WO2024058637A1 - 비디오 신호 처리 방법 및 이를 위한 장치 - Google Patents

비디오 신호 처리 방법 및 이를 위한 장치 Download PDF

Info

Publication number
WO2024058637A1
WO2024058637A1 PCT/KR2023/014063 KR2023014063W WO2024058637A1 WO 2024058637 A1 WO2024058637 A1 WO 2024058637A1 KR 2023014063 W KR2023014063 W KR 2023014063W WO 2024058637 A1 WO2024058637 A1 WO 2024058637A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
intra prediction
current block
transform
intra
Prior art date
Application number
PCT/KR2023/014063
Other languages
English (en)
French (fr)
Inventor
김동철
김경용
손주형
곽진삼
Original Assignee
주식회사 윌러스표준기술연구소
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 주식회사 윌러스표준기술연구소 filed Critical 주식회사 윌러스표준기술연구소
Publication of WO2024058637A1 publication Critical patent/WO2024058637A1/ko

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/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • 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/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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • 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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • 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/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Definitions

  • the present invention relates to a method and device for processing video signals, and more particularly, to a method and device for processing video signals for encoding or decoding video signals.
  • Compression encoding refers to a series of signal processing technologies for transmitting digitized information through communication lines or storing it in a form suitable for storage media.
  • Targets of compression coding include audio, video, and text.
  • the technology for performing compression coding on video is called video image compression.
  • Compressive coding for video signals is accomplished by removing redundant information by considering spatial correlation, temporal correlation, and probabilistic correlation.
  • spatial correlation e.g., spatial correlation, temporal correlation, and probabilistic correlation.
  • the purpose of this specification is to increase the coding efficiency of video signals by providing a video signal processing method and apparatus for the same.
  • This specification provides a video signal processing method and a device therefor.
  • a video signal decoding device includes a processor, wherein the processor determines a transform kernel set for transforming a current block to which intra template matching is applied, and transforms included in the transform kernel set. Predict the current block based on a kernel, and the transform kernel set may be determined based on an intra prediction mode associated with the current block.
  • the video signal encoding device includes a processor, wherein the processor obtains a bitstream to be decoded by a decoding method, and the decoding method is performed by converting the current block to which intra template matching is applied. determining a set of transformation kernels for; and predicting the current block based on a transform kernel included in the transform kernel set, wherein the transform kernel set may be determined based on an intra prediction mode associated with the current block.
  • the bitstream is decoded by a decoding method, and the decoding method is a conversion of the current block to which intra template matching is applied.
  • the decoding method is a conversion of the current block to which intra template matching is applied. determining a set of transformation kernels for; and predicting the current block based on a transform kernel included in the transform kernel set, wherein the transform kernel set may be determined based on an intra prediction mode associated with the current block.
  • the transform kernel set includes a set of transform matrices of a multiple transform set (MTS), a set of transform matrices of a low frequency non-separable transform (LFNST), and /Or it may be at least one of a set of transformation matrices of non-separable primary transform.
  • MTS multiple transform set
  • LNNST low frequency non-separable transform
  • the intra prediction mode may be derived based on DIMD (Decoder side intra mode derivation).
  • the intra prediction mode may be derived based on the intra prediction mode of a preset position in the reference block of the current block and the intra prediction mode of a neighboring block of the reference block.
  • the preset positions within the reference block are the top left, bottom right, and center of the current block
  • the neighboring blocks of the reference block are neighbors of the reference block adjacent to the upper boundary of the reference block.
  • the blocks it may be a block adjacent to the middle block among blocks on the upper boundary of the current block, and a block adjacent to the middle block among blocks on the left boundary of the current block among neighboring blocks adjacent to the left boundary of the reference block.
  • the intra prediction mode may be derived based on the intra prediction mode of a neighboring block of the current block.
  • the neighboring blocks of the current block are (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0 ), where H is the height of the current block, W is the width of the current block, and the position of the upper left block of the current block may be (0, 0).
  • the intra prediction mode of a preset position in the reference block of the current block and the intra prediction mode of the neighboring block of the reference block do not exist, the intra prediction mode is DIMD (Decoder side intra mode derivation) It can be derived based on .
  • This specification provides a method for efficiently processing video signals.
  • FIG. 1 is a schematic block diagram of a video signal encoding device according to an embodiment of the present invention.
  • Figure 2 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention.
  • Figure 3 shows an embodiment in which a coding tree unit is divided into coding units within a picture.
  • Figure 4 shows one embodiment of a method for signaling splitting of quad trees and multi-type trees.
  • FIGS 5 and 6 show the intra prediction method according to an embodiment of the present invention in more detail.
  • Figure 7 is a diagram showing the positions of neighboring blocks used to construct a motion candidate list in inter prediction.
  • Figure 8 is a diagram showing the type of conversion kernel according to an embodiment of the present specification.
  • Figure 9 is a diagram showing the 0th (lowest frequency component of the corresponding transformation kernel) basis function of DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII transformation according to an embodiment of the present specification.
  • FIGS. 10 and 11 are diagrams showing a transformation kernel set according to an embodiment of the present specification.
  • FIG. 12 is a diagram illustrating a process for restoring a residual signal according to an embodiment of the present specification.
  • Figure 13 is a diagram showing the ROI (Region-Of-Interest) of a block to which secondary transformation has been applied according to an embodiment of the present specification.
  • Figure 14 is a diagram showing a method of applying quadratic transformation (LFNST) according to an embodiment of the present specification.
  • Figure 15 is a diagram showing the mapping relationship between an intra prediction mode and a transformation kernel set for secondary transformation according to an embodiment of the present specification.
  • Figure 16 is a diagram showing the process of generating a prediction block using DIMD according to an embodiment of the present invention.
  • Figure 17 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
  • Figure 18 is a diagram showing a method for mapping a directional mode according to an embodiment of the present invention.
  • Figure 19 is a diagram showing a histogram for deriving an intra prediction directional mode according to an embodiment of the present invention.
  • 20 to 22 show matrix-based intra prediction according to an embodiment of the present invention.
  • Figure 23 is a diagram showing intra template matching according to an embodiment of the present invention.
  • Figure 24 is a diagram showing the encoding/decoding process of a signal related to the DIMD method according to an embodiment of the present invention.
  • Figure 25 is a diagram showing the encoding/decoding process of a signal related to the MIP and/or intra TMP method according to an embodiment of the present invention.
  • Figure 26 is a diagram showing the relationship between an input vector of secondary transformation and an intra prediction mode according to an embodiment of the present invention.
  • Figure 27 is a diagram showing a method of configuring an input vector for secondary transformation according to an embodiment of the present specification.
  • FIG. 28 is a diagram illustrating a process for deriving directionality information of a template of a current block for intra-template matching according to an embodiment of the present invention.
  • Figure 29 is a diagram showing a template form for deriving intra prediction direction information according to an embodiment of the present invention.
  • Figure 30 is a diagram showing an MTS set applied to an intra template matching block according to an embodiment of the present invention.
  • Figures 31 and 32 are diagrams showing a syntax structure including a flag indicating whether to apply intra template matching according to an embodiment of the present invention.
  • Figure 33 is a diagram showing a syntax structure showing a method of parsing a syntax element indicating whether to apply LFNST.
  • Figure 34 is a diagram showing intra propagation of an intra template matching block according to an embodiment of the present invention.
  • Figure 35 is a diagram showing a method of applying a hash key according to the intra template matching block search method according to an embodiment of the present invention.
  • Figure 36 is a diagram showing preset positions for intra-template matching block search according to an embodiment of the present invention.
  • Figure 37 is a diagram showing a coding unit syntax structure according to an embodiment of the present invention.
  • Figure 38 is a diagram showing a method of selecting a transform set for a block to which intra TMP is applied according to an embodiment of the present invention.
  • Figure 39 is a diagram showing a plurality of block vectors for an intra TMP block according to an embodiment of the present invention.
  • Figure 40 is a diagram showing a method of deriving an intra prediction mode of a block to which intra TMP is applied according to an embodiment of the present invention.
  • Figure 41 is a diagram showing a method for determining an MTS set or LFNST set according to an embodiment of the present invention.
  • a and/or B may be interpreted as meaning ‘including at least one of A or B.’
  • Coding can be interpreted as encoding or decoding depending on the case.
  • a device that performs encoding (encoding) of a video signal to generate a video signal bitstream is referred to as an encoding device or encoder
  • a device that performs decoding (decoding) of a video signal bitstream to restore a video signal is referred to as a decoder. It is referred to as a device or decoder.
  • a video signal processing device is used as a term that includes both an encoder and a decoder.
  • 'Unit' is used to refer to a basic unit of image processing or a specific location of a picture, and refers to an image area containing at least one of a luminance (luma) component and a chrominance (chroma) component.
  • 'block' refers to an image area containing specific components among the luminance component and chrominance component (i.e., Cb and Cr).
  • terms such as 'unit', 'block', 'partition', 'signal', and 'area' may be used interchangeably.
  • 'current block' refers to a block currently scheduled to be encoded
  • 'reference block' refers to a block for which encoding or decoding has already been completed and is used as a reference in the current block.
  • terms such as 'luma', 'luma', 'luminance', and 'Y' may be used interchangeably.
  • terms such as 'chroma', 'chroma', 'color difference', and 'Cb or Cr' may be used interchangeably, and since the color difference component is divided into two types, Cb and Cr, each color difference component will be used separately. You can.
  • a unit may be used as a concept that includes all coding units, prediction units, and transformation units.
  • a picture refers to a field or frame, and depending on the embodiment, the above terms may be used interchangeably.
  • the captured image is an interlaced image
  • one frame is divided into an odd (or odd, top) field and an even (or even, bottom) field, and each field consists of one picture unit. and can be encoded or decoded.
  • the captured image is a progressive image, one frame can be configured as a picture and encoded or decoded.
  • terms such as 'error signal', 'residual signal', 'residual signal', 'residual signal', and 'difference signal' may be used interchangeably.
  • terms such as 'intra prediction mode', 'intra prediction directional mode', 'intra-screen prediction mode', and 'intra-screen prediction directional mode' may be used interchangeably.
  • terms such as 'motion' and 'movement' may be used interchangeably.
  • 'left', 'upper left', 'upper', 'upper right', 'right', 'lower right', 'bottom', and 'lower left' mean 'left', 'upper left', ' It can be used interchangeably with 'top', 'top right', 'bottom right', 'bottom right', 'bottom', and 'bottom left'. Additionally, element and member can be used interchangeably.
  • POC Picture Order Count
  • Figure 1 is a schematic block diagram of a video signal encoding device 100 according to an embodiment of the present invention.
  • the encoding device 100 of the present invention includes a transform unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transform unit 125, a filtering unit 130, and a prediction unit 150. ) and an entropy coding unit 160.
  • the conversion unit 110 obtains a conversion coefficient value by converting the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit 150.
  • Discrete Cosine Transform DCT
  • DST Discrete Sine Transform
  • Wavelet Transform may be used.
  • Discrete cosine transform and discrete sine transform perform transformation by dividing the input picture signal into blocks. In transformation, coding efficiency may vary depending on the distribution and characteristics of values within the transformation area.
  • the transformation kernel used for transformation of the residual block may be a transformation kernel with separable characteristics of vertical transformation and horizontal transformation. In this case, transformation for the residual block can be performed separately into vertical transformation and horizontal transformation.
  • the encoder can perform vertical transformation by applying a transformation kernel in the vertical direction of the residual block.
  • the encoder can perform horizontal transformation by applying a transformation kernel in the horizontal direction of the residual block.
  • a transform kernel may be used as a term to refer to a set of parameters used for transforming a residual signal, such as a transform matrix, transform array, transform function, or transform.
  • the transformation kernel may be any one of a plurality of available kernels. Additionally, transformation kernels based on different transformation types may be used for each of vertical transformation and horizontal transformation.
  • error signals may exist only in some areas of the coding block.
  • the conversion process may be performed only for some arbitrary areas.
  • an error signal may exist only in the first 2NxN block, and a conversion process is performed only on the first 2NxN block, but the conversion process is not performed on the second 2NxN block and may not be encoded or decoded.
  • N can be any positive integer.
  • the encoder may perform additional transformations before the transform coefficients are quantized.
  • the above-described transformation method may be referred to as a primary transform, and additional transformation may be referred to as a secondary transform.
  • Secondary transformation may be optional for each residual block.
  • the encoder may improve coding efficiency by performing secondary transformation on a region where it is difficult to concentrate energy in the low-frequency region only through primary transformation.
  • secondary transformation may be additionally performed on a block whose residual values appear large in directions other than the horizontal or vertical direction of the residual block.
  • secondary transformation may not be performed separately into vertical transformation and horizontal transformation. This secondary transform may be referred to as Low Frequency Non-Separable Transform (LFNST).
  • LTNST Low Frequency Non-Separable Transform
  • the quantization unit 115 quantizes the transform coefficient value output from the transform unit 110.
  • the picture is predicted using the already coded area through the prediction unit 150, and the residual value between the original picture and the predicted picture is added to the predicted picture to create a reconstructed picture.
  • a method of obtaining is used.
  • the encoder performs a process of restoring the current encoded block.
  • the inverse quantization unit 120 inversely quantizes the transform coefficient value, and the inverse transform unit 125 restores the residual value using the inverse quantized transform coefficient value.
  • the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and improve coding efficiency.
  • deblocking filters For example, deblocking filters, sample adaptive offset (SAO), and adaptive loop filters may be included.
  • the filtered picture is output or stored in a decoded picture buffer (DPB, 156) to be used as a reference picture.
  • DPB decoded picture buffer
  • a deblocking filter is a filter for removing distortion within blocks created at the boundaries between blocks in a restored picture.
  • the encoder can determine whether to apply a deblocking filter to the edge based on the distribution of pixels included in several columns or rows based on an arbitrary edge within the block.
  • the encoder can apply a long filter, strong filter, or weak filter depending on the deblocking filtering strength.
  • horizontal filtering and vertical filtering can be processed in parallel.
  • Sample adaptive offset (SAO) can be used to correct the offset from the original image on a pixel basis for a residual block to which a deblocking filter has been applied.
  • the encoder In order to correct the offset for a specific picture, the encoder divides the pixels included in the image into a certain number of areas, determines the area to perform offset correction, and uses a method (Band Offset) to apply the offset to the area. You can. Alternatively, the encoder can use a method of applying an offset (Edge Offset) by considering the edge information of each pixel.
  • Adaptive Loop Filter ALF is a method of dividing pixels included in an image into predetermined groups, then determining one filter to be applied to the group, and performing differential filtering for each group. Information related to whether to apply ALF may be signaled in units of coding units, and the shape and filter coefficients of the ALF filter to be applied may vary for each block. Additionally, an ALF filter of the same type (fixed type) may be applied regardless of the characteristics of the target block to be applied.
  • the prediction unit 150 includes an intra prediction unit 152 and an inter prediction unit 154.
  • the intra prediction unit 152 performs intra prediction within the current picture
  • the inter prediction unit 154 performs inter prediction using the reference picture stored in the decoded picture buffer 156. Perform.
  • the intra prediction unit 152 performs intra prediction from the reconstructed areas in the current picture and transmits intra encoding information to the entropy coding unit 160.
  • Intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, an MPM index, and information about a reference sample.
  • the inter prediction unit 154 may again include a motion estimation unit 154a and a motion compensation unit 154b.
  • the motion estimation unit 154a refers to a specific region of the reconstructed reference picture, finds the part most similar to the current region, and obtains a motion vector value that is the distance between regions.
  • Motion information reference direction indication information (L0 prediction, L1 prediction, bi-directional prediction), reference picture index, motion vector information, etc.) about the reference area obtained from the motion estimation unit 154a is transmitted to the entropy coding unit 160. so that it can be included in the bitstream.
  • the motion compensation unit 154b uses the motion information transmitted from the motion estimation unit 154a, the motion compensation unit 154b performs inter-motion compensation to generate a prediction block for the current block.
  • the inter prediction unit 154 transmits inter encoding information including motion information about the reference region to the entropy coding unit 160.
  • the prediction unit 150 may include an intra block copy (IBC) prediction unit (not shown).
  • the IBC prediction unit performs IBC prediction from the reconstructed samples in the current picture and transmits IBC encoding information to the entropy coding unit 160.
  • the IBC prediction unit refers to a specific region in the current picture and obtains a block vector value indicating a reference region used for prediction of the current region.
  • the IBC prediction unit may perform IBC prediction using the obtained block vector value.
  • the IBC prediction unit transmits IBC encoding information to the entropy coding unit 160.
  • IBC encoding information may include at least one of reference area size information and block vector information (index information for block vector prediction of the current block within the motion candidate list, block vector difference information).
  • the transform unit 110 obtains a transform coefficient value by transforming the residual value between the original picture and the predicted picture.
  • transformation may be performed on a specific block basis within the picture, and the size of the specific block may vary within a preset range.
  • the quantization unit 115 quantizes the transform coefficient value generated by the transform unit 110 and transmits the quantized transform coefficient to the entropy coding unit 160.
  • the quantized transform coefficients in the form of a two-dimensional array can be rearranged into a one-dimensional array for entropy coding.
  • the scanning method for the quantized transform coefficient may be determined depending on the size of the transform block and the intra-screen prediction mode. As an example, diagonal, vertical, and horizontal scans may be applied. This scan information can be signaled in block units and can be derived according to already established rules.
  • the entropy coding unit 160 generates a video signal bitstream by entropy coding information representing quantized transform coefficients, intra encoding information, and inter encoding information.
  • the entropy coding unit 160 may use a variable length coding (VLC) method or an arithmetic coding method.
  • VLC variable length coding
  • the variable length coding (VLC) method converts input symbols into continuous codewords, and the length of the codewords may be variable. For example, frequently occurring symbols are expressed as short codewords, and infrequently occurring symbols are expressed as long codewords.
  • Context-based Adaptive Variable Length Coding CAVLC
  • CAVLC Context-based Adaptive Variable Length Coding
  • Arithmetic coding converts consecutive data symbols into a single decimal number using the probability distribution of each data symbol. Arithmetic coding can obtain the optimal decimal bits needed to express each symbol.
  • As arithmetic coding context-based adaptive binary arithmetic code (CABAC) can be used.
  • CABAC context-based adaptive binary arithmetic code
  • CABAC is a method of binary arithmetic encoding using multiple context models created based on probabilities obtained through experiments.
  • the context model can also be called a context model.
  • the CABAC initialization process is divided into context initialization and arithmetic coding initialization.
  • Context initialization is a process of initializing the probability of occurrence of each symbol, and is determined depending on the type of symbol, quantization parameter (QP), and slice type (whether I, P, or B).
  • QP quantization parameter
  • slice type whether I, P, or B
  • the context model provides the probability of occurrence of LPS (Least Probable Symbol) or MPS (Most Probable Symbol) for the symbol currently being coded and information (valMPS) about which empty value among 0 and 1 corresponds to the MPS.
  • LPS Local Probable Symbol
  • MPS Moving Probable Symbol
  • valMPS information about which empty value among 0 and 1 corresponds to the MPS.
  • One of several context models is selected through a context index (ctxIdx), and the context index can be derived through information on the current block to be encoded or information on surrounding blocks.
  • Initialization for binary arithmetic coding is performed based on the probability model selected from the context model.
  • Binary arithmetic coding is divided into probability intervals using the probability of occurrence of 0 and 1, and then coding is carried out through the process where the probability interval corresponding to the bin to be processed becomes the entire probability interval for the next bin to be processed.
  • a renormalization process is performed to widen the probability interval and the corresponding location information is output. Additionally, after each bin is processed, a probability update process may be performed in which the probability of the next bin to be processed is newly set through information on the processed bin.
  • the generated bitstream is encapsulated in a NAL (Network Abstraction Layer) unit as a basic unit.
  • NAL units are divided into VCL (Video Coding Layer) NAL units containing video data and non-VCL NAL units containing parameter information for decoding video data.
  • VCL Video Coding Layer
  • non-VCL NAL units There are various types of VCL or non-VCL NAL units.
  • the NAL unit consists of NAL header information and data, RBSP (Raw Byte Sequence Payload), and the NAL header information includes summary information about the RBSP.
  • the RBSP of the VCL NAL unit includes an encoded integer number of coding tree units.
  • the bitstream In order to decode a bitstream in a video decoder, the bitstream must first be separated into NAL units, and then each separated NAL unit must be decoded. Meanwhile, the information required for decoding the video signal bitstream will be transmitted in a picture parameter set (PPS), sequence parameter set (SPS), video parameter set (VPS), etc. You can.
  • PPS picture parameter set
  • SPS sequence parameter set
  • VPS video parameter set
  • FIG. 1 shows the encoding device 100 according to an embodiment of the present invention, and the separately displayed blocks show elements of the encoding device 100 logically distinguished. Accordingly, the elements of the above-described encoding device 100 may be mounted as one chip or as a plurality of chips depending on the design of the device. According to one embodiment, the operation of each element of the above-described encoding device 100 may be performed by a processor (not shown).
  • Figure 2 is a schematic block diagram of a video signal decoding device 200 according to an embodiment of the present invention.
  • the decoding device 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230, and a prediction unit 250.
  • the entropy decoding unit 210 entropy decodes the video signal bitstream and extracts transform coefficient information, intra encoding information, and inter encoding information for each region. For example, the entropy decoder 210 may obtain a binarization code for transform coefficient information of a specific area from a video signal bitstream. Additionally, the entropy decoding unit 210 inversely binarizes the binarization code to obtain a quantized transform coefficient. The inverse quantization unit 220 inversely quantizes the quantized transform coefficient, and the inverse transform unit 225 restores the residual value using the inverse quantized transform coefficient. The video signal processing device 200 restores the original pixel value by summing the residual value obtained from the inverse transform unit 225 with the predicted value obtained from the prediction unit 250.
  • the filtering unit 230 improves image quality by performing filtering on the picture. This may include a deblocking filter to reduce block distortion and/or an adaptive loop filter to remove distortion of the entire picture.
  • the filtered picture is output or stored in the decoded picture buffer (DPB, 256) to be used as a reference picture for the next picture.
  • the prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254.
  • the prediction unit 250 generates a prediction picture using the coding type decoded through the entropy decoding unit 210, transform coefficients for each region, intra/inter coding information, etc.
  • the current picture including the current block or the decoded area of other pictures can be used. Only the current picture is used for reconstruction, that is, a picture (or tile/slice) that performs intra prediction or intra BC prediction is used as an intra picture or I picture (or tile/slice), intra prediction, both inter prediction and intra BC prediction.
  • a picture (or tile/slice) that can be performed is called an inter picture (or tile/slice).
  • a picture (or tile/slice) that uses up to one motion vector and reference picture index is called a predictive picture or P picture (or , tile/slice), and a picture (or tile/slice) using up to two motion vectors and a reference picture index is called a bi-predictive picture or B picture (or tile/slice).
  • a P picture (or tile/slice) uses at most one set of motion information to predict each block
  • a B picture (or tile/slice) uses at most two sets of motion information to predict each block.
  • the motion information set includes one or more motion vectors and one reference picture index.
  • the intra prediction unit 252 generates a prediction block using intra encoding information and reconstructed samples in the current picture.
  • intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index.
  • MPM Most Probable Mode
  • the intra prediction unit 252 predicts sample values of the current block using reconstructed samples located to the left and/or above the current block as reference samples.
  • reconstructed samples, reference samples, and samples of the current block may represent pixels. Additionally, sample values may represent pixel values.
  • the reference samples may be samples included in neighboring blocks of the current block.
  • the reference samples may be samples adjacent to the left border and/or samples adjacent to the upper boundary of the current block.
  • the reference samples are samples of neighboring blocks of the current block, which are located on a line within a preset distance from the left border of the current block and/or are located on a line within a preset distance from the upper border of the current block. These may be samples that do.
  • the surrounding blocks of the current block are the left (L) block, upper (A) block, Below Left (BL) block, Above Right (AR) block, or Above Left block adjacent to the current block.
  • AL may include at least one block.
  • the inter prediction unit 254 generates a prediction block using the reference picture and inter encoding information stored in the decoded picture buffer 256.
  • Inter-encoding information may include a set of motion information (reference picture index, motion vector information, etc.) of the current block with respect to the reference block.
  • Inter prediction may include L0 prediction, L1 prediction, and bi-prediction.
  • L0 prediction refers to prediction using one reference picture included in the L0 picture list
  • L1 prediction refers to prediction using one reference picture included in the L1 picture list. This may require one set of motion information (eg, motion vector and reference picture index).
  • a maximum of two reference regions can be used, and these two reference regions may exist in the same reference picture or in different pictures.
  • the pair prediction method up to two sets of motion information (e.g., a motion vector and a reference picture index) can be used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indices. It may be possible to respond.
  • the reference pictures are pictures located temporally before or after the current picture, and may be pictures that have already been reconstructed.
  • the two reference regions used in the bi-prediction method may be regions selected from the L0 picture list and the L1 picture list, respectively.
  • the inter prediction unit 254 may obtain a reference block of the current block using a motion vector and a reference picture index.
  • the reference block exists in a reference picture corresponding to a reference picture index.
  • the sample value of the block specified by the motion vector or its interpolated value may be used as a predictor of the current block.
  • an 8-tap interpolation filter can be used for the luminance signal and a 4-tap interpolation filter can be used for the chrominance signal.
  • the interpolation filter for motion prediction in subpel units is not limited to this. In this way, the inter prediction unit 254 performs motion compensation to predict the texture of the current unit from the previously restored picture. At this time, the inter prediction unit can use a motion information set.
  • the prediction unit 250 may include an IBC prediction unit (not shown).
  • the IBC prediction unit can reconstruct the current region by referring to a specific region containing reconstructed samples in the current picture.
  • the IBC prediction unit may perform IBC prediction using IBC encoding information obtained from the entropy decoding unit 210.
  • IBC encoding information may include block vector information.
  • the predicted value output from the intra prediction unit 252 or the inter prediction unit 254 and the residual value output from the inverse transform unit 225 are added to generate a restored video picture. That is, the video signal decoding apparatus 200 restores the current block using the prediction block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225.
  • FIG. 2 shows a decoding device 200 according to an embodiment of the present invention, and the separately displayed blocks show elements of the decoding device 200 logically distinguished. Accordingly, the elements of the above-described decoding device 200 may be mounted as one chip or as a plurality of chips depending on the design of the device. According to one embodiment, the operation of each element of the above-described decoding device 200 may be performed by a processor (not shown).
  • signaling can be described as encoding each syntax from an encoder's perspective
  • parsing can be described as interpreting each syntax from a decoder's perspective. That is, each syntax can be signaled by being included in the bitstream from the encoder, and the decoder can parse the syntax and use it in the restoration process.
  • sequence of bits for each syntax arranged according to the prescribed hierarchical structure can be referred to as a bitstream.
  • One picture may be divided into sub-pictures, slices, tiles, etc. and encoded.
  • a subpicture may include one or more slices or tiles. If one picture is divided into multiple slices or tiles and encoded, it can be displayed on the screen only when all slices or tiles in the picture have been decoded. On the other hand, when one picture is encoded with several subpictures, only arbitrary subpictures can be decoded and displayed on the screen.
  • a slice may contain multiple tiles or subpictures. Alternatively, a tile may include multiple subpictures or slices. Subpictures, slices, and tiles can be encoded or decoded independently of each other, which is effective in improving parallel processing and processing speed. However, there is a disadvantage in that the bit amount increases because encoded information of other adjacent subpictures, other slices, and other tiles cannot be used.
  • Subpictures, slices, and tiles can be divided into multiple Coding Tree Units (CTUs) and encoded.
  • CTUs Coding Tree Units
  • FIG. 3 shows an embodiment in which a Coding Tree Unit (CTU) is divided into Coding Units (CUs) within a picture.
  • CTU Coding Tree Unit
  • CUs Coding Units
  • a coding tree unit may be composed of a luma coding tree block (CTB), two chroma coding tree blocks, and its encoded syntax information.
  • CB luma coding tree block
  • One coding tree unit may consist of one coding unit, or one coding tree unit may be divided into multiple coding units.
  • One coding unit may be composed of a luminance coding block (CB), two chrominance coding blocks, and its encoded syntax information.
  • One coding block can be divided into several sub-coding blocks.
  • One coding unit may consist of one transform unit (TU), or one coding unit may be divided into several transform units.
  • One transformation unit may be composed of a luminance transformation block (Transform Block, TB), two chrominance transformation blocks, and its encoded syntax information.
  • a coding tree unit may be divided into a plurality of coding units.
  • a coding tree unit may be a leaf node without being split. In this case, the coding tree unit itself may be a coding unit.
  • a coding unit refers to a basic unit for processing a picture in the video signal processing process described above, that is, intra/inter prediction, transformation, quantization, and/or entropy coding.
  • the size and shape of a coding unit within one picture may not be constant.
  • the coding unit may have a square or rectangular shape.
  • a rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block).
  • a vertical block is a block whose height is greater than its width
  • a horizontal block is a block whose width is greater than its height.
  • a non-square block may refer to a rectangular block, but the present invention is not limited thereto.
  • the coding tree unit is first divided into a quad tree (Quad Tree, QT) structure. That is, in a quad tree structure, one node with a size of 2NX2N can be divided into four nodes with a size of NXN.
  • a quad tree may also be referred to as a quaternary tree.
  • Quad-tree partitioning can be performed recursively, and not all nodes need to be partitioned to the same depth.
  • the leaf nodes of the aforementioned quad tree can be further divided into a multi-type tree (MTT) structure.
  • MTT multi-type tree
  • one node in a multi-type tree structure, one node may be divided into a binary or ternary tree structure with horizontal or vertical division. That is, there are four division structures in the multi-type tree structure: vertical binary division, horizontal binary division, vertical ternary division, and horizontal ternary division.
  • the width and height of the nodes in each tree structure may both have values that are powers of 2.
  • BT Binary Tree
  • a node of size 2NX2N may be divided into two NX2N nodes by vertical binary division and into two 2NXN nodes by horizontal binary division.
  • a node of size 2NX2N is divided into nodes of (N/2)X2N, NX2N and (N/2)X2N by vertical ternary division, and horizontal ternary division By division, it can be divided into nodes of 2NX(N/2), 2NXN, and 2NX(N/2).
  • This multi-type tree partitioning can be performed recursively.
  • Leaf nodes of a multi-type tree can be coding units. If the coding unit is not larger than the maximum transformation length, the coding unit can be used as a unit of prediction and/or transformation without further division. As an example, if the width or height of the current coding unit is greater than the maximum transform length, the current coding unit may be split into a plurality of transform units without explicit signaling regarding splitting. Meanwhile, in the above-described quad tree and multi-type tree, at least one of the following parameters may be defined in advance or transmitted through an RBSP of a higher level set such as PPS, SPS, VPS, etc.
  • Figure 4 shows one embodiment of a method for signaling splitting of quad trees and multi-type trees.
  • Preset flags can be used to signal division of the above-described quad tree and multi-type tree.
  • a flag 'split_cu_flag' indicating whether to split a node
  • a flag 'split_qt_flag' indicating whether to split a quad tree node
  • a flag 'mtt_split_cu_vertical_flag' indicating the splitting direction of a multi-type tree node, or a multi-type tree node.
  • At least one of the flags 'mtt_split_cu_binary_flag' that indicates the split shape of the type tree node can be used.
  • 'split_cu_flag' a flag indicating whether to split the current node, may be signaled first. If the value of 'split_cu_flag' is 0, it indicates that the current node is not split, and the current node becomes a coding unit. If the current node is a coating tree unit, the coding tree unit includes one undivided coding unit. If the current node is a quad tree node 'QT node', the current node is a leaf node 'QT leaf node' of the quad tree and becomes a coding unit. If the current node is a multi-type tree node 'MTT node', the current node is a leaf node 'MTT leaf node' of the multi-type tree and becomes a coding unit.
  • the current node can be divided into nodes of a quad tree or multi-type tree according to the value of 'split_qt_flag'.
  • the coding tree unit is the root node of the quad tree and can be first divided into a quad tree structure. In the quad tree structure, 'split_qt_flag' is signaled for each node 'QT node'.
  • quad tree division may be limited depending on the type of the current node. Quad tree splitting may be allowed if the current node is a coding tree unit (root node of the quot tree) or a quot tree node, and quot tree splitting may not be allowed if the current node is a multi-type tree node.
  • Each quad tree leaf node 'QT leaf node' can be further divided into a multi-type tree structure. As described above, if 'split_qt_flag' is 0, the current node can be split into multi-type nodes. To indicate the split direction and split shape, 'mtt_split_cu_vertical_flag' and 'mtt_split_cu_binary_flag' may be signaled.
  • the luminance block and the chrominance block can be divided into the same form. That is, the chrominance block can be divided by referring to the division type of the luminance block. If the current chrominance block is smaller than a certain size, the chrominance block may not be divided even if the luminance block is divided.
  • the luminance block and the chrominance block may have different forms.
  • division information for the luminance block and division information for the chrominance block may be signaled, respectively.
  • not only the division information but also the encoding information of the luminance block and the chrominance block may be different.
  • at least one intra coding mode of a luminance block and a chrominance block, encoding information for motion information, etc. may be different.
  • a node to be divided into the smallest unit can be processed as one coding block.
  • the coding block may be divided into several sub-blocks (sub-coding blocks), and the prediction information of each sub-block may be the same or different.
  • the intra prediction mode of each subblock may be the same or different from each other.
  • the motion information of each sub-block may be the same or different.
  • each sub-block may be encoded or decoded independently from each other.
  • Each sub-block can be distinguished through a sub-block index (sbIdx).
  • a coding unit when a coding unit is divided into sub-blocks, it may be divided horizontally or vertically or diagonally.
  • ISP Intra Sub Partitions
  • GPM Gaometric partitioning mode
  • the position and direction of the diagonal line are derived using a predetermined angle table, and the index information of the angle table is signaled.
  • Picture prediction (motion compensation) for coding is performed on coding units that are no longer divided (i.e., leaf nodes of coding tree units).
  • the basic unit that performs such prediction is hereinafter referred to as a prediction unit or prediction block.
  • the term unit used in this specification may be used as a replacement for the prediction unit, which is a basic unit for performing prediction.
  • the present invention is not limited to this, and can be understood more broadly as a concept including the coding unit.
  • Figures 5 and 6 show the intra prediction method according to an embodiment of the present invention in more detail.
  • the intra prediction unit predicts sample values of the current block using reconstructed samples located to the left and/or above the current block as reference samples.
  • Figure 5 shows an example of reference samples used for prediction of the current block in intra prediction mode.
  • the reference samples may be samples adjacent to the left boundary and/or samples adjacent to the upper boundary of the current block.
  • a maximum of 2W+2H+1 located to the left and/or above the current block Reference samples can be set using the surrounding samples.
  • pixels of multiple reference lines may be used for intra prediction of the current block.
  • Multiple reference lines may be composed of n lines located within a preset range from the current block.
  • separate index information indicating lines to be set as reference pixels may be signaled, and may be called a reference line index.
  • the intra prediction unit may obtain reference samples by performing a reference sample padding process. Additionally, the intra prediction unit may perform a reference sample filtering process to reduce the error of intra prediction. That is, filtered reference samples can be obtained by performing filtering on surrounding samples and/or reference samples obtained through a reference sample padding process. The intra prediction unit predicts samples of the current block using the reference samples obtained in this way. The intra prediction unit predicts samples of the current block using unfiltered or filtered reference samples.
  • peripheral samples may include samples on at least one reference line. For example, neighboring samples may include adjacent samples on a line adjacent to the boundary of the current block.
  • Intra prediction mode information indicating the intra prediction direction may be signaled.
  • Intra prediction mode information indicates one of a plurality of intra prediction modes constituting an intra prediction mode set. If the current block is an intra prediction block, the decoder receives intra prediction mode information of the current block from the bitstream. The intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.
  • the intra prediction mode set may include all intra prediction modes used for intra prediction (eg, a total of 67 intra prediction modes). More specifically, the intra prediction mode set may include a planar mode, a DC mode, and multiple (e.g., 65) angular modes (i.e., directional modes). Each intra prediction mode may be indicated through a preset index (i.e., intra prediction mode index). For example, as shown in FIG. 6, intra prediction mode index 0 indicates planar mode, and intra prediction mode index 1 indicates DC mode. Additionally, intra prediction mode indices 2 to 66 may respectively indicate different angle modes. The angle modes each indicate different angles within a preset angle range.
  • the angle mode may indicate an angle within an angle range between 45 degrees and -135 degrees clockwise (i.e., a first angle range).
  • the angle mode can be defined based on the 12 o'clock direction.
  • intra prediction mode index 2 indicates horizontal diagonal (HDIA) mode
  • intra prediction mode index 18 indicates horizontal (HORizontal, HOR) mode
  • intra prediction mode index 34 indicates diagonal (DIA) mode.
  • the mode is indicated, and intra prediction mode index 50 indicates vertical (VER) mode, and intra prediction mode index 66 indicates vertical diagonal (VDIA) mode.
  • the preset angle range may be set differently depending on the shape of the current block. For example, if the current block is a rectangular block, a wide-angle mode indicating an angle exceeding 45 degrees or less than -135 degrees clockwise may be additionally used. If the current block is a horizontal block, the angle mode may indicate an angle within an angle range (i.e., a second angle range) between (45+offset1) degrees and (-135+offset1) degrees in a clockwise direction. At this time, angle modes 67 to 76 outside the first angle range may be additionally used.
  • an angle range i.e., a second angle range
  • the angle mode may indicate an angle within an angle range between (45-offset2) degrees and (-135-offset2) degrees clockwise (i.e., a third angle range).
  • angle modes -10 to -1 outside the first angle range may be additionally used.
  • the values of offset1 and offset2 may be determined differently depending on the ratio between the width and height of the rectangular block. Additionally, offset1 and offset2 can be positive numbers.
  • the plurality of angle modes constituting the intra prediction mode set may include a basic angle mode and an extended angle mode.
  • the extended angle mode may be determined based on the basic angle mode.
  • the basic angle mode corresponds to the angle used in intra prediction of the existing HEVC (High Efficiency Video Coding) standard
  • the extended angle mode corresponds to the angle newly added in intra prediction of the next-generation video codec standard. It may be a mode that does this. More specifically, the default angle mode is the intra prediction mode ⁇ 2, 4, 6,... , 66 ⁇ , and the extended angle mode is the intra prediction mode ⁇ 3, 5, 7,... , 65 ⁇ may be an angle mode corresponding to one of the following. That is, the extended angle mode may be an angle mode between basic angle modes within the first angle range. Accordingly, the angle indicated by the extended angle mode can be determined based on the angle indicated by the basic angle mode.
  • the basic angle mode may be a mode corresponding to an angle within a preset first angle range
  • the extended angle mode may be a wide angle mode outside the first angle range. That is, the default angle mode is the intra prediction mode ⁇ 2, 3, 4, ... , 66 ⁇ , and the extended angle mode is the intra prediction mode ⁇ -14, -13, -12,... , -1 ⁇ and ⁇ 67, 68, ... , 80 ⁇ may be an angle mode corresponding to one of the following.
  • the angle indicated by the extended angle mode may be determined as the angle opposite to the angle indicated by the corresponding basic angle mode. Accordingly, the angle indicated by the extended angle mode can be determined based on the angle indicated by the basic angle mode.
  • the number of expansion angle modes is not limited to this, and additional expansion angles may be defined depending on the size and/or shape of the current block.
  • the total number of intra prediction modes included in the intra prediction mode set may vary depending on the configuration of the basic angle mode and extended angle mode described above.
  • the spacing between extended angle modes may be set based on the spacing between corresponding basic angle modes.
  • the extended angle modes ⁇ 3, 5, 7, ... , 65 ⁇ are the corresponding fundamental angular modes ⁇ 2, 4, 6, ... , 66 ⁇ can be determined based on the interval between them.
  • the extended angle modes ⁇ -14, -13, ... , -1 ⁇ are the corresponding opposite fundamental angular modes ⁇ 53, 53,... , 66 ⁇ is determined based on the spacing between the extended angle modes ⁇ 67, 68,... , 80 ⁇ are the corresponding opposite fundamental angular modes ⁇ 2, 3, 4, ... , 15 ⁇ can be determined based on the interval between them.
  • the angular spacing between the extended angle modes may be set to be equal to the angular spacing between the corresponding basic angle modes.
  • the number of extended angle modes in the intra prediction mode set may be set to less than the number of basic angle modes.
  • the extended angle mode may be signaled based on the basic angle mode.
  • a wide angle mode i.e., extended angle mode
  • the basic angle mode that is replaced may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the basic angle mode that is replaced is an angle mode that corresponds to an angle in the opposite direction of the angle indicated by the wide-angle mode or to an angle that differs from the angle in the opposite direction by a preset offset index.
  • the preset offset index is 1.
  • the intra-prediction mode index corresponding to the replaced basic angle mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode.
  • wide angle mode ⁇ -14, -13, ... , -1 ⁇ is the intra prediction mode index ⁇ 52, 53, ... , 66 ⁇ , respectively
  • the wide-angle mode ⁇ 67, 68, ... , 80 ⁇ is the intra prediction mode index ⁇ 2, 3, ... , 15 ⁇ can be signaled respectively.
  • the intra prediction mode index for the basic angle mode signals the extended angle mode, so that even if the configurations of the angle modes used for intra prediction of each block are different, the same set of intra prediction mode indexes are used for signaling of the intra prediction mode. can be used Accordingly, signaling overhead due to changes in intra prediction mode configuration can be minimized.
  • whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block.
  • the extended angle mode may be used for intra prediction of the current block, otherwise, only the basic angle mode may be used for intra prediction of the current block.
  • the extended angle mode may be used for intra prediction of the current block, and if the current block is a square block, only the basic angle mode may be used for intra prediction of the current block.
  • the intra prediction unit determines reference samples and/or interpolated reference samples to be used for intra prediction of the current block, based on intra prediction mode information of the current block.
  • the intra prediction mode index indicates a specific angle mode
  • a reference sample or an interpolated reference sample corresponding to the specific angle from the current sample of the current block is used for prediction of the current pixel. Accordingly, different sets of reference samples and/or interpolated reference samples may be used for intra prediction depending on the intra prediction mode.
  • the decoder restores the sample values of the current block by adding the residual signal of the current block obtained from the inverse transformer to the intra prediction value of the current block. .
  • Movement (motion) information used for inter prediction may include reference direction indication information (inter_pred_idc), reference picture indices (ref_idx_l0, ref_idx_l1), and motion (motion) vectors (mvL0, mvL1).
  • Reference picture list utilization information (predFlagL0, predFlagL1) may be set according to the reference direction indication information.
  • the coding unit may be divided into several sub-blocks, and the prediction information of each sub-block may be the same or different.
  • the intra prediction mode of each subblock may be the same or different from each other.
  • the motion information of each sub-block may be the same or different.
  • each sub-block may be encoded or decoded independently from each other.
  • Each sub-block can be distinguished through a sub-block index (sbIdx).
  • the motion vector of the current block is likely to be similar to the motion vector of neighboring blocks. Therefore, the motion vector of the neighboring block can be used as a motion vector predictor (mvp), and the motion vector of the current block can be derived using the motion vector of the neighboring block. Additionally, in order to increase the accuracy of the motion vector, the motion vector difference (mvd) between the optimal motion vector of the current block found in the original image by the encoder and the motion prediction value may be signaled.
  • mvp motion vector predictor
  • mvd motion vector difference between the optimal motion vector of the current block found in the original image by the encoder and the motion prediction value
  • the motion vector may have various resolutions, and the resolution of the motion vector may vary on a block basis.
  • Motion vector resolution can be expressed in integer units, half-pixel units, 1/4 pixel units, 1/16 pixel units, integer pixel units of 4, etc. Since images such as screen content are in the form of simple graphics such as text, there is no need to apply an interpolation filter, so integer units and integer pixel units of 4 can be selectively applied on a block basis.
  • Blocks encoded in affine mode which can express rotation and scale, have significant changes in shape, so integer units, 1/4 pixel units, and 1/16 pixel units can be selectively applied on a block basis.
  • Information on whether to selectively apply motion vector resolution on a block basis is signaled with amvr_flag. If applied, which motion vector resolution to apply to the current block is signaled with amvr_precision_idx.
  • the weights between the two prediction blocks can be applied the same or different, and information about the weights is signaled through bcw_idx.
  • the Merge method is a method that configures the motion information of the current block to be the same as the motion information of neighboring blocks adjacent to the current block.
  • the Merge method has the advantage of increasing the coding efficiency of motion information by spatially propagating motion information without change in a motion region with homogeneity.
  • the AMVP method is a method that predicts motion information in the L0 and L1 prediction directions respectively and signals the most optimal motion information in order to express accurate motion information.
  • the decoder derives motion information for the current block through the AMVP or Merge method and then uses the reference block located in the motion information derived from the reference picture as a prediction block for the current block.
  • a method of deriving motion information in Merge or AMVP may be a method in which a motion candidate list is constructed using motion prediction values derived from neighboring blocks of the current block, and then index information for the optimal motion candidate is signaled.
  • AMVP since motion candidate lists are derived for each of L0 and L1, the optimal motion candidate indices (mvp_l0_flag, mvp_l1_flag) for each of L0 and L1 are signaled.
  • one merge index (merge_idx) is signaled.
  • the motion candidate list derived from one coding unit may vary, and a motion candidate index or merge index may be signaled for each motion candidate list. At this time, a mode in which there is no information about the remaining blocks in blocks encoded in Merge mode can be called Merge Skip mode.
  • motion candidate and motion information candidate may have the same meaning. Additionally, the motion candidate list and the motion information candidate list in this specification may have the same meaning.
  • SMVD Symmetric MVD
  • MVD Motion Vector Difference
  • OBMC Overlapped Block Motion Compensation
  • the MMVD method is a method of correcting motion information using one candidate selected from among several motion difference value candidates.
  • Information about the correction value of motion information obtained through the MMVD method may be included in the bitstream and transmitted to the decoder.
  • the amount of bits can be saved by including information on the correction value of the motion information in the bitstream.
  • the TM (Template Matching) method is a method of compensating motion information by constructing a template using surrounding pixels of the current block and finding a matching area with the highest similarity to the template.
  • Template matching (TM) is a method of performing motion prediction in a decoder without including motion information in the bitstream in order to reduce the size of the encoded bitstream. At this time, since the decoder does not have the original image, it can roughly derive motion information for the current block using already restored neighboring blocks.
  • the DMVR (Decoder-side Motion Vector Refinement) method is a method of correcting motion information through the correlation of already restored reference images in order to find more accurate motion information. It uses the bidirectional motion information of the current block to compare the two reference pictures. This is a method of using the point with the best matching between reference blocks in a reference picture within a certain area as a new bidirectional movement.
  • the encoder corrects the motion information by performing DMVR in one block unit, then divides the block into sub-blocks and performs DMVR in each sub-block unit to correct the motion information of the sub-block again. This can be done, and this can be called MP-DMVR (Multi-pass DMVR).
  • the LIC (Local Illumination Compensation) method is a method of compensating for luminance changes between blocks. It derives a linear model using surrounding pixels adjacent to the current block, and then compensates for the luminance information of the current block through the linear model.
  • BDOF Bi-Directional Optical Flow
  • the motion of the current block can be corrected using motion information derived from the BDOF of this VVC.
  • PROF Prediction refinement with optical flow
  • PROF is a technology to improve the accuracy of sub-block-level affine motion prediction to be similar to the accuracy of pixel-level motion prediction.
  • PROF similar to BDOF, is a technology that obtains the final prediction signal by calculating correction values in pixel units for affine motion compensated pixel values in sub-block units based on optical flow.
  • the CIIP (Combined Inter-/Intra-picture Prediction) method When generating a prediction block for the current block, the CIIP (Combined Inter-/Intra-picture Prediction) method performs a weighted average of the prediction blocks generated by the intra-picture prediction method and the prediction blocks generated by the inter-picture prediction method to create the final prediction block. This is a method to create .
  • the IBC (Intra Block Copy) method is a method that finds the part most similar to the current block in an already reconstructed area in the current picture and uses the corresponding reference block as a prediction block for the current block. At this time, information related to the block vector, which is the distance between the current block and the reference block, may be included in the bitstream.
  • the decoder can calculate or set the block vector for the current block by parsing information related to the block vector contained in Paintstream.
  • the BCW (Bi-prediction with CU-level Weights) method does not generate a prediction block by averaging two prediction blocks that have been motion-compensated from different reference pictures, but applies weights adaptively on a block-by-block basis to compensate for motion. This is a method of performing a weighted average on two prediction blocks.
  • a video signal processing device constructs a reference template using pixel values of neighboring blocks adjacent to the current block, and finds the part most similar to the constructed reference template in the already restored area within the current picture. Afterwards, this is a method of using the reference block (part already found in the restored area) as a prediction block for the current block.
  • the MHP (Multi-hypothesis prediction) method is a method of performing weight prediction using various prediction signals by transmitting additional motion information to unidirectional and bidirectional motion information when predicting between screens.
  • CCLM Cross-component linear model
  • MMLM Multi-model Linear mode
  • the restored coefficients t' k for input coefficients t k depend only on the associated quantization index q k . That is, the quantization index for any restored coefficient has a different value from the quantization indexes for other restored coefficients.
  • t' k may be a value including the quantization error at t k and may be different or the same depending on the quantization parameter.
  • t'k may be named a restored transform coefficient or a dequantized transform coefficient
  • the quantization index may be named a quantized transform coefficient.
  • the reconstructed coefficients have the characteristic of being arranged at equal intervals.
  • the distance between two adjacent restored values can be referred to as the quantization step size.
  • the restored values may include 0, and the entire set of available restored values may be uniquely defined depending on the quantization step size.
  • the quantization step size may vary depending on the quantization parameter.
  • the set of allowable restored transform coefficients decreases due to quantization, and the number of elements of this set may be finite. Because of this, there is a limit to minimizing the average error between the original image and the restored image.
  • Vector quantization can be used as a method to minimize this average error.
  • a simple form of vector quantization method used in video encoding is sign data hiding. This is a method in which the encoder does not encode the sign of one non-zero coefficient, and the decoder determines the sign for the corresponding coefficient depending on whether the sum of the absolute values of all coefficients is even or odd. To this end, at least one coefficient may be increased or decreased by '1' in the encoder, and at least one coefficient is selected to be optimal in terms of cost for rate-distortion, so that the value is It can be adjusted. As an example embodiment, a coefficient having a value close to the boundary of the quantization interval may be selected.
  • Trellis-Coded Quantization Another vector quantization method is Trellis-Coded Quantization, and in video coding, it is used as an optimal path search technique to obtain an optimized quantization value in dependent quantization.
  • quantization candidates for all coefficients within a block are placed in a trellis graph, and the optimal trellis path between optimized quantization candidates is determined considering the cost of rate-distortion. and explore.
  • dependent quantization applied to video encoding may be designed such that the set of allowable restored transform coefficients for a transform coefficient depends on the value of the transform coefficient that precedes the current transform coefficient in reconstruction order. At this time, by selectively using multiple quantizers according to the transformation coefficient, the average error between the original image and the restored image is minimized, thereby increasing coding efficiency.
  • the MIP (Matrix Intra Prediction) method is a matrix-based intra prediction method. Unlike prediction methods that have directionality from pixels of neighboring blocks adjacent to the current block, pixels on the left and top of neighboring blocks are used in a predefined matrix ( This is a method of obtaining a prediction signal using a matrix) and an offset value.
  • the matrix may be a matrix vector.
  • the intra prediction mode for the template derived through the surrounding pixels of the template is used to restore the current block. It can be used for.
  • the decoder can generate a prediction template for the template using surrounding pixels (references) adjacent to the template, and use the intra prediction mode, which generates a prediction template most similar to the already restored template, to restore the current block. This method can be called TIMD (Template intra mode derivation).
  • an encoder can determine a prediction mode for generating a prediction block and generate a bitstream containing information about the determined prediction mode.
  • the decoder can set the intra prediction mode by parsing the received bitstream.
  • the bit amount of information about the prediction mode may be about 10% of the total bitstream size.
  • the encoder may not include information about the intra prediction mode in the bitstream. Accordingly, the decoder can derive (determine) an intra prediction mode for restoration of the current block using the characteristics of the surrounding blocks, and can restore the current block using the derived intra prediction mode.
  • the decoder infers directionality information by applying a Sobel filter horizontally and vertically to each surrounding pixel (pixel) adjacent to the current block to derive the intra prediction mode, and then converts the directionality information into the intra prediction mode.
  • a mapping method can be used.
  • the method by which the decoder derives an intra prediction mode using neighboring blocks can be described as DIMD (Decoder side intra mode derivation).
  • Figure 7 is a diagram showing the positions of neighboring blocks used to construct a motion candidate list in inter prediction.
  • Surrounding blocks may be blocks in a spatial location or blocks in a temporal location. Surrounding blocks that are spatially adjacent to the current block are Left (A1) block, Left Below (A0) block, Above (B1) block, Above Right (B0) block, or Above Left. , B2) It can be at least one of the blocks.
  • the neighboring block temporally adjacent to the current block may be a block containing the upper left pixel position of the bottom right (BR) block of the current block in the corresponding picture (Collocated picture).
  • TMVP Temporal Motion Vector Predictor
  • sbTMVP sub-block Temporal Motion Vector Predictor
  • slice type information e.g., whether it is an I slice, a P slice, or a B slice
  • slice type information e.g., whether it is an I slice, a P slice, or a B slice
  • whether it is a tile whether it is a subpicture
  • the size of the current block the depth of the coding unit, and the current block. It may be determined based on at least one of information about whether it is a luminance block or a chrominance block, whether it is a reference frame or a non-reference frame, reference order, and temporal hierarchy according to the hierarchy.
  • Information used to determine whether the methods described in this specification will be applied may be information previously agreed upon between the decoder and the encoder. Additionally, this information may be determined according to profile and level.
  • This information can be expressed as variable values, and the bitstream can include information about variable values. That is, the decoder can determine whether the above-described methods are applied by parsing information about variable values included in the bitstream. For example, it may be determined whether the above-described methods will be applied based on the horizontal or vertical length of the coding unit. If the horizontal or vertical length is 32 or more (e.g., 32, 64, 128, etc.), the above-described methods can be applied. Additionally, the above-described methods can be applied when the horizontal or vertical length is less than 32 (e.g., 2, 4, 8, 16). Additionally, the above-described methods can be applied when the horizontal or vertical length is 4 or 8.
  • Figure 8 is a diagram showing the type of conversion kernel according to an embodiment of the present specification.
  • Figure 8 shows the definition of the conversion kernel used in MTS, and the formula (basis function) of the DCT-II, DCT-V, DCT-VIII, DST-I, DST-VII, and DST-IV kernels function)).
  • DCT-II is referred to as DCT-2 (DCT2)
  • DCT-V is referred to as DCT-5 (DCT5)
  • DCT-VIII is referred to as DCT-8 (DCT8)
  • DST-I is referred to as DST-1 (DST1).
  • DST-VII can be described as DST-7 (DST7)
  • DST-IV can be described as DST-4 (DST4).
  • DCT and DST can be expressed as functions of cosine and sine, respectively.
  • index i is the index in the frequency domain.
  • index j represents the index within the basis function. That is, as i becomes smaller, it represents a low-frequency basis function, and as i becomes larger, it represents a high-frequency basis function.
  • the basis function T i (j) can represent the j th element of the i th row, and since the transformation kernels shown in Figure 8 all have separable characteristics, the horizontal Transformation can be performed separately in the direction and vertical direction. That is, when the residual signal block is X and the transformation kernel matrix is T, the transformation for the residual signal X can be expressed as TXT'. At this time, T' means the transpose of the transformation kernel matrix T.
  • the values of the transformation matrix defined by the basis function shown in FIG. 8 may be in decimal form rather than integer form. Accordingly, it may be difficult to implement decimal values in hardware in a video encoding device and decoding device. Therefore, an integer-approximated transform kernel from an original transform kernel containing decimal-type values can be used for encoding and decoding of a video signal.
  • An approximated transformation kernel containing values in integer form can be generated through scaling and rounding for the circular transformation kernel.
  • the integer value included in the approximated conversion kernel may be a value within a range that can be expressed with a preset number of bits. The preset number of bits may be 8-bit or 10-bit.
  • the orthonormal properties of DCT and DST may not be maintained. However, since the resulting loss in encoding efficiency is not significant, it may be advantageous in terms of hardware implementation to approximate the conversion kernel in an integer form.
  • IDTR Identity Transform
  • identity transformation constructs a transformation matrix by setting '1' at the position where the row and column have the same value.
  • the identity transformation uses a fixed value other than '1' to equally increase or decrease the value of the input residual signal.
  • Figure 9 is a diagram showing the 0th (lowest frequency component of the corresponding transformation kernel) basis function of DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII transformation according to an embodiment of the present specification.
  • DST-VII shows a tendency for the signal to increase as the index j increases, so like intra-screen prediction, the distance in the horizontal and vertical directions within the residual signal block is long based on the upper left coordinate of the block. It can be efficient for a pattern of the residual signal in which the energy of the residual signal increases as the number increases.
  • the signal size decreases as the index j increases, so the energy of the residual signal increases as the distance in the horizontal and vertical directions increases based on the upper left coordinate of the block within the residual signal block. It can be efficient for patterns of residual signals that decrease.
  • the signal increases as the index j within the basis function increases, and then the size of the signal decreases starting from a specific index. Therefore, it can be efficient for a residual signal pattern in which the energy of the residual signal increases as it moves to the center of the residual block.
  • the 0th basis function represents DC, and can be efficient for patterns of residual signals where the pixel value distribution within the residual block is uniform, such as inter-screen prediction.
  • DCT-V it is similar to DCT-II, but since the value when j is 0 has a smaller value than the value when j is not 0, it has a signal model in which a straight line is bent when j is 1.
  • multiple transform selection (MTS) technology is a transform coding method that can improve coding efficiency by adaptively selecting a transform kernel according to the prediction mode.
  • DCT2 can be used as a basic conversion kernel for restoration of the current block. Meanwhile, if DCT2 is not used, the remaining kernels (eg, DCT8, DST7, DCT5, DST4, DST1) can be used. If DCT2 is not used, some of the preset combinations for the remaining kernels can be used. Table 1 shows the combination of kernels excluding DCT2 and IDTR among the conversion kernels disclosed in FIG. 8. That is, Table 1 shows a combination of five types of kernels (DCT8, DST7, DCT5, DST4, and DST1). Specifically, Table 1 shows 25 combinations that can be formed by combining two transformation kernels as a pair (combination). A video signal processing device (e.g., decoder, encoder) can use any one of the 25 combinations in Table 1 as a transformation kernel for the horizontal or vertical direction of the current block. Meanwhile, IDTR can be used only when certain conditions are met.
  • FIGS. 10 and 11 are diagrams showing a transformation kernel set according to an embodiment of the present specification.
  • the transform kernel used in the intra prediction mode may be determined based on the intra prediction mode and the size of the current block (eg, coding block, transform block).
  • Figure 10 may represent a set of transformation kernels for MIP.
  • 101 in FIG. 10 represents the type of intra prediction mode (i.e., an index indicating the intra prediction mode), and 102 represents the size (i.e., width x height) of the current block (e.g., coding block, transform block).
  • the transform kernel for the current block may be determined based on the transform kernel set corresponding to index 0. Referring to FIG.
  • the transformation kernel set corresponding to index 0 may be T0 ⁇ 18, 24, 17, 23, 8, 12 ⁇ .
  • the video signal processing device can restore the current block based on the transform kernel (sub-transform kernel set) included in the transform kernel set corresponding to any one index of T0.
  • Figure 11(a) shows a transformation kernel set consisting of indices corresponding to six transformation kernels.
  • Figure 11(a) is a diagram showing a portion of a set of 80 transformation kernels consisting of indices corresponding to 6 transformation kernels.
  • each index constituting the transformation kernel set in FIG. 11(a) may correspond to any one of the transformation kernel combinations (sub-transformation kernel sets) in Table 1.
  • each of the 25 combinations in Table 1 may be indexed from 0 to 24, and the combination of Table 1 may correspond to an index included in any one transformation kernel set of FIG. 11.
  • the transform kernel set in 11(a) can be determined based on the size of the current block (coding block, transform block) and the intra prediction mode of the current block.
  • FIG. 11(b) is a diagram showing the first transformation kernel set (T0) among the transformation kernel sets of FIG. 11(a).
  • Indexes of the conversion kernel set may be grouped into a plurality of groups based on preset appointments. That is, the number of indices of the grouped transformation kernel set can be set adaptively. At this time, the group may consist of three or more.
  • the indices of the transformation kernel set may be grouped based on a plurality of reference values (eg, a first reference value and a second reference value).
  • the grouping value is less than or equal to the first reference value, a group containing one index (18) is selected, and if the grouping value is greater than the first reference value and less than or equal to the second reference value, four indices (18) are selected. A group containing 18, 2, 17, 23) is selected, and if the grouping value is greater than the second reference value, a group containing 6 indices (18, 24, 17, 23, 8, 12) can be selected. there is. If the grouping value is compared with the reference value and the corresponding group is selected according to the preset settings, there may be an effect of reducing complexity compared to when one of the six indexes (conversion kernels) for the current block is signaled/parsed.
  • the reference value may be the sum of transformation coefficients, and the first reference value and the second reference value may be determined based on the sum of the transformation coefficients. For example, the first reference value may be 6 and the second reference value may be 32.
  • Separate signaling may be required to indicate the index included in the group selected by comparing the reference value and the grouping value.
  • the selected group when the grouping value is greater than the first reference value and less than or equal to the second reference value, the selected group may be a group composed of indices of (18, 24, 17, 23). . At this time, separate signaling may be required to indicate each of the four indices.
  • the selected group if the grouping value is greater than the second reference value, the selected group may be a group composed of indices of (18, 24, 17, 23, 8, 12). At this time, separate signaling (mts_idx) may be required to indicate each of the six indices.
  • the index within the conversion kernel set may be indicated by the mts_idx described above.
  • mts_idx may have a fixed bit size.
  • mts_idx for 6 indices may have a size of 3 bits.
  • mts_idx may be signaled using the truncated unary binarization (TB) method.
  • TB truncated unary binarization
  • mts_idx is coded using the TB method, and context model-based CABAC coding can be applied to the first bin and TB-based CABAC coding can be applied to the remaining bins.
  • the selected group when the grouping value is equal to or smaller than the first reference value, the selected group may be a group composed of the index of (18). At this time, since the group consists of only one index, separate signaling to indicate one index may not be necessary.
  • FIG. 12 is a diagram illustrating a process for restoring a residual signal according to an embodiment of the present specification.
  • the residual signal which is the difference between the original signal and the predicted signal, has the characteristic that the energy distribution of the signal changes depending on the prediction method. Therefore, if the transformation kernel is adaptively selected according to the prediction method, such as MTS, coding efficiency can be improved. Additionally, if transformation using only the MTS or DCT2 kernel is referred to as primary transformation, the video signal processing device may improve coding efficiency by additionally performing secondary transformation on the primary transformed coefficient block. Secondary transformation is particularly effective in terms of energy compaction for predicted residual signal blocks within a screen, where strong energy is likely to exist in a direction other than the horizontal or vertical direction of the residual signal block.
  • a video signal processing device can parse syntax elements related to a residual signal included in a bitstream and restore quantization coefficients through inverse binarization based on the parsing result.
  • a video signal processing device may obtain a transform coefficient by performing inverse quantization on the restored quantization coefficient.
  • the video signal processing device can restore the residual signal block by performing inverse transformation on the transform coefficient.
  • inverse transformation can be applied to blocks to which transform skip (TS) is not applied.
  • the video signal processing device may perform inverse transformation in the order of secondary inverse transformation and first order inverse transformation.
  • the secondary inverse transform may be omitted. For example, if the current block is encoded in inter prediction mode, the secondary inverse transform may be omitted. Additionally, the secondary inverse transform may be omitted depending on the size of the current block.
  • the restored residual signal contains quantization error, and secondary transformation can reduce the quantization error by changing the energy distribution of the residual signal compared to when only primary transformation is performed.
  • Figure 13 is a diagram showing the ROI (Region-Of-Interest) of a block to which secondary transformation has been applied according to an embodiment of the present specification.
  • the number indicated in the subblock in FIG. 13 may be a subblock index
  • the subblock index may be a scan order and may be scanned in order from small to large numbers.
  • FIG. 13(a) shows the ROI of LFNST4.
  • the ROI of LFNST4 may be the ROI for a transformation block of size 4 x N or N x 4. At this time, N may be an integer between 4 and 128.
  • the ROI of LFNST4 may be an ROI in a 16 x 4 block composed of 4 subblocks (subblocks 0 to 3). At this time, the ROI is one subblock with a size of 4 x 4, and referring to FIG. 13(a), the ROI corresponds to subblock 0.
  • the number of input samples of ROI may be 16.
  • the forward transformation matrix of LFNST4 may be R x 16. At this time, R may be 4, 8, 16, etc. For example, if R is 16, there may be 16 conversion coefficients generated after conversion.
  • FIG. 13(b) shows the ROI of LFNST8.
  • the ROI of LFNST8 may be the ROI for a transform block of size 8 x N or N x 8. At this time, N may be an integer between 8 and 128.
  • the ROI of LFNST8 may be an ROI in a 16 x 8 block composed of 8 subblocks (subblocks 0 to 7). At this time, the ROI may be an area corresponding to four subblocks of 4 x 4 size, and referring to FIG. 13(b), the ROI corresponds to subblocks 0, 1, 2, and 3.
  • the number of input samples of ROI may be 64.
  • the forward transformation matrix of LFNST8 may be R x 64. At this time, R may be 8, 16, 32, 64, etc. For example, if R is 32, there may be 32 conversion coefficients generated after conversion.
  • FIG. 13(c) shows the ROI of LFNST16.
  • the ROI of LFNST8 may be the ROI for a transform block of size 16 x N or N x 16. At this time, N may be an integer between 16 and 128.
  • the ROI of LFNST16 may be an ROI in a 16 x 16 block composed of 16 subblocks (subblocks 0 to 15). At this time, the ROI may be an area corresponding to six subblocks of 4 x 4 size.
  • the ROI corresponds to subblocks 0, 1, 2, 3, 4, and 5.
  • the number of input samples of ROI may be 96.
  • the forward transformation matrix of LFNST16 may be R x 96. At this time, R may be 8, 16, 32, 64, 96, etc. For example, if R is 32, there may be 32 conversion coefficients generated after conversion.
  • Figure 14 is a diagram showing a method of applying quadratic transformation (LFNST) according to an embodiment of the present specification.
  • the secondary transformation can be expressed as the product of the matrix of the secondary transformation kernel and the first transformed coefficient vector. In other words, it can be interpreted as mapping the primary transformed coefficients to another space.
  • the number of coefficients to be secondary transformed is reduced, that is, if the number of basis vectors constituting the secondary transformation kernel is reduced, the amount of computation required for the secondary transformation and the memory capacity required to store the transformation kernel can be reduced.
  • the size is 32 x 96.
  • a secondary transformation kernel of can be applied, and an inverse secondary transformation kernel of size 96x32 can be applied.
  • the encoder can perform forward primary transform on the residual signal block to obtain a primary transformed coefficient block.
  • the residual signal may be a signal obtained through intra prediction.
  • the size of the first converted coefficient block may be M x N.
  • the encoder can perform forward primary transformation on the residual signal block with a min(M,N) value of 16 to obtain a primary transformed coefficient block.
  • the encoder may perform 32 x 96 secondary transformation (LFNST) on samples in the upper left ROI area of the primary transformed coefficient block (subblocks 0 to 5 in FIG. 23).
  • the encoder can obtain a first-order transformed coefficient block by performing forward primary transformation on the residual signal block whose Min(M,N) value is 8.
  • the encoder may perform secondary transformation on samples in the upper left ROI area of the primary transformed coefficient block.
  • transform coefficients of the entire transform block size including secondary transform coefficients may be quantized, and information about the quantized transform coefficients may be included in the bitstream.
  • the bitstream may include a syntax element (lfnst_idx) related to secondary conversion.
  • the bitstream may include information indicating whether secondary transformation is applied to the current block and the transformation kernel.
  • the decoder can parse quantized transform coefficients from the bitstream and obtain the transform coefficients through de-quantization.
  • the decoder can determine whether to perform an inverse secondary transform (Inverse LFNST) on the current transform block based on syntax elements related to the secondary transform.
  • an inverse quadratic transform is applied to the current transform block, 16 or 32 transform coefficients can be input to the inverse quadratic transform, depending on the size of the transform block.
  • the number of transform coefficients that are input to the inverse secondary transform may be the same as the number of transform coefficients obtained by the encoder performing the secondary transform.
  • the decoder can obtain the first-order transformed coefficient through the product of the vectorized transform coefficient and the inverse second-order transform kernel matrix.
  • the inverse secondary transform kernel may be determined based on the size of the transform block, intra prediction mode, and syntax elements indicating the transform kernel.
  • the inverse quadratic transformation kernel matrix may be the transpose matrix of the quadratic transformation kernel matrix, and considering the complexity of implementation, the elements of the kernel matrix may be integers expressed with 10-bit or 8-bit accuracy. Since the first-order transformation coefficient obtained through the inverse second-order transformation is in the form of a vector, it can be expressed as two-dimensional data. The first-order transform coefficient may be dependent on the intra prediction mode. A mapping relationship based on the intra prediction mode applied by the encoder can be equally applied.
  • the decoder can obtain a residual signal by performing an inverse primary transform on a transform coefficient block of the entire transform block size including transform coefficients obtained by performing an inverse secondary transform.
  • the process described with reference to FIG. 14 may include a scaling process using a bit shift operation.
  • Figure 15 is a diagram showing the mapping relationship between an intra prediction mode and a transformation kernel set for secondary transformation according to an embodiment of the present specification.
  • the transform kernel set for LFNST applied to the transform block can be determined for each intra prediction mode of the transform block.
  • One transformation kernel set may be composed of multiple LFNST kernels.
  • one transformation kernel set may consist of three or four LFNST kernels.
  • There may be 35 transformation kernel sets, and each transformation kernel set may be indexed with an index of 0 to 34.
  • Intra prediction mode indices -14 to -1 and 67 to 80 corresponding to the extended angle mode can be mapped to the transformation kernel set of index 2.
  • Figure 16 is a diagram showing the process of generating a prediction block using DIMD according to an embodiment of the present invention.
  • the decoder can derive a prediction block using surrounding samples (blocks, pixels).
  • the neighboring sample may be a neighboring block (pixel) of the current block.
  • the decoder can determine intra prediction modes and weight information for restoration of the current block through a histogram for directionality information (angle information) using surrounding samples as input.
  • Figure 17 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
  • Figure 17(a) shows when all neighboring blocks of the current block are available to derive directional information
  • Figure 17(b) shows that the upper boundary of the current block is divided into sub-pictures, slices, and It shows when it is a tile or CTU boundary
  • Figure 17(c) shows when the left boundary of the current block is a sub-picture, slice, tile, or CTU boundary.
  • the neighboring block and the current block do not belong to the same sub-picture, slice, tile, or CTU
  • the neighboring block may not be used to derive directional information.
  • the gray dots in FIG. 17 indicate the positions of pixels used to derive actual directional information
  • the dotted lines indicate sub-picture, slice, tile, and CTU boundaries.
  • FIGS. 17(d) to 17(f) in order to derive directional information, pixels located at the boundary may be padded by one pixel outside the boundary. Through this padding, it may be possible to derive more accurate directional information.
  • a 3x3 Sobel filter of Equation 1 can be applied in the horizontal and vertical directions, respectively.
  • a in Equation 1 may mean pixel information (values) of restored neighboring blocks of the 3x3 current block.
  • the directionality information ( ⁇ ) can be determined using Equation 2.
  • the decoder can derive directional information ( ⁇ ) only by calculating Gy/Gx in Equation 1 without calculating the atan function in Equation 2.
  • directionality information can be calculated for every gray dot shown in FIG. 17, and directionality information can be mapped to an angle in intra prediction mode.
  • the intra prediction mode set may include a planar mode, a DC mode, and a plurality (e.g., 65) angular modes (i.e., direction modes).
  • the intra prediction directional mode described herein may be the same as the angular mode shown in FIG. 6. Additionally, in this specification, a method of deriving intra prediction directionality information and mapping (determining) an intra prediction directionality mode may be described as a DIMD method.
  • Figure 18 is a diagram showing a method for mapping a directional mode according to an embodiment of the present invention.
  • the intra prediction directional mode can be divided into four sections based on 0 degrees (index 18), 45 degrees (index 34), 90 degrees (index 50), and 135 degrees (index 66) (Figure 6).
  • the section for determining the intra prediction directional mode can be divided into four sections from section 0 to section 3.
  • Section 0 can be from -45 degrees to 0 degrees
  • section 1 can be from 0 degrees to 45 degrees
  • section 2 can be from 45 degrees to 90 degrees
  • section 3 can be from 90 degrees to 135 degrees.
  • each section may include 16 intra prediction directional modes.
  • any one of four sections can be determined by comparing the signs and magnitudes of Gx and Gy calculated through Equation 1.
  • section 1 may be selected.
  • the intra prediction directionality mode mapped to each section can be determined through directionality information ( ⁇ ) calculated from Equation 2. Specifically, the decoder expands the value by multiplying the direction information ( ⁇ ) by 2 ⁇ 16. And the decoder can compare the extended value with the numbers in a predefined table to find the value closest to the extended value and determine the intra prediction directionality mode based on the closest value. At this time, the number of predefined table values can be 17.
  • the values of the predefined table may be ⁇ 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536 ⁇ .
  • the difference between predefined table values may be set differently depending on the difference between the angles of the intra prediction directional mode.
  • the difference between predefined table values may be inconsistent with the distance between angles of the intra prediction directional mode.
  • atan has the characteristic that the slope gradually decreases as the input value increases. Therefore, the table defined above must also be set with values taking into account not only the difference between the angles of the intra prediction directional mode but also the nonlinear characteristics of the atan. For example, the difference between the defined table values can be set to gradually decrease. Conversely, the difference between the defined table values can be set to gradually increase.
  • the available intra prediction directionality mode may vary. That is, if the horizontal and vertical lengths of the current block are different, the section for deriving the intra prediction directional mode may vary. In other words, the section for deriving the intra prediction directional mode can be changed based on the horizontal and vertical lengths of the current block (for example, the ratio of the horizontal length to the vertical length, etc.). For example, if the width of the current block is longer than the height, intra prediction modes may be remapped from 67 to 80, and intra prediction modes in the opposite direction may be excluded from 2 to 15.
  • the intra prediction mode ⁇ 3, 4, 5, 6, 7, 8 ⁇ is ⁇ 67, 68, 69, 70, 71, 72 ⁇ can be reset (mapped) respectively.
  • the intra prediction mode may be reset to a value obtained by adding '65' to the intra prediction mode.
  • the intra prediction mode may be reset to the value of the intra prediction mode minus '67'.
  • a histogram can be used to derive an intra prediction directional mode for reconstruction of the current block.
  • the prediction mode for the block without directionality may have the highest cumulative value on the histogram.
  • the prediction mode for a block without directionality can be excluded even if the cumulative value on the histogram is the highest.
  • a gentle area with no gradient or directionality between neighboring pixels may not be used to derive an intra prediction directionality mode.
  • the prediction mode for a block without directionality may be a planar mode or a DC mode.
  • the left neighboring block may not be used to derive directional information, and directional information may be derived using only the upper neighboring block.
  • the decoder can generate a histogram using the G value calculated as in Equation 3 to emphasize directionality. At this time, the histogram may not be based on a frequency in which '1' is added to each intra-prediction directional mode generated, but may be a cumulative value in which the calculated G value is added for each intra-prediction directional mode generated.
  • Figure 19 is a diagram showing a histogram for deriving an intra prediction directional mode according to an embodiment of the present invention.
  • the X-axis of FIG. 19 represents the intra prediction directional mode
  • the Y-axis represents the cumulative value of G values.
  • the decoder may select the intra prediction directionality mode with the largest cumulative G value among the intra prediction directionality modes. In other words, the decoder can select the intra prediction directional mode for the current block based on the accumulated value. Referring to FIG. 19, modeA with the largest cumulative value and modeB with the second largest cumulative value may be selected as the intra prediction directional mode.
  • the decoder can generate a final prediction block by performing a weighted average of the prediction block generated in modeA, the prediction block generated in modeB, and finally the prediction blocks generated in planar mode.
  • the weight of each prediction block can be determined using the accumulated values of modeA and modeB.
  • the weight for a prediction block generated in planar mode may be set to 1/3 of the total weight.
  • the weight for the prediction block generated by modeA can be set to a weight corresponding to the sum of the cumulative values of modeA and modeB divided by the cumulative value of modeA.
  • the weight for the prediction block created with modeB can be determined as the difference between the modeA weight and 1/3 of the total weight from the total weight.
  • the decoder can expand the range of the weight by multiplying the weight for the prediction block generated by modeA by a random value.
  • the weight for the prediction block generated in modeB and the weight for the prediction block generated in planar mode can also be expanded in the same way.
  • 20 to 22 show matrix-based intra prediction according to an embodiment of the present invention.
  • the video signal processing device can predict the current block using bdry top and bdry left (input) and obtain (output) a prediction block (pred).
  • bdry top represents the upper reference samples of the current block and may be W in FIG. 20.
  • bdry left represents left reference samples of the current block and may be H in FIG. 20.
  • the reference sample line may be the one closest to the current block.
  • a video signal processing device may obtain a prediction block of the current block based on reference samples, a matrix, and an offset value.
  • the method of obtaining a prediction block as shown in FIG. 20 may be described as MIP (Matrix based Intra prediction). MIP in this specification may be described as ALWIP (Affine linear weighted intra prediction).
  • Figure 21 is a diagram showing a method of performing matrix-based intra-screen prediction when the size of the current block is 8 x 8.
  • the video signal processing device may perform an averaging process on neighboring reference samples of the current block.
  • the upper reference samples (bdry top ) of the current block can be re-expressed as the average value of a certain group.
  • the video signal processing device may generate 4 new reference samples (bdry top red ) by taking the average of 2 reference samples (bdry top ) from the top 8 reference samples (bdry top) of the current block.
  • the video signal processing device may obtain four new reference samples (bdry left red ) by taking the average of two reference samples (bdry left ) out of the eight left reference samples (bdry left ) of the current block. Accordingly, the video signal processing device can obtain a total of 8 new reference samples. Depending on the size of the current block, the number of reference samples newly generated after the averaging process may be determined. Next, ii) the video signal processing device may perform a matrix vector multiplication process to obtain the prediction block (pred) of the current block.
  • the video signal processing device converts the matrix and offset values required in the matrix-vector multiplication process to obtain the prediction block of the current block into the results of step i) (i.e., each of the four new samples (bdry top red , bdry left red ) and /Or it can be determined based on mode k. Mode k will be described later.
  • step iii) The video signal processing device can perform interpolation. In step ii), the resulting value (predicted block (pred) of the current block) may be mapped to a specified location of the current block.
  • the video signal processing device applies single step linear interpolation in the vertical or horizontal direction, or in the vertical and horizontal direction.
  • the final prediction block can be generated.
  • W may be the width (horizontal) of the current block
  • H may be the height (height) of the current block
  • max(W, H) is a function that outputs the larger value between W and H.
  • the size of the current block is 8 x 8 (see FIG. 21)
  • the video signal processing device can acquire 8 new reference samples.
  • the video signal processing device can obtain 16 new samples by performing a matrix-vector multiplication process.
  • the 16 new samples can be mapped to specific positions in the prediction block of the current block (gray shaded portion 2101 in FIG. 21).
  • reference samples corresponding to the width of the current block may be reference samples generated in an averaging process mapped to a specific position (gray shaded portion 2102 in FIG. 21).
  • the specific position may be an odd number (1st, 3rd, 5th, and 7th positions of 2102 in FIG. 21).
  • Reference samples corresponding to the height of the current block may be the same as reference samples used in the averaging process.
  • the video signal processing device may perform filtering on reference samples used in the linear interpolation process. For example, a video signal processing device may apply upper and lower weights [1, 2, 1] based on the current sample, add them, and perform filtering using the bit shift operator 2.
  • a in Equation 1 is a matrix, and if the width (W) and height (H) of the current block are 4, A may be a 4 x 4 matrix with 4 rows and 4 columns. If at least one of the width (W) and height (H) of the current block is not 4, A may be an 8 x 8 matrix with 8 rows and 8 columns.
  • b is an offset value in vector form, which may be of size W red x H red .
  • Matrix A and vector b can be one of three sets S 0 , S 1 , and S 2 .
  • S 0 may be composed of 18 matrices, and each matrix may be composed of 16 rows and 4 columns, and may have 18 offset vectors.
  • S 1 may be composed of 10 matrices, and each matrix may be composed of 16 rows and 8 columns, and may have 10 offset vectors.
  • S 2 may be composed of 6 matrices, and each matrix may be composed of 64 rows and 8 columns, and may have 6 offset vectors.
  • S 0 , S 1 , and S 2 may be indicated by separate indices (idx). The index can be determined as in Equation 5.
  • W may be the width (horizontal) of the current block
  • H may be the height (vertical) of the current block.
  • max(W, H) is a function that outputs the larger value between W and H.
  • the method for determining the mode k may be as follows.
  • mode k may be for a set of conversion kernels for MIP. mode k may be used to determine the matrix for MIP. Mode k may be determined based on the intra prediction mode (eg, angle mode) and/or the size of the current block. For example, if the intra prediction mode is an angle mode with an index lower than 18 and the width and height of the current block are 4, mode k may be the same mode as the intra prediction mode. If the intra prediction mode is an angle mode with an index equal to or greater than 18, and the width and height of the current block are 4, mode k may be an angle mode corresponding to the index of the intra prediction mode minus 17.
  • the intra prediction mode is an angle mode with an index lower than 18 and the width and height of the current block are 4
  • mode k may be the same mode as the intra prediction mode.
  • mode k may be an angle mode corresponding to the index of the intra prediction mode minus 17.
  • mode k may be the same as the intra prediction mode. If the intra prediction mode is an angle mode with an index equal to or greater than 10, and the larger value of the width and height of the current block is 8, mode k may be an angle mode corresponding to the index of the intra prediction mode minus 9. If the intra prediction mode is an angle mode with an index less than 6, and the larger of the width and height of the current block is greater than 8, mode k may be the same as the intra prediction mode.
  • mode k may be an angle mode corresponding to the index of the intra prediction mode minus 5. . If this is organized into a mathematical equation, it can be the same as equation 6.
  • Figure 22 shows how a video signal processing device performs matrix-based intra prediction when the size of the current block is 4 x 4.
  • the video signal processing device can generate four new reference samples after the averaging process.
  • the video signal processing device may generate two new reference samples (bdry top red ) by taking the average of two of the four upper reference samples (bdry top ) of the current block.
  • the video signal processing device may acquire two new reference samples (bdry left red ) by taking the average of two reference samples (bdry left ) out of the four left reference samples (bdry left ) of the current block. Accordingly, the video signal processing device can obtain a total of four new reference samples.
  • the video signal processing device may perform a matrix vector multiplication process based on the four new reference samples.
  • the video signal processing device may obtain the prediction block of the current block without performing additional linear interpolation (eg, single-step linear interpolation) (skip interpolation). If the size of the current block is 4 x 4, the number of samples in the prediction block of the current block may be 16, which may be the same as the number of samples for the matrix-vector multiplication process.
  • additional linear interpolation eg, single-step linear interpolation
  • Figure 23 is a diagram showing intra template matching according to an embodiment of the present invention.
  • the video signal processing device searches for a template with the highest similarity or lowest cost to the template of the current coding/prediction block within a designated search area within the current frame/slice, and selects a block corresponding to the found template. It can be used as a prediction block for the current block.
  • the designated search area may be four areas (R1, R2, R3, R4) including the current CTU.
  • R1 may be a CTU containing the current coding/prediction block, and may be a CTU neighboring R2, R3, and R4.
  • the size of the CTU may be 32, 64, 128, or 256, and may be square in shape.
  • a video signal processing device may use the Sum of Absolute Transformed Differences (SATD) method to find a template with the lowest cost for templates within a defined search area. Additionally, the video signal processing device may use Hadamard transform for intra-template matching.
  • search area, CTU size, shape, template shape, and size are exemplified for convenience of explanation, but are not limited thereto.
  • Figure 24 is a diagram showing the encoding/decoding process of a signal related to the DIMD method according to an embodiment of the present invention.
  • the video signal processing device can derive ModeA and ModeB described in FIGS. 16 to 19.
  • the first mode and the second mode can be derived by the method described in FIGS. 16 to 19 above.
  • the video signal processing device can generate the final prediction block of the current block by overlapping ModeA, ModeB, and planar mode.
  • ModeA and ModeB can be described as DIMD modes.
  • ModeA and ModeB are angle modes
  • ModeA and ModeB can be converted to wide angle mode based on the size of the current block (eg, coding block, transform block, prediction block). Based on the converted extended angle mode, the video signal processing device may generate a prediction block of the current block.
  • a video signal processing device may perform a conversion process on the residual signal of a prediction block predicted using the DIMD method.
  • the conversion method for the conversion process may be MTS or LFNST.
  • MTS and LFNST are based on intra prediction mode, and a video signal processing device can derive a set of transformation kernels for MTS and LFNST, respectively.
  • Each kernel set may consist of a plurality of kernel candidates.
  • the intra prediction mode derived by the DIMD method may be a mode derived based on surrounding sample information of the current block and may be an angle mode 0 to 67. Accordingly, for the intra prediction mode derived from the DIMD mode, the conversion process to the extended angle mode can be omitted.
  • the video signal processing device can generate prediction blocks of the current block for the intra prediction mode induced in the DIMD mode without conversion to the extended angle mode. Additionally, when deriving an MTS or LFNST transformation kernel set, the video signal processing device may derive an MTS or LFNST transformation kernel set for the intra prediction mode derived in the DIMD mode without conversion to the extended angle mode.
  • Figure 25 is a diagram showing the encoding/decoding process of a signal related to the MIP and/or intra TMP method according to an embodiment of the present invention.
  • the video signal processing device may generate a prediction block of the current block based on the MIP method described with reference to FIGS. 20 to 22.
  • the video signal processing device may generate a prediction block of the current block based on the intra TMP method described with reference to FIG. 23.
  • the video signal processing device may perform a conversion process on the residual signal of the prediction block generated based on either the MIP method or the intra TMP method.
  • the conversion method for the conversion process may be MTS or LFNST.
  • the video signal processing device may derive a set of conversion kernels for each of MTS and LFNST. Each kernel set may consist of a plurality of kernel candidates.
  • the video signal processing device may omit MTS or LFNST or apply a limited set of conversion kernels.
  • the video signal processing device derives DIMD mode to apply MTS or LFNST to the block to which the MIP method or TMP method is applied when the prediction block of the current block is generated without intra prediction mode.
  • the process can be performed.
  • the video signal processing device may derive a transform kernel set of MTS or LFNST based on the derived DIMD mode.
  • the video signal processing device may perform a conversion process to extended angle mode.
  • the intra prediction mode derived by the DIMD method may be a mode derived based on surrounding sample information of the current block and may be an angle mode 0 to 67. Accordingly, for the intra prediction mode derived from the DIMD mode, the conversion process to the extended angle mode can be omitted.
  • a video signal processing device may perform MTS or LFNST transformation on a signal that has undergone inverse quantization.
  • the video signal processing device may derive a DIMD mode before performing MTS or LFNST conversion on a block to which the MIP method or intra TMP method is applied, and may perform MTS or LFNST conversion based on the intra prediction mode derived from the DIMD mode. .
  • the conversion process to extended angle mode can be omitted.
  • a video signal processing device can perform MTS or LFNST conversion on a signal that has undergone inverse quantization.
  • the video signal processing device may derive the DIMD mode before performing MTS or LFNST conversion on a block to which the DIMD method is applied, and may perform MTS or LFNST conversion based on the intra prediction mode derived in the DIMD mode. At this time, the conversion process to extended angle mode can be omitted.
  • a video signal processing device may derive a set of transform kernels for NSPT based on an intra prediction mode derived in DIMD mode. Additionally, the video signal processing device may perform NSPT conversion based on a set of conversion kernels for NSPT.
  • Figure 26 is a diagram showing the relationship between an input vector of secondary transformation and an intra prediction mode according to an embodiment of the present invention.
  • the quadratic transformation can be calculated as the product of the quadratic transformation kernel matrix and the input vector.
  • the video signal processing device may configure the coefficients in the upper left sub-block of the first-order transformed coefficient block in a vector form.
  • Vectors can be configured depending on the intra prediction mode. For example, if the intra prediction mode is a prediction mode corresponding to an index equal to or smaller than index 34 in FIG. 6, or is an INTRA_LT_CCLM, INTRA_T_CCLM, INTRA_L_CCLM mode that predicts chroma samples using the linear relationship of chroma, the video signal processing device
  • the coefficients can be configured in vector form by horizontally scanning the upper left sub-block of the first transformed coefficient block.
  • the element of the i-th row and j-th column of the n x n block at the top left of the first transformed coefficient block can be described as x_ij.
  • the vectorized coefficients are [x_00,x_01, ..., x_0n-1, x_10, x_11, ... , x_1n-1, ..., x_n-10, x_n-11, ..., x_n-1n-1].
  • the intra prediction mode is a prediction mode corresponding to an index greater than index 34 in FIG. 6, the video signal processing device vertically scans the upper left sub-block of the first transformed coefficient block to convert the coefficients in vector form.
  • the vectorized coefficients are [x_00, x_10, ..., x_n-10, x_01, x_11, ..., x_n-11, ..., x_0n-1, x_1n-1, ..., x_n-1n- 1].
  • Secondary transformed coefficients are in vector form, they can be expressed as two-dimensional data. Secondary transformed coefficients according to a preset scan order may be assigned to the upper-left subblock of the transform block.
  • the preset scan order may be an up-right diagonal scan order.
  • Figure 27 is a diagram showing a method of configuring an input vector for secondary transformation according to an embodiment of the present specification.
  • Figure 27 shows a method for using the forward first-order transform coefficient as an input vector for forward LFNST.
  • the method described in FIG. 26 can be applied to use the Forward Primary Transform coefficient as an input vector for the forward LFNST.
  • the ROI of LFNST16 may correspond to six 4 x 4 subblocks (see FIGS. 27(b) and (c)).
  • a total of 96 first-order transform coefficients can be used, and the matrix of the transform kernel of LFNST16 can be 32 x 96.
  • a total of 96 transformation coefficients can be configured in the form of a 96x1 input vector.
  • the current block may be composed of 16 sub-blocks of 4 x 4 size, and each sub-block may be mapped to an index of 0 to 15.
  • the ROI of LFNST16 may be an area corresponding to the subblocks corresponding to indices 0, 4, 8, 1, 5, and 2.
  • a horizontal (horizontal) direction scan order can be used to configure the input vector. That is, the video signal processing device can scan the transform coefficients in the order of subblocks corresponding to indices 0, 1, 2, 4, 5, and 8. In other words, in the horizontal direction of subblocks with consecutive indices 0, 1, and 2, 12 samples in the first row are scanned in order, then 12 samples in the second row are scanned, and then 12 samples in the third row are scanned. can be scanned, and then the 12 samples in the fourth row can be scanned. And, four samples from each of the fifth to eighth rows can be scanned in the horizontal direction of consecutive subblocks with indices 4 and 5.
  • the input vector can be configured according to the scan order in the vertical (vertical) direction as shown in FIG. 27(c). That is, the video signal processing device can configure the input vector by scanning the transform coefficients in the order of subblocks corresponding to 0, 4, 8, 1, 5, and 2.
  • FIG. 28 is a diagram illustrating a process for deriving directionality information of a template of a current block for intra-template matching according to an embodiment of the present invention.
  • the process of deriving the directionality information of the template of the current block for intra-template matching can be applied to each color component (i.e., luma component, chroma (Cb, Cr) component) of the current block.
  • the process of deriving the directionality information of the template of the current block for intra-template matching is applied to only one of the chroma components (Cb or Cr), and the result of the derivation process can be used for the remaining chroma components.
  • the size of the template of the current block for intra template matching may be 4.
  • a video signal processing device can derive intra prediction directionality information by using the method described above in FIGS. 17 and 18 for a template.
  • a video signal processing device can apply a Sobel filter to a 3 x 3 template.
  • the video signal processing device can display the derived intra prediction directionality information (mode) in the form of a histogram and sort it in order of frequency.
  • the video signal processing device may derive intra prediction direction information by using the template of the matching block found through template matching in the search area instead of the current block.
  • Figure 29 is a diagram showing a template form for deriving intra prediction direction information according to an embodiment of the present invention.
  • the method for deriving intra prediction directionality information may be described as a DIMD method.
  • Figure 29(a) shows a template located above the current block for deriving intra prediction direction information.
  • a video signal processing device can derive intra prediction direction information using only the template located above the current block.
  • FIG. 29(b) shows a template located on the left side of the current block for deriving intra prediction direction information.
  • a video signal processing device can derive intra prediction direction information using only the template located on the left side of the current block.
  • Intra prediction direction information derived based on the template shown in FIGS. 28 and 29 can be used in intra prediction mode.
  • the video signal processing device may apply MTS to the intra template matching block based on the intra prediction mode. Additionally, the video signal processing device may apply LFNST to the intra template matching block based on the intra prediction mode.
  • the derived intra prediction direction information can be obtained for each color component.
  • intra prediction directional information can be derived for each luma and chroma.
  • the video signal processing device can derive MTS and LFNST kernel sets for each color component, and can also derive a plurality of kernel sets. At this time, the video signal processing device can derive intra prediction directionality information from only one of the Cb and Cr components. In blocks to which intra block matching is applied, MTS and LFNST may not be used or limited MTS and LFNST may be applied because there is no intra prediction mode information. There may be multiple pieces of intra prediction direction information derived by the video signal processing device.
  • the video signal processing device may determine intra prediction direction information with a large coding gain by applying MTS or LFNST to a plurality of pieces of intra prediction direction information, and may derive a kernel set based on the determined intra prediction direction information. And, the video signal processing device can signal kernel candidates in the derived kernel set.
  • the encoder may generate a bitstream that includes syntax elements mts_idx and/or lfnst_idx that indicate kernel candidates.
  • the decoder may determine a kernel candidate by parsing mts_idx and/or lfnst_idx included in the bitstream.
  • the video signal processing device can derive a set of MTS or LFNST kernels for the one mode with the highest frequency.
  • mts_idx and lfnst_idx can be parsed by color component (e.g., Y, Cb, Cr) or by luma and chroma components.
  • Figure 30 is a diagram showing an MTS set applied to an intra template matching block according to an embodiment of the present invention.
  • the video signal processing device can set and use MTS sets and kernel types for each set for each size of the prediction block of the current block.
  • the block size may be 4x4, 4x8, 4x16, 4x32, 8x4, 8x8, 8x16, 8x32, 16x4, 16x8, 16x16, 16x32, 32x4, 32x8, 32x16, 32x32.
  • the size of the block can be expanded to be larger than 32, for example, when the horizontal or vertical length is 64.
  • a transformation set for an intra template matching block can be set for each block size.
  • the transform set may be an addition to the existing intra-mode and block size-based transform sets.
  • Figure 30(b) shows some of the kernel candidates set for each transformation set.
  • the number of transformation kernel candidates set for each transformation set may be 4 or 6.
  • the transformation kernel candidate may be indicated among the transformation kernel combinations in Table 1 described above.
  • a video signal processing device can find a conversion kernel candidate suitable for intra-template block matching through experimentation.
  • the MTS method based on the inter prediction mode can be applied as the MTS method to be applied to the intra template matching block.
  • the encoder may generate a bitstream containing index information about the optimal transform set for the block to which intra-template matching is applied.
  • the optimal transformation set may be any one of ⁇ (DST7, DST7), (DST7, DCT8), (DCT8, DST7), (DCT8, DCT8) ⁇ .
  • the decoder may determine the transform set for the current block based on the optimal transform set determined by parsing the index information included in the bitstream.
  • Figures 31 and 32 are diagrams showing a syntax structure including a flag indicating whether to apply intra template matching according to an embodiment of the present invention.
  • a flag (syntax element) indicating whether to apply intra template matching to the current block may be included in the coding unit syntax structure.
  • the flag indicating the intra prediction method may be signaled and/or parsed in the order indicating DIMD, BDPCM, Intra TMP, MIP, TIMD, MRL, ISP, and MPM.
  • the video signal processing device may parse and/or signal a flag (cu_dimd_flag) indicating whether to apply DIMD.
  • the video signal processing device may parse and/or signal a flag (intra_bdpcm_luma_flag) indicating whether BDPCM is applied to the luma component when the value of cu_dimd_flag is 0 (when DIMD is not applied).
  • the video signal processing device can parse and/or signal a flag (intra_tmp_flag) indicating whether to apply Intra TMP. there is. Flags after intra_mip_flag may be parsed and/or signaled when the values of cu_dimd_flag, intra_bdpcm_luma_flag, and intra_tmp_flag are all 0.
  • the flag indicating the intra prediction method for the current block may be signaled and/or parsed in the order indicating TIMD, BDPCM, Intra TMP, MIP, DIMD, MRL, ISP, and MPM.
  • the video signal processing device may parse and/or signal a flag (cu_timd_flag) indicating whether to apply TIMD.
  • the video signal processing device may parse and/or signal intra_bdpcm_luma_flag when the value of cu_timd_flag is 0 (when TIMD is not applied).
  • the video signal processing device may parse and/or signal intra_tmp_flag. Flags after intra_mip_flag may be parsed and/or signaled when the values of cu_timd_flag, intra_bdpcm_luma_flag, and intra_tmp_flag are all 0.
  • the video signal processing device uses a syntax element (intra_luma_ref_idx) indicating whether to apply MRL (Multi Reference Line) when the value of the flag (intra_dimd_flag) indicating whether DIMD is applied to the current block (e.g., prediction block) is 0 (DIMD can only be signaled and/or parsed (if does not apply).
  • a syntax element (intra_luma_ref_idx) indicating whether to apply MRL (Multi Reference Line) when the value of the flag (intra_dimd_flag) indicating whether DIMD is applied to the current block (e.g., prediction block) is 0 (DIMD can only be signaled and/or parsed (if does not apply).
  • Figure 33 is a diagram showing a syntax structure showing a parsing method of a syntax element indicating whether to apply LFNST.
  • the syntax element (lfnst_idx) indicating whether to apply LFNST to the current block can be parsed when IntraTmp is applied (when the IntraTmpFlag[x0][y0] value is not 0) (see FIG. 33 3301).
  • the variable IntraTmpFlag[x][y] may be set to the value of intra_tmp_flag.
  • x can be x0..x0 + cbWidth - 1
  • y can be y0..y0 + cbHeight - 1.
  • the effect of LFNST may be relatively small for coding blocks to which intra template matching is applied.
  • Whether or not LFNST is applied can be determined not only for the luma component block but also for the chroma component block. At this time, when whether to apply LFNST is determined for the chroma component block, Cb and Cr may be commonly determined or may be determined separately.
  • a variable (channel type variable) indicating the color component may be additionally included.
  • IntraTmpFlag[x][y] can be expressed in the form of IntraTmpFlag[channel type variable][x][y]
  • lfnst_idx can be expressed in the form of lfnst_idx[channel type variable].
  • the syntax element indicating whether to apply LFNST may be parsed based on the block size for each color component.
  • Figure 34 is a diagram showing intra propagation of an intra template matching block according to an embodiment of the present invention.
  • one of the preset intra prediction modes may be stored in the intra prediction mode map.
  • the preset intra prediction modes may be planar mode, DC mode, and angle mode.
  • Intra prediction mode can be applied to the intra prediction mode map in 4 x 4 units.
  • the intra prediction mode stored in the intra prediction mode map can be used when the video signal processing device configures the MPM list of the current prediction block.
  • the video signal processing device may store the intra prediction mode map information of the template matching block in the intra prediction mode map of the current block.
  • the video signal processing device uses the intra prediction mode map information at the location containing the preset position of the template matching block in 4 x 4 units as the intra prediction mode of the current block. You can save it to the map.
  • the preset position may be one of the positions of each corner of a 4 x 4 block or the center position of the block.
  • Figure 35 is a diagram showing a method of applying a hash key according to the intra template matching block search method according to an embodiment of the present invention.
  • a video signal processing device can perform a search for a template matching block based on a hash key.
  • the video signal processing device may perform hash key (32-bit CRC (cyclical redundancy check)) matching between the template of the current block and the template of the template matching block for all template sizes to which the intra template matching block is applied.
  • Hash keys can be calculated in units of 4 x 4 blocks (subblocks). To match the hash key of a template block larger than 4 x 4, the video signal processing device can check whether the hash key of the template of the current block and the template of the template matching block match.
  • the video signal processing device may check whether the hash key of the template of the current block matches the hash key of each of the templates of all 4 x 4 blocks (subblocks, 3501 to 3505 in FIG. 35) of the template matching block. .
  • the video signal processing device can calculate the cost for the templates of the template matching block whose hash key matches (matches) the template of the current block, and determine the block corresponding to the template corresponding to the minimum cost as the prediction block of the current block. there is. That is, the video signal processing device calculates the similarity (cost) between the template of one or more template matching blocks whose hash keys match the template of the current block and the template of the current block, and selects the template corresponding to the template with the highest similarity (minimum cost). The block can be determined as the prediction block of the current block.
  • the video signal processing device may perform search in 4 x 4 units within the search section of FIG. 23.
  • Figure 36 is a diagram showing preset positions for intra-template matching block search according to an embodiment of the present invention.
  • the search area for intra template matting block search may be 4 CTU in size.
  • the video signal processing device may calculate the cost between the template at the preset position of the search area (e.g., part x in FIG. 36) and the template of the current block, and determine the block at the position corresponding to the smallest cost as the matching block. there is.
  • the preset position may be determined equally or unevenly. For example, if the preset position is determined equally, it may be determined in units of multiples of 2 or 4, and if it is determined unevenly, the position may be preset. Referring to FIG. 36, the preset location included in R1 corresponding to the current CTU may be a restored area.
  • Figure 37 is a diagram showing a coding unit syntax structure according to an embodiment of the present invention.
  • a flag (intra_tmp_flag) indicating whether to apply Intra TMP may be parsed and signaled based on the maximum size of the intra template matching block.
  • the maximum size of the intra template matching block can be set for each slice type.
  • the maximum size of the intra template matching block may be set for each color component (Y, Cb, Cr), and may be set for each chroma component and luma component. For example, if the slice type is I slice, the width (cbWidth) of the current block (e.g.
  • TMP_MaxSize can be 64 or any of 16, 32, 128, or 256. TMPSize can be smaller than TMP_MaxSize. If TMP_MaxSize does not exist, TMPSize can be set to an integer not exceeding the CTU size. The parsing conditions of Intra_tmp_flag are described below.
  • intra_tmp_flag is a syntax element that indicates whether intra TMP is activated and can be signaled at the SPS level. If the value of sps_tmp_enable_flag is 1, this may indicate that intra TMP is activated, and if the value of sps_tmp_enable_flag is 0, this may indicate that intra TMP is deactivated.
  • sps_tmp_enable_flag indicates that intra TMP is enabled
  • cu_dimd_flag indicates that DIMD is not applied
  • !cu_dimd_flag in condition 1 may or may not be included depending on the syntax structure.
  • Condition 2 may be a condition for !Intra_bdpcm_luma_flag added to condition 1. According to Condition 2, in addition to i) to iii) of Condition 1, if iv) BDPCM is not applied, intra_tmp_flag may be parsed.
  • intra_tmp_flag, TMP_MaxSize, and TMPSize can be set separately for each color component (Y, Cb, Cr) or for each luma and chroma.
  • the filtering strength (bS) of the boundary portion in deblocking filtering when determining the filtering strength (bS) of the boundary portion in deblocking filtering, a method of determining the filtering strength in the inter prediction mode can be used. For example, in the process of determining the filtering strength, if intra-template matching is applied to any one of the p and q blocks, the filtering strength for the boundary between the p and q blocks may be set to 1. A larger filtering strength means stronger filtering, and a filtering strength of 0 may mean that no filtering is performed. For example, if the filtering strength is 1 (weak filtering), it may mean weaker filtering than if the filtering strength is 2 (strong filtering).
  • the strength of filtering may be determined according to the difference in block vectors between p and q blocks. For example, in the process of determining the filtering strength, if intra template matching is applied to both p and q blocks and the block vector difference between p and q blocks is greater than a certain number, the difference between p and q blocks is The filtering strength for the boundary can be set to 1. At this time, any given number may be an integer of 1.
  • Figure 38 is a diagram showing a method of selecting a transform set for a block to which intra TMP is applied according to an embodiment of the present invention.
  • the width and height of blocks with intra TMP applied may be limited.
  • the width and height of a block to which intra TMP is applied may each be 64.
  • the horizontal transformation kernel for a block to which intra TMP is applied may be DCT2, and the vertical transformation kernel may be DCT2. If the width of the block to which intra TMP is applied satisfies a specific condition, the horizontal direction transformation kernel may be DST7. If the height of the block to which intra TMP is applied satisfies a specific condition, the vertical direction conversion kernel may be DST7.
  • the horizontal direction conversion kernel may be DST2
  • the vertical direction conversion kernel may be DST2. It can be.
  • a specific condition may be that the width (or height) of the block to which intra TMP is applied is equal to or greater than 4 and less than or equal to 16.
  • a video signal processing device can determine an MTS set for a block to which intra TMP is applied. The MTS set can be determined using the intra prediction mode derived with the DIMD method. The video signal processing device may calculate the cost of the transformation kernel candidates constituting the determined MTS set and use the transformation kernel candidate corresponding to the smallest cost.
  • the method described with reference to FIG. 38 can be applied to blocks except when the width (or height) of the block to which intra TMP is applied is equal to or greater than 4 and less than or equal to 16. That is, the method described with reference to FIG. 38 can be applied to blocks where the width (or height) of the block to which intra TMP is applied is less than 4 or greater than 16.
  • the parsing conditions for the MTS index indicating the conversion kernel candidate included in the bitstream are as follows.
  • the first and second reference values of Condition 1 may be a preset value of 16. Additionally, the first reference value and the second reference value may be set to different values, and the first reference value and the second reference value may be any one of 4, 8, 16, 32, etc.
  • the video signal processing device can determine the MTS set for all blocks to which intra TMP is applied, regardless of the specific conditions of FIG. 32.
  • the MTS set can be determined using the intra prediction mode derived with the DIMD method.
  • the video signal processing device may determine a specific conversion kernel to be used based on the cost for the conversion kernel included in the determined MTS set.
  • the parsing conditions for the MTS index indicating a specific conversion kernel included in the bitstream are as follows.
  • the MTS index can be parsed.
  • the third reference value and the fourth reference value may be 64. Additionally, the third reference value and the fourth reference value may be equal to the maximum size to which intra TMP can be applied. Additionally, the third reference value and the fourth reference value may be different values.
  • the condition for parsing the LFNST index indicating the kernel for LFNST may also be the same as condition 2.
  • the video signal processing device may parse the MTS index based on a specific kernel set.
  • intra prediction mode information may not be needed.
  • a particular kernel set may have 4 to 6 kernel candidates.
  • kernel candidates can be configured as shown in Table 1.
  • Figure 39 is a diagram showing a plurality of block vectors for an intra TMP block according to an embodiment of the present invention.
  • the video signal processing device calculates the cost between the template at a preset position for intra-template matching block search and the template of the current block, and creates a block vector (motion vector) for the template for intra-template matching block search corresponding to the smallest cost. can be calculated (obtained).
  • a video signal processing device can sort and store block vectors in order of low cost.
  • the cost calculates SAD (Sum of Absolute Differences) and MR-SAD (Mean Removed-Sum of Absolute Difference) using samples of the current block's template and the reference block's template (the device is a template at a preset location for intra-template matching block search). ), can be calculated using the SATD ((Sum of Absolute Transformed Differences) method.
  • Block vectors can be expressed in integer pixel units, 1/2, 1/4, 1/8, 2, 4 pixels. Among the obtained block vectors, the actually used block vector is placed first (or last), and the remaining block vectors can be sorted and stored in descending order of cost.
  • the stored block vectors are motion vector candidates for the IBC coding block.
  • the video signal processing device can use the stored block vectors.
  • One intra TMP block can be predicted by combining a plurality of intra TMP blocks.
  • the video signal processing device can store block vectors of reference blocks used for combining.
  • the reference block to be combined may be two or more blocks.
  • the video signal processing device can store block vectors equal to the number of reference blocks to be combined and block vectors obtained through the above-described cost calculation. If only the block vector of the reference block used for combining is used, the video signal processing device may use weighted combining.
  • the video signal processing device may determine the storage order of the block vector based on the weight.
  • the video signal processing device can determine the order of motion candidates for the IBC coding block based on the storage order of the block vectors. For example, a block vector with a large weight may have a high priority. If the block vectors of the reference block to be combined and the block vectors obtained through cost calculation are stored together, the block vector of the reference block to be combined may have a high priority.
  • Figure 40 is a diagram showing a method of deriving an intra prediction mode of a block to which intra TMP is applied according to an embodiment of the present invention.
  • Figure 40 shows a method of deriving the intra prediction mode required to apply MTS and LFNST to a block to which intra TMP is applied.
  • the video signal processing device performs intra prediction for a block to which intra TMP is applied based on the intra prediction mode stored at a preset location within the reference block of the current block and the intra prediction mode stored at a preset location within the surrounding (neighboring) block of the reference block. You can decide the mode. Meanwhile, if the samples at the preset location are MIP mode, intra TMP mode, IBC mode, palette mode, or intra mode, the video signal processing device may not use the intra prediction mode stored at the preset location.
  • FIG. 40(a) may be an enlarged view of the reference block (matching block) of FIG. 40(b).
  • the video signal processing device may check the intra prediction mode of the matching block.
  • the preset positions are P1 (center), P2 (right-bottom), P3 (top-left), and P4 (blocks on the upper border of the current block among the neighboring blocks of the reference block adjacent to the upper border of the reference block).
  • P5 a block adjacent to the middle block among the blocks on the left boundary of the current block among neighboring blocks adjacent to the left boundary of the reference block).
  • the intra prediction mode may not exist at a preset location.
  • the video signal processing device can use the preset mode by setting it to the intra prediction mode.
  • the preset mode may be one of planar mode, DC mode, horizontal angle mode, vertical angle mode, diagonal angle mode, and angle mode.
  • the video signal processing device may derive the intra prediction mode using a template as shown in FIG. 28.
  • the video signal processing device may derive an intra prediction mode using all or part of the samples in the reference block.
  • the video signal processing device may use the derived intra prediction mode to determine the MTS set or LFNST set of the current block to which the intra TMP is applied.
  • the video signal processing device may use an intra prediction mode at a preset position of a neighboring block of the current block, as shown in FIG. 40(c).
  • the video signal processing device may use the intra prediction mode at five preset positions to determine the MTS set or the LFNST set. For example, if the position of the upper left block of the current block is (0,0), the preset positions of the current block's neighboring blocks are P1(-1, H-1), P2(W-1, -1 ), P3(-1, H), P4(W, -1), P5(-1, 0).
  • H may mean the height of the current block
  • W may mean the width of the current block.
  • the video signal processing device may use one of the above-described preset modes or use a template sample located in the neighborhood of the current block to derive an intra prediction mode.
  • the video signal processing device checks whether there is an intra prediction mode stored at a preset location within the reference block of the current block and an intra prediction mode stored at a preset location within a neighboring block of the reference block. If there is no intra prediction mode stored, the current block It is possible to check whether an intra prediction mode exists at a preset position of a neighboring block. If the intra prediction mode does not exist even at the preset position of the neighboring block of the current block, the video signal processing device uses one of the above-mentioned preset modes or uses a template sample located in the neighbor of the current block (using DIMD). An intra prediction mode can be derived.
  • the video signal processing device can check the intra prediction mode by scanning the preset positions (P1 to P5) shown in FIGS. 40(a) and 40(c) in the order of P1, P2, P3, P4, and P5.
  • the video signal processing device may determine the MTS set or the LFNST set using the first identified intra prediction mode while performing a scan for P1 to P5.
  • the method described with reference to FIG. 40 can also be applied to blocks to which IBC mode is applied. That is, even for blocks to which IBC mode is applied, the video signal processing device can derive the intra prediction mode necessary to apply MTS and LFNST.
  • Figure 41 shows a method for determining an MTS set or LFNST set according to an embodiment of the present invention.
  • FIG. 41 shows a method of deriving an intra prediction mode to determine an MTS set or LFNST set for an intra TMP block described with reference to FIGS. 1 to 40.
  • the video signal decoding device may determine a transformation kernel set for transformation of the current block to which intra template matching is applied (S4110).
  • the video signal decoding device can predict the current block based on the transform kernel included in the transform kernel set (S4120).
  • the transform kernel set may be determined based on the intra prediction mode associated with the current block.
  • the transform kernel set may be a set of transform matrices of a multiple transform set (MTS), a set of transform matrices of a low frequency non-separable transform (LFNST), and/or other types of ratios.
  • -It may be at least one of a set of transformation matrices of Non-Separable Primary Transform (NSPT).
  • the intra prediction mode may be derived based on DIMD (Decoder side intra mode derivation).
  • the intra prediction mode may be derived based on the intra prediction mode of a preset position within the reference block of the current block and the intra prediction mode of a neighboring block of the reference block.
  • the preset positions within the reference block are the top left, bottom right, and center of the current block
  • the neighboring block of the reference block is the current block among neighboring blocks of the reference block adjacent to the upper boundary of the reference block. It may be a block adjacent to the middle block among blocks on the upper boundary of , and a block adjacent to the middle block among blocks on the left boundary of the current block among neighboring blocks adjacent to the left boundary of the reference block.
  • the intra prediction mode may be derived based on the intra prediction mode of a neighboring block of the current block.
  • the neighboring blocks of the current block are blocks located at (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0), Where H is the height of the current block, W is the width of the current block, and the position of the upper left block of the current block may be (0, 0,).
  • the intra prediction mode of a preset position in the reference block of the current block and the intra prediction mode of the neighboring block of the reference block do not exist, the intra prediction mode may be derived based on DIMD (Decoder side intra mode derivation).
  • DIMD Decoder side intra mode derivation
  • the methods described above in this specification may be performed through a processor of a decoder or encoder. Additionally, the encoder can generate a bitstream that is decoded by the methods described above. Additionally, the bitstream generated by the encoder may be stored in a computer-readable non-transitory storage medium (recording medium).
  • parsing is not limited to the decoder operation, but can also be interpreted as the act of constructing a bitstream in the encoder. Additionally, this bitstream may be stored and configured in a computer-readable recording medium.
  • Embodiments of the present invention described above can be implemented through various means.
  • embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.
  • the method according to embodiments of the present invention uses one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), and Programmable Logic Devices (PLDs).
  • ASICs Application Specific Integrated Circuits
  • DSPs Digital Signal Processors
  • DSPDs Digital Signal Processing Devices
  • PLDs Programmable Logic Devices
  • FPGAs Field Programmable Gate Arrays
  • processors controllers, microcontrollers, microprocessors, etc.
  • the method according to embodiments of the present invention may be implemented in the form of a module, procedure, or function that performs the functions or operations described above.
  • Software code can be stored in memory and run by a processor.
  • the memory may be located inside or outside the processor, and may exchange data with the processor through various known means.
  • Computer-readable media can be any available media that can be accessed by a computer and includes both volatile and non-volatile media, removable and non-removable media. Additionally, computer-readable media may include both computer storage media and communication media.
  • Computer storage media includes both volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data.
  • Communication media typically includes computer readable instructions, data structures or other data of modulated data signals such as program modules, or other transmission mechanisms, and includes any information delivery medium.

Landscapes

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

Abstract

비디오 신호 디코딩 장치의 프로세서는, 현재 블록의 제1 예측 모드를 결정하고, 상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하고, 제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하고, 상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원할 수 있다.

Description

비디오 신호 처리 방법 및 이를 위한 장치
본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.
압축 부호화란 디지털화한 정보를 통신 회선을 통해 전송하거나, 저장 매체에 적합한 형태로 저장하기 위한 일련의 신호 처리 기술을 의미한다. 압축 부호화의 대상에는 음성, 영상, 문자 등의 대상이 존재하며, 특히 영상을 대상으로 압축 부호화를 수행하는 기술을 비디오 영상 압축이라고 일컫는다. 비디오 신호에 대한 압축 부호화는 공간적인 상관관계, 시간적인 상관관계, 확률적인 상관관계 등을 고려하여 잉여 정보를 제거함으로써 이루어진다. 그러나 최근의 다양한 미디어 및 데이터 전송 매체의 발전으로 인해, 더욱 고효율의 비디오 신호 처리 방법 및 장치가 요구되고 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공하여 비디오 신호의 코딩 효율을 높이기 위한 목적이 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공한다.
본 명세서에 있어서, 비디오 신호 디코딩 장치는 프로세서를 포함하며, 상기 프로세서는, 인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하고, 상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하고, 상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정될 수 있다.
본 명세서에 있어서, 비디오 신호 인코딩 장치는 프로세서를 포함하며, 상기 프로세서는, 디코딩 방법에 의해 디코딩되는 비트스트림을 획득하고, 상기 디코딩 방법은, 인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하는 단계; 및 상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하는 단계를 포함하고, 상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정될 수 있다.
본 명세서에 있어서, 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에 있어서, 상기 비트스트림은 디코딩 방법에 의해 디코딩되고, 상기 디코딩 방법은, 인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하는 단계; 및 상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하는 단계를 포함하고, 상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정될 수 있다.
또한 본 명세서에 있어서, 상기 변환 커널 세트는, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합, 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 및/또는 비-분리 변환(Non-Separable Primary Transform)의 변환 매트릭스의 집합 중 적어도 어느 하나일 수 있다.
또한 본 명세서에 있어서, 상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도될 수 있다.
또한 본 명세서에 있어서, 상기 인트라 예측 모드는, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도될 수 있다.
또한 본 명세서에 있어서, 상기 참조 블록 내 기 설정된 위치는 상기 현재 블록의 좌-상단, 우-하단, 및 가운데이고, 상기 참조 블록의 이웃 블록은 상기 참조 블록의 상측 경계와 인접한 상기 참조 블록의 이웃 블록들 중 상기 현재 블록의 상측 경계의 블록들 중 가운데 블록과 인접한 블록 및 상기 참조 블록의 좌측 경계와 인접한 이웃 블록들 중 상기 현재 블록의 좌측 경계의 블록들 중 가운데 블록과 인접한 블록일 수 있다.
또한 본 명세서에 있어서, 상기 인트라 예측 모드는 상기 현재 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도될 수 있다.
또한 본 명세서에 있어서, 상기 현재 블록의 이웃 블록은 (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0)에 위치한 블록이고, 상기 H는 상기 현재 블록의 높이이고, 상기 W는 상기 현재 블록의 너비이고, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)일 수 있다.
또한 본 명세서에 있어서, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드가 존재하지 않는 경우, 상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도될 수 있다.
본 명세서는 효율적으로 비디오 신호를 처리하기 위한 방법을 제공한다.
본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다.
도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치의 개략적인 블록도이다.
도 3은 픽쳐 내에서 코딩 트리 유닛이 코딩 유닛들로 분할되는 실시예를 도시한다.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다.
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다.
도 8은 본 명세서의 일 실시예에 따른 변환 커널의 유형을 나타내는 도면이다.
도 9는 본 명세서의 일 실시예에 따른 DCT-II, DCT-V, DCT-VIII, DST-I, DST-VII 변환의 0 번째 (해당 변환 커널의 가장 저주파 성분) 기저 함수를 나타내는 도면이다.
도 10 및 도 11은 본 명세서의 일 실시예에 따른 변환 커널 세트를 나타내는 도면이다.
도 12는 본 명세서의 일 실시예에 따른 잔차 신호를 복원하는 과정을 나타내는 도면이다.
도 13은 본 명세서의 일 실시예에 따른 2차 변환이 적용된 블록의 ROI(Region-Of-Interest)를 나타내는 도면이다.
도 14는 본 명세서의 일 실시예에 따른 2차 변환(LFNST)의 적용 방법을 나타내는 도면이다.
도 15는 본 명세서의 일 실시예에 따른 인트라 예측 모드와 2차 변환을 위한 변환 커널 세트간 매핑 관계를 나타내는 도면이다.
도 16은 본 발명의 일 실시예에 따른 DIMD를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.
도 17은 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.
도 18은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.
도 19는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.
도 20 내지 도 22는 본 발명의 일 실시예에 따른 매트릭스 기반 인트라 예측을 나타낸다.
도 23은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭(Intra Template Matching)을 나타낸 도면이다.
도 24는 본 발명의 일 실시예에 따른 DIMD 방법과 관련된 신호의 인코딩/디코딩 과정을 나타낸 도면이다.
도 25는 본 발명의 일 실시예에 따른 MIP 및/또는 인트라 TMP 방법과 관련된 신호의 인코딩/디코딩 과정을 나타낸 도면이다.
도 26은 본 발명의 일 실시예에 따른 2차 변환의 입력 벡터와 인트라 예측 모드와의 관계를 나타내는 도면이다.
도 27은 본 명세서의 일 실시예에 따른 2차 변환의 입력 벡터를 구성하는 방법을 나타내는 도면이다.
도 28은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭을 위한 현재 블록의 템플릿의 방향성 정보를 유도하는 과정을 나타낸 도면이다.
도 29는 본 발명의 일 실시예에 따른 인트라 예측 방향성 정보를 유도하기 위한 템플릿 형태를 나타낸 도면이다.
도 30은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록에 적용되는 MTS 세트를 나타낸 도면이다.
도 31, 도 32는 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 적용 여부를 지시하는 플래그를 포함하는 신택스 구조를 나타낸 도면이다.
도 33은 LFNST의 적용 여부를 지시하는 신택스 요소의 파싱 방법을 나타낸 신택스 구조를 나타낸 도면이다.
도 34은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록의 인트라 프로파게이션(propagation)을 나타낸 도면이다.
도 35는 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록의 탐색 방법에 따른 해쉬 키를 적용하는 방법을 나타낸 도면이다.
도 36은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록 탐색을 위한 기 설정된 위치를 나타낸 도면이다.
도 37은 본 발명의 일 실시예에 따른 코딩 유닛 신택스 구조를 나타낸 도면이다.
도 38은 본 발명의 일 실시예에 따른 인트라 TMP가 적용되는 블록을 위한 변환 세트를 선택하는 방법을 나타낸 도면이다.
도 39는 본 발명의 일 실시예에 따른 인트라 TMP 블록에 대한 복수 개의 블록 벡터를 나타낸 도면이다.
도 40은 본 발명의 일 실시예에 따른 인트라 TMP가 적용된 블록의 인트라 예측 모드를 유도하는 방법을 나타낸 도면이다.
도 41은 본 발명의 일 실시예에 따른 MTS 세트 또는 LFNST 세트를 결정하기 위한 방법을 나타낸 도면이다.
본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.
본 명세서에서 'A 및/또는 B'는 'A 또는 B 중 적어도 하나를 포함하는'과 같은 의미로 해석될 수 있다.
본 명세서에서 일부 용어들은 다음과 같이 해석될 수 있다. 코딩은 경우에 따라 인코딩 또는 디코딩으로 해석될 수 있다. 본 명세서에서 비디오 신호의 인코딩(부호화)을 수행하여 비디오 신호 비트스트림을 생성하는 장치는 인코딩 장치 또는 인코더로 지칭되며, 비디오 신호 비트스트림의 디코딩(복호화)을 수행하여 비디오 신호를 복원하는 장치는 디코딩 장치 또는 디코더로 지칭된다. 또한, 본 명세서에서 비디오 신호 처리 장치는 인코더 및 디코더를 모두 포함하는 개념의 용어로 사용된다. 정보(information)는 값(values), 파라미터(parameter), 계수(coefficients), 성분(elements) 등을 모두 포함하는 용어로서, 경우에 따라 의미는 달리 해석될 수 있으므로 본 발명은 이에 한정되지 아니한다. '유닛'은 영상 처리의 기본 단위 또는 픽쳐의 특정 위치를 지칭하는 의미로 사용되며, 휘도(luma) 성분 및 색차(chroma) 성분 중 적어도 하나를 포함하는 이미지 영역을 가리킨다. 또한, '블록'은 휘도 성분 및 색차 성분들(즉, Cb 및 Cr) 중 특정 성분을 포함하는 이미지 영역을 가리킨다. 다만, 실시예에 따라서 '유닛', '블록', '파티션', '신호' 및 '영역' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '현재 블록'은 현재 부호화를 진행할 예정인 블록을 의미하며, '참조 블록'은 이미 부호화 또는 복호화가 완료된 블록으로 현재 블록에서 참조로 사용되는 블록을 의미한다. 또한, 본 명세서에서 '루마', 'luma', '휘도', 'Y' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '크로마', 'chroma' '색차', 'Cb 또는 Cr' 등의 용어는 서로 혼용하여 사용될 수 있으며, 색차 성분은 Cb와 Cr 2가지로 나누어지므로 각 색차 성분은 구분되어 사용될 수 있다. 또한, 본 명세서에서 유닛은 코딩 유닛, 예측 유닛, 변환 유닛을 모두 포함하는 개념으로 사용될 수 있다. 픽쳐는 필드 또는 프레임을 가리키며, 실시예에 따라 상기 용어들은 서로 혼용하여 사용될 수 있다. 구체적으로 촬영된 영상이 비월주사식(interlace) 영상일 경우, 하나의 프레임은 홀수(또는 기수, top) 필드와 짝수(또는 우수, bottom) 필드로 분리되어, 각 필드는 하나의 픽쳐 단위로 구성되어 부호화 또는 복호화 될 수 있다. 만일 촬영된 영상이 순차주사(progressive) 영상일 경우, 하나의 프레임이 픽쳐로서 구성되어 부호화 또는 복호화 될 수 있다. 또한, 본 명세서에서 '오차 신호', '레지듀얼 신호', '잔차 신호', '잔여 신호' 및 '차분 신호' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '인트라 예측 모드', '인트라 예측 방향성 모드', '화면 내 예측 모드' 및 '화면 내 예측 방향성 모드' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '모션', '움직임' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '좌측', '좌상측', '상측', '우상측', '우측', '우하측', '하측', '좌하측'은 '좌단', '좌상단', '상단', '우상단', '우단', '우하단', '하단', '좌하단'와 서로 혼용하여 사용될 수 있다. 또한, 원소(element), 멤버(member)는 서로 혼용하여 사용될 수 있다. POC(Picture Order Count)는 픽쳐(또는 프레임)의 시간적 위치 정보를 나타내며, 화면에 출력되는 재생 순서가 될 수 있으며, 픽쳐마다 고유의 POC를 가질 수 있다.
도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치(100)의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 인코딩 장치(100)는 변환부(110), 양자화부(115), 역양자화부(120), 역변환부(125), 필터링부(130), 예측부(150) 및 엔트로피 코딩부(160)를 포함한다.
변환부(110)는 입력 받은 비디오 신호와 예측부(150)에서 생성된 예측 신호의 차이인 레지듀얼 신호를 변환하여 변환 계수 값을 획득한다. 예를 들어, 이산 코사인 변환(Discrete Cosine Transform, DCT), 이산 사인 변환(Discrete Sine Transform, DST) 또는 웨이블릿 변환(Wavelet Transform) 등이 사용될 수 있다. 이산 코사인 변환 및 이산 사인 변환은 입력된 픽쳐 신호를 블록 형태로 나누어 변환을 수행하게 된다. 변환에 있어서 변환 영역 내의 값들의 분포와 특성에 따라서 코딩 효율이 달라질 수 있다. 레지듀얼 블록에 대한 변환에 사용되는 변환 커널은 수직 변환 및 수평 변환의 분리 가능한 특성을 가지는 변환 커널일 수 있다. 이 경우, 레지듀얼 블록에 대한 변환은 수직 변환 및 수평 변환으로 분리되어 수행될 수 있다. 예를 들어, 인코더는 레지듀얼 블록의 수직 방향으로 변환 커널을 적용하여 수직 변환을 수행할 수 있다. 또한, 인코더는 레지듀얼 블록의 수평 방향으로 변환 커널을 적용하여 수평 변환을 수행할 수 있다. 본 개시에서, 변환 커널은 변환 매트릭스, 변환 어레이, 변환 함수, 변환과 같이 레지듀얼 신호의 변환에 사용되는 파라미터 세트를 지칭하는 용어로 사용될 수 있다. 예를 들어, 변환 커널은 복수의 사용 가능한 커널들 중 어느 하나일 수 있다. 또한, 수직 변환 및 수평 변환 각각에 대해 서로 다른 변환 타입에 기반한 변환 커널이 사용될 수도 있다.
변환계수는 블록의 좌상단으로 갈수록 높은 계수가 분포하고, 블록의 우하단으로 갈수록 '0'에 가까운 계수가 분포한다. 현재 블록의 크기가 커질수록 우하단 영역에서 계수 '0'이 많이 존재할 가능성이 있다. 크기가 큰 블록의 변환 복잡도를 감소시키기 위해서, 임의의 좌상단 영역만을 남기고 나머지 영역은 '0'으로 재설정될 수 있다.
또한, 코딩 블록에서 일부 영역에만 오차 신호가 존재할 수 있다. 이 경우, 임의의 일부 영역에 대해서만 변환 과정이 수행될 수 있다. 실시 일 예로, 2Nx2N 크기의 블록에서 첫번째 2NxN 블록에만 오차 신호가 존재할 수 있으며, 첫번째 2NxN블록에만 변환과정이 수행되지만 두번째 2NxN 블록은 변환과정이 수행되지 않고 인코딩 또는 디코딩되지 않을 수 있다. 여기서 N은 임의의 양의 정수가 될 수 있다.
인코더는 변환 계수가 양자화되기 전에 추가적인 변환을 수행할 수 있다. 전술한 변환 방법은 1차 변환(primary transform)으로 지칭되고, 추가적인 변환은 2차 변환(secondary transform)으로 지칭될 수 있다. 2차 변환은 레지듀얼 블록 별로 선택적일 수 있다. 일 실시예에 따라, 인코더는 1차 변환만으로 저주파 영역에 에너지를 집중시키기 어려운 영역에 대해 2차 변환을 수행하여 코딩 효율을 향상시킬 수 있다. 예를 들어, 레지듀얼 값들이 레지듀얼 블록의 수평 또는 수직 방향 이외의 방향에서 크게 나타나는 블록에 대해 2차 변환이 추가로 수행될 수 있다. 2차 변환은 1차 변환과 달리 수직 변환 및 수평 변환으로 분리되어 수행되지 않을 수 있다. 이러한 2차 변환은 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)으로 지칭될 수 있다.
양자화부(115)는 변환부(110)에서 출력된 변환 계수 값을 양자화한다.
코딩 효율을 높이기 위하여 픽쳐 신호를 그대로 코딩하는 것이 아니라, 예측부(150)를 통해 이미 코딩된 영역을 이용하여 픽쳐를 예측하고, 예측된 픽쳐에 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 더하여 복원 픽쳐를 획득하는 방법이 사용된다. 인코더와 디코더에서 미스매치가 발생되지 않도록 하기 위해, 인코더에서 예측을 수행할 때에는 디코더에서도 사용 가능한 정보를 사용해야 한다. 이를 위해, 인코더에서는 부호화한 현재 블록을 다시 복원하는 과정을 수행한다. 역양자화부(120)에서는 변환 계수 값을 역양자화하고, 역변환부(125)에서는 역양자화된 변환 계수값을 이용하여 레지듀얼 값을 복원한다. 한편, 필터링부(130)는 복원된 픽쳐의 품질 개선 및 부호화 효율 향상을 위한 필터링 연산을 수행한다. 예를 들어, 디블록킹 필터, 샘플 적응적 오프셋(Sample Adaptive Offset, SAO) 및 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, DPB, 156)에 저장된다.
디블록킹 필터(deblocking filter)는 복원된 픽쳐에서 블록 간의 경계에 생성된 블록 내의 왜곡을 제거하기 위한 필터이다. 인코더는 블록 내의 임의 경계(edge)를 기준으로 몇 개의 열 또는 행에 포함된 픽셀들의 분포를 통해, 해당 경계에 디블록킹 필터를 적용할지 여부를 판단할 수 있다. 블록에 디블록킹 필터를 적용되는 경우, 인코더는 디블록킹 필터링 강도에 따라 긴 필터(Long Filter), 강한 필터(Strong Filter) 또는 약한 필터(Weak Filter)를 적용할 수 있다. 또한, 수평 방향 필터링 및 수직 방향 필터링이 병렬적으로 처리될 수 있다. 샘플 적응적 오프셋(SAO)은 디블록킹 필터가 적용된 레지듀얼 블록에 대하여, 픽셀 단위로 원본 영상과의 오프셋을 보정하는데 사용될 수 있다. 인코더는 특정 픽쳐에 대한 오프셋을 보정하기 위하여 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후, 오프셋 보정을 수행할 영역을 결정하고, 해당 영역에 오프셋을 적용하는 방법(Band Offset)을 사용할 수 있다. 또는 인코더는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법(Edge Offset)을 사용할 수 있다. 적응적 루프 필터(Adaptive Loop Filter, ALF)는 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후, 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행하는 방법이다. ALF를 적용할지 여부에 관련된 정보는 코딩 유닛 단위로 시그널링될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수가 달라질 수 있다. 또한, 적용할 대상 블록의 특성에 관계없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다.
예측부(150)는 인트라 예측부(152)와 인터 예측부(154)를 포함한다. 인트라 예측부(152)에서는 현재 픽쳐 내에서 인트라(intra) 예측을 수행하며, 인터 예측부(154)에서는 복호 픽쳐 버퍼(156)에 저장된 참조 픽쳐를 이용하여 현재 픽쳐를 예측하는 인터(inter) 예측을 수행한다. 인트라 예측부(152)는 현재 픽쳐 내의 복원된 영역들로부터 인트라 예측을 수행하여, 인트라 부호화 정보를 엔트로피 코딩부(160)에 전달한다. 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스, 참조 샘플에 관한 정보 중 적어도 하나를 포함할 수 있다. 인터 예측부(154)는 다시 모션 추정부(154a) 및 모션 보상부(154b)를 포함하여 구성될 수 있다. 모션 추정부(154a)에서는 복원된 참조 픽쳐의 특정 영역을 참조하여 현재 영역과 가장 유사한 부분을 찾고 영역 간의 거리인 모션 벡터 값을 획득한다. 모션 추정부(154a)에서 획득한 참조 영역에 대한 모션 정보(참조 방향 지시 정보(L0 예측, L1 예측, 양방향 예측), 참조 픽쳐 인덱스, 모션 벡터 정보 등) 등을 엔트로피 코딩부(160)로 전달하여 비트스트림에 포함될 수 있도록 한다. 모션 추정부(154a)에서 전달된 모션 정보를 이용하여 모션 보상부(154b)에서는 인터 모션 보상을 수행하여 현재 블록을 위한 예측 블록을 생성한다. 인터 예측부(154)는 참조 영역에 대한 모션 정보를 포함하는 인터 부호화 정보를 엔트로피 코딩부(160)에 전달한다.
추가적인 실시예에 따라, 예측부(150)는 인트라 블록 카피(Intra block copy, IBC) 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들로부터 IBC 예측을 수행하여, IBC 부호화 정보를 엔트로피 코딩부(160)에 전달한다. IBC 예측부는 현재 픽쳐 내의 특정 영역을 참조하여 현재 영역의 예측에 이용되는 참조 영역을 지시하는 블록 벡터값을 획득한다. IBC 예측부는 획득된 블록 벡터값을 이용하여 IBC 예측을 수행할 수 있다. IBC 예측부는 IBC 부호화 정보를 엔트로피 코딩부(160)로 전달한다. IBC 부호화 정보는 참조 영역의 크기 정보, 블록 벡터 정보(움직임 후보 리스트 내에서 현재 블록의 블록 벡터 예측을 위한 인덱스 정보, 블록 벡터 차분 정보) 중에서 적어도 하나를 포함할 수 있다.
위와 같은 픽쳐 예측이 수행될 경우, 변환부(110)는 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 변환하여 변환 계수 값을 획득한다. 이때, 변환은 픽쳐 내에서 특정 블록 단위로 수행될 수 있으며, 특정 블록의 크기는 기 설정된 범위 내에서 가변할 수 있다. 양자화부(115)는 변환부(110)에서 생성된 변환 계수 값을 양자화하여 양자화된 변환 계수를 엔트로피 코딩부(160)로 전달한다.
상기 2차원 배열 형태의 양자화된 변환 계수는 엔트로피 코딩을 위해 1차원의 배열 형태로 재정렬될 수 있다. 양자화된 변환 계수를 스캐닝하는 방법은 변환 블록의 크기 및 화면 내 예측 모드에 따라 어떠한 스캔 방법이 사용될지 여부가 결정될 수 있다. 실시 일 예로, 대각(Diagonal), 수직(vertical), 수평(horizontal) 스캔이 적용될 수 있다. 이러한 스캔 정보는 블록 단위로 시그널링될 수 있으며, 이미 정해진 규칙에 따라 유도될 수 있다.
엔트로피 코딩부(160)는 양자화된 변환 계수를 나타내는 정보, 인트라 부호화 정보, 및 인터 부호화 정보 등을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성한다. 엔트로피 코딩부(160)에서는 가변 길이 코딩(Variable Length Coding, VLC) 방식과 산술 코딩(arithmetic coding) 방식 등이 사용될 수 있다. 가변 길이 코딩(VLC) 방식은 입력되는 심볼들을 연속적인 코드워드로 변환하는데, 코드워드의 길이는 가변적일 수 있다. 예를 들어, 자주 발생하는 심볼들을 짧은 코드워드로, 자주 발생하지 않은 심볼들은 긴 코드워드로 표현하는 것이다. 가변 길이 코딩 방식으로서 컨텍스트 기반 적응형 가변 길이 코딩(Context-based Adaptive Variable Length Coding, CAVLC) 방식이 사용될 수 있다. 산술 코딩은 각 데이터 심볼들의 확률 분포를 이용하여 연속적인 데이터 심볼들을 하나의 소수로 변환하는데, 산술 코딩은 각 심볼을 표현하기 위하여 필요한 최적의 소수 비트를 얻을 수 있다. 산술 코딩으로서 컨텍스트 기반 적응형 산술 부호화(Context-based Adaptive Binary Arithmetic Code, CABAC)가 이용될 수 있다.
CABAC은 실험을 통해 얻은 확률을 기반으로 생성된 여러 개의 문맥 모델(context model)을 통해 이진 산술 부호화하는 방법이다. 문맥 모델은 컨텍스트 모델이라고 할 수도 있다. 먼저, 심볼이 이진 형태가 아닐 경우, 인코더는 exp-Golomb 등을 사용하여 각 심볼을 이진화한다. 이진화된 0 또는 1은 빈(bin)으로 기술될 수 있다. CABAC 초기화 과정은 문맥 초기화와 산술 코딩 초기화로 구분된다. 문맥 초기화는 각 심볼의 발생 확률을 초기화하는 과정으로, 심볼의 종류, 양자화 파라미터(QP), 슬라이스 타입(I, P, B 인지)에 따라 결정된다. 이러한 초기화 정보를 가지는 문맥 모델은 실험을 통해 얻은 확률 기반 값을 사용할 수 있다. 문맥 모델은 현재 코딩하려는 심볼에 대한 LPS(Least Probable Symbol) 또는 MPS(Most Probable Symbol)의 발생 확률과 0과 1중에서 어떤 빈 값이 MPS에 해당되는지에 대한 정보(valMPS)를 제공한다. 문맥 인덱스(Context index, ctxIdx)를 통해 여러 개의 문맥 모델 중에서 하나가 선택되며, 문맥 인덱스는 현재 부호화할 블록의 정보 또는 주변 블록의 정보를 통해 유도될 수 있다. 문맥 모델에서 선택된 확률 모델을 기반으로 이진 산술 코딩을 위한 초기화가 수행된다. 이진 산술 부호화는 0과 1의 발생 확률을 통해 확률 구간으로 분할한 후, 처리할 빈에 해당하는 확률 구간이 다음에 처리될 빈에 대한 전체 확률 구간이 되는 과정을 통해 부호화가 진행된다. 마지막 빈이 처리된 확률 구간 안의 위치 정보가 출력된다. 단, 확률 구간이 무한정 분할될 수 없으므로, 일정 크기 이내로 줄어들 경우에는 재규격화(renormalization)과정이 수행되어 확률 구간이 넓어지고 해당 위치 정보가 출력된다. 또한, 각 빈이 처리된 후, 처리된 빈의 정보를 통해 다음 처리될 빈에 대한 확률이 새롭게 설정되는 확률 업데이트 과정이 수행될 수 있다.
상기 생성된 비트스트림은 NAL(Network Abstraction Layer) 유닛을 기본 단위로 캡슐화 된다. NAL 유닛은 영상 데이터를 포함하는 VCL(Video Coding Layer) NAL 유닛과 영상 데이터를 디코딩하기 위한 파라미터 정보를 포함하는 non-VCL NAL 유닛으로 구분되며, 다양한 종류의 VCL 또는 non-VCL NAL 유닛이 존재한다. NAL 유닛은 NAL 헤더 정보와 데이터인 RBSP(Raw Byte Sequence Payload)로 구성되며, NAL 헤더 정보에는 RBSP에 대한 요약 정보가 포함된다. VCL NAL 유닛의 RBSP에는 부호화된 정수 개의 코딩 트리 유닛(coding tree unit)을 포함한다. 비디오 디코더에서 비트스트림을 복호화하기 위해서는 먼저 비트스트림을 NAL 유닛 단위로 분리한 후, 분리된 각각의 NAL 유닛을 복호화해야 한다. 한편, 비디오 신호 비트스트림의 복호화를 위해 필요한 정보들은 픽쳐 파라미터 세트(Picture Parameter Set, PPS), 시퀀스 파라미터 세트(Sequence Parameter Set, SPS), 비디오 파라미터 세트(Video Parameter Set, VPS) 등에 포함되어 전송될 수 있다.
한편, 도 1의 블록도는 본 발명의 일 실시예에 따른 인코딩 장치(100)를 나타낸 것으로서, 분리하여 표시된 블록들은 인코딩 장치(100)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 인코딩 장치(100)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 인코딩 장치(100)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.
도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치(200)의 개략적인 블록도이다. 도 2를 참조하면 본 발명의 디코딩 장치(200)는 엔트로피 디코딩부(210), 역양자화부(220), 역변환부(225), 필터링부(230) 및 예측부(250)를 포함한다.
엔트로피 디코딩부(210)는 비디오 신호 비트스트림을 엔트로피 디코딩하여, 각 영역에 대한 변환 계수 정보, 인트라 부호화 정보, 인터 부호화 정보 등을 추출한다. 예를 들어, 엔트로피 디코딩부(210)는 비디오 신호 비트스트림으로부터 특정 영역의 변환 계수 정보에 대한 이진화 코드를 획득할 수 있다. 또한, 엔트로피 디코딩부(210)는 이진화 코드를 역 이진화하여 양자화된 변환 계수를 획득한다. 역양자화부(220)는 양자화된 변환 계수를 역양자화하고, 역변환부(225)는 역양자화된 변환 계수를 이용하여 레지듀얼 값을 복원한다. 비디오 신호 처리 장치(200)는 역변환부(225)에서 획득된 레지듀얼 값을 예측부(250)에서 획득된 예측 값과 합산하여 원래의 화소값을 복원한다.
한편, 필터링부(230)는 픽쳐에 대한 필터링을 수행하여 화질을 향상시킨다. 여기에는 블록 왜곡 현상을 감소시키기 위한 디블록킹 필터 및/또는 픽쳐 전체의 왜곡 제거를 위한 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 다음 픽쳐에 대한 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(DPB, 256)에 저장된다.
예측부(250)는 인트라 예측부(252) 및 인터 예측부(254)를 포함한다. 예측부(250)는 전술한 엔트로피 디코딩부(210)를 통해 복호화된 부호화 타입, 각 영역에 대한 변환 계수, 인트라/인터 부호화 정보 등을 활용하여 예측 픽쳐를 생성한다. 복호화가 수행되는 현재 블록을 복원하기 위해서, 현재 블록이 포함된 현재 픽쳐 또는 다른 픽쳐들의 복호화된 영역이 이용될 수 있다. 복원에 현재 픽쳐만을 이용하는, 즉 인트라 예측 또는 인트라 BC 예측을 수행하는 픽쳐(또는, 타일/슬라이스)를 인트라 픽쳐 또는 I 픽쳐(또는, 타일/슬라이스), 인트라 예측, 인터 예측 및 인트라 BC 예측을 모두 수행할 수 있는 픽쳐(또는, 타일/슬라이스)를 인터 픽쳐(또는, 타일/슬라이스)라고 한다. 인터 픽쳐(또는, 타일/슬라이스) 중 각 블록의 샘플값들을 예측하기 위하여 최대 하나의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 예측 픽쳐(predictive picture) 또는 P 픽쳐(또는, 타일/슬라이스)라고 하며, 최대 두 개의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 쌍예측 픽쳐(Bi-predictive picture) 또는 B 픽쳐(또는, 타일/슬라이스) 라고 한다. 다시 말해서, P 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 하나의 모션 정보 세트를 이용하고, B 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 두 개의 모션 정보 세트를 이용한다. 여기서, 모션 정보 세트는 하나 이상의 모션 벡터와 하나의 참조 픽쳐 인덱스를 포함한다.
인트라 예측부(252)는 인트라 부호화 정보 및 현재 픽쳐 내의 복원된 샘플들을 이용하여 예측 블록을 생성한다. 전술한 바와 같이, 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스 중 적어도 하나를 포함할 수 있다. 인트라 예측부(252)는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다. 본 개시에서, 복원된 샘플들, 참조 샘플들 및 현재 블록의 샘플들은 픽셀들을 나타낼 수 있다. 또한, 샘플 값(sample value)들은 픽셀 값들을 나타낼 수 있다.
일 실시예에 따르면, 참조 샘플들은 현재 블록의 주변 블록에 포함된 샘플들일 수 있다. 예를 들어, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 또한, 참조 샘플들은 현재 블록의 주변 블록의 샘플들 중 현재 블록의 좌측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들 및/또는 현재 블록의 상측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들일 수 있다. 이때, 현재 블록의 주변 블록은 현재 블록에 인접한 좌측(L) 블록, 상측(A) 블록, 하좌측(Below Left, BL) 블록, 상우측(Above Right, AR) 블록 또는 상좌측(Above Left, AL) 블록 중 적어도 하나를 포함할 수 있다.
인터 예측부(254)는 복호 픽쳐 버퍼(256)에 저장된 참조 픽쳐 및 인터 부호화 정보를 이용하여 예측 블록을 생성한다. 인터 부호화 정보는 참조 블록에 대한 현재 블록의 모션 정보 세트(참조 픽쳐 인덱스, 모션 벡터 정보 등)를 포함할 수 있다. 인터 예측에는 L0 예측, L1 예측 및 쌍예측(Bi-prediction)이 있을 수 있다. L0 예측은 L0 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측이고, L1 예측은 L1 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측을 의미한다. 이를 위해서는 1세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 필요할 수 있다. 쌍예측 방식에서는 최대 2개의 참조 영역을 이용할 수 있는데, 이 2개의 참조 영역은 동일한 참조 픽쳐에 존재할 수도 있고, 서로 다른 픽쳐에 각각 존재할 수도 있다. 즉, 쌍예측 방식에서는 최대 2세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 이용될 수 있는데, 2개의 모션 벡터가 동일한 참조 픽쳐 인덱스에 대응될 수도 있고 서로 다른 참조 픽쳐 인덱스에 대응될 수도 있다. 이때, 참조 픽쳐들은 현재 픽쳐를 기준으로 시간적으로 이전 또는 이후에 위치하는 픽쳐로서, 이미 복원된 완료된 픽쳐가 될 수 있다. 일 실시예에 따라, 쌍예측 방식에서는 사용되는 2개의 참조 영역은 L0 픽쳐 리스트 및 L1 픽쳐 리스트 각각에서 선택된 영역일 수 있다.
인터 예측부(254)는 모션 벡터 및 참조 픽쳐 인덱스를 이용하여 현재 블록의 참조 블록을 획득할 수 있다. 상기 참조 블록은 참조 픽쳐 인덱스에 대응하는 참조 픽쳐 내에 존재한다. 또한, 모션 벡터에 의해서 특정된 블록의 샘플 값 또는 이의 보간(interpolation)된 값이 현재 블록의 예측자(predictor)로 이용될 수 있다. 서브펠(sub-pel) 단위의 픽셀 정확도를 갖는 모션 예측을 위하여 이를 테면, 휘도 신호에 대하여 8-탭 보간 필터가, 색차 신호에 대하여 4-탭 보간 필터가 사용될 수 있다. 다만, 서브펠 단위의 모션 예측을 위한 보간 필터는 이에 한정되지 않는다. 이와 같이 인터 예측부(254)는 이전에 복원된 픽쳐로부터 현재 유닛의 텍스쳐를 예측하는 모션 보상(motion compensation)을 수행한다. 이때, 인터 예측부는 모션 정보 세트를 이용할 수 있다.
추가적인 실시예에 따라, 예측부(250)는 IBC 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들을 포함하는 특정 영역을 참조하여 현재 영역을 복원할 수 있다. IBC 예측부는 엔트로피 디코딩부(210)로부터 획득된 IBC 부호화 정보를 이용하여 IBC 예측을 수행할 수 있다. IBC 부호화 정보는 블록 벡터 정보를 포함할 수 있다.
상기 인트라 예측부(252) 또는 인터 예측부(254)로부터 출력된 예측값, 및 역변환부(225)로부터 출력된 레지듀얼 값이 더해져서 복원된 비디오 픽쳐가 생성된다. 즉, 비디오 신호 디코딩 장치(200)는 예측부(250)에서 생성된 예측 블록과 역변환부(225)로부터 획득된 레지듀얼을 이용하여 현재 블록을 복원한다.
한편, 도 2의 블록도는 본 발명의 일 실시예에 따른 디코딩 장치(200)를 나타낸 것으로서, 분리하여 표시된 블록들은 디코딩 장치(200)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 디코딩 장치(200)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 디코딩 장치(200)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.
한편, 본 명세서에서 제안된 기술은 인코더와 디코더의 방법 및 장치에 모두 적용 가능한 기술이며, 시그널링과 파싱으로 기술된 부분은 설명의 편의를 위해 기술한 것일 수 있다. 일반적으로 시그널링은 인코더 관점에서 각 신택스(syntax)를 부호화하기 위한 것이고, 파싱은 디코더 관점에서 각 신택스의 해석을 위한 것으로 설명될 수 있다. 즉, 각 신택스는 인코더로부터 비트스트림에 포함되어 시그널링될 수 있으며, 디코더에서는 신택스를 파싱하여 복원과정에서 사용할 수 있다. 이때, 규정된 계층적 구성대로 나열한 각 신택스에 대한 비트의 시퀀스를 비트스트림이라고 할 수 있다.
하나의 픽쳐는 서브 픽쳐(sub-picture), 슬라이스(slice), 타일(tile) 등으로 분할되어 부호화될 수 있다. 서브 픽쳐는 하나 이상의 슬라이스 또는 타일을 포함할 수 있다. 하나의 픽쳐가 여러 개의 슬라이스 또는 타일로 분할되어 부호화되었을 경우, 픽쳐 내의 모든 슬라이스 또는 타일이 디코딩이 완료되어야만 화면에 출력이 가능하다. 반면에, 하나의 픽쳐가 여러 개의 서브 픽쳐로 부호화되었을 경우, 임의의 서브 픽쳐만 디코딩되어 화면에 출력될 수 있다. 슬라이스는 여러 개의 타일 또는 서브 픽쳐를 포함할 수 있다. 또는 타일은 여러 개의 서브 픽쳐 또는 슬라이스를 포함할 수 있다. 서브 픽쳐, 슬라이스, 타일은 서로 독립적으로 인코딩 또는 디코딩이 가능하므로 병렬처리 및 처리 속도 향상에 효과적이다. 하지만, 인접한 다른 서브 픽쳐, 다른 슬라이스, 다른 타일의 부호화된 정보를 이용할 수 없으므로 비트량이 증가되는 단점이 있다. 서브 픽쳐, 슬라이스, 타일은 여러 개의 코딩 트리 유닛(Coding Tree Unit, CTU)으로 분할되어 부호화될 수 있다.
도 3은 픽쳐 내에서 코딩 트리 유닛(Coding Tree Unit, CTU)이 코딩 유닛들(Coding Units, CUs)로 분할되는 실시예를 도시한다. 비디오 신호의 코딩 과정에서, 픽쳐는 코딩 트리 유닛(CTU)들의 시퀀스로 분할될 수 있다. 코딩 트리 유닛은 휘도(luma) 코딩 트리 블록(Coding Tree Block, CTB)와 2개의 색차(chroma) 코딩 트리 블록들, 그리고 그것의 부호화된 신택스(syntax) 정보로 구성될 수 있다. 하나의 코딩 트리 유닛은 하나의 코딩 유닛으로 구성될 수 있으며, 또는 하나의 코딩 트리 유닛은 여러 개의 코딩 유닛으로 분할될 수 있다. 하나의 코딩 유닛은 휘도 코딩 블록(Coding Block, CB)과 2개의 색차 코딩 블록들, 그리고 그것의 부호화된 신택스 정보로 구성될 수 있다. 하나의 코딩 블록은 여러 개의 서브 코딩 블록으로 분할될 수 있다. 하나의 코딩 유닛은 하나의 변환 유닛(Transform Unit, TU)으로 구성될 수 있으며, 또는 하나의 코딩 유닛은 여러 개의 변환 유닛으로 분할될 수 있다. 하나의 변환 유닛은 휘도 변환 블록(Transform Block, TB)과 2개의 색차 변환 블록들, 그리고 그것의 부호화된 신택스 정보로 구성될 수 있다. 코딩 트리 유닛은 복수의 코딩 유닛들로 분할될 수 있다. 코딩 트리 유닛은 분할되지 않고 리프 노드가 될 수도 있다. 이 경우, 코딩 트리 유닛 자체가 코딩 유닛이 될 수 있다.
코딩 유닛은 상기에서 설명한 비디오 신호의 처리 과정, 즉 인트라/인터 예측, 변환, 양자화 및/또는 엔트로피 코딩 등의 과정에서 픽쳐를 처리하기 위한 기본 단위를 가리킨다. 하나의 픽쳐 내에서 코딩 유닛의 크기 및 모양은 일정하지 않을 수 있다. 코딩 유닛은 정사각형 또는 직사각형의 모양을 가질 수 있다. 직사각형 코딩 유닛(또는, 직사각형 블록)은 수직 코딩 유닛(또는, 수직 블록)과 수평 코딩 유닛(또는, 수평 블록)을 포함한다. 본 명세서에서, 수직 블록은 높이가 너비보다 큰 블록이며, 수평 블록은 너비가 높이보다 큰 블록이다. 또한, 본 명세서에서 정사각형이 아닌(non-square) 블록은 직사각형 블록을 가리킬 수 있지만, 본 발명은 이에 한정되지 않는다.
도 3을 참조하면, 코딩 트리 유닛은 먼저 쿼드 트리(Quad Tree, QT) 구조로 분할된다. 즉, 쿼드 트리 구조에서 2NX2N 크기를 가지는 하나의 노드는 NXN 크기를 가지는 네 개의 노드들로 분할될 수 있다. 본 명세서에서 쿼드 트리는 4진(quaternary) 트리로도 지칭될 수 있다. 쿼드 트리 분할은 재귀적으로 수행될 수 있으며, 모든 노드들이 동일한 깊이로 분할될 필요는 없다.
한편, 전술한 쿼드 트리의 리프 노드(leaf node)는 멀티-타입 트리(Multi-Type Tree, MTT) 구조로 더욱 분할될 수 있다. 본 발명의 실시예에 따르면, 멀티 타입 트리 구조에서는 하나의 노드가 수평 또는 수직 분할의 2진(binary, 바이너리) 또는 3진(ternary, 터너리) 트리 구조로 분할될 수 있다. 즉, 멀티-타입 트리 구조에는 수직 바이너리 분할, 수평 바이너리 분할, 수직 터너리 분할 및 수평 터너리 분할의 4가지 분할 구조가 존재한다. 본 발명의 실시예에 따르면, 상기 각 트리 구조에서 노드의 너비 및 높이는 모두 2의 거듭제곱 값을 가질 수 있다. 예를 들어, 바이너리 트리(Binary Tree, BT) 구조에서, 2NX2N 크기의 노드는 수직 바이너리 분할에 의해 2개의 NX2N 노드들로 분할되고, 수평 바이너리 분할에 의해 2개의 2NXN 노드들로 분할될 수 있다. 또한, 터너리 트리(Ternary Tree, TT) 구조에서, 2NX2N 크기의 노드는 수직 터너리 분할에 의해 (N/2)X2N, NX2N 및 (N/2)X2N의 노드들로 분할되고, 수평 터너리 분할에 의해 2NX(N/2), 2NXN 및 2NX(N/2)의 노드들로 분할될 수 있다. 이러한 멀티-타입 트리 분할은 재귀적으로 수행될 수 있다.
멀티-타입 트리의 리프 노드는 코딩 유닛이 될 수 있다. 코딩 유닛이 최대 변환 길이에 비해 크지 않은 경우, 해당 코딩 유닛은 더 이상의 분할 없이 예측 및/또는 변환의 단위로 사용될 수 있다. 일 실시예로서, 현재 코딩 유닛의 너비 또는 높이가 최대 변환 길이보다 큰 경우, 현재 코딩 유닛은 분할에 관한 명시적 시그널링 없이 복수의 변환 유닛으로 분할될 수 있다. 한편, 전술한 쿼드 트리 및 멀티-타입 트리에서 다음의 파라메터들 중 적어도 하나가 사전에 정의되거나 PPS, SPS, VPS 등과 같은 상위 레벨 세트의 RBSP를 통해 전송될 수 있다. 1) CTU 크기: 쿼드 트리의 루트 노드(root node) 크기, 2) 최소 QT 크기(MinQtSize): 허용된 최소 QT 리프 노드 크기, 3) 최대 BT 크기(MaxBtSize): 허용된 최대 BT 루트 노드 크기, 4) 최대 TT 크기(MaxTtSize): 허용된 최대 TT 루트 노드 크기, 5) 최대 MTT 깊이(MaxMttDepth): QT의 리프 노드로부터의 MTT 분할의 최대 허용 깊이, 6) 최소 BT 크기(MinBtSize): 허용된 최소 BT 리프 노드 크기, 7) 최소 TT 크기(MinTtSize): 허용된 최소 TT 리프 노드 크기.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다. 전술한 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하기 위해 기 설정된 플래그들이 사용될 수 있다. 도 4를 참조하면, 노드의 분할 여부를 지시하는 플래그 'split_cu_flag', 쿼드 트리 노드의 분할 여부를 지시하는 플래그 'split_qt_flag', 멀티-타입 트리 노드의 분할 방향을 지시하는 플래그 'mtt_split_cu_vertical_flag' 또는 멀티-타입 트리 노드의 분할 모양을 지시하는 플래그 'mtt_split_cu_binary_flag' 중 적어도 하나가 사용될 수 있다.
본 발명의 실시예에 따르면, 현재 노드의 분할 여부를 지시하는 플래그인 'split_cu_flag'가 먼저 시그널링될 수 있다. 'split_cu_flag'의 값이 0인 경우, 현재 노드가 분할되지 않는 것을 나타내며, 현재 노드는 코딩 유닛이 된다. 현재 노드가 코팅 트리 유닛인 경우, 코딩 트리 유닛은 분할되지 않은 하나의 코딩 유닛을 포함한다. 현재 노드가 쿼드 트리 노드 'QT node'인 경우, 현재 노드는 쿼드 트리의 리프 노드 'QT leaf node'이며 코딩 유닛이 된다. 현재 노드가 멀티-타입 트리 노드 'MTT node'인 경우, 현재 노드는 멀티-타입 트리의 리프 노드 'MTT leaf node'이며 코딩 유닛이 된다.
'split_cu_flag'의 값이 1인 경우, 현재 노드는 'split_qt_flag'의 값에 따라 쿼드 트리 또는 멀티-타입 트리의 노드들로 분할될 수 있다. 코딩 트리 유닛은 쿼드 트리의 루트 노드이며, 쿼드 트리 구조로 우선 분할될 수 있다. 쿼드 트리 구조에서는 각각의 노드 'QT node' 별로 'split_qt_flag'가 시그널링된다. 'split_qt_flag'의 값이 1인 경우 해당 노드는 4개의 정사각형 노드들로 분할되며, 'split_qt_flag'의 값이 0인 경우 해당 노드는 쿼드 트리의 리프 노드 'QT leaf node'가 되며, 해당 노드는 멀티-타입 노드들로 분할된다. 본 발명의 실시예에 따르면, 현재 노드의 종류에 따라서 쿼드 트리 분할은 제한될 수 있다. 현재 노드가 코딩 트리 유닛(쿼트 트리의 루트 노드) 또는 쿼트 트리 노드인 경우에 쿼드 트리 분할이 허용될 수 있으며, 현재 노드가 멀티-타입 트리 노드인 경우 쿼트 트리 분할은 허용되지 않을 수 있다. 각각의 쿼드 트리 리프 노드 'QT leaf node'는 멀티-타입 트리 구조로 더 분할될 수 있다. 상술한 바와 같이, 'split_qt_flag'가 0인 경우 현재 노드는 멀티-타입 노드들로 분할될 수 있다. 분할 방향 및 분할 모양을 지시하기 위하여, 'mtt_split_cu_vertical_flag' 및 'mtt_split_cu_binary_flag'가 시그널링될 수 있다. 'mtt_split_cu_vertical_flag'의 값이 1인 경우 노드 'MTT node'의 수직 분할이 지시되며, 'mtt_split_cu_vertical_flag'의 값이 0인 경우 노드 'MTT node'의 수평 분할이 지시된다. 또한, 'mtt_split_cu_binary_flag'의 값이 1인 경우 노드 'MTT node'는 2개의 직사각형 노드들로 분할되며, 'mtt_split_cu_binary_flag'의 값이 0인 경우 노드 'MTT node'는 3개의 직사각형 노드들로 분할된다.
트리 분할 구조는 휘도 블록과 색차 블록이 동일한 형태로 분할될 수 있다. 즉, 색차 블록은 휘도 블록의 분할 형태를 참조하여 색차 블록을 분할할 수 있다. 현재 색차 블록이 임의의 정해진 크기보다 적다면, 휘도 블록이 분할되었더라도 색차 블록은 분할되지 않을 수 있다.
트리 분할 구조는 휘도 블록과 색차 블록이 서로 다른 형태를 가질 수 있다. 이때, 휘도 블록에 대한 분할 정보와 색차 블록에 대한 분할 정보가 각각 시그널링될 수 있다. 또한, 분할 정보 뿐만 아니라 휘도 블록과 색차 블록의 부호화 정보도 다를 수 있다. 실시 일 예로, 휘도 블록과 색차 블록의 인트라 부호화 모드, 움직임 정보에 대한 부호화 정보 등이 적어도 하나 이상 다를 수 있다.
가장 작은 단위로 분할될 노드는 하나의 코딩 블록으로 처리될 수 있다. 현재 블록이 코딩 블록일 경우, 코딩 블록은 여러 개의 서브 블록(서브 코딩 블록)으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다. 또한 코딩 유닛이 서브 블록으로 분할될 때, 수평 또는 수직 방향으로 분할되거나 사선으로 분할될 수 있다. 인트라 모드에서 현재 코딩 유닛을 수평 또는 수직 방향으로 2개 또는 4개의 서브 블록으로 분할하는 모드를 ISP(Intra Sub Partitions)이라 한다. 인터 모드에서 현재 코딩 블록을 사선으로 분할하는 모드를 GPM(Geometric partitioning mode)이라 한다. GPM모드에서 사선의 위치와 방향은 미리 정해진 각도 테이블을 사용하여 유도하고, 각도 테이블의 인덱스 정보가 시그널링된다.
코딩을 위한 픽쳐 예측(모션 보상)은 더 이상 나누어지지 않는 코딩 유닛(즉 코딩 트리 유닛의 리프 노드)을 대상으로 이루어진다. 이러한 예측을 수행하는 기본 단위를 이하에서는 예측 유닛(prediction unit) 또는 예측 블록(prediction block)이라고 한다.
이하, 본 명세서에서 사용되는 유닛이라는 용어는 예측을 수행하는 기본 단위인 상기 예측 유닛을 대체하는 용어로 사용될 수 있다. 다만, 본 발명이 이에 한정되는 것은 아니며, 더욱 광의적으로는 상기 코딩 유닛을 포함하는 개념으로 이해될 수 있다.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다. 전술한 바와 같이, 인트라 예측부는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다.
먼저, 도 5는 인트라 예측 모드에서 현재 블록의 예측을 위해 사용되는 참조 샘플들의 일 실시예를 도시한다. 일 실시예에 따르면, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 도 5에 도시된 바와 같이, 현재 블록의 크기가 WXH이고 현재 블록에 인접한 단일 참조 라인(line)의 샘플들이 인트라 예측에 사용될 경우, 현재 블록의 좌측 및/또는 상측에 위치한 최대 2W+2H+1개의 주변 샘플들을 사용하여 참조 샘플들이 설정될 수 있다.
한편, 현재 블록의 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 수 있다. 다중 참조 라인은 현재 블록으로부터 기 설정된 범위 이내에 위치한 n개의 라인들로 구성될 수 있다. 일 실시예에 따르면, 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 경우, 참조 픽셀들로 설정될 라인들을 지시하는 별도의 인덱스 정보가 시그널링될 수 있으며, 이를 참조 라인 인덱스라고 명명할 수 있다.
또한, 참조 샘플로 사용될 적어도 일부의 샘플이 아직 복원되지 않은 경우, 인트라 예측부는 참조 샘플 패딩 과정을 수행하여 참조 샘플을 획득할 수 있다. 또한, 인트라 예측부는 인트라 예측의 오차를 줄이기 위해 참조 샘플 필터링 과정을 수행할 수 있다. 즉, 주변 샘플들 및/또는 참조 샘플 패딩 과정에 의해 획득된 참조 샘플들에 필터링을 수행하여 필터링된 참조 샘플들을 획득할 수 있다. 인트라 예측부는 이와 같이 획득된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 인트라 예측부는 필터링되지 않은 참조 샘플들 또는 필터링된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 본 개시에서, 주변 샘플들은 적어도 하나의 참조 라인 상의 샘플들을 포함할 수 있다. 예를 들어, 주변 샘플들은 현재 블록의 경계에 인접한 라인 상의 인접 샘플들을 포함할 수 있다.
다음으로, 도 6은 인트라 예측에 사용되는 예측 모드들의 일 실시예를 도시한다. 인트라 예측을 위해, 인트라 예측 방향을 지시하는 인트라 예측 모드 정보가 시그널링될 수 있다. 인트라 예측 모드 정보는 인트라 예측 모드 세트를 구성하는 복수의 인트라 예측 모드들 중 어느 하나를 지시한다. 현재 블록이 인트라 예측 블록일 경우, 디코더는 비트스트림으로부터 현재 블록의 인트라 예측 모드 정보를 수신한다. 디코더의 인트라 예측부는 추출된 인트라 예측 모드 정보에 기초하여 현재 블록에 대한 인트라 예측을 수행한다.
본 발명의 실시예에 따르면, 인트라 예측 모드 세트는 인트라 예측에 사용되는 모든 인트라 예측 모드들(예, 총 67개의 인트라 예측 모드들)을 포함할 수 있다. 더욱 구체적으로, 인트라 예측 모드 세트는 평면 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향 모드들)을 포함할 수 있다. 각각의 인트라 예측 모드는 기 설정된 인덱스(즉, 인트라 예측 모드 인덱스)를 통해 지시될 수 있다. 예를 들어, 도 6에 도시된 바와 같이 인트라 예측 모드 인덱스 0은 평면(planar) 모드를 지시하고, 인트라 예측 모드 인덱스 1은 DC 모드를 지시한다. 또한, 인트라 예측 모드 인덱스 2 내지 66은 서로 다른 각도 모드들을 각각 지시할 수 있다. 각도 모드들은 기 설정된 각도 범위 이내의 서로 다른 각도들을 각각 지시한다. 예를 들어, 각도 모드는 시계 방향으로 45도에서 -135도 사이의 각도 범위(즉, 제1 각도 범위) 이내의 각도를 지시할 수 있다. 상기 각도 모드는 12시 방향을 기준으로 정의될 수 있다. 이때, 인트라 예측 모드 인덱스 2는 수평 대각(Horizontal Diagonal, HDIA) 모드를 지시하고, 인트라 예측 모드 인덱스 18은 수평(Horizontal, HOR) 모드를 지시하고, 인트라 예측 모드 인덱스 34는 대각(Diagonal, DIA) 모드를 지시하고, 인트라 예측 모드 인덱스 50은 수직(Vertical, VER) 모드를 지시하며, 인트라 예측 모드 인덱스 66은 수직 대각(Vertical Diagonal, VDIA) 모드를 지시한다.
한편, 기 설정된 각도 범위는 현재 블록의 모양에 따라 서로 다르게 설정될 수 있다. 예를 들어, 현재 블록이 직사각형 블록일 경우 시계 방향으로 45도를 초과하거나 -135도 미만 각도를 지시하는 광각 모드가 추가적으로 사용될 수 있다. 현재 블록이 수평 블록일 경우, 각도 모드는 시계 방향으로 (45+offset1)도에서 (-135+offset1)도 사이의 각도 범위(즉, 제2 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 67 내지 76이 추가적으로 사용될 수 있다. 또한, 현재 블록이 수직 블록일 경우, 각도 모드는 시계 방향으로 (45-offset2)도에서 (-135-offset2)도 사이의 각도 범위(즉, 제3 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 -10 내지 -1이 추가적으로 사용될 수 있다. 본 발명의 실시예에 따르면, offset1 및 offset2의 값은 직사각형 블록의 너비와 높이 간의 비율에 따라 서로 다르게 결정될 수 있다. 또한, offset1 및 offset2는 양수일 수 있다.
본 발명의 추가적인 실시예에 따르면, 인트라 예측 모드 세트를 구성하는 복수의 각도 모드들은 기본 각도 모드와 확장 각도 모드를 포함할 수 있다. 이때, 확장 각도 모드는 기본 각도 모드에 기초하여 결정될 수 있다.
일 실시예에 따르면, 기본 각도 모드는 기존 HEVC(High Efficiency Video Coding) 표준의 인트라 예측에서 사용되는 각도에 대응하는 모드이고, 확장 각도 모드는 차세대 비디오 코덱 표준의 인트라 예측에서 새롭게 추가되는 각도에 대응하는 모드일 수 있다. 더욱 구체적으로, 기본 각도 모드는 인트라 예측 모드 {2, 4, 6, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {3, 5, 7, …, 65} 중 어느 하나에 대응하는 각도 모드일 수 있다. 즉, 확장 각도 모드는 제1 각도 범위 내에서 기본 각도 모드들 사이의 각도 모드일 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다.
다른 실시예에 따르면, 기본 각도 모드는 기 설정된 제1 각도 범위 이내의 각도에 대응하는 모드이고, 확장 각도 모드는 상기 제1 각도 범위를 벗어나는 광각 모드일 수 있다. 즉, 기본 각도 모드는 인트라 예측 모드 {2, 3, 4, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {-14, -13, -12, …, -1} 및 {67, 68, …, 80} 중 어느 하나에 대응하는 각도 모드일 수 있다. 확장 각도 모드가 지시하는 각도는 대응하는 기본 각도 모드가 지시하는 각도의 반대편 각도로 결정될 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다. 한편, 확장 각도 모드들의 개수는 이에 한정되지 않으며, 현재 블록의 크기 및/또는 모양에 따라 추가적인 확장 각도들이 정의될 수 있다. 한편, 인트라 예측 모드 세트에 포함되는 인트라 예측 모드들의 총 개수는 전술한 기본 각도 모드와 확장 각도 모드의 구성에 따라 가변할 수 있다.
상기 실시예에서, 확장 각도 모드들 간의 간격은 대응하는 기본 각도 모드들 간의 간격에 기초하여 설정될 수 있다. 예를 들어, 확장 각도 모드들 {3, 5, 7, …, 65} 간의 간격은 대응하는 기본 각도 모드들 {2, 4, 6, …, 66} 간의 간격에 기초하여 결정될 수 있다. 또한, 확장 각도 모드들 {-14, -13, …, -1} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {53, 53, …, 66} 간의 간격에 기초하여 결정되고, 확장 각도 모드들 {67, 68, …, 80} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {2, 3, 4, …, 15} 간의 간격에 기초하여 결정될 수 있다. 확장 각도 모드들 간의 각도 간격은 대응하는 기본 각도 모드들 간의 각도 간격과 동일하도록 설정될 수 있다. 또한, 인트라 예측 모드 세트에서 확장 각도 모드들의 개수는 기본 각도 모드들의 개수 이하로 설정될 수 있다.
본 발명의 실시예에 따르면, 확장 각도 모드는 기본 각도 모드를 기초로 시그널링될 수 있다. 예를 들어, 광각 모드(즉, 확장 각도 모드)는 제1 각도 범위 이내의 적어도 하나의 각도 모드(즉, 기본 각도 모드)를 대체할 수 있다. 대체되는 기본 각도 모드는 광각 모드의 반대편에 대응하는 각도 모드일 수 있다. 즉, 대체되는 기본 각도 모드는 광각 모드가 지시하는 각도의 반대 방향의 각도에 대응하거나 또는 상기 반대 방향의 각도로부터 기 설정된 오프셋 인덱스만큼 차이 나는 각도에 대응하는 각도 모드이다. 본 발명의 실시예에 따르면, 기 설정된 오프셋 인덱스는 1이다. 대체되는 기본 각도 모드에 대응하는 인트라 예측 모드 인덱스는 광각 모드에 다시 매핑되어 해당 광각 모드를 시그널링할 수 있다. 예를 들어, 광각 모드 {-14, -13, …, -1}은 인트라 예측 모드 인덱스 {52, 53, …, 66}에 의해 각각 시그널링될 수 있고, 광각 모드 {67, 68, …, 80}은 인트라 예측 모드 인덱스 {2, 3, …, 15}에 의해 각각 시그널링될 수 있다. 이와 같이 기본 각도 모드를 위한 인트라 예측 모드 인덱스가 확장 각도 모드를 시그널링하도록 함으로, 각 블록의 인트라 예측에 사용되는 각도 모드들의 구성이 서로 다르더라도 동일한 세트의 인트라 예측 모드 인덱스들이 인트라 예측 모드의 시그널링에 사용될 수 있다. 따라서, 인트라 예측 모드 구성의 변화에 따른 시그널링 오버헤드가 최소화될 수 있다.
한편, 확장 각도 모드의 사용 여부는 현재 블록의 모양 및 크기 중 적어도 하나에 기초하여 결정될 수 있다. 일 실시예에 따르면, 현재 블록의 크기가 기 설정된 크기보다 클 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 그렇지 않을 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다. 다른 실시예에 따르면, 현재 블록이 정사각형이 아닌 블록인 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 현재 블록이 정사각형 블록인 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다.
인트라 예측부는 현재 블록의 인트라 예측 모드 정보에 기초하여, 현재 블록의 인트라 예측에 사용될 참조 샘플들 및/또는 보간된 참조 샘플들을 결정한다. 인트라 예측 모드 인덱스가 특정 각도 모드를 지시할 경우, 현재 블록의 현재 샘플로부터 상기 특정 각도에 대응하는 참조 샘플 또는 보간된 참조 샘플이 현재 픽셀의 예측에 사용된다. 따라서, 인트라 예측 모드에 따라 서로 다른 세트의 참조 샘플들 및/또는 보간된 참조 샘플들이 인트라 예측에 사용될 수 있다. 참조 샘플들 및 인트라 예측 모드 정보를 이용하여 현재 블록의 인트라 예측이 수행되고 나면, 디코더는 역변환부로부터 획득된 현재 블록의 잔차 신호를 현재 블록의 인트라 예측 값과 더하여 현재 블록의 샘플 값들을 복원한다.
인터 예측에 사용되는 움직임(모션) 정보에는 참조 방향 지시 정보(inter_pred_idc), 참조 픽쳐 인덱스(ref_idx_l0, ref_idx_l1), 움직임(모션) 벡터(mvL0, mvL1)이 포함될 수 있다. 참조 방향 지시 정보에 따라 참조 픽쳐 리스트 활용 정보(predFlagL0, predFlagL1)가 설정될 수 있다. 실시 일 예로, L0 참조 픽쳐를 사용하는 단방향 예측인 경우, predFlagL0=1, predFlagL1=0로 설정될 수 있다. L1 참조 픽쳐를 사용하는 단방향 예측인 경우, predFlagL0=0, predFlagL1=1로 설정될 수 있다. L0와 L1 참조 픽쳐를 모두 사용하는 양방향 예측인 경우, predFlagL0=1, predFlagL1=1로 설정될 수 있다.
현재 블록이 코딩 유닛일 경우, 코딩 유닛은 여러 개의 서브 블록으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다.
현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터와 유사할 가능성이 높다. 따라서, 주변 블록의 움직임 벡터는 움직임 예측 값(motion vector predictor, mvp)으로 사용될 수 있고, 현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터를 이용하여 유도될 수 있다. 또한, 움직임 벡터의 정확성을 높이기 위해서, 인코더에서 원본 영상으로 찾은 현재 블록의 최적의 움직임 벡터와 움직임 예측 값 간의 움직임 벡터의 차이(motion vector difference, mvd)가 시그널링될 수 있다.
움직임 벡터는 다양한 해상도를 가질 수 있으며, 블록 단위로 움직임 벡터의 해상도가 달라질 수 있다. 움직임 벡터 해상도는 정수 단위, 반화소 단위, 1/4 화소 단위, 1/16 화소 단위, 4의 정수 화소 단위 등으로 표현될 수 있다. 스크린 콘텐츠와 같은 영상은 문자와 같은 단순한 그래픽 형태이므로 보간(interpolation) 필터를 적용하지 않아도 되므로, 정수 단위와 4의 정수 화소 단위가 블록 단위 선택적으로 적용될 수 있다. 회전 및 스케일을 표현할 수 있는 어파인(Affine) 모드로 부호화된 블록은 형태의 변화가 심하므로, 정수 단위, 1/4 화소 단위, 1/16 화소 단위가 블록 기반 선택적으로 적용될 수 있다. 블록 단위로 움직임 벡터 해상도를 선택적으로 적용할 지에 대한 여부 정보는 amvr_flag으로 시그널링된다. 만일 적용되는 경우, 어떠한 움직임 벡터 해상도를 현재 블록에 적용할지는 amvr_precision_idx으로 시그널링된다.
양방향 예측이 적용되는 블록의 경우, 가중치 평균을 적용할 때 2개의 예측 블록 간의 가중치를 같거나 또는 다르게 적용할 수 있으며, 가중치에 대한 정보는 bcw_idx를 통해 시그널링된다.
움직임 예측 값의 정확도를 높이기 위해서, 머지(Merge) 또는 AMVP(dvanced motion vector prediction) 방법이 블록 단위 선택적으로 사용될 수 있다. Merge 방법은 현재 블록의 움직임 정보를 현재 블록에 인접한 주변 블록의 움직임 정보와 동일하게 구성하는 방법으로, 동질성을 갖는 움직임 영역에서 움직임 정보가 변화없이 공간적으로 전파됨으로써 움직임 정보의 부호화 효율을 증가시키는 장점이 있다. 반면에 AMVP 방법은 정확한 움직임 정보를 표현하기 위해 L0 및 L1 예측 방향으로 각각 움직임 정보를 예측하고 가장 최적의 움직임 정보를 시그널링하는 방법이다. 디코더는 AMVP 또는 Merge 방법을 통해 현재 블록에 대한 움직임 정보를 유도한 후, 참조 픽쳐(reference picture)에서 유도한 움직임 정보에 위치한 참조 블록을 현재 블록을 위한 예측 블록으로 사용한다.
Merge 또는 AMVP에서 움직임 정보를 유도하는 방법은 현재 블록의 주변 블록으로부터 유도된 움직임 예측 값을 사용하여 움직임 후보 리스트를 구성한 후, 최적의 움직임 후보에 대한 인덱스 정보가 시그널링되는 방법일 수 있다. AMVP의 경우, L0와 L1 각각 움직임 후보 리스트가 유도되므로, L0와 L1 각각에 대한 최적의 움직임 후보 인덱스(mvp_l0_flag, mvp_l1_flag)가 시그널링된다. Merge의 경우, 하나의 움직임 후보 리스트가 유도되므로, 하나의 머지 인덱스(merge_idx)가 시그널링된다. 하나의 코딩 유닛에서 유도되는 움직임 후보 리스트는 다양할 수 있으며, 각 움직임 후보 리스트마다 움직임 후보 인덱스 또는 머지 인덱스가 시그널링될 수 있다. 이때, Merge 모드로 부호화된 블록에서 잔여 블록에 대한 정보가 없는 모드를 머지 스킵(MergeSkip) 모드라고 할 수 있다.
본 명세서의 움직임 후보와 움직임 정보 후보는 서로 동일한 의미일 수 있다. 또한, 본 명세서의 움직임 후보 리스트와 움직임 정보 후보 리스트는 서로 동일한 의미일 수 있다.
SMVD(Symmetric MVD)는 양방향 예측(bi-directional prediction)의 경우에, L0 방향과 L1 방향의 MVD(Motion Vector Difference) 값이 대칭을 이루도록 하여 전송되는 움직임 정보의 비트량을 줄이는 방법이다. L0 방향과 대칭을 이루는 L1 방향의 MVD 정보는 전송되지 않으며, L0 및 L1 방향의 참조 픽쳐 정보도 전송되지 않고 복호화 과정에서 유도될 수 있다.
OBMC(Overlapped Block Motion Compensation)는 블록 간의 움직임 정보가 서로 다른 경우, 주변 블록들의 움직임 정보를 사용하여 현재 블록에 대한 예측 블록들을 생성한 후, 예측 블록들을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성하는 방법이다. 이는 움직임 보상된 영상의 블록 경계에서 발생되는 블록킹 현상을 줄여주는 효과가 있다.
일반적으로 머지 움직임 후보는 움직임의 정확도가 낮다. 이러한 머지 움직임 후보의 정확도를 높이기 위해서, MMVD(Merge mode with MVD) 방법이 사용될 수 있다. MMVD 방법은 몇 개의 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 이용하여 움직임 정보를 보정하는 방법이다. MMVD 방법을 통해 획득되는 움직임 정보의 보정 값에 대한 정보(예를 들어, 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 지시하는 인덱스 등)은 비트스트림에 포함되어 디코더로 전송될 수 있다. 기존의 움직임 정보 차분 값이 비트스트림에 포함되는 것에 비해 움직임 정보의 보정 값에 대한 정보가 비트스트림에 포함됨으로써 비트량은 절약될 수 있다.
TM(Template Matching) 방법은 현재 블록의 주변 화소를 통해 템플릿을 구성하여 템플릿과 가장 유사도가 높은 매칭 영역을 찾아서 움직임 정보를 보정하는 방법이다. TM(Template matching)은 부호화되는 비트스트림의 크기를 줄이기 위해서, 움직임 정보를 비트스트림에 포함하지 않고 디코더에서 움직임 예측을 수행하는 방법이다. 이때, 디코더는 원본 영상이 없으므로 이미 복원된 주변 블록을 사용하여 현재 블록에 대한 움직임 정보를 개략적으로 유도할 수 있다.
DMVR(Decoder-side Motion Vector Refinement) 방법은 조금 더 정확한 움직임 정보를 찾기 위해 이미 복원된 참조 영상들의 상관성을 통해 움직임 정보를 보정하는 방법으로써, 현재 블록의 양방향 움직임 정보를 사용하여 2개의 참조 픽쳐의 임의의 정해진 영역 내에서 참조 픽쳐 내의 참조 블록 간의 가장 매칭이 잘되는 지점을 새로운 양방향 움직임으로 사용하는 방법이다. 이러한 DMVR이 수행될 때, 인코더는 하나의 블록 단위에서 DMVR을 수행하여 움직임 정보를 보정한 후, 다시 블록을 서브 블록으로 분할하여 각 서브 블록 단위에서 DMVR을 수행하여 서브 블록의 움직임 정보를 다시 보정할 수 있으며, 이를 MP-DMVR(Multi-pass DMVR)이라 할 수 있다.
LIC(Local Illumination Compensation) 방법은 블록 간의 휘도 변화를 보상하는 방법으로, 현재 블록에 인접한 주변 화소들을 사용하여 선형 모델을 유도한 후, 선형 모델을 통해 현재 블록의 휘도 정보를 보상하는 방법이다.
기존 비디오 부호화 방법들은 상하좌우의 평행 이동만을 고려한 움직임 보상을 수행하기 때문에, 현실에서 일반적으로 접하는 확대, 축소, 회전 등과 같은 움직임 포함하고 있는 비디오들의 부호화 시 부호화 효율이 저하된다. 이러한 확대, 축소, 회전에 대한 움직임을 표현하기 위하여, 4개(회전) 또는 6개(확대, 축소, 회전) 파라미터 모델을 이용하는 Affine 모델 기반 움직임 예측 기술이 적용될 수 있다.
BDOF(Bi-Directional Optical Flow)는 양방향 움직임으로 구성된 블록의 참조 블록으로부터 광-흐름(optical-flow) 기반으로 화소의 변화량을 추정하여 예측 블록을 보정하는데 사용된다. 이러한 VVC의 BDOF에서 유도된 움직임 정보를 이용하여 현재 블록의 움직임을 보정할 수 있다.
PROF(Prediction refinement with optical flow)는 서브 블록 단위 Affine 움직임 예측의 정확도를 픽셀 단위 움직임 예측의 정확도와 유사하도록 개선하기 위한 기술이다. PROF는 BDOF와 유사하게 광-흐름(optical-flow)에 기반하여 서브 블록 단위로 Affine 움직임 보상된 픽셀 값들에 대해 픽셀 단위로 보정 값을 계산하여 최종 예측 신호를 획득하는 기술이다.
CIIP(Combined Inter-/Intra-picture Prediction)방법은 현재 블록에 대한 예측 블록을 생성할 때, 화면 내 예측 방법으로 생성한 예측 블록과 화면 간 예측 방법으로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성하는 방법이다.
IBC(Intra Block Copy) 방법은 현재 블록과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾아서, 해당 참조 블록을 현재 블록에 대한 예측 블록으로 사용하는 방법이다. 이때, 현재 블록과 참조 블록 간의 거리인 블록 벡터(Block Vector)와 관련된 정보는 비트스트림에 포함될 수 있다. 디코더는 비스트스림에 포함된 블록 벡터와 관련된 정보를 파싱하여 현재 블록을 위한 블록 벡터를 계산하거나 설정할 수 있다.
BCW(Bi-prediction with CU-level Weights) 방법은 서로 다른 참조 픽쳐로 부터 움직임 보상된 두 개의 예측 블록에 대하여, 평균으로 예측 블록을 생성하지 않고, 블록 단위로 적응적으로 가중치를 적용하여 움직임 보상된 두 개의 예측 블록에 가중치 평균을 수행하는 방법이다.
Intra TMP(Template Matching Prediction) 방법은, 비디오 신호 처리 장치가 현재 블록에 인접한 주변 블록의 화소 값들을 사용하여 기준 템플릿이 구성하고, 구성된 기준 템플릿과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾은 후, 해당 참조 블록(이미 복원된 영역에서 찾은 부분)을 현재 블록에 대한 예측 블록으로 사용하는 방법이다
MHP(Multi-hypothesis prediction) 방법은 화면 간 예측 시 단방향 및 양방향 움직임 정보에 추가적인 움직임 정보를 전송함으로써, 다양한 예측 신호를 통한 가중치 예측을 수행하는 방법이다.
CCLM(Cross-component linear model)은 휘도 신호와 해당 휘도 신호와 동일한 위치에 있는 색차 신호 간의 높은 상관성을 이용하여 선형 모델을 구성한 후, 해당 선형 모델을 통해 색차 신호를 예측하는 방법이다. 현재 블록에 인접한 주변 블록 중에서 복원이 완료된 블록을 사용하여 템플릿을 구성한 후, 템플릿을 통해 선형 모델에 대한 파라미터가 유도된다. 다음으로, 영상 포맷에 따라 선택적으로 색차 블록의 크기에 맞게 복원된 현재 휘도 블록이 다운 샘플링된다. 마지막으로, 다운 샘플링된 휘도 블록과 해당 선형 모델을 이용하여 현재 블록의 색차 블록을 예측한다. 이때, 2개 이상의 선형 모델을 사용하는 방법을 MMLM(Multi-model Linear mode)이라고 한다.
독립 스칼라 양자화(independent scalar quantization)에서, 입력된 계수 tk에 대한 복원된 계수 t'k는 관련된 양자화 인덱스(quantization index) qk에만 의존적이다. 즉, 임의의 복원된 계수에 대한 양자화 인덱스(quantization index)는 다른 복원된 계수들에 대한 양자화 인덱스들과는 다른 값을 가진다. 이때 t'k는 tk에서 양자화 오차가 포함된 값일 수 있으며, 양자화 파라미터에 따라 서로 다르거나 또는 같을 수 있다. 여기서, t'k는 복원된 변환 계수 또는 역양자화된 변환계수라고 명명할 수 있으며, 양자화 인덱스를 양자화된 변환 계수라고 명명할 수도 있다.
균일 복원 양자화(URQ; Uniform Reconstruction Quantizers)에서, 복원된 계수들은 동일한 간격으로 배치되는 특성을 지닌다. 이때 인접하는 두 복원 값들 사이의 거리를 양자화 단계 크기(quantization step size)라고 할 수 있다. 복원된 값 중에는 0을 포함할 수 있으며, 사용 가능한 복원 값들의 전체 집합(set)은 양자화 단계 크기에 따라 고유하게 정의될 수 있다. 양자화 단계 크기는 양자화 파라미터에 따라 달라질 수 있다.
기존 방법에서는 양자화로 인해 허용 가능한 복원된 변환 계수들의 집합(세트)이 감소하며, 이러한 집합의 원소(element)는 유한 개일 수 있다. 이로 인해, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하는데 한계가 존재한다. 이러한 평균적인 오차를 최소화하기 위한 방법으로 벡터 양자화(Vector Quantization)를 사용할 수 있다.
비디오 부호화에서 사용되는 간단한 형태의 벡터 양자화 방법에는 부호 데이터 은닉(sign data hiding)이 있다. 이는 인코더에서 0이 아닌 하나의 계수에 대한 부호를 부호화하지 않고, 디코더에서는 해당 계수에 대한 부호를 모든 계수들에 대한 절대값의 합이 짝수인지 또는 홀수인지에 따라 결정하는 방법이다. 이를 위해 인코더에서는 적어도 하나의 계수가 '1'이 증가되거나 또는 감소될 수 있으며, 이는 율-왜곡(rate-distortion)에 대한 비용(Cost) 관점에서 최적이 되도록 적어도 하나의 계수가 선택되어 값이 조정될 수 있다. 실시 일 예로, 양자화 간격의 경계에 가까운 값을 가지는 계수가 선택될 수 있다.
또 다른 벡터 양자화 방법에는 트렐리스 부호화된 양자화(Trellis-Coded Quantization)가 있으며, 비디오 부호화에서는 종속 양자화(dependent quantization)에서 최적화된 양자화 값을 얻기 위한 최적의 경로 탐색 기법으로 활용된다. 블록 단위로, 블록 내 모든 계수들에 대한 양자화 후보들을 트렐리스 그래프에 배치하고, 최적화된 양자화 후보들 간의 최적의 트렐리스 경로를 율-왜곡(rate-distortion)에 대한 비용(Cost)을 고려하여 탐색한다. 구체적으로, 비디오 부호화에 적용된 종속 양자화는 변환 계수에 대한 허용 가능한 복원된 변환 계수들의 집합이 복원 순서에서 현재 변환 계수에 선행하는 변환 계수의 값에 의존하도록 설계될 수 있다. 이때, 여러 개의 양자화기를 변환 계수에 따라 선택적으로 사용하게 함으로써, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하여 부호화 효율을 높이는 효과가 있다.
인트라 예측 부호화 기술 중에서 MIP(Matrix Intra Prediction) 방법은 행렬 기반 인트라 예측 방법으로 현재 블록에 인접한 주변 블록의 픽셀로부터 방향성을 가지는 예측 방법과 달리, 주변 블록의 좌측 및 상단의 픽셀들을 미리 정의된 행렬(매트릭스)와 오프셋 값을 이용하여 예측 신호를 구하는 방법이다. MIP 방법에 있어 매트릭스는 매트릭스 벡터일 수 있다.
현재 블록의 인트라 예측 모드를 유도하기 위해서, 현재 블록에 인접하면서 복원된 임의의 영역인 템플릿(template)을 기반으로, 해당 템플릿의 주변 픽셀을 통해 유도된 템플릿에 대한 인트라 예측 모드가 현재 블록의 복원을 위해 이용할 수 있다. 우선, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성하고, 이미 복원된 템플릿과 가장 유사한 예측 템플릿을 생성한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 이러한 방법을 TIMD(Template intra mode derivation)이라고 할 수 있다.
일반적으로 인코더는 예측 블록을 생성하기 위한 예측 모드를 결정하여 결정된 예측 모드에 대한 정보가 포함된 비트스트림을 생성할 수 있다. 디코더는 수신한 비트스트림을 파싱하여 인트라 예측 모드를 설정할 수 있다. 이때, 예측 모드에 대한 정보의 비트량은 전체 비트스트림 크기의 10% 정도일 수 있다. 예측 모드에 대한 정보의 비트량을 감소시키기 위해 인코더는 비트스트림에 인트라 예측 모드에 대한 정보를 포함하지 않을 수 있다. 이에, 디코더는 주변 블록의 특성을 이용하여 현재 블록의 복원을 위한 인트라 예측 모드를 유도(결정)할 수 있고, 유도된 인트라 예측 모드를 이용하여 현재 블록을 복원할 수 있다. 이때, 디코더는 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 주변 화소(픽셀)들마다 소벨(Sobel) 필터를 가로 및 세로 방향으로 적용하여 방향성 정보를 유추한 후, 해당 방향성 정보를 인트라 예측 모드로 매핑하는 방법을 이용할 수 있다. 디코더가 주변 블록을 이용하여 인트라 예측 모드를 유도하는 방법은 DIMD(Decoder side intra mode derivation)로 기술될 수 있다.
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다.
주변 블록들은 공간적인 위치의 블록이거나 시간적인 위치의 블록일 수 있다. 현재 블록에 공간적으로 인접한 주변 블록은 좌측(Left, A1) 블록, 좌하측(Left Below, A0) 블록, 상측(Above, B1) 블록, 상우측(Above Right, B0) 블록 또는 상좌측(Above Left, B2) 블록 중 적어도 하나가 될 수 있다. 현재 블록에 시간적으로 인접한 주변 블록은 대응되는 픽쳐(Collocated picture)에서 현재 블록의 하우측(bottom Right, BR) 블록의 좌상단 픽셀 위치를 포함하는 블록이 될 수 있다. 상기 현재 블록에 시간적으로 인접한 주변 블록이 인트라 모드로 부호화되거나 상기 현재 블록에 시간적으로 인접한 주변 블록이 사용할 수 없는 위치에 존재하면, 현재 픽쳐에 대응되는 픽쳐(Collocated picture)에서 현재 블록의 가로 및 세로의 중앙(Center, Ctr) 픽셀 위치를 포함하는 블록이 시간적 주변 블록으로 사용될 수 있다. 대응되는 픽쳐에서 유도된 움직임 후보 정보는 TMVP(Temporal Motion Vector Predictor)라 지칭될 수 있다. TMVP는 하나의 블록에서 하나만 유도될 수 있고, 하나의 블록을 여러 개의 서브 블록으로 분할한 후, 각 서브 블록마다 각각의 TMVP 후보가 유도될 수 있다. 서브 블록 단위의 TMVP 유도 방법은 sbTMVP(sub-block Temporal Motion Vector Predictor)로 지칭될 수 있다.
본 명세서에서 설명하는 방법들이 적용될 것인지 여부는 슬라이스 타입 정보 (예, I 슬라이스, P 슬라이스, B 슬라이스 인지 여부), 타일인지 여부, 서브 픽쳐인지 여부, 현재 블록의 크기, 코딩 유닛의 깊이, 현재 블록이 휘도 블록인지 색차 블록인지 여부, 참조 프레임인지 비참조 프레임인지 여부, 참조 순서 및 계층에 따른 시간적인 계층 등에 대한 정보들 중 적어도 어느 하나에 기초하여 결정될 수 있다. 본 명세서에서 설명하는 방법들이 적용될 것인지 여부를 결정하기 위해 사용되는 정보들은 디코더 및 인코더 간 미리 약속된 정보일 수 있다. 또한, 이러한 정보들은 프로파일 및 레벨에 따라 결정되어 있을 수 있다. 이러한 정보들은 변수 값으로 표현될 수 있고, 비트스트림에는 변수 값에 대한 정보가 포함될 수 있다. 즉, 디코더는 비트스트림에 포함된 변수 값에 대한 정보를 파싱하여 상술한 방법들이 적용되는지 여부를 결정할 수 있다. 예를 들어, 코딩 유닛의 가로의 길이 또는 세로의 길이에 기초하여 상술한 방법들이 적용될 것인지 여부가 결정될 수 있다. 가로의 길이 또는 세로의 길이가 32 이상(예, 32, 64, 128 등)이면 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 32 보다 작은 경우(예, 2, 4, 8, 16)에 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 4 또는 8인 경우 상술한 방법들은 적용될 수 있다.
도 8은 본 명세서의 일 실시예에 따른 변환 커널의 유형을 나타내는 도면이다.
구체적으로, 도 8은 MTS에서 사용하는 변환 커널에 대한 정의를 나타낸 것으로, DCT-II, DCT-V, DCT-VIII, DST-I, DST-VII, DST-IV 커널의 수식(기저 함수(basis function))을 나타낸다. 본 명세서에서 DCT-II는 DCT-2(DCT2)로, DCT-V는 DCT-5(DCT5)로, DCT-VIII는 DCT-8(DCT8)로, DST-I는 DST-1(DST1)로, DST-VII는 DST-7(DST7)로, DST-IV는 DST-4(DST4)로 기술될 수 있다.
DCT와 DST는 각각 코사인(cosine), 사인(sine)의 함수로 표현이 가능하며, 샘플 수 N에 대한 변환 커널의 기저 함수를 Ti(j)로 표현할 경우, 인덱스 i는 주파수 도메인에서의 인덱스를 나타내며, 인덱스 j는 기저 함수 내의 인덱스를 나타낸다. 즉, i가 작아질수록 저주파 기저 함수를 나타내며, i가 커질수록 고주파 기저 함수를 나타낸다. 기저 함수 Ti(j)는 2차원 행렬로 표현했을 때, i 번째 행의 j 번째 요소를 나타낼 수 있으며, 도 8에 도시한 변환 커널은 모두 분리 가능한 특성을 가지고 있으므로, 잔차 신호 X에 대하여 가로 방향과 세로 방향에 각각 변환을 수행할 수 있다. 즉, 잔차 신호 블록을 X라 하고, 변환 커널 행렬을 T라 했을 때, 잔차 신호 X에 대한 변환은 TXT'으로 나타낼 수 있다. 이때, T'는 변환 커널 행렬 T의 전치행렬 (transpose)를 의미한다.
도 8에 도시된 기저 함수에 의해 정의되는 변환 매트릭스의 값들은 정수 형태가 아닌 소수 형태일 수 있다. 이에 비디오 인코딩 장치 및 디코딩 장치에 하드웨어적으로 소수 형태의 값들을 구현하기 어려울 수 있다. 따라서 소수 형태의 값들을 포함하는 원형(original) 변환 커널로부터 정수 근사화된 변환 커널이 비디오 신호의 인코딩 및 디코딩에 사용될 수 있다. 정수 형태의 값들을 포함하는 근사화된 변환 커널은 원형 변형 커널에 대한 스케일링 및 라운딩을 통해 생성될 수 있다. 근사화된 변환 커널이 포함하는 정수 값은 기 설정된 개수의 비트로 표현 가능한 범위 내의 값일 수 있다. 기 설정된 개수의 비트는 8-bit 또는 10-bit일 수 있다. 근사화에 따라 DCT와 DST의 정규 직교 (orthonormal) 성질은 유지되지 않을 수 있다. 그러나, 이에 따른 부호화 효율 손실이 크지 않으므로, 변환 커널을 정수 형태로 근사화 시키는 것이 하드웨어적 구현 측면에서 유리할 수 있다.
IDTR(Identity Transform)은 변환의 결과가 변환 전의 자기 자신이 나오는 변환으로, 항등 변환이라고 한다. 일반적으로 항등 변환은 행과 열이 동일한 값을 가지는 위치에 '1'을 설정하여 변환 매트릭스를 구성한다. 하지만, 여기서 항등 변환은 '1'값이 아닌 임의의 고정된 값을 사용하여, 입력된 잔차 신호의 값을 동일하게 높이거나 줄이는데 사용한다.
도 9는 본 명세서의 일 실시예에 따른 DCT-II, DCT-V, DCT-VIII, DST-I, DST-VII 변환의 0 번째 (해당 변환 커널의 가장 저주파 성분) 기저 함수를 나타내는 도면이다.
구체적으로 도 9는 도 8에서 정의한 DCT/DST의 변환 기저 함수인 Ti(j)에 대해 N이 8이고, i가 0일 때의 그래프로써, 가로축은 변환 기저 함수 내의 인덱스 j (j=0, 1, …, N-1)을 나타내며, 세로축은 신호의 크기 값을 나타낸다.
도 9에 도시된 바와 같이 DST-VII은 인덱스 j가 증가할수록 신호가 증가하는 경향을 보이므로 화면내 예측과 같이 잔차 신호 블록 내에서 블록의 좌상단 좌표를 기준으로 수평, 수직 방향으로의 거리가 멀어질수록 잔차 신호의 에너지가 증가하는 잔차 신호의 패턴에 효율적일 수 있다.
반면, DCT-VIII의 경우, 인덱스 j가 증가할수록 신호의 크기가 감소하는 패턴을 보이므로 잔차 신호 블록 내에서 블록의 좌상단 좌표를 기준으로 수평, 수직 방향으로의 거리가 멀어질수록 잔차 신호의 에너지가 감소하는 잔차 신호의 패턴에 효율적일 수 있다.
DST-I의 경우, 기저 함수 내의 인덱스 j가 증가할수록 신호가 증가하다가 특정 인덱스를 기점으로 신호의 크기가 감소하는 형태를 보인다. 따라서 잔차 블록 내의 중앙으로 이동할수록 잔차 신호의 에너지가 증가하는 잔차 신호의 패턴에 효율적일 수 있다.
DCT-II의 경우, 0 번째 기저 함수는 DC를 나타내며, 화면간 예측과 같이 잔차 블록 내의 화소 값 분포가 균일한 잔차 신호의 패턴에 효율적일 수 있다.
DCT-V의 경우, DCT-II와 유사하지만 j가 0일 때의 값이 j가 0이 아닐 때의 값보다 작은 값을 가지므로 j가 1일 때 직선이 꺾이는 형태의 신호 모형을 가진다.
DCT-II만을 주요하게 사용하는 기존의 비디오 코덱의 경우, 예측 모드와 원본 신호의 특성에 따라 달라지는 잔차 신호의 패턴에 적응적으로 변환을 수행할 수 없으므로 최적의 부호화 효율을 달성할 수 없다. 그러나, 다양한 변환 커널을 예측 모드에 따라 달리 사용하여 잔차 신호의 패턴에 최적화된 변환 커널을 선택하여 변환 부호화를 수행하는 AMT(adaptive multiple transform)의 경우 높은 압축 효율을 기대할 수 있다. AMT와 마찬가지로, 다중 변환 선택(multiple transform selection, MTS) 기술은 예측 모드에 따라 적응적으로 변환 커널을 선택하여 부호화 효율을 향상시킬 수 있는 변환 부호화 방법이다.
이하에서 본 명세서의 일 실시예에 따른 변환 커널의 조합에 대해 설명한다.
DCT2는 현재 블록의 복원을 위한 기본 변환 커널로 사용될 수 있다. 한편, DCT2 가 사용되지 않는 경우, 나머지 커널들(예, DCT8, DST7, DCT5, DST4, DST1)이 사용될 수 있다. DCT2가 사용되지 않는 경우, 나머지 커널들에 대한 기 설정된 조합 중 일부가 사용될 수 있다. 표 1은 도 8에 개시된 변환 커널들 중 DCT2와 IDTR을 제외한 커널들의 조합을 나타낸다. 즉, 표 1은 5가지 종류의 커널들(DCT8, DST7, DCT5, DST4, DST1)의 조합을 나타낸 것이다. 구체적으로, 표 1은 2개의 변환 커널들을 1 쌍(조합)으로 하여, 구성될 수 있는 25가지의 조합을 나타낸다. 비디오 신호 처리 장치(예, 디코더, 인코더)는 표 1의 25가지의 조합 중 어느 하나를 현재 블록의 수평 방향 또는 수직 방향에 대한 변환 커널로 사용할 수 있다. 한편, IDTR은 특정 조건을 만족하는 경우에만 사용될 수 있다.
Figure PCTKR2023014063-appb-img-000001
도 10 및 도 11은 본 명세서의 일 실시예에 따른 변환 커널 세트를 나타내는 도면이다.
도 10을 참조하여 현재 블록의 인트라 예측 모드와 현재 블록의 크기에 기초하여 결정되는 변환 커널 세트에 대해 설명한다.
도 10을 참조하면, 인트라 예측 모드에서 사용되는 변환 커널은 인트라 예측 모드와 현재 블록(예, 코딩 블록, 변환 블록)의 크기에 기초하여 결정될 수 있다. 또한, 도 10은 MIP에 대한 변환 커널 세트를 나타낼 수 있다. 도 10의 101은 인트라 예측 모드의 종류(즉, 인트라 예측 모드를 나타내는 인덱스)를 나타내고, 102는 현재 블록(예, 코딩 블록, 변환 블록)의 크기(즉 가로x세로)를 나타낸다. 예를 들어, 현재 블록의 크기가 4x4이고, 인트라 예측 모드의 종류가 1인 경우, 현재 블록을 위한 변환 커널은 인덱스 0에 대응되는 변환 커널 세트에 기초하여 결정될 수 있다. 인덱스 0에 대응되는 변환 커널 세트는 도 11을 참조하면 T0 {18, 24, 17, 23, 8, 12} 일 수 있다. 그리고, 비디오 신호 처리 장치는 T0의 어느 하나의 인덱스에 대응하는 변환 커널 세트에 포함되는 변환 커널(서브 변환 커널 세트)에 기초하여 현재 블록을 복원할 수 있다. 도 11의 변환 커널 세트에 포함되는 변환 커널(서브 변환 커널 세트)에 대응되는 인덱스는 6가지이나, 이는 일 예일 뿐 4가지일 수 있다.
도 11(a)는 6개의 변환 커널에 대응되는 인덱스로 구성되는 변환 커널 세트를 나타낸다. 도 11(a)는 6개의 변환 커널에 대응되는 인덱스로 구성되는 80가지의 변환 커널 세트 중 일부를 나타내는 도면이다. 마찬가지로, 도 11(a)의 변환 커널 세트를 구성하는 각각의 인덱스는 표 1의 변환 커널 조합(서브 변환 커널 세트) 중 어느 하나의 조합에 대응될 수 있다. 예를 들어, 표 1의 25가지의 조합은 각각 0 내지 24로 인덱싱될 수 있고, 도 11의 어느 하나의 변환 커널 세트에 포함되는 인덱스와 표 1의 조합은 대응될 수 있다. 11(a)의 변환 커널 세트는 현재 블록(코딩 블록, 변환 블록)의 크기와 현재 블록의 인트라 예측 모드에 기초하여 결정될 수 있다. 도 11(b)는 도11(a)의 변환 커널 세트들 중 첫번째 변환 커널 세트(T0)를 나타내는 도면이다. 변환 커널 세트의 인덱스들은 기 설정된 약속에 기초하여 복수 개의 그룹으로 그룹핑될 수 있다. 즉, 그룹핑되는 변환 커널 세트의 인덱스들의 개수는 적응적으로 설정될 수 있다. 이때 그룹은 3개 이상으로 구성될 수 있다. 도 11(b)를 참조하면, 변환 커널 세트의 인덱스들은 복수 개의 기준 값(예, 제1 기준 값, 제2 기준 값)에 기초하여 그룹핑될 수 있다. 예를 들어, 그룹핑 값이 제1 기준 값보다 작거나 같으면 1개의 인덱스(18)을 포함하는 그룹이 선택되고, 그룹핑 값이 제1 기준 값보다 크고 제2 기준 값보다 작거나 같으면 4개의 인덱스(18, 2, 17, 23)를 포함하는 그룹이 선택되고, 그룹핑 값이 제2 기준 값보다 크다면 6개의 인덱스(18, 24, 17, 23, 8, 12)를 포함하는 그룹이 선택될 수 있다. 그룹핑 값을 기준 값으로 비교하여 기 약속된 설정대로 해당하는 그룹이 선택되는 경우, 현재 블록에 대해 6개의 인덱스(변환 커널) 중 하나가 시그널링/파싱되는 것에 비해 복잡도 감소하는 효과가 있을 수 있다. 이때, 기준 값은 변환 계수들의 합일 수 있고, 변환 계수들의 합에 기초하여 제1 기준 값, 제2 기준 값이 결정될 수 있다. 예를 들어, 제1 기준 값은 6, 제2 기준 값은 32일 수 있다.
기준 값과 그룹핑 값을 비교하여 선택되는 그룹에 포함되는 인덱스를 지시하기 위한 별도의 시그널링이 필요할 수 있다. 예를 들어, 도 11(b)와 같이 그룹핑 값이 제1 기준 값보다 크고 제2 기준 값 보다 작거나 같은 경우 선택되는 그룹은 (18, 24, 17, 23)의 인덱스로 구성된 그룹일 수 있다. 이때, 4개의 인덱스 각각을 지시하기 위한 별도의 시그널링이 필요할 수 있다. 마찬가지로, 그룹핑 값이 제2 기준 값보다 큰 경우 선택되는 그룹은 (18, 24, 17, 23, 8, 12)의 인덱스로 구성된 그룹일 수 있다. 이때 6개의 인덱스 각각을 지시하기 위한 별도의 시그널링(mts_idx)이 필요할 수 있다 변환 커널 세트 내 인덱스는 상술한 mts_idx에 의해 지시될 수 있다. 이때, mts_idx는 고정된 비트 크기를 가질 수 있다. 예를 들어, 6개의 인덱스에 대한 mts_idx는 3 비트 크기를 가질 수 있다. 또는 mts_idx는 절삭 단항 이진화(Truncated unary Binarization, TB) 방법으로 시그널링될 수 있다. mts_idx는 TB 방법으로 코딩되면서 첫번째 빈(bin)에 대해서는 컨텍스트 모델 기반 CABAC 코딩이 적용되고 나머지 빈에 대해서는 TB 방식의 CABAC 코딩이 적용될 수 있다.
한편, 그룹핑 값이 제1 기준 값보다 같거나 작은 경우 선택되는 그룹은 (18)의 인덱스로 구성된 그룹일 수 있다. 이때, 그룹은 1개의 인덱스로만 구성되므로 1개의 인덱스를 지시하기 위한 별도의 시그널링은 필요하지 않을 수 있다.
도 12는 본 명세서의 일 실시예에 따른 잔차 신호를 복원하는 과정을 나타내는 도면이다.
원본 신호와 예측 신호의 차이인 잔차 신호는 예측 방법에 따라 신호의 에너지 분포가 변하는 특성이 있다. 따라서 MTS와 같이 예측 방법에 따라 변환 커널이 적응적으로 선택되는 경우 부호화 효율은 향상될 수 있다. 또한, MTS 또는 DCT2 커널만을 사용하는 변환을 1차 변환이라고 하면, 비디오 신호 처리 장치는 1차 변환된 계수 블록에 추가적으로 2차 변환을 수행하여 부호화 효율을 향상시킬 수도 있다. 2차 변환은 특히 잔차 신호 블록의 수평 또는 수직 방향이 아닌 방향으로 강한 에너지가 존재할 가능성이 높은 화면내 예측된 잔차 신호 블록에 대하여 에너지 압축(energy compaction)면에서 효과가 있다.
도 12를 참조하면 비디오 신호 처리 장치는 비트스트림에 포함된 잔차 신호와 관련된 신택스 요소를 파싱하고, 파싱 결과에 기초한 역 이진화를 통해 양자화 계수를 복원할 수 있다. 비디오 신호 처리 장치는 복원된 양자화 계수에 역 양자화를 수행하여 변환 계수를 획득할 수 있다. 비디오 신호 처리 장치는 변환 계수에 역 변환을 수행하여 잔차 신호 블록을 복원할 수 있다. 이때, 역 변환은 변환 생략 (Transform Skip, TS)이 적용되지 않는 블록에 적용될 수 있다. 비디오 신호 처리 장치는 2차 역 변환, 1차 역 변환 순으로 수행 역 변환을 수행할 수 있다. 이때, 2차 역 변환은 생략될 수도 있다. 예를 들어, 현재 블록이 인터 예측 모드로 부호화된 경우 2차 역 변환은 생략될 수 있다. 또한, 현재 블록의 크기에 따라 2차 역 변환은 생략될 수 있다. 복원된 잔차 신호는 양자화 오차가 포함된 것으로, 2차 변환은 잔차 신호의 에너지 분포를 변화시킴으로써 1차 변환만을 수행했을 때보다 양자화 오차를 줄일 수 있다.
도 13은 본 명세서의 일 실시예에 따른 2차 변환이 적용된 블록의 ROI(Region-Of-Interest)를 나타내는 도면이다.
본 명세서의 일 실시예에 따라 도 13에서 서브 블록에 표기된 숫자는 서브 블록 인덱스일 수 있고, 서브 블록 인덱스는 스캔 순서일 수 있으며 작은 번호에서 큰 번호 순으로 스캔 될 수 있다.
도 13(a)는 LFNST4의 ROI를 나타낸다. LFNST4의 ROI는 4 x N 또는 N x 4 크기의 변환 블록에 대한 ROI일 수 있다. 이때, N은 4 내지 128 사이의 정수일 수 있다. 도 13(a)를 참조하면 LFNST4의 ROI는 4개의 서브블록(서브블록 0 내지 서브블록 3)으로 구성된 16 x 4 블록에서의 ROI일 수 있다. 이때 ROI는 4 x 4 크기의 1개의 서브 블록이고, 도 13(a)를 참조하면 ROI는 서브블록 0에 해당한다. ROI의 입력 샘플 수는 16개일 수 있다. LFNST4의 순방향 변환 행렬은 R x 16일 수 있다. 이때 R은 4, 8, 16 등일 수 있다. 예를 들어 R이 16이면 변환 후 생성되는 변환 계수는 16개 일 수 있다.
도 13(b)는 LFNST8의 ROI를 나타낸다. LFNST8의 ROI는 8 x N 또는 N x 8 크기의 변환 블록에 대한 ROI일 수 있다. 이때, N은 8 내지 128 사이의 정수일 수 있다. 도 13(b)를 참조하면 LFNST8의 ROI는 8개의 서브블록(서브블록 0 내지 서브블록 7)으로 구성된 16 x 8 블록에서의 ROI일 수 있다. 이때 ROI는 4 x 4 크기의 서브 블록 4개에 해당하는 영역일 수 있고, 도 13(b)를 참조하면 ROI는 서브블록 0, 1, 2, 3에 해당한다. ROI의 입력 샘플 수는 64개일 수 있다. LFNST8의 순방향 변환 행렬은 R x 64일 수 있다. 이때 R은 8, 16, 32, 64 등일 수 있다. 예를 들어 R이 32이면 변환 후 생성되는 변환 계수는 32개 일 수 있다.
도 13(c)는 LFNST16의 ROI를 나타낸다. LFNST8의 ROI는 16 x N 또는 N x 16 크기의 변환 블록에 대한 ROI일 수 있다. 이때, N은 16 내지 128 사이의 정수일 수 있다. 도 13(c)를 참조하면 LFNST16의 ROI는 16개의 서브블록(서브블록 0 내지 서브블록 15)으로 구성된 16 x 16 블록에서의 ROI일 수 있다. 이때 ROI는 4 x 4 크기의 서브 블록 6개에 해당하는 영역일 수 있고, 도 13(b)를 참조하면 ROI는 서브블록 0, 1, 2, 3, 4, 5에 해당한다. ROI의 입력 샘플 수는 96개일 수 있다. LFNST16의 순방향 변환 행렬은 R x 96일 수 있다. 이때 R은 8, 16, 32, 64, 96 등일 수 있다. 예를 들어 R이 32이면 변환 후 생성되는 변환 계수는 32개 일 수 있다.
도 14는 본 명세서의 일 실시예에 따른 2차 변환(LFNST)의 적용 방법을 나타내는 도면이다.
2차 변환은 2차 변환 커널의 행렬과 1차 변환된 계수 벡터의 곱으로 표현될 수 있다. 즉, 1차 변환된 계수를 또 다른 공간으로 매핑하는 것으로 해석할 수 있다. 이때, 2차 변환되는 계수의 개수를 줄일 경우, 즉, 2차 변환 커널을 구성하는 기저 벡터의 수를 줄일 경우, 2차 변환에서 필요한 연산량과 변환 커널 저장에 필요한 메모리 용량을 줄일 수 있다는 효과가 있다.. 예를 들어, 비디오 신호 처리 장치가 변환 블록의 좌-상단 ROI에 해당되는 영역에 대해 2차 변환을 수행할 때, 2차 변환되는 계수의 개수가 32개로 줄어드는 경우, 32 x 96 크기의 2차 변환 커널이 적용될 수 있으며, 96x32 크기의 역 2차 변환 커널이 적용될 수 있다.
도 14를 참조하면 인코더는 잔차 신호 블록에 대하여 순방향 1차 변환 (Forward Primary Transform)을 수행하여 1차 변환된 계수 블록을 얻을 수 있다. 이때 잔차 신호는 인트라 예측에 의해 획득되는 신호일 수 있다. 1차 변환된 계수 블록의 크기는 M x N일 수 있다. 인코더는 min(M,N)의 값이 16인 잔차 신호 블록에 대해 순방향 1차 변환을 수행하여 1차 변환된 계수 블록을 획득할 수 있다. 그리고, 인코더는 1차 변환된 계수 블록의 좌-상단 ROI 영역의 샘플들(도 23의 서브블록 0 내지 서브블록 5)에 대해 32 x 96 2차 변환 (LFNST)을 수행할 수 있다. 또한 인코더는 Min(M,N)의 값이 8인 잔차 신호 블록에 대해 순방향 1차 변환을 수행하여 1차 변환된 계수 블록을 획득할 수 있다. 그리고, 인코더는 1차 변환된 계수 블록의 좌-상단 ROI 영역의 샘플들에 2차 변환을 수행할 수 있다.
도 14를 참조하면 2차 변환된 계수들을 포함하는 전체 변환 블록 크기의 변환 계수들은 양자화 (Quantization)될 수 있고, 양자화된 변환 계수들에 대한 정보는 비트스트림에 포함될 수 있다. 또한, 비트스트림은 2차 변환과 관련된 신택스 요소(lfnst_idx)를 포함할 수 있다. 구체적으로, 비트스트림은 현재 블록에 2차 변환이 적용되는지의 여부와 변환 커널을 지시하는 정보를 포함할 수 있다.
도 14를 참조하면 디코더는 비트스트림으로부터 양자화된 변환 계수들을 파싱할 수 있고, 역-양자화 (De-quantization)를 통해 변환 계수들을 획득할 수 있다. 디코더는 2차 변환과 관련된 신택스 요소에 기반하여 현재 변환 블록에 역 2차 변환 (Inverse LFNST)이 수행할 지 여부를 결정할 수 있다. 현재 변환 블록에 역 2차 변환이 적용되는 경우, 변환 블록의 크기에 따라 16개 또는 32개의 변환 계수가 역 2차 변환의 입력이 될 수 있다. 역 2차 변환의 입력이 되는 변환 계수의 개수는 인코더가 2차 변환을 수행하여 획득한 변환 계수의 개수와 동일할 수 있다. 디코더는 벡터화된 변환 계수와 역 2차 변환 커널 행렬의 곱을 통해 1차 변환된 계수를 획득할 수 있다. 역 2차 변환 커널은 변환 블록의 크기, 인트라 예측 모드, 변환 커널을 지시하는 신택스 요소에 기초하여 결정될 수 있다. 역 2차 변환 커널 행렬은 2차 변환 커널 행렬의 전치 행렬일 수 있으며, 구현의 복잡도를 고려하여 커널 행렬의 원소는 10-bit 또는 8-bit 정확도로 표현되는 정수일 수 있다. 역 2차 변환을 통해 획득되는 1차 변환 계수는 벡터 형태이므로, 2차원 형태의 데이터로 표현될 수 있다. 1차 변환 계수는 인트라 예측 모드에 의존적일 수 있다. 인코더에서 적용한 인트라 예측 모드에 기초하는 매핑 관계가 동일하게 적용될 수 있다. 디코더는 역 2차 변환을 수행하여 획득한 변환 계수를 포함하는 전체 변환 블록 크기의 변환 계수 블록에 대하여 역 1차 변환 (Inverse Primary Transform)을 수행하여 잔차 신호를 획득할 수 있다. 도 14를 통해 설명한 과정에는 비트 쉬프트 연산을 사용한 스케일링 과정이 포함될 수 있다.
도 15는 본 명세서의 일 실시예에 따른 인트라 예측 모드와 2차 변환을 위한 변환 커널 세트간 매핑 관계를 나타내는 도면이다.
변환 블록에 적용되는 LFNST를 위한 변환 커널 세트는 변환 블록의 인트라 예측 모드별로 결정될 수 있다. 하나의 변환 커널 세트는 복수 개의 LFNST 커널들로 구성될 수 있다. 예를 들어, 하나의 변환 커널 세트는 3개 또는 4개의 LFNST 커널들로 구성될 수 있다. 변환 커널 세트는 35개일 수 있고, 각 변환 커널 세트는 0 내지 34의 인덱스로 인덱싱될 수 있다. 확장 각도 모드에 해당하는 인트라 예측 모드 인덱스 -14 부터 -1, 67 부터 80은 인덱스 2의 변환 커널 세트와 매핑될 수 있다.
도 16은 본 발명의 일 실시예에 따른 DIMD를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.
도 16을 참조하면 디코더는 주변 샘플(블록, 픽셀)을 이용하여 예측 블록을 유도할 수 있다. 이때, 주변 샘플은 현재 블록의 주변 블록(픽셀)일 수 있다. 구체적으로, 디코더는 주변 샘플을 입력으로 하여 방향성 정보(각도 정보)에 대한 히스토그램을 통해 현재 블록의 복원을 위한 인트라 예측 모드들 및 가중치 정보를 결정할 수 있다.
도 17은 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.
도 17(a)는 방향성 정보를 유도하기 위해 현재 블록의 주변 블록이 모두 사용 가능할 때를 나타내고, 도 17(b)는 현재 블록의 상측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타내고, 도 17(c)는 현재 블록의 좌측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타낸다. 한편 주변 블록과 현재 블록이 동일한 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU에 속해 있지 않다면, 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있다. 도 17의 회색 점은 실제 방향성 정보를 유도하기 위해 사용되는 픽셀의 위치를 나타내고, 점선은 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계를 나타낸다. 또한, 도 17(d) 내지 (f)를 참조하면 방향성 정보를 유도하기 위해서, 경계에 위치한 픽셀은 경계 밖으로 한 픽셀씩 패딩(padding)될 수 있다. 이러한 패딩을 통해 보다 더 정확한 방향성 정보의 유도가 가능할 수 있다.
특정 위치의 픽셀에 대한 방향성 정보를 유도하기 위해, 수학식 1의 3x3 크기의 소벨(Sobel) 필터가 가로 및 세로 방향으로 각각 적용될 수 있다. 수학식 1의 A는 3x3 크기의 현재 블록의 복원된 주변 블록들의 픽셀 정보(값)을 의미할 수 있다. 그리고 방향성 정보(θ)는 수학식 2를 이용하여 결정될 수 있다. 방향성 정보 유도를 위한 계산 복잡도를 감소시키기 위해, 디코더는 수학식 2의 atan 함수를 계산하지 않고 수학식 1의 Gy/Gx에 대한 계산만으로 방향성 정보(θ)를 유도할 수 있다.
Figure PCTKR2023014063-appb-img-000002
Figure PCTKR2023014063-appb-img-000003
도 17를 참조하면 방향성 정보는 도 17에 표시된 모든 회색 점마다 계산될 수 있고, 방향성 정보는 인트라 예측 모드의 각도에 매핑될 수 있다. 인트라 예측 모드 세트는 평면(Planar) 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향 모드들)을 포함할 수 있다. 인트라 예측 모드는 67가지의 모드들일 수 있는데, 수학식 2를 통해 계산된 방향성 정보(각도, θ)는 실수 단위의 값일 수 있다. 따라서, 방향성 정보를 특정 인트라 예측 방향성 모드에 매핑하는 과정이 필요하다. 본 명세서에서 기술하는 인트라 예측 방향성 모드는 도 6에 도시된 각도 모드와 동일할 수 있다. 또한, 본 명세서에서 인트라 예측 방향성 정보를 유도하여 인트라 예측 방향성 모드를 매핑(결정)하는 방법은 DIMD 방법으로 기술될 수 있다.
도 18은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.
도 18을 참조하면 인트라 예측 방향성 모드는 0도(인덱스 18), 45도(인덱스 34), 90도(인덱스 50), 135도(인덱스 66)를 기준으로 4개의 구간으로 나누어질 수 있다(도 6 참조). 도 10을 참조하면 인트라 예측 방향성 모드를 결정하기 위한 구간은 0번 구간부터 3번 구간까지 4개의 구간으로 나누어질 수 있다. 0번 구간은 -45도에서 0도까지이고, 1번 구간은 0도에서 45도까지이고, 2번 구간은 45도에서 90도까지이고, 3번 구간은 90도에서 135도까지일 수 있다. 이때, 각 구간은 16개의 인트라 예측 방향성 모드를 포함할 수 있다. 방향성 모드는 수학식 1을 통해 계산된 Gx, Gy의 부호 및 크기를 비교하여 4개 구간 중 어느 하나의 구간이 결정될 수 있다. 예를 들어, Gx 및 Gy가 양수이고, Gx의 절대값이 Gy의 절대값보다 크다면 1번 구간이 선택될 수 있다. 각 구간에 매핑되는 인트라 예측 방향성 모드는 수학식 2로부터 계산된 방향성 정보(θ)를 통해 결정될 수 있다. 구체적으로, 디코더는 방향성 정보(θ)에 2^16을 곱하여 값을 확장한다. 그리고 디코더는 확장된 값을 미리 정의된 테이블의 수치와 비교하여 확장된 값과 가장 가까운 값을 찾고 가장 가까운 값에 기초하여 인트라 예측 방향성 모드를 결정할 수 있다. 이때 미리 정의된 테이블의 값은 17개 일 수 있다. 구체적으로, 미리 정의된 테이블의 값은 {0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536}일 수 있다. 이때, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도 간의 차이에 따라 다르게 설정될 수 있다.
한편, 계산 복잡도를 감소시키기 위해 atan 계산이 수행되지 않고 Gy/Gx만을 사용하여 방향성 각도를 구하는 경우, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도간 거리와 서로 불일치할 수 있다. atan는 입력 값이 증가할수록 기울기가 점점 낮아지는 특성이 있다. 따라서, 상기 정의된 테이블도 인트라 예측 방향성 모드의 각도 간의 차이뿐만 아니라 atan의 비선형 특성을 모두 고려하여 수치가 설정되어야 한다. 예를 들어, 상기 정의된 테이블 값들 간 차이는 점점 낮아지도록 설정될 수 있다. 반대로, 상기 정의된 테이블 값들 간 차이는 점점 높아지도록 설정될 수 있다.
현재 블록의 가로와 세로의 길이가 다르다면, 사용할 수 있는 인트라 예측 방향성 모드가 달라질 수 있다. 즉, 현재 블록의 가로와 세로의 길이가 다르다면, 인트라 예측 방향성 모드를 유도하기 위한 구간이 달라질 수 있다. 다시 말하면 인트라 예측 방향성 모드를 유도하기 위한 구간은 현재 블록의 가로와 세로의 길이에 기초(예를 들어, 가로의 길이와 세로의 길이의 비율 등)하여 변경될 수 있다. 예를 들어, 현재 블록의 가로가 세로보다 긴 경우, 인트라 예측 모드는 67~80까지 재매핑될 수 있으며, 반대 방향의 인트라 예측 모드는 2~15까지 제외될 수 있다. 예를 들어, 현재 블록의 가로의 길이가 세로의 길이보다 n(정수)배 만큼 길다면(예를 들어 2배), 인트라 예측 모드 {3, 4, 5, 6, 7, 8}은 {67, 68, 69, 70, 71, 72}으로 각각 재설정(매핑)될 수 있다. 또한, 현재 블록의 가로의 길이가 세로의 길이보다 길다면, 인트라 예측 모드에 '65'를 더한 값으로 인트라 예측 모드가 재설정될 수 있다. 한편, 현재 블록의 가로의 길이가 세로의 길이보다 짧다면, 인트라 예측 모드에 '67'을 뺀 값으로 인트라 예측 모드가 재설정될 수 있다.
현재 블록의 복원을 위한 인트라 예측 방향성 모드를 유도하기 위해 히스토그램이 사용될 수 있다. 주변 블록들에 대한 방향성 정보를 획득한 결과, 방향성이 존재하는 블록보다 방향성이 존재하지 않는 블록이 많은 경우, 방향성이 존재하지 않는 블록에 대한 예측 모드가 히스토그램상 누적 값이 가장 높을 수 있다. 그러나, 현재 블록의 복원을 위해서는 방향성 모드를 유도하여야 하므로, 히스토그램상 누적 값이 가장 높더라도 방향성이 존재하지 않는 블록에 대한 예측 모드는 제외될 수 있다. 즉, 주변 픽셀 간 변화도가 없거나 방향성이 없는 완만한 영역은 인트라 예측 방향성 모드를 유도하기 위해 사용되지 않을 수 있다. 예를 들어 방향성이 존재하지 않는 블록에 대한 예측 모드는 평면 모드, DC 모드 일 수 있다. 만일 좌측 주변 블록이 평면 모드 또는 DC 모드인 경우, 좌측 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있으며, 상측 주변 블록만을 사용하여 방향성 정보는 유도될 수 있다. 현재 블록의 주변 블록들에 완만한 영역과 방향성이 존재하는 영역이 혼재하는 경우, 디코더는 방향성을 강조하기 위해 수학식 3과 같이 계산된 G 값을 이용하여 히스토그램을 생성할 수 있다. 이때 히스토그램은 발생된 인트라 예측 방향성 모드마다 '1'만큼 더해지는 빈도수 기반이 아닌, 발생된 인트라 예측 방향성 모드마다 상기 계산된 G 값이 더해지는 누적 값일 수 있다.
Figure PCTKR2023014063-appb-img-000004
도 19는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.
도 19의 X축은 인트라 예측 방향성 모드를 나타내고, Y축은 G 값들의 누적 값을 나타낸다. 디코더는 인트라 예측 방향성 모드들 중에서 G 값들의 누적 값이 가장 큰 인트라 예측 방향성 모드를 선택할 수 있다. 다시 말하면, 디코더는 누적 값에 기초하여 현재 블록에 대한 인트라 예측 방향성 모드를 선택할 수 있다. 도 19를 참조하면 누적 값이 가장 큰 modeA와 두 번째로 큰 modeB가 인트라 예측 방향성 모드로 선택될 수 있다. 디코더는 현재 블록에 대한 예측 블록을 생성하기 위해, modeA로 생성한 예측 블록과 modeB로 생성한 예측 블록, 마지막으로 평면 모드로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때, 각 예측 블록의 가중치는 modeA와 modeB의 누적 값을 이용하여 결정될 수 있다. 예를 들어, 평면 모드로 생성한 예측 블록에 대한 가중치는 전체 가중치의 1/3로 설정될 수 있다. modeA로 생성한 예측 블록에 대한 가중치는 modeA와 modeB의 누적 값을 더한 것에서 modeA 누적 값을 나눈 값에 해당하는 가중치로 설정될 수 있다. modeB로 생성한 예측 블록에 대한 가중치는 전체 가중치에서 modeA 가중치와 전체 가중치의 1/3값을 차분한 값으로 결정될 수 있다. 가중치에 대한 계산을 보다 정확하게 하기 위해 디코더는 modeA로 생성한 예측 블록에 대한 가중치에 임의의 값을 곱하여 가중치의 범위를 확장할 수 있다. modeB로 생성한 예측 블록에 대한 가중치 및 평면 모드로 생성한 예측 블록에 대한 가중치도 동일하게 확장될 수 있다.
도 20 내지 도 22는 본 발명의 일 실시예에 따른 매트릭스 기반 인트라 예측을 나타낸다.
도 20의 참조하면 비디오 신호 처리 장치는 bdrytop, bdryleft를 사용하여(입력) 현재 블록을 예측하여 예측 블록(pred)를 획득(출력)할 수 있다. bdrytop은 현재 블록의 위쪽 참조 샘플들을 나타내며 도 20의 W일 수 있다. bdryleft는 현재 블록의 왼쪽 참조 샘플들을 나타내며 도 20의 H일 수 있다. 참조 샘플 라인은 현재 블록에 가장 인접한 것일 수 있다. 비디오 신호 처리 장치는 참조 샘플들, 매트릭스, 오프셋 값에 기초하여 현재 블록의 예측 블록을 획득할 수 있다. 도 20과 같이 예측 블록을 획득하는 방법은 MIP(Matrix based Intra prediction)라 기술될 수 있다. 본 명세서의 MIP는 ALWIP(Affine linear weighted intra prediction)로 기술될 수 있다.
도 21을 참조하여, 매트릭스 기반 화면내 예측을 수행하는 방법에 대해 살펴본다. 도 21은 현재 블록의 크기가 8 x 8인 경우, 매트릭스 기반 화면내 예측을 수행하는 방법을 나타낸 도면이다. 먼저, i) 비디오 신호 처리 장치는 현재 블록의 이웃하는 참조 샘플들에 대해 평균화(Averaging) 과정을 수행할 수 있다. 평균화 과정에서 현재 블록의 위쪽 참조 샘플들(bdrytop)은 일정 묶음 단위의 평균 값으로 재표현될 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록의 위쪽 8개의 참조 샘플들(bdrytop) 중 2개의 참조 샘플들씩 평균을 취하여 4개의 새로운 참조 샘플들(bdrytop red)을 생성할 수 있다. 마찬가지로, 비디오 신호 처리 장치는 현재 블록의 왼쪽 8개의 참조 샘플들(bdryleft) 중 2개의 참조 샘플들씩 평균을 취하여 4개의 새로운 참조 샘플들(bdryleft red)을 획득할 수 있다. 따라서, 비디오 신호 처리 장치는 총 8개의 새로운 참조 샘플들을 획득할 수 있다. 현재 블록의 크기에 따라서 평균화 과정 후 새롭게 생성되는 참조 샘플들의 수가 결정될 수 있다. 다음으로, ii) 비디오 신호 처리 장치는 행렬 벡터 곱셈(Matrix vector multiplication) 과정을 수행하여 현재 블록의 예측 블록(pred)을 획득할 수 있다. 비디오 신호 처리 장치는 현재 블록의 예측 블록을 획득하기 위한 행렬 벡터 곱셈 과정에서 필요한 매트릭스와 오프셋 값을 i) 단계의 결과(즉, 각각의 4개의 새로운 샘플들(bdrytop red, bdryleft red) 및/또는 mode k에 기초하여 결정할 수 있다. mode k에 대해서는 후술한다. iii) 비디오 신호 처리 장치는 보간(interpolation)을 수행할 수 있다. ii) 단계에서 결과 값(현재 블록의 예측 블록(pred))은 현재 블록의 지정된 위치로 매핑될 수 있다. 현재 블록이 다운샘플링(예, i) 단계의 평균화 과정)된 참조 샘플 보다 큰 경우, 비디오 신호 처리 장치는 수직 또는 수평 방향으로 또는 수직 및 수평 방향으로 단일 단계 선형 보간(single step linear interpolation)을 적용하여 최종 예측 블록을 생성할 수 있다. 단일 단계 선형 보간은 W x H크기의 블록 중 max(W, H)>=8인 블록에 적용될 수 있다. W는 현재 블록의 너비(가로)일 수 있고, H는 현재 블록의 높이(세로)일 수 있고, max(W, H)는 W와 H 중 큰 값을 출력하는 함수이다. 구체적으로, 현재 블록의 크기가 8 x 8인 경우(도 21 참조) 비디오 신호 처리 장치는 8개의 새로운 참조 샘플들을 획득할 수 있다. 그리고, 비디오 신호 처리 장치는 행렬 벡터 곱셈 과정을 수행하여 16개의 새로운 샘플들을 획득할 수 있다. 16개의 새로운 샘플들은 현재 블록의 예측 블록의 특정 위치에 매핑될 수 있다(도 21의 2101의 회색 음영 부분). 선형 보간(예, 단일 단계 선형 보간) 과정에 있어서, 현재 블록의 너비에 대응되는 참조 샘플들은 특정 위치에 매핑된 평균화 과정에서 생성된 참조 샘플들일 수 있다(도 21의 2102의 회색 음영 부분). 도 21의 2102를 참조하면, 특정 위치는 홀수 번째일 수 있다(도 21의 2102의 1, 3, 5, 7 번째). 현재 블록의 높이에 대응되는 참조 샘플들은 평균화 과정에서 사용된 참조 샘플들과 동일할 수 있다. 이때, 비디오 신호 처리 장치는 선형 보간 과정에서 사용되는 참조 샘플들에 대해 필터링을 수행할 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 샘플 기준으로 상하 가중치 [1,2,1] 을 적용하여 더하고 비트 쉬프트 연산자 2로 필터링을 수행할 수 있다.
Figure PCTKR2023014063-appb-img-000005
수학식 1의 A는 매트릭스이고, 현재 블록의 너비(W) 및 높이(H)가 4이면, A는 행(row)이 4이고, 열(column)이 4인 4 x 4 매트릭스 일 수 있다. 현재 블록의 너비(W) 및 높이(H) 중 적어도 어느 하나가 4가 아니면, A는 행(row)이 8이고, 열(column)이 8인 8 x 8 매트릭스 일 수 있다. b는 벡터 형태의 오프셋 값으로, Wred x Hred 크기일 수 있다. 매트릭스 A와 벡터 b는 3개의 세트 S0, S1, S2 중의 하나 일 수 있다. S0는 18개의 매트릭스로 구성될 수 있고, 각각의 매트릭스는 16개의 행(row)과 4개의 열(column)로 구성될 수 있고, 18개의 오프셋 벡터를 가질 수 있다. S1는 10개의 매트릭스로 구성될 수 있고, 각각의 매트릭스는 16개의 행(row)과 8개의 열(column)로 구성될 수 있고, 10개의 오프셋 벡터를 가질 수 있다. S2 는 6개의 매트릭스로 구성될 수 있고, 각각의 매트릭스는 64개의 행(row)과 8개의 열(column)로 구성될 수 있고, 6개의 오프셋 벡터를 가질 수 있다. S0, S1, S2는 별도의 인덱스(idx)에 의해 지시될 수 있다. 인덱스는 수학식 5와 같이 결정될 수 있다.
Figure PCTKR2023014063-appb-img-000006
수학식 5의 W는 현재 블록의 너비(가로), H는 현재 블록의 높이(세로)일 수 있다. max(W, H)는 W와 H 중 큰 값을 출력하는 함수이다.
상기 mode k를 결정하는 방법은 다음과 같을 수 있다.
mode k는 MIP에 대한 변환 커널 세트에 대한 것일 수 있다. mode k는 MIP에 대한 매트릭스를 결정하기 위해 사용되는 것일 수 있다. mode k는 인트라 예측 모드(예, 각도 모드) 및/또는 현재 블록의 크기에 기초하여 결정될 수 있다. 예를 들어, 인트라 예측 모드가 18번 보다 낮은 인덱스의 각도 모드이고, 현재 블록의 너비와 높이가 4이면, mode k는 인트라 예측 모드와 동일한 모드일 수 있다. 인트라 예측 모드가 18번 보다 같거나 큰 인덱스의 각도 모드이고, 현재 블록의 너비와 높이가 4이면, mode k는 인트라 예측 모드의 인덱스에서 17을 뺀 인덱스에 대응되는 각도 모드일 수 있다. 인트라 예측 모드가 10보다 낮은 인덱스의 각도 모드이고, 현재 블록의 너비와 높이 중 큰 값이 8이면, mode k는 인트라 예측 모드와 동일할 수 있다. 인트라 예측 모드가 10보다 같거나 큰 인덱스의 각도 모드이고, 현재 블록의 너비와 높이 중 큰 값이 8이면, mode k는 인트라 예측 모드의 인덱스에서 9를 뺀 인덱스에 대응되는 각도 모드일 수 있다. 인트라 예측 모드가 6보다 작은 인덱스의 각도 모드이고, 현재 블록의 너비와 높이 중 큰 값이 8보다 크면, mode k는 인트라 예측 모드와 같을 수 있다. 인트라 예측 모드가 6보다 같거나 큰 인덱스의 각도 모드이고, 현재 블록의 너비와 높이 중 큰 값이 8보다 크면, mode k는 인트라 예측 모드의 인덱스에서 5를 뺀 인덱스에 대응되는 각도 모드일 수 있다. 이를 수학식으로 정리하면 수학식 6과 같을 수 있다.
Figure PCTKR2023014063-appb-img-000007
도 22는 현재 블록의 크기가 4 x 4 인 경우, 비디오 신호 처리 장치가 매트릭스 기반 인트라 예측을 수행하는 방법을 나타낸다.
도 22를 참조하면 현재 블록의 크기가 4 x 4인 경우 비디오 신호 처리 장치는 평균화 과정 이후 4개의 새로운 참조 샘플들을 생성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록의 위쪽 4개의 참조 샘플들(bdrytop) 중 2개의 참조 샘플들씩 평균을 취하여 2개의 새로운 참조 샘플들(bdrytop red)을 생성할 수 있다. 마찬가지로, 비디오 신호 처리 장치는 현재 블록의 왼쪽 4개의 참조 샘플들(bdryleft) 중 2개의 참조 샘플들씩 평균을 취하여 2개의 새로운 참조 샘플들(bdryleft red)을 획득할 수 있다. 따라서, 비디오 신호 처리 장치는 총 4개의 새로운 참조 샘플들을 획득할 수 있다. 비디오 신호 처리 장치는 4개의 새로운 참조 샘플들에 기초하여 매트릭스 벡터 곱셈 과정을 수행할 수 있다. 이때, 비디오 신호 처리 장치는 추가적인 선형 보간(예, 단일 단계 선형 보간)을 수행하지 않고(skip interpolation) 현재 블록의 예측 블록을 획득할 수 있다. 현재 블록의 크기가 4 x 4인 경우, 현재 블록의 예측 블록의 샘플 수는 16개일 수 있고, 이는 매트릭스 벡터 곱셈 과정을 위한 샘플 수와 동일할 수 있다.
도 23은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭(Intra Template Matching)을 나타낸 도면이다.
비디오 신호 처리 장치는 인트라 템플릿 매칭을 수행할 때, 현재 프레임/슬라이스 내의 정해진 탐색 영역 내에서 현재 코딩/예측 블록의 템플릿과 유사도가 높은 또는 코스트가 가장 낮은 템플릿을 찾고, 찾은 템플릿에 대응되는 블록을 현재 블록의 예측 블록으로 사용할 수 있다. 도 23을 참조하면, 정해진 탐색 영역은 현재 CTU를 포함하여 4개의 영역(R1, R2, R3, R4)일 수 있다. R1은 현재 코딩/예측 블록이 포함된 CTU 일수 있으며, R2, R3, R4와 이웃하는 CTU일 수 있다. CTU의 크기는 32, 64, 128, 256일 수 있고, 정사각형 형태일 수 있다. 도 23을 참조하면, 템플릿(도 23의 2301, 2302)은 L자 형태로 구성될 수 있고, 템플릿의 크기는 4일 수 있다. 하지만, 크기를 4로 한정하지는 않는다. 비디오 신호 처리 장치는 정해진 탐색 영역 내의 템플릿에 대해 코스트가 가장 낮은 템플릿을 찾기 위해 SATD(Sum of Absolute Transformed Differences) 방법을 사용할 수 있다. 또한, 비디오 신호 처리 장치는 인트라 템플릿 매칭을 위해 아다마르 변환(Hadamard transform)을 사용할 수 있다. 본 명세서에서는 설명의 편의를 위해 정해진 탐색 영역, CTU 크기, 형태, 템플릿 형태, 크기를 예시하였으나, 이에 한정되지는 않는다.
도 24는 본 발명의 일 실시예에 따른 DIMD 방법과 관련된 신호의 인코딩/디코딩 과정을 나타낸 도면이다.
DIMD 방법을 이용한 예측을 수행하기 위해 비디오 신호 처리 장치는 도 16 내지 도 19에서 설명한 ModeA와 ModeB를 유도할 수 있다. DIMD 예측 방법에서는 상기 도 16 내지 도 19에서 설명된 방법에 의해 첫번째 모드와 두번째 모드를 유도할 수 있다. 비디오 신호 처리 장치는 ModeA, ModeB 및 평면(planar) 모드를 중첩하여 현재 블록의 최종 예측 블록을 생성할 수 있다. ModeA와 ModeB는 DIMD 모드로 기술될 수 있다. ModeA와 ModeB가 각도 모드인 경우, ModeA와 ModeB는 현재 블록(예, 코딩 블록, 변환 블록, 예측 블록)의 크기에 기초하여 확장 각도(Wide Angle)모드로 변환될 수 있다. 변환된 확장 각도 모드에 기초하여 비디오 신호 처리 장치는 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 DIMD 방법을 이용하여 예측된 예측 블록의 잔차 신호에 대해 변환 과정을 수행할 수 있다. 이때, 변환 과정을 위한 변환 방법은 MTS 또는 LFNST일 수 있다. MTS와 LFNST는 인트라 예측 모드에 기반한 것으로, 비디오 신호 처리 장치는 MTS와 LFNST 각각의 변환 커널 세트를 유도할 수 있다. 각각의 커널 세트는 복수개의 커널 후보들로 구성될 수 있다. DIMD 방법으로 유도된 인트라 예측 모드는 현재 블록의 주변 샘플 정보에 기초하여 유도된 모드일 수 있고, 0 내지 67 번 각도 모드일 수 있다. 따라서, DIMD 모드로 유도된 인트라 예측 모드에 대해서는 확장 각도 모드로의 변환 과정이 생략될 수 있다. 비디오 신호 처리 장치는 DIMD 모드로 유도된 인트라 예측 모드에 대해서는 확장 각도 모드로의 변환 없이 현재 블록의 예측 블록들을 생성할 수 있다. 또한, 비디오 신호 처리 장치는 MTS 또는 LFNST의 변환 커널 세트를 유도함에 있어서도 DIMD 모드로 유도된 인트라 예측 모드에 대해서는 확장 각도 모드로의 변환 없이 MTS 또는 LFNST의 변환 커널 세트를 유도할 수 있다.
도 25는 본 발명의 일 실시예에 따른 MIP 및/또는 인트라 TMP 방법과 관련된 신호의 인코딩/디코딩 과정을 나타낸 도면이다.
비디오 신호 처리 장치는 도 20 내지 도 22를 통해 설명한 MIP 방법에 기초하여 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 도 23을 통해 설명한 인트라 TMP 방법에 기초하여 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 MIP 방법 및 인트라 TMP 방법 중 어느 하나에 기초하여 생성되는 예측 블록의 잔차 신호에 대해 변환 과정을 수행할 수 있다. 변환 과정을 위한 변환 방법은 MTS 또는 LFNST일 수 있다. 비디오 신호 처리 장치는 MTS와 LFNST 각각의 변환 커널 세트를 유도할 수 있다. 각각의 커널 세트는 복수개의 커널 후보들로 구성될 수 있다. MIP 방법과 인트라 TMP 방법이 사용되는 경우, 인트라 예측 모드는 존재하지 않을 수 있다. 따라서, 변환 과정에 있어, 비디오 신호 처리 장치는 MTS 또는 LFNST를 생략하거나 제한된 변환 커널 세트를 적용할 수 있다.
비디오 신호 처리 장치는 MIP 방법과 인트라 TMP 방법이 사용됨에 따라, 인트라 예측 모드 없이 현재 블록의 예측 블록이 생성되는 경우, MIP 방법 또는 TMP 방법이 적용된 블록에 MTS 또는 LFNST를 적용하기 위해 DIMD 모드를 유도하는 과정을 수행할 수 있다. 비디오 신호 처리 장치는 유도한 DIMD 모드에 기초하여 MTS 또는 LFNST의 변환 커널 세트를 유도할 수 있다. MTS와 LFNST 각각의 변환 커널 세트를 유도하기 위해, 비디오 신호 처리 장치는 확장 각도 모드로의 변환 과정을 수행할 수 있다. DIMD 방법으로 유도된 인트라 예측 모드는 현재 블록의 주변 샘플 정보에 기초하여 유도된 모드일 수 있고, 0 내지 67 번 각도 모드일 수 있다. 따라서, DIMD 모드로 유도된 인트라 예측 모드에 대해서는 확장 각도 모드로의 변환 과정이 생략될 수 있다.
비디오 신호 처리 장치는 디코딩 과정에 있어, 역양자화를 수행한 신호에 대해 MTS 또는 LFNST 변환을 수행할 수 있다. 비디오 신호 처리 장치는 MIP 방법 또는 인트라 TMP 방법이 적용된 블록에 대해 MTS 또는 LFNST 변환을 수행하기 전 DIMD 모드를 유도하고, DIMD 모드에서 유도된 인트라 예측 모드에 기초하여 MTS 또는 LFNST 변환을 수행할 수 있다. 이때, 확장 각도 모드로의 변환 과정은 생략될 수 있다.
비디오 신호 처리 장치는 역양자화를 수행한 신호에 대해 MTS 또는 LFNST 변환을 수행할 수 있다. 비디오 신호 처리 장치는 DIMD 방법이 적용된 블록에 MTS 또는 LFNST 변환을 수행하기 전 DIMD 모드를 유도할 수 있고, DIMD 모드로 유도된 인트라 예측 모드에 기초하여 MTS 또는 LFNST 변환을 수행할 수 있다. 이때, 확장 각도 모드로의 변환 과정은 생략될 수 있다.
상술한 본 명세서에 따른 MTS 또는 LFNST 변환과 관련된 동작은 LFNST와는 다른 형태의 비-분리 변환(Non-Separable Primary Transform, NSPT)에도 적용될 수 있다. 예를 들어, 비디오 신호 처리 장치는 DIMD 모드에서 유도된 인트라 예측 모드에 기초하여 NSPT를 위한 변환 커널 세트를 유도할 수 있다. 또한 비디오 신호 처리 장치는 NSPT를 위한 변환 커널 세트에 기초하여 NSPT 변환을 수행할 수 있다.
도 26은 본 발명의 일 실시예에 따른 2차 변환의 입력 벡터와 인트라 예측 모드와의 관계를 나타내는 도면이다.
2차 변환은 2차 변환 커널 행렬과 입력 벡터의 곱으로 계산이 될 수 있다. 비디오 신호 처리 장치는 1차 변환된 계수 블록의 좌-상단 서브 블록 내의 계수들을 벡터 형태로 구성할 수 있다. 벡터는 인트라 예측 모드에 의존적으로 구성될 수 있다. 예를 들어, 인트라 예측 모드가 도 6의 인덱스 34보다 같거나 작은 인덱스에 대응되는 예측 모드이거나 크로마의 선형 관계를 이용하여 크로마 샘플을 예측하는 INTRA_LT_CCLM, INTRA_T_CCLM, INTRA_L_CCLM 모드일 경우, 비디오 신호 처리 장치는 1차 변환된 계수 블록의 좌-상단 서브 블록을 가로 방향으로 스캔하여 계수들을 벡터 형태로 구성할 수 있다. 1차 변환된 계수 블록의 좌-상단 n x n 블록의 i번째 행, j번째 열의 원소는 x_ij라고 기술될 수 있다. 이때, 벡터화된 계수는 [x_00,x_01, ..., x_0n-1, x_10, x_11, …, x_1n-1, ..., x_n-10, x_n-11, ..., x_n-1n-1]로 표현될 수 있다. 반면, 인트라 예측 모드가 도 6의 인덱스 34보다 큰 인덱스에 대응되는 예측 모드인 경우, 비디오 신호 처리 장치는 1차 변환된 계수 블록의 좌-상단 서브 블록을 세로 방향으로 스캔하여 계수들을 벡터 형태로로 구성할 수 있다. 벡터화된 계 수는 [x_00, x_10, ..., x_n-10, x_01, x_11, ..., x_n-11, ..., x_0n-1, x_1n-1, ..., x_n-1n-1]로 표현될 수 있다.
2차 변환된 계수들은 벡터 형태이므로, 2차원 형태의 데이터로 표현될 수 있다. 기 설정된 스캔 순서에 따라 2차 변환된 계수들은 변환 블록의 좌-상단 서브 블록에 할당될 수 있다. 기 설정된 스캔 순서는 우-상측 대각(up-right diagonal) 스캔 순서일 수 있다.
도 27은 본 명세서의 일 실시예에 따른 2차 변환의 입력 벡터를 구성하는 방법을 나타내는 도면이다.
도 27은 순방향 1차 변환 계수를 순방향 LFNST의 입력 벡터로 사용하기 위한 방법을 나타낸다. 도 14에서 설명한 바와 같이 순방향 1차 변환(Forward Primary Transform) 계수를 순방향 LFNST의 입력 벡터로 사용하기 위해서는 도 26에서 설명한 방법을 적용할 수 있다. 도 27을 참조하면 LFNST16의 ROI는 6개의 4 x 4 서브 블록에 해당할 수 있다(도 27(b), (c) 참조). 총 96개의 1차 변환 계수가 사용될 수 있고, LFNST16의 변환 커널의 행렬은 32 x 96일 수 있다. 총 96개의 변환 계수가 96x1의 입력 벡터 형태로 구성될 수 있다.
도 27(a)를 참조하면 현재 블록은 16개의 4 x 4 크기의 서브 블록으로 구성될 수 있고, 각 서브 블록은 0 내지 15의 인덱스로 각각 매핑될 수 있다. 이때, LFNST16의 ROI는 인덱스 0, 4, 8, 1, 5, 2에 대응되는 서브 블록에 해당하는 영역일 수 있다.
도 27(b)를 참조하면 입력 벡터 구성을 위해 수평(가로) 방향 스캔 순서가 사용될 수 있다. 즉, 비디오 신호 처리 장치는 인덱스 0, 1, 2, 4, 5, 8에 대응되는 서브 블록 순으로 변환 계수를 스캔할 수 있다. 다시 말하면 연속된 인덱스 0, 1, 2의 서브 블록들의 가로 방향으로 첫번째 행의 12개의 샘플들이 순서대로 스캔되고, 다음으로 두번째 행의 12개의 샘플들이 스캔되고, 다음으로 세번째 행의 12개의 샘플들이 스캔될 수 있고, 다음으로 네번째 행의 12개의 샘플들이 스캔될 수 있다. 그리고 연속되는 인덱스 4, 5의 서브 블록들의 가로 방향으로 다섯번째부터 여덟번째 행의 각 4개의 샘플들이 스캔될 수 있다. 그리고, 인덱스 8의 서브 블록들의 가로 방향으로 9번째부터 12번째 행의 각 4개의 샘플들이 스캔될 수 있다. 현재 블록의 부호화 모드가 인덱스 34의 인트라 예측 모드보다 큰 인덱스에 대응되는 인트라 예측 모드인 경우, 도 27(c)와 같이 수직(세로)방향의 스캔 순서에 따라 입력 벡터가 구성될 수 있다. 즉, 비디오 신호 처리 장치는 0, 4, 8, 1, 5, 2에 대응되는 서브 블록 순으로 변환 계수를 스캔하여 입력 벡터를 구성할 수 있다.
도 28은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭을 위한 현재 블록의 템플릿의 방향성 정보를 유도하는 과정을 나타낸 도면이다.
인트라 템플릿 매칭을 위한 현재 블록의 템플릿의 방향성 정보를 유도하는 과정은 현재 블록의 각 컬러 성분(즉, 루마 성분, 크로마(Cb, Cr) 성분) 별로 적용될 수 있다. 또는 크로마 성분 중 어느 하나(Cb 또는 Cr)에 대해서만 인트라 템플릿 매칭을 위한 현재 블록의 템플릿의 방향성 정보를 유도하는 과정이 적용되고, 유도 과정에 따른 결과는 나머지 크로마 성분에 사용될 수 있다. 인트라 템플릿 매칭을 위한 현재 블록의 템플릿의 크기는 4일 수 있다. 비디오 신호 처리 장치는 도 17, 18에서 상술한 방법을 템플릿에 사용하여 인트라 예측 방향성 정보를 유도할 수 있다. 비디오 신호 처리 장치는 3 x 3 단위의 템플릿에 소벨 필터를 적용할 수 있다. 비디오 신호 처리 장치는 유도한 인트라 예측 방향성 정보(모드)를 히스토그램 형태로 나타낼 수 있고, 빈도가 높은 순으로 정렬할 수 있다. 또는, 비디오 신호 처리 장치는 현재 블록 대신 탐색 영역에서 템플릿 매칭으로 찾은 매칭 블록의 템플릿을 사용하여 인트라 예측 방향성 정보를 유도할 수 있다.
도 29는 본 발명의 일 실시예에 따른 인트라 예측 방향성 정보를 유도하기 위한 템플릿 형태를 나타낸 도면이다.
본 명세서에서 기술하고 있는 바와 같이 인트라 예측 방향성 정보를 유도하기 위한 방법은 DIMD 방법이라 기술될 수도 있다.
도 29(a)는 인트라 예측 방향성 정보를 유도하기 위한 현재 블록의 상측에 위치한 템플릿을 나타낸다. 비디오 신호 처리 장치는 현재 블록의 상측에 위치한 템플릿만을 사용하여 인트라 예측 방향성 정보를 유도할 수 있다. 도 29(b)는 인트라 예측 방향성 정보를 유도하기 위한 현재 블록의 좌측에 위치한 템플릿을 나타낸다.비디오 신호 처리 장치는 현재 블록의 좌측에 위치한 템플릿만을 사용하여 인트라 예측 방향성 정보를 유도할 수 있다. 도 28, 도 29에 도시된 템플릿에 기초하여 유도되는 인트라 예측 방향성 정보는 인트라 예측 모드로 사용될 수 있다. 비디오 신호 처리 장치는 인트라 예측 모드에 기초하여 인트라 템플릿 매칭 블록에 MTS를 적용할 수 있다. 또한, 비디오 신호 처리 장치는 인트라 예측 모드에 기초하여 인트라 템플릿 매칭 블록에 LFNST를 적용할 수도 있다. 유도된 인트라 예측 방향성 정보는 컬러 성분 별로 획득될 수 있다. 즉, 인트라 예측 방향성 정보는 루마, 크로마 별로 유도가 가능할 수 있다. 비디오 신호 처리 장치는 컬러 성분 별로 MTS, LFNST 커널 세트를 유도할 수 있고, 복수개의 커널 세트에 대해서도 유도 가능하다. 이때, 비디오 신호 처리 장치는 Cb, Cr 성분 중 하나에서만 인트라 예측 방향성 정보를 유도할 수 있다. 인트라 블록 매칭이 적용된 블록에서는 인트라 예측 모드 정보가 없기 때문에 MTS와 LFNST가 사용되지 않거나 제한된 MTS, LFNST가 적용될 수 있다. 비디오 신호 처리 장치가 유도한 인트라 예측 방향성 정보는 복수 개일 수 있다. 비디오 신호 처리 장치는 복수 개의 인트라 예측 방향성 정보에 대해 MTS 또는 LFNST를 적용하여 코딩 이득이 큰 인트라 예측 방향성 정보를 결정할 수 있고, 결정된 인트라 예측 방향성 정보에 기초하여 커널 세트를 유도할 수 있다. 그리고, 비디오 신호 처리 장치는 유도한 커널 세트 내 커널 후보들을 시그널링할 수 있다. 예를 들어, 인코더는 커널 후보들을 지시하는 신택스 요소 mts_idx 및/또는 lfnst_idx를 포함하는 비트스트림을 생성할 수 있다. 디코더는 비트스트림에 포함된 mts_idx 및/또는 lfnst_idx를 파싱하여 커널 후보를 결정할 수 있다. 비디오 신호 처리 장치는 가장 높은 빈도수를 가진 모드 하나에 대한 MTS 또는 LFNST 커널 세트를 유도할 수 있다. mts_idx 와 lfnst_idx는 컬러 성분 별(예, Y, Cb, Cr) 또는 루마와 크로마 성분별로 파싱될 수 있다.
도 30은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록에 적용되는 MTS 세트를 나타낸 도면이다.
일반적인 인트라 템플릿 매칭 블록에서는 인트라 예측 정보가 없을 수 있다. 따라서, 비디오 신호 처리 장치는 현재 블록의 예측 블록의 크기별로 MTS 세트와 각 세트 별 커널 종류를 설정하여 사용할 수 있다. 예를 들어, 블록의 크기는 4x4, 4x8, 4x16, 4x32, 8x4, 8x8, 8x16, 8x32, 16x4, 16x8, 16x16, 16x32, 32x4, 32x8, 32x16, 32x32일 수 있다. 또한, 블록의 크기는 32 보다 큰 경우, 예를 들어, 가로 또는 세로의 길이가 64인 경우로 확장될 수 있다. 도 30(a)를 참조하면, 인트라 템플릿 매칭 블록을 위한 변환 세트는 블록의 크기마다 설정될 수 있다. 변환 세트는 기존의 인트라 모드와 블록 크기 기반 변환 세트에 추가된 형태일 수 있다. 도 30(b)는 각 변환 세트 별 설정된 커널 후보들 중 일부를 나타낸다. 각 변환 세트별로 설정된 변환 커널 후보들의 개수는 4개 또는 6개일 수 있다. 변환 커널 후보는 상술한 표 1의 변환 커널 조합들 중에서 지시될 수 있다. 비디오 신호 처리 장치는 인트라 템플릿 블록 매칭에 적합한 변환 커널 후보를 실험을 통해 찾을 수 있다.
인트라 템플릿 매칭 방법은 인터 예측 모드의 특성을 지니므로, 인트라 템플릿 매칭 블록에 적용할 MTS 방법을 인터 예측 모드 기반의 MTS 방법을 적용할 수 있다. 예를 들어, 인코더는 인트라 템플릿 매칭이 적용된 블록에 대한 최적의 변환 세트에 대한 인덱스 정보를 포함하는 비트스트림을 생성할 수 있다. 이때, 최적의 변환 세트는 {(DST7, DST7), (DST7, DCT8), (DCT8, DST7), (DCT8, DCT8)} 중 어느 하나일 수 있다. 디코더는 비트스트림에 포함된 인덱스 정보를 파싱하여 결정되는 최적의 변환 세트에 기초하여 현재 블록에 대한 변환 세트를 결정할 수 있다.
도 31, 도 32는 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 적용 여부를 지시하는 플래그를 포함하는 신택스 구조를 나타낸 도면이다.
도 31을 참조하면 현재 블록에 대한 인트라 템플릿 매칭 적용 여부를 지시하는 플래그(신택스요소)는 코딩 유닛 신택스 구조에 포함될 수 있다. 인트라 예측 방법을 지시하는 플래그는 DIMD, BDPCM, Intra TMP, MIP, TIMD, MRL, ISP, MPM을 지시하는 순서로 시그널링 및/또는 파싱될 수 있다. 먼저 비디오 신호 처리 장치는 DIMD의 적용 여부를 지시하는 플래그(cu_dimd_flag)를 파싱 및/또는 시그널링 할 수 있다. 비디오 신호 처리 장치는, cu_dimd_flag의 값이 0인 경우(DIMD가 적용되지 않는 경우)에 루마 성분에 대해 BDPCM이 적용되는 지 여부를 나타내는 플래그(intra_bdpcm_luma_flag)를 파싱 및/또는 시그널링할 수 있다. 비디오 신호 처리 장치는 cu_dimd_flag와 intra_bdpcm_luma_flag의 값이 모두 0인 경우(DIMD가 적용되지 않고, BDPCM이 적용되지 않는 경우), Intra TMP의 적용 여부를 지시하는 플래그(intra_tmp_flag)를 파싱 및/또는 시그널링할 수 있다. intra_mip_flag 이후 플래그들은 cu_dimd_flag, intra_bdpcm_luma_flag 및 intra_tmp_flag의 값이 모두 0인 경우에 파싱 및/또는 시그널링될 수 있다.
도 32를 참조하면, 현재 블록에 대한 인트라 예측 방법을 지시하는 플래그는 TIMD, BDPCM, Intra TMP, MIP, DIMD, MRL, ISP, MPM을 지시하는 순서로 시그널링 및/또는 파싱될 수 있다. 비디오 신호 처리 장치는 TIMD의 적용 여부를 지시하는 플래그(cu_timd_flag)를 파싱 및/또는시그널링 할 수 있다. 비디오 신호 처리 장치는 cu_timd_flag의 값이 0인 경우(TIMD가 적용되지 않는 경우) intra_bdpcm_luma_flag를 파싱 및/또는시그널링 할 수 있다. 비디오 신호 처리 장치는 cu_timd_flag와 intra_bdpcm_luma_flag의 값이 모두 0인 경우, intra_tmp_flag를 파싱 및/또는 시그널링 할 수 있다. intra_mip_flag 이후 플래그들은 cu_timd_flag, intra_bdpcm_luma_flag 및 intra_tmp_flag의 값이 모두 0인 경우에 파싱 및/또는 시그널링될 수 있다. 비디오 신호 처리 장치는 MRL(Multi Reference Line)적용 여부를 지시하는 신택스 요소(intra_luma_ref_idx)는 현재 블록(예, 예측 블록)에 DIMD가 적용되는지 여부를 나타내는 플래그(intra_dimd_flag)의 값이 0인 경우(DIMD가 적용되지 않는 경우)에만 시그널링 및/또는 파싱할 수 있다.
도 33은 LFNST의 적용 여부를 지시하는 신택스 요소의 파싱 방법을 나타낸 신택스 구조를 나타낸 도면이다.
도 33을 참조하면 현재 블록에 대한 LFNST의 적용 여부를 지시하는 신택스 요소(lfnst_idx)는 IntraTmp가 적용되는 경우(IntraTmpFlag[x0][y0]값이 0이 아닌 경우) 파싱될 수 있다(도 33의 3301). 상기 변수 IntraTmpFlag[ x ][ y ]는 intra_tmp_flag의 값으로 설정될 수 있다. IntraTmpFlag[ x ][ y ]에서 x는 x0..x0 + cbWidth - 1이고, y는 y0..y0 + cbHeight - 1일 수 있다. 인트라 템플릿 매칭이 적용된 코딩 블록에는 상대적으로 LFNST의 효과가 적을 수 있다. LFNST의 적용 여부는 루마 성분 블록뿐 아니라, 크로마 성분 블록에 대해서도 판단될 수 있다. 이때, LFNST의 적용 여부가 크로마 성분 블록에 대해서 판단될 때, Cb, Cr 공통적으로 판단되거나 각각 판단될 수 있다. LFNST의 적용 여부가 크로마 성분 블록에 대해 지시되는 경우, 컬러 성분을 지시하는 변수(채널타입변수)가 추가적으로 포함될 수 있다. 예를 들어, IntraTmpFlag[ x ][ y ]는 IntraTmpFlag[채널타입변수][ x ][ y ]로, lfnst_idx는 lfnst_idx[채널타입변수] 형태로 표현될 수 있다. 또한, LFNST의 적용 여부를 지시하는 신택스 요소는 각 컬러 성분 별 블록 크기에 기초하여 파싱될 수 있다.
도 34은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록의 인트라 프로파게이션(propagation)을 나타낸 도면이다.
인트라 템플릿 블록 매칭이 적용된 블록에는 인트라 예측 모드 정보가 없기 때문에 기 설정된 인트라 예측 모드들 중 하나가 인트라 예측 모드 맵에 저장될 수 있다. 상기 기 설정된 인트라 예측 모드들은 평면 모드, DC 모드, 각도 모드일 수 있다. 4 x 4 단위로 인트라 예측 모드가 인트라 예측 모드 맵에 적용될 수 있다. 인트라 예측 모드 맵에 저장된 인트라 예측 모드는 비디오 신호 처리 장치가 현재 예측 블록의 MPM 리스트를 구성할 때 사용될 수 있다. 비디오 신호 처리 장치는 현재 블록의 인트라 예측 모드 맵에 템플릿 매칭 블록의 인트라 예측 모드 맵 정보를 저장할 수 있다. 템플릿 매칭 블록의 위치와 인트라 예측 모드 맵이 일치하지 않는 경우, 비디오 신호 처리 장치는 템플릿 매칭 블록의 4 x 4 단위의 기 설정된 위치가 포함된 곳의 인트라 예측 모드 맵 정보를 현재 블록의 인트라 예측 모드 맵에 저장할 수 있다. 기 설정된 위치는 4 x 4 단위의 블록의 각 모서리 위치 중 어느 하나이거나 블록의 중앙 위치일 수 있다.
도 35는 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록의 탐색 방법에 따른 해쉬 키를 적용하는 방법을 나타낸 도면이다.
비디오 신호 처리 장치는 해쉬 키(Hash Key)기반의 템플릿 매칭 블록에 대한 탐색을 수행할 수 있다. 비디오 신호 처리 장치는 인트라 템플릿 매칭 블록이 적용되는 모든 템플릿 크기에 대하여, 현재 블록의 템플릿과 템플릿 매칭 블록의 템플릿 사이의 해쉬 키(32 비트 CRC(cyclical redundancy check)) 매칭을 수행할 수 있다. 해쉬 키는 4 x 4 블록(서브 블록) 단위로 계산될 수 있다. 비디오 신호 처리 장치는 4 x 4 보다 큰 템플릿 블록의 해쉬 키 매칭을 위해 현재 블록의 템플릿과 템플릿 매칭 블록의 템플릿의 해쉬 키가 일치하는지 여부를 확인할 수 있다. 구체적으로, 비디오 신호 처리 장치는 현재 블록의 템플릿의 해쉬 키와 템플릿 매칭 블록의 템플릿 모든 4 x 4 블록(서브 블록, 도 35의 3501 내지 3505)) 각각의 해쉬 키가 일치하는지 여부를 확인할 수 있다. 비디오 신호 처리 장치는 현재 블록의 템플릿과 해쉬 키가 매칭(일치)하는 템플릿 매칭 블록의 템플릿들에 대한 코스트를 계산하고, 최소 코스트에 대응되는 템플릿에 대응되는 블록을 현재 블록의 예측 블록으로 결정할 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록의 템플릿과 해쉬 키가 일치하는 하나 이상의 템플릿 매칭 블록의 템플릿과 현재 블록의 템플릿 간 유사도(코스트)를 계산하여, 유사도가 가장 높은(최소 코스트) 템플릿에 대응되는 블록을 현재 블록의 예측 블록으로 결정할 수 있다. 비디오 신호 처리 장치는 도 23의 탐색 구간 내에서 4 x 4 단위로 탐색을 수행할 수 있다.
도 36은 본 발명의 일 실시예에 따른 인트라 템플릿 매칭 블록 탐색을 위한 기 설정된 위치를 나타낸 도면이다.
인트라 템플릿 매팅 블록 탐색을 위한 탐색 영역은 4 CTU 크기 일 수 있다. 비디오 신호 처리 장치는 탐색 영역의 기 설정된 위치(예를 들어, 도 36의 x 부분)의 템플릿과 현재 블록의 템플릿 간 코스트를 계산하고, 가장 작은 코스트에 대응되는 위치의 블록을 매칭 블록으로 결정할 수 있다. 기 설정된 위치는 균등 또는 비균등하게 결정될 수 있다. 예를 들어, 기 설정된 위치가 균등하게 결정되는 경우, 2 또는 4의 배수 단위로 결정될 수 있고, 비균등하게 결정되는 경우, 위치는 미리 설정되어 있을 수 있다. 도 36을 참조하면 현재 CTU에 해당하는 R1에 포함되는 기 설정된 위치는 복원된 영역일 수 있다.
도 37은 본 발명의 일 실시예에 따른 코딩 유닛 신택스 구조를 나타낸 도면이다.
도 37의 신택스 구조 내 신택스 요소들은 도 31 내지 도 33에 도시된 신택스 요소들과 동일할 수 있다. 도 37을 참조하면 Intra TMP의 적용 여부를 지시하는 플래그(intra_tmp_flag)는 인트라 템플릿 매칭 블록의 최대 크기에 기초하여 파싱 및 시그널링될 수 있다. 인트라 템플릿 매칭 블록의 최대 크기는 슬라이스 타입별로 설정될 수 있다. 또는 인트라 템플릿 매칭 블록의 최대 크기는 컬러 성분(Y, Cb, Cr)별로 설정될 수 있고, 크로마 성분 루마 성분에 따라 설정될 수 있다. 예를 들어, 슬라이스 타입이 I 슬라이스이면 현재 블록(예, 코딩 블록)의 너비(cbWidth)는 템플릿 매칭이 적용 가능한 최대 블록 크기(TMPSize)보다 같거나 작고, 현재 블록의 높이(cbHeight)는 TMP크기보다 같거나 작을 수 있다(즉, cbWidth <= TMPSize , cbHeight <= TMPSize). 슬라이스 타입이 I 슬라이스가 아니면 현재 블록의 너비는 TMP 최대 크기(TMP_MaxSize)보다 같거나 작고, 현재 블록의 높이는 TMP 최대 크기보다 같거나 작을 수 있다(cbWidth <= TMP_MaxSize , cbHeight <= TMP_MaxSize). TMP_MaxSize는 64이거나 16, 32, 128, 256 중 어느 하나일 수 있다. TMPSize는 TMP_MaxSize 보다 작을 수 있다. TMP_MaxSize가 존재하지 않는 경우, TMPSize는 CTU 크기를 넘지 않는 정수로 설정될 수 있다. 이하 Intra_tmp_flag의 파싱 조건에 대해 설명한다.
(조건 1)
(sps_tmp_enable_flag && !cu_dimd_flag && ((sh_slice_type !=I && cbWidth <= TMP_MaxSize && cbHeight <= TMP_MaxSize) || (sh_slice_type==I && cbWidth<=TMPSize && cbHeight<=TMPSize)))
를 만족하는 경우, intra_tmp_flag는 파싱될 수 있다. sps_tmp_enable_flag는 인트라 TMP의 활성화 여부를 나타내는 신택스 요소로 SPS 레벨에서 시그널링될 수 있다. sps_tmp_enable_flag의 값이 1이면 인트라 TMP가 활성화됨을 나타낼 수 있고, sps_tmp_enable_flag의 값이 0이면 인트라 TMP가 비활성화됨을 나타낼 수 있다. 조건 1에 따르면 i) sps_tmp_enable_flag가 인트라 TMP가 활성화됨을 나타내고, ii) cu_dimd_flag가 DIMD가 적용되지 않음을 나타내고, iii) 슬라이스 타입이 I 슬라이스이면 현재 블록의 너비 및 높이가 TMP크기(TMPSize)보다 같거나 작거나 슬라이스 타입이 I 슬라이스가 아니면 현재 블록의 너비는 TMP 최대 크기(TMP_MaxSize)보다 같거나 작으면, intra_tmp_flag는 파싱될 수 있다.
조건 1의 !cu_dimd_flag는 신택스 구조에 따라 포함되거나 포함되지 않을 수 있다.
(조건 2)
(sps_tmp_enable_flag && !cu_dimd_flag && !Intra_bdpcm_luma_flag && ((sh_slice_type !=I && cbWidth <= TMP_MaxSize && cbHeight <= TMP_MaxSize) || (sh_slice_type==I && cbWidth<=TMPSize && cbHeight<=TMPSize)))
를 만족하는 경우, intra_tmp_flag는 파싱될 수 있다. 조건 2는 조건 1에 !Intra_bdpcm_luma_flag 에 대한 조건이 추가된 것일 수 있다. 조건 2에 따르면 조건 1의 i) 내지 iii)에 더하여 iv) BDPCM이 적용되지 않는 경우, intra_tmp_flag는 파싱될 수 있다.
intra_tmp_flag, TMP_MaxSize, TMPSize 들은 컬러 성분(Y, Cb, Cr)별로 또는 루마와 크로마 별로 각기 설정될 수 있다.
인트라 템플릿 매칭이 적용된 블록은 인터 예측 모드의 특성을 가지므로, 디블록킹 필터링에서 경계 부분의 필터링 세기(bS)를 결정할 때, 인터 예측 모드에서 필터링 세기를 결정하는 방법이 사용될 수 있다. 예를 들어, 필터링 세기를 결정하는 과정에서 p와 q 블록 중에서 어느 하나라도 인트라 템플릿 매칭이 적용되었을 경우, p와 q 블록 사이의 경계에 대한 필터링 세기는 1로 설정될 수 있다. 필터링 세기가 클수록 강한 필터링을 의미하며 필터링 세기가 0이면 필터링이 수행되지 않음을 의미할 수 있다. 예를 들어, 필터링 세기가 1(약한 필터링)이면 필터링 세기가 2(강한 필터링)인 경우보다 약한 필터링을 의미할 수 있다. 강한 필터링은 p 블록과 q 블록 사이의 경계 주변의 임의의 개수 이상의 화소 값을 변경할 수 있으며, 약한 필터링은 임의의 개수보다 적은 화소 값을 변경할 수 있다. 임의의 개수는 정수로 6일 수 있다. 또는, p와 q 블록 모두 인트라 템플릿 매칭이 적용되었을 경우, p와 q 블록 간의 블록 벡터(block vector) 차이에 따라 필터링의 세기가 결정될 수 있다. 예를 들어, 필터링 세기를 결정하는 과정에서 p와 q 블록이 모두 인트라 템플릿 매칭이 적용되고, p와 q 블록 간의 블록 벡터(block vector) 차이가 임의의 정해진 수 이상인 경우, p와 q 블록 사이의 경계에 대한 필터링 세기는 1로 설정될 수 있다. 이때, 임의의 정해진 수는 정수로 1일 수 있다.
도 38은 본 발명의 일 실시예에 따른 인트라 TMP가 적용되는 블록을 위한 변환 세트를 선택하는 방법을 나타낸 도면이다.
인트라 TMP가 적용된 블록의 너비와 높이는 제한적일 수 있다. 예를 들어, 인트라 TMP가 적용된 블록의 너비와 높이는 각각 64일 수 있다. 인트라 TMP가 적용된 블록을 위한 수평 방향 변환 커널은 DCT2이고, 수직 방향 변환 커널은 DCT2 일 수 있다. 인트라 TMP가 적용된 블록의 너비가 특정 조건을 만족하는 경우, 수평 방향 변환 커널은 DST7일 수 있다. 인트라 TMP가 적용된 블록의 높이가 특정 조건을 만족하는 경우, 수직 방향 변환 커널은 DST7일 수 있다. 한편, 인트라 TMP가 적용된 블록의 너비가 특정 조건을 만족하지 않는 경우, 수평 방향 변환 커널은 DST2일 수 있고, 인트라 TMP가 적용된 블록의 높이가 특정 조건을 만족하지 않는 경우, 수직 방향 변환 커널은 DST2일 수 있다. 특정 조건은 인트라 TMP가 적용된 블록의 너비(또는 높이)가 4보다 같거나 크고 16보다 같거나 작은 경우일 수 있다. 비디오 신호 처리 장치는 인트라 TMP가 적용되는 블록을 위한 MTS 세트를 결정할 수 있다. MTS 세트는 DIMD 방법으로 유도된 인트라 예측 모드를 사용하여 결정될 수 있다. 비디오 신호 처리 장치는 결정된 MTS 세트를 구성하는 변환 커널 후보들에 대한 코스트를 계산하고, 가장 작은 코스트에 대응되는 변환 커널 후보를 사용할 수 있다. 도 38을 통해 설명한 방법은, 인트라 TMP가 적용된 블록의 너비(또는 높이)가 4보다 같거나 크고 16보다 같거나 작은 경우를 제외한 블록에 적용될 수 있다. 즉, 도 38을 통해 설명한 방법은, 인트라 TMP가 적용된 블록의 너비(또는 높이)가 4보다 작거나 16보다 큰 경우에 해당하는 블록에 적용될 수 있다. 이때, 비트스트림에 포함되는 변환 커널 후보를 나타내는 MTS 인덱스의 파싱 조건은 다음과 같다.
(조건 1)
Cu.IntraTmpFlag && Width>제1 기준 값 && Height > 제2 기준 값
현재 블록(예, 코딩 블록, 변환 블록)에 인트라 TMP가 적용되는지 여부를 나타내는 플래그(Cu.IntraTmpFlag)가 참(값이 1이고, 인트라 TMP가 적용됨을 나타내는 경우)이고, 현재 블록의 너비가 제1 기준 값보다 크고, 현재 블록의 높이가 제2 기준 값보다 큰 경우, MTS 인덱스는 파싱될 수 있다. 조건 1의 제1 기준 값과 제2 기준 값은 기 설정된 값으로 16일 수 있다. 또한, 제1 기준 값과 제2 기준 값은 서로 다른 값으로 설정될 수 있고, 제1 기준 값과 제2 기준 값은 4, 8, 16, 32 등 중 어느 하나일 수 있다.
한편, 비디오 신호 처리 장치는 도 32의 특정 조건과 무관하게 인트라 TMP가 적용된 모든 블록을 위한 MTS 세트를 결정할 수 있다. MTS 세트는 DIMD 방법으로 유도된 인트라 예측 모드를 사용하여 결정될 수 있다. 비디오 신호 처리 장치는 결정된 MTS 세트에 포함되는 변환 커널에 대한 코스트에 기초하여 사용될 특정 변환 커널을 결정할 수 있다. 이때, 비트스트림에 포함되는 특정 변환 커널을 나타내는 나타내는 MTS 인덱스의 파싱 조건은 다음과 같다.
(조건 2)
Cu.IntraTmpFlag && Width<=제3 기준 값 && Height <= 제4 기준 값
Cu.IntraTmpFlag가 참이고 현재 블록의 너비가 제3 기준 값보다 같거나 작고, 현재 블록의 높이가 제4 기준 값보다 같거나 작은 경우, MTS 인텍스는 파싱될 수 있다. 제3 기준 값과 제4 기준 값은 64일 수 있다. 또한, 제3 기준 값과 제4 기준 값은 인트라 TMP가 적용될 수 있는 최대 크기와 같을 수 있다. 또한, 제3 기준 값과 제4 기준 값은 서로 상이한 값일 수 있다. LFNST를 위한 커널을 나타내는 LFNST 인덱스를 파싱하기 위한 조건도 조건 2와 같을 수 있다.
또는 비디오 신호 처리 장치는 특정 커널 세트에 기초하여 MTS 인덱스를 파싱할 수 있다. 이때에는 인트라 예측 모드 정보가 필요하지 않을 수 있다. 특정 커널 세트는 4 내지 6개의 커널 후보들일 수 있다. 이때의 커널 후보들은 표 1과 같이 구성될 수 있다.
도 39는 본 발명의 일 실시예에 따른 인트라 TMP 블록에 대한 복수 개의 블록 벡터를 나타낸 도면이다.
비디오 신호 처리 장치는 인트라 템플릿 매칭 블록 탐색을 위한 기 설정된 위치의 템플릿과 현재 블록의 템플릿 간 코스트를 계산하여, 가장 작은 코스트에 대응되는 인트라 템플릿 매칭 블록 탐색을 위한 템플릿에 대한 블록 벡터(움직임 벡터)를 계산(획득)할 수 있다. 비디오 신호 처리 장치는 낮은 코스트 순으로 블록 벡터를 정렬하여 저장할 수 있다. 코스트는 현재 블록의 템플릿과 참조 블록의 템플릿(장치는 인트라 템플릿 매칭 블록 탐색을 위한 기 설정된 위치의 템플릿) 샘플들을 이용하여 SAD(Sum of Absolute Differences), MR-SAD(Mean Removed-Sum of Absolute Difference), SATD((Sum of Absolute Transformed Differences) 방법으로 계산될 수 있다. 블록 벡터(움직임 벡터는) 정수 픽셀 단위, 1/2, 1/4, 1/8, 2, 4 픽셀 단위로 표현될 수 있다. 획득된 블록 벡터들 중 실제 사용된 블록 벡터를 첫번째(또는 맨 마지막)로하고, 나머지는 블록 벡터들은 작은 코스트 순으로 정렬되어 저장될 수 있다. 저장된 블록 벡터들은 IBC 코딩 블록의 움직임 벡터 후보로 사용될 수 있다. IBC 코딩 블록의 이웃 블록에 인트라 TMP가 적용된 블록이 존재하는 하는 경우, 비디오 신호 처리 장치는 저장된 블록 벡터들을 사용할 수 있다.
복수개의 인트라 TMP 블록들의 결합을 통해 하나의 인트라 TMP 블록이 예측될 수 있다. 이때, 비디오 신호 처리 장치는 결합에 사용되는 참조 블록들의 블록 벡터를 저장할 수 있다. 이때, 결합되는 참조 블록은 2개 이상의 블록일 수 있다. 비디오 신호 처리 장치는 결합되는 참조 블록의 개수만큼의 블록 벡터들과 상술한 코스트 계산을 통해 획득되는 블록 벡터들을 같이 저장할 수 있다. 결합에 사용된 참조 블록의 블록 벡터만 사용되는 경우, 비디오 신호 처리 장치는 가중치 결합을 사용할 수 있다. 비디오 신호 처리 장치는 가중치에 기초하여 블록 벡터의 저장 순서를 결정할 수 있다. IBC 코딩 블록을 위해 저장된 블록 벡터가 사용되는 경우, 비디오 신호 처리 장치는 블록 벡터의 저장 순서에 기초하여 IBC 코딩 블록에 대한 움직임 후보의 순서를 결정할 수 있다. 예를 들어, 가중치가 큰 블록 벡터는 높은 우선 순위를 가질 수 있다. 결합되는 참조 블록의 블록 벡터들과 코스트 계산을 통해 획득되는 블록 벡터들이 같이 저장되는 경우, 결합되는 참조 블록의 블록 벡터가 높은 우선 순위를 가질 수 있다.
도 40은 본 발명의 일 실시예에 따른 인트라 TMP가 적용된 블록의 인트라 예측 모드를 유도하는 방법을 나타낸 도면이다.
구체적으로, 도 40은 인트라 TMP가 적용된 블록에 MTS와 LFNST를 적용하기 위해 필요한 인트라 예측 모드를 유도하는 방법을 나타낸다. 비디오 신호 처리 장치는 현재 블록의 참조 블록 내에 기 설정된 위치에 저장된 인트라 예측 모드와 참조 블록의 주변(이웃) 블록 내에 기 설정된 위치에 저장된 인트라 예측 모드에 기초하여 인트라 TMP가 적용되는 블록을 위한 인트라 예측 모드를 결정할 수 있다. 한편, 기 설정된 위치의 샘플들이 MIP 모드, 인트라 TMP 모드, IBC 모드, 팔레트 모드, 인트라 모드인 경우, 비디오 신호 처리 장치는 기 설정된 위치에 저장된 인트라 예측 모드를 사용하지 않을 수 있다. 도 40(a)는 도 40(b)의 참조 블록(매칭 블록)을 확대한 도면일 수 있다. 도 40(a)를 참조하면 비디오 신호 처리 장치가 매칭 블록의 인트라 예측 모드를 확인하기 위한 기 설정된 위치는 5개 일 수 있다. 예를 들어, 참조 블록 내에 기 설정된 위치는 3개(P1 내지 P3)일 수 있고, 참조 블록의 주변 블록 내 기 설정된 위치(P4 내지 P5)는 2개일 수 있다. 구체적으로, 기 설정된 위치는 P1(중앙), P2(우-하측), P3(상-좌측), P4(참조 블록의 상측 경계와 인접한 참조 블록의 이웃 블록들 중 현재 블록의 상측 경계의 블록들 중 가운데 블록과 인접한 블록), P5(참조 블록의 좌측 경계와 인접한 이웃 블록들 중 현재 블록의 좌측 경계의 블록들 중 가운데 블록과 인접한 블록)일 수 있다. 도 40(a)에서는 설명의 편의상 5개의 기 설정된 위치를 도시하였으나, 이에 제한되는 것은 아니다. 한편, 기 설정된 위치에서 인트라 예측 모드가 존재하지 않을 수 있다. 이때, 비디오 신호 처리 장치는 기 설정된 모드를 인트라 예측 모드로 설정하여 사용할 수 있다. 기 설정된 모드는 평면 모드, DC 모드, 수평 각도 모드, 수직 각도 모드, 대각 각도 모드, 각도 모드 중 하나일 수 있다. 또한, 기 설정된 위치에서 인트라 예측 모드가 존재하지 않는 경우, 비디오 신호 처리 장치는 도 28과 같은 템플릿을 이용하여 인트라 예측 모드를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 참조 블록 내의 샘플들 전체 또는 일부를 이용하여 인트라 예측 모드를 유도할 수 있다. 비디오 신호 처리 장치는 인트라 TMP가 적용되는 현재 블록의 MTS 세트 또는 LFNST 세트를 결정하기 위해 유도한 인트라 예측 모드를 사용할 수 있다.
또한, 비디오 신호 처리 장치는 도 40(c)와 같이 현재 블록의 이웃 블록의 기 설정된 위치의 인트라 예측 모드를 사용할 수 있다. 도 40(c)를 참조하면 비디오 신호 처리 장치는 MTS 세트 또는 LFNST 세트를 결정하기 위해 5개의 기 설정된 위치의 인트라 예측 모드를 사용할 수 있다. 예를 들어, 현재 블록의 좌-상단 블록의 위치를 (0,0)이라 하면, 현재 블록의 이웃 블록의 기 설정된 위치는 P1(-1, H-1), P2(W-1, -1), P3(-1, H), P4(W, -1), P5(-1, 0)일 수 있다. 이때, H는 현재 블록의 높이, W는 현재 블록의 너비를 의미할 수 있다. 한편, 비디오 신호 처리 장치는 기 설정된 위치의 인트라 예측 모드가 존재하지 않는 경우, 상술한 기 설정된 모드 중 하나를 사용하거나 현재 블록의 이웃에 위치한 템플릿 샘플을 이용하여 인트라 예측 모드를 유도할 수 있다.
또한, 비디오 신호 처리 장치는 현재 블록의 참조 블록 내에 기 설정된 위치에 저장된 인트라 예측 모드와 참조 블록의 주변 블록 내에 기 설정된 위치에 저장된 인트라 예측 모드가 있는지 확인하고, 저장된 인트라 예측 모드가 없다면 현재 블록의 이웃 블록의 기 설정된 위치의 인트라 예측 모드가 존재하는지 확인할 수 있다. 비디오 신호 처리 장치는 현재 블록의 이웃 블록의 기 설정된 위치에도 인트라 예측 모드가 존재하지 않는 경우, 상술한 기 설정된 모드 중 하나를 사용하거나 현재 블록의 이웃에 위치한 템플릿 샘플을 이용(DIMD를 이용)하여 인트라 예측 모드를 유도할 수 있다.
비디오 신호 처리 장치는 도 40(a), (c) 각각에 도시된 기 설정된 위치(P1 내지 P5)는 P1, P2, P3, P4, P5 순으로 스캔하여 인트라 예측 모드를 확인할 수 있다. 비디오 신호 처리 장치는 P1 내지 P5에 대해 스캔을 수행하는 중, 처음으로 확인된 인트라 예측 모드를 사용하여 MTS 세트 또는 LFNST 세트를 결정할 수 있다.
IBC 모드가 적용되는 블록에 대해서도 도 40을 통해 설명한 방법이 적용될 수 있다. 즉, IBC 모드가 적용되는 블록에 대해서도 비디오 신호 처리 장치는 MTS와 LFNST를 적용하기 위해 필요한 인트라 예측 모드를 유도할 수 있다.
도 41은 본 발명의 일 실시예에 따른 MTS 세트 또는 LFNST 세트를 결정하기 위한 방법을 나타낸다.
도 41은 도1 내지 도 40를 통해 설명한 인트라 TMP 블록을 위한 MTS 세트 또는 LFNST 세트를 결정하기 위해 인트라 예측 모드를 유도하는 방법을 나타낸다.
도 41을 참조하면 비디오 신호 디코딩 장치는, 인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정할 수 있다(S4110). 비디오 신호 디코딩 장치는 상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측할 수 있다(S4120). 상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정될 수 있다.
상기 변환 커널 세트는, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합, 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 및/또는 다른 형태의 비-분리 변환(Non-Separable Primary Transform, NSPT)의 변환 매트릭스의 집합 중 적어도 어느 하나일 수 있다.
상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도될 수 있다.
상기 인트라 예측 모드는, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도될 수 있다.
상기 참조 블록 내 기 설정된 위치는 상기 현재 블록의 좌-상단, 우-하단, 및 가운데이고, 상기 참조 블록의 이웃 블록은 상기 참조 블록의 상측 경계와 인접한 상기 참조 블록의 이웃 블록들 중 상기 현재 블록의 상측 경계의 블록들 중 가운데 블록과 인접한 블록 및 상기 참조 블록의 좌측 경계와 인접한 이웃 블록들 중 상기 현재 블록의 좌측 경계의 블록들 중 가운데 블록과 인접한 블록일 수 있다.
상기 인트라 예측 모드는 상기 현재 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도될 수 있다.
상기 현재 블록의 이웃 블록은 (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0)에 위치한 블록이고, 상기 H는 상기 현재 블록의 높이이고, 상기 W는 상기 현재 블록의 너비이고, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0,)일 수 있다.
상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드가 존재하지 않는 경우, 상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도될 수 있다.본 명세서에서 상술한 방법들은 디코더 또는 인코더의 프로세서를 통해 수행될 수 있다. 또한, 인코더는 상술한 방법들에 의해 디코딩되는 비트스트림을 생성할 수 있다. 또한, 인코더가 생성한 비트스트림은 컴퓨터 판독 가능한 비 일시적 저장 매체(기록 매체)에 저장될 수 있다.
본 명세서는 주로 디코더 관점에서 기술되었으나 인코더에서도 동일하게 동작될 수 있다. 본 명세서의 파싱이라는 용어는 비트스트림으로부터 정보를 획득하는 과정을 중점으로하여 설명되었으나 인코더 측면에서는 비트스트림에 해당 정보를 구성하는 것으로 해석될 수 있다. 따라서 파싱이라는 용어는 디코더 동작으로만 한정되지 않고 인코더에서는 비트스트림을 구성하는 행위로까지 해석될 수 있다. 또한, 이러한 비트스트림은 컴퓨터 판독 가능한 기록 매체에 저장되어 구성될 수 있다.
상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.
하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.
펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 프로세서의 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 프로세서와 데이터를 주고받을 수 있다.
일부 실시예는 컴퓨터에 의해 실행되는 프로그램 모듈과 같은 컴퓨터에 의해 실행가능한 명령어를 포함하는 기록 매체의 형태로도 구현될 수 있다. 컴퓨터 판독 가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용 매체일 수 있고, 휘발성 및 비휘발성 매체, 분리형 및 비분리형 매체를 모두 포함한다. 또한, 컴퓨터 판독 가능 매체는 컴퓨터 저장 매체 및 통신 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함한다. 통신 매체는 전형적으로 컴퓨터 판독가능 명령어, 데이터 구조 또는 프로그램 모듈과 같은 변조된 데이터 신호의 기타 데이터, 또는 기타 전송 메커니즘을 포함하며, 임의의 정보 전달 매체를 포함한다.
전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아는 것으로 해석해야 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다.
본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.

Claims (20)

  1. 비디오 신호 디코딩 장치에 있어서,
    프로세서를 포함하며,
    상기 프로세서는,
    인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하고,
    상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하고,
    상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정되는, 비디오 신호 디코딩 장치.
  2. 제 1항에 있어서,
    상기 변환 커널 세트는, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합, 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 및/또는 비-분리 변환(Non-Separable Primary Transform)의 변환 매트릭스의 집합 중 적어도 어느 하나인, 비디오 신호 디코딩 장치.
  3. 제 1항에 있어서,
    상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도되는, 비디오 신호 디코딩 장치.
  4. 제 1항에 있어서,
    상기 인트라 예측 모드는, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도되는, 비디오 신호 디코딩 장치.
  5. 제 4항에 있어서,
    상기 참조 블록 내 기 설정된 위치는 상기 현재 블록의 좌-상단, 우-하단, 및 가운데이고,
    상기 참조 블록의 이웃 블록은 상기 참조 블록의 상측 경계와 인접한 상기 참조 블록의 이웃 블록들 중 상기 현재 블록의 상측 경계의 블록들 중 가운데 블록과 인접한 블록 및 상기 참조 블록의 좌측 경계와 인접한 이웃 블록들 중 상기 현재 블록의 좌측 경계의 블록들 중 가운데 블록과 인접한 블록인, 비디오 신호 디코딩 장치.
  6. 제 1항에 있어서,
    상기 인트라 예측 모드는 상기 현재 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도되는, 비디오 신호 디코딩 장치.
  7. 제 6항에 있어서,
    상기 현재 블록의 이웃 블록은 (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0)에 위치한 블록이고,
    상기 H는 상기 현재 블록의 높이이고, 상기 W는 상기 현재 블록의 너비이고, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)인, 비디오 신호 디코딩 장치.
  8. 제 4항에 있어서,
    상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드가 존재하지 않는 경우,
    상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도되는, 비디오 신호 디코딩 장치.
  9. 비디오 신호 인코딩 장치에 있어서,
    프로세서를 포함하며,
    상기 프로세서는,
    디코딩 방법에 의해 디코딩되는 비트스트림을 획득하고,
    상기 디코딩 방법은,
    인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하는 단계; 및
    상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하는 단계를 포함하고,
    상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정되는, 비디오 신호 인코딩 장치.
  10. 제 9항에 있어서,
    상기 변환 커널 세트는, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합, 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 및/또는 비-분리 변환(Non-Separable Primary Transform)의 변환 매트릭스의 집합 중 적어도 어느 하나인, 비디오 신호 인코딩 장치.
  11. 제 9항에 있어서,
    상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도되는, 비디오 신호 인코딩 장치.
  12. 제 9항에 있어서,
    상기 인트라 예측 모드는, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도되는, 비디오 신호 인코딩 장치.
  13. 제 12항에 있어서,
    상기 참조 블록 내 기 설정된 위치는 상기 현재 블록의 좌-상단, 우-하단, 및 가운데이고,
    상기 참조 블록의 이웃 블록은 상기 참조 블록의 상측 경계와 인접한 상기 참조 블록의 이웃 블록들 중 상기 현재 블록의 상측 경계의 블록들 중 가운데 블록과 인접한 블록 및 상기 참조 블록의 좌측 경계와 인접한 이웃 블록들 중 상기 현재 블록의 좌측 경계의 블록들 중 가운데 블록과 인접한 블록인, 비디오 신호 인코딩 장치.
  14. 제 9항에 있어서,
    상기 인트라 예측 모드는 상기 현재 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도되는, 비디오 신호 인코딩 장치.
  15. 제 14항에 있어서,
    상기 현재 블록의 이웃 블록은 (-1, H-1), (W-1, -1), (-1, H), (W, -1), (-1, 0)에 위치한 블록이고,
    상기 H는 상기 현재 블록의 높이이고, 상기 W는 상기 현재 블록의 너비이고, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)인, 비디오 인코딩 장치.
  16. 제 12항에 있어서,
    상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드가 존재하지 않는 경우,
    상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도되는, 비디오 신호 인코딩 장치.
  17. 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에 있어서, 상기 비트스트림은 디코딩 방법에 의해 디코딩되고,
    상기 디코딩 방법은,
    인트라 템플릿 매칭(Template Matching)이 적용되는 현재 블록의 변환을 위한 변환 커널 세트를 결정하는 단계; 및
    상기 변환 커널 세트에 포함되는 변환 커널에 기초하여 상기 현재 블록을 예측하는 단계를 포함하고,
    상기 변환 커널 세트는 상기 현재 블록과 연관된 인트라 예측 모드에 기초하여 결정되는, 비 일시적 저장 매체.
  18. 제 17항에 있어서,
    상기 변환 커널 세트는, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합, 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 및/또는 비-분리 변환(Non-Separable Primary Transform)의 변환 매트릭스의 집합 중 적어도 어느 하나인, 비 일시적 저장 매체.
  19. 제 17항에 있어서,
    상기 인트라 예측 모드는 DIMD(Decoder side intra mode derivation)에 기초하여 유도되는, 비 일시적 저장 매체.
  20. 제 17항에 있어서,
    상기 인트라 예측 모드는, 상기 현재 블록의 참조 블록 내 기 설정된 위치의 인트라 예측 모드와 상기 참조 블록의 이웃 블록의 인트라 예측 모드에 기초하여 유도되는, 비 일시적 저장 매체.
PCT/KR2023/014063 2022-09-16 2023-09-18 비디오 신호 처리 방법 및 이를 위한 장치 WO2024058637A1 (ko)

Applications Claiming Priority (8)

Application Number Priority Date Filing Date Title
KR20220117490 2022-09-16
KR10-2022-0117490 2022-09-16
KR20220130980 2022-10-12
KR10-2022-0130980 2022-10-12
KR20220132759 2022-10-14
KR10-2022-0132759 2022-10-14
KR20230004031 2023-01-11
KR10-2023-0004031 2023-01-11

Publications (1)

Publication Number Publication Date
WO2024058637A1 true WO2024058637A1 (ko) 2024-03-21

Family

ID=90275421

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/014063 WO2024058637A1 (ko) 2022-09-16 2023-09-18 비디오 신호 처리 방법 및 이를 위한 장치

Country Status (1)

Country Link
WO (1) WO2024058637A1 (ko)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011071514A2 (en) * 2009-12-08 2011-06-16 Thomson Licensing Methods and apparatus for adaptive residual updating of template matching prediction for video encoding and decoding
US20120044996A1 (en) * 2009-02-20 2012-02-23 Kazushi Sato Image processing device and method
US11284086B2 (en) * 2017-07-04 2022-03-22 Huawei Technologies Co., Ltd. Decoder side intra mode derivation (DIMD) tool computational complexity reduction

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120044996A1 (en) * 2009-02-20 2012-02-23 Kazushi Sato Image processing device and method
WO2011071514A2 (en) * 2009-12-08 2011-06-16 Thomson Licensing Methods and apparatus for adaptive residual updating of template matching prediction for video encoding and decoding
US11284086B2 (en) * 2017-07-04 2022-03-22 Huawei Technologies Co., Ltd. Decoder side intra mode derivation (DIMD) tool computational complexity reduction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A. BROWNE, Y. YE, S. KIM: "Algorithm description for Versatile Video Coding and Test Model 17 (VTM 17)", 138. MPEG MEETING; 20220425 - 20220429; ONLINE; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), 14 July 2022 (2022-07-14), XP030302682 *
M. COBAN, F. LE LÉANNEC, K. NASER, J. STRÖM, L. ZHANG: "Algorithm description of Enhanced Compression Model 6 (ECM 6)", 139. MPEG MEETING; 20220718 - 20220722; ONLINE; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), 11 October 2022 (2022-10-11), XP030304402 *

Similar Documents

Publication Publication Date Title
WO2021015523A1 (ko) 비디오 신호 처리 방법 및 장치
WO2017043949A1 (ko) 비디오 신호 처리 방법 및 장치
WO2016200100A1 (ko) 적응적 가중치 예측을 위한 신택스 시그널링을 이용하여 영상을 부호화 또는 복호화하는 방법 및 장치
WO2018212577A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018056703A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018008906A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019190211A1 (ko) 모션 보상을 이용하는 비디오 신호 처리 방법 및 장치
WO2018070742A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2018008905A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019117634A1 (ko) 2차 변환에 기반한 영상 코딩 방법 및 그 장치
WO2020096425A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2018066958A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018044089A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019235891A1 (ko) 비디오 신호 처리 방법 및 장치
WO2017150823A1 (ko) 비디오 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020076142A1 (ko) 교차성분 선형 모델을 이용한 비디오 신호 처리 방법 및 장치
WO2021118309A1 (ko) 비디오 신호 처리 방법 및 장치
WO2024058637A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024085656A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2020139040A1 (ko) 영상 부/복호화 방법 및 장치
WO2024091002A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2020106117A1 (ko) 영상 성분 간 예측 방법과 그를 이용한 영상 부호화 및 복호화 방법 및 장치
WO2019225991A1 (ko) 비디오 신호 처리 방법 및 장치
WO2023080691A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024053987A1 (ko) 기하학적 분할을 이용하는 비디오 신호 처리 방법 및 이를 위한 장치

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: 23865930

Country of ref document: EP

Kind code of ref document: A1