Transform-based video coding method and device
The video coding method improves efficiency and reduces data loss by employing multiple transform selection and high frequency zeroing techniques for high-resolution and immersive media, addressing the need for cost-effective compression of high-quality video content.
Patent Information
- Application Number
- JP2023172611
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-08-08
- Filing Date
- 2023-10-04
- Publication Date
- 2024-11-07
- Estimated Expiration
- 2040-08-07
AI Technical Summary
The increasing demand for high-resolution, high-quality images and immersive media such as VR and AR content necessitates highly efficient video compression technologies to reduce transmission and storage costs while minimizing data loss during high frequency zeroing processes.
A video coding method and apparatus that employs multiple transform selection (MTS) and high frequency zeroing techniques, including deriving transform coefficients based on residual information and applying sub-block transforms to improve coding efficiency and reduce data loss.
The method enhances overall video compression efficiency, increases residual coding efficiency, and reduces data loss by utilizing multiple transform kernels and zero-out blocks to optimize transform coefficient processing.
Smart Images

Figure 0007579409000033 
Figure 0007579409000034 
Figure 0007579409000035
Abstract
Description
[Technical field]
[0001] This document relates to video coding technology, and more particularly to a transform-based video coding method and apparatus in a video coding system. [Background technology]
[0002] Recently, the demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the image / video data has higher resolution and quality, the amount of information or bits transmitted relatively increases compared to existing image / video data, so when image data is transmitted using existing media such as wired or wireless broadband lines or when image / video data is stored using existing storage media, the transmission and storage costs increase.
[0003] In addition, interest and demand for immersive media such as virtual reality (VR), artificial reality (AR) content and holograms has been increasing recently, and the broadcast of images / videos with different image characteristics from real images, such as game images, is increasing.
[0004] Therefore, in order to effectively compress, transmit, store, and play back high-resolution, high-quality image / video information having the above-mentioned various characteristics, a highly efficient image / video compression technology is required. Summary of the Invention [Problem to be solved by the invention]
[0005] The technical problem of this document is to provide a method and apparatus for increasing video coding efficiency.
[0006] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of residual coding.
[0007] Another technical problem of this document is to provide a method and apparatus for coding transform coefficients based on high frequency zeroing to improve residual coding efficiency.
[0008] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of video coding that performs high frequency zeroing based on multiple transform selection.
[0009] Another technical object of the present invention is to provide a method and apparatus for video coding capable of reducing data loss when high frequency zeroing is performed.
[0010] Another technical objective of this document is to provide a method and apparatus for deriving a context model for last valid transform coefficient position information based on the current block size when coding transform coefficients for a current block (or a current transform block) based on high frequency zeroing. [Means for solving the problem]
[0011] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including deriving transform coefficients for a current block based on residual information, the residual information including first flag information indicating whether a sub-block transform for dividing a coding unit and performing a transform is applied to the current block, and deriving the transform coefficients includes deriving a zero-out block indicating an area where valid transform coefficients in the current block can exist, based on whether a Multiple Transform Selection (MTS) in which multiple transform kernels are used is applied to the current block if the first flag information is 1.
[0012] If the multiple transform selection is applied, the width or height of the zero-out block is set to 16, and if the multiple transform selection is not applied, the width or height of the zero-out block is set to 32 or less.
[0013] The first flag information is signaled at a coding unit level.
[0014] Whether the multiple transform selection is applied to the current block is determined based on second flag information indicating whether the multiple transform selection is applied to the current block, and the second flag information is signaled at a sequence parameter set level.
[0015] If the height of a divided sub-block is less than 64 and the width of the sub-block is 32, the width of the zero-out block is set to 16, and if the width of the sub-block is less than 64 and the height of the sub-block is 32, the height of the zero-out block is set to 16.
[0016] The transformation kernel is derived based on the division direction of the current block and the position of the sub-block to which the transformation is applied.
[0017] The zero-out block is derived for the luma component of the current block.
[0018] According to an embodiment of the present document, there is provided a video encoding method performed by an encoding device, the method including the steps of deriving transform coefficients based on residual samples, and encoding residual information including information on the transform coefficients, the deriving transform coefficients including the step of deriving a zero-out block indicating an area where valid transform coefficients in the current block can exist, based on whether a Multiple Transform Selection (MTS) in which multiple transform kernels are used is applied to the current block, when a sub-block transform that divides a coding unit and performs a transform is applied to the current block, and the encoding of the residual information including the step of encoding first flag information indicating whether the sub-block transform is applied.
[0019] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding apparatus.
[0020] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream that enables a decoding device to perform the video decoding method. Effect of the Invention
[0021] According to the document, it can improve the overall image / video compression efficiency.
[0022] According to the present disclosure, the efficiency of residual coding can be increased.
[0023] According to the present disclosure, the efficiency of residual coding can be improved by coding transform coefficients based on high frequency zeroing.
[0024] In accordance with the present disclosure, video coding efficiency can be increased by performing high frequency zeroing based on multiple transform selection.
[0025] According to the present disclosure, when high frequency zeroing is performed, data loss can be reduced and video coding efficiency can be increased.
[0026] Effects that can be obtained through a specific example of the present specification are not limited to the effects listed above. For example, there may be various technical effects that a person having ordinary skill in the related art can understand or derive from the present specification. Thus, the specific effects of the present specification are not limited to those explicitly described in the present specification, but may include various effects that can be understood or derive from the technical features of the present specification. [Brief description of the drawings]
[0027] [Figure 1] 1 illustrates generally an example of a video / image coding system to which this document can be applied; [Diagram 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied. [Diagram 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied. [Figure 4] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. [Diagram 5] 1 illustrates a schematic of a multiple conversion technique according to one embodiment of the present document; [Figure 6] An intra-directional mode with 65 prediction directions is shown as an example. [Figure 7] FIG. 1 is a diagram for explaining a RST according to one embodiment of this document. [Figure 8]FIG. 1 is a diagram for explaining MTS applied to sub-block transform according to an example of this document. [Figure 9] FIG. 1 illustrates a 32-point zero-out applied to a sub-block transform according to an example of the present document. [Figure 10] 1 is a flow chart illustrating the operation of a video decoding device according to one embodiment of the present document. [Figure 11] 1 is a flow diagram illustrating a process of deriving transform coefficients by a video decoding device according to an embodiment of the present document. [Figure 12] 1 is a flow chart illustrating the operation of a video encoding device according to an embodiment of the present document. [Figure 13] 1 is a flow diagram illustrating a transform coefficient and information encoding process according to one embodiment of the present document. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0028] This document may have various modifications and may have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to a specific embodiment. The terms used in this specification are merely used to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" or "have" specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0029] Meanwhile, each component in the drawings described in this document is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components among the components may be combined to form one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the rights of this document as long as it does not deviate from the essence of this document.
[0030] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following, the same reference numerals are used for the same components in the drawings, and duplicated descriptions of the same components will be omitted.
[0031] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be associated with the Versatile Video Coding (VVC) standard (ITU-T Rec. H.266), a next-generation video / image coding standard beyond VVC, or other video coding related standards (e.g., the High Efficiency Video Coding (HEVC) standard (ITU-T Rec. H.265), the essential video coding (EVC) standard, the AVS2 standard, etc.).
[0032] This document presents various embodiments for video / image coding, which embodiments may also be implemented in combination with each other, unless otherwise stated.
[0033] In this document, video may refer to a collection of a series of images over time. A picture generally refers to a unit that indicates one image at a specific time, and a slice / tile is a unit that constitutes a part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). One picture may be composed of one or more slices / tiles. One picture may be composed of one or more tile groups. One tile group may include one or more tiles.
[0034] A pixel or a pel may refer to the smallest unit constituting one picture (or image). A term corresponding to a pixel may also be used as a "sample." A sample may generally refer to a pixel or a pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. Alternatively, a sample may refer to a pixel value in the spatial domain, or may refer to a transform coefficient in the frequency domain when such a pixel value is transformed into the frequency domain.
[0035] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used interchangeably with terms such as block or area depending on the case. In a general case, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0036] In this document, the terms " / " and "," should be interpreted to indicate "and / or." For instance, "A / B" is interpreted as "A and / or B," and "A,B" is interpreted as "A and / or B." Additionally, "A / B / C" means "at least one of A, B, and / or C." Also, "A,B,C" means "at least one of A, B, and / or C." (In this document, the term " / " and "," should be interpreted to indicate "and / or." For instance, the expression "A / B" may mean "A and / or B." Further, "A,B" may mean "A and / or B." Further, "A / B / C" may mean "at least one of A,B,and / or C." Also, "A / B / C" may mean "at least one of A,B,and / or C.")
[0037] Additionally, in this document, the term "or" should be interpreted to indicate "and / or." For example, "A or B" may comprise 1) only A, 2) only B, or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively."
[0038] In this specification, "at least one of A and B" can mean "only A," "only B," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted as "at least one of A and B."
[0039] In addition, in this specification, "at least one of A, B and C" can mean "only A," "only B," "only C," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" or "at least one of A, B and / or C" can mean "at least one of A, B and C."
[0040] Furthermore, parentheses used in the present specification may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction." In other words, "prediction" in the present specification is not limited to "intra prediction," and "intra prediction" is proposed as an example of "prediction." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction."
[0041] In this specification, technical features individually described in one drawing may be embodied individually or simultaneously.
[0042] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system to which this document can be applied.
[0043] Referring to Figure 1, the video / image coding system may include a source device and a receiving device. The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.
[0044] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.
[0045] A video source may acquire video / images through a video / image capture, synthesis, or generation process. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated via a computer, etc., in which case the video / image capture process may be replaced by a process in which related data is generated.
[0046] An encoding device may encode an input video / image. The encoding device may perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) may be output in the form of a bitstream.
[0047] The transmitting unit can transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit can include elements for generating a media file through a predetermined file format and can include elements for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.
[0048] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction that correspond to the operations of the encoding device.
[0049] The renderer may render the decoded video / image, and the rendered video / image may be displayed via a display unit.
[0050] 2 is a diagram for briefly explaining the configuration of a video / image encoding device to which this document can be applied. Hereinafter, the video encoding device may include an image encoding device.
[0051] Referring to FIG. 2, the encoding apparatus 200 may include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured with one or more hardware components (e.g., an encoder chip set or a processor) according to an embodiment. Also, the memory 270 may include a decoded picture buffer (DPB) and may be configured with a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.
[0052] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document may be performed based on a final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.The prediction unit is a unit of sample prediction, and the transform unit is a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0053] The unit may be used interchangeably with terms such as block or area. In general, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, or may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of a picture (or image).
[0054] The subtraction unit 231 may subtract a prediction signal (predicted block, prediction sample, or prediction sample array) output from the prediction unit 220 from an input image signal (original block, original sample, or original sample array) to generate a residual signal (residual block, residual sample, or residual sample array), and the generated residual signal is transmitted to the conversion unit 232. The prediction unit 220 may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit 220 may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as described below in the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0055] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block by using the prediction modes applied to the neighboring blocks.
[0056] The inter prediction unit 221 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. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of a block, a sub-block, or a sample based on the correlation of the motion information between a neighboring block 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 block may include a spatial neighboring block present in the current picture and a temporal neighboring block 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 221 may generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal is not transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0057] The prediction unit 220 may generate a prediction signal based on various prediction methods described below. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The prediction unit may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document.
[0058] The prediction signal generated through the inter prediction unit 221 and / or the intra prediction unit 222 may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include a discrete cosine transform (DCT), a discrete sine transform (DST), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to non-square variable-size blocks.
[0059] The quantization unit 233 quantizes the transform coefficients and transmits them to the entropy encoding unit 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantization unit 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoding unit 240 may also encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / image information may further include general constraint information. Signaling / transmitted information and / or syntax elements described later in this document may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital storage medium, where the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding apparatus 200, or the transmitter may be included in the entropy encoding unit 240.
[0060] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample, or reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the predictor 220. If there is no residual for the current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering as described below.
[0061] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or restoration.
[0062] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset (SAO), an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit it to the entropy encoding unit 240, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0063] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter predictor 221. When inter prediction is applied through this, the encoding apparatus can avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus, and can also improve encoding efficiency.
[0064] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 222.
[0065] FIG. 3 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.
[0066] Referring to FIG. 3, the decoding device 300 may include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 332 and an intra predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0067] When a bitstream including video / image information is input, the decoding apparatus 300 can restore an image corresponding to a process in which the video / image information is processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied in the encoding apparatus. Thus, the processing unit for decoding is, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. And, the restored image signal decoded and output by the decoding apparatus 300 can be reproduced by a reproduction device.
[0068] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding apparatus may decode a picture further based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be obtained from the bitstream by being decoded via the decoding procedure. For example, the entropy decoding unit 310 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in a bitstream, determine a context model using information on a syntax element to be decoded and decoding information of adjacent and to-be-decoded blocks or information on symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element.In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Prediction information from the information decoded by the entropy decoding unit 310 may be provided to the prediction unit 330, and information on the residual on which the entropy decoding is performed by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 321. In addition, filtering information from the information decoded by the entropy decoding unit 310 may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to the present document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.
[0069] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding apparatus. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0070] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0071] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0072] The predictor may generate a prediction signal based on various prediction methods described below. For example, the predictor may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document.
[0073] The intra prediction unit 331 may predict a current block by referring to samples in a current picture. The referenced samples may be located in a neighbor of the current block or may be located far away depending on a prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block by using a prediction mode applied to a neighboring block.
[0074] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on 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 may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. For example, the inter prediction unit 332 may configure a motion information candidate list based on the neighboring blocks, and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.
[0075] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to the prediction signal (predicted block, predicted sample array) output from the prediction unit 330. When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block.
[0076] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in a current picture, may be output after filtering as described below, or may be used for inter prediction of a next picture.
[0077] Meanwhile, luma mapping with chroma scaling (LMCS) can be applied during the picture decoding process.
[0078] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.
[0079] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter prediction unit 332. The memory 360 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 332 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.
[0080] In this specification, the embodiments described for the prediction unit 330, inverse quantization unit 321, inverse transform unit 322, and filtering unit 350 of the decoding device 300 can be applied identically or correspondingly to the prediction unit 220, inverse quantization unit 234, inverse transform unit 235, and filtering unit 260 of the encoding device 200, respectively.
[0081] As described above, prediction is performed to improve compression efficiency when performing video coding. Through this, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in a spatial domain (or a pixel domain). The predicted block is derived in the same manner by an encoding device and a decoding device, and the encoding device can improve video coding efficiency by signaling information (residual information) on the residual between the original block and the predicted block, which is not an original sample value of the original block, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.
[0082] The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between the original block and the predicted block, perform a transform procedure on the residual samples (residual sample array) included in the residual block to derive transform coefficients, perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and signal the associated residual information (through a bitstream) to the decoding apparatus. Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding apparatus may derive a residual sample (or a residual block) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. Also, the encoding apparatus may derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a future picture, and generate a reconstructed picture based on the residual block.
[0083] FIG. 4 exemplarily shows a structural diagram of a content streaming system to which this document applies.
[0084] Furthermore, the content streaming system to which this document applies may include to a large extent encoding servers, streaming servers, web servers, media stores, user devices, and multimedia input devices.
[0085] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted. The bitstream may be generated by an encoding method or a bitstream generation method to which this document is applied, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0086] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.
[0087] The streaming server can receive content from a media repository and / or an encoding server. For example, when the content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.
[0088] Examples of the user devices 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, etc. Each server in the content streaming system may be operated as a distributed server, and in this case, data received by each server may be processed in a distributed manner.
[0089] FIG. 5 illustrates a schematic of the multiple conversion technique according to this document.
[0090] Referring to FIG. 5, the transform unit may correspond to the transform unit in the encoding device of FIG. 2 described above, and the inverse transform unit may correspond to the inverse transform unit in the encoding device of FIG. 2 described above or the inverse transform unit in the decoding device of FIG. 3.
[0091] The transform unit may perform a primary transform based on the residual samples (residual sample array) in the residual block to derive (primary) transform coefficients (S510). Such a primary transform may be called a core transform. Here, the primary transform may be based on Multiple Transform Selection (MTS), and when multiple transforms are applied as the primary transform, it may be called a multiple core transform.
[0092] The multi-kernel transform may refer to a method of transforming by additionally using a Discrete Cosine Transform (DCT) type 2 and a Discrete Sine Transform (DST) type 7, DCT type 8, and / or DST type 1. That is, the multi-kernel transform may refer to a transform method of transforming a residual signal (or a residual block) in a spatial domain into a transform coefficient (or a first transform coefficient) in a frequency domain based on a plurality of transform kernels selected from the DCT type 2, the DST type 7, the DCT type 8, and the DST type 1. Here, the first transform coefficient may be called a temporary transform coefficient from the perspective of a transform unit.
[0093] That is, when the existing transform method is applied, a transform coefficient can be generated by applying a spatial domain to frequency domain transform to the residual signal (or residual block) based on DCT type 2. In contrast, when the multi-kernel transform is applied, a transform coefficient (or primary transform coefficient) can be generated by applying a spatial domain to frequency domain transform to the residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, etc. Here, DCT type 2, DST type 7, DCT type 8, DST type 1, etc. can be called a transform type, a transform kernel, or a transform core. Such DCT / DST transform types can be defined based on basis functions.
[0094] When the multi-kernel transform is performed, a vertical transform kernel and a horizontal transform kernel for a current block may be selected from the transform kernels, and a vertical transform for the current block may be performed based on the vertical transform kernel, and a horizontal transform for the current block may be performed based on the horizontal transform kernel. Here, the horizontal transform may indicate a transform for a horizontal component of the current block, and the vertical transform may indicate a transform for a vertical component of the current block. The vertical transform kernel / horizontal transform kernel may be adaptively determined based on a prediction mode and / or a transform index of a current block (CU or sub-block) including a residual block.
[0095] In addition, according to one example, when a first-order transformation is performed by applying MTS, a specific basis function is set to a predetermined value, and when it is a vertical transformation or horizontal transformation, a mapping relationship for the transformation kernel can be set by combining what basis function is applied. For example, when a horizontal transformation kernel is represented by trTypeHor and a vertical transformation kernel is represented by trTypeVer, a trTypeHor or trTypeVer value of 0 can be set to DCT2, a trTypeHor or trTypeVer value of 1 can be set to DST7, and a trTypeHor or trTypeVer value of 2 can be set to DCT8.
[0096] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a number of transformation kernel sets. For example, if the MTS index is 0, it may indicate that both the trTypeHor and trTypeVer values are 0, if the MTS index is 1, it may indicate that both the trTypeHor and trTypeVer values are 1, if the MTS index is 2, it may indicate that the trTypeHor value is 2 and the trTypeVer value is 1, if the MTS index is 3, it may indicate that the trTypeHor value is 1 and the trTypeVer value is 2, and if the MTS index is 4, it may indicate that both the trTypeHor and trTypeVer values are 2.
[0097] As an example, a conversion kernel set according to MTS index information is shown in the table below.
[0098] [Table 1]
[0099] The transform unit may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S520). The primary transform is a transform from a spatial domain to a frequency domain, and the secondary transform refers to a transform into a more compressed representation using a correlation existing between the (primary) transform coefficients. The secondary transform may include a non-separable transform. In this case, the secondary transform may be called a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform may refer to a transform in which the (primary) transform coefficients derived through the primary transform are secondary transformed based on a non-separable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for a residual signal. Here, the non-separable transform matrix can be used to apply a transform to the (first-order) transform coefficients at once, without separating the vertical transform and the horizontal transform (or independently applying the horizontal-vertical transform). That is, the non-separable second-order transform does not separate the vertical and horizontal components of the (first-order) transform coefficients, but may refer to a transform method in which, for example, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal in a specific direction (for example, a row-first direction or a column-first direction) and then a modified transform coefficient (or a second-order transform coefficient) is generated based on the non-separable transform matrix. For example, the row-first order is to arrange the first row, the second row, ..., the Nth row in a row for an M×N block, and the column-first order is to arrange the first column, the second column, ..., the Mth column in a row for an M×N block. The non-separable secondary transform may be applied to a top-left region of a block composed of (first-order) transform coefficients (hereinafter, may be referred to as a transform coefficient block).For example, if the width (W) and height (H) of the transform coefficient block are both 8 or more, an 8×8 non-separable secondary transform may be applied to the upper left 8×8 region of the transform coefficient block. Also, if the width (W) and height (H) of the transform coefficient block are both 4 or more, and the width (W) or height (H) of the transform coefficient block is less than 8, a 4×4 non-separable secondary transform may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if only the condition that the width (W) or height (H) of the transform coefficient block is both 4 or more is satisfied, a 4×4 non-separable secondary transform may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block.
[0100] Specifically, for example, if a 4×4 input block is used, the non-separable quadratic transform can be performed as follows:
[0101] The 4×4 input block X is denoted as follows:
[0102]
number
[0103] When the X is expressed in vector form, the vector JPEG0007579409000003.jpg14106 is shown as follows:
[0104]
number
[0105] As shown in Equation 2, the vector JPEG0007579409000005.jpg12114 rearranges the two-dimensional block of X in Equation 1 into a one-dimensional vector in row-first order.
[0106] In this case, the second-order non-separable transform can be computed as follows:
[0107]
number
[0108] Where: JPEG0007579409000007.jpg12102 denotes the transform coefficient vector, and T denotes the 16×16 (non-separable) transform matrix.
[0109] The 16×1 transform coefficient vector JPEG0007579409000008.jpg12102 can be derived, JPEG0007579409000009.jpg11104 can be re-organized into 4x4 blocks via the scan order (horizontal, vertical, diagonal, etc.). However, the above calculations are merely examples, and in order to reduce the computational complexity of the non-separable quadratic transform, a Hypercube-Givens Transform (HyGT) or the like can be used to calculate the non-separable quadratic transform.
[0110] Meanwhile, the non-separable secondary transform may be a mode-dependent transform kernel (or transform core, transform type), where the mode may include an intra-prediction mode and / or an inter-prediction mode.
[0111] As described above, the non-separable secondary transform may be performed based on an 8×8 transform or a 4×4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8×8 transform refers to a transform that may be applied to an 8×8 region contained within the corresponding transform coefficient block when W and H are both greater than or equal to 8, and the corresponding 8×8 region is the upper left 8×8 region within the corresponding transform coefficient block. Similarly, the 4×4 transform refers to a transform that may be applied to a 4×4 region contained within the corresponding transform coefficient block when W and H are both greater than or equal to 4, and the corresponding 4×4 region is the upper left 4×4 region within the corresponding transform coefficient block. For example, the 8×8 transform kernel matrix may be a 64×64 / 16×64 matrix, and the 4×4 transform kernel matrix may be a 16×16 / 8×16 matrix.
[0112] At this time, for mode-based transform kernel selection, two non-separable quadratic transform kernels may be configured per transform set for non-separable quadratic transform for both 8×8 transform and 4×4 transform, and the number of transform sets is four. That is, four transform sets may be configured for 8×8 transform, and four transform sets may be configured for 4×4 transform. In this case, each of the four transform sets for 8×8 transform may include two 8×8 transform kernels, and each of the four transform sets for 4×4 transform may include two 4×4 transform kernels.
[0113] However, the size of the transform, i.e., the size of the region to which the transform is applied, is merely an example and sizes other than 8x8 or 4x4 can be used, the number of sets is n, and the number of transform kernels in each set is k.
[0114] The transform set may be referred to as an NSST set or an LFNST set. The selection of a particular set from the transform set may be performed based on, for example, an intra prediction mode of a current block (CU or sub-block). LFNST (Low-Frequency Non-Separable Transform) is an example of a reduced non-separable transform, which will be described later, and indicates a non-separable transform for low-frequency components.
[0115] For reference, for example, the intra prediction modes may include two non-directional (non-angular) intra prediction modes and 65 directional (angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 to 66. However, this is merely an example, and the present document may be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, a 67th intra prediction mode may be further used, and the 67th intra prediction mode may indicate a linear model (LM) mode.
[0116] FIG. 6 exemplarily shows intra-directional modes of 65 prediction directions.
[0117] Referring to FIG. 6, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality may be distinguished with respect to the 34th intra prediction mode having a right-down diagonal prediction direction. H and V in FIG. 6 respectively mean horizontal directionality and vertical directionality, and the numbers from -32 to 32 indicate a displacement of 1 / 32 units on a sample grid position. This may indicate an offset for a mode index value. The 2nd to 33rd intra prediction modes have horizontal directionality, and the 34th to 66th intra prediction modes have vertical directionality. Meanwhile, the 34th intra prediction mode may be considered to be neither horizontal nor vertical in the strict sense, but may be classified as belonging to horizontal directionality in terms of determining a transformation set for a secondary transformation. This is because input data is transposed and used for vertical modes symmetrical with respect to the 34th intra prediction mode, and an input data alignment method for horizontal modes is used for the 34th intra prediction mode. Transposing the input data means that rows become columns and columns become rows for 2D block data M×N to form N×M data. The 18th intra prediction mode and the 50th intra prediction mode indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and the 2nd intra prediction mode can be called an upper right diagonal intra prediction mode because it predicts in an upper right direction using a left reference pixel. In the same vein, the 34th intra prediction mode can be called a lower right diagonal intra prediction mode, and the 66th intra prediction mode can be called a lower left diagonal intra prediction mode.
[0118] As an example, the mapping of four transform sets according to intra prediction modes is shown in the following table.
[0119] [Table 2]
[0120] As shown in Table 2, depending on the intra prediction mode, one of four transform sets, i.e., lfnstTrSetIdx can be mapped to one of 0 to 3, i.e., one of four.
[0121] Meanwhile, when it is determined that a specific set is used for non-separable transform, one of k transform kernels in the specific set may be selected through a non-separable secondary transform index. The encoding apparatus may derive a non-separable secondary transform index that indicates a specific transform kernel based on a rate-distortion (RD) check, and may signal the non-separable secondary transform index to a decoding apparatus. The decoding apparatus may select one of k transform kernels in the specific set based on the non-separable secondary transform index. For example, an lfnst index value 0 may indicate a first non-separable secondary transform kernel, an lfnst index value 1 may indicate a second non-separable secondary transform kernel, and an lfnst index value 2 may indicate a third non-separable secondary transform kernel. Alternatively, an lfnst index value 0 may indicate that a first non-separable secondary transform is not applied to a current block, and lfnst index values 1 to 3 may indicate the three transform kernels.
[0122] The transform unit may perform the non-separable quadratic transform based on a selected transform kernel to obtain modified (quadrature) transform coefficients. The modified transform coefficients may be derived as quantized transform coefficients through a quantizer as described above, and may be encoded and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in the encoding device.
[0123] On the other hand, as described above, when the secondary transform is omitted, the (primary) transform coefficients, which are the output of the primary (separate) transform, can be derived as quantized transform coefficients through a quantization unit as described above, and can be encoded and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit within the encoding device.
[0124] The inverse transform unit may perform a series of steps in the reverse order of the steps performed by the transform unit described above. The inverse transform unit may receive (dequantized) transform coefficients, perform a secondary (inverse) transform to derive (primary) transform coefficients (S550), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S560). Here, the primary transform coefficients may be called modified transform coefficients from the inverse transform unit's perspective. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.
[0125] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element for determining whether to apply the secondary inverse transform) and a secondary inverse transform determining unit (or an element for determining the secondary inverse transform). The secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform. For example, the secondary inverse transform may be NSST, RST or LFNST, and the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a secondary transform flag parsed from the bitstream. As another example, the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a transform coefficient of a residual block.
[0126] The secondary inverse transform decision unit may determine a secondary inverse transform. At this time, the secondary inverse transform decision unit may determine a secondary inverse transform to be applied to a current block based on an LFNST (NSST or RST) transform set designated according to an intra prediction mode. In addition, as an embodiment, a secondary transform decision method may be determined depending on a primary transform decision method. Various combinations of a primary transform and a secondary transform may be determined according to an intra prediction mode. In addition, as an example, the secondary inverse transform decision unit may determine an area to which a secondary inverse transform is applied based on a size of a current block.
[0127] Meanwhile, as described above, when the second (inverse) transform is omitted, a residual block (residual sample) can be obtained by receiving (dequantized) transform coefficients and performing the first (separate) inverse transform. As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.
[0128] Meanwhile, in this paper, in order to reduce the computational complexity and memory requirements due to non-separable secondary transform, RST (reduced secondary transform) can be applied, in which the size of the transformation matrix (kernel) is reduced based on the concept of NSST.
[0129] Meanwhile, coefficients constituting the transformation kernel, transformation matrix, and transformation kernel matrix described in this document, i.e., kernel coefficients or matrix coefficients, can be expressed in 8 bits. This is one condition for implementation in a decoding device and an encoding device, and it is possible to reduce the memory requirement for storing the transformation kernel with a reasonably acceptable performance degradation compared to the existing 9 bits or 10 bits. In addition, by expressing the kernel matrix in 8 bits, a small multiplier can be used, and it is more compatible with SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.
[0130] In this specification, RST may refer to a transformation performed on residual samples for a target block based on a transform matrix whose size is reduced by a simplification factor. When performing a simplified transformation, the amount of calculations required during transformation can be reduced due to the reduction in the size of the transform matrix. That is, RST can be used to solve the problem of complexity that occurs during transformation of a large block or non-separable transformation.
[0131] The RST may be called by various terms such as a reduced transform, a reduced secondary transform, a reduction transform, a simplified transform, a simple transform, etc., and the name of the RST is not limited to the listed examples. Alternatively, the RST may be called a Low-Frequency Non-Separable Transform (LFNST) since it is mainly performed in a low-frequency domain including non-zero coefficients in a transform block. The transform index may be named an LFNST index.
[0132] Meanwhile, when the second inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 300 may include an inverse RST unit for deriving modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit for deriving residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to an inverse transform of a linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.
[0133] FIG. 7 is a diagram for explaining a RST according to an embodiment of this document.
[0134] In this specification, a "target block" may refer to a current block, a residual block, or a transformed block on which coding is performed.
[0135] In an RST according to an embodiment, an N-dimensional vector may be mapped to an R-dimensional vector located in a different space to determine a reduced transformation matrix, where R is smaller than N. N may represent the square of the length of one side of a block to which a transformation is applied or the total number of transformation coefficients corresponding to a block to which a transformation is applied, and the simplification factor may represent an R / N value. The simplification factor may be referred to by various terms such as a reduced factor, a reduction factor, a simplified factor, and a simple factor. Meanwhile, R may be referred to as a reduced coefficient, but in some cases, the simplification factor may represent R. In addition, in some cases, the simplification factor may represent an N / R value.
[0136] In one embodiment, the simplification factors or simplification coefficients may be signaled via a bitstream, but the embodiment is not limited thereto. For example, predefined values for the simplification factors or simplification coefficients may be stored in each of the encoding apparatus 200 and the decoding apparatus 300, in which case the simplification factors or simplification coefficients are not separately signaled.
[0137] The size of the simplified transformation matrix according to an embodiment is R×N, which is smaller than the size N×N of the normal transformation matrix, and can be defined as Equation 4 below.
[0138]
number
[0139] The matrix T in the Reduced Transform block shown in FIG. 7(a) is the matrix T in Equation 4. R×N As shown in FIG. 7(a), the simplified transformation matrix T R×N When multiplied by, the transform coefficients for the current block can be derived.
[0140] In one embodiment, if the size of the block to which the transform is applied is 8×8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to Fig. 7(a) can be expressed by a matrix operation as shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced to approximately 1 / 4 due to the simplification factor.
[0141] In this document, a matrix operation may be understood as an operation in which a matrix is placed to the left of a column vector to multiply the matrix and the column vector to obtain the column vector.
[0142]
number
[0143] In Formula 5, r 1 〜r 64 may represent a residual sample for the target block, and more specifically, is a transform coefficient generated by applying a linear transform. As a result of the calculation of Equation 5, the transform coefficient c i can be derived, c i The derivation process is as shown in Equation 6.
[0144]
number
[0145] The calculation result of Equation 6, the conversion coefficient c for the target block 1 ~c R That is, when R=16, the transform coefficient c 1 ~c 16 can be derived. If a regular transform, instead of the RST, is applied and a transform matrix of size 64×64 (N×N) is multiplied to residual samples of size 64×1 (N×1), 64 (N) transform coefficients for the current block are derived, but since the RST is applied, only 16 (R) transform coefficients for the current block are derived. Since the total number of transform coefficients for the current block is reduced from N to R, the amount of data transmitted from the encoding apparatus 200 to the decoding apparatus 300 is reduced, and therefore the transmission efficiency between the encoding apparatus 200 and the decoding apparatus 300 can be increased.
[0146] Considering the size of the transformation matrix, the size of the normal transformation matrix is 64x64 (NxN), while the size of the simplified transformation matrix is reduced to 16x64 (RxN), so compared to performing normal transformation, memory usage can be reduced to the ratio R / N when performing RST. Also, compared to the number of multiplications NxN when using the normal transformation matrix, when using the simplified transformation matrix, the number of multiplications can be reduced to the ratio R / N (RxN).
[0147] In one embodiment, the transform unit 232 of the encoding apparatus 200 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on the residual samples for the current block. Such transform coefficients may be transmitted to an inverse transform unit of the decoding apparatus 300, and the inverse transform unit 322 of the decoding apparatus 300 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and derive residual samples for the current block based on an inverse primary transform for the modified transform coefficients.
[0148] Inverse RST matrix T according to one embodiment N×R The size of the simplified transformation matrix T R×N It is in a transpose relationship with.
[0149] The matrix T in the Reduced Inv. Transform block shown in (b) of Figure 7 t is the inverse RST matrix T R×N T (The superscript T means transpose.) As shown in FIG. 7(b), the inverse RST matrix T R×N T When the inverse RST matrix T is multiplied, modified transform coefficients for the current block or residual samples for the current block can be derived. R×N T is (T R×N ) T N×R It can also be expressed as:
[0150] More specifically, when the inverse RST is applied as the secondary inverse transform, the inverse RST matrix T R×N TAlternatively, an inverse RST may be applied as an inverse linear transform, in which case the inverse RST matrix T R×N T Once multiplied by, the residual sample for the current block can be derived.
[0151] In one embodiment, when the size of the block to which the inverse transform is applied is 8×8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (b) of FIG. 7 can be expressed by a matrix operation as shown in Equation 7 below.
[0152]
number
[0153] In formula 7, c 1 ~c 16 The result of the operation of Equation 7 is a modified transform coefficient for the target block or a residual sample for the target block, r i can be derived, and r i The derivation process is as shown in Equation 8.
[0154]
number
[0155] The result of the calculation of Equation 8 is r, which indicates the modified transform coefficient for the target block or the residual sample for the target block. 1 〜r Ncan be derived. Considering the size of the inverse transformation matrix, the size of the normal inverse transformation matrix is 64×64 (N×N), and the size of the simplified inverse transformation matrix is reduced to 64×16 (N×R), so compared to performing normal inverse transformation, memory usage can be reduced to a ratio of R / N when performing inverse RST. Also, compared to the number of multiplication operations N×N when using the normal inverse transformation matrix, the number of multiplication operations can be reduced to a ratio of R / N when using the simplified inverse transformation matrix (N×R).
[0156] Meanwhile, the transform set configuration as shown in Table 2 may be applied to the 8×8 RST. That is, the corresponding 8×8 RST may be applied according to the transform set in Table 2. Since one transform set is composed of two or three transforms (kernels) according to the prediction mode in the screen, it may be configured to select one from up to four transforms including not applying the secondary transform. When the secondary transform is not applied, the transform may be considered to be applied with an identity matrix. When the four transforms are assigned indexes 0, 1, 2, and 3 (for example, the 0th index may be assigned as an identity matrix, i.e., when the secondary transform is not applied), the transform to be applied may be specified by signaling a syntax element called a transform index or an lfnst index for each transform coefficient block. That is, for an 8×8 upper left block, an 8×8 RST may be specified in the RST configuration through the transform index, or an 8×8 lfnst may be specified when LFNST is applied. The 8×8 lfnst and 8×8 RST refer to a transform that can be applied to an 8×8 region contained within a corresponding transform coefficient block when W and H of a target block to be transformed are both greater than or equal to 8, and the corresponding 8×8 region is the upper left 8×8 region within the corresponding transform coefficient block. Similarly, the 4×4 lfnst and 4×4 RST refer to a transform that can be applied to a 4×4 region contained within a corresponding transform coefficient block when W and H of a target block are both greater than or equal to 4, and the corresponding 4×4 region is the upper left 4×4 region within the corresponding transform coefficient block.
[0157] Meanwhile, according to an embodiment of the present document, in the conversion of the encoding process, a maximum 16×48 conversion kernel matrix can be applied by selecting only 48 data, not a 16×64 conversion kernel matrix, for 64 data constituting an 8×8 region. Here, "maximum" means that the maximum value of m is 16 for an m×48 conversion kernel matrix capable of generating m coefficients. That is, when RST is performed by applying an m×48 conversion kernel matrix (m≦16) to an 8×8 region, m coefficients can be generated by receiving 48 data. When m is 16, 16 coefficients are generated by receiving 48 data. That is, when 48 data constitute a 48×1 vector, a 16×1 vector can be generated by multiplying a 16×48 matrix and a 48×1 vector in sequence. In this case, a 48×1 vector can be configured by appropriately arranging 48 data constituting an 8×8 region. For example, a 48×1 vector can be configured based on 48 data constituting a region excluding the lower right 4×4 region of the 8×8 region. In this case, when a matrix operation is performed by applying a maximum 16x48 transformation kernel matrix, 16 modified transformation coefficients are generated, and the 16 modified transformation coefficients can be arranged in the upper left 4x4 area according to the scanning order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.
[0158] A transposed matrix of the above-described transformation kernel matrix can be used for the inverse transformation of the decoding process. That is, when the inverse RST or LFNST is performed as the inverse transformation process performed in the decoding device, the input coefficient data to which the inverse RST is applied is composed of one-dimensional vectors in a predetermined arrangement order, and the modified coefficient vectors obtained by multiplying the one-dimensional vectors by the corresponding inverse RST matrix on the left side can be arranged in two-dimensional blocks in a predetermined arrangement order.
[0159] In summary, when RST or LFNST is applied to an 8×8 region in the transformation process, a matrix operation is performed between 48 transform coefficients in the upper left, upper right, and lower left regions of the 8×8 region, excluding the lower right region, and a 16×48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input in a one-dimensional array. When such a matrix operation is performed, 16 modified transform coefficients are derived, and the modified transform coefficients may be arranged in the upper left region of the 8×8 region.
[0160] Conversely, when the inverse RST or LFNST is applied to an 8×8 region in the inverse transform process, 16 transform coefficients corresponding to the upper left corner of the 8×8 region among the transform coefficients of the 8×8 region are input in a one-dimensional array form according to the scanning order and may be subjected to a matrix operation with a 48×16 transform kernel matrix. That is, the matrix operation in this case may be expressed as (48×16 matrix)*(16×1 transform coefficient vector)=(48×1 modified transform coefficient vector). Here, an n×1 vector may be interpreted as an n×1 matrix, and therefore may be expressed as an n×1 column vector. Also, * means a matrix multiplication operation. When such a matrix operation is performed, 48 modified transform coefficients may be derived, and the 48 modified transform coefficients may be arranged in the upper left corner, upper right corner, and lower left corner regions excluding the lower right corner region of the 8×8 region.
[0161] Meanwhile, when the secondary inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 300 may include an inverse RST unit for deriving modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit for deriving residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to an inverse transform of a linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.
[0162] Meanwhile, a reduced adaptive multiple transform selection (or set) (RMTS) technique will be described below.
[0163] As described above, when a combination of various transforms (DCT2, DST7, DCT8, DST1, DCT5, etc.) is selectively used for the primary transform in the multiple transform technique (Multiple Transform Set or Adaptive Multiple Transform), the complexity for the worst case can be significantly reduced by applying the transform only to a predefined region rather than performing the transform for all cases to reduce the complexity.
[0164] For example, when a linear transform is applied to a pixel block of size M×M based on the reduced transform (RT) method already mentioned, instead of obtaining a transform block of size M×M, calculations can be performed only for the transform block of the R×R block (M>=R). As a result, there are non-zero coefficients that are valid only for the R×R region, and the transform coefficients in other regions can be considered to be zero values without performing calculations. The following table shows three examples of reduced adaptive multiple transforms (RAMTs) that use predefined simplification factor (R) values according to the size of the block to which the linear transform is applied.
[0165] [Table 3]
[0166] In addition, according to an example, when applying the reduced multi-transform technique as described above, a simplification factor may be determined based on the corresponding primary transform. For example, when the primary transform is DCT2, the amount of calculation is relatively simple compared to other primary transforms, so that the reduced transform may not be used for a small number of blocks, or a relatively large R value may be used to minimize the decrease in coding performance. For example, when the primary transform is DCT2 and other transforms, different simplification factors may be used as follows:
[0167] [Table 4]
[0168] As shown in Table 4, when the primary transform is DCT2, if the size of the block to be transformed is 8x8, 16x16 or more, the transform size is not changed, and if the size is 32x32 or more, the reduced transform size is limited to 32x32.
[0169] Or, according to one example, if the flag value indicating whether MTS is applied is 0 (i.e., if the DCT-2 transform is applied to both the horizontal and vertical directions), only 32 coefficients from the left and top for both directions (horizontal or vertical) are left, and the high frequency components can be configured to be zeroed out, i.e., set to 0 (zero-out embodiment 1).
[0170] For example, in the case of a 64x64 transform unit (TU), the transform coefficients remain only in the upper left 32x32 region, in the case of a 64x16TU, the transform coefficients remain only in the upper left 32x16 region, and in the case of an 8x64TU, the transform coefficients remain only in the upper left 8x32 region. In other words, the transform coefficients exist up to a maximum length of 32 in both the horizontal and vertical directions.
[0171] Such a zero-out method may be applied only to a residual signal to which intra prediction is applied, may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied.
[0172] The change in the size of the transform block, which may be expressed as zeroing out or high frequency zeroing as mentioned above, refers to a process of zeroing (i.e., determining to 0) transform coefficients associated with frequencies higher than a certain value in a (transform) block having a first horizontal size (or length) W1 and a first vertical size (or length) H1. When high frequency zeroing is applied, the transform coefficient values of the transform coefficients outside a low frequency transform coefficient area formed based on a second horizontal size W2 and a second vertical size H2 among the transform coefficients in the (transform) block may all be determined (set) to 0. The outside of the low frequency transform coefficient area may be referred to as a high frequency transform coefficient area. In one example, the low frequency transform coefficient area is a rectangular area located from the upper left corner of the (transform) block.
[0173] In other words, high frequency zeroing can be defined as setting all transform coefficient values for positions where the x coordinate is greater than or equal to w or the y coordinate is greater than or equal to h to 0 when the horizontal x coordinate value for the top left position of the current transform block (TB) is 0 and the vertical y coordinate value is 0 (and the x coordinate increases from left to right and the y coordinate increases from top to bottom).
[0174] In this document, certain terms or phrases are used to define certain information or concepts. For example, as described above, this specification defines a process of zeroing transform coefficients corresponding to frequencies above a certain value in a (transform) block having a first horizontal dimension (or length) W1 and a first vertical dimension (or length) H1 as "high frequency zeroing", defines an area where zeroing is performed through the high frequency zeroing as a "high frequency transform coefficient area", and defines an area where the zeroing is not performed as a "low frequency transform coefficient area". A second horizontal dimension (or length) W2 and a second vertical dimension (or length) H2 are used to indicate the size of the low frequency transform coefficient area.
[0175] However, "high frequency zeroing" can be replaced by various terms such as high frequency zeroing, high frequency zeroing, high frequency zeroing, high frequency zero-out, zero-out, etc., the "high frequency transform coefficient region" can be replaced by various terms such as high frequency zeroing application region, high frequency zeroing region, high frequency region, high frequency coefficient region, high frequency zero-out region, etc., and the "low frequency transform coefficient region" can be replaced by various terms such as high frequency zeroing non-application region, low frequency region, low frequency coefficient region, restriction region, zero-out region, etc., and when interpreting specific terms or sentences used to define specific information or concepts in this specification in the context of the specification as a whole, they should not be interpreted in a limited manner based on their names, but should be interpreted with attention to various operations, functions and effects according to the content that the terms are intended to express.
[0176] Or, in one example, the low-frequency transform coefficient region is the region remaining after high-frequency zeroing has been performed, the region where valid transform coefficients remain, i.e., the region where non-zero transform coefficients may exist, and this can be named a zero-out region or zero-out block.
[0177] Meanwhile, according to one example, when the flag value indicating whether MTS is applied is 1, i.e., when a transform other than DCT-2 (DCT-7 or DCT-8) can be applied to the horizontal and vertical directions, the transform coefficients can be left only in some of the upper left corner areas and the remaining areas can be zeroed out (zero-out embodiment 2) as shown below.
[0178] -Width (w) is 2 n If greater than or equal, w / 2 from the left p The transform coefficients can be left only for about the length, and the rest can be zeroed out.
[0179] -Height (h) is 2 m If it is greater than or equal to, h / 2 from above q The transform coefficients can be left only for about the length, and the rest can be zeroed out.
[0180] In this case, m, n, p, and q are integers greater than or equal to 0, and are specifically as follows:
[0181] 1)(m, n, p, q)=(5, 5, 1, 1)
[0182] 2)(m, n, p, q)=(4, 4, 1, 1)
[0183] In the case of the above configuration 1), for a 32×16 TU, the transform coefficients remain only in the upper left 16×16 area, and for an 8×32 TU, the transform coefficients remain only in the upper left 8×16 area.
[0184] Such a zero-out method may be applied only to a residual signal to which intra prediction is applied, may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied.
[0185] Or, as another example, when the flag value indicating whether MTS is applied is 1, i.e., when a transform other than DCT-2 (DCT-7 or DCT-8) can be applied to the horizontal and vertical directions, the transform coefficients can be left only in some of the upper left corner areas and the remaining areas can be zeroed out as shown below (zero-out embodiment 3).
[0186] - Height (h) is greater than or equal to width (w), height is 2 n If greater than or equal, the top left corner w×(h / 2 p ) region, the transform coefficients can be left as they are, and the remaining regions can be fixed to 0 (zero-out).
[0187] -Width (w) is greater than height (h), width is 2 m If greater than or equal, the top left corner (w / 2 q )×h region, and the coefficients for the remaining regions can be fixed to 0 (zero-out).
[0188] Under the above conditions, when the height (h) and width (w) are the same, the vertical direction is reduced (h / 2 p ) but to reduce the lateral direction (w / 2 q ) can also be set.
[0189] In this case, m, n, p, and q are integers greater than or equal to 0, and are specifically as follows:
[0190] 1)(m, n, p, q)=(4, 4, 1, 1)
[0191] 2)(m, n, p, q)=(5, 5, 1, 1)
[0192] In the case of the above configuration 1), for a 32×16 TU, the transform coefficients remain only in the upper left 16×16 area, and for an 8×16 TU, the transform coefficients remain only in the upper left 8×8 area.
[0193] Such a zero-out method may be applied only to a residual signal to which intra prediction is applied, may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied.
[0194] In the above-mentioned embodiment, the transform coefficient region is restricted when the flag value indicating whether MTS is applied is 0, or when the flag value indicating whether MTS is applied is 1. According to an example, a combination of these is possible.
[0195] 1) Zero-out Example 1 + Zero-out Example 2
[0196] 2) Zero-out Example 1 + Zero-out Example 3
[0197] As mentioned in the zero-out embodiment 2 and the zero-out embodiment 3, the zero-out method may be applied only to a residual signal to which intra prediction is applied, or may be applied only to a residual signal to which inter prediction is applied. Alternatively, the zero-out method may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied. Therefore, when the MTS flag is 1, the configuration shown in the table below is possible (when the MTS flag is 0, the zero-out embodiment 1 can be applied). In this case, the MTS flag may be embodied as an MTS index indicating a transform kernel for the MTS. For example, when the MTS index is 0, it may indicate that the zero-out embodiment 1 is applied.
[0198] [Table 5]
[0199] In the zero-out embodiment 1, the zero-out embodiment 2, and the zero-out embodiment 3, the area having the value 0 in the TU is clearly defined. That is, except for the upper left corner area where the existence of the transform coefficient is allowed, the rest is zeroed out to the value 0. Therefore, according to one embodiment, when performing entropy coding on the residual signal, it can be configured to bypass the residual coding for the area where the transform coefficient is sure to have the value 0. For example, the following configuration is possible.
[0200] 1) In the HEVC and VVC standards, a flag indicating whether a non-zero transform coefficient exists within a CG (which can be a 4x4 or 2x2 block depending on whether it is a Coefficient Group, subblock, TU block, or luma / chroma component) is coded (subblock_flag). Only when subblock_flag is 1, the inside of the corresponding CG is scanned and the coefficient level value is coded. Therefore, for CGs that belong to an area that is zeroed out to a value of 0, subblock_flag is not coded and can be set to a value of 0 by default.
[0201] 2) In the HEVC and VVC standards, the position of the last coefficient in the forward scan order (last_coefficient_position_x, which is the X-direction position, and last_coefficient_position_y, which is the Y-direction position) is coded first. Normally, the maximum values that last_coefficient_position_x and last_coefficient_position_y can have are the (width-1) and (height-1) values of the TU, respectively, but when the area in which non-zero coefficients can exist is limited due to the zero-out, the maximum values that last_coefficient_position_x and last_coefficient_position_y can have are also limited. Therefore, the maximum values that last_coefficient_position_x and last_coefficient_position_y can have can be coded after being limited in consideration of the zero-out. For example, if the binarization method applied to last_coefficient_position_x and last_coefficient_position_y is truncated unary, the maximum length of the truncated unary code (the codeword length that last_coefficient_position_x and last_coefficient_position_y can have) can be reduced based on the adjusted maximum value.
[0202] As mentioned above, when zero-out is applied, especially when the upper left 16x16 region is used as the low-frequency transform coefficient region (hereinafter, this can be named 32-point Reduced MTS or RMTS32), it can be applied not only when the MTS technique is applied, but also in all cases where 32-point DST-7 or 32-point DCT-8 is applied.
[0203] FIG. 8 is a diagram for explaining MTS applied to sub-block transform according to an example of this document.
[0204] As an example, a subblock transform (SBT) may be applied in which a coding unit is divided into subblocks and a transform process is performed. The subblock transform is applied to a residual signal generated through inter prediction, and the residual signal block is divided into two subblocks by the subblock transform, and a separable transform is applied to only one of the subblocks. The subblocks may be divided horizontally or vertically, and the width or height of the divided subblocks may be 1 / 2 or 1 / 4 of the coding unit. When the subblock transform is applied, a transform is performed on only one of the two divided subblocks, so that residual data exists only in the subblock on which the transform is performed, and no residual data exists in the remaining subblock.
[0205] For the sub-block to which the transformation is applied, if either the width or height is 64 or more, DCT-2 is applied in both the horizontal and vertical directions, and if both the width and height are 32 or less, DST-7 or DCT-8 can be applied. Therefore, when SBT is applied, RMTS32 can be applied to perform zeroing only if the lengths of both sides of the sub-block to which the transformation is applied are both 32 or less. In other words, DST-7 or DCT-8 with a length of 32 or less can be applied in each direction (horizontal and vertical directions) to leave up to 16 transform coefficients for each row or column.
[0206] When a block is divided and a transform is applied to an area indicated as A as shown in Fig. 8, DST-7 or DCT-8 can be applied to each side, and the transform pair applied in the horizontal and vertical directions is not limited to the example shown in Fig. 8. In Fig. 8, the width and height of the entire block are indicated as w and h, respectively, and the width and height of a block to which a separable transform is actually applied are (w1, h) or (w, h1) when expressed as a (width, height) pair. w1 is 1 / 2 or 1 / 4 of w, and h1 is also 1 / 2 or 1 / 4 of h.
[0207] The block to which the transform is applied may be located on the left or right side or the upper or lower side of the entire block as shown in Fig. 8. Also, the block in Fig. 8 is a residual signal generated by inter prediction. A flag indicating whether to apply transform to only one sub-block by dividing the residual signal as shown in Fig. 8 may be signaled, and when the flag is 1, a flag indicating whether the division is vertical or horizontal as shown in Fig. 8 may also be set through signaling.
[0208] A flag indicating whether block A to which the transformation is actually applied is located on the left or right side of the entire block, or on the upper or lower side, may also be signaled.
[0209] As shown in the example of Figure 8, when horizontal and vertical transforms are not specified in MTS signaling but horizontal and vertical transforms are determined for a certain block, the proposed RMTS32 can be applied when the length of each side in the horizontal and vertical directions is 32. In the case of RMTS32, it can be configured to omit residual coding for areas that become zero-out, or it can perform residual coding by scanning only areas that do not become zero-out.
[0210] FIG. 9 is a diagram illustrating a 32-point zero-out applied to a sub-block transform according to an example of this document.
[0211] When RMTS32 is applied to the sub-blocks divided as shown in Figure 8, the transformed residual data can exist as shown in Figure 9. That is, Figure 9 shows that RMTS32 is applied to the sub-blocks on which the transformation is performed among the blocks divided by applying the sub-block transformation.
[0212] The width and height of the A block to which the transformation is actually applied can be w / 2 and h / 2 or w / 4 and h / 4, respectively, relative to the width (w) and height (h) of the original transformation block.
[0213] In summary, for any block to which a transform is applied, if DST-7 or DCT-8 with a length of 32 can be applied in each of the horizontal and vertical directions, RMTS32 can be applied. Whether DST-7 or DCT-8 with a length of 32 is applied can be determined through preset signaling, or can be determined without signaling according to a predetermined coding condition.
[0214] On the other hand, if MTS is disabled (e.g., in the case of VVC, MTS can be disabled when “sps_mts_enable_flag” is set to 0 in the sequence parameter set), when SBT is applied, DCT2 is applied to both the horizontal and vertical directions, rather than the combination of DST7 and DCT8 presented in Table 3.
[0215] Therefore, when MTS is deactivated, RMTS32 should not be applied even if the block to be transformed is divided into sub-blocks. As described above, when MTS is not applied, DCT2, not DST7 or DCT8, is applied as the primary transform, and the upper left block to which DCT2 is applied and non-zero transform coefficients can exist can be subjected to high frequency zeroing-out, in which the width and height are reduced to 32. That is, the upper left block to which inverse DCT-2 is applied and non-zero transform coefficients can exist can be reduced in size to 32 in width and height, but is not zeroed out below that. This is to prevent data loss due to zeroing-out, and the width or height of the upper left block to which inverse DCT2 is applied is not reduced to 16.
[0216] If MTS is deactivated, a process of explicitly checking this is required so that the width or height of the divided sub-block to which DCT2 is applied is not reduced to 16.
[0217] As an example, by determining 'sps_mts_enabled_flag' in the residual coding syntax, it can be configured so that zero-out by RMTS32 is not performed when SBT is applied.
[0218] The specification text reflecting the above embodiment can be expressed in the following tables (Tables 6 to 16).
[0219] [Table 6]
[0220] [Table 7]
[0221] Tables 6 and 7 include video information signaled in a sequence parameter set for video coding, including flag information related to transformations.
[0222] sps_transform_skip_enabled_flag indicates whether transform skip is applied, i.e., whether the transform skip flag (transform_skip_flag) can be present in the syntax for the transform unit.
[0223] sps_mts_enabled_flag is flag information indicating whether MTS, i.e., multiple transform selection technique, can be used explicitly, and when sps_mts_enabled_flag is 1, it indicates that sps_explicit_mts_intra_enabled_flag and sps_explicit_mts_inter_enabled_flag are present in the sequence parameter set syntax.
[0224] If either sps_explicit_mts_intra_enabled_flag or sps_explicit_mts_inter_enabled_flag is 1, it indicates that MTS can be applied to the transform unit, which means that tu_mts_idx can be present in the transform unit syntax. For example, if the sps_mts_enabled_flag value is 1 and the sps_explicit_mts_intra_enabled_flag value is 0, implicit MTS can be applied to the intra-coding unit.
[0225] sps_sbt_enabled_flag is flag information indicating whether the above-mentioned sub-block transform can be applied to a coding unit for inter prediction.
[0226] If sps_sbt_enabled_flag is 1, sps_sbt_max_size_64_flag can be signaled for the maximum coding unit width and height for which sub-block transform is allowed.
[0227] If sps_sbt_max_size_64_flag is 0, the maximum coding unit width and height for which sub-block transforms are allowed is 32; if sps_sbt_max_size_64_flag is 1, the maximum coding unit width and height for which sub-block transforms are allowed is derived as 64.
[0228] [Table 8]
[0229] Table 8 shows transform-related information signaled in a picture parameter set. log2_transform_skip_max_size_minus2 is information for deriving the maximum block size for which transform skip can be used, and the maximum block size for which transform skip can be used is derived as a power of 2 (1<<(log2_transform_skip_max_size_minus2+2)) obtained by adding 2 to log2_transform_skip_max_size_minus2.
[0230] [Table 9]
[0231] [Table 10]
[0232] Tables 9 and 10 show syntax and semantics for coding units to which inter prediction is applied, and the division to which SBT is applied can be determined by the four syntax elements in Table 9.
[0233] Cu_sbt_flag indicates whether SBT is applied to the corresponding coding unit, and cu_sbt_quad_flag is flag information indicating whether the block to which transformation is applied is 1 / 4 of the entire block when one coding unit is divided into two sub-blocks. If the cu_sbt_quad_flag value is 0, the divided sub-blocks have 1 / 2 the width or height of the coding unit, and if the cu_sbt_quad_flag value is 1, the divided sub-blocks have 1 / 4 the width or height of the coding unit. If the width and height of the coding unit are w and h, respectively, the height of the sub-block is h1=(1 / 4)×h or the width is w1=(1 / 4)×w.
[0234] When the cu_sbt_horizontal_flag value is 1, the coding unit is divided horizontally, whereas when the cu_sbt_horizontal_flag value is 0, the coding unit is divided vertically, i.e.
[0235] If the cu_sbt_pos_flag value is 0, the transformation is applied to the upper sub-block of the horizontally divided sub-blocks and the left sub-block of the vertically divided sub-blocks. If the cu_sbt_pos_flag value is 1, the transformation is applied to the lower sub-block of the horizontally divided sub-blocks and the right sub-block of the vertically divided sub-blocks.
[0236] The trTypeHor and trTypeVer according to cu_sbt_horizontal_flag and cu_sbt_pos_flag are shown in the table below.
[0237] [Table 11]
[0238] As described above, if the horizontal transformation kernel is represented by trTypeHor and the vertical transformation kernel is represented by trTypeVer, a trTypeHor or trTypeVer value of 0 can be set to DCT2, a trTypeHor or trTypeVer value of 1 can be set to DST7, and a trTypeHor or trTypeVer value of 2 can be set to DCT8. Therefore, if the length of at least one side of the corresponding divided block to which the transformation is applied is 64 or more, DCT-2 can be applied in both the horizontal and vertical directions, or DST-7 or DCT-8 can be applied. When the current block is divided and transformation is performed on sub-blocks, MTS can be applied implicitly as shown in Table 11.
[0239] On the other hand, if DST-7 or DCT-8 is applied because both the width and height of a subblock are less than or equal to 32, i.e., if MTS is applied to the subblock, then the RMTS described above can be applied. For example, if the length in each direction of a subblock is 32, then a 32-length DST-7 or DCT-8 can be applied leaving only 16 transform coefficients.
[0240] On the other hand, if either the width or height of a subblock is 64 or more, DCT-2 is applied in both the horizontal and vertical directions, and the RMTS is not applied in each direction, leaving only 32 transform coefficients by high frequency zeroing out.
[0241] [Table 12]
[0242] Table 12 shows a part of the syntax and semantics of a transform unit according to an example. tu_mts_idx[x0][y0] indicates the MTS index applied to the transform block, and trTypeHor and trTypeVer can be determined according to the MTS index as shown in Table 1.
[0243] As another example, mts_idx may be signaled at the coding unit level rather than the transform unit level.
[0244] [Table 13]
[0245] Table 13 shows some of the residual coding syntax and semantics according to one example.
[0246] The syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix in Table 13 indicate the (x, y) position information of the last non-zero transform coefficient in the transform block. More specifically, last_sig_coeff_x_prefix indicates the prefix of the column position of the last significant coefficient in the scanning order within the transform block, last_sig_coeff_y_prefix indicates the prefix of the row position of the last significant coefficient in the scanning order within the transform block, last_sig_coeff_x_suffix indicates the suffix of the column position of the last significant coefficient in the scanning order within the transform block, and last_sig_coeff_y_suffix indicates the suffix of the row position of the last significant coefficient in the scanning order within the transform block. Here, the significant coefficients may indicate the non-zero coefficients. The scan order may be a top-right diagonal scan order. Alternatively, the scan order may be a horizontal scan order or a vertical scan order. The scan order may be determined based on whether intra / inter prediction is applied to a current block (CB, or CB including TB) and / or a specific intra / inter prediction mode.
[0247] Based on tu_mts_idx[x0][y0] in Table 12, the zero-out area can be set in the residual coding of Table 13.
[0248] Also, if cu_sbt_flag is 1, the height of the block to which the transform is applied is 32 or less (log2TbHeight<6) and the width is 32 (log2TbWidth<6&& log2TbWidth>4), and the sps_mts_enabled_flag value is 1, then the width of the top-left region in which non-zero transform coefficients can exist is set to 16 (log2ZoTbWidth=4). Similarly, if cu_sbt_flag is 1, the width of the block to which the transform is applied is 32 or less (log2TbWidth<6) and the height is 32 (log2TbHeight<6&& log2TbHeight>4), and the sps_mts_enabled_flag value is 1, then the height of the top-left region in which non-zero transform coefficients can exist is set to 16 (log2ZoTbHeight=4).
[0249] The block to which the transform is applied may be the original transform block or a divided sub-block.
[0250] Here, log2ZoTbWidth and log2ZoTbHeight indicate the maximum width and height of the top left region in the transform block where non-zero coefficients can exist, and the top left region can be named a "reduced transform block." That is, log2ZoTbWidth and log2ZoTbHeight can be defined as variables indicating the width and height of the reduced transform block.
[0251] That is, for example, when a sub-block transform is applied to a coding unit, the width of the upper left block in which non-zero coefficients can exist is reduced to 16, and the remaining area must be applied in order to apply zero-out (RMTS) which becomes zero.
[0252] If MTS is not applied, even if it is determined that SBT is applied to the coding unit (cu_sbt_flag is 1), a non-MTS DCT-2 should be applied to the sub-block to which the transform is applied. For example, if sps_mts_enabled_flag is 0, a DCT-2 other than DST-7 or DCT-8 should be applied to the coding block even if SBT is applied to the coding block.
[0253] In addition, when SBT is applied to a coding block, DCT-2 is applied only when the width or height of a sub-block is 64 or more, and DCT-2 is not applied in the remaining cases.
[0254] That is, in order to ensure that DCT-2 is applied to a sub-block and to prevent RMTS, which can induce data loss, from being applied to a sub-block to which DCT-2 is applied, the encoding device configures the image information so that it can check the sps_mts_enabled_flag value, and the decoding device checks the sps_mts_enabled_flag value during residual coding according to this configuration of the image information.
[0255] In summary, when it is confirmed that cu_sbt_flag is 1 only during the c image decoding process, the sps_mts_enabled_flag value signaled in the sequence parameter set can be checked when setting the transform block size according to RMTS in order to prevent RMTS from being applied to the sub-block to which DCT-2 is applied. When cu_sbt_flag is 1 and the sps_mts_enabled_flag value is 1, the width and height of the top left block to which RMTS is applied and non-zero transform coefficients can exist can be set to 16, and when cu_sbt_flag is 1 and the sps_mts_enabled_flag value is 0, DCT-2 is used for transformation and MTS is not applied, so zero-out according to RMTS is not applied either. In this case, the width and height of the top left block to which non-zero transform coefficients can exist can be set to 32 or less.
[0256] For example, in the case of a 32x32 transform block to which a sub-block transform is applied, if sps_mts_enabled_flag is 0, the width or height having a length of 32 is not reduced to 16 because DCT-2 is used as the transform kernel.
[0257] In this way, it is possible to prevent the RMTS from being zeroed out to a length of 16 when the MTS is disabled by checking the sps_mts_enabled_flag value.
[0258] In other cases, if cu_sbt_flag is not 1, or the height of the transform block is greater than 32, or the width of the transform block is not 32, or MTS is not applied, the width of the transform block may be set to the smaller of the width of the transform block and 32. That is, the maximum width of the transform block may be limited to 32 by high frequency zeroing. Also, if cu_sbt_flag is not 1, or the width of the transform block is greater than 32, or the height of the transform block is not 32, the height of the transform block may be set to the smaller of the height of the transform block and 32. That is, the maximum height of the transform block may be limited to 32 by zeroing.
[0259] When a sub-block transform (SBT) is applied, if the length of at least one side of the division block is 64 or more, DCT-2 is applied to both the horizontal and vertical directions, or DST-7 or DCT-8 can be applied as shown in Table 11. Therefore, when SBT is applied, zeroing out can be performed by applying RMTS32 only when the lengths of both sides of the division block to which the transform is applied are both less than or equal to 2. That is, if the length in each direction of the block is 32, DST-7 or DCT-8 of length 32 can be applied to leave only 16 transform coefficients.
[0260] As shown in Table 13, when applying RMTS32, the width and height values of the original transform unit are not used for coding, and the width and height of the area that is not zeroed out (low-frequency transform coefficient area) can be regarded as the width and height of the actual transform block and coded (log2ZoTbWidth=4 or log2ZoTbHeight=4).
[0261] For example, if the original width x height of a transform block is 32 x 16, when RMTS32 is applied, non-zero coefficients exist only in the top left 16 x 16 region due to zero-out. Therefore, the width and height of the top left region where non-zero transform coefficients can exist are set to 16 and 16, respectively, and coding of syntax elements (e.g., last_sig_coeff_x_prefix, last_sig_coeff_y_prefix) can then be carried out.
[0262] In summary, according to the residual coding of Table 13, the log2ZoTbWidth and log2ZoTbHeight values indicating the maximum width and maximum height at which a non-zero coefficient can exist are set before coding last_sig_coeff_x_prefix, and after applying the log2ZoTbWidth and log2ZoTbHeight values to code the position of the last non-zero coefficient, the width and height of the actual transform block are changed to log2ZoTbWidth and log2ZoTbHeight, respectively (log2TbWidth = log2ZoTbWidth, log2TbHeight = log2ZoTbHeight). Subsequent syntax elements can be coded according to the changed values. As a result, the upper left corner area remaining except for the zeroed out area in the residual coding part can be set as a new transform block, and then the residual sample can be derived.
[0263] In this way, when the size of the transform block is reduced to the transform coefficient domain in the low frequency domain due to the zeroing out of the high frequency transform coefficients, the range of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix values can be limited to values between 0 and (log2ZoTbWidth<<1)-1 and (log2ZoTbHeight<<1)-1, as per the semantics of Table 13.
[0264] [Table 14-1]
[0265] [Table 14-2]
[0266] [Table 14-3]
[0267] [Table 14-4]
[0268] Table 14 shows the conversion process, and indicates that when SBT is applied to a coding unit, MTS is implicitly applied (cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to 32, implicitMtsEnabled is set equal to 1).
[0269] A variable trTypeHor indicating a horizontal transformation kernel and a variable trTypeVer indicating a vertical transformation kernel can be derived based on Tables 8-14, which can correspond to Table 1 of this document.
[0270] In addition, the variables trTypeHor and trTypeVer when SBT is applied to a coding unit can be derived based on Tables 8-15, and Tables 8-15 in Table 14 can correspond to Table 11 in this document.
[0271] The content of the size of the block to which the zero-out disclosed in Table 13 is applied, i.e., the zero-out block, is expressed as nonZeroW and nonZeroH in Table 14. nonZeroW and nonZeroH can be defined as variables indicating the width and height of the upper left block in which a non-zero transform coefficient can exist.
[0272] If LFNST is not applied, nonZeroW can be set to the smaller of a value based on whether trTypeHor is greater than 0 ((trTypeHor>0)?16:32) and the width of the transform block (nTbW) (nonZeroW=Min(nTbW, (trTypeHor>0)?16:32)). If trTypeHor is greater than 0, MTS is applied, so "(trTypeHor>0)?16:32" is set to 16, and nonZeroW is set to the smaller of the width of the transform block (nTbW) and 16. On the other hand, if trTypeHor is not greater than 0, MTS is not applied, so "(trTypeHor>0)?16:32" is set to 32, and nonZeroW is set to the smaller of the width of the transform block (nTbW) and 32.
[0273] Similarly, when LFNST is not applied, nonZeroH can be set to the smaller of a value based on whether trTypeVer is greater than 0 ((trTypeVer>0)?16:32) and the width of the transform block (nTbH) (nonZeroH=Min(nTbH, (trTypeVer>0)?16:32)). When trTypeVer is greater than 0, MTS is applied, so "(trTypeVer>0)?16:32" is set to 16, and nonZeroH is set to the smaller of the height of the transform block (nTbH) and 16. On the other hand, when trTypeVer is not greater than 0, MTS is not applied, so "(trTypeVer>0)?16:32" is set to 32, and nonZeroH is set to the smaller of the height of the transform block (nTbH) and 32.
[0274] This indicates that the size of the zero-out block is set to 16 or 32 depending on whether MTS is applicable, that is, whether the trTypeHor and trTypeVer values can have values greater than or equal to 0.
[0275] Residual sample values can be derived based on nonZeroW and nonZeroH, which are set to reflect zero-out. (When nTbH is greater than 1, each (vertical) column of scaled transform coefficients d[x][y]with x=0..nonZeroW-1,y=0..nonZeroH-1 is transformed to e[x][y]with x=0..nonZeroW-1,y=0..nTbH-1 by invoking the one-dimensional transformation process as specified inclause 8.7.4.4 for each column x=0..nonZeroW-1 with the height of the transform block nTbH, the non-zero height of the scaled transform coefficients nonZeroH, the list d[x][y]with y=0..nonZeroH-1 and the transform type variable trType set equal to trTypeVer as inputs, and the output is the list e[x][y]with y=0..nTbH-1).
[0276] Meanwhile, when the size of the transform block is changed by applying zero-out as described above, the size of the transform block used for context selection of last_sig_coeff_x_prefix and last sig_coeff_y_prefix may also be changed. Table 15 shows the binarization of last_sig_coeff_x_prefix and last sig_coeff_y_prefix considering the reduced transform block, and Table 16 shows a process of deriving ctxInc (context increment) for deriving last_sig_coeff_x_prefix and last sig_coeff_y_prefix. Since the context can be selected and classified by the context increment, the context model can be derived based on the context increment.
[0277] [Table 15]
[0278] [Table 16]
[0279] As shown in Table 15, the maximum value (cMax) of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix is set based on log2ZoTbWidth and log2ZoTbHeight corresponding to the width and height of the reduced transform block such as the low-frequency transform coefficient area (cMax = (log2ZoTbWidth << 1) -1, cMax = (log2ZoTbHeight << 1) -1). On the other hand, when a truncated unary is used for binarizing last_sig_coeff_x_prefix and last_sig_coeff_y_prefix, the maximum value (cMax) of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be set to the same as the maximum value of the codeword used for binarizing last_sig_coeff_x_prefix and last_sig_coeff_y_prefix. Therefore, the maximum length of the prefix codeword indicating the last valid coefficient prefix information can be derived based on the size of the zero-out block.
[0280] As shown in Table 16, for the CABAC context for two syntax elements, namely last_sig_coeff_x_prefix and last_sig_coeff_y_prefix, the original transform block (original TU) size, not the reduced transform block in the low frequency transform coefficient domain, is applied (log2TbSize is set equal to log2TbWidth, log2TbSize is set equal to log2TbHeight).
[0281] To summarize, in one example, a residual sample is derived based on information about the last significant coefficient position, a context model is derived based on the size of an original transform block whose size is not changed, and the last significant coefficient position may be derived based on the size of a transform block to which zero-out is applied. In this case, the size, specifically, the width or height, of the transform block to which zero-out is applied, i.e., the zero-out block, is smaller than the size, width or height, of the original transform block.
[0282] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.
[0283] FIG. 10 is a flow diagram illustrating the operation of a video decoding device according to one embodiment of this document.
[0284] Each step disclosed in FIG. 10 may be performed by the decoding device 300 disclosed in FIG. 3. More specifically, S1000 and S1010 may be performed by the entropy decoding unit 310 disclosed in FIG. 3, S1020 may be performed by the inverse quantization unit 321 disclosed in FIG. 3, S1030 may be performed by the inverse transform unit 322 disclosed in FIG. 3, and S1040 may be performed by the addition unit 340 disclosed in FIG. 3. In addition, the operations according to S1000 to S1040 are based on some of the contents detailed in FIG. 4 to FIG. 9. Therefore, the detailed contents that overlap with the contents detailed in FIG. 3 to FIG. 6 will be omitted or simplified.
[0285] A decoding apparatus according to an embodiment may receive a bitstream including residual information (S1000). More specifically, an entropy decoding unit 310 of the decoding apparatus may receive a bitstream including residual information.
[0286] A decoding apparatus according to an embodiment may derive quantized transform coefficients for a current block based on residual information included in a bitstream (S1010). More specifically, an entropy decoding unit 310 of the decoding apparatus may derive quantized transform coefficients for a current block based on residual information included in a bitstream.
[0287] The decoding device according to an embodiment may derive transform coefficients from the quantized transform coefficients based on the inverse quantization process (S1020). More specifically, the inverse quantization unit 321 of the decoding device may derive transform coefficients from the quantized transform coefficients based on the inverse quantization process.
[0288] The decoding apparatus according to an embodiment may derive a residual sample for the current block by applying an inverse transform to the derived transform coefficients (S1030). More specifically, the inverse transform unit 322 of the decoding apparatus may derive a residual sample for the current block by applying an inverse transform to the derived transform coefficients.
[0289] The decoding apparatus according to an embodiment may generate a reconstructed picture based on the residual sample for the current block (S1040). More specifically, the adder 340 of the decoding apparatus may generate a reconstructed picture based on the residual sample for the current block.
[0290] In one embodiment, the unit of the current block is a transform block (TB).
[0291] In one embodiment, each of the transform coefficients for the current block is associated with a high frequency transform coefficient domain comprised of zero transform coefficients or a low frequency transform coefficient domain including at least one significant transform coefficient.
[0292] In one embodiment, the residual information may include last significant coefficient prefix information and last significant coefficient suffix information regarding the position of the last significant transform coefficient among the transform coefficients for the current block.
[0293] According to one example, the maximum value that the last significant coefficient prefix information can have may be determined based on the size of the zero-out block.
[0294] In one embodiment, the location of the last significant transform coefficient may be determined based on a prefix codeword indicating the last significant coefficient prefix information and the last significant coefficient suffix information.
[0295] In one embodiment, the maximum length of the prefix codeword may be determined based on the size of the low-frequency transform coefficient region, i.e., the zero-out block.
[0296] In one embodiment, the size of the zero-out block may be determined based on the width and height of the current block.
[0297] In one embodiment, the last significant coefficient prefix information includes x-axis prefix information and y-axis prefix information, and the prefix codeword is a codeword for the x-axis prefix information or a codeword for the y-axis prefix information.
[0298] In one example, the x-axis prefix information may be expressed as last_sig_coeff_x_prefix, the y-axis prefix information may be expressed as last_sig_coeff_y_prefix, and the position of the last significant transform coefficient may be expressed as (LastSignificantCoeffX, LastSignificantCoeffY).
[0299] In one embodiment, the residual information may include information regarding the size of a zero-out block.
[0300] FIG. 11 is a flow diagram illustrating a process of deriving transform coefficients by a video decoding apparatus according to an embodiment of the present document.
[0301] Each step disclosed in Fig. 11 may be performed by the decoding apparatus 300 disclosed in Fig. 3. More specifically, S1100 to S1140 may be performed by the entropy decoding unit 310 disclosed in Fig. 3.
[0302] First, as shown in the figure, the decoding device may check first flag information indicating whether a sub-block transform is applied to the current block, which divides a coding unit and performs a transform, in order to derive a zero-out block for the current block (S1100).
[0303] As described above, the zero-out block refers to a low-frequency transform coefficient region including non-zero significant transform coefficients, and the decoding apparatus can derive the zero-out block in the residual coding step.
[0304] A decoding apparatus can determine whether or not to apply sub-block transformation based on first flag information such as cu_sbt_flag, and such first flag information can be signaled at a coding unit level.
[0305] In addition, the decoding apparatus may check second flag information indicating whether a multi-transform selection in which multiple transform kernels are used is applied to the current block (S1110).
[0306] The second flag information indicating whether multiple transform selection is applied to the current block is sps_mts_enabled_flag, and such second flag information can be signaled at the sequence parameter set level.
[0307] The decoding device can derive whether MTS can be applied to the current block and whether a sub-block transform is applied, i.e., the zero-out block to which the transform is applied based on the first flag information, the second flag information, and the width or height of the current block (S1120).
[0308] The transform block to which the transform is applied can be implemented as a zero-out block indicating the area in which valid transform coefficients in the current block can exist, and the width and height of the zero-out block can be derived as various values depending on whether MTS and sub-block transforms are applied to the current block.
[0309] As an example, the decoding device may set the width or height of the zero-out block to 16 when multiple transform selection is applied (when DST-7 / DCT-8 can be applied), and may set the width or height of the zero-out block to 32 or less when multiple transform selection is not applied.
[0310] Specifically, when a transform kernel used in the inverse linear transform is not DCT-2 but DST-7 or DCT-8, if the width of the current block is 32 and the height of the current block is less than or equal to 32, the width of the zero-out block may be set to 16. On the other hand, if the above condition cannot be met, i.e., the transform kernel is DCT-2, or the width of the current block is not 32, or the height of the current block is 64 or more, the width of the zero-out block may be set to the smaller of the width of the current block and 32.
[0311] Similarly, when the transform kernel used for the inverse linear transform is not DCT-2 but DST-7 or DCT-8, if the height of the current block is 32 and the width of the current block is less than or equal to 32, the height of the zero-out block may be set to 16. On the other hand, if the above condition cannot be met, i.e., the transform kernel is DCT-2, or the height of the current block is not 32, or the width of the current block is 64 or more, the height of the zero-out block may be set to the smaller of the height of the current block and 32.
[0312] Also, according to one example, the width or height of the zero-out block may be set to 16 when a flag value indicating whether the current block is divided into sub-blocks for transformation is 1, the width of the divided sub-blocks is 32, and the height of the sub-blocks is less than 64, and the width of the upper left corner region in which non-zero transform coefficients can exist in the sub-blocks is 16. Alternatively, when a flag value indicating whether the current block is divided into sub-blocks for transformation is 1, the height of the divided sub-blocks is 32, and the width of the upper left corner region in which non-zero transform coefficients can exist in the sub-blocks is less than 64, the height of the sub-blocks may be set to 16.
[0313] Based on the division direction of the current block and the position of the sub-block to which the transformation is applied, a transformation kernel can be derived as shown in Table 11.
[0314] The size of the zero-out block is smaller than the size of the current block, specifically, the width of the zero-out block is smaller than the width of the current block, and the height of the zero-out block is smaller than the height of the current block.
[0315] In one embodiment, the size of the zero-out block is one of 32x16, 16x32, 16x16, or 32x32.
[0316] In one embodiment, the size of the current block is 64x64 and the size of the zero-out block is 32x32.
[0317] Meanwhile, according to an example, the decoding apparatus may derive a context model for last significant coefficient position information based on the width or height of the current block, and derive a value of the last significant coefficient position based on the derived context model.
[0318] According to an example, the context model may be derived based on the size of the original transform block, which is not the size of the zero-out block. More specifically, the context increment for the x-axis prefix information and the y-axis prefix information corresponding to the last significant coefficient prefix information may be derived based on the size of the original transform block.
[0319] As described above, the last significant coefficient position information may include last significant coefficient prefix information and last significant coefficient suffix information, and the value of the last significant coefficient position may be derived based on a context model.
[0320] The decoding apparatus can derive the position of the last significant coefficient based on the derived value of the last significant coefficient position information and the width or height of the zero-out block (S1130).
[0321] According to one example, the decoding apparatus may derive the last significant coefficient position within a size range of a zero-out block having a size smaller than that of a current block that is not originally a current block, i.e., a transform coefficient to which a transform is applied may be derived within a size range of a zero-out block that is not a current block.
[0322] According to one example, the maximum value that the last significant coefficient prefix information can have may be determined based on the size of the zero-out block.
[0323] In one example, the last significant coefficient position is derived based on a prefix codeword indicating the last significant coefficient prefix information and the last significant coefficient suffix information, and the maximum length of the prefix codeword can be derived based on the size of the zero-out block.
[0324] The decoding apparatus may derive transform coefficients based on the last significant coefficient position derived based on the width or height of the zero-out block (S1140).
[0325] The transform coefficients can be derived through the residual coding process of Table 13.
[0326] Thereafter, the decoding apparatus can perform at least one of the non-separable inverse quadratic transform and the inverse linear transform based on Tables 1 and 11 to derive residual samples.
[0327] FIG. 12 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.
[0328] Each step disclosed in FIG. 12 may be performed by the encoding apparatus 200 disclosed in FIG. 2. More specifically, S1200 may be performed by the subtraction unit 231 disclosed in FIG. 2, S1210 may be performed by the conversion unit 232 disclosed in FIG. 2, S1220 may be performed by the quantization unit 233 disclosed in FIG. 2, and S1230 may be performed by the entropy encoding unit 240 disclosed in FIG. 2. In addition, the operations according to S1200 to S1230 are based on some of the contents detailed in FIG. 4 to FIG. 9. Therefore, the detailed contents overlapping with the contents detailed in FIG. 2 and FIG. 4 to FIG. 9 will be omitted or simplified.
[0329] The encoding apparatus according to an embodiment may derive a residual sample for a current block (S1200). More specifically, the subtractor 231 of the encoding apparatus may derive a residual sample for the current block.
[0330] The encoding apparatus according to an embodiment may transform the residual samples for the current block to derive transform coefficients for the current block (S1210). More specifically, the transform unit 232 of the encoding apparatus may transform the residual samples for the current block to derive transform coefficients for the current block.
[0331] The encoding apparatus according to an embodiment may derive quantized transform coefficients from the transform coefficients based on a quantization process (S1220). More specifically, the quantizer 233 of the encoding apparatus may derive quantized transform coefficients from the transform coefficients based on a quantization process.
[0332] The encoding apparatus according to an embodiment may encode residual information including information on the quantized transform coefficients (S1230). More specifically, the entropy encoding unit 240 of the encoding apparatus may encode the residual information including information on the quantized transform coefficients.
[0333] In one embodiment, each of the transform coefficients for the current block is associated with a high frequency transform coefficient domain comprised of zero transform coefficients or a low frequency transform coefficient domain containing at least one significant transform coefficient, ie, a zero-out block.
[0334] In an embodiment, the residual information may include last significant coefficient prefix information and last significant coefficient suffix information regarding a position of a last significant transform coefficient among the transform coefficients for the current block.
[0335] In one embodiment, the location of the last significant transform coefficient is based on a prefix codeword indicating the last significant coefficient prefix information and the last significant coefficient suffix information.
[0336] According to one example, the maximum value that the last significant coefficient prefix information can have may be determined based on the size of the zero-out block.
[0337] In one embodiment, the maximum length of the prefix codeword may be determined based on the size of the zero-out block.
[0338] In one embodiment, the size of the zero-out block may be determined based on the width and height of the current block.
[0339] In one embodiment, the last significant coefficient prefix information includes x-axis prefix information and y-axis prefix information, and the prefix codeword is a codeword for the x-axis prefix information or a codeword for the y-axis prefix information.
[0340] In one example, the x-axis prefix information may be expressed as last_sig_coeff_x_prefix, the y-axis prefix information may be expressed as last_sig_coeff_y_prefix, and the position of the last significant transform coefficient may be expressed as (LastSignificantCoeffX, LastSignificantCoeffY).
[0341] In one embodiment, the residual information may include information regarding the size of a zero-out block.
[0342] FIG. 13 is a flow diagram illustrating a transform coefficient and information encoding process according to one embodiment of the present document.
[0343] Each step disclosed in Fig. 13 may be performed by the encoding apparatus 200 disclosed in Fig. 2. More specifically, steps S1300 to S1330 may be performed by the transform unit 232, and steps S1340 to S1350 may be performed by the entropy encoding unit 240 disclosed in Fig. 2.
[0344] First, the encoding apparatus may determine whether a sub-block transform that divides a coding unit and performs a transform on a current block is applied to the current block in order to derive a zero-out block for the current block (S1300).
[0345] As described above, the zero-out block refers to a low-frequency transform coefficient area including non-zero significant transform coefficients, and corresponds to a substantial transform block to which a transform is applied.
[0346] Information indicating whether a sub-block transform is applied to a current block can be generated and output by the encoding device as flag information (cu_sbt_flag), and such flag information can be signaled at the coding unit level.
[0347] The encoding apparatus may also determine whether a multi-transform selection, in which multiple transform kernels are used, is applied to the current block (S1310).
[0348] Information indicating whether multiple transform selection is applied to the current block can be generated and output by the encoding device as flag information (sps_mts_enabled_flag), and such flag information can be signaled at the sequence parameter set level.
[0349] The encoding apparatus may derive the zero-out block to which the transformation is applied based on whether MTS can be applied to the current block, whether a sub-block transformation is applied, and the width or height of the current block (S1320).
[0350] The area in which the transform coefficients to which the inverse transform is applied during the decoding process exist can be embodied as a zero-out block indicating the area in which valid transform coefficients in the current block can exist, and the width and height of the zero-out block can be derived as various values depending on whether MTS and sub-block transform are applied to the current block.
[0351] According to one example, the encoding device may set the width or height of the zero-out block to 16 if multiple transform selection is applied, and may set the width or height of the zero-out block to 32 or less if multiple transform selection is not applied.
[0352] Specifically, when a transform kernel used in the primary transform is not DCT-2 but DST-7 or DCT-8, if the width of the current block is 32 and the height of the current block is less than or equal to 32, the width of the zero-out block may be set to 16. On the other hand, if the above conditions cannot be met, i.e., the transform kernel is DCT-2, or the width of the current block is not 32, or the height of the current block is 64 or more, the width of the zero-out block may be set to the smaller of the width of the current block and 32.
[0353] Similarly, when the transform kernel used in the primary transform is DST-7 or DCT-8, which is not DCT-2, and the height of the current block is 32 and the width of the current block is less than or equal to 32, the height of the zero-out block may be set to 16. On the other hand, if the above condition cannot be met, i.e., the transform kernel is DCT-2, or the height of the current block is not 32, or the width of the current block is 64 or more, the height of the zero-out block may be set to the smaller of the height of the current block and 32.
[0354] Also, according to one example, the width or height of the zero-out block may be derived based on whether the current block is divided into sub-blocks and converted. For example, if the current block is divided into sub-blocks and converted, and the width of the divided sub-blocks is 32 and the height of the sub-blocks is less than 64, the width of the sub-blocks may be set to 16. Alternatively, if the current block is divided into sub-blocks and converted, and the height of the divided sub-blocks is 32 and the width of the sub-blocks is less than 64, the height of the sub-blocks may be set to 16.
[0355] Based on the division direction of the current block and the position of the sub-block to which the transformation is applied, a transformation kernel can be derived as shown in Table 11.
[0356] In one embodiment, the size of the zero-out block is one of 32x16, 16x32, 16x16, or 32x32.
[0357] In one embodiment, the size of the current block is 64x64 and the size of the zero-out block is 32x32.
[0358] Meanwhile, the encoding apparatus can derive transform coefficients from residual samples by performing at least one of the above-described transform processes, that is, the linear transform and the non-separable inverse quadratic transform based on Tables 1 and 11.
[0359] The encoding apparatus may derive the last significant coefficient position based on the width or height of the derived zero-out block (S1330).
[0360] According to one example, the encoding apparatus may derive the last significant coefficient position within a size range of a zero-out block having a size smaller than or equal to that of a current block that is not originally a current block, i.e., a transform coefficient to which a transform is applied may be derived within a size range of a zero-out block that is not a current block.
[0361] In one example, the last significant coefficient position is derived based on a prefix codeword indicating the last significant coefficient prefix information and the last significant coefficient suffix information, and the maximum length of the prefix codeword can be derived based on the size of the zero-out block.
[0362] The encoding apparatus may encode a first flag indicating whether a sub-block transform that divides a coding unit into a current block and performs a transform is applied (S1340).
[0363] As mentioned above, the first flag information can be encoded in cu_sbt_flag and signaled at the coding unit level, and the second flag information can be encoded in sps_mts_enabled_flag and signaled at the sequence parameter set level.
[0364] Since the first flag information is signaled for each coding unit and the second flag information is signaled at the sequence parameter set level, which is the upper end of the first flag information, the second flag information can be signaled before S1350.
[0365] The encoding apparatus may derive a context model for last significant coefficient position information based on a width or height of the current block, and encode position information for a value of the last significant coefficient position based on the derived context model (S1350).
[0366] According to an example, the context model may be derived based on the size of the original transform block, which is not the size of the zero-out block. More specifically, the context increment for the x-axis prefix information and the y-axis prefix information corresponding to the last significant coefficient prefix information may be derived based on the size of the original transform block.
[0367] As described above, the last significant coefficient position information may include last significant coefficient prefix information and last significant coefficient suffix information, and the value of the last significant coefficient position may be encoded based on a context model.
[0368] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. If the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. If the transform / inverse transform is omitted, the transform coefficients may be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for uniformity of expression.
[0369] Also, in this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information on the transform coefficient(s), and the information on the transform coefficient(s) may be signaled via a residual coding syntax. Transform coefficients may be derived based on the residual information (or information on the transform coefficient(s)), and scaled transform coefficients may be derived through an inverse transform (scaling) on the transform coefficients. Residual samples may be derived based on an inverse transform (transform) on the scaled transform coefficients. This may be similarly applied / expressed in other parts of this document.
[0370] In the above embodiments, the method is described based on a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and a step can occur in a different order or simultaneously with different steps than those described above. Also, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps can be included, or one or more steps of the flow chart can be deleted without affecting the scope of this document.
[0371] The method according to the present document described above may be embodied in software form, and the encoding device and / or decoding device according to the present document may be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.
[0372] In this document, when the embodiments are implemented in software, the methods described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in a memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices. That is, the embodiments described in this document may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in each drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip.
[0373] In addition, the decoding device and encoding device to which this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), and the like.
[0374] In addition, the processing method to which this document is applied may be produced in the form of a program executed by a computer, and may be stored in a computer-readable recording medium. In addition, multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium may include a medium embodied in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network. In addition, the embodiments of this document may be embodied in a computer program product by a program code, and the program code may be executed by a computer according to the embodiments of this document. The program code may be stored on a computer-readable carrier.
[0375] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined and embodied in an apparatus, and the technical features of the apparatus claims herein may be combined and embodied in a method. Also, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in an apparatus, and the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in a method.
Claims
1. 1. A video decoding method performed by a decoding device, comprising: receiving a bitstream including residual information; deriving transform coefficients for a current block based on the residual information; deriving a residual sample for the current block based on the transform coefficients; deriving a prediction sample for the current block; generating a reconstructed picture based on the residual samples and the predicted samples; The bitstream includes first flag information relating to whether a sub-block transform for dividing a coding unit and performing a transform is applied to the current block; The step of deriving the transform coefficients comprises: If the first flag information is 1, deriving a zero-out block associated with a region in which a valid transform coefficient exists in the current block based on a Multiple Transform Selection (MTS) enabled flag indicating whether an MTS inter enabled flag exists in a sequence parameter set (SPS), The MTSinter enabled flag being equal to 1 indicates that MTS index information may be present for the inter-coding unit, and the MTSinter enabled flag being equal to 0 indicates that the MTS index information is not present for the inter-coding unit; The MTS index information indicates horizontal and vertical transform kernels.
2. Based on the MTS enabled flag indicating that the MTS enabled flag is present in the SPS, the width or height of the zero-out block is set to 16; The video decoding method of claim 1 , wherein the width or height of the zero-out block is set to 32 or less based on the MTS enabled flag indicating that the MTS inter enabled flag is not present in the SPS.
3. The video decoding method of claim 1 , wherein the first flag information is signaled at a coding unit level.
4. The video decoding method of claim 1 , wherein the MTS enabled flag is signaled in the SPS.
5. If the height of a sub-block obtained by dividing the current block is less than 64 and the width of the sub-block is 32, the width of the zero-out block is set to 16; The method of claim 1 , wherein if the width of the sub-block is less than 64 and the height of the sub-block is 32, then the height of the zero-out block is set to 16. 20 .
6. The method of claim 1 , wherein a plurality of transform kernels are derived based on a division direction of the current block and a position of a sub-block to which a transform is applied.
7. The video decoding method of claim 1 , wherein the zero-out block is derived for a luma component of the current block.
8. A video encoding method performed by a video encoding apparatus, comprising: deriving a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; deriving transform coefficients based on residual samples for the current block; and encoding residual information including information about the transform coefficients; The step of deriving the transform coefficients comprises: In the case where a sub-block transform for performing a transform by dividing a coding unit is applied to the current block, the method includes the step of deriving a zero-out block associated with an area in which a valid transform coefficient exists in the current block based on a Multiple Transform Selection (MTS) enabled flag indicating whether an MTS inter enabled flag exists in a sequence parameter set (SPS); The MTSinter enabled flag being equal to 1 indicates that MTS index information may be present for the inter-coding unit, and the MTSinter enabled flag being equal to 0 indicates that the MTS index information is not present for the inter-coding unit; The MTS index information indicates horizontal and vertical transform kernels; The first flag information relating to whether the sub-block transform is applied is encoded into a bitstream.
9. Based on the MTS enabled flag indicating that the MTS enabled flag is present in the SPS, the width or height of the zero-out block is set to 16; The video encoding method of claim 8 , wherein the width or height of the zero-out block is set to 32 or less based on the MTS enabled flag indicating that the MTS inter enabled flag is not present in the SPS.
10. The video encoding method of claim 8 , wherein the first flag information is signaled at a coding unit level.
11. The step of encoding the residual information includes: The method further includes the step of encoding the MTS enabled flag; The video encoding method of claim 8 , wherein the MTS enabled flag is signaled in the SPS.
12. If the height of a sub-block obtained by dividing the current block is less than 64 and the width of the sub-block is 32, the width of the zero-out block is set to 16; The method of claim 8 , wherein if the width of the sub-block is less than 64 and the height of the sub-block is 32, then the height of the zero-out block is set to 16.
13. The method of claim 8 , wherein a plurality of transform kernels are derived based on a division direction of the current block and a position of a sub-block to which a transform is applied.
14. The video encoding method of claim 8 , wherein the zero-out block is derived for a luma component of the current block.
15. Obtaining a bitstream, the bitstream is generated by deriving a predictive sample for a current block, deriving a residual sample for the current block based on the predictive sample, deriving transform coefficients based on the residual sample for the current block, and encoding residual information including information about the transform coefficients; transmitting the bitstream including the residual information; When applying a sub-block transform for performing transform by dividing a coding unit to the current block, the method includes deriving a zero-out block associated with an area in which valid transform coefficients in the current block exist based on a Multiple Transform Selection (MTS) enabled flag indicating whether an MTS inter enabled flag exists in a sequence parameter set (SPS), wherein the MTSinter enabled flag being equal to 1 indicates that MTS index information may exist for an inter coding unit, and the MTSinter enabled flag being equal to 0 indicates that the MTS index information does not exist for the inter coding unit, The MTS index information indicates horizontal and vertical transform kernels; A method of transforming, wherein first flag information relating to whether the sub-block transform is applied is encoded into the bitstream.
