[go: up one dir, main page]

WO2019194420A1 - Image coding method and device on basis of transform indicator - Google Patents

Image coding method and device on basis of transform indicator Download PDF

Info

Publication number
WO2019194420A1
WO2019194420A1 PCT/KR2019/002498 KR2019002498W WO2019194420A1 WO 2019194420 A1 WO2019194420 A1 WO 2019194420A1 KR 2019002498 W KR2019002498 W KR 2019002498W WO 2019194420 A1 WO2019194420 A1 WO 2019194420A1
Authority
WO
WIPO (PCT)
Prior art keywords
transform
current block
index
uti
kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/KR2019/002498
Other languages
French (fr)
Korean (ko)
Inventor
김승환
살레히파메흐디
구문모
임재현
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LG Electronics Inc
Original Assignee
LG Electronics Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LG Electronics Inc filed Critical LG Electronics Inc
Publication of WO2019194420A1 publication Critical patent/WO2019194420A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present invention relates to image coding technology, and more particularly, to an image coding method and apparatus based on a transform indicator in an image coding system.
  • the demand for high resolution and high quality images such as high definition (HD) images and ultra high definition (UHD) images is increasing in various fields.
  • the higher the resolution and the higher quality of the image data the more information or bit rate is transmitted than the existing image data. Therefore, the image data can be transmitted by using a medium such as a conventional wired / wireless broadband line or by using a conventional storage medium. In the case of storage, the transmission cost and the storage cost are increased.
  • a high efficiency image compression technique is required to effectively transmit, store, and reproduce high resolution, high quality image information.
  • An object of the present invention is to provide a method and apparatus for improving image coding efficiency.
  • Another technical problem of the present invention is to provide a method and apparatus for improving conversion efficiency.
  • Another technical problem of the present invention is to provide a method and apparatus for increasing the efficiency of residual coding through transformation.
  • Another technical problem of the present invention is to provide an image coding method and apparatus based on a transform indicator.
  • Another technical problem of the present invention is to provide a method and apparatus for improving image coding efficiency based on a Unified Transform Indicator (UTI) index.
  • UTI Unified Transform Indicator
  • a picture decoding method performed by a decoding apparatus includes decoding an unified transform indicator (UTI) index for a current block from a bitstream, decoding transform coefficients for the current block from the bitstream, and based on the UTI index. Deriving a transform type for a current block, performing an inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform Generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform.
  • UTI unified transform indicator
  • a picture encoding method performed by an encoding device comprises: deriving residual samples for a current block, performing a transform on the residual samples for the current block to derive transform coefficients, an integrated transform indicating a transform type of the performed transform Deriving an indicator (UTI) index and encoding information about the transform coefficients and image information including the UTI index, wherein the UTI index is used for transform kernel and secondary transform for the primary transform. It is characterized by indicating at least one of the conversion kernel for.
  • a decoding apparatus for decoding a picture.
  • the decoding apparatus decodes a Unified Transform Indicator (UTI) index for the current block from the bitstream, decodes transform coefficients for the current block from the bitstream, and applies the current block to the current block based on the decoded UTI index.
  • UTI Unified Transform Indicator
  • An entropy decoding unit that derives a transform type for the transform, an inverse transform unit that performs inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform And an adder for generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for the first transform and a transform kernel for the second transform.
  • an encoding apparatus for encoding a picture.
  • the encoding apparatus may be configured to derive residual samples for a current block, perform a transform on the residual samples for the current block, and to derive transform coefficients, and to indicate a transform type of the performed transform.
  • Deriving a transform indicator (UTI) index and includes an entropy encoding unit for encoding the information about the transform coefficients and the image information including the UTI index, wherein the UTI index is a transform kernel and secondary transform for the primary transform It is characterized by indicating at least one of the conversion kernel for.
  • the overall video / video compression efficiency can be improved.
  • the amount of data to be transmitted for residual processing can be reduced through efficient conversion, and the residual coding efficiency can be improved.
  • image coding efficiency may be improved by performing image coding based on a transform indicator.
  • the conversion may be performed based on the Unified Transform Indicator (UTI) index to increase image coding efficiency.
  • UTI Unified Transform Indicator
  • FIG. 1 is a diagram schematically illustrating a configuration of a video / video encoding apparatus to which the present invention can be applied.
  • FIG. 2 is a diagram schematically illustrating a configuration of a video / video decoding apparatus to which the present invention may be applied.
  • FIG. 3 schematically illustrates a multiple conversion scheme according to an embodiment.
  • 4 exemplarily shows intra directional modes of 65 prediction directions.
  • 5A and 5B are flowcharts illustrating a coding process of transform coefficients, according to an exemplary embodiment.
  • FIG. 6 is a flowchart illustrating a process of coding a transform coefficient according to an embodiment.
  • FIG. 7 is a flowchart illustrating a coding process of transform coefficients, according to an exemplary embodiment.
  • 8A and 8B are flowcharts illustrating a coding order of transform coefficients and UTI indexes, according to an exemplary embodiment.
  • FIG. 9 is a flowchart illustrating an operation of an encoding apparatus according to an embodiment.
  • FIG. 10 is a block diagram illustrating a configuration of an encoding apparatus according to an embodiment.
  • FIG. 11 is a flowchart illustrating an operation of a decoding apparatus according to an embodiment.
  • FIG. 12 is a block diagram illustrating a configuration of a decoding apparatus according to an embodiment.
  • a picture decoding method performed by a decoding apparatus includes decoding an unified transform indicator (UTI) index for a current block from a bitstream, decoding transform coefficients for the current block from the bitstream, and based on the UTI index. Deriving a transform type for a current block, performing an inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform Generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform.
  • UTI unified transform indicator
  • each configuration in the drawings described in the present invention are shown independently for the convenience of description of the different characteristic functions, it does not mean that each configuration is implemented by separate hardware or separate software.
  • two or more of each configuration may be combined to form one configuration, or one configuration may be divided into a plurality of configurations.
  • Embodiments in which each configuration is integrated and / or separated are also included in the scope of the present invention without departing from the spirit of the present invention.
  • a video may mean a series of images over time.
  • a picture generally refers to a unit representing one image in a specific time zone, and a slice is a unit constituting a part of a picture in coding.
  • One picture may be composed of a plurality of slices, and if necessary, the picture and the slice may be mixed with each other.
  • an "image” may mean a concept including a still image and a video, which is a set of a series of still images over time.
  • video does not necessarily mean a set of a series of still images over time, and in some embodiments, may be interpreted as a concept in which still images are included in video.
  • a pixel or a pel may refer to a minimum unit constituting one picture (or image). Also, 'sample' may be used as a term corresponding to a pixel.
  • a sample may generally represent a pixel or a value of a pixel, and may only represent pixel / pixel values of the luma component, or only pixel / pixel values of the chroma component.
  • a unit represents the basic unit of image processing.
  • the unit may include at least one of a specific region of the picture and information related to the region.
  • the unit may be used interchangeably with terms such as block or area in some cases.
  • an M ⁇ N block may represent a set of samples or transform coefficients composed of M columns and N rows.
  • FIG. 1 is a diagram schematically illustrating a configuration of a video / video encoding apparatus to which the present invention may be applied.
  • the encoding / decoding device may include a video encoding / decoding device and / or an image encoding / decoding device, and the video encoding / decoding device is used as a concept including the image encoding / decoding device, or the image encoding / decoding device is It may be used in a concept including a video encoding / decoding device.
  • the (video) encoding apparatus 100 may include a picture partitioning module 105, a prediction module 110, a residual processing module 120, and an entropy encoding unit (
  • the entropy encoding module 130 may include an adder 140, a filtering module 150, and a memory 160.
  • the residual processor 120 may include a substractor 121, a transform module 122, a quantization module 123, a rearrangement module 124, and a dequantization module 125. ) And an inverse transform module 126.
  • the picture divider 105 may divide the input picture into at least one processing unit.
  • the processing unit may be called a coding unit (CU).
  • the coding unit may be recursively split from the largest coding unit (LCU) according to a quad-tree binary-tree (QTBT) structure.
  • QTBT quad-tree binary-tree
  • 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 tree structure.
  • the quad tree structure may be applied first, and the binary tree structure and the ternary tree structure may be applied later.
  • the binary tree structure / tunary tree structure may be applied first.
  • the coding procedure according to the present invention may be performed based on the final coding unit that is no longer split.
  • the maximum coding unit may be used as the final coding unit immediately based on coding efficiency according to the image characteristic, or if necessary, the coding unit is recursively divided into coding units of lower depths and optimized.
  • a coding unit of size may be used as the final coding unit.
  • the coding procedure may include a procedure of prediction, transform, and reconstruction, which will be described later.
  • the processing unit may include a coding unit (CU) prediction unit (PU) or a transform unit (TU).
  • the coding unit may be split from the largest coding unit (LCU) into coding units of deeper depths along the quad tree structure.
  • LCU largest coding unit
  • the maximum coding unit may be used as the final coding unit immediately based on coding efficiency according to the image characteristic, or if necessary, the coding unit is recursively divided into coding units of lower depths and optimized.
  • a coding unit of size may be used as the final coding unit. If a smallest coding unit (SCU) is set, the coding unit may not be split into smaller coding units than the minimum coding unit.
  • the final coding unit refers to a coding unit that is the basis of partitioning or partitioning into a prediction unit or a transform unit.
  • the prediction unit is a unit partitioning from the coding unit and may be a unit of sample prediction. In this case, the prediction unit may be divided into sub blocks.
  • the transform unit may be divided along the quad tree structure from the coding unit, and may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.
  • a coding unit may be called a coding block (CB)
  • a prediction unit is a prediction block (PB)
  • a transform unit may be called a transform block (TB).
  • a prediction block or prediction unit may mean a specific area in the form of a block within a picture, and may include an array of prediction samples.
  • a transform block or a transform unit may mean a specific area in a block form within a picture, and may include an array of transform coefficients or residual samples.
  • the prediction unit 110 performs prediction on a block to be processed (hereinafter, may mean a current block or a residual block), and generates a predicted block including prediction samples for the current block. can do.
  • the unit of prediction performed by the prediction unit 110 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. As an example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied on a CU basis.
  • the prediction unit 110 may derive a prediction sample for the current block based on reference samples outside the current block in the picture to which the current block belongs (hereinafter, referred to as the current picture). In this case, the prediction unit 110 may (i) derive the prediction sample based on the average or interpolation of neighboring reference samples of the current block, and (ii) the neighbor reference of the current block.
  • the prediction sample may be derived based on a reference sample present in a specific (prediction) direction with respect to the prediction sample among the samples. In case of (i), it may be called non-directional mode or non-angle mode, and in case of (ii), it may be called directional mode or angular mode.
  • the prediction mode may have, for example, 33 directional prediction modes and at least two non-directional modes.
  • the non-directional mode may include a DC prediction mode and a planner mode (Planar mode).
  • the prediction unit 110 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.
  • the prediction unit 110 may derive the prediction sample for the current block based on the sample specified by the motion vector on the reference picture.
  • the prediction unit 110 may apply one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode to derive a prediction sample for the current block.
  • the prediction unit 110 may use the motion information of the neighboring block as the motion information of the current block.
  • the skip mode unlike the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted.
  • the MVP mode the motion vector of the current block may be derived using the motion vector of the neighboring block as a motion vector predictor.
  • the neighboring block may include a spatial neighboring block existing in the current picture and a temporal neighboring block present in the reference picture.
  • a reference picture including the temporal neighboring block may be called a collocated picture (colPic).
  • the motion information may include a motion vector and a reference picture index.
  • Information such as prediction mode information and motion information may be encoded (entropy) and output in the form of a bitstream.
  • the highest picture on the reference picture list may be used as the reference picture.
  • Reference pictures included in a reference picture list may be sorted based on a difference in a picture order count (POC) between a current picture and a corresponding reference picture.
  • POC picture order count
  • the subtraction unit 121 generates a residual sample which is a difference between the original sample and the prediction sample.
  • residual samples may not be generated as described above.
  • the transform unit 122 generates transform coefficients by transforming the residual sample in units of transform blocks.
  • the transform unit 122 may perform the transform according to the size of the transform block and the prediction mode applied to the coding block or the prediction block that spatially overlaps the transform block. For example, if intra prediction is applied to the coding block or the prediction block that overlaps the transform block, and the transform block is a 4 ⁇ 4 residual array, the residual sample is configured to perform a discrete sine transform (DST) transform kernel.
  • the residual sample may be transformed using a discrete cosine transform (DCT) transform kernel.
  • DST discrete sine transform
  • DCT discrete cosine transform
  • the quantization unit 123 may quantize the transform coefficients to generate quantized transform coefficients.
  • the reordering unit 124 rearranges the quantized transform coefficients.
  • the reordering unit 124 may reorder the quantized transform coefficients in the form of a block into a one-dimensional vector form through a coefficient scanning method. Although the reordering unit 124 has been described in a separate configuration, the reordering unit 124 may be part of the quantization unit 123.
  • the entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients.
  • Entropy encoding may include, for example, encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), and the like.
  • the entropy encoding unit 130 may encode information necessary for video reconstruction other than the quantized transform coefficients (for example, a value of a syntax element) together or separately according to entropy encoding or a predetermined method.
  • the encoded information may be transmitted or stored in units of network abstraction layer (NAL) units in the form of bitstreams.
  • the bitstream may be transmitted over a network or may be stored in a digital storage medium.
  • the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like.
  • the inverse quantization unit 125 inverse quantizes the quantized values (quantized transform coefficients) in the quantization unit 123, and the inverse transformer 126 inverse transforms the inverse quantized values in the inverse quantization unit 125 to obtain a residual sample.
  • the adder 140 reconstructs the picture by combining the residual sample and the predictive sample.
  • the residual sample and the predictive sample may be added in units of blocks to generate a reconstructed block.
  • the adder 140 may be part of the predictor 110.
  • the adder 140 may also be called a reconstruction module or a restore block generator.
  • the filter unit 150 may apply a deblocking filter and / or a sample adaptive offset to the reconstructed picture. Through deblocking filtering and / or sample adaptive offset, the artifacts of the block boundaries in the reconstructed picture or the distortion in the quantization process can be corrected.
  • the sample adaptive offset may be applied on a sample basis and may be applied after the process of deblocking filtering is completed.
  • the filter unit 150 may apply an adaptive loop filter (ALF) to the reconstructed picture. ALF may be applied to the reconstructed picture after the deblocking filter and / or sample adaptive offset is applied.
  • ALF adaptive loop filter
  • the memory 160 may store reconstructed pictures (decoded pictures) or information necessary for encoding / decoding.
  • the reconstructed picture may be a reconstructed picture after the filtering process is completed by the filter unit 150.
  • the stored reconstructed picture may be used as a reference picture for (inter) prediction of another picture.
  • the memory 160 may store (reference) pictures used for inter prediction.
  • pictures used for inter prediction may be designated by a reference picture set or a reference picture list.
  • FIG. 2 is a diagram schematically illustrating a configuration of a video / video decoding apparatus to which the present invention can be applied.
  • the video decoding apparatus may include an image decoding apparatus.
  • the (video) decoding apparatus 200 may include an entropy decoding module 210, a residual processing module 220, a prediction module 230, and an adder. , 240, a filtering module 250, and a memory 260.
  • the residual processor 220 may include a rearrangement module 221, a dequantization module 222, and an inverse transform module 223.
  • the video decoding apparatus 200 may include a receiver that receives a bitstream including video information. The receiver may be configured as a separate module or may be included in the entropy decoding unit 210.
  • the (video) decoding apparatus 200 may restore the video / image / picture in response to a process in which the video / image information is processed in the (video) encoding apparatus. .
  • the video decoding apparatus 200 may perform video decoding using a processing unit applied in the video encoding apparatus.
  • the processing unit block of video decoding may be, for example, a coding unit, and in another example, a coding unit, a prediction unit, or a transform unit.
  • the coding unit may be split along the quad tree structure, binary tree structure and / or ternary tree structure from the largest coding unit.
  • the prediction unit and the transform unit may be further used in some cases, in which case the prediction block is a block derived or partitioned from the coding unit and may be a unit of sample prediction. At this point, the prediction unit may be divided into subblocks.
  • the transform unit may be divided along the quad tree structure from the coding unit, and may be a unit for deriving a transform coefficient or a unit for deriving a residual signal from the transform coefficient.
  • the entropy decoding unit 210 may parse the bitstream and output information necessary for video reconstruction or picture reconstruction. For example, the entropy decoding unit 210 decodes information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, quantized values of syntax elements necessary for video reconstruction, and residual coefficients. Can be output.
  • a coding method such as exponential Golomb coding, CAVLC, or CABAC, quantized values of syntax elements necessary for video reconstruction, and residual coefficients. Can be output.
  • the CABAC entropy decoding method receives a bin corresponding to each syntax element in a bitstream, and decodes syntax element information and decoding information of neighboring and decoding target blocks or information of symbols / bins decoded in a previous step.
  • the context model is determined using the context model, the probability of occurrence of a bin is predicted according to the determined context model, and arithmetic decoding of the bin is performed to generate a symbol corresponding to the value of each syntax element. can do.
  • the CABAC entropy decoding method may update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model.
  • the information related to the prediction among the information decoded by the entropy decoding unit 210 is provided to the prediction unit 230, and the residual value on which the entropy decoding has been performed by the entropy decoding unit 210, that is, the quantized transform coefficient, is used as a reordering unit ( 221 may be input.
  • the reordering unit 221 may rearrange the quantized transform coefficients in a two-dimensional block form.
  • the reordering unit 221 may perform reordering in response to coefficient scanning performed by the encoding apparatus.
  • the rearrangement unit 221 has been described in a separate configuration, but the rearrangement unit 221 may be part of the inverse quantization unit 222.
  • the inverse quantization unit 222 may dequantize the quantized transform coefficients based on the (inverse) quantization parameter and output the transform coefficients.
  • information for deriving a quantization parameter may be signaled from the encoding apparatus.
  • the inverse transform unit 223 may inversely transform transform coefficients to derive residual samples.
  • the prediction unit 230 may perform prediction on the current block and generate a predicted block including prediction samples for the current block.
  • the unit of prediction performed by the prediction unit 230 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 230 may determine whether to apply intra prediction or inter prediction based on the information about the prediction.
  • a unit for determining which of intra prediction and inter prediction is to be applied and a unit for generating a prediction sample may be different.
  • the unit for generating a prediction sample in inter prediction and intra prediction may also be different.
  • whether to apply inter prediction or intra prediction may be determined in units of CUs.
  • a prediction mode may be determined and a prediction sample may be generated in PU units
  • intra prediction a prediction mode may be determined in PU units and a prediction sample may be generated in TU units.
  • the prediction unit 230 may derive the prediction sample for the current block based on the neighbor reference samples in the current picture.
  • the prediction unit 230 may derive the prediction sample for the current block by applying the directional mode or the non-directional mode based on the neighbor reference samples of the current block.
  • the prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.
  • the prediction unit 230 may derive the prediction sample for the current block based on the sample specified on the reference picture by the motion vector on the reference picture.
  • the prediction unit 230 may apply any one of a skip mode, a merge mode, and an MVP mode to derive a prediction sample for the current block.
  • motion information required for inter prediction of the current block provided by the video encoding apparatus for example, information about a motion vector, a reference picture index, and the like may be obtained or derived based on the prediction information.
  • the motion information of the neighboring block may be used as the motion information of the current block.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • the prediction unit 230 may construct a merge candidate list using motion information of available neighboring blocks, and may use information indicated by the merge index on the merge candidate list as a motion vector of the current block.
  • the merge index may be signaled from the encoding device.
  • the motion information may include a motion vector and a reference picture. When the motion information of the temporal neighboring block is used in the skip mode and the merge mode, the highest picture on the reference picture list may be used as the reference picture.
  • the difference (residual) between the prediction sample and the original sample is not transmitted.
  • the motion vector of the current block may be derived using the motion vector of the neighboring block as a motion vector predictor.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • a merge candidate list may be generated by using a motion vector of a reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block, which is a temporal neighboring block.
  • the motion vector of the candidate block selected from the merge candidate list is used as the motion vector of the current block.
  • the information about the prediction may include a merge index indicating a candidate block having an optimal motion vector selected from candidate blocks included in the merge candidate list.
  • the prediction unit 230 may derive the motion vector of the current block by using the merge index.
  • a motion vector predictor candidate list may be generated using a motion vector of a reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block, which is a temporal neighboring block.
  • the prediction information may include a prediction motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list.
  • the prediction unit 230 may select the predicted motion vector of the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index.
  • the prediction unit of the encoding apparatus may obtain a motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and may encode the output vector in a bitstream form. That is, MVD may be obtained by subtracting the motion vector predictor from the motion vector of the current block.
  • the prediction unit 230 may obtain a motion vector difference included in the information about the prediction, and derive the motion vector of the current block by adding the motion vector difference and the motion vector predictor.
  • the prediction unit may also obtain or derive a reference picture index or the like indicating a reference picture from the information about the prediction.
  • the adder 240 may reconstruct the current block or the current picture by adding the residual sample and the predictive sample.
  • the adder 240 may reconstruct the current picture by adding the residual sample and the predictive sample in block units. Since the residual is not transmitted when the skip mode is applied, the prediction sample may be a reconstruction sample.
  • the adder 240 has been described in a separate configuration, the adder 240 may be part of the predictor 230.
  • the adder 240 may also be called a reconstruction module or a reconstruction block generator.
  • the filter unit 250 may apply the deblocking filtering sample adaptive offset, and / or ALF to the reconstructed picture.
  • the sample adaptive offset may be applied in units of samples and may be applied after deblocking filtering.
  • ALF may be applied after deblocking filtering and / or sample adaptive offset.
  • the memory 260 may store reconstructed pictures (decoded pictures) or information necessary for decoding.
  • the reconstructed picture may be a reconstructed picture after the filtering process is completed by the filter unit 250.
  • the memory 260 may store pictures used for inter prediction.
  • pictures used for inter prediction may be designated by a reference picture set or a reference picture list.
  • the reconstructed picture can be used as a reference picture for another picture.
  • the memory 260 may output the reconstructed picture in an output order.
  • a predicted block including prediction samples of the current block which is a coding target block
  • the predicted block comprises prediction samples in the spatial domain (or pixel domain).
  • the predicted block is derived identically in the encoding apparatus and the decoding apparatus, and the encoding apparatus decodes information (residual information) about the residual between the original block and the predicted block, not the original sample value itself of the original block. Signaling to an apparatus may increase image coding efficiency.
  • the decoding apparatus may derive a residual block including residual samples based on the residual information, generate the reconstructed block including reconstructed samples by adding the residual block and the predicted block, and generate reconstructed blocks. A reconstructed picture may be generated.
  • the residual information may be generated through a transform and quantization procedure.
  • the encoding apparatus derives a residual block between the original block and the predicted block, and performs transform procedure on residual samples (residual sample array) included in the residual block to derive transform coefficients.
  • the quantized transform coefficients may be derived by performing a quantization procedure on the transform coefficients to signal related residual information to the decoding device (via a bitstream).
  • the residual information may include information such as value information of the quantized transform coefficients, position information, a transform scheme, a transform kernel, and a quantization parameter.
  • the decoding apparatus may perform an inverse quantization / inverse transformation procedure and derive residual samples (or residual blocks) based on the residual information.
  • the decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block.
  • the encoding apparatus may then dequantize / inverse transform the quantized transform coefficients for reference for inter prediction of the picture to derive a residual block, and generate a reconstructed picture based thereon.
  • the transform unit may correspond to a transform unit in the encoding apparatus of FIG. 1, and the inverse transform unit may correspond to an inverse transform unit in the encoding apparatus of FIG. 1 or an inverse transform unit in the decoding apparatus of FIG. 2. .
  • the transform unit may derive (primary) transform coefficients by performing a first-order transform based on the residual samples (residual sample array) in the residual block (S310).
  • the first transform may include a multiple transform set.
  • Multiple transform sets may be referred to as adaptive multiple core transforms as the case may be.
  • the adaptive multiple core transform may be referred to as adaptive multiple transform (AMT), explicit multiple transform (EMT), or multiple transform transformation (MTS).
  • the adaptive multi-core transform may represent a method of additionally using a discrete cosine transform (DCT) type 2, a discrete sine transform (DST) type 7, a DCT type 8, and / or a DST type 1. That is, the multi-core transform is a frequency domain of a residual signal (or residual block) of the spatial 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.
  • a transform method of converting to transform coefficients (or first-order transform coefficients) may be represented.
  • the first-order transform coefficients may be referred to as temporary transform coefficients from a transform unit point of view.
  • transform coefficients may be generated by applying the spatial domain to the frequency domain transform for the residual signal (or the residual block) based on the DCT type 2.
  • the residual signal (or the residual block) on the DCT type 2, the DST type 7, the DCT type 8, the DST type 1, and / or the DST type 5 is applied.
  • the transform from the spatial domain to the frequency domain may be applied to generate transform coefficients (or first order transform coefficients).
  • DCT type 2, DST type 7, DCT type 8, DST type 1, and / or DST type 5 may be referred to as a conversion type, a conversion kernel, or a conversion core.
  • the transformation kernel according to an example may include information about a transformation algorithm applicable for the corresponding transformation.
  • the DCT / DST conversion types may be defined based on base functions, and the base functions may be represented as the following table.
  • a vertical transform kernel and a horizontal transform kernel for a target block among the transform kernels may be selected, and a vertical transform on the target block is performed based on the vertical transform kernel.
  • the horizontal transformation may be performed on the target block based on the horizontal transformation kernel.
  • the horizontal transform may indicate a transform for horizontal components of the target block
  • the vertical transform may indicate a transform for vertical components of the target block.
  • the vertical transform kernel / horizontal transform kernel may be adaptively determined based on the prediction mode of the target block (CU or subblock) enclosing the residual block and / or the transform index indicating the transform subset.
  • the transform unit may derive the (secondary) transform coefficients by performing a quadratic transformation based on the (primary) transform coefficients (S320). If the first order transform was from spatial domain to frequency domain, then the second order transform can be viewed as a frequency domain to frequency domain transformation.
  • the secondary transform may include a non-separable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST).
  • the transformation may be applied at once without applying the vertical and horizontal transformations (or independently of the horizontal and vertical transformations) to the (primary) transformation coefficients based on the non-separated transformation matrix.
  • the non-separated second-order transform generates transform coefficients (or second-order transform coefficients) by transforming together the vertical and horizontal components of the (primary) transform coefficients without separating them based on the non-separated transform matrix. It can represent the conversion method.
  • the non-separated secondary transform may be applied to a top-left region of a block composed of (primary) transform coefficients (hereinafter, referred to as a transform coefficient block).
  • a transform coefficient block For example, when the width W and the height H of the transform coefficient block are both 8 or more, an 8x8 non-separated secondary transform may be applied to the upper left 8x8 region of the transform coefficient block.
  • 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
  • 4 ⁇ 4 non-separated secondary A transform may be applied to the upper left min (8, W) ⁇ min (8, H) region of the transform coefficient block.
  • the embodiment is not limited thereto.
  • a 4 ⁇ 4 non-separated quadratic transform is applied to the upper left end of the transform coefficient block. It may also be applied to the min (8, W) ⁇ min (8, H) region.
  • non-separated quadratic transformation may be performed as follows.
  • the 4x4 input block X may be represented as follows.
  • the second order non-separation transform can be calculated as follows.
  • T denotes a 16x16 (non-separated) transform matrix
  • the non-separated secondary transform may be mode dependent, and a transform kernel (or a transform core or a transform type) may be selected.
  • the mode may include an intra prediction mode and / or an inter prediction mode.
  • the non-separated secondary transform may be performed based on an 8 ⁇ 8 transform or a 4 ⁇ 4 transform determined based on the width W and the height H of the transform coefficient block. That is, the non-separated quadratic transform may be performed based on an 8 ⁇ 8 subblock size or a 4 ⁇ 4 subblock size.
  • the mode based transform kernel selection 35 sets of non-separated secondary transform kernels, 3 for non-separated secondary transform, for both 8x8 subblock size and 4x4 subblock size, Can be configured. That is, 35 transform sets may be configured for an 8 ⁇ 8 subblock size, and 35 transform sets may be configured for a 4 ⁇ 4 subblock size.
  • 35 transform sets for 8 ⁇ 8 subblock sizes may include three 8 ⁇ 8 transform kernels, and in this case, 35 transform sets for 4 ⁇ 4 subblock sizes, three 4 ⁇ for each 4 translation kernels may be included.
  • the transform subblock size, the number of sets and the number of transform kernels in the set may be used as an example, other than 8 ⁇ 8 or 4 ⁇ 4, or n sets are configured and k sets are included in each set. Conversion kernels may be included.
  • the translation set may be called an NSST set, and the translation kernel within the NSST set may be called an NSST kernel. Selection of a specific set of the transform sets may be performed based on, for example, the intra prediction mode of the target block (CU or subblock).
  • the intra prediction mode includes two non-directinoal or non-angular intra prediction modes and 65 directional or angular intra prediction modes. Can include them.
  • the non-directional intra prediction modes may include a planar intra prediction mode of 0 and a DC intra prediction mode of 1, and the directional intra prediction modes may include 65 intra prediction modes of 2 to 66. .
  • the present invention may be applied to a case where the number of intra prediction modes is different.
  • the intra prediction mode 67 may further be used, and the intra prediction mode 67 may represent a linear model (LM) mode.
  • LM linear model
  • 4 exemplarily shows intra directional modes of 65 prediction directions.
  • an intra prediction mode having horizontal directionality and an intra prediction mode having vertical directionality may be distinguished from an intra prediction mode 34 having a left upward diagonal prediction direction.
  • H and V in FIG. 3 mean horizontal directionality and vertical directionality, respectively, and numbers of -32 to 32 represent a displacement of 1/32 on a sample grid position.
  • Intra prediction modes 2 to 33 have horizontal orientation, and intra prediction modes 34 to 66 have vertical orientation.
  • Intra prediction mode 18 and intra prediction mode 50 indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and an intra prediction mode 2 indicates a left downward diagonal intra prediction mode,
  • the 34th intra prediction mode may be referred to as a left upward diagonal intra prediction mode, and the 66th intra prediction mode may be referred to as a right upward diagonal intra prediction mode.
  • mapping between the 35 transform sets and the intra prediction modes may be represented, for example, in the following table.
  • the quadratic transformation may not be applied to the target block.
  • one of k transform kernels in the particular set may be selected via a non-separated secondary transform index.
  • the encoding apparatus may derive a non-separated secondary transform index pointing to a specific transform kernel based on a rate-distortion (RD) check, and may signal the non-separated secondary transform index to the decoding apparatus.
  • the decoding apparatus may select one of k transform kernels in a specific set based on the non-separated secondary transform index.
  • NSST index value 0 can point to the first non-isolated secondary transform kernel
  • NSST index value 1 can point to the second non-isolated secondary transform kernel
  • NSST index value 2 is the third non-isolated secondary transform kernel.
  • the NSST index value 0 may indicate that the first non-separated secondary transform is not applied to the target block
  • the NSST index values 1 to 3 may indicate the three transform kernels.
  • the transform unit may perform the non-separated secondary transform based on the selected transform kernels and obtain (secondary) transform coefficients.
  • the transform coefficients may be derived as quantized transform coefficients through the quantization unit as described above, and may be encoded and transferred to the decoding apparatus and to the inverse quantization / inverse transform unit in the encoding apparatus.
  • the (primary) transform coefficients which are outputs of the primary (separated) transform, may be derived as quantized transform coefficients through the quantization unit as described above, and may be encoded.
  • the decoding apparatus may be transferred to an inverse quantization / inverse transform unit in the signaling and encoding apparatus.
  • the inverse transform unit may perform a series of procedures in a reverse order of the procedure performed in the above-described transform unit.
  • the inverse transform unit receives the (inverse quantized) transform coefficients, performs a second order (inverse) transform, and derives (first order) transform coefficients (S350), and performs a first order (inverse) on the (first order) transform coefficients.
  • the transformation may be performed to obtain a residual block (residual samples).
  • the first transform coefficients may be referred to as modified transform coefficients from an inverse transform unit.
  • the encoding apparatus and the decoding apparatus may generate a reconstructed block based on the residual block and the predicted block, and generate a reconstructed picture based on the residual block and the predicted block.
  • a residual block (residual samples) may be obtained by receiving the (dequantized) transform coefficients and performing the first (separated) transform.
  • the encoding apparatus and the decoding apparatus may generate a reconstructed block based on the residual block and the predicted block, and generate a reconstructed picture based on the residual block and the predicted block.
  • 5A and 5B are flowcharts illustrating a coding process of transform coefficients, according to an exemplary embodiment.
  • FIGS. 5A and 5B may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 and the disclosure illustrated in FIG. 1. It may be performed by the entropy decoding unit 210 disclosed in FIG.
  • the "non-transform-skip mode" of the non-transform coefficients of the transform coefficients for the current block may also mean a target block or residual block.
  • a flag for indicating whether the number is less than two or a flag indicating whether a non-zero transform coefficient exists among the transform coefficients for the current block is indicated by the cbf flag.
  • the "cbf flag” may be replaced with various terms such as coded_block_flag, cbf, and the term or sentence used to define a specific information or concept in the present specification is to be interpreted limited to its name when interpreting throughout the specification. Rather, it is necessary to pay attention to and interpret various operations, functions, and effects as the term means.
  • 5A illustrates an example of an encoding process of transform coefficients.
  • the encoding apparatus 100 may include a flag indicating whether at least one non-zero transform coefficient among the transform coefficients for the current block exists or the number of nonzero transform coefficients among the transform coefficients for the current block. It may be determined whether or not the cbf flag indicating a flag indicating 1 is 1 or less (S500). If the cbf flag indicates 1, it may indicate that there is at least one non-zero transform coefficient among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block is present. Two or more may be present.
  • the cbf flag indicates 0, it may indicate that there are no non-zero transform coefficients among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block. May be present in fewer than two.
  • the cbf flag is a flag for the luma block (eg cbf_luma flag, cbf_luma [x0] [y0] [tranfoDepth]) and a flag for the chroma block (eg cbf_cb flag and cbf_cr flag, or cbf_cb [x0] [y0] [trafoDepth] and cbf_cr [x0] [y0] [trafoDepth]).
  • the array indexes x0 and y0 are the top-left of the current picture.
  • the array index trafoDepth may refer to a level at which the coding block is divided for transform coding purposes. If the coding block and the transform block are defined to be identical to the coding block, the blocks in which trafoDepth indicates 0 may be regarded as trafoDepth.
  • the encoding apparatus 100 may encode information about transform coefficients for the current block (S510).
  • the information about the transform coefficients for the current block includes information on the position of the last non-zero transform coefficient, group flag information indicating whether a non-zero transform coefficient is included in a subblock of the current block, EMT_CU_Flag (or MTS_CU_Flag), EMT_TU (or MTS_TU), EMT_TU index (or MTS_TU index), transform coefficients (value of) for the current block, and the like.
  • the encoding apparatus 100 may determine whether it corresponds to a condition for performing NSST (S520). More specifically, the encoding apparatus 100 may determine whether it corresponds to a condition for encoding the NSST index.
  • the NSST index may be referred to as, for example, a transform index.
  • the encoding apparatus 100 may omit the operations according to S510, S520, and S530.
  • the encoding apparatus 100 may omit the operation according to S530 when it is determined in S520 that it does not correspond to a condition for performing NSST.
  • 5B illustrates an example of a decoding process of transform coefficients.
  • the decoding apparatus 200 may determine whether the cbf flag indicates 1 (S540). If the cbf flag indicates 1, it may indicate that there is at least one non-zero transform coefficient among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block is Two or more may be present. Conversely, if the cbf flag indicates 0, it may indicate that there are no non-zero transform coefficients among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block. May be present in fewer than two.
  • the decoding apparatus 200 may decode information about transform coefficients for the current block when the cbf flag indicates 1 in S540 (S550).
  • the decoding apparatus 200 may determine whether it corresponds to a condition for performing NSST (S560). More specifically, the decoding apparatus 200 may determine whether it corresponds to a condition for encoding the NSST index.
  • the decoding apparatus 200 may omit the operations according to S550, S560, and S570.
  • the decoding apparatus 200 may omit the operation according to S570.
  • FIG. 6 is a flowchart illustrating a process of coding a transform coefficient according to an embodiment.
  • Each step disclosed in FIG. 6 may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 disclosed in FIG. 1 or the disclosure described in FIG. 2. It may be performed by the entropy decoding unit 210.
  • S600 of FIG. 6 may correspond to S500 of FIG. 5A and S540 of FIG. 5B
  • S605 to S625 and S645 of FIG. 6 may correspond to S510 of FIG. 5A and S550 of FIG. 5B
  • S635 may correspond to S520 and S530 of FIG. 5A and S560 and S570 of FIG. 5B. Therefore, specific details overlapping with the above-described contents in FIGS. 1, 2, 5A, and 5B will be omitted or simply described.
  • a transform performed first on residual samples for a current block is referred to as a primary transform
  • a transform performed second is referred to as a secondary transform.
  • the primary transform may be referred to by various names such as core transform, core transform, primary transform, primary transform, adaptive multiple transform, AMT, EMT, MTS, and secondary transform may be non-separated secondary transform, NSST, MDNSST, etc. It may be referred to by various names, examples are not limited thereto.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the cbf flag indicates 1 (S600).
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether a single transform indicator (STI) indicates 1 (S605).
  • STI in this specification indicates whether to apply a single transform instead of applying both transforms (eg, primary transform and secondary transform) to transform the residual coefficients. It may mean information for.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the STI is enabled, and when the STI is enabled, the STI sets 1 Can be determined.
  • the process of determining whether the STI is activated is not a required process, and in another embodiment, it may be determined whether the STI indicates 1 directly without determining whether the STI is activated. Alternatively, if the STI indicates 1 in some cases, it may indicate that the STI is activated.
  • the STI may be referred to as STI coding, STI coding flag, ST flag, or the like.
  • STI When the STI indicates 1, it may mean that a single transform is applied in converting the residual coefficients.
  • the STI indicates 0 it may mean that a single transform is not applied in converting the residual coefficients.
  • a single transformation can vary.
  • Examples of a single transform may be a separable transform, a non-separable transform, an approximated transform from the non-separable transform, and the like.
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) EMT_CU_Flag (or MTS_CU_Flag, hereinafter same) when STI indicates 0 in S605 (S610).
  • the encoding apparatus 100 or the decoding apparatus 200 may skip the operations according to S605 and S610 and proceed to the operation according to S615.
  • the EMT (or MTS, hereinafter same) may correspond to an example of first-order transformation or core transformation, as described above with reference to FIG. 3.
  • the EMT (or MTS) may be applied to a coding block CU whose width and height are less than or equal to 32, and in some cases, may be applied to a coding block smaller than or equal to 64.
  • Whether to apply EMT (or MTS) may be controlled based on the EMT_CU_Flag (or MTS_CU_Flag) signaled at the CU level. If EMT_CU_Flag (or MTS_CU_Flag) indicates 0, DCT type 2 may be used to perform residual coding for the current block. Two additional flags may be signaled to identify the horizontal and vertical transforms to be used in the luma coding block in the coding block to which the EMT (or MTS) is applied.
  • a mode-dependent transform candidate selection process may be used due to different residual states of different intra prediction modes. Examples of the three transform subsets are shown in Table 3 below, and the relationship between the intra prediction mode and the transform subset is shown in Table 4 below.
  • one transform (sub) set may be derived using the intra prediction mode when EMT_CU_flag (or MTS_CU_flag) indicates 1 according to Table 3.
  • EMT_TU_horizontal_index (or MTS_TU_horizontal_index, hereinafter same), which is the EMT_TU index (or MTS_TU_index, hereinafter same) in the horizontal direction for each intra mode, or the same as the EMT_TU_horizontal_flag (or, MTS_TU_horizontal_flag, hereinafter vertical)
  • EMT_TU_vertical_index (or MTS_TU_vertical_index, hereinafter same) or EMT_TU_horizontal_flag (or EMT_TU_horizontal_flag, hereinafter same)
  • EMT_TU_horizontal_flag (or EMT_TU_horizontal_flag, hereinafter same)
  • a flag for determining one of the transform candidates may be signaled.
  • the decoding apparatus 200 decodes EMT_CU_Flag (MTS_CU_Flag), and when EMT_CU_Flag (MTS_CU_Flag) indicates 1, one transform set using an intra prediction mode based on Table 3 Can be derived.
  • EMT_CU_Flag EMT_CU_Flag
  • MTS_CU_Flag EMT_CU_Flag
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) transform coefficients for the current block (S615). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode transform coefficients derived by performing transform on residual coefficients for the current block.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU (or MTS_TU, hereinafter identical) is coded (or coded) (S620). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU index (or MTS_TU index) is coded.
  • the EMT_TU index (or MTS_TU index) is the EMT_TU_horizontal_index (MTS_TU_horizontal_index) (or EMT_TU_horizontal_flag (MTS_TU_horizontal_flag) in the vertical direction (or EMT_TU_horizontal_flag)), which is the EMT_TU index (or MTS_TU index) in the horizontal direction, as described above. It may include an EMT_TU_vertical_index (MTS_TU_vertical_index) (or an EMT_TU_vertical_flag (MTS_TU_vertical_flag)) which is an MTS_TU index.
  • the encoding apparatus 100 or the decoding apparatus 200 may be added to the EMT_TU index (or, MTS_TU index). The coding may be skipped and an operation according to S630 may be performed.
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) the EMT_TU index (or MTS_TU index). There is (S625). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code an EMT_TU index (or MTS_TU index) for each intra mode.
  • the encoding apparatus 100 or the decoding apparatus 200 may have an EMT_TU_horizontal_index (MTS_TU_horizontal_index) (or EMT_TU_horizontal_flag (MTS_TU_horizontal_flag)) which is a horizontal EMT_TU index (or MTS_TU index) for each intra mode.
  • EMT_TU_vertical_index (MTS_TU_vertical_index) (or EMT_TU_vertical_flag (MTS_TU_vertical_flag)) that is (or MTS_TU index) may be coded.
  • EMT_TU index (or MTS_TU index) may be as shown in Table 3, and an example in which an EMT_TU index (or MTS_TU index) is allocated to each intra mode may be as shown in Table 4.
  • a flag for determining one of two transform candidates included in the transform set of Table 3 may be further signaled.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for performing NSST (S630). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for coding (encoding or decoding) the NSST index.
  • the encoding apparatus 100 or the decoding apparatus 200 may code an NSST index when it is determined that the condition corresponds to a condition for performing NSST in S630 (S635). More specifically, when it is determined in S630 that the conditions for coding the NSST index, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode the NSST index.
  • the encoding apparatus 100 or the decoding apparatus 200 may code an STI index when STI indicates 1 in S605 (S640). More specifically, when the STI is activated and the STI indicates 1, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index.
  • the embodiment is not limited thereto, and in another embodiment, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index regardless of whether the STI indicates one. In other words, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index without omitting the determination of whether the STI indicates 1.
  • the STI index may mean an index corresponding to a transform (or a transform kernel) to be applied to the current block among a plurality of available transform candidates.
  • the decoding apparatus 200 may derive the STI without separate signaling from the encoding apparatus 100.
  • a condition in which the size of the current block is the same as a predetermined value such as 4 and 8 a condition in which the current block is a square shape having the same width and height, and an intra prediction mode are predetermined as in the DC mode or the planar mode. If at least one of the conditions, which is one of the modes, is satisfied, the STI may indicate 1.
  • the decoding apparatus 200 may receive information on the STI from the encoding apparatus 100. That is, information about the STI may be signaled from the encoding apparatus 100 to the decoding apparatus 200. In addition, the information on the STI may be conditionally signaled in consideration of at least one of the size of the current block, the shape of the current block, and the intra prediction mode.
  • the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block (S645). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block based on the STI index derived in S640.
  • transform coefficients for the current block may be coded before the STI index is coded. That is, the transform coefficients for the current block are coded before the STI index is coded, so that information obtained in the process of deriving the transform coefficients for the current block may be used when deriving the STI index.
  • the STI index may be determined based on at least one of the size of the current block, the intra prediction mode, and the number of nonzero transform coefficients.
  • the STI index may be conditionally encoded or decoded based on at least one of the size of the current block, the shape of the current block, the intra prediction mode, and the number of nonzero transform coefficients.
  • whether to skip signaling of the STI index may be determined based on a distribution state of non-zero transform coefficients in the current block. More specifically, when a non-zero transform coefficient is detected in a region except the upper left 4x4 region of the current block, signaling of the STI index may be skipped.
  • FIG. 7 is a flowchart illustrating a coding process of transform coefficients, according to an exemplary embodiment.
  • Each step disclosed in FIG. 7 may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 disclosed in FIG. 1 or the disclosure described in FIG. 2. It may be performed by the entropy decoding unit 210.
  • S700 of FIG. 7 may correspond to S500 of FIG. 5A and S540 of FIG. 5B
  • S705 to S725 and S745 of FIG. 7 may correspond to S510 of FIG. 5A and S550 of FIG. 5B
  • S735 may correspond to S520 and S530 of FIG. 5A and S560 and S570 of FIG. 5B. Accordingly, detailed descriptions overlapping with those described above in FIGS. 1, 2, 5A, 5B, and 6 will be omitted or simplified.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the cbf flag indicates 1 (S700).
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the Unified Transform Indicator (UTI) indicates 1 when the cbf flag indicates 1 in S700 (S705).
  • UTI may include an indicator of each of two transforms (eg, a primary transform and a secondary transform) for transforming residual coefficients.
  • the UTI can include at least one of a primary transform indicator and a secondary transform indicator.
  • the primary transform indicator may indicate a transform kernel for the primary transform and the secondary transform indicator may indicate a transform kernel for the secondary transform.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the UTI is enabled when the cbf flag indicates 1 in S700, and if the UTI is enabled, the UTI is 1. Can be determined. However, the process of determining whether the UTI is activated is not a mandatory process, and in another embodiment, it may be determined whether the UTI indicates 1 directly without determining whether the UTI is activated. Alternatively, in some cases, when the UTI indicates 1, it may indicate that the UTI is activated.
  • the UTI may be referred to as UTI coding, UTI coding flag, UT flag, or the like. If the UTI indicates 1, it may indicate that transforms applied in transforming the residual coefficients are signaled based on the UTI index. If the UTI indicates 0, the transforms applied in converting the residual coefficients indicate a UTI index. May mean not based.
  • each transformation indicated by the UTI index may vary. Examples of the types of transformations are: separable transform, non-separable transform (NSST), approximated transform from non-separated transform, primary transform, secondary transform, core transform, primary There may be transforms and the like, and the type of each transform is not limited to the examples.
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) EMT_CU_Flag (or, MTS_CU_Flag) when the UTI indicates 0 in S705 (S710).
  • the encoding apparatus 100 or the decoding apparatus 200 may skip the operations according to S705 and S710 and proceed with the operations according to S715.
  • the decoding apparatus 200 may decode EMT_CU_Flag and, when EMT_CU_Flag indicates 1, may derive one transform set using the intra prediction mode based on Table 3.
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) transform coefficients for the current block (S715). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode transform coefficients derived by performing transform on residual coefficients for the current block.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU is coded (or coded) (S720). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU index is coded.
  • the EMT_TU index may include EMT_TU_horizontal_index (or EMT_TU_horizontal_flag) that is the horizontal EMT_TU index and EMT_TU_vertical_index (or EMT_TU_vertical_flag) that is the vertical direction for each intra mode.
  • the encoding apparatus 100 or the decoding apparatus 200 If it is determined that the EMT_TU is not coded (or not coded) in S720, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment skips coding for the EMT_TU index and performs an operation according to S730. can do.
  • the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) the EMT_TU index (S725). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code an EMT_TU index for each intra mode. In an example, the encoding apparatus 100 or the decoding apparatus 200 may code, for each intra mode, an EMT_TU_horizontal_index (or EMT_TU_horizontal_flag) that is a horizontal EMT_TU index and an EMT_TU_vertical_index (or EMT_TU_vertical_flag) that is a vertical EMT_TU index.
  • EMT_TU_horizontal_index or EMT_TU_horizontal_flag
  • EMT_TU_vertical_index or EMT_TU_vertical_flag
  • EMT_TU index may be as shown in Table 3, and an example in which the EMT_TU index is allocated to each intra mode may be as shown in Table 4.
  • a flag for determining one of two transform candidates included in the transform set of Table 3 may be further signaled.
  • the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for performing NSST (S730). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for coding (encoding or decoding) the NSST index.
  • the encoding apparatus 100 or the decoding apparatus 200 may code the NSST index when it is determined that the condition corresponds to the condition for performing NSST in S630 (S735). More specifically, when it is determined in S630 that the conditions for coding the NSST index, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode the NSST index.
  • data hiding and implicit coding methods for the transform indicator may be used.
  • the transform indicator can include an STI index, a UTI index, an EMT_CU_Flag, an EMT_TU_Flag, an NSST index, and any index related to the transform that can be used to indicate the transform kernel.
  • the transform indicator is not signaled and information corresponding to the transform indicator can be derived in the coding process of transform coefficients for the current block.
  • the example is not limited thereto, and in another example, the transform indicator may be signaled, and the transform indicator signaled within the transform coefficient coding process for deriving information corresponding to the transform indicator may be used.
  • the information corresponding to the conversion indicator is, for example, information about Last_position_x, information about Last_position_y, information about Group flag, information about Significance map, information about Greater_than_1 flag, information about Greater_than_2 flag, and information about Greater_than_3 flag. It may include at least one of information on Remaining level coding, Information on Sign coding, and Information on Parity_map.
  • the information about Last_position_x and the information about Last_position_y may represent the x-axis position information and the y-axis position information of the last transform coefficient other than 0, respectively.
  • the information on the group flag may indicate whether a non-zero transform coefficient is included in a subblock (or subgroup) of the current block.
  • the group flag may be signaled through various field names, for example, Group_Flag, group_flag, subgroup_flag, subblock_flag, coded_sub_block_flag, and the example is not limited thereto.
  • the information about the significance map may include information about valid coefficients among transform coefficients for the target block.
  • the information on the Greater_than_1 flag may include information about transform coefficients having an absolute value greater than 1 among valid transform coefficients for the target block.
  • the information about the Parity_map may include information about whether the corresponding transform coefficient is even for the case where the absolute value of the valid transform coefficients for the target block is 2 or more.
  • the information on the Greater_than_2 flag may include information about transform coefficients having an absolute value of 2 or more among valid transform coefficients for the target block.
  • the example is not limited thereto.
  • the information on the Greater_than_2 flag may represent information on transform coefficients having an absolute value of 3 or more among valid transform coefficients for the target block in consideration of the information on Parity_map.
  • information about the Greater_than_3 flag may be derived instead of information about the Greater_than_2 flag, and the information about the Greater_than_3 flag may have an absolute value of 2 among the valid transform coefficients for the target block in consideration of the information about the Parity_map. Information on the above-described transform coefficients may be indicated.
  • the information on the retaining level coding may indicate information for level coding of transform coefficients classified based on the information on the Greater_than_2 flag or the information on the Greater_than_3 flag.
  • the information on sign coding may indicate information about a sign of transform coefficients for the current block.
  • the information about the transform indicator may be used in the transform coefficient coding process.
  • information on the transform indicator in the transform coefficient coding process for example, information on the pattern of the sign coding, information on the absolute value of the remaining level, information on the number of the Greater_than_1 flag, Last_position_X At least one of a value and a value of Last_position_Y may be used.
  • Last_position_x information on Last_position_y
  • information on Group flag information on Significance map
  • information on Greater_than_1 flag information on Greater_than_2 flag
  • information on Greater_than_3 flag information on Remaining level coding
  • information about sign coding and information about Parity_map are merely examples of syntax elements that may be signaled in the residual coding process, and thus, the names or definitions may vary slightly from case to case. It will be readily understood by those skilled in the art.
  • Last_position_x may be represented by last_sig_coeff_x
  • information about last_sig_coeff_x may be derived by considering information about last_sig_coeff_x_prefix and information quantum about last_sig_coeff_x_suffix.
  • the information on Last_position_y may be represented by last_sig_coeff_y
  • the information on last_sig_coeff_y may be derived in consideration of information about last_sig_coeff_y_prefix and information quantum about last_sig_coeff_y_suffix.
  • the Greater_than_1 flag, Greater_than_2 flag, Remaining level coding, and Significance map are syntax elements for classifying the absolute values of the transform coefficients based on integers 0, 1, 2, 3, and the like.
  • the signaling method may have a slight difference in some cases.
  • the significance map may be referred to as sig_coeff_flag.
  • the Greater_than_1 flag may be referred to as rem_abs_gt1_flag and may indicate whether the absolute value of the transform coefficient is greater than 1 or greater than 1.
  • the Greater_than_2 flag may be referred to as rem_abs_gt2_flag and may indicate whether the absolute value of the transform coefficient is greater than 2, greater than 2, greater than 3, or greater than 3.
  • the Greater_than_3 flag may be referred to as rem_abs_gt3_flag and may indicate whether the absolute value of the transform coefficient is greater than 2, greater than 2, greater than 3, or greater than 3.
  • rem_abs_gt1_flag indicates 1
  • rem_abs_gt2_flag or rem_abs_gt3_flag may be signaled.
  • abs_remainder including information on the remaining transform coefficients not derived may be signaled.
  • dec_abs_level including information about transform coefficients derived in the transform coefficient coding process may be signaled.
  • syntax elements described above mainly classify the absolute values of the transform coefficients on the basis of 0, 1, 2, 3, etc., so that the Greater_than_1 flag, Greater_than_2 flag, Remaining level coding and Significance It will be readily understood that the correspondence between syntax elements such as map and syntax elements such as rem_abs_gt1_flag, rem_abs_gt2_flag, rem_abs_gt3_flag, abs_remainder, sig_coeff_flag, etc. may be different from those described above in some cases.
  • par_level_flag the information about the parity map may be referred to as par_level_flag.
  • the par_level_flag may be signaled only when sig_coeff_flag indicates 1 for the corresponding transform coefficient, and may be signaled only when rem_abs_gt1_flag indicates 1 for the corresponding transform coefficient.
  • rem_abs_gt1_flag may be signaled only when par_level_flag indicates 1 by changing the signaling order.
  • data Haiing may depend on the number of nonzero transform coefficients.
  • the NSST index and the EMT_CU_Flag or EMT_TU index may be interdependent.
  • EMT_CU_Flag 0 (or 1)
  • the NSST index may not be zero.
  • NSST index-1 may be signaled instead of NSST index.
  • the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index when the UTI indicates 1 in S705 (S740). More specifically, when the UTI is activated and the UTI indicates 1, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index. However, the embodiment is not limited thereto, and in another embodiment, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index regardless of whether the UTI indicates 1. In other words, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index without omitting the determination of whether the UTI indicates 1.
  • Coding for the UTI index may depend on at least one of the size of the current block, the shape of the current block, and the intra prediction mode.
  • the UTI index is at least one of a primary transform (or kernel for primary transform) and a secondary transform (or transform kernel for secondary transform) to be applied to the current block among a plurality of available transform candidates. You can indicate one.
  • how to derive (or extract) the primary transform from the UTI and how to derive (or extract) the secondary transform from the UTI may be predefined.
  • the UTI index may indicate both a primary transform (or a transform kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform). More specifically, the UTI index joint coding an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). )can do.
  • An example of a UTI index in which an index for indicating a primary transform and an index for indicating a secondary transform is jointly coded is shown in Table 5 below.
  • the indices for indicating the primary transform are described from 0 to 5, and the indices for indicating the secondary transform are described from 0 to 3.
  • Each index may indicate a specific conversion type.
  • UTI indices jointly coded with an index for indicating a primary transform and an index for indicating a secondary transform are described from 0 to 31, and binary codes corresponding to each UTI index are described from 00000 to 11111.
  • the binary code corresponding to each UTI index may be a fixed length coding (FLC) binary code, but the example is not limited thereto.
  • UTI index list may mean a set of UTI indexes indicating transform kernel combinations.
  • UTI indexes 0 to 31 of Table 5 may constitute one UTI index list.
  • the UTI index list may be determined based on at least one of a size of a current block, a shape of the current block, and an intra prediction mode applied to the current block.
  • the UTI index when a predefined condition is satisfied, may indicate a primary transform type. More specifically, when the size of the current block is smaller than the predefined threshold, the UTI index may indicate only the transform kernel for the primary transform.
  • the predefined threshold may include, for example, 2x2, 4x4, 8x8, and the like, but the example is not limited thereto.
  • the UTI index is an index for indicating a secondary transform. Can be indicated. More specifically, when the transform kernel for the first transform is predetermined based on at least one of the size of the current block, the shape of the current block, and the intra prediction mode applied to the current block, the UTI index is used to transform the second transform. Can only point to the kernel.
  • the UTI index is used to indicate a primary transform. It can indicate an index. More specifically, when the transform kernel for the second transform is predetermined based on at least one of the size of the current block, the shape of the current block, and the intra prediction mode applied to the current block, the UTI index is used to transform the first transform. Can only point to the kernel.
  • the UTI index is used to indicate the primary transform. It can indicate an index.
  • the UTI index is used to indicate the secondary transform. It can indicate an index.
  • the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block (S745). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block based on the UTI index derived in S740. However, the embodiment is not limited thereto, and for example, transform coefficients for the current block may be coded before the UTI index is coded. A more detailed description of an embodiment in which transform coefficients for the current block are coded before the UTI index is coded will be described later with reference to FIGS. 8A and 8B.
  • 8A and 8B are flowcharts illustrating a coding order of transform coefficients and UTI indexes, according to an exemplary embodiment.
  • FIGS. 8A and 8B may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 illustrated in FIG. 1 or FIG. It may be performed by the entropy decoding unit 210 disclosed in 2.
  • S800 of FIG. 8A and S830 of FIG. 8B may correspond to S500 of FIG. 5A and S540 of FIG. 5B
  • S810 of FIG. 8A and S850 of FIG. 8B may correspond to S740 of FIG. 7
  • FIG. 8A of FIG. S820 and S840 of FIG. 8B may correspond to S745 of FIG. 7.
  • the UTI index may be determined based on at least one of the size of the current block, the intra prediction mode, and the number of nonzero transform coefficients.
  • the UTI index may be conditionally encoded or decoded based on at least one of the size of the current block, the shape of the current block, the intra prediction mode, and the number of nonzero transform coefficients.
  • whether to skip signaling of the UTI index may be determined based on a distribution state of non-zero transform coefficients in the current block. More specifically, when a non-zero transform coefficient is detected in a region other than the upper left 4x4 region of the current block, signaling of the UTI index may be skipped.
  • transform coefficients for the current block may be coded (ie, encoded or decoded) (S820) after the UTI index is coded (ie, encoded or decoded) (S810). .
  • the transform coefficients for the current block may be coded (ie, encoded or decoded) after the UTI index is coded (ie, encoded or decoded). Since the UTI index is coded before the transform coefficients for the current block are coded, the information obtained in the process of deriving the UTI index may be used when deriving the transform coefficients for the current block.
  • the UTI index may be coded (ie, encoded or decoded) (S850) after the transform coefficients for the current block are coded (ie, encoded or decoded) (S840). have.
  • the UTI index may be coded (ie, encoded or decoded) after the transform coefficients for the current block are coded (ie, encoded or decoded). Since transform coefficients for the current block are coded before the UTI index is coded, information obtained in the process of deriving the transform coefficients for the current block may be used when deriving the UTI index.
  • FIG. 9 is a flowchart illustrating an operation of an encoding apparatus according to an embodiment
  • FIG. 10 is a block diagram illustrating a configuration of an encoding apparatus according to an embodiment.
  • Each step disclosed in FIG. 9 may be performed by the encoding apparatus 100 disclosed in FIG. 1. More specifically, S900 and S910 may be performed by the transform unit 122 shown in FIG. 1, and S920 and S930 may be performed by the entropy encoding unit 130 shown in FIG. 1. In addition, operations according to S900 to S930 are based on some of the contents described above with reference to FIGS. 7 to 8B. Therefore, specific details overlapping with the above-described contents in FIGS. 1 and 7 to 8b will be omitted or simply described.
  • the encoding apparatus may include a transformer 122 and an entropy encoder 130.
  • the encoding apparatus may be implemented by more or fewer components than those illustrated in FIG. 10.
  • the converter 122 and the entropy encoder 130 may be implemented as separate chips, or at least two or more components may be implemented through one chip.
  • the encoding apparatus may derive residual samples for the current block (S900). More specifically, the converter 122 of the encoding apparatus may derive residual samples for the current block.
  • the encoding apparatus may perform transform on residual samples for the current block to derive transform coefficients (S910). More specifically, the transform unit 122 of the encoding apparatus may derive transform coefficients by performing transform on residual samples of the current block.
  • the transform can include at least one of a primary transform (or core transform) and a secondary transform, and each of the primary transform and the secondary transform can be based on one transform type of the plurality of transform types.
  • the plurality of transform types of the primary transform may include the multiple transform set described above in FIG. 3, and the plurality of transform types of the secondary transform may include a non-separated secondary transform (NSST).
  • the encoding apparatus may derive a UTI index indicating a transform type of the performed transform (S920). More specifically, the entropy encoding unit 130 of the encoding apparatus may derive a UTI index indicating the transform type of the performed transform.
  • the UTI index is at least one of a primary transform (or kernel for primary transform) and a secondary transform (or transform kernel for secondary transform) to be applied to the current block among a plurality of available transform candidates. You can indicate one.
  • the UTI index may indicate both a primary transform (or a transform kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform). More specifically, the UTI index joint coding an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). )can do.
  • the UTI index may indicate only the transform kernel for the primary transform.
  • the UTI index is an index for indicating a secondary transform. Can be indicated.
  • the UTI index is an index for indicating a primary transform. Can be indicated.
  • the encoding apparatus may encode image information including information on transform coefficients and a UTI index (S930). More specifically, the entropy encoding unit 130 of the encoding apparatus may encode information about transform coefficients and image information including a UTI index.
  • the encoding apparatus derives residual samples for the current block (S900), performs transformation on the residual samples for the current block, and performs the transformation.
  • Coefficients may be derived (S910), a UTI index indicating a transform type of the performed transform may be derived (S920), and information about the transform coefficients and image information including the UTI index may be encoded (S930).
  • FIG. 11 is a flowchart illustrating an operation of a decoding apparatus according to an embodiment
  • FIG. 12 is a block diagram illustrating a configuration of a decoding apparatus according to an embodiment.
  • Each step disclosed in FIG. 11 may be performed by the decoding apparatus 200 disclosed in FIG. 2. More specifically, S1100 to S1120 may be performed by the entropy decoding unit 210 shown in FIG. 2, S1130 may be performed by the inverse transform unit 223 shown in FIG. 2, and S1140 may be added as shown in FIG. 2. It may be performed by the unit 240.
  • operations according to S1100 to S1140 are based on some of the contents described above with reference to FIGS. 7 to 8B. Therefore, detailed descriptions overlapping with those described above with reference to FIGS. 2 and 7 to 8B will be omitted or simply described.
  • the decoding apparatus may include an entropy decoding unit 210, an inverse transform unit 223, and an adder 240.
  • the decoding apparatus may be implemented by more or fewer components than those illustrated in FIG. 12.
  • the entropy decoding unit 210, the inverse transform unit 223, and the adder 240 are each implemented as separate chips, or at least two or more components are implemented through one chip. May be
  • the decoding apparatus may decode the UTI index for the current block from the bitstream (S1100). More specifically, the entropy decoding unit 210 of the decoding apparatus may decode the UTI index for the current block from the bitstream.
  • the UTI index may indicate at least one of a primary transform (or a kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform) to be applied to the current block among the plurality of valid transform candidates.
  • the UTI index may indicate (or both) the primary transform (or transform kernel for the primary transform) and the secondary transform (or transform kernel for the secondary transform). More specifically, the UTI index may joint code an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). .
  • the UTI index may indicate only the transform kernel for the primary transform.
  • the UTI index is an index for indicating a secondary transform. Can be indicated.
  • the UTI index is an index for indicating a primary transform. Can be indicated.
  • the decoding apparatus may decode transform coefficients for the current block from the bitstream (S1110). More specifically, the entropy decoding unit 210 of the decoding apparatus may decode transform coefficients for the current block from the bitstream.
  • the decoding apparatus may derive a transform type for the current block based on the UTI index (S1120). More specifically, the entropy decoding unit 210 of the decoding apparatus may derive a transform type for the current block based on the UTI index.
  • the transform can include at least one of a primary transform (or core transform) and a secondary transform, and each of the primary transform and the secondary transform can be based on one transform type of the plurality of transform types.
  • the plurality of transform types of the primary transform may include the multiple transform set described above in FIG. 3, and the plurality of transform types of the secondary transform may include a non-separated secondary transform (NSST).
  • the decoding apparatus may perform inverse transformation based on the derived transform type and transform coefficients for the current block (S1130). More specifically, the inverse transform unit 223 of the decoding apparatus may perform inverse transform based on the derived transform type and transform coefficients for the current block.
  • the decoding apparatus may generate a reconstructed picture based on residual samples for the current block derived through inverse transform (S1140). More specifically, the adder 240 of the decoding apparatus may generate a reconstructed picture based on residual samples for the current block derived through inverse transform.
  • the decoding apparatus decodes the UTI index for the current block from the bitstream (S1100), decodes the transform coefficients for the current block from the bitstream ( S1110), a transform type for the current block is derived based on the UTI index (S1120), an inverse transform is performed based on the derived transform type and transform coefficients for the current block (S1130), and the current block derived through the inverse transform A reconstructed picture may be generated based on the residual samples for (S1140).
  • the above-described method according to the present invention may be implemented in software, and the encoding device and / or the decoding device according to the present invention may perform image processing of, for example, a TV, a computer, a smartphone, a set-top box, a display device, and the like. It can be included in the device.
  • the above-described method may be implemented as a module (process, function, etc.) for performing the above-described function.
  • the module may be stored in memory and executed by a processor.
  • the memory may be internal or external to the processor and may be coupled to the processor by various well known means.
  • 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 card, storage medium and / or other storage device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A picture decoding method performed by a decoding device according to the present invention comprises the steps of: decoding a unified transform indicator (UTI) index for a current block from a bitstream; decoding transform coefficients for the current block from the bitstream; deriving a transform type for the current block on the basis of the UTI index; performing inverse transform on the basis of the derived transform type and the transform coefficients for the current block; and generating a reconstruction picture on the basis of residual samples for the current block derived via the inverse transform, wherein the UTI index indicates at least one of a transform kernel for a first transform and a transform kernel for a second transform.

Description

변환 인디케이터에 기반한 영상 코딩 방법 및 그 장치 Image coding method and apparatus therefor based on transform indicator

본 발명은 영상 코딩 기술에 관한 것으로서 보다 상세하게는 영상 코딩 시스템에서 변환 인디케이터에 기반한 영상 코딩 방법 및 그 장치에 관한 것이다.The present invention relates to image coding technology, and more particularly, to an image coding method and apparatus based on a transform indicator in an image coding system.

최근 HD(High Definition) 영상 및 UHD(Ultra High Definition) 영상과 같은 고해상도, 고품질의 영상에 대한 수요가 다양한 분야에서 증가하고 있다. 영상 데이터가 고해상도, 고품질이 될수록 기존의 영상 데이터에 비해 상대적으로 전송되는 정보량 또는 비트량이 증가하기 때문에 기존의 유무선 광대역 회선과 같은 매체를 이용하여 영상 데이터를 전송하거나 기존의 저장 매체를 이용해 영상 데이터를 저장하는 경우, 전송 비용과 저장 비용이 증가된다. Recently, the demand for high resolution and high quality images such as high definition (HD) images and ultra high definition (UHD) images is increasing in various fields. The higher the resolution and the higher quality of the image data, the more information or bit rate is transmitted than the existing image data. Therefore, the image data can be transmitted by using a medium such as a conventional wired / wireless broadband line or by using a conventional storage medium. In the case of storage, the transmission cost and the storage cost are increased.

이에 따라, 고해상도, 고품질 영상의 정보를 효과적으로 전송하거나 저장하고, 재생하기 위해 고효율의 영상 압축 기술이 요구된다.Accordingly, a high efficiency image compression technique is required to effectively transmit, store, and reproduce high resolution, high quality image information.

본 발명의 기술적 과제는 영상 코딩 효율을 높이는 방법 및 장치를 제공함에 있다.An object of the present invention is to provide a method and apparatus for improving image coding efficiency.

본 발명의 다른 기술적 과제는 변환 효율을 높이는 방법 및 장치를 제공함에 있다. Another technical problem of the present invention is to provide a method and apparatus for improving conversion efficiency.

본 발명의 또 다른 기술적 과제는 변환을 통하여 레지듀얼 코딩의 효율을 높이는 방법 및 장치를 제공함에 있다.Another technical problem of the present invention is to provide a method and apparatus for increasing the efficiency of residual coding through transformation.

본 발명의 또 다른 기술적 과제는 변환 인디케이터에 기반한 영상 코딩 방법 및 장치를 제공함에 있다. Another technical problem of the present invention is to provide an image coding method and apparatus based on a transform indicator.

본 발명의 또 다른 기술적 과제는 통합 변환 인디케이터(Unified Transform Indicator, UTI) 인덱스를 기반으로 영상 코딩 효율을 높이는 방법 및 장치를 제공함에 있다.Another technical problem of the present invention is to provide a method and apparatus for improving image coding efficiency based on a Unified Transform Indicator (UTI) index.

본 발명의 일 실시예에 따르면, 디코딩 장치에 의하여 수행되는 픽처 디코딩 방법이 제공된다. 상기 방법은, 비트스트림으로부터 현재 블록에 대한 통합 변환 인디케이터(unified transform indicator, UTI) 인덱스를 디코딩하는 단계, 상기 비트스트림으로부터 상기 현재 블록에 대한 변환 계수들을 디코딩하는 단계, 상기 UTI 인덱스를 기반으로 상기 현재 블록에 대한 변환 타입을 도출하는 단계, 상기 도출된 변환 타입 및 상기 현재 블록에 대한 상기 변환 계수들을 기반으로 역변환(inverse transform)을 수행하는 단계 및 상기 역변환을 통해 도출된 상기 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성하는 단계를 포함하되, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 한다.According to an embodiment of the present invention, a picture decoding method performed by a decoding apparatus is provided. The method includes decoding an unified transform indicator (UTI) index for a current block from a bitstream, decoding transform coefficients for the current block from the bitstream, and based on the UTI index. Deriving a transform type for a current block, performing an inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform Generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform.

본 발명의 다른 일 실시예에 따르면, 인코딩 장치에 의하여 수행되는 픽처 인코딩 방법이 제공된다. 상기 방법은, 현재 블록에 대한 레지듀얼 샘플들을 도출하는 단계, 상기 현재 블록에 대한 상기 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출하는 단계, 상기 수행된 변환의 변환 타입을 나타내는 통합 변환 인디케이터(UTI) 인덱스를 도출하는 단계 및 상기 변환 계수들에 관한 정보 및 상기 UTI 인덱스를 포함하는 영상 정보를 인코딩하는 단계를 포함하되, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 한다.According to another embodiment of the present invention, a picture encoding method performed by an encoding device is provided. The method comprises: deriving residual samples for a current block, performing a transform on the residual samples for the current block to derive transform coefficients, an integrated transform indicating a transform type of the performed transform Deriving an indicator (UTI) index and encoding information about the transform coefficients and image information including the UTI index, wherein the UTI index is used for transform kernel and secondary transform for the primary transform. It is characterized by indicating at least one of the conversion kernel for.

본 발명의 또 다른 일 실시예에 따르면, 픽처를 디코딩하는 디코딩 장치가 제공된다. 상기 디코딩 장치는, 비트스트림으로부터 현재 블록에 대한 통합 변환 인디케이터(UTI) 인덱스를 디코딩하고, 상기 비트스트림으로부터 상기 현재 블록에 대한 변환 계수들을 디코딩하고, 상기 디코딩된 UTI 인덱스를 기반으로 상기 현재 블록에 대한 변환 타입을 도출하는 엔트로피 디코딩부, 상기 도출된 변환 타입 및 상기 현재 블록에 대한 상기 변환 계수들을 기반으로 역변환(inverse transform)을 수행하는 역변환부 및 상기 역변환을 통해 도출된 상기 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성하는 가산부를 포함하되, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 한다.According to another embodiment of the present invention, a decoding apparatus for decoding a picture is provided. The decoding apparatus decodes a Unified Transform Indicator (UTI) index for the current block from the bitstream, decodes transform coefficients for the current block from the bitstream, and applies the current block to the current block based on the decoded UTI index. An entropy decoding unit that derives a transform type for the transform, an inverse transform unit that performs inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform And an adder for generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for the first transform and a transform kernel for the second transform.

본 발명의 또 다른 일 실시예에 따르면, 픽처를 인코딩하는 인코딩 장치가 제공된다. 상기 인코딩 장치는, 현재 블록에 대한 레지듀얼 샘플들을 도출하고, 상기 현재 블록에 대한 상기 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출하는 변환부 및 상기 수행된 변환의 변환 타입을 나타내는 통합 변환 인디케이터(UTI) 인덱스를 도출하고, 상기 변환 계수들에 관한 정보 및 상기 UTI 인덱스를 포함하는 영상 정보를 인코딩하는 엔트로피 인코딩부를 포함하되, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 한다.According to yet another embodiment of the present invention, an encoding apparatus for encoding a picture is provided. The encoding apparatus may be configured to derive residual samples for a current block, perform a transform on the residual samples for the current block, and to derive transform coefficients, and to indicate a transform type of the performed transform. Deriving a transform indicator (UTI) index, and includes an entropy encoding unit for encoding the information about the transform coefficients and the image information including the UTI index, wherein the UTI index is a transform kernel and secondary transform for the primary transform It is characterized by indicating at least one of the conversion kernel for.

본 발명에 따르면 전반적인 영상/비디오 압축 효율을 높일 수 있다.According to the present invention, the overall video / video compression efficiency can be improved.

본 발명에 따르면 효율적인 변환을 통하여 레지듀얼 처리를 위해 전송되어야 하는 데이터량을 줄일 수 있고, 레지듀얼 코딩 효율을 높일 수 있다. According to the present invention, the amount of data to be transmitted for residual processing can be reduced through efficient conversion, and the residual coding efficiency can be improved.

본 발명에 따르면 변환 인디케이터를 기반으로 영상 코딩을 수행하여 영상 코딩 효율을 높일 수 있다.According to the present invention, image coding efficiency may be improved by performing image coding based on a transform indicator.

본 발명에 따르면 통합 변환 인디케이터(UTI) 인덱스를 기반으로 변환을 수행하여 영상 코딩 효율을 높일 수 있다.According to the present invention, the conversion may be performed based on the Unified Transform Indicator (UTI) index to increase image coding efficiency.

도 1은 본 발명이 적용될 수 있는 비디오/영상 인코딩 장치의 구성을 개략적으로 설명하는 도면이다. 1 is a diagram schematically illustrating a configuration of a video / video encoding apparatus to which the present invention can be applied.

도 2는 본 발명이 적용될 수 있는 비디오/영상 디코딩 장치의 구성을 개략적으로 설명하는 도면이다.2 is a diagram schematically illustrating a configuration of a video / video decoding apparatus to which the present invention may be applied.

도 3은 일 실시예에 따른 다중 변환 기법을 개략적으로 나타낸다.3 schematically illustrates a multiple conversion scheme according to an embodiment.

도 4는 65개의 예측 방향의 인트라 방향성 모드들을 예시적으로 나타낸다.4 exemplarily shows intra directional modes of 65 prediction directions.

도 5a 및 도 5b는 일 실시예에 따른 변환 계수의 코딩 과정을 도시하는 흐름도이다.5A and 5B are flowcharts illustrating a coding process of transform coefficients, according to an exemplary embodiment.

도 6은 일 실시예에 따른 변환 계수의 코딩 과정을 구체화하여 도시하는 흐름도이다.6 is a flowchart illustrating a process of coding a transform coefficient according to an embodiment.

도 7은 일 실시예에 따른 변환 계수의 코딩 과정을 도시하는 흐름도이다.7 is a flowchart illustrating a coding process of transform coefficients, according to an exemplary embodiment.

도 8a 및 도 8b는 일 실시예에 따른 변환 계수 및 UTI 인덱스의 코딩 순서를 설명하기 위한 흐름도이다. 8A and 8B are flowcharts illustrating a coding order of transform coefficients and UTI indexes, according to an exemplary embodiment.

도 9는 일 실시예에 따른 인코딩 장치의 동작을 도시하는 흐름도이다.9 is a flowchart illustrating an operation of an encoding apparatus according to an embodiment.

도 10은 일 실시예에 따른 인코딩 장치의 구성을 도시하는 블록도이다.10 is a block diagram illustrating a configuration of an encoding apparatus according to an embodiment.

도 11은 일 실시예에 따른 디코딩 장치의 동작을 도시하는 흐름도이다.11 is a flowchart illustrating an operation of a decoding apparatus according to an embodiment.

도 12는 일 실시예에 따른 디코딩 장치의 구성을 도시하는 블록도이다.12 is a block diagram illustrating a configuration of a decoding apparatus according to an embodiment.

본 발명의 일 실시예에 따르면, 디코딩 장치에 의하여 수행되는 픽처 디코딩 방법이 제공된다. 상기 방법은, 비트스트림으로부터 현재 블록에 대한 통합 변환 인디케이터(unified transform indicator, UTI) 인덱스를 디코딩하는 단계, 상기 비트스트림으로부터 상기 현재 블록에 대한 변환 계수들을 디코딩하는 단계, 상기 UTI 인덱스를 기반으로 상기 현재 블록에 대한 변환 타입을 도출하는 단계, 상기 도출된 변환 타입 및 상기 현재 블록에 대한 상기 변환 계수들을 기반으로 역변환(inverse transform)을 수행하는 단계 및 상기 역변환을 통해 도출된 상기 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성하는 단계를 포함하되, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 한다.According to an embodiment of the present invention, a picture decoding method performed by a decoding apparatus is provided. The method includes decoding an unified transform indicator (UTI) index for a current block from a bitstream, decoding transform coefficients for the current block from the bitstream, and based on the UTI index. Deriving a transform type for a current block, performing an inverse transform based on the derived transform type and the transform coefficients for the current block, and a register for the current block derived through the inverse transform Generating a reconstructed picture based on the dual samples, wherein the UTI index indicates at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정 실시예에 한정하려고 하는 것이 아니다. 본 명세서에서 상용하는 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명의 기술적 사상을 한정하려는 의도로 사용되는 것은 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서 "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성 요소, 부품 도는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.As the present invention allows for various changes and numerous embodiments, particular embodiments will be illustrated in the drawings and described in detail in the written description. However, this is not intended to limit the invention to the specific embodiments. The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the spirit of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. The terms "comprise" or "having" in this specification are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features It is to be understood that the numbers, steps, operations, components, parts or figures do not exclude in advance the presence or possibility of adding them.

한편, 본 발명에서 설명되는 도면상의 각 구성들은 서로 다른 특징적인 기능들에 관한 설명의 편의를 위해 독립적으로 도시된 것으로서, 각 구성들이 서로 별개의 하드웨어나 별개의 소프트웨어로 구현된다는 것을 의미하지는 않는다. 예컨대, 각 구성 중 두 개 이상의 구성이 합쳐져 하나의 구성을 이룰 수도 있고, 하나의 구성이 복수의 구성으로 나뉘어질 수도 있다. 각 구성이 통합 및/또는 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.On the other hand, each configuration in the drawings described in the present invention are shown independently for the convenience of description of the different characteristic functions, it does not mean that each configuration is implemented by separate hardware or separate software. For example, two or more of each configuration may be combined to form one configuration, or one configuration may be divided into a plurality of configurations. Embodiments in which each configuration is integrated and / or separated are also included in the scope of the present invention without departing from the spirit of the present invention.

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성 요소에 대해서는 동일한 참조 부호를 사용하고 동일한 구성 요소에 대해서 중복된 설명은 생략한다.Hereinafter, with reference to the accompanying drawings, it will be described in detail a preferred embodiment of the present invention. Hereinafter, the same reference numerals are used for the same components in the drawings, and redundant description of the same components is omitted.

본 명세서에서 비디오(video)는 시간의 흐름에 따른 일련의 영상(image)들의 집합을 의미할 수 있다. 픽처(picture)는 일반적으로 특정 시간대의 하나의 영상을 나타내는 단위를 의미하며, 슬라이스(slice)는 코딩에 있어서 픽처의 일부를 구성하는 단위이다. 하나의 픽처는 복수의 슬라이스로 구성될 수 있으며, 필요에 따라서 픽처 및 슬라이스는 서로 혼용되어 사용될 수 있다. 또한, 경우에 따라서 "이미지(image)"는 정지 영상 및 시간의 흐름에 따른 일련의 정지 영상들의 집합인 비디오(video)를 포함하는 개념을 의미할 수 있다. 또한, "비디오(video)"도 반드시 시간의 흐름에 따른 일련의 정지 영상들의 집합만을 의미하는 것은 아니고, 일부 실시예에서는 정지 영상이 비디오에 포함되는 개념으로 해석될 수 있다.In the present specification, a video may mean a series of images over time. A picture generally refers to a unit representing one image in a specific time zone, and a slice is a unit constituting a part of a picture in coding. One picture may be composed of a plurality of slices, and if necessary, the picture and the slice may be mixed with each other. Also, in some cases, an "image" may mean a concept including a still image and a video, which is a set of a series of still images over time. In addition, “video” does not necessarily mean a set of a series of still images over time, and in some embodiments, may be interpreted as a concept in which still images are included in video.

픽셀(pixel) 또는 펠(pel)은 하나의 픽처(또는 영상)을 구성하는 최소의 단위를 의미할 수 있다. 또한, 픽셀에 대응하는 용어로서 '샘플(sample)'이 사용될 수 있다. 샘플은 일반적으로 픽셀 또는 픽셀의 값을 나타낼 수 있으며, 휘도(luma) 성분의 픽셀/픽셀값만을 나타낼 수도 있고, 채도(chroma) 성분의 픽셀/픽셀 값만을 나타낼 수도 있다. A pixel or a pel may refer to a minimum unit constituting one picture (or image). Also, 'sample' may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a value of a pixel, and may only represent pixel / pixel values of the luma component, or only pixel / pixel values of the chroma component.

유닛(unit)은 영상 처리의 기본 단위를 나타낸다. 유닛은 픽처의 특정 영역 및 해당 영역에 관련된 정보 중 적어도 하나를 포함할 수 있다. 유닛은 경우에 따라서 블록(block) 또는 영역(area) 등의 용어와 혼용하여 사용될 수 있다. 일반적인 경우, MxN 블록은 M개의 열과 N개의 행으로 이루어진 샘플들 또는 변환 계수(transform coefficient)들의 집합을 나타낼 수 있다.A unit represents the basic unit of image processing. The unit may include at least one of a specific region of the picture and information related to the region. The unit may be used interchangeably with terms such as block or area in some cases. In a general case, an M × N block may represent a set of samples or transform coefficients composed of M columns and N rows.

도 1은 본 발명이 적용될 수 있는 비디오/영상 인코딩 장치(video encoding apparatus)의 구성을 개략적으로 설명하는 도면이다. 이하 인코딩/디코딩 장치는 비디오 인코딩/디코딩 장치 및/또는 영상 인코딩/디코딩 장치를 포함할 수 있고, 비디오 인코딩/디코딩 장치가 영상 인코딩/디코딩 장치를 포함하는 개념으로 사용되거나, 영상 인코딩/디코딩 장치가 비디오 인코딩/디코딩 장치를 포함하는 개념으로 사용될 수도 있다.FIG. 1 is a diagram schematically illustrating a configuration of a video / video encoding apparatus to which the present invention may be applied. Hereinafter, the encoding / decoding device may include a video encoding / decoding device and / or an image encoding / decoding device, and the video encoding / decoding device is used as a concept including the image encoding / decoding device, or the image encoding / decoding device is It may be used in a concept including a video encoding / decoding device.

도 1을 참조하면, (비디오) 인코딩 장치(100)는 픽처 분할부(picture partitioning module, 105), 예측부(prediction module, 110), 레지듀얼 처리부(residual processing module, 120), 엔트로피 인코딩부(entropy encoding module, 130), 가산부(adder, 140), 필터부(filtering module, 150) 및 메모리(memory, 160)을 포함할 수 있다. 레지듀얼 처리부(120)는 감산부(substractor, 121), 변환부(transform module, 122), 양자화부(quantization module, 123), 재정렬부(rearrangement module, 124), 역양자화부(dequantization module, 125) 및 역변환부(inverse transform module, 126)를 포함할 수 있다. Referring to FIG. 1, the (video) encoding apparatus 100 may include a picture partitioning module 105, a prediction module 110, a residual processing module 120, and an entropy encoding unit ( The entropy encoding module 130 may include an adder 140, a filtering module 150, and a memory 160. The residual processor 120 may include a substractor 121, a transform module 122, a quantization module 123, a rearrangement module 124, and a dequantization module 125. ) And an inverse transform module 126.

픽처 분할부(105)는 입력된 픽처를 적어도 하나의 처리 유닛(processing unit)으로 분할할 수 있다. The picture divider 105 may divide the input picture into at least one processing unit.

일 예로, 처리 유닛은 코딩 유닛(coding unit, CU)이라고 불릴 수 있다. 이 경우 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 QTBT (Quad-tree binary-tree) 구조에 따라 재귀적으로(recursively) 분할될 수 있다. 예를 들어, 하나의 코딩 유닛은 쿼드 트리 구조, 바이너리 트리 구조 및/또는 터너리(ternary) 트리 구조를 기반으로 하위(deeper) 뎁스의 복수의 코딩 유닛들로 분할될 수 있다. 이 경우 예를 들어 쿼드 트리 구조가 먼저 적용되고 바이너리 트리 구조 및 터너리 트리 구조가 나중에 적용될 수 있다. 또는 바이너리 트리 구조/터너리 트리 구조가 먼저 적용될 수도 있다. 더 이상 분할되지 않는 최종 코딩 유닛을 기반으로 본 발명에 따른 코딩 절차가 수행될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 여기서 코딩 절차라 함은 후술하는 예측, 변환, 및 복원 등의 절차를 포함할 수 있다. As an example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively split from the largest coding unit (LCU) according to a quad-tree binary-tree (QTBT) 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 tree structure. In this case, for example, the quad tree structure may be applied first, and the binary tree structure and the ternary tree structure may be applied later. Alternatively, the binary tree structure / tunary tree structure may be applied first. The coding procedure according to the present invention may be performed based on the final coding unit that is no longer split. In this case, the maximum coding unit may be used as the final coding unit immediately based on coding efficiency according to the image characteristic, or if necessary, the coding unit is recursively divided into coding units of lower depths and optimized. A coding unit of size may be used as the final coding unit. Here, the coding procedure may include a procedure of prediction, transform, and reconstruction, which will be described later.

다른 예로, 처리 유닛은 코딩 유닛(coding unit, CU) 예측 유닛(prediction unit, PU) 또는 변환 유닛(transform unit, TU)을 포함할 수도 있다. 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 쿼드 트리 구조를 따라서 하위(deeper) 뎁스의 코딩 유닛들로 분할(split)될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 최소 코딩 유닛(smallest coding unit, SCU)이 설정된 경우 코딩 유닛은 최소 코딩 유닛보다 더 작은 코딩 유닛으로 분할될 수 없다. 여기서 최종 코딩 유닛이라 함은 예측 유닛 또는 변환 유닛으로 파티셔닝 또는 분할되는 기반이 되는 코딩 유닛을 의미한다. 예측 유닛은 코딩 유닛으로부터 파티셔닝(partitioning)되는 유닛으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록(sub block)으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 및/또는 변환 계수로부터 레지듀얼 신호(residual signal)를 유도하는 유닛일 수 있다. 이하, 코딩 유닛은 코딩 블록(coding block, CB), 예측 유닛은 예측 블록(prediction block, PB), 변환 유닛은 변환 블록(transform block, TB) 으로 불릴 수 있다. 예측 블록 또는 예측 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 예측 샘플의 어레이(array)를 포함할 수 있다. 또한, 변환 블록 또는 변환 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 변환 계수 또는 레지듀얼 샘플의 어레이를 포함할 수 있다.As another example, the processing unit may include a coding unit (CU) prediction unit (PU) or a transform unit (TU). The coding unit may be split from the largest coding unit (LCU) into coding units of deeper depths along the quad tree structure. In this case, the maximum coding unit may be used as the final coding unit immediately based on coding efficiency according to the image characteristic, or if necessary, the coding unit is recursively divided into coding units of lower depths and optimized. A coding unit of size may be used as the final coding unit. If a smallest coding unit (SCU) is set, the coding unit may not be split into smaller coding units than the minimum coding unit. Here, the final coding unit refers to a coding unit that is the basis of partitioning or partitioning into a prediction unit or a transform unit. The prediction unit is a unit partitioning from the coding unit and may be a unit of sample prediction. In this case, the prediction unit may be divided into sub blocks. The transform unit may be divided along the quad tree structure from the coding unit, and may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient. Hereinafter, a coding unit may be called a coding block (CB), a prediction unit is a prediction block (PB), and a transform unit may be called a transform block (TB). A prediction block or prediction unit may mean a specific area in the form of a block within a picture, and may include an array of prediction samples. In addition, a transform block or a transform unit may mean a specific area in a block form within a picture, and may include an array of transform coefficients or residual samples.

예측부(110)는 처리 대상 블록(이하, 현재 블록 또는 레지듀얼 블록을 의미할 수도 있다)에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(110)에서 수행되는 예측의 단위는 코딩 블록일 수 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다.The prediction unit 110 performs prediction on a block to be processed (hereinafter, may mean a current block or a residual block), and generates a predicted block including prediction samples for the current block. can do. The unit of prediction performed by the prediction unit 110 may be a coding block, a transform block, or a prediction block.

예측부(110)는 현재 블록에 인트라 예측이 적용되는지 인터 예측이 적용되는지를 결정할 수 있다. 일 예로, 예측부(110)는 CU 단위로 인트라 예측 또는 인터 예측이 적용되는지를 결정할 수 있다.The prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. As an example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied on a CU basis.

인트라 예측의 경우에, 예측부(110)는 현재 블록이 속하는 픽처(이하, 현재 픽처) 내의 현재 블록 외부의 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 예측부(110)는 (i) 현재 블록의 주변(neighboring) 참조 샘플들의 평균(average) 혹은 인터폴레이션(interpolation)을 기반으로 예측 샘플을 유도할 수 있고, (ii) 현재 블록의 주변 참조 샘플들 중 예측 샘플에 대하여 특정 (예측) 방향에 존재하는 참조 샘플을 기반으로 상기 예측 샘플을 유도할 수도 있다. (i)의 경우는 비방향성 모드 또는 비각도 모드, (ii)의 경우는 방향성(directional) 모드 또는 각도(angular) 모드라고 불릴 수 있다. 인트라 예측에서 예측 모드는 예를 들어 33개의 방향성 예측 모드와 적어도 2개 이상의 비방향성 모드를 가질 수 있다. 비방향성 모드는 DC 예측 모드 및 플래너 모드(Planar 모드)를 포함할 수 있다. 예측부(110)는 주변 블록에 적용된 예측 모드를 이용하여, 현재 블록에 적용되는 예측 모드를 결정할 수도 있다.In the case of intra prediction, the prediction unit 110 may derive a prediction sample for the current block based on reference samples outside the current block in the picture to which the current block belongs (hereinafter, referred to as the current picture). In this case, the prediction unit 110 may (i) derive the prediction sample based on the average or interpolation of neighboring reference samples of the current block, and (ii) the neighbor reference of the current block. The prediction sample may be derived based on a reference sample present in a specific (prediction) direction with respect to the prediction sample among the samples. In case of (i), it may be called non-directional mode or non-angle mode, and in case of (ii), it may be called directional mode or angular mode. In intra prediction, the prediction mode may have, for example, 33 directional prediction modes and at least two non-directional modes. The non-directional mode may include a DC prediction mode and a planner mode (Planar mode). The prediction unit 110 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.

인터 예측의 경우에, 예측부(110)는 참조 픽처 상에서 움직임 벡터에 의해 특정되는 샘플을 기반으로, 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(110)는 스킵(skip) 모드, 머지(merge) 모드, 및 MVP(motion vector prediction) 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 스킵 모드와 머지 모드의 경우에, 예측부(110)는 주변 블록의 움직임 정보를 현재 블록의 움직임 정보로 이용할 수 있다. 스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차(레지듀얼)가 전송되지 않는다. MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(Motion Vector Predictor)로 이용하여 현재 블록의 움직임 벡터 예측자로 이용하여 현재 블록의 움직임 벡터를 유도할 수 있다.In the case of inter prediction, the prediction unit 110 may derive the prediction sample for the current block based on the sample specified by the motion vector on the reference picture. The prediction unit 110 may apply one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode to derive a prediction sample for the current block. In the skip mode and the merge mode, the prediction unit 110 may use the motion information of the neighboring block as the motion information of the current block. In the skip mode, unlike the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted. In the MVP mode, the motion vector of the current block may be derived using the motion vector of the neighboring block as a motion vector predictor.

인터 예측의 경우에, 주변 블록은 현재 픽처 내에 존재하는 공간적 주변 블록(spatial neighboring block)과 참조 픽처(reference picture)에 존재하는 시간적 주변 블록(temporal neighboring block)을 포함할 수 있다. 상기 시간적 주변 블록을 포함하는 참조 픽처는 동일 위치 픽처(collocated picture, colPic)라고 불릴 수도 있다. 움직임 정보(motion information)는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 예측 모드 정보와 움직임 정보 등의 정보는 (엔트로피) 인코딩되어 비트스트림 형태로 출력될 수 있다.In the case of inter prediction, the neighboring block may include a spatial neighboring block existing in the current picture and a temporal neighboring block present in the reference picture. A reference picture including the temporal neighboring block may be called a collocated picture (colPic). The motion information may include a motion vector and a reference picture index. Information such as prediction mode information and motion information may be encoded (entropy) and output in the form of a bitstream.

스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트(reference picture list) 상의 최상위 픽처가 참조 픽처로서 이용될 수도 있다. 참조 픽처 리스트(Picture Order Count)에 포함되는 참조 픽처들은 현재 픽처와 해당 참조 픽처 간의 POC(Picture order count) 차이 기반으로 정렬될 수 있다. POC는 픽처의 디스플레이 순서에 대응하며, 코딩 순서와 구분될 수 있다.When the motion information of the temporal neighboring block is used in the skip mode and the merge mode, the highest picture on the reference picture list may be used as the reference picture. Reference pictures included in a reference picture list may be sorted based on a difference in a picture order count (POC) between a current picture and a corresponding reference picture. The POC corresponds to the display order of the pictures and may be distinguished from the coding order.

감산부(121)는 원본 샘플과 예측 샘플 간의 차이인 레지듀얼 샘플을 생성한다. 스킵 모드가 적용되는 경우에는, 상술한 바와 같이 레지듀얼 샘플을 생성하지 않을 수 있다.The subtraction unit 121 generates a residual sample which is a difference between the original sample and the prediction sample. When the skip mode is applied, residual samples may not be generated as described above.

변환부(122)는 변환 블록 단위로 레지듀얼 샘플을 변환하여 변환 계수(transform coefficient)를 생성한다. 변환부(122)는 해당 변환 블록의 사이즈와, 해당 변환 블록과 공간적으로 겹치는 코딩 블록 또는 예측 블록에 적용된 예측 모드에 따라서 변환을 수행할 수 있다. 예컨대, 상기 변환 블록과 겹치는 상기 코딩 블록 또는 상기 예측 블록에 인트라 예측이 적용되었고, 상기 변환 블록이 4×4의 레지듀얼 어레이(array)라면, 레지듀얼 샘플은 DST(Discrete Sine Transform) 변환 커널을 이용하여 변환되고, 그 외의 경우라면 레지듀얼 샘플은 DCT(Discrete Cosine Transform) 변환 커널을 이용하여 변환할 수 있다.The transform unit 122 generates transform coefficients by transforming the residual sample in units of transform blocks. The transform unit 122 may perform the transform according to the size of the transform block and the prediction mode applied to the coding block or the prediction block that spatially overlaps the transform block. For example, if intra prediction is applied to the coding block or the prediction block that overlaps the transform block, and the transform block is a 4 × 4 residual array, the residual sample is configured to perform a discrete sine transform (DST) transform kernel. The residual sample may be transformed using a discrete cosine transform (DCT) transform kernel.

양자화부(123)는 변환 계수들을 양자화하여, 양자화된 변환 계수를 생성할 수 있다.The quantization unit 123 may quantize the transform coefficients to generate quantized transform coefficients.

재정렬부(124)는 양자화된 변환 계수를 재정렬한다. 재정렬부(124)는 계수들 스캐닝(scanning) 방법을 통해 블록 형태의 양자화된 변환 계수들을 1차원 벡터 형태로 재정렬할 수 있다. 여기서 재정렬부(124)는 별도의 구성으로 설명하였으나, 재정렬부(124)는 양자화부(123)의 일부일 수 있다.The reordering unit 124 rearranges the quantized transform coefficients. The reordering unit 124 may reorder the quantized transform coefficients in the form of a block into a one-dimensional vector form through a coefficient scanning method. Although the reordering unit 124 has been described in a separate configuration, the reordering unit 124 may be part of the quantization unit 123.

엔트로피 인코딩부(130)는 양자화된 변환 계수들에 대한 엔트로피 인코딩을 수행할 수 있다. 엔트로피 인코딩은 예를 들어 지수 골롬(exponential Golomb), CAVLC(context-adaptive variable length coding), CABAC(context-adaptive binary arithmetic coding) 등과 같은 인코딩 방법을 포함할 수 있다. 엔트로피 인코딩부(130)는 양자화된 변환 계수 외 비디오 복원에 필요한 정보들(예컨대 신택스 요소(syntax element)의 값 등)을 함께 또는 별도로 엔트로피 인코딩 또는 기 설정된 방법에 따라 인코딩할 수도 있다. 인코딩된 정보들은 비트스트림 형태로 NAL(network abstraction layer) 유닛 단위로 전송 또는 저장될 수 있다. 상기 비트스트림은 네트워크를 통하여 전송될 수 있고, 또는 디지털 저장매체에 저장될 수 있다. 여기서 네트워크는 방송망 및/또는 통신망 등을 포함할 수 있고, 디지털 저장매체는 USB, SD, CD, DVD, 블루레이, HDD, SSD 등 다양한 저장매체를 포함할 수 있다.The entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients. Entropy encoding may include, for example, encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), and the like. The entropy encoding unit 130 may encode information necessary for video reconstruction other than the quantized transform coefficients (for example, a value of a syntax element) together or separately according to entropy encoding or a predetermined method. The encoded information may be transmitted or stored in units of network abstraction layer (NAL) units in the form of bitstreams. The bitstream may be transmitted over a network or may be stored in a digital storage medium. The network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like.

역양자화부(125)는 양자화부(123)에서 양자화된 값(양자화된 변환 계수)들을 역양자화하고, 역변환부(126)는 역양자화부(125)에서 역양자화된 값들을 역변환하여 레지듀얼 샘플을 생성한다.The inverse quantization unit 125 inverse quantizes the quantized values (quantized transform coefficients) in the quantization unit 123, and the inverse transformer 126 inverse transforms the inverse quantized values in the inverse quantization unit 125 to obtain a residual sample. Create

가산부(140)는 레지듀얼 샘플과 예측 샘플을 합쳐서 픽처를 복원한다. 레지듀얼 샘플과 예측 샘플은 블록 단위로 더해져서 복원 블록이 생성될 수 있다. 여기서 가산부(140)는 별도의 구성으로 설명하였으나, 가산부(140)는 예측부(110)의 일부일 수 있다. 한편, 가산부(140)는 복원부(reconstruction module) 또는 복원 블록 생성부로 불릴 수도 있다.The adder 140 reconstructs the picture by combining the residual sample and the predictive sample. The residual sample and the predictive sample may be added in units of blocks to generate a reconstructed block. Although the adder 140 has been described in a separate configuration, the adder 140 may be part of the predictor 110. The adder 140 may also be called a reconstruction module or a restore block generator.

복원된 픽처(reconstructed picture)에 대하여 필터부(150)는 디블록킹 필터 및/또는 샘플 적응적 오프셋(sample adaptive offset)을 적용할 수 있다. 디블록킹 필터링 및/또는 샘플 적응적 오프셋을 통해, 복원 픽처 내 블록 경계의 아티팩트나 양자화 과정에서의 왜곡이 보정될 수 있다. 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링의 과정이 완료된 후 적용될 수 있다. 필터부(150)는 ALF(Adaptive Loop Filter)를 복원된 픽처에 적용할 수도 있다. ALF는 디블록킹 필터 및/또는 샘플 적응적 오프셋이 적용된 후의 복원된 픽처에 대하여 적용될 수 있다.The filter unit 150 may apply a deblocking filter and / or a sample adaptive offset to the reconstructed picture. Through deblocking filtering and / or sample adaptive offset, the artifacts of the block boundaries in the reconstructed picture or the distortion in the quantization process can be corrected. The sample adaptive offset may be applied on a sample basis and may be applied after the process of deblocking filtering is completed. The filter unit 150 may apply an adaptive loop filter (ALF) to the reconstructed picture. ALF may be applied to the reconstructed picture after the deblocking filter and / or sample adaptive offset is applied.

메모리(160)는 복원 픽처(디코딩된 픽처) 또는 인코딩/디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(150)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 상기 저장된 복원 픽처는 다른 픽처의 (인터) 예측을 위한 참조 픽처로 활용될 수 있다. 예컨대, 메모리(160)는 인터 예측에 사용되는 (참조) 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트(reference picture set) 혹은 참조 픽처 리스트(reference picture list)에 의해 지정될 수 있다.The memory 160 may store reconstructed pictures (decoded pictures) or information necessary for encoding / decoding. Here, the reconstructed picture may be a reconstructed picture after the filtering process is completed by the filter unit 150. The stored reconstructed picture may be used as a reference picture for (inter) prediction of another picture. For example, the memory 160 may store (reference) pictures used for inter prediction. In this case, pictures used for inter prediction may be designated by a reference picture set or a reference picture list.

도 2는 본 발명이 적용될 수 있는 비디오/영상 디코딩 장치(video decoding apparatus)의 구성을 개략적으로 설명하는 도면이다. 이하 비디오 디코딩 장치라 함은 영상 디코딩 장치를 포함할 수 있다.FIG. 2 is a diagram schematically illustrating a configuration of a video / video decoding apparatus to which the present invention can be applied. Hereinafter, the video decoding apparatus may include an image decoding apparatus.

도 2를 참조하면, (비디오) 디코딩 장치(200)는 엔트로피 디코딩부(entropy decoding module, 210), 레지듀얼 처리부(residual processing module, 220), 예측부(prediction module, 230), 가산부(adder, 240), 필터부(filtering module, 250) 및 메모리(memory, 260)을 포함할 수 있다. 여기서 레지듀얼 처리부(220)는 재정렬부(rearrangement module, 221), 역양자화부(dequantization module, 222), 역변환부(inverse transform module, 223)을 포함할 수 있다. 또한, 비록 도시되지는 않았으나, 비디오 디코딩 장치(200)는 비디오 정보를 포함하는 비트스트림을 수신하는 수신부를 포함할 수 있다. 상기 수신부는 별도의 모듈로 구성될 수도 있고 또는 엔트로피 디코딩부(210)에 포함될 수 있다. Referring to FIG. 2, the (video) decoding apparatus 200 may include an entropy decoding module 210, a residual processing module 220, a prediction module 230, and an adder. , 240, a filtering module 250, and a memory 260. The residual processor 220 may include a rearrangement module 221, a dequantization module 222, and an inverse transform module 223. In addition, although not shown, the video decoding apparatus 200 may include a receiver that receives a bitstream including video information. The receiver may be configured as a separate module or may be included in the entropy decoding unit 210.

비디오/영상 정보를 포함하는 비트스트림이 입력되면, (비디오) 디코딩 장치는(200)는 (비디오) 인코딩 장치에서 비디오/영상 정보가 처리된 프로세스에 대응하여 비디오/영상/픽처를 복원할 수 있다.When the bitstream including the video / image information is input, the (video) decoding apparatus 200 may restore the video / image / picture in response to a process in which the video / image information is processed in the (video) encoding apparatus. .

예컨대, 비디오 디코딩 장치(200)는 비디오 인코딩 장치에서 적용된 처리 유닛을 이용하여 비디오 디코딩을 수행할 수 있다. 따라서 비디오 디코딩의 처리 유닛 블록은 일 예로 코딩 유닛일 수 있고, 다른 예로 코딩 유닛, 예측 유닛 또는 변환 유닛일 수 있다. 코딩 유닛은 최대 코딩 유닛으로부터 쿼드 트리 구조, 바이너리 트리 구조 및/또는 터너리 트리 구조를 따라서 분할될 수 있다. For example, the video decoding apparatus 200 may perform video decoding using a processing unit applied in the video encoding apparatus. Thus, the processing unit block of video decoding may be, for example, a coding unit, and in another example, a coding unit, a prediction unit, or a transform unit. The coding unit may be split along the quad tree structure, binary tree structure and / or ternary tree structure from the largest coding unit.

예측 유닛 및 변환 유닛이 경우에 따라 더 사용될 수 있으며, 이 경우 예측 블록은 코딩 유닛으로부터 도출 또는 파티셔닝되는 블록으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 또는 변환 계수로부터 레지듀얼 신호를 유도하는 유닛일 수 있다. The prediction unit and the transform unit may be further used in some cases, in which case the prediction block is a block derived or partitioned from the coding unit and may be a unit of sample prediction. At this point, the prediction unit may be divided into subblocks. The transform unit may be divided along the quad tree structure from the coding unit, and may be a unit for deriving a transform coefficient or a unit for deriving a residual signal from the transform coefficient.

엔트로피 디코딩부(210)는 비트스트림을 파싱하여 비디오 복원 또는 픽처 복원에 필요한 정보를 출력할 수 있다. 예컨대, 엔트로피 디코딩부(210)는 지수 골롬 부호화, CAVLC 또는 CABAC 등의 코딩 방법을 기초로 비트스트림 내 정보를 디코딩하고, 비디오 복원에 필요한 신택스 엘리먼트의 값, 레지듀얼에 관한 변환 계수의 양자화된 값 들을 출력할 수 있다. The entropy decoding unit 210 may parse the bitstream and output information necessary for video reconstruction or picture reconstruction. For example, the entropy decoding unit 210 decodes information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, quantized values of syntax elements necessary for video reconstruction, and residual coefficients. Can be output.

보다 상세하게, CABAC 엔트로피 디코딩 방법은, 비트스트림에서 각 구문 요소에 해당하는 빈을 수신하고, 디코딩 대상 구문 요소 정보와 주변 및 디코딩 대상 블록의 디코딩 정보 혹은 이전 단계에서 디코딩된 심볼/빈의 정보를 이용하여 컨택스트(context) 모델을 결정하고, 결정된 컨택스트 모델에 따라 빈(bin)의 발생 확률을 예측하여 빈의 산술 디코딩(arithmetic decoding)를 수행하여 각 구문 요소의 값에 해당하는 심볼을 생성할 수 있다. 이때, CABAC 엔트로피 디코딩 방법은 컨택스트 모델 결정 후 다음 심볼/빈의 컨택스트 모델을 위해 디코딩된 심볼/빈의 정보를 이용하여 컨택스트 모델을 업데이트할 수 있다.More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in a bitstream, and decodes syntax element information and decoding information of neighboring and decoding target blocks or information of symbols / bins decoded in a previous step. The context model is determined using the context model, the probability of occurrence of a bin is predicted according to the determined context model, and arithmetic decoding of the bin is performed to generate a symbol corresponding to the value of each syntax element. can do. In this case, the CABAC entropy decoding method may update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model.

엔트로피 디코딩부(210)에서 디코딩된 정보 중 예측에 관한 정보는 예측부(230)로 제공되고, 엔트로피 디코딩부(210)에서 엔트로피 디코딩이 수행된 레지듀얼 값, 즉 양자화된 변환 계수는 재정렬부(221)로 입력될 수 있다.The information related to the prediction among the information decoded by the entropy decoding unit 210 is provided to the prediction unit 230, and the residual value on which the entropy decoding has been performed by the entropy decoding unit 210, that is, the quantized transform coefficient, is used as a reordering unit ( 221 may be input.

재정렬부(221)는 양자화되어 있는 변환 계수들을 2차원의 블록 형태로 재정렬할 수 있다. 재정렬부(221)는 인코딩 장치에서 수행된 계수 스캐닝에 대응하여 재정렬을 수행할 수 있다. 여기서 재정렬부(221)는 별도의 구성으로 설명하였으나, 재정렬부(221)는 역양자화부(222)의 일부일 수 있다.The reordering unit 221 may rearrange the quantized transform coefficients in a two-dimensional block form. The reordering unit 221 may perform reordering in response to coefficient scanning performed by the encoding apparatus. Here, the rearrangement unit 221 has been described in a separate configuration, but the rearrangement unit 221 may be part of the inverse quantization unit 222.

역양자화부(222)는 양자화되어 있는 변환 계수들을 (역)양자화 파라미터를 기반으로 역양자화하여 변환 계수를 출력할 수 있다. 이 때, 양자화 파라미터를 유도하기 위한 정보는 인코딩 장치로부터 시그널링될 수 있다.The inverse quantization unit 222 may dequantize the quantized transform coefficients based on the (inverse) quantization parameter and output the transform coefficients. In this case, information for deriving a quantization parameter may be signaled from the encoding apparatus.

역변환부(223)는 변환 계수들을 역변환하여 레지듀얼 샘플들을 유도할 수 있다. The inverse transform unit 223 may inversely transform transform coefficients to derive residual samples.

예측부(230)는 현재 블록에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(230)에서 수행되는 예측의 단위는 코딩 블록일 수도 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다. The prediction unit 230 may perform prediction on the current block and generate a predicted block including prediction samples for the current block. The unit of prediction performed by the prediction unit 230 may be a coding block, a transform block, or a prediction block.

예측부(230)는 상기 예측에 관한 정보를 기반으로 인트라 예측을 적용할 것인지 인터 예측을 적용할 것인지를 결정할 수 있다. 이 때, 인트라 예측과 인터 예측 중 어느 것을 적용할 것인지를 결정하는 단위와 예측 샘플을 생성하는 단위는 상이할 수 있다. 아울러, 인터 예측과 인트라 예측에 있어서 예측 샘플을 생성하는 단위 또한 상이할 수 있다. 예를 들어, 인터 예측과 인트라 예측 중 어느 것을 적용할 것인지는 CU 단위로 결정할 수 있다. 또한 예를 들어, 인터 예측에 있어서 PU 단위로 예측 모드를 결정하고 예측 샘플을 생성할 수 있고, 인트라 예측에 있어서 PU 단위로 예측 모드를 결정하고 TU 단위로 예측 샘플을 생성할 수도 있다. The prediction unit 230 may determine whether to apply intra prediction or inter prediction based on the information about the prediction. In this case, a unit for determining which of intra prediction and inter prediction is to be applied and a unit for generating a prediction sample may be different. In addition, the unit for generating a prediction sample in inter prediction and intra prediction may also be different. For example, whether to apply inter prediction or intra prediction may be determined in units of CUs. In addition, for example, in inter prediction, a prediction mode may be determined and a prediction sample may be generated in PU units, and in intra prediction, a prediction mode may be determined in PU units and a prediction sample may be generated in TU units.

인트라 예측의 경우에, 예측부(230)는 현재 픽처 내의 주변 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 현재 블록의 주변 참조 샘플을 기반으로 방향성 모드 또는 비방향성 모드를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 주변 블록의 인트라 예측 모드를 이용하여 현재 블록에 적용할 예측 모드가 결정될 수도 있다. In the case of intra prediction, the prediction unit 230 may derive the prediction sample for the current block based on the neighbor reference samples in the current picture. The prediction unit 230 may derive the prediction sample for the current block by applying the directional mode or the non-directional mode based on the neighbor reference samples of the current block. In this case, the prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.

인터 예측의 경우에, 예측부(230)는 참조 픽처 상에서 움직임 벡터에 의해 참조 픽처 상에서 특정되는 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 스킵(skip) 모드, 머지(merge) 모드 및 MVP 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이때, 비디오 인코딩 장치에서 제공된 현재 블록의 인터 예측에 필요한 움직임 정보, 예컨대 움직임 벡터, 참조 픽처 인덱스 등에 관한 정보는 상기 예측에 관한 정보를 기반으로 획득 또는 유도될 수 있다In the case of inter prediction, the prediction unit 230 may derive the prediction sample for the current block based on the sample specified on the reference picture by the motion vector on the reference picture. The prediction unit 230 may apply any one of a skip mode, a merge mode, and an MVP mode to derive a prediction sample for the current block. In this case, motion information required for inter prediction of the current block provided by the video encoding apparatus, for example, information about a motion vector, a reference picture index, and the like may be obtained or derived based on the prediction information.

스킵 모드와 머지 모드의 경우에, 주변 블록의 움직임 정보가 현재 블록의 움직임 정보로 이용될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.In the skip mode and the merge mode, the motion information of the neighboring block may be used as the motion information of the current block. In this case, the neighboring block may include a spatial neighboring block and a temporal neighboring block.

예측부(230)는 가용한 주변 블록의 움직임 정보로 머지 후보 리스트를 구성하고, 머지 인덱스가 머지 후보 리스트 상에서 지시하는 정보를 현재 블록의 움직임 벡터로 사용할 수 있다. 머지 인덱스는 인코딩 장치로부터 시그널링될 수 있다. 움직임 정보는 움직임 벡터와 참조 픽처를 포함할 수 있다. 스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트 상의 최상위 픽처가 참조 픽처로서 이용될 수 있다.The prediction unit 230 may construct a merge candidate list using motion information of available neighboring blocks, and may use information indicated by the merge index on the merge candidate list as a motion vector of the current block. The merge index may be signaled from the encoding device. The motion information may include a motion vector and a reference picture. When the motion information of the temporal neighboring block is used in the skip mode and the merge mode, the highest picture on the reference picture list may be used as the reference picture.

스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차이(레지듀얼)이 전송되지 않는다.In the skip mode, unlike the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted.

MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(motion vector predictor)로 이용하여 현재 블록의 움직임 벡터가 유도될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.In the MVP mode, the motion vector of the current block may be derived using the motion vector of the neighboring block as a motion vector predictor. In this case, the neighboring block may include a spatial neighboring block and a temporal neighboring block.

일 예로, 머지 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 머지 후보 리스트가 생성될 수 있다. 머지 모드에서는 머지 후보 리스트에서 선택된 후보 블록의 움직임 벡터가 현재 블록의 움직임 벡터로 사용된다. 상기 예측에 관한 정보는 상기 머지 후보 리스트에 포함된 후보 블록들 중에서 선택된 최적의 움직임 벡터를 갖는 후보 블록을 지시하는 머지 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 머지 인덱스를 이용하여, 현재 블록의 움직임 벡터를 도출할 수 있다.For example, when the merge mode is applied, a merge candidate list may be generated by using a motion vector of a reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block, which is a temporal neighboring block. In the merge mode, the motion vector of the candidate block selected from the merge candidate list is used as the motion vector of the current block. The information about the prediction may include a merge index indicating a candidate block having an optimal motion vector selected from candidate blocks included in the merge candidate list. In this case, the prediction unit 230 may derive the motion vector of the current block by using the merge index.

다른 예로, MVP(Motion Vector Prediction) 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 움직임 벡터 예측자 후보 리스트가 생성될 수 있다. 즉, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터는 움직임 벡터 후보로 사용될 수 있다. 상기 예측에 관한 정보는 상기 리스트에 포함된 움직임 벡터 후보 중에서 선택된 최적의 움직임 벡터를 지시하는 예측 움직임 벡터 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 움직임 벡터 인덱스를 이용하여, 움직임 벡터 후보 리스트에 포함된 움직임 벡터 후보 중에서, 현재 블록의 예측 움직임 벡터를 선택할 수 있다. 인코딩 장치의 예측부는 현재 블록의 움직임 벡터와 움직임 벡터 예측자 간의 움직임 벡터 차분(MVD)을 구할 수 있고, 이를 인코딩하여 비트스트림 형태로 출력할 수 있다. 즉, MVD는 현재 블록의 움직임 벡터에서 상기 움직임 벡터 예측자를 뺀 값으로 구해질 수 있다. 이 때, 예측부(230)는 상기 예측에 관한 정보에 포함된 움직임 벡터 차분을 획득하고, 상기 움직임 벡터 차분과 상기 움직임 벡터 예측자의 가산을 통해 현재 블록의 상기 움직임 벡터를 도출할 수 있다. 예측부는 또한 참조 픽처를 지시하는 참조 픽처 인덱스 등을 상기 예측에 관한 정보로부터 획득 또는 유도할 수 있다. As another example, when the Motion Vector Prediction (MVP) mode is applied, a motion vector predictor candidate list may be generated using a motion vector of a reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block, which is a temporal neighboring block. Can be. That is, the motion vector of the reconstructed spatial neighboring block and / or the Col vector, which is a temporal neighboring block, may be used as a motion vector candidate. The prediction information may include a prediction motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list. In this case, the prediction unit 230 may select the predicted motion vector of the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. The prediction unit of the encoding apparatus may obtain a motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and may encode the output vector in a bitstream form. That is, MVD may be obtained by subtracting the motion vector predictor from the motion vector of the current block. In this case, the prediction unit 230 may obtain a motion vector difference included in the information about the prediction, and derive the motion vector of the current block by adding the motion vector difference and the motion vector predictor. The prediction unit may also obtain or derive a reference picture index or the like indicating a reference picture from the information about the prediction.

가산부(240)는 레지듀얼 샘플과 예측 샘플을 더하여 현재 블록 혹은 현재 픽처를 복원할 수 있다. 가산부(240)는 레지듀얼 샘플과 예측 샘플을 블록 단위로 더하여 현재 픽처를 복원할 수도 있다. 스킵 모드가 적용된 경우에는 레지듀얼이 전송되지 않으므로, 예측 샘플이 복원 샘플이 될 수 있다. 여기서는 가산부(240)를 별도의 구성으로 설명하였으나, 가산부(240)는 예측부(230)의 일부일 수도 있다. 한편, 가산부(240)는 복원부(reconstruction module) 또는 복원 블록 생성부로 불릴 수도 있다. The adder 240 may reconstruct the current block or the current picture by adding the residual sample and the predictive sample. The adder 240 may reconstruct the current picture by adding the residual sample and the predictive sample in block units. Since the residual is not transmitted when the skip mode is applied, the prediction sample may be a reconstruction sample. Although the adder 240 has been described in a separate configuration, the adder 240 may be part of the predictor 230. The adder 240 may also be called a reconstruction module or a reconstruction block generator.

필터부(250)는 복원된 픽처에 디블록킹 필터링 샘플 적응적 오프셋, 및/또는 ALF 등을 적용할 수 있다. 이 때, 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링 이후 적용될 수도 있다. ALF는 디블록킹 필터링 및/또는 샘플 적응적 오프셋 이후 적용될 수도 있다.The filter unit 250 may apply the deblocking filtering sample adaptive offset, and / or ALF to the reconstructed picture. In this case, the sample adaptive offset may be applied in units of samples and may be applied after deblocking filtering. ALF may be applied after deblocking filtering and / or sample adaptive offset.

메모리(260)는 복원 픽처(디코딩된 픽처) 또는 디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(250)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 예컨대, 메모리(260)는 인터 예측에 사용되는 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트 혹은 참조 픽처 리스트에 의해 지정될 수도 있다. 복원된 픽처는 다른 픽처에 대한 참조 픽처로서 이용될 수 있다. 또한, 메모리(260)는 복원된 픽처를 출력 순서에 따라서 출력할 수도 있다. The memory 260 may store reconstructed pictures (decoded pictures) or information necessary for decoding. Here, the reconstructed picture may be a reconstructed picture after the filtering process is completed by the filter unit 250. For example, the memory 260 may store pictures used for inter prediction. In this case, pictures used for inter prediction may be designated by a reference picture set or a reference picture list. The reconstructed picture can be used as a reference picture for another picture. In addition, the memory 260 may output the reconstructed picture in an output order.

한편, 상술한 바와 같이 비디오 코딩을 수행함에 있어 압축 효율을 높이기 위하여 예측을 수행한다. 이를 통하여 코딩 대상 블록인 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록을 생성할 수 있다. 여기서 상기 예측된 블록은 공간 도메인(또는 픽셀 도메인)에서의 예측 샘플들을 포함한다. 상기 예측된 블록은 인코딩 장치 및 디코딩 장치에서 동일하게 도출되며, 상기 인코딩 장치는 원본 블록의 원본 샘플 값 자체가 아닌 상기 원본 블록과 상기 예측된 블록 간의 레지듀얼에 대한 정보(레지듀얼 정보)를 디코딩 장치로 시그널링함으로써 영상 코딩 효율을 높일 수 있다. 디코딩 장치는 상기 레지듀얼 정보를 기반으로 레지듀얼 샘플들을 포함하는 레지듀얼 블록을 도출하고, 상기 레지듀얼 블록과 상기 예측된 블록을 합하여 복원 샘플들을 포함하는 복원 블록을 생성할 수 있고, 복원 블록들을 포함하는 복원 픽처를 생성할 수 있다. Meanwhile, as described above, prediction is performed in order to increase compression efficiency in performing video coding. Through this, a predicted block including prediction samples of the current block, which is a coding target block, may be generated. Wherein the predicted block comprises prediction samples in the spatial domain (or pixel domain). The predicted block is derived identically in the encoding apparatus and the decoding apparatus, and the encoding apparatus decodes information (residual information) about the residual between the original block and the predicted block, not the original sample value itself of the original block. Signaling to an apparatus may increase image coding efficiency. The decoding apparatus may derive a residual block including residual samples based on the residual information, generate the reconstructed block including reconstructed samples by adding the residual block and the predicted block, and generate reconstructed blocks. A reconstructed picture may be generated.

상기 레지듀얼 정보는 변환 및 양자화 절차를 통하여 생성될 수 있다. 예를 들어, 인코딩 장치는 상기 원본 블록과 상기 예측된 블록 간의 레지듀얼 블록을 도출하고, 상기 레지듀얼 블록에 포함된 레지듀얼 샘플들(레지듀얼 샘플 어레이)에 변환 절차를 수행하여 변환 계수들을 도출하고, 상기 변환 계수들에 양자화 절차를 수행하여 양자화된 변환 계수들을 도출하여 관련된 레지듀얼 정보를 (비트스트림을 통하여) 디코딩 장치로 시그널링할 수 있다. 여기서 상기 레지듀얼 정보는 상기 양자화된 변환 계수들의 값 정보, 위치 정보, 변환 기법, 변환 커널, 양자화 파라미터 등의 정보를 포함할 수 있다. 디코딩 장치는 상기 레지듀얼 정보를 기반으로 역양자화/역변환 절차를 수행하고 레지듀얼 샘플들(또는 레지듀얼 블록)을 도출할 수 있다. 디코딩 장치는 예측된 블록과 상기 레지듀얼 블록을 기반으로 복원 픽처를 생성할 수 있다. 인코딩 장치는 또한 이후 픽처의 인터 예측을 위한 참조를 위하여 양자화된 변환 계수들을 역양자화/역변환하여 레지듀얼 블록을 도출하고, 이를 기반으로 복원 픽처를 생성할 수 있다.The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus derives a residual block between the original block and the predicted block, and performs transform procedure on residual samples (residual sample array) included in the residual block to derive transform coefficients. The quantized transform coefficients may be derived by performing a quantization procedure on the transform coefficients to signal related residual information to the decoding device (via a bitstream). Here, the residual information may include information such as value information of the quantized transform coefficients, position information, a transform scheme, a transform kernel, and a quantization parameter. The decoding apparatus may perform an inverse quantization / inverse transformation procedure and derive residual samples (or residual blocks) based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. The encoding apparatus may then dequantize / inverse transform the quantized transform coefficients for reference for inter prediction of the picture to derive a residual block, and generate a reconstructed picture based thereon.

도 3은 본 발명에 따른 다중 변환 기법을 개략적으로 나타낸다. 3 schematically illustrates a multiple conversion scheme according to the present invention.

도 3을 참조하면, 변환부는 상술한 도 1의 인코딩 장치 내의 변환부에 대응될 수 있고, 역변환부는 상술한 도 1의 인코딩 장치 내의 역변환부 또는 도 2의 디코딩 장치 내의 역변환부에 대응될 수 있다. Referring to FIG. 3, the transform unit may correspond to a transform unit in the encoding apparatus of FIG. 1, and the inverse transform unit may correspond to an inverse transform unit in the encoding apparatus of FIG. 1 or an inverse transform unit in the decoding apparatus of FIG. 2. .

변환부는 레지듀얼 블록 내의 레지듀얼 샘플들(레지듀얼 샘플 어레이)를 기반으로 1차 변환을 수행하여 (1차) 변환 계수들을 도출할 수 있다(S310). 여기서 상기 1차 변환은 다중 변환 세트(Multiple Transform Set)를 포함할 수 있다. 다중 변환 세트는, 경우에 따라서 적응적 다중 핵심 변환(adaptive multiple core transform)으로 지칭될 수도 있다. 나아가, 적응적 다중 핵심 변환은 AMT(Adaptive Multiple Transform), EMT(Explicit Multiple Transform), 또는 MTS(Multiple Transform Selection)로 지칭될 수 있다. The transform unit may derive (primary) transform coefficients by performing a first-order transform based on the residual samples (residual sample array) in the residual block (S310). In this case, the first transform may include a multiple transform set. Multiple transform sets may be referred to as adaptive multiple core transforms as the case may be. Furthermore, the adaptive multiple core transform may be referred to as adaptive multiple transform (AMT), explicit multiple transform (EMT), or multiple transform transformation (MTS).

적응적 다중 핵심 변환은 DCT(Discrete Cosine Transform) 타입 2과 DST(Discrete Sine Transform) 타입 7, DCT 타입 8, 및/또는 DST 타입 1을 추가적으로 사용하여 변환하는 방식을 나타낼 수 있다. 즉, 상기 다중 핵심 변환 은 상기 DCT 타입 2, 상기 DST 타입 7, 상기 DCT 타입 8 및 상기 DST 타입 1 중 선택된 복수의 변환 커널들을 기반으로 공간 도메인의 레지듀얼 신호(또는 레지듀얼 블록)를 주파수 도메인의 변환 계수들(또는 1차 변환 계수들)로 변환하는 변환 방법을 나타낼 수 있다. 여기서 상기 1차 변환 계수들은 변환부 입장에서 임시 변환 계수들로 불릴 수 있다. The adaptive multi-core transform may represent a method of additionally using a discrete cosine transform (DCT) type 2, a discrete sine transform (DST) type 7, a DCT type 8, and / or a DST type 1. That is, the multi-core transform is a frequency domain of a residual signal (or residual block) of the spatial 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. A transform method of converting to transform coefficients (or first-order transform coefficients) may be represented. Here, the first-order transform coefficients may be referred to as temporary transform coefficients from a transform unit point of view.

다시 말하면, 기존의 변환 방법이 적용되는 경우, DCT 타입 2를 기반으로 레지듀얼 신호(또는 레지듀얼 블록)에 대한 공간 도메인에서 주파수 도메인으로의 변환이 적용되어 변환 계수들이 생성될 수 있었다. 이와 달리, 상기 적응적 다중 핵심 변환이 적용되는 경우, DCT 타입 2, DST 타입 7, DCT 타입 8, DST 타입 1 및/또는 DST 타입 5 등을 기반으로 레지듀얼 신호(또는 레지듀얼 블록)에 대한 공간 도메인에서 주파수 도메인으로의 변환이 적용되어 변환 계수들(또는 1차 변환 계수들)이 생성될 수 있다. 여기서, DCT 타입 2, DST 타입 7, DCT 타입 8, DST 타입 1 및/또는 DST 타입 5 등은 변환 타입, 변환 커널(kernel) 또는 변환 코어(core)라고 불릴 수 있다. 일 예시에 따른 변환 커널은 대응되는 변환을 위해 적용 가능한 변환 알고리즘(algorithm)에 대한 정보를 포함할 수 있다. In other words, when the conventional transform method is applied, transform coefficients may be generated by applying the spatial domain to the frequency domain transform for the residual signal (or the residual block) based on the DCT type 2. On the contrary, when the adaptive multi-core transform is applied, the residual signal (or the residual block) on the DCT type 2, the DST type 7, the DCT type 8, the DST type 1, and / or the DST type 5 is applied. The transform from the spatial domain to the frequency domain may be applied to generate transform coefficients (or first order transform coefficients). Here, DCT type 2, DST type 7, DCT type 8, DST type 1, and / or DST type 5 may be referred to as a conversion type, a conversion kernel, or a conversion core. The transformation kernel according to an example may include information about a transformation algorithm applicable for the corresponding transformation.

참고로, 상기 DCT/DST 변환 타입들은 기저 함수들을 기반으로 정의될 수 있으며, 상기 기저 함수들은 다음 표와 같이 나타내어질 수 있다.For reference, the DCT / DST conversion types may be defined based on base functions, and the base functions may be represented as the following table.

[표 1]TABLE 1

Figure PCTKR2019002498-appb-I000001
Figure PCTKR2019002498-appb-I000001

상기 적응적 다중 핵심 변환이 수행되는 경우, 상기 변환 커널들 중 대상 블록에 대한 수직 변환 커널 및 수평 변환 커널이 선택될 수 있고, 상기 수직 변환 커널을 기반으로 상기 대상 블록에 대한 수직 변환이 수행되고, 상기 수평 변환 커널을 기반으로 상기 대상 블록에 대한 수평 변환이 수행될 수 있다. 여기서, 상기 수평 변환은 상기 대상 블록의 수평 성분들에 대한 변환을 나타낼 수 있고, 상기 수직 변환은 상기 대상 블록의 수직 성분들에 대한 변환을 나타낼 수 있다. 상기 수직 변환 커널/수평 변환 커널은 레지듀얼 블록을 에워싸는(encompass) 대상 블록(CU 또는 서브블록)의 예측 모드 및/또는 변환 서브셋을 가리키는 변환 인덱스를 기반으로 적응적으로 결정될 수 있다.When the adaptive multi-core transform is performed, a vertical transform kernel and a horizontal transform kernel for a target block among the transform kernels may be selected, and a vertical transform on the target block is performed based on the vertical transform kernel. The horizontal transformation may be performed on the target block based on the horizontal transformation kernel. Here, the horizontal transform may indicate a transform for horizontal components of the target block, and the vertical transform may indicate a transform for vertical components of the target block. The vertical transform kernel / horizontal transform kernel may be adaptively determined based on the prediction mode of the target block (CU or subblock) enclosing the residual block and / or the transform index indicating the transform subset.

변환부는 상기 (1차) 변환 계수들을 기반으로 2차 변환을 수행하여 (2차) 변환 계수들을 도출할 수 있다(S320). 상기 1차 변환이 공간 도메인에서 주파수 도메인으로의 변환이었다면, 상기 2차 변환은 주파수 도메인에서 주파수 도메인으로의 변환으로 볼 수 있다. 상기 2차 변환은 비분리 변환(non- separable transform)을 포함할 수 있다. 이 경우 상기 2차 변환은 비분리 2차 변환(non-separable secondary transform, NSST) 또는 MDNSST(mode-dependent non-separable secondary transform)이라고 불릴 수 있다. 상기 비분리 2차 변환은 상기 1차 변환을 통하여 도출된 (1차) 변환 계수들을 비분리 변환 매트릭스(non-separable transform matrix)를 기반으로 2차 변환하여 레지듀얼 신호에 대한 변환 계수들(또는 2차 변환 계수들)을 생성하는 변환을 나타낼 수 있다. 여기서, 상기 비분리 변환 매트릭스를 기반으로 상기 (1차) 변환 계수들에 대하여 수직 변환 및 수평 변환을 분리하여(또는 수평 수직 변환을 독립적으로) 적용하지 않고 한번에 변환을 적용할 수 있다. 다시 말해, 상기 비분리 2차 변환은 상기 비분리 변환 매트릭스를 기반으로 상기 (1차) 변환 계수들의 수직 성분 및 수평 성분 분리하지 않고 같이 변환하여 변환 계수들(또는 2차 변환 계수들)을 생성하는 변환 방법을 나타낼 수 있다. The transform unit may derive the (secondary) transform coefficients by performing a quadratic transformation based on the (primary) transform coefficients (S320). If the first order transform was from spatial domain to frequency domain, then the second order transform can be viewed as a frequency domain to frequency domain transformation. The secondary transform may include a non-separable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separated quadratic transform transforms (first-order) transform coefficients derived through the first-order transform based on a non-separable transform matrix to transform coefficients (or Transform to generate quadratic transform coefficients). Here, the transformation may be applied at once without applying the vertical and horizontal transformations (or independently of the horizontal and vertical transformations) to the (primary) transformation coefficients based on the non-separated transformation matrix. In other words, the non-separated second-order transform generates transform coefficients (or second-order transform coefficients) by transforming together the vertical and horizontal components of the (primary) transform coefficients without separating them based on the non-separated transform matrix. It can represent the conversion method.

상기 비분리 2차 변환은 (1차) 변환 계수들로 구성된 블록(이하, 변환 계수 블록이라고 불릴 수 있다)의 좌상단(top-left) 영역에 대하여 적용될 수 있다. 예를 들어, 상기 변환 계수 블록의 너비(W) 및 높이(H)가 둘 다 8 이상인 경우, 8×8 비분리 2차 변환이 상기 변환 계수 블록의 좌상단 8×8 영역에 대하여 적용될 수 있다. 또한, 상기 변환 계수 블록의 너비(W) 및 높이(H)가 둘 다 4 이상이면서, 상기 변환 계수 블록의 너비(W) 또는 높이(H)가 8보다 작은 경우, 4×4 비분리 2차 변환이 상기 변환 계수 블록의 좌상단 min(8,W)×min(8,H) 영역에 대하여 적용될 수 있다. 다만 실시예는 이에 한정되지 않으며, 예를 들어 상기 변환 계수 블록의 너비(W) 또는 높이(H)가 8보다 작은 조건만 만족하더라도, 4×4 비분리 2차 변환이 상기 변환 계수 블록의 좌상단 min(8,W)×min(8,H) 영역에 대하여 적용될 수도 있다.The non-separated secondary transform may be applied to a top-left region of a block composed of (primary) transform coefficients (hereinafter, referred to as a transform coefficient block). For example, when the width W and the height H of the transform coefficient block are both 8 or more, an 8x8 non-separated secondary transform may be applied to the upper left 8x8 region of the transform coefficient block. Further, when 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, 4 × 4 non-separated secondary A 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. For example, even if only the width W or the height H of the transform coefficient block is less than 8, a 4 × 4 non-separated quadratic transform is applied to the upper left end of the transform coefficient block. It may also be applied to the min (8, W) × min (8, H) region.

구체적으로 예를 들어, 4×4 입력 블록이 사용되는 경우 비분리 2차 변환은 다음과 같이 수행될 수 있다.Specifically, for example, when a 4x4 input block is used, non-separated quadratic transformation may be performed as follows.

상기 4×4 입력 블록 X는 다음과 같이 나타내어질 수 있다.The 4x4 input block X may be represented as follows.

[수학식 1][Equation 1]

Figure PCTKR2019002498-appb-I000002
Figure PCTKR2019002498-appb-I000002

상기 X를 벡터 형태로 나타내는 경우, 벡터

Figure PCTKR2019002498-appb-I000003
는 다음과 같이 나타내어질 수 있다. If X is represented in vector form, then
Figure PCTKR2019002498-appb-I000003
Can be expressed as follows.

[수학식 2][Equation 2]

Figure PCTKR2019002498-appb-I000004
Figure PCTKR2019002498-appb-I000004

이 경우, 상기 2차 비분리 변환은 다음과 같이 계산될 수 있다.In this case, the second order non-separation transform can be calculated as follows.

[수학식 3][Equation 3]

Figure PCTKR2019002498-appb-I000005
Figure PCTKR2019002498-appb-I000005

여기서,

Figure PCTKR2019002498-appb-I000006
는 변환 계수 벡터를 나타내고, T는 16×16 (비분리) 변환 매트릭스를 나타낸다. here,
Figure PCTKR2019002498-appb-I000006
Denotes a transform coefficient vector, and T denotes a 16x16 (non-separated) transform matrix.

상기 수학식3을 통하여 통하여 16×1 변환 계수 벡터

Figure PCTKR2019002498-appb-I000007
가 도출될 수 있으며, 상기
Figure PCTKR2019002498-appb-I000008
는 스캔 순서(수평, 수직, 대각(diagonal) 등)를 통하여 4×4 블록으로 재구성(re-organized)될 수 있다. 다만, 상술한 계산은 예시로서 비분리 2차 변환의 계산 복잡도를 줄이기 위하여 HyGT(Hypercube-Givens Transsform) 등이 비분리 2차 변환의 계산을 위하여 사용될 수도 있다. 16 × 1 transform coefficient vector through Equation 3
Figure PCTKR2019002498-appb-I000007
Can be derived and said
Figure PCTKR2019002498-appb-I000008
Can be re-organized into 4x4 blocks through the scan order (horizontal, vertical, diagonal, etc.). However, the above-described calculation may be used to calculate a hypercube-givens transsform (HyGT) or the like for the calculation of the non-separated secondary transform as an example to reduce the computational complexity of the non-separated secondary transform.

한편, 상기 비분리 2차 변환은 모드 기반(mode dependent)하게 변환 커널(또는 변환 코어, 변환 타입)이 선택될 수 있다. 여기서 모드는 인트라 예측 모드 및/또는 인터 예측 모드를 포함할 수 있다. In the meantime, the non-separated secondary transform may be mode dependent, and a transform kernel (or a transform core or a transform type) may be selected. Here, the mode may include an intra prediction mode and / or an inter prediction mode.

상술한 바와 같이 상기 비분리 2차 변환은 상기 변환 계수 블록의 너비(W) 및 높이(H)를 기반으로 결정된 8×8 변환 또는 4×4 변환에 기반하여 수행될 수 있다. 즉, 상기 비분리 2차 변환은 8×8 서브블록 사이즈 또는 4×4 서브블록 사이즈에 기반하여 수행될 수 있다. 예를 들어, 상기 모드 기반 변환 커널 선택을 위하여, 8×8 서브블록 사이즈 및 4×4 서브블록 사이즈 둘 다에 대하여 비분리 2차 변환을 위한 3개씩 35개 세트의 비분리 2차 변환 커널들이 구성될 수 있다. 즉, 8×8 서브블록 사이즈에 대하여 35개의 변환 세트가 구성되고, 4×4 서브블록 사이즈에 대하여 35개의 변환 세트가 구성될 수 있다. 이 경우 8×8 서브블록 사이즈에 대한 35개의 변환 세트에는 각각 3개씩의 8×8 변환 커널들이 포함될 수 있고, 이 경우 4×4 서브블록 사이즈에 대한 35개의 변환 세트에는 각각 3개씩의 4×4 변환 커널들이 포함될 수 있다. 다만, 상기 변환 서브블록 사이즈, 상기 세트의 수 및 세트 내 변환 커널들의 수는 예시로서 8×8 또는 4×4 이외의 사이즈가 사용될 수 있고, 또는 n개의 세트들이 구성되고, 각 세트 내에 k개의 변환 커널들이 포함될 수도 있다. As described above, the non-separated secondary transform may be performed based on an 8 × 8 transform or a 4 × 4 transform determined based on the width W and the height H of the transform coefficient block. That is, the non-separated quadratic transform may be performed based on an 8 × 8 subblock size or a 4 × 4 subblock size. For example, for the mode based transform kernel selection, 35 sets of non-separated secondary transform kernels, 3 for non-separated secondary transform, for both 8x8 subblock size and 4x4 subblock size, Can be configured. That is, 35 transform sets may be configured for an 8 × 8 subblock size, and 35 transform sets may be configured for a 4 × 4 subblock size. In this case, 35 transform sets for 8 × 8 subblock sizes may include three 8 × 8 transform kernels, and in this case, 35 transform sets for 4 × 4 subblock sizes, three 4 × for each 4 translation kernels may be included. However, the transform subblock size, the number of sets and the number of transform kernels in the set may be used as an example, other than 8 × 8 or 4 × 4, or n sets are configured and k sets are included in each set. Conversion kernels may be included.

상기 변환 세트는 NSST 세트라고 불릴 수 있고, 상기 NSST 세트 내의 변환 커널은 NSST 커널이라고 불릴 수 있다. 상기 변환 세트들 중 특정 세트의 선택은 예를 들어, 대상 블록(CU 또는 서브블록)의 인트라 예측 모드에 기반하여 수행될 수 있다. The translation set may be called an NSST set, and the translation kernel within the NSST set may be called an NSST kernel. Selection of a specific set of the transform sets may be performed based on, for example, the intra prediction mode of the target block (CU or subblock).

참고로, 예를 들어, 인트라 예측 모드는 2개의 비방향성(non-directinoal, 또는 비각도성(non-angular)) 인트라 예측 모드들과 65개의 방향성(directional, 또는 각도성(angular)) 인트라 예측 모드들을 포함할 수 있다. 상기 비방향성 인트라 예측 모드들은 0번인 플래너(planar) 인트라 예측 모드 및 1번인 DC 인트라 예측 모드를 포함할 수 있고, 상기 방향성 인트라 예측 모드들은 2번 내지 66번의 65개의 인트라 예측 모드들을 포함할 수 있다. 다만, 이는 예시로서 본 발명은 인트라 예측 모드들의 수가 다른 경우에도 적용될 수 있다. 한편, 경우에 따라 67번 인트라 예측 모드가 더 사용될 수 있으며, 상기 67번 인트라 예측 모드는 LM(linear model) 모드를 나타낼 수 있다.For reference, for example, the intra prediction mode includes two non-directinoal or non-angular intra prediction modes and 65 directional or angular intra prediction modes. Can include them. The non-directional intra prediction modes may include a planar intra prediction mode of 0 and a DC intra prediction mode of 1, and the directional intra prediction modes may include 65 intra prediction modes of 2 to 66. . However, as an example, the present invention may be applied to a case where the number of intra prediction modes is different. In some cases, the intra prediction mode 67 may further be used, and the intra prediction mode 67 may represent a linear model (LM) mode.

도 4은 65개의 예측 방향의 인트라 방향성 모드들을 예시적으로 나타낸다.4 exemplarily shows intra directional modes of 65 prediction directions.

도 4를 참조하면, 좌상향 대각 예측 방향을 갖는 34번 인트라 예측 모드를 중심으로 수평 방향성(horizontal directionality)을 갖는 인트라 예측 모드와 수직 방향성(vertical directionality)을 갖는 인트라 예측 모드를 구분할 수 있다. 도 3의 H와 V는 각각 수평 방향성과 수직 방향성을 의미하며, -32 ~ 32의 숫자는 샘플 그리드 포지션(sample grid position) 상에서 1/32 단위의 변위를 나타낸다. 2번 내지 33번 인트라 예측 모드는 수평 방향성, 34번 내지 66번 인트라 예측 모드는 수직 방향성을 갖는다. 18번 인트라 예측 모드와 50번 인트라 예측 모드는 각각 수평 인트라 예측 모드(horizontal intra prediction mode), 수직 인트라 예측 모드(vertical intra prediction mode)를 나타내며, 2번 인트라 예측 모드는 좌하향 대각 인트라 예측 모드, 34번 인트라 예측 모드는 좌상향 대각 인트라 예측 모드, 66번 인트라 예측 모드는 우상향 대각 인트라 예측 모드라고 불릴 수 있다. Referring to FIG. 4, an intra prediction mode having horizontal directionality and an intra prediction mode having vertical directionality may be distinguished from an intra prediction mode 34 having a left upward diagonal prediction direction. H and V in FIG. 3 mean horizontal directionality and vertical directionality, respectively, and numbers of -32 to 32 represent a displacement of 1/32 on a sample grid position. Intra prediction modes 2 to 33 have horizontal orientation, and intra prediction modes 34 to 66 have vertical orientation. Intra prediction mode 18 and intra prediction mode 50 indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and an intra prediction mode 2 indicates a left downward diagonal intra prediction mode, The 34th intra prediction mode may be referred to as a left upward diagonal intra prediction mode, and the 66th intra prediction mode may be referred to as a right upward diagonal intra prediction mode.

이 경우, 상기 35개의 변환 세트들과 상기 인트라 예측 모드들 간의 매핑(mapping)은 예를 들어 다음 표와 같이 나타내어질 수 있다. 참고로, 대상 블록에 LM 모드가 적용되는 경우 상기 대상 블록에 대하여는 2차 변환이 적용되지 않을 수 있다.In this case, the mapping between the 35 transform sets and the intra prediction modes may be represented, for example, in the following table. For reference, when the LM mode is applied to the target block, the quadratic transformation may not be applied to the target block.

[표 2]TABLE 2

Figure PCTKR2019002498-appb-I000009
Figure PCTKR2019002498-appb-I000009

한편, 특정 세트가 사용되는 것으로 결정되면, 비분리 2차 변환 인덱스를 통하여 상기 특정 세트 내 k개의 변환 커널들 중 하나가 선택될 수 있다. 인코딩 장치는 RD(rate-distortion) 체크 기반으로 특정 변환 커널을 가리키는 비분리 2차 변환 인덱스를 도출할 수 있으며, 상기 비분리 2차 변환 인덱스를 디코딩 장치로 시그널링할 수 있다. 디코딩 장치는 상기 비분리 2차 변환 인덱스를 기반으로 특정 세트 내 k개의 변환 커널들 중 하나를 선택할 수 있다. 예를 들어, NSST 인덱스 값 0은 첫번째 비분리 2차 변환 커널을 가리킬 수 있고, NSST 인덱스 값 1은 두번째 비분리 2차 변환 커널을 가리킬 수 있으며, NSST 인덱스 값 2는 세번째 비분리 2차 변환 커널을 가리킬 수 있다. 또는 NSST 인덱스 값 0은 대상 블록에 대하여 첫번째 비분리 2차 변환이 적용되지 않음을 가리킬 수 있고, NSST 인덱스 값 1 내지 3은 상기 3개의 변환 커널들을 가리킬 수 있다. On the other hand, if it is determined that a particular set is to be used, one of k transform kernels in the particular set may be selected via a non-separated secondary transform index. The encoding apparatus may derive a non-separated secondary transform index pointing to a specific transform kernel based on a rate-distortion (RD) check, and may signal the non-separated secondary transform index to the decoding apparatus. The decoding apparatus may select one of k transform kernels in a specific set based on the non-separated secondary transform index. For example, NSST index value 0 can point to the first non-isolated secondary transform kernel, NSST index value 1 can point to the second non-isolated secondary transform kernel, and NSST index value 2 is the third non-isolated secondary transform kernel. Can point to Alternatively, the NSST index value 0 may indicate that the first non-separated secondary transform is not applied to the target block, and the NSST index values 1 to 3 may indicate the three transform kernels.

다시 도 3을 참조하면, 변환부는 선택된 변환 커널들을 기반으로 상기 비분리 2차 변환을 수행하고 (2차) 변환 계수들을 획득할 수 있다. 상기 변환 계수들은 상술한 바와 같이 양자화부를 통하여 양자화된 변환 계수들로 도출될 수 있고, 인코딩되어 디코딩 장치로 시그널링 및 인코딩 장치 내의 역양자화/역변환부로 전달될 수 있다.Referring back to FIG. 3, the transform unit may perform the non-separated secondary transform based on the selected transform kernels and obtain (secondary) transform coefficients. The transform coefficients may be derived as quantized transform coefficients through the quantization unit as described above, and may be encoded and transferred to the decoding apparatus and to the inverse quantization / inverse transform unit in the encoding apparatus.

한편, 상술한 바와 같이 2차 변환이 생략되는 경우 상기 1차 (분리) 변환의 출력인 (1차) 변환 계수들이 상술한 바와 같이 양자화부를 통하여 양자화된 변환 계수들로 도출될 수 있고, 인코딩되어 디코딩 장치로 시그널링 및 인코딩 장치 내의 역양자화/역변환부로 전달될 수 있다.On the other hand, when the secondary transform is omitted as described above, the (primary) transform coefficients, which are outputs of the primary (separated) transform, may be derived as quantized transform coefficients through the quantization unit as described above, and may be encoded. The decoding apparatus may be transferred to an inverse quantization / inverse transform unit in the signaling and encoding apparatus.

역변환부는 상술한 변환부에서 수행된 절차의 역순으로 일련의 절차를 수행할 수 있다. 역변환부는 (역양자화된) 변환 계수들을 수신하여, 2차 (역)변환을 수행하여 (1차) 변환 계수들을 도출하고(S350), 상기 (1차) 변환 계수들에 대하여 1차 (역)변환을 수행하여 레지듀얼 블록(레지듀얼 샘플들)을 획득할 수 있다. 여기서 상기 1차 변환 계수들은 역변환부 입장에서 수정된(modified) 변환 계수들로 불릴 수 있다. 인코딩 장치 및 디코딩 장치는 상기 레지듀얼 블록과 예측된 블록을 기반으로 복원 블록을 생성하고, 이를 기반으로 복원 픽처를 생성할 수 있음은 상술한 바와 같다.The inverse transform unit may perform a series of procedures in a reverse order of the procedure performed in the above-described transform unit. The inverse transform unit receives the (inverse quantized) transform coefficients, performs a second order (inverse) transform, and derives (first order) transform coefficients (S350), and performs a first order (inverse) on the (first order) transform coefficients. The transformation may be performed to obtain a residual block (residual samples). Here, the first transform coefficients may be referred to as modified transform coefficients from an inverse transform unit. As described above, the encoding apparatus and the decoding apparatus may generate a reconstructed block based on the residual block and the predicted block, and generate a reconstructed picture based on the residual block and the predicted block.

한편, 상술한 바와 같이 2차 (역)변환이 생략되는 경우 (역양자화된) 변환 계수들을 수신하여 상기 1차 (분리) 변환을 수행하여 레지듀얼 블록(레지듀얼 샘플들)을 획득할 수 있다. 인코딩 장치 및 디코딩 장치는 상기 레지듀얼 블록과 예측된 블록을 기반으로 복원 블록을 생성하고, 이를 기반으로 복원 픽처를 생성할 수 있음은 상술한 바와 같다.Meanwhile, as described above, when the secondary (inverse) transform is omitted, a residual block (residual samples) may be obtained by receiving the (dequantized) transform coefficients and performing the first (separated) transform. . As described above, the encoding apparatus and the decoding apparatus may generate a reconstructed block based on the residual block and the predicted block, and generate a reconstructed picture based on the residual block and the predicted block.

도 5a 및 도 5b는 일 실시예에 따른 변환 계수의 코딩 과정을 도시하는 흐름도이다.5A and 5B are flowcharts illustrating a coding process of transform coefficients, according to an exemplary embodiment.

도 5a 및 도 5b에 개시된 각 단계는 도 1 및 도 2에 개시된 인코딩 장치(100) 또는 디코딩 장치(200)에 의하여 수행될 수 있으며, 보다 구체적으로는 도 1에 개시된 엔트로피 인코딩부(130) 및 도 2에 개시된 엔트로피 디코딩부(210)에 의하여 수행될 수 있다. Each of the steps disclosed in FIGS. 5A and 5B may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 and the disclosure illustrated in FIG. 1. It may be performed by the entropy decoding unit 210 disclosed in FIG.

본 명세서에서는 특정 정보 또는 개념을 정의하기 위한 용어 또는 문장을 사용하고 있다. 예를 들어, 본 명세서에서는 "변환 스킵 모드가 아닌(non-transform-skip mode) 현재 블록(이하, 대상 블록 또는 레지듀얼 블록을 의미할 수도 있다)에 대한 변환 계수들 중 0이 아닌 변환 계수의 개수가 2개 미만인지 여부를 나타내기 위한 플래그" 또는 "현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 존재하는지 여부를 나타내는 플래그"를 cbf 플래그로 나타내고 있다. 그러나, "cbf 플래그"는 coded_block_flag, cbf 등 다양한 용어로 대체될 수 있는 바, 본 명세서에서 특정 정보 또는 개념을 정의하기 위해 사용된 용어 또는 문장을 명세서 전반에서 해석함에 있어서 그 명칭에 국한된 해석을 하여서는 안 되고, 상기 용어가 의미하는 바에 따른 다양한 동작, 기능 및 효과에 주목하여 해석할 필요가 있다. In this specification, terms or sentences for defining specific information or concepts are used. For example, in the present specification, the "non-transform-skip mode" of the non-transform coefficients of the transform coefficients for the current block (hereinafter, may also mean a target block or residual block). A flag for indicating whether the number is less than two or a flag indicating whether a non-zero transform coefficient exists among the transform coefficients for the current block is indicated by the cbf flag. However, the "cbf flag" may be replaced with various terms such as coded_block_flag, cbf, and the term or sentence used to define a specific information or concept in the present specification is to be interpreted limited to its name when interpreting throughout the specification. Rather, it is necessary to pay attention to and interpret various operations, functions, and effects as the term means.

도 5a는 변환 계수의 인코딩 과정의 일 예를 도시하고 있다. 5A illustrates an example of an encoding process of transform coefficients.

일 실시예에 따른 인코딩 장치(100)는, 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 적어도 하나 존재하는지 여부를 나타내는 플래그 또는 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수의 개수가 2개 미만인지 여부를 나타내기 위한 플래그인 cbf 플래그가 1을 지시하는지 여부를 판단할 수 있다(S500). cbf 플래그가 1을 지시하는 경우, 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 적어도 하나 존재함을 나타낼 수 있고, 경우에 따라서는 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 2개 이상 존재함을 나타낼 수 있다. 반대로, cbf 플래그가 0을 지시하는 경우, 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수들이 존재하지 않음을 나타낼 수 있고, 경우에 따라서는 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 2개 미만으로 존재함을 나타낼 수 있다.The encoding apparatus 100 according to an embodiment may include a flag indicating whether at least one non-zero transform coefficient among the transform coefficients for the current block exists or the number of nonzero transform coefficients among the transform coefficients for the current block. It may be determined whether or not the cbf flag indicating a flag indicating 1 is 1 or less (S500). If the cbf flag indicates 1, it may indicate that there is at least one non-zero transform coefficient among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block is present. Two or more may be present. Conversely, if the cbf flag indicates 0, it may indicate that there are no non-zero transform coefficients among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block. May be present in fewer than two.

일 실시예에서, cbf 플래그는 루마 블록에 대한 플래그(예를 들어, cbf_luma flag, cbf_luma[x0][y0][tranfoDepth]) 및 크로마 블록에 대한 플래그(예를 들어, cbf_cb flag 및 cbf_cr flag, 또는 cbf_cb[x0][y0][trafoDepth] 및 cbf_cr[x0][y0][trafoDepth])를 포함할 수 있다. cbf_luma[x0][y0][tranfoDepth], cbf_cb[x0][y0][trafoDepth] 및 cbf_cr[x0][y0][trafoDepth]와 관련하여, 어레이 인덱스 x0 및 y0는 현재 픽처의 좌상단(top-left) 루마/크로마 샘플에 대한 대상 블록의 좌상단 루마/크로마 샘플의 위치를 의미하고, 어레이 인덱스 trafoDepth는 변환 코딩을 목적으로 하여 코딩 블록이 분할된 레벨을 의미할 수 있다. trafoDepth가 0을 지시하는 블록들을 코딩 블록과 대응되고, 코딩 블록과 변환 블록이 동일하게 정의된 경우에는 trafoDepth가 0으로 간주될 수 있다.In one embodiment, the cbf flag is a flag for the luma block (eg cbf_luma flag, cbf_luma [x0] [y0] [tranfoDepth]) and a flag for the chroma block (eg cbf_cb flag and cbf_cr flag, or cbf_cb [x0] [y0] [trafoDepth] and cbf_cr [x0] [y0] [trafoDepth]). With respect to cbf_luma [x0] [y0] [tranfoDepth], cbf_cb [x0] [y0] [trafoDepth], and cbf_cr [x0] [y0] [trafoDepth], the array indexes x0 and y0 are the top-left of the current picture. ) Denotes the position of the upper left luma / chroma sample of the target block with respect to the luma / chroma sample, and the array index trafoDepth may refer to a level at which the coding block is divided for transform coding purposes. If the coding block and the transform block are defined to be identical to the coding block, the blocks in which trafoDepth indicates 0 may be regarded as trafoDepth.

일 실시예에 따른 인코딩 장치(100)는, S500에서 cbf 플래그가 1을 지시하는 경우, 현재 블록에 대한 변환 계수들에 관한 정보를 인코딩할 수 있다(S510). 일 예시에서, 현재 블록에 대한 변환 계수들에 관한 정보는, 0이 아닌 마지막 변환 계수의 위치에 대한 정보, 현재 블록의 서브 블록에 0이 아닌 변환 계수가 포함되는지 여부를 지시하는 그룹 플래그 정보, EMT_CU_Flag(또는, MTS_CU_Flag), EMT_TU(또는, MTS_TU), EMT_TU 인덱스(또는, MTS_TU 인덱스), 현재 블록에 대한 변환 계수들(의 값) 등을 포함할 수 있다.According to an embodiment, when the cbf flag indicates 1 in S500, the encoding apparatus 100 may encode information about transform coefficients for the current block (S510). In one example, the information about the transform coefficients for the current block includes information on the position of the last non-zero transform coefficient, group flag information indicating whether a non-zero transform coefficient is included in a subblock of the current block, EMT_CU_Flag (or MTS_CU_Flag), EMT_TU (or MTS_TU), EMT_TU index (or MTS_TU index), transform coefficients (value of) for the current block, and the like.

일 실시예에 따른 인코딩 장치(100)는, NSST를 수행할 조건에 해당하는지 여부를 판단할 수 있다(S520). 보다 구체적으로, 인코딩 장치(100)는 NSST 인덱스를 인코딩할 조건에 해당하는지 여부를 판단할 수 있다. 이때 NSST 인덱스는, 예를 들어 변환 인덱스(transform index) 등으로 지칭될 수도 있다. The encoding apparatus 100 according to an embodiment may determine whether it corresponds to a condition for performing NSST (S520). More specifically, the encoding apparatus 100 may determine whether it corresponds to a condition for encoding the NSST index. In this case, the NSST index may be referred to as, for example, a transform index.

일 실시예에 따른 인코딩 장치(100)는, S500에서 cbf 플래그가 0을 지시하는 경우, S510, S520 및 S530에 따른 동작을 생략할 수 있다. If the cbf flag indicates 0 in S500, the encoding apparatus 100 according to an exemplary embodiment may omit the operations according to S510, S520, and S530.

또한, 일 실시예에 따른 인코딩 장치(100)는, S520에서 NSST를 수행할 조건에 해당하지 않는다고 판단된 경우, S530에 따른 동작을 생략할 수 있다. The encoding apparatus 100 according to an embodiment may omit the operation according to S530 when it is determined in S520 that it does not correspond to a condition for performing NSST.

도 5b는 변환 계수의 디코딩 과정의 일 예를 도시하고 있다. 5B illustrates an example of a decoding process of transform coefficients.

일 실시예에 따른 디코딩 장치(200)는, cbf 플래그가 1을 지시하는지 여부를 판단할 수 있다(S540). cbf 플래그가 1을 지시하는 경우, 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 적어도 하나 존재함을 나타낼 수 있고, 경우에 따라서는 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 2개 이상 존재함을 나타낼 수 있다. 반대로, cbf 플래그가 0을 지시하는 경우, 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수들이 존재하지 않음을 나타낼 수 있고, 경우에 따라서는 현재 블록에 대한 변환 계수들 중 0이 아닌 변환 계수가 2개 미만으로 존재함을 나타낼 수 있다.The decoding apparatus 200 according to an embodiment may determine whether the cbf flag indicates 1 (S540). If the cbf flag indicates 1, it may indicate that there is at least one non-zero transform coefficient among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block is Two or more may be present. Conversely, if the cbf flag indicates 0, it may indicate that there are no non-zero transform coefficients among the transform coefficients for the current block, and in some cases, a non-zero transform coefficient among the transform coefficients for the current block. May be present in fewer than two.

일 실시예에 따른 디코딩 장치(200)는, S540에서 cbf 플래그가 1을 지시하는 경우, 현재 블록에 대한 변환 계수들에 관한 정보를 디코딩할 수 있다(S550).The decoding apparatus 200 according to an embodiment may decode information about transform coefficients for the current block when the cbf flag indicates 1 in S540 (S550).

일 실시예에 따른 디코딩 장치(200)는, NSST를 수행할 조건에 해당하는지 여부를 판단할 수 있다(S560). 보다 구체적으로, 디코딩 장치(200)는 NSST 인덱스를 인코딩할 조건에 해당하는지 여부를 판단할 수 있다. The decoding apparatus 200 according to an embodiment may determine whether it corresponds to a condition for performing NSST (S560). More specifically, the decoding apparatus 200 may determine whether it corresponds to a condition for encoding the NSST index.

일 실시예에 따른 디코딩 장치(200)는, S540에서 cbf 플래그가 0을 지시하는 경우, S550, S560 및 S570에 따른 동작을 생략할 수 있다. When the cbf flag indicates 0 in S540, the decoding apparatus 200 may omit the operations according to S550, S560, and S570.

또한, 일 실시예에 따른 디코딩 장치(200)는, S560에서 NSST를 수행할 조건에 해당하지 않는다고 판단된 경우, S570에 따른 동작을 생략할 수 있다.In addition, if it is determined that the decoding apparatus 200 does not correspond to a condition for performing NSST, the decoding apparatus 200 according to an exemplary embodiment may omit the operation according to S570.

도 6은 일 실시예에 따른 변환 계수의 코딩 과정을 구체화하여 도시하는 흐름도이다.6 is a flowchart illustrating a process of coding a transform coefficient according to an embodiment.

도 6에 개시된 각 단계는 도 1 및 도 2에 개시된 인코딩 장치(100) 또는 디코딩 장치(200)에 의하여 수행될 수 있으며, 보다 구체적으로 도 1에 개시된 엔트로피 인코딩부(130) 또는 도 2에 개시된 엔트로피 디코딩부(210)에 의하여 수행될 수 있다. 더불어, 도 6의 S600은 도 5a의 S500 및 도 5b의 S540과 대응될 수 있고, 도 6의 S605 내지 S625 및 S645는 도 5a의 S510 및 도 5b의 S550과 대응될 수 있고, 도 6의 S630 및 S635는 도 5a의 S520 및 S530, 도 5b의 S560 및 S570과 대응될 수 있다. 따라서, 도 1, 도 2, 도 5a 및 도 5b에서 전술된 내용과 중복되는 구체적인 내용은 설명을 생략하거나 간단히 하기로 한다.Each step disclosed in FIG. 6 may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 disclosed in FIG. 1 or the disclosure described in FIG. 2. It may be performed by the entropy decoding unit 210. In addition, S600 of FIG. 6 may correspond to S500 of FIG. 5A and S540 of FIG. 5B, and S605 to S625 and S645 of FIG. 6 may correspond to S510 of FIG. 5A and S550 of FIG. 5B, and S630 of FIG. 6. And S635 may correspond to S520 and S530 of FIG. 5A and S560 and S570 of FIG. 5B. Therefore, specific details overlapping with the above-described contents in FIGS. 1, 2, 5A, and 5B will be omitted or simply described.

본 명세서에서는, 인코딩 장치를 기준으로 할 때, 현재 블록에 대한 레지듀얼 샘플들에 대하여 첫 번째로 수행되는 변환을 1차 변환으로 지칭하고, 두 번째로 수행되는 변환을 2차 변환으로 지칭하기로 한다. 다만 1차 변환은 코어 변환, core transform, primary 변환, primary transform, 적응적 다중 변환, AMT, EMT, MTS 등 다양한 명칭으로 지칭될 수 있고, 2차 변환은 비분리 2차 변환, NSST, MDNSST 등 다양한 명칭으로 지칭될 수 있으며, 예시는 이에 한정되지 않는다. In the present specification, when referring to an encoding apparatus, a transform performed first on residual samples for a current block is referred to as a primary transform, and a transform performed second is referred to as a secondary transform. do. However, the primary transform may be referred to by various names such as core transform, core transform, primary transform, primary transform, adaptive multiple transform, AMT, EMT, MTS, and secondary transform may be non-separated secondary transform, NSST, MDNSST, etc. It may be referred to by various names, examples are not limited thereto.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 cbf 플래그가 1을 지시하는지 여부를 판단할 수 있다(S600).The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether the cbf flag indicates 1 (S600).

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 S600에서 cbf 플래그가 1을 지시하는 경우, STI(Single Transform Indicator)가 1을 지시하는지 여부를 판단할 수 있다(S605). 본 명세서에서 "STI"는 레지듀얼 계수들을 변환하기 위해 두 개의 변환(예를 들어, 1차 변환 및 2차 변환)을 모두 적용(apply)하는 대신 단일(single) 변환을 적용할지 여부를 나타내기 위한 정보를 의미할 수 있다. When the cbf flag indicates 1 in S600, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether a single transform indicator (STI) indicates 1 (S605). “STI” in this specification indicates whether to apply a single transform instead of applying both transforms (eg, primary transform and secondary transform) to transform the residual coefficients. It may mean information for.

보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 S600에서 cbf 플래그가 1을 지시하는 경우, STI가 활성화 되었는지(enabled) 여부를 판단할 수 있고, STI가 활성화 된 경우 STI가 1을 지시하는지 여부를 판단할 수 있다. 다만 STI가 활성화 되었는지 여부를 판단하는 과정은 필수 과정이 아니며, 다른 일 실시예에서는 STI가 활성화 되었는지 여부에 대한 판단 없이 곧바로(directly) STI가 1을 지시하는지 여부를 판단할 수 있다. 또는, 경우에 따라서 STI가 1을 지시하면 STI가 활성화 되었음을 나타낼 수도 있다.More specifically, when the cbf flag indicates 1 in S600, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the STI is enabled, and when the STI is enabled, the STI sets 1 Can be determined. However, the process of determining whether the STI is activated is not a required process, and in another embodiment, it may be determined whether the STI indicates 1 directly without determining whether the STI is activated. Alternatively, if the STI indicates 1 in some cases, it may indicate that the STI is activated.

일 예시에서, STI는 STI coding, STI coding flag, ST flag 등으로 지칭될 수도 있다. STI가 1을 지시하는 경우 레지듀얼 계수들을 변환함에 있어서 단일 변환이 적용됨을 의미하고, STI가 0을 지시하는 경우 레지듀얼 계수들을 변환함에 있어서 단일 변환이 적용되지 않음을 의미할 수 있다.In one example, the STI may be referred to as STI coding, STI coding flag, ST flag, or the like. When the STI indicates 1, it may mean that a single transform is applied in converting the residual coefficients. When the STI indicates 0, it may mean that a single transform is not applied in converting the residual coefficients.

단일 변환의 종류(type)는 다양할 수 있다. 단일 변환의 예시로서, 분리(separable) 변환, 비분리(non-separable) 변환, 비분리 변환으로부터의 근사화된(approximated) 변환 등이 있을 수 있다. The type of a single transformation can vary. Examples of a single transform may be a separable transform, a non-separable transform, an approximated transform from the non-separable transform, and the like.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 S605에서 STI가 0을 지시하는 경우, EMT_CU_Flag(또는, MTS_CU_Flag, 이하 동일)를 코딩(인코딩 또는 디코딩)할 수 있다(S610). The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code (encode or decode) EMT_CU_Flag (or MTS_CU_Flag, hereinafter same) when STI indicates 0 in S605 (S610).

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, cbf 플래그가 0을 지시하는 경우, S605 및 S610에 따른 동작을 생략하고 S615에 따른 동작을 진행할 수 있다. When the cbf flag indicates 0, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may skip the operations according to S605 and S610 and proceed to the operation according to S615.

EMT(또는, MTS, 이하 동일)는 도 3에서 전술한 바와 같이 1차 변환 또는 코어 변환의 예시에 해당할 수 있다. EMT(또는, MTS)는 폭(width) 및 높이(height)가 32보다 작거나 같은 코딩 블록(CU)에 적용될 수 있고, 경우에 따라서는 64보다 작거나 같은 코딩 블록에 적용될 수도 있다. EMT(또는, MTS)의 적용 여부는 CU 레벨에서 시그널링되는 EMT_CU_Flag(또는, MTS_CU_Flag)를 기반으로 제어될 수 있다. EMT_CU_Flag(또는, MTS_CU_Flag)가 0을 지시하는 경우, 현재 블록에 대한 레지듀얼 코딩을 수행하기 위해 DCT 타입 2가 이용될 수 있다. EMT(또는, MTS)가 적용되는 코딩 블록 내의 루마 코딩 블록에서 이용될 수평 변환 및 수직 변환을 식별하기 위해 두 개의 추가적인 플래그들이 시그널링될 수 있다.The EMT (or MTS, hereinafter same) may correspond to an example of first-order transformation or core transformation, as described above with reference to FIG. 3. The EMT (or MTS) may be applied to a coding block CU whose width and height are less than or equal to 32, and in some cases, may be applied to a coding block smaller than or equal to 64. Whether to apply EMT (or MTS) may be controlled based on the EMT_CU_Flag (or MTS_CU_Flag) signaled at the CU level. If EMT_CU_Flag (or MTS_CU_Flag) indicates 0, DCT type 2 may be used to perform residual coding for the current block. Two additional flags may be signaled to identify the horizontal and vertical transforms to be used in the luma coding block in the coding block to which the EMT (or MTS) is applied.

인트라 레지듀얼 코딩에서는 서로 다른 인트라 예측 모드들의 서로 다른 레지듀얼 상태(static)로 인해, 모드 의존 변환 후보 선택 프로세스(mode-dependent transform candidate selection process)가 이용될 수 있다. 세 개의 변환 서브셋의 예시는 아래의 표 3과 같고, 인트라 예측 모드와 상기 변환 서브셋 간의 관계는 아래의 표 4와 같다. In intra residual coding, a mode-dependent transform candidate selection process may be used due to different residual states of different intra prediction modes. Examples of the three transform subsets are shown in Table 3 below, and the relationship between the intra prediction mode and the transform subset is shown in Table 4 below.

[표 3]TABLE 3

Figure PCTKR2019002498-appb-I000010
Figure PCTKR2019002498-appb-I000010

[표 4]TABLE 4

Figure PCTKR2019002498-appb-I000011
Figure PCTKR2019002498-appb-I000011

서브셋 개념을 기반으로, EMT_CU_flag(또는, MTS_CU_flag)가 1을 지시하는 경우에 인트라 예측 모드를 이용하여 하나의 변환 (서브)셋이 표 3에 따라 도출될 수 있다. 또한, 표 4를 참조하면 각 인트라 모드에 대하여 수평 방향의 EMT_TU 인덱스(또는, MTS_TU_인덱스, 이하 동일)인 EMT_TU_horizontal_index(또는, MTS_TU_horizontal_index, 이하 동일)(또는 EMT_TU_horizontal_flag (또는, MTS_TU_horizontal_flag, 이하 동일)와 수직 방향의 EMT_TU 인덱스(또는, MTS_TU 인덱스)인 EMT_TU_vertical_index(또는, MTS_TU_vertical_index, 이하 동일) (또는 EMT_TU_horizontal_flag(또는, EMT_TU_horizontal_flag, 이하 동일)가 할당될 수 있다. 나아가, 표 3의 변환 셋 내에 포함된 두 개의 변환 후보들(transform candidates) 중 하나를 결정하기 위한 플래그가 시그널링될 수 있다. Based on the subset concept, one transform (sub) set may be derived using the intra prediction mode when EMT_CU_flag (or MTS_CU_flag) indicates 1 according to Table 3. In addition, referring to Table 4, the EMT_TU_horizontal_index (or MTS_TU_horizontal_index, hereinafter same), which is the EMT_TU index (or MTS_TU_index, hereinafter same) in the horizontal direction for each intra mode, or the same as the EMT_TU_horizontal_flag (or, MTS_TU_horizontal_flag, hereinafter vertical) EMT_TU_vertical_index (or MTS_TU_vertical_index, hereinafter same) (or EMT_TU_horizontal_flag (or EMT_TU_horizontal_flag, hereinafter same)), which is an EMT_TU index (or MTS_TU index) in the direction, may be allocated. A flag for determining one of the transform candidates may be signaled.

다시 S610을 참조하면, 일 실시예에 따른 디코딩 장치(200)는 EMT_CU_Flag(MTS_CU_Flag)를 디코딩하고, EMT_CU_Flag(MTS_CU_Flag)가 1을 지시하는 경우 표 3을 기반으로 인트라 예측 모드를 이용하여 하나의 변환 셋을 도출할 수 있다.Referring back to S610, the decoding apparatus 200 according to an embodiment decodes EMT_CU_Flag (MTS_CU_Flag), and when EMT_CU_Flag (MTS_CU_Flag) indicates 1, one transform set using an intra prediction mode based on Table 3 Can be derived.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 변환 계수들을 코딩(인코딩 또는 디코딩)할 수 있다(S615). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 레지듀얼 계수들에 대하여 변환이 수행되어 도출된 변환 계수들을 인코딩 또는 디코딩할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code (encode or decode) transform coefficients for the current block (S615). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode transform coefficients derived by performing transform on residual coefficients for the current block.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 EMT_TU(또는, MTS_TU, 이하 동일)가 코딩 되었는지(또는 코딩 할지) 여부를 판단할 수 있다(S620). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 EMT_TU 인덱스(또는, MTS_TU 인덱스)가 코딩 되었는지 여부를 판단할 수 있다. EMT_TU 인덱스(또는, MTS_TU 인덱스)는 전술한 바와 같이, 각 인트라 모드에 대하여 수평 방향의 EMT_TU 인덱스(또는, MTS_TU 인덱스)인 EMT_TU_horizontal_index(MTS_TU_horizontal_index)(또는 EMT_TU_horizontal_flag(MTS_TU_horizontal_flag))와 수직 방향의 EMT_TU 인덱스(또는, MTS_TU 인덱스)인 EMT_TU_vertical_index(MTS_TU_vertical_index)(또는 EMT_TU_vertical_flag(MTS_TU_vertical_flag))를 포함할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether the EMT_TU (or MTS_TU, hereinafter identical) is coded (or coded) (S620). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU index (or MTS_TU index) is coded. As described above, the EMT_TU index (or MTS_TU index) is the EMT_TU_horizontal_index (MTS_TU_horizontal_index) (or EMT_TU_horizontal_flag (MTS_TU_horizontal_flag) in the vertical direction (or EMT_TU_horizontal_flag)), which is the EMT_TU index (or MTS_TU index) in the horizontal direction, as described above. It may include an EMT_TU_vertical_index (MTS_TU_vertical_index) (or an EMT_TU_vertical_flag (MTS_TU_vertical_flag)) which is an MTS_TU index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S620에서 EMT_TU(또는, MTS_TU)가 코딩 되지 않았다고(또는 코딩 하지 않을 것으로) 판단된 경우, EMT_TU 인덱스(또는, MTS_TU 인덱스)에 대한 코딩을 스킵하고 S630에 따른 동작을 수행할 수 있다. If the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment determines that the EMT_TU (or MTS_TU) is not coded (or not to be coded) in S620, the encoding apparatus 100 or the decoding apparatus 200 according to the embodiment may be added to the EMT_TU index (or, MTS_TU index). The coding may be skipped and an operation according to S630 may be performed.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S620에서 EMT_TU(또는, MTS_TU)가 코딩 되었다고 판단된 경우, EMT_TU 인덱스(또는, MTS_TU 인덱스)를 코딩(인코딩 또는 디코딩)할 수 있다(S625). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 각 인트라 모드에 대하여 EMT_TU 인덱스(또는, MTS_TU 인덱스)를 코딩할 수 있다. 일 예시에서, 인코딩 장치(100) 또는 디코딩 장치(200)는 각 인트라 모드에 대하여 수평 방향의 EMT_TU 인덱스(또는, MTS_TU 인덱스)인 EMT_TU_horizontal_index(MTS_TU_horizontal_index)(또는 EMT_TU_horizontal_flag(MTS_TU_horizontal_flag))와 수직 방향의 EMT_TU 인덱스(또는, MTS_TU 인덱스)인 EMT_TU_vertical_index(MTS_TU_vertical_index)(또는 EMT_TU_vertical_flag(MTS_TU_vertical_flag))를 코딩할 수 있다. EMT_TU 인덱스(또는, MTS_TU 인덱스)의 예시는 표 3과 같을 수 있고, 각 인트라 모드에 대하여 EMT_TU 인덱스(또는, MTS_TU 인덱스)가 할당되는 예시는 표 4와 같을 수 있다. 또한, 전술한 바와 같이 표 3의 변환 셋 내에 포함된 두 개의 변환 후보들(transform candidates) 중 하나를 결정하기 위한 플래그가 추가로 시그널링될 수 있다.If it is determined that the EMT_TU (or MTS_TU) is coded in S620, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code (encode or decode) the EMT_TU index (or MTS_TU index). There is (S625). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code an EMT_TU index (or MTS_TU index) for each intra mode. In one example, the encoding apparatus 100 or the decoding apparatus 200 may have an EMT_TU_horizontal_index (MTS_TU_horizontal_index) (or EMT_TU_horizontal_flag (MTS_TU_horizontal_flag)) which is a horizontal EMT_TU index (or MTS_TU index) for each intra mode. EMT_TU_vertical_index (MTS_TU_vertical_index) (or EMT_TU_vertical_flag (MTS_TU_vertical_flag)) that is (or MTS_TU index) may be coded. An example of an EMT_TU index (or MTS_TU index) may be as shown in Table 3, and an example in which an EMT_TU index (or MTS_TU index) is allocated to each intra mode may be as shown in Table 4. In addition, as described above, a flag for determining one of two transform candidates included in the transform set of Table 3 may be further signaled.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, NSST를 수행할 조건에 해당하는지 여부를 판단할 수 있다(S630). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 NSST 인덱스를 코딩(인코딩 또는 디코딩)할 조건에 해당하는지 여부를 판단할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether it corresponds to a condition for performing NSST (S630). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for coding (encoding or decoding) the NSST index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S630에서 NSST를 수행할 조건에 해당한다고 판단된 경우, NSST 인덱스를 코딩할 수 있다(S635). 보다 구체적으로, S630에서 NSST 인덱스를 코딩할 조건에 해당한다고 판단된 경우, 인코딩 장치(100) 또는 디코딩 장치(200)는 NSST 인덱스를 인코딩 또는 디코딩할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code an NSST index when it is determined that the condition corresponds to a condition for performing NSST in S630 (S635). More specifically, when it is determined in S630 that the conditions for coding the NSST index, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode the NSST index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S605에서 STI가 1을 지시하는 경우, STI 인덱스를 코딩할 수 있다(S640). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 STI가 활성화 되었으며, STI가 1을 지시하는 경우, STI 인덱스를 코딩할 수 있다. 다만 실시예는 이에 한정되지 않으며, 다른 일 실시예에서 인코딩 장치(100) 또는 디코딩 장치(200)는 STI가 1을 지시하는지 여부와 무관하게 STI 인덱스를 코딩할 수 있다. 다시 말해, 인코딩 장치(100) 또는 디코딩 장치(200)는 STI가 1을 지시하는지 여부에 대한 판단을 생략한 채 STI 인덱스를 코딩할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code an STI index when STI indicates 1 in S605 (S640). More specifically, when the STI is activated and the STI indicates 1, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index. However, the embodiment is not limited thereto, and in another embodiment, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index regardless of whether the STI indicates one. In other words, the encoding apparatus 100 or the decoding apparatus 200 may code the STI index without omitting the determination of whether the STI indicates 1.

STI 인덱스는 복수의 유효 변환 후보들(available transform candidates) 중 현재 블록에 대하여 적용될 변환(또는 변환 커널(kernel))과 대응되는 인덱스를 의미할 수 있다. The STI index may mean an index corresponding to a transform (or a transform kernel) to be applied to the current block among a plurality of available transform candidates.

일 예시에서, 디코딩 장치(200)는 인코딩 장치(100)로부터의 별도의 시그널링 없이도 STI를 도출할 수 있다. 예를 들어, 현재 블록의 사이즈가 4, 8과 같은 기 결정된 값과 동일한 조건, 현재 블록이 폭과 높이가 동일한 정사각형(square) 형태인 조건 및 인트라 예측 모드가 DC 모드, Planar 모드와 같이 기 결정된 모드들 중 하나인 조건 중 적어도 하나의 조건이 만족되는 경우, STI가 1을 지시할 수 있다. In one example, the decoding apparatus 200 may derive the STI without separate signaling from the encoding apparatus 100. For example, a condition in which the size of the current block is the same as a predetermined value such as 4 and 8, a condition in which the current block is a square shape having the same width and height, and an intra prediction mode are predetermined as in the DC mode or the planar mode. If at least one of the conditions, which is one of the modes, is satisfied, the STI may indicate 1.

다른 일 예시에서, 디코딩 장치(200)는 인코딩 장치(100)로부 STI에 대한 정보를 수신할 수 있다. 즉, STI에 대한 정보는 인코딩 장치(100)에서 디코딩 장치(200)로 시그널링될 수 있다. 또한, STI에 대한 정보는 현재 블록의 사이즈, 현재 블록의 형태 및 인트라 예측 모드 중 적어도 하나를 고려하여 조건적으로(conditionally) 시그널링 될 수도 있다. In another example, the decoding apparatus 200 may receive information on the STI from the encoding apparatus 100. That is, information about the STI may be signaled from the encoding apparatus 100 to the decoding apparatus 200. In addition, the information on the STI may be conditionally signaled in consideration of at least one of the size of the current block, the shape of the current block, and the intra prediction mode.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 변환 계수들을 코딩할 수 있다(S645). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 S640에서 도출된 STI 인덱스를 기반으로 현재 블록에 대한 변환 계수들을 코딩할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code transform coefficients for the current block (S645). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block based on the STI index derived in S640.

다만 실시예는 이에 한정되지 않으며, 예를 들어 STI 인덱스가 코딩되기 전에 현재 블록에 대한 변환 계수들이 코딩될 수 있다. 즉, STI 인덱스가 코딩되기 전에 현재 블록에 대한 변환 계수들이 코딩됨으로써, STI 인덱스를 도출할 때 현재 블록에 대한 변환 계수들이 도출되는 과정에서 획득된 정보가 이용될 수 있다. However, the embodiment is not limited thereto, and for example, transform coefficients for the current block may be coded before the STI index is coded. That is, the transform coefficients for the current block are coded before the STI index is coded, so that information obtained in the process of deriving the transform coefficients for the current block may be used when deriving the STI index.

일 예시에서, STI 인덱스는 현재 블록의 사이즈, 인트라 예측 모드 및 0이 아닌 변환 계수들의 개수 중 적어도 하나를 기반으로 결정될 수 있다. 다른 일 예시에서, STI 인덱스는 현재 블록의 사이즈, 현재 블록의 형태, 인트라 예측 모드 및 0이 아닌 변환 계수들의 개수 중 적어도 하나를 기반으로 조건적으로(conditionally) 인코딩 또는 디코딩될 수 있다. 또 다른 일 예시에서, STI 인덱스의 시그널링을 스킵할 지 여부가 현재 블록 내 0이 아닌 변환 계수들의 분배(distribution) 상태를 기반으로 결정될 수 있다. 보다 구체적으로, 현재 블록의 좌상단 4x4 리전(region)을 제외한 리전에서 0이 아닌 변환 계수가 검출된 경우, STI 인덱스의 시그널링이 스킵될 수 있다. In one example, the STI index may be determined based on at least one of the size of the current block, the intra prediction mode, and the number of nonzero transform coefficients. In another example, the STI index may be conditionally encoded or decoded based on at least one of the size of the current block, the shape of the current block, the intra prediction mode, and the number of nonzero transform coefficients. In another example, whether to skip signaling of the STI index may be determined based on a distribution state of non-zero transform coefficients in the current block. More specifically, when a non-zero transform coefficient is detected in a region except the upper left 4x4 region of the current block, signaling of the STI index may be skipped.

도 7은 일 실시예에 따른 변환 계수의 코딩 과정을 도시하는 흐름도이다.7 is a flowchart illustrating a coding process of transform coefficients, according to an exemplary embodiment.

도 7에 개시된 각 단계는 도 1 및 도 2에 개시된 인코딩 장치(100) 또는 디코딩 장치(200)에 의하여 수행될 수 있으며, 보다 구체적으로 도 1에 개시된 엔트로피 인코딩부(130) 또는 도 2에 개시된 엔트로피 디코딩부(210)에 의하여 수행될 수 있다. 더불어, 도 7의 S700은 도 5a의 S500 및 도 5b의 S540과 대응될 수 있고, 도 7의 S705 내지 S725 및 S745는 도 5a의 S510 및 도 5b의 S550과 대응될 수 있고, 도 7의 S730 및 S735는 도 5a의 S520 및 S530, 도 5b의 S560 및 S570과 대응될 수 있다. 따라서, 도 1, 도 2, 도 5a, 도 5b 및 도 6에서 전술된 내용과 중복되는 구체적인 내용은 설명을 생략하거나 간단히 하기로 한다.Each step disclosed in FIG. 7 may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 disclosed in FIG. 1 or the disclosure described in FIG. 2. It may be performed by the entropy decoding unit 210. In addition, S700 of FIG. 7 may correspond to S500 of FIG. 5A and S540 of FIG. 5B, and S705 to S725 and S745 of FIG. 7 may correspond to S510 of FIG. 5A and S550 of FIG. 5B, and S730 of FIG. 7. And S735 may correspond to S520 and S530 of FIG. 5A and S560 and S570 of FIG. 5B. Accordingly, detailed descriptions overlapping with those described above in FIGS. 1, 2, 5A, 5B, and 6 will be omitted or simplified.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 cbf 플래그가 1을 지시하는지 여부를 판단할 수 있다(S700).The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether the cbf flag indicates 1 (S700).

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 S700에서 cbf 플래그가 1을 지시하는 경우, UTI(Unified Transform Indicator)가 1을 지시하는지 여부를 판단할 수 있다(S705). 본 명세서에서 "UTI"는 레지듀얼 계수들을 변환하기 위한 두 개의 변환(예를 들어, 1차 변환 및 2차 변환) 각각의 인디케이터를 포함할 수 있다. 일 예시에서, UTI는 1차 변환 인디케이터 및 2차 변환 인디케이터 중 적어도 하나를 포함할 수 있다. 1차 변환 인디케이터는 1차 변환에 대한 변환 커널을 지시할 수 있고, 2차 변환 인디케이터는 2차 변환에 대한 변환 커널을 지시할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether the Unified Transform Indicator (UTI) indicates 1 when the cbf flag indicates 1 in S700 (S705). In the present specification, “UTI” may include an indicator of each of two transforms (eg, a primary transform and a secondary transform) for transforming residual coefficients. In one example, the UTI can include at least one of a primary transform indicator and a secondary transform indicator. The primary transform indicator may indicate a transform kernel for the primary transform and the secondary transform indicator may indicate a transform kernel for the secondary transform.

보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 S700에서 cbf 플래그가 1을 지시하는 경우, UTI가 활성화 되었는지(enabled) 여부를 판단할 수 있고, UTI가 활성화 된 경우 UTI가 1을 지시하는지 여부를 판단할 수 있다. 다만 UTI가 활성화 되었는지 여부를 판단하는 과정은 필수 과정이 아니며, 다른 일 실시예에서는 UTI가 활성화 되었는지 여부에 대한 판단 없이 곧바로(directly) UTI가 1을 지시하는지 여부를 판단할 수 있다. 또는, 경우에 따라서 UTI가 1을 지시하면 UTI가 활성화 되었음을 나타낼 수도 있다.More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the UTI is enabled when the cbf flag indicates 1 in S700, and if the UTI is enabled, the UTI is 1. Can be determined. However, the process of determining whether the UTI is activated is not a mandatory process, and in another embodiment, it may be determined whether the UTI indicates 1 directly without determining whether the UTI is activated. Alternatively, in some cases, when the UTI indicates 1, it may indicate that the UTI is activated.

일 예시에서, UTI는 UTI coding, UTI coding flag, UT flag 등으로 지칭될 수도 있다. UTI가 1을 지시하는 경우 레지듀얼 계수들을 변환함에 있어서 적용되는 변환들이 UTI 인덱스를 기반으로 시그널링됨을 나타낼 수 있고, UTI가 0을 지시하는 경우 레지듀얼 계수들을 변환함에 있어서 적용되는 변환들이 UTI 인덱스를 기반으로 하지 않음을 의미할 수 있다.In one example, the UTI may be referred to as UTI coding, UTI coding flag, UT flag, or the like. If the UTI indicates 1, it may indicate that transforms applied in transforming the residual coefficients are signaled based on the UTI index. If the UTI indicates 0, the transforms applied in converting the residual coefficients indicate a UTI index. May mean not based.

UTI 인덱스에 의해 지시되는 각 변환들의 종류(type)는 다양할 수 있다. 각 변환들의 종류의 예시로서, 분리(separable) 변환, 비분리(non-separable) 변환(NSST), 비분리 변환으로부터의 근사화된(approximated) 변환, 1차 변환, 2차 변환, 코어 변환, primary 변환 등이 있을 수 있으며, 각 변환들의 종류는 예시에 한정되지 않는다.The type of each transformation indicated by the UTI index may vary. Examples of the types of transformations are: separable transform, non-separable transform (NSST), approximated transform from non-separated transform, primary transform, secondary transform, core transform, primary There may be transforms and the like, and the type of each transform is not limited to the examples.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 S705에서 UTI가 0을 지시하는 경우, EMT_CU_Flag(또는, MTS_CU_Flag)를 코딩(인코딩 또는 디코딩)할 수 있다(S710). The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code (encode or decode) EMT_CU_Flag (or, MTS_CU_Flag) when the UTI indicates 0 in S705 (S710).

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, cbf 플래그가 0을 지시하는 경우, S705 및 S710에 따른 동작을 생략하고 S715에 따른 동작을 진행할 수 있다. When the cbf flag indicates 0, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may skip the operations according to S705 and S710 and proceed with the operations according to S715.

다시 S710을 참조하면, 일 실시예에 따른 디코딩 장치(200)는 EMT_CU_Flag를 디코딩하고, EMT_CU_Flag가 1을 지시하는 경우 표 3을 기반으로 인트라 예측 모드를 이용하여 하나의 변환 셋을 도출할 수 있다.Referring back to S710, the decoding apparatus 200 according to an embodiment may decode EMT_CU_Flag and, when EMT_CU_Flag indicates 1, may derive one transform set using the intra prediction mode based on Table 3.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 변환 계수들을 코딩(인코딩 또는 디코딩)할 수 있다(S715). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 레지듀얼 계수들에 대하여 변환이 수행되어 도출된 변환 계수들을 인코딩 또는 디코딩할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code (encode or decode) transform coefficients for the current block (S715). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode transform coefficients derived by performing transform on residual coefficients for the current block.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 EMT_TU가 코딩 되었는지(또는 코딩 할지) 여부를 판단할 수 있다(S720). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 EMT_TU 인덱스가 코딩 되었는지 여부를 판단할 수 있다. EMT_TU 인덱스는 전술한 바와 같이, 각 인트라 모드에 대하여 수평 방향의 EMT_TU 인덱스인 EMT_TU_horizontal_index(또는 EMT_TU_horizontal_flag)와 수직 방향의 EMT_TU 인덱스인 EMT_TU_vertical_index(또는 EMT_TU_vertical_flag)를 포함할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether the EMT_TU is coded (or coded) (S720). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether the EMT_TU index is coded. As described above, the EMT_TU index may include EMT_TU_horizontal_index (or EMT_TU_horizontal_flag) that is the horizontal EMT_TU index and EMT_TU_vertical_index (or EMT_TU_vertical_flag) that is the vertical direction for each intra mode.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S720에서 EMT_TU가 코딩 되지 않았다고(또는 코딩 하지 않을 것으로) 판단된 경우, EMT_TU 인덱스에 대한 코딩을 스킵하고 S730에 따른 동작을 수행할 수 있다.If it is determined that the EMT_TU is not coded (or not coded) in S720, the encoding apparatus 100 or the decoding apparatus 200 according to an embodiment skips coding for the EMT_TU index and performs an operation according to S730. can do.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S720에서 EMT_TU가 코딩 되었다고 판단된 경우, EMT_TU 인덱스를 코딩(인코딩 또는 디코딩)할 수 있다(S725). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 각 인트라 모드에 대하여 EMT_TU 인덱스를 코딩할 수 있다. 일 예시에서, 인코딩 장치(100) 또는 디코딩 장치(200)는 각 인트라 모드에 대하여 수평 방향의 EMT_TU 인덱스인 EMT_TU_horizontal_index(또는 EMT_TU_horizontal_flag)와 수직 방향의 EMT_TU 인덱스인 EMT_TU_vertical_index(또는 EMT_TU_vertical_flag)를 코딩할 수 있다. EMT_TU 인덱스의 예시는 표 3과 같을 수 있고, 각 인트라 모드에 대하여 EMT_TU 인덱스가 할당되는 예시는 표 4와 같을 수 있다. 또한, 전술한 바와 같이 표 3의 변환 셋 내에 포함된 두 개의 변환 후보들(transform candidates) 중 하나를 결정하기 위한 플래그가 추가로 시그널링될 수 있다.If it is determined in step S720 that the EMT_TU is coded, the encoding apparatus 100 or the decoding apparatus 200 may code (encode or decode) the EMT_TU index (S725). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code an EMT_TU index for each intra mode. In an example, the encoding apparatus 100 or the decoding apparatus 200 may code, for each intra mode, an EMT_TU_horizontal_index (or EMT_TU_horizontal_flag) that is a horizontal EMT_TU index and an EMT_TU_vertical_index (or EMT_TU_vertical_flag) that is a vertical EMT_TU index. An example of the EMT_TU index may be as shown in Table 3, and an example in which the EMT_TU index is allocated to each intra mode may be as shown in Table 4. In addition, as described above, a flag for determining one of two transform candidates included in the transform set of Table 3 may be further signaled.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, NSST를 수행할 조건에 해당하는지 여부를 판단할 수 있다(S730). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 NSST 인덱스를 코딩(인코딩 또는 디코딩)할 조건에 해당하는지 여부를 판단할 수 있다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may determine whether it corresponds to a condition for performing NSST (S730). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may determine whether it corresponds to a condition for coding (encoding or decoding) the NSST index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S630에서 NSST를 수행할 조건에 해당한다고 판단된 경우, NSST 인덱스를 코딩할 수 있다(S735). 보다 구체적으로, S630에서 NSST 인덱스를 코딩할 조건에 해당한다고 판단된 경우, 인코딩 장치(100) 또는 디코딩 장치(200)는 NSST 인덱스를 인코딩 또는 디코딩할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code the NSST index when it is determined that the condition corresponds to the condition for performing NSST in S630 (S735). More specifically, when it is determined in S630 that the conditions for coding the NSST index, the encoding apparatus 100 or the decoding apparatus 200 may encode or decode the NSST index.

일 실시예에서, 변환 인디케이터에 대한 데이터 하이딩(data hiding) 및 암시 코딩(implicit coding) 방법이 이용될 수 있다. 변환 인디케이터는 STI 인덱스, UTI 인덱스, EMT_CU_Flag, EMT_TU_Flag, NSST 인덱스 및 변환 커널을 지시하는데 이용될 수 있는 변환에 관련된 임의의 인덱스를 포함할 수 있다. 일 예시에서, 변환 인디케이터는 시그널링 되지 않고, 변환 인디케이터와 상응하는 정보가 현재 블록에 대한 변환 계수의 코딩 과정에서 도출될 수 있다. 다만 예시는 이에 한정되지 않으며, 다른 예시에서 변환 인디케이터가 시그널링되고, 변환 인디케이터와 상응하는 정보를 도출하는 변환 계수 코딩 프로세스 내에서 시그널링된 변환 인디케이터가 이용될 수 있다. In one embodiment, data hiding and implicit coding methods for the transform indicator may be used. The transform indicator can include an STI index, a UTI index, an EMT_CU_Flag, an EMT_TU_Flag, an NSST index, and any index related to the transform that can be used to indicate the transform kernel. In one example, the transform indicator is not signaled and information corresponding to the transform indicator can be derived in the coding process of transform coefficients for the current block. However, the example is not limited thereto, and in another example, the transform indicator may be signaled, and the transform indicator signaled within the transform coefficient coding process for deriving information corresponding to the transform indicator may be used.

변환 인디케이터와 상응하는 정보는, 예를 들어 Last_position_x에 대한 정보, Last_position_y에 대한 정보, Group flag에 대한 정보, Significance map에 대한 정보, Greater_than_1 flag에 대한 정보, Greater_than_2 flag에 대한 정보, Greater_than_3 flag에 대한 정보, Remaining level coding에 대한 정보, Sign coding에 대한 정보 및 Parity_map에 대한 정보 중 적어도 하나를 포함할 수 있다. The information corresponding to the conversion indicator is, for example, information about Last_position_x, information about Last_position_y, information about Group flag, information about Significance map, information about Greater_than_1 flag, information about Greater_than_2 flag, and information about Greater_than_3 flag. It may include at least one of information on Remaining level coding, Information on Sign coding, and Information on Parity_map.

일 예시에서, Last_position_x에 대한 정보 및 Last_position_y에 대한 정보는 각각 0이 아닌 마지막 변환 계수의 x축 방향 위치 정보 및 y축 방향 위치 정보를 나타낼 수 있다. In one example, the information about Last_position_x and the information about Last_position_y may represent the x-axis position information and the y-axis position information of the last transform coefficient other than 0, respectively.

다른 일 예시에서, Group flag에 대한 정보는 현재 블록의 서브 블록(또는 서브 그룹)에 0이 아닌 변환 계수가 포함되는지 여부를 나타낼 수 있다. Group flag는, 예를 들어 Group_Flag, group_flag, subgroup_flag, subblock_flag, coded_sub_block_flag 등 다양한 필드명을 통해 시그널링될 수 있으며, 예시는 이에 한정되지 않는다. In another example, the information on the group flag may indicate whether a non-zero transform coefficient is included in a subblock (or subgroup) of the current block. The group flag may be signaled through various field names, for example, Group_Flag, group_flag, subgroup_flag, subblock_flag, coded_sub_block_flag, and the example is not limited thereto.

또 다른 일 예시에서, Significance map에 대한 정보는 대상 블록에 대한 변환 계수들 중 유효 계수들에 관한 정보를 포함할 수 있다.In another example, the information about the significance map may include information about valid coefficients among transform coefficients for the target block.

또 다른 일 예시에서, Greater_than_1 flag에 대한 정보는 대상 블록에 대한 유효 변환 계수들 중 절대값이 1보다 큰 변환 계수들에 관한 정보를 포함할 수 있다.In another example, the information on the Greater_than_1 flag may include information about transform coefficients having an absolute value greater than 1 among valid transform coefficients for the target block.

또 다른 일 예시에서, Parity_map에 대한 정보는 대상 블록에 대한 유효 변환 계수들 중 절대값이 2 이상인 경우에 대하여 해당 변환 계수가 짝수 인지 여부에 관한 정보를 포함할 수 있다. In another example, the information about the Parity_map may include information about whether the corresponding transform coefficient is even for the case where the absolute value of the valid transform coefficients for the target block is 2 or more.

또 다른 일 예시에서, Greater_than_2 flag에 대한 정보는 대상 블록에 대한 유효 변환 계수들 중 절대값이 2이상인 변환 계수들에 관한 정보를 포함할 수 있다. 다만 예시는 이에 한정되지 않으며, 예를 들어 Greater_than_2 flag에 대한 정보는, Parity_map에 대한 정보를 고려하여, 대상 블록에 대한 유효 변환 계수들 중 절대값이 3이상인 변환 계수들에 관한 정보를 나타낼 수 있다. 또 다른 예에서는, Greater_than_2 flag에 대한 정보 대신 Greater_than_3 flag에 대한 정보가 도출될 수 있고, Greater_than_3 flag에 대한 정보는, Parity_map에 대한 정보를 고려하여, 대상 블록에 대한 유효 변환 계수들 중 절대값이 2이상인 변환 계수들에 관한 정보를 나타낼 수 있다. In another example, the information on the Greater_than_2 flag may include information about transform coefficients having an absolute value of 2 or more among valid transform coefficients for the target block. However, the example is not limited thereto. For example, the information on the Greater_than_2 flag may represent information on transform coefficients having an absolute value of 3 or more among valid transform coefficients for the target block in consideration of the information on Parity_map. . In another example, information about the Greater_than_3 flag may be derived instead of information about the Greater_than_2 flag, and the information about the Greater_than_3 flag may have an absolute value of 2 among the valid transform coefficients for the target block in consideration of the information about the Parity_map. Information on the above-described transform coefficients may be indicated.

또 다른 일 예시에서, Remaining level coding에 대한 정보는 Greater_than_2 flag에 대한 정보 또는 Greater_than_3 flag에 대한 정보를 기반으로 분류된 변환 계수들의 레벨 코딩을 위한 정보를 나타낼 수 있다. In another example, the information on the retaining level coding may indicate information for level coding of transform coefficients classified based on the information on the Greater_than_2 flag or the information on the Greater_than_3 flag.

또 다른 일 예시에서, Sign coding에 대한 정보는 현재 블록에 대한 변환 계수들의 부호에 관한 정보를 나타낼 수 있다. In another example, the information on sign coding may indicate information about a sign of transform coefficients for the current block.

한편 상기 변환 인디케이터에 대한 정보는 상기 변환 계수 코딩 프로세스 내에서 이용될 수 있다. 변환 계수 코딩 프로세스 내에서 상기 변환 인디케이터에 대한 정보를 이용하기 위해, 예를 들어 Sign coding의 패턴(pattern)에 대한 정보, Remaining level의 절대값에 대한 정보, Greater_than_1 flag의 개수에 대한 정보, Last_position_X의 값 및 Last_position_Y의 값 중 적어도 하나가 이용될 수 있다. Meanwhile, the information about the transform indicator may be used in the transform coefficient coding process. In order to use the information on the transform indicator in the transform coefficient coding process, for example, information on the pattern of the sign coding, information on the absolute value of the remaining level, information on the number of the Greater_than_1 flag, Last_position_X At least one of a value and a value of Last_position_Y may be used.

한편, 상기된 Last_position_x에 대한 정보, Last_position_y에 대한 정보, Group flag에 대한 정보, Significance map에 대한 정보, Greater_than_1 flag에 대한 정보, Greater_than_2 flag에 대한 정보, Greater_than_3 flag에 대한 정보, Remaining level coding에 대한 정보, Sign coding에 대한 정보 및 Parity_map에 대한 정보는 레지듀얼 코딩 과정에서 시그널링될 수 있는 신택스 요소의 일 예시에 불과하며, 따라서 그 명칭이나 정의가 경우에 따라서 미세하게 달라질 수 있음은 당해 기술 분야의 통상의 기술자에게 용이하게 이해될 것이다. Meanwhile, the information on Last_position_x, information on Last_position_y, information on Group flag, information on Significance map, information on Greater_than_1 flag, information on Greater_than_2 flag, information on Greater_than_3 flag, and information on Remaining level coding For example, information about sign coding and information about Parity_map are merely examples of syntax elements that may be signaled in the residual coding process, and thus, the names or definitions may vary slightly from case to case. It will be readily understood by those skilled in the art.

예를 들어, Last_position_x에 대한 정보는 last_sig_coeff_x로 나타날 수 있고, last_sig_coeff_x에 대한 정보는 last_sig_coeff_x_prefix에 대한 정보 및 last_sig_coeff_x_suffix에 대한 정보 양 자를 고려하여 도출될 수 있다. 또한, Last_position_y에 대한 정보는 last_sig_coeff_y로 나타날 수 있고, last_sig_coeff_y에 대한 정보는 last_sig_coeff_y_prefix에 대한 정보 및 last_sig_coeff_y_suffix에 대한 정보 양 자를 고려하여 도출될 수 있다. For example, information about Last_position_x may be represented by last_sig_coeff_x, and information about last_sig_coeff_x may be derived by considering information about last_sig_coeff_x_prefix and information quantum about last_sig_coeff_x_suffix. In addition, the information on Last_position_y may be represented by last_sig_coeff_y, and the information on last_sig_coeff_y may be derived in consideration of information about last_sig_coeff_y_prefix and information quantum about last_sig_coeff_y_suffix.

다른 예시에서, Greater_than_1 flag, Greater_than_2 flag, Remaining level coding 및 Significance map 등은 변환 계수들의 절대값을 정수 0, 1, 2, 3 등을 기준으로 분류하기 위한 신택스 요소로서 그 명칭이나 정의, 시그널링 순서, 시그널링 방법 등은 경우에 따라서 미세한 차이가 존재할 수 있다. Significance map은 sig_coeff_flag로 지칭될 수 있다. Greater_than_1 flag는 rem_abs_gt1_flag로 지칭될 수 있고, 변환 계수의 절대값이 1보다 큰지 또는 1 이상인지 여부를 나타낼 수 있다. Greater_than_2 flag는 rem_abs_gt2_flag로 지칭될 수 있고, 변환 계수의 절대값이 2보다 큰지, 2이상인지, 3보다 큰지 또는 3 이상인지 여부를 나타낼 수 있다. Greater_than_3 flag는 rem_abs_gt3_flag로 지칭될 수 있고, 변환 계수의 절대값이 2보다 큰지, 2이상인지, 3보다 큰지 또는 3 이상인지 여부를 나타낼 수 있다. rem_abs_gt1_flag가 1을 지시하는 경우 rem_abs_gt2_flag 또는 rem_abs_gt3_flag가 시그널링될 수 있다. rem_abs_gt2_flag 또는 rem_abs_gt3_flag가 1을 지시하는 경우, 도출되지 않은 나머지 변환 계수들에 대한 정보를 포함하는 abs_remainder가 시그널링될 수 있다. 또는, 변환 계수 코딩 프로세스 내에서 도출된 변환 계수들에 대한 정보를 포함하는 dec_abs_level이 시그널링될 수 있다. 당해 기술 분야의 통상의 기술자는, 상기된 신택스 요소들은 변환 계수들의 절대값을 0, 1, 2, 3 등을 기준으로 분류하는 것을 주요 목적으로 하므로, Greater_than_1 flag, Greater_than_2 flag, Remaining level coding 및 Significance map 등의 신택스 요소들과 rem_abs_gt1_flag, rem_abs_gt2_flag, rem_abs_gt3_flag, abs_remainder, sig_coeff_flag 등의 신택스 요소들간의 대응 관계가 경우에 따라서는 상기된 바와 상이할 수 있음을 용이하게 이해할 것이다. In another example, the Greater_than_1 flag, Greater_than_2 flag, Remaining level coding, and Significance map are syntax elements for classifying the absolute values of the transform coefficients based on integers 0, 1, 2, 3, and the like. The signaling method may have a slight difference in some cases. The significance map may be referred to as sig_coeff_flag. The Greater_than_1 flag may be referred to as rem_abs_gt1_flag and may indicate whether the absolute value of the transform coefficient is greater than 1 or greater than 1. The Greater_than_2 flag may be referred to as rem_abs_gt2_flag and may indicate whether the absolute value of the transform coefficient is greater than 2, greater than 2, greater than 3, or greater than 3. The Greater_than_3 flag may be referred to as rem_abs_gt3_flag and may indicate whether the absolute value of the transform coefficient is greater than 2, greater than 2, greater than 3, or greater than 3. When rem_abs_gt1_flag indicates 1, rem_abs_gt2_flag or rem_abs_gt3_flag may be signaled. If rem_abs_gt2_flag or rem_abs_gt3_flag indicates 1, abs_remainder including information on the remaining transform coefficients not derived may be signaled. Alternatively, dec_abs_level including information about transform coefficients derived in the transform coefficient coding process may be signaled. One of ordinary skill in the art will understand that the syntax elements described above mainly classify the absolute values of the transform coefficients on the basis of 0, 1, 2, 3, etc., so that the Greater_than_1 flag, Greater_than_2 flag, Remaining level coding and Significance It will be readily understood that the correspondence between syntax elements such as map and syntax elements such as rem_abs_gt1_flag, rem_abs_gt2_flag, rem_abs_gt3_flag, abs_remainder, sig_coeff_flag, etc. may be different from those described above in some cases.

또 다른 예시에서, Parity map에 대한 정보는 par_level_flag로 지칭될 수 있다. par_level_flag는 해당 변환 계수에 대하여 sig_coeff_flag가 1을 지시하는 경우에만 시그널링될 수 있고, 해당 변환 계수에 대하여 rem_abs_gt1_flag가 1을 지시하는 경우에만 시그널링될 수 있다. 또는, 시그널링 순서를 달리하여, par_level_flag가 1을 지시하는 경우에만 rem_abs_gt1_flag가 시그널링될 수도 있다. In another example, the information about the parity map may be referred to as par_level_flag. The par_level_flag may be signaled only when sig_coeff_flag indicates 1 for the corresponding transform coefficient, and may be signaled only when rem_abs_gt1_flag indicates 1 for the corresponding transform coefficient. Alternatively, rem_abs_gt1_flag may be signaled only when par_level_flag indicates 1 by changing the signaling order.

한편 상기된 데이터 하이딩은 조건부(conditionally) 적용될 수 있다. 예를 들어, 데이터 하이딩은 0이 아닌 변환 계수의 개수에 의존할 수 있다. Meanwhile, the above-described data hiring may be applied conditionally. For example, data Haiing may depend on the number of nonzero transform coefficients.

또한, 일 실시예에서 NSST 인덱스와 EMT_CU_Flag 또는 EMT_TU 인덱스가 상호 의존 관계에 있을 수 있다. 예를 들어, EMT_CU_Flag가 0(또는 1)인 경우 NSST 인덱스는 0이 아닐 수 있다. 이러한 경우, NSST 인덱스 대신 NSST 인덱스-1이 시그널링될 수 있다. In addition, in one embodiment, the NSST index and the EMT_CU_Flag or EMT_TU index may be interdependent. For example, when EMT_CU_Flag is 0 (or 1), the NSST index may not be zero. In this case, NSST index-1 may be signaled instead of NSST index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는, S705에서 UTI가 1을 지시하는 경우, UTI 인덱스를 코딩할 수 있다(S740). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 UTI가 활성화 되었으며, UTI가 1을 지시하는 경우, UTI 인덱스를 코딩할 수 있다. 다만 실시예는 이에 한정되지 않으며, 다른 일 실시예에서 인코딩 장치(100) 또는 디코딩 장치(200)는 UTI가 1을 지시하는지 여부와 무관하게 UTI 인덱스를 코딩할 수 있다. 다시 말해, 인코딩 장치(100) 또는 디코딩 장치(200)는 UTI가 1을 지시하는지 여부에 대한 판단을 생략한 채 UTI 인덱스를 코딩할 수 있다.The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code the UTI index when the UTI indicates 1 in S705 (S740). More specifically, when the UTI is activated and the UTI indicates 1, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index. However, the embodiment is not limited thereto, and in another embodiment, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index regardless of whether the UTI indicates 1. In other words, the encoding apparatus 100 or the decoding apparatus 200 may code the UTI index without omitting the determination of whether the UTI indicates 1.

UTI 인덱스에 대한 코딩은 현재 블록의 사이즈, 현재 블록의 형태 및 인트라 예측 모드 중 적어도 하나에 의존(depend)할 수 있다. Coding for the UTI index may depend on at least one of the size of the current block, the shape of the current block, and the intra prediction mode.

UTI 인덱스는 복수의 유효 변환 후보들(available transform candidates) 중 현재 블록에 대하여 적용될 1차 변환(또는 1차 변환에 대한 커널(kernel)) 및 2차 변환(또는 2차 변환에 대한 변환 커널) 중 적어도 하나를 지시할 수 있다. 일 실시예에서, UTI로부터 1차 변환을 어떻게 도출(또는 추출)할 지 여부 및 UTI로부터 2차 변환을 어떻게 도출(또는 추출)할 지 여부는 기 정의될 수 있다. The UTI index is at least one of a primary transform (or kernel for primary transform) and a secondary transform (or transform kernel for secondary transform) to be applied to the current block among a plurality of available transform candidates. You can indicate one. In one embodiment, how to derive (or extract) the primary transform from the UTI and how to derive (or extract) the secondary transform from the UTI may be predefined.

일 예시에서, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널) 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 둘 다(both) 지시할 수 있다. 보다 구체적으로, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널)을 지시하기 위한 인덱스 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 지시하기 위한 인덱스를 조인트 코딩(joint coding)할 수 있다. 1차 변환을 지시하기 위한 인덱스와 2차 변환을 지시하기 위한 인덱스가 조인트 코딩된(jointly coded) UTI 인덱스의 예시는 아래의 표 5와 같다.In one example, the UTI index may indicate both a primary transform (or a transform kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform). More specifically, the UTI index joint coding an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). )can do. An example of a UTI index in which an index for indicating a primary transform and an index for indicating a secondary transform is jointly coded is shown in Table 5 below.

[표 5]TABLE 5

Figure PCTKR2019002498-appb-I000012
Figure PCTKR2019002498-appb-I000012

표 5를 참조하면, 1차 변환을 지시하기 위한 인덱스는 0부터 5까지 기재되어 있고, 2차 변환을 지시하기 위한 인덱스는 0부터 3까지 기재되어 있다. 각 인덱스는 특정 변환 타입(type)을 지시할 수 있다. 1차 변환을 지시하기 위한 인덱스와 2차 변환을 지시하기 위한 인덱스가 조인트 코딩된 UTI 인덱스는 0부터 31까지 기재되어 있고, 각 UTI 인덱스와 대응되는 바이너리 코드가 00000부터 11111까지 기재되어 있다. 일 예시에서, 각 UTI 인덱스와 대응되는 바이너리 코드는 FLC(Fixed Length Coding) 바이너리 코드일 수 있으나, 예시가 이에 한정되는 것은 아니다. Referring to Table 5, the indices for indicating the primary transform are described from 0 to 5, and the indices for indicating the secondary transform are described from 0 to 3. Each index may indicate a specific conversion type. UTI indices jointly coded with an index for indicating a primary transform and an index for indicating a secondary transform are described from 0 to 31, and binary codes corresponding to each UTI index are described from 00000 to 11111. In one example, the binary code corresponding to each UTI index may be a fixed length coding (FLC) binary code, but the example is not limited thereto.

본 명세서에서 "UTI 인덱스 리스트"는 변환 커널 조합들을 지시하는 UTI 인덱스들의 집합을 의미할 수 있다. 예를 들어, 표 5의 UTI 인덱스 0 내지 31은 하나의 UTI 인덱스 리스트를 구성할 수 있다. 일 실시예에서, UTI 인덱스 리스트는 현재 블록의 사이즈(size), 상기 현재 블록의 형태(shape) 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 결정될 수 있다. As used herein, "UTI index list" may mean a set of UTI indexes indicating transform kernel combinations. For example, UTI indexes 0 to 31 of Table 5 may constitute one UTI index list. In an embodiment, the UTI index list may be determined based on at least one of a size of a current block, a shape of the current block, and an intra prediction mode applied to the current block.

일 실시예에서, 기 정의된 조건이 만족되는 경우, UTI 인덱스는 1차 변환 타입을 지시할 수 있다. 보다 구체적으로, 현재 블록의 사이즈가 기 정의된 임계치보다 작은 경우, UTI 인덱스는 1차 변환에 대한 변환 커널(만)을 지시할 수 있다. 여기서 기 정의된 임계치는, 예를 들어 2x2, 4x4, 8x8 등을 포함할 수 있으며, 예시는 이에 한정되지 않는다.In one embodiment, when a predefined condition is satisfied, the UTI index may indicate a primary transform type. More specifically, when the size of the current block is smaller than the predefined threshold, the UTI index may indicate only the transform kernel for the primary transform. Here, the predefined threshold may include, for example, 2x2, 4x4, 8x8, and the like, but the example is not limited thereto.

다른 일 실시예에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 1차 변환이 기 결정된 경우, UTI 인덱스는 2차 변환을 지시하기 위한 인덱스를 지시할 수 있다. 보다 구체적으로, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 1차 변환에 대한 변환 커널이 기 결정된 경우, UTI 인덱스는 2차 변환에 대한 변환 커널(만)을 지시할 수 있다. In another embodiment, when a primary transform is determined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is an index for indicating a secondary transform. Can be indicated. More specifically, when the transform kernel for the first transform is predetermined based on at least one of the size of the current block, the shape of the current block, and the intra prediction mode applied to the current block, the UTI index is used to transform the second transform. Can only point to the kernel.

또 다른 일 실시예에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 2차 변환이 기 결정된 경우, UTI 인덱스는 1차 변환을 지시하기 위한 인덱스를 지시할 수 있다. 보다 구체적으로, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 2차 변환에 대한 변환 커널이 기 결정된 경우, UTI 인덱스는 1차 변환에 대한 변환 커널(만)을 지시할 수 있다. In another embodiment, when a second transform is predetermined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is used to indicate a primary transform. It can indicate an index. More specifically, when the transform kernel for the second transform is predetermined based on at least one of the size of the current block, the shape of the current block, and the intra prediction mode applied to the current block, the UTI index is used to transform the first transform. Can only point to the kernel.

또 다른 일 실시예에서, UTI 인덱스를 통해 2차 변환이 지시되지 않는 것으로 결정된 경우(예를 들어, 시그널링을 통해서, 또는 2차 변환이 기 결정된 경우), UTI 인덱스는 1차 변환을 지시하기 위한 인덱스를 지시할 수 있다.In another embodiment, if it is determined that no secondary transform is indicated via the UTI index (eg, via signaling or when a secondary transform is predetermined), the UTI index is used to indicate the primary transform. It can indicate an index.

또 다른 일 실시예에서, UTI 인덱스를 통해 1차 변환이 지시되지 않는 것으로 결정된 경우(예를 들어, 시그널링을 통해서, 또는 1차 변환이 기 결정된 경우), UTI 인덱스는 2차 변환을 지시하기 위한 인덱스를 지시할 수 있다.In another embodiment, if it is determined that no primary transform is indicated via the UTI index (eg, via signaling or when a primary transform is predetermined), the UTI index is used to indicate the secondary transform. It can indicate an index.

일 실시예에 따른 인코딩 장치(100) 또는 디코딩 장치(200)는 현재 블록에 대한 변환 계수들을 코딩할 수 있다(S745). 보다 구체적으로, 인코딩 장치(100) 또는 디코딩 장치(200)는 S740에서 도출된 UTI 인덱스를 기반으로 현재 블록에 대한 변환 계수들을 코딩할 수 있다. 다만 실시예는 이에 한정되지 않으며, 예를 들어 UTI 인덱스가 코딩되기 전에 현재 블록에 대한 변환 계수들이 코딩될 수 있다. UTI 인덱스가 코딩되기 전에 현재 블록에 대한 변환 계수들이 코딩되는 실시예에 대한 보다 구체적인 설명은 도 8a 및 도 8b에서 후술하기로 한다. The encoding apparatus 100 or the decoding apparatus 200 according to an embodiment may code transform coefficients for the current block (S745). More specifically, the encoding apparatus 100 or the decoding apparatus 200 may code transform coefficients for the current block based on the UTI index derived in S740. However, the embodiment is not limited thereto, and for example, transform coefficients for the current block may be coded before the UTI index is coded. A more detailed description of an embodiment in which transform coefficients for the current block are coded before the UTI index is coded will be described later with reference to FIGS. 8A and 8B.

도 8a 및 도 8b는 일 실시예에 따른 변환 계수 및 UTI 인덱스의 코딩 순서를 설명하기 위한 흐름도이다. 8A and 8B are flowcharts illustrating a coding order of transform coefficients and UTI indexes, according to an exemplary embodiment.

도 8a 및 도 8b에 개시된 각 단계는 도 1 및 도 2에 개시된 인코딩 장치(100) 또는 디코딩 장치(200)에 의하여 수행될 수 있으며, 보다 구체적으로 도 1에 개시된 엔트로피 인코딩부(130) 또는 도 2에 개시된 엔트로피 디코딩부(210)에 의하여 수행될 수 있다. 더불어, 도 8a의 S800 및 도 8b의 S830은 도 5a의 S500 및 도 5b의 S540과 대응될 수 있고, 도 8a의 S810 및 도 8b의 S850은 도 7의 S740과 대응될 수 있고, 도 8a의 S820 및 도 8b의 S840은 도 7의 S745와 대응될 수 있다. 정리하면, 도 1, 도 2, 도 5a, 도 5b, 도 6 및 도 7에서 전술된 내용과 중복되는 구체적인 내용은 설명을 생략하거나 간단히 하기로 하며, 도 8a 및 도 8b에서는 S810과 S820 간의 선후 관계 및 S840과 S850 간의 선후 관계를 중점적으로 검토하기로 한다.Each of the steps disclosed in FIGS. 8A and 8B may be performed by the encoding apparatus 100 or the decoding apparatus 200 disclosed in FIGS. 1 and 2, and more specifically, the entropy encoding unit 130 illustrated in FIG. 1 or FIG. It may be performed by the entropy decoding unit 210 disclosed in 2. In addition, S800 of FIG. 8A and S830 of FIG. 8B may correspond to S500 of FIG. 5A and S540 of FIG. 5B, S810 of FIG. 8A and S850 of FIG. 8B may correspond to S740 of FIG. 7, and FIG. 8A of FIG. S820 and S840 of FIG. 8B may correspond to S745 of FIG. 7. In summary, detailed descriptions that overlap with the above-described contents in FIGS. 1, 2, 5A, 5B, 6, and 7 will be omitted or simplified. In FIGS. 8A and 8B, the front and rear sides between S810 and S820 will be omitted. The relationship and the future relationship between S840 and S850 will be reviewed.

일 예시에서, UTI 인덱스는 현재 블록의 사이즈, 인트라 예측 모드 및 0이 아닌 변환 계수들의 개수 중 적어도 하나를 기반으로 결정될 수 있다. 다른 일 예시에서, UTI 인덱스는 현재 블록의 사이즈, 현재 블록의 형태, 인트라 예측 모드 및 0이 아닌 변환 계수들의 개수 중 적어도 하나를 기반으로 조건적으로(conditionally) 인코딩 또는 디코딩될 수 있다. 또 다른 일 예시에서, UTI 인덱스의 시그널링을 스킵할 지 여부가 현재 블록 내 0이 아닌 변환 계수들의 분배(distribution) 상태를 기반으로 결정될 수 있다. 보다 구체적으로, 현재 블록의 좌상단 4x4 리전(region)을 제외한 리전에서 0이 아닌 변환 계수가 검출된 경우, UTI 인덱스의 시그널링이 스킵될 수 있다.In one example, the UTI index may be determined based on at least one of the size of the current block, the intra prediction mode, and the number of nonzero transform coefficients. In another example, the UTI index may be conditionally encoded or decoded based on at least one of the size of the current block, the shape of the current block, the intra prediction mode, and the number of nonzero transform coefficients. In another example, whether to skip signaling of the UTI index may be determined based on a distribution state of non-zero transform coefficients in the current block. More specifically, when a non-zero transform coefficient is detected in a region other than the upper left 4x4 region of the current block, signaling of the UTI index may be skipped.

일 실시예에서, 도 8a에 도시된 바와 같이, UTI 인덱스가 코딩(즉, 인코딩 또는 디코딩)(S810)된 후에 현재 블록에 대한 변환 계수들이 코딩(즉, 인코딩 또는 디코딩)(S820)될 수 있다. 다시 말해, 현재 블록에 대한 변환 계수들은 UTI 인덱스가 코딩(즉, 인코딩 또는 디코딩)된 이후에 코딩(즉, 인코딩 또는 디코딩)될 수 있다. 현재 블록에 대한 변환 계수들이 코딩되기 전에 UTI 인덱스가 코딩됨으로써, 현재 블록에 대한 변환 계수들을 도출할 때 UTI 인덱스가 도출되는 과정에서 획득된 정보가 이용될 수 있다. In one embodiment, as shown in FIG. 8A, transform coefficients for the current block may be coded (ie, encoded or decoded) (S820) after the UTI index is coded (ie, encoded or decoded) (S810). . In other words, the transform coefficients for the current block may be coded (ie, encoded or decoded) after the UTI index is coded (ie, encoded or decoded). Since the UTI index is coded before the transform coefficients for the current block are coded, the information obtained in the process of deriving the UTI index may be used when deriving the transform coefficients for the current block.

다른 일 실시예에서, 도 8b에 도시된 바와 같이, 현재 블록에 대한 변환 계수들이 코딩(즉, 인코딩 또는 디코딩)(S840)된 후에 UTI 인덱스가 코딩(즉, 인코딩 또는 디코딩)(S850)될 수 있다. 다시 말해, UTI 인덱스는 현재 블록에 대한 변환 계수들이 코딩(즉, 인코딩 또는 디코딩)된 이후에 코딩(즉, 인코딩 또는 디코딩)될 수 있다. UTI 인덱스가 코딩되기 전에 현재 블록에 대한 변환 계수들이 코딩됨으로써, UTI 인덱스를 도출할 때 현재 블록에 대한 변환 계수들이 도출되는 과정에서 획득된 정보가 이용될 수 있다. In another embodiment, as shown in FIG. 8B, the UTI index may be coded (ie, encoded or decoded) (S850) after the transform coefficients for the current block are coded (ie, encoded or decoded) (S840). have. In other words, the UTI index may be coded (ie, encoded or decoded) after the transform coefficients for the current block are coded (ie, encoded or decoded). Since transform coefficients for the current block are coded before the UTI index is coded, information obtained in the process of deriving the transform coefficients for the current block may be used when deriving the UTI index.

도 9는 일 실시예에 따른 인코딩 장치의 동작을 도시하는 흐름도이고, 도 10은 일 실시예에 따른 인코딩 장치의 구성을 도시하는 블록도이다.9 is a flowchart illustrating an operation of an encoding apparatus according to an embodiment, and FIG. 10 is a block diagram illustrating a configuration of an encoding apparatus according to an embodiment.

도 9에 개시된 각 단계는 도 1 에 개시된 인코딩 장치(100)에 의하여 수행될 수 있다. 보다 구체적으로, S900 및 S910은 도 1에 개시된 변환부(122)에 의하여 수행될 수 있고, S920 및 S930은 도 1에 개시된 엔트로피 인코딩부(130)에 의하여 수행될 수 있다. 더불어 S900 내지 S930에 따른 동작들은, 도 7 내지 도 8b에서 전술된 내용들 중 일부를 기반으로 한 것이다. 따라서, 도 1 및 도 7 내지 도 8b에서 전술된 내용과 중복되는 구체적인 내용은 설명을 생략하거나 간단히 하기로 한다. Each step disclosed in FIG. 9 may be performed by the encoding apparatus 100 disclosed in FIG. 1. More specifically, S900 and S910 may be performed by the transform unit 122 shown in FIG. 1, and S920 and S930 may be performed by the entropy encoding unit 130 shown in FIG. 1. In addition, operations according to S900 to S930 are based on some of the contents described above with reference to FIGS. 7 to 8B. Therefore, specific details overlapping with the above-described contents in FIGS. 1 and 7 to 8b will be omitted or simply described.

도 10에 도시된 바와 같이, 일 실시예에 따른 인코딩 장치는 변환부(122) 및 엔트로피 인코딩부(130)를 포함할 수 있다. 그러나, 경우에 따라서는 도 10에 도시된 구성 요소 모두가 인코딩 장치의 필수 구성 요소가 아닐 수 있고, 인코딩 장치는 도 10에 도시된 구성 요소보다 많거나 적은 구성 요소에 의해 구현될 수 있다.As shown in FIG. 10, the encoding apparatus according to the embodiment may include a transformer 122 and an entropy encoder 130. However, in some cases, not all of the components shown in FIG. 10 may be required components of the encoding apparatus, and the encoding apparatus may be implemented by more or fewer components than those illustrated in FIG. 10.

일 실시예에 따른 인코딩 장치에서 변환부(122) 및 엔트로피 인코딩부(130)는 각각 별도의 칩(chip)으로 구현되거나, 적어도 둘 이상의 구성 요소가 하나의 칩을 통해 구현될 수도 있다.In the encoding apparatus according to an embodiment, the converter 122 and the entropy encoder 130 may be implemented as separate chips, or at least two or more components may be implemented through one chip.

일 실시예에 따른 인코딩 장치는, 현재 블록에 대한 레지듀얼 샘플들을 도출할 수 있다(S900). 보다 구체적으로, 인코딩 장치의 변환부(122)는 현재 블록에 대한 레지듀얼 샘플들을 도출할 수 있다. The encoding apparatus according to an embodiment may derive residual samples for the current block (S900). More specifically, the converter 122 of the encoding apparatus may derive residual samples for the current block.

일 실시예에 따른 인코딩 장치는, 현재 블록에 대한 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출할 수 있다(S910). 보다 구체적으로, 인코딩 장치의 변환부(122)는 현재 블록에 대한 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출할 수 있다. The encoding apparatus according to an embodiment may perform transform on residual samples for the current block to derive transform coefficients (S910). More specifically, the transform unit 122 of the encoding apparatus may derive transform coefficients by performing transform on residual samples of the current block.

일 예시에서, 변환은 1차 변환(또는 코어 변환) 및 2차 변환 중 적어도 하나를 포함할 수 있고, 1차 변환 및 2차 변환 각각은 복수의 변환 타입 중 하나의 변환 타입에 기반할 수 있다. 1차 변환의 복수의 변환 타입은 도 3에서 전술한 다중 변환 세트를 포함할 수 있고, 2차 변환의 복수의 변환 타입은 비분리 2차 변환(NSST)을 포함할 수 있다. In one example, the transform can include at least one of a primary transform (or core transform) and a secondary transform, and each of the primary transform and the secondary transform can be based on one transform type of the plurality of transform types. . The plurality of transform types of the primary transform may include the multiple transform set described above in FIG. 3, and the plurality of transform types of the secondary transform may include a non-separated secondary transform (NSST).

일 실시예에 따른 인코딩 장치는, 수행된 변환의 변환 타입을 나타내는 UTI 인덱스를 도출할 수 있다(S920). 보다 구체적으로, 인코딩 장치의 엔트로피 인코딩부(130)는 수행된 변환의 변환 타입을 나타내는 UTI 인덱스를 도출할 수 있다. According to an embodiment, the encoding apparatus may derive a UTI index indicating a transform type of the performed transform (S920). More specifically, the entropy encoding unit 130 of the encoding apparatus may derive a UTI index indicating the transform type of the performed transform.

UTI 인덱스는 복수의 유효 변환 후보들(available transform candidates) 중 현재 블록에 대하여 적용될 1차 변환(또는 1차 변환에 대한 커널(kernel)) 및 2차 변환(또는 2차 변환에 대한 변환 커널) 중 적어도 하나를 지시할 수 있다. The UTI index is at least one of a primary transform (or kernel for primary transform) and a secondary transform (or transform kernel for secondary transform) to be applied to the current block among a plurality of available transform candidates. You can indicate one.

일 예시에서, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널) 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 둘 다(both) 지시할 수 있다. 보다 구체적으로, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널)을 지시하기 위한 인덱스 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 지시하기 위한 인덱스를 조인트 코딩(joint coding)할 수 있다.In one example, the UTI index may indicate both a primary transform (or a transform kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform). More specifically, the UTI index joint coding an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). )can do.

다른 일 예시에서, 현재 블록의 사이즈가 기 정의된 임계치보다 작은 경우, UTI 인덱스는 1차 변환에 대한 변환 커널(만)을 지시할 수 있다.In another example, when the size of the current block is smaller than a predefined threshold, the UTI index may indicate only the transform kernel for the primary transform.

또 다른 일 예시에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 1차 변환이 기 결정된 경우, UTI 인덱스는 2차 변환을 지시하기 위한 인덱스를 지시할 수 있다.In another example, when a primary transform is predetermined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is an index for indicating a secondary transform. Can be indicated.

또 다른 일 예시에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 2차 변환이 기 결정된 경우, UTI 인덱스는 1차 변환을 지시하기 위한 인덱스를 지시할 수 있다. In another example, when a second transform is predetermined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is an index for indicating a primary transform. Can be indicated.

일 실시예에 따른 인코딩 장치는, 변환 계수들에 관한 정보 및 UTI 인덱스를 포함하는 영상 정보를 인코딩할 수 있다(S930). 보다 구체적으로, 인코딩 장치의 엔트로피 인코딩부(130)는 변환 계수들에 관한 정보 및 UTI 인덱스를 포함하는 영상 정보를 인코딩할 수 있다. According to an embodiment, the encoding apparatus may encode image information including information on transform coefficients and a UTI index (S930). More specifically, the entropy encoding unit 130 of the encoding apparatus may encode information about transform coefficients and image information including a UTI index.

도 9 및 도 10에 개시된 인코딩 장치 및 인코딩 장치의 동작 방법에 따르면, 인코딩 장치는 현재 블록에 대한 레지듀얼 샘플들을 도출하고(S900), 현재 블록에 대한 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출하고(S910), 수행된 변환의 변환 타입을 나타내는 UTI 인덱스를 도출하고(S920), 변환 계수들에 관한 정보 및 UTI 인덱스를 포함하는 영상 정보를 인코딩할 수 있다(S930). UTI 인덱스를 기반으로 1차 변환(또는 코어 변환) 및 2차 변환의 변환 타입을 한 번에(at once) 가리킴으로써, 인코딩 장치의 코딩 효율(또는 코딩 게인(gain))이 증가할 수 있다. According to the encoding apparatus and the operation method of the encoding apparatus disclosed in FIGS. 9 and 10, the encoding apparatus derives residual samples for the current block (S900), performs transformation on the residual samples for the current block, and performs the transformation. Coefficients may be derived (S910), a UTI index indicating a transform type of the performed transform may be derived (S920), and information about the transform coefficients and image information including the UTI index may be encoded (S930). By pointing at once the transform type of the primary transform (or core transform) and the secondary transform based on the UTI index, the coding efficiency (or coding gain) of the encoding apparatus may be increased.

도 11은 일 실시예에 따른 디코딩 장치의 동작을 도시하는 흐름도이고, 도 12는 일 실시예에 따른 디코딩 장치의 구성을 도시하는 블록도이다. 11 is a flowchart illustrating an operation of a decoding apparatus according to an embodiment, and FIG. 12 is a block diagram illustrating a configuration of a decoding apparatus according to an embodiment.

도 11에 개시된 각 단계는 도 2 에 개시된 디코딩 장치(200)에 의하여 수행될 수 있다. 보다 구체적으로, S1100 내지 S1120은 도 2에 개시된 엔트로피 디코딩부(210)에 의하여 수행될 수 있고, S1130은 도 2에 개시된 역변환부(223)에 의하여 수행될 수 있고, S1140은 도 2에 개시된 가산부(240)에 의하여 수행될 수 있다. 더불어 S1100 내지 S1140에 따른 동작들은, 도 7 내지 도 8b에서 전술된 내용들 중 일부를 기반으로 한 것이다. 따라서, 도 2 및 도 7 내지 도 8b에서 전술된 내용과 중복되는 구체적인 내용은 설명을 생략하거나 간단히 하기로 한다. Each step disclosed in FIG. 11 may be performed by the decoding apparatus 200 disclosed in FIG. 2. More specifically, S1100 to S1120 may be performed by the entropy decoding unit 210 shown in FIG. 2, S1130 may be performed by the inverse transform unit 223 shown in FIG. 2, and S1140 may be added as shown in FIG. 2. It may be performed by the unit 240. In addition, operations according to S1100 to S1140 are based on some of the contents described above with reference to FIGS. 7 to 8B. Therefore, detailed descriptions overlapping with those described above with reference to FIGS. 2 and 7 to 8B will be omitted or simply described.

도 12에 도시된 바와 같이, 일 실시예에 따른 디코딩 장치는 엔트로피 디코딩부(210), 역변환부(223) 및 가산부(240)를 포함할 수 있다. 그러나, 경우에 따라서는 도 12에 도시된 구성 요소 모두가 디코딩 장치의 필수 구성 요소가 아닐 수 있고, 디코딩 장치는 도 12에 도시된 구성 요소보다 많거나 적은 구성 요소에 의해 구현될 수 있다.As shown in FIG. 12, the decoding apparatus according to the embodiment may include an entropy decoding unit 210, an inverse transform unit 223, and an adder 240. However, in some cases, all of the components shown in FIG. 12 may not be essential components of the decoding apparatus, and the decoding apparatus may be implemented by more or fewer components than those illustrated in FIG. 12.

일 실시예에 따른 디코딩 장치에서 엔트로피 디코딩부(210), 역변환부(223) 및 가산부(240)는 각각 별도의 칩(chip)으로 구현되거나, 적어도 둘 이상의 구성 요소가 하나의 칩을 통해 구현될 수도 있다. In the decoding apparatus according to an embodiment, the entropy decoding unit 210, the inverse transform unit 223, and the adder 240 are each implemented as separate chips, or at least two or more components are implemented through one chip. May be

일 실시예에 따른 디코딩 장치는, 비트스트림으로부터 현재 블록에 대한 UTI 인덱스를 디코딩할 수 있다(S1100). 보다 구체적으로, 디코딩 장치의 엔트로피 디코딩부(210)는 비트스트림으로부터 현재 블록에 대한 UTI 인덱스를 디코딩할 수 있다. The decoding apparatus according to an embodiment may decode the UTI index for the current block from the bitstream (S1100). More specifically, the entropy decoding unit 210 of the decoding apparatus may decode the UTI index for the current block from the bitstream.

UTI 인덱스는 복수의 유효 변환 후보들 중 현재 블록에 대하여 적용될 1차 변환(또는 1차 변환에 대한 커널) 및 2차 변환(또는 2차 변환에 대한 변환 커널) 중 적어도 하나를 지시할 수 있다. The UTI index may indicate at least one of a primary transform (or a kernel for the primary transform) and a secondary transform (or a transform kernel for the secondary transform) to be applied to the current block among the plurality of valid transform candidates.

일 예시에서, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널) 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 둘 다(both)(또는 모두) 지시할 수 있다. 보다 구체적으로, UTI 인덱스는 1차 변환(또는 1차 변환에 대한 변환 커널)을 지시하기 위한 인덱스 및 2차 변환(또는 2차 변환에 대한 변환 커널)을 지시하기 위한 인덱스를 조인트 코딩할 수 있다.In one example, the UTI index may indicate (or both) the primary transform (or transform kernel for the primary transform) and the secondary transform (or transform kernel for the secondary transform). More specifically, the UTI index may joint code an index for indicating a primary transform (or a transform kernel for a primary transform) and an index for indicating a secondary transform (or a transform kernel for a secondary transform). .

다른 일 예시에서, 현재 블록의 사이즈가 기 정의된 임계치보다 작은 경우, UTI 인덱스는 1차 변환에 대한 변환 커널(만)을 지시할 수 있다.In another example, when the size of the current block is smaller than a predefined threshold, the UTI index may indicate only the transform kernel for the primary transform.

또 다른 일 예시에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 1차 변환이 기 결정된 경우, UTI 인덱스는 2차 변환을 지시하기 위한 인덱스를 지시할 수 있다.In another example, when a primary transform is predetermined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is an index for indicating a secondary transform. Can be indicated.

또 다른 일 예시에서, 현재 블록의 사이즈, 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 2차 변환이 기 결정된 경우, UTI 인덱스는 1차 변환을 지시하기 위한 인덱스를 지시할 수 있다.In another example, when a second transform is predetermined based on at least one of a size of a current block, a shape of a current block, and an intra prediction mode applied to the current block, the UTI index is an index for indicating a primary transform. Can be indicated.

일 실시예에 따른 디코딩 장치는, 비트스트림으로부터 현재 블록에 대한 변환 계수들을 디코딩할 수 있다(S1110). 보다 구체적으로, 디코딩 장치의 엔트로피 디코딩부(210)는 비트스트림으로부터 현재 블록에 대한 변환 계수들을 디코딩할 수 있다. The decoding apparatus according to an embodiment may decode transform coefficients for the current block from the bitstream (S1110). More specifically, the entropy decoding unit 210 of the decoding apparatus may decode transform coefficients for the current block from the bitstream.

일 실시예에 따른 디코딩 장치는, UTI 인덱스를 기반으로 현재 블록에 대한 변환 타입을 도출할 수 있다(S1120). 보다 구체적으로, 디코딩 장치의 엔트로피 디코딩부(210)는 UTI 인덱스를 기반으로 현재 블록에 대한 변환 타입을 도출할 수 있다. The decoding apparatus according to an embodiment may derive a transform type for the current block based on the UTI index (S1120). More specifically, the entropy decoding unit 210 of the decoding apparatus may derive a transform type for the current block based on the UTI index.

일 예시에서, 변환은 1차 변환(또는 코어 변환) 및 2차 변환 중 적어도 하나를 포함할 수 있고, 1차 변환 및 2차 변환 각각은 복수의 변환 타입 중 하나의 변환 타입에 기반할 수 있다. 1차 변환의 복수의 변환 타입은 도 3에서 전술한 다중 변환 세트를 포함할 수 있고, 2차 변환의 복수의 변환 타입은 비분리 2차 변환(NSST)을 포함할 수 있다.In one example, the transform can include at least one of a primary transform (or core transform) and a secondary transform, and each of the primary transform and the secondary transform can be based on one transform type of the plurality of transform types. . The plurality of transform types of the primary transform may include the multiple transform set described above in FIG. 3, and the plurality of transform types of the secondary transform may include a non-separated secondary transform (NSST).

일 실시예에 따른 디코딩 장치는, 도출된 변환 타입 및 현재 블록에 대한 변환 계수들을 기반으로 역변환을 수행할 수 있다(S1130). 보다 구체적으로, 디코딩 장치의 역변환부(223)는 도출된 변환 타입 및 현재 블록에 대한 변환 계수들을 기반으로 역변환을 수행할 수 있다. The decoding apparatus according to an embodiment may perform inverse transformation based on the derived transform type and transform coefficients for the current block (S1130). More specifically, the inverse transform unit 223 of the decoding apparatus may perform inverse transform based on the derived transform type and transform coefficients for the current block.

일 실시예에 따른 디코딩 장치는, 역변환을 통해 도출된 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성할 수 있다(S1140). 보다 구체적으로, 디코딩 장치의 가산부(240)는 역변환을 통해 도출된 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성할 수 있다.The decoding apparatus according to an embodiment may generate a reconstructed picture based on residual samples for the current block derived through inverse transform (S1140). More specifically, the adder 240 of the decoding apparatus may generate a reconstructed picture based on residual samples for the current block derived through inverse transform.

도 11 및 도 12에 개시된 디코딩 장치 및 디코딩 장치의 동작 방법에 따르면, 디코딩 장치는 비트스트림으로부터 현재 블록에 대한 UTI 인덱스를 디코딩하고(S1100), 비트스트림으로부터 현재 블록에 대한 변환 계수들을 디코딩하고(S1110), UTI 인덱스를 기반으로 현재 블록에 대한 변환 타입을 도출하고(S1120), 도출된 변환 타입 및 현재 블록에 대한 변환 계수들을 기반으로 역변환을 수행하고(S1130), 역변환을 통해 도출된 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성할 수 있다(S1140).According to the decoding apparatus and the operating method of the decoding apparatus disclosed in FIGS. 11 and 12, the decoding apparatus decodes the UTI index for the current block from the bitstream (S1100), decodes the transform coefficients for the current block from the bitstream ( S1110), a transform type for the current block is derived based on the UTI index (S1120), an inverse transform is performed based on the derived transform type and transform coefficients for the current block (S1130), and the current block derived through the inverse transform A reconstructed picture may be generated based on the residual samples for (S1140).

상술한 본 발명에 따른 방법은 소프트웨어 형태로 구현될 수 있으며, 본 발명에 따른 인코딩 장치 및/또는 디코딩 장치는 예를 들어 TV, 컴퓨터, 스마트폰, 셋톱박스, 디스플레이 장치 등의 영상 처리를 수행하는 장치에 포함될 수 있다.The above-described method according to the present invention may be implemented in software, and the encoding device and / or the decoding device according to the present invention may perform image processing of, for example, a TV, a computer, a smartphone, a set-top box, a display device, and the like. It can be included in the device.

본 발명에서 실시예들이 소프트웨어로 구현될 때, 상술한 방법은 상술한 기능을 수행하는 모듈(과정, 기능 등)로 구현될 수 있다. 모듈은 메모리에 저장되고, 프로세서에 의해 실행될 수 있다. 메모리는 프로세서 내부 또는 외부에 있을 수 있고, 잘 알려진 다양한 수단으로 프로세서와 연결될 수 있다. 프로세서는 ASIC(appICation-specific integrated circuit), 다른 칩셋, 논리 회로 및/또는 데이터 처리 장치를 포함할 수 있다. 메모리는 ROM(read-only memory), RAM(random access memory), 플래쉬 메모리, 메모리 카드, 저장 매체 및/또는 다른 저장 장치를 포함할 수 있다.When the embodiments of the present invention are implemented in software, the above-described method may be implemented as a module (process, function, etc.) for performing the above-described function. The module may be stored in memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor by various well known means. 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 card, storage medium and / or other storage device.

Claims (15)

디코딩 장치에 의하여 수행되는 픽처 디코딩 방법에 있어서,In the picture decoding method performed by the decoding apparatus, 비트스트림으로부터 현재 블록에 대한 통합 변환 인디케이터(unified transform indicator, UTI) 인덱스를 디코딩하는 단계; Decoding an unified transform indicator (UTI) index for the current block from the bitstream; 상기 비트스트림으로부터 상기 현재 블록에 대한 변환 계수들을 디코딩하는 단계;Decoding transform coefficients for the current block from the bitstream; 상기 UTI 인덱스를 기반으로 상기 현재 블록에 대한 변환 타입을 도출하는 단계;Deriving a transform type for the current block based on the UTI index; 상기 도출된 변환 타입 및 상기 현재 블록에 대한 상기 변환 계수들을 기반으로 역변환(inverse transform)을 수행하는 단계; 및Performing an inverse transform based on the derived transform type and the transform coefficients for the current block; And 상기 역변환을 통해 도출된 상기 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성하는 단계를 포함하되,Generating a reconstructed picture based on residual samples for the current block derived through the inverse transform, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 하는, 픽처 디코딩 방법.And the UTI index indicates at least one of a transform kernel for a first order transform and a transform kernel for a second order transform. 제1항에 있어서,The method of claim 1, 상기 역변환을 수행하는 단계는,Performing the inverse transform, 상기 UTI 인덱스가 지시하는 상기 2차 변환에 대한 변환 커널을 기반으로 상기 대상 블록에 대한 변환 계수들에 대하여 2차 역변환을 수행하여 수정된 변환 계수들을 도출하는 단계; 및Deriving modified transform coefficients by performing second-order inverse transform on the transform coefficients for the target block based on the transform kernel for the secondary transform indicated by the UTI index; And 상기 UTI 인덱스가 지시하는 상기 1차 변환에 대한 변환 커널을 기반으로 상기 수정된 변환 계수들에 대하여 1차 역변환을 수행하는 단계를 포함하는, 픽처 디코딩 방법.And performing a first order inverse transform on the modified transform coefficients based on the transform kernel for the first transform indicated by the UTI index. 제1항에 있어서,The method of claim 1, 상기 UTI 인덱스는 상기 1차 변환에 대한 변환 커널 및 상기 2차 변환에 대한 변환 커널을 둘 다 지시하는 것을 특징으로 하는, 픽처 디코딩 방법.And the UTI index indicates both a transform kernel for the primary transform and a transform kernel for the secondary transform. 제1항에 있어서,The method of claim 1, 상기 UTI 인덱스는 UTI 인덱스 리스트에 포함된 변환 커널 조합들 중 하나를 지시하며, 상기 UTI 인덱스 리스트는 상기 현재 블록의 사이즈(size), 상기 현재 블록의 형태(shape) 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 결정되는 것을 특징으로 하는, 픽처 디코딩 방법.The UTI index indicates one of the transform kernel combinations included in the UTI index list, wherein the UTI index list is a size of the current block, a shape of the current block, and an intra applied to the current block. And determine based on at least one of the prediction modes. 제1항에 있어서,The method of claim 1, 상기 현재 블록의 사이즈가 기 정의된 임계치보다 작은 경우, 상기 UTI 인덱스는 상기 1차 변환에 대한 변환 커널을 지시하는 것을 특징으로 하는, 픽처 디코딩 방법.And if the size of the current block is smaller than a predefined threshold, the UTI index indicates a transform kernel for the first transform. 제4항에 있어서,The method of claim 4, wherein 상기 현재 블록의 사이즈, 상기 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 상기 1차 변환에 대한 변환 커널이 기 결정된 경우, 상기 UTI 인덱스는 상기 2차 변환에 대한 변환 커널을 지시하는 것을 특징으로 하는, 픽처 디코딩 방법.When a transform kernel for the first transform is predetermined based on at least one of the size of the current block, the shape of the current block, and an intra prediction mode applied to the current block, the UTI index is determined for the second transform. And picture a transform kernel. 제4항에 있어서,The method of claim 4, wherein 상기 현재 블록의 사이즈, 상기 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 상기 2차 변환에 대한 변환 커널이 기 결정된 경우, 상기 UTI 인덱스는 상기 1차 변환에 대한 변환 커널을 지시하는 것을 특징으로 하는, 픽처 디코딩 방법.When a transform kernel for the second transform is predetermined based on at least one of the size of the current block, the shape of the current block, and an intra prediction mode applied to the current block, the UTI index is determined for the first transform. And picture a transform kernel. 제1항에 있어서,The method of claim 1, 상기 현재 블록에 대한 상기 변환 계수들은 상기 UTI 인덱스가 디코딩된 이후에 디코딩되는 것을 특징으로 하는, 픽처 디코딩 방법.And the transform coefficients for the current block are decoded after the UTI index is decoded. 제1항에 있어서,The method of claim 1, 상기 현재 블록에 대한 상기 변환 계수들은 상기 UTI 인덱스보다 먼저 디코딩되는 것을 특징으로 하는, 픽처 디코딩 방법.And the transform coefficients for the current block are decoded before the UTI index. 인코딩 장치에 의하여 수행되는 픽처 인코딩 방법에 있어서,In the picture encoding method performed by the encoding device, 현재 블록에 대한 레지듀얼 샘플들을 도출하는 단계;Deriving residual samples for the current block; 상기 현재 블록에 대한 상기 레지듀얼 샘플들에 대하여 변환을 수행하여 변환 계수들을 도출하는 단계;Performing transform on the residual samples for the current block to derive transform coefficients; 상기 수행된 변환의 변환 타입을 나타내는 통합 변환 인디케이터(UTI) 인덱스를 도출하는 단계; 및Deriving a Unified Transform Indicator (UTI) index that represents the transform type of the performed transform; And 상기 변환 계수들에 관한 정보 및 상기 UTI 인덱스를 포함하는 영상 정보를 인코딩하는 단계를 포함하되,Encoding information about the transform coefficients and the image information including the UTI index, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 하는, 픽처 인코딩 방법.And the UTI index indicates at least one of a transform kernel for a first order transform and a transform kernel for a second order transform. 제10항에 있어서,The method of claim 10, 상기 변환을 수행하는 단계는,Performing the conversion, 상기 UTI 인덱스가 지시하는 상기 1차 변환에 대한 변환 커널을 기반으로 상기 현재 블록에 대한 상기 레지듀얼 샘플들에 대하여 1차 변환을 수행하는 단계; 및Performing a first order transform on the residual samples for the current block based on the transform kernel for the first order indicated by the UTI index; And 상기 UTI 인덱스가 지시하는 상기 2차 변환에 대한 변환 커널을 기반으로 상기 1차 변환이 수행된 변환 계수들에 대하여 2차 변환을 수행하여 수정된 변환 계수들을 도출하는 단계를 포함하는, 픽처 인코딩 방법.And performing a second transform on transform coefficients on which the first transform is performed based on the transform kernel for the second transform indicated by the UTI index to derive modified transform coefficients. . 제10항에 있어서,The method of claim 10, 상기 UTI 인덱스는 UTI 인덱스 리스트에 포함된 변환 커널 조합들 중 하나를 지시하며, 상기 UTI 인덱스 리스트는 상기 현재 블록의 사이즈, 상기 현재 블록의 형태 및 상기 현재 블록에 적용되는 인트라 예측 모드 중 적어도 하나를 기반으로 결정되는 것을 특징으로 하는, 픽처 인코딩 방법.The UTI index indicates one of transform kernel combinations included in a UTI index list, and the UTI index list includes at least one of a size of the current block, a type of the current block, and an intra prediction mode applied to the current block. The picture encoding method, characterized in that determined based on. 제10항에 있어서,The method of claim 10, 상기 현재 블록의 사이즈가 기 정의된 임계치보다 작은 경우, 상기 UTI 인덱스는 상기 1차 변환에 대한 변환 커널을 지시하는 것을 특징으로 하는, 픽처 인코딩 방법.And if the size of the current block is smaller than a predefined threshold, the UTI index indicates a transform kernel for the first transform. 제10항에 있어서,The method of claim 10, 상기 현재 블록에 대한 상기 변환 계수들은 상기 UTI 인덱스가 인코딩된 이후에 인코딩되는 것을 특징으로 하는, 픽처 인코딩 방법.And the transform coefficients for the current block are encoded after the UTI index is encoded. 픽처를 디코딩하는 디코딩 장치에 있어서,In the decoding apparatus for decoding a picture, 비트스트림으로부터 현재 블록에 대한 통합 변환 인디케이터(UTI) 인덱스를 디코딩하고, 상기 비트스트림으로부터 상기 현재 블록에 대한 변환 계수들을 디코딩하고, 상기 디코딩된 UTI 인덱스를 기반으로 상기 현재 블록에 대한 변환 타입을 도출하는 엔트로피 디코딩부;Decode a Unified Transform Indicator (UTI) index for the current block from the bitstream, decode transform coefficients for the current block from the bitstream, and derive a transform type for the current block based on the decoded UTI index. An entropy decoding unit; 상기 도출된 변환 타입 및 상기 현재 블록에 대한 상기 변환 계수들을 기반으로 역변환(inverse transform)을 수행하는 역변환부; 및An inverse transform unit performing an inverse transform based on the derived transform type and the transform coefficients for the current block; And 상기 역변환을 통해 도출된 상기 현재 블록에 대한 레지듀얼 샘플들을 기반으로 복원 픽처를 생성하는 가산부를 포함하되,Including an adder for generating a reconstruction picture based on the residual samples for the current block derived through the inverse transform, 상기 UTI 인덱스는 1차 변환에 대한 변환 커널 및 2차 변환에 대한 변환 커널 중 적어도 하나를 지시하는 것을 특징으로 하는, 디코딩 장치.And the UTI index indicates at least one of a transform kernel for a first order transform and a transform kernel for a second order transform.
PCT/KR2019/002498 2018-04-01 2019-03-05 Image coding method and device on basis of transform indicator Ceased WO2019194420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862651238P 2018-04-01 2018-04-01
US62/651,238 2018-04-01

Publications (1)

Publication Number Publication Date
WO2019194420A1 true WO2019194420A1 (en) 2019-10-10

Family

ID=68101281

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/002498 Ceased WO2019194420A1 (en) 2018-04-01 2019-03-05 Image coding method and device on basis of transform indicator

Country Status (1)

Country Link
WO (1) WO2019194420A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114747222A (en) * 2019-11-01 2022-07-12 Lg 电子株式会社 Image compiling method and device based on transformation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120060914A (en) * 2009-10-23 2012-06-12 후아웨이 테크놀러지 컴퍼니 리미티드 Method and device for encoding and decoding video
KR101640973B1 (en) * 2010-12-29 2016-07-19 퀄컴 인코포레이티드 Video coding using mapped transforms and scanning modes
KR101718953B1 (en) * 2011-10-17 2017-03-22 주식회사 케이티 Method and apparatus for encoding/decoding image
KR20170089037A (en) * 2011-10-18 2017-08-02 주식회사 케이티 Method for encoding image, method for decoding image, image encoder, and image decoder
KR20180025284A (en) * 2016-08-31 2018-03-08 주식회사 케이티 Method and apparatus for processing a video signal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120060914A (en) * 2009-10-23 2012-06-12 후아웨이 테크놀러지 컴퍼니 리미티드 Method and device for encoding and decoding video
KR101640973B1 (en) * 2010-12-29 2016-07-19 퀄컴 인코포레이티드 Video coding using mapped transforms and scanning modes
KR101718953B1 (en) * 2011-10-17 2017-03-22 주식회사 케이티 Method and apparatus for encoding/decoding image
KR20170089037A (en) * 2011-10-18 2017-08-02 주식회사 케이티 Method for encoding image, method for decoding image, image encoder, and image decoder
KR20180025284A (en) * 2016-08-31 2018-03-08 주식회사 케이티 Method and apparatus for processing a video signal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114747222A (en) * 2019-11-01 2022-07-12 Lg 电子株式会社 Image compiling method and device based on transformation

Similar Documents

Publication Publication Date Title
WO2019117634A1 (en) Image coding method on basis of secondary transform and device therefor
WO2019117636A1 (en) Image coding method on basis of non-separable secondary transform and device therefor
WO2017209328A1 (en) Intra-prediction method and apparatus in image coding system
WO2020009556A1 (en) Transform-based image coding method and device
WO2019177429A1 (en) Method for coding image/video on basis of intra prediction and device therefor
WO2018221817A1 (en) Method and device for performing image decoding on basis of intra prediction in image coding system
WO2019117639A1 (en) Image coding method on basis of transformation and device therefor
WO2020246849A1 (en) Transform-based image coding method and device for same
WO2017065357A1 (en) Filtering method and apparatus for improving prediction in image coding system
WO2017164441A1 (en) Method and apparatus for inter prediction in video coding system
WO2020116961A1 (en) Image coding method based on secondary transform, and device therefor
WO2018008905A1 (en) Method and apparatus for processing video signal
WO2017014412A1 (en) Intra prediction method and device in video coding system
WO2019125035A1 (en) Method for coding image on basis of selective transform and device therefor
WO2017082443A1 (en) Method and apparatus for adaptively predicting image using threshold value in image coding system
WO2018044089A1 (en) Method and device for processing video signal
WO2017061671A1 (en) Method and device for coding image on basis of adaptive transformation in image coding system
WO2016159610A1 (en) Method and apparatus for processing video signal
WO2016114583A1 (en) Method and device for processing video signal
WO2020071879A1 (en) Transform coefficient coding method and device therefor
WO2019199141A1 (en) Inter prediction method and device in video coding system
WO2020256346A1 (en) Coding of information about transform kernel set
WO2020141831A2 (en) Image coding method and apparatus using intra block copy prediction
WO2020197274A1 (en) Transform-based image coding method and device therefor
WO2020130581A1 (en) Method for coding image on basis of secondary transform and device therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19781992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19781992

Country of ref document: EP

Kind code of ref document: A1