WO2024039209A1 - Video signal processing method and apparatus therefor - Google Patents

Video signal processing method and apparatus therefor Download PDF

Info

Publication number
WO2024039209A1
WO2024039209A1 PCT/KR2023/012220 KR2023012220W WO2024039209A1 WO 2024039209 A1 WO2024039209 A1 WO 2024039209A1 KR 2023012220 W KR2023012220 W KR 2023012220W WO 2024039209 A1 WO2024039209 A1 WO 2024039209A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
prediction
block
current block
intra prediction
Prior art date
Application number
PCT/KR2023/012220
Other languages
French (fr)
Korean (ko)
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 WO2024039209A1 publication Critical patent/WO2024039209A1/en

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/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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • 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/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • 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/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame 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/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/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 apparatus includes a processor, wherein the processor determines a first prediction mode of a current block, generates a prediction block of the current block based on the first prediction mode, and generates a second prediction block.
  • a residual block of the current block may be generated based on a set of transformation matrices determined based on a prediction mode, and the current block may be restored based on the prediction block and the residual block.
  • the video signal encoding device includes a processor, wherein the processor determines a first prediction mode of the current block, generates a prediction block of the current block based on the first prediction mode, and generates a second prediction block.
  • a residual block of the current block may be generated based on a set of transformation matrices determined based on a prediction mode, and the current block may be restored based on the prediction block and the residual block.
  • the bitstream is decoded by a decoding method, the decoding method comprising: determining a first prediction mode of a current block; generating a prediction block of the current block based on the first prediction mode; generating a residual block of the current block based on a set of transformation matrices determined based on a second prediction mode; And it may include restoring the current block based on the prediction block and the residual block.
  • the residual block is a set of transform matrices of a multiple transform set (MTS) and/or a transform matrix of a low frequency non-separable transform (LFNST). It can be created based on at least one of the sets.
  • MTS multiple transform set
  • LNNST low frequency non-separable transform
  • the first prediction mode and the second prediction mode may be different prediction modes.
  • the first prediction mode may be one of a planar mode based on the horizontal direction or a planar mode based on the vertical direction.
  • planar mode based on the horizontal direction is a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position
  • planar mode based on the vertical direction is a prediction mode based on the value of the block at the (-1, y) position
  • Plane mode is a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position, and the position of the upper left block of the current block is (0, 0).
  • the position of the prediction block may be (x, y).
  • the first prediction mode is a planar mode based on the horizontal direction
  • the second prediction mode is a vertical angle mode
  • the first prediction mode is a planar mode based on the horizontal direction. It is a planar mode
  • the second prediction mode may be a horizontal angle mode.
  • the first prediction mode may be a linear prediction mode.
  • the first prediction mode may be indicated by a syntax element included in the bitstream.
  • 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 process of generating a prediction block using DIMD according to an embodiment of the present invention.
  • Figure 9 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
  • Figure 10 is a diagram showing a method for mapping a directional mode according to an embodiment of the present invention.
  • Figure 11 is a diagram showing a histogram for deriving an intra prediction directional mode according to an embodiment of the present invention.
  • Figure 12 is a diagram showing a method of signaling DIMD mode according to an embodiment of the present invention.
  • Figure 13 is a diagram showing a method of signaling syntax elements related to intra prediction mode depending on whether DIMD mode is used according to an embodiment of the present invention.
  • FIG. 14 is a diagram illustrating a method of generating a prediction sample for restoring a current block according to an embodiment of the present invention.
  • Figure 15 is a diagram showing a method for determining an intra prediction mode according to an embodiment of the present invention.
  • Figure 16 shows a syntax structure including syntax elements related to DIMD according to an embodiment of the present invention.
  • Figure 17 is a diagram showing intra prediction directional mode and weight information for neighboring blocks of the current block according to an embodiment of the present invention.
  • Figure 18 is a diagram showing a method of determining DIMD combination information according to an embodiment of the present invention.
  • Figure 19 is a diagram showing a method of generating a prediction sample using intra prediction directional mode information and weights according to an embodiment of the present invention.
  • Figures 20 and 21 are diagrams showing pixel values of neighboring blocks used when deriving an intra prediction directional mode according to an embodiment of the present invention.
  • Figure 22 is a diagram showing a method of configuring an MPM list including the intra prediction directional mode of the current block according to an embodiment of the present invention.
  • Figures 23 and 24 are diagrams showing a template used to derive the intra prediction mode of the current block according to an embodiment of the present invention.
  • 25 to 28 are diagrams showing a method of generating prediction samples (pixels) based on a plurality of reference pixel lines according to an embodiment of the present invention.
  • Figure 29 shows a method of predicting a sample using a plurality of reference pixel lines according to an embodiment of the present invention.
  • Figure 30 shows a method of determining a reference pixel line based on a template according to an embodiment of the present invention.
  • Figure 31 shows a method of setting a template for testing a reference pixel line adjacent to the current block according to an embodiment of the present invention.
  • Figure 32 is a structural diagram showing a method of determining an optimal reference pixel line using a plurality of reference pixel lines based on a template according to an embodiment of the present invention.
  • Figure 33 shows a method for generating prediction samples using planar mode according to an embodiment of the present invention.
  • Figure 34 shows a method for deriving a multiple transform set and an LFNST set for a vertical plane mode or a horizontal plane mode according to an embodiment of the present invention.
  • Figure 35 shows a mapping table according to an embodiment of the present invention.
  • Figure 36 shows a conversion type set table according to an embodiment of the present invention.
  • Figure 37 shows a conversion type combination table according to an embodiment of the present invention.
  • Figure 38 shows a threshold table for IDT conversion type according to an embodiment of the present invention.
  • Figure 39 shows a method by which a video signal processing device derives a first-order or second-order transformation matrix according to an embodiment of the present invention.
  • Figure 40 shows a DC prediction method on a vertical or horizontal line basis according to an embodiment of the present invention.
  • Figure 41 shows a plane prediction method in units of vertical or horizontal lines according to an embodiment of the present invention.
  • Figure 42 shows a prediction method in sub-block units using planar mode according to an embodiment of the present invention.
  • Figure 43 shows an intra prediction method based on bidirectional prediction according to an embodiment of the present invention.
  • Figure 44 shows the types of transform kernels that can be used in video coding according to an embodiment of the present invention.
  • Figures 45 and 46 show part of a sequence parameter set according to an embodiment of the present invention.
  • Figure 47 shows part of the general_constraint_info() syntax structure according to an embodiment of the present invention.
  • Figure 48 shows a method of constructing an MPM list using multiple prediction modes according to an embodiment of the present invention.
  • Figure 49 shows the location of a reference pixel used when a prediction block is generated using a multi-prediction mode according to an embodiment of the present invention.
  • Figure 50 shows a transform set table for LFNST and NSPT transforms according to an embodiment of the present invention.
  • Figure 51 shows a method of deriving a transform set for a linear mode in prediction using a linear mode 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, bidirectional 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 the 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 the VVC.
  • PROF Prediction refinement with optical flow
  • 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 on a pixel basis 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. Then, 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 through 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 taken into account, taking into account the cost of rate-distortion. and explore.
  • dependent quantization applied to video encoding may be designed such that the set of acceptable 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 as a predefined matrix matrix. This is a method of obtaining a prediction signal using the and offset values.
  • 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 generates a prediction template for the template using surrounding pixels (references) adjacent to the template, and can use the intra prediction mode that generates the 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 applies a Sobel filter horizontally and vertically to each surrounding pixel (pixel) adjacent to the current block to infer directionality information, 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 the 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 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 9 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
  • Figure 9(a) shows when all neighboring blocks of the current block are available to derive directional information
  • Figure 9(b) shows that the upper border of the current block is divided into sub-pictures, slices, and It shows when it is a tile or CTU boundary
  • Figure 9(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. 9 indicate the positions of pixels used to derive actual directional information
  • the dotted lines indicate sub-picture, slice, tile, and CTU boundaries.
  • FIGS. 9(d) to 9(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 may 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 directional 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. 9, 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 directional mode described herein may be the same as the angular mode.
  • Figure 10 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 closest value 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 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. For example, if the horizontal length of the current block is n (integer) times longer than the vertical length (e.g.
  • 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 11 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. 11 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 directionality mode for the current block based on the accumulated value. Referring to FIG. 11, 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 generated by 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.
  • Figure 12 is a diagram showing a method of signaling DIMD mode according to an embodiment of the present invention.
  • Figure 12 shows a signaling method used to store syntax elements regarding whether to apply DIMD mode in a bitstream and transmit them to the decoder.
  • a syntax element (cu_dimd_flag) for whether the DIMD mode is used to generate a prediction block for the current block determines whether the encoding mode of the current block is intra mode and whether the DIMD mode set in the SPS is activated.
  • sps_dimd_enabled_flag indicates that DIMD mode is activated (e.g., if the value of sps_dimd_enabled_flag is 1)
  • the encoding mode of the current block is not SKIP mode
  • the current block is a luminance block
  • the current block is not inter encoding mode.
  • cu_dimd_flag is '1'
  • cu_dimd_flag is '0', it can indicate that the current block is not decoded in DIMD mode.
  • sps_dimd_enabled_flag can be controlled by syntax elements included in profile, tier and level syntax.
  • sps_dimd_enabled_flag can be controlled by gci_no_dimd_constraint_flag, a syntax element included in general_conatraints_info() syntax. It can be defined to perform the following actions. If the value of gci_no_dimd_constraint_flag is 1, the sps_dimd_enabled_flag value for all pictures in OlsinScope can be 0.
  • gci_no_dimd_constraint_flag 1 specifies that sps_dimd_enabled_flag for all pictures in OlsInScope shall be equal to 0.
  • gci_no_dimd_constraint_flag 0 does not impose such a constraint.
  • Figure 13 is a diagram showing a method of signaling syntax elements related to intra prediction mode depending on whether DIMD mode is used according to an embodiment of the present invention.
  • additional information related to the encoding mode may not be parsed.
  • additional information related to the encoding mode of the current block e.g., intra_mip_flag, intra_subpartitions_mode_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, etc.
  • intra_mip_flag intra_subpartitions_mode_flag
  • intra_luma_mpm_flag intra_luma_not_planar_flag
  • intra_luma_mpm_idx intra_luma_mpm_remainder, etc.
  • FIG. 14 is a diagram illustrating a method of generating a prediction sample for restoring a current block according to an embodiment of the present invention.
  • FIG. 14 is a structural diagram showing a process for more effectively deriving an intra prediction mode to improve encoding performance and generating a prediction sample using the derived intra prediction mode.
  • the decoder can derive an intra prediction directional mode for the current block using samples of neighboring blocks adjacent to the current block.
  • the decoder can derive at least one intra prediction directional mode and derive a weight for each mode.
  • the decoder can use a histogram-based method to derive directionality information of neighboring block samples through a random filter and determine frequently occurring directionality information as the intra prediction directionality mode. .
  • the intra prediction directionality mode only the upper pixel adjacent to the current block is used to generate an intra prediction pixel for the left pixel adjacent to the current block, and the intra prediction mode with the least distortion is selected as the intra prediction directionality for the current block.
  • a method of determining by mode may also be used.
  • prediction blocks for the current block can be generated using the intra prediction directional modes and weights derived in the 'prediction mode generator' process.
  • the number of prediction blocks can be determined according to the number of intra prediction directional modes derived in the prediction mode generator process. For example, if the number of derived intra prediction directional modes is 2, there may be 2 prediction blocks for the current block.
  • PDPC Porition dependent intra prediction combination
  • Position dependent intra prediction combination (PDPC) filtering may be applied to each of the prediction blocks generated in the 'intra prediction' process. If PDPC filtering is applied to each prediction block, complexity may increase in terms of the decoder, so if a prediction block is predicted in DIMD mode, PDPC filtering may not be applied to the corresponding prediction block. Additionally, PDPC filtering can be applied only to either modeA, which has the largest cumulative value, or modeB, which has the second largest cumulative value. For example, PDPC filtering can be applied only for modeA. Additionally, whether PDPC filtering is applied may be determined depending on the weight of each directional mode.
  • PDPC filtering may be applied to modeA, and PDPC filtering may not be applied to modeB.
  • a preset form of PDPC filtering can be applied only to the final prediction block to which the weighted average has been applied through the weighted prediction process (see FIG. 14).
  • PDPC filtering can be applied using modeA to the final prediction block to which the weighted average is applied.
  • PDPC filtering can be applied using modeB to the final prediction block to which the weighted average is applied.
  • the decoder can additionally generate a prediction block for the current block.
  • the decoder may generate an intra prediction block using at least one of planar mode, DC mode, and Matrix Intra Prediction (MIP). Weight information for each of the intra prediction directionality modes and prediction directionality derived from the 'prediction mode generator' process, quantization parameter information of the current block, horizontal or vertical length of the current block, and whether the current block is luminance or chrominance.
  • 'other prediction' using at least one of information about, intra prediction mode around the current block, and information about the presence or absence of transform coefficients around the current block (which may correspond to Additional information A, B, and C in FIG. 14) ' It can be decided whether the process will be performed or not. Below, we will explain how to determine whether the 'other prediction' process is performed.
  • information about which mode (e.g., planar, DC, MIP mode, etc.) the decoder will use may be pre-arranged or signaled through SPS.
  • the decoder can determine the mode based on a syntax element (sps_dimd_default_mode) indicating which mode to use.
  • the decoder can decide which mode to use among planar mode, DC mode, and MIP mode depending on the value of sps_dimd_default_mode.
  • the decoder may generate a prediction block using at least one of planar mode, DC mode, and MIP mode.
  • a prediction block can be generated using at least one of planar mode, DC mode, and MIP mode. Additionally, if the weights of the intra prediction directional modes derived in the 'prediction mode generator' process are similar to each other (for example, if the difference between the weights of each directional mode is smaller than a certain threshold, etc.), the 'other prediction' process It may not be performed. If the weights of the intra prediction directional modes derived in the 'prediction mode generator' process are similar to each other, the decoder can generate a prediction block using at least one of the planar mode, DC mode, and MIP mode (i.e., 'other prediction ' process is performed).
  • the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode. Additionally, if the horizontal and vertical lengths of the current block are different, the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode. Conversely, when the horizontal and vertical lengths of the current block are the same, the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode.
  • the decoder can generate one prediction sample by averaging the weights of multiple intra prediction blocks generated in the 'intra prediction' and 'other prediction' processes.
  • the weight for each intra prediction block is the intra prediction directional mode and weight information derived from the 'prediction mode generator' process, the quantization parameter information of the current block, the horizontal or vertical length of the current block, and whether the current block is luminance or chrominance. It may be determined based on at least one of information, an intra prediction mode around the current block, and information about the presence or absence of a transform coefficient around the current block.
  • Figure 15 is a diagram showing a method for determining an intra prediction mode according to an embodiment of the present invention.
  • Figure 15 shows the 'prediction mode generator' process of Figure 14 in more detail.
  • the 'prediction mode generator' process of FIG. 14 can derive intra prediction directionality through histogram analysis.
  • the decoder can derive intra prediction directionality by analyzing the histogram obtained using surrounding samples adjacent to the current block.
  • the decoder determines the horizontal length and vertical length of the current block, quantization parameter information, possible intra prediction direction mode information among neighboring blocks of the current block, information on the presence or absence of residual signals in neighboring blocks of the current block, and the luminance of the current block.
  • the intra prediction directionality mode and weight for the current block can be derived using at least one of the information about whether it is a block or a color difference block. Below, a method for deriving the intra prediction directionality mode and weight for the current block will be described.
  • Intra prediction directional mode can be set based on frequency.
  • the decoder can obtain a histogram for the intra prediction directionality mode for a neighboring block, analyze the histogram, and select the frequently occurring intra prediction directionality mode and the second most frequently occurring mode as the prediction directionality mode. Additionally, the intra prediction directional mode may be set based on an accumulated value (eg, G value in FIG. 11).
  • the decoder can select the intra prediction directionality mode with the highest weight and the mode with the second highest weight as the prediction directionality mode by analyzing the histogram obtained as the cumulative value obtained by adding the G value to each of the intra prediction directionality modes.
  • the decoder can select the intra prediction directionality mode based on the cumulative value of the distance between the intra prediction directionality modes of neighboring blocks and the G value.
  • the distance between directional modes may mean the index difference of the directional modes.
  • the distance difference between the directional mode of index 66 and the directional mode of index 2 may be 64.
  • the distance difference between the directional mode at index 66 and the directional mode at index 2 may be 2.
  • the decoder can obtain a histogram with the cumulative value of each of the intra prediction direction modes for the neighboring block with the G value added, analyze the histogram, and select the intra prediction direction mode with the highest cumulative value first.
  • the decoder selects the modes corresponding to the remaining cumulative values except the highest cumulative value (e.g., the mode with the second highest cumulative value, the mode with the third highest cumulative value, and the fourth highest cumulative value).
  • the mode with the highest cumulative value and the mode with the smallest distance between directional modes can be used.
  • the decoder first selects the intra prediction directional mode with the highest cumulative value, and the decoder selects the modes corresponding to the remaining cumulative values excluding the highest cumulative value (e.g., the mode with the second highest cumulative value, Among the modes with the third highest cumulative value, the mode with the fourth highest cumulative value, etc.), the mode with the highest cumulative value and the mode with the largest distance between directional modes (the mode that is farthest away) can be used.
  • the cumulative value for each intra prediction directional mode can be used when determining weights for the intra prediction directional modes finally determined in the 'Histogram analysis' process.
  • intra prediction directional modes There may be two or more intra prediction directional modes for the current block derived by the decoder in FIG. 15 during the 'Histogram analysis' process. If there are two or more intra prediction directional modes derived from 'Histogram analysis', the distance between each intra prediction directional mode may be similar to or different from each other. Additionally, cumulative values between intra prediction directional modes may be similar to or different from each other. Therefore, in order to derive the optimal prediction sample for the current block, the most optimal combination must be selected among various mode combinations.
  • the decoder can combine not only the intra prediction directional mode derived in the 'prediction mode generator' process of FIG. 14 but also the encoding mode derived in 'other prediction' to derive the optimal prediction sample for the current block. Information about this combination may be included in the bitstream.
  • the mode combination described herein may mean using one of mode A, mode B, planar mode, DC mode, and MIP mode, or combining some or all of them.
  • the decoder uses weight information corresponding to the intra prediction modes determined in the 'Histogram analysis' process and the derived intra prediction modes in the 'Prediction mode analysis' process to determine the optimal level for the current block.
  • the optimal combination for deriving prediction samples can be selected.
  • the decoder uses the derived intra prediction modes and the corresponding weight information to determine whether to use weighted average to generate a prediction sample for the current block, which intra prediction mode to use, and information about the intra prediction mode. Information on how to set the weights can be determined.
  • the decoder uses at least one of the intra prediction modes determined in the 'Histogram analysis' process, weight information corresponding to the determined intra prediction modes, and intra prediction modes of neighboring blocks.
  • the optimal combination for deriving a prediction sample for the current block can be selected.
  • the decoder can determine whether to use a weighted average to generate a prediction sample for the current block, which intra prediction mode to use, and how to set the weights for the intra prediction mode.
  • the optimal combination information for prediction modes for generating a prediction sample for the current block can be derived by using at least one of the information about whether it is a chrominance block.
  • the combination information may include intra prediction directional mode information and weights for the intra prediction directional mode. For example, if the weight of the mode with the second highest weight among the two induced intra prediction directional modes is '0' or within a random value, the decoder does not apply weighted average when generating a prediction block for the current block. , a prediction block can be generated using only one intra prediction directional mode with the highest weight. At this time, the arbitrary value is an integer greater than 1 and may be 10.
  • the decoder applies a weighted average when generating a prediction block for the current block. Instead, a prediction block can be generated using only one intra prediction directional mode with the highest weight. Additionally, if at least one of the two derived intra prediction modes is DC mode, Planar mode, or MIP mode (i.e., not directional mode), the decoder may apply weighted average when generating the prediction block for the current block. You can.
  • Figure 16 shows a syntax structure including syntax elements related to DIMD according to an embodiment of the present invention.
  • the decoder uses syntax for DIMD combination information (information about the mode combined to obtain the prediction sample, mode combination information) Elements (cu_dimd_mode) can be additionally parsed.
  • DIMD combination information information about the mode combined to obtain the prediction sample, mode combination information
  • Elements cu_dimd_mode
  • the way cu_dimd_mode is parsed may differ depending on the number of prediction modes to be combined. For example, if the number of combinations is '2', the decoder can only parse one bin. At this time, if the value of cu_dimd_mode is '0', the decoder can generate a prediction sample using modeA and modeB.
  • the decoder will generate prediction samples using modeA and modeB and the planar mode, or generate prediction samples using modeA and the planar mode, or generate prediction samples using modeB and the planar mode. You can. If the number of combinations is '4', the decoder can parse two bins. At this time, if the value of cu_dimd_mode is '0', the decoder can generate a prediction sample using modeA and modeB. If the cu_dimd_mode value is '1', prediction samples can be generated using modeA, modeB, and planar mode.
  • the decoder can generate prediction samples using modeA and planar mode. If the value of cu_dimd_mode is '3', the decoder can generate prediction samples using modeB and planar mode.
  • syntax elements for DIMD combination information are included in the bitstream, there may be a problem that the bit amount increases.
  • syntax elements for DIMD combination information are not included in the bitstream, and the decoder can derive combination information through information on the current block and neighboring blocks. As described above, the decoder can derive optimal combination information to generate a prediction sample for the current block.
  • Figure 17 is a diagram showing intra prediction directional mode and weight information for neighboring blocks of the current block according to an embodiment of the present invention.
  • FIG. 17 shows weight information corresponding to the intra prediction directional mode for each block derived in the 'Histogram analysis' step described with reference to FIG. 15.
  • the size of the weight (WeightX) can be expressed in alphabetical order.
  • the highest weight can be expressed as 'WeightA' and the second highest weight can be expressed as 'WeightB'.
  • Weight information may exist as many times as the number (X) of derived intra prediction directional modes.
  • the intra prediction mode corresponding to the WeightA weight may be modeA.
  • the characteristics of the intra prediction directional mode and the corresponding weight information may be different. Referring to FIG.
  • Case 1 represents a case where the intra prediction directional modes of modeA and modeB and the corresponding weight information are similar to each other.
  • Case 2 represents a case where the difference between the intra prediction directional modes of modeA and modeB and the corresponding weight information is significantly different.
  • Case 3 represents a case where the intra prediction directional modes of modeA and modeB are similar, but the difference between the corresponding weight information is significantly different.
  • Case 4 represents a case where the intra prediction directional modes of modeA and modeB are significantly different, but the corresponding weight information is similar.
  • Figure 18 is a diagram showing a method of determining DIMD combination information according to an embodiment of the present invention.
  • Figure 18 shows a method of determining optimal DIMD combination information through the difference between intra prediction directional modes (modeA, modeB) derived in the 'prediction mode generator' process and the corresponding weights (WeightA, WeightB).
  • the optimal DIMD combination for the current block may be a combination of modeA and modeB, and the decoder may generate a prediction sample by combining modeA and modeB.
  • Tmode1 an arbitrary threshold value
  • WeightA an arbitrary threshold value
  • the optimal DIMD combination for the current block may be to use only modeA, and the decoder uses only modeA to generate the prediction sample. can be created.
  • the optimal DIMD combination for the current block is derived from modeA and the 'other prediction' process. It may be a combination of some or all of the encoded modes (e.g., planar mode, DC mode, MIP mode), and the decoder may use a encoding mode (e.g., planar mode, Prediction samples can be generated by combining some or all of (DC mode, MIP mode).
  • Tmode2 e.g. 15
  • the optimal DIMD combination for the current block is derived from modeA and the 'other prediction' process. It may be a combination of some or all of the encoded modes (e.g., planar mode, DC mode, MIP mode), and the decoder may use a encoding mode (e.g., planar mode, Prediction samples can be generated by combining some or all of (DC mode, MIP mode).
  • the optimal DIMD combination for the current block is modeA, modeB, and some or all of the encoding modes (e.g., planar mode, DC mode, MIP mode) derived in the 'other prediction' process. It may be a combination, and the decoder may generate prediction samples by combining modeA, modeB, and some or all of the encoding modes (e.g., planar mode, DC mode, MIP mode) derived in the 'other prediction' process. .
  • the decoder can obtain DIMD combination information.
  • DIMD combination information can be obtained by comparing the weights of modeA and modeB with all (e.g., sum of weights) weights of direction information (including weights of modeA and modeB) for neighboring blocks of the current block. .
  • the DIMD combination information combines at least one of the derived intra-prediction directional mode, planar mode, DC mode, and MIP mode. It may be.
  • the specific ratio may be 1/2, 2/3, 3/4, 3/8, etc.
  • the two corresponding intra prediction directionality A mode can be selected.
  • the DIMD combination information is at least one of the derived intra-prediction directional mode, planar mode, DC mode, and MIP mode. More than one may be selected.
  • modeA, modeB and planar mode can be selected.
  • modeA and modeB may be selected.
  • the specific ratio may be 1/2, 2/3, 3/4, 3/8, etc.
  • Figure 19 is a diagram showing a method of generating a prediction sample using intra prediction directional mode information and weights according to an embodiment of the present invention.
  • Figure 19 shows the 'Intra prediction' and 'weighted prediction' processes of Figure 14.
  • the decoder uses the weight information of each of the plurality of intra prediction directional modes to perform weighted prediction using their weight information to obtain a prediction sample. can be obtained.
  • Weight information may be reset based on at least one of the horizontal length, vertical length, quantization parameter information, and information about whether the current block is luminance or chrominance (Additional information) of the current block.
  • Figures 20 and 21 are diagrams showing pixel values of neighboring blocks used when deriving an intra prediction directional mode according to an embodiment of the present invention.
  • Figures 20 and 21 show pixel (pixel) values of neighboring blocks used when deriving an intra prediction directional mode in the 'histogram analysis' process of Figure 14.
  • filtering calculations are required for all surrounding pixels located to the left and above of the current block.
  • the surrounding pixels may be pixels on a line adjacent to or spaced apart from the boundary of the current block. That is, in order to derive the intra prediction directional mode, filtering calculations must be performed on all neighboring pixels on lines adjacent to or spaced apart from the left and upper boundaries of the current block, so there is a problem that delay may occur due to computational complexity.
  • the decoder can separate filtering calculations for neighboring pixels located to the left and above of the current block and derive an intra prediction directional mode for neighboring pixels located to the left and above in parallel.
  • the decoder may derive directional information by performing filtering calculations only on surrounding pixels corresponding to an arbitrarily determined location.
  • Figures 20(a) and (c) show surrounding pixels located to the left of the current block used in filtering calculations to derive an intra prediction directional mode.
  • Figures 20(b) and 20(d) show surrounding pixels located above the current block used in filtering calculations to derive an intra prediction directional mode.
  • the intra-directional information that can be mapped may vary depending on the location of the reference pixel that the decoder uses to obtain the histogram described in FIG. 11.
  • the horizontal and vertical lengths of the current block may be the same.
  • the intra prediction directionality mode mapped when deriving directionality information for the surrounding pixel located to the left of the current block in FIG. 20(a) can only be used for indices -14 to 34.
  • the intra prediction directionality mode mapped when deriving directionality information for neighboring pixels located above the current block can be used only for indices 34 to 80.
  • the decoder may derive directional information by using only the surrounding pixels located on the left side of the current block, without using the surrounding pixels located on the upper side. This has the effect of reducing computational complexity by using only neighboring pixels located on the left rather than using neighboring pixels located on the upper side. If the horizontal length of the current block is longer than the vertical length, the decoder can derive directional information by applying a greater weight to neighboring pixels located above than to neighboring pixels located to the left of the current block.
  • Weights can use specific pre-arranged values. For example, if the horizontal length of the current block is greater than the vertical length, a weight of 1 may be used for neighboring pixels located to the left of the current block, and a weight of 2 may be used for neighboring pixels located above. In other words, because the current block is longer horizontally than vertically, it is more effective to derive an intra prediction directionality mode using directionality information about surrounding pixels located above rather than surrounding pixels located to the left of the current block. Because.
  • the decoder can perform filtering calculations only on pixels corresponding to a certain number of pixels located around the current block. At this time, the specific number may be a multiple of N, and N may be 2, 3, 4, etc. Information about N may be included in picture header information. Referring to FIG. 21, based on the position moved from the upper left corner of the current block to (-2, -2) on the x and y axes, the decoder performs filtering calculations only at positions corresponding to multiples of '2', Directional information can be derived. Additionally, the decoder may derive directionality information if the current block is a luminance block, and may not derive directionality information if the current block is a chrominance block.
  • the decoder can apply the directional information found in the luminance block to the chrominance block. Meanwhile, directionality information for the luminance block and directionality information for the chrominance block can be obtained respectively.
  • the chrominance block may not use the directional information found in the luminance block, but may use information obtained using at least one of planar mode, DC mode, horizontal mode, vertical mode, and MIP mode.
  • the intra prediction directionality mode of the current block is likely to be similar to the intra prediction directionality mode of neighboring blocks. Therefore, in order to encode the intra prediction directional mode of the current block, an MPM (Most Probable Mode) list is constructed using the intra prediction directional mode of neighboring blocks, and information about whether the intra prediction directional mode of the current block exists in the MPM list and Information about existing locations may be included in the bitstream. That is, information about the intra prediction directional mode of the current block may not be separately included in the bitstream. Therefore, since the intra prediction direction mode of the current block is determined based on information about whether the intra prediction direction mode of the current block exists in the MPM list and information about the location where it exists, the intra prediction direction mode of the current block depends on whether the MPM list is effectively constructed. Information (i.e., bit quantity) for deriving the prediction directional mode may vary.
  • the method of deriving an intra prediction directionality mode using the directionality characteristics of surrounding pixels of the current block can also be used in the process of constructing an MPM list.
  • the decoder can add the intra prediction directionality mode for the current block derived using the directionality characteristics of surrounding pixels of the current block to the MPM list and use it to encode the intra prediction directionality mode for the current block. This can be used when neighboring blocks of the current block are not encoded in intra prediction mode or when there is no intra prediction directional mode such as MIP (Matrix intra prediction) mode.
  • MIP Microx intra prediction
  • Neighboring blocks adjacent to the current block may contain blocks without an intra prediction directional mode and blocks with an intra prediction directional mode. If the neighboring block located to the left of the current block is a block without an intra prediction directionality mode, the decoder can calculate the directionality characteristics using only the surrounding pixels located above the current block and derive the intra prediction directionality mode of the current block. . Or, if the intra prediction directionality mode exists in the neighboring block located above the current block, and the intra prediction directionality mode does not exist in the neighboring block located to the left of the current block, the decoder uses the intra prediction directionality mode of the neighboring block located above the current block. It can be included in the MPM list, and the intra prediction directionality mode derived through the directionality characteristics of surrounding pixels located on the left can be included in the MPM list.
  • Figure 22 is a diagram showing a method of configuring an MPM list including the intra prediction directional mode of the current block according to an embodiment of the present invention.
  • DIMD mode may be preferentially included in the MPM list.
  • the intra prediction directionality mode of a block with an intra prediction directionality mode may be added to the MPM list. If there is an empty spot in the MPM list, a mode modified by +1 or -1 in modeA can be added to the list, and DC mode, horizontal mode, vertical mode, and MIP mode can be added.
  • TIMD Tempolate based Intra Mode Derivation
  • both DIMD and TIMD modes can be included in the MPM list. Additionally, at least one of the two intra directional prediction modes derived using the DIMD mode and the two intra directional prediction modes derived using the TIMD mode may be included in the MPM list. Additionally, if the intra-prediction directional mode is used in a first region of one of the GPM blocks divided into two regions, the MPM list can be used to derive the intra-prediction directional mode for the first region.
  • the MPM list may include at least one of two intra prediction directionality modes derived using DIMD mode and two intra prediction directionality modes derived using TIMD mode.
  • the MPM list includes DIMD mode, information about whether the current block is encoded in DIMD mode can be derived through a syntax element (mpm_idx). Therefore, additional information related to DIMD may not need to be signaled.
  • the reference line index may be 0 (mrl_ref_idx is 0). Additionally, when DIMD mode is used, mrl_ref_idx is not parsed and the value of mrl_ref_idx may be inferred as 0.
  • the MPM list may include intra prediction directional modes derived using DIMD mode.
  • mrl_ref_idx may be reset.
  • the value of mrl_ref_idx can be reset to any of 0, 1, 2...
  • the decoder determines whether to add the intra prediction directionality mode derived using the DIMD mode in the MPM list or the priority of the intra prediction directionality mode derived using the DIMD mode in the MPM list. You can decide.
  • the decoder may not include the intra prediction directional mode derived using the DIMD mode in the MPM list.
  • the decoder may include an intra prediction directional mode derived using the DIMD mode in the MPM list.
  • the decoder may include an intra prediction directional mode derived using DIMD mode in the MPM list.
  • the decoder may not include the intra prediction directional mode derived using the DIMD mode in the MPM list.
  • the decoder may include an intra prediction directional mode derived using DIMD mode in the MPM list.
  • the intra prediction directional mode derived from the DIMD mode can be used to reorder intra prediction mode candidates in the MPM list.
  • the decoder can construct an MPM list starting from neighboring blocks of the current block and then derive an intra prediction directional mode using DIMD mode.
  • the decoder can reorder intra prediction mode candidates in the MPM list using the derived intra prediction directional mode.
  • the decoder determines the derived intra prediction directionality mode, the horizontal or vertical length of the current block, quantization parameter information, intra prediction mode information available among neighboring blocks of the current block, and the presence of residual signals of neighboring blocks of the current block.
  • the MPM list can be rearranged using one or more of information about whether the current block is a luminance block or a chrominance block.
  • the decoder can reorder the MPM list using the difference between the intra prediction mode candidates in the MPM list and the derived intra prediction directional mode. For example, the decoder may calculate the difference between the derived intra-prediction directional mode and each of the intra-prediction mode candidates in the MPM list and sort the MPM list in order of the smallest difference (including 0).
  • the intra prediction mode candidate with the smallest difference in the MPM list may be set to have the smallest index value in the MPM list.
  • the derived intra prediction directional mode may be set to have the highest priority within the MPM list and may be set to have the smallest index value.
  • the decoder can calculate the difference between the derived intra-prediction directionality mode and each of the intra-prediction mode candidates in the MPM list and sort the MPM list in order of the smallest difference (including 0). Additionally, when two MPM lists are used, the first MPM list may be organized in the order of intra prediction mode candidates similar to the derived intra prediction directional mode. The difference between the derived intra-prediction directional mode and the intra-prediction mode candidates in the MPM list may be organized in descending order. The second MPM list can be constructed using candidates that do not have high similarity to the derived intra prediction directional mode.
  • the second MPM list may be organized in the order of the largest difference between the derived intra-prediction directional mode and the intra-prediction mode candidates in the MPM list. If the size of the MPM list is fixed, there may be unfilled empty space in the MPM list. At this time, a new prediction candidate derived using one or more of the candidates already included in the MPM list or frequently occurring candidates may be added to the empty space. For example, a new prediction candidate may be a candidate corresponding to a number added or subtracted by a random amount in the '+' or '-' direction from the mode number (index) of an already included candidate. At this time, the arbitrary sizes are '1', '2', '3',...
  • the first MPM list may be composed of prediction modes obtained by referring to the prediction mode of the neighboring block of the current block
  • the second MPM list may be composed of prediction modes derived by DIMD. It can be. At this time, if the number of prediction modes included in the MPM list is smaller than the number of prediction modes that can be included in the predefined MPM list, prediction modes derived by applying an offset to the prediction modes included in the MPM list may be added.
  • the intra prediction directional mode derived from the DIMD mode can be used to reassemble the intra prediction mode candidates in the MPM list.
  • the decoder may construct an MPM list based on the prediction modes of neighboring blocks of the current block and then derive the intra prediction directional mode through the DIMD mode. Additionally, the decoder can recombine the intra prediction mode candidates in the MPM list using the derived intra prediction directional mode and reconstruct them into multiple prediction candidates. At this time, the decoder determines the derived intra prediction directionality mode, the horizontal or vertical length of the current block, quantization parameter information, intra prediction mode information available among neighboring blocks of the current block, and the presence of residual signals of neighboring blocks of the current block.
  • the MPM list can be reassembled using one or more of information about whether the current block is a luminance block or a chrominance block. Below, the MPM list recombination method will be described.
  • the decoder can reassemble the MPM list.
  • the decoder may include in the MPM list a multi-prediction candidate constructed by combining the intra-prediction directional mode derived by selecting candidates whose difference is less than or equal to a certain value and the candidates (existing intra-prediction modes in the MPM list).
  • the decoder may include the corresponding candidates in the MPM list in order from smallest to largest difference.
  • the decoder can sequentially insert candidates whose difference is greater than a random value into the MPM list.
  • random values are 1, 2, 3, ... It may be a natural number such as:
  • the index of the derived intra prediction mode is '18'
  • the indices of candidates in the MPM list are '16', '21', '34', '1', '66'
  • the random value is 5. It can be assumed.
  • indices '16' and '21' which have a difference within '5' from the derived intra prediction mode, can be changed to multi-prediction candidates, and the candidates in the MPM list have indices '16, 18', '21, 18'. ', '34', '1', and '66' prediction modes.
  • '16, 18' and '21, 18' may be multiple prediction candidates.
  • the decoder selects '16, 18', a multiple prediction candidate in the MPM list
  • the decoder performs a weighted average of the prediction sample generated by the prediction mode of index 16 and the prediction sample generated by the prediction mode of index 18 to obtain the final result.
  • a prediction block can be created.
  • the MPM list can be '16, 18', '21, 18', '16', '21', and '34'.
  • the first MPM list may be composed of candidates that are recombined using candidates similar to the derived intra prediction directional mode.
  • the second MPM list may be composed of candidates from the first MPM list and candidates that do not have high similarity to the derived intra prediction directional mode. Accordingly, the first MPM list may be composed of multiple prediction candidates, and the second MPM candidates may be composed of single prediction candidates. Alternatively, the first MPM list may be composed of both single prediction candidates and multiple prediction candidates, and the second MPM candidates may be composed of only single prediction candidates.
  • the derived intra prediction mode is index '18'
  • the prediction mode candidates in the first MPM list are index '16', '21', '34', '1', '66'
  • the prediction mode candidates are indices '50', '2', '8', '30', and '40', and an arbitrary value can be 5.
  • indices '16' and '21' that have a difference of less than 5 from the derived intra prediction mode index 18 may be changed to multi-prediction candidates.
  • the first MPM list may consist of indices '16, 18', '21, 18', '16', '18', and '34'
  • the second MPM list may consist of indices '1', '66', and ' It can consist of '50', '2', '8', '30', and '40'.
  • the intra prediction directional mode can be encoded based on whether it is in the MPM list and, if so, where it is located. If the intra prediction directional mode does not exist in the MPM list, the intra prediction directional mode may be encoded based on the total number of intra prediction directional modes minus the total number of prediction modes in the MPM list. Specifically, there are a total of 67 intra-prediction directional modes, and among them, encoding can be performed on the total number of prediction modes in the MPM list, 5, and 61 types excluding the planar mode. At this time, 61 intra prediction directional modes can be encoded using fixed length coding, so encoding for a total of 6 bins is required.
  • Figures 23 and 24 are diagrams showing a template used to derive the intra prediction mode of the current block according to an embodiment of the present invention.
  • the decoder may use a template, which is a reconstructed random area (pixel(s)) adjacent to the current block, to derive the intra prediction mode of the current block.
  • the decoder can generate a prediction template for the template using surrounding pixels (references) adjacent to the template. Additionally, the decoder can use the intra prediction mode for the prediction template that is most similar to the already restored template to restore the current block.
  • the method of deriving the intra prediction mode of the current block using the above-described template may be described as TIMD (Template intra mode derivation).
  • the intra prediction mode may be a mode with indices 0 to 67, and may only apply to the intra prediction mode within the MPM list derived from the neighboring blocks of the current block.
  • the intra prediction mode may be an intra prediction mode in the MPM list derived from a neighboring block of the current block and a mode that differs from the corresponding intra prediction mode by an arbitrary number. Any number can be 1, 2, 3, ...
  • only the directional mode may be applicable to the intra prediction mode for the template, and the non-directional mode (planar mode, DC mode) may not be applicable.
  • the decoder can set the size of the template.
  • the horizontal or vertical size (length) of the template may be 4, and if the horizontal or vertical size (length) of the current block is 8 or less, the horizontal or vertical size (length) of the template may be set to 2.
  • the decoder can set the type of template.
  • the type of template can be divided into a type that uses only the left sample, a type that uses only the upper sample, and a type that uses all of the left, upper, and upper left samples.
  • the decoder can determine the type of template depending on whether the surrounding block is valid or whether the surrounding block can be used to derive an intra prediction directional mode.
  • the TIMD mode may be set to a planar mode, and weighted averaging may not be performed.
  • the decoder can construct a template for the current block.
  • the decoder may derive an intra prediction directionality mode for neighboring blocks located to the left, top, top left, top right, and bottom left of the current block to determine whether the current block has directionality.
  • the neighboring blocks of the current block are not all directional (e.g., non-directional mode (DC mode, planar mode, MIP mode, etc.)), the decoder selects one intra prediction directional mode with the minimum cost. You can select and not perform TIMD mode.
  • the process described later can be performed.
  • the process described later can be performed based on the intra prediction directional mode that exists in the MPM list. This is because complexity may increase if all 67 intra-prediction directional modes are checked.
  • the decoder can construct an MPM list.
  • the decoder can modify the MPM list by adding DC mode, horizontal mode, and vertical mode to the MPM list if they do not exist in the MPM list.
  • the decoder can compare costs by performing evaluation on all intra prediction directional modes in the modified list.
  • the decoder can select a first mode with the lowest cost and a second mode with the second lowest cost.
  • the decoder may additionally perform evaluation on the intra prediction directional mode corresponding to the index of the intra prediction directional mode of the first mode and the index of the intra prediction directional mode of the second mode by 1 less or greater than the index.
  • the decoder may perform additional evaluation and again select the third mode with the lowest cost and the fourth mode with the second lowest cost. Meanwhile, the first mode and the third mode may be the same, and the second mode and the fourth mode may be the same.
  • the decoder may decide whether to perform weighted averaging based on the costs of the third mode and the fourth mode.
  • the decoder can perform weighted averaging, and the weights of the third mode and fourth mode are based on the costs of the third mode and fourth mode. can be decided. If the difference between the cost of the third mode and the cost of the fourth mode is greater than a specific value, the decoder may generate a prediction block using only the third mode without performing weighted average. At this time, the specific value may be a pre-arranged value.
  • the size of the template may vary depending on the horizontal or vertical length of the current block.
  • an upper template that is longer than the horizontal length of the current block may be configured.
  • the vertical length of the upper template may be a predetermined length.
  • a left template that is longer than the vertical length of the current block can be configured.
  • the horizontal length of the left template may be a pre-arranged length.
  • the pre-arranged length can be 1, 2, 3, ....
  • the reference pixel for deriving/predicting the template used for TIMD mode may be changed.
  • the reference pixel for predicting the left template may be the upper reference pixel (above reference) and the left reference pixel (left reference) of the current block.
  • the height of the left template may be the same as the height of the current block, as shown in Figure 24(a).
  • the decoder checks whether the neighboring block to the left of the current block is a block for which restoration has already been completed, and if it is a block for which restoration has been completed, the decoder configures the height of the left template to be larger than the height of the current block. can do.
  • the accuracy of prediction samples for the current block can increase as the decoder refers to more adjacent pixels of the current block.
  • the required memory increases.
  • the corresponding area cannot be used as a template.
  • the length of the upper template is the same as the horizontal length of the current block, and the length of the left template is the same as the vertical length of the current block, as shown in Figure 23(b). can be set.
  • the decoder may use an intra prediction mode derived using a template to obtain a prediction sample for the current block.
  • the decoder can generate prediction samples using neighboring pixels adjacent to the current block, and can adaptively select which neighboring pixels to use to generate the prediction samples. Additionally, the decoder may use multiple reference lines to generate prediction samples, and in this case, index information of multiple reference lines may be included in the bitstream.
  • a context for the index of multiple reference lines for TIMD mode can be newly defined.
  • the increase in context types may be related to memory and context switching complexity. Therefore, the context used to code and decode the index of a multiple reference line used in TIMD mode may be a reused context for the index of an existing multiple reference line.
  • the primary transformation may be adaptively applying transformations such as DCT-II, DST-VII, DCT-VIII, DCT5, DST4, DST1, and identity transformation (IDT) horizontally and vertically, respectively.
  • a secondary transformation may be additionally applied to the transformation coefficient for which the primary transformation has been completed, and the secondary transformation may be calculated as a matrix product between the primary transformed transformation coefficient and a predefined matrix.
  • the secondary transform can be described as a low frequency non-separable transform (LFNST).
  • the matrix transformation set for secondary transformation may vary depending on the intra prediction mode of the current block. Coefficient information of the transformation matrix used for secondary transformation may be included in the bitstream.
  • the transform set for the secondary transform may be determined based on the intra prediction mode derived in DIMD mode or TIMD mode. Coefficient information of the transformation matrix used for secondary transformation may be included in the bitstream.
  • the decoder can set matrix coefficient information of secondary transformation for DIMD mode or TIMD mode by parsing coefficient information included in the bitstream.
  • one of the two intra prediction modes derived from the TIMD mode can be used to select the first or second transform set.
  • the intra prediction directional mode with the smallest cost can be used to select the first or second transform set.
  • one of the two intra prediction directional modes derived from DIMD can be used to select either the first-order transform or the second-order transform set.
  • the intra prediction directional mode with the highest weight can be used to select the first or second transformation set.
  • TIMD mode has high complexity because it predicts the template of the current block and uses the intra prediction mode derived from the template to generate the prediction block of the current block. Therefore, when the decoder generates a prediction template for the template area, the existing reference sample filtering process may not be performed. Additionally, if ISP mode is applied to the current block or if the current block is applied in CIIP mode, TIMD mode may not be applied. ISP mode or CIIP mode may not be applied to the current block to which TIMD mode is applied, or syntax related to ISP or CIIP may not be parsed. At this time, the value of the syntax related to the ISP or CIIP that is not parsed may be inferred as a pre-designated value.
  • Template prediction can be performed by dividing into a left template area adjacent to the current block and an upper template area, and an intra prediction mode can be derived for each template. Additionally, two or more intra prediction modes can be derived for each template, and there can be four or more intra prediction modes for the current block. If there are two or more intra prediction modes, the prediction sample for the current block can be generated using all of the derived intra prediction modes, and the decoder can generate the final prediction block for the current block by weight-averaging the generated prediction samples. You can. At this time, at least three of two or more intra prediction modes, planar mode, DC mode, and MIP mode derived from template prediction can be used to generate the prediction sample. For example, when the decoder generates (obtains) a prediction sample for the current block, the decoder generates the final prediction sample by weighting the intra prediction modes derived from template prediction and the prediction samples generated using the planar mode. can do.
  • CIIP mode is a method that uses both intra prediction and inter prediction when generating prediction samples (blocks) for the current block.
  • the prediction sample for the current block may be generated as a weighted average between intra prediction samples and inter prediction samples.
  • intra prediction samples When intra prediction samples are generated by applying CIIP mode, DIMD mode or TIMD mode can be used.
  • DIMD mode intra prediction samples can be generated based on DIMD combination information.
  • the decoder may generate a first prediction sample using the intra prediction mode with the highest weight and generate a second prediction sample using the intra prediction mode with the second highest weight.
  • the decoder may generate a final intra prediction block by performing a weighted average of the first prediction sample and the second prediction sample.
  • the decoder may generate a final intra prediction block by performing a weighted average of a total of 3 prediction samples, including a sample predicted in planar mode, a first prediction sample, and a second prediction sample, among the neighboring blocks of the current block.
  • intra prediction samples can be generated based on TIMD combination information.
  • the decoder may generate two prediction samples using each of the two intra prediction modes. Then, the decoder can generate the final intra prediction sample by performing a weighted average of the two prediction samples. At this time, the decoder can generate the final intra prediction sample by performing a weighted average of the two prediction samples and the sample predicted in planar mode.
  • the accuracy of intra prediction samples may vary depending on location. That is, pixels located at a distance from neighboring pixels used for prediction within the prediction sample may contain more residual signals than pixels located at a closer location. Accordingly, the decoder can divide prediction samples into vertical, horizontal, and diagonal directions depending on the direction of the intra prediction mode, and set weights differently depending on the distance from neighboring pixels used for prediction. This can be applied to intra-prediction blocks created using CIIP mode, or to intra-prediction blocks created using more than one intra-prediction mode, for each pixel within a prediction block depending on the distance between the location of the reference pixel and the pixel location within the prediction block. Weights can be set differently.
  • the intra prediction mode of the current block is a mode having a vertical direction or a direction similar to vertical
  • a higher weight is set as the pixel position of the prediction block is closer to the top pixel, and the pixel position farther from the top pixel is set.
  • the lower the weight, the lower the weight can be set for each pixel position.
  • the decoder can generate the final prediction block by weighting the intra prediction sample and the inter prediction sample.
  • the pixel-level weight in the inter-prediction sample can be set considering the pixel-level weight in the intra-prediction sample.
  • the pixel weight of the inter prediction sample may be the sum of all weights minus the pixel weight of the intra prediction sample.
  • the sum of all weights may be the sum of the weights of the intra prediction samples and the weights of the inter prediction samples on a pixel basis.
  • the decoder may generate prediction samples based on each intra prediction mode and perform a weighted average on the generated prediction samples to generate the final prediction sample.
  • pixel-level weights according to the intra prediction mode may be applied.
  • the pixel-level weights include the intra prediction mode, the horizontal length and vertical length of the current block, quantization parameters, information about whether the current block is luminance or chrominance, whether the surrounding block is intra-coded, and the presence of residual transform coefficients of the surrounding block. It can be set based on at least one thing, such as presence/absence information.
  • 25 to 28 are diagrams showing a method of generating prediction samples (pixels) based on a plurality of reference pixel lines according to an embodiment of the present invention.
  • the video signal processing device includes a first reference pixel line (reference line 1) adjacent to the current block 2501 and a second reference pixel line (reference line 2) upwardly adjacent to the first reference pixel line. )
  • a prediction sample 2502 within the current block can be generated based on .
  • the predicted sample sample 2502 in FIG. 25(a) is only a sample corresponding to a position according to an embodiment of the present invention, and the pixel position is not limited to this.
  • the meaning of generating by a video signal processing device may be the same as the meaning of acquiring by the video signal processing device.
  • FIG. 25(b) is a view showing FIG. 25(a) in more detail.
  • the video signal processing device uses a smoothing filter, a cubic, or a Gaussian filter depending on the intra prediction mode to determine the first prediction pixel through six reference pixels of the first reference pixel line. (2503) can be generated. And, the video signal processing device uses the six reference pixels of the second reference pixel line to generate a second prediction pixel (2504) using a smoothing filter, cubic or Gaussian filter according to the intra prediction mode. ) can be created.
  • the video signal processing device may generate the third prediction pixel 2505 by performing a weighted average on the generated first prediction pixel 2503 and the second prediction pixel 2504 using an arbitrarily determined weight.
  • the six reference pixels of the second reference pixel line are located one pixel to the right of each pixel of the first reference pixel line, considering the intra prediction mode of the current block, the pixel position to be generated, the position of the reference pixel line, etc. These may be reference pixels of the moved location.
  • the video signal processing device may generate a prediction sample 2502 within the current block based on the third prediction pixel 2505.
  • the video signal processing device may generate the current intra-block prediction sample 2502 based on the third prediction pixel 2505 and the distance between the third prediction pixel 2505 and the current intra-block prediction sample 2502.
  • the weight used by the video signal processing device to generate the third prediction pixel 2505 may be an integer of 0 or more.
  • the weight of the first prediction pixel 2503 may be 3, and the weight of the second prediction pixel 2504 may be 1.
  • the intra prediction mode of the current block, the location of the generated pixel e.g., the location of the first prediction pixel 2503 in FIG. 25, the location of the second prediction pixel 2504, and the location of the third prediction pixel 2505)
  • the location of the reference pixel used to generate a prediction sample based on at least one or more such as the location of the reference pixel line (e.g., the location of the first reference pixel line and the second reference pixel line in FIG. 25) (FIG.
  • the positions of the six reference pixels of the first reference pixel line of 25 and the positions of the six reference pixels of the second reference pixel line of 25) may vary.
  • the video signal processing device may generate a prediction sample 2601 within the current block using reference pixels in which two reference pixel lines are positioned at the same vertical direction. That is, each of the six pixels of the first reference pixel line (Reference line 1) and each of the six pixels of the second reference pixel line (Reference line 2) used to generate the prediction sample within the current block have a vertical position. may be the same. The position of each pixel can be determined regardless of the position of the reference pixel line.
  • the video signal processing device may generate a first prediction pixel 2602 using six pixels of the first reference line.
  • the video signal processing device may obtain a second prediction pixel 2603 using six pixels 2607 of the second reference line.
  • the video signal processing device constructs the right pixel 2606 of the second reference line by copying (padding) the pixel 2605 and then constructing the right pixel 2606 of the second reference line ( 2606) can be used to generate the second prediction pixel 2603.
  • the video signal processing device may obtain the third prediction pixel 2604 using the first prediction pixel 2602 and the second prediction pixel 2603.
  • the video signal processing device may generate a prediction sample 2601 within the current block using the third prediction pixel 2604.
  • FIG. 26 is different from FIG. 25 only in the pixels of the first and second reference pixel lines used to generate the prediction sample within the current block, and the method of generating the prediction sample within the current block may be the same as that of FIG. 25.
  • the video signal processing device may include a DIMD mode that derives an intra prediction directional mode from a reconstructed neighboring block adjacent to the current block in the MPM list.
  • the video signal processing device can include both of the two intra prediction directionality modes in the MPM list.
  • a video signal processing device may derive an intra prediction directional mode by performing a DIMD method at a pixel position indicated by a reference pixel line. And the derived intra prediction directional mode may be included in the MPM list.
  • the video signal processing device may derive an intra-prediction directional mode using DIMD for each reference pixel line and then add the derived intra-prediction directional mode to the MPM list.
  • the reference pixel line may be a line positioned 1, 3, 5, 7, or 12 pixels away from the upper left position of the current block.
  • the reference pixel line may be a reference pixel line located above and adjacent to the current block.
  • the intra prediction directional mode derived by the video signal processing device using DIMD for each reference pixel line may be added to the MPM list. If the derived intra-prediction directional modes overlap, the overlapping intra-prediction directional modes may be excluded from the MPM list.
  • Reference pixel lines may be indexed herein.
  • reference pixel line 1 a reference pixel line adjacent to the current block
  • reference pixel line 1 a reference pixel line that is 1 pixel away from the current block, 2 pixels away, ... n pixels away from the current block
  • reference pixel line 2 a reference pixel line that is 1 pixel away from the current block, 2 pixels away, ... n pixels away from the current block
  • Line 2 ... may be indexed and referred to as reference pixel line n.
  • the video signal processing device may perform DIMD using reference pixel lines 0, 1, and 2 and derive an intra prediction directional mode.
  • the video signal processing device may perform DIMD using reference pixel lines 5, 6, and 7 and derive an intra prediction directional mode.
  • the video signal processing device may perform DIMD using reference pixel lines 11, 12, and 13 and derive an intra prediction directional mode.
  • the encoder can generate and signal a bitstream including information related to the reference pixel line that should be used to derive the intra prediction directional mode. And the encoder can generate an intra prediction block using the reference pixel line on which DIMD was performed and the intra prediction directional mode derived from DIMD.
  • the decoder may parse information related to the reference pixel line and then derive an intra prediction directional mode using the reference pixel line corresponding to the information related to the reference pixel line. And the decoder can generate an intra prediction block using reference pixel line information and an intra prediction directional mode derived from DIMD.
  • a video signal processing device may generate a virtual new reference pixel line using a plurality of reference pixel lines and generate a prediction sample within the current block based on the new reference pixel line.
  • Circles in the same horizontal row in FIG. 27 may mean pixels located on the same reference pixel line.
  • Figure 27(a) shows that the position of the reference pixel used when generating a prediction sample using at least one of the intra prediction mode of the current block, the pixel position to be generated, and the position of the reference pixel line varies for each reference pixel line.
  • the video signal processing device generates samples 2701-a to 2701-d at the '1' position for each reference pixel line using a smoothing filter, a cubic filter, or a Gaussian filter depending on the intra prediction mode, and multiple '1' position samples 2701-a to 2701-d.
  • a new virtual reference pixel line 2702 can be created using samples at the 1' position.
  • a virtual new reference pixel line 2702 may be generated using integer reference pixels closest to the '1' position.
  • a video signal processing device can generate prediction samples within the current block using a virtual new reference pixel line. Referring to FIG. 27(b), the video signal processing device can use four reference pixels at the same position in the vertical direction to create a virtual new reference pixel line 2705. That is, the pixels for generating the virtual new reference pixel line 2705 are each of the six reference pixels of the first reference pixel line and the six reference pixels of the second reference pixel line are pixels at the same position in the vertical direction. You can.
  • the video signal processing device may acquire the first prediction pixel 2703 using at least one of a virtual new reference pixel line and position, an intra prediction mode of the current block, and a pixel position to be generated.
  • the video signal processing device may generate a prediction sample 2704 of the current block using the first prediction pixel 2703.
  • the number of reference pixel lines used to generate a virtual new reference pixel line may be two or more. For example, 2 to 5 reference pixel lines may be used.
  • the video signal processing device may use four reference pixels close to the location of the new reference pixel 2801 to be created to generate a virtual new reference pixel line.
  • the location of the new reference pixel may be the same as the reference pixel line in the vertical direction. Additionally, the location of the new reference pixel may be adjacent to the direction of the intra prediction mode of the current block.
  • Figure 29 shows a method of predicting a sample using a plurality of reference pixel lines according to an embodiment of the present invention.
  • a video signal processing device may receive a plurality of reference pixel lines and perform intra prediction to generate a prediction block within the current block. Different prediction blocks can be generated depending on which reference pixel line is used, and the video signal processing device can generate a final prediction block by performing a weight average according to the weights input for each prediction block.
  • the weight may be a preset value. For example, the weight of the sample predicted by the main reference pixel line may be 3, and the weight of the sample predicted by the sub-reference pixel line may be 1.
  • the weight is based on at least one of the following: the size of the current block, the horizontal or vertical size of the current block, the intra prediction mode of the current block, quantization parameter information, and the distance (or difference) between the main reference pixel line and the sub-reference pixel line. It can be decided. Additionally, the reference pixel line may be determined based on at least one of the size of the current block, the horizontal or vertical size of the current block, the intra prediction mode of the current block, quantization parameter information, and MRL information. For example, the main reference pixel line may be a reference pixel line adjacent to the current block, and the sub-reference pixel line may be a reference pixel line indicated by the MRL.
  • the main reference pixel line may be a reference pixel line indicated by the MRL
  • the sub-reference pixel line may be a reference pixel line that is located at a certain location away from the reference pixel line indicated by the MRL, and may be located at a certain location.
  • the intra prediction mode used in the method of generating a prediction sample within the current block described above may be the same for each reference pixel line. Or, conversely, the intra prediction mode used in the method of generating the prediction sample within the current block described above may be different for each reference pixel line. That is, the signaled intra prediction mode can be used in the main reference pixel line, and in the sub-reference pixel line, a random value (corresponding to the index) is added or subtracted from (the index of) the intra prediction mode used in the main reference pixel line. Predictive mode may be used. At this time, the arbitrary value may be an integer of 1 or more.
  • the video signal processing device may determine whether to increase or decrease a random value depending on the value of the intra prediction mode used in the main reference pixel line. For example, the video signal processing device may increase the angle of the intra prediction mode by a random value if it is a negative number, and may decrease it by a random value if it is a positive number.
  • Figure 30 shows a method of determining a reference pixel line based on a template according to an embodiment of the present invention.
  • TMRL Temporal-based multiple reference line intra prediction
  • a video signal processing device can configure a reference template using a reference pixel line adjacent to the current block.
  • the video signal processing device may generate a prediction sample for the position of the reference template using reference pixel lines 1, 2, 3... (Reference lines 1, 2, 3).
  • the video signal processing device may calculate the cost between the generated prediction sample and the samples of the reference template.
  • the cost can be calculated through methods such as SAD (Sum of Absolute Differences) or MRSAD (Mean-Removed SAD).
  • SAD Sud of Absolute Differences
  • MRSAD Mean-Removed SAD
  • the encoder may rearrange the calculated costs in ascending order, construct a list of reference pixel lines, and then generate and signal a bitstream containing information about the index of the optimal reference pixel line.
  • the decoder can construct a list of reference pixel lines through the above-described method, parse the index for the optimal reference pixel line included in the bitstream, and generate a prediction sample using the reference pixel line indicated by the index. .
  • the optimal reference pixel line is not used for all intra prediction modes, but the optimal reference pixel line can be used only for the intra prediction modes included in the MPM list. That is, the encoder constructs a list of reference pixel lines by combining intra prediction modes included in the MPM list and a plurality of reference pixel lines, and predicts samples generated using each candidate in the list for reference pixel lines and The cost between standard templates can be calculated. Additionally, the encoder can rearrange the list in ascending order based on cost and then reconstruct the list using only a few combinations with low costs.
  • the encoder may generate and signal a bitstream containing information about the index for the optimal combination information among the combination information (arbitrary intra prediction mode and arbitrary reference pixel lines) in the reconstructed list.
  • the decoder can construct a list of identical reference pixel lines through the above-described method, then parse the index for the optimal combination information included in the bitstream and generate a prediction sample using the optimal combination information indicated by the index. .
  • the encoder uses a combination of intra prediction modes included in the MPM list, a plurality of reference pixel lines, and a weight for the samples predicted by each reference pixel line (e.g., one of 3:1 and 2:2).
  • a list of reference pixel lines can be constructed, and the cost between the generated prediction sample and the reference template can be calculated using each candidate in the list of reference pixel lines. Then, the video signal processing device can calculate the MPM list based on the cost.
  • the MPM list can be reconstructed using only a few low-cost combinations.
  • the encoder combines information in the reconstructed list (any intra prediction mode, any reference pixel lines, weights for the samples predicted by each reference pixel line (e.g., one of 3:1, 2:2))
  • a bitstream containing information about the index of the optimal combination information can be generated and signalled.
  • the decoder constructs a list of the same reference pixel lines through the above-described method and then inputs the optimal combination information included in the bitstream. By parsing the index, a prediction sample can be created using the optimal combination information indicated by the index.
  • a reference pixel line adjacent to the current block may be used to configure the template. Accordingly, the reference pixel line determined based on the template may be determined using reference pixel lines that are not adjacent to the current block.
  • reference pixel lines adjacent to the current block can also be used to determine the reference pixel line based on the template will be described.
  • Figure 31 shows a method of setting a template for testing a reference pixel line adjacent to the current block according to an embodiment of the present invention.
  • the reference pixel line adjacent to the current block can also be used to determine the reference pixel line based on the template.
  • a reference template can be constructed that includes only reference pixels adjacent to the left side of the current block.
  • the encoder generates a prediction sample for the reference template using at least one of Reference pixel line 0 on the upper side of the current block and/or Reference pixel line 1 on the left side of the current block.
  • the cost between the reference template and the predicted sample can be calculated.
  • the encoder can use reference pixel lines 1, 2, 3 ... (Reference lines 1, 2, 3 ...) to generate prediction samples for the reference template and calculate the cost between the reference template and the prediction sample.
  • Figure 31(b) shows a case where the reference template includes only reference pixels adjacent to the top of the current block.
  • the encoder uses at least one of Reference pixel line 0 on the left of the current block and/or Reference pixel line 1 on the top of the current block to generate a prediction sample for the reference template. You can generate and calculate the cost between the reference template and the predicted sample.
  • the encoder can use reference pixel lines 1, 2, 3 ... (Reference lines 1, 2, 3 ...) to generate prediction samples for the reference template and calculate the cost between the reference template and the prediction sample.
  • the encoder may rearrange the calculated costs in ascending order to construct a list of reference pixel lines, then generate and signal a bitstream containing information about the index of the optimal reference pixel line.
  • the decoder constructs a list of reference pixel lines through the above-described method and then generates a prediction sample using the optimal reference pixel line determined by parsing information about the index of the optimal reference pixel line included in the bitstream. can do.
  • Figure 32 is a structural diagram showing a method of determining an optimal reference pixel line using a plurality of reference pixel lines based on a template according to an embodiment of the present invention.
  • the encoder may receive a plurality of reference pixel lines and perform intra prediction to generate prediction blocks for the template. Different prediction blocks may be generated depending on which reference pixel line is used. The encoder can perform a weighted average according to various weight information input to each of the prediction blocks to finally generate a prediction block for the template. A plurality of prediction blocks may be generated depending on which reference pixel lines are used and what weights are used. After calculating the cost between each prediction block and the reference template, the encoder can rearrange them in ascending order based on the cost corresponding to each prediction block and construct a separate list using only the top few candidates of a predetermined number. At this time, the predetermined number may be an integer of 2 or more, or may be 10.
  • the encoder can generate a prediction block for the current block through the combination information used to generate the prediction block in a separate list.
  • the encoder can select the optimal candidate from the list in terms of picture quality and bit quantity, then generate and signal a bitstream containing information about the index of the optimal candidate.
  • the decoder constructs the same separate list through the above-described method, and uses the optimal combination information indicated by the index of the optimal candidate determined by parsing the information about the index of the optimal candidate included in the bitstream to predict the sample. can be created.
  • the encoded intra prediction mode may be any one of angular mode, planar mode, DC mode, and MIP mode. Prediction according to the angle mode may be prediction performed according to 65 angles, and prediction according to MIP mode may be prediction performed based on a predefined matrix. Angle mode can be effective in blocks where features such as edges exist within the current block. However, if the current block has gentle characteristics, discontinuous edges at the boundaries between blocks may be generated in the block predicted using the angle mode, or visible outlines may be generated inside the block. This may be a factor in reducing coding efficiency. Additionally, DC mode may have the disadvantage of generating visible edges at boundaries between blocks at low bit rates. Plane mode can generate prediction blocks without discontinuities by improving edge problems caused by angle mode and DC mode.
  • Figure 33 shows a method for generating prediction samples using planar mode according to an embodiment of the present invention.
  • the video signal processing device may generate a linearly predicted value in the vertical direction and a linearly predicted value in the horizontal direction to generate a prediction sample within the current block.
  • the video signal processing device may generate a prediction sample (value) within the current block by performing a weighted average of the linearly predicted value in the vertical direction and the linearly predicted value in the horizontal direction.
  • the linearly predicted value in the vertical direction (predV (x, y)) can be generated based on Equation 4, and the linearly predicted value in the horizontal direction (predH (x, y)) can be generated based on Equation 5.
  • a new prediction value (pred (x, y)) can be generated based on Equation 6.
  • W is the horizontal size (width) of the current block
  • H is the horizontal size (width) of the current block. It can be the vertical size (height).
  • rec(x, y) can mean the pixel value at (x, y) coordinates.
  • Predicted values (predV(x, y), predH(x, y), pred(x, y)) may mean the predicted pixel value at (x, y) coordinates.
  • a video signal processing device can only use linear prediction in the vertical direction when performing prediction related to the current block according to the planar mode.
  • the video signal processing device may use only linear prediction in the horizontal direction when performing prediction related to the current block according to the planar mode. Therefore, the planar mode can be divided into three modes. That is, in addition to the conventional method of weighting prediction blocks generated using linear prediction in the vertical and horizontal directions, a vertical plane mode that uses only linear prediction in the vertical direction, and a vertical plane mode that uses only linear prediction in the horizontal direction. It can be divided into horizontal plane mode.
  • the encoder can generate and signal a bitstream containing information about which prediction mode among the three planar modes the current block used.
  • the decoder may generate a prediction block for the current block based on the planar mode determined by parsing information about which prediction mode was used included in the bitstream.
  • An explicit method of signaling by including information about which plane mode was used in the bitstream may have the problem of increasing the bit amount.
  • the decoder determines the size of the current block, the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, the number of pixels (pixels) in the current block, and whether the current block is a luminance signal or a chrominance signal.
  • Recognition which plane mode was used using at least one of the intra prediction direction mode information of neighboring blocks adjacent to the current block, MPM list information for the current block, and intra prediction direction mode information derived from DIMD or TIMD. It can be induced implicitly.
  • Vertical plane mode and horizontal plane mode can be more effective when the shape of the current block is rectangular rather than square. Accordingly, the vertical plane mode and the horizontal plane mode can be applied (activated) only when the horizontal and vertical sizes of the current block are different from each other.
  • the encoder compares the horizontal and vertical sizes of the current block and then selects a plane mode, whether the vertical plane mode, the horizontal plane mode, or the conventional plane mode is applied only if the sizes are different. Signaling can be performed by generating a bitstream containing information.
  • the decoder can compare the horizontal and vertical sizes of the current block and parse the planar mode selection information only if the sizes are different. Meanwhile, when the horizontal and vertical sizes of the current block are the same, the conventional planar mode can be applied.
  • plane mode selection information information about which prediction mode among three plane modes the current block uses.
  • Plane mode selection information may be signaled for each coding unit. However, if the planar mode selection information is signaled in response to all coding units, the bit amount may increase, so the encoder can generate and signal a bitstream including the planar mode selection information only when a specific condition is satisfied. If a specific condition is satisfied, the decoder can determine the intra prediction directionality mode for the current block by parsing the plane mode selection information and generate a prediction block for the current block using the determined intra prediction directionality mode.
  • the specific conditions are the horizontal and vertical size of the current block, the ratio of the horizontal and vertical size of the current block, and the intra prediction direction mode of the current block is a specific mode (e.g., planar mode, DC mode, vertical direction mode, horizontal direction mode), whether the coding mode of the current block is DIMD, TIMD, IntraTMP, IBC, ISP, MIP coding mode, and conditions related to the index information of the reference pixel line used when generating the prediction block for the current block. You can. Whether to encode or decode the plane selection information may be determined depending on whether at least one of the specific conditions is satisfied.
  • the specific conditions are 1) if the intra prediction directionality mode of the current block is a conventional planar mode (i.e., if the index of the intra prediction directionality mode is 0), 2) the horizontal and vertical sizes of the current block are equal to the maximum transformation block size. is equal to or smaller than, and the product of the horizontal and vertical sizes of the current block is larger than the product of the minimum conversion block size and the minimum conversion block size. 3) The horizontal and vertical sizes of the current block may be different.
  • the size of the minimum transform block may be an integer, such as 4 or 8
  • the size of the maximum transform block may be an integer, such as 64, 128, 256, etc.
  • the encoder can generate and signal a bitstream including planar mode selection information, and the decoder parses the planar mode selection information and stores it in the current block.
  • the intra prediction directional mode can be determined.
  • the vertical plane mode and the horizontal plane mode are not applied, and only the conventional plane mode can be applied. That is, when the current block is a chrominance component block, the video signal processing device can generate a prediction block using the conventional planar mode. Accordingly, if the current block is a chrominance component block, the video signal processing device may not signal or parse the planar mode selection information. Meanwhile, even if the current block is a chrominance component block, the vertical plane mode or the horizontal plane mode can be applied in the same way as the luminance component block.
  • the decoder uses the vertical plane mode to match the luminance block and chrominance block of the current block to the prediction block for the luminance block and chrominance block of the current block. can be created.
  • the decoder uses the vertical plane mode to create a prediction block for the current block. can be created. If the vertical size of the current block is larger than the horizontal size, the number of pixels adjacent to the left is greater than the number of pixels adjacent to the top of the current block, so the decoder uses the horizontal plane mode to create a prediction block for the current block. can be created. If the horizontal and vertical sizes of the current block are the same, the decoder can generate a prediction block for the current block using the conventional planar mode.
  • the encoder Since the planar mode is implicitly determined according to the horizontal and vertical sizes of the current block, the encoder does not need to generate a bitstream including planar mode selection information.
  • the decoder can generate a prediction block of the current block according to the plane mode determined by the horizontal and vertical sizes of the current block.
  • Vertical plane mode and horizontal plane mode may not be applied in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in planar mode, the encoder may not signal planar mode selection information (that is, the bitstream may not include planar mode selection information). If the current block is encoded in ISP mode and the current block is encoded in flat mode, the decoder may not parse the planar mode selection information. Conversely, vertical plane mode and horizontal plane mode can be applied in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in planar mode, the encoder may generate and signal a bitstream including planar mode selection information. If the current block is encoded in ISP mode and the current block is encoded in plane mode, the decoder may generate a prediction block for the current block using the plane mode determined by parsing the plane mode selection information.
  • the video signal processing device can replace the horizontal mode (angle mode 18 in FIG. 6) with the horizontal plane mode among the conventional intra prediction directional modes. Additionally, the video signal processing device can replace the vertical mode (angle mode 50 in FIG. 6) among the conventional intra prediction directional modes with the vertical plane mode. In other words, the video signal processing device uses a horizontal plane mode and a vertical plane mode instead of the horizontal direction mode (angle mode 18 in FIG. 6) and the vertical direction mode (angle mode 50 in FIG. 6) among the conventional intra prediction directionality modes. You can use it. At this time, the video signal processing device selects the horizontal direction mode (angle mode 18 in FIG. 6) and the vertical direction mode (angle mode 50 in FIG. 6) among the conventional intra prediction directionality modes only when the horizontal and vertical sizes of the current block are different. angle mode) can be replaced with horizontal plane mode and vertical plane mode.
  • the video signal processing device can apply the vertical plane mode and the horizontal plane mode only when the size of the current block is smaller than an arbitrary size.
  • the arbitrary size may be 16 or 32 in width or height. That is, the video signal processing device can apply the vertical plane mode and the horizontal plane mode to the current block when the horizontal or vertical size of the current block is less than or equal to 32.
  • the video signal processing device may not apply the vertical plane mode and the horizontal plane mode to the current block when either the horizontal or vertical size of the current block is greater than 32.
  • the encoder may not include planar mode selection information in the bitstream. If the encoding mode of the current block is planar mode and either the horizontal or vertical size of the current block is greater than 32, the decoder does not parse the planar mode selection information and performs prediction of the current block using the conventional planar mode. can do.
  • DIMD and TIMD modes are modes that generate a prediction block by weight-averaging blocks predicted from various intra prediction modes. At this time, blocks predicted using planar mode can be used for DIMD and TIMD modes.
  • a video signal processing device When a video signal processing device generates a predicted block using the plane mode used in DIMD and TIMD modes, it can use any one of a vertical plane mode, a horizontal plane mode, and a conventional plane mode.
  • Planar mode selection information may be signaled by being included in a bitstream.
  • the decoder can parse the planar mode selection information and determine which of the three planar modes to use. For example, if the planar mode selection information indicates a vertical plane mode, the prediction block used in DIMD and TIMD modes may be a block predicted using the vertical plane mode.
  • the MIP mode can be an effective mode for complex areas.
  • a multi-prediction based MIP mode can be used.
  • the multi-prediction-based MIP mode is a method of generating the final prediction block for the current block by weighting the prediction block generated by the MIP method and the prediction block generated based on the intra-prediction directional mode.
  • the encoder can generate and signal a bitstream that includes both encoding information for the MIP mode and encoding information for the intra prediction directional mode.
  • the decoder parses both the encoding information for the MIP mode and the encoding information for the intra prediction directional mode, generates a prediction block to which the MIP mode is applied and a prediction block to which the intra prediction directional mode is applied, and then performs a weighted average of the two prediction blocks.
  • the final prediction block for the current block can be generated.
  • the MIP mode can be performed adaptively on a block basis.
  • the encoder may generate and signal a bitstream containing information about whether the multi-prediction based MIP mode is used.
  • the decoder can parse information about whether the multi-prediction-based MIP mode is used to determine whether the multi-prediction-based MIP mode or the single-prediction-based MIP mode is used when generating a prediction block for the current block.
  • Single prediction-based MIP mode is a method of generating a prediction block using only the MIP mode.
  • the encoder may additionally include in the bitstream information about whether to use the multi-prediction based MIP mode and signal it. there is. If a multi-prediction-based MIP mode is used in the current block, the encoder can additionally include information about the intra-prediction directional mode in the bitstream and signal it. If the intra-prediction mode of the current block is MIP, the decoder additionally parses information about whether the multi-prediction-based MIP mode is used, and if the multi-prediction-based MIP mode is used, the decoder additionally parses information about the intra-prediction directional mode. You can.
  • the bit quantity may increase and compression efficiency may be reduced.
  • a multi-prediction based MIP mode is used in the current block, only a certain intra prediction directional mode can be used.
  • any given intra prediction directionality mode may be one of the MPM list, and the encoder may signal by including index information about the intra prediction directionality mode to be used in the multi-prediction-based MIP mode among the MPM list in the bitstream.
  • the decoder can parse the index information and determine the intra-prediction directional mode to be used in the multi-prediction-based MIP mode from the MPM list.
  • a vertical plane mode, a horizontal plane mode, and a conventional plane mode can be used to generate a prediction block based on the intra prediction directional mode. That is, the encoder can generate and signal a bitstream including planar mode selection information. If the multi-prediction-based MIP mode is used in the current block, the decoder can parse the planar mode selection information to determine the intra-prediction directional mode to be used in the multi-prediction-based MIP mode.
  • the video signal processing device can determine which of the three planar modes to use using the intra-prediction directional mode of the DIMD derived from surrounding pixels of the current block. For example, when a multi-prediction based MIP mode is used in the current block, the video signal processing device generates a prediction block based on the intra-prediction directional mode if the DIMD (or TIMD) mode of the current block is less than 34. To do this, a horizontal plane mode can be applied. Alternatively, if the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the vertical plane mode may be applied to the current block to generate a prediction block based on the intra prediction directional mode.
  • the video signal processing device If a planar mode is used in the current block, the video signal processing device generates a prediction block for each mode using the vertical plane mode and the horizontal plane mode, and applies a weight to each prediction block to create the final prediction block. can be created.
  • the weight for each prediction block may be the same or different depending on the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the largest weight may be applied to the block predicted using the vertical plane mode. For example, the weight for a block predicted using a vertical plane mode may be 3, and the weight for a block predicted using a horizontal plane mode may be 1.
  • the intra-prediction directional mode of the DIMD derived from the surrounding pixels of the current block is smaller than a random value, the greatest weight may be applied to the block predicted using the horizontal plane mode.
  • the weight for a block predicted using the horizontal plane mode may be 3, and the weight for a block predicted using the vertical plane mode may be 1.
  • the arbitrary value is an integer, such as 34 (angle mode 34 in FIG. 6).
  • DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not performed among the DIMD information of neighboring pixels of the current block, the video signal processing device may generate a prediction block by applying the same weight.
  • the prediction block of the current block is weighted based on the prediction block in which intra prediction mode is used (intra prediction block) and the prediction block in which inter prediction mode is used (inter prediction block). It can be generated by averaging.
  • the encoder can generate and signal a bitstream including planar mode selection information. If CIIP mode is used and planar mode is used, the decoder may parse the planar mode selection information to determine the intra prediction mode used to generate the intra prediction block.
  • PDPC ition dependent intra prediction combination
  • the vertical plane mode is used to generate the prediction block of the current block
  • PDPC filtering based on the plane mode is not performed, but PDPC filtering based on the horizontal angle mode (e.g., angle mode 18 in FIG. 6) is performed. It can be.
  • PDPC filtering based on the plane mode is not performed, and PDPC filtering is performed based on the vertical angle mode (e.g., angle mode 50 in FIG.
  • the meaning that the current block is predicted may be the same as the meaning that the prediction block of the current block is generated.
  • the pixel value of rec(-1, H) when the vertical plane mode is used to generate a prediction block of the current block, the pixel value of rec(-1, H), which is a fixed position, changes flexibly according to the x-axis coordinate.
  • a prediction block of the current block may be generated based on the pixel value of rec(x, -1).
  • the pixel value of rec(W, -1) when the horizontal plane mode is used to generate a prediction block of the current block, the pixel value of rec(W, -1), which is a fixed position, and the y-axis coordinate are flexible.
  • a prediction block of the current block can be generated based on the pixel value of rec(-1, y) that changes to .
  • the prediction block can be generated so that the continuity of pixel values is maintained at the boundary between neighboring blocks, so if the prediction block of the current block is generated using the vertical plane mode or the horizontal plane mode, PDPC will not be performed. You can.
  • PDPC filtering for the planar mode described above can be applied even when the current block is encoded in CIIP mode.
  • the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the vertical plane mode or the horizontal plane mode, the video signal processing device selects the intra prediction directional mode of the neighboring block. You can set it to planar mode and include it in the MPM list. Or, when the video signal processing device constructs the MPM list for the current block, if neighboring blocks adjacent to the current block are predicted in vertical plane mode or horizontal plane mode, set the intra prediction directionality mode of the neighboring block to DC mode. It can be included in the MPM list.
  • the intra prediction direction mode of the neighboring block is set to the horizontal angle mode (No. 18 in FIG. 6 You can set it to angle mode and include it in the MPM list.
  • the video signal processing device constructs the MPM list for the current block if the neighboring block adjacent to the current block is predicted in the vertical plane mode, the intra prediction direction mode of the neighboring block is set to the vertical angle mode (50 in FIG. 6 It can be included in the MPM list by setting it to angle mode).
  • the video signal processing device when the video signal processing device constructs the MPM list for the current block, if the surrounding blocks adjacent to the current block are predicted to be in the horizontal plane mode, the video signal processing device can be included in the MPM list by setting the intra prediction direction mode of the neighboring block to vertical angle mode (angle mode 50 in FIG. 6).
  • the video signal processing device when the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the vertical direction plane mode, the video signal processing device changes the intra prediction directionality mode of the neighboring block to the horizontal angle mode ( It can be set to angle mode 18 in FIG. 6 and included in the MPM list.
  • the vertical plane mode and horizontal plane mode proposed in this specification may not be signaled as any specific mode, but may be included and signaled as any one of the intra prediction directional modes.
  • intra prediction directional modes there are a total of 67 intra prediction directional modes, of which 0 (planar mode) and 1 (DC mode) are non-directional modes, and 2 to 66 are directional modes (angle mode).
  • Intra prediction directional modes can be expanded to include newly defined vertical plane modes and horizontal plane modes. For example, in the existing intra prediction directional mode, mode 2 can be set to the vertical plane mode and mode 3 can be set to the horizontal plane mode.
  • numbers 0 (flat mode), 1 (DC mode), 2 (vertical flat mode), and 3 (horizontal flat mode) are non-directional modes
  • numbers 4 to 68 are the existing directional modes from 2 to 66. It can be set the same as the mode.
  • Figure 34 shows a method for deriving a multiple transform set and an LFNST set for a vertical plane mode or a horizontal plane mode according to an embodiment of the present invention.
  • Figure 35 shows a mapping table according to an embodiment of the present invention.
  • Figure 36 shows a conversion type set table according to an embodiment of the present invention.
  • Figure 37 shows a conversion type combination table according to an embodiment of the present invention.
  • Figure 38 shows a threshold table for IDT conversion type according to an embodiment of the present invention.
  • the characteristics of the error (residual) signal (block) may be similar to the characteristics of the error signal in the vertical angle mode (angle mode 50 in FIG. 6).
  • the multiple transform set (MTS) applied to the error signal may vary based on the intra prediction directional mode of the current block. That is, when the prediction block of the current block is generated using the vertical plane mode, the encoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the vertical angle mode (angle mode 50 in FIG. 6).
  • a set of transformation matrices can be used to perform a first-order transformation process based on multiple transformation sets.
  • the encoder may perform the primary transformation using a predetermined transform set regardless of the multiple transform sets. Additionally, the encoder can perform secondary transformation through LFNST on the primary transformed transform coefficients using multiple transform sets or a predetermined transform set.
  • the transformation matrix used when performing LFNST may vary depending on the intra prediction directionality mode. That is, when the vertical plane mode is used to generate the prediction block of the current block, the encoder does not use the set of second-order LFNST transformation matrices for the plane mode for the error signal, but uses the vertical angle mode (number 50 in Figure 6). The transformation process can be performed using a set of second-order LFNST transformation matrices (in angular mode).
  • the encoder uses the horizontal angle mode (angle mode 18 in Figure 6) rather than the planar mode to generate the first or second transformation matrix (or set of matrices). , set of matrices, set of kernels) can be derived.
  • the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but rather uses the vertical angle mode (angle mode 50 in Figure 6 )
  • the transformation process can be performed using a set of first-order LFNST transformation matrices.
  • the decoder when the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but rather the set of transformation matrices of the vertical angle mode (angle mode 50 in Figure 6).
  • a set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets.
  • the encoder may perform secondary transformation after performing primary transformation in the encoding process, which corresponds to the primary transformation and secondary transformation in the decoding process of the decoder, respectively.
  • the primary transformation performed by the encoder corresponds to the secondary transformation performed by the decoder (the inverse transformation of the primary transformation performed by the encoder)
  • the secondary transformation performed by the encoder corresponds to the primary transformation performed by the decoder (the reverse transformation of the primary transformation performed by the encoder). It corresponds to the inverse transformation of the secondary transformation performed.
  • Equation 4 when the vertical plane mode is used to generate the prediction block of the current block, the prediction block is generated according to the pixel value of rec(-1, H), which is a fixed position, and the x-axis coordinate. It can be generated based on the dynamically changing pixel value of rec(x, -1). That is, when the vertical plane mode is used, a change in pixel value occurs along the x-axis, so the characteristics of the error signal may be similar to those of the horizontal angle mode (angle mode 50 in FIG. 6).
  • the set of multiple transforms applied to the error signal may vary based on the intra prediction directional mode of the current block.
  • the encoder when the vertical plane mode is used to generate the prediction block of the current block, the encoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the horizontal angle mode (angle mode No. 18 in Figure 6).
  • a set of transformation matrices can be used to perform a first-order transformation process based on multiple transformation sets.
  • the encoder may perform the primary transformation using a predetermined transform set regardless of the multiple transform sets.
  • the encoder can perform secondary transformation through LFNST on the primary transformed transform coefficients using multiple transform sets or a predetermined transform set.
  • the transformation matrix used when performing LFNST may vary depending on the intra prediction directionality mode.
  • the encoder when the prediction block of the current block is generated using the vertical plane mode, the encoder does not use the set of second-order LFNST transformation matrices for the planar mode for the error signal, but uses the horizontal angle mode (number 18 in Figure 6).
  • the transformation process can be performed using a set of second-order LFNST transformation matrices (in angular mode).
  • the encoder uses the vertical angle mode (e.g., angle mode 50 in Figure 6) rather than the planar mode to generate the first or second transformation matrix ( Alternatively, a set of matrices, a set of matrices, and a kernel set) can be derived.
  • the decoder When the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but uses the horizontal angle mode (angle mode 18 in Figure 6 )
  • the transformation process can be performed using a set of first-order LFNST transformation matrices.
  • the decoder when the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the horizontal angle mode (angle mode No. 18 in Figure 6).
  • a set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets.
  • the encoder uses the vertical angle mode (angle mode 50 in Figure 6) rather than the planar mode to generate the first or second order transformation matrix (or set of matrices). , set of matrices, set of kernels) can be derived.
  • the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but rather uses the vertical angle mode (angle mode 50 in Figure 6
  • the transformation process can be performed using a set of first-order LFNST transformation matrices for ).
  • the decoder when the horizontal plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but rather the set of transformation matrices of the vertical angle mode (angle mode 50 in Figure 6).
  • a set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets.
  • the video signal processing device can derive nSzIdxW and nSzIdxH values based on the size of the current block in order to map the horizontal and vertical sizes of the current block into one variable.
  • nSzIdxW calculates the logarithm of 2 to the width of the current block, discarding decimal places, and can be the minimum value between 2 and 3.
  • nSzIdxH can be the minimum value between 2 and 3 after calculating the logarithm of 2 to the height of the current block, discarding the decimal places.
  • the video signal processing device can derive the intra-directional mode (predMode) of the current block.
  • predMode intra-directional mode
  • TIMD mode intra prediction modes expanded from the existing 67 to 131 can be used, reducing precision to the existing 67 modes.
  • the video signal processing device can derive the ucMode, nMdIdx, and isTrTransposed values.
  • ucMode can be set to '0'
  • nMdIdx can be set to '35'
  • isTrTransposed can be set to a value derived from MIP.
  • ucMode can be set to the intra-directional mode (predMode) of the current block.
  • predMode may mean the index value of intra directional mode.
  • predMode can be determined through extended angle mode according to the width-to-height size ratio of the current block.
  • the video signal processing device can clip predMode to a value between 2 and 66. If the prediction block of the current block is generated using the vertical plane mode, the video signal processing device may reset predMode to the horizontal prediction mode (angle mode no. 18 in FIG. 6). If the prediction block of the current block is generated using the horizontal plane mode, the video signal processing device may reset predMode to the vertical prediction mode (angle mode No. 50 in FIG. 6).
  • predMode is greater than angle mode 34, which is diagonal mode
  • the isTrTransposed value can be set to 1
  • the isTrTransposed value can be set to 0.
  • predMode is greater than 34
  • the video signal processing device resets the value of predMode to a value subtracted from 67 (the maximum value of the intra directional mode index) plus 1. For example, if predMode is 35, the video signal processing device can reset angle mode 35 to angle mode 33 (67+1-35(predMode)).
  • predMode is 66
  • the video signal processing device can reset angle mode 66 to angle mode 2 (67+1-66(predMode)). That is, by making it symmetrical based on angle mode 34, which is the diagonal mode. , which has the effect of reducing the size of the conversion mapping table in Figure 35 by about half.
  • the video signal processing device can derive the nSzIdx value through nSzIdxW, nSzIdxH, and isTrTransposed values. If the isTrTransposed value is '1', the value obtained by multiplying nSzIdxH by 4 and adding nSzIdxW may be set as nSzIdx. If the isTrTransposed value is '0', the value obtained by multiplying nSzIdxW by 4 and adding nSzIdxH may be set as nSzIdx.
  • the video signal processing device can use nSzIdx, which is the size information of the current block, and nMdIdx, which is the intra directionality mode information of the current block, to derive nTrSet, which is an index of the set of available transformation types according to the predefined table in FIG. 35.
  • Figure 35 defines the index of the transformation type set according to the intra-screen orientation mode (0 to 34 and MIP) of the current block and the size index (0 to 15) of the current block.
  • nTrSet can be 80 types. If the size of the current block is 4x8 and the orientation mode within the screen of the current block is 13, nTrSet can be '7'.
  • the video signal processing device can parse mts_idx included in the bitstream and derive a transformation type set corresponding to nTrSet from the table in FIG. 36.
  • the conversion type in the vertical and horizontal directions is set differently depending on whether predMode is a value greater than angle mode 34, which is diagonal mode.
  • numbers 0 to 79 of the gray-shaded vertical column may correspond to nTrSet
  • numbers 0 to 3 of the gray-shaded horizontal column may correspond to mts_idx. Referring to FIG. 36, if nTrSet is 7 and the value of mts_idx is 3, 22 can be selected from (2, 17, 18, 22).
  • DST1 and DCT5 corresponding to index 22 of the transformation type combination table of FIG. 37 are selected, and the vertical transformation type of the current block can be set to DST1 and the horizontal transformation type to DCT5.
  • 0 to 24 in the gray-shaded horizontal column of FIG. 37 are indices selected through FIG. 36, and 0 to 1 in the gray-shaded vertical column may mean the vertical direction conversion type and the horizontal direction conversion type, respectively. If the intra-screen prediction directionality mode of the current block is greater than 34, which is the diagonal mode, the vertical and horizontal transformation types are exchanged.
  • the vertical or horizontal transformation type can be reset to the IDT transformation type through a process described later.
  • the vertical direction transformation type can be reset to the IDT transformation type. If the absolute value difference between the index of the intra-screen prediction direction mode of the current block and 18, which is the index of the horizontal direction mode, is less than a certain value, the vertical direction transformation type can be reset to the IDT transformation type. If the absolute value difference between the index of the intra-screen prediction direction mode of the current block and 50, which is the index of the horizontal direction mode, is less than a certain value, the horizontal direction transformation type can be reset to the IDT transformation type.
  • the arbitrary value is an integer and can be determined based on the horizontal or vertical size of the current block. For example, any given value can be determined through the table in FIG. 38.
  • the table in Figure 38(a) shows a case where the threshold value is set differently every time the horizontal or vertical size differs by 4, and the table in Figure 38(b) shows a case where the threshold value is set each time the horizontal or vertical size differs by 2. Indicates a case where the value is set differently. If the current block size is 16x16, the vertical transformation type is not reset to the IDT transformation type, and the existing transformation type can be maintained as is.
  • Figure 39 shows a method by which a video signal processing device derives a first-order or second-order transformation matrix according to an embodiment of the present invention.
  • Figure 39 shows that when the current block is predicted using a vertical plane mode, a horizontal plane mode, or a conventional plane mode, the video signal processing device uses a first or second transformation matrix (a set of matrices, a set of matrices) , shows a flowchart of how to derive the kernel set).
  • a first or second transformation matrix (a set of matrices, a set of matrices)
  • the video signal processing device can receive an intra prediction directional mode and check whether the prediction mode of the current block is a planar mode. If the prediction mode is not a planar mode, the video signal processing device may derive a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the input intra prediction directional mode. When the prediction mode is a planar mode, the video signal processing device can check whether the prediction mode is a vertical planar mode. When the prediction mode is the vertical plane mode, the video signal processing device creates a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the horizontal angle mode (angle mode 18 in Figure 6).
  • the video signal processing device may check whether the prediction mode is the horizontal plane mode.
  • the video signal processing device creates a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the vertical angle mode (angle mode 50 in Figure 6). It can be induced. If the prediction mode is not a horizontal plane mode, the video signal processing device may derive a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the conventional planar mode.
  • the video signal processing device uses the intra prediction directional mode derived using the DIMD method.
  • a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) can be derived.
  • the video signal processing device uses the intra prediction directionality derived using the DIMD method.
  • a set of transformation matrices of modes can be used to perform a first-order transformation process based on multiple transformation sets.
  • the video signal processing device uses the intra prediction directional mode derived using the DIMD method.
  • a second-order transformation process based on LFNST can be performed using a set of transformation matrices.
  • DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not applied among the DIMD information from the surrounding pixels of the current block in the encoder and decoder, the first or second transformation matrix (or set of matrices, set of matrices, or kernel set) is used using the existing Planar prediction mode. It can be induced.
  • the encoder can implicitly apply the DCT2 transformation method without performing a first-order transformation process based on a multiple transformation set.
  • the decoder can apply the DCT2 transformation method if the current block is predicted in planar mode. If the current block is predicted to be in a conventional planar mode, the video signal processing device can implicitly apply the DCT2 transformation method without performing a primary transformation process based on a multiple transformation set. If the current block is predicted to be a vertical plane mode or a horizontal plane mode, the video signal processing device can apply a first-order transformation process based on a multiple transformation set.
  • the video signal processing device may implicitly apply the DCT2 transformation method without applying the first transformation process based on the multiple transformation set. If the current block is predicted to be in a conventional planar mode, the video signal processing device can apply a first-order transform process based on a multiple transform set. Additionally, in the above-described method, if the size of the current block is an arbitrary size, the DST7 conversion method rather than the DCT2 conversion method can be applied. At this time, the arbitrary size may be the case where the horizontal or vertical size of the current block is equal to or greater than 4 or less than or equal to 16.
  • the video signal processing device requires horizontal direction conversion.
  • DCT2 can be applied, and DST7 can be applied for vertical conversion.
  • DC mode can also be divided into three prediction modes. Specifically, DC mode can be divided into modes based on the average between the upper pixels of the current block, the average between the left pixels of the current block, and the average between the upper and left pixels of the current block. If the horizontal size of the current block is larger than the vertical size, the video signal processing device may generate a prediction block of the current block using the average value between upper pixels of the current block. If the vertical size of the current block is larger than the horizontal size, the video signal processing device may generate a prediction block of the current block using the average value between the left pixels of the current block. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block of the current block using the average value between the upper and left pixels.
  • the encoder can generate and signal a bitstream containing information (DC mode selection information) on which of the three DC modes the current block was predicted based on.
  • the decoder may generate a prediction block for the current block based on the mode determined by parsing the DC mode selection information. If the prediction mode of the current block is DC mode, the encoder can generate and signal a bitstream including information about what mode it was encoded in. If the prediction mode of the current block is DC mode, the decoder can parse the DC mode selection information and determine the final DC mode for the current block.
  • the encoder signals the information that the current block is in DC mode and predicts that the current block is predicted to be in DC mode using the average between left pixels. Predicted information can be signaled using additional flag bits. If the current block is in DC mode, the decoder can determine which mode is applied to the current block by parsing additional flag bits.
  • the above three DC prediction modes may not be used in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in DC mode, the encoder provides a flag indicating whether the current block is DC mode using the average between left pixels or DC mode using the average between top pixels. Bits may not be signaled. If the current block is in ISP mode and the current block is in DC mode, the decoder does not parse the flag bit indicating whether the current block is in DC mode using the average between left pixels or DC mode using the average between top pixels. It may not be possible.
  • the three DC prediction modes can be used in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in DC mode, the encoder can signal a flag bit indicating which of the three DC prediction modes the prediction mode of the current block is and include it in the bitstream. If the current block is ISP mode and the current block is DC mode, the decoder can set the final DC mode for the current block by parsing the flag bit.
  • Whether or not to apply the three DC prediction modes can be determined based on the color component of the current block.
  • the above three DC prediction modes can be used.
  • the current block is a chrominance component block, among the three DC prediction modes, only the DC prediction mode that uses the average between the upper and left pixels can be used. Therefore, if the current block is a chrominance component block and DC mode is applied, the encoder may not include a flag bit indicating which of the three DC modes is used in the bitstream.
  • the decoder may not parse the flag bit indicating which of the three DC modes is used, and sets the DC mode for the current block to the upper and left pixels. It can be set to DC prediction mode, which uses the average between
  • the current block When ISP mode is applied, the current block may be divided horizontally or vertically. Depending on the horizontal or vertical size of the current block, one block can be divided into 2 or 4 blocks.
  • the prediction mode can be determined according to the division type of the block. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, the horizontal plane mode can be used among the three plane modes. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, the vertical plane mode can be used among the three plane modes.
  • the mode that uses the average between left pixels can be used. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, among the three DC modes, the mode that uses the average between upper pixels can be used.
  • the division type of the ISP mode may be determined based on the intra prediction directional mode derived from DIMD or the intra prediction directional mode derived from TIMD. If the DIMD (or TIMD) mode of the current block is less than 34, the ISP partition type of the current block may be horizontal partition. If the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the ISP partition type of the current block may be vertical partition. Conversely, if the DIMD (or TIMD) mode of the current block is less than 34, the ISP division type of the current block may be vertical division. If the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the ISP partition type of the current block may be horizontal partition.
  • the splitting type of the ISP mode is determined based on the intra prediction directional mode derived from DIMD (or TIMD), the splitting type is implicitly determined, so the encoder may not include information about the ISP splitting type in the bitstream. , the decoder may not parse information about the ISP partition type.
  • the video signal processing device can use all three DC modes to generate prediction blocks for each mode, and apply the same or different weights to each prediction block to generate the final prediction block through weight average.
  • the largest weight may be applied to the block predicted using the average between the upper pixels.
  • the horizontal size of the current block is smaller than the vertical size, the largest weight may be applied to the block predicted using the average between left pixels.
  • the intra prediction direction mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the largest weight may be applied to the block predicted using the average between the upper pixels.
  • the largest weight may be applied to the block predicted using the average between left pixels.
  • the arbitrary value can be an integer and can be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6).
  • DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not applied among DIMD information derived from surrounding pixels of the current block, the largest weight may be applied to the block predicted using the average between all pixels on the upper and left sides.
  • Figure 40 shows a DC prediction method on a vertical or horizontal line basis according to an embodiment of the present invention.
  • DC mode is a prediction method that generates a prediction block for the current block using only one average value, and has the characteristic that all pixels in the prediction block have the same value.
  • a video signal processing device can generate a prediction block so that the average value changes depending on the vertical or horizontal position within the block, and use this to predict DC based on the gradient. It is described as a mode. Referring to FIG. 40, when a prediction block for the current block is generated using DC mode in the vertical direction, the video signal processing device selects pixels upwardly adjacent to the current block (e.g., the hatched pixel in FIG. 40).
  • a prediction sample can be generated by applying the average value to the pixels corresponding to the first horizontal line of the current block (for example, pixels indicated by 1 in FIG. 40).
  • the average value may be recalculated according to the degree of change between the reference pixel (A) located at the top of the pixels adjacent to the left of the current block and the reference pixel (B) of the next horizontal line.
  • the video signal processing device may generate a prediction sample by applying the recalculated average value to the second horizontal line of the current block (for example, pixels indicated by 2 in FIG. 40).
  • How to recalculate the average value for the second horizontal line is the distance between reference pixel (A) and reference pixel (B) (L), the distance between reference pixel (A) and reference pixel (E) (M), and ) and the pixel (E) at a position of (-1, -1) based on the lower left position of the current block.
  • the average value can be recalculated by adding L divided by M multiplied by X to the average value.
  • the same is performed for the next horizontal line, so that a prediction sample for the current block can be generated. That is, the prediction block of the current block may be generated so that the average value for each horizontal (or vertical) line changes according to the gradient of reference pixels adjacent to the left (or top) of the current block.
  • the pixel (pixel) values of each horizontal (or vertical) direction sample are configured to be the same, and the prediction block of the current block may be generated so that at least one vertical (or horizontal) pixel (pixel) value is different.
  • the line-level DC prediction mode can be divided into a line-level DC prediction mode in the vertical direction and a line-level DC prediction mode in the horizontal direction. If the horizontal size of the current block is larger than the vertical size, the number of pixels (pixels) adjacent to the upper side of the current block is large, so the prediction block for the current block is generated using the line-by-line DC prediction mode in the vertical direction. It can be. Alternatively, if the horizontal and vertical sizes of the current block are the same, a prediction block for the current block can be generated using the conventional DC prediction mode.
  • Figure 41 shows a plane prediction method in units of vertical or horizontal lines according to an embodiment of the present invention.
  • the position of the standard reference pixel used may vary for each horizontal line.
  • the first horizontal line of the current block uses pixels adjacent to the upper side of the current block (e.g., hatched pixels in Figure 41) and the A pixel. It can be predicted.
  • the second horizontal line of the current block can be predicted using pixels adjacent to the top of the current block (e.g., hatched pixels in Figure 41) and the B pixel. there is.
  • the line-by-line planar prediction mode can be divided into a vertical planar mode, a horizontal planar mode, and a weighted average mode of prediction blocks in the vertical and horizontal directions. If the horizontal size of the current block is larger than the vertical size, the number of pixels (pixels) adjacent to the upper side of the current block is large, so the video signal processing device generates a prediction block for the current block using the vertical plane mode. can do. If the vertical size of the current block is larger than the horizontal size, the number of pixels (pixels) adjacent to the left of the current block is large, so the video signal processing device can generate a prediction block of the current block using the vertical direction plane mode. You can. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block for the current block using a conventional planar mode.
  • Figure 42 shows a prediction method in sub-block units using planar mode according to an embodiment of the present invention.
  • the video signal processing device may divide the current block into sub-blocks of an arbitrary specified size (MxN) and then perform prediction on a sub-block basis using a planar mode.
  • MxN arbitrary specified size
  • the positions of standard reference pixels for prediction (1, 2, 3, and 4 in FIG. 42) may vary for each sub-block.
  • the current block can be divided into 4 sub-blocks of MxN size.
  • the position of the standard reference pixel may be determined based on the upper left position of the current sub-block and/or the horizontal and vertical sizes of the current sub-block.
  • the positions of the standard reference pixels of the upper left subblock can be 1 and 3, the positions of the standard reference pixels of the upper right subblock can be 2 and 3, and the standard reference pixels of the lower left subblock can be 1 and 3.
  • the positions of can be 1 and 4, and the positions of the standard reference pixels of the lower right sub-block can be 2 and 4.
  • the video signal processing device uses the V pixel value and the value generated using the reference pixel 3 and H
  • a predicted value for the pixel marked with an Figure 42(b) shows prediction of the horizontal plane mode on a sub-block basis. For example, when the prediction block for the lower left sub-block in FIG.
  • FIG. 42(b) is generated, if the horizontal plane mode is used, the video signal processing device generates the H pixel value and the standard reference pixel 1. A weighted average of the values can be used to generate a predicted value for the X-marked pixel.
  • Figure 42(c) shows prediction of the vertical plane mode on a sub-block basis. For example, when a prediction block for the upper right sub-block in Figure 42(c) is generated, if the vertical plane mode is used, the video signal processing device generates a value using the V pixel value and the reference pixel 3. You can generate a predicted value for the pixel marked with X by weighting the average.
  • the video signal processing device includes the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, whether the current block is a luminance component block or a chrominance component block, quantization parameter information, and intra prediction directionality of neighboring blocks of the current block. Based on at least one of the mode information, the position of the subblock, and intra prediction directional mode information derived using DIMD from surrounding pixels of the current block, a horizontal plane mode, a vertical plane mode, and a conventional plane are applied to each subblock. Among the modes, you can determine which planar mode is applied.
  • the video signal processing device may apply the vertical plane mode to generate the prediction block of the sub-block. If the intra prediction directional mode derived using DIMD from the surrounding pixels of the current block is smaller than a random value, the video signal processing device may apply the horizontal plane mode to generate the prediction block of the sub-block.
  • the arbitrary value may be an integer or may be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6).
  • DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If DIMD information derived from surrounding pixels of the current block indicates that weight prediction is not performed, the video signal processing device may generate a prediction block for each sub-block using a conventional planar mode.
  • the plane mode used to generate the prediction block for each sub-block may be determined based on the location of each sub-block.
  • the video signal processing device may use a conventional planar mode to generate a prediction block of the upper left sub-block, use a vertical plane mode to generate a prediction block of the upper right sub-block, and use a horizontal plane mode to generate a prediction block of the upper-right sub-block.
  • the prediction block of the lower left sub-block can be generated, and the prediction block of the lower right sub-block can be generated using the conventional unfolding mode.
  • the sub-block unit plane mode prediction method can be applied.
  • the video signal processing device can generate a prediction block of the current block using the conventional planar mode. If the vertical or horizontal plane mode is used for the current block, the video signal processing device can divide the current block into subblocks and generate a prediction block for each subblock using the vertical or horizontal plane mode. there is.
  • the first horizontal line of the current block (pixels marked 1 in Figure 40(a)) can be predicted using the A pixel and pixels adjacent to the upper part of the current block (e.g., the hatched pixels in Figure 40). there is.
  • the second horizontal line of the current block (pixels marked 2 in Figure 40(a)) will be predicted using the pixels adjacent to the upper part of the current block (e.g., the hatched pixels in Figure 40) and the B pixel. You can.
  • the line-level planar mode can be divided into a vertical planar mode, a horizontal planar mode, and a weighted average prediction mode of prediction blocks in the vertical and horizontal directions.
  • the video signal processing device can generate a prediction block for the current block using the vertical plane mode. You can. If the vertical size of the current block is larger than the horizontal size, the number of pixels (pixels) adjacent to the left of the current block is large, so the video signal processing device generates a prediction block for the current block using the horizontal plane mode. can do. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block for the current block using a conventional planar mode.
  • the video signal processing device When the prediction block of the current block is generated using the planar mode, the video signal processing device generates the prediction block using the vertical planar mode, and generates the prediction block using the horizontal planar mode, and each prediction block The final prediction block can be generated by weighting the average. At this time, the weights may be the same or different. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the weight of the block predicted using the vertical plane mode may be the largest. The weight of the block predicted using the vertical plane mode may be 3, and the weight of the block predicted using the horizontal plane mode may be 1.
  • the weight of the block predicted using the horizontal plane mode may be the largest.
  • the weight of the block predicted in the horizontal plane mode may be 3, and the weight of the block predicted in the vertical plane mode may be 1.
  • the arbitrary value is an integer, which may be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6).
  • DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If DIMD information derived from neighboring pixels of the current block indicates that weight prediction is not applied, the video signal processing device may apply the same weight to each prediction block.
  • the prediction block generated using the vertical plane mode and the prediction block generated using the horizontal plane mode may be generated using a sub-block-based planar mode prediction method.
  • the video signal processing device may perform correction on the prediction block by adding a random offset value to the prediction block of the current block generated through DC mode.
  • information about the arbitrary offset value may be included in the bitstream and explicitly signaled, or may be implicitly derived from surrounding pixel values adjacent to the current block.
  • the decoder may perform correction on the prediction block of the current block based on the offset value obtained by parsing information about an arbitrary offset value.
  • the decoder may perform correction for the prediction block of the current block by deriving an offset value from neighboring pixel values adjacent to the current block.
  • the prediction block of the current block may be generated by weighting the average of a block predicted using planar mode and a block predicted using DC mode.
  • the video signal processing device may configure a reference template including reconstructed neighboring blocks adjacent to the current block (see FIG. 23). And the video signal processing device can configure prediction templates for the three planar modes using reference pixels around the reference template. The video signal processing device may calculate the cost between the reference template and the prediction template and then generate a prediction block of the current block using a planar prediction mode indicating the minimum cost.
  • the video signal processing device may configure a reference template including reconstructed neighboring blocks adjacent to the current block (see FIG. 23). And the video signal processing device can configure prediction templates for the three planar modes using reference pixels around the reference template.
  • the video signal processing device may calculate the cost between the reference template and the prediction template and then configure a list of planar modes based on the cost. At this time, the planar mode with the smallest cost may be located at the beginning of the list, and the list may be organized in ascending order according to cost.
  • the encoder may generate and signal a bitstream including index information about the optimal plane mode for generating the prediction block of the current block among the plane modes in the list.
  • the decoder can generate a prediction block of the current block using a planar mode determined by parsing the index information.
  • the above-described template-based planar mode derivation method can be equally applied to the three DC modes.
  • Figure 43 shows an intra prediction method based on bidirectional prediction according to an embodiment of the present invention.
  • a video signal processing device When a video signal processing device encodes the current block in intra prediction mode, pixels on the left or upper side of the current block are adjacent to neighboring pixels of the reconstructed current block, so they can be effectively predicted. However, the prediction efficiency of pixels to the right or below the current block is low because adjacent pixels have not yet been restored. In other words, the farther the pixel is located in the lower right corner of the current block, the farther the distance from the reference pixel (pixels around the restored current block) becomes, so the error signal increases. In order to improve this problem, as shown in FIG. 43, the video signal processing device restores only one pixel located on the lower right side of the current block in advance, and then restores the current block based on the restored lower right pixel and surrounding pixels adjacent to the current block. A prediction block can be generated.
  • the pixel located on the lower right side of the current block can be predicted and encoded from the pixel adjacent to the current block, and information about the difference value, which is the difference between the pixel value located on the lower right side of the current block and the predicted value, is included in the bitstream and signaled. It can be.
  • the decoder can restore the pixel located on the lower right side of the current block using the difference value determined by parsing information about the difference value.
  • the video signal processing device can generate a prediction block of the current block using pixels adjacent to the current block and one pixel located at the lower right of the current block.
  • the video signal processing device uses pixels adjacent to the current block and one pixel located on the lower right side of the current block to display pixels on the right side of the current block (pixels marked 1 in FIG. 43) and pixels on the lower side (pixels marked 1 in FIG. 43). After predicting (pixels indicated by ), a prediction block of the current block can be generated using pixels adjacent to the current block and the lower and right pixels within the current block.
  • a method of converting the residual signal, quantizing the obtained transform coefficient value, and coding the quantized transform coefficient may be used.
  • the converter may obtain a transform coefficient value by converting the residual signal.
  • the residual signal of a specific block may be distributed throughout the entire area of the current block. Accordingly, coding efficiency can be improved by concentrating energy in the low-frequency region through frequency domain conversion of the residual signal.
  • the encoder may obtain at least one residual block containing the residual signal for the current block.
  • the remaining block may be either the current block or blocks divided from the current block.
  • a residual block may be described as a residual array or residual matrix containing residual samples of the current block. Additionally, in this specification, the residual block may represent a block with the same size as the size of the transform unit or transform block.
  • the encoder can transform the remaining blocks using a transform kernel.
  • the transformation kernel used for transformation of the remaining block may be a transformation kernel with separable characteristics of vertical transformation and horizontal transformation.
  • transformation for the remaining 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 remaining 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.
  • transformation kernels based on different transformation types may be used for each of vertical transformation and horizontal transformation. That is, before performing the first transformation, a transformation method for the vertical and horizontal directions is derived using at least one of the intra prediction mode of the current block, the encoding mode, the transformation method parsed from the bitstream, and the size information of the current block. It can be. Additionally, in order to reduce computational complexity in the conversion process for blocks of large size, a process may be performed in which only the low-frequency region is left and the high-frequency region is treated as '0'. This process is called high-frequency zeroing, and for this zeroing, the conversion size during the actual primary conversion can be set. In the high-frequency zeroing process, the low-frequency area can be set to an arbitrarily determined size. For example, the horizontal or vertical size can be a combination of 4, 8, 16, 32, etc.
  • the encoder can quantize the transform block converted from the residual block by transmitting it to the quantization unit.
  • the transform block may include a plurality of transform coefficients.
  • a transform block may be composed of a plurality of transform coefficients arranged two-dimensionally.
  • the size of the transform block like the remaining block, may be the same as either the current block or a block divided from the current block.
  • Transform coefficients transmitted to the quantization unit can be expressed as quantized values.
  • the encoder may perform additional transformation 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 remaining 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. For example, a secondary transformation may be added to a block whose residual values appear large in directions other than the horizontal or vertical direction of the residual block.
  • the residual values of an intra-predicted block may have a higher probability of changing in directions other than the horizontal or vertical direction compared to the residual values of an inter-predicted block.
  • the encoder can additionally perform secondary transformation on the residual signal of the intra-predicted block. Additionally, the encoder may omit secondary transformation for the residual signal of the inter-predicted block. Even in the secondary conversion process, high-frequency zeroing in the primary conversion can be performed.
  • whether to perform secondary transformation may be determined depending on the size of the current block or remaining block.
  • transformation kernels of different sizes may be used depending on the size of the current block or remaining block.
  • 8X8 secondary transformation may be applied to a block where the length of the shorter side of width or height is greater than or equal to the first preset length.
  • the first preset length may be larger than the second preset length, but the present disclosure is not limited thereto.
  • the 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).
  • LFNST Low Frequency Non-Separable Transform
  • the syntax element may include transform skip information. Transformation skip information may be a transform skip flag. If the transformation skip information for the remaining block indicates transformation skipping, transformation is not performed on the corresponding remaining block. In this case, the encoder can directly quantize the residual signal for which conversion of the corresponding region has not been performed.
  • the above-described conversion-related syntax elements may be information parsed from a video signal bitstream.
  • the decoder may obtain conversion-related syntax elements by entropy decoding the video signal bitstream. Additionally, the encoder may generate a video signal bitstream by entropy coding transformation-related syntax elements.
  • the decoder can obtain the encoding information necessary for decoding by parsing the transmitted bitstream.
  • information related to the transformation process includes index information for the primary and secondary transformation types and quantized transformation coefficients.
  • the inverse transform unit may obtain a residual signal by inversely transforming the inverse quantized transform coefficient.
  • the inverse transformation unit can detect whether inverse transformation is performed for a specific region from the transformation-related syntax elements of the region. According to one embodiment, when a transform-related syntax element for a specific transform block indicates transform skipping, transform for the corresponding transform block may be omitted. In this case, both the first inverse transform and the second inverse transform can be omitted for the transform block. Additionally, the dequantized transform coefficient can be used as a residual signal.
  • the decoder can restore the current block using the dequantized transform coefficient as a residual signal.
  • the secondary inverse transformation may be performed and the first inverse transformation may be omitted, and the secondary inverse transformation may be used as the residual signal.
  • the above-described first-order inverse transform represents the inverse transformation of the first-order transform, and may be referred to as an inverse primary transform.
  • the secondary inverse transform refers to the inverse transformation of the secondary transform, and may be referred to as an inverse secondary transform or inverse LFNST.
  • the first (inverse) transformation may be referred to as the first (inverse) transformation
  • the secondary (inverse) transformation may be referred to as the second (inverse) transformation.
  • Figure 44 shows the types of transform kernels that can be used in video coding according to an embodiment of the present invention.
  • Figure 44 shows DCT-II, DCT-V (discrete cosine transform type-V), DCT-VIII (discrete cosine transform type-VIII), DST-I (discrete sine transform type-I), and DST-VII applied to MTS.
  • This shows the kernel formula.
  • DCT and DST can be expressed as functions of cosine and sine, respectively.
  • index i represents the index in the frequency domain
  • index j is the basis. Indicates the index within the 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 Ti(j) can represent the j-th element of the i-th row, and since the transformation kernels shown in Figure 30 all have separable characteristics, the horizontal direction with respect to the residual signal Conversion can be performed in the and vertical directions, respectively. 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. Since DCT and DST are in decimal form rather than integer, it is burdensome to implement them as is in a hardware encoder and decoder. Therefore, the decimal type conversion kernel must be approximated to an integer type conversion kernel through scaling and rounding.
  • the integer precision of the conversion kernel can be determined as 8-bit or 10-bit, but if the precision is low, coding efficiency may decrease. Depending on the approximation, the orthonormal properties of DCT and DST may not be maintained, but the resulting loss of coding efficiency is not significant, so approximating the conversion kernel to an integer form is advantageous in terms of implementing a hardware encoder and decoder.
  • IDTR Identity Transform
  • identity transformation constructs a transformation matrix by setting '1' at the position where the row and column have the same value. However, here, the identity transformation is used to equally increase or decrease the value of the input residual signal using an arbitrary fixed value other than the '1' value.
  • a bitstream consists of one or more coded video sequences (CVS), and one CVS is encoded independently from other CVSs.
  • CVS consists of one or more layers, and each layer can represent a specific image quality, a specific resolution, or a general image, depth information map, or transparency map.
  • CLVS coded layer video sequence
  • a CLVS may exist for a specific image quality layer
  • a CLVS may exist for a depth information map.
  • Figures 45 and 46 show part of a sequence parameter set according to an embodiment of the present invention.
  • Figure 45 shows a method of signaling in SPS a syntax element indicating whether the vertical plane mode and the horizontal plane mode are activated.
  • sps_directional_planar_enabled_flag in FIG. 45 When sps_directional_planar_enabled_flag in FIG. 45 is '1' (true), it may indicate that the vertical plane mode and the horizontal plane mode are activated. If sps_directional_planar_enabled_flag is '0' (false), it may indicate that the vertical plane mode and the horizontal plane mode are disabled. That is, the vertical plane mode and horizontal plane mode are not used in all blocks. If sps_directional_planar_enabled_flag is not parsed (not included in the bitstream), the value of sps_directional_planar_enabled_flag can be inferred to be 0.
  • sps_directional_planar_enabled_flag 1 specifies that the vertical planar and the horizontal planar mode is enabled for the CLVS.
  • sps_directional_planar_enabled_flag 0 specifies that the vertical planar and the horizontal planar mode is disabled for the CLVS.
  • sps_directional_planar_enabled_flag not present, it is inferred to be equal to 0.
  • a syntax element indicating whether the vertical plane mode and the horizontal plane mode are activated can also be signaled in the PPS. That is, whether the vertical plane mode and the horizontal plane mode are activated may vary for each picture and/or frame depending on the syntax element signaled in the PPS (eg, pps_directional_planar_enabled_flag).
  • Figure 46 shows a method of signaling in the SPS a syntax element indicating whether to activate the method of generating a prediction block using a plurality of reference pixel lines described with reference to Figures 25 to 29.
  • a method of generating a prediction block using a plurality of reference pixel lines may be described as intra fusion.
  • sps_intra_fusion_enabled_flag in FIG. 46 is '1' (true), it may indicate that intra fusion is activated. If sps_intra_fusion_enabled_flag is '0' (false), it indicates that intra fusion is disabled. That is, intra fusion is not performed on all blocks. If sps_intra_fusion_enabled_flag is not parsed (not included in the bitstream), the value of sps_intra_fusion_enabled_flag can be inferred to be 0.
  • sps_intra_fusion_enabled_flag 1 specifies that the intra fusion method is enabled for the CLVS.
  • sps_intra_fusion_enabled_flag 0 specifies that intra fusion method is disabled for the CLVS.
  • sps_intra_fusion_enabled_flag not present, it is inferred to be equal to 0.
  • a syntax element indicating whether intra fusion is activated can also be signaled in the PPS. That is, whether intra fusion is activated may vary for each picture and/or frame depending on the syntax element signaled in the PPS (eg, pps_intra_fusion_enabled_flag).
  • Figure 47 shows part of the general_constraint_info() syntax structure according to an embodiment of the present invention.
  • Figure 47 shows constraint flags related to vertical plane mode and horizontal plane mode and intra fusion.
  • the general_constraint_info() syntax of Figure 47 can be called in the profile_tier_level() syntax.
  • profile_tier_level() syntax can be called in sequence parameter set RBSP syntax, video parameter set RBSP syntax, and Decoding capability information RBSP syntax.
  • Individual syntax elements of the general_constraint_info() syntax may have corresponding syntax elements in the sequence parameter set RBSP, and activation/deactivation of the corresponding sequence parameter set RBSP syntax element may be restricted by the definition of the corresponding flag.
  • the constraint flag related to the vertical plane mode and the horizontal plane mode may be gci_no_directional_planar_constraint_flag.
  • gci_no_directional_planar_constraint_flag 1
  • sps_directional_planar_enabled_flag for all pictures existing in OlsScope is constrained to 0. That is, deactivation of the vertical plane mode and the horizontal plane mode may be restricted (forced). If the value of gci_no_directional_planar_constraint_flag is equal to 0, the value of sps_directional_planar_enabled_flag is not restricted.
  • gci_no_directional_planar_constraint_flag 1 specifies that sps_directional_planar_enabled_flag for all pictures in OlsInScope shall be equal to 0.
  • gci_no_directional_planar_constraint_flag 0 does not impose such a constraint.
  • the constraint flag related to intra fusion may be gci_no_intra_fusion_constraint_flag.
  • gci_no_intra_fusion_constraint_flag If the value of gci_no_intra_fusion_constraint_flag is equal to 1, the value of sps_intra_fusion_enabled_flag for all pictures existing in OlsScope is constrained to 0. In other words, deactivation of intra fusion can be restricted (forced). If the value of gci_no_intra_fusion_constraint_flag is equal to 0, the value of sps_intra_fusion_enabled_flag is not constrained to 0.
  • gci_no_intra_fusion_constraint_flag 1 specifies that sps_intra_fusion_enabled_flag for all pictures in OlsInScope shall be equal to 0.
  • gci_no_intra_fusion_constraint_flag 0 does not impose such a constraint.
  • a video signal processing device may use a multi-prediction mode that performs a weighted average of two or more intra prediction blocks.
  • DIMD or TIMD mode the two intra prediction directionality modes can be implicitly determined from the surrounding block or MPM list.
  • two intra prediction directional modes can be signaled from the bitstream, but this may increase the bit amount and reduce compression efficiency.
  • the intra prediction directionality mode to be included in each item of the list may be set to two or more instead of one.
  • Figure 48 shows a method of constructing an MPM list using multiple prediction modes according to an embodiment of the present invention.
  • A, B, C,... , F, G can represent any of the intra prediction directional modes, MIP, Intra TMP, IBC, DIMD, and TIMD, and "N/A" means not used, so the 4th and 5th in the MPM list are multi-prediction. It may consist of only one intra prediction directional mode rather than a single mode.
  • a single prediction mode can be added to the MPM list first, and then multiple prediction modes can be added, and "N/A" means not used, so the 1st and 2nd in the MPM list are It may consist of only one intra prediction directional mode, not multiple prediction modes.
  • the encoder can signal information about whether to use an MPM list consisting of only one intra-prediction directional mode (single prediction-based MPM list) or a multi-prediction-based MPM list by adaptively including it in the bitstream on a block-by-block basis. .
  • the decoder parses information about whether to use an MPM list consisting of only one intra-prediction directional mode (single prediction-based MPM list) or a multi-prediction-based MPM list, and determines which MPM is used to generate a prediction block for the current block. You can decide on a list.
  • the video signal processing device includes the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, whether the current block is a luminance block or a chrominance block, quantization parameter information, and intra prediction directional mode information of neighboring blocks of the current block. , At least one of the encoding mode information of the current block can be used to determine whether to use the multi-prediction based MPM list.
  • Coding efficiency may vary depending on how the multi-prediction-based MPM list is constructed, and various methods can be applied as follows.
  • the video signal processing device may first construct a single prediction-based MPM list and then construct a multi-prediction-based MPM list using the single prediction-based MPM list. For example, a video signal processing device can configure a multi-prediction-based MPM list by combining each intra-prediction directional mode in a single prediction-based MPM list. At this time, the video signal processing device may rearrange the single prediction-based MPM list using the template cost-based reordering method used in the TIMD method. The video signal processing device may construct a multi-prediction-based MPM list using only a combination of the first intra-prediction directional mode and non-first intra-prediction directional modes of the reordered single prediction-based MPM list.
  • a video signal processing device can construct a multi-prediction-based MPM list using a combination of intra-prediction directional modes derived from DIMD and single-prediction-based MPM lists. For example, the video signal processing device may combine the first intra prediction directionality mode derived from DIMD and the first intra prediction directionality mode in the single prediction-based MPM list and add it to the first of the multi-prediction-based MPM list. Additionally, the video signal processing device may combine the second intra prediction directionality mode derived from DIMD and the first intra prediction directionality mode in the single prediction-based MPM list and add it to the second of the multi-prediction-based MPM list.
  • the video signal processing device may combine the first intra prediction directionality mode derived from DIMD and the second intra prediction directionality mode in the single prediction-based MPM list and add it to the third of the multi-prediction-based MPM list. In this way, the video signal processing device can construct a multi-prediction based MPM list using all possible combinations.
  • a video signal processing device can configure a multi-prediction-based MPM list using several predefined multi-prediction modes.
  • several predefined multi-prediction modes are (18, 0), (50, 0), (34, 0), (2, 0), (66, 0), (18, 1), (50, 1) ), (34, 1), (2, 1), (66, 1), etc., and in "(X, Y)", there is.
  • the video signal processing device can reorder the multi-prediction based MPM list through a TIMD-based reordering method.
  • the video signal processing device can reset the multi-prediction based MPM list using only a few low-cost items.
  • the intra prediction mode used to generate each prediction block may be signaled based on the Primary MPM and Secondary MPM.
  • Primary MPM may include 6 intra-prediction directional modes
  • Secondary MPM may include 16 intra-prediction directional modes.
  • Secondary MPM can be configured using several predefined intra prediction modes.
  • the video signal processing unit has DC, 50, 18, 46, 54, 14, 22, 42, 58, 10, 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, 16 If the prediction mode (see intra prediction mode in Figure 6) does not exist in the Primary MPM, DC, 50, 18, 46, 54, 14, 22, 42, 58, 10 until the list of Secondary MPMs is all constructed.
  • the list of secondary MPMs can be constructed by adding the following prediction modes in order: , 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, and 16.
  • the video signal processing device determines the prediction block of the current block by deriving one intra-prediction directionality mode from the Primary MPM and another intra-prediction directionality mode from the Secondary MPM.
  • the intra prediction directional mode used to generate can be determined. If multiple prediction modes are used in the current block, the encoder can signal by including in the bitstream index information indicating which intra-prediction directional mode is used within the Primary MPM and Secondary MPM. If multiple prediction modes are used in the current block, the decoder can parse the index information and then determine the intra prediction direction modes used to generate prediction blocks for the current block from the Primary MPM and Secondary MPM lists.
  • the video signal processing device can determine the intra prediction directionality modes used to generate the prediction block of the current block using the intra prediction directionality mode, Primary MPM, and Secondary MPM derived from DIMD. there is. If multiple prediction modes are used in the current block, the encoder sends information about whether the intra prediction directionality mode derived from DIMD is used and index information indicating which intra prediction directionality mode is used within the Primary MPM and Secondary MPM in the bitstream. It can be signaled by including it in . If multiple prediction modes are used in the current block, the decoder parses information on whether the intra prediction directionality mode derived from DIMD is used and index information indicating which intra prediction directionality mode is used within the Primary MPM and Secondary MPM. Intra prediction directional modes used to generate prediction blocks for the current block can be determined.
  • the video signal processing device can configure the Secondary MPM list into a multi-prediction-based MPM list using the Primary MPM list. For example, if the primary MPM mode created from the surrounding block is Planar, 18, 54, 30, 45, 17, modes such as Planar+18, Planard+54,.., etc. are added to the list of secondary MPM to enable multi-prediction based It may consist of an MPM list. If a multi-prediction mode is used in the current block, the encoder uses the Primary MPM list to configure the Secondary MPM list into a multi-prediction-based MPM list, and then configures the multi-prediction mode used to generate the prediction block of the current block into the list of Secondary MPMs. It can be determined and signaled by including index information about the determined list of Secondary MPMs in the bitstream. The decoder can parse the index information and determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPM.
  • the video signal processing device can configure the Secondary MPM list into a multi-prediction-based MPM list using the intra-prediction directional mode derived from DIMD and the Primary MPM list. For example, if the primary MPM mode created from the surrounding block is Planar, 18, 54, 30, 45, 17, the list of secondary MPM includes modes such as Planar+18, Planard+54,.., etc. to enable multi-prediction. It may consist of a base MPM list. If a multi-prediction mode is used in the current block, the encoder can configure the secondary MPM list into a multi-prediction-based MPM list using the intra-prediction directional mode derived from DIMD and the primary MPM list.
  • the encoder can determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPMs, and can signal it by including index information for the determined list of Secondary MPMs in the bitstream.
  • the decoder can parse the index information and determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPM.
  • the video signal processing device can determine the positions of reference pixels used to generate each prediction block, respectively. That is, the video signal processing device can specify the left reference pixel line and the top reference pixel line used to generate each prediction block among various reference pixel lines (see FIG. 31).
  • the encoder can signal by including the position information of the left reference pixel line and the position information of the top reference pixel line in the bitstream.
  • the decoder can parse each position information to determine the positions of the left reference pixel line and the top reference pixel line used to generate each prediction block.
  • Figure 49 shows the location of a reference pixel used when a prediction block is generated using a multi-prediction mode according to an embodiment of the present invention.
  • the video signal processing device may generate the prediction block using only the left reference pixel of the current block.
  • the second intra prediction directional mode among the multiple prediction modes is used to generate a prediction block
  • the video signal processing device may generate the prediction block using only the top reference pixel of the current block.
  • the first intra prediction directional mode only modes with numbers less than 34 can be used among the intra prediction directional modes of FIG. 6, and for the second intra prediction directional mode, only modes equal to or greater than 34 among the intra prediction directional modes of FIG. 6 can be used. there is. Therefore, when a multi-prediction-based MPM list is configured, the first intra prediction directional mode can be configured to enable only modes with numbers less than 34, and the second intra prediction directional mode can be configured to enable only modes with numbers equal to or greater than 34.
  • the video signal processing device can specify the left reference pixel line and the top reference pixel line used to generate each prediction block, respectively.
  • the encoder can signal by including the position information of the left reference pixel line and the position information of the top reference pixel line in the bitstream.
  • the decoder can parse each position information to determine the positions of the left reference pixel line and the top reference pixel line used to generate each prediction block. Additionally, the position information of the top reference pixel line may be derived from the position information of the left reference pixel line, and the position information of the top reference pixel line and the position information of the left reference pixel line may be the same.
  • the encoder can signal only the difference value from the position information of the left reference pixel line by including it in the bitstream.
  • the decoder the position information of the left reference pixel line is parsed, the difference value of the position information of the top reference pixel line is parsed, and then the difference value of the position information of the left reference pixel line and the top reference pixel line is used.
  • the location information of the upper reference pixel line can be determined.
  • a transform set for the secondary transform may be determined based on the two intra prediction directional modes.
  • one of the two intra prediction directionality modes can be used to select the first or second transformation set, and the first intra prediction directionality mode can be used.
  • the encoder can signal which of the two intra-prediction directionality modes will be used to derive the primary transform or secondary transform set by including in the bitstream.
  • the decoder parses information about which of the two intra prediction directional modes to use to derive the first or second transform set, and determines which intra prediction mode to use to derive the first or second inverse transform set for the current error block.
  • Directional mode can be determined.
  • the video signal processing device may determine the intra prediction directionality mode used to derive the first transform (inverse transform) or second transform (inverse transform) set as a predefined mode.
  • the predefined mode may be Planar, DC mode, etc.
  • a video signal processing device may not perform PDPC on a prediction block to which the multi-prediction mode is applied.
  • the video signal processing device may perform PDPC on the prediction block to which the multiple prediction mode is applied based on the first intra prediction directional mode among the two intra prediction directional modes.
  • the video signal processing device may perform the first PDPC based on the first intra prediction directional mode among the two intra prediction directional modes on the prediction block to which the multiple prediction mode is applied, and then perform the second PDPC based on the second intra prediction directional mode. there is.
  • the transformation is calculated by applying a transformation kernel to each of the vertical and horizontal directions of the error block, so it can be said to be a separable transform method.
  • the transformation does not apply a transformation kernel to each of the vertical and horizontal directions, and the transformation kernel is applied and calculated only once, so it can be said to be a non-separable transform method.
  • the above-described secondary transformation is additionally applied to the primary transformed transform coefficient of the block to which DCT-2 transformation has been applied, so it can be said to be a two-stage transformation technique.
  • the above-described secondary transformation has high coding efficiency, but has the disadvantage of being complicated because a total of three transformation kernels are applied.
  • the NSPT (Non-separable primary transform) method which is a method of applying transformation using only the secondary transformation method, can be applied.
  • the NSPT transformation method is a non-separate transformation method, and is calculated by applying the transformation kernel only once rather than applying a transformation kernel to each of the vertical and horizontal directions of the error block.
  • the error block of the current block may be transformed or inversely transformed using one of the MTS, DCT2 + LFNST, and NSPT transformation methods.
  • Figure 50 shows a transform set table for LFNST and NSPT transforms according to an embodiment of the present invention.
  • the video signal processing device may refer to the transform set table of FIG. 50 and derive the transform set index of the LFNST and NSPT transforms corresponding to the intra prediction mode (see FIG. 6). Additionally, the LFNST and NSPT transform sets vary depending on the intra prediction mode, information on whether the current block is a luminance block or a chrominance block, the horizontal and vertical sizes of the current block, and whether the intra prediction directionality mode of the current block is the extended angle mode. You can. There may be an arbitrary number of transformation matrices for each transformation set.
  • the arbitrary number may be an integer of 1 or more, and may be 3.
  • index information about the optimal transformation matrix among several transformation matrices in the transformation set can be signaled by including it in the bitstream.
  • the inverse transformation can be applied using the transformation matrix corresponding to the index in the transformation set.
  • the encoder does not use the transform set of the plane mode for the error signal, but rather the transform set of the vertical angle mode (angle mode 50 in Figure 6).
  • the transformation process can be performed using transformation sets. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the encoder can derive the transform set using the horizontal angle mode (angle mode 18 in FIG. 6) rather than the planar mode. If the vertical plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the vertical angle mode (angle mode 50 in Figure 6). The transformation process can be performed using transformation sets.
  • the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the horizontal angle mode (angle mode 18 in Figure 6).
  • the transformation process can be performed using transformation sets.
  • Equation 4 when the vertical plane mode is used to generate the prediction block of the current block, the prediction block is generated according to the pixel value of rec(-1, H), which is a fixed position, and the x-axis coordinate. It can be generated based on the dynamically changing pixel value of rec(x, -1). That is, when the vertical plane mode is used, a change in pixel value occurs along the x-axis, so the characteristics of the error signal may be similar to those of the horizontal angle mode (angle mode 50 in FIG. 6).
  • the encoder does not use the transform set of the plane mode for the error signal, but uses the horizontal angle mode (angle mode number 18 in Figure 6). ) can be used to perform the conversion process. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the encoder can derive the transform set using the vertical angle mode (angle mode 50 in Figure 6) rather than the planar mode. If the vertical plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the horizontal angle mode (angle mode 18 in Figure 6). The transformation process can be performed using transformation sets.
  • the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the vertical angle mode (angle mode 50 in Figure 6).
  • a transformation process can be performed using a transformation set. If the current block is adjacent to at least one boundary among a tile boundary, a slice boundary, and a subpicture boundary, the restored sample of another adjacent tile, another adjacent slice, or another adjacent subpicture cannot be accessed or used. If the current block is adjacent to at least one boundary among a tile boundary, a slice boundary, and a subpicture boundary, the encoder may not signal planar mode selection information and may not include it in the bitstream.
  • the planar mode selection information may not be parsed, and the mode of the current block may be set to planar mode (or DC mode). .
  • the encoder may not signal information related to DIMD, TIMD, Intra TMP, TMRL, and intra fusion, and may not include it in the bitstream. You can.
  • information related to DIMD, TIMD, Intra TMP, TMRL, and intra fusion may not be parsed, and the mode of the current block may be set to planar. It can be set to mode (or DC mode).
  • Figure 51 shows a method of deriving a transform set for a linear mode in prediction using a linear mode according to an embodiment of the present invention.
  • FIG. 51 shows a method of deriving a multiple transform set and an LFNST transform set for the linear mode when linear mode is used in generating a prediction block of the current block described with reference to FIGS. 1 to 50.
  • the video signal processing device may determine the first prediction mode of the current block (S5110).
  • the video signal processing device may generate a prediction block of the current block based on the first prediction mode (S5120).
  • the video signal processing device may generate a residual block of the current block based on a transformation matrix set determined based on the second prediction mode (S5130).
  • the video signal processing device may restore the current block based on the prediction block and the residual block (S5140).
  • the residual block is based on at least one of a set of transform matrices of a multiple transform set (MTS) and/or a set of transform matrices of a low frequency non-separable transform (LFNST). It can be created.
  • MTS multiple transform set
  • LNNST low frequency non-separable transform
  • the first prediction mode and the second prediction mode may be different prediction modes.
  • the first prediction mode may be one of a planar mode based on the horizontal direction (horizontal planar mode) or a planar mode based on the vertical direction (vertical planar mode).
  • the plane mode based on the horizontal direction may be a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position.
  • the plane mode based on the vertical direction may be a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position.
  • the position of the upper-left block of the current block may be (0, 0), and the position of the prediction block may be (x, y).
  • the first prediction mode is a planar mode based on the horizontal direction
  • the second prediction mode is a vertical angle mode
  • the first prediction mode is a planar mode based on the horizontal direction
  • the second prediction mode is The prediction mode may be a horizontal angle mode.
  • the first prediction mode may be a linear prediction mode.
  • the first prediction mode may be indicated by a syntax element included in the bitstream.
  • 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.

Abstract

This processor of a video signal decoding apparatus may determine a first prediction mode of the current block, generate a prediction block of the current block on the basis of the first prediction mode, generate a residual block of the current block on the basis of a transformation matrix set determined on the basis of a second prediction mode, and reconstruct the current block on the basis of the prediction block and the residual block.

Description

비디오 신호 처리 방법 및 이를 위한 장치Video signal processing method and device therefor
본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.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. In particular, 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. However, due to recent developments in various media and data transmission media, more highly efficient video signal processing methods and devices are required.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공하여 비디오 신호의 코딩 효율을 높이기 위한 목적이 있다.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.
본 명세서에 있어서, 비디오 신호 디코딩 장치는 프로세서를 포함하며, 상기 프로세서는, 현재 블록의 제1 예측 모드를 결정하고, 상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하고, 제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하고, 상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원할 수 있다.In this specification, a video signal decoding apparatus includes a processor, wherein the processor determines a first prediction mode of a current block, generates a prediction block of the current block based on the first prediction mode, and generates a second prediction block. A residual block of the current block may be generated based on a set of transformation matrices determined based on a prediction mode, and the current block may be restored based on the prediction block and the residual block.
본 명세서에 있어서, 비디오 신호 인코딩 장치는 프로세서를 포함하며, 상기 프로세서는, 현재 블록의 제1 예측 모드를 결정하고, 상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하고, 제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하고, 상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원할 수 있다. In this specification, the video signal encoding device includes a processor, wherein the processor determines a first prediction mode of the current block, generates a prediction block of the current block based on the first prediction mode, and generates a second prediction block. A residual block of the current block may be generated based on a set of transformation matrices determined based on a prediction mode, and the current block may be restored based on the prediction block and the residual block.
본 명세서에 있어서, 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에 있어서, 상기 비트스트림은 디코딩 방법에 의해 디코딩되고, 상기 디코딩 방법은, 현재 블록의 제1 예측 모드를 결정하는 단계; 상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하는 단계; 제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하는 단계; 및 상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원하는 단계를 포함할 수 있다.In the present specification, in a computer-readable non-transitory storage medium storing a bitstream, the bitstream is decoded by a decoding method, the decoding method comprising: determining a first prediction mode of a current block; generating a prediction block of the current block based on the first prediction mode; generating a residual block of the current block based on a set of transformation matrices determined based on a second prediction mode; And it may include restoring the current block based on the prediction block and the residual block.
또한, 본 명세서에 있어서, 상기 잔차 블록은, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합 및/또는 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 중 적어도 어느 하나에 기초하여 생성될 수 있다.Additionally, in this specification, the residual block is a set of transform matrices of a multiple transform set (MTS) and/or a transform matrix of a low frequency non-separable transform (LFNST). It can be created based on at least one of the sets.
또한, 본 명세서에 있어서, 상기 제1 예측 모드와 상기 제2 예측 모드는 서로 상이한 예측 모드일 수 있다.Additionally, in this specification, the first prediction mode and the second prediction mode may be different prediction modes.
또한, 본 명세서에 있어서, 상기 제1 예측 모드는, 수평 방향에 기초한 평면 모드, 또는 수직 방향에 기초한 평면 모드 중 하나일 수 있다.Additionally, in this specification, the first prediction mode may be one of a planar mode based on the horizontal direction or a planar mode based on the vertical direction.
또한, 본 명세서에 있어서, 상기 수평 방향에 기초한 평면 모드는, (-1, y) 위치의 블록의 값과 (W, -1) 위치의 블록의 값에 기초한 예측 모드이고, 상기 수직 방향에 기초한 평면 모드는, (x, -1) 위치의 블록의 값과 (-1, H) 위치의 블록의 값에 기초한 예측 모드이고, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)이고, 상기 예측 블록의 위치는 (x, y)일 수 있다.In addition, in this specification, the planar mode based on the horizontal direction is a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position, and the planar mode based on the vertical direction is a prediction mode based on the value of the block at the (-1, y) position. Plane mode is a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position, and the position of the upper left block of the current block is (0, 0). , the position of the prediction block may be (x, y).
또한, 본 명세서에 있어서, i) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수직 방향 각도 모드이고, 또는 ii) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수평 방향 각도 모드일 수 있다.Additionally, in this specification, i) the first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a vertical angle mode, or ii) the first prediction mode is a planar mode based on the horizontal direction. It is a planar mode, and the second prediction mode may be a horizontal angle mode.
또한, 본 명세서에 있어서, 상기 제1 예측 모드는, 선형(linear)적인 예측 모드일 수 있다.Additionally, in this specification, the first prediction mode may be a linear prediction mode.
또한, 본 명세서에 있어서, 상기 제1 예측 모드는, 비트스트림에 포함된 신택스 요소에 의해 지시될 수 있다.Additionally, in this specification, the first prediction mode may be indicated by a syntax element included in the bitstream.
본 명세서는 효율적으로 비디오 신호를 처리하기 위한 방법을 제공한다.This specification provides a method for efficiently processing video signals.
본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The effects that can be obtained in this specification are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the description below. will be.
도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다.1 is a schematic block diagram of a video signal encoding device according to an embodiment of the present invention.
도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치의 개략적인 블록도이다.Figure 2 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention.
도 3은 픽쳐 내에서 코딩 트리 유닛이 코딩 유닛들로 분할되는 실시예를 도시한다. Figure 3 shows an embodiment in which a coding tree unit is divided into coding units within a picture.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다.Figure 4 shows one embodiment of a method for signaling splitting of quad trees and multi-type trees.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다.Figures 5 and 6 show the intra prediction method according to an embodiment of the present invention in more detail.
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다. Figure 7 is a diagram showing the positions of neighboring blocks used to construct a motion candidate list in inter prediction.
도 8은 본 발명의 일 실시예에 따른 DIMD를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.Figure 8 is a diagram showing the process of generating a prediction block using DIMD according to an embodiment of the present invention.
도 9는 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.Figure 9 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
도 10은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.Figure 10 is a diagram showing a method for mapping a directional mode according to an embodiment of the present invention.
도 11은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.Figure 11 is a diagram showing a histogram for deriving an intra prediction directional mode according to an embodiment of the present invention.
도 12는 본 발명의 일 실시예에 따른 DIMD 모드를 시그널링하는 방법을 나타낸 도면이다.Figure 12 is a diagram showing a method of signaling DIMD mode according to an embodiment of the present invention.
도 13은 본 발명의 일 실시예에 따른 DIMD 모드의 사용 여부에 따른 인트라 예측 모드와 관련된 신택스 요소를 시그널링하는 방법을 나타낸 도면이다.Figure 13 is a diagram showing a method of signaling syntax elements related to intra prediction mode depending on whether DIMD mode is used according to an embodiment of the present invention.
도 14는 본 발명의 일 실시예에 따른 현재 블록을 복원하기 위한 예측 샘플을 생성하는 방법을 나타낸 도면이다.FIG. 14 is a diagram illustrating a method of generating a prediction sample for restoring a current block according to an embodiment of the present invention.
도 15는 본 발명의 일 실시예에 따른 인트라 예측 모드를 결정하는 방법을 나타낸 도면이다.Figure 15 is a diagram showing a method for determining an intra prediction mode according to an embodiment of the present invention.
도 16은 본 발명의 일 실시예에 따른 DIMD와 관련된 신택스 요소들이 포함된 신택스 구조를 나타낸다.Figure 16 shows a syntax structure including syntax elements related to DIMD according to an embodiment of the present invention.
도 17은 본 발명의 일 실시예에 따른 현재 블록의 주변 블록에 대한 인트라 예측 방향성 모드 및 가중치 정보를 나타낸 도면이다.Figure 17 is a diagram showing intra prediction directional mode and weight information for neighboring blocks of the current block according to an embodiment of the present invention.
도 18은 본 발명의 일 실시예에 따른 DIMD 조합 정보를 결정하는 방법을 나타낸 도면이다.Figure 18 is a diagram showing a method of determining DIMD combination information according to an embodiment of the present invention.
도 19는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드 정보와 가중치를 이용하여 예측 샘플을 생성하는 방법을 나타낸 도면이다.Figure 19 is a diagram showing a method of generating a prediction sample using intra prediction directional mode information and weights according to an embodiment of the present invention.
도 20 및 도 21은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도할 때 사용되는 주변 블록의 픽셀 값을 나타낸 도면이다.Figures 20 and 21 are diagrams showing pixel values of neighboring blocks used when deriving an intra prediction directional mode according to an embodiment of the present invention.
도 22는 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 방향성 모드를 포함한 MPM 리스트를 구성하는 방법을 나타낸 도면이다.Figure 22 is a diagram showing a method of configuring an MPM list including the intra prediction directional mode of the current block according to an embodiment of the present invention.
도 23 및 도 24는 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 모드를 유도하기 위해 사용되는 템플릿(template)을 나타낸 도면이다.Figures 23 and 24 are diagrams showing a template used to derive the intra prediction mode of the current block according to an embodiment of the present invention.
도 25 내지 도 28은 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인에 기초하여 예측 샘플(픽셀)을 생성하는 방법을 나타내는 도면이다.25 to 28 are diagrams showing a method of generating prediction samples (pixels) based on a plurality of reference pixel lines according to an embodiment of the present invention.
도 29는 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인을 사용하여 샘플을 예측하는 방법을 나타낸다.Figure 29 shows a method of predicting a sample using a plurality of reference pixel lines according to an embodiment of the present invention.
도 30은 본 발명의 일 실시예에 따른 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법을 나타낸다.Figure 30 shows a method of determining a reference pixel line based on a template according to an embodiment of the present invention.
도 31은 본 발명의 일 실시예에 따른 현재 블록에 인접한 참조 픽셀 라인을 테스트하기 위한 템플릿을 설정하는 방법을 나타낸다.Figure 31 shows a method of setting a template for testing a reference pixel line adjacent to the current block according to an embodiment of the present invention.
도 32는 본 발명의 일 실시예에 따른 템플릿에 기초한 복수의 참조 픽셀 라인을 사용하여 최적의 참조 픽셀 라인을 결정하는 방법을 나타낸 구조도이다.Figure 32 is a structural diagram showing a method of determining an optimal reference pixel line using a plurality of reference pixel lines based on a template according to an embodiment of the present invention.
도 33은 본 발명의 일 실시예에 따른 평면 모드를 사용하여 예측 샘플을 생성하는 방법을 나타낸다.Figure 33 shows a method for generating prediction samples using planar mode according to an embodiment of the present invention.
도 34는 본 발명의 일 실시예에 따른 수직 방향 평면 모드 또는 수평 방향 평면 모드를 위한 다중 변환 세트 및 LFNST 세트를 유도하는 방법을 나타낸다.Figure 34 shows a method for deriving a multiple transform set and an LFNST set for a vertical plane mode or a horizontal plane mode according to an embodiment of the present invention.
도 35는 본 발명의 일 실시예에 따른 매핑 테이블을 나타낸다.Figure 35 shows a mapping table according to an embodiment of the present invention.
도 36은 본 발명의 일 실시예에 따른 변환 타입 세트 테이블을 나타낸다.Figure 36 shows a conversion type set table according to an embodiment of the present invention.
도 37은 본 발명의 일 실시예에 따른 변환 타입 조합 테이블을 나타낸다.Figure 37 shows a conversion type combination table according to an embodiment of the present invention.
도 38은 본 발명의 일 실시예에 따른 IDT 변환 타입에 대한 임계 값 테이블을 나타낸다.Figure 38 shows a threshold table for IDT conversion type according to an embodiment of the present invention.
도 39는 본 발명의 일 실시예에 따른 비디오 신호 처리 장치가 1차 또는 2차 변환 매트릭스를 유도하는 방법을 나타낸다.Figure 39 shows a method by which a video signal processing device derives a first-order or second-order transformation matrix according to an embodiment of the present invention.
도 40은 본 발명의 일 실시예에 따른 수직 또는 수평 라인 단위의 DC 예측 방법을 나타낸다.Figure 40 shows a DC prediction method on a vertical or horizontal line basis according to an embodiment of the present invention.
도 41은 본 발명의 일 실시예에 따른 수직 또는 수평 라인(line) 단위의 평면 예측 방법을 나타낸다.Figure 41 shows a plane prediction method in units of vertical or horizontal lines according to an embodiment of the present invention.
도 42는 본 발명의 일 실시예에 따른 평면 모드를 사용한 서브 블록 단위의 예측 방법을 나타낸다.Figure 42 shows a prediction method in sub-block units using planar mode according to an embodiment of the present invention.
도 43은 본 발명의 일 실시예에 따른 양방향 예측 기반의 인트라 예측 방법을 나타낸다.Figure 43 shows an intra prediction method based on bidirectional prediction according to an embodiment of the present invention.
도 44는 본 발명의 일 실시예에 따른 비디오 코딩에 사용될 수 있는 변환 커널 종류를 나타낸다.Figure 44 shows the types of transform kernels that can be used in video coding according to an embodiment of the present invention.
도 45, 도 46은 본 발명의 일 실시예에 따른 시퀀스 파라미터 세트의 일부를 나타낸다.Figures 45 and 46 show part of a sequence parameter set according to an embodiment of the present invention.
도 47은 본 발명의 일 실시예에 따른 general_constraint_info() 신택스 구조의 일부를 나타낸다.Figure 47 shows part of the general_constraint_info() syntax structure according to an embodiment of the present invention.
도 48은 본 발명의 일 실시예에 따른 다중 예측 모드를 사용하여 MPM 리스트를 구성하는 방법을 나타낸다. Figure 48 shows a method of constructing an MPM list using multiple prediction modes according to an embodiment of the present invention.
도 49는 본 발명의 일 실시예에 따른 다중 예측 모드를 사용하여 예측 블록이 생성될 때 사용되는 참조 픽셀의 위치를 나타낸다.Figure 49 shows the location of a reference pixel used when a prediction block is generated using a multi-prediction mode according to an embodiment of the present invention.
도 50은 본 발명의 일 실시예에 따른 LFNST 및 NSPT 변환에 대한 변환 세트 테이블을 나타낸다.Figure 50 shows a transform set table for LFNST and NSPT transforms according to an embodiment of the present invention.
도 51은 본 발명의 일 실시예에 따른 선형 모드를 사용한 예측에 있어, 선형 모드를 위한 변환 세트를 유도하는 방법을 나타낸다.Figure 51 shows a method of deriving a transform set for a linear mode in prediction using a linear mode according to an embodiment of the present invention.
본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.The terms used in this specification are general terms that are currently widely used as much as possible while considering the function in the present invention, but this may vary depending on the intention of a person skilled in the art, custom, or the emergence of new technology. In addition, in certain cases, there are terms arbitrarily selected by the applicant, and in this case, the meaning will be described in the description of the relevant invention. Therefore, we would like to clarify that the terms used in this specification should be interpreted based on the actual meaning of the term and the overall content of this specification, not just the name of the term.
본 명세서에서 'A 및/또는 B'는 'A 또는 B 중 적어도 하나를 포함하는'과 같은 의미로 해석될 수 있다.In this specification, ‘A and/or B’ may be interpreted as meaning ‘including at least one of A or 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를 가질 수 있다.Some terms in this specification may be interpreted as follows. Coding can be interpreted as encoding or decoding depending on the case. In this specification, 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, and 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. Additionally, in this specification, a video signal processing device is used as a term that includes both an encoder and a decoder. Information is a term that includes values, parameters, coefficients, elements, etc., and the meaning may be interpreted differently depending on the case, so the present invention is not limited thereto. '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. Additionally, 'block' refers to an image area containing specific components among the luminance component and chrominance component (i.e., Cb and Cr). However, depending on the embodiment, terms such as 'unit', 'block', 'partition', 'signal', and 'area' may be used interchangeably. Additionally, in this specification, 'current block' refers to a block currently scheduled to be encoded, and '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. Additionally, in this specification, terms such as 'luma', 'luma', 'luminance', and 'Y' may be used interchangeably. In addition, in this specification, 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. Additionally, in this specification, 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. Specifically, when 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. If the captured image is a progressive image, one frame can be configured as a picture and encoded or decoded. Additionally, in this specification, terms such as 'error signal', 'residual signal', 'residual signal', 'residual signal', and 'difference signal' may be used interchangeably. Additionally, in this specification, terms such as 'intra prediction mode', 'intra prediction directional mode', 'intra-screen prediction mode', and 'intra-screen prediction directional mode' may be used interchangeably. Additionally, in this specification, terms such as 'motion' and 'movement' may be used interchangeably. In addition, in this specification, '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) represents temporal location information of a picture (or frame), can be the playback order displayed on the screen, and each picture can have a unique POC.
도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치(100)의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 인코딩 장치(100)는 변환부(110), 양자화부(115), 역양자화부(120), 역변환부(125), 필터링부(130), 예측부(150) 및 엔트로피 코딩부(160)를 포함한다.Figure 1 is a schematic block diagram of a video signal encoding device 100 according to an embodiment of the present invention. Referring to Figure 1, 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.
변환부(110)는 입력 받은 비디오 신호와 예측부(150)에서 생성된 예측 신호의 차이인 레지듀얼 신호를 변환하여 변환 계수 값을 획득한다. 예를 들어, 이산 코사인 변환(Discrete Cosine Transform, DCT), 이산 사인 변환(Discrete Sine Transform, DST) 또는 웨이블릿 변환(Wavelet Transform) 등이 사용될 수 있다. 이산 코사인 변환 및 이산 사인 변환은 입력된 픽쳐 신호를 블록 형태로 나누어 변환을 수행하게 된다. 변환에 있어서 변환 영역 내의 값들의 분포와 특성에 따라서 코딩 효율이 달라질 수 있다. 레지듀얼 블록에 대한 변환에 사용되는 변환 커널은 수직 변환 및 수평 변환의 분리 가능한 특성을 가지는 변환 커널일 수 있다. 이 경우, 레지듀얼 블록에 대한 변환은 수직 변환 및 수평 변환으로 분리되어 수행될 수 있다. 예를 들어, 인코더는 레지듀얼 블록의 수직 방향으로 변환 커널을 적용하여 수직 변환을 수행할 수 있다. 또한, 인코더는 레지듀얼 블록의 수평 방향으로 변환 커널을 적용하여 수평 변환을 수행할 수 있다. 본 개시에서, 변환 커널은 변환 매트릭스, 변환 어레이, 변환 함수, 변환과 같이 레지듀얼 신호의 변환에 사용되는 파라미터 세트를 지칭하는 용어로 사용될 수 있다. 예를 들어, 변환 커널은 복수의 사용 가능한 커널들 중 어느 하나일 수 있다. 또한, 수직 변환 및 수평 변환 각각에 대해 서로 다른 변환 타입에 기반한 변환 커널이 사용될 수도 있다.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. For example, Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), or 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. For example, the encoder can perform vertical transformation by applying a transformation kernel in the vertical direction of the residual block. Additionally, the encoder can perform horizontal transformation by applying a transformation kernel in the horizontal direction of the residual block. In this disclosure, 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. For example, 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.
변환계수는 블록의 좌상단으로 갈수록 높은 계수가 분포하고, 블록의 우하단으로 갈수록 '0'에 가까운 계수가 분포한다. 현재 블록의 크기가 커질수록 우하단 영역에서 계수 '0'이 많이 존재할 가능성이 있다. 크기가 큰 블록의 변환 복잡도를 감소시키기 위해서, 임의의 좌상단 영역만을 남기고 나머지 영역은 '0'으로 재설정될 수 있다.Higher conversion coefficients are distributed toward the top left of the block, and coefficients closer to '0' are distributed toward the bottom right of the block. As the size of the current block increases, there is a possibility that there will be more coefficients of '0' in the lower right area. In order to reduce the conversion complexity of large blocks, only the upper left area can be left and the remaining areas can be reset to '0'.
또한, 코딩 블록에서 일부 영역에만 오차 신호가 존재할 수 있다. 이 경우, 임의의 일부 영역에 대해서만 변환 과정이 수행될 수 있다. 실시 일 예로, 2Nx2N 크기의 블록에서 첫번째 2NxN 블록에만 오차 신호가 존재할 수 있으며, 첫번째 2NxN블록에만 변환과정이 수행되지만 두번째 2NxN 블록은 변환과정이 수행되지 않고 인코딩 또는 디코딩되지 않을 수 있다. 여기서 N은 임의의 양의 정수가 될 수 있다.Additionally, error signals may exist only in some areas of the coding block. In this case, the conversion process may be performed only for some arbitrary areas. As an example, in a block of size 2Nx2N, 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. Here N can be any positive integer.
인코더는 변환 계수가 양자화되기 전에 추가적인 변환을 수행할 수 있다. 전술한 변환 방법은 1차 변환(primary transform)으로 지칭되고, 추가적인 변환은 2차 변환(secondary transform)으로 지칭될 수 있다. 2차 변환은 레지듀얼 블록 별로 선택적일 수 있다. 일 실시예에 따라, 인코더는 1차 변환만으로 저주파 영역에 에너지를 집중시키기 어려운 영역에 대해 2차 변환을 수행하여 코딩 효율을 향상시킬 수 있다. 예를 들어, 레지듀얼 값들이 레지듀얼 블록의 수평 또는 수직 방향 이외의 방향에서 크게 나타나는 블록에 대해 2차 변환이 추가로 수행될 수 있다. 2차 변환은 1차 변환과 달리 수직 변환 및 수평 변환으로 분리되어 수행되지 않을 수 있다. 이러한 2차 변환은 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)으로 지칭될 수 있다.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. According to one embodiment, 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. For example, 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. Unlike primary transformation, 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).
양자화부(115)는 변환부(110)에서 출력된 변환 계수 값을 양자화한다.The quantization unit 115 quantizes the transform coefficient value output from the transform unit 110.
코딩 효율을 높이기 위하여 픽쳐 신호를 그대로 코딩하는 것이 아니라, 예측부(150)를 통해 이미 코딩된 영역을 이용하여 픽쳐를 예측하고, 예측된 픽쳐에 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 더하여 복원 픽쳐를 획득하는 방법이 사용된다. 인코더와 디코더에서 미스매치가 발생되지 않도록 하기 위해, 인코더에서 예측을 수행할 때에는 디코더에서도 사용 가능한 정보를 사용해야 한다. 이를 위해, 인코더에서는 부호화한 현재 블록을 다시 복원하는 과정을 수행한다. 역양자화부(120)에서는 변환 계수 값을 역양자화하고, 역변환부(125)에서는 역양자화된 변환 계수값을 이용하여 레지듀얼 값을 복원한다. 한편, 필터링부(130)는 복원된 픽쳐의 품질 개선 및 부호화 효율 향상을 위한 필터링 연산을 수행한다. 예를 들어, 디블록킹 필터, 샘플 적응적 오프셋(Sample Adaptive Offset, SAO) 및 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, DPB, 156)에 저장된다.In order to increase coding efficiency, rather than coding the picture signal as is, 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. To prevent mismatches between the encoder and decoder, information available in the decoder must be used when performing prediction in the encoder. For this purpose, 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. Meanwhile, the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and improve coding efficiency. 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.
디블록킹 필터(deblocking filter)는 복원된 픽쳐에서 블록 간의 경계에 생성된 블록 내의 왜곡을 제거하기 위한 필터이다. 인코더는 블록 내의 임의 경계(edge)를 기준으로 몇 개의 열 또는 행에 포함된 픽셀들의 분포를 통해, 해당 경계에 디블록킹 필터를 적용할지 여부를 판단할 수 있다. 블록에 디블록킹 필터를 적용되는 경우, 인코더는 디블록킹 필터링 강도에 따라 긴 필터(Long Filter), 강한 필터(Strong Filter) 또는 약한 필터(Weak Filter)를 적용할 수 있다. 또한, 수평 방향 필터링 및 수직 방향 필터링이 병렬적으로 처리될 수 있다. 샘플 적응적 오프셋(SAO)은 디블록킹 필터가 적용된 레지듀얼 블록에 대하여, 픽셀 단위로 원본 영상과의 오프셋을 보정하는데 사용될 수 있다. 인코더는 특정 픽쳐에 대한 오프셋을 보정하기 위하여 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후, 오프셋 보정을 수행할 영역을 결정하고, 해당 영역에 오프셋을 적용하는 방법(Band Offset)을 사용할 수 있다. 또는 인코더는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법(Edge Offset)을 사용할 수 있다. 적응적 루프 필터(Adaptive Loop Filter, ALF)는 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후, 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행하는 방법이다. ALF를 적용할지 여부에 관련된 정보는 코딩 유닛 단위로 시그널링될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수가 달라질 수 있다. 또한, 적용할 대상 블록의 특성에 관계없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다.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. When a deblocking filter is applied to a block, the encoder can apply a long filter, strong filter, or weak filter depending on the deblocking filtering strength. Additionally, 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. 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.
예측부(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)에 전달한다.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, and 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, bidirectional 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. Using 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.
추가적인 실시예에 따라, 예측부(150)는 인트라 블록 카피(Intra block copy, IBC) 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들로부터 IBC 예측을 수행하여, IBC 부호화 정보를 엔트로피 코딩부(160)에 전달한다. IBC 예측부는 현재 픽쳐 내의 특정 영역을 참조하여 현재 영역의 예측에 이용되는 참조 영역을 지시하는 블록 벡터값을 획득한다. IBC 예측부는 획득된 블록 벡터값을 이용하여 IBC 예측을 수행할 수 있다. IBC 예측부는 IBC 부호화 정보를 엔트로피 코딩부(160)로 전달한다. IBC 부호화 정보는 참조 영역의 크기 정보, 블록 벡터 정보(움직임 후보 리스트 내에서 현재 블록의 블록 벡터 예측을 위한 인덱스 정보, 블록 벡터 차분 정보) 중에서 적어도 하나를 포함할 수 있다.According to an additional embodiment, 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).
위와 같은 픽쳐 예측이 수행될 경우, 변환부(110)는 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 변환하여 변환 계수 값을 획득한다. 이때, 변환은 픽쳐 내에서 특정 블록 단위로 수행될 수 있으며, 특정 블록의 크기는 기 설정된 범위 내에서 가변할 수 있다. 양자화부(115)는 변환부(110)에서 생성된 변환 계수 값을 양자화하여 양자화된 변환 계수를 엔트로피 코딩부(160)로 전달한다.When the above picture prediction is performed, the transform unit 110 obtains a transform coefficient value by transforming the residual value between the original picture and the predicted picture. At this time, 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.
상기 2차원 배열 형태의 양자화된 변환 계수는 엔트로피 코딩을 위해 1차원의 배열 형태로 재정렬될 수 있다. 양자화된 변환 계수를 스캐닝하는 방법은 변환 블록의 크기 및 화면 내 예측 모드에 따라 어떠한 스캔 방법이 사용될지 여부가 결정될 수 있다. 실시 일 예로, 대각(Diagonal), 수직(vertical), 수평(horizontal) 스캔이 적용될 수 있다. 이러한 스캔 정보는 블록 단위로 시그널링될 수 있으며, 이미 정해진 규칙에 따라 유도될 수 있다.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.
엔트로피 코딩부(160)는 양자화된 변환 계수를 나타내는 정보, 인트라 부호화 정보, 및 인터 부호화 정보 등을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성한다. 엔트로피 코딩부(160)에서는 가변 길이 코딩(Variable Length Coding, VLC) 방식과 산술 코딩(arithmetic coding) 방식 등이 사용될 수 있다. 가변 길이 코딩(VLC) 방식은 입력되는 심볼들을 연속적인 코드워드로 변환하는데, 코드워드의 길이는 가변적일 수 있다. 예를 들어, 자주 발생하는 심볼들을 짧은 코드워드로, 자주 발생하지 않은 심볼들은 긴 코드워드로 표현하는 것이다. 가변 길이 코딩 방식으로서 컨텍스트 기반 적응형 가변 길이 코딩(Context-based Adaptive Variable Length Coding, CAVLC) 방식이 사용될 수 있다. 산술 코딩은 각 데이터 심볼들의 확률 분포를 이용하여 연속적인 데이터 심볼들을 하나의 소수로 변환하는데, 산술 코딩은 각 심볼을 표현하기 위하여 필요한 최적의 소수 비트를 얻을 수 있다. 산술 코딩으로서 컨텍스트 기반 적응형 산술 부호화(Context-based Adaptive Binary Arithmetic Code, CABAC)가 이용될 수 있다. 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. 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. As a variable length coding method, Context-based Adaptive Variable Length Coding (CAVLC) can be used. 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 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)과정이 수행되어 확률 구간이 넓어지고 해당 위치 정보가 출력된다. 또한, 각 빈이 처리된 후, 처리된 빈의 정보를 통해 다음 처리될 빈에 대한 확률이 새롭게 설정되는 확률 업데이트 과정이 수행될 수 있다.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. First, if the symbols are not in binary form, the encoder binarizes each symbol using exp-Golomb, etc. Binarized 0 or 1 can be described as a bin. 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). The context model with this initialization information can use probability-based values obtained through experimentation. 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. 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. Location information within the probability interval where the last bin was processed is output. However, since the probability interval cannot be divided indefinitely, when it is reduced to within a certain size, 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.
상기 생성된 비트스트림은 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) 등에 포함되어 전송될 수 있다.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. 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. 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.
한편, 도 1의 블록도는 본 발명의 일 실시예에 따른 인코딩 장치(100)를 나타낸 것으로서, 분리하여 표시된 블록들은 인코딩 장치(100)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 인코딩 장치(100)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 인코딩 장치(100)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.Meanwhile, the block diagram of 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).
도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치(200)의 개략적인 블록도이다. 도 2를 참조하면 본 발명의 디코딩 장치(200)는 엔트로피 디코딩부(210), 역양자화부(220), 역변환부(225), 필터링부(230) 및 예측부(250)를 포함한다.Figure 2 is a schematic block diagram of a video signal decoding device 200 according to an embodiment of the present invention. Referring to FIG. 2, 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.
엔트로피 디코딩부(210)는 비디오 신호 비트스트림을 엔트로피 디코딩하여, 각 영역에 대한 변환 계수 정보, 인트라 부호화 정보, 인터 부호화 정보 등을 추출한다. 예를 들어, 엔트로피 디코딩부(210)는 비디오 신호 비트스트림으로부터 특정 영역의 변환 계수 정보에 대한 이진화 코드를 획득할 수 있다. 또한, 엔트로피 디코딩부(210)는 이진화 코드를 역 이진화하여 양자화된 변환 계수를 획득한다. 역양자화부(220)는 양자화된 변환 계수를 역양자화하고, 역변환부(225)는 역양자화된 변환 계수를 이용하여 레지듀얼 값을 복원한다. 비디오 신호 처리 장치(200)는 역변환부(225)에서 획득된 레지듀얼 값을 예측부(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.
한편, 필터링부(230)는 픽쳐에 대한 필터링을 수행하여 화질을 향상시킨다. 여기에는 블록 왜곡 현상을 감소시키기 위한 디블록킹 필터 및/또는 픽쳐 전체의 왜곡 제거를 위한 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 다음 픽쳐에 대한 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(DPB, 256)에 저장된다.Meanwhile, 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.
예측부(250)는 인트라 예측부(252) 및 인터 예측부(254)를 포함한다. 예측부(250)는 전술한 엔트로피 디코딩부(210)를 통해 복호화된 부호화 타입, 각 영역에 대한 변환 계수, 인트라/인터 부호화 정보 등을 활용하여 예측 픽쳐를 생성한다. 복호화가 수행되는 현재 블록을 복원하기 위해서, 현재 블록이 포함된 현재 픽쳐 또는 다른 픽쳐들의 복호화된 영역이 이용될 수 있다. 복원에 현재 픽쳐만을 이용하는, 즉 인트라 예측 또는 인트라 BC 예측을 수행하는 픽쳐(또는, 타일/슬라이스)를 인트라 픽쳐 또는 I 픽쳐(또는, 타일/슬라이스), 인트라 예측, 인터 예측 및 인트라 BC 예측을 모두 수행할 수 있는 픽쳐(또는, 타일/슬라이스)를 인터 픽쳐(또는, 타일/슬라이스)라고 한다. 인터 픽쳐(또는, 타일/슬라이스) 중 각 블록의 샘플값들을 예측하기 위하여 최대 하나의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 예측 픽쳐(predictive picture) 또는 P 픽쳐(또는, 타일/슬라이스)라고 하며, 최대 두 개의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 쌍예측 픽쳐(Bi-predictive picture) 또는 B 픽쳐(또는, 타일/슬라이스) 라고 한다. 다시 말해서, P 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 하나의 모션 정보 세트를 이용하고, B 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 두 개의 모션 정보 세트를 이용한다. 여기서, 모션 정보 세트는 하나 이상의 모션 벡터와 하나의 참조 픽쳐 인덱스를 포함한다.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. To restore the current block on which decoding is performed, 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). To predict sample values of each block among inter pictures (or tiles/slices), 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). In other words, a P picture (or tile/slice) uses at most one set of motion information to predict each block, and a B picture (or tile/slice) uses at most two sets of motion information to predict each block. Use a set. Here, the motion information set includes one or more motion vectors and one reference picture index.
인트라 예측부(252)는 인트라 부호화 정보 및 현재 픽쳐 내의 복원된 샘플들을 이용하여 예측 블록을 생성한다. 전술한 바와 같이, 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스 중 적어도 하나를 포함할 수 있다. 인트라 예측부(252)는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다. 본 개시에서, 복원된 샘플들, 참조 샘플들 및 현재 블록의 샘플들은 픽셀들을 나타낼 수 있다. 또한, 샘플 값(sample value)들은 픽셀 값들을 나타낼 수 있다.The intra prediction unit 252 generates a prediction block using intra encoding information and reconstructed samples in the current picture. As described above, intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. 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. In this disclosure, reconstructed samples, reference samples, and samples of the current block may represent pixels. Additionally, sample values may represent pixel values.
일 실시예에 따르면, 참조 샘플들은 현재 블록의 주변 블록에 포함된 샘플들일 수 있다. 예를 들어, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 또한, 참조 샘플들은 현재 블록의 주변 블록의 샘플들 중 현재 블록의 좌측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들 및/또는 현재 블록의 상측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들일 수 있다. 이때, 현재 블록의 주변 블록은 현재 블록에 인접한 좌측(L) 블록, 상측(A) 블록, 하좌측(Below Left, BL) 블록, 상우측(Above Right, AR) 블록 또는 상좌측(Above Left, AL) 블록 중 적어도 하나를 포함할 수 있다.According to one embodiment, the reference samples may be samples included in neighboring blocks of the current block. For example, the reference samples may be samples adjacent to the left border and/or samples adjacent to the upper boundary of the current block. In addition, 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. At this time, 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.
인터 예측부(254)는 복호 픽쳐 버퍼(256)에 저장된 참조 픽쳐 및 인터 부호화 정보를 이용하여 예측 블록을 생성한다. 인터 부호화 정보는 참조 블록에 대한 현재 블록의 모션 정보 세트(참조 픽쳐 인덱스, 모션 벡터 정보 등)를 포함할 수 있다. 인터 예측에는 L0 예측, L1 예측 및 쌍예측(Bi-prediction)이 있을 수 있다. L0 예측은 L0 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측이고, L1 예측은 L1 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측을 의미한다. 이를 위해서는 1세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 필요할 수 있다. 쌍예측 방식에서는 최대 2개의 참조 영역을 이용할 수 있는데, 이 2개의 참조 영역은 동일한 참조 픽쳐에 존재할 수도 있고, 서로 다른 픽쳐에 각각 존재할 수도 있다. 즉, 쌍예측 방식에서는 최대 2세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 이용될 수 있는데, 2개의 모션 벡터가 동일한 참조 픽쳐 인덱스에 대응될 수도 있고 서로 다른 참조 픽쳐 인덱스에 대응될 수도 있다. 이때, 참조 픽쳐들은 현재 픽쳐를 기준으로 시간적으로 이전 또는 이후에 위치하는 픽쳐로서, 이미 복원된 완료된 픽쳐가 될 수 있다. 일 실시예에 따라, 쌍예측 방식에서는 사용되는 2개의 참조 영역은 L0 픽쳐 리스트 및 L1 픽쳐 리스트 각각에서 선택된 영역일 수 있다.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, and 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). In the pair prediction method, 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. That is, in 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. At this time, the reference pictures are pictures located temporally before or after the current picture, and may be pictures that have already been reconstructed. According to one embodiment, 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.
인터 예측부(254)는 모션 벡터 및 참조 픽쳐 인덱스를 이용하여 현재 블록의 참조 블록을 획득할 수 있다. 상기 참조 블록은 참조 픽쳐 인덱스에 대응하는 참조 픽쳐 내에 존재한다. 또한, 모션 벡터에 의해서 특정된 블록의 샘플 값 또는 이의 보간(interpolation)된 값이 현재 블록의 예측자(predictor)로 이용될 수 있다. 서브펠(sub-pel) 단위의 픽셀 정확도를 갖는 모션 예측을 위하여 이를 테면, 휘도 신호에 대하여 8-탭 보간 필터가, 색차 신호에 대하여 4-탭 보간 필터가 사용될 수 있다. 다만, 서브펠 단위의 모션 예측을 위한 보간 필터는 이에 한정되지 않는다. 이와 같이 인터 예측부(254)는 이전에 복원된 픽쳐로부터 현재 유닛의 텍스쳐를 예측하는 모션 보상(motion compensation)을 수행한다. 이때, 인터 예측부는 모션 정보 세트를 이용할 수 있다.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. Additionally, 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. For motion prediction with sub-pel unit pixel accuracy, for example, 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. However, 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.
추가적인 실시예에 따라, 예측부(250)는 IBC 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들을 포함하는 특정 영역을 참조하여 현재 영역을 복원할 수 있다. IBC 예측부는 엔트로피 디코딩부(210)로부터 획득된 IBC 부호화 정보를 이용하여 IBC 예측을 수행할 수 있다. IBC 부호화 정보는 블록 벡터 정보를 포함할 수 있다.According to an additional embodiment, 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 the IBC encoding information obtained from the entropy decoding unit 210. IBC encoding information may include block vector information.
상기 인트라 예측부(252) 또는 인터 예측부(254)로부터 출력된 예측값, 및 역변환부(225)로부터 출력된 레지듀얼 값이 더해져서 복원된 비디오 픽쳐가 생성된다. 즉, 비디오 신호 디코딩 장치(200)는 예측부(250)에서 생성된 예측 블록과 역변환부(225)로부터 획득된 레지듀얼을 이용하여 현재 블록을 복원한다.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.
한편, 도 2의 블록도는 본 발명의 일 실시예에 따른 디코딩 장치(200)를 나타낸 것으로서, 분리하여 표시된 블록들은 디코딩 장치(200)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 디코딩 장치(200)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 디코딩 장치(200)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.Meanwhile, the block diagram of 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).
한편, 본 명세서에서 제안된 기술은 인코더와 디코더의 방법 및 장치에 모두 적용 가능한 기술이며, 시그널링과 파싱으로 기술된 부분은 설명의 편의를 위해 기술한 것일 수 있다. 일반적으로 시그널링은 인코더 관점에서 각 신택스(syntax)를 부호화하기 위한 것이고, 파싱은 디코더 관점에서 각 신택스의 해석을 위한 것으로 설명될 수 있다. 즉, 각 신택스는 인코더로부터 비트스트림에 포함되어 시그널링될 수 있으며, 디코더에서는 신택스를 파싱하여 복원과정에서 사용할 수 있다. 이때, 규정된 계층적 구성대로 나열한 각 신택스에 대한 비트의 시퀀스를 비트스트림이라고 할 수 있다.Meanwhile, the technology proposed in this specification is applicable to both encoder and decoder methods and devices, and parts described as signaling and parsing may be described for convenience of explanation. In general, signaling can be described as encoding each syntax from an encoder's perspective, and 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. At this time, the sequence of bits for each syntax arranged according to the prescribed hierarchical structure can be referred to as a bitstream.
하나의 픽쳐는 서브 픽쳐(sub-picture), 슬라이스(slice), 타일(tile) 등으로 분할되어 부호화될 수 있다. 서브 픽쳐는 하나 이상의 슬라이스 또는 타일을 포함할 수 있다. 하나의 픽쳐가 여러 개의 슬라이스 또는 타일로 분할되어 부호화되었을 경우, 픽쳐 내의 모든 슬라이스 또는 타일이 디코딩이 완료되어야만 화면에 출력이 가능하다. 반면에, 하나의 픽쳐가 여러 개의 서브 픽쳐로 부호화되었을 경우, 임의의 서브 픽쳐만 디코딩되어 화면에 출력될 수 있다. 슬라이스는 여러 개의 타일 또는 서브 픽쳐를 포함할 수 있다. 또는 타일은 여러 개의 서브 픽쳐 또는 슬라이스를 포함할 수 있다. 서브 픽쳐, 슬라이스, 타일은 서로 독립적으로 인코딩 또는 디코딩이 가능하므로 병렬처리 및 처리 속도 향상에 효과적이다. 하지만, 인접한 다른 서브 픽쳐, 다른 슬라이스, 다른 타일의 부호화된 정보를 이용할 수 없으므로 비트량이 증가되는 단점이 있다. 서브 픽쳐, 슬라이스, 타일은 여러 개의 코딩 트리 유닛(Coding Tree Unit, CTU)으로 분할되어 부호화될 수 있다.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.
도 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개의 색차 변환 블록들, 그리고 그것의 부호화된 신택스 정보로 구성될 수 있다. 코딩 트리 유닛은 복수의 코딩 유닛들로 분할될 수 있다. 코딩 트리 유닛은 분할되지 않고 리프 노드가 될 수도 있다. 이 경우, 코딩 트리 유닛 자체가 코딩 유닛이 될 수 있다. Figure 3 shows an embodiment in which a Coding Tree Unit (CTU) is divided into Coding Units (CUs) within a picture. In the process of coding a video signal, a picture can be divided into a sequence of coding tree units (CTUs). A coding tree unit may be composed of a luma coding tree block (CTB), two chroma coding tree blocks, and its encoded syntax information. 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.
코딩 유닛은 상기에서 설명한 비디오 신호의 처리 과정, 즉 인트라/인터 예측, 변환, 양자화 및/또는 엔트로피 코딩 등의 과정에서 픽쳐를 처리하기 위한 기본 단위를 가리킨다. 하나의 픽쳐 내에서 코딩 유닛의 크기 및 모양은 일정하지 않을 수 있다. 코딩 유닛은 정사각형 또는 직사각형의 모양을 가질 수 있다. 직사각형 코딩 유닛(또는, 직사각형 블록)은 수직 코딩 유닛(또는, 수직 블록)과 수평 코딩 유닛(또는, 수평 블록)을 포함한다. 본 명세서에서, 수직 블록은 높이가 너비보다 큰 블록이며, 수평 블록은 너비가 높이보다 큰 블록이다. 또한, 본 명세서에서 정사각형이 아닌(non-square) 블록은 직사각형 블록을 가리킬 수 있지만, 본 발명은 이에 한정되지 않는다.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). In this specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. Additionally, in this specification, a non-square block may refer to a rectangular block, but the present invention is not limited thereto.
도 3을 참조하면, 코딩 트리 유닛은 먼저 쿼드 트리(Quad Tree, QT) 구조로 분할된다. 즉, 쿼드 트리 구조에서 2NX2N 크기를 가지는 하나의 노드는 NXN 크기를 가지는 네 개의 노드들로 분할될 수 있다. 본 명세서에서 쿼드 트리는 4진(quaternary) 트리로도 지칭될 수 있다. 쿼드 트리 분할은 재귀적으로 수행될 수 있으며, 모든 노드들이 동일한 깊이로 분할될 필요는 없다.Referring to Figure 3, 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. In this specification, 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.
한편, 전술한 쿼드 트리의 리프 노드(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)의 노드들로 분할될 수 있다. 이러한 멀티-타입 트리 분할은 재귀적으로 수행될 수 있다.Meanwhile, the leaf nodes of the aforementioned quad tree can be further divided into a multi-type tree (MTT) structure. According to an embodiment of the present invention, 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. According to an embodiment of the present invention, the width and height of the nodes in each tree structure may both have values that are powers of 2. For example, in a Binary Tree (BT) structure, 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. Additionally, in the Ternary Tree (TT) structure, 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.
멀티-타입 트리의 리프 노드는 코딩 유닛이 될 수 있다. 코딩 유닛이 최대 변환 길이에 비해 크지 않은 경우, 해당 코딩 유닛은 더 이상의 분할 없이 예측 및/또는 변환의 단위로 사용될 수 있다. 일 실시예로서, 현재 코딩 유닛의 너비 또는 높이가 최대 변환 길이보다 큰 경우, 현재 코딩 유닛은 분할에 관한 명시적 시그널링 없이 복수의 변환 유닛으로 분할될 수 있다. 한편, 전술한 쿼드 트리 및 멀티-타입 트리에서 다음의 파라메터들 중 적어도 하나가 사전에 정의되거나 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 리프 노드 크기.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. 1) CTU size: the root node size of the quad tree, 2) minimum QT size (MinQtSize): minimum allowed QT leaf node size, 3) maximum BT size (MaxBtSize): maximum allowed BT root node size, 4) Maximum TT Size (MaxTtSize): Maximum TT root node size allowed, 5) Maximum MTT Depth (MaxMttDepth): Maximum allowed depth of MTT split from leaf nodes of QT, 6) Minimum BT Size (MinBtSize): Allowed Minimum BT leaf node size, 7) Minimum TT size (MinTtSize): Minimum TT leaf node size allowed.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다. 전술한 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하기 위해 기 설정된 플래그들이 사용될 수 있다. 도 4를 참조하면, 노드의 분할 여부를 지시하는 플래그 'split_cu_flag', 쿼드 트리 노드의 분할 여부를 지시하는 플래그 'split_qt_flag', 멀티-타입 트리 노드의 분할 방향을 지시하는 플래그 'mtt_split_cu_vertical_flag' 또는 멀티-타입 트리 노드의 분할 모양을 지시하는 플래그 'mtt_split_cu_binary_flag' 중 적어도 하나가 사용될 수 있다.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. Referring to Figure 4, 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'가 먼저 시그널링될 수 있다. 'split_cu_flag'의 값이 0인 경우, 현재 노드가 분할되지 않는 것을 나타내며, 현재 노드는 코딩 유닛이 된다. 현재 노드가 코팅 트리 유닛인 경우, 코딩 트리 유닛은 분할되지 않은 하나의 코딩 유닛을 포함한다. 현재 노드가 쿼드 트리 노드 'QT node'인 경우, 현재 노드는 쿼드 트리의 리프 노드 'QT leaf node'이며 코딩 유닛이 된다. 현재 노드가 멀티-타입 트리 노드 'MTT node'인 경우, 현재 노드는 멀티-타입 트리의 리프 노드 'MTT leaf node'이며 코딩 유닛이 된다.According to an embodiment of the present invention, '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.
'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개의 직사각형 노드들로 분할된다.If the value of 'split_cu_flag' is 1, 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'. If the value of 'split_qt_flag' is 1, the node is split into 4 square nodes, and if the value of 'split_qt_flag' is 0, the node becomes a leaf node 'QT leaf node' of the quad tree, and the node becomes a multi-square node. -Divided into type nodes. According to an embodiment of the present invention, 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. If the value of 'mtt_split_cu_vertical_flag' is 1, vertical splitting of the node 'MTT node' is indicated, and if the value of 'mtt_split_cu_vertical_flag' is 0, horizontal splitting of the node 'MTT node' is indicated. Additionally, if the value of 'mtt_split_cu_binary_flag' is 1, the node 'MTT node' is divided into two rectangular nodes, and if the value of 'mtt_split_cu_binary_flag' is 0, the node 'MTT node' is divided into three rectangular nodes.
트리 분할 구조는 휘도 블록과 색차 블록이 동일한 형태로 분할될 수 있다. 즉, 색차 블록은 휘도 블록의 분할 형태를 참조하여 색차 블록을 분할할 수 있다. 현재 색차 블록이 임의의 정해진 크기보다 적다면, 휘도 블록이 분할되었더라도 색차 블록은 분할되지 않을 수 있다.In the tree division structure, 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.
트리 분할 구조는 휘도 블록과 색차 블록이 서로 다른 형태를 가질 수 있다. 이때, 휘도 블록에 대한 분할 정보와 색차 블록에 대한 분할 정보가 각각 시그널링될 수 있다. 또한, 분할 정보 뿐만 아니라 휘도 블록과 색차 블록의 부호화 정보도 다를 수 있다. 실시 일 예로, 휘도 블록과 색차 블록의 인트라 부호화 모드, 움직임 정보에 대한 부호화 정보 등이 적어도 하나 이상 다를 수 있다.In the tree division structure, the luminance block and the chrominance block may have different forms. At this time, division information for the luminance block and division information for the chrominance block may be signaled, respectively. Additionally, not only the division information but also the encoding information of the luminance block and the chrominance block may be different. As an example of an embodiment, at least one intra coding mode of a luminance block and a chrominance block, encoding information for motion information, etc. may be different.
가장 작은 단위로 분할될 노드는 하나의 코딩 블록으로 처리될 수 있다. 현재 블록이 코딩 블록일 경우, 코딩 블록은 여러 개의 서브 블록(서브 코딩 블록)으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다. 또한 코딩 유닛이 서브 블록으로 분할될 때, 수평 또는 수직 방향으로 분할되거나 사선으로 분할될 수 있다. 인트라 모드에서 현재 코딩 유닛을 수평 또는 수직 방향으로 2개 또는 4개의 서브 블록으로 분할하는 모드를 ISP(Intra Sub Partitions)이라 한다. 인터 모드에서 현재 코딩 블록을 사선으로 분할하는 모드를 GPM(Geometric partitioning mode)이라 한다. GPM모드에서 사선의 위치와 방향은 미리 정해진 각도 테이블을 사용하여 유도하고, 각도 테이블의 인덱스 정보가 시그널링된다.A node to be divided into the smallest unit can be processed as one coding block. When the current block is a 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. As an example embodiment, when the coding unit is an intra mode, the intra prediction mode of each subblock may be the same or different from each other. Additionally, when the coding unit is in inter mode, the motion information of each sub-block may be the same or different. Additionally, each sub-block may be encoded or decoded independently from each other. Each sub-block can be distinguished through a sub-block index (sbIdx). Additionally, when a coding unit is divided into sub-blocks, it may be divided horizontally or vertically or diagonally. In intra mode, the mode in which the current coding unit is divided into 2 or 4 sub-blocks horizontally or vertically is called ISP (Intra Sub Partitions). In inter mode, the mode in which the current coding block is divided diagonally is called GPM (Geometric partitioning mode). In GPM 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.
코딩을 위한 픽쳐 예측(모션 보상)은 더 이상 나누어지지 않는 코딩 유닛(즉 코딩 트리 유닛의 리프 노드)을 대상으로 이루어진다. 이러한 예측을 수행하는 기본 단위를 이하에서는 예측 유닛(prediction unit) 또는 예측 블록(prediction block)이라고 한다.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.
이하, 본 명세서에서 사용되는 유닛이라는 용어는 예측을 수행하는 기본 단위인 상기 예측 유닛을 대체하는 용어로 사용될 수 있다. 다만, 본 발명이 이에 한정되는 것은 아니며, 더욱 광의적으로는 상기 코딩 유닛을 포함하는 개념으로 이해될 수 있다.Hereinafter, 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. However, the present invention is not limited to this, and can be understood more broadly as a concept including the coding unit.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다. 전술한 바와 같이, 인트라 예측부는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다.Figures 5 and 6 show the intra prediction method according to an embodiment of the present invention in more detail. As described above, 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.
먼저, 도 5는 인트라 예측 모드에서 현재 블록의 예측을 위해 사용되는 참조 샘플들의 일 실시예를 도시한다. 일 실시예에 따르면, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 도 5에 도시된 바와 같이, 현재 블록의 크기가 WXH이고 현재 블록에 인접한 단일 참조 라인(line)의 샘플들이 인트라 예측에 사용될 경우, 현재 블록의 좌측 및/또는 상측에 위치한 최대 2W+2H+1개의 주변 샘플들을 사용하여 참조 샘플들이 설정될 수 있다.First, Figure 5 shows an example of reference samples used for prediction of the current block in intra prediction mode. According to one embodiment, the reference samples may be samples adjacent to the left boundary and/or samples adjacent to the upper boundary of the current block. As shown in Figure 5, when the size of the current block is WXH and samples of a single reference line adjacent to the current block are used for intra prediction, 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.
한편, 현재 블록의 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 수 있다. 다중 참조 라인은 현재 블록으로부터 기 설정된 범위 이내에 위치한 n개의 라인들로 구성될 수 있다. 일 실시예에 따르면, 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 경우, 참조 픽셀들로 설정될 라인들을 지시하는 별도의 인덱스 정보가 시그널링될 수 있으며, 이를 참조 라인 인덱스라고 명명할 수 있다.Meanwhile, 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. According to one embodiment, when pixels of multiple reference lines are used for intra prediction, separate index information indicating lines to be set as reference pixels may be signaled, and may be called a reference line index.
또한, 참조 샘플로 사용될 적어도 일부의 샘플이 아직 복원되지 않은 경우, 인트라 예측부는 참조 샘플 패딩 과정을 수행하여 참조 샘플을 획득할 수 있다. 또한, 인트라 예측부는 인트라 예측의 오차를 줄이기 위해 참조 샘플 필터링 과정을 수행할 수 있다. 즉, 주변 샘플들 및/또는 참조 샘플 패딩 과정에 의해 획득된 참조 샘플들에 필터링을 수행하여 필터링된 참조 샘플들을 획득할 수 있다. 인트라 예측부는 이와 같이 획득된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 인트라 예측부는 필터링되지 않은 참조 샘플들 또는 필터링된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 본 개시에서, 주변 샘플들은 적어도 하나의 참조 라인 상의 샘플들을 포함할 수 있다. 예를 들어, 주변 샘플들은 현재 블록의 경계에 인접한 라인 상의 인접 샘플들을 포함할 수 있다.Additionally, when at least some samples to be used as reference samples have not yet been reconstructed, 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. In this disclosure, 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.
다음으로, 도 6은 인트라 예측에 사용되는 예측 모드들의 일 실시예를 도시한다. 인트라 예측을 위해, 인트라 예측 방향을 지시하는 인트라 예측 모드 정보가 시그널링될 수 있다. 인트라 예측 모드 정보는 인트라 예측 모드 세트를 구성하는 복수의 인트라 예측 모드들 중 어느 하나를 지시한다. 현재 블록이 인트라 예측 블록일 경우, 디코더는 비트스트림으로부터 현재 블록의 인트라 예측 모드 정보를 수신한다. 디코더의 인트라 예측부는 추출된 인트라 예측 모드 정보에 기초하여 현재 블록에 대한 인트라 예측을 수행한다.Next, Figure 6 shows an example of prediction modes used for intra prediction. For intra prediction, 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.
본 발명의 실시예에 따르면, 인트라 예측 모드 세트는 인트라 예측에 사용되는 모든 인트라 예측 모드들(예, 총 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) 모드를 지시한다.According to an embodiment of the present invention, 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. For example, 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. At this time, intra prediction mode index 2 indicates horizontal diagonal (HDIA) mode, intra prediction mode index 18 indicates horizontal (HORizontal, HOR) mode, and 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.
한편, 기 설정된 각도 범위는 현재 블록의 모양에 따라 서로 다르게 설정될 수 있다. 예를 들어, 현재 블록이 직사각형 블록일 경우 시계 방향으로 45도를 초과하거나 -135도 미만 각도를 지시하는 광각 모드가 추가적으로 사용될 수 있다. 현재 블록이 수평 블록일 경우, 각도 모드는 시계 방향으로 (45+offset1)도에서 (-135+offset1)도 사이의 각도 범위(즉, 제2 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 67 내지 76이 추가적으로 사용될 수 있다. 또한, 현재 블록이 수직 블록일 경우, 각도 모드는 시계 방향으로 (45-offset2)도에서 (-135-offset2)도 사이의 각도 범위(즉, 제3 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 -10 내지 -1이 추가적으로 사용될 수 있다. 본 발명의 실시예에 따르면, offset1 및 offset2의 값은 직사각형 블록의 너비와 높이 간의 비율에 따라 서로 다르게 결정될 수 있다. 또한, offset1 및 offset2는 양수일 수 있다.Meanwhile, 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. Additionally, if the current block is a vertical block, 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). . At this time, angle modes -10 to -1 outside the first angle range may be additionally used. According to an embodiment of the present invention, 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.
본 발명의 추가적인 실시예에 따르면, 인트라 예측 모드 세트를 구성하는 복수의 각도 모드들은 기본 각도 모드와 확장 각도 모드를 포함할 수 있다. 이때, 확장 각도 모드는 기본 각도 모드에 기초하여 결정될 수 있다.According to a further embodiment of the present invention, the plurality of angle modes constituting the intra prediction mode set may include a basic angle mode and an extended angle mode. At this time, the extended angle mode may be determined based on the basic angle mode.
일 실시예에 따르면, 기본 각도 모드는 기존 HEVC(High Efficiency Video Coding) 표준의 인트라 예측에서 사용되는 각도에 대응하는 모드이고, 확장 각도 모드는 차세대 비디오 코덱 표준의 인트라 예측에서 새롭게 추가되는 각도에 대응하는 모드일 수 있다. 더욱 구체적으로, 기본 각도 모드는 인트라 예측 모드 {2, 4, 6, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {3, 5, 7, …, 65} 중 어느 하나에 대응하는 각도 모드일 수 있다. 즉, 확장 각도 모드는 제1 각도 범위 내에서 기본 각도 모드들 사이의 각도 모드일 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다.According to one embodiment, the basic angle mode corresponds to the angle used in intra prediction of the existing HEVC (High Efficiency Video Coding) standard, and 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.
다른 실시예에 따르면, 기본 각도 모드는 기 설정된 제1 각도 범위 이내의 각도에 대응하는 모드이고, 확장 각도 모드는 상기 제1 각도 범위를 벗어나는 광각 모드일 수 있다. 즉, 기본 각도 모드는 인트라 예측 모드 {2, 3, 4, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {-14, -13, -12, …, -1} 및 {67, 68, …, 80} 중 어느 하나에 대응하는 각도 모드일 수 있다. 확장 각도 모드가 지시하는 각도는 대응하는 기본 각도 모드가 지시하는 각도의 반대편 각도로 결정될 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다. 한편, 확장 각도 모드들의 개수는 이에 한정되지 않으며, 현재 블록의 크기 및/또는 모양에 따라 추가적인 확장 각도들이 정의될 수 있다. 한편, 인트라 예측 모드 세트에 포함되는 인트라 예측 모드들의 총 개수는 전술한 기본 각도 모드와 확장 각도 모드의 구성에 따라 가변할 수 있다.According to another embodiment, the basic angle mode may be a mode corresponding to an angle within a preset first angle range, and 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. Meanwhile, 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. Meanwhile, 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.
상기 실시예에서, 확장 각도 모드들 간의 간격은 대응하는 기본 각도 모드들 간의 간격에 기초하여 설정될 수 있다. 예를 들어, 확장 각도 모드들 {3, 5, 7, …, 65} 간의 간격은 대응하는 기본 각도 모드들 {2, 4, 6, …, 66} 간의 간격에 기초하여 결정될 수 있다. 또한, 확장 각도 모드들 {-14, -13, …, -1} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {53, 53, …, 66} 간의 간격에 기초하여 결정되고, 확장 각도 모드들 {67, 68, …, 80} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {2, 3, 4, …, 15} 간의 간격에 기초하여 결정될 수 있다. 확장 각도 모드들 간의 각도 간격은 대응하는 기본 각도 모드들 간의 각도 간격과 동일하도록 설정될 수 있다. 또한, 인트라 예측 모드 세트에서 확장 각도 모드들의 개수는 기본 각도 모드들의 개수 이하로 설정될 수 있다.In the above embodiment, the spacing between extended angle modes may be set based on the spacing between corresponding basic angle modes. For example, 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. Additionally, 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. Additionally, the number of extended angle modes in the intra prediction mode set may be set to less than the number of basic angle modes.
본 발명의 실시예에 따르면, 확장 각도 모드는 기본 각도 모드를 기초로 시그널링될 수 있다. 예를 들어, 광각 모드(즉, 확장 각도 모드)는 제1 각도 범위 이내의 적어도 하나의 각도 모드(즉, 기본 각도 모드)를 대체할 수 있다. 대체되는 기본 각도 모드는 광각 모드의 반대편에 대응하는 각도 모드일 수 있다. 즉, 대체되는 기본 각도 모드는 광각 모드가 지시하는 각도의 반대 방향의 각도에 대응하거나 또는 상기 반대 방향의 각도로부터 기 설정된 오프셋 인덱스만큼 차이 나는 각도에 대응하는 각도 모드이다. 본 발명의 실시예에 따르면, 기 설정된 오프셋 인덱스는 1이다. 대체되는 기본 각도 모드에 대응하는 인트라 예측 모드 인덱스는 광각 모드에 다시 매핑되어 해당 광각 모드를 시그널링할 수 있다. 예를 들어, 광각 모드 {-14, -13, …, -1}은 인트라 예측 모드 인덱스 {52, 53, …, 66}에 의해 각각 시그널링될 수 있고, 광각 모드 {67, 68, …, 80}은 인트라 예측 모드 인덱스 {2, 3, …, 15}에 의해 각각 시그널링될 수 있다. 이와 같이 기본 각도 모드를 위한 인트라 예측 모드 인덱스가 확장 각도 모드를 시그널링하도록 함으로, 각 블록의 인트라 예측에 사용되는 각도 모드들의 구성이 서로 다르더라도 동일한 세트의 인트라 예측 모드 인덱스들이 인트라 예측 모드의 시그널링에 사용될 수 있다. 따라서, 인트라 예측 모드 구성의 변화에 따른 시그널링 오버헤드가 최소화될 수 있다.According to an embodiment of the present invention, the extended angle mode may be signaled based on the basic angle mode. For example, a wide angle mode (i.e., extended angle mode) may replace at least one angle mode (i.e., basic angle mode) within the first angle range. 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. According to an embodiment of the present invention, 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. For example, wide angle mode {-14, -13, … , -1} is the intra prediction mode index {52, 53, … , 66}, respectively, and the wide-angle mode {67, 68, … , 80} is the intra prediction mode index {2, 3, … , 15} can be signaled respectively. In this way, 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.
한편, 확장 각도 모드의 사용 여부는 현재 블록의 모양 및 크기 중 적어도 하나에 기초하여 결정될 수 있다. 일 실시예에 따르면, 현재 블록의 크기가 기 설정된 크기보다 클 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 그렇지 않을 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다. 다른 실시예에 따르면, 현재 블록이 정사각형이 아닌 블록인 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 현재 블록이 정사각형 블록인 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다.Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. According to one embodiment, if the size of the current block is larger than the preset size, 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. According to another embodiment, if the current block is a non-square 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. When 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. After intra prediction of the current block is performed using reference samples and intra prediction mode information, 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. .
인터 예측에 사용되는 움직임(모션) 정보에는 참조 방향 지시 정보(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로 설정될 수 있다.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. As an example of an embodiment, in the case of unidirectional prediction using an L0 reference picture, predFlagL0=1 and predFlagL1=0 may be set. In the case of unidirectional prediction using an L1 reference picture, predFlagL0=0 and predFlagL1=1 can be set. In the case of bidirectional prediction using both L0 and L1 reference pictures, predFlagL0=1 and predFlagL1=1 can be set.
현재 블록이 코딩 유닛일 경우, 코딩 유닛은 여러 개의 서브 블록으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다.When the current block is a coding unit, the coding unit may be divided into several sub-blocks, and the prediction information of each sub-block may be the same or different. As an example embodiment, when the coding unit is an intra mode, the intra prediction mode of each subblock may be the same or different from each other. Additionally, when the coding unit is in inter mode, the motion information of each sub-block may be the same or different. Additionally, each sub-block may be encoded or decoded independently from each other. Each sub-block can be distinguished through a sub-block index (sbIdx).
현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터와 유사할 가능성이 높다. 따라서, 주변 블록의 움직임 벡터는 움직임 예측 값(motion vector predictor, mvp)으로 사용될 수 있고, 현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터를 이용하여 유도될 수 있다. 또한, 움직임 벡터의 정확성을 높이기 위해서, 인코더에서 원본 영상으로 찾은 현재 블록의 최적의 움직임 벡터와 움직임 예측 값 간의 움직임 벡터의 차이(motion vector difference, mvd)가 시그널링될 수 있다.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.
움직임 벡터는 다양한 해상도를 가질 수 있으며, 블록 단위로 움직임 벡터의 해상도가 달라질 수 있다. 움직임 벡터 해상도는 정수 단위, 반화소 단위, 1/4 화소 단위, 1/16 화소 단위, 4의 정수 화소 단위 등으로 표현될 수 있다. 스크린 콘텐츠와 같은 영상은 문자와 같은 단순한 그래픽 형태이므로 보간(interpolation) 필터를 적용하지 않아도 되므로, 정수 단위와 4의 정수 화소 단위가 블록 단위 선택적으로 적용될 수 있다. 회전 및 스케일을 표현할 수 있는 어파인(Affine) 모드로 부호화된 블록은 형태의 변화가 심하므로, 정수 단위, 1/4 화소 단위, 1/16 화소 단위가 블록 기반 선택적으로 적용될 수 있다. 블록 단위로 움직임 벡터 해상도를 선택적으로 적용할 지에 대한 여부 정보는 amvr_flag으로 시그널링된다. 만일 적용되는 경우, 어떠한 움직임 벡터 해상도를 현재 블록에 적용할지는 amvr_precision_idx으로 시그널링된다.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.
양방향 예측이 적용되는 블록의 경우, 가중치 평균을 적용할 때 2개의 예측 블록 간의 가중치를 같거나 또는 다르게 적용할 수 있으며, 가중치에 대한 정보는 bcw_idx를 통해 시그널링된다. For blocks to which bidirectional prediction is applied, when applying weight average, the weights between the two prediction blocks can be applied the same or different, and information about the weights is signaled through bcw_idx.
움직임 예측 값의 정확도를 높이기 위해서, 머지(Merge) 또는 AMVP(dvanced motion vector prediction) 방법이 블록 단위 선택적으로 사용될 수 있다. Merge 방법은 현재 블록의 움직임 정보를 현재 블록에 인접한 주변 블록의 움직임 정보와 동일하게 구성하는 방법으로, 동질성을 갖는 움직임 영역에서 움직임 정보가 변화없이 공간적으로 전파됨으로써 움직임 정보의 부호화 효율을 증가시키는 장점이 있다. 반면에 AMVP 방법은 정확한 움직임 정보를 표현하기 위해 L0 및 L1 예측 방향으로 각각 움직임 정보를 예측하고 가장 최적의 움직임 정보를 시그널링하는 방법이다. 디코더는 AMVP 또는 Merge 방법을 통해 현재 블록에 대한 움직임 정보를 유도한 후, 참조 픽쳐(reference picture)에서 유도한 움직임 정보에 위치한 참조 블록을 현재 블록을 위한 예측 블록으로 사용한다. To increase the accuracy of motion prediction values, merge or advanced motion vector prediction (AMVP) methods can be selectively used on a block basis. 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. There is. On the other hand, 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.
Merge 또는 AMVP에서 움직임 정보를 유도하는 방법은 현재 블록의 주변 블록으로부터 유도된 움직임 예측 값을 사용하여 움직임 후보 리스트를 구성한 후, 최적의 움직임 후보에 대한 인덱스 정보가 시그널링되는 방법일 수 있다. AMVP의 경우, L0와 L1 각각 움직임 후보 리스트가 유도되므로, L0와 L1 각각에 대한 최적의 움직임 후보 인덱스(mvp_l0_flag, mvp_l1_flag)가 시그널링된다. Merge의 경우, 하나의 움직임 후보 리스트가 유도되므로, 하나의 머지 인덱스(merge_idx)가 시그널링된다. 하나의 코딩 유닛에서 유도되는 움직임 후보 리스트는 다양할 수 있으며, 각 움직임 후보 리스트마다 움직임 후보 인덱스 또는 머지 인덱스가 시그널링될 수 있다. 이때, Merge 모드로 부호화된 블록에서 잔여 블록에 대한 정보가 없는 모드를 머지 스킵(MergeSkip) 모드라고 할 수 있다. 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. In the case of 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. In the case of Merge, since one motion candidate list is derived, 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.
본 명세서의 움직임 후보와 움직임 정보 후보는 서로 동일한 의미일 수 있다. 또한, 본 명세서의 움직임 후보 리스트와 움직임 정보 후보 리스트는 서로 동일한 의미일 수 있다.In this specification, 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)는 양방향 예측(bi-directional prediction)의 경우에, L0 방향과 L1 방향의 MVD(Motion Vector Difference) 값이 대칭을 이루도록 하여 전송되는 움직임 정보의 비트량을 줄이는 방법이다. L0 방향과 대칭을 이루는 L1 방향의 MVD 정보는 전송되지 않으며, L0 및 L1 방향의 참조 픽쳐 정보도 전송되지 않고 복호화 과정에서 유도될 수 있다.SMVD (Symmetric MVD) is a method of reducing the amount of bits of transmitted motion information by ensuring that the MVD (Motion Vector Difference) values in the L0 and L1 directions are symmetrical in the case of bi-directional prediction. MVD information in the L1 direction, which is symmetrical to the L0 direction, is not transmitted, and reference picture information in the L0 and L1 directions is also not transmitted and can be derived during the decoding process.
OBMC(Overlapped Block Motion Compensation)는 블록 간의 움직임 정보가 서로 다른 경우, 주변 블록들의 움직임 정보를 사용하여 현재 블록에 대한 예측 블록들을 생성한 후, 예측 블록들을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성하는 방법이다. 이는 움직임 보상된 영상의 블록 경계에서 발생되는 블록킹 현상을 줄여주는 효과가 있다.OBMC (Overlapped Block Motion Compensation) generates prediction blocks for the current block using the motion information of neighboring blocks when the motion information between blocks is different, and then weight averages the prediction blocks to create the final prediction block for the current block. How to create it. This has the effect of reducing the blocking phenomenon that occurs at the block boundaries of motion compensated images.
일반적으로 머지 움직임 후보는 움직임의 정확도가 낮다. 이러한 머지 움직임 후보의 정확도를 높이기 위해서, MMVD(Merge mode with MVD) 방법이 사용될 수 있다. MMVD 방법은 몇 개의 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 이용하여 움직임 정보를 보정하는 방법이다. MMVD 방법을 통해 획득되는 움직임 정보의 보정 값에 대한 정보(예를 들어, 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 지시하는 인덱스 등)은 비트스트림에 포함되어 디코더로 전송될 수 있다. 기존의 움직임 정보 차분 값이 비트스트림에 포함되는 것에 비해 움직임 정보의 보정 값에 대한 정보가 비트스트림에 포함됨으로써 비트량은 절약될 수 있다.In general, merge movement candidates have low movement accuracy. To increase the accuracy of these merge motion candidates, the MMVD (Merge mode with MVD) method can be used. 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 (for example, an index indicating one candidate selected from motion difference value candidates, etc.) may be included in the bitstream and transmitted to the decoder. Compared to the existing motion information difference value being included in the bitstream, the amount of bits can be saved by including information on the correction value of the motion information in the bitstream.
TM(Template Matching) 방법은 현재 블록의 주변 화소를 통해 템플릿을 구성하여 템플릿과 가장 유사도가 높은 매칭 영역을 찾아서 움직임 정보를 보정하는 방법이다. TM(Template matching)은 부호화되는 비트스트림의 크기를 줄이기 위해서, 움직임 정보를 비트스트림에 포함하지 않고 디코더에서 움직임 예측을 수행하는 방법이다. 이때, 디코더는 원본 영상이 없으므로 이미 복원된 주변 블록을 사용하여 현재 블록에 대한 움직임 정보를 개략적으로 유도할 수 있다.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.
DMVR(Decoder-side Motion Vector Refinement) 방법은 조금 더 정확한 움직임 정보를 찾기 위해 이미 복원된 참조 영상들의 상관성을 통해 움직임 정보를 보정하는 방법으로써, 현재 블록의 양방향 움직임 정보를 사용하여 2개의 참조 픽쳐의 임의의 정해진 영역 내에서 참조 픽쳐 내의 참조 블록 간의 가장 매칭이 잘되는 지점을 새로운 양방향 움직임으로 사용하는 방법이다. 이러한 DMVR이 수행될 때, 인코더는 하나의 블록 단위에서 DMVR을 수행하여 움직임 정보를 보정한 후, 다시 블록을 서브 블록으로 분할하여 각 서브 블록 단위에서 DMVR을 수행하여 서브 블록의 움직임 정보를 다시 보정할 수 있으며, 이를 MP-DMVR(Multi-pass DMVR)이라 할 수 있다. 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. When such DMVR is performed, 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).
LIC(Local Illumination Compensation) 방법은 블록 간의 휘도 변화를 보상하는 방법으로, 현재 블록에 인접한 주변 화소들을 사용하여 선형 모델을 유도한 후, 선형 모델을 통해 현재 블록의 휘도 정보를 보상하는 방법이다.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.
기존 비디오 부호화 방법들은 상하좌우의 평행 이동만을 고려한 움직임 보상을 수행하기 때문에, 현실에서 일반적으로 접하는 확대, 축소, 회전 등과 같은 움직임 포함하고 있는 비디오들의 부호화 시 부호화 효율이 저하된다. 이러한 확대, 축소, 회전에 대한 움직임을 표현하기 위하여, 4개(회전) 또는 6개(확대, 축소, 회전) 파라미터 모델을 이용하는 Affine 모델 기반 움직임 예측 기술이 적용될 수 있다.Existing video coding methods perform motion compensation considering only horizontal, vertical, and horizontal movements, so coding efficiency deteriorates when coding videos that include movements such as enlargement, reduction, and rotation that are commonly encountered in reality. To express such movements for enlargement, reduction, and rotation, an Affine model-based motion prediction technology that uses a 4 (rotation) or 6 (enlargement, reduction, rotation) parameter model can be applied.
BDOF(Bi-Directional Optical Flow)는 양방향 움직임으로 구성된 블록의 참조 블록으로부터 광-흐름(optical-flow) 기반으로 화소의 변화량을 추정하여 예측 블록을 보정하는데 사용된다. 이러한 VVC의 BDOF에서 유도된 움직임 정보를 이용하여 현재 블록의 움직임을 보정할 수 있다.BDOF (Bi-Directional Optical Flow) is used to correct the prediction block by estimating the amount of pixel change based on optical-flow from the reference block of the block composed of bi-directional movement. The motion of the current block can be corrected using motion information derived from the BDOF of the VVC.
PROF(Prediction refinement with optical flow)는 서브 블록 단위 Affine 움직임 예측의 정확도를 픽셀 단위 움직임 예측의 정확도와 유사하도록 개선하기 위한 기술이다. PROF는 BDOF와 유사하게 광-흐름(optical-flow)에 기반하여 서브 블록 단위로 Affine 움직임 보상된 픽셀 값들에 대해 픽셀 단위로 보정 값을 계산하여 최종 예측 신호를 획득하는 기술이다.PROF (Prediction refinement with optical flow) 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 on a pixel basis for affine motion compensated pixel values in sub-block units based on optical flow.
CIIP(Combined Inter-/Intra-picture Prediction)방법은 현재 블록에 대한 예측 블록을 생성할 때, 화면 내 예측 방법으로 생성한 예측 블록과 화면 간 예측 방법으로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성하는 방법이다.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 .
IBC(Intra Block Copy) 방법은 현재 블록과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾아서, 해당 참조 블록을 현재 블록에 대한 예측 블록으로 사용하는 방법이다. 이때, 현재 블록과 참조 블록 간의 거리인 블록 벡터(Block Vector)와 관련된 정보는 비트스트림에 포함될 수 있다. 디코더는 비스트스림에 포함된 블록 벡터와 관련된 정보를 파싱하여 현재 블록을 위한 블록 벡터를 계산하거나 설정할 수 있다.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 Beaststream.
BCW(Bi-prediction with CU-level Weights) 방법은 서로 다른 참조 픽쳐로 부터 움직임 보상된 두 개의 예측 블록에 대하여, 평균으로 예측 블록을 생성하지 않고, 블록 단위로 적응적으로 가중치를 적용하여 움직임 보상된 두 개의 예측 블록에 가중치 평균을 수행하는 방법이다.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.
Intra TMP(Template Matching Prediction) 방법은, 비디오 신호 처리 장치가 현재 블록에 인접한 주변 블록의 화소 값들을 사용하여 기준 템플릿이 구성하고, 구성된 기준 템플릿과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾은 후, 해당 참조 블록(이미 복원된 영역에서 찾은 부분)을 현재 블록에 대한 예측 블록으로 사용하는 방법이다In the Intra TMP (Template Matching Prediction) method, 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. Then, this is a method of using the reference block (part already found in the restored area) as a prediction block for the current block.
MHP(Multi-hypothesis prediction) 방법은 화면 간 예측 시 단방향 및 양방향 움직임 정보에 추가적인 움직임 정보를 전송함으로써, 다양한 예측 신호를 통한 가중치 예측을 수행하는 방법이다.The MHP (Multi-hypothesis prediction) method is a method of performing weight prediction through various prediction signals by transmitting additional motion information to unidirectional and bidirectional motion information when predicting between screens.
CCLM(Cross-component linear model)은 휘도 신호와 해당 휘도 신호와 동일한 위치에 있는 색차 신호 간의 높은 상관성을 이용하여 선형 모델을 구성한 후, 해당 선형 모델을 통해 색차 신호를 예측하는 방법이다. 현재 블록에 인접한 주변 블록 중에서 복원이 완료된 블록을 사용하여 템플릿을 구성한 후, 템플릿을 통해 선형 모델에 대한 파라미터가 유도된다. 다음으로, 영상 포맷에 따라 선택적으로 색차 블록의 크기에 맞게 복원된 현재 휘도 블록이 다운 샘플링된다. 마지막으로, 다운 샘플링된 휘도 블록과 해당 선형 모델을 이용하여 현재 블록의 색차 블록을 예측한다. 이때, 2개 이상의 선형 모델을 사용하는 방법을 MMLM(Multi-model Linear mode)이라고 한다.CCLM (Cross-component linear model) is a method of constructing a linear model using the high correlation between a luminance signal and a chrominance signal located at the same location as the luminance signal, and then predicting the chrominance signal through the linear model. After constructing a template using restored blocks among neighboring blocks adjacent to the current block, parameters for the linear model are derived through the template. Next, depending on the video format, the restored current luminance block is selectively down-sampled to fit the size of the chrominance block. Finally, the chrominance block of the current block is predicted using the down-sampled luminance block and the corresponding linear model. At this time, the method of using two or more linear models is called MMLM (Multi-model Linear mode).
독립 스칼라 양자화(independent scalar quantization)에서, 입력된 계수 tk에 대한 복원된 계수 t'k는 관련된 양자화 인덱스(quantization index) qk에만 의존적이다. 즉, 임의의 복원된 계수에 대한 양자화 인덱스(quantization index)는 다른 복원된 계수들에 대한 양자화 인덱스들과는 다른 값을 가진다. 이때 t'k는 tk에서 양자화 오차가 포함된 값일 수 있으며, 양자화 파라미터에 따라 서로 다르거나 또는 같을 수 있다. 여기서, t'k는 복원된 변환 계수 또는 역양자화된 변환계수라고 명명할 수 있으며, 양자화 인덱스를 양자화된 변환 계수라고 명명할 수도 있다.In independent scalar quantization, 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. At this time, 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. Here, t'k may be named a restored transform coefficient or a dequantized transform coefficient, and the quantization index may be named a quantized transform coefficient.
균일 복원 양자화(URQ; Uniform Reconstruction Quantizers)에서, 복원된 계수들은 동일한 간격으로 배치되는 특성을 지닌다. 이때 인접하는 두 복원 값들 사이의 거리를 양자화 단계 크기(quantization step size)라고 할 수 있다. 복원된 값 중에는 0을 포함할 수 있으며, 사용 가능한 복원 값들의 전체 집합(set)은 양자화 단계 크기에 따라 고유하게 정의될 수 있다. 양자화 단계 크기는 양자화 파라미터에 따라 달라질 수 있다.In Uniform Reconstruction Quantizers (URQ), the reconstructed coefficients have the characteristic of being arranged at equal intervals. At this time, 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.
기존 방법에서는 양자화로 인해 허용 가능한 복원된 변환 계수들의 집합(세트)이 감소하며, 이러한 집합의 원소(element)는 유한 개일 수 있다. 이로 인해, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하는데 한계가 존재한다. 이러한 평균적인 오차를 최소화하기 위한 방법으로 벡터 양자화(Vector Quantization)를 사용할 수 있다.In the existing method, 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.
비디오 부호화에서 사용되는 간단한 형태의 벡터 양자화 방법에는 부호 데이터 은닉(sign data hiding)이 있다. 이는 인코더에서 0이 아닌 하나의 계수에 대한 부호를 부호화하지 않고, 디코더에서는 해당 계수에 대한 부호를 모든 계수들에 대한 절대값의 합이 짝수인지 또는 홀수인지에 따라 결정하는 방법이다. 이를 위해 인코더에서는 적어도 하나의 계수가 '1'이 증가되거나 또는 감소될 수 있으며, 이는 율-왜곡(rate-distortion)에 대한 비용(Cost) 관점에서 최적이 되도록 적어도 하나의 계수가 선택되어 값이 조정될 수 있다. 실시 일 예로, 양자화 간격의 경계에 가까운 값을 가지는 계수가 선택될 수 있다.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)가 있으며, 비디오 부호화에서는 종속 양자화(dependent quantization)에서 최적화된 양자화 값을 얻기 위한 최적의 경로 탐색 기법으로 활용된다. 블록 단위로, 블록 내 모든 계수들에 대한 양자화 후보들을 트렐리스 그래프에 배치하고, 최적화된 양자화 후보들 간의 최적의 트렐리스 경로를 율-왜곡(rate-distortion)에 대한 비용(Cost)을 고려하여 탐색한다. 구체적으로, 비디오 부호화에 적용된 종속 양자화는 변환 계수에 대한 허용 가능한 복원된 변환 계수들의 집합이 복원 순서에서 현재 변환 계수에 선행하는 변환 계수의 값에 의존하도록 설계될 수 있다. 이때, 여러 개의 양자화기를 변환 계수에 따라 선택적으로 사용하게 함으로써, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하여 부호화 효율을 높이는 효과가 있다. 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. On a block basis, quantization candidates for all coefficients within a block are placed in a trellis graph, and the optimal trellis path between optimized quantization candidates is taken into account, taking into account the cost of rate-distortion. and explore. Specifically, dependent quantization applied to video encoding may be designed such that the set of acceptable 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.
인트라 예측 부호화 기술 중에서 MIP(Matrix Intra Prediction) 방법은 행렬 기반 인트라 예측 방법으로 현재 블록에 인접한 주변 블록의 픽셀로부터 방향성을 가지는 예측 방법과 달리, 주변 블록의 좌측 및 상단의 픽셀들을 미리 정의된 행렬 매트릭스와 오프셋 값을 이용하여 예측 신호를 구하는 방법이다.Among intra prediction coding technologies, 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 as a predefined matrix matrix. This is a method of obtaining a prediction signal using the and offset values.
현재 블록의 인트라 예측 모드를 유도하기 위해서, 현재 블록에 인접하면서 복원된 임의의 영역인 템플릿(template)을 기반으로, 해당 템플릿의 주변 픽셀을 통해 유도된 템플릿에 대한 인트라 예측 모드가 현재 블록의 복원을 위해 이용할 수 있다. 우선, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성하고, 이미 복원된 템플릿과 가장 유사한 예측 템플릿을 생성한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 이러한 방법을 TIMD(Template intra mode derivation)이라고 할 수 있다.In order to derive the intra prediction mode of the current block, based on a template, which is a random area restored while adjacent to the current block, 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. First, the decoder generates a prediction template for the template using surrounding pixels (references) adjacent to the template, and can use the intra prediction mode that generates the prediction template most similar to the already restored template to restore the current block. This method can be called TIMD (Template intra mode derivation).
일반적으로 인코더는 예측 블록을 생성하기 위한 예측 모드를 결정하여 결정된 예측 모드에 대한 정보가 포함된 비트스트림을 생성할 수 있다. 디코더는 수신한 비트스트림을 파싱하여 인트라 예측 모드를 설정할 수 있다. 이때, 예측 모드에 대한 정보의 비트량은 전체 비트스트림 크기의 10% 정도일 수 있다. 예측 모드에 대한 정보의 비트량을 감소시키기 위해 인코더는 비트스트림에 인트라 예측 모드에 대한 정보를 포함하지 않을 수 있다. 이에, 디코더는 주변 블록의 특성을 이용하여 현재 블록의 복원을 위한 인트라 예측 모드를 유도(결정)할 수 있고, 유도된 인트라 예측 모드를 이용하여 현재 블록을 복원할 수 있다. 이때, 디코더는 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 주변 화소(픽셀)들마다 소벨(Sobel) 필터를 가로 및 세로 방향으로 적용하여 방향성 정보를 유추한 후, 해당 방향성 정보를 인트라 예측 모드로 매핑하는 방법을 이용할 수 있다. 디코더가 주변 블록을 이용하여 인트라 예측 모드를 유도하는 방법은 DIMD(Decoder side intra mode derivation)로 기술될 수 있다.In general, 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. At this time, the bit amount of information about the prediction mode may be about 10% of the total bitstream size. In order to reduce the bit amount of information about the prediction mode, 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. At this time, in order to derive the intra prediction mode, the decoder applies a Sobel filter horizontally and vertically to each surrounding pixel (pixel) adjacent to the current block to infer directionality information, 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).
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다. Figure 7 is a diagram showing the positions of neighboring blocks used to construct a motion candidate list in inter prediction.
주변 블록들은 공간적인 위치의 블록이거나 시간적인 위치의 블록일 수 있다. 현재 블록에 공간적으로 인접한 주변 블록은 좌측(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)로 지칭될 수 있다.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). If a neighboring block temporally adjacent to the current block is encoded in intra mode or a neighboring block temporally adjacent to the current block exists in an unusable position, the horizontal and vertical dimensions of the current block in the picture corresponding to the current picture (Collocated picture) A block containing the center (Ctr) pixel position of can be used as a temporal neighboring block. Motion candidate information derived from the corresponding picture may be referred to as TMVP (Temporal Motion Vector Predictor). Only one TMVP can be derived from one block, and after dividing one block into several sub-blocks, each TMVP candidate can be derived for each sub-block. The TMVP derivation method on a sub-block basis may be referred to as sbTMVP (sub-block Temporal Motion Vector Predictor).
본 명세서에서 설명하는 방법들이 적용될 것인지 여부는 슬라이스 타입 정보 (예, I 슬라이스, P 슬라이스, B 슬라이스 인지 여부), 타일인지 여부, 서브 픽쳐인지 여부, 현재 블록의 크기, 코딩 유닛의 깊이, 현재 블록이 휘도 블록인지 색차 블록인지 여부, 참조 프레임인지 비참조 프레임인지 여부, 참조 순서 및 계층에 따른 시간적인 계층 등에 대한 정보들 중 적어도 어느 하나에 기초하여 결정될 수 있다. 본 명세서에서 설명하는 방법들이 적용될 것인지 여부를 결정하기 위해 사용되는 정보들은 디코더 및 인코더 간 미리 약속된 정보일 수 있다. 또한, 이러한 정보들은 프로파일 및 레벨에 따라 결정되어 있을 수 있다. 이러한 정보들은 변수 값으로 표현될 수 있고, 비트스트림에는 변수 값에 대한 정보가 포함될 수 있다. 즉, 디코더는 비트스트림에 포함된 변수 값에 대한 정보를 파싱하여 상술한 방법들이 적용되는지 여부를 결정할 수 있다. 예를 들어, 코딩 유닛의 가로의 길이 또는 세로의 길이에 기초하여 상술한 방법들이 적용될 것인지 여부가 결정될 수 있다. 가로의 길이 또는 세로의 길이가 32 이상(예, 32, 64, 128 등)이면 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 32 보다 작은 경우(예, 2, 4, 8, 16)에 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 4 또는 8인 경우 상술한 방법들은 적용될 수 있다.Whether the methods described herein will be applied depends on 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 the 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.
도 8은 본 발명의 일 실시예에 따른 DIMD를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.Figure 8 is a diagram showing the process of generating a prediction block using DIMD according to an embodiment of the present invention.
도 8을 참조하면 디코더는 주변 샘플(블록, 픽셀)을 이용하여 예측 블록을 유도할 수 있다. 이때, 주변 샘플은 현재 블록의 주변 블록(픽셀)일 수 있다. 구체적으로, 디코더는 주변 샘플을 입력으로 하여 방향성 정보(각도 정보)에 대한 히스토그램을 통해 현재 블록의 복원을 위한 인트라 예측 모드들 및 가중치 정보를 결정할 수 있다.Referring to FIG. 8, the decoder can derive a prediction block using surrounding samples (blocks, pixels). At this time, the neighboring sample may be a neighboring block (pixel) of the current block. Specifically, 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.
도 9는 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.Figure 9 is a diagram showing the positions of surrounding pixels used to derive directional information according to an embodiment of the present invention.
도 9(a)는 방향성 정보를 유도하기 위해 현재 블록의 주변 블록이 모두 사용 가능할 때를 나타내고, 도 9(b)는 현재 블록의 상측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타내고, 도 9(c)는 현재 블록의 좌측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타낸다. 한편 주변 블록과 현재 블록이 동일한 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU에 속해 있지 않다면, 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있다. 도 9의 회색 점은 실제 방향성 정보를 유도하기 위해 사용되는 픽셀의 위치를 나타내고, 점선은 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계를 나타낸다. 또한, 도 9(d) 내지 (f)를 참조하면 방향성 정보를 유도하기 위해서, 경계에 위치한 픽셀은 경계 밖으로 한 픽셀씩 패딩(padding)될 수 있다. 이러한 패딩을 통해 보다 더 정확한 방향성 정보의 유도가 가능할 수 있다.Figure 9(a) shows when all neighboring blocks of the current block are available to derive directional information, and Figure 9(b) shows that the upper border of the current block is divided into sub-pictures, slices, and It shows when it is a tile or CTU boundary, and Figure 9(c) shows when the left boundary of the current block is a sub-picture, slice, tile, or CTU boundary. Meanwhile, if 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. 9 indicate the positions of pixels used to derive actual directional information, and the dotted lines indicate sub-picture, slice, tile, and CTU boundaries. Additionally, referring to FIGS. 9(d) to 9(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.
특정 위치의 픽셀에 대한 방향성 정보를 유도하기 위해, 수학식 1의 3x3 크기의 소벨(Sobel) 필터가 가로 및 세로 방향으로 각각 적용될 수 있다. 수학식 1의 A는 3x3 크기의 현재 블록의 복원된 주변 블록들의 픽셀 정보(값)을 의미할 수 있다. 그리고 방향성 정보(θ)는 수학식 2를 이용하여 결정될 수 있다. 방향성 정보 유도를 위한 계산 복잡도를 감소시키기 위해, 디코더는 수학식 2의 atan 함수를 계산하지 않고 수학식 1의 Gy/Gx에 대한 계산만으로 방향성 정보(θ)를 유도할 수 있다.To derive directional information about a pixel at a specific location, a 3x3 Sobel filter of Equation 1 may 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. And the directional information (θ) can be determined using Equation 2. In order to reduce the computational complexity for deriving directional information, the decoder can derive directional information (θ) only by calculating Gy/Gx in Equation 1 without calculating the atan function in Equation 2.
Figure PCTKR2023012220-appb-img-000001
Figure PCTKR2023012220-appb-img-000001
Figure PCTKR2023012220-appb-img-000002
Figure PCTKR2023012220-appb-img-000002
도 9를 참조하면 방향성 정보는 도 9에 표시된 모든 회색 점마다 계산될 수 있고, 방향성 정보는 인트라 예측 모드의 각도에 매핑될 수 있다. 인트라 예측 모드 세트는 평면(Planar) 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향 모드들)을 포함할 수 있다. 인트라 예측 모드는 67가지의 모드들일 수 있는데, 수학식 2를 통해 계산된 방향성 정보(각도, θ)는 실수 단위의 값일 수 있다. 따라서, 방향성 정보를 특정 인트라 예측 방향성 모드에 매핑하는 과정이 필요하다. 본 명세서에서 기술하는 방향성 모드는 각도 모드와 동일할 수 있다.Referring to FIG. 9, directionality information can be calculated for every gray dot shown in FIG. 9, 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). There may be 67 intra prediction modes, and the directionality information (angle, θ) calculated through Equation 2 may be a value in real numbers. Therefore, a process of mapping directional information to a specific intra prediction directional mode is necessary. The directional mode described herein may be the same as the angular mode.
도 10은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.Figure 10 is a diagram showing a method for mapping a directional mode according to an embodiment of the present invention.
도 10을 참조하면 인트라 예측 방향성 모드는 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}일 수 있다. 이때, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도 간의 차이에 따라 다르게 설정될 수 있다. Referring to Figure 10, 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). Referring to FIG. 10, 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, and section 3 can be from 90 degrees to 135 degrees. . At this time, each section may include 16 intra prediction directional modes. In the directional mode, any one of four sections can be determined by comparing the signs and magnitudes of Gx and Gy calculated through Equation 1. For example, if Gx and Gy are positive numbers and the absolute value of Gx is greater than the absolute value of Gy, 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 closest value 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. Specifically, 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} . At this time, the difference between predefined table values may be set differently depending on the difference between the angles of the intra prediction directional mode.
한편, 계산 복잡도를 감소시키기 위해 atan 계산이 수행되지 않고 Gy/Gx만을 사용하여 방향성 각도를 구하는 경우, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도간 거리와 서로 불일치할 수 있다. atan는 입력 값이 증가할수록 기울기가 점점 낮아지는 특성이 있다. 따라서, 상기 정의된 테이블도 인트라 예측 방향성 모드의 각도 간의 차이뿐만 아니라 atan의 비선형 특성을 모두 고려하여 수치가 설정되어야 한다. 예를 들어, 상기 정의된 테이블 값들 간 차이는 점점 낮아지도록 설정될 수 있다. 반대로, 상기 정의된 테이블 값들 간 차이는 점점 높아지도록 설정될 수 있다.Meanwhile, if atan calculation is not performed to reduce computational complexity and the directional angle is obtained using only Gy/Gx, 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 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.
현재 블록의 가로와 세로의 길이가 다르다면, 사용할 수 있는 인트라 예측 방향성 모드가 달라질 수 있다. 즉, 현재 블록의 가로와 세로의 길이가 다르다면, 인트라 예측 방향성 모드를 유도하기 위한 구간이 달라질 수 있다. 다시 말하면 인트라 예측 방향성 모드를 유도하기 위한 구간은 현재 블록의 가로와 세로의 길이에 기초(예를 들어, 가로의 길이와 세로의 길이의 비율 등)하여 변경될 수 있다. 예를 들어, 현재 블록의 가로가 세로보다 긴 경우, 인트라 예측 모드는 67~80까지 재매핑될 수 있으며, 반대 방향의 인트라 예측 모드는 2~15까지 제외될 수 있다. 예를 들어, 현재 블록의 가로의 길이가 세로의 길이보다 n(정수)배 만큼 길다면(예를 들어 2배), 인트라 예측 모드 {3, 4, 5, 6, 7, 8}은 {67, 68, 69, 70, 71, 72}으로 각각 재설정(매핑)될 수 있다. 또한, 현재 블록의 가로의 길이가 세로의 길이보다 길다면, 인트라 예측 모드에 '65'를 더한 값으로 인트라 예측 모드가 재설정될 수 있다. 한편, 현재 블록의 가로의 길이가 세로의 길이보다 짧다면, 인트라 예측 모드에 '67'을 뺀 값으로 인트라 예측 모드가 재설정될 수 있다.If the horizontal and vertical lengths of the current block are different, 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. For example, if the horizontal length of the current block is n (integer) times longer than the vertical length (e.g. 2 times), the intra prediction mode {3, 4, 5, 6, 7, 8} is {67, 68, 69, 70, 71, 72} can be reset (mapped) respectively. Additionally, if the horizontal length of the current block is longer than the vertical length, the intra prediction mode may be reset to a value obtained by adding '65' to the intra prediction mode. Meanwhile, if the horizontal length of the current block is shorter than the vertical length, the intra prediction mode may be reset to the value of the intra prediction mode minus '67'.
현재 블록의 복원을 위한 인트라 예측 방향성 모드를 유도하기 위해 히스토그램이 사용될 수 있다. 주변 블록들에 대한 방향성 정보를 획득한 결과, 방향성이 존재하는 블록보다 방향성이 존재하지 않는 블록이 많은 경우, 방향성이 존재하지 않는 블록에 대한 예측 모드가 히스토그램상 누적 값이 가장 높을 수 있다. 그러나, 현재 블록의 복원을 위해서는 방향성 모드를 유도하여야 하므로, 히스토그램상 누적 값이 가장 높더라도 방향성이 존재하지 않는 블록에 대한 예측 모드는 제외될 수 있다. 즉, 주변 픽셀 간 변화도가 없거나 방향성이 없는 완만한 영역은 인트라 예측 방향성 모드를 유도하기 위해 사용되지 않을 수 있다. 예를 들어 방향성이 존재하지 않는 블록에 대한 예측 모드는 평면 모드, DC 모드 일 수 있다. 만일 좌측 주변 블록이 평면 모드 또는 DC 모드인 경우, 좌측 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있으며, 상측 주변 블록만을 사용하여 방향성 정보는 유도될 수 있다. 현재 블록의 주변 블록들에 완만한 영역과 방향성이 존재하는 영역이 혼재하는 경우, 디코더는 방향성을 강조하기 위해 수학식 3과 같이 계산된 G 값을 이용하여 히스토그램을 생성할 수 있다. 이때 히스토그램은 발생된 인트라 예측 방향성 모드마다 '1'만큼 더해지는 빈도수 기반이 아닌, 발생된 인트라 예측 방향성 모드마다 상기 계산된 G 값이 더해지는 누적 값일 수 있다. A histogram can be used to derive an intra prediction directional mode for reconstruction of the current block. As a result of obtaining directionality information about neighboring blocks, if there are more blocks without directionality than blocks with directionality, the prediction mode for the block without directionality may have the highest cumulative value on the histogram. However, since a directional mode must be derived to restore the current block, the prediction mode for a block without directionality can be excluded even if the cumulative value on the histogram is the highest. In other words, a gentle area with no gradient or directionality between neighboring pixels may not be used to derive an intra prediction directionality mode. For example, the prediction mode for a block without directionality may be a planar mode or a DC mode. If the left neighboring block is in planar mode or 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. If the surrounding blocks of the current block contain a mixture of gentle areas and areas with directionality, 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 PCTKR2023012220-appb-img-000003
Figure PCTKR2023012220-appb-img-000003
도 11은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.Figure 11 is a diagram showing a histogram for deriving an intra prediction directional mode according to an embodiment of the present invention.
도 11의 X축은 인트라 예측 방향성 모드를 나타내고, Y축은 G 값들의 누적 값을 나타낸다. 디코더는 인트라 예측 방향성 모드들 중에서 G 값들의 누적 값이 가장 큰 인트라 예측 방향성 모드를 선택할 수 있다. 다시 말하면, 디코더는 누적 값에 기초하여 현재 블록에 대한 인트라 예측 방향성 모드를 선택할 수 있다. 도 11을 참조하면 누적 값이 가장 큰 modeA와 두 번째로 큰 modeB가 인트라 예측 방향성 모드로 선택될 수 있다. 디코더는 현재 블록에 대한 예측 블록을 생성하기 위해, modeA로 생성한 예측 블록과 modeB로 생성한 예측 블록, 마지막으로 평면 모드로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때, 각 예측 블록의 가중치는 modeA와 modeB의 누적 값을 이용하여 결정될 수 있다. 예를 들어, 평면 모드로 생성한 예측 블록에 대한 가중치는 전체 가중치의 1/3로 설정될 수 있다. modeA로 생성한 예측 블록에 대한 가중치는 modeA와 modeB의 누적 값을 더한 것에서 modeA 누적 값을 나눈 값에 해당하는 가중치로 설정될 수 있다. modeB로 생성한 예측 블록에 대한 가중치는 전체 가중치에서 modeA 가중치와 전체 가중치의 1/3값을 차분한 값으로 결정될 수 있다. 가중치에 대한 계산을 보다 정확하게 하기 위해 디코더는 modeA로 생성한 예측 블록에 대한 가중치에 임의의 값을 곱하여 가중치의 범위를 확장할 수 있다. modeB로 생성한 예측 블록에 대한 가중치 및 평면 모드로 생성한 예측 블록에 대한 가중치도 동일하게 확장될 수 있다.The X-axis of FIG. 11 represents the intra prediction directional mode, and 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 directionality mode for the current block based on the accumulated value. Referring to FIG. 11, modeA with the largest cumulative value and modeB with the second largest cumulative value may be selected as the intra prediction directional mode. In order to generate a prediction block for the current block, 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. At this time, the weight of each prediction block can be determined using the accumulated values of modeA and modeB. For example, 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 generated by modeB can be determined as the difference between the modeA weight and 1/3 of the total weight from the total weight. In order to calculate the weight more accurately, 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.
도 12는 본 발명의 일 실시예에 따른 DIMD 모드를 시그널링하는 방법을 나타낸 도면이다.Figure 12 is a diagram showing a method of signaling DIMD mode according to an embodiment of the present invention.
구체적으로 도 12는 DIMD 모드의 적용 여부에 대한 신택스 요소를 비트스트림에 저장하여 디코더로 전달하는데 사용하는 시그널링 방법을 나타낸다. 도 12를 참조하면, 현재 블록에 대한 예측 블록을 생성하기 위해 DIMD 모드가 사용되는지 여부에 대한 신택스 요소(cu_dimd_flag)는, 현재 블록의 부호화 모드가 인트라 모드이고 SPS에서 설정되는 DIMD 모드의 활성화 여부에 대한 신택스 요소(sps_dimd_enabled_flag)가 DIMD 모드가 활성화됨을 나타내고(예, sps_dimd_enabled_flag의 값이 1인 경우), 현재 블록의 부호화 모드가 SKIP모드가 아니고 현재 블록이 휘도 블록이고 현재 블록이 인터 부호화 모드가 아닌 경우 파싱될 수 있다. 이때, cu_dimd_flag가 '1'이면 현재 블록은 DIMD 모드로 복호화됨을 나타낼 수 있고, cu_dimd_flag가 '0'이면 현재 블록은 DIMD 모드로 복호화 되지 않음을 나타낼 수 있다. 한편, cu_dimd_flag가 파싱되지 않는다면 cu_dimd_flag의 값은 '0'으로 설정될 수 있다. sps_dimd_enabled_flag는 프로파일, 티어 및 레벨 신택스(profile, tier and level syntax)에 포함되는 신택스 요소에 의해 제어될 수 있다. 예를 들어, sps_dimd_enabled_flag는 general_conatraints_info() syntax에 포함되는 신택스 요소인 gci_no_dimd_constraint_flag에 의해 제어될 수 있다. 다음과 같은 동작을 하도록 정의할 수 있다. gci_no_dimd_constraint_flag의 값이 1이면 OlsinScope 내의 모든 픽쳐들에 대한 sps_dimd_enabled_flag 값은 0일 수 있다. gci_no_dimd_constraint_flag의 값이 0이면 별도의 제약이 없을 수 있다 (gci_no_dimd_constraint_flag equal to 1 specifies that sps_dimd_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_dimd_constraint_flag equal to 0 does not impose such a constraint.).Specifically, Figure 12 shows a signaling method used to store syntax elements regarding whether to apply DIMD mode in a bitstream and transmit them to the decoder. Referring to FIG. 12, a syntax element (cu_dimd_flag) for whether the DIMD mode is used to generate a prediction block for the current block determines whether the encoding mode of the current block is intra mode and whether the DIMD mode set in the SPS is activated. If the syntax element (sps_dimd_enabled_flag) indicates that DIMD mode is activated (e.g., if the value of sps_dimd_enabled_flag is 1), the encoding mode of the current block is not SKIP mode, the current block is a luminance block, and the current block is not inter encoding mode. Can be parsed. At this time, if cu_dimd_flag is '1', it can indicate that the current block is decoded in DIMD mode, and if cu_dimd_flag is '0', it can indicate that the current block is not decoded in DIMD mode. Meanwhile, if cu_dimd_flag is not parsed, the value of cu_dimd_flag may be set to '0'. sps_dimd_enabled_flag can be controlled by syntax elements included in profile, tier and level syntax. For example, sps_dimd_enabled_flag can be controlled by gci_no_dimd_constraint_flag, a syntax element included in general_conatraints_info() syntax. It can be defined to perform the following actions. If the value of gci_no_dimd_constraint_flag is 1, the sps_dimd_enabled_flag value for all pictures in OlsinScope can be 0. If the value of gci_no_dimd_constraint_flag is 0, there may be no separate constraint (gci_no_dimd_constraint_flag equal to 1 specifies that sps_dimd_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_dimd_constraint_flag equal to 0 does not impose such a constraint.).
도 13은 본 발명의 일 실시예에 따른 DIMD 모드의 사용 여부에 따른 인트라 예측 모드와 관련된 신택스 요소를 시그널링하는 방법을 나타낸 도면이다.Figure 13 is a diagram showing a method of signaling syntax elements related to intra prediction mode depending on whether DIMD mode is used according to an embodiment of the present invention.
현재 블록이 DIMD 모드로 복호화되는 경우, 부호화 모드와 관련된 추가적인 정보(신택스 요소)들은 파싱되지 않을 수 있다. 도 13을 참조하면, cu_dimd_flag의 값이 1인 경우, 현재 블록의 부호화 모드와 관련된 추가적인 정보(예, intra_mip_flag, intra_subpartitions_mode_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder 등)는 파싱되지 않을 수 있다. 이후 잔차 신호가 존재하는 경우, 잔차 신호에 대한 변환 계수가 존재하는지 여부 및 잔차 신호와 관련된 신택스 요소들이 파싱될 수 있다.When the current block is decoded in DIMD mode, additional information (syntax elements) related to the encoding mode may not be parsed. Referring to FIG. 13, when the value of cu_dimd_flag is 1, additional information related to the encoding mode of the current block (e.g., intra_mip_flag, intra_subpartitions_mode_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, etc.) may not be parsed. Afterwards, if a residual signal exists, whether a transform coefficient for the residual signal exists and syntax elements related to the residual signal may be parsed.
도 14는 본 발명의 일 실시예에 따른 현재 블록을 복원하기 위한 예측 샘플을 생성하는 방법을 나타낸 도면이다.FIG. 14 is a diagram illustrating a method of generating a prediction sample for restoring a current block according to an embodiment of the present invention.
구체적으로, 도 14는 부호화 성능을 개선하기 위해 인트라 예측 모드를 보다 효과적으로 유도하여, 유도된 인트라 예측 모드를 이용하여 예측 샘플을 생성하는 과정을 나타낸 구조도이다. Specifically, FIG. 14 is a structural diagram showing a process for more effectively deriving an intra prediction mode to improve encoding performance and generating a prediction sample using the derived intra prediction mode.
도 14를 참조하면, 'prediction mode generator' 과정에서 디코더는 현재 블록에 인접한 주변 블록의 샘플(neighboring sample)들을 이용하여 현재 블록에 대한 인트라 예측 방향성 모드를 유도할 수 있다. 이때, 디코더는 인트라 예측 방향성 모드를 적어도 하나 이상 유도할 수 있으며, 각 모드에 대한 가중치를 유도할 수 있다. 예를 들어, 인트라 예측 방향성 모드를 유도하기 위해 디코더는 임의의 필터를 통해 주변 블록 샘플들의 방향성 정보를 유도하고 빈번하게 발생하는 방향성 정보들을 인트라 예측 방향성 모드로 결정하도록 하는 히스토그램 기반 방법을 사용할 수 있다. 또한, 인트라 예측 방향성 모드를 유도하기 위한 방법으로 현재 블록에 인접한 위쪽 픽셀만을 이용하여 현재 블록에 인접한 왼쪽 픽셀에 대한 인트라 예측 픽셀을 생성하여 가장 왜곡이 적은 인트라 예측 모드를 현재 블록을 위한 인트라 예측 방향성 모드로 결정하는 방법이 사용될 수도 있다.Referring to FIG. 14, in the 'prediction mode generator' process, the decoder can derive an intra prediction directional mode for the current block using samples of neighboring blocks adjacent to the current block. At this time, the decoder can derive at least one intra prediction directional mode and derive a weight for each mode. For example, to derive the intra prediction directionality mode, the decoder can use a histogram-based method to derive directionality information of neighboring block samples through a random filter and determine frequently occurring directionality information as the intra prediction directionality mode. . In addition, as a method to derive the intra prediction directionality mode, only the upper pixel adjacent to the current block is used to generate an intra prediction pixel for the left pixel adjacent to the current block, and the intra prediction mode with the least distortion is selected as the intra prediction directionality for the current block. A method of determining by mode may also be used.
도 14를 참조하면 'intra prediction' 과정에서는 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드들과 가중치를 이용하여 현재 블록에 대한 예측 블록들을 생성할 수 있다. 예측 블록들의 개수는 prediction mode generator 과정에서 유도된 인트라 예측 방향성 모드 개수에 따라 결정될 수 있다. 예를 들어, 유도된 인트라 예측 방향성 모드 개수가 2일 경우, 현재 블록에 대한 예측 블록은 2개일 수 있다. 'intra prediction' 과정에서 생성된 예측 블록들은 후술하는 방법을 이용한 PDPC(Position dependent intra prediction combination) 필터링이 적용될 수 있다.Referring to FIG. 14, in the 'intra prediction' process, prediction blocks for the current block can be generated using the intra prediction directional modes and weights derived in the 'prediction mode generator' process. The number of prediction blocks can be determined according to the number of intra prediction directional modes derived in the prediction mode generator process. For example, if the number of derived intra prediction directional modes is 2, there may be 2 prediction blocks for the current block. PDPC (Position dependent intra prediction combination) filtering using a method described later may be applied to the prediction blocks generated in the 'intra prediction' process.
'intra prediction' 과정에서 생성한 예측 블록들 각각에 PDPC(Position dependent intra prediction combination) 필터링이 적용될 수 있다. 예측 블록마다 PDPC 필터링이 적용되는 경우, 디코더 측면에서 복잡도가 높아질 수 있으므로, 예측 블록이 DIMD 모드로 예측된 경우, 해당 예측 블록에는 PDPC 필터링이 적용되지 않을 수 있다. 또한, 누적 값이 가장 큰 modeA와 두 번째로 큰 modeB 중 어느 하나에 대해서만 PDPC 필터링이 적용될 수 있다. 예를 들어, modeA에 대해서만 PDPC 필터링이 적용될 수 있다. 또한, 각 방향성 모드의 가중치에 따라 PDPC 필터링이 적용될지 여부가 결정될 수 있다. 예를 들어, modeA에 대한 가중치와 modeB에 대한 가중치의 차이에 기초하여 modeA 및 modeB 전부 또는 일부에 PDPC가 적용될 지 여부가 결정될 수 있다. 예를 들어, modeA에 대한 가중치와 modeB에 대한 가중치의 차이가 특정 값보다 작다면, modeA 및 modeB 모두에 PDPC 필터링이 적용될 수 있다. 또한, modeA에 대한 가중치와 modeB에 대한 가중치 각각을 특정 값과 비교하여 modeA 및 modeB에 PDPC 필터링이 적용되는지 여부가 결정될 수 있다. 가중치가 특정 값보다 크다면 해당 가중치의 방향성 모드에 PDPC 필터링이 적용될 수 있다. 예를 들어, modeA에 대한 가중치가 특정 값 이상이고, modeB에 대한 가중치가 특정 값보다 작다면, modeA에는 PDPC 필터링이 적용될 수 있고, modeB에는 PDPC 필터링이 적용되지 않을 수 있다. 또한, 방향성 모드와는 무관하게 weighted prediction 과정(도 14 참조)을 통해 가중치 평균이 적용된 최종 예측 블록에만 기 설정된 형태의 PDPC 필터링이 적용될 수 있다. 또한, 'weighted prediction' 과정에서 가중치 평균이 적용된 최종 예측 블록에 modeA를 사용하여 PDPC 필터링이 적용될 수 있다. 'weighted prediction' 과정에서 가중치 평균이 적용된 최종 예측 블록에 modeB를 사용하여 PDPC 필터링이 적용될 수 있다.Position dependent intra prediction combination (PDPC) filtering may be applied to each of the prediction blocks generated in the 'intra prediction' process. If PDPC filtering is applied to each prediction block, complexity may increase in terms of the decoder, so if a prediction block is predicted in DIMD mode, PDPC filtering may not be applied to the corresponding prediction block. Additionally, PDPC filtering can be applied only to either modeA, which has the largest cumulative value, or modeB, which has the second largest cumulative value. For example, PDPC filtering can be applied only for modeA. Additionally, whether PDPC filtering is applied may be determined depending on the weight of each directional mode. For example, it may be determined whether PDPC will be applied to all or part of modeA and modeB based on the difference between the weight for modeA and the weight for modeB. For example, if the difference between the weight for modeA and the weight for modeB is less than a certain value, PDPC filtering can be applied to both modeA and modeB. Additionally, it can be determined whether PDPC filtering is applied to modeA and modeB by comparing each of the weight for modeA and the weight for modeB with a specific value. If the weight is greater than a certain value, PDPC filtering can be applied to the directional mode of the weight. For example, if the weight for modeA is greater than a certain value and the weight for modeB is less than a certain value, PDPC filtering may be applied to modeA, and PDPC filtering may not be applied to modeB. Additionally, regardless of the directional mode, a preset form of PDPC filtering can be applied only to the final prediction block to which the weighted average has been applied through the weighted prediction process (see FIG. 14). Additionally, in the 'weighted prediction' process, PDPC filtering can be applied using modeA to the final prediction block to which the weighted average is applied. In the 'weighted prediction' process, PDPC filtering can be applied using modeB to the final prediction block to which the weighted average is applied.
도 14를 참조하면 'other prediction' 과정에서 디코더는 현재 블록에 대한 예측 블록을 추가적으로 생성할 수 있다. 예를 들어, 디코더는 평면 모드, DC 모드, MIP(Matrix Intra Prediction) 중에서 적어도 하나 이상을 사용하여 인트라 예측 블록을 생성할 수 있다. 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드들 및 예측 방향성 각각에 대한 가중치 정보들, 현재 블록의 양자화 파라미터 정보, 현재 블록의 가로의 길이 또는 세로의 길이, 현재 블록이 휘도인지 색차인지 여부에 대한 정보, 현재 블록 주변의 인트라 예측 모드, 현재 블록 주변의 변환 계수의 존재 여부 정보들(도 14의 Additional information A, B, C에 해당할 수 있음) 중에서 적어도 하나 이상을 사용하여 'other prediction' 과정이 수행될지 여부가 결정될 수 있다. 이하에서 'other prediction' 과정이 수행되는지 여부를 결정하는 방법에 대해 설명한다.Referring to FIG. 14, in the 'other prediction' process, the decoder can additionally generate a prediction block for the current block. For example, the decoder may generate an intra prediction block using at least one of planar mode, DC mode, and Matrix Intra Prediction (MIP). Weight information for each of the intra prediction directionality modes and prediction directionality derived from the 'prediction mode generator' process, quantization parameter information of the current block, horizontal or vertical length of the current block, and whether the current block is luminance or chrominance. 'other prediction' using at least one of information about, intra prediction mode around the current block, and information about the presence or absence of transform coefficients around the current block (which may correspond to Additional information A, B, and C in FIG. 14) ' It can be decided whether the process will be performed or not. Below, we will explain how to determine whether the 'other prediction' process is performed.
'other prediction' 과정에서 디코더가 어떠한 모드(예, 평면, DC, MIP 모드 등)를 사용할지에 대한 정보는 미리 약속되어 있거나 SPS를 통해 시그널링 될 수 있다. 예를 들어, 디코더는 어떠한 모드를 사용할 지를 나타내는 신택스 요소(sps_dimd_default_mode)에 기초하여 모드를 결정할 수 있다. 디코더는 sps_dimd_default_mode의 값에 따라 평면 모드, DC 모드, MIP 모드 중 어떠한 모드를 사용할 것인지 결정할 수 있다. 예를 들어, sps_dimd_default_mode의 값이 '0'이면 평면 모드, sps_dimd_default_mode의 값이 '1'이면 DC 모드, sps_dimd_default_mode의 값이 0과 1이 아닌 다른 값이면 MIP 모드를 사용도록 지시할 수 있다. 또한, 현재 블록이 휘도 블록이고 주변 블록의 변환 계수가 존재할 경우, 디코더는 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다. 현재 블록이 색차 블록이고, 주변 블록의 변환 계수가 존재하지 않는 경우, 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다. 또한, 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드들의 가중치가 서로 비슷하다면(예를 들어, 방향성 모드들 각각의 가중치 간 차이가 특정 임계 값보다 작은 경우 등), 'other prediction' 과정은 수행되지 않을 수 있다. 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드들의 가중치가 서로 비슷하다면, 디코더는 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다(즉, 'other prediction' 과정이 수행됨). 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드들의 가중치 간 차이가 크다면(예를 들어, 방향성 모드들 각각의 가중치 간 차이가 특정 임계 값보다 큰 경우) 주변 블록의 픽셀간 변화가 많은 것을 의미하므로, 디코더는 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다. 또한, 현재 블록의 가로와 세로의 길이가 서로 다르다면 디코더는 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다. 반대로, 현재 블록의 가로와 세로의 길이가 동일할 때 디코더는 평면 모드, DC 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 예측 블록을 생성할 수 있다.In the 'other prediction' process, information about which mode (e.g., planar, DC, MIP mode, etc.) the decoder will use may be pre-arranged or signaled through SPS. For example, the decoder can determine the mode based on a syntax element (sps_dimd_default_mode) indicating which mode to use. The decoder can decide which mode to use among planar mode, DC mode, and MIP mode depending on the value of sps_dimd_default_mode. For example, if the value of sps_dimd_default_mode is '0', you can instruct to use flat mode, if the value of sps_dimd_default_mode is '1', you can instruct to use DC mode, and if the value of sps_dimd_default_mode is a value other than 0 and 1, you can instruct to use MIP mode. Additionally, if the current block is a luminance block and transform coefficients of neighboring blocks exist, the decoder may generate a prediction block using at least one of planar mode, DC mode, and MIP mode. If the current block is a chrominance block and the transform coefficient of the surrounding block does not exist, a prediction block can be generated using at least one of planar mode, DC mode, and MIP mode. Additionally, if the weights of the intra prediction directional modes derived in the 'prediction mode generator' process are similar to each other (for example, if the difference between the weights of each directional mode is smaller than a certain threshold, etc.), the 'other prediction' process It may not be performed. If the weights of the intra prediction directional modes derived in the 'prediction mode generator' process are similar to each other, the decoder can generate a prediction block using at least one of the planar mode, DC mode, and MIP mode (i.e., 'other prediction ' process is performed). If the difference between the weights of the intra-prediction directional modes derived in the 'prediction mode generator' process is large (for example, if the difference between the weights of each directional mode is larger than a certain threshold), there is a lot of change between pixels in the surrounding blocks. Therefore, the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode. Additionally, if the horizontal and vertical lengths of the current block are different, the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode. Conversely, when the horizontal and vertical lengths of the current block are the same, the decoder can generate a prediction block using at least one of planar mode, DC mode, and MIP mode.
'weighted prediction' 과정에서 디코더는 'intra prediction', 'other prediction' 과정에서 생성된 여러 개의 인트라 예측 블록들을 가중치 평균하여 하나의 예측 샘플을 생성할 수 있다. 인트라 예측 블록들 각각에 대한 가중치는 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드 및 가중치 정보, 현재 블록의 양자화 파라미터 정보, 현재 블록의 가로 또는 세로의 길이, 현재 블록이 휘도 또는 색차인지 여부 정보, 현재 블록 주변의 인트라 예측 모드, 현재 블록 주변의 변환 계수의 존재 여부 정보들 중에서 적어도 하나 이상에 기초하여 결정될 수 있다.In the 'weighted prediction' process, the decoder can generate one prediction sample by averaging the weights of multiple intra prediction blocks generated in the 'intra prediction' and 'other prediction' processes. The weight for each intra prediction block is the intra prediction directional mode and weight information derived from the 'prediction mode generator' process, the quantization parameter information of the current block, the horizontal or vertical length of the current block, and whether the current block is luminance or chrominance. It may be determined based on at least one of information, an intra prediction mode around the current block, and information about the presence or absence of a transform coefficient around the current block.
도 15는 본 발명의 일 실시예에 따른 인트라 예측 모드를 결정하는 방법을 나타낸 도면이다.Figure 15 is a diagram showing a method for determining an intra prediction mode according to an embodiment of the present invention.
도 15는 도 14의 'prediction mode generator' 과정을 보다 자세히 나타낸다. 도 15를 참조하면 도 14의 'prediction mode generator' 과정은 히스토그램 분석을 통해 인트라 예측 방향성을 유도할 수 있다. 구체적으로 도 15의 'Histogram analysis' 과정에서 디코더는 현재 블록에 인접한 주변 샘플들을 이용하여 획득되는 히스토그램 분석하여 인트라 예측 방향성을 유도할 수 있다. 이때, 디코더는 현재 블록의 가로의 길이, 세로의 길이, 양자화 파라미터 정보, 현재 블록의 주변 블록들 중에서 가능한 인트라 예측 방향성 모드 정보, 현재 블록의 주변 블록의 잔차 신호의 존재 여부 정보, 현재 블록이 휘도 블록인지 색차 블록인지에 대한 정보들 중에서 적어도 하나 이상을 사용하여 현재 블록에 대한 인트라 예측 방향성 모드와 가중치를 유도할 수 있다. 이하에서 현재 블록에 대한 인트라 예측 방향성 모드와 가중치를 유도하는 방법에 대해 설명한다.Figure 15 shows the 'prediction mode generator' process of Figure 14 in more detail. Referring to FIG. 15, the 'prediction mode generator' process of FIG. 14 can derive intra prediction directionality through histogram analysis. Specifically, in the 'Histogram analysis' process of FIG. 15, the decoder can derive intra prediction directionality by analyzing the histogram obtained using surrounding samples adjacent to the current block. At this time, the decoder determines the horizontal length and vertical length of the current block, quantization parameter information, possible intra prediction direction mode information among neighboring blocks of the current block, information on the presence or absence of residual signals in neighboring blocks of the current block, and the luminance of the current block. The intra prediction directionality mode and weight for the current block can be derived using at least one of the information about whether it is a block or a color difference block. Below, a method for deriving the intra prediction directionality mode and weight for the current block will be described.
인트라 예측 방향성 모드는 빈도수에 기초하여 설정될 수 있다. 디코더는 주변 블록에 대한 인트라 예측 방향성 모드에 대한 히스토그램을 획득하고, 히스토그램을 분석하여 빈번하게 발생하는 인트라 예측 방향성 모드와 두 번째로 빈번하게 발생하는 모드를 예측 방향성 모드로 선택할 수 있다. 또한, 인트라 예측 방향성 모드는 누적 값(예, 도 11의 G 값)에 기초하여 설정될 수 있다. 디코더는 인트라 예측 방향성 모드 각각에 G값이 더해진 누적 값으로 획득되는 히스토그램을 분석하여 가장 높은 가중치를 가지는 인트라 예측 방향성 모드와 두 번째로 큰 가중치를 가지는 모드를 예측 방향성 모드로 선택할 수 있다. 또한, 디코더는 주변 블록의 인트라 예측 방향성 모드간 거리 및 G값이 더해진 누적 값 기반으로 인트라 예측 방향성 모드를 선택할 수 있다. 방향성 모드간 거리는 방향성 모드의 인덱스 차이를 의미할 수 있다. 예를 들어, 인덱스 66의 방향성 모드와 인덱스 2의 방향성 모드간 거리 차이는 64가 될 수 있다. 또는 방향성 모드의 인덱스는 66이 마지막 인덱스이므로, 인덱스 66의 방향성 모드와 인덱스 2의 방향성 모드간 거리 차이는 2일 수 있다. 디코더는 주변 블록에 대한 인트라 예측 방향성 모드들 각각에 G값이 더해진 누적 값으로 히스토그램을 획득하고 히스토그램을 분석하여, 가장 높은 누적 값을 가지는 인트라 예측 방향성 모드를 먼저 선택할 수 있다. 다음으로 디코더는 가장 높은 누적 값을 제외한 나머지 누적 값에 대응되는 모드들(예를 들어, 두 번째로 높은 누적 값을 가지는 모드, 세 번째로 높은 누적 값을 가지는 모드, 네 번째로 높은 누적 값을 가지는 모드 등) 중에서 가장 높은 누적 값을 가지는 모드와 방향성 모드간 거리가 가장 적은 모드(가장 가까운 모드)를 사용할 수 있다. 한편, 디코더는 가장 높은 누적 값을 가지는 인트라 예측 방향성 모드를 먼저 선택하고, 디코더는 가장 높은 누적 값을 제외한 나머지 누적 값에 대응되는 모드들(예를 들어, 두 번째로 높은 누적 값을 가지는 모드, 세 번째로 높은 누적 값을 가지는 모드, 네 번째로 높은 누적값을 가지는 모드 등) 중에서 가장 높은 누적 값을 가지는 모드와 방향성 모드간 거리가 가장 큰 모드(가장 멀리 떨어진 모드)를 사용할 수 있다. 상기 각각의 인트라 예측 방향성 모드에 대한 누적 값은 'Histogram analysis' 과정에서 최종적으로 결정된 인트라 예측 방향성 모드들에 대한 가중치를 결정할 때 사용될 수 있다.Intra prediction directional mode can be set based on frequency. The decoder can obtain a histogram for the intra prediction directionality mode for a neighboring block, analyze the histogram, and select the frequently occurring intra prediction directionality mode and the second most frequently occurring mode as the prediction directionality mode. Additionally, the intra prediction directional mode may be set based on an accumulated value (eg, G value in FIG. 11). The decoder can select the intra prediction directionality mode with the highest weight and the mode with the second highest weight as the prediction directionality mode by analyzing the histogram obtained as the cumulative value obtained by adding the G value to each of the intra prediction directionality modes. Additionally, the decoder can select the intra prediction directionality mode based on the cumulative value of the distance between the intra prediction directionality modes of neighboring blocks and the G value. The distance between directional modes may mean the index difference of the directional modes. For example, the distance difference between the directional mode of index 66 and the directional mode of index 2 may be 64. Alternatively, since 66 is the last index of the directional mode, the distance difference between the directional mode at index 66 and the directional mode at index 2 may be 2. The decoder can obtain a histogram with the cumulative value of each of the intra prediction direction modes for the neighboring block with the G value added, analyze the histogram, and select the intra prediction direction mode with the highest cumulative value first. Next, the decoder selects the modes corresponding to the remaining cumulative values except the highest cumulative value (e.g., the mode with the second highest cumulative value, the mode with the third highest cumulative value, and the fourth highest cumulative value). The mode with the highest cumulative value and the mode with the smallest distance between directional modes (closest mode) can be used. Meanwhile, the decoder first selects the intra prediction directional mode with the highest cumulative value, and the decoder selects the modes corresponding to the remaining cumulative values excluding the highest cumulative value (e.g., the mode with the second highest cumulative value, Among the modes with the third highest cumulative value, the mode with the fourth highest cumulative value, etc.), the mode with the highest cumulative value and the mode with the largest distance between directional modes (the mode that is farthest away) can be used. The cumulative value for each intra prediction directional mode can be used when determining weights for the intra prediction directional modes finally determined in the 'Histogram analysis' process.
도 15의 디코더가 'Histogram analysis' 과정에서 유도한 현재 블록에 대한 인트라 예측 방향성 모드는 2개 이상일 수 있다. 'Histogram analysis'에서 유도된 인트라 예측 방향성 모드가 2개 이상인 경우, 각 인트라 예측 방향성 모드간 거리는 서로 비슷하거나 다를 수 있다. 또한, 인트라 예측 방향성 모드간 누적 값들도 각각 서로 비슷하거나 다를 수 있다. 따라서, 현재 블록에 대한 최적의 예측 샘플을 유도하기 위해서는 다양한 모드 조합 중에서 가장 최적의 조합이 선택되어야 한다. 또한, 디코더는 현재 블록에 대한 최적의 예측 샘플을 유도하기 위해 도 14의 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드뿐만 아니라 'other prediction'에서 유도된 부호화 모드도 조합할 수 있다. 이러한 조합에 대한 정보는 비트스트림에 포함될 수 있다. 본 명세서에서 기술하는 모드 조합은 mode A, mode B, 평면 모드, DC 모드, MIP 모드 중 하나를 사용하거나 일부 또는 전부를 조합하는 것을 의미할 수 있다.There may be two or more intra prediction directional modes for the current block derived by the decoder in FIG. 15 during the 'Histogram analysis' process. If there are two or more intra prediction directional modes derived from 'Histogram analysis', the distance between each intra prediction directional mode may be similar to or different from each other. Additionally, cumulative values between intra prediction directional modes may be similar to or different from each other. Therefore, in order to derive the optimal prediction sample for the current block, the most optimal combination must be selected among various mode combinations. In addition, the decoder can combine not only the intra prediction directional mode derived in the 'prediction mode generator' process of FIG. 14 but also the encoding mode derived in 'other prediction' to derive the optimal prediction sample for the current block. Information about this combination may be included in the bitstream. The mode combination described herein may mean using one of mode A, mode B, planar mode, DC mode, and MIP mode, or combining some or all of them.
다음으로, 도 15를 참조하면 디코더는 'Prediction mode analysis' 과정에서 'Histogram analysis' 과정에서 결정된 인트라 예측 모드들과 유도된 인트라 예측 모드들에 대응되는 가중치 정보를 이용하여, 현재 블록에 대한 최적의 예측 샘플을 유도하기 위한 최적의 조합을 선택할 수 있다. 구체적으로, 디코더는 유도된 인트라 예측 모드들과 이에 대응되는 가중치 정보를 이용하여 현재 블록에 대한 예측 샘플을 생성하기 위해 가중치 평균을 사용할지 여부, 어떠한 인트라 예측 모드를 사용할 것인지, 인트라 예측 모드에 대한 가중치를 어떻게 설정할 것인지에 대한 정보를 결정할 수 있다. 또한, 디코더는 'Prediction mode analysis' 과정에 있어, 'Histogram analysis' 과정에서 결정된 인트라 예측 모드들과 결정된 인트라 예측 모드들에 대응되는 가중치 정보 및 주변 블록의 인트라 예측 모드들 중에서 적어도 어느 하나를 이용하여 현재 블록에 대한 예측 샘플을 유도하기 위한 최적의 조합을 선택할 수 있다. 구체적으로, 디코더는 현재 블록에 대한 예측 샘플을 생성하기 위해 가중치 평균을 사용할지 여부, 어떠한 인트라 예측 모드를 사용할 것인지, 인트라 예측 모드에 대한 가중치를 어떻게 설정할 것인지에 대한 정보를 결정할 수 있다. 이때, 현재 블록의 가로의 길이 또는 세로의 길이, 양자화 파라미터 정보, 현재 블록의 주변 블록들 중에서 사용 가능한 인트라 예측 모드 정보, 현재 블록의 주변 블록의 잔차 신호의 존재 여부 정보, 현재 블록이 휘도 블록인지 색차 블록인지에 대한 정보들 중에서 적어도 하나 이상을 사용하여 현재 블록에 대한 예측 샘플을 생성하기 위한 최적의 조합 정보(Combination information for prediction modes)를 유도할 수 있다. 조합 정보에는 인트라 예측 방향성 모드 정보들과 인트라 예측 방향성 모드에 대한 가중치가 포함될 수 있다. 예를 들어, 유도된 2개의 인트라 예측 방향성 모드 중에서 가중치가 2번째 높은 모드의 가중치가 '0' 이거나 임의의 값 이내이면, 디코더는 현재 블록에 대한 예측 블록을 생성할 때 가중치 평균을 적용하지 않고, 가중치가 가장 높은 하나의 인트라 예측 방향성 모드만을 사용하여 예측 블록을 생성할 수 있다. 이때, 임의의 값은 1 이상의 정수로, 10일 수 있다. 또한, 유도된 2개의 인트라 예측 방향성 모드 중에서 적어도 하나가 DC 모드, Planar 모드 또는 MIP 모드인 경우(즉, 방향성 모드가 아닌 경우), 디코더는 현재 블록에 대한 예측 블록을 생성할 때 가중치 평균을 적용하지 않고, 가중치가 가장 높은 하나의 인트라 예측 방향성 모드만을 사용하여 예측 블록을 생성할 수 있다. 또한, 유도된 2개의 인트라 예측 모드 중에서 적어도 하나가 DC 모드, Planar 모드, MIP 모드인 경우(즉, 방향성 모드가 아닌 경우), 디코더는 현재 블록에 대한 예측 블록을 생성할 때 가중치 평균을 적용할 수 있다.Next, referring to FIG. 15, the decoder uses weight information corresponding to the intra prediction modes determined in the 'Histogram analysis' process and the derived intra prediction modes in the 'Prediction mode analysis' process to determine the optimal level for the current block. The optimal combination for deriving prediction samples can be selected. Specifically, the decoder uses the derived intra prediction modes and the corresponding weight information to determine whether to use weighted average to generate a prediction sample for the current block, which intra prediction mode to use, and information about the intra prediction mode. Information on how to set the weights can be determined. In addition, in the 'Prediction mode analysis' process, the decoder uses at least one of the intra prediction modes determined in the 'Histogram analysis' process, weight information corresponding to the determined intra prediction modes, and intra prediction modes of neighboring blocks. The optimal combination for deriving a prediction sample for the current block can be selected. Specifically, the decoder can determine whether to use a weighted average to generate a prediction sample for the current block, which intra prediction mode to use, and how to set the weights for the intra prediction mode. At this time, the horizontal or vertical length of the current block, quantization parameter information, available intra prediction mode information among neighboring blocks of the current block, information on the presence or absence of residual signals in neighboring blocks of the current block, and whether the current block is a luminance block. The optimal combination information for prediction modes for generating a prediction sample for the current block can be derived by using at least one of the information about whether it is a chrominance block. The combination information may include intra prediction directional mode information and weights for the intra prediction directional mode. For example, if the weight of the mode with the second highest weight among the two induced intra prediction directional modes is '0' or within a random value, the decoder does not apply weighted average when generating a prediction block for the current block. , a prediction block can be generated using only one intra prediction directional mode with the highest weight. At this time, the arbitrary value is an integer greater than 1 and may be 10. Additionally, if at least one of the two derived intra-prediction directional modes is DC mode, Planar mode, or MIP mode (i.e., not a directional mode), the decoder applies a weighted average when generating a prediction block for the current block. Instead, a prediction block can be generated using only one intra prediction directional mode with the highest weight. Additionally, if at least one of the two derived intra prediction modes is DC mode, Planar mode, or MIP mode (i.e., not directional mode), the decoder may apply weighted average when generating the prediction block for the current block. You can.
도 16은 본 발명의 일 실시예에 따른 DIMD와 관련된 신택스 요소들이 포함된 신택스 구조를 나타낸다.Figure 16 shows a syntax structure including syntax elements related to DIMD according to an embodiment of the present invention.
도 16을 참조하면, 현재 블록이 DIMD로 부호화 되었다면(즉, cu_dimd_flag의 값이 1인 경우), 디코더는 DIMD 조합 정보(예측 샘플 획득을 위해 조합되는 모드에 대한 정보, 모드 조합 정보)에 대한 신택스 요소(cu_dimd_mode)를 추가적으로 파싱할 수 있다. 이때, cu_dimd_mode는 조합되는 예측 모드의 개수에 따라 파싱되는 방법이 상이할 수 있다. 예를 들어, 디코더는 조합되는 개수가 '2'개일 경우, 1개의 빈(bin)만을 파싱할 수 있다. 이때, cu_dimd_mode의 값이 '0'일 경우, 디코더는 modeA와 modeB를 사용하여 예측 샘플을 생성할 수 있다. cu_dimd_mode의 값이 '1'일 경우, 디코더는 modeA와 modeB 그리고 평면 모드를 사용하여 예측 샘플을 생성하거나 modeA와 평면 모드를 사용하여 예측 샘플을 생성하거나 modeB와 평면 모드를 사용하여 예측 샘플을 생성할 수 있다. 조합되는 개수가 '4'개일 경우, 디코더는 2개의 빈(bin)을 파싱할 수 있다. 이때, cu_dimd_mode의 값이 '0'일 경우, 디코더는 modeA와 modeB를 사용하여 예측 샘플을 생성할 수 있다. cu_dimd_mode값이 '1'일 경우, modeA와 modeB 그리고 평면 모드를 사용하여 예측 샘플을 생성할 수 있다. cu_dimd_mode의 값이 '2'일 경우, 디코더는 modeA와 평면 모드를 사용하여 예측 샘플을 생성할 수 있다. cu_dimd_mode의 값이 '3'일 경우, 디코더는 modeB와 평면 모드를 사용하여 예측 샘플을 생성할 수 있다.Referring to FIG. 16, if the current block is encoded with DIMD (i.e., the value of cu_dimd_flag is 1), the decoder uses syntax for DIMD combination information (information about the mode combined to obtain the prediction sample, mode combination information) Elements (cu_dimd_mode) can be additionally parsed. At this time, the way cu_dimd_mode is parsed may differ depending on the number of prediction modes to be combined. For example, if the number of combinations is '2', the decoder can only parse one bin. At this time, if the value of cu_dimd_mode is '0', the decoder can generate a prediction sample using modeA and modeB. If the value of cu_dimd_mode is '1', the decoder will generate prediction samples using modeA and modeB and the planar mode, or generate prediction samples using modeA and the planar mode, or generate prediction samples using modeB and the planar mode. You can. If the number of combinations is '4', the decoder can parse two bins. At this time, if the value of cu_dimd_mode is '0', the decoder can generate a prediction sample using modeA and modeB. If the cu_dimd_mode value is '1', prediction samples can be generated using modeA, modeB, and planar mode. If the value of cu_dimd_mode is '2', the decoder can generate prediction samples using modeA and planar mode. If the value of cu_dimd_mode is '3', the decoder can generate prediction samples using modeB and planar mode.
DIMD 조합 정보에 대한 신택스 요소가 비트스트림에 포함될 경우, 비트량이 증가한다는 문제점이 있을 수 있다. 이러한 문제점을 해소하기 위해 DIMD 조합 정보에 대한 신택스 요소는 비트스트림에 포함되지 않고, 디코더가 현재 블록 및 주변 블록의 정보를 통해 조합 정보를 유도할 수 있다. 상술한대로, 디코더는 현재 블록에 대한 예측 샘플을 생성하기 위한 최적의 조합 정보를 유도할 수 있다.If syntax elements for DIMD combination information are included in the bitstream, there may be a problem that the bit amount increases. To solve this problem, syntax elements for DIMD combination information are not included in the bitstream, and the decoder can derive combination information through information on the current block and neighboring blocks. As described above, the decoder can derive optimal combination information to generate a prediction sample for the current block.
도 17은 본 발명의 일 실시예에 따른 현재 블록의 주변 블록에 대한 인트라 예측 방향성 모드 및 가중치 정보를 나타낸 도면이다.Figure 17 is a diagram showing intra prediction directional mode and weight information for neighboring blocks of the current block according to an embodiment of the present invention.
구체적으로 도 17은, 도 15을 통해 설명한 'Histogram analysis' 단계에서 유도되는 각 블록에 대한 인트라 예측 방향성 모드와 대응되는 가중치 정보를 나타낸다. 도 17을 참조하면 가중치의 크기(WeightX)는 알파벳 순으로 표현할 수 있다. 예를 들어, 가장 높은 가중치는 'WeightA'로, 두번째로 높은 가중치는 'WeightB'로 표현될 수 있다. 가중치 정보는 유도된 인트라 예측 방향성 모드의 개수(X) 만큼 존재할 수 있다. 또한, WeightA가중치에 대응되는 인트라 예측 모드는 modeA일 수 있다. 현재 블록에 인접한 주변 블록의 특성에 따라 인트라 예측 방향성 모드와 대응되는 가중치 정보의 특성은 상이할 수 있다. 도 17을 참조하면, Case 1은 modeA와 modeB의 인트라 예측 방향성 모드와 이에 대응되는 가중치 정보가 서로 유사한 경우를 나타낸다. Case 2는 modeA와 modeB의 인트라 예측 방향성 모드와 이에 대응되는 가중치 정보간 차이가 크게 상이한 경우를 나타낸다. Case 3은 modeA와 modeB의 인트라 예측 방향성 모드는 유사하지만 대응되는 가중치 정보간 차이가 크게 상이한 경우를 나타낸다. Case 4는 modeA와 modeB의 인트라 예측 방향성 모드는 크게 상이하지만 대응되는 가중치 정보는 서로 유사한 경우를 나타낸다.Specifically, FIG. 17 shows weight information corresponding to the intra prediction directional mode for each block derived in the 'Histogram analysis' step described with reference to FIG. 15. Referring to FIG. 17, the size of the weight (WeightX) can be expressed in alphabetical order. For example, the highest weight can be expressed as 'WeightA' and the second highest weight can be expressed as 'WeightB'. Weight information may exist as many times as the number (X) of derived intra prediction directional modes. Additionally, the intra prediction mode corresponding to the WeightA weight may be modeA. Depending on the characteristics of neighboring blocks adjacent to the current block, the characteristics of the intra prediction directional mode and the corresponding weight information may be different. Referring to FIG. 17, Case 1 represents a case where the intra prediction directional modes of modeA and modeB and the corresponding weight information are similar to each other. Case 2 represents a case where the difference between the intra prediction directional modes of modeA and modeB and the corresponding weight information is significantly different. Case 3 represents a case where the intra prediction directional modes of modeA and modeB are similar, but the difference between the corresponding weight information is significantly different. Case 4 represents a case where the intra prediction directional modes of modeA and modeB are significantly different, but the corresponding weight information is similar.
도 18은 본 발명의 일 실시예에 따른 DIMD 조합 정보를 결정하는 방법을 나타낸 도면이다.Figure 18 is a diagram showing a method of determining DIMD combination information according to an embodiment of the present invention.
구체적으로, 도 18은 'prediction mode generator' 과정에서 유도된 인트라 예측 방향성 모드(modeA, modeB)와 대응되는 가중치(WeightA, WeightB)간의 차이를 통해 최적의 DIMD 조합 정보를 결정하는 방법을 나타낸다. Specifically, Figure 18 shows a method of determining optimal DIMD combination information through the difference between intra prediction directional modes (modeA, modeB) derived in the 'prediction mode generator' process and the corresponding weights (WeightA, WeightB).
도 18을 참조하면 i) ModeA와 ModeB 간의 절대값의 차이가 임의의 임계 값(Tmode1, 예를 들어, 10) 미만이고, WeightA가 임의의 임계 값(Tweight1, 예를 들어, 0.7) 미만일 경우, 현재 블록에 대한 DIMD 최적의 조합은 modeA와 modeB를 조합하는 것일 수 있고, 디코더는 modeA와 modeB를 조합하여 예측 샘플을 생성할 수 있다. ii) i)에 해당하지 않고 WeightA가 임의의 임계치(Tweight2, 예를 들어, 0.85)이상일 경우, 현재 블록에 대한 DIMD 최적의 조합은 modeA만을 사용하는 것일 수 있고, 디코더는 modeA만을 사용하여 예측 샘플을 생성할 수 있다. iii) ii)에 해당하지 않고 modeA와 modeB 간의 절대값의 차이가 임의의 임계치(Tmode2, 예를 들어, 15) 이상일 경우, 현재 블록에 대한 DIMD 최적의 조합은 modeA 및 'other Prediction' 과정에서 유도된 부호화 모드(예를 들어, 평면 모드, DC 모드, MIP 모드) 중 일부 또는 전부를 조합하는 것일 수 있고, 디코더는 modeA 및 'other Prediction' 과정에서 유도된 부호화 모드(예를 들어, 평면 모드, DC 모드, MIP 모드) 중 일부 또는 전부를 조합하여 예측 샘플을 생성할 수 있다. iv) iii)에 해당하지 않으면 현재 블록에 대한 DIMD 최적의 조합은 modeA와 modeB 및 'other Prediction' 과정에서 유도된 부호화 모드(예를 들어, 평면 모드, DC 모드, MIP 모드) 중 일부 또는 전부를 조합하는 것일 수 있고, 디코더는 modeA와 modeB 및 'other Prediction' 과정에서 유도된 부호화 모드(예를 들어, 평면 모드, DC 모드, MIP 모드) 중 일부 또는 전부를 조합하여 예측 샘플을 생성할 수 있다.Referring to FIG. 18, i) when the difference in absolute value between ModeA and ModeB is less than an arbitrary threshold value (Tmode1, e.g. 10) and WeightA is less than an arbitrary threshold value (Tweight1, e.g. 0.7), The optimal DIMD combination for the current block may be a combination of modeA and modeB, and the decoder may generate a prediction sample by combining modeA and modeB. ii) If i) does not apply and WeightA is above an arbitrary threshold (Tweight2, for example, 0.85), the optimal DIMD combination for the current block may be to use only modeA, and the decoder uses only modeA to generate the prediction sample. can be created. iii) If ii) does not apply and the absolute value difference between modeA and modeB is greater than an arbitrary threshold (Tmode2, e.g. 15), the optimal DIMD combination for the current block is derived from modeA and the 'other prediction' process. It may be a combination of some or all of the encoded modes (e.g., planar mode, DC mode, MIP mode), and the decoder may use a encoding mode (e.g., planar mode, Prediction samples can be generated by combining some or all of (DC mode, MIP mode). iv) If iii) is not applicable, the optimal DIMD combination for the current block is modeA, modeB, and some or all of the encoding modes (e.g., planar mode, DC mode, MIP mode) derived in the 'other prediction' process. It may be a combination, and the decoder may generate prediction samples by combining modeA, modeB, and some or all of the encoding modes (e.g., planar mode, DC mode, MIP mode) derived in the 'other prediction' process. .
이하에서 디코더가 유도한 인트라 예측 방향성 모드(modeA, modeB)와 이에 대응하는 가중치(WeightA, WeightB) 간의 차이를 통해 최적의 DIMD 조합 정보를 결정하는 방법에 대해 설명한다. Below, a method of determining optimal DIMD combination information through the difference between the intra prediction directionality modes (modeA, modeB) derived by the decoder and the corresponding weights (WeightA, WeightB) will be described.
modeA와 modeB의 가중치와 히스토그램(도 11 참조)의 모든 가중치의 합을 비교하여 디코더는 DIMD 조합 정보를 획득할 수 있다. 구체적으로, 현재 블록의 주변 블록에 대한 방향성 정보의 가중치들(modeA 및 modeB의 가중치 포함) 전체(예를 들어, 가중치들 합)와 modeA 및 modeB의 가중치를 비교하여 DIMD 조합 정보는 획득될 수 있다. By comparing the weights of modeA and modeB with the sum of all weights in the histogram (see FIG. 11), the decoder can obtain DIMD combination information. Specifically, DIMD combination information can be obtained by comparing the weights of modeA and modeB with all (e.g., sum of weights) weights of direction information (including weights of modeA and modeB) for neighboring blocks of the current block. .
예를 들어, 유도된 인트라 예측 방향성 모드가 1개(modeA 또는 modeB)인 경우 전체 가중치들 중에서 해당하는 예측 방향성 모드의 가중치가 차지하는 비율이 특정 비율보다 큰 경우, 해당하는 예측 방향성 모드가 선택될 수 있다. 한편, 전체 가중치들 중에서 유도된 인트라 예측 방향성 모드의 가중치가 차지하는 비율이 특정 비율보다 같거나 작은 경우, DIMD 조합 정보는 유도된 인트라 예측 방향성 모드, 평면 모드, DC 모드 MIP 모드 중에서 적어도 하나 이상을 조합하는 것일 수 있다. 이때 특정 비율은 1/2, 2/3, 3/4, 3/8 등일 수 있다.For example, when there is one derived intra prediction directionality mode (modeA or modeB), if the ratio of the weight of the corresponding prediction directionality mode among all weights is greater than a certain ratio, the corresponding prediction directionality mode can be selected. there is. Meanwhile, if the ratio of the weight of the derived intra-prediction directional mode among all weights is equal to or smaller than a specific ratio, the DIMD combination information combines at least one of the derived intra-prediction directional mode, planar mode, DC mode, and MIP mode. It may be. At this time, the specific ratio may be 1/2, 2/3, 3/4, 3/8, etc.
또 다른 예로, 유도된 인트라 예측 방향성 모드가 2개(modeA 및 modeB)인 경우 전체 가중치들 중에서 인트라 예측 방향성 모드 각각의 가중치들 합이 차지하는 비율이 특정 비율보다 큰 경우, 해당하는 2개의 인트라 예측 방향성 모드가 선택될 수 있다. 한편, 전체 가중치들 중에서 유도된 2개의 인트라 예측 방향성 모드의 가중치들 합이 차지하는 비율이 특정 비율보다 같거나 작은 경우, DIMD 조합 정보는 유도된 인트라 예측 방향성 모드, 평면 모드, DC 모드 MIP 모드 중에서 적어도 하나 이상이 선택될 수 있다. 예를 들어, modeA, modeB 및 평면 모드가 선택될 수 있다. 또는 modeA 및 modeB가 선택될 수 있다. 이때 특정 비율은 1/2, 2/3, 3/4, 3/8 등일 수 있다.As another example, when there are two derived intra prediction directionality modes (modeA and modeB), and the ratio of the sum of the weights of each intra prediction directionality mode among all weights is greater than a certain ratio, the two corresponding intra prediction directionality A mode can be selected. Meanwhile, if the ratio of the sum of the weights of the two derived intra-prediction directional modes among all weights is equal to or smaller than a specific ratio, the DIMD combination information is at least one of the derived intra-prediction directional mode, planar mode, DC mode, and MIP mode. More than one may be selected. For example, modeA, modeB and planar mode can be selected. Alternatively, modeA and modeB may be selected. At this time, the specific ratio may be 1/2, 2/3, 3/4, 3/8, etc.
도 19는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드 정보와 가중치를 이용하여 예측 샘플을 생성하는 방법을 나타낸 도면이다.Figure 19 is a diagram showing a method of generating a prediction sample using intra prediction directional mode information and weights according to an embodiment of the present invention.
구체적으로, 도 19는 도 14의 'Intra prediction'과 'weighted prediction' 과정을 나타낸다. 도 19를 참조하면 디코더가 유도한 인트라 예측 방향성 모드가 복수 개인 경우, 디코더는 복수 개의 인트라 예측 방향성 모드 각각의 가중치 정보를 이용하여 그것들의 가중치 정보를 이용한 가중치 예측(weighted prediction)을 수행하여 예측 샘플을 획득할 수 있다. 가중치 정보는 현재 블록의 가로의 길이, 세로의 길이, 양자화 파라미터 정보, 현재 블록이 휘도인지 색차인지 여부에 대한 정보 중 적어도 하나 이상에 기초하여 재설정될 수 있다(Additional information).Specifically, Figure 19 shows the 'Intra prediction' and 'weighted prediction' processes of Figure 14. Referring to FIG. 19, when there are a plurality of intra prediction directional modes derived by the decoder, the decoder uses the weight information of each of the plurality of intra prediction directional modes to perform weighted prediction using their weight information to obtain a prediction sample. can be obtained. Weight information may be reset based on at least one of the horizontal length, vertical length, quantization parameter information, and information about whether the current block is luminance or chrominance (Additional information) of the current block.
도 20 및 도 21은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도할 때 사용되는 주변 블록의 픽셀 값을 나타낸 도면이다.Figures 20 and 21 are diagrams showing pixel values of neighboring blocks used when deriving an intra prediction directional mode according to an embodiment of the present invention.
도 20 및 도 21은 도 14의 'histogram analysis' 과정에서 인트라 예측 방향성 모드를 유도할 때 사용되는 주변 블록의 픽셀(화소) 값을 나타낸다. 인트라 예측 방향성 모드를 유도할 때 현재 블록의 좌측 및 상측에 위치한 주변 픽셀들 전부에 대해 필터링 계산이 필요하다. 이때, 주변 픽셀들은 현재 블록의 경계와 인접하거나 이격된 라인 상의 픽셀들일 수 있다. 즉, 인트라 예측 방향성 모드를 유도하기 위해 현재 블록의 좌측 및 상측 경계에 인접하거나 이격된 라인 상의 주변 픽셀들 전부에 대해 필터링 계산을 수행해야 하므로 계산 복잡도로 인한 지연이 발생할 수 있다는 문제점이 있다. 이러한 문제점을 해결하기 위해, 디코더는 현재 블록의 좌측 및 상측에 위치한 주변 픽셀들에 대한 필터링 계산을 분리하여 병렬적으로 좌측 및 상측에 위치한 주변 픽셀에 대한 인트라 예측 방향성 모드를 유도할 수 있다. 또한 디코더는 임의의 정해진 위치에 해당하는 주변 픽셀에 대해서만 필터링 계산을 수행하여 방향성 정보를 유도할 수도 있다. Figures 20 and 21 show pixel (pixel) values of neighboring blocks used when deriving an intra prediction directional mode in the 'histogram analysis' process of Figure 14. When deriving an intra prediction directional mode, filtering calculations are required for all surrounding pixels located to the left and above of the current block. At this time, the surrounding pixels may be pixels on a line adjacent to or spaced apart from the boundary of the current block. That is, in order to derive the intra prediction directional mode, filtering calculations must be performed on all neighboring pixels on lines adjacent to or spaced apart from the left and upper boundaries of the current block, so there is a problem that delay may occur due to computational complexity. To solve this problem, the decoder can separate filtering calculations for neighboring pixels located to the left and above of the current block and derive an intra prediction directional mode for neighboring pixels located to the left and above in parallel. In addition, the decoder may derive directional information by performing filtering calculations only on surrounding pixels corresponding to an arbitrarily determined location.
도 20(a) 및 (c)는 인트라 예측 방향성 모드를 유도하기 위한 필터링 계산에 사용되는 현재 블록의 좌측에 위치한 주변 픽셀을 나타낸다. 도 20(b), (d)는 인트라 예측 방향성 모드를 유도하기 위한 필터링 계산에 사용되는 현재 블록의 상측에 위치한 주변 픽셀을 나타내다. Figures 20(a) and (c) show surrounding pixels located to the left of the current block used in filtering calculations to derive an intra prediction directional mode. Figures 20(b) and 20(d) show surrounding pixels located above the current block used in filtering calculations to derive an intra prediction directional mode.
디코더가 도 11에서 설명한 히스토그램을 획득하기 위해 사용하는 참조 픽셀의 위치에 따라 매핑 가능한 인트라 방향성 정보는 달라질 수 있다. The intra-directional information that can be mapped may vary depending on the location of the reference pixel that the decoder uses to obtain the histogram described in FIG. 11.
예를 들어, 현재 블록의 가로 및 세로의 길이는 동일할 수 있다. 이때, 도 20 (a)에서 현재 블록의 좌측에 위치한 주변 픽셀에 대한 방향성 정보를 유도할 때 매핑되는 인트라 예측 방향성 모드는 인덱스 -14 내지 34 까지만 사용될 수 있다. 도 20 (b)에서 현재 블록의 상측에 위치한 주변 픽셀에 대한 방향성 정보를 유도할 때 매핑되는 인트라 예측 방향성 모드는 인덱스 34 내지 80 까지만 사용될 수 있다. For example, the horizontal and vertical lengths of the current block may be the same. At this time, the intra prediction directionality mode mapped when deriving directionality information for the surrounding pixel located to the left of the current block in FIG. 20(a) can only be used for indices -14 to 34. In FIG. 20(b), the intra prediction directionality mode mapped when deriving directionality information for neighboring pixels located above the current block can be used only for indices 34 to 80.
한편, 현재 블록의 가로의 길이와 세로의 길이가 다른 경우가 있을 수 있으며, 현재 블록의 가로의 길이와 세로의 길이에 따라 방향성 정보를 유도할 때 사용되는 주변 픽셀의 위치가 달라질 수 있다. 예를 들어, 현재 블록의 세로의 길이가 가로의 길이보다 길다면, 디코더는 현재 블록의 상측에 위치한 주변 픽셀은 사용하지 않고, 좌측에 위치한 주변 픽셀만을 사용하여 방향성 정보를 유도할 수 있다. 이는 상측에 위치한 주변 픽셀을 사용하지 않고 좌측에 위치한 주변 픽셀만을 사용함으로써 계산 복잡도가 줄어든다는 효과가 있다. 현재 블록의 가로의 길이가 세로의 길이보다 길다면, 디코더는 현재 블록의 좌측에 위치한 주변 픽셀보다 상측에 위치한 주변 픽셀에 더 큰 가중치를 적용하여 방향성 정보를 유도할 수 있다. 가중치는 미리 약속된 특정 값을 사용할 수 있다. 예를 들어, 현재 블록의 세로의 길이보다 가로의 길이가 더 크다면, 현재 블록의 좌측에 위치한 주변 픽셀에는 1의 가중치를, 상측에 위치한 주변 픽셀에는 2의 가중치가 사용될 수 있다. 다시 말해서, 현재 블록은 세로의 길이보다 가로의 길이가 더 길기 때문에, 현재 블록의 좌측에 위치한 주변 픽셀보다 상측에 위치한 주변 픽셀에 대한 방향성 정보를 이용하여 인트라 예측 방향성 모드를 유도하는 것이 더 효과적이기 때문이다.Meanwhile, there may be cases where the horizontal and vertical lengths of the current block are different, and the positions of surrounding pixels used when deriving directional information may vary depending on the horizontal and vertical lengths of the current block. For example, if the vertical length of the current block is longer than the horizontal length, the decoder may derive directional information by using only the surrounding pixels located on the left side of the current block, without using the surrounding pixels located on the upper side. This has the effect of reducing computational complexity by using only neighboring pixels located on the left rather than using neighboring pixels located on the upper side. If the horizontal length of the current block is longer than the vertical length, the decoder can derive directional information by applying a greater weight to neighboring pixels located above than to neighboring pixels located to the left of the current block. Weights can use specific pre-arranged values. For example, if the horizontal length of the current block is greater than the vertical length, a weight of 1 may be used for neighboring pixels located to the left of the current block, and a weight of 2 may be used for neighboring pixels located above. In other words, because the current block is longer horizontally than vertically, it is more effective to derive an intra prediction directionality mode using directionality information about surrounding pixels located above rather than surrounding pixels located to the left of the current block. Because.
디코더는 현재 블록의 주변에 위치한 주변 픽셀들 중에서 특정 개수에 해당하는 픽셀들에 대해서만 필터링 계산을 수행할 수 있다. 이때 특정 개수는 N의 배수일 수 있고, N은 2, 3, 4 등일 수 있다. N에 대한 정보는 픽쳐 헤더 정보에 포함될 수 있다. 도 21을 참조하면, 현재 블록의 좌상단에서 x, y 축으로 (-2, -2)로 이동한 위치를 기준으로 하여, '2'의 배수에 해당하는 위치에서만 디코더는 필터링 계산을 수행하고, 방향성 정보를 유도할 수 있다. 또한, 디코더는 현재 블록이 휘도 블록이면 방향성 정보를 유도하고, 색차 블록이면 방향성 정보를 유도하지 않을 수 있다. 디코더는 휘도 블록에서 찾은 방향성 정보를 색차 블록에 적용할 수 있다. 한편, 휘도 블록에 대한 방향성 정보와 색차 블록에 대한 방향성 정보는 각각 획득될 수 있다. 색차 블록은 휘도 블록에서 찾은 방향성 정보를 사용하지 않고, 평면 모드, DC 모드, 수평 모드, 수직 모드, MIP 모드 중에서 적어도 하나 이상을 사용하여 획득된 정보를 이용할 수 있다. The decoder can perform filtering calculations only on pixels corresponding to a certain number of pixels located around the current block. At this time, the specific number may be a multiple of N, and N may be 2, 3, 4, etc. Information about N may be included in picture header information. Referring to FIG. 21, based on the position moved from the upper left corner of the current block to (-2, -2) on the x and y axes, the decoder performs filtering calculations only at positions corresponding to multiples of '2', Directional information can be derived. Additionally, the decoder may derive directionality information if the current block is a luminance block, and may not derive directionality information if the current block is a chrominance block. The decoder can apply the directional information found in the luminance block to the chrominance block. Meanwhile, directionality information for the luminance block and directionality information for the chrominance block can be obtained respectively. The chrominance block may not use the directional information found in the luminance block, but may use information obtained using at least one of planar mode, DC mode, horizontal mode, vertical mode, and MIP mode.
현재 블록의 인트라 예측 방향성 모드는 주변 블록의 인트라 예측 방향성 모드와 유사할 가능성이 높다. 따라서, 현재 블록의 인트라 예측 방향성 모드를 부호화하기 위해서 주변 블록의 인트라 예측 방향성 모드를 이용하여 MPM(Most Probable Mode) 리스트를 구성하고 현재 블록의 인트라 예측 방향성 모드가 MPM 리스트에 존재하는지에 대한 정보 및 존재하는 위치에 대한 정보가 비트스트림에 포함될 수 있다. 즉, 현재 블록의 인트라 예측 방향성 모드에 대한 정보는 별도로 비트스트림에 포함되지 않을 수 있다. 따라서 현재 블록의 인트라 예측 방향성 모드가 MPM 리스트에 존재하는지에 대한 정보 및 존재하는 위치에 대한 정보에 기초하여 현재 블록의 인트라 예측 방향성 모드가 결정되므로, MPM 리스트가 효과적으로 구성되는지에 따라 현재 블록의 인트라 예측 방향성 모드를 유도하기 위한 정보(즉, 비트량)는 달라질 수 있다. The intra prediction directionality mode of the current block is likely to be similar to the intra prediction directionality mode of neighboring blocks. Therefore, in order to encode the intra prediction directional mode of the current block, an MPM (Most Probable Mode) list is constructed using the intra prediction directional mode of neighboring blocks, and information about whether the intra prediction directional mode of the current block exists in the MPM list and Information about existing locations may be included in the bitstream. That is, information about the intra prediction directional mode of the current block may not be separately included in the bitstream. Therefore, since the intra prediction direction mode of the current block is determined based on information about whether the intra prediction direction mode of the current block exists in the MPM list and information about the location where it exists, the intra prediction direction mode of the current block depends on whether the MPM list is effectively constructed. Information (i.e., bit quantity) for deriving the prediction directional mode may vary.
현재 블록의 주변 픽셀들의 방향성 특성을 이용하여 인트라 예측 방향성 모드를 유도하는 방법은 MPM 리스트를 구성하는 과정에서도 사용될 수 있다. 디코더는 현재 블록의 주변 픽셀들의 방향성 특성을 이용하여 유도된 현재 블록에 대한 인트라 예측 방향성 모드를 MPM 리스트에 추가하여 현재 블록에 대한 인트라 예측 방향성 모드를 부호화하는데 사용할 수 있다. 이는 현재 블록의 주변 블록이 인트라 예측 모드로 부호화되지 않았거나 MIP(Matrix intra prediction) 모드와 같이 인트라 예측 방향성 모드가 없는 경우 사용될 수 있다.The method of deriving an intra prediction directionality mode using the directionality characteristics of surrounding pixels of the current block can also be used in the process of constructing an MPM list. The decoder can add the intra prediction directionality mode for the current block derived using the directionality characteristics of surrounding pixels of the current block to the MPM list and use it to encode the intra prediction directionality mode for the current block. This can be used when neighboring blocks of the current block are not encoded in intra prediction mode or when there is no intra prediction directional mode such as MIP (Matrix intra prediction) mode.
현재 블록에 인접한 주변 블록들에는 인트라 예측 방향성 모드가 없는 블록과 인트라 예측 방향성 모드가 존재하는 블록이 혼재할 수 있다. 현재 블록의 좌측에 위치한 주변 블록이 인트라 예측 방향성 모드가 없는 블록이라면, 디코더는 현재 블록의 상측에 위치한 주변 픽셀들만을 이용하여 방향성 특성을 계산하고, 현재 블록의 인트라 예측 방향성 모드를 유도할 수 있다. 또는 현재 블록의 상측에 위치한 주변 블록에는 인트라 예측 방향성 모드가 존재하고, 현재 블록의 좌측에 위치한 주변 블록에는 인트라 예측 방향성 모드가 존재하지 않을 경우, 디코더는 상측에 위치한 주변 블록의 인트라 예측 방향성 모드를 MPM 리스트에 포함하고, 좌측에 위치한 주변 픽셀들의 방향성 특성을 통해 유도된 인트라 예측 방향성 모드를 MPM 리스트에 포함시킬 수 있다.Neighboring blocks adjacent to the current block may contain blocks without an intra prediction directional mode and blocks with an intra prediction directional mode. If the neighboring block located to the left of the current block is a block without an intra prediction directionality mode, the decoder can calculate the directionality characteristics using only the surrounding pixels located above the current block and derive the intra prediction directionality mode of the current block. . Or, if the intra prediction directionality mode exists in the neighboring block located above the current block, and the intra prediction directionality mode does not exist in the neighboring block located to the left of the current block, the decoder uses the intra prediction directionality mode of the neighboring block located above the current block. It can be included in the MPM list, and the intra prediction directionality mode derived through the directionality characteristics of surrounding pixels located on the left can be included in the MPM list.
도 22는 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 방향성 모드를 포함한 MPM 리스트를 구성하는 방법을 나타낸 도면이다.Figure 22 is a diagram showing a method of configuring an MPM list including the intra prediction directional mode of the current block according to an embodiment of the present invention.
도 22를 참조하면 DIMD 모드가 MPM 리스트에 우선하여 포함될 수 있다. DIMD 모드를 통해 유도되는 현재 블록의 인트라 예측 방향성 모드는 복수 개일 수 있다. 따라서 디코더는 다중 예측(multiple prediction)을 통해 예측 샘플을 획득할 수 있다. 현재 블록의 주변 블록들 중에서 인트라 예측 방향성 모드가 있는 블록의 인트라 예측 방향성 모드가 MPM 리스트에 추가될 수 있다. MPM 리스트에 빈 곳이 있다면 modeA에서 +1 또는 -1만큼 수정된 모드가 리스트에 추가될 수 있으며, DC 모드, 수평 모드, 수직 모드, MIP 모드가 추가될 수 있다. DIMD 모드 대신에 TIMD(Template based Intra Mode Derivation) 모드가 MPM 리스트에 우선하여 포함될 수 있다. 또한, DIMD 및 TIMD 모드가 MPM 리스트에 모두 포함될 수 있다. 또한, DIMD 모드를 이용하여 유도된 2개의 인트라 방향성 예측 모드들과 TIMD 모드를 이용하여 유도된 2개의 인트라 방향성 예측 모드들 중에서 적어도 하나 이상이 MPM 리스트에 포함될 수 있다. 또한, 2개의 영역으로 분할된 GPM 블록들 중 하나의 제1 영역에 인트라 예측 방향성 모드가 사용되었다면, 제1 영역에 대한 인트라 예측 방향성 모드를 유도하기 위해 MPM 리스트가 사용될 수 있다. MPM 리스트에는 DIMD 모드를 이용하여 유도된 2개의 인트라 예측 방향성 모드와 TIMD 모드를 이용하여 유도된 2개의 인트라 예측 방향성 모드들 중 적어도 하나 이상이 포함될 수 있다.Referring to FIG. 22, DIMD mode may be preferentially included in the MPM list. There may be multiple intra prediction directional modes of the current block derived through the DIMD mode. Therefore, the decoder can obtain prediction samples through multiple prediction. Among the neighboring blocks of the current block, the intra prediction directionality mode of a block with an intra prediction directionality mode may be added to the MPM list. If there is an empty spot in the MPM list, a mode modified by +1 or -1 in modeA can be added to the list, and DC mode, horizontal mode, vertical mode, and MIP mode can be added. Instead of DIMD mode, TIMD (Template based Intra Mode Derivation) mode may be preferentially included in the MPM list. Additionally, both DIMD and TIMD modes can be included in the MPM list. Additionally, at least one of the two intra directional prediction modes derived using the DIMD mode and the two intra directional prediction modes derived using the TIMD mode may be included in the MPM list. Additionally, if the intra-prediction directional mode is used in a first region of one of the GPM blocks divided into two regions, the MPM list can be used to derive the intra-prediction directional mode for the first region. The MPM list may include at least one of two intra prediction directionality modes derived using DIMD mode and two intra prediction directionality modes derived using TIMD mode.
MPM리스트에 DIMD 모드가 포함되는 경우, 현재 블록이 DIMD 모드로 부호화되었는지에 대한 정보는 신택스 요소(mpm_idx)를 통해 유도될 수 있다. 따라서, DIMD와 관련된 추가적인 정보는 시그널링될 필요가 없을 수 있다. 이때, 현재 블록이 DIMD 모드로 부호화된 경우, 참조 라인 인덱스는 0(mrl_ref_idx는 0)일 수 있다. 또한, DIMD 모드가 사용된 경우, mrl_ref_idx는 파싱되지 않고 mrl_ref_idx의 값은 0으로 추론(infer)될 수 있다. 또한 MPM 리스트에는 DIMD 모드를 사용하여 유도된 인트라 예측 방향성 모드가 포함될 수 있다. DIMD로부터 유도된 인트라 예측 방향성 모드가 선택되는 경우, mrl_ref_idx는 재설정될 수 있다. 예를 들어, mrl_ref_idx의 값은 0, 1, 2 ... 중 어느 하나로 재설정될 수 있다. 디코더는 mrl_ref_idx를 파싱하여 획득된 mrl_ref_idx의 값에 기초하여 MPM 리스트 내 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 추가할 것인지 MPM 리스트 내 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드의 우선 순위를 결정할 수 있다. 예를 들어, mrl_ref_idx의 값이 0이 아닌 경우, 디코더는 MPM 리스트에 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 포함하지 않을 수 있다. 또는, mrl_ref_idx의 값이 0인 경우에만, 디코더는 MPM 리스트에 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 포함할 수 있다. 또는, mrl_ref_idx의 값으로부터 결정되는 참조 픽셀 라인이 0, 1, 2, 3인 경우에만, 디코더는 MPM 리스트에 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 포함할 수 있다. 또는, mrl_ref_idx의 값으로부터 결정되는 참조 픽셀 라인이 3보다 큰 경우, 디코더는 MPM 리스트에 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 포함하지 않을 수 있다. 또는, mrl_ref_idx의 값이 0이 아닌 경우, 디코더는 MPM 리스트에 DIMD 모드를 이용하여 유도되는 인트라 예측 방향성 모드를 포함할 수 있다. If the MPM list includes DIMD mode, information about whether the current block is encoded in DIMD mode can be derived through a syntax element (mpm_idx). Therefore, additional information related to DIMD may not need to be signaled. At this time, if the current block is encoded in DIMD mode, the reference line index may be 0 (mrl_ref_idx is 0). Additionally, when DIMD mode is used, mrl_ref_idx is not parsed and the value of mrl_ref_idx may be inferred as 0. Additionally, the MPM list may include intra prediction directional modes derived using DIMD mode. If the intra prediction directional mode derived from DIMD is selected, mrl_ref_idx may be reset. For example, the value of mrl_ref_idx can be reset to any of 0, 1, 2... Based on the value of mrl_ref_idx obtained by parsing mrl_ref_idx, the decoder determines whether to add the intra prediction directionality mode derived using the DIMD mode in the MPM list or the priority of the intra prediction directionality mode derived using the DIMD mode in the MPM list. You can decide. For example, if the value of mrl_ref_idx is non-0, the decoder may not include the intra prediction directional mode derived using the DIMD mode in the MPM list. Alternatively, only when the value of mrl_ref_idx is 0, the decoder may include an intra prediction directional mode derived using the DIMD mode in the MPM list. Alternatively, only when the reference pixel line determined from the value of mrl_ref_idx is 0, 1, 2, or 3, the decoder may include an intra prediction directional mode derived using DIMD mode in the MPM list. Alternatively, if the reference pixel line determined from the value of mrl_ref_idx is greater than 3, the decoder may not include the intra prediction directional mode derived using the DIMD mode in the MPM list. Alternatively, if the value of mrl_ref_idx is not 0, the decoder may include an intra prediction directional mode derived using DIMD mode in the MPM list.
DIMD 모드로 유도되는 인트라 예측 방향성 모드는 MPM 리스트 내의 인트라 예측 모드 후보들을 재정렬하는데 사용될 수 있다. 디코더는 현재 블록의 주변 블록들부터 MPM 리스트를 구성한 후, DIMD 모드를 이용하여 인트라 예측 방향성 모드를 유도할 수 있다. 디코더는 유도된 인트라 예측 방향성 모드를 이용하여 MPM 리스트 내의 인트라 예측 모드 후보들을 재정렬할 수 있다. 이때, 디코더는 유도된 인트라 예측 방향성 모드, 현재 블록의 가로의 길이 또는 세로의 길이, 양자화 파라미터 정보, 현재 블록의 주변 블록들 중에서 사용 가능한 인트라 예측 모드 정보, 현재 블록의 주변 블록의 잔차 신호의 존재 여부 정보, 현재 블록이 휘도 블록인지 색차 블록인지에 대한 정보 중 어느 하나 이상을 사용하여 MPM 리스트를 재정렬할 수 있다.The intra prediction directional mode derived from the DIMD mode can be used to reorder intra prediction mode candidates in the MPM list. The decoder can construct an MPM list starting from neighboring blocks of the current block and then derive an intra prediction directional mode using DIMD mode. The decoder can reorder intra prediction mode candidates in the MPM list using the derived intra prediction directional mode. At this time, the decoder determines the derived intra prediction directionality mode, the horizontal or vertical length of the current block, quantization parameter information, intra prediction mode information available among neighboring blocks of the current block, and the presence of residual signals of neighboring blocks of the current block. The MPM list can be rearranged using one or more of information about whether the current block is a luminance block or a chrominance block.
디코더는 MPM 리스트 내의 인트라 예측 모드 후보들과 유도된 인트라 예측 방향성 모드간 차이를 이용하여 MPM 리스트를 재정렬할 수 있다. 예를 들어, 디코더는 유도된 인트라 예측 방향성 모드와 MPM 리스트 내 인트라 예측 모드 후보들 각각의 차이를 계산하여 차이가 작은 순(0 포함)으로 MPM 리스트를 정렬할 수 있다. MPM 리스트에서 차이가 가장 작은 인트라 예측 모드 후보는 MPM 리스트 내 가장 작은 인덱스 값을 가지도록 설정될 수 있다. 또한, 유도된 인트라 예측 방향성 모드가 MPM 리스트 내에서 가장 높은 우선 순위를 갖도록 설정될 수 있고, 가장 작은 인덱스 값을 가지도록 설정될 수 있다. 그리고 디코더는 유도된 인트라 예측 방향성 모드 이후 MPM 리스트를 유도된 인트라 예측 방향성 모드와 MPM 리스트 내 인트라 예측 모드 후보들 각각의 차이를 계산하여 차이가 작은 순(0 포함)으로 정렬할 수 있다. 또한, 2개의 MPM 리스트를 사용되는 경우, 첫번째 MPM 리스트는 유도된 인트라 예측 방향성 모드와 유사한 인트라 예측 모드 후보 순으로 구성될 수 있다. 유도된 인트라 예측 방향성 모드와 MPM 리스트 내 인트라 예측 모드 후보들 간 차이가 작은 순으로 구성될 수 있다. 두번째 MPM 리스트는 유도된 인트라 예측 방향성 모드와 유사도가 높지 않은 후보들을 사용하여 구성될 수 있다. 예를 들어, 두번째 MPM 리스트는 유도된 인트라 예측 방향성 모드와 MPM 리스트 내 인트라 예측 모드 후보들 간 차이가 큰 순으로 구성될 수 있다. MPM 리스트의 크기가 고정되는 경우, MPM 리스트 내 채워지지 않은 빈 공간이 존재할 수 있다. 이때, 빈 공간에는 MPM 리스트에 이미 포함된 후보들 또는 자주 발생하는 후보들 중에서 하나 이상을 이용하여 유도된 새로운 예측 후보가 추가될 수 있다. 예를 들어, 새로운 예측 후보는 이미 포함된 후보의 모드 번호(인덱스)에서 '+' 또는 '-' 방향으로 임의의 크기만큼 가감된 번호에 대응되는 후보일 수 있다. 이때, 임의의 크기는 '1', '2', '3', … 등의 자연수일 수 있고, 임의의 크기에 대한 정보는 픽쳐 헤더 정보에 포함될 수 있다. 또한, 2개의 MPM 리스트가 사용되는 경우, 첫번째 MPM 리스트는 현재 블록의 이웃 블록의 예측 모드를 참조하여 획득되는 예측 모드들로 구성될 수 있고, 두번째 MPM리스트는 DIMD로 유도된 예측 모드들로 구성될 수 있다. 이때, MPM 리스트에 포함된 예측 모드들의 수가 미리 정의된 MPM 리스트에 포함될 수 있는 예측 모드들의 수보다 작으면 MPM 리스트에 포함된 예측 모드들에 오프셋을 적용하여 유도되는 예측 모드들이 추가될 수도 있다. The decoder can reorder the MPM list using the difference between the intra prediction mode candidates in the MPM list and the derived intra prediction directional mode. For example, the decoder may calculate the difference between the derived intra-prediction directional mode and each of the intra-prediction mode candidates in the MPM list and sort the MPM list in order of the smallest difference (including 0). The intra prediction mode candidate with the smallest difference in the MPM list may be set to have the smallest index value in the MPM list. Additionally, the derived intra prediction directional mode may be set to have the highest priority within the MPM list and may be set to have the smallest index value. And, after the derived intra-prediction directionality mode, the decoder can calculate the difference between the derived intra-prediction directionality mode and each of the intra-prediction mode candidates in the MPM list and sort the MPM list in order of the smallest difference (including 0). Additionally, when two MPM lists are used, the first MPM list may be organized in the order of intra prediction mode candidates similar to the derived intra prediction directional mode. The difference between the derived intra-prediction directional mode and the intra-prediction mode candidates in the MPM list may be organized in descending order. The second MPM list can be constructed using candidates that do not have high similarity to the derived intra prediction directional mode. For example, the second MPM list may be organized in the order of the largest difference between the derived intra-prediction directional mode and the intra-prediction mode candidates in the MPM list. If the size of the MPM list is fixed, there may be unfilled empty space in the MPM list. At this time, a new prediction candidate derived using one or more of the candidates already included in the MPM list or frequently occurring candidates may be added to the empty space. For example, a new prediction candidate may be a candidate corresponding to a number added or subtracted by a random amount in the '+' or '-' direction from the mode number (index) of an already included candidate. At this time, the arbitrary sizes are '1', '2', '3',... It may be a natural number such as, and information about an arbitrary size may be included in the picture header information. Additionally, when two MPM lists are used, the first MPM list may be composed of prediction modes obtained by referring to the prediction mode of the neighboring block of the current block, and the second MPM list may be composed of prediction modes derived by DIMD. It can be. At this time, if the number of prediction modes included in the MPM list is smaller than the number of prediction modes that can be included in the predefined MPM list, prediction modes derived by applying an offset to the prediction modes included in the MPM list may be added.
DIMD 모드로 유도된 인트라 예측 방향성 모드는 MPM 리스트 내의 인트라 예측 모드 후보들을 재조합하는데 사용될 수 있다. 디코더는, 현재 블록의 주변 블록들의 예측 모드에 기초하여 MPM 리스트를 구성한 후, DIMD 모드를 통해 인트라 예측 방향성 모드를 유도할 수 있다. 그리고, 디코더는 유도한 인트라 예측 방향성 모드를 이용하여 MPM 리스트 내의 인트라 예측 모드 후보들을 재조합하여 다중 예측 후보(multiple prediction)들로 재구성할 수 있다. 이때, 디코더는 유도된 인트라 예측 방향성 모드, 현재 블록의 가로의 길이 또는 세로의 길이, 양자화 파라미터 정보, 현재 블록의 주변 블록들 중에서 사용 가능한 인트라 예측 모드 정보, 현재 블록의 주변 블록의 잔차 신호의 존재 여부 정보, 현재 블록이 휘도 블록인지 색차 블록인지에 대한 정보 중 어느 하나 이상을 사용하여 MPM 리스트를 재조합할 수 있다. 이하에서 MPM 리스트 재조합 방법에 대해 설명한다.The intra prediction directional mode derived from the DIMD mode can be used to reassemble the intra prediction mode candidates in the MPM list. The decoder may construct an MPM list based on the prediction modes of neighboring blocks of the current block and then derive the intra prediction directional mode through the DIMD mode. Additionally, the decoder can recombine the intra prediction mode candidates in the MPM list using the derived intra prediction directional mode and reconstruct them into multiple prediction candidates. At this time, the decoder determines the derived intra prediction directionality mode, the horizontal or vertical length of the current block, quantization parameter information, intra prediction mode information available among neighboring blocks of the current block, and the presence of residual signals of neighboring blocks of the current block. The MPM list can be reassembled using one or more of information about whether the current block is a luminance block or a chrominance block. Below, the MPM list recombination method will be described.
유도된 인트라 예측 방향성 모드와 MPM 리스트 내의 인트라 예측 모드 후보들 간의 차이를 이용하여 디코더는 MPM 리스트를 재조합 할 수 있다. 예를 들어, 디코더는 차이가 임의의 값 이하인 후보들을 선택하여 유도된 인트라 예측 방향성 모드와 상기 후보(MPM 리스트 내 기존의 인트라 예측 모드)들을 조합하여 구성한 다중 예측 후보를 MPM 리스트에 포함할 수 있다. 이때, 디코더는 차이가 작은 순서부터 큰 순서로 해당하는 후보들을 MPM 리스트에 포함할 수 있다. 다음으로, 디코더는 차이가 임의의 값보다 큰 후보들을 차례대로 MPM 리스트에 삽입할 수 있다. 이때, 임의의 값은 1, 2, 3, … 등의 자연수일 수 있다. 예를 들어, 유도된 인트라 예측 모드의 인덱스가 '18'이고, MPM 리스트내에 후보들의 인덱스는 '16', '21', '34', '1', '66'이고 임의의 값은 5로 가정할 수 있다. 이때, 유도된 인트라 예측 모드와 차이가 '5'이내인, 인덱스 '16', '21'이 다중 예측 후보로 변경될 수 있고, MPM 리스트 내 후보들은 인덱스 '16, 18', '21, 18', '34', '1', '66'의 예측 모드로 변경될 수 있다. 즉, '16, 18' 및 '21, 18'이 다중 예측 후보일 수 있다. 예를 들어, 디코더가 MPM 리스트 내 다중 예측 후보인 '16, 18'을 선택하는 경우 디코더는 인덱스 16의 예측 모드로 생성한 예측 샘플과 인덱스 18의 예측 모드로 생성한 예측 샘플을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때, MPM 리스트의 개수가 5로 제한되어 있다면 MPM 리스트는 '16, 18', '21, 18', '16', '21', '34' 가 될 수 있다. 또한, 2개의 MPM 리스트가 사용되는 경우, 경우, 첫번째 MPM 리스트는 유도된 인트라 예측 방향성 모드와 유사한 후보들을 사용하여 재조합되는 후보들로 구성될 수 있다. 두번째 MPM 리스트는 첫번째 MPM 리스트의 후보들 및 유도된 인트라 예측 방향성 모드와 유사도가 높지 않은 후보들로 구성될 수 있다. 따라서, 첫번째 MPM리스트는 다중 예측 후보들로 구성되고, 두 번째 MPM 후보들은 단일 예측 후보들로 구성될 수 있다. 또는 첫번째 MPM리스트는 단일 예측 후보들과 다중 예측 후보들을 모두 포함하여 구성될 수 있고, 두 번째 MPM 후보들은 단일 예측 후보로만 구성될 수 있다. 예를 들어, 유도된 인트라 예측 모드가 인덱스 '18'이고, 첫번째 MPM 리스트내 예측 모드 후보들이 인덱스 '16', '21', '34', '1', '66'이고, 두번째 MPM 리스트내에 예측 모드 후보들이 인덱스 '50', '2', '8', '30', '40'이고, 임의의 값이 5일 수 있다. 이때, 유도된 인트라 예측 모드 인덱스 18과 차이가 5 이내인 인덱스 '16', '21'이 다중 예측 후보로 변경될 수 있다. 이때, 첫번째 MPM리스트는 인덱스 '16, 18', '21, 18', '16', '18', '34'으로 구성될 수 있고, 두번째 MPM 리스트는 인덱스 '1', '66', '50', '2', '8', '30', '40'으로 구성될 수 있다.Using the difference between the derived intra-prediction directional mode and intra-prediction mode candidates in the MPM list, the decoder can reassemble the MPM list. For example, the decoder may include in the MPM list a multi-prediction candidate constructed by combining the intra-prediction directional mode derived by selecting candidates whose difference is less than or equal to a certain value and the candidates (existing intra-prediction modes in the MPM list). . At this time, the decoder may include the corresponding candidates in the MPM list in order from smallest to largest difference. Next, the decoder can sequentially insert candidates whose difference is greater than a random value into the MPM list. At this time, random values are 1, 2, 3, … It may be a natural number such as: For example, the index of the derived intra prediction mode is '18', the indices of candidates in the MPM list are '16', '21', '34', '1', '66', and the random value is 5. It can be assumed. At this time, indices '16' and '21', which have a difference within '5' from the derived intra prediction mode, can be changed to multi-prediction candidates, and the candidates in the MPM list have indices '16, 18', '21, 18'. ', '34', '1', and '66' prediction modes. That is, '16, 18' and '21, 18' may be multiple prediction candidates. For example, when the decoder selects '16, 18', a multiple prediction candidate in the MPM list, the decoder performs a weighted average of the prediction sample generated by the prediction mode of index 16 and the prediction sample generated by the prediction mode of index 18 to obtain the final result. A prediction block can be created. At this time, if the number of MPM lists is limited to 5, the MPM list can be '16, 18', '21, 18', '16', '21', and '34'. Additionally, when two MPM lists are used, the first MPM list may be composed of candidates that are recombined using candidates similar to the derived intra prediction directional mode. The second MPM list may be composed of candidates from the first MPM list and candidates that do not have high similarity to the derived intra prediction directional mode. Accordingly, the first MPM list may be composed of multiple prediction candidates, and the second MPM candidates may be composed of single prediction candidates. Alternatively, the first MPM list may be composed of both single prediction candidates and multiple prediction candidates, and the second MPM candidates may be composed of only single prediction candidates. For example, the derived intra prediction mode is index '18', the prediction mode candidates in the first MPM list are index '16', '21', '34', '1', '66', and in the second MPM list The prediction mode candidates are indices '50', '2', '8', '30', and '40', and an arbitrary value can be 5. At this time, indices '16' and '21' that have a difference of less than 5 from the derived intra prediction mode index 18 may be changed to multi-prediction candidates. At this time, the first MPM list may consist of indices '16, 18', '21, 18', '16', '18', and '34', and the second MPM list may consist of indices '1', '66', and ' It can consist of '50', '2', '8', '30', and '40'.
인트라 예측 방향성 모드는 MPM 리스트에 있는지 여부와 MPM 리스트에 있다면 어디에 위치하는지에 기초하여 부호화될 수 있다. 인트라 예측 방향성 모드가 MPM 리스트에 존재하지 않는 경우, 인트라 예측 방향성 모드는 전체 인트라 예측 방향성 모드 개수에서 MPM 리스트 내 예측 모드의 전체 개수를 뺀 값에 기초하여 부호화될 수 있다. 구체적으로 인트라 예측 방향성 모드는 총 67가지가 존재하며 그 중에서 MPM 리스트 내 예측 모드의 전체 개수 5개와 평면 모드를 제외한 61가지에 대하여 부호화가 수행될 수 있다. 이때 61가지의 인트라 예측 방향성 모드는 고정 길이 부호화(fixed length coding)를 사용하여 부호화될 수 있으므로, 총 6개 빈(bin)에 대한 부호화가 필요하다.The intra prediction directional mode can be encoded based on whether it is in the MPM list and, if so, where it is located. If the intra prediction directional mode does not exist in the MPM list, the intra prediction directional mode may be encoded based on the total number of intra prediction directional modes minus the total number of prediction modes in the MPM list. Specifically, there are a total of 67 intra-prediction directional modes, and among them, encoding can be performed on the total number of prediction modes in the MPM list, 5, and 61 types excluding the planar mode. At this time, 61 intra prediction directional modes can be encoded using fixed length coding, so encoding for a total of 6 bins is required.
도 23 및 도 24는 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 모드를 유도하기 위해 사용되는 템플릿(template)을 나타낸 도면이다.Figures 23 and 24 are diagrams showing a template used to derive the intra prediction mode of the current block according to an embodiment of the present invention.
도 23을 참조하면, 디코더는 현재 블록의 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 복원된 임의의 영역(픽셀(들))인 템플릿을 사용할 수 있다. 먼저, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성할 수 있다. 그리고, 디코더는 이미 복원된 템플릿과 가장 유사한 예측 템플릿에 대한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 상술한 템플릿을 사용하여 현재 블록의 인트라 예측 모드를 유도하는 방법은 TIMD(Template intra mode derivation)라고 기술될 수 있다. 이때, 인트라 예측 모드는 인덱스 0 내지 67의 모드일 수 있고, 현재 블록의 주변 블록으로부터 유도된 MPM 리스트 내에 있는 인트라 예측 모드만 해당될 수도 있다. 이때, 인트라 예측 모드는 현재 블록의 주변 블록으로부터 유도된 MPM 리스트 내에 있는 인트라 예측 모드와 해당 인트라 예측 모드와 임의의 수만큼 차이가 나는 모드들일 수 있다. 임의의 수는 1, 2, 3, ... 일 수 있다. 또는 템플릿에 대한 인트라 예측 모드에는 방향성 모드만 해당할 수 있고, 비방향성 모드(평면 모드, DC 모드)는 해당하지 않을 수 있다.Referring to FIG. 23, the decoder may use a template, which is a reconstructed random area (pixel(s)) adjacent to the current block, to derive the intra prediction mode of the current block. First, the decoder can generate a prediction template for the template using surrounding pixels (references) adjacent to the template. Additionally, the decoder can use the intra prediction mode for the prediction template that is most similar to the already restored template to restore the current block. The method of deriving the intra prediction mode of the current block using the above-described template may be described as TIMD (Template intra mode derivation). At this time, the intra prediction mode may be a mode with indices 0 to 67, and may only apply to the intra prediction mode within the MPM list derived from the neighboring blocks of the current block. At this time, the intra prediction mode may be an intra prediction mode in the MPM list derived from a neighboring block of the current block and a mode that differs from the corresponding intra prediction mode by an arbitrary number. Any number can be 1, 2, 3, ... Alternatively, only the directional mode may be applicable to the intra prediction mode for the template, and the non-directional mode (planar mode, DC mode) may not be applicable.
이하 TIMD 모드를 이용하여 인트라 예측 방향성 모드를 유도하는 방법에 대해 설명한다. Hereinafter, a method for deriving an intra prediction directional mode using the TIMD mode will be described.
i) 디코더는 템플릿의 크기를 설정할 수 있다. 템플릿의 가로 또는 세로의 크기(길이)는 4일 수 있고, 현재 블록의 가로 또는 세로의 크기(길이)가 8 이하인 경우, 템플릿의 가로 또는 세로의 크기는 2로 설정될 수 있다. ii) 디코더는 템플릿의 타입을 설정할 수 있다. 템플릿의 타입은 좌측 샘플만 사용하는 타입, 상측 샘플만 사용하는 타입, 좌측, 상측 및 좌상측 샘플을 모두 사용하는 타입으로 구분될 수 있다. 디코더는 주변 블록이 유효한지 또는 주변 블록이 인트라 예측 방향성 모드를 유도하는데 사용될 수 있는지 여부에 따라 템플릿의 타입을 결정할 수 있다. 한편, 주변 블록이 인트라 예측 방향성 모드를 유도하는데 사용될 수 없는 경우, TIMD 모드는 평면 모드로 설정될 수 있고, 가중치 평균은 수행되지 않을 수 있다. iii) 디코더는 현재 블록에 대한 템플릿을 구성할 수 있다. iv) 디코더는, 현재 블록이 방향성을 가지는지 판단하기 위해 현재 블록의 좌측, 상측, 좌상측, 우상측, 좌하측에 위치한 주변 블록들에 대한 인트라 예측 방향성 모드를 유도할 수 있다. v) 현재 블록의 주변 블록들이 모두 방향성을 가지지 않는 경우(예를 들어, 비방향성 모드(DC 모드, 평면 모드, MIP 모드 등)), 디코더는 최소 코스트(Cost)를 가지는 하나의 인트라 예측 방향성 모드를 선택하고, TIMD 모드를 수행하지 않을 수 있다. 이때, 여러 개의 예측 블록을 이용하는 가중치 평균은 수행되지 않을 수 있다. vi) 현재 블록의 주변 블록들 중 방향성을 가지는 블록이 하나 이상 존재한다면, 후술하는 과정이 수행될 수 있다. 후술하는 과정은 MPM 리스트 내에 존재하는 인트라 예측 방향성 모드에 기초하여 수행될 수 있다. 67가지의 인트라 예측 방향성 모드를 모두 확인하는 경우 복잡도가 증가할 수 있기 때문이다. a. 디코더는 MPM 리스트를 구성할 수 있다. b. 다음으로, 디코더는 MPM 리스트 내에 DC 모드, 수평 모드, 수직 모드가 존재하지 않으면 MPM 리스트 내에 추가하여 MPM 리스트를 수정할 수 있다. c. 디코더는 수정된 리스트 내의 모든 인트라 예측 방향성 모드들에 대한 평가를 수행하여 코스트를 비교할 수 있다. 디코더는 가장 작은 코스트를 가지는 제1 모드와 두번째로 작은 코스트를 가지는 제2 모드를 선택할 수 있다. d. 디코더는, 정확도를 높이기 위해 제1 모드의 인트라 예측 방향성 모드 인덱스와 제2 모드의 인트라 예측 방향성 모드의 인덱스보다 1만큼 적거나 큰 인덱스에 대응되는 인트라 예측 방향성 모드에 대한 평가를 추가적으로 수행할 수 있다. 디코더는 추가적인 평가를 수행하고 가장 작은 코스트를 가지는 제3모드와 2번째로 작은 코스트를 가지는 제4 모드를 다시 선택할 수 있다. 한편, 제1 모드와 제3 모드는 서로 동일할 수 있고, 제2 모드와 제4 모드는 동일할 수 있다. e. 디코더는 제3 모드와 제4 모드의 코스트에 기초하여 가중치 평균을 수행할지 여부를 결정할 수 있다. 제3 모드의 코스트와 제4 모드의 코스트 간 차이가 특정 값보다 작다면 디코더는 가중치 평균을 수행할 수 있고, 제3 모드와 제4 모드의 가중치는 제3 모드와 제4 모드의 코스트를 기반으로 결정될 수 있다. 제3 모드의 코스트와 제4 모드의 코스트 간 차이가 특정 값보다 크다면 디코더는 가중치 평균을 수행하지 않고 제3 모드만을 사용하여 예측 블록을 생성할 수 있다. 이때 특정 값은 미리 약속된 값일 수 있다.i) The decoder can set the size of the template. The horizontal or vertical size (length) of the template may be 4, and if the horizontal or vertical size (length) of the current block is 8 or less, the horizontal or vertical size (length) of the template may be set to 2. ii) The decoder can set the type of template. The type of template can be divided into a type that uses only the left sample, a type that uses only the upper sample, and a type that uses all of the left, upper, and upper left samples. The decoder can determine the type of template depending on whether the surrounding block is valid or whether the surrounding block can be used to derive an intra prediction directional mode. Meanwhile, if neighboring blocks cannot be used to derive the intra prediction directional mode, the TIMD mode may be set to a planar mode, and weighted averaging may not be performed. iii) The decoder can construct a template for the current block. iv) The decoder may derive an intra prediction directionality mode for neighboring blocks located to the left, top, top left, top right, and bottom left of the current block to determine whether the current block has directionality. v) If the neighboring blocks of the current block are not all directional (e.g., non-directional mode (DC mode, planar mode, MIP mode, etc.)), the decoder selects one intra prediction directional mode with the minimum cost. You can select and not perform TIMD mode. At this time, weighted average using multiple prediction blocks may not be performed. vi) If there is one or more blocks with directionality among the neighboring blocks of the current block, the process described later can be performed. The process described later can be performed based on the intra prediction directional mode that exists in the MPM list. This is because complexity may increase if all 67 intra-prediction directional modes are checked. a. The decoder can construct an MPM list. b. Next, the decoder can modify the MPM list by adding DC mode, horizontal mode, and vertical mode to the MPM list if they do not exist in the MPM list. c. The decoder can compare costs by performing evaluation on all intra prediction directional modes in the modified list. The decoder can select a first mode with the lowest cost and a second mode with the second lowest cost. d. To increase accuracy, the decoder may additionally perform evaluation on the intra prediction directional mode corresponding to the index of the intra prediction directional mode of the first mode and the index of the intra prediction directional mode of the second mode by 1 less or greater than the index. . The decoder may perform additional evaluation and again select the third mode with the lowest cost and the fourth mode with the second lowest cost. Meanwhile, the first mode and the third mode may be the same, and the second mode and the fourth mode may be the same. e. The decoder may decide whether to perform weighted averaging based on the costs of the third mode and the fourth mode. If the difference between the cost of the third mode and the cost of the fourth mode is less than a certain value, the decoder can perform weighted averaging, and the weights of the third mode and fourth mode are based on the costs of the third mode and fourth mode. can be decided. If the difference between the cost of the third mode and the cost of the fourth mode is greater than a specific value, the decoder may generate a prediction block using only the third mode without performing weighted average. At this time, the specific value may be a pre-arranged value.
템플릿의 크기는 현재 블록의 가로의 길이 또는 세로의 길이에 따라 달라질 수 있다. 예를 들어, 도 23(a)와 같이 현재 블록의 가로의 길이보다 긴 상측 템플릿(Above template)이 구성될 수 있다. 이때, 상측 템플릿의 세로 길이는 미리 약속된 길이일 수 있다. 마찬가지로, 현재 블록의 세로의 길이보다 긴 좌측 템플릿(Left template)이 구성될 수 있다. 이때, 좌측 템플릿의 가로 길이는 미리 약속된 길이일 수 있다. 미리 약속된 길이는 1, 2, 3, ... 일 수 있다.The size of the template may vary depending on the horizontal or vertical length of the current block. For example, as shown in FIG. 23(a), an upper template that is longer than the horizontal length of the current block may be configured. At this time, the vertical length of the upper template may be a predetermined length. Likewise, a left template that is longer than the vertical length of the current block can be configured. At this time, the horizontal length of the left template may be a pre-arranged length. The pre-arranged length can be 1, 2, 3, ....
현재 블록이 CTU 경계에 위치해 있는 경우(현재 블록의 상하좌우 중 어느 경계가 CTU의 경계에 포함되는 경우), TIMD 모드를 위해 사용되는 템플릿을 유도/예측하기 위한 참조 픽셀은 변경될 수 있다. 도 24를 참조하면 현재 블록의 상측 경계가 CTU의 경계에 포함되는 경우, 템플릿 구성을 위해 사용되는 현재 블록의 상측에 위치한 참조 라인은 1개일 수 있다. 이는 라인 버퍼(line buffer) 메모리 사용량을 최소화하기 위함이다. 따라서, 디코더는 현재 블록의 상측 템플릿을 구성하지 않고, 현재 블록의 좌측 템플릿만 구성하여 TIMD 모드를 수행할 수 있다. 이때, 좌측 템플릿을 예측하기 위한 참조 픽셀은 현재 블록의 상측 참조 픽셀(above reference)와 좌측 참조 픽셀(left reference)이 사용될 수 있다. 이때, 좌측 템플릿의 높이는 도 24(a)와 같이 현재 블록의 높이와 동일할 수 있다. 또한, 도 24(b)와 같이 디코더는 현재 블록의 좌측에 이웃하는 블록이 이미 복원이 완료된 블록인지를 확인한 후, 만일 복원이 완료된 블록일 경우, 좌측 템플릿의 높이를 현재 블록의 높이보다 크게 구성할 수 있다.If the current block is located at a CTU boundary (when any of the upper, lower, left, and right boundaries of the current block are included in the boundary of the CTU), the reference pixel for deriving/predicting the template used for TIMD mode may be changed. Referring to FIG. 24, when the upper boundary of the current block is included in the boundary of the CTU, there may be one reference line located above the current block used to configure the template. This is to minimize line buffer memory usage. Therefore, the decoder can perform TIMD mode by configuring only the left template of the current block, without configuring the upper template of the current block. At this time, the reference pixel for predicting the left template may be the upper reference pixel (above reference) and the left reference pixel (left reference) of the current block. At this time, the height of the left template may be the same as the height of the current block, as shown in Figure 24(a). In addition, as shown in Figure 24(b), the decoder checks whether the neighboring block to the left of the current block is a block for which restoration has already been completed, and if it is a block for which restoration has been completed, the decoder configures the height of the left template to be larger than the height of the current block. can do.
일반적으로 현재 블록에 대한 예측 샘플의 정확도는 디코더가 현재 블록의 인접한 주변 픽셀을 많이 참조할수록 높아질 수 있다. 반면에, 주변 픽셀을 많이 참조하게 되면 요구되는 메모리가 증가하게 된다. 또한, 현재 블록에 인접한 주변 블록 중 아직 복원되지 않은 블록이 존재할 경우, 해당 영역은 템플릿으로 사용할 수 없다. 이러한 메모리 증가 및 복원되지 않은 영역에 대한 효과적인 처리를 위해, 도 23(b)와 같이 상측 템플릿의 길이는 현재 블록의 가로의 길이와 동일하게 좌측 템플릿의 길이는 현재 블록의 세로의 길이와 동일하게 설정될 수 있다.In general, the accuracy of prediction samples for the current block can increase as the decoder refers to more adjacent pixels of the current block. On the other hand, if many surrounding pixels are referenced, the required memory increases. Additionally, if there are blocks that have not yet been restored among the surrounding blocks adjacent to the current block, the corresponding area cannot be used as a template. In order to increase memory and effectively process unrestored areas, the length of the upper template is the same as the horizontal length of the current block, and the length of the left template is the same as the vertical length of the current block, as shown in Figure 23(b). can be set.
디코더는 현재 블록에 대한 예측 샘플을 획득하는데 템플릿을 이용하여 유도되는 인트라 예측 모드를 사용할 수 있다. 디코더는 현재 블록에 인접한 주변 픽셀을 이용하여 예측 샘플을 생성할 수 있고, 예측 샘플을 생성하기 위해 어떠한 주변 픽셀을 사용할 것인지 적응적으로 선택할 수 있다. 또한, 디코더는 예측 샘플을 생성하기 위해 다중 참조 라인을 사용할 수 있는데, 이때 다중 참조 라인의 인덱스 정보는 비트스트림에 포함될 수 있다. The decoder may use an intra prediction mode derived using a template to obtain a prediction sample for the current block. The decoder can generate prediction samples using neighboring pixels adjacent to the current block, and can adaptively select which neighboring pixels to use to generate the prediction samples. Additionally, the decoder may use multiple reference lines to generate prediction samples, and in this case, index information of multiple reference lines may be included in the bitstream.
엔트로피 코딩을 위해서, TIMD 모드를 위한 다중 참조 라인의 인덱스에 대한 컨텍스트(context)가 새롭게 정의될 수 있다. 컨텍스트 종류의 증가는 메모리 및 컨텍스트 스위칭 복잡도와 관련될 수 있다. 따라서, TIMD 모드에서 사용되는 다중 참조 라인의 인덱스를 코딩 및 디코딩하기 위해 사용되는 컨텍스트는 기존의 다중 참조 라인의 인덱스에 대한 컨텍스트를 재사용한 것일 수 있다.For entropy coding, a context for the index of multiple reference lines for TIMD mode can be newly defined. The increase in context types may be related to memory and context switching complexity. Therefore, the context used to code and decode the index of a multiple reference line used in TIMD mode may be a reused context for the index of an existing multiple reference line.
현재 블록의 잔차 신호에 대한 변환은 2단계로 진행될 수 있다. 1차 변환은 DCT-II, DST-VII, DCT-VIII, DCT5, DST4, DST1, identity transformation (IDT) 등의 변환을 수평 그리고 수직에 각각 적응적으로 적용되는 것일 수 있다. 1차 변환이 완료된 변환 계수에 2차 변환이 추가적으로 적용될 수 있고, 2차 변환은 1차 변환된 변환 계수와 미리 정의된 매트릭스(matrix) 간의 행렬 곱으로 계산될 수 있다. 2차 변환은 저대역 비분리 변환(Low Frequency Non-Separable Transform, LFNST)로 기술될 수 있다. 2차 변환을 위한 매트릭스 변환 세트는 현재 블록의 인트라 예측 모드에 따라 달라질 수 있다. 2차 변환에 사용되는 변환 매트릭스의 계수 정보는 비트스트림에 포함될 수 있다.Conversion of the residual signal of the current block can be performed in two steps. The primary transformation may be adaptively applying transformations such as DCT-II, DST-VII, DCT-VIII, DCT5, DST4, DST1, and identity transformation (IDT) horizontally and vertically, respectively. A secondary transformation may be additionally applied to the transformation coefficient for which the primary transformation has been completed, and the secondary transformation may be calculated as a matrix product between the primary transformed transformation coefficient and a predefined matrix. The secondary transform can be described as a low frequency non-separable transform (LFNST). The matrix transformation set for secondary transformation may vary depending on the intra prediction mode of the current block. Coefficient information of the transformation matrix used for secondary transformation may be included in the bitstream.
DIMD 모드 또는 TIMD 모드가 적용되는 현재 블록에 2차 변환이 적용되는 경우, 2차 변환에 대한 변환 세트는 DIMD 모드 또는 TIMD 모드로 유도된 인트라 예측 모드에 기초하여 결정될 수 있다. 2차 변환에 사용되는 변환 매트릭스의 계수 정보는 비트스트림에 포함될 수 있다. 디코더는 비트스트림에 포함된 계수 정보를 파싱하여 DIMD 모드 또는 TIMD 모드를 위한 2차 변환의 매트릭스 계수 정보를 설정할 수 있다. 이때, TIMD 모드로부터 유도된 2개의 인트라 예측 모드들 중에서 하나가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 2개의 인트라 예측 방향성 모드 각각의 코스트를 비교하여 가장 작은 코스트를 가지는 인트라 예측 방향성 모드가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 또한, DIMD로부터 유도된 2개의 인트라 예측 방향성 모드들 중에서 하나가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 2개의 인트라 예측 모드 각각의 가중치를 비교하여 가장 높은 가중치를 가지는 인트라 예측 방향성 모드가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다.When a secondary transform is applied to the current block to which DIMD mode or TIMD mode is applied, the transform set for the secondary transform may be determined based on the intra prediction mode derived in DIMD mode or TIMD mode. Coefficient information of the transformation matrix used for secondary transformation may be included in the bitstream. The decoder can set matrix coefficient information of secondary transformation for DIMD mode or TIMD mode by parsing coefficient information included in the bitstream. At this time, one of the two intra prediction modes derived from the TIMD mode can be used to select the first or second transform set. By comparing the costs of each of the two intra prediction directional modes, the intra prediction directional mode with the smallest cost can be used to select the first or second transform set. Additionally, one of the two intra prediction directional modes derived from DIMD can be used to select either the first-order transform or the second-order transform set. By comparing the weights of each of the two intra prediction modes, the intra prediction directional mode with the highest weight can be used to select the first or second transformation set.
TIMD 모드는 현재 블록의 템플릿을 예측하고, 템플릿으로부터 유도된 인트라 예측 모드를 현재 블록의 예측 블록을 생성하는데 사용하는 모드이므로 복잡도가 높다. 따라서, 디코더가 템플릿 영역에 대한 예측 템플릿을 생성할 때, 기존의 참조 샘플 필터링 과정을 수행하지 않을 수 있다. 또한, 현재 블록에 ISP 모드가 적용되는 경우 또는 현재 블록이 CIIP 모드로 적용되는 경우, TIMD 모드가 적용되지 않을 수 있다. TIMD 모드가 적용된 현재 블록에는 ISP 모드 또는 CIIP 모드가 적용되지 않을 수 있거나 ISP 또는 CIIP와 관련된 신택스가 파싱되지 않을 수 있다. 이때 파싱되지 않는 ISP 또는 CIIP와 관련된 신택스의 값은 미리 지정된 값으로 추론(infer)될 수 있다.TIMD mode has high complexity because it predicts the template of the current block and uses the intra prediction mode derived from the template to generate the prediction block of the current block. Therefore, when the decoder generates a prediction template for the template area, the existing reference sample filtering process may not be performed. Additionally, if ISP mode is applied to the current block or if the current block is applied in CIIP mode, TIMD mode may not be applied. ISP mode or CIIP mode may not be applied to the current block to which TIMD mode is applied, or syntax related to ISP or CIIP may not be parsed. At this time, the value of the syntax related to the ISP or CIIP that is not parsed may be inferred as a pre-designated value.
템플릿 예측은 현재 블록에 인접한 좌측 템플릿 영역과 상측 템플릿 영역으로 나누어져 수행될 수 있고, 각 템플릿마다 인트라 예측 모드가 유도될 수 있다. 또한 각 템플릿마다 인트라 예측 모드가 2개 이상 유도될 수 있고, 현재 블록에 대한 인트라 예측 모드는 4개 이상이 될 수 있다. 인트라 예측 모드가 2개 이상인 경우, 현재 블록에 대한 예측 샘플은 유도된 인트라 예측 모드들을 모두 사용하여 생성될 수 있고, 디코더는 생성된 예측 샘플들을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성할 수 있다. 이때, 예측 샘플을 생성하기 위해 템플릿 예측으로부터 유도된 2개 이상의 인트라 예측 모드들, 평면 모드, DC 모드, MIP 모드 중에서 적어도 3개 이상이 사용될 수 있다. 예를 들어, 디코더가 현재 블록에 대한 예측 샘플을 생성(획득)할 때, 디코더는 템플릿 예측으로 유도된 인트라 예측 모드들과 평면 모드를 사용하여 생성한 예측 샘플들을 가중치 평균하여 최종 예측 샘플을 생성할 수 있다.Template prediction can be performed by dividing into a left template area adjacent to the current block and an upper template area, and an intra prediction mode can be derived for each template. Additionally, two or more intra prediction modes can be derived for each template, and there can be four or more intra prediction modes for the current block. If there are two or more intra prediction modes, the prediction sample for the current block can be generated using all of the derived intra prediction modes, and the decoder can generate the final prediction block for the current block by weight-averaging the generated prediction samples. You can. At this time, at least three of two or more intra prediction modes, planar mode, DC mode, and MIP mode derived from template prediction can be used to generate the prediction sample. For example, when the decoder generates (obtains) a prediction sample for the current block, the decoder generates the final prediction sample by weighting the intra prediction modes derived from template prediction and the prediction samples generated using the planar mode. can do.
CIIP 모드가 적용되는 경우에도 상술한 방법들을 이용하여 예측 샘플은 생성될 수 있다. CIIP 모드는 현재 블록에 대한 예측 샘플(블록)을 생성할 때, 인트라 예측과 인터 예측을 모두 사용하는 방법이다. 현재 블록에 대한 예측 샘플은 인트라 예측 샘플과 인터 예측 샘플 간의 가중치 평균으로 생성될 수 있다.Even when CIIP mode is applied, prediction samples can be generated using the methods described above. CIIP mode is a method that uses both intra prediction and inter prediction when generating prediction samples (blocks) for the current block. The prediction sample for the current block may be generated as a weighted average between intra prediction samples and inter prediction samples.
CIIP 모드를 적용하여 인트라 예측 샘플이 생성되는 경우, DIMD 모드 또는 TIMD 모드가 사용될 수 있다. 이때 DIMD 모드가 사용되는 경우, 인트라 예측 샘플은 DIMD 조합 정보에 기초하여 생성될 수 있다. 예를 들어, 디코더는 가중치가 가장 높은 인트라 예측 모드를 사용하여 제1 예측 샘플을 생성하고 2번째로 가중치가 높은 인트라 예측 모드를 사용하여 제2 예측 샘플을 생성할 수 있다. 그리고, 디코더는 제1 예측 샘플과 제2 예측 샘플을 가중치 평균하여 최종 인트라 예측 블록을 생성할 수 있다. 이때, 디코더는 현재 블록의 주변 블록들 중 평면 모드로 예측된 샘플과 제1 예측 샘플, 제2 예측 샘플 총 3개의 예측 샘플들을 가중치 평균하여 최종 인트라 예측 블록을 생성할 수 있다. TIMD 모드가 사용되는 경우, 인트라 예측 샘플은 TIMD 조합 정보에 기초하여 생성될 수 있다. 예를 들어, 디코더는 2개의 인트라 예측 모드 각각을 사용하여 2개의 예측 샘플을 생성할 수 있다. 그리고, 디코더는 2개의 예측 샘플을 가중치 평균하여 최종 인트라 예측 샘플을 생성할 수 있다. 이때, 디코더는 2개의 예측 샘플과 평면 모드로 예측된 샘플을 가중치 평균하여 최종 인트라 예측 샘플을 생성할 있다.When intra prediction samples are generated by applying CIIP mode, DIMD mode or TIMD mode can be used. At this time, when DIMD mode is used, intra prediction samples can be generated based on DIMD combination information. For example, the decoder may generate a first prediction sample using the intra prediction mode with the highest weight and generate a second prediction sample using the intra prediction mode with the second highest weight. And, the decoder may generate a final intra prediction block by performing a weighted average of the first prediction sample and the second prediction sample. At this time, the decoder may generate a final intra prediction block by performing a weighted average of a total of 3 prediction samples, including a sample predicted in planar mode, a first prediction sample, and a second prediction sample, among the neighboring blocks of the current block. When TIMD mode is used, intra prediction samples can be generated based on TIMD combination information. For example, the decoder may generate two prediction samples using each of the two intra prediction modes. Then, the decoder can generate the final intra prediction sample by performing a weighted average of the two prediction samples. At this time, the decoder can generate the final intra prediction sample by performing a weighted average of the two prediction samples and the sample predicted in planar mode.
인트라 예측 샘플은 위치에 따라 정확도가 달라질 수 있다. 즉, 예측 샘플 내 예측에 사용된 주변 픽셀과 거리가 먼 위치의 픽셀은 거리가 가까운 위치의 픽셀보다 더 많은 잔차 신호를 포함할 수 있다. 따라서, 디코더는 인트라 예측 모드의 방향에 따라 예측 샘플을 수직, 수평, 대각선 방향으로 분할하고, 예측에 사용된 주변 픽셀과의 거리에 따라 가중치를 다르게 설정할 수 있다. 이는 CIIP 모드를 사용하여 생성한 인트라 예측 블록 또는 2개 이상의 인트라 예측 모드를 사용하여 생성한 인트라 예측 블록에 적용될 수 있으며, 참조 픽셀의 위치와 예측 블록 내 픽셀 위치 간의 거리에 따라 예측 블록 내 픽셀마다 가중치를 다르게 설정할 수 있다. 실시 일 예로, 현재 블록의 인트라 예측 모드가 수직 방향 또는 수직과 유사한 방향을 가지는 모드일 경우, 예측 블록의 픽셀 위치가 상단 픽셀과 거리가 가까울수록 높은 가중치가 설정되고 상단 픽셀과 거리가 먼 픽셀 위치일수록 낮은 가중치가 각 픽셀 위치마다 설정될 수 있다. The accuracy of intra prediction samples may vary depending on location. That is, pixels located at a distance from neighboring pixels used for prediction within the prediction sample may contain more residual signals than pixels located at a closer location. Accordingly, the decoder can divide prediction samples into vertical, horizontal, and diagonal directions depending on the direction of the intra prediction mode, and set weights differently depending on the distance from neighboring pixels used for prediction. This can be applied to intra-prediction blocks created using CIIP mode, or to intra-prediction blocks created using more than one intra-prediction mode, for each pixel within a prediction block depending on the distance between the location of the reference pixel and the pixel location within the prediction block. Weights can be set differently. As an example of an embodiment, when the intra prediction mode of the current block is a mode having a vertical direction or a direction similar to vertical, a higher weight is set as the pixel position of the prediction block is closer to the top pixel, and the pixel position farther from the top pixel is set. The lower the weight, the lower the weight can be set for each pixel position.
현재 블록이 CIIP 모드로 부호화되는 경우, 디코더는 인트라 예측 샘플과 인터 예측 샘플을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 인터 예측 샘플에서의 픽셀 단위 가중치는 인트라 예측 샘플의 픽셀 단위 가중치를 고려하여 설정될 수 있다. 예를 들어, 인터 예측 샘플의 픽셀 단위 가중치는 전체 가중치의 합에서 인트라 예측 샘플의 픽셀 단위 가중치를 뺀 값이 될 수 있다. 이때, 전체 가중치의 합은 픽셀 단위에서 인트라 예측 샘플의 가중치와 인터 예측 샘플의 가중치가 더해진 값일 수 있다.If the current block is encoded in CIIP mode, the decoder can generate the final prediction block by weighting the intra prediction sample and the inter prediction sample. The pixel-level weight in the inter-prediction sample can be set considering the pixel-level weight in the intra-prediction sample. For example, the pixel weight of the inter prediction sample may be the sum of all weights minus the pixel weight of the intra prediction sample. At this time, the sum of all weights may be the sum of the weights of the intra prediction samples and the weights of the inter prediction samples on a pixel basis.
예측 샘플 생성을 위해 2개 이상의 인트라 예측 모드가 사용되는 경우, 디코더는 각 인트라 예측 모드에 기초하여 예측 샘플을 각각 생성하고, 생성된 예측 샘플들을 가중치 평균하여 최종 예측 샘플을 생성할 수 있다. 각 인트라 예측 모드에 대한 예측 샘플을 생성할 때, 인트라 예측 모드에 따른 픽셀 단위 가중치가 적용될 수 있다.When two or more intra prediction modes are used to generate prediction samples, the decoder may generate prediction samples based on each intra prediction mode and perform a weighted average on the generated prediction samples to generate the final prediction sample. When generating prediction samples for each intra prediction mode, pixel-level weights according to the intra prediction mode may be applied.
픽셀 단위 가중치는 인트라 예측 모드, 현재 블록의 가로의 길이, 세로의 길이, 양자화 파라미터, 현재 블록이 휘도 인지 또는 색차 인지에 대한 정보, 주변 블록의 인트라 코딩 여부, 주변 블록의 잔여 변환 계수에 대한 존재 유무 정보 등 적어도 어느 하나에 기초하여 설정될 수 있다.The pixel-level weights include the intra prediction mode, the horizontal length and vertical length of the current block, quantization parameters, information about whether the current block is luminance or chrominance, whether the surrounding block is intra-coded, and the presence of residual transform coefficients of the surrounding block. It can be set based on at least one thing, such as presence/absence information.
도 25 내지 도 28은 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인에 기초하여 예측 샘플(픽셀)을 생성하는 방법을 나타내는 도면이다.25 to 28 are diagrams showing a method of generating prediction samples (pixels) based on a plurality of reference pixel lines according to an embodiment of the present invention.
도 25(a)를 참조하면, 비디오 신호 처리 장치는 현재 블록(2501)에 인접한 제1 참조 픽셀 라인 (reference line 1)과 제1 참조 픽셀 라인에 상측으로 인접한 제2 참조 픽셀 라인(reference line 2)에 기초하여 현재 블록 내 예측 샘플(2502)을 생성할 수 있다. 도 25(a)의 예측 샘플 샘플 (2502)은 본 발명의 일 실시예에 따른 위치에 대응되는 샘플일 뿐, 픽셀의 위치는 이에 한정되지 않는다. 본 명세서에서 비디오 신호 처리 장치가 생성한다는 의미는 비디오 신호 처리 장치가 획득한다는 의미와 동일할 수 있다. 도 25(b)는 도 25(a)를 보다 자세하게 나타낸 도면이다. 예를 들어, 비디오 신호 처리 장치는 제1 참조 픽셀 라인의 6개의 참조 픽셀들을 통해, 인트라 예측 모드에 따라 스무딩(smoothing) 필터, 큐빅(cubic) 또는 가우시안(gaussian) 필터를 사용하여 제1 예측 픽셀(2503)을 생성할 수 있다. 그리고, 비디오 신호 처리 장치는 제2 참조 픽셀 라인의 6개의 참조 픽셀들을 통해, 인트라 예측 모드에 따라 스무딩(smoothing) 필터, 큐빅(cubic) 또는 가우시안(gaussian) 필터를 사용하여 제2 예측 픽셀(2504)을 생성할 수 있다. 비디오 신호 처리 장치는 생성한 제1 예측 픽셀(2503)과 제2 예측 픽셀(2504)에 대해 임의의 정해진 가중치를 통해 가중치 평균을 수행하여 제3 예측 픽셀(2505)을 생성할 수 있다. 이때, 제2 참조 픽셀 라인의 6개의 참조 픽셀들은, 현재 블록의 인트라 예측 모드, 생성할 픽셀 위치, 참조 픽셀 라인의 위치 등을 고려하여 제1 참조 픽셀 라인의 각 픽셀들보다 오른쪽으로 한 픽셀만큼 이동한 위치의 참조 픽셀들일 수 있다. 비디오 신호 처리 장치는 제3 예측 픽셀(2505)에 기초하여 현재 블록 내 예측 샘플(2502)을 생성할 수 있다. 또는 비디오 신호 처리 장치는 제3 예측 픽셀(2505) 및, 제3 예측 픽셀(2505)과 현재 블록 내 예측 샘플(2502)간의 거리에 기초하여 현재 블록 내 예측 샘플(2502)을 생성할 수 있다. 비디오 신호 처리 장치가 제3 예측 픽셀(2505)을 생성하기 위해 사용하는 가중치는 0이상의 정수 일 수 있다. 예를 들어, 제1 예측 픽셀(2503)의 가중치는 3일 수 있고, 제2 예측 픽셀(2504)의 가중치는 1일 수 있다. 이때, 현재 블록의 인트라 예측 모드, 생성되는 픽셀의 위치(예를 들어, 도 25의 제1 예측 픽셀(2503)의 위치, 제2 예측 픽셀(2504)의 위치 제3 예측 픽셀(2505)의 위치), 참조 픽셀 라인의 위치(예를 들어, 도 25의 제1 참조 픽셀 라인, 제2 참조 픽셀 라인의 위치) 등 적어도 하나 이상에 기초하여 예측 샘플을 생성하기 위해 사용되는 참조 픽셀의 위치(도 25의 제1 참조 픽셀 라인의 6개의 참조 픽셀의 위치, 제2 참조 픽셀 라인의 6개의 참조 픽셀의 위치)는 달라질 수 있다.Referring to FIG. 25(a), the video signal processing device includes a first reference pixel line (reference line 1) adjacent to the current block 2501 and a second reference pixel line (reference line 2) upwardly adjacent to the first reference pixel line. ) A prediction sample 2502 within the current block can be generated based on . The predicted sample sample 2502 in FIG. 25(a) is only a sample corresponding to a position according to an embodiment of the present invention, and the pixel position is not limited to this. In this specification, the meaning of generating by a video signal processing device may be the same as the meaning of acquiring by the video signal processing device. FIG. 25(b) is a view showing FIG. 25(a) in more detail. For example, the video signal processing device uses a smoothing filter, a cubic, or a Gaussian filter depending on the intra prediction mode to determine the first prediction pixel through six reference pixels of the first reference pixel line. (2503) can be generated. And, the video signal processing device uses the six reference pixels of the second reference pixel line to generate a second prediction pixel (2504) using a smoothing filter, cubic or Gaussian filter according to the intra prediction mode. ) can be created. The video signal processing device may generate the third prediction pixel 2505 by performing a weighted average on the generated first prediction pixel 2503 and the second prediction pixel 2504 using an arbitrarily determined weight. At this time, the six reference pixels of the second reference pixel line are located one pixel to the right of each pixel of the first reference pixel line, considering the intra prediction mode of the current block, the pixel position to be generated, the position of the reference pixel line, etc. These may be reference pixels of the moved location. The video signal processing device may generate a prediction sample 2502 within the current block based on the third prediction pixel 2505. Alternatively, the video signal processing device may generate the current intra-block prediction sample 2502 based on the third prediction pixel 2505 and the distance between the third prediction pixel 2505 and the current intra-block prediction sample 2502. The weight used by the video signal processing device to generate the third prediction pixel 2505 may be an integer of 0 or more. For example, the weight of the first prediction pixel 2503 may be 3, and the weight of the second prediction pixel 2504 may be 1. At this time, the intra prediction mode of the current block, the location of the generated pixel (e.g., the location of the first prediction pixel 2503 in FIG. 25, the location of the second prediction pixel 2504, and the location of the third prediction pixel 2505) ), the location of the reference pixel used to generate a prediction sample based on at least one or more such as the location of the reference pixel line (e.g., the location of the first reference pixel line and the second reference pixel line in FIG. 25) (FIG. The positions of the six reference pixels of the first reference pixel line of 25 and the positions of the six reference pixels of the second reference pixel line of 25) may vary.
도 26(a)를 참조하면, 비디오 신호 처리 장치는 2개의 참조 픽셀 라인이 수직 방향으로 동일한 위치의 참조 픽셀들을 이용하여 현재 블록 내 예측 샘플(2601)을 생성할 수 있다. 즉, 현재 블록 내 예측 샘플을 생성하기 위해 사용되는 제1 참조 픽셀 라인(Reference line 1)의 6개의 픽셀 각각과 제2 참조 픽셀 라인(Reference line 2)의 6개의 픽셀 각각은 수직 방향의 위치가 동일할 수 있다. 참조 픽셀 라인의 위치에 상관없이 각 픽셀들의 위치는 결정될 수 있다. 도 26(b)를 참조하면 비디오 신호 처리 장치는 제1 참조 라인의 6개의 픽셀을 이용하여 제1 예측 픽셀(2602)를 생성할 수 있다. 비디오 신호 처리 장치는 제2 참조 라인의 6개의 픽셀(2607)을 이용하여 제2 예측 픽셀(2603)을 획득할 수 있다. 이때, 제1 참조 라인과 수직 방향으로 동일한 제2 참조 라인의 샘플이 사용되는 경우, 제2 참조 라인의 오른쪽 픽셀(2606)은 사용되지 않을 수 있다. 따라서, 비디오 신호 처리 장치는 제2 참조 라인의 오른쪽 픽셀(2606)을 픽셀(2605)을 복사(패딩)하여 제2 참조 라인의 오른쪽 픽셀(2606)을 구성한 다음, 제2 참조 라인의 오른쪽 픽셀(2606)을 제2 예측 픽셀(2603)을 생성하는데 사용할 수 있다. 비디오 신호 처리 장치는 제1 예측 픽셀(2602)와 제2 예측 픽셀(2603)을 이용하여 제3 예측 픽셀(2604)를 획득할 수 있다. 비디오 신호 처리 장치는 제3 예측 픽셀(2604)를 이용하여 현재 블록 내 예측 샘플(2601)을 생성 할 수 있다. 도 26은 현재 블록 내 예측 샘플을 생성하기 위해 사용되는 제1, 제2 참조 픽셀 라인의 픽셀들만 도 25와 상이할 뿐, 현재 블록 내 예측 샘플을 생성하는 방법은 도 25와 동일할 수 있다.Referring to FIG. 26(a), the video signal processing device may generate a prediction sample 2601 within the current block using reference pixels in which two reference pixel lines are positioned at the same vertical direction. That is, each of the six pixels of the first reference pixel line (Reference line 1) and each of the six pixels of the second reference pixel line (Reference line 2) used to generate the prediction sample within the current block have a vertical position. may be the same. The position of each pixel can be determined regardless of the position of the reference pixel line. Referring to FIG. 26(b), the video signal processing device may generate a first prediction pixel 2602 using six pixels of the first reference line. The video signal processing device may obtain a second prediction pixel 2603 using six pixels 2607 of the second reference line. At this time, when a sample of the same second reference line in the vertical direction as the first reference line is used, the right pixel 2606 of the second reference line may not be used. Accordingly, the video signal processing device constructs the right pixel 2606 of the second reference line by copying (padding) the pixel 2605 and then constructing the right pixel 2606 of the second reference line ( 2606) can be used to generate the second prediction pixel 2603. The video signal processing device may obtain the third prediction pixel 2604 using the first prediction pixel 2602 and the second prediction pixel 2603. The video signal processing device may generate a prediction sample 2601 within the current block using the third prediction pixel 2604. FIG. 26 is different from FIG. 25 only in the pixels of the first and second reference pixel lines used to generate the prediction sample within the current block, and the method of generating the prediction sample within the current block may be the same as that of FIG. 25.
비디오 신호 처리 장치는 MPM 리스트를 구성할 때, 현재 블록에 인접한 복원된 주변 블록으로부터 인트라 예측 방향성 모드를 유도하는 DIMD 모드를 MPM 리스트에 포함시킬 수 있다. 이때, DIMD 모드로 유도된 인트라 예측 방향성 모드가 2개인 경우, 비디오 신호 처리 장치는 2개의 인트라 예측 방향성 모드를 MPM 리스트에 모두 포함시킬 수 있다.When constructing an MPM list, the video signal processing device may include a DIMD mode that derives an intra prediction directional mode from a reconstructed neighboring block adjacent to the current block in the MPM list. At this time, when there are two intra prediction directionality modes derived from the DIMD mode, the video signal processing device can include both of the two intra prediction directionality modes in the MPM list.
비디오 신호 처리 장치가 복수의 참조 픽셀 라인을 사용하여 현재 블록에 대한 예측 샘플을 생성(도 25, 26의 방법)하는 경우, MPM 리스트 내에 포함되는 DIMD 모드는 현재 블록에 인접한 픽셀이 사용되지 않고, 비디오 신호 처리 장치는 참조 픽셀 라인이 지시하는 픽셀 위치에서 DIMD 방법을 수행하여 인트라 예측 방향성 모드를 유도할 수 있다. 그리고 유도된 인트라 예측 방향성 모드가 MPM 리스트에 포함될 수 있다.When a video signal processing device generates a prediction sample for the current block using a plurality of reference pixel lines (method of FIGS. 25 and 26), the DIMD mode included in the MPM list is such that pixels adjacent to the current block are not used, A video signal processing device may derive an intra prediction directional mode by performing a DIMD method at a pixel position indicated by a reference pixel line. And the derived intra prediction directional mode may be included in the MPM list.
또한, 비디오 신호 처리 장치는 참조 픽셀 라인마다 DIMD를 사용하여 인트라 예측 방향성 모드를 유도한 후, 유도된 인트라 예측 방향성 모드를 MPM 리스트에 추가할 수 있다. 참조 픽셀 라인은 현재 블록의 좌상단 위치로부터 1, 3, 5, 7, 12의 픽셀만큼 이격된 위치의 라인일 수 있다. 또는 참조 픽셀 라인은 현재 블록에 상측으로 인접한 위치인 참조 픽셀 라인일 수 있다. 이때, 비디오 신호 처리 장치가 각 참조 픽셀 라인마다 DIMD를 사용하여 유도한 인트라 예측 방향성 모드는 MPM 리스트에 추가될 수 있다. 유도된 인트라 예측 방향성 모드가 중복되면, 중복된 인트라 예측 방향성 모드는 MPM 리스트에서 제외될 수 있다. 본 명세서에서 참조 픽셀 라인은 인덱싱될 수 있다. 예를 들어, 현재 블록과 인접한 참조 픽셀 라인은 참조 픽셀 라인 0으로, 현재 블록과 1 픽셀만큼, 2픽셀만큼, ... n 픽셀만큼 이격된 참조 픽셀 라인은 각각 참조 픽셀 라인 1로, 참조 픽셀 라인 2, ... 참조 픽셀 라인 n으로 인덱싱되고, 지칭될 수 있다.Additionally, the video signal processing device may derive an intra-prediction directional mode using DIMD for each reference pixel line and then add the derived intra-prediction directional mode to the MPM list. The reference pixel line may be a line positioned 1, 3, 5, 7, or 12 pixels away from the upper left position of the current block. Alternatively, the reference pixel line may be a reference pixel line located above and adjacent to the current block. At this time, the intra prediction directional mode derived by the video signal processing device using DIMD for each reference pixel line may be added to the MPM list. If the derived intra-prediction directional modes overlap, the overlapping intra-prediction directional modes may be excluded from the MPM list. Reference pixel lines may be indexed herein. For example, a reference pixel line adjacent to the current block is referred to as reference pixel line 0, and a reference pixel line that is 1 pixel away from the current block, 2 pixels away, ... n pixels away from the current block is referred to as reference pixel line 1, respectively. Line 2, ... may be indexed and referred to as reference pixel line n.
예를 들어, 비디오 신호 처리 장치는 현재 블록에 대한 참조 픽셀 라인이 1, 3 인 경우, 참조 픽셀 라인 0, 1, 2를 사용하여 DIMD를 수행하고, 인트라 예측 방향성 모드를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록에 대한 참조 픽셀 라인이 5, 7 인 경우, 참조 픽셀 라인 5, 6, 7을 사용하여 DIMD를 수행하고, 인트라 예측 방향성 모드를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록에 대한 참조 픽셀 라인이 12 인 경우, 참조 픽셀 라인 11, 12, 13을 사용하여 DIMD가 수행하고 인트라 예측 방향성 모드를 유도할 수 있다.For example, when the reference pixel lines for the current block are 1 and 3, the video signal processing device may perform DIMD using reference pixel lines 0, 1, and 2 and derive an intra prediction directional mode. Additionally, when the reference pixel lines for the current block are 5 and 7, the video signal processing device may perform DIMD using reference pixel lines 5, 6, and 7 and derive an intra prediction directional mode. Additionally, when the reference pixel line for the current block is 12, the video signal processing device may perform DIMD using reference pixel lines 11, 12, and 13 and derive an intra prediction directional mode.
현재 블록이 DIMD 모드로 부호화되는 경우, 인코더는 인트라 예측 방향성 모드를 유도하기 위해 사용되어야 할 참조 픽셀 라인과 관련된 정보를 포함하여 비트스트림을 생성하고, 시그널링할 수 있다. 그리고 인코더는 DIMD가 수행된 참조 픽셀 라인과 DIMD로부터 유도된 인트라 예측 방향성 모드를 사용하여 인트라 예측 블록을 생성할 수 있다. 디코더는 현재 블록이 DIMD 모드로 복호화되는 경우, 참조 픽셀 라인과 관련된 정보를 파싱한 후, 참조 픽셀 라인과 관련된 정보에 대응되는 참조 픽셀 라인을 사용하여 인트라 예측 방향성 모드를 유도할 수 있다. 그리고 디코더는 참조 픽셀 라인 정보와 DIMD로부터 유도된 인트라 예측 방향성 모드를 사용하여 인트라 예측 블록을 생성할 수 있다.If the current block is encoded in DIMD mode, the encoder can generate and signal a bitstream including information related to the reference pixel line that should be used to derive the intra prediction directional mode. And the encoder can generate an intra prediction block using the reference pixel line on which DIMD was performed and the intra prediction directional mode derived from DIMD. When the current block is decoded in DIMD mode, the decoder may parse information related to the reference pixel line and then derive an intra prediction directional mode using the reference pixel line corresponding to the information related to the reference pixel line. And the decoder can generate an intra prediction block using reference pixel line information and an intra prediction directional mode derived from DIMD.
도 27을 참조하면 비디오 신호 처리 장치는 복수 개의 참조 픽셀 라인을 이용하여 가상의 새로운 참조 픽셀 라인을 생성하고, 새로운 참조 픽셀 라인에 기초하여 현재 블록 내 예측 샘플을 생성할 수 있다.Referring to FIG. 27, a video signal processing device may generate a virtual new reference pixel line using a plurality of reference pixel lines and generate a prediction sample within the current block based on the new reference pixel line.
도 27의 같은 가로 열의 원은 동일한 참조 픽셀 라인 상에 위치한 픽셀을 의미할 수 있다. 도 27(a)는 현재 블록의 인트라 예측 모드, 생성할 픽셀 위치, 참조 픽셀 라인의 위치 등 적어도 하나 이상을 사용하여 예측 샘플을 생성할 때 사용되는 참조 픽셀의 위치가 참조 픽셀 라인마다 달라지는 것을 보여준다. 비디오 신호 처리 장치는 인트라 예측 모드에 따라 스무딩 필터, 큐빅 필터 또는 가우시안 필터를 사용하여 각 참조 픽셀 라인마다 '1' 위치의 샘플들(2701-a 내지 2701-d)을 각각 생성하고, 여러 개의 '1' 위치의 샘플들을 사용하여 가상의 새로운 참조 픽셀 라인(2702)을 생성할 수 있다. 한편, 복잡도를 낮추기 위해서, '1' 위치의 샘플들이 생성되지 않고, '1' 위치에 가장 가까운 곳에 인접한 정수 단위 참조 픽셀들을 사용하여 가상의 새로운 참조 픽셀 라인(2702)이 생성될 수 있다. 비디오 신호 처리 장치는 가상의 새로운 참조 픽셀 라인을 사용하여 현재 블록 내 예측 샘플을 생성할 수 있다. 도 27(b)를 참조하면 비디오 신호 처리 장치는 가상의 새로운 참조 픽셀 라인(2705)을 생성하기 위해서 수직 방향으로 동일한 위치의 4개 참조 픽셀들을 사용할 수 있다. 즉, 가상의 새로운 참조 픽셀 라인(2705)을 생성하기 위한 픽셀들은 제1 참조 픽셀 라인의 6개의 참조 픽셀들 각각과 제2 참조 픽셀 라인의 6개의 참조 픽셀들은 각각 수직 방향으로 동일한 위치의 픽셀들일 수 있다. 비디오 신호 처리 장치는 가상의 새로운 참조 픽셀 라인 및 위치, 현재 블록의 인트라 예측 모드, 생성할 픽셀 위치 등 적어도 하나 이상을 사용하여 제1 예측 픽셀(2703)를 획득할 수 있다. 비디오 신호 처리 장치는 제1 예측 픽셀(2703)를 이용하여 현재 블록의 예측 샘플(2704)을 생성할 수 있다. 가상의 새로운 참조 픽셀 라인을 생성하기 위해 사용되는 참조 픽셀 라인의 수는 2이상의 복수 개일 수 있다. 예를 들어, 2 내지 5개의 참조 픽셀 라인이 사용될 수 있다.Circles in the same horizontal row in FIG. 27 may mean pixels located on the same reference pixel line. Figure 27(a) shows that the position of the reference pixel used when generating a prediction sample using at least one of the intra prediction mode of the current block, the pixel position to be generated, and the position of the reference pixel line varies for each reference pixel line. . The video signal processing device generates samples 2701-a to 2701-d at the '1' position for each reference pixel line using a smoothing filter, a cubic filter, or a Gaussian filter depending on the intra prediction mode, and multiple '1' position samples 2701-a to 2701-d. A new virtual reference pixel line 2702 can be created using samples at the 1' position. Meanwhile, in order to reduce complexity, samples at the '1' position may not be generated, and a virtual new reference pixel line 2702 may be generated using integer reference pixels closest to the '1' position. A video signal processing device can generate prediction samples within the current block using a virtual new reference pixel line. Referring to FIG. 27(b), the video signal processing device can use four reference pixels at the same position in the vertical direction to create a virtual new reference pixel line 2705. That is, the pixels for generating the virtual new reference pixel line 2705 are each of the six reference pixels of the first reference pixel line and the six reference pixels of the second reference pixel line are pixels at the same position in the vertical direction. You can. The video signal processing device may acquire the first prediction pixel 2703 using at least one of a virtual new reference pixel line and position, an intra prediction mode of the current block, and a pixel position to be generated. The video signal processing device may generate a prediction sample 2704 of the current block using the first prediction pixel 2703. The number of reference pixel lines used to generate a virtual new reference pixel line may be two or more. For example, 2 to 5 reference pixel lines may be used.
도 28을 참조하면 비디오 신호 처리 장치는 가상의 새로운 참조 픽셀 라인을 생성하기 위해 생성할 새로운 참조 픽셀(2801)의 위치와 가까운 4개의 참조 픽셀이 사용될 수 있다. 이때 새로운 참조 픽셀의 위치는 참조 픽셀 라인과 수직 방향으로 동일할 수 있다. 또한 새로운 참조 픽셀의 위치는 현재 블록의 인트라 예측 모드의 방향에 인접한 위치일 수 있다.Referring to FIG. 28, the video signal processing device may use four reference pixels close to the location of the new reference pixel 2801 to be created to generate a virtual new reference pixel line. At this time, the location of the new reference pixel may be the same as the reference pixel line in the vertical direction. Additionally, the location of the new reference pixel may be adjacent to the direction of the intra prediction mode of the current block.
도 29는 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인을 사용하여 샘플을 예측하는 방법을 나타낸다.Figure 29 shows a method of predicting a sample using a plurality of reference pixel lines according to an embodiment of the present invention.
도 29를 참조하면 비디오 신호 처리 장치는 복수의 참조 픽셀 라인을 입력 받아 인트라 예측을 수행하여 현재 블록 내 예측 블록을 생성할 수 있다. 어떠한 참조 픽셀 라인이 사용되는지에 따라 다른 예측 블록이 생성될 수 있고, 비디오 신호 처리 장치는 각 예측 블록에 대해 입력된 가중치에 따라 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때 가중치는 기 설정된 값일 수 있다. 예를 들어, 메인 참조 픽셀 라인으로 예측된 샘플의 가중치는 3이고, 서브 참조 픽셀 라인으로 예측된 샘플의 가중치는 1일 수 있다. 이때, 가중치는 현재 블록의 크기, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 인트라 예측 모드, 양자화 파라미터 정보, 메인 참조 픽셀 라인과 서브 참조 픽셀 라인 간의 거리(또는 차이) 등 적어도 하나 이상에 기초하여 결정될 수 있다. 또한, 참조 픽셀 라인은 현재 블록의 크기, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 인트라 예측 모드, 양자화 파라미터 정보, MRL 정보 등 적어도 하나 이상에 기초하여 결정될 수 있다. 예를 들어, 메인 참조 픽셀 라인은 현재 블록에 인접한 참조 픽셀 라인일 수 있고, 서브 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인일 수 있다. 또 다른 예로, 메인 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인일 수 있고, 서브 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인보다 임의의 정해진 위치만큼 떨어진 참조 픽셀 라인일 수 있으며, 임의의 정해진 위치는 -N ~ +N까지의 정수일 수 있으며, N은 0보다 큰 정수일 수 있다.Referring to FIG. 29, a video signal processing device may receive a plurality of reference pixel lines and perform intra prediction to generate a prediction block within the current block. Different prediction blocks can be generated depending on which reference pixel line is used, and the video signal processing device can generate a final prediction block by performing a weight average according to the weights input for each prediction block. At this time, the weight may be a preset value. For example, the weight of the sample predicted by the main reference pixel line may be 3, and the weight of the sample predicted by the sub-reference pixel line may be 1. At this time, the weight is based on at least one of the following: the size of the current block, the horizontal or vertical size of the current block, the intra prediction mode of the current block, quantization parameter information, and the distance (or difference) between the main reference pixel line and the sub-reference pixel line. It can be decided. Additionally, the reference pixel line may be determined based on at least one of the size of the current block, the horizontal or vertical size of the current block, the intra prediction mode of the current block, quantization parameter information, and MRL information. For example, the main reference pixel line may be a reference pixel line adjacent to the current block, and the sub-reference pixel line may be a reference pixel line indicated by the MRL. As another example, the main reference pixel line may be a reference pixel line indicated by the MRL, and the sub-reference pixel line may be a reference pixel line that is located at a certain location away from the reference pixel line indicated by the MRL, and may be located at a certain location. may be an integer from -N to +N, and N may be an integer greater than 0.
상술한 현재 블록 내 예측 샘플을 생성하는 방법에서 사용되는 인트라 예측 모드는 참조 픽셀 라인마다 동일할 수 있다. 또는, 반대로 상술한 현재 블록 내 예측 샘플을 생성하는 방법에서 사용되는 인트라 예측 모드는 참조 픽셀 라인마다 상이할 수 있다. 즉, 메인 참조 픽셀 라인에서는 시그널링된 인트라 예측 모드가 사용될 수 있고, 서브 참조 픽셀 라인에서는 메인 참조 픽셀 라인에서 사용된 인트라 예측 모드(의 인덱스)에서 임의의 값만큼 더해지거나 빼진 (인덱스에 대응되는)예측 모드가 사용될 수 있다. 이때, 임의의 값은 1이상의 정수 일 수 있다. 또한, 비디오 신호 처리 장치는 메인 참조 픽셀 라인에서 사용된 인트라 예측 모드의 값에 따라 임의의 값을 증가시킬 지 혹은 감소시킬 지를 결정할 수 있다. 예를 들어, 비디오 신호 처리 장치는 인트라 예측 모드의 각도가 음수일 경우에는 임의의 값만큼 증가시키고, 양수일 경우에는 임의의 값만큼 감소시킬 수 있다.The intra prediction mode used in the method of generating a prediction sample within the current block described above may be the same for each reference pixel line. Or, conversely, the intra prediction mode used in the method of generating the prediction sample within the current block described above may be different for each reference pixel line. That is, the signaled intra prediction mode can be used in the main reference pixel line, and in the sub-reference pixel line, a random value (corresponding to the index) is added or subtracted from (the index of) the intra prediction mode used in the main reference pixel line. Predictive mode may be used. At this time, the arbitrary value may be an integer of 1 or more. Additionally, the video signal processing device may determine whether to increase or decrease a random value depending on the value of the intra prediction mode used in the main reference pixel line. For example, the video signal processing device may increase the angle of the intra prediction mode by a random value if it is a negative number, and may decrease it by a random value if it is a positive number.
도 30은 본 발명의 일 실시예에 따른 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법을 나타낸다.Figure 30 shows a method of determining a reference pixel line based on a template according to an embodiment of the present invention.
이하 템플릿에 기초하여 현재 블록을 위한(현재 블록의 복원을 위한) 최적의 참조 픽셀 라인을 결정하는 방법에 대해 설명한다.Hereinafter, a method for determining the optimal reference pixel line for the current block (for restoration of the current block) based on the template will be described.
본 명세서에서 설명의 편의상, 현재 블록을 위한(현재 블록의 복원을 위한) 최적의 참조 픽셀 라인을 결정하는 방법을 TMRL(Template-based multiple reference line intra prediction)으로 기술할 수 있다.For convenience of explanation in this specification, a method of determining the optimal reference pixel line for the current block (for restoration of the current block) may be described as TMRL (Template-based multiple reference line intra prediction).
도 30을 참조하면 비디오 신호 처리 장치는 현재 블록에 인접한 참조 픽셀 라인을 사용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 참조 픽셀 라인 1, 2, 3...(Reference line 1, 2, 3 ...) 등을 사용하여 기준 템플릿의 위치에 대한 예측 샘플을 생성할 수 있다. 비디오 신호 처리 장치는 생성된 예측 샘플과 기준 템플릿의 샘플들 간 코스트를 계산할 수 있다. 이때 코스트는 SAD(Sum of Absolute Differences) 또는 MRSAD(Mean-Removed SAD) 등의 방법을 통해 계산될 수 있다. 최소 코스트에 대응되는 참조 픽셀이 최적의 참조 픽셀일 수 있다. 또한, 인코더는 계산된 코스트를 오름차순으로 재정렬하고, 참조 픽셀 라인에 대한 리스트를 구성한 후, 최적의 참조 픽셀 라인에 대한 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 참조 픽셀 라인에 대한 리스트를 구성하고, 비트스트림에 포함된 최적의 참조 픽셀 라인에 대한 인덱스를 파싱하여 인덱스가 지시하는 참조 픽셀 라인을 이용하여 예측 샘플을 생성할 수 있다. Referring to FIG. 30, a video signal processing device can configure a reference template using a reference pixel line adjacent to the current block. The video signal processing device may generate a prediction sample for the position of the reference template using reference pixel lines 1, 2, 3... ( Reference lines 1, 2, 3...). The video signal processing device may calculate the cost between the generated prediction sample and the samples of the reference template. At this time, the cost can be calculated through methods such as SAD (Sum of Absolute Differences) or MRSAD (Mean-Removed SAD). The reference pixel corresponding to the minimum cost may be the optimal reference pixel. Additionally, the encoder may rearrange the calculated costs in ascending order, construct a list of reference pixel lines, and then generate and signal a bitstream containing information about the index of the optimal reference pixel line. The decoder can construct a list of reference pixel lines through the above-described method, parse the index for the optimal reference pixel line included in the bitstream, and generate a prediction sample using the reference pixel line indicated by the index. .
최적의 참조 픽셀 라인을 결정함에 있어 복잡도를 낮추기 위해 모든 인트라 예측 모드에 대해 최적의 참조 픽셀 라인이 사용되는 것이 아니라, MPM 리스트에 포함된 인트라 예측 모드에 대해서만 최적의 참조 픽셀 라인이 사용될 수 있다. 즉, 인코더는 MPM 리스트에 포함된 인트라 예측 모드들과 복수의 참조 픽셀 라인 간의 조합으로 참조 픽셀 라인에 대한 리스트를 구성하고, 참조 픽셀 라인에 대한 리스트 내 각각의 후보를 사용하여 생성된 예측 샘플과 기준 템플릿 간의 코스트를 계산할 수 있다. 그리고, 인코더는 코스트를 기준으로 리스트를 오름차순으로 재정렬한 후, 코스트가 낮은 몇 개의 조합만을 사용하여 리스트를 재구성할 수 있다. 인코더는 재구성된 리스트 내의 조합 정보(임의의 인트라 예측 모드와 임의의 참조 픽셀 라인들) 중에서 최적의 조합 정보에 대한 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 동일한 참조 픽셀 라인에 대한 리스트를 구성한 후 비트스트림에 포함된 최적의 조합 정보에 대한 인덱스를 파싱하여 인덱스가 지시하는 최적의 조합 정보를 사용하여 예측 샘플을 생성할 수 있다. In order to reduce complexity in determining the optimal reference pixel line, the optimal reference pixel line is not used for all intra prediction modes, but the optimal reference pixel line can be used only for the intra prediction modes included in the MPM list. That is, the encoder constructs a list of reference pixel lines by combining intra prediction modes included in the MPM list and a plurality of reference pixel lines, and predicts samples generated using each candidate in the list for reference pixel lines and The cost between standard templates can be calculated. Additionally, the encoder can rearrange the list in ascending order based on cost and then reconstruct the list using only a few combinations with low costs. The encoder may generate and signal a bitstream containing information about the index for the optimal combination information among the combination information (arbitrary intra prediction mode and arbitrary reference pixel lines) in the reconstructed list. The decoder can construct a list of identical reference pixel lines through the above-described method, then parse the index for the optimal combination information included in the bitstream and generate a prediction sample using the optimal combination information indicated by the index. .
여러 개의 참조 픽셀 라인을 사용하여 예측 샘플이 생성될 때 각 참조 픽셀 라인을 통해 생성된 예측 샘플마다 서로 다른 가중치가 적용될 수 있다. 이때, 최적의 가중치를 유도하기 위해서 템플릿 기반 방법이 사용될 수 있다. 즉, 인코더는 MPM 리스트에 포함된 인트라 예측 모드들, 복수의 참조 픽셀 라인, 각 참조 픽셀 라인으로 예측된 샘플들에 대한 가중치 (예를 들어, 3:1, 2:2 중에서 하나) 간의 조합으로 참조 픽셀 라인에 대한 리스트를 구성하고, 참조 픽셀 라인에 대한 리스트 내 각각의 후보를 사용하여 생성된 예측 샘플과 기준 템플릿 간의 코스트를 계산할 수 있다 그리고, 비디오 신호 처리 장치는 MPM 리스트를 코스트를 기준으로 오름차순으로 재정렬한 후, 코스트가 낮은 몇 개의 조합만을 사용하여 MPM 리스트를 재구성할 수 있다. 인코더는 재구성된 리스트 내의 조합 정보(임의의 인트라 예측 모드, 임의의 참조 픽셀 라인들, 각 참조 픽셀 라인으로 예측된 샘플들에 대한 가중치 (예를 들어, 3:1, 2:2 중에서 하나) 중에서 최적의 조합 정보에 대한 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 동일한 참조 픽셀 라인에 대한 리스트를 구성한 후 비트스트림에 포함된 최적의 조합 정보에 대한 인덱스를 파싱하여 인덱스가 지시하는 최적의 조합 정보를 사용하여 예측 샘플을 생성할 수 있다. When prediction samples are generated using multiple reference pixel lines, different weights may be applied to prediction samples generated through each reference pixel line. At this time, a template-based method can be used to derive optimal weights. That is, the encoder uses a combination of intra prediction modes included in the MPM list, a plurality of reference pixel lines, and a weight for the samples predicted by each reference pixel line (e.g., one of 3:1 and 2:2). A list of reference pixel lines can be constructed, and the cost between the generated prediction sample and the reference template can be calculated using each candidate in the list of reference pixel lines. Then, the video signal processing device can calculate the MPM list based on the cost. After reordering in ascending order, the MPM list can be reconstructed using only a few low-cost combinations. The encoder combines information in the reconstructed list (any intra prediction mode, any reference pixel lines, weights for the samples predicted by each reference pixel line (e.g., one of 3:1, 2:2)) A bitstream containing information about the index of the optimal combination information can be generated and signalled. The decoder constructs a list of the same reference pixel lines through the above-described method and then inputs the optimal combination information included in the bitstream. By parsing the index, a prediction sample can be created using the optimal combination information indicated by the index.
도 30을 통해 설명한 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법에 있어서, 현재 블록에 인접한 참조 픽셀 라인은 템플릿을 구성하는데 사용될 수 있다. 따라서, 현재 블록에 인접하지 않은 참조 픽셀 라인들을 사용하여 템플릿에 기초하여 결정되는 참조 픽셀 라인이 결정될 수 있다. 이하에서 현재 블록에 인접한 참조 픽셀 라인도 템플릿에 기초하여 참조 픽셀 라인을 결정하기 위해 사용될 수 있는 방법에 대해 설명한다.In the method of determining a reference pixel line based on a template described with reference to FIG. 30, a reference pixel line adjacent to the current block may be used to configure the template. Accordingly, the reference pixel line determined based on the template may be determined using reference pixel lines that are not adjacent to the current block. Below, a method in which reference pixel lines adjacent to the current block can also be used to determine the reference pixel line based on the template will be described.
도 31은 본 발명의 일 실시예에 따른 현재 블록에 인접한 참조 픽셀 라인을 테스트하기 위한 템플릿을 설정하는 방법을 나타낸다.Figure 31 shows a method of setting a template for testing a reference pixel line adjacent to the current block according to an embodiment of the present invention.
도 31에 도시된 바와 같이 기준 템플릿이 구성되면, 현재 블록에 인접한 참조 픽셀 라인도 상기 템플릿에 기초하여 참조 픽셀 라인을 결정하기 위해 사용될 수 있다. 도 31(a)를 참조하면 현재 블록의 좌측에 인접한 참조 픽셀들만을 포함하는 기준 템플릿이 구성될 수 있다. 인코더는 현재 블록의 상측의 참조 픽셀 라인 0(Reference line 0) 및/또는 현재 블록의 좌측의 참조 픽셀 라인 1(Reference line 1) 중 적어도 하나 이상을 사용하여, 기준 템플렛에 대한 예측 샘플을 생성하고, 기준 템플릿과 예측 샘플 간의 코스트를 계산할 수 있다. 인코더는 참조 픽셀 라인 1, 2, 3 ...(Reference line 1, 2, 3 ...)를 사용하여 기준 템플릿에 대한 예측 샘플을 생성하고, 기준 템플릿과 예측 샘플 간의 코스트를 계산할 수 있다. 도 31(b)는 기준 템플릿이 현재 블록의 상측에 인접한 참조 픽셀들만을 포함하는 경우를 나타낸다. 마찬가지로, 인코더는 현재 블록의 좌측의 참조 픽셀 라인 0(Reference line 0) 및/또는 현재 블록의 상측의 참조 픽셀 라인 1(Reference line 1) 중 적어도 하나 이상을 사용하여, 기준 템플렛에 대한 예측 샘플을 생성하고, 기준 템플릿과 예측 샘플 간의 코스트를 계산할 수 있다. 인코더는 참조 픽셀 라인 1, 2, 3 ...(Reference line 1, 2, 3 ...)를 사용하여 기준 템플릿에 대한 예측 샘플을 생성하고, 기준 템플릿과 예측 샘플 간의 코스트를 계산할 수 있다.Once the reference template is configured as shown in FIG. 31, the reference pixel line adjacent to the current block can also be used to determine the reference pixel line based on the template. Referring to FIG. 31(a), a reference template can be constructed that includes only reference pixels adjacent to the left side of the current block. The encoder generates a prediction sample for the reference template using at least one of Reference pixel line 0 on the upper side of the current block and/or Reference pixel line 1 on the left side of the current block. , the cost between the reference template and the predicted sample can be calculated. The encoder can use reference pixel lines 1, 2, 3 ... ( Reference lines 1, 2, 3 ...) to generate prediction samples for the reference template and calculate the cost between the reference template and the prediction sample. Figure 31(b) shows a case where the reference template includes only reference pixels adjacent to the top of the current block. Likewise, the encoder uses at least one of Reference pixel line 0 on the left of the current block and/or Reference pixel line 1 on the top of the current block to generate a prediction sample for the reference template. You can generate and calculate the cost between the reference template and the predicted sample. The encoder can use reference pixel lines 1, 2, 3 ... ( Reference lines 1, 2, 3 ...) to generate prediction samples for the reference template and calculate the cost between the reference template and the prediction sample.
인코더는 계산된 코스트를 오름차순으로 재정렬하여 참조 픽셀 라인에 대한 리스트를 구성한 후, 최적의 참조 픽셀 라인의 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는, 상술한 방법을 통해 참조 픽셀 라인에 대한 리스트를 구성한 후, 비트스트림에 포함된 최적의 참조 픽셀 라인의 인덱스에 대한 정보를 파싱하여 결정되는 최적의 참조 픽셀 라인을 이용하여 예측 샘플을 생성할 수 있다. The encoder may rearrange the calculated costs in ascending order to construct a list of reference pixel lines, then generate and signal a bitstream containing information about the index of the optimal reference pixel line. The decoder constructs a list of reference pixel lines through the above-described method and then generates a prediction sample using the optimal reference pixel line determined by parsing information about the index of the optimal reference pixel line included in the bitstream. can do.
도 32는 본 발명의 일 실시예에 따른 템플릿에 기초한 복수의 참조 픽셀 라인을 사용하여 최적의 참조 픽셀 라인을 결정하는 방법을 나타낸 구조도이다.Figure 32 is a structural diagram showing a method of determining an optimal reference pixel line using a plurality of reference pixel lines based on a template according to an embodiment of the present invention.
도 32를 참조하면 인코더는 복수의 참조 픽셀 라인을 입력 받아 인트라 예측을 수행하여 템플릿에 대한 예측 블록들을 생성할 수 있다. 어떠한 참조 픽셀 라인이 사용되었는지에 따라 다른 예측 블록이 생성될 수 있다. 인코더는 예측 블록들 각각에 입력된 다양한 가중치 정보에 따라 가중치 평균을 수행하여 최종적으로 템플릿에 대한 예측 블록을 생성할 수 있다. 어떠한 참조 픽셀 라인들이 사용되었는지, 어떠한 가중치가 사용되었는지에 따라 복수의 예측 블록이 생성될 수 있다. 인코더는 각 예측 블록과 기준 템플릿 간의 코스트를 계산한 후, 각 예측 블록에 대응되는 코스트를 기반으로 오름차순으로 재정렬하고, 미리 정해진 개수의 상위 몇 개의 후보만을 사용하여 별도의 리스트를 구성할 수 있다. 이때, 미리 정해진 개수는 2이상의 정수일 수 있으며, 10일 수 있다. 인코더는 별도의 리스트 내 예측 블록을 생성하는데 사용된 조합 정보를 통해 현재 블록에 대한 예측 블록을 생성할 수 있다. 그리고 인코더는 화질 및 비트량 관점에서 최적의 후보를 리스트에서 선택한 후 최적의 후보의 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 동일한 별도의 리스트를 구성하고, 비트스트림에 포함된 최적의 후보의 인덱스에 대한 정보를 파싱하여 결정되는 최적의 후보의 인덱스가 지시하는 최적의 조합 정보를 사용하여 예측 샘플을 생성할 수 있다.Referring to FIG. 32, the encoder may receive a plurality of reference pixel lines and perform intra prediction to generate prediction blocks for the template. Different prediction blocks may be generated depending on which reference pixel line is used. The encoder can perform a weighted average according to various weight information input to each of the prediction blocks to finally generate a prediction block for the template. A plurality of prediction blocks may be generated depending on which reference pixel lines are used and what weights are used. After calculating the cost between each prediction block and the reference template, the encoder can rearrange them in ascending order based on the cost corresponding to each prediction block and construct a separate list using only the top few candidates of a predetermined number. At this time, the predetermined number may be an integer of 2 or more, or may be 10. The encoder can generate a prediction block for the current block through the combination information used to generate the prediction block in a separate list. In addition, the encoder can select the optimal candidate from the list in terms of picture quality and bit quantity, then generate and signal a bitstream containing information about the index of the optimal candidate. The decoder constructs the same separate list through the above-described method, and uses the optimal combination information indicated by the index of the optimal candidate determined by parsing the information about the index of the optimal candidate included in the bitstream to predict the sample. can be created.
현재 블록이 인트라 예측 모드로 부호화되는 경우, 부호화되는 인트라 예측 모드는 각도 모드, 평면(Planar) 모드, DC 모드, MIP 모드 중 어느 하나의 모드일 수 있다. 각도 모드에 따른 예측은 65가지의 각도에 따라 수행되는 예측일 수 있고, MIP 모드에 따른 예측은 미리 정의된 매트릭스를 기반으로 수행되는 예측일 수 있다. 각도 모드는 현재 블록 내에 에지와 같은 특성이 존재하는 블록에서 효과적일 수 있다. 하지만, 현재 블록이 완만한 특성을 가질 경우, 각도 모드를 사용하여 예측된 블록에는 블록 간 경계 부분의 불연속적인 에지가 생성되거나 블록 내부에 가시적인 윤곽선이 생성될 수 있다. 이는 부호화 효율을 감소시키는 요인이 될 수 있다. 또한, DC 모드는 낮은 비트율에서 블록 간 경계 부분에서 가시적인 에지를 생성하는 단점이 있을 수 있다. 평면 모드는 각도 모드와 DC 모드로 발생되는 에지 문제를 개선하여 불연속성이 없는 예측 블록을 생성할 수 있다.When the current block is encoded in intra prediction mode, the encoded intra prediction mode may be any one of angular mode, planar mode, DC mode, and MIP mode. Prediction according to the angle mode may be prediction performed according to 65 angles, and prediction according to MIP mode may be prediction performed based on a predefined matrix. Angle mode can be effective in blocks where features such as edges exist within the current block. However, if the current block has gentle characteristics, discontinuous edges at the boundaries between blocks may be generated in the block predicted using the angle mode, or visible outlines may be generated inside the block. This may be a factor in reducing coding efficiency. Additionally, DC mode may have the disadvantage of generating visible edges at boundaries between blocks at low bit rates. Plane mode can generate prediction blocks without discontinuities by improving edge problems caused by angle mode and DC mode.
도 33은 본 발명의 일 실시예에 따른 평면 모드를 사용하여 예측 샘플을 생성하는 방법을 나타낸다.Figure 33 shows a method for generating prediction samples using planar mode according to an embodiment of the present invention.
도 33을 참조하면 평면 모드에 따르면 비디오 신호 처리 장치는 현재 블록 내 예측 샘플을 생성하기 위해 수직 방향으로 선형 예측된 값을 생성하고, 수평 방향으로 선형 예측된 값을 생성할 수 있다. 비디오 신호 처리 장치는 수직 방향으로 선형 예측된 값과 수평 방향으로 선형 예측된 값을 가중치 평균하여 현재 블록 내 예측 샘플(값)을 생성할 수 있다.Referring to FIG. 33, according to the planar mode, the video signal processing device may generate a linearly predicted value in the vertical direction and a linearly predicted value in the horizontal direction to generate a prediction sample within the current block. The video signal processing device may generate a prediction sample (value) within the current block by performing a weighted average of the linearly predicted value in the vertical direction and the linearly predicted value in the horizontal direction.
수직 방향으로 선형 예측된 값(predV (x, y)은 수학식 4에 기초하여 생성될 수 있고, 수평 방향으로 선형 예측된 값(predH (x, y)은 수학식 5에 기초하여 생성될 수 있다. 그리고, 새로운 예측 값(pred (x, y)은 수학식 6에 기초하여 생성될 수 있다. 수학식 4 내지 6에서 W는 현재 블록의 가로의 크기(너비)이고, H는 현재 블록의 세로의 크기(높이)일 수 있다. rec(x, y)는 (x, y)좌표에서의 픽셀 값을 의미할 수 있다. 예측 값(predV(x, y), predH(x, y), pred(x, y))는 (x, y)좌표에서의 예측된 픽셀 값을 의미할 수 있다.The linearly predicted value in the vertical direction (predV (x, y)) can be generated based on Equation 4, and the linearly predicted value in the horizontal direction (predH (x, y)) can be generated based on Equation 5. And, a new prediction value (pred (x, y)) can be generated based on Equation 6. In Equations 4 to 6, W is the horizontal size (width) of the current block, and H is the horizontal size (width) of the current block. It can be the vertical size (height). rec(x, y) can mean the pixel value at (x, y) coordinates. Predicted values (predV(x, y), predH(x, y), pred(x, y)) may mean the predicted pixel value at (x, y) coordinates.
Figure PCTKR2023012220-appb-img-000004
Figure PCTKR2023012220-appb-img-000004
Figure PCTKR2023012220-appb-img-000005
Figure PCTKR2023012220-appb-img-000005
Figure PCTKR2023012220-appb-img-000006
Figure PCTKR2023012220-appb-img-000006
비디오 신호 처리 장치는 평면 모드에 따라 현재 블록과 관련된 예측을 수행할 때 수직 방향으로의 선형 예측만을 사용할 수 있다. 또는 비디오 신호 처리 장치는 평면 모드에 따라 현재 블록과 관련된 예측을 수행할 때 수평 방향으로의 선형 예측만을 사용할 수 있다. 따라서, 평면 모드는 3가지 모드로 구분될 수 있다. 즉, 종래의 수직 방향 및 수평 방향으로의 선형 예측을 이용하여 생성되는 예측 블록을 가중치 평균하는 방법에 더하여, 수직 방향으로의 선형 예측만을 사용하는 수직 방향 평면 모드, 수평 방향으로의 선형 예측만을 사용하는 수평 방향 평면 모드로 구분될 수 있다. 인코더는 현재 블록이 3가지 평면 모드 중 어떠한 예측 모드를 사용했는지에 대한 정보를 포함하는 비트스트림을 생성하고, 시그널링할 수 있다. 디코더는 비트스트림에 포함된 어떠한 예측 모드를 사용했는지에 대한 정보를 파싱하여 결정되는 평면 모드에 기초하여 현재 블록에 대한 예측 블록을 생성할 수 있다.A video signal processing device can only use linear prediction in the vertical direction when performing prediction related to the current block according to the planar mode. Alternatively, the video signal processing device may use only linear prediction in the horizontal direction when performing prediction related to the current block according to the planar mode. Therefore, the planar mode can be divided into three modes. That is, in addition to the conventional method of weighting prediction blocks generated using linear prediction in the vertical and horizontal directions, a vertical plane mode that uses only linear prediction in the vertical direction, and a vertical plane mode that uses only linear prediction in the horizontal direction. It can be divided into horizontal plane mode. The encoder can generate and signal a bitstream containing information about which prediction mode among the three planar modes the current block used. The decoder may generate a prediction block for the current block based on the planar mode determined by parsing information about which prediction mode was used included in the bitstream.
어떠한 평면 모드를 사용했는지에 대한 정보를 비트스트림에 포함하여 시그널링하는 명시적인 방법은 비트량이 증가하는 문제가 있을 수 있다. 비트량을 절약하기 위해서, 디코더는 현재 블록의 크기, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 가로 및 세로의 크기 비율, 현재 블록의 화소(픽셀) 개수, 현재 블록이 휘도 신호인지 색차 신호인지, 현재 블록에 인접한 주변 블록의 인트라 예측 방향성 모드 정보들, 현재 블록에 대한 MPM 리스트 정보, DIMD 혹은 TIMD로 부터 유도된 인트라 예측 방향성 모드 정보들 중에서 적어도 하나 이상을 사용하여 어떠한 평면 모드를 사용했는지 암묵적으로 유도할 수 있다.An explicit method of signaling by including information about which plane mode was used in the bitstream may have the problem of increasing the bit amount. In order to save the amount of bits, the decoder determines the size of the current block, the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, the number of pixels (pixels) in the current block, and whether the current block is a luminance signal or a chrominance signal. Recognition, which plane mode was used using at least one of the intra prediction direction mode information of neighboring blocks adjacent to the current block, MPM list information for the current block, and intra prediction direction mode information derived from DIMD or TIMD. It can be induced implicitly.
수직 방향 평면 모드, 수평 방향 평면 모드는 현재 블록의 형태가 정사각형일때보다 직사각형인 경우 더욱 효과적일 수 있다. 따라서, 현재 블록의 가로 크기와 세로 크기가 서로 다른 경우에만 수직 방향 평면 모드, 수평 방향 평면 모드가 적용될 수 있다(활성화될 수 있다). 다시 말해, 인코더는 현재 블록의 가로 크기와 세로 크기를 비교한 후, 크기가 서로 다른 경우에만 수직 방향 평면 모드가 적용되는지 수평 방향 평면 모드가 적용되는지 기존의 평면 모드가 적용되는지에 대한 평면 모드 선택 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더는 현재 블록의 가로 크기와 세로 크기를 비교한 후, 크기가 서로 다른 경우에만 평면 모드 선택 정보를 파싱할 수 있다. 한편, 현재 블록의 가로 크기와 세로 크기가 서로 동일한 경우에는 종래의 평면 모드가 적용될 수 있다.Vertical plane mode and horizontal plane mode can be more effective when the shape of the current block is rectangular rather than square. Accordingly, the vertical plane mode and the horizontal plane mode can be applied (activated) only when the horizontal and vertical sizes of the current block are different from each other. In other words, the encoder compares the horizontal and vertical sizes of the current block and then selects a plane mode, whether the vertical plane mode, the horizontal plane mode, or the conventional plane mode is applied only if the sizes are different. Signaling can be performed by generating a bitstream containing information. The decoder can compare the horizontal and vertical sizes of the current block and parse the planar mode selection information only if the sizes are different. Meanwhile, when the horizontal and vertical sizes of the current block are the same, the conventional planar mode can be applied.
본 명세서에서 설명의 편의상, 현재 블록이 3가지 평면 모드 중 어떠한 예측 모드를 사용했는지에 대한 정보를 평면 모드 선택 정보로 기술할 수 있다.For convenience of explanation in this specification, information about which prediction mode among three plane modes the current block uses can be described as plane mode selection information.
평면 모드 선택 정보는 코딩 유닛마다 시그널링될 수 있다. 하지만, 모든 코딩 유닛에 대응하여 평면 모드 선택 정보가 시그널링되면 비트량이 증가할 수 있으므로, 인코더는 특정 조건을 만족하는 경우에만, 평면 모드 선택 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 특정 조건을 만족하는 경우 평면 모드 선택 정보를 파싱하여 현재 블록에 대한 인트라 예측 방향성 모드를 결정할 수 있고, 결정된 인트라 예측 방향성 모드를 이용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 이때, 특정 조건은 현재 블록의 가로 및 세로 크기, 현재 블록의 가로 및 세로 크기의 비율, 현재 블록의 인트라 예측 방향성 모드가 특정 모드인 경우(예를 들어, 평면 모드, DC 모드, 수직 방향 모드, 수평 방향 모드 인지), 현재 블록의 부호화 모드가 DIMD, TIMD, IntraTMP, IBC, ISP, MIP 부호화 모드인지 여부, 현재 블록에 대한 예측 블록을 생성할 때 사용되는 참조 픽셀 라인의 인덱스 정보와 관련된 조건일 수 있다. 특정 조건들 중에서 적어도 하나 이상이 만족하는지 여부에 따라 평면 선택 정보에 대한 부호화 및 복호화 여부가 결정될 수 있다. 구체적으로 특정 조건은 1) 현재 블록의 인트라 예측 방향성 모드가 종래의 평면 모드인 경우(즉, 인트라 예측 방향성 모드의 인덱스가 0인 경우), 2) 현재 블록의 가로 및 세로 크기가 최대 변환 블록 크기보다 같거나 작고, 현재 블록의 가로 크기와 세로 크기의 곱이 최소 변환 블록 크기와 최소 변환 블록 크기의 곱보다 큰 경우, 3) 현재 블록의 가로 및 세로 크기가 서로 다른 경우일 수 있다. 이때, 최소 변환 블록의 크기는 정수일 수 있으며, 4, 8 등일 수 있고, 최대 변환 블록의 크기는 정수일 수 있으며, 64, 128, 256 등일 수 있다. 상술한 1) 내지 3)의 특정 조건 중 적어도 하나가 만족하는 경우, 인코더는 평면 모드 선택 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있고, 디코더는 평면 모드 선택 정보를 파싱하여, 현재 블록에 대한 인트라 예측 방향성 모드를 결정할 수 있다. Plane mode selection information may be signaled for each coding unit. However, if the planar mode selection information is signaled in response to all coding units, the bit amount may increase, so the encoder can generate and signal a bitstream including the planar mode selection information only when a specific condition is satisfied. If a specific condition is satisfied, the decoder can determine the intra prediction directionality mode for the current block by parsing the plane mode selection information and generate a prediction block for the current block using the determined intra prediction directionality mode. At this time, the specific conditions are the horizontal and vertical size of the current block, the ratio of the horizontal and vertical size of the current block, and the intra prediction direction mode of the current block is a specific mode (e.g., planar mode, DC mode, vertical direction mode, horizontal direction mode), whether the coding mode of the current block is DIMD, TIMD, IntraTMP, IBC, ISP, MIP coding mode, and conditions related to the index information of the reference pixel line used when generating the prediction block for the current block. You can. Whether to encode or decode the plane selection information may be determined depending on whether at least one of the specific conditions is satisfied. Specifically, the specific conditions are 1) if the intra prediction directionality mode of the current block is a conventional planar mode (i.e., if the index of the intra prediction directionality mode is 0), 2) the horizontal and vertical sizes of the current block are equal to the maximum transformation block size. is equal to or smaller than, and the product of the horizontal and vertical sizes of the current block is larger than the product of the minimum conversion block size and the minimum conversion block size. 3) The horizontal and vertical sizes of the current block may be different. At this time, the size of the minimum transform block may be an integer, such as 4 or 8, and the size of the maximum transform block may be an integer, such as 64, 128, 256, etc. When at least one of the above-mentioned specific conditions 1) to 3) is satisfied, the encoder can generate and signal a bitstream including planar mode selection information, and the decoder parses the planar mode selection information and stores it in the current block. The intra prediction directional mode can be determined.
현재 블록이 색차 성분 블록인 경우, 수직 방향 평면 모드 및 수평 방향 평면 모드는 적용되지 않고, 종래 평면 모드만 적용될 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록이 색차 성분 블록인 경우, 종래 평면 모드를 사용하여 예측 블록을 생성할 수 있다. 따라서, 현재 블록이 색차 성분 블록인 경우, 비디오 신호 처리 장치는 평면 모드 선택 정보를 시그널링하거나 파싱하지 않을 수 있다. 한편, 현재 블록이 색차 성분 블록이더라도 휘도 성분 블록과 동일하게 수직 방향 평면 모드 또는 수평 방향 평면 모드가 적용될 수 있다. 예를 들어, 현재 블록에 수직 방향 평면 모드가 적용되는 경우, 디코더는 현재 블록의 휘도 성분 블록 및 색차 성분 블록을 수직 방향 평면 모드를 사용하여 현재 블록의 휘도 성분 블록 및 색차 성분 블록에 대한 예측 블록을 생성할 수 있다.If the current block is a chrominance component block, the vertical plane mode and the horizontal plane mode are not applied, and only the conventional plane mode can be applied. That is, when the current block is a chrominance component block, the video signal processing device can generate a prediction block using the conventional planar mode. Accordingly, if the current block is a chrominance component block, the video signal processing device may not signal or parse the planar mode selection information. Meanwhile, even if the current block is a chrominance component block, the vertical plane mode or the horizontal plane mode can be applied in the same way as the luminance component block. For example, when the vertical plane mode is applied to the current block, the decoder uses the vertical plane mode to match the luminance block and chrominance block of the current block to the prediction block for the luminance block and chrominance block of the current block. can be created.
현재 블록의 가로의 크기가 세로의 크기보다 크다면, 현재 블록에 좌측으로 인접한 픽셀의 개수보다 상측으로 인접한 픽셀의 개수가 많으므로, 디코더는 수직 방향 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 세로의 크기가 가로의 크기보다 크다면, 현재 블록에 상측으로 인접한 픽셀의 개수보다 좌측으로 인접한 픽셀의 개수가 많으므로, 디코더는 수평 방향 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 가로 및 세로의 크기가 같다면, 디코더는 종래의 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 가로 및 세로의 크기에 따라 평면 모드가 묵시적으로 결정되므로, 인코더는 평면 모드 선택 정보를 포함하는 비트스트림을 생성하지 않아도 된다. 디코더는 현재 블록의 가로 및 세로의 크기에 따라 결정되는 평면 모드에 따라 현재 블록의 예측 블록을 생성할 수 있다.If the horizontal size of the current block is larger than the vertical size, the number of pixels adjacent to the top is greater than the number of pixels adjacent to the left of the current block, so the decoder uses the vertical plane mode to create a prediction block for the current block. can be created. If the vertical size of the current block is larger than the horizontal size, the number of pixels adjacent to the left is greater than the number of pixels adjacent to the top of the current block, so the decoder uses the horizontal plane mode to create a prediction block for the current block. can be created. If the horizontal and vertical sizes of the current block are the same, the decoder can generate a prediction block for the current block using the conventional planar mode. Since the planar mode is implicitly determined according to the horizontal and vertical sizes of the current block, the encoder does not need to generate a bitstream including planar mode selection information. The decoder can generate a prediction block of the current block according to the plane mode determined by the horizontal and vertical sizes of the current block.
수직 방향 평면 모드 및 수평 방향 평면 모드는 ISP 모드에서는 적용되지 않을 수 있다. 인코더는 현재 블록이 ISP 모드로 부호화되고, 현재 블록이 평면 모드로 부호화된 경우, 평면 모드 선택 정보를 시그널링하지 않을 수 있다(즉, 비트스트림에 평면 모드 선택 정보는 포함되지 않을 수 있다). 디코더는 현재 블록이 ISP 모드로 부호화되고, 현재 블록이 평면 모드로 부호화된 경우, 평면 모드 선택 정보를 파싱하지 않을 수 있다. 반대로, 수직 방향 평면 모드 및 수평 방향 평면 모드는 ISP 모드에서 적용될 수 있다. 인코더는 현재 블록이 ISP 모드로 부호화되고, 현재 블록이 평면 모드로 부호화된 경우, 평면 모드 선택 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 현재 블록이 ISP 모드로 부호화되고, 현재 블록이 평면 모드로 부호화된 경우, 평면 모드 선택 정보를 파싱하여 결정되는 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다.Vertical plane mode and horizontal plane mode may not be applied in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in planar mode, the encoder may not signal planar mode selection information (that is, the bitstream may not include planar mode selection information). If the current block is encoded in ISP mode and the current block is encoded in flat mode, the decoder may not parse the planar mode selection information. Conversely, vertical plane mode and horizontal plane mode can be applied in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in planar mode, the encoder may generate and signal a bitstream including planar mode selection information. If the current block is encoded in ISP mode and the current block is encoded in plane mode, the decoder may generate a prediction block for the current block using the plane mode determined by parsing the plane mode selection information.
비디오 신호 처리 장치는 종래의 인트라 예측 방향성 모드들 중에서 수평 방향 모드(도 6의 18번 각도 모드)를 수평 방향 평면 모드로 대체할 수 있다. 또한, 비디오 신호 처리 장치는 종래의 인트라 예측 방향성 모드들 중 수직 방향 모드(도 6의 50번 각도 모드)를 수직 방향 평면 모드로 대체할 수 있다. 다시 말하면 비디오 신호 처리 장치는 종래의 인트라 예측 방향성 모드 중에서 수평 방향 모드(도 6의 18번 각도 모드), 수직 방향 모드(도 6의 50번 각도 모드) 대신 수평 방향 평면 모드, 수직 방향 평면 모드를 사용할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 가로의 크기와 세로의 크기가 상이한 경우에만, 종래의 인트라 예측 방향성 모드 중에서 수평 방향 모드(도 6의 18번 각도 모드), 수직 방향 모드(도 6의 50번 각도 모드)를 수평 방향 평면 모드, 수직 방향 평면 모드로 대체하여 사용할 수 있다.The video signal processing device can replace the horizontal mode (angle mode 18 in FIG. 6) with the horizontal plane mode among the conventional intra prediction directional modes. Additionally, the video signal processing device can replace the vertical mode (angle mode 50 in FIG. 6) among the conventional intra prediction directional modes with the vertical plane mode. In other words, the video signal processing device uses a horizontal plane mode and a vertical plane mode instead of the horizontal direction mode (angle mode 18 in FIG. 6) and the vertical direction mode (angle mode 50 in FIG. 6) among the conventional intra prediction directionality modes. You can use it. At this time, the video signal processing device selects the horizontal direction mode (angle mode 18 in FIG. 6) and the vertical direction mode (angle mode 50 in FIG. 6) among the conventional intra prediction directionality modes only when the horizontal and vertical sizes of the current block are different. angle mode) can be replaced with horizontal plane mode and vertical plane mode.
수직 방향 평면 모드 및 수평 방향 평면 모드는 크기가 작은 블록에 효과적일 수 있다. 따라서, 비디오 신호 처리 장치는 현재 블록의 크기가 임의의 크기보다 작은 경우에만, 수직 방향 평면 모드 및 수평 방향 평면 모드를 적용할 수 있다. 이때, 임의의 크기는 가로 또는 세로의 크기가 16 또는 32일 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록의 가로 또는 세로의 크기가 32보다 작거나 같은 경우 현재 블록에 수직 방향 평면 모드 및 수평 방향 평면 모드를 적용할 수 있다. 또는 비디오 신호 처리 장치는 현재 블록의 가로 또는 세로의 크기 중 어느 하나라도 32보다 큰 경우, 현재 블록에 수직 방향 평면 모드 및 수평 방향 평면 모드를 적용하지 않을 수 있다. 예를 들어, 인코더는 현재 블록의 가로 또는 세로의 크기 중 어느 하나라도 32보다 큰 경우, 비트스트림에 평면 모드 선택 정보를 포함하지 않을 수 있다. 디코더는 현재 블록의 부호화 모드가 평면 모드이고 현재 블록의 가로 또는 세로의 크기 중 어느 하나라도 32보다 큰 경우, 평면 모드 선택 정보를 파싱하지 않고, 종래의 평면 모드를 사용하여 현재 블록의 예측을 수행할 수 있다.Vertical plane mode and horizontal plane mode can be effective for small blocks. Accordingly, the video signal processing device can apply the vertical plane mode and the horizontal plane mode only when the size of the current block is smaller than an arbitrary size. At this time, the arbitrary size may be 16 or 32 in width or height. That is, the video signal processing device can apply the vertical plane mode and the horizontal plane mode to the current block when the horizontal or vertical size of the current block is less than or equal to 32. Alternatively, the video signal processing device may not apply the vertical plane mode and the horizontal plane mode to the current block when either the horizontal or vertical size of the current block is greater than 32. For example, if either the horizontal or vertical size of the current block is larger than 32, the encoder may not include planar mode selection information in the bitstream. If the encoding mode of the current block is planar mode and either the horizontal or vertical size of the current block is greater than 32, the decoder does not parse the planar mode selection information and performs prediction of the current block using the conventional planar mode. can do.
DIMD 및 TIMD 모드는 다양한 인트라 예측 모드로부터 예측된 블록들을 가중치 평균하여 예측 블록을 생성하는 모드이다. 이때, 평면 모드를 사용하여 예측된 블록은 DIMD 및 TIMD 모드를 위해 사용될 수 있다. 비디오 신호 처리 장치가 DIMD 및 TIMD 모드에서 사용되는 평면 모드를 사용하여 예측된 블록을 생성할 때, 수직 방향 평면 모드, 수평 방향 평면 모드 및 종래의 평면 모드 중 어느 하나를 사용할 수 있다. 평면 모드 선택 정보는 비트스트림에 포함되어 시그널링될 수 있다. 디코더는 평면 모드 선택 정보를 파싱하여, 3가지 평면 모드 중 사용할 모드를 결정할 수 있다. 예를 들어, 평면 모드 선택 정보가 수직 방향 평면 모드를 나타내는 경우, DIMD 및 TIMD 모드에 사용되는 예측 블록은 수직 방향 평면 모드를 사용하여 예측된 블록일 수 있다.DIMD and TIMD modes are modes that generate a prediction block by weight-averaging blocks predicted from various intra prediction modes. At this time, blocks predicted using planar mode can be used for DIMD and TIMD modes. When a video signal processing device generates a predicted block using the plane mode used in DIMD and TIMD modes, it can use any one of a vertical plane mode, a horizontal plane mode, and a conventional plane mode. Planar mode selection information may be signaled by being included in a bitstream. The decoder can parse the planar mode selection information and determine which of the three planar modes to use. For example, if the planar mode selection information indicates a vertical plane mode, the prediction block used in DIMD and TIMD modes may be a block predicted using the vertical plane mode.
MIP 모드는 복잡한 영역에 효과적인 모드일 수 있다. MIP 모드의 부호화 성능을 향상시키기 위해서, 다중 예측 기반 MIP 모드가 사용될 수 있다. 즉, 다중 예측 기반 MIP 모드는 MIP 방법으로 생성된 예측 블록과 인트라 예측 방향성 모드를 기반으로 생성된 예측 블록을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성하는 방법이다. 인코더는 MIP 모드에 대한 부호화 정보와 인트라 예측 방향성 모드에 대한 부호화 정보를 모두 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 MIP 모드에 대한 부호화 정보와 인트라 예측 방향성 모드에 대한 부호화 정보를 모두 파싱하여, MIP 모드가 적용된 예측 블록과 인트라 예측 방향성 모드가 적용된 예측 블록을 생성한 후, 2개의 예측 블록을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성할 수 있다.MIP mode can be an effective mode for complex areas. To improve the encoding performance of the MIP mode, a multi-prediction based MIP mode can be used. In other words, the multi-prediction-based MIP mode is a method of generating the final prediction block for the current block by weighting the prediction block generated by the MIP method and the prediction block generated based on the intra-prediction directional mode. The encoder can generate and signal a bitstream that includes both encoding information for the MIP mode and encoding information for the intra prediction directional mode. The decoder parses both the encoding information for the MIP mode and the encoding information for the intra prediction directional mode, generates a prediction block to which the MIP mode is applied and a prediction block to which the intra prediction directional mode is applied, and then performs a weighted average of the two prediction blocks. The final prediction block for the current block can be generated.
MIP 모드는 블록 단위로 적응적으로 수행될 수 있다. 인코더는 다중 예측 기반 MIP 모드가 사용되는지 여부에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 다중 예측 기반 MIP 모드가 사용되는지 여부에 대한 정보를 파싱하여 현재 블록에 대한 예측 블록을 생성할 때 다중 예측 기반 MIP 모드가 사용되는지 단일 예측 기반 MIP 모드가 사용되는지를 결정할 수 있다. 단일 예측 기반 MIP 모드는 MIP 모드만을 사용하여 예측 블록을 생성하는 방법이다. MIP mode can be performed adaptively on a block basis. The encoder may generate and signal a bitstream containing information about whether the multi-prediction based MIP mode is used. The decoder can parse information about whether the multi-prediction-based MIP mode is used to determine whether the multi-prediction-based MIP mode or the single-prediction-based MIP mode is used when generating a prediction block for the current block. Single prediction-based MIP mode is a method of generating a prediction block using only the MIP mode.
복잡도를 감소시키고 시그널링되는 부호화 정보를 감소시키기 위해서, 인코더는 현재 블록의 인트라 예측 모드가 MIP인 경우, 다중 예측 기반 MIP 모드의 사용 여부에 대한 정보를 추가적으로 비트스트림에 포함할 수 있고, 시그널링할 수 있다. 인코더는 현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 인트라 예측 방향성 모드에 대한 정보를 추가적으로 비트스트림에 포함시킬 수 있고, 시그널링할 수 있다. 디코더는 현재 블록의 인트라 예측 모드가 MIP인 경우, 추가적으로 다중 예측 기반 MIP 모드의 사용 여부에 대한 정보를 파싱하고, 다중 예측 기반 MIP 모드가 사용되는 경우, 인트라 예측 방향성 모드에 대한 정보를 추가적으로 파싱할 수 있다.In order to reduce complexity and signal encoded information, if the intra prediction mode of the current block is MIP, the encoder may additionally include in the bitstream information about whether to use the multi-prediction based MIP mode and signal it. there is. If a multi-prediction-based MIP mode is used in the current block, the encoder can additionally include information about the intra-prediction directional mode in the bitstream and signal it. If the intra-prediction mode of the current block is MIP, the decoder additionally parses information about whether the multi-prediction-based MIP mode is used, and if the multi-prediction-based MIP mode is used, the decoder additionally parses information about the intra-prediction directional mode. You can.
인트라 예측 방향성 모드가 추가적으로 시그널링되는 경우, 비트량이 증가하여 압축 효율이 감소될 수 있다. 현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 임의의 정해진 인트라 예측 방향성 모드만이 사용될 수 있다. 이때, 임의의 정해진 인트라 예측 방향성 모드는 MPM 리스트 중에 하나일 수 있으며, 인코더는 MPM 리스트 중에서 다중 예측 기반 MIP 모드에서 사용될 인트라 예측 방향성 모드에 대한 인덱스 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 인덱스 정보를 파싱하여 MPM 리스트 중에서 다중 예측 기반 MIP 모드에서 사용될 인트라 예측 방향성 모드를 결정할 수 있다.If the intra prediction directional mode is additionally signaled, the bit quantity may increase and compression efficiency may be reduced. If a multi-prediction based MIP mode is used in the current block, only a certain intra prediction directional mode can be used. At this time, any given intra prediction directionality mode may be one of the MPM list, and the encoder may signal by including index information about the intra prediction directionality mode to be used in the multi-prediction-based MIP mode among the MPM list in the bitstream. If the multi-prediction-based MIP mode is used in the current block, the decoder can parse the index information and determine the intra-prediction directional mode to be used in the multi-prediction-based MIP mode from the MPM list.
현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 인트라 예측 방향성 모드 기반의 예측 블록을 생성하기 위해 수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드가 사용될 수 있다. 즉, 인코더는 평면 모드 선택 정보를 포함하는 비트스트림을 생성하고 시그널링 할 수 있다. 디코더는 현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 평면 모드 선택 정보를 파싱하여 다중 예측 기반 MIP 모드에서 사용될 인트라 예측 방향성 모드를 결정할 수 있다.When a multi-prediction based MIP mode is used in the current block, a vertical plane mode, a horizontal plane mode, and a conventional plane mode can be used to generate a prediction block based on the intra prediction directional mode. That is, the encoder can generate and signal a bitstream including planar mode selection information. If the multi-prediction-based MIP mode is used in the current block, the decoder can parse the planar mode selection information to determine the intra-prediction directional mode to be used in the multi-prediction-based MIP mode.
현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 비디오 신호 처리 장치는 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드를 사용하여 3가지 평면 모드 중 어떠한 평면 모드를 사용할 것인지 결정할 수 있다. 예를 들어, 현재 블록에 다중 예측 기반 MIP 모드가 사용되는 경우, 비디오 신호 처리 장치는 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 작다면, 현재 블록은 인트라 예측 방향성 모드 기반의 예측 블록을 생성하기 위해 수평 방향 평면 모드가 적용될 수 있다. 또는, 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 같거나 크다면, 현재 블록은 인트라 예측 방향성 모드 기반의 예측 블록을 생성하기 위해 수직 방향 평면 모드가 적용될 수 있다.If a multi-prediction based MIP mode is used in the current block, the video signal processing device can determine which of the three planar modes to use using the intra-prediction directional mode of the DIMD derived from surrounding pixels of the current block. For example, when a multi-prediction based MIP mode is used in the current block, the video signal processing device generates a prediction block based on the intra-prediction directional mode if the DIMD (or TIMD) mode of the current block is less than 34. To do this, a horizontal plane mode can be applied. Alternatively, if the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the vertical plane mode may be applied to the current block to generate a prediction block based on the intra prediction directional mode.
비디오 신호 처리 장치는 현재 블록에 평면 모드가 사용되는 경우, 수직 방향 평면 모드와 수평 방향 평면 모드를 사용하여 각각의 모드에 대한 예측 블록을 생성하고, 각 예측 블록에 대해 가중치를 적용하여 최종 예측 블록을 생성할 수 있다. 이때, 각 예측 블록에 대한 가중치는 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드에 따라 동일하거나 상이할 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 크거나 같다면, 수직 방향 평면 모드를 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 예를 들어, 수직 방향 평면 모드를 사용하여 예측되는 블록에 대한 가중치는 3일 수 있고, 수평 방향 평면 모드를 사용하여 예측되는 블록에 대한 가중치는 1일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 작다면, 수평 방향 평면 모드를 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 예를 들어, 수평 방향 평면 모드를 사용하여 예측되는 블록에 대한 가중치는 3일 수 있고, 수직 방향 평면 모드를 사용하여 예측되는 블록에 대한 가중치는 1일 수 있다. 임의의 값은 정수로, 34(도 6의 34번 각도 모드)일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보에는 첫번째 인트라 예측 방향성 모드, 두번째 인트라 예측 방향성 모드, 가중치 예측을 수행할지 여부에 대한 정보가 포함될 수 있다. 현재 블록의 주변 픽셀의 DIMD 정보 중에서 가중치 예측이 수행되지 않은 경우, 비디오 신호 처리 장치는 동일한 가중치를 적용하여 예측 블록을 생성할 수 있다.If a planar mode is used in the current block, the video signal processing device generates a prediction block for each mode using the vertical plane mode and the horizontal plane mode, and applies a weight to each prediction block to create the final prediction block. can be created. At this time, the weight for each prediction block may be the same or different depending on the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the largest weight may be applied to the block predicted using the vertical plane mode. For example, the weight for a block predicted using a vertical plane mode may be 3, and the weight for a block predicted using a horizontal plane mode may be 1. If the intra-prediction directional mode of the DIMD derived from the surrounding pixels of the current block is smaller than a random value, the greatest weight may be applied to the block predicted using the horizontal plane mode. For example, the weight for a block predicted using the horizontal plane mode may be 3, and the weight for a block predicted using the vertical plane mode may be 1. The arbitrary value is an integer, such as 34 (angle mode 34 in FIG. 6). DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not performed among the DIMD information of neighboring pixels of the current block, the video signal processing device may generate a prediction block by applying the same weight.
CIIP 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 현재 블록의 예측 블록은 인트라 예측 모드가 사용된 예측 블록(인트라 예측 블록)과 인터 예측 모드가 사용된 예측 블록(인터 예측 블록)을 가중치 평균하여 생성될 수 있다. 이때, CIIP 모드에서 인트라 예측 블록을 생성하는데 사용되는 인트라 예측 방향성 모드가 평면 모드인 경우, 인코더는 평면 모드 선택 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 CIIP 모드가 사용되고, 평면 모드가 사용되는 경우, 평면 모드 선택 정보를 파싱하여, 인트라 예측 블록을 생성하기 위해 사용되는 인트라 예측 모드를 결정할 수 있다.When the CIIP mode is used to generate a prediction block of the current block, the prediction block of the current block is weighted based on the prediction block in which intra prediction mode is used (intra prediction block) and the prediction block in which inter prediction mode is used (inter prediction block). It can be generated by averaging. At this time, when the intra prediction directional mode used to generate an intra prediction block in CIIP mode is a planar mode, the encoder can generate and signal a bitstream including planar mode selection information. If CIIP mode is used and planar mode is used, the decoder may parse the planar mode selection information to determine the intra prediction mode used to generate the intra prediction block.
현재 블록이 인트라 예측 모드를 사용하여 예측되는 경우, 현재 블록과 주변 블록 간의 경계 부분에 픽셀 값의 연속성이 끊길 수 있다. 이러한 비연속성을 해소하기 위해서 생성된 예측 블록에 PDPC(Position dependent intra prediction combination) 필터링이 적용될 수 있다. 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 평면 모드 기반의 PDPC 필터링이 수행되지 않고, 수평 각도 모드(예를 들어, 도 6의 18번 각도 모드) 기반의 PDPC 필터링이 수행될 수 있다. 또는, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 평면 모드 기반의 PDPC 필터링이 수행되지 않고, 수직 각도 모드(예를 들어, 도 6의 50번 각도 모드) 기반의 PDPC 필터링이 수행될 수 있다. 또한, 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 평면 모드 기반의 PDPC 필터링이 수행되지 않고, 수직 각도 모드(예를 들어, 도 6의 50번 각도 모드)기반의 PDPC 필터링이 수행될 수 있다. 또한, 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 평면 모드 기반의 PDPC 필터링이 수행되지 않고, 수평 각도 모드(예를 들어, 도 6의 18번 각도 모드) 기반의 PDPC 필터링이 수행될 수 있다. 본 명세서에 있어서 현재 블록이 예측된다는 의미는 현재 블록의 예측 블록이 생성된다는 의미와 동일할 수 있다.If the current block is predicted using the intra prediction mode, the continuity of pixel values may be broken at the boundary between the current block and neighboring blocks. To resolve this discontinuity, PDPC (Position dependent intra prediction combination) filtering may be applied to the generated prediction block. When the vertical plane mode is used to generate the prediction block of the current block, PDPC filtering based on the plane mode is not performed, but PDPC filtering based on the horizontal angle mode (e.g., angle mode 18 in FIG. 6) is performed. It can be. Alternatively, when the vertical plane mode is used to generate the prediction block of the current block, PDPC filtering based on the plane mode is not performed, and PDPC filtering is performed based on the vertical angle mode (e.g., angle mode 50 in FIG. 6). This can be done. In addition, when the horizontal plane mode is used to generate the prediction block of the current block, PDPC filtering based on the plane mode is not performed, but PDPC filtering is performed based on the vertical angle mode (e.g., angle mode 50 in FIG. 6). This can be done. Additionally, when the horizontal plane mode is used to generate the prediction block of the current block, PDPC filtering based on the plane mode is not performed, but PDPC filtering is performed based on the horizontal angle mode (e.g., angle mode No. 18 in FIG. 6). This can be done. In this specification, the meaning that the current block is predicted may be the same as the meaning that the prediction block of the current block is generated.
도 33과 수학식 4를 참조하면, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 고정된 위치인 rec(-1, H)의 화소 값과 x 축 좌표에 따라 유동적으로 변화되는 rec(x, -1)의 화소 값에 기초하여 현재 블록의 예측 블록이 생성될 수 있다. 마찬가지로, 도 33과 수학식 5를 참조하면, 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 고정된 위치인 rec(W, -1)의 화소 값과 y축 좌표에 따라 유동적으로 변화되는 rec(-1, y)의 화소 값에 기초하여 현재 블록의 예측 블록이 생성될 수 있다. 즉, 주변 블록 간의 경계 부분에 픽셀 값의 연속성이 유지되도록 예측 블록이 생성될 수 있으므로, 수직 방향 평면 모드 또는 수평 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성되는 경우, PDPC가 수행되지 않을 수 있다.Referring to FIG. 33 and Equation 4, when the vertical plane mode is used to generate a prediction block of the current block, the pixel value of rec(-1, H), which is a fixed position, changes flexibly according to the x-axis coordinate. A prediction block of the current block may be generated based on the pixel value of rec(x, -1). Likewise, referring to FIG. 33 and Equation 5, when the horizontal plane mode is used to generate a prediction block of the current block, the pixel value of rec(W, -1), which is a fixed position, and the y-axis coordinate are flexible. A prediction block of the current block can be generated based on the pixel value of rec(-1, y) that changes to . In other words, the prediction block can be generated so that the continuity of pixel values is maintained at the boundary between neighboring blocks, so if the prediction block of the current block is generated using the vertical plane mode or the horizontal plane mode, PDPC will not be performed. You can.
상술한 평면 모드에 대한 PDPC 필터링 수행은 현재 블록이 CIIP 모드로 부호화된 경우에도 적용될 수 있다.PDPC filtering for the planar mode described above can be applied even when the current block is encoded in CIIP mode.
비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수직 방향 평면 모드 또는 수평 방향 평면 모드로 예측된 경우, 비디오 신호 처리 장치는 주변 블록의 인트라 예측 방향성 모드를 평면 모드로 설정하여 MPM 리스트에 포함시킬 수 있다. 또는 비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수직 방향 평면 모드 또는 수평 방향 평면 모드로 예측된 경우, 주변 블록의 인트라 예측 방향성 모드를 DC 모드로 설정하여 MPM 리스트에 포함시킬 수 있다. 또는 비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수평 방향 평면 모드로 예측된 경우, 주변 블록의 인트라 예측 방향성 모드를 수평 각도 모드(도 6의 18번 각도 모드)로 설정하여 MPM 리스트에 포함시킬 수 있다. 또는, 비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수직 방향 평면 모드로 예측된 경우, 주변 블록의 인트라 예측 방향성 모드를 수직 각도 모드(도 6의 50번 각도 모드)로 설정하여 MPM 리스트에 포함시킬 수 있다. 반대로, 수평 방향 평면 모드는 수직 특성을 가질 수 있으므로, 비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수평 방향 평면 모드로 예측된 경우, 비디오 신호 처리 장치는 주변 블록의 인트라 예측 방향성 모드를 수직 각도 모드(도 6의 50번 각도 모드)로 설정하여 MPM 리스트에 포함시킬 수 있다. 또는 비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 구성할 때, 현재 블록에 인접한 주변 블록이 수직 방향 평면 모드로 예측된 경우, 비디오 신호 처리 장치는 주변 블록의 인트라 예측 방향성 모드를 수평 각도 모드(도 6의 18번 각도 모드)로 설정하여 MPM 리스트에 포함시킬 수 있다.When the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the vertical plane mode or the horizontal plane mode, the video signal processing device selects the intra prediction directional mode of the neighboring block. You can set it to planar mode and include it in the MPM list. Or, when the video signal processing device constructs the MPM list for the current block, if neighboring blocks adjacent to the current block are predicted in vertical plane mode or horizontal plane mode, set the intra prediction directionality mode of the neighboring block to DC mode. It can be included in the MPM list. Alternatively, when the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the horizontal plane mode, the intra prediction direction mode of the neighboring block is set to the horizontal angle mode (No. 18 in FIG. 6 You can set it to angle mode and include it in the MPM list. Alternatively, when the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the vertical plane mode, the intra prediction direction mode of the neighboring block is set to the vertical angle mode (50 in FIG. 6 It can be included in the MPM list by setting it to angle mode). Conversely, since the horizontal plane mode may have vertical characteristics, when the video signal processing device constructs the MPM list for the current block, if the surrounding blocks adjacent to the current block are predicted to be in the horizontal plane mode, the video signal processing device can be included in the MPM list by setting the intra prediction direction mode of the neighboring block to vertical angle mode (angle mode 50 in FIG. 6). Alternatively, when the video signal processing device constructs the MPM list for the current block, if the neighboring block adjacent to the current block is predicted in the vertical direction plane mode, the video signal processing device changes the intra prediction directionality mode of the neighboring block to the horizontal angle mode ( It can be set to angle mode 18 in FIG. 6 and included in the MPM list.
본 명세서에서 제안하는 수직 방향 평면 모드, 수평 방향 평면 모드는 임의의 특정 모드로 시그널링되지 않고, 인트라 예측 방향성 모드 중 어느 하나의 모드로 포함되어 시그널링될 수 있다. 도 6을 참조하면, 인트라 예측 방향성 모드는 총 67가지이며, 이 중에서 0번(평면 모드)과 1번(DC 모드)은 비방향성 모드이고 2~66까지는 방향성 모드(각도 모드)이다. 새롭게 정의된 수직 방향 평면 모드 및 수평 방향 평면 모드를 포함하여 인트라 예측 방향성 모드는 확장될 수 있다. 예를 들어, 기존 인트라 예측 방향성 모드에서 2번 모드를 수직 방향 평면 모드, 3번 모드를 수평 방향 평면 모드로 설정할 수 있다. 즉, 0번(평면 모드), 1번(DC 모드), 2번(수직 방향 평면 모드), 3번(수평 방향 평면 모드)은 비방향성 모드로, 4~68번은 기존 2~66까지의 방향성 모드와 동일하게 설정될 수 있다.The vertical plane mode and horizontal plane mode proposed in this specification may not be signaled as any specific mode, but may be included and signaled as any one of the intra prediction directional modes. Referring to FIG. 6, there are a total of 67 intra prediction directional modes, of which 0 (planar mode) and 1 (DC mode) are non-directional modes, and 2 to 66 are directional modes (angle mode). Intra prediction directional modes can be expanded to include newly defined vertical plane modes and horizontal plane modes. For example, in the existing intra prediction directional mode, mode 2 can be set to the vertical plane mode and mode 3 can be set to the horizontal plane mode. That is, numbers 0 (flat mode), 1 (DC mode), 2 (vertical flat mode), and 3 (horizontal flat mode) are non-directional modes, and numbers 4 to 68 are the existing directional modes from 2 to 66. It can be set the same as the mode.
도 34는 본 발명의 일 실시예에 따른 수직 방향 평면 모드 또는 수평 방향 평면 모드를 위한 다중 변환 세트 및 LFNST 세트를 유도하는 방법을 나타낸다.Figure 34 shows a method for deriving a multiple transform set and an LFNST set for a vertical plane mode or a horizontal plane mode according to an embodiment of the present invention.
도 35는 본 발명의 일 실시예에 따른 매핑 테이블을 나타낸다.Figure 35 shows a mapping table according to an embodiment of the present invention.
도 36은 본 발명의 일 실시예에 따른 변환 타입 세트 테이블을 나타낸다.Figure 36 shows a conversion type set table according to an embodiment of the present invention.
도 37은 본 발명의 일 실시예에 따른 변환 타입 조합 테이블을 나타낸다.Figure 37 shows a conversion type combination table according to an embodiment of the present invention.
도 38은 본 발명의 일 실시예에 따른 IDT 변환 타입에 대한 임계 값 테이블을 나타낸다.Figure 38 shows a threshold table for IDT conversion type according to an embodiment of the present invention.
수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 오차(잔차) 신호(블록)의 특성은 수직 각도 모드(도 6의 50번 각도 모드)의 오차 신호의 특성과 유사할 수 있다. 오차 신호에 적용되는 다중 변환 세트(Multiple Transform Set, MTS)는 현재 블록의 인트라 예측 방향성 모드에 기초하여 달라질 수 있다. 즉, 수직 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성되는 경우, 인코더는 오차 신호에 대해 평면 모드의 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 1차 변환과정을 수행할 수 있다. 또는 인코더는 다중 변환 세트와 관계없이 미리 정해진 변환 세트를 사용하여 1차 변환을 수행할 수 있다. 또한, 인코더는 다중 변환 세트를 이용하거나 미리 정해진 변환 세트를 사용하여 1차 변환된 변환 계수에 대해 LFNST를 통한 2차 변환을 수행할 수 있다. LFNST 수행 시 사용되는 변환 매트릭스는 인트라 예측 방향성 모드에 따라 달라질 수 있다. 즉, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 인코더는 오차 신호에 대해 평면 모드에 대한 2차 LFNST 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 2차 LFNST 변환 매트릭스의 집합을 사용하여 변환과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 인코더는 평면 모드가 아닌 수평 각도 모드(도 6의 18번 각도 모드)를 사용하여 1차 또는 2차 변환 매트릭스(또는 매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 1차 LFNST 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 1차 LFNST 변환 매트릭스의 집합을 사용하여 변환 과정을 수행할 수 있다. 또한, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드의 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 2차 변환과정을 수행할 수 있다. 본 명세서에 있어서 인코더는 부호화 처리 과정에서 1차 변환 수행 후 2차 변환을 수행할 수 있고, 이는 각각 디코더의 복호화 처리 과정에서 1차 변환 및 2차 변환에 대응된다. 즉, 인코더가 수행하는 1차 변환은 디코더가 수행하는 2차 변환(인코더가 수행하는 1차 변환의 역변환)에 대응되고, 인코더가 수행하는 2차 변환은 디코더가 수행하는 1차 변환(인코더가 수행하는 2차 변환의 역변환)에 대응된다.When the vertical plane mode is used to generate the prediction block of the current block, the characteristics of the error (residual) signal (block) may be similar to the characteristics of the error signal in the vertical angle mode (angle mode 50 in FIG. 6). . The multiple transform set (MTS) applied to the error signal may vary based on the intra prediction directional mode of the current block. That is, when the prediction block of the current block is generated using the vertical plane mode, the encoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the vertical angle mode (angle mode 50 in FIG. 6). A set of transformation matrices can be used to perform a first-order transformation process based on multiple transformation sets. Alternatively, the encoder may perform the primary transformation using a predetermined transform set regardless of the multiple transform sets. Additionally, the encoder can perform secondary transformation through LFNST on the primary transformed transform coefficients using multiple transform sets or a predetermined transform set. The transformation matrix used when performing LFNST may vary depending on the intra prediction directionality mode. That is, when the vertical plane mode is used to generate the prediction block of the current block, the encoder does not use the set of second-order LFNST transformation matrices for the plane mode for the error signal, but uses the vertical angle mode (number 50 in Figure 6). The transformation process can be performed using a set of second-order LFNST transformation matrices (in angular mode). When the horizontal plane mode is used to generate the prediction block of the current block, the encoder uses the horizontal angle mode (angle mode 18 in Figure 6) rather than the planar mode to generate the first or second transformation matrix (or set of matrices). , set of matrices, set of kernels) can be derived. When the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but rather uses the vertical angle mode (angle mode 50 in Figure 6 ) The transformation process can be performed using a set of first-order LFNST transformation matrices. Additionally, when the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but rather the set of transformation matrices of the vertical angle mode (angle mode 50 in Figure 6). A set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets. In this specification, the encoder may perform secondary transformation after performing primary transformation in the encoding process, which corresponds to the primary transformation and secondary transformation in the decoding process of the decoder, respectively. In other words, the primary transformation performed by the encoder corresponds to the secondary transformation performed by the decoder (the inverse transformation of the primary transformation performed by the encoder), and the secondary transformation performed by the encoder corresponds to the primary transformation performed by the decoder (the reverse transformation of the primary transformation performed by the encoder). It corresponds to the inverse transformation of the secondary transformation performed.
도 33, 수학식 4를 참조하면, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 예측 블록은 고정된 위치인 rec(-1, H)의 화소 값과 x 축 좌표에 따라 유동적으로 변화되는 rec(x, -1)의 화소 값에 기초하여 생성될 수 있다. 즉, 수직 방향 평면 모드가 사용되면, x축으로 화소 값의 변화가 발생하므로, 오차 신호의 특성은 수평 각도 모드(도 6의 50번 각도 모드)의 오차 신호의 특성과 유사할 수 있다. 오차 신호에 적용되는 다중 변환 세트는 현재 블록의 인트라 예측 방향성 모드에 기초하여 달라질 수 있다. 즉, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 인코더는 오차 신호에 대해 평면 모드의 변환 매트릭스의 집합을 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 1차 변환과정을 수행할 수 있다. 또는 인코더는 다중 변환 세트와 관계없이 미리 정해진 변환 세트를 사용하여 1차 변환을 수행할 수 있다. 또한, 인코더는 다중 변환 세트를 이용하거나 미리 정해진 변환 세트를 사용하여 1차 변환된 변환 계수에 대해 LFNST를 통한 2차 변환을 수행할 수 있다. LFNST 수행 시 사용되는 변환 매트릭스는 인트라 예측 방향성 모드에 따라 달라질 수 있다. 즉, 수직 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성되는 경우, 인코더는 오차 신호에 대해 평면 모드에 대한 2차 LFNST 변환 매트릭스의 집합을 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 2차 LFNST 변환 매트릭스의 집합을 사용하여 변환과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 인코더는 평면 모드가 아닌 수직 각도 모드(예를 들어, 도 6의 50번 각도 모드)를 사용하여 1차 또는 2차 변환 매트릭스(또는 매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 1차 LFNST 변환 매트릭스의 집합을 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드) 1차 LFNST 변환 매트릭스의 집합을 사용하여 변환 과정을 수행할 수 있다. 또한, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드의 변환 매트릭스의 집합을 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 2차 변환과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 모드가 생성되는 경우, 인코더는 평면 모드가 아닌 수직 각도 모드(도 6의 50번 각도 모드)를 사용하여 1차 또는 2차 변환 매트릭스(또는 매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 1차 LFNST 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)에 대한 1차 LFNST 변환 매트릭스의 집합을 사용하여 변환 과정을 수행할 수 있다. 또한, 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 디코더는 오차 신호에 대해 평면 모드의 변환 매트릭스의 집합을 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 2차 변환과정을 수행할 수 있다.Referring to Figure 33, Equation 4, when the vertical plane mode is used to generate the prediction block of the current block, the prediction block is generated according to the pixel value of rec(-1, H), which is a fixed position, and the x-axis coordinate. It can be generated based on the dynamically changing pixel value of rec(x, -1). That is, when the vertical plane mode is used, a change in pixel value occurs along the x-axis, so the characteristics of the error signal may be similar to those of the horizontal angle mode (angle mode 50 in FIG. 6). The set of multiple transforms applied to the error signal may vary based on the intra prediction directional mode of the current block. That is, when the vertical plane mode is used to generate the prediction block of the current block, the encoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the horizontal angle mode (angle mode No. 18 in Figure 6). A set of transformation matrices can be used to perform a first-order transformation process based on multiple transformation sets. Alternatively, the encoder may perform the primary transformation using a predetermined transform set regardless of the multiple transform sets. Additionally, the encoder can perform secondary transformation through LFNST on the primary transformed transform coefficients using multiple transform sets or a predetermined transform set. The transformation matrix used when performing LFNST may vary depending on the intra prediction directionality mode. That is, when the prediction block of the current block is generated using the vertical plane mode, the encoder does not use the set of second-order LFNST transformation matrices for the planar mode for the error signal, but uses the horizontal angle mode (number 18 in Figure 6). The transformation process can be performed using a set of second-order LFNST transformation matrices (in angular mode). When the horizontal plane mode is used to generate the prediction block of the current block, the encoder uses the vertical angle mode (e.g., angle mode 50 in Figure 6) rather than the planar mode to generate the first or second transformation matrix ( Alternatively, a set of matrices, a set of matrices, and a kernel set) can be derived. When the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but uses the horizontal angle mode (angle mode 18 in Figure 6 ) The transformation process can be performed using a set of first-order LFNST transformation matrices. In addition, when the vertical plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but the set of transformation matrices of the horizontal angle mode (angle mode No. 18 in Figure 6). A set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets. If the horizontal plane mode is used to generate the prediction mode for the current block, the encoder uses the vertical angle mode (angle mode 50 in Figure 6) rather than the planar mode to generate the first or second order transformation matrix (or set of matrices). , set of matrices, set of kernels) can be derived. When the horizontal plane mode is used to generate the prediction block of the current block, the decoder does not use the set of first-order LFNST transform matrices for the planar mode for the error signal, but rather uses the vertical angle mode (angle mode 50 in Figure 6 The transformation process can be performed using a set of first-order LFNST transformation matrices for ). Additionally, when the horizontal plane mode is used to generate the prediction block of the current block, the decoder does not use the set of transformation matrices of the plane mode for the error signal, but rather the set of transformation matrices of the vertical angle mode (angle mode 50 in Figure 6). A set of transformation matrices can be used to perform a secondary transformation process based on multiple transformation sets.
수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 비디오 신호 처리 장치에서 현재 블록에 사용 가능한 다중 변환 세트를 선택하는 방법에 대해 설명한다.When a vertical plane mode, a horizontal plane mode, and a conventional plane mode are used to generate a prediction block of the current block, a method of selecting a multi-transform set available for the current block in a video signal processing device will be described.
1) 먼저, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로 크기를 하나의 변수로 매핑하기 위해, 현재 블록의 크기를 기반으로 nSzIdxW와 nSzIdxH 값을 유도할 수 있다. nSzIdxW은 현재 블록의 너비에 2의 로그(Log) 값을 계산한 후, 소수점 자리를 버리고 2를 차분한 값과 3 중 최소 값일 수 있다. nSzIdxH는 현재 블록의 높이에 2의 로그(Log) 값을 계산한 후, 소수점 자리를 버리고 2를 차분한 값과 3 중 최소 값일 수 있다.1) First, the video signal processing device can derive nSzIdxW and nSzIdxH values based on the size of the current block in order to map the horizontal and vertical sizes of the current block into one variable. nSzIdxW calculates the logarithm of 2 to the width of the current block, discarding decimal places, and can be the minimum value between 2 and 3. nSzIdxH can be the minimum value between 2 and 3 after calculating the logarithm of 2 to the height of the current block, discarding the decimal places.
2) 다음으로, 비디오 신호 처리 장치는 현재 블록의 인트라 방향성 모드(predMode)를 유도할 수 있다. TIMD 모드인 경우에는 기존 67개에서 131개로 확장된 인트라 예측 모드가 사용될 수 있어, 기존 67개 모드로 정밀도(precision)를 감소시킨다.2) Next, the video signal processing device can derive the intra-directional mode (predMode) of the current block. In TIMD mode, intra prediction modes expanded from the existing 67 to 131 can be used, reducing precision to the existing 67 modes.
3) 다음으로, 비디오 신호 처리 장치는 ucMode, nMdIdx, isTrTransposed 값을 유도할 수 있다. 3) Next, the video signal processing device can derive the ucMode, nMdIdx, and isTrTransposed values.
A. 현재 블록이 MIP 모드로 부호화되었을 경우, ucMode는 '0', nMdIdx은 '35', isTrTransposed는 MIP에서 유도된 값으로 설정될 수 있다.A. If the current block is encoded in MIP mode, ucMode can be set to '0', nMdIdx can be set to '35', and isTrTransposed can be set to a value derived from MIP.
B. 현재 블록이 MIP 모드로 부호화되지 않았다면, ucMode는 현재 블록의 인트라 방향성 모드(predMode)로 설정될 수 있다. predMode는 인트라 방향성 모드의 인덱스 값을 의미할 수 있다. 현재 블록의 가로 세로 크기 비율에 따라 확장 각도 모드를 통해 predMode는 결정될 수 있다. 비디오 신호 처리 장치는 predMode를 2에서 66사이의 값으로 클리핑(clipping)할 수 있다. 수직 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성된 경우, 비디오 신호 처리 장치는 predMode를 수평 방향 예측 모드(도 6의 18번 각도 모드)로 재설정할 수 있다. 수평 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성된 경우, 비디오 신호 처리 장치는 predMode를 수직 방향 예측 모드(도 6의 50번 각도 모드)로 재설정할 수 있다. predMode가 대각 모드인 34번 각도 모드 보다 큰 경우, isTrTransposed 값은 1로 설정될 수 있고, predMode가 34보다 같거나 작은 경우 isTrTransposed 값은 0으로 설정될 수 있다. predMode가 34보다 큰 경우, 비디오 신호 처리 장치는 67(인트라 방향성 모드 인덱스의 최대 값)에서 1을 더한 값에서 predMode의 값을 차분한 값으로 predMode의 값을 재설정한다. 예를 들어, predMode가 35라면, 비디오 신호 처리 장치는 35번 각도 모드를 33(67+1-35(predMode))번 각도 모드로 재설정할 수 있다. predMode가 66이라면, 비디오 신호 처리 장치는 66번 각도 모드를 2(67+1-66(predMode))번 각도 모드로 재설정할 수 있다 즉, 대각 모드인 34번 각도 모드를 기준으로 대칭이 되도록 함으로써, 도 35의 변환 매핑 테이블의 크기를 절반 정도로 줄이는 효과가 있다.B. If the current block is not encoded in MIP mode, ucMode can be set to the intra-directional mode (predMode) of the current block. predMode may mean the index value of intra directional mode. predMode can be determined through extended angle mode according to the width-to-height size ratio of the current block. The video signal processing device can clip predMode to a value between 2 and 66. If the prediction block of the current block is generated using the vertical plane mode, the video signal processing device may reset predMode to the horizontal prediction mode (angle mode no. 18 in FIG. 6). If the prediction block of the current block is generated using the horizontal plane mode, the video signal processing device may reset predMode to the vertical prediction mode (angle mode No. 50 in FIG. 6). If predMode is greater than angle mode 34, which is diagonal mode, the isTrTransposed value can be set to 1, and if predMode is equal to or less than 34, the isTrTransposed value can be set to 0. If predMode is greater than 34, the video signal processing device resets the value of predMode to a value subtracted from 67 (the maximum value of the intra directional mode index) plus 1. For example, if predMode is 35, the video signal processing device can reset angle mode 35 to angle mode 33 (67+1-35(predMode)). If predMode is 66, the video signal processing device can reset angle mode 66 to angle mode 2 (67+1-66(predMode)). That is, by making it symmetrical based on angle mode 34, which is the diagonal mode. , which has the effect of reducing the size of the conversion mapping table in Figure 35 by about half.
4) 비디오 신호 처리 장치는 nSzIdxW와 nSzIdxH, isTrTransposed 값을 통해, nSzIdx값을 유도할 수 있다. isTrTransposed 값이 '1'이면, nSzIdxH에 4를 곱한 후, nSzIdxW를 더한 값이 nSzIdx로 설정될 수 있다. isTrTransposed 값이 '0'이면, nSzIdxW에 4를 곱한 후, nSzIdxH를 더한 값이 nSzIdx로 설정될 수 있다.4) The video signal processing device can derive the nSzIdx value through nSzIdxW, nSzIdxH, and isTrTransposed values. If the isTrTransposed value is '1', the value obtained by multiplying nSzIdxH by 4 and adding nSzIdxW may be set as nSzIdx. If the isTrTransposed value is '0', the value obtained by multiplying nSzIdxW by 4 and adding nSzIdxH may be set as nSzIdx.
5) 비디오 신호 처리 장치는 현재 블록의 크기 정보인 nSzIdx와 현재 블록의 인트라 방향성 모드 정보인 nMdIdx를 이용하여 도 35의 미리 정의된 테이블에 따라 사용 가능한 변환 타입 세트의 인덱스인 nTrSet을 유도할 수 있다. 도 35는 현재 블록의 화면 내 방향성 모드(0 내지 34 및 MIP)와 현재 블록의 크기 인덱스(0 내지 15)에 따른 변환 타입 세트의 인덱스를 정의한다. 도 35를 참조하면 nTrSet은 80가지가 될 수 있으며, 현재 블록의 크기가 4x8이고, 현재 블록의 화면 내 방향성 모드가 13이라면, nTrSet은 '7'이 될 수 있다.5) The video signal processing device can use nSzIdx, which is the size information of the current block, and nMdIdx, which is the intra directionality mode information of the current block, to derive nTrSet, which is an index of the set of available transformation types according to the predefined table in FIG. 35. . Figure 35 defines the index of the transformation type set according to the intra-screen orientation mode (0 to 34 and MIP) of the current block and the size index (0 to 15) of the current block. Referring to FIG. 35, nTrSet can be 80 types. If the size of the current block is 4x8 and the orientation mode within the screen of the current block is 13, nTrSet can be '7'.
6) 비디오 신호 처리 장치는 비트스트림에 포함된 mts_idx를 파싱하여 nTrSet에 대응되는 변환 타입 세트를 도 36의 테이블로부터 유도할 수 있다. 수직 및 수평 방향의 변환 타입은 predMode 가 대각 모드인 34번 각도 모드보다 큰 값인지 여부에 따라 다르게 설정된다. 도 36의 회색 음영 처리된 세로 열의 0 내지 79는 nTrSet에 대응되고, 회색 음영 처리된 가로 열의 0 내지 3은 mts_idx에 대응될 수 있다. 도 36을 참조하면 nTrSet가 7이고, mts_idx의 값이 3이라면, (2, 17, 18, 22) 중에서 22가 선택될 수 있다. 그리고, 도 37의 변환 타입 조합 테이블의 인덱스 22에 대응되는 DST1, DCT5가 선택되며, 현재 블록의 수직 방향 변환 타입은 DST1로 수평 방향 변환 타입은 DCT5로 설정될 수 있다. 도 37의 회색 음영 처리된 가로 열의 0 내지 24는 도 36을 통해 선택되는 인덱스이고, 회색 음영 처리된 세로 열의 0 내지 1은 각각 수직 방향 변환 타입과 수평 방향 변환 타입을 의미할 수 있다. 현재 블록의 화면 내 예측 방향성 모드가 대각 모드인 34보다 클 경우, 수직 및 수평 방향의 변환 타입이 서로 교체된다.6) The video signal processing device can parse mts_idx included in the bitstream and derive a transformation type set corresponding to nTrSet from the table in FIG. 36. The conversion type in the vertical and horizontal directions is set differently depending on whether predMode is a value greater than angle mode 34, which is diagonal mode. 36, numbers 0 to 79 of the gray-shaded vertical column may correspond to nTrSet, and numbers 0 to 3 of the gray-shaded horizontal column may correspond to mts_idx. Referring to FIG. 36, if nTrSet is 7 and the value of mts_idx is 3, 22 can be selected from (2, 17, 18, 22). Then, DST1 and DCT5 corresponding to index 22 of the transformation type combination table of FIG. 37 are selected, and the vertical transformation type of the current block can be set to DST1 and the horizontal transformation type to DCT5. 0 to 24 in the gray-shaded horizontal column of FIG. 37 are indices selected through FIG. 36, and 0 to 1 in the gray-shaded vertical column may mean the vertical direction conversion type and the horizontal direction conversion type, respectively. If the intra-screen prediction directionality mode of the current block is greater than 34, which is the diagonal mode, the vertical and horizontal transformation types are exchanged.
mts_idx 값이 '3'이고, 현재 블록의 가로 및 세로의 크기가 모두 16 이하이면, 후술하는 과정을 통해 수직 또는 수평 방향의 변환 타입이 IDT 변환 타입으로 재설정될 수 있다.If the mts_idx value is '3' and both the horizontal and vertical sizes of the current block are 16 or less, the vertical or horizontal transformation type can be reset to the IDT transformation type through a process described later.
현재 블록의 화면 내 예측 방향성 모드의 인덱스와 수평 방향 모드의 인덱스인 18 간의 절대값 차이가 임의의 정해진 값보다 적다면, 수직 방향의 변환 타입은 IDT 변환 타입으로 재설정될 수 있다. 현재 블록의 화면 내 예측 방향성 모드의 인덱스와 수평 방향 모드의 인덱스인 50 간의 절대값 차이가 임의의 정해진 값보다 적다면, 수평 방향의 변환 타입은 IDT 변환 타입으로 재설정될 수 있다. 이때, 임의의 정해진 값은 정수로, 현재 블록의 가로 또는 세로의 크기에 기초하여 결정될 수 있다. 예를 들어, 임의의 정해진 값은 도 38의 테이블을 통해 결정될 수 있다. 도 38(a)의 테이블은 가로 또는 세로의 크기가 4씩 차이가 날때마다 임계 값이 다르게 설정된 경우를 나타내고, 도 38(b)의 테이블은 가로 또는 세로의 크기가 2배씩 차이가 날때마다 임계 값이 다르게 설정된 경우를 나타낸다. 현재 블록의 크기가 16x16 크기인 경우에는 수직 방향의 변환 타입은 IDT 변환 타입으로 재설정되지 않고, 기존의 변환 타입을 그대로 유지될 수 있다.If the absolute value difference between the index of the intra-screen prediction direction mode of the current block and 18, which is the index of the horizontal direction mode, is less than a certain value, the vertical direction transformation type can be reset to the IDT transformation type. If the absolute value difference between the index of the intra-screen prediction direction mode of the current block and 50, which is the index of the horizontal direction mode, is less than a certain value, the horizontal direction transformation type can be reset to the IDT transformation type. At this time, the arbitrary value is an integer and can be determined based on the horizontal or vertical size of the current block. For example, any given value can be determined through the table in FIG. 38. The table in Figure 38(a) shows a case where the threshold value is set differently every time the horizontal or vertical size differs by 4, and the table in Figure 38(b) shows a case where the threshold value is set each time the horizontal or vertical size differs by 2. Indicates a case where the value is set differently. If the current block size is 16x16, the vertical transformation type is not reset to the IDT transformation type, and the existing transformation type can be maintained as is.
도 39는 본 발명의 일 실시예에 따른 비디오 신호 처리 장치가 1차 또는 2차 변환 매트릭스를 유도하는 방법을 나타낸다.Figure 39 shows a method by which a video signal processing device derives a first-order or second-order transformation matrix according to an embodiment of the present invention.
구체적으로, 도 39는 현재 블록이 수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드를 사용하여 예측된 경우, 비디오 신호 처리 장치가 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도하는 방법에 대한 순서도를 나타낸다.Specifically, Figure 39 shows that when the current block is predicted using a vertical plane mode, a horizontal plane mode, or a conventional plane mode, the video signal processing device uses a first or second transformation matrix (a set of matrices, a set of matrices) , shows a flowchart of how to derive the kernel set).
도 39를 참조하면 비디오 신호 처리 장치는 인트라 예측 방향성 모드(intra prediction mode)를 입력 받아서 현재 블록의 예측 모드가 평면 모드인지 여부를 확인할 수 있다. 예측 모드가 평면 모드가 아닌 경우, 비디오 신호 처리 장치는 입력된 인트라 예측 방향성 모드를 기반으로 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 예측 모드가 평면 모드인 경우, 비디오 신호 처리 장치는 예측 모드가 수직 방향 평면 모드인지 여부를 확인할 수 있다. 예측 모드가 수직 방향 평면 모드인 경우, 비디오 신호 처리 장치는 수평 각도 모드(도 6의 18번 각도 모드)를 기반으로 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 예측 모드가 수직 방향 평면 모드가 아닌 경우, 비디오 신호 처리 장치는 예측 모드가 수평 방향 평면 모드인지 여부를 확인할 수 있다. 예측 모드가 수평 방향 평면 모드인 경우, 비디오 신호 처리 장치는 수직 각도 모드(도 6의 50번 각도 모드)를 기반으로 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 예측 모드가 수평 방향 평면 모드가 아닌 경우, 비디오 신호 처리 장치는 종래의 평면 모드를 기반으로 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다.Referring to FIG. 39, the video signal processing device can receive an intra prediction directional mode and check whether the prediction mode of the current block is a planar mode. If the prediction mode is not a planar mode, the video signal processing device may derive a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the input intra prediction directional mode. When the prediction mode is a planar mode, the video signal processing device can check whether the prediction mode is a vertical planar mode. When the prediction mode is the vertical plane mode, the video signal processing device creates a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the horizontal angle mode (angle mode 18 in Figure 6). It can be induced. If the prediction mode is not the vertical plane mode, the video signal processing device may check whether the prediction mode is the horizontal plane mode. When the prediction mode is the horizontal plane mode, the video signal processing device creates a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the vertical angle mode (angle mode 50 in Figure 6). It can be induced. If the prediction mode is not a horizontal plane mode, the video signal processing device may derive a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) based on the conventional planar mode.
수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드 중 어느 하나의 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 비디오 신호 처리 장치는 DIMD 방법을 사용하여 유도된 인트라 예측 방향성 모드를 사용하여 1차 또는 2차 변환 매트릭스 (매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다. 다시 말하면, 수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드 중 어느 하나의 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 비디오 신호 처리 장치는 DIMD 방법을 사용하여 유도된 인트라 예측 방향성 모드의 변환 매트릭스의 집합을 사용하여 다중 변환 세트에 기반한 1차 변환과정을 수행할 수 있다. 또한, 수직 방향 평면 모드, 수평 방향 평면 모드, 종래의 평면 모드 중 어느 하나의 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 비디오 신호 처리 장치는 DIMD 방법을 사용하여 유도된 인트라 예측 방향성 모드의 변환 매트릭스의 집합을 사용하여 LFNST에 기반한 2차 변환 과정을 수행할 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보에는 첫번째 인트라 예측 방향성 모드, 두번째 인트라 예측 방향성 모드, 가중치 예측을 수행할지 여부 정보가 포함될 수 있다. 만일 인코더 및 디코더에서 현재 블록의 주변 픽셀로부터 DIMD 정보 중에서 가중치 예측이 적용되지 않았을 경우, 기존 Planar 예측 모드를 사용하여 1차 혹은 2차 변환 매트릭스 (혹은 매트릭스의 집합, 매트릭스의 세트, 커널 세트)를 유도할 수 있다.When any one of the vertical plane mode, horizontal plane mode, and conventional plane mode is used to generate the prediction block of the current block, the video signal processing device uses the intra prediction directional mode derived using the DIMD method. Thus, a first-order or second-order transformation matrix (set of matrices, set of matrices, set of kernels) can be derived. In other words, when the prediction block of the current block is generated using any one of the vertical plane mode, horizontal plane mode, and conventional plane mode, the video signal processing device uses the intra prediction directionality derived using the DIMD method. A set of transformation matrices of modes can be used to perform a first-order transformation process based on multiple transformation sets. In addition, when the prediction block of the current block is generated by using any one of the vertical plane mode, the horizontal plane mode, and the conventional planar mode, the video signal processing device uses the intra prediction directional mode derived using the DIMD method. A second-order transformation process based on LFNST can be performed using a set of transformation matrices. DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not applied among the DIMD information from the surrounding pixels of the current block in the encoder and decoder, the first or second transformation matrix (or set of matrices, set of matrices, or kernel set) is used using the existing Planar prediction mode. It can be induced.
평면 모드는 평활한 영역에 효과적일 수 있으므로, 복잡도를 감소시키기 위해서, 인코더는 다중 변환 세트에 기반한 1차 변환과정을 수행하지 않고, DCT2 변환 방법을 묵시적으로 적용할 수 있다. 디코더는 현재 블록이 평면 모드로 예측되는 경우, DCT2 변환 방법을 적용할 수 있다. 현재 블록이 종래의 평면 모드로 예측되는 경우, 비디오 신호 처리 장치는 다중 변환 세트에 기반한 1차 변환과정을 수행하지 않고, DCT2 변환 방법을 묵시적으로 적용할 수 있다. 현재 블록이 수직 방향 평면 모드, 수평 방향 평면 모드로 예측되는 경우, 비디오 신호 처리 장치는 다중 변환 세트에 기반한 1차 변환과정을 적용할 수 있다. 한편, 현재 블록이 수직 방향 평면 모드, 수평 방향 평면 모드로 예측되는 경우, 비디오 신호 처리 장치는 다중 변환 세트에 기반한 1차 변환과정을 적용하지 않고, DCT2 변환 방법을 묵시적으로 적용할 수 있다. 현재 블록이 종래의 평면 모드로 예측되는 경우, 비디오 신호 처리 장치는 다중 변환 세트에 기반한 1차 변환 과정을 적용할 수 있다. 또한, 상술한 방법에서 현재 블록의 크기가 임의의 크기인 경우, DCT2 변환 방법이 아닌 DST7 변환 방법이 적용될 수 있다. 이때, 임의의 크기는 현재 블록의 가로 또는 세로의 크기가 4보다 같거나 크고 또는 16보다 작거나 같은 경우일 수 있다. 예를 들어, 수직 방향 평면 모드 또는 수평 방향 평면 모드에 기초하여 현재 블록이 예측되고, 현재 블록의 가로의 크기가 32이고, 세로의 크기가 16인 경우, 비디오 신호 처리 장치는 가로 방향 변환을 위해서는 DCT2를 적용하고, 세로 방향 변환을 위해서는 DST7을 적용할 수 있다.Since planar mode can be effective in smooth regions, to reduce complexity, the encoder can implicitly apply the DCT2 transformation method without performing a first-order transformation process based on a multiple transformation set. The decoder can apply the DCT2 transformation method if the current block is predicted in planar mode. If the current block is predicted to be in a conventional planar mode, the video signal processing device can implicitly apply the DCT2 transformation method without performing a primary transformation process based on a multiple transformation set. If the current block is predicted to be a vertical plane mode or a horizontal plane mode, the video signal processing device can apply a first-order transformation process based on a multiple transformation set. Meanwhile, if the current block is predicted to be a vertical plane mode or a horizontal plane mode, the video signal processing device may implicitly apply the DCT2 transformation method without applying the first transformation process based on the multiple transformation set. If the current block is predicted to be in a conventional planar mode, the video signal processing device can apply a first-order transform process based on a multiple transform set. Additionally, in the above-described method, if the size of the current block is an arbitrary size, the DST7 conversion method rather than the DCT2 conversion method can be applied. At this time, the arbitrary size may be the case where the horizontal or vertical size of the current block is equal to or greater than 4 or less than or equal to 16. For example, if the current block is predicted based on the vertical plane mode or the horizontal plane mode, and the horizontal size of the current block is 32 and the vertical size is 16, the video signal processing device requires horizontal direction conversion. DCT2 can be applied, and DST7 can be applied for vertical conversion.
평면 모드와 유사하게 DC 모드도 3가지 예측 모드로 구분될 수 있다. 구체적으로, DC 모드는 현재 블록의 상측 화소들 간의 평균, 현재 블록의 좌측 화소들 간의 평균, 현재 블록의 상측 및 좌측 화소들 간의 평균에 따른 모드로 구분될 수 있다. 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 비디오 신호 처리 장치는 현재 블록의 상측 화소들 간의 평균 값을 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 현재 블록의 세로의 크기가 가로의 크기보다 크다면, 비디오 신호 처리 장치는 현재 블록의 좌측 화소들 간의 평균 값을 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 현재 블록의 가로의 크기와 세로의 크기가 같다면, 비디오 신호 처리 장치는 상측 및 좌측의 화소들 간의 평균 값을 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 인코더는 3가지 DC 모드 중 어떠한 모드에 기초하여 현재 블록이 예측되었는지에 대한 정보(DC 모드 선택 정보)를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더는 DC 모드 선택 정보를 파싱하여 결정되는 모드에 기초하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 인코더는 현재 블록의 예측 모드가 DC 모드인 경우, 어떠한 모드로 부호화되었는지에 대한 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더는 현재 블록의 예측 모드가 DC 모드인 경우, DC 모드 선택 정보를 파싱하여, 현재 블록에 대한 최종 DC 모드를 결정할 수 있다. 예를 들어, 현재 블록이 좌측 화소들 간의 평균을 사용하는 DC 모드로 예측되는 경우, 인코더는 현재 블록이 DC 모드라는 정보를 시그널링하고 그리고 현재 블록이 좌측 화소들 간의 평균을 사용하는 DC 모드를 통해 예측되었다는 정보를 추가적인 플래그 비트를 사용하여 시그널링할 수 있다. 디코더는 현재 블록이 DC 모드인 경우, 추가적인 플래그 비트를 파싱하여 현재 블록에 어떠한 모드가 적용되었는지를 결정할 수 있다.Similar to planar mode, DC mode can also be divided into three prediction modes. Specifically, DC mode can be divided into modes based on the average between the upper pixels of the current block, the average between the left pixels of the current block, and the average between the upper and left pixels of the current block. If the horizontal size of the current block is larger than the vertical size, the video signal processing device may generate a prediction block of the current block using the average value between upper pixels of the current block. If the vertical size of the current block is larger than the horizontal size, the video signal processing device may generate a prediction block of the current block using the average value between the left pixels of the current block. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block of the current block using the average value between the upper and left pixels. The encoder can generate and signal a bitstream containing information (DC mode selection information) on which of the three DC modes the current block was predicted based on. The decoder may generate a prediction block for the current block based on the mode determined by parsing the DC mode selection information. If the prediction mode of the current block is DC mode, the encoder can generate and signal a bitstream including information about what mode it was encoded in. If the prediction mode of the current block is DC mode, the decoder can parse the DC mode selection information and determine the final DC mode for the current block. For example, if the current block is predicted to be in DC mode using the average between left pixels, the encoder signals the information that the current block is in DC mode and predicts that the current block is predicted to be in DC mode using the average between left pixels. Predicted information can be signaled using additional flag bits. If the current block is in DC mode, the decoder can determine which mode is applied to the current block by parsing additional flag bits.
상기 3가지 DC 예측 모드는 ISP 모드에서 사용되지 않을 수 있다. 인코더는 현재 블록이 ISP 모드로 부호화되었고, 현재 블록이 DC 모드로 부호화된 경우, 현재 블록이 좌측 화소들간의 평균을 사용하는 DC 모드인지 또는 상단 화소들간의 평균을 사용하는 DC 모드인지를 나타내는 플래그 비트를 시그널링 하지 않을 수 있다. 디코더는 현재 블록이 ISP 모드이고, 현재 블록이 DC 모드인 경우, 현재 블록이 좌측 화소들간의 평균을 사용하는 DC 모드인지 또는 상단 화소들간의 평균을 사용하는 DC 모드인지를 나타내는 플래그 비트를 파싱하지 않을 수 있다.The above three DC prediction modes may not be used in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in DC mode, the encoder provides a flag indicating whether the current block is DC mode using the average between left pixels or DC mode using the average between top pixels. Bits may not be signaled. If the current block is in ISP mode and the current block is in DC mode, the decoder does not parse the flag bit indicating whether the current block is in DC mode using the average between left pixels or DC mode using the average between top pixels. It may not be possible.
한편 상기 3가지 DC 예측 모드는 ISP 모드에서 사용될수 있다. 인코더는 현재 블록이 ISP 모드로 부호화되었고, 현재 블록이 DC 모드로 부호화된 경우, 현재 블록의 예측 모드가 3가지 DC 예측 모드 중 어떠한 것인지를 나타내는 플래그 비트를 시그널링하여 비트스트림에 포함시킬 수 있다. 디코더는 현재 블록이 ISP 모드이고, 현재 블록이 DC 모드인 경우, 플래그 비트를 파싱하여, 현재 블록에 대한 최종 DC 모드를 설정할 수 있다.Meanwhile, the three DC prediction modes can be used in ISP mode. If the current block is encoded in ISP mode and the current block is encoded in DC mode, the encoder can signal a flag bit indicating which of the three DC prediction modes the prediction mode of the current block is and include it in the bitstream. If the current block is ISP mode and the current block is DC mode, the decoder can set the final DC mode for the current block by parsing the flag bit.
상기 3가지 DC 예측 모드의 적용 여부는 현재 블록의 컬러 성분에 기초하여 결정될 수 있다. 현재 블록이 휘도 성분 블록인 경우, 상기 3가지 DC 예측 모드는 사용될 수 있다. 또는 현재 블록이 색차 성분 블록인 경우, 상기 3가지 DC 예측 모드 중에서 상측 및 좌측 화소들 간의 평균을 사용하는 DC 예측 모드만 사용될 수 있다. 따라서, 인코더는 현재 블록이 색차 성분 블록이고 DC 모드가 적용되는 경우, 3가지 DC 모드 중 어떠한 DC 모드가 사용되는지를 나타내는 플래그 비트를 비트스트림에 포함시키지 않을 수 있다. 디코더는 현재 블록이 색차 성분 블록이고 DC 모드가 적용되는 경우, 3가지 DC 모드 중 어떠한 DC 모드가 사용되는지를 나타내는 플래그 비트를 파싱하지 않을 수 있으며, 현재 블록에 대한 DC 모드를 상측 및 좌측 화소들 간의 평균을 사용하는 DC 예측 모드로 설정할 수 있다.Whether or not to apply the three DC prediction modes can be determined based on the color component of the current block. When the current block is a luminance component block, the above three DC prediction modes can be used. Alternatively, when the current block is a chrominance component block, among the three DC prediction modes, only the DC prediction mode that uses the average between the upper and left pixels can be used. Therefore, if the current block is a chrominance component block and DC mode is applied, the encoder may not include a flag bit indicating which of the three DC modes is used in the bitstream. If the current block is a chrominance component block and DC mode is applied, the decoder may not parse the flag bit indicating which of the three DC modes is used, and sets the DC mode for the current block to the upper and left pixels. It can be set to DC prediction mode, which uses the average between
ISP 모드가 적용되는 경우, 현재 블록은 수평 방향으로 분할되거나 수직 방향으로 분할될 수 있다. 현재 블록의 가로 또는 세로의 크기에 따라 하나의 블록이 2개 또는 4개의 블록으로 분할될 수 있다. ISP 모드로 부호화된 블록에서 상기 3가지 평면 모드 또는 상기 3가지 DC 모드가 사용되는 경우, 블록의 분할 형태에 따라 예측 모드는 결정될 수 있다. 현재 블록이 ISP 모드로 부호화되었고 ISP 모드에 따른 분할 형태가 수평 방향 분할인 경우, 3가지 평면 모드 중 수평 방향 평면 모드가 사용될 수 있다. 현재 블록이 ISP 모드로 부호화되었고 ISP 모드에 따른 분할 형태가 수평 방향 분할인 경우, 3가지 평면 모드 중 수직 방향 평면 모드가 사용될 수 있다. 현재 블록이 ISP 모드로 부호화되었고 ISP 모드에 따른 분할 형태가 수평 방향 분할인 경우 3가지 DC 모드들 중 좌측 화소들 간의 평균을 사용하는 모드가 사용될 수 있다. 현재 블록이 ISP 모드로 부호화되었고 ISP 모드에 따른 분할 형태가 수평 방향 분할인 경우 3가지 DC 모드들 중 상측 화소들 간의 평균을 사용하는 모드가 사용될 수 있다. When ISP mode is applied, the current block may be divided horizontally or vertically. Depending on the horizontal or vertical size of the current block, one block can be divided into 2 or 4 blocks. When the three planar modes or the three DC modes are used in a block encoded in ISP mode, the prediction mode can be determined according to the division type of the block. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, the horizontal plane mode can be used among the three plane modes. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, the vertical plane mode can be used among the three plane modes. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, among the three DC modes, the mode that uses the average between left pixels can be used. If the current block is encoded in ISP mode and the division type according to the ISP mode is horizontal division, among the three DC modes, the mode that uses the average between upper pixels can be used.
ISP 모드의 분할 형태는 DIMD로부터 유도된 인트라 예측 방향성 모드 또는 TIMD로부터 유도된 인트라 예측 방향성 모드에 기초하여 결정될 수 있다. 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 작다면, 현재 블록의 ISP 분할 형태는 수평 방향 분할일 수 있다. 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 같거나 크다면 현재 블록의 ISP 분할 형태는 수직 방향 분할일 수 있다. 반대로, 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 작다면, 현재 블록의 ISP 분할 형태는 수직 방향 분할일 수 있다. 현재 블록의 DIMD(또는 TIMD) 모드가 34보다 같거나 크다면 현재 블록의 ISP 분할 형태는 수평 방향 분할일 수 있다. ISP 모드의 분할 형태가 DIMD(또는 TIMD)로부터 유도된 인트라 예측 방향성 모드에 기초하여 결정되는 경우, 분할 형태는 암묵적으로 결정되므로, 인코더는 ISP 분할 형태에 대한 정보를 비트스트림에 포함시키지 않을 수 있고, 디코더는 ISP 분할 형태에 대한 정보를 파싱하지 않을 수 있다.The division type of the ISP mode may be determined based on the intra prediction directional mode derived from DIMD or the intra prediction directional mode derived from TIMD. If the DIMD (or TIMD) mode of the current block is less than 34, the ISP partition type of the current block may be horizontal partition. If the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the ISP partition type of the current block may be vertical partition. Conversely, if the DIMD (or TIMD) mode of the current block is less than 34, the ISP division type of the current block may be vertical division. If the DIMD (or TIMD) mode of the current block is equal to or greater than 34, the ISP partition type of the current block may be horizontal partition. If the splitting type of the ISP mode is determined based on the intra prediction directional mode derived from DIMD (or TIMD), the splitting type is implicitly determined, so the encoder may not include information about the ISP splitting type in the bitstream. , the decoder may not parse information about the ISP partition type.
비디오 신호 처리 장치는 3가지 DC 모드를 모두 사용하여 각각의 모드에 대한 예측 블록을 생성하고, 각 예측 블록 별로 동일하거나 상이한 가중치를 적용하여 가중치 평균을 통한 최종 예측 블록을 생성할 수 있다. 이때, 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 상측 화소들 간의 평균을 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 또한 현재 블록의 가로의 크기가 세로의 크기보다 작다면, 좌측 화소들 간의 평균을 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 또는 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 크거나 같다면, 상측 화소들 간의 평균을 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 작다면, 좌측 화소들 간의 평균을 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다. 여기서 임의의 값은 정수가 될 수 있으며, 대각 모드(도 6의 34번 각도 모드)의 인덱스인 34일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보에는 첫번째 인트라 예측 방향성 모드, 두번째 인트라 예측 방향성 모드, 가중치 예측을 수행할지 여부에 대한 정보가 포함될 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보 중에서 가중치 예측이 적용되지 않았을 경우, 상측 및 좌측 모든 화소들 간의 평균을 사용하여 예측된 블록에 가장 큰 가중치가 적용될 수 있다.The video signal processing device can use all three DC modes to generate prediction blocks for each mode, and apply the same or different weights to each prediction block to generate the final prediction block through weight average. At this time, if the horizontal size of the current block is larger than the vertical size, the largest weight may be applied to the block predicted using the average between the upper pixels. Additionally, if the horizontal size of the current block is smaller than the vertical size, the largest weight may be applied to the block predicted using the average between left pixels. Alternatively, if the intra prediction direction mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the largest weight may be applied to the block predicted using the average between the upper pixels. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is smaller than a random value, the largest weight may be applied to the block predicted using the average between left pixels. Here, the arbitrary value can be an integer and can be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6). DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If weight prediction is not applied among DIMD information derived from surrounding pixels of the current block, the largest weight may be applied to the block predicted using the average between all pixels on the upper and left sides.
도 40은 본 발명의 일 실시예에 따른 수직 또는 수평 라인 단위의 DC 예측 방법을 나타낸다.Figure 40 shows a DC prediction method on a vertical or horizontal line basis according to an embodiment of the present invention.
DC 모드는 하나의 평균 값 만을 사용하여 현재 블록에 대한 예측 블록을 생성하는 예측 방법이고, 예측 블록 내의 모든 픽셀이 동일한 값을 가지는 특징이 있다. 완만한 변화를 가지는 블록에서의 DC 모드를 사용한 예측 효율을 높이기 위해서, 비디오 신호 처리 장치는 블록 내 수직 또는 수평 위치에 따라 평균 값이 변화하도록 예측 블록을 생성할 수 있으며, 이를 변화도 기반 DC 예측 모드라 기술한다. 도 40을 참조하면, 수직 방향으로의 DC 모드를 사용하여 현재 블록에 대한 예측 블록이 생성될 때, 비디오 신호 처리 장치는 현재 블록에 상측으로 인접한 픽셀들(예를 들어, 도 40의 빗금 친 픽셀들)의 평균 값을 계산한 후, 현재 블록의 첫 번째 수평 라인에 해당하는 픽셀들(예를 들어, 도 40의 1로 표시된 픽셀들)에 적용하여 예측 샘플을 생성할 수 있다. 다음으로, 현재 블록에 좌측으로 인접한 픽셀들 중 가장 위에 위치하는 참조 픽셀(A)와 다음 수평 라인의 참조 픽셀(B)간의 변화도에 따라 평균 값이 재계산될 수 있다. 비디오 신호 처리 장치는 재계산된 평균 값을 현재 블록의 두번째 수평 라인(예를 들어, 도 40의 2로 표시된 픽셀들)에 적용하여 예측 샘플을 생성할 수 있다. 두번째 수평 라인을 위한 평균값을 재계산하는 방법은 참조 픽셀(A)와 참조 픽셀(B) 간의 거리(L), 참조 픽셀(A)와 참조 픽셀(E) 간의 거리(M), 참조 픽셀(A)와 현재 블록의 좌측 하단 위치를 기준으로 (-1, -1)의 위치에 있는 픽셀(E) 간의 픽셀 값 간의 차이(X)를 사용한 보간법을 통해 계산될 수 있다. 예를 들어, L을 M으로 나눈 값에 X를 곱한 값을 평균값에 더하여 평균값은 재계산될 수 있다. 다음 번째 수평 라인도 동일하게 수행되어, 현재 블록에 대한 예측 샘플이 생성될 수 있다. 즉, 현재 블록에 좌측(또는 상측)으로 인접한 참조 픽셀들의 변화도에 따라 각각의 수평(또는 수직) 라인에 대한 평균 값이 변화되도록 현재 블록의 예측 블록은 생성될 수 있다. 각 수평(또는 수직) 방향의 샘플들의 화소(픽셀)값들은 서로 동일하도록 구성되며, 수직(또는 수평) 화소(픽셀)값들은 적어도 하나 이상이 달라지도록 현재 블록의 예측 블록이 생성될 수 있다. 또한 라인 단위 DC 예측 모드는 수직 방향으로의 라인 단위 DC 예측 모드, 수평 방향으로의 라인 단위 DC 예측 모드로 나누어질 수 있다. 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 현재 블록에 상측으로 인접한 화소(픽셀)의 개수가 많으므로, 수직 방향으로의 라인 단위 DC 예측 모드를 사용하여 현재 블록에 대한 예측 블록은 생성될 수 있다. 또는 현재 블록의 가로 및 세로의 크기가 같다면, 종래의 DC 예측 모드를 사용하여 현재 블록에 대한 예측 블록은 생성될 수 있다.DC mode is a prediction method that generates a prediction block for the current block using only one average value, and has the characteristic that all pixels in the prediction block have the same value. In order to increase prediction efficiency using DC mode in blocks with gradual changes, a video signal processing device can generate a prediction block so that the average value changes depending on the vertical or horizontal position within the block, and use this to predict DC based on the gradient. It is described as a mode. Referring to FIG. 40, when a prediction block for the current block is generated using DC mode in the vertical direction, the video signal processing device selects pixels upwardly adjacent to the current block (e.g., the hatched pixel in FIG. 40). After calculating the average value of the current block, a prediction sample can be generated by applying the average value to the pixels corresponding to the first horizontal line of the current block (for example, pixels indicated by 1 in FIG. 40). Next, the average value may be recalculated according to the degree of change between the reference pixel (A) located at the top of the pixels adjacent to the left of the current block and the reference pixel (B) of the next horizontal line. The video signal processing device may generate a prediction sample by applying the recalculated average value to the second horizontal line of the current block (for example, pixels indicated by 2 in FIG. 40). How to recalculate the average value for the second horizontal line is the distance between reference pixel (A) and reference pixel (B) (L), the distance between reference pixel (A) and reference pixel (E) (M), and ) and the pixel (E) at a position of (-1, -1) based on the lower left position of the current block. For example, the average value can be recalculated by adding L divided by M multiplied by X to the average value. The same is performed for the next horizontal line, so that a prediction sample for the current block can be generated. That is, the prediction block of the current block may be generated so that the average value for each horizontal (or vertical) line changes according to the gradient of reference pixels adjacent to the left (or top) of the current block. The pixel (pixel) values of each horizontal (or vertical) direction sample are configured to be the same, and the prediction block of the current block may be generated so that at least one vertical (or horizontal) pixel (pixel) value is different. Additionally, the line-level DC prediction mode can be divided into a line-level DC prediction mode in the vertical direction and a line-level DC prediction mode in the horizontal direction. If the horizontal size of the current block is larger than the vertical size, the number of pixels (pixels) adjacent to the upper side of the current block is large, so the prediction block for the current block is generated using the line-by-line DC prediction mode in the vertical direction. It can be. Alternatively, if the horizontal and vertical sizes of the current block are the same, a prediction block for the current block can be generated using the conventional DC prediction mode.
도 41은 본 발명의 일 실시예에 따른 수직 또는 수평 라인(line) 단위의 평면 예측 방법을 나타낸다.Figure 41 shows a plane prediction method in units of vertical or horizontal lines according to an embodiment of the present invention.
도 41(a) 내지 (d)를 참조하면, 수직 방향 평면 모드를 사용하여 현재 블록이 예측되는 경우, 사용되는 기준 참조 화소의 위치는 각 수평 라인마다 달라질 수 있다. 구체적으로, 현재 블록의 첫번째 수평 라인(도 41(a)에서 1로 표시된 픽셀들)은 현재 블록에 상측으로 인접한 픽셀들 (예를 들어, 도 41의 빗금 친 픽셀들)과 A 픽셀을 사용하여 예측될 수 있다. 현재 블록의 두번째 수평 라인(도 41(a)의 2로 표시된 픽셀들)은 현재 블록에 상측으로 인접한 픽셀들(예를 들어, 도 41의 빗금 친 픽셀들)과 B 픽셀을 사용하여 예측될 수 있다. 또한 라인 단위 평면 예측 모드는 수직 방향 평면 모드, 수평 방향 평면 모드, 수직 및 수평 방향으로의 예측 블록들을 가중치 평균한 모드로 나누어질 수 있다. 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 현재 블록에 상측으로 인접한 화소(픽셀)의 개수가 많으므로, 비디오 신호 처리 장치는 수직 방향 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 세로의 크기가 가로의 크기보다 크다면, 현재 블록에 좌측으로 인접한 화소(픽셀)의 개수가 많으므로, 비디오 신호 처리 장치는 수형 방향 평면 모드를 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 현재 블록의 가로 및 세로의 크기가 같다면, 비디오 신호 처리 장치는 종래의 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다.Referring to FIGS. 41(a) to 41(d), when the current block is predicted using the vertical plane mode, the position of the standard reference pixel used may vary for each horizontal line. Specifically, the first horizontal line of the current block (pixels marked 1 in Figure 41(a)) uses pixels adjacent to the upper side of the current block (e.g., hatched pixels in Figure 41) and the A pixel. It can be predicted. The second horizontal line of the current block (pixels marked 2 in Figure 41(a)) can be predicted using pixels adjacent to the top of the current block (e.g., hatched pixels in Figure 41) and the B pixel. there is. Additionally, the line-by-line planar prediction mode can be divided into a vertical planar mode, a horizontal planar mode, and a weighted average mode of prediction blocks in the vertical and horizontal directions. If the horizontal size of the current block is larger than the vertical size, the number of pixels (pixels) adjacent to the upper side of the current block is large, so the video signal processing device generates a prediction block for the current block using the vertical plane mode. can do. If the vertical size of the current block is larger than the horizontal size, the number of pixels (pixels) adjacent to the left of the current block is large, so the video signal processing device can generate a prediction block of the current block using the vertical direction plane mode. You can. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block for the current block using a conventional planar mode.
도 42는 본 발명의 일 실시예에 따른 평면 모드를 사용한 서브 블록 단위의 예측 방법을 나타낸다.Figure 42 shows a prediction method in sub-block units using planar mode according to an embodiment of the present invention.
비디오 신호 처리 장치는 현재 블록을 임의의 지정된 크기(MxN)의 서브 블록으로 분할한 후, 평면 모드를 사용하여 서브 블록 단위로 예측을 수행할 수 있다. 도 42(a) 내지 (c)를 참조하면, 예측을 위한 기준 참조 화소의 위치(도 42의 1, 2, 3, 4)는 각 서브 블록마다 달라질 수 있다. 구체적으로 도 42(a)를 참조하면, 현재 블록은 MxN 크기의 4개의 서브 블록으로 분할될 수 있다. 현재 서브 블록의 좌상단 위치 및/또는 현재 서브 블록의 가로 및 세로의 크기에 기초하여 기준 참조 화소의 위치는 결정될 수 있다. 도 42(a)에서 좌상단 서브 블록의 기준 참조 화소의 위치는 1, 3이 될 수 있고, 우상단 서브 블록의 기준 참조 화소의 위치는 2, 3이 될 수 있고, 좌하단 서브 블록의 기준 참조 화소의 위치는 1, 4가 될 수 있고, 우하단 서브 블록의 기준 참조 화소의 위치는 2, 4가 될 수 있다. 예를 들어, 도 42(a)의 우상단 서브 블록에 대한 예측 블록이 생성될 때, 평면 모드가 사용되는 경우, 비디오 신호 처리 장치는 V 픽셀 값과 기준 참조 화소 3을 사용하여 생성한 값과 H 픽셀 값과 기준 참조 화소 2를 사용하여 생성한 값을 가중치 평균하여 X 표시된 픽셀에 대한 예측 값을 생성할 수 있다. 도 42(b)는 서브 블록 단위의 수평 방향 평면 모드의 예측을 나타낸다. 예를 들어, 도 42(b)의 좌하단 서브 블록에 대한 예측 블록이 생성될 때, 수평 방향 평면 모드가 사용되는 경우, 비디오 신호 처리 장치는 H 픽셀 값과 기준 참조 화소 1을 사용하여 생성한 값을 가중치 평균하여 X 표시된 픽셀에 대한 예측 값을 생성할 수 있다. 도 42(c)는 서브 블록 단위의 수직 방향 평면 모드의 예측을 나타낸다. 예를 들어, 도 42(c)의 우상단 서브 블록에 대한 예측 블록이 생성될 때, 수직 방향 평면 모드가 사용되는 경우, 비디오 신호 처리 장치는 V 픽셀 값과 기준 참조 화소 3을 사용하여 생성한 값을 가중치 평균하여 X 표시된 픽셀에 대한 예측 값을 생성할 수 있다.The video signal processing device may divide the current block into sub-blocks of an arbitrary specified size (MxN) and then perform prediction on a sub-block basis using a planar mode. Referring to FIGS. 42(a) to 42(c), the positions of standard reference pixels for prediction (1, 2, 3, and 4 in FIG. 42) may vary for each sub-block. Specifically, referring to FIG. 42(a), the current block can be divided into 4 sub-blocks of MxN size. The position of the standard reference pixel may be determined based on the upper left position of the current sub-block and/or the horizontal and vertical sizes of the current sub-block. In Figure 42(a), the positions of the standard reference pixels of the upper left subblock can be 1 and 3, the positions of the standard reference pixels of the upper right subblock can be 2 and 3, and the standard reference pixels of the lower left subblock can be 1 and 3. The positions of can be 1 and 4, and the positions of the standard reference pixels of the lower right sub-block can be 2 and 4. For example, when a prediction block for the upper right sub-block in Figure 42(a) is generated, if planar mode is used, the video signal processing device uses the V pixel value and the value generated using the reference pixel 3 and H A predicted value for the pixel marked with an Figure 42(b) shows prediction of the horizontal plane mode on a sub-block basis. For example, when the prediction block for the lower left sub-block in FIG. 42(b) is generated, if the horizontal plane mode is used, the video signal processing device generates the H pixel value and the standard reference pixel 1. A weighted average of the values can be used to generate a predicted value for the X-marked pixel. Figure 42(c) shows prediction of the vertical plane mode on a sub-block basis. For example, when a prediction block for the upper right sub-block in Figure 42(c) is generated, if the vertical plane mode is used, the video signal processing device generates a value using the V pixel value and the reference pixel 3. You can generate a predicted value for the pixel marked with X by weighting the average.
비디오 신호 처리 장치는 현재 블록의 가로 또는 세로 크기, 현재 블록의 가로 및 세로 크기의 비율, 현재 블록이 휘도 성분 블록인지 또는 색차 성분 블록인지 여부, 양자화 파라미터 정보, 현재 블록의 주변 블록들의 인트라 예측 방향성 모드 정보, 서브 블록의 위치, 현재 블록의 주변 픽셀로부터 DIMD를 사용하여 유도된 인트라 예측 방향성 모드 정보 중에서 적어도 하나 이상에 기초하여, 각 서브 블록에 수평 방향 평면 모드, 수직 방향 평면 모드 및 종래의 평면 모드 중 어떠한 평면 모드가 적용되는지 결정할 수 있다.The video signal processing device includes the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, whether the current block is a luminance component block or a chrominance component block, quantization parameter information, and intra prediction directionality of neighboring blocks of the current block. Based on at least one of the mode information, the position of the subblock, and intra prediction directional mode information derived using DIMD from surrounding pixels of the current block, a horizontal plane mode, a vertical plane mode, and a conventional plane are applied to each subblock. Among the modes, you can determine which planar mode is applied.
현재 블록의 주변 픽셀로부터 DIMD를 사용하여 유도된 인트라 예측 방향성 모드가 임의의 값보다 크거나 같다면, 비디오 신호 처리 장치는 수직 방향 평면 모드를 적용하여 서브 블록의 예측 블록을 생성할 수 있다. 현재 블록의 주변 픽셀로부터 DIMD를 사용하여 유도된 인트라 예측 방향성 모드가 임의의 값보다 작다면, 비디오 신호 처리 장치는 수평 방향 평면 모드를 적용하여 서브 블록의 예측 블록을 생성할 수 있다. 이때, 임의의 값은 정수일 수 있고, 대각 모드(도 6의 34번 각도 모드)의 인덱스인 34일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보에는 첫번째 인트라 예측 방향성 모드, 두번째 인트라 예측 방향성 모드, 가중치 예측을 수행할지 여부에 대한 정보가 포함될 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보가 가중치 예측이 수행되지 않는 것을 나타내는 경우 비디오 신호 처리 장치는 종래의 평면 모드를 사용하여 각 서브 블록의 예측 블록을 생성할 수 있다.If the intra prediction directional mode derived using DIMD from the surrounding pixels of the current block is greater than or equal to a random value, the video signal processing device may apply the vertical plane mode to generate the prediction block of the sub-block. If the intra prediction directional mode derived using DIMD from the surrounding pixels of the current block is smaller than a random value, the video signal processing device may apply the horizontal plane mode to generate the prediction block of the sub-block. At this time, the arbitrary value may be an integer or may be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6). DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If DIMD information derived from surrounding pixels of the current block indicates that weight prediction is not performed, the video signal processing device may generate a prediction block for each sub-block using a conventional planar mode.
각 서브 블록의 위치에 기초하여 각 서브 블록의 예측 블록을 생성하기 위해 사용되는 평면 모드가 결정될 수 있다. 비디오 신호 처리 장치는 종래의 평면 모드를 사용하여 좌상단 서브 블록의 예측 블록을 생성할 수 있고, 수직 방향 평면 모드를 사용하여 우상단 서브 블록의 예측 블록을 생성할 수 있고, 수평 방향 평면 모드를 사용하여 좌하단 서브 블록의 예측 블록을 생성할 수 있고, 종래의 펴면 모드를 사용하여 우하단 서브 블록의 예측 블록을 생성할 수 있다.The plane mode used to generate the prediction block for each sub-block may be determined based on the location of each sub-block. The video signal processing device may use a conventional planar mode to generate a prediction block of the upper left sub-block, use a vertical plane mode to generate a prediction block of the upper right sub-block, and use a horizontal plane mode to generate a prediction block of the upper-right sub-block. The prediction block of the lower left sub-block can be generated, and the prediction block of the lower right sub-block can be generated using the conventional unfolding mode.
현재 블록에 대해 수직 방향 또는 수평 방향 평면 모드가 적용된 경우에만, 서브 블록 단위의 평면 모드 예측 방법이 적용될 수 있다. 다시 말하면, 현재 블록에 종래의 평면 모드가 적용된 경우, 비디오 신호 처리 장치는 종래의 평면 모드를 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 현재 블록에 수직 방향 또는 수평 방향 평면 모드가 사용된 경우, 비디오 신호 처리 장치는 현재 블록을 서브 블록들로 분할하고, 수직 방향 또는 수평 방향 평면 모드를 사용하여 각 서브 블록의 예측 블록을 생성할 수 있다.Only when a vertical or horizontal plane mode is applied to the current block, the sub-block unit plane mode prediction method can be applied. In other words, when the conventional planar mode is applied to the current block, the video signal processing device can generate a prediction block of the current block using the conventional planar mode. If the vertical or horizontal plane mode is used for the current block, the video signal processing device can divide the current block into subblocks and generate a prediction block for each subblock using the vertical or horizontal plane mode. there is.
현재 블록의 첫번째 수평 라인(도 40(a)에서 1로 표시된 픽셀들)은 현재 블록에 상측으로 인접한 픽셀들 (예를 들어, 도 40의 빗금 친 픽셀들)과 A 픽셀을 사용하여 예측될 수 있다. 마찬가지로 현재 블록의 두번째 수평 라인(도 40(a)에서 2로 표시된 픽셀들)은 현재 블록에 상측으로 인접한 픽셀들 (예를 들어, 도 40의 빗금 친 픽셀들)과 B 픽셀을 사용하여 예측될 수 있다. 또한 라인 단위 평면 모드는 수직 방향 평면 모드, 수평 방향 평면 모드, 수직 및 수평 방향으로의 예측 블록들을 가중치 평균한 예측 모드로 나누어질 수 있다. 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 현재 블록에 인접한 상단 화소(픽셀)의 개수가 많으므로, 비디오 신호 처리 장치는 수직 방향 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 세로의 크기가 가로의 크기보다 크다면, 현재 블록에 좌측으로 인접한 화소(픽셀)의 개수가 많으므로, 비디오 신호 처리 장치는 수평 방향 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 가로 및 세로 크기가 같다면, 비디오 신호 처리 장치는 종래의 평면 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다.The first horizontal line of the current block (pixels marked 1 in Figure 40(a)) can be predicted using the A pixel and pixels adjacent to the upper part of the current block (e.g., the hatched pixels in Figure 40). there is. Likewise, the second horizontal line of the current block (pixels marked 2 in Figure 40(a)) will be predicted using the pixels adjacent to the upper part of the current block (e.g., the hatched pixels in Figure 40) and the B pixel. You can. Additionally, the line-level planar mode can be divided into a vertical planar mode, a horizontal planar mode, and a weighted average prediction mode of prediction blocks in the vertical and horizontal directions. If the horizontal size of the current block is larger than the vertical size, the number of top pixels (pixels) adjacent to the current block is large, so the video signal processing device can generate a prediction block for the current block using the vertical plane mode. You can. If the vertical size of the current block is larger than the horizontal size, the number of pixels (pixels) adjacent to the left of the current block is large, so the video signal processing device generates a prediction block for the current block using the horizontal plane mode. can do. If the horizontal and vertical sizes of the current block are the same, the video signal processing device can generate a prediction block for the current block using a conventional planar mode.
평면 모드를 사용하여 현재 블록의 예측 블록이 생성되는 경우, 비디오 신호 처리 장치는 수직 방향 평면 모드를 사용하여 예측 블록을 생성하고, 수평 방향 평면 모드를 사용하여 예측 블록을 생성하고, 각각의 예측 블록을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때, 가중치는 동일하거나 상이할 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 크거나 같다면, 수직 방향 평면 모드를 사용하여 예측되는 블록의 가중치가 가장 클 수 있다. 수직 방향 평면 모드를 사용하여 예측된 블록의 가중치는 3일 수 있고, 수평 방향 평면 모드를 사용하여 예측된 블록의 가중치는 1일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD의 인트라 예측 방향성 모드가 임의의 값보다 작다면, 수평 방향 평면 모드를 사용하여 예측된 블록의 가중치가 가장 클 수 있다. 수평 방향 평면 모드로 예측된 블록의 가중치는 3일 수 있고, 수직 방향 평면 모드로 예측된 블록의 가중치는 1일 수 있다. 여기서 임의의 값은 정수로, 대각 모드(도 6의 34번 각도 모드)의 인덱스인 34일 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보에는 첫번째 인트라 예측 방향성 모드, 두번째 인트라 예측 방향성 모드, 가중치 예측을 수행할지 여부 정보가 포함될 수 있다. 현재 블록의 주변 픽셀로부터 유도된 DIMD 정보가 가중치 예측이 적용되지 않음을 나타내는 경우, 비디오 신호 처리 장치는 각 예측 블록에 대해 동일한 가중치를 적용할 수 있다. 여기서 수직 방향 평면 모드를 사용하여 생성되는 예측 블록과 수평 방향 평면 모드를 사용하여 생성되는 예측 블록은 서브 블록 기반의 평면 모드 예측 방법이 사용되어 생성될 수 있다.When the prediction block of the current block is generated using the planar mode, the video signal processing device generates the prediction block using the vertical planar mode, and generates the prediction block using the horizontal planar mode, and each prediction block The final prediction block can be generated by weighting the average. At this time, the weights may be the same or different. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is greater than or equal to a random value, the weight of the block predicted using the vertical plane mode may be the largest. The weight of the block predicted using the vertical plane mode may be 3, and the weight of the block predicted using the horizontal plane mode may be 1. If the intra prediction directional mode of the DIMD derived from the surrounding pixels of the current block is smaller than a random value, the weight of the block predicted using the horizontal plane mode may be the largest. The weight of the block predicted in the horizontal plane mode may be 3, and the weight of the block predicted in the vertical plane mode may be 1. Here, the arbitrary value is an integer, which may be 34, which is the index of the diagonal mode (angle mode 34 in FIG. 6). DIMD information derived from neighboring pixels of the current block may include the first intra prediction directionality mode, the second intra prediction directionality mode, and information on whether to perform weight prediction. If DIMD information derived from neighboring pixels of the current block indicates that weight prediction is not applied, the video signal processing device may apply the same weight to each prediction block. Here, the prediction block generated using the vertical plane mode and the prediction block generated using the horizontal plane mode may be generated using a sub-block-based planar mode prediction method.
DC 모드를 사용하는 예측은 저비트율에서 블록 간 경계에서 불연속적인 에지를 발생시키는 문제가 있다. 이러한 문제를 개선하기 위해서, 비디오 신호 처리 장치는 DC 모드를 통해 생성된 현재 블록의 예측 블록에 임의의 오프셋 값을 더하여 예측 블록에 대한 보정을 수행할 수 있다. 이때, 임의의 오프셋 값에 대한 정보는 비트스트림에 포함되어 명시적으로 시그널링되거나 묵시적으로 현재 블록에 인접한 주변 화소 값들로부터 유도될 수 있다. 디코더는 임의의 오프셋 값에 대한 정보를 파싱하여 획득되는 오프셋 값에 기초하여 현재 블록의 예측 블록에 대한 보정을 수행할 수 있다. 또는 디코더는 현재 블록에 인접한 주변 화소 값들로부터 오프셋 값을 유도하여 현재 블록의 예측 블록에 대한 보정을 수행할 수 있다. 또는, 현재 블록의 예측 블록은 평면 모드를 사용하여 예측되는 블록과 DC 모드를 사용하여 예측되는 블록을 가중치 평균하여 생성될 수 있다.Prediction using DC mode has the problem of generating discontinuous edges at boundaries between blocks at low bit rates. To improve this problem, the video signal processing device may perform correction on the prediction block by adding a random offset value to the prediction block of the current block generated through DC mode. At this time, information about the arbitrary offset value may be included in the bitstream and explicitly signaled, or may be implicitly derived from surrounding pixel values adjacent to the current block. The decoder may perform correction on the prediction block of the current block based on the offset value obtained by parsing information about an arbitrary offset value. Alternatively, the decoder may perform correction for the prediction block of the current block by deriving an offset value from neighboring pixel values adjacent to the current block. Alternatively, the prediction block of the current block may be generated by weighting the average of a block predicted using planar mode and a block predicted using DC mode.
3가지 평면 모드 또는 3가지 DC 모드는 템플릿에 기초하여 유도될 수 있다. 먼저, 비디오 신호 처리 장치는 현재 블록에 인접한 복원된 주변 블록을 포함하는 기준 템플릿을 구성할 수 있다(도 23 참조). 그리고 비디오 신호 처리 장치는 기준 템플릿 주변의 참조 픽셀을 사용하여 3가지 평면 모드들에 대한 예측 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 기준 템플릿과 예측 템플릿 간의 코스트를 계산한 후, 최소 코스트를 나타내는 평면 예측 모드를 사용하여 현재 블록의 예측 블록을 생성할 수 있다. Three planar modes or three DC modes can be derived based on the template. First, the video signal processing device may configure a reference template including reconstructed neighboring blocks adjacent to the current block (see FIG. 23). And the video signal processing device can configure prediction templates for the three planar modes using reference pixels around the reference template. The video signal processing device may calculate the cost between the reference template and the prediction template and then generate a prediction block of the current block using a planar prediction mode indicating the minimum cost.
또한, 비디오 신호 처리 장치는 현재 블록에 인접한 복원된 주변 블록을 포함하는 기준 템플릿을 구성할 수 있다(도 23 참조). 그리고 비디오 신호 처리 장치는 기준 템플릿 주변의 참조 픽셀을 사용하여 3가지 평면 모드들에 대한 예측 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 기준 템플릿과 예측 템플릿 간의 코스트를 계산한 후, 코스트를 기반으로 평면 모드에 대한 리스트를 구성할 수 있다. 이때 가장 작은 코스트를 가지는 평면 모드가 리스트의 가장 처음에 위치할 수 있고, 코스트에 따라 오름차순으로 리스트가 구성될 수 있다. 인코더는 리스트 내의 평면 모드들 중 현재 블록의 예측 블록을 생성하기 위한 최적의 평면 모드에 대한 인덱스 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 인덱스 정보를 파싱하여 결정되는 평면 모드를 사용하여 현재 블록의 예측 블록을 생성할 수 있다.Additionally, the video signal processing device may configure a reference template including reconstructed neighboring blocks adjacent to the current block (see FIG. 23). And the video signal processing device can configure prediction templates for the three planar modes using reference pixels around the reference template. The video signal processing device may calculate the cost between the reference template and the prediction template and then configure a list of planar modes based on the cost. At this time, the planar mode with the smallest cost may be located at the beginning of the list, and the list may be organized in ascending order according to cost. The encoder may generate and signal a bitstream including index information about the optimal plane mode for generating the prediction block of the current block among the plane modes in the list. The decoder can generate a prediction block of the current block using a planar mode determined by parsing the index information.
상술한 템플릿 기반 평면 모드 유도 방법은 3가지 DC 모드에도 동일하게 적용될 수 있다.The above-described template-based planar mode derivation method can be equally applied to the three DC modes.
도 43 본 발명의 일 실시예에 따른 양방향 예측 기반의 인트라 예측 방법을 나타낸다.Figure 43 shows an intra prediction method based on bidirectional prediction according to an embodiment of the present invention.
비디오 신호 처리 장치가 현재 블록을 인트라 예측 모드로 부호화하는 경우, 현재 블록의 좌측 또는 상측의 화소들은 복원된 현재 블록의 주변 화소들과 인접해 있으므로, 효과적으로 예측될 수 있다. 그러나, 현재 블록의 우측 또는 하측의 화소들은 주변에 인접한 화소가 아직 복원되지 않았으므로 예측 효율이 낮다. 즉, 현재 블록의 우하단에 위치한 화소일수록 참조 화소(복원된 현재 블록의 주변 화소)와의 거리가 멀어지므로 오차 신호가 많아진다. 이러한 문제를 개선하기 위해서, 도 43과 같이, 비디오 신호 처리 장치는 현재 블록의 우하측에 위치한 하나의 화소만을 미리 복원한 후, 복원된 우하단 화소와 현재 블록에 인접한 주변 화소들을 기반으로 현재 블록의 예측 블록을 생성할 수 있다. 이때, 현재 블록의 우하측에 위치한 화소는 현재 블록에 인접한 화소로부터 예측되어 부호화될 수 있고, 현재 블록의 우하측에 위치한 화소값과 예측값 간의 차이인 차분값에 대한 정보는 비트스트림에 포함되어 시그널링될 수 있다. 디코더는 차분값에 대한 정보를 파싱하여 결정되는 차분값을 사용하여 현재 블록의 우하측에 위치한 화소를 복원할 수 있다. 다음으로, 비디오 신호 처리 장치는 현재 블록에 인접한 화소들과 현재 블록의 우하측에 위치한 하나의 화소를 사용하여 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 화소들과 현재 블록의 우하측에 위치한 하나의 화소를 사용하여 현재 블록의 우측 화소들(도 43의 1로 표시된 화소들)과 하측 화소들 (도 43의 2로 표시된 화소들)을 예측한 후, 현재 블록에 인접한 화소들과 현재 블록 내의 하측 화소들과 우측 화소들을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.When a video signal processing device encodes the current block in intra prediction mode, pixels on the left or upper side of the current block are adjacent to neighboring pixels of the reconstructed current block, so they can be effectively predicted. However, the prediction efficiency of pixels to the right or below the current block is low because adjacent pixels have not yet been restored. In other words, the farther the pixel is located in the lower right corner of the current block, the farther the distance from the reference pixel (pixels around the restored current block) becomes, so the error signal increases. In order to improve this problem, as shown in FIG. 43, the video signal processing device restores only one pixel located on the lower right side of the current block in advance, and then restores the current block based on the restored lower right pixel and surrounding pixels adjacent to the current block. A prediction block can be generated. At this time, the pixel located on the lower right side of the current block can be predicted and encoded from the pixel adjacent to the current block, and information about the difference value, which is the difference between the pixel value located on the lower right side of the current block and the predicted value, is included in the bitstream and signaled. It can be. The decoder can restore the pixel located on the lower right side of the current block using the difference value determined by parsing information about the difference value. Next, the video signal processing device can generate a prediction block of the current block using pixels adjacent to the current block and one pixel located at the lower right of the current block. The video signal processing device uses pixels adjacent to the current block and one pixel located on the lower right side of the current block to display pixels on the right side of the current block (pixels marked 1 in FIG. 43) and pixels on the lower side (pixels marked 1 in FIG. 43). After predicting (pixels indicated by ), a prediction block of the current block can be generated using pixels adjacent to the current block and the lower and right pixels within the current block.
코딩 효율을 높이기 위하여 전술한 잔여 신호를 그대로 코딩하는 것이 아니라, 잔여 신호를 변환하여 획득된 변환 계수 값을 양자화하고, 양자화된 변환 계수를 코딩하는 방법이 사용될 수 있다. 전술한 바와 같이, 변환부는 잔여 신호를 변환하여 변환 계수 값을 획득할 수 있다. 이때, 특정 블록의 잔여 신호는 현재 블록의 전 영역에 분산되어 있을 수 있다. 이에 따라, 잔여 신호에 대한 주파수 영역 변환을 통해 저주파 영역에 에너지를 집중시켜 코딩 효율을 향상시킬 수 있다. In order to increase coding efficiency, instead of coding the above-mentioned residual signal as is, a method of converting the residual signal, quantizing the obtained transform coefficient value, and coding the quantized transform coefficient may be used. As described above, the converter may obtain a transform coefficient value by converting the residual signal. At this time, the residual signal of a specific block may be distributed throughout the entire area of the current block. Accordingly, coding efficiency can be improved by concentrating energy in the low-frequency region through frequency domain conversion of the residual signal.
인코더는 현재 블록에 대한 잔여 신호를 포함하는 적어도 하나의 잔여 블록을 획득할 수 있다. 잔여 블록은 현재 블록 또는 현재 블록으로부터 분할된 블록들 중 어느 하나일 수 있다. 본 명세서에서, 잔여 블록은 현재 블록의 잔여 샘플들을 포함하는 잔여 어레이(array) 또는 잔여 매트릭스(matrix)로 기술될 수 있다. 또한 본 명세서에서 잔여 블록은 변환 유닛 또는 변환 블록의 크기와 동일한 크기의 블록을 나타낼 수 있다.The encoder may obtain at least one residual block containing the residual signal for the current block. The remaining block may be either the current block or blocks divided from the current block. In this specification, a residual block may be described as a residual array or residual matrix containing residual samples of the current block. Additionally, in this specification, the residual block may represent a block with the same size as the size of the transform unit or transform block.
인코더는 변환 커널을 사용하여 잔여 블록을 변환할 수 있다. 잔여 블록에 대한 변환에 사용되는 변환 커널은 수직 변환 및 수평 변환의 분리 가능한 특성을 가지는 변환 커널일 수 있다. 이 경우, 잔여 블록에 대한 변환은 수직 변환 및 수평 변환으로 분리되어 수행될 수 있다. 예를 들어, 인코더는 잔여 블록의 수직 방향으로 변환 커널을 적용하여 수직 변환을 수행할 수 있다. 또한, 인코더는 잔여 블록의 수평 방향으로 변환 커널을 적용하여 수평 변환을 수행할 수 있다. 본 명세서에서, 변환 커널은 변환 매트릭스, 변환 어레이, 변환 함수, 변환과 같이 잔여 신호의 변환에 사용되는 파라미터 세트를 지칭하는 용어로 사용될 수 있다. 일 실시예에 따라, 변환 커널은 복수의 사용 가능한 커널들 중 어느 하나일 수 있다. 또한, 수직 변환 및 수평 변환 각각에 대해 서로 다른 변환 타입에 기반한 변환 커널이 사용될 수도 있다. 즉, 1차 변환을 수행하기 전에, 현재 블록의 인트라 예측 모드, 부호화 모드, 비트스트림으로부터 파싱된 변환 방법, 현재 블록의 크기 정보 중에서 적어도 하나 이상을 사용하여 수직 및 수평 방향에 대한 변환 방법이 유도될 수 있다. 또한, 크기가 큰 블록에 대하여 변환 과정에서의 계산 복잡도를 감소시키기 위하여 저주파 영역만을 남기고 고주파 영역은 '0'로 처리하는 과정이 수행될 수 있다. 이러한 과정을 고주파 제로화(zeroing)라고 하며, 이러한 제로화를 위해서 실제 1차 변환 시의 변환 크기가 설정될 수 있다. 고주파 제로화 과정에서 저주파 영역은 임의의 정해진 크기로 설정될 수 있으며, 예를 들어, 가로 또는 세로의 크기는 4, 8, 16, 32 등의 조합이 될 수 있다. The encoder can transform the remaining blocks using a transform kernel. The transformation kernel used for transformation of the remaining block may be a transformation kernel with separable characteristics of vertical transformation and horizontal transformation. In this case, transformation for the remaining block can be performed separately into vertical transformation and horizontal transformation. For example, the encoder can perform vertical transformation by applying a transformation kernel in the vertical direction of the residual block. Additionally, the encoder can perform horizontal transformation by applying a transformation kernel in the horizontal direction of the remaining block. In this specification, 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. According to one embodiment, 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. That is, before performing the first transformation, a transformation method for the vertical and horizontal directions is derived using at least one of the intra prediction mode of the current block, the encoding mode, the transformation method parsed from the bitstream, and the size information of the current block. It can be. Additionally, in order to reduce computational complexity in the conversion process for blocks of large size, a process may be performed in which only the low-frequency region is left and the high-frequency region is treated as '0'. This process is called high-frequency zeroing, and for this zeroing, the conversion size during the actual primary conversion can be set. In the high-frequency zeroing process, the low-frequency area can be set to an arbitrarily determined size. For example, the horizontal or vertical size can be a combination of 4, 8, 16, 32, etc.
인코더는 잔여 블록으로부터 변환된 변환 블록을 양자화부로 전달하여 양자화할 수 있다. 이때, 변환 블록은 복수의 변환 계수들을 포함할 수 있다. 구체적으로, 변환 블록은 2차원 배열된 복수의 변환 계수들로 구성될 수 있다. 변환 블록의 크기는 잔여 블록과 마찬가지로 현재 블록 또는 현재 블록으로부터 분할된 블록 중 어느 하나와 동일할 수 있다. 양자화부로 전달된 변환 계수들은 양자화된 값으로 표현될 수 있다.The encoder can quantize the transform block converted from the residual block by transmitting it to the quantization unit. At this time, the transform block may include a plurality of transform coefficients. Specifically, a transform block may be composed of a plurality of transform coefficients arranged two-dimensionally. The size of the transform block, like the remaining block, may be the same as either the current block or a block divided from the current block. Transform coefficients transmitted to the quantization unit can be expressed as quantized values.
또한, 인코더는 변환 계수가 양자화되기 전에 추가적인 변환을 수행할 수 있다. 전술한 변환 방법은 1차 변환(primary transform)으로 지칭되고, 추가적인 변환은 2차 변환(secondary transform)으로 지칭될 수 있다. 2차 변환은 잔여 블록 별로 선택적일 수 있다. 일 실시예에 따라, 인코더는 1차 변환만으로 저주파 영역에 에너지를 집중시키기 어려운 영역에 대해 2차 변환을 수행하여 코딩 효율을 향상시킬 수 있다. 예를 들어, 잔여 값들이 잔여 블록의 수평 또는 수직 방향 이외의 방향에서 크게 나타나는 블록에 대해 2차 변환이 추가될 수 있다. 인트라 예측된 블록의 잔여 값들은 인터 예측된 블록의 잔여 값들에 비해 수평 또는 수직 방향 이외의 방향으로 변화할 확률이 높을 수 있다. 이에 따라, 인코더는 인트라 예측된 블록의 잔여 신호에 대해 2차 변환을 추가적으로 수행할 수 있다. 또한, 인코더는 인터 예측된 블록의 잔여 신호에 대해 2차 변환을 생략할 수 있다. 2차 변환 과정에서도 1차 변환에서의 고주파 제로화가 수행될 수 있다.Additionally, the encoder may perform additional transformation 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 remaining block. According to one embodiment, 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. For example, a secondary transformation may be added to a block whose residual values appear large in directions other than the horizontal or vertical direction of the residual block. The residual values of an intra-predicted block may have a higher probability of changing in directions other than the horizontal or vertical direction compared to the residual values of an inter-predicted block. Accordingly, the encoder can additionally perform secondary transformation on the residual signal of the intra-predicted block. Additionally, the encoder may omit secondary transformation for the residual signal of the inter-predicted block. Even in the secondary conversion process, high-frequency zeroing in the primary conversion can be performed.
다른 예로, 현재 블록 또는 잔여 블록의 크기에 따라, 2차 변환 수행 여부가 결정될 수 있다. 또한, 현재 블록 또는 잔여 블록의 크기에 따라 크기가 서로 다른 변환 커널이 사용될 수 있다. 예를 들어, 너비 또는 높이 중 짧은 변의 길이가 제1 기 설정된 길이 보다 크거나 같은 블록에 대해서는 8X8 2차 변환이 적용될 수 있다. 또한, 너비 또는 높이 중 짧은 변의 길이가 제2 기 설정된 길이 보다 크거나 같고, 제1 기 설정된 길이 보다 작은 블록에 대해서는 4X4 2차 변환이 적용될 수 있다. 이때, 제1 기 설정된 길이는 제2 기 설정된 길이 보다 큰 값일 수 있으나, 본 개시가 이에 제한되는 것은 아니다. 또한, 2차 변환은 1차 변환과 달리 수직 변환 및 수평 변환으로 분리되어 수행되지 않을 수 있다. 이러한 2차 변환은 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)으로 지칭될 수 있다.As another example, whether to perform secondary transformation may be determined depending on the size of the current block or remaining block. Additionally, transformation kernels of different sizes may be used depending on the size of the current block or remaining block. For example, 8X8 secondary transformation may be applied to a block where the length of the shorter side of width or height is greater than or equal to the first preset length. In addition, 4 At this time, the first preset length may be larger than the second preset length, but the present disclosure is not limited thereto. Additionally, unlike the primary transformation, the 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).
또한, 특정 영역의 비디오 신호의 경우, 급격한 밝기 변화로 인해 주파수 변환을 수행하여도 고주파 대역 에너지가 줄어들지 않을 수 있다. 이에 따라, 양자화에 의한 압축 성능이 저하될 수 있다. 또한, 잔여 값이 드물게 존재하는 영역에 대해 변환을 수행하는 경우, 인코딩 시간 및 디코딩 시간이 불필요하게 증가할 수 있다. 이에 따라, 특정 영역의 잔여 신호에 대한 변환은 생략될 수 있다. 특정 영역의 잔여 신호에 대한 변환 수행 여부는 특정 영역의 변환과 관련된 신택스 요소에 의해 결정될 수 있다. 예를 들어, 상기 신택스 요소는 변환 스킵 정보(transform skip information)를 포함할 수 있다. 변환 스킵 정보는 변환 스킵 플래그(transform skip flag)일 수 있다. 잔여 블록에 대한 변환 스킵 정보가 변환 스킵을 나타내는 경우, 해당 잔여 블록에 대한 변환이 수행되지 않는다. 이 경우, 인코더는 해당 영역의 변환이 수행되지 않은 잔여 신호를 곧바로 양자화할 수 있다.Additionally, in the case of video signals in a specific area, high-frequency band energy may not be reduced even if frequency conversion is performed due to rapid changes in brightness. Accordingly, compression performance by quantization may deteriorate. Additionally, when conversion is performed on an area where residual values rarely exist, encoding time and decoding time may unnecessarily increase. Accordingly, conversion of the residual signal in a specific area may be omitted. Whether or not to perform conversion on the residual signal of a specific area may be determined by syntax elements related to conversion of the specific area. For example, the syntax element may include transform skip information. Transformation skip information may be a transform skip flag. If the transformation skip information for the remaining block indicates transformation skipping, transformation is not performed on the corresponding remaining block. In this case, the encoder can directly quantize the residual signal for which conversion of the corresponding region has not been performed.
전술한 변환 관련 신택스 요소들은 비디오 신호 비트스트림으로부터 파싱된 정보일 수 있다. 디코더는 비디오 신호 비트스트림을 엔트로피 디코딩하여 변환 관련 신택스 요소들을 획득할 수 있다. 또한, 인코더는 변환 관련 신택스 요소들을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성할 수 있다.The above-described conversion-related syntax elements may be information parsed from a video signal bitstream. The decoder may obtain conversion-related syntax elements by entropy decoding the video signal bitstream. Additionally, the encoder may generate a video signal bitstream by entropy coding transformation-related syntax elements.
디코더에서는 전송된 비트스트림을 파싱하여 디코딩하는데 필요한 부호화 정보들을 획득할 수 있다. 이 때 변환 과정과 관련된 정보에는 1차 및 2차 변환 타입에 대한 인덱스 정보 및 양자화된 변환 계수 등이 있다. 역변환부는 역양자화된 변환 계수를 역변환하여 잔여 신호를 획득할 수 있다. 먼저, 역변환부는 특정 영역의 변환 관련 신택스 요소로부터 해당 영역에 대한 역변환이 수행되는지 검출할 수 있다. 일 실시예에 따라, 특정 변환 블록에 대한 변환 관련 신택스 요소가 변환 스킵을 나타내는 경우, 해당 변환 블록에 대한 변환이 생략될 수 있다. 이 경우, 변환 블록에 대해 1차 역변환 및 2차 역변환이 모두 생략될 수 있다. 또한, 역양자화된 변환 계수는 잔여 신호로 사용될 수 있다. 예를 들어, 디코더는 역양자화된 변환 계수를 잔여 신호로 사용하여 현재 블록을 복원할 수 있다. 혹은 2차 역변환은 수행되고 1차 역변환은 생략될 수 있으며, 2차 역변환된 값이 잔여 신호로 사용될 수 있다. 전술한 1차 역변환은 1차 변환에 대한 역변환을 나타내며, 역 1차 변환(inverse primary transform)으로 지칭될 수 있다. 2차 역변환은 2차 변환에 대한 역변환을 나타내며, 역 2차 변환(inverse secondary transform) 또는 inverse LFNST로 지칭될 수 있다. 본 발명에서 1차 (역)변환은 제1 (역)변환으로 지칭될 수 있으며, 2차 (역)변환은 제2 (역)변환으로 지칭될 수 있다.The decoder can obtain the encoding information necessary for decoding by parsing the transmitted bitstream. At this time, information related to the transformation process includes index information for the primary and secondary transformation types and quantized transformation coefficients. The inverse transform unit may obtain a residual signal by inversely transforming the inverse quantized transform coefficient. First, the inverse transformation unit can detect whether inverse transformation is performed for a specific region from the transformation-related syntax elements of the region. According to one embodiment, when a transform-related syntax element for a specific transform block indicates transform skipping, transform for the corresponding transform block may be omitted. In this case, both the first inverse transform and the second inverse transform can be omitted for the transform block. Additionally, the dequantized transform coefficient can be used as a residual signal. For example, the decoder can restore the current block using the dequantized transform coefficient as a residual signal. Alternatively, the secondary inverse transformation may be performed and the first inverse transformation may be omitted, and the secondary inverse transformation may be used as the residual signal. The above-described first-order inverse transform represents the inverse transformation of the first-order transform, and may be referred to as an inverse primary transform. The secondary inverse transform refers to the inverse transformation of the secondary transform, and may be referred to as an inverse secondary transform or inverse LFNST. In the present invention, the first (inverse) transformation may be referred to as the first (inverse) transformation, and the secondary (inverse) transformation may be referred to as the second (inverse) transformation.
도 44는 본 발명의 일 실시예에 따른 비디오 코딩에 사용될 수 있는 변환 커널 종류를 나타낸다.Figure 44 shows the types of transform kernels that can be used in video coding according to an embodiment of the present invention.
도 44는 MTS에 적용되는 DCT-II, DCT-V (discrete cosine transform type-V), DCT-VIII (discrete cosine transform type-VIII), DST-I (discrete sine transform type-I), DST-VII 커널의 수식을 나타낸 것이다. DCT와 DST는 각각 cosine, sine의 함수로 표현이 가능하며, 샘플 수 N에 대한 변환 커널의 기저 함수를 Ti(j)로 표현할 경우, 인덱스 i는 주파수 도메인에서의 인덱스를 나타내며, 인덱스 j는 기저 함수 내의 인덱스를 나타낸다. 즉, i가 작아질수록 저주파 기저 함수를 나타내며, i가 커질수록 고주파 기저 함수를 나타낸다. 기저 함수 Ti(j)는 2차원 행렬로 표현했을 때, i 번째 행의 j 번째 요소를 나타낼 수 있으며, 도 30에 도시한 변환 커널은 모두 분리 가능한 특성을 가지고 있으므로, 잔차 신호 X에 대하여 가로 방향과 세로 방향에 각각 변환을 수행할 수 있다. 즉, 잔차 신호 블록을 X라 하고, 변환 커널 행렬을 T라 했을 때, 잔차 신호 X에 대한 변환은 TXT'으로 나타낼 수 있다. 이때, T'는 변환 커널 행렬 T의 전치행렬 (transpose)를 의미한다. DCT와 DST는 정수가 아닌 소수 형태이므로, 이를 그대로 하드웨어 부호화기, 복호화기에 구현하기에는 부담이 따른다. 따라서 소수 형태의 변환 커널에 scaling과 rounding을 통해 정수 형태의 변환 커널로 근사화시켜야 한다. 변환 커널의 정수 정밀도는 8-bit 또는 10-bit로 결정될 수 있으나, 정밀도가 떨어질 경우, 부호화 효율이 감소할 수 있다. 근사화에 따라 DCT와 DST의 정규 직교 (orthonormal) 성질은 유지되지 않을 수 있으나, 이에 따른 부호화 효율 손실이 크지 않으므로, 변환 커널을 정수 형태로 근사화 시키는 것이 하드웨어 부호화기, 복호화기 구현 측면에서 유리하다. IDTR(Identity Transform)은 변환의 결과가 변환 전의 자기 자신이 나오는 변환으로, 항등변환이라고 한다. 일반적으로 항등변환은 행과 열이 동일한 값을 가지는 위치에 '1'을 설정하여 변환 매트릭스를 구성한다. 하지만, 여기서 항등변환은 '1'값이 아닌 임의의 고정된 값을 사용하여, 입력된 잔차 신호의 값을 동일하게 높이거나 줄이는데 사용한다.Figure 44 shows DCT-II, DCT-V (discrete cosine transform type-V), DCT-VIII (discrete cosine transform type-VIII), DST-I (discrete sine transform type-I), and DST-VII applied to MTS. This shows the kernel formula. DCT and DST can be expressed as functions of cosine and sine, respectively. When the basis function of the transformation kernel for the number of samples N is expressed as Ti(j), index i represents the index in the frequency domain, and index j is the basis. Indicates the index within the 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. When expressed as a two-dimensional matrix, the basis function Ti(j) can represent the j-th element of the i-th row, and since the transformation kernels shown in Figure 30 all have separable characteristics, the horizontal direction with respect to the residual signal Conversion can be performed in the and vertical directions, respectively. 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. Since DCT and DST are in decimal form rather than integer, it is burdensome to implement them as is in a hardware encoder and decoder. Therefore, the decimal type conversion kernel must be approximated to an integer type conversion kernel through scaling and rounding. The integer precision of the conversion kernel can be determined as 8-bit or 10-bit, but if the precision is low, coding efficiency may decrease. Depending on the approximation, the orthonormal properties of DCT and DST may not be maintained, but the resulting loss of coding efficiency is not significant, so approximating the conversion kernel to an integer form is advantageous in terms of implementing a hardware encoder and decoder. IDTR (Identity Transform) is a transformation in which the result of transformation is the self before transformation, and is called an identity transformation. In general, identity transformation constructs a transformation matrix by setting '1' at the position where the row and column have the same value. However, here, the identity transformation is used to equally increase or decrease the value of the input residual signal using an arbitrary fixed value other than the '1' value.
비트스트림은 하나 혹은 그 이상의 CVS(coded video sequences)로 구성되어 있으며, 하나의 CVS는 다른 CVS들과는 독립적으로 부호화된다. 각 CVS는 하나 혹은 그 이상의 layer로 구성되어 있으며, 각 layer는 특정 화질, 특정 해상도를 나타낼 수 있으며, 또는 일반 영상, 깊이정보맵, transparency 맵을 나타낼 수 있다. 또한, CLVS(coded layer video sequence)는 동일 layer 내의 연속된(디코딩 순서상) PU들로 구성된 layer-wise CVS를 의미한다. 예를 들어, 특정 화질 layer에 대한 CLVS가 존재하며, 깊이정보맵에 대한 CLVS가 존재할 수 있다.A bitstream consists of one or more coded video sequences (CVS), and one CVS is encoded independently from other CVSs. Each CVS consists of one or more layers, and each layer can represent a specific image quality, a specific resolution, or a general image, depth information map, or transparency map. Additionally, CLVS (coded layer video sequence) refers to a layer-wise CVS composed of consecutive PUs (in decoding order) within the same layer. For example, a CLVS may exist for a specific image quality layer, and a CLVS may exist for a depth information map.
도 45, 도 46은 본 발명의 일 실시예에 따른 시퀀스 파라미터 세트의 일부를 나타낸다.Figures 45 and 46 show part of a sequence parameter set according to an embodiment of the present invention.
도 45는 수직 방향 평면 모드 및 수평 방향 평면 모드의 활성화 여부를 나타내는 신택스 요소를 SPS에서 시그널링하는 방법을 나타낸다.Figure 45 shows a method of signaling in SPS a syntax element indicating whether the vertical plane mode and the horizontal plane mode are activated.
도 45의 sps_directional_planar_enabled_flag가 '1'(참)인 경우, 수직 방향 평면 모드 및 수평 방향 평면 모드가 활성화됨을 나타낼 수 있다. sps_directional_planar_enabled_flag가 '0'(거짓)인 경우, 수직 방향 평면 모드 및 수평 방향 평면 모드는 비활성화됨을 나타낼 수 있다. 즉, 모든 블록에 수직 방향 평면 모드 및 수평 방향 평면 모드가 사용되지는 않는다. sps_directional_planar_enabled_flag가 파싱되지 않는 경우(비트스트림에 포함되지 않는 경우), sps_directional_planar_enabled_flag의 값은 0으로 추론될 수 있다.When sps_directional_planar_enabled_flag in FIG. 45 is '1' (true), it may indicate that the vertical plane mode and the horizontal plane mode are activated. If sps_directional_planar_enabled_flag is '0' (false), it may indicate that the vertical plane mode and the horizontal plane mode are disabled. That is, the vertical plane mode and horizontal plane mode are not used in all blocks. If sps_directional_planar_enabled_flag is not parsed (not included in the bitstream), the value of sps_directional_planar_enabled_flag can be inferred to be 0.
sps_directional_planar_enabled_flag equal to 1 specifies that the vertical planar and the horizontal planar mode is enabled for the CLVS. sps_directional_planar_enabled_flag equal to 0 specifies that the vertical planar and the horizontal planar mode is disabled for the CLVS. When sps_directional_planar_enabled_flag is not present, it is inferred to be equal to 0.sps_directional_planar_enabled_flag equal to 1 specifies that the vertical planar and the horizontal planar mode is enabled for the CLVS. sps_directional_planar_enabled_flag equal to 0 specifies that the vertical planar and the horizontal planar mode is disabled for the CLVS. When sps_directional_planar_enabled_flag is not present, it is inferred to be equal to 0.
상술한 SPS에서 시그널링하는 방법과 동일하게, 수직 방향 평면 모드 및 수평 방향 평면 모드의 활성화 여부를 나타내는 신택스 요소를 PPS에서도 시그널링할 수 있다. 즉, PPS에 시그널링되는 신택스 요소(예를 들어, pps_directional_planar_enabled_flag)에 따라 픽쳐 및/또는 프레임마다 수직 방향 평면 모드 및 수평 방향 평면 모드의 활성화 여부가 달라질 수 있다.In the same manner as the signaling method in the SPS described above, a syntax element indicating whether the vertical plane mode and the horizontal plane mode are activated can also be signaled in the PPS. That is, whether the vertical plane mode and the horizontal plane mode are activated may vary for each picture and/or frame depending on the syntax element signaled in the PPS (eg, pps_directional_planar_enabled_flag).
도 46은 도 25 내지 도 29를 통해 설명한 복수의 참조 픽셀 라인을 사용하여 예측 블록을 생성하는 방법의 활성화 여부를 나타내는 신택스 요소를 SPS에서 시그널링하는 방법을 나타낸다. 복수의 참조 픽셀 라인을 사용하여 예측 블록을 생성하는 방법은 인트라 퓨젼(intra fusion)이라 기술될 수 있다.Figure 46 shows a method of signaling in the SPS a syntax element indicating whether to activate the method of generating a prediction block using a plurality of reference pixel lines described with reference to Figures 25 to 29. A method of generating a prediction block using a plurality of reference pixel lines may be described as intra fusion.
도 46의 sps_intra_fusion_enabled_flag가 '1'(참)인 경우, 인트라 퓨젼이 활성화됨을 나타낼 수 있다. sps_intra_fusion_enabled_flag가 '0'(거짓)인 경우, 인트라 퓨젼이 비활성화됨을 나타낸다. 즉, 모든 블록에 인트라 퓨젼이 수행되지 않는다. sps_intra_fusion_enabled_flag가 파싱되지 않는 경우(비트스트림에 포함되지 않는 경우), sps_intra_fusion_enabled_flag 의 값은 0으로 추론될 수 있다.If sps_intra_fusion_enabled_flag in FIG. 46 is '1' (true), it may indicate that intra fusion is activated. If sps_intra_fusion_enabled_flag is '0' (false), it indicates that intra fusion is disabled. That is, intra fusion is not performed on all blocks. If sps_intra_fusion_enabled_flag is not parsed (not included in the bitstream), the value of sps_intra_fusion_enabled_flag can be inferred to be 0.
sps_intra_fusion_enabled_flag equal to 1 specifies that the intra fusion method is enabled for the CLVS. sps_intra_fusion_enabled_flag equal to 0 specifies that intra fusion method is disabled for the CLVS. When sps_intra_fusion_enabled_flag is not present, it is inferred to be equal to 0.sps_intra_fusion_enabled_flag equal to 1 specifies that the intra fusion method is enabled for the CLVS. sps_intra_fusion_enabled_flag equal to 0 specifies that intra fusion method is disabled for the CLVS. When sps_intra_fusion_enabled_flag is not present, it is inferred to be equal to 0.
상술한 SPS에서 시그널링하는 방법과 동일하게, 인트라 퓨젼의 활성화 여부를 나타내는 신택스 요소를 PPS에서도 시그널링할 수 있다. 즉, PPS에 시그널링되는 신택스 요소(예를 들어, pps_intra_fusion_enabled_flag)에 따라 픽쳐 및/또는 프레임마다 인트라 퓨젼의 활성화 여부가 달라질 수 있다.In the same manner as the signaling method in the SPS described above, a syntax element indicating whether intra fusion is activated can also be signaled in the PPS. That is, whether intra fusion is activated may vary for each picture and/or frame depending on the syntax element signaled in the PPS (eg, pps_intra_fusion_enabled_flag).
도 47은 본 발명의 일 실시예에 따른 general_constraint_info() 신택스 구조의 일부를 나타낸다.Figure 47 shows part of the general_constraint_info() syntax structure according to an embodiment of the present invention.
도 47은 수직 방향 평면 모드 및 수평 방향 평면 모드와 인트라 퓨젼과 관련된 제약 플래그를 나타낸다. 도 47의 general_constraint_info() 신택스는 profile_tier_level() 신택스에서 호출될 수 있다. profile_tier_level() 신택스는 시퀀스 파라미터 세트 RBSP 신택스, 비디오 파라미터 세트 RBSP 신택스, Decoding capability information RBSP 신택스에서 호출될 수 있다. general_constraint_info() 신택스의 개별 신택스 요소들은 시퀀스 파라미터 세트 RBSP내에 대응되는 신택스 요소들이 있을 수 있으며, 해당 플래그의 정의에 의해 대응되는 시퀀스 파라미터 세트 RBSP 신택스 요소의 활성화/비활성화 여부가 제약 받을 수 있다.Figure 47 shows constraint flags related to vertical plane mode and horizontal plane mode and intra fusion. The general_constraint_info() syntax of Figure 47 can be called in the profile_tier_level() syntax. profile_tier_level() syntax can be called in sequence parameter set RBSP syntax, video parameter set RBSP syntax, and Decoding capability information RBSP syntax. Individual syntax elements of the general_constraint_info() syntax may have corresponding syntax elements in the sequence parameter set RBSP, and activation/deactivation of the corresponding sequence parameter set RBSP syntax element may be restricted by the definition of the corresponding flag.
수직 방향 평면 모드 및 수평 방향 평면 모드와 관련된 제약 플래그는 gci_no_directional_planar_constraint_flag 일 수 있다. The constraint flag related to the vertical plane mode and the horizontal plane mode may be gci_no_directional_planar_constraint_flag.
gci_no_directional_planar_constraint_flag의 값이 1과 같으면 OlsScope내에 존재하는 모든 픽쳐들에 대해 sps_directional_planar_enabled_flag의 값은 0으로 제약된다. 즉 수직 방향 평면 모드 및 수평 방향 평면 모드의 비활성화는 제약(강제)될 수 있다. gci_no_directional_planar_constraint_flag의 값이 0과 같으면 sps_directional_planar_enabled_flag의 값은 제약되지 않는다.If the value of gci_no_directional_planar_constraint_flag is equal to 1, the value of sps_directional_planar_enabled_flag for all pictures existing in OlsScope is constrained to 0. That is, deactivation of the vertical plane mode and the horizontal plane mode may be restricted (forced). If the value of gci_no_directional_planar_constraint_flag is equal to 0, the value of sps_directional_planar_enabled_flag is not restricted.
gci_no_directional_planar_constraint_flag equal to 1 specifies that sps_directional_planar_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_directional_planar_constraint_flag equal to 0 does not impose such a constraint.gci_no_directional_planar_constraint_flag equal to 1 specifies that sps_directional_planar_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_directional_planar_constraint_flag equal to 0 does not impose such a constraint.
인트라 퓨젼과 관련된 제약 플래그는 gci_no_intra_fusion_constraint_flag 일 수 있다. The constraint flag related to intra fusion may be gci_no_intra_fusion_constraint_flag.
gci_no_intra_fusion_constraint_flag의 값이 1과 같으면 OlsScope내에 존재하는 모든 픽쳐들에 대해 sps_intra_fusion_enabled_flag 값은 0으로 제약된다. 즉 인트라 퓨젼의 비활성화는 제약(강제)될 수 있다. gci_no_intra_fusion_constraint_flag의 값이 0과 같으면 sps_intra_fusion_enabled_flag의 값은 0으로 제약되지 않는다.If the value of gci_no_intra_fusion_constraint_flag is equal to 1, the value of sps_intra_fusion_enabled_flag for all pictures existing in OlsScope is constrained to 0. In other words, deactivation of intra fusion can be restricted (forced). If the value of gci_no_intra_fusion_constraint_flag is equal to 0, the value of sps_intra_fusion_enabled_flag is not constrained to 0.
gci_no_intra_fusion_constraint_flag equal to 1 specifies that sps_intra_fusion_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_intra_fusion_constraint_flag equal to 0 does not impose such a constraint.gci_no_intra_fusion_constraint_flag equal to 1 specifies that sps_intra_fusion_enabled_flag for all pictures in OlsInScope shall be equal to 0. gci_no_intra_fusion_constraint_flag equal to 0 does not impose such a constraint.
비디오 신호 처리 장치는 현재 블록에 대한 예측 블록을 생성할 때, 2개 이상의 인트라 예측 블록을 가중치 평균하는 다중 예측 모드를 사용할 수 있다. DIMD 혹은 TIMD 모드가 사용되는 경우, 2개 인트라 예측 방향성 모드는 주변 블록 또는 MPM 리스트로부터 암묵적으로 결정될 수 있다. DIMD 혹은 TIMD 모드가 아닌 블록에서 2개 인트라 예측 방향성 모드는 비트스트림으로부터 시그널링될 수 있으나 이는 비트량이 증가되어 압축 효율이 낮아질 수 있다.When generating a prediction block for a current block, a video signal processing device may use a multi-prediction mode that performs a weighted average of two or more intra prediction blocks. When DIMD or TIMD mode is used, the two intra prediction directionality modes can be implicitly determined from the surrounding block or MPM list. In blocks other than DIMD or TIMD mode, two intra prediction directional modes can be signaled from the bitstream, but this may increase the bit amount and reduce compression efficiency.
이러한 비트량 증가를 완화시키기 위해서, 비디오 신호 처리 장치가 MPM 리스트를 구성할 때, 리스트의 각 항목에 포함될 인트라 예측 방향성 모드는 1개가 아닌 2개 이상으로 설정될 수 있다.To alleviate this increase in bit quantity, when the video signal processing device configures the MPM list, the intra prediction directionality mode to be included in each item of the list may be set to two or more instead of one.
도 48은 본 발명의 일 실시예에 따른 다중 예측 모드를 사용하여 MPM 리스트를 구성하는 방법을 나타낸다. Figure 48 shows a method of constructing an MPM list using multiple prediction modes according to an embodiment of the present invention.
도 48(a)에서 A, B, C, … , F, G는 임의의 인트라 예측 방향성 모드, MIP, Intra TMP, IBC, DIMD, TIMD 중에 하나를 나타낼 수 있으며, "N/A"은 사용되지 않는다는 것으로 MPM 리스트의 4번째와 5번째는 다중 예측 모드가 아닌 하나의 인트라 예측 방향성 모드로만 구성될 수 있다. 도 48(b)와 같이, MPM 리스트에 먼저 단일 예측 모드가 추가된 후, 다음으로 다중 예측 모드가 추가될 수 있으며, "N/A"은 사용되지 않는다는 것으로 MPM 리스트의 1번째와 2번째는 다중 예측 모드가 아닌 하나의 인트라 예측 방향성 모드로만 구성될 수 있다.In Figure 48(a), A, B, C,... , F, G can represent any of the intra prediction directional modes, MIP, Intra TMP, IBC, DIMD, and TIMD, and "N/A" means not used, so the 4th and 5th in the MPM list are multi-prediction. It may consist of only one intra prediction directional mode rather than a single mode. As shown in Figure 48(b), a single prediction mode can be added to the MPM list first, and then multiple prediction modes can be added, and "N/A" means not used, so the 1st and 2nd in the MPM list are It may consist of only one intra prediction directional mode, not multiple prediction modes.
인코더는 하나의 인트라 예측 방향성 모드로만 구성된 MPM 리스트(단일 예측 기반 MPM 리스트)를 사용할지 다중 예측 기반 MPM 리스트를 사용할지 여부에 대한 정보를 블록 단위로 적응적으로 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 하나의 인트라 예측 방향성 모드로만 구성된 MPM 리스트(단일 예측 기반 MPM 리스트)를 사용할지 다중 예측 기반 MPM 리스트를 사용할지 여부에 대한 정보를 파싱하여 현재 블록에 대한 예측 블록을 생성하기 위해 사용되는 MPM 리스트를 결정할 수 있다.The encoder can signal information about whether to use an MPM list consisting of only one intra-prediction directional mode (single prediction-based MPM list) or a multi-prediction-based MPM list by adaptively including it in the bitstream on a block-by-block basis. . The decoder parses information about whether to use an MPM list consisting of only one intra-prediction directional mode (single prediction-based MPM list) or a multi-prediction-based MPM list, and determines which MPM is used to generate a prediction block for the current block. You can decide on a list.
비디오 신호 처리 장치는 현재 블록의 가로 혹은 세로 크기, 현재 블록의 가로 및 세로 크기의 비율, 현재 블록이 휘도 블록인지 혹은 색차 블록인지 여부, 양자화 파라미터 정보, 현재 블록의 주변 블록들의 인트라 예측 방향성 모드 정보, 현재 블록의 부호화 모드 정보 중에서 적어도 하나를 사용하여 다중 예측 기반 MPM 리스트의 사용 여부를 결정할 수 있다.The video signal processing device includes the horizontal or vertical size of the current block, the ratio of the horizontal and vertical sizes of the current block, whether the current block is a luminance block or a chrominance block, quantization parameter information, and intra prediction directional mode information of neighboring blocks of the current block. , At least one of the encoding mode information of the current block can be used to determine whether to use the multi-prediction based MPM list.
다중 예측 기반 MPM 리스트를 어떻게 구성하는지에 따라 부호화 효율이 달라질 수 있으며, 다음과 같이 다양한 방안이 적용될 수 있다.Coding efficiency may vary depending on how the multi-prediction-based MPM list is constructed, and various methods can be applied as follows.
비디오 신호 처리 장치는 단일 예측 기반 MPM 리스트를 먼저 구성한 후, 단일 예측 기반 MPM 리스트를 이용하여 다중 예측 기반 MPM 리스트를 구성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 단일 예측 기반 MPM 리스트 내의 각 인트라 예측 방향성 모드들의 조합으로 다중 예측 기반 MPM 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 단일 예측 기반 MPM 리스트를 TIMD 방법에서 사용하는 템플릿 코스트 기반 재정렬 방법을 사용하여 단일 예측 기반 MPM 리스트를 재정렬할 수 있다. 비디오 신호 처리 장치는 재정렬된 단일 예측 기반 MPM 리스트의 첫 번째 인트라 예측 방향성 모드와 첫 번째가 아닌 인트라 예측 방향성 모드들과의 조합만을 사용하여 다중 예측 기반 MPM 리스트를 구성할 수 있다.The video signal processing device may first construct a single prediction-based MPM list and then construct a multi-prediction-based MPM list using the single prediction-based MPM list. For example, a video signal processing device can configure a multi-prediction-based MPM list by combining each intra-prediction directional mode in a single prediction-based MPM list. At this time, the video signal processing device may rearrange the single prediction-based MPM list using the template cost-based reordering method used in the TIMD method. The video signal processing device may construct a multi-prediction-based MPM list using only a combination of the first intra-prediction directional mode and non-first intra-prediction directional modes of the reordered single prediction-based MPM list.
비디오 신호 처리 장치는 DIMD로부터 유도된 인트라 예측 방향성 모드들과 단일 예측 기반 MPM 리스트들과의 조합을 사용하여 다중 예측 기반 MPM 리스트를 구성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 DIMD로부터 유도된 첫번째 인트라 예측 방향성 모드와 단일 예측 기반 MPM 리스트 내에서 첫번째 인트라 예측 방향성 모드를 조합하여 다중 예측 기반 MPM 리스트의 첫번째에 추가할 수 있다. 그리고 비디오 신호 처리 장치는 DIMD로부터 유도된 두번째 인트라 예측 방향성 모드와 단일 예측 기반 MPM 리스트 내에서 첫번째 인트라 예측 방향성 모드를 조합하여 다중 예측 기반 MPM 리스트의 두번째에 추가할 수 있다. 그리고 비디오 신호 처리 장치는 DIMD로부터 유도된 첫번째 인트라 예측 방향성 모드와 단일 예측 기반 MPM 리스트 내에서 두번째 인트라 예측 방향성 모드를 조합하여 다중 예측 기반 MPM 리스트의 세번째에 추가할 수 있다. 이러한 방법으로 비디오 신호 처리 장치는 모든 가능한 조합을 사용하여 다중 예측 기반 MPM 리스트를 구성할 수 있다.A video signal processing device can construct a multi-prediction-based MPM list using a combination of intra-prediction directional modes derived from DIMD and single-prediction-based MPM lists. For example, the video signal processing device may combine the first intra prediction directionality mode derived from DIMD and the first intra prediction directionality mode in the single prediction-based MPM list and add it to the first of the multi-prediction-based MPM list. Additionally, the video signal processing device may combine the second intra prediction directionality mode derived from DIMD and the first intra prediction directionality mode in the single prediction-based MPM list and add it to the second of the multi-prediction-based MPM list. Additionally, the video signal processing device may combine the first intra prediction directionality mode derived from DIMD and the second intra prediction directionality mode in the single prediction-based MPM list and add it to the third of the multi-prediction-based MPM list. In this way, the video signal processing device can construct a multi-prediction based MPM list using all possible combinations.
비디오 신호 처리 장치는 미리 정의된 여러 개의 다중 예측 모드를 사용하여 다중 예측 기반 MPM 리스트를 구성할 수 있다. 여기서 미리 정의된 여러 개의 다중 예측 모드는 (18, 0), (50, 0), (34, 0), (2, 0), (66, 0), (18, 1), (50, 1), (34, 1), (2, 1), (66, 1) 등이 될 수 있으며, "(X, Y)"에서 X, Y는 도 6의 인트라 예측 방향성 모드(의 인덱스)일 수 있다.A video signal processing device can configure a multi-prediction-based MPM list using several predefined multi-prediction modes. Here, several predefined multi-prediction modes are (18, 0), (50, 0), (34, 0), (2, 0), (66, 0), (18, 1), (50, 1) ), (34, 1), (2, 1), (66, 1), etc., and in "(X, Y)", there is.
비디오 신호 처리 장치는 다중 예측 기반 MPM 리스트는 TIMD 기반 재정렬 방법을 통해 재정렬될 수 있다. 비디오 신호 처리 장치는 코스트가 낮은 몇 개의 항목만을 사용하여 다중 예측 기반 MPM 리스트를 재설정할 수 있다.The video signal processing device can reorder the multi-prediction based MPM list through a TIMD-based reordering method. The video signal processing device can reset the multi-prediction based MPM list using only a few low-cost items.
비디오 신호 처리 장치가 다중 예측 모드를 사용하여 예측 블록을 생성할 때, 각 예측 블록을 생성하는데 사용되는 인트라 예측 모드는 Primary MPM과 Secondary MPM을 기반으로 시그널링될 수 있다. Primary MPM에는 6개의 인트라 예측 방향성 모드가 포함될 수 있고, Secondary MPM에는 16개의 인트라 예측 방향성 모드가 포함될 수 있다. Secondary MPM은 미리 정의된 몇 개의 인트라 예측 모드를 사용하여 구성될 수 있다. 예를 들어, 비디오 신호 처리 장치는 DC, 50, 18, 46, 54, 14, 22, 42, 58, 10, 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, 16의 예측 모드(도 6의 인트라 예측 모드 참조)가 Primary MPM에 존재하지 않는 경우, Secondary MPM의 리스트가 모두 구성될 때까지 DC, 50, 18, 46, 54, 14, 22, 42, 58, 10, 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, 16의 예측 모드를 순서대로 추가하면서 Secondary MPM의 리스트를 구성할 수 있다. 비디오 신호 처리 장치는 현재 블록에 다중 예측 모드가 사용되는 경우, Primary MPM에서 하나의 인트라 예측 방향성 모드를 유도하고, Secondary MPM에서 또 다른 하나의 인트라 예측 방향성 모드를 유도함으로써, 현재 블록의 예측 블록을 생성하는데 사용되는 인트라 예측 방향성 모드를 결정할 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 인코더는 Primary MPM과 Secondary MPM 내에서 어떠한 인트라 예측 방향성 모드가 사용되었는지를 지시하는 인덱스 정보들을 비트스트림에 포함시켜서 시그널링할 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 디코더는 인덱스 정보들을 파싱한 후, 현재 블록에 대한 예측 블록들을 생성하는데 사용되는 인트라 예측 방향성 모드들을 Primary MPM과 Secondary MPM 리스트 내에서 결정할 수 있다.When a video signal processing device generates a prediction block using multiple prediction modes, the intra prediction mode used to generate each prediction block may be signaled based on the Primary MPM and Secondary MPM. Primary MPM may include 6 intra-prediction directional modes, and Secondary MPM may include 16 intra-prediction directional modes. Secondary MPM can be configured using several predefined intra prediction modes. For example, the video signal processing unit has DC, 50, 18, 46, 54, 14, 22, 42, 58, 10, 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, 16 If the prediction mode (see intra prediction mode in Figure 6) does not exist in the Primary MPM, DC, 50, 18, 46, 54, 14, 22, 42, 58, 10 until the list of Secondary MPMs is all constructed. The list of secondary MPMs can be constructed by adding the following prediction modes in order: , 26, 38, 62, 6, 30, 34, 66, 2, 48, 52, and 16. When multiple prediction modes are used in the current block, the video signal processing device determines the prediction block of the current block by deriving one intra-prediction directionality mode from the Primary MPM and another intra-prediction directionality mode from the Secondary MPM. The intra prediction directional mode used to generate can be determined. If multiple prediction modes are used in the current block, the encoder can signal by including in the bitstream index information indicating which intra-prediction directional mode is used within the Primary MPM and Secondary MPM. If multiple prediction modes are used in the current block, the decoder can parse the index information and then determine the intra prediction direction modes used to generate prediction blocks for the current block from the Primary MPM and Secondary MPM lists.
현재 블록에 다중 예측 모드가 사용되는 경우, 비디오 신호 처리 장치는 DIMD로부터 유도된 인트라 예측 방향성 모드, Primary MPM, Secondary MPM을 사용하여 현재 블록의 예측 블록을 생성하는데 사용되는 인트라 예측 방향성 모드들을 결정할 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 인코더는 DIMD로부터 유도된 인트라 예측 방향성 모드가 사용되었는지 여부 정보, Primary MPM과 Secondary MPM 내에서 어떠한 인트라 예측 방향성 모드가 사용되었는지를 지시하는 인덱스 정보들을 비트스트림에 포함시켜서 시그널링할 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 디코더는 DIMD로부터 유도된 인트라 예측 방향성 모드가 사용되었는지 여부 정보, Primary MPM과 Secondary MPM 내에서 어떠한 인트라 예측 방향성 모드가 사용되었는지를 지시하는 인덱스 정보들을 파싱하여 현재 블록에 대한 예측 블록들을 생성하는데 사용되는 인트라 예측 방향성 모드들을 결정할 수 있다.If multiple prediction modes are used in the current block, the video signal processing device can determine the intra prediction directionality modes used to generate the prediction block of the current block using the intra prediction directionality mode, Primary MPM, and Secondary MPM derived from DIMD. there is. If multiple prediction modes are used in the current block, the encoder sends information about whether the intra prediction directionality mode derived from DIMD is used and index information indicating which intra prediction directionality mode is used within the Primary MPM and Secondary MPM in the bitstream. It can be signaled by including it in . If multiple prediction modes are used in the current block, the decoder parses information on whether the intra prediction directionality mode derived from DIMD is used and index information indicating which intra prediction directionality mode is used within the Primary MPM and Secondary MPM. Intra prediction directional modes used to generate prediction blocks for the current block can be determined.
현재 블록에 다중 예측 모드가 사용되는 경우, 비디오 신호 처리 장치는 Primary MPM 리스트를 이용하여 Secondary MPM 리스트를 다중 예측 기반 MPM 리스트로 구성할 수 있다. 예를 들어 주변 블록으로부터 생성된 Primary MPM 모드가 Planar, 18, 54, 30, 45, 17 인 경우, Secondary MPM의 리스트에는 Planar+18, Planard+54,.. 등의 모드들이 추가되어 다중 예측 기반 MPM 리스트로 구성될 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 인코더는 Primary MPM 리스트를 이용하여 Secondary MPM 리스트를 다중 예측 기반 MPM 리스트로 구성한 후, 현재 블록의 예측 블록을 생성하는데 사용되는 다중 예측 모드를 Secondary MPM의 리스트에서 결정할 수 있으며, 결정된 Secondary MPM의 리스트에 대한 인덱스 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 인덱스 정보를 파싱하여 현재 블록의 예측 블록을 생성하는데 사용되는 다중 예측 모드를 Secondary MPM의 리스트에서 결정할 수 있다.If the multi-prediction mode is used in the current block, the video signal processing device can configure the Secondary MPM list into a multi-prediction-based MPM list using the Primary MPM list. For example, if the primary MPM mode created from the surrounding block is Planar, 18, 54, 30, 45, 17, modes such as Planar+18, Planard+54,.., etc. are added to the list of secondary MPM to enable multi-prediction based It may consist of an MPM list. If a multi-prediction mode is used in the current block, the encoder uses the Primary MPM list to configure the Secondary MPM list into a multi-prediction-based MPM list, and then configures the multi-prediction mode used to generate the prediction block of the current block into the list of Secondary MPMs. It can be determined and signaled by including index information about the determined list of Secondary MPMs in the bitstream. The decoder can parse the index information and determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPM.
또한, 현재 블록에 다중 예측 모드가 사용되는 경우, 비디오 신호 처리 장치는 DIMD로부터 유도된 인트라 예측 방향성 모드와 Primary MPM 리스트를 이용하여 Secondary MPM 리스트를 다중 예측 기반 MPM 리스트로 구성할 수 있다. 예를 들어, 주변 블록으로부터 생성된 Primary MPM 모드가 Planar, 18, 54, 30, 45, 17 인 경우, Secondary MPM의 리스트는 Planar+18, Planard+54,.. 등의 모드들이 추가되어 다중 예측 기반 MPM 리스트로 구성될 수 있다. 현재 블록에 다중 예측 모드가 사용되는 경우, 인코더는 DIMD로부터 유도된 인트라 예측 방향성 모드와 Primary MPM 리스트를 이용하여 Secondary MPM 리스트를 다중 예측 기반 MPM 리스트로 구성할 수 있다. 인코더는 현재 블록의 예측 블록을 생성하는데 사용되는 다중 예측 모드를 Secondary MPM의 리스트에서 결정할 수 있으며, 결정된 Secondary MPM의 리스트에 대한 인덱스 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 인덱스 정보를 파싱하여 현재 블록의 예측 블록을 생성하는데 사용되는 다중 예측 모드를 Secondary MPM의 리스트에서 결정할 수 있다.Additionally, when a multi-prediction mode is used in the current block, the video signal processing device can configure the Secondary MPM list into a multi-prediction-based MPM list using the intra-prediction directional mode derived from DIMD and the Primary MPM list. For example, if the primary MPM mode created from the surrounding block is Planar, 18, 54, 30, 45, 17, the list of secondary MPM includes modes such as Planar+18, Planard+54,.., etc. to enable multi-prediction. It may consist of a base MPM list. If a multi-prediction mode is used in the current block, the encoder can configure the secondary MPM list into a multi-prediction-based MPM list using the intra-prediction directional mode derived from DIMD and the primary MPM list. The encoder can determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPMs, and can signal it by including index information for the determined list of Secondary MPMs in the bitstream. The decoder can parse the index information and determine the multi-prediction mode used to generate the prediction block of the current block from the list of Secondary MPM.
다중 예측 모드가 사용되어 예측 블록이 생성될 때, 비디오 신호 처리 장치는 각 예측 블록을 생성하는데 사용되는 참조 픽셀의 위치를 각각 결정할 수 있다. 즉, 비디오 신호 처리 장치는 다양한 참조 픽셀 라인 중(도 31 참조)에서 각각의 예측 블록을 생성하는 데 사용되는 좌측 참조 픽셀 라인과 상단 참조 픽셀 라인을 각각 지정할 수 있다. 인코더는 최적의 참조 픽셀 라인을 결정한 후, 좌측 참조 픽셀 라인의 위치 정보와 상단 참조 픽셀 라인의 위치 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 각 위치 정보를 파싱하여, 각각의 예측 블록을 생성하는데 사용되는 좌측 참조 픽셀 라인과 상단 참조 픽셀 라인의 위치를 결정할 수 있다.When multiple prediction modes are used to generate prediction blocks, the video signal processing device can determine the positions of reference pixels used to generate each prediction block, respectively. That is, the video signal processing device can specify the left reference pixel line and the top reference pixel line used to generate each prediction block among various reference pixel lines (see FIG. 31). After determining the optimal reference pixel line, the encoder can signal by including the position information of the left reference pixel line and the position information of the top reference pixel line in the bitstream. The decoder can parse each position information to determine the positions of the left reference pixel line and the top reference pixel line used to generate each prediction block.
도 49는 본 발명의 일 실시예에 따른 다중 예측 모드를 사용하여 예측 블록이 생성될 때 사용되는 참조 픽셀의 위치를 나타낸다.Figure 49 shows the location of a reference pixel used when a prediction block is generated using a multi-prediction mode according to an embodiment of the present invention.
도 49을 참조하면, 다중 예측 모드 중에서 첫번째 인트라 예측 방향성 모드가 사용되어 예측 블록이 생성될 때, 비디오 신호 처리 장치는 현재 블록의 좌측 참조 픽셀만을 사용하여 예측 블록을 생성할 수 있다. 또한 다중 예측 모드 중에서 두번째 인트라 예측 방향성 모드가 사용되어 예측 블록을 생성될 때, 비디오 신호 처리 장치는 현재 블록의 상단 참조 픽셀만을 사용하여 예측 블록을 생성할 수 있다. 첫번째 인트라 예측 방향성 모드는 도 6의 인트라 예측 방향성 모드 중에서 34보다 적은 번호의 모드만이 사용될 수 있으며, 두번째 인트라 예측 방향성 모드는 도 6의 인트라 예측 방향성 모드 중에서 34보다 같거나 큰 모드만이 사용될 수 있다. 따라서, 다중 예측 기반 MPM 리스트가 구성될 때, 첫번째 인트라 예측 방향성 모드는 34보다 적은 번호의 모드만 가능하며, 두번째 인트라 예측 방향성 모드는 34보다 같거나 큰 번호의 모드만 가능하도록 구성할 수 있다.Referring to FIG. 49, when the first intra prediction directional mode among the multiple prediction modes is used to generate a prediction block, the video signal processing device may generate the prediction block using only the left reference pixel of the current block. Additionally, when the second intra prediction directional mode among the multiple prediction modes is used to generate a prediction block, the video signal processing device may generate the prediction block using only the top reference pixel of the current block. For the first intra prediction directional mode, only modes with numbers less than 34 can be used among the intra prediction directional modes of FIG. 6, and for the second intra prediction directional mode, only modes equal to or greater than 34 among the intra prediction directional modes of FIG. 6 can be used. there is. Therefore, when a multi-prediction-based MPM list is configured, the first intra prediction directional mode can be configured to enable only modes with numbers less than 34, and the second intra prediction directional mode can be configured to enable only modes with numbers equal to or greater than 34.
도 49를 참조하면 비디오 신호 처리 장치는 각각의 예측 블록을 생성하는데 사용되는 좌측 참조 픽셀 라인과 상단 참조 픽셀 라인을 각각 지정할 수 있다. 인코더는 최적의 참조 픽셀 라인을 결정한 후, 좌측 참조 픽셀 라인의 위치 정보와 상단 참조 픽셀 라인의 위치 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 각각의 위치 정보를 파싱하여, 각각의 예측 블록을 생성하는 데 사용되는 좌측 참조 픽셀 라인과 상단 참조 픽셀 라인의 위치를 결정할 수 있다. 또한, 상단 참조 픽셀 라인의 위치 정보는 좌측 참조 픽셀 라인의 위치 정보로부터 유도될 수 있으며, 상단 참조 픽셀 라인의 위치 정보와 좌측 참조 픽셀 라인의 위치 정보가 동일할 수 있다. 인코더는 상단 참조 픽셀 라인의 위치 정보를 시그널링할 때, 좌측 참조 픽셀 라인의 위치 정보와의 차이값만을 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더에서는 좌측 참조 픽셀 라인의 위치 정보를 파싱하고, 상단 참조 픽셀 라인의 위치 정보에 대한 차이값을 파싱한 후, 좌측 참조 픽셀 라인의 위치 정보와 상단 참조 픽셀 라인의 위치 정보에 대한 차이값을 통해 상단 참조 픽셀 라인의 위치 정보를 결정할 수 있다.Referring to FIG. 49, the video signal processing device can specify the left reference pixel line and the top reference pixel line used to generate each prediction block, respectively. After determining the optimal reference pixel line, the encoder can signal by including the position information of the left reference pixel line and the position information of the top reference pixel line in the bitstream. The decoder can parse each position information to determine the positions of the left reference pixel line and the top reference pixel line used to generate each prediction block. Additionally, the position information of the top reference pixel line may be derived from the position information of the left reference pixel line, and the position information of the top reference pixel line and the position information of the left reference pixel line may be the same. When signaling the position information of the top reference pixel line, the encoder can signal only the difference value from the position information of the left reference pixel line by including it in the bitstream. In the decoder, the position information of the left reference pixel line is parsed, the difference value of the position information of the top reference pixel line is parsed, and then the difference value of the position information of the left reference pixel line and the top reference pixel line is used. The location information of the upper reference pixel line can be determined.
다중 예측 모드가 적용된 현재 블록에 2차 변환이 적용되는 경우, 2차 변환에 대한 변환 세트는 2개의 인트라 예측 방향성 모드에 기초하여 결정될 수 있다. 이때, 2개의 인트라 예측 방향성 모드들 중에서 하나가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있으며, 첫번째 인트라 예측 방향성 모드가 사용될 수 있다. 인코더는 2개의 인트라 예측 방향성 모드 중에서 어떠한 것을 1차 변환 또는 2차 변환 세트를 유도하는데 사용할지에 대한 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더는 2개의 인트라 예측 방향성 모드 중에서 어떠한 것을 1차 변환 또는 2차 변환 세트를 유도하는데 사용할지에 대한 정보를 파싱하여, 현재 오차 블록에 대한 1차 역변환 또는 2차 역변환 세트를 유도하는데 사용하는 인트라 예측 방향성 모드를 결정할 수 있다. 또는 현재 블록에 다중 예측 모드가 적용되는 경우, 비디오 신호 처리 장치는 1차 변환(역변환) 또는 2차 변환(역변환) 세트를 유도하는데 사용하는 인트라 예측 방향성 모드를 미리 정의된 모드로 결정할 수 있다. 여기서, 미리 정의된 모드는 Planar, DC 모드 등이 될 수 있다.When a secondary transform is applied to the current block to which a multi-prediction mode is applied, a transform set for the secondary transform may be determined based on the two intra prediction directional modes. At this time, one of the two intra prediction directionality modes can be used to select the first or second transformation set, and the first intra prediction directionality mode can be used. The encoder can signal which of the two intra-prediction directionality modes will be used to derive the primary transform or secondary transform set by including in the bitstream. The decoder parses information about which of the two intra prediction directional modes to use to derive the first or second transform set, and determines which intra prediction mode to use to derive the first or second inverse transform set for the current error block. Directional mode can be determined. Alternatively, when multiple prediction modes are applied to the current block, the video signal processing device may determine the intra prediction directionality mode used to derive the first transform (inverse transform) or second transform (inverse transform) set as a predefined mode. Here, the predefined mode may be Planar, DC mode, etc.
비디오 신호 처리 장치는 상기 다중 예측 모드가 적용된 예측 블록에는 PDPC를 수행하지 않을 수 있다. 비디오 신호 처리 장치는 상기 다중 예측 모드가 적용된 예측 블록에는 2개의 인트라 예측 방향성 모드 중에서 첫번째 인트라 예측 방향성 모드에 기초하여 PDPC를 수행할 수 있다. 비디오 신호 처리 장치는 상기 다중 예측 모드가 적용된 예측 블록에는 2개의 인트라 예측 방향성 모드 중에서 첫번째 인트라 예측 방향성 모드에 기초하여 첫번째 PDPC를 수행한 후, 두번째 인트라 예측 방향성 모드에 기초하여 두번째 PDPC를 수행할 수 있다.A video signal processing device may not perform PDPC on a prediction block to which the multi-prediction mode is applied. The video signal processing device may perform PDPC on the prediction block to which the multiple prediction mode is applied based on the first intra prediction directional mode among the two intra prediction directional modes. The video signal processing device may perform the first PDPC based on the first intra prediction directional mode among the two intra prediction directional modes on the prediction block to which the multiple prediction mode is applied, and then perform the second PDPC based on the second intra prediction directional mode. there is.
상술한 1차 변환인 MTS 변환에서 변환은 오차 블록의 수직 방향과 수평 방향에 대해 각각 변환 커널이 적용되어 계산되므로, 분리가능한 변환(separable transform) 방식이라고 할 수 있다. 반면에 상술한 2차 변환인 LFNST 변환에서 변환은 수직 방향과 수평 방향에 대해 각각 변환 커널을 적용되지 않고 변환 커널은 한번만 적용되어 계산되므로, 비분리 변환(non-separable transform) 방식이라고 할 수 있다. 또한, 상술한 2차 변환은 DCT-2 변환이 적용된 블록의 1차 변환된 변환 계수에 대해 추가로 적용되는 것이므로, 2단계 변환 기법이라고 할 수 있다. 상술한 2차 변환은 부호화 효율은 높지만 총 3번의 변환 커널이 적용되므로, 복잡하다는 단점이 있다. 이러한 복잡도를 줄이기 위해서, 2차 변환 방식만으로 변환을 적용하는 방식인 NSPT(Non-separable primary transform) 방식이 적용될 수 있다. NSPT 변환 방식은 비분리 변환 방식으로, 오차 블록의 수직 방향과 수평 방향에 대해 각각 변환 커널을 적용하지 않고 변환 커널을 한번만 적용하여 계산된다. 비디오 신호 처리 장치에서 현재 블록의 오차 블록은 MTS, DCT2 + LFNST, NSPT 변환 방식 중에서 하나의 변환 방식을 사용하여 변환 또는 역변환이 수행될 수 있다.In the MTS transformation, which is the first transformation described above, the transformation is calculated by applying a transformation kernel to each of the vertical and horizontal directions of the error block, so it can be said to be a separable transform method. On the other hand, in the LFNST transformation, which is the secondary transformation described above, the transformation does not apply a transformation kernel to each of the vertical and horizontal directions, and the transformation kernel is applied and calculated only once, so it can be said to be a non-separable transform method. . In addition, the above-described secondary transformation is additionally applied to the primary transformed transform coefficient of the block to which DCT-2 transformation has been applied, so it can be said to be a two-stage transformation technique. The above-described secondary transformation has high coding efficiency, but has the disadvantage of being complicated because a total of three transformation kernels are applied. To reduce this complexity, the NSPT (Non-separable primary transform) method, which is a method of applying transformation using only the secondary transformation method, can be applied. The NSPT transformation method is a non-separate transformation method, and is calculated by applying the transformation kernel only once rather than applying a transformation kernel to each of the vertical and horizontal directions of the error block. In a video signal processing device, the error block of the current block may be transformed or inversely transformed using one of the MTS, DCT2 + LFNST, and NSPT transformation methods.
도 50은 본 발명의 일 실시예에 따른 LFNST 및 NSPT 변환에 대한 변환 세트 테이블을 나타낸다.Figure 50 shows a transform set table for LFNST and NSPT transforms according to an embodiment of the present invention.
LFNST 및 NSPT 변환에서 사용되는 변환 세트는 35가지가 존재할 수 있으며, 인트라 예측 모드(도 6 참고)에 따라 달라질 수 있다. 즉, 비디오 신호 처리 장치는 도 50의 변환 세트 테이블을 참고하여, 인트라 예측 모드(도 6 참고)에 대응되는 LFNST 및 NSPT 변환의 변환 세트 인덱스를 유도할 수 있다. 또한, LFNST 및 NSPT 변환 세트는 인트라 예측 모드, 현재 블록이 휘도 블록인지 혹은 색차 블록인지 여부 정보, 현재 블록의 가로 및 세로의 크기, 현재 블록의 인트라 예측 방향성 모드가 확장 각도 모드인지 여부에 따라 달라질 수 있다. 하나의 변환 세트마다 임의의 개수만큼의 변환 매트릭스가 존재할 수 있다. 여기서, 임의의 개수는 1이상의 정수일 수 있으며, 3일 수 있다. 인코더에서는 변환 세트 내의 여러 개의 변환 매트릭스 중에서 최적의 변환 매트릭스에 대한 인덱스 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더에서는 최적의 변환 매트릭스에 대한 인덱스를 파싱한 후, 변환 세트에서 인덱스에 대응되는 변환 매트릭스를 사용하여 역변환을 적용할 수 있다.There may be 35 transformation sets used in the LFNST and NSPT transformations, and they may vary depending on the intra prediction mode (see Figure 6). That is, the video signal processing device may refer to the transform set table of FIG. 50 and derive the transform set index of the LFNST and NSPT transforms corresponding to the intra prediction mode (see FIG. 6). Additionally, the LFNST and NSPT transform sets vary depending on the intra prediction mode, information on whether the current block is a luminance block or a chrominance block, the horizontal and vertical sizes of the current block, and whether the intra prediction directionality mode of the current block is the extended angle mode. You can. There may be an arbitrary number of transformation matrices for each transformation set. Here, the arbitrary number may be an integer of 1 or more, and may be 3. In the encoder, index information about the optimal transformation matrix among several transformation matrices in the transformation set can be signaled by including it in the bitstream. In the decoder, after parsing the index for the optimal transformation matrix, the inverse transformation can be applied using the transformation matrix corresponding to the index in the transformation set.
수직 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성되고 NSPT가 적용되는 경우, 인코더는 오차 신호에 대해 평면 모드의 변환 세트를 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 세트를 사용하여 변환과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용되는 경우, 인코더는 평면 모드가 아닌 수평 각도 모드(도 6의 18번 각도 모드)를 사용하여 변환 세트를 유도할 수 있다. 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용된 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 변환 세트를 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 세트를 사용하여 변환 과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용된 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 변환 세트를 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 변환 세트를 사용하여 변환 과정을 수행할 수 있다.If the prediction block of the current block is generated using the vertical plane mode and NSPT is applied, the encoder does not use the transform set of the plane mode for the error signal, but rather the transform set of the vertical angle mode (angle mode 50 in Figure 6). The transformation process can be performed using transformation sets. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the encoder can derive the transform set using the horizontal angle mode (angle mode 18 in FIG. 6) rather than the planar mode. If the vertical plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the vertical angle mode (angle mode 50 in Figure 6). The transformation process can be performed using transformation sets. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the horizontal angle mode (angle mode 18 in Figure 6). The transformation process can be performed using transformation sets.
도 33, 수학식 4를 참조하면, 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되는 경우, 예측 블록은 고정된 위치인 rec(-1, H)의 화소 값과 x 축 좌표에 따라 유동적으로 변화되는 rec(x, -1)의 화소 값에 기초하여 생성될 수 있다. 즉, 수직 방향 평면 모드가 사용되면, x축으로 화소 값의 변화가 발생하므로, 오차 신호의 특성은 수평 각도 모드(도 6의 50번 각도 모드)의 오차 신호의 특성과 유사할 수 있다. 즉, 수직 방향 평면 모드를 사용하여 현재 블록의 예측 블록이 생성되고 NSPT가 적용되는 경우, 인코더는 오차 신호에 대해 평면 모드의 변환 세트를 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 변환 세트를 사용하여 변환과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용되는 경우, 인코더는 평면 모드가 아닌 수직 각도 모드(도 6의 50번 각도 모드)를 사용하여 변환 세트를 유도할 수 있다. 수직 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용된 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 변환 세트를 사용하지 않고, 수평 각도 모드(도 6의 18번 각도 모드)의 변환 세트를 사용하여 변환 과정을 수행할 수 있다. 수평 방향 평면 모드가 사용되어 현재 블록의 예측 블록이 생성되고 NSPT가 적용된 경우, 디코더는 오차 신호에 대해 평면 모드에 대한 변환 세트를 사용하지 않고, 수직 각도 모드(도 6의 50번 각도 모드)의 변환 세트를 사용하여 변환 과정을 수행할 수 있다.현재 블록이 타일 경계, 슬라이스 경계, 서브 픽쳐 경계 중에서 적어도 하나 이상의 경계에 인접한 경우, 인접한 다른 타일, 인접한 다른 슬라이스, 인접한 다른 서브 픽쳐의 복원된 샘플에 접근할 수 없거나 사용할 수 없다. 인코더는 현재 블록이 타일 경계, 슬라이스 경계, 서브 픽쳐 경계 중에서 적어도 하나 이상의 경계에 인접한 경우, 평면 모드 선택 정보를 시그널링하지 않을 수 있으며, 비트스트림에 포함시키지 않을 수 있다. 디코더에서는 현재 블록이 타일 경계, 슬라이스 경계, 서브 픽쳐 경계 중에서 적어도 하나 이상의 경계에 인접한 경우, 평면 모드 선택 정보를 파싱하지 않을 수 있으며, 현재 블록의 모드를 평면 모드(또는 DC 모드)로 설정할 수 있다.Referring to Figure 33, Equation 4, when the vertical plane mode is used to generate the prediction block of the current block, the prediction block is generated according to the pixel value of rec(-1, H), which is a fixed position, and the x-axis coordinate. It can be generated based on the dynamically changing pixel value of rec(x, -1). That is, when the vertical plane mode is used, a change in pixel value occurs along the x-axis, so the characteristics of the error signal may be similar to those of the horizontal angle mode (angle mode 50 in FIG. 6). That is, if the prediction block of the current block is generated using the vertical plane mode and NSPT is applied, the encoder does not use the transform set of the plane mode for the error signal, but uses the horizontal angle mode (angle mode number 18 in Figure 6). ) can be used to perform the conversion process. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the encoder can derive the transform set using the vertical angle mode (angle mode 50 in Figure 6) rather than the planar mode. If the vertical plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the horizontal angle mode (angle mode 18 in Figure 6). The transformation process can be performed using transformation sets. If the horizontal plane mode is used to generate the prediction block of the current block and NSPT is applied, the decoder does not use the transform set for the plane mode for the error signal, but rather the transform set for the vertical angle mode (angle mode 50 in Figure 6). A transformation process can be performed using a transformation set. If the current block is adjacent to at least one boundary among a tile boundary, a slice boundary, and a subpicture boundary, the restored sample of another adjacent tile, another adjacent slice, or another adjacent subpicture cannot be accessed or used. If the current block is adjacent to at least one boundary among a tile boundary, a slice boundary, and a subpicture boundary, the encoder may not signal planar mode selection information and may not include it in the bitstream. In the decoder, if the current block is adjacent to at least one boundary among tile boundaries, slice boundaries, and subpicture boundaries, the planar mode selection information may not be parsed, and the mode of the current block may be set to planar mode (or DC mode). .
인코더는 현재 블록이 타일 경계, 슬라이스 경계, 서브 픽쳐 경계 중에서 적어도 하나 이상의 경계에 인접한 경우, DIMD, TIMD, Intra TMP, TMRL, 인트라 퓨젼과 관련된 정보를 시그널링하지 않을 수 있으며, 비트스트림에 포함시키지 않을 수 있다. 디코더에서는 현재 블록이 타일 경계, 슬라이스 경계, 서브 픽쳐 경계 중에서 적어도 하나 이상의 경계에 인접한 경우, DIMD, TIMD, Intra TMP, TMRL, 인트라 퓨젼과 관련된 정보를 파싱하지 않을 수 있으며, 현재 블록의 모드를 평면 모드(또는 DC 모드)로 설정할 수 있다.If the current block is adjacent to at least one boundary among tile boundaries, slice boundaries, and subpicture boundaries, the encoder may not signal information related to DIMD, TIMD, Intra TMP, TMRL, and intra fusion, and may not include it in the bitstream. You can. In the decoder, if the current block is adjacent to at least one boundary among tile boundaries, slice boundaries, and subpicture boundaries, information related to DIMD, TIMD, Intra TMP, TMRL, and intra fusion may not be parsed, and the mode of the current block may be set to planar. It can be set to mode (or DC mode).
도 51은 본 발명의 일 실시예에 따른 선형 모드를 사용한 예측에 있어, 선형 모드를 위한 변환 세트를 유도하는 방법을 나타낸다.Figure 51 shows a method of deriving a transform set for a linear mode in prediction using a linear mode according to an embodiment of the present invention.
도 51은 도1 내지 도 50를 통해 설명한 현재 블록의 예측 블록을 생성함에 있어, 선형 모드가 사용되는 경우, 선형 모드에 대한 다중 변환 세트 및 LFNST 변환 세트를 유도하는 방법을 나타낸다.FIG. 51 shows a method of deriving a multiple transform set and an LFNST transform set for the linear mode when linear mode is used in generating a prediction block of the current block described with reference to FIGS. 1 to 50.
도 51을 참조하면 비디오 신호 처리 장치는 현재 블록의 제1 예측 모드를 결정할 수 있다(S5110). 비디오 신호 처리 장치는 상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성할 수 있다(S5120). 비디오 신호 처리 장치는 제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성할 수 있다(S5130). 비디오 신호 처리 장치는 상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원할 수 있다(S5140).Referring to FIG. 51, the video signal processing device may determine the first prediction mode of the current block (S5110). The video signal processing device may generate a prediction block of the current block based on the first prediction mode (S5120). The video signal processing device may generate a residual block of the current block based on a transformation matrix set determined based on the second prediction mode (S5130). The video signal processing device may restore the current block based on the prediction block and the residual block (S5140).
상기 잔차 블록은, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합 및/또는 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 중 적어도 어느 하나에 기초하여 생성될 수 있다.The residual block is based on at least one of a set of transform matrices of a multiple transform set (MTS) and/or a set of transform matrices of a low frequency non-separable transform (LFNST). It can be created.
상기 제1 예측 모드와 상기 제2 예측 모드는 서로 상이한 예측 모드일 수 있다.The first prediction mode and the second prediction mode may be different prediction modes.
상기 제1 예측 모드는, 수평 방향에 기초한 평면 모드(수평 방향 평면 모드), 또는 수직 방향에 기초한 평면 모드(수직 방향 평면 모드) 중 하나일 수 있다.The first prediction mode may be one of a planar mode based on the horizontal direction (horizontal planar mode) or a planar mode based on the vertical direction (vertical planar mode).
상기 수평 방향에 기초한 평면 모드는, (-1, y) 위치의 블록의 값과 (W, -1) 위치의 블록의 값에 기초한 예측 모드일 수 있다. 상기 수직 방향에 기초한 평면 모드는, (x, -1) 위치의 블록의 값과 (-1, H) 위치의 블록의 값에 기초한 예측 모드일 수 있다. 이때, 상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)이고, 상기 예측 블록의 위치는 (x, y)일 수 있다.The plane mode based on the horizontal direction may be a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position. The plane mode based on the vertical direction may be a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position. At this time, the position of the upper-left block of the current block may be (0, 0), and the position of the prediction block may be (x, y).
i) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수직 방향 각도 모드이고, 또는 ii) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수평 방향 각도 모드일 수 있다.i) the first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a vertical angle mode, or ii) the first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is The prediction mode may be a horizontal angle mode.
상기 제1 예측 모드는, 선형(linear)적인 예측 모드일 수 있다.The first prediction mode may be a linear prediction mode.
상기 제1 예측 모드는, 비트스트림에 포함된 신택스 요소에 의해 지시될 수 있다.The first prediction mode may be indicated by a syntax element included in the bitstream.
본 명세서에서 상술한 방법들은 디코더 또는 인코더의 프로세서를 통해 수행될 수 있다. 또한, 인코더는 상술한 방법들에 의해 디코딩되는 비트스트림을 생성할 수 있다. 또한, 인코더가 생성한 비트스트림은 컴퓨터 판독 가능한 비 일시적 저장 매체(기록 매체)에 저장될 수 있다.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).
본 명세서는 주로 디코더 관점에서 기술되었으나 인코더에서도 동일하게 동작될 수 있다. 본 명세서의 파싱이라는 용어는 비트스트림으로부터 정보를 획득하는 과정을 중점으로하여 설명되었으나 인코더 측면에서는 비트스트림에 해당 정보를 구성하는 것으로 해석될 수 있다. 따라서 파싱이라는 용어는 디코더 동작으로만 한정되지 않고 인코더에서는 비트스트림을 구성하는 행위로까지 해석될 수 있다. 또한, 이러한 비트스트림은 컴퓨터 판독 가능한 기록 매체에 저장되어 구성될 수 있다.Although this specification is mainly described from the perspective of a decoder, it can be operated equally in an encoder. The term parsing in this specification has been described with a focus on the process of obtaining information from the bitstream, but from the encoder perspective, it can be interpreted as configuring the information in the bitstream. Therefore, the term 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.
상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.Embodiments of the present invention described above can be implemented through various means. For example, embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.
하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.In the case of hardware implementation, 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). , can be implemented by FPGAs (Field Programmable Gate Arrays), processors, controllers, microcontrollers, microprocessors, etc.
펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 프로세서의 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 프로세서와 데이터를 주고받을 수 있다.In the case of implementation by firmware or software, 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.
일부 실시예는 컴퓨터에 의해 실행되는 프로그램 모듈과 같은 컴퓨터에 의해 실행가능한 명령어를 포함하는 기록 매체의 형태로도 구현될 수 있다. 컴퓨터 판독 가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용 매체일 수 있고, 휘발성 및 비휘발성 매체, 분리형 및 비분리형 매체를 모두 포함한다. 또한, 컴퓨터 판독 가능 매체는 컴퓨터 저장 매체 및 통신 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함한다. 통신 매체는 전형적으로 컴퓨터 판독가능 명령어, 데이터 구조 또는 프로그램 모듈과 같은 변조된 데이터 신호의 기타 데이터, 또는 기타 전송 메커니즘을 포함하며, 임의의 정보 전달 매체를 포함한다.Some embodiments may also be implemented in the form of a recording medium containing instructions executable by a computer, such as program modules executed by a computer. 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.
전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아는 것으로 해석해야 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다.The description of the present invention described above is for illustrative purposes, and those skilled in the art will understand that the present invention can be easily modified into other specific forms without changing the technical idea or essential features of the present invention. will be. Therefore, the embodiments described above are illustrative in all respects and should be interpreted as limited. For example, each component described as unitary may be implemented in a distributed manner, and similarly, components described as distributed may also be implemented in a combined form.
본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.The scope of the present invention is indicated by the claims described below rather than the detailed description above, and all changes or modified forms derived from the meaning and scope of the claims and their equivalent concepts should be construed as being included in the scope of the present invention. do.

Claims (20)

  1. 비디오 신호 디코딩 장치에 있어서,In the video signal decoding device,
    프로세서를 포함하며,Contains a processor,
    상기 프로세서는,The processor,
    현재 블록의 제1 예측 모드를 결정하고,determine the first prediction mode of the current block,
    상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하고,Generate a prediction block of the current block based on the first prediction mode,
    제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하고,Generating a residual block of the current block based on a set of transformation matrices determined based on a second prediction mode,
    상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원하는, 비디오 신호 디코딩 장치.A video signal decoding device that restores the current block based on the prediction block and the residual block.
  2. 제 1항에 있어서,According to clause 1,
    상기 잔차 블록은, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합 및/또는 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 중 적어도 어느 하나에 기초하여 생성되는, 비디오 신호 디코딩 장치.The residual block is based on at least one of a set of transform matrices of a multiple transform set (MTS) and/or a set of transform matrices of a low frequency non-separable transform (LFNST). A video signal decoding device generated by:
  3. 제 1항에 있어서,According to clause 1,
    상기 제1 예측 모드와 상기 제2 예측 모드는 서로 상이한 예측 모드인, 비디오 신호 디코딩 장치.The first prediction mode and the second prediction mode are different prediction modes.
  4. 제 3항에 있어서,According to clause 3,
    상기 제1 예측 모드는, 수평 방향에 기초한 평면 모드, 또는 수직 방향에 기초한 평면 모드 중 하나인, 비디오 신호 디코딩 장치. The first prediction mode is one of a planar mode based on the horizontal direction or a planar mode based on the vertical direction.
  5. 제 4항에 있어서,According to clause 4,
    상기 수평 방향에 기초한 평면 모드는, (-1, y) 위치의 블록의 값과 (W, -1) 위치의 블록의 값에 기초한 예측 모드이고,The plane mode based on the horizontal direction is a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position,
    상기 수직 방향에 기초한 평면 모드는, (x, -1) 위치의 블록의 값과 (-1, H) 위치의 블록의 값에 기초한 예측 모드이고,The plane mode based on the vertical direction is a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position,
    상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)이고, The position of the upper left block of the current block is (0, 0),
    상기 예측 블록의 위치는 (x, y)인, 비디오 신호 디코딩 장치.A video signal decoding device, wherein the position of the prediction block is (x, y).
  6. 제 4항에 있어서,According to clause 4,
    i) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수직 방향 각도 모드이고, 또는i) the first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a vertical angle mode, or
    ii) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수평 방향 각도 모드인, 비디오 신호 디코딩 장치.ii) The first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a horizontal direction angle mode.
  7. 제 4항에 있어서,According to clause 4,
    상기 제1 예측 모드는, 선형(linear)적인 예측 모드인, 비디오 신호 디코딩 장치.The first prediction mode is a linear prediction mode.
  8. 제 4항에 있어서,According to clause 4,
    상기 제1 예측 모드는, 비트스트림에 포함된 신택스 요소에 의해 지시되는, 비디오 신호 디코딩 장치.The first prediction mode is indicated by a syntax element included in the bitstream.
  9. 비디오 신호 인코딩 장치에 있어서,In the video signal encoding device,
    프로세서를 포함하며,Contains a processor,
    상기 프로세서는,The processor,
    현재 블록의 제1 예측 모드를 결정하고,determine the first prediction mode of the current block,
    상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하고,Generate a prediction block of the current block based on the first prediction mode,
    제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하고,Generating a residual block of the current block based on a set of transformation matrices determined based on a second prediction mode,
    상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원하는, 비디오 신호 인코딩 장치.A video signal encoding device that restores the current block based on the prediction block and the residual block.
  10. 제 9항에 있어서,According to clause 9,
    상기 잔차 블록은, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합 및/또는 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 중 적어도 어느 하나에 기초하여 생성되는, 비디오 신호 인코딩 장치.The residual block is based on at least one of a set of transform matrices of a multiple transform set (MTS) and/or a set of transform matrices of a low frequency non-separable transform (LFNST). A video signal encoding device generated by:
  11. 제 9항에 있어서,According to clause 9,
    상기 제1 예측 모드와 상기 제2 예측 모드는 서로 상이한 예측 모드인, 비디오 신호 인코딩 장치.The first prediction mode and the second prediction mode are different prediction modes.
  12. 제 11항에 있어서,According to claim 11,
    상기 제1 예측 모드는, 수평 방향에 기초한 평면 모드, 또는 수직 방향에 기초한 평면 모드 중 하나인, 비디오 신호 인코딩 장치. The first prediction mode is one of a planar mode based on the horizontal direction or a planar mode based on the vertical direction.
  13. 제 12항에 있어서,According to clause 12,
    상기 수평 방향에 기초한 평면 모드는, (-1, y) 위치의 블록의 값과 (W, -1) 위치의 블록의 값에 기초한 예측 모드이고,The plane mode based on the horizontal direction is a prediction mode based on the value of the block at the (-1, y) position and the value of the block at the (W, -1) position,
    상기 수직 방향에 기초한 평면 모드는, (x, -1) 위치의 블록의 값과 (-1, H) 위치의 블록의 값에 기초한 예측 모드이고,The plane mode based on the vertical direction is a prediction mode based on the value of the block at the (x, -1) position and the value of the block at the (-1, H) position,
    상기 현재 블록의 좌-상단 블록의 위치는 (0, 0)이고, The position of the upper left block of the current block is (0, 0),
    상기 예측 블록의 위치는 (x, y)인, 비디오 신호 인코딩 장치.A video signal encoding device where the position of the prediction block is (x, y).
  14. 제 12항에 있어서,According to clause 12,
    i) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수직 방향 각도 모드이고, 또는i) the first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a vertical angle mode, or
    ii) 상기 제1 예측 모드는 상기 수평 방향에 기초한 평면 모드이고, 상기 제2 예측 모드는 수평 방향 각도 모드인, 비디오 신호 인코딩 장치.ii) The first prediction mode is a planar mode based on the horizontal direction, and the second prediction mode is a horizontal direction angle mode.
  15. 제 12항에 있어서,According to clause 12,
    상기 제1 예측 모드는, 선형(linear)적인 예측 모드인, 비디오 신호 인코딩 장치.The first prediction mode is a linear prediction mode.
  16. 제 12항에 있어서,According to clause 12,
    상기 제1 예측 모드는, 비트스트림에 포함된 신택스 요소에 의해 지시되는, 비디오 신호 인코딩 장치.The first prediction mode is indicated by a syntax element included in the bitstream.
  17. 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에 있어서, 상기 비트스트림은 디코딩 방법에 의해 디코딩되고,A computer-readable non-transitory storage medium storing a bitstream, wherein the bitstream is decoded by a decoding method,
    상기 디코딩 방법은,The decoding method is,
    현재 블록의 제1 예측 모드를 결정하는 단계;determining a first prediction mode of the current block;
    상기 제1 예측 모드에 기초하여 상기 현재 블록의 예측 블록을 생성하는 단계;generating a prediction block of the current block based on the first prediction mode;
    제2 예측 모드에 기초하여 결정되는 변환 매트릭스 집합에 기초하여 상기 현재 블록의 잔차 블록을 생성하는 단계; 및generating a residual block of the current block based on a set of transformation matrices determined based on a second prediction mode; and
    상기 예측 블록과 상기 잔차 블록에 기초하여 상기 현재 블록을 복원하는 단계를 포함하는, 비 일시적 저장 매체.and restoring the current block based on the prediction block and the residual block.
  18. 제 17항에 있어서,According to clause 17,
    상기 잔차 블록은, 다중 변환 세트(Multiple Transform Set, MTS)의 변환 매트릭스의 집합 및/또는 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)의 변환 매트릭스의 집합 중 적어도 어느 하나에 기초하여 생성되는, 비 일시적 저장 매체.The residual block is based on at least one of a set of transform matrices of a multiple transform set (MTS) and/or a set of transform matrices of a low frequency non-separable transform (LFNST). A non-transitory storage medium created by
  19. 제 17항에 있어서,According to clause 17,
    상기 제1 예측 모드와 상기 제2 예측 모드는 서로 상이한 예측 모드인, 비 일시적 저장 매체.The first prediction mode and the second prediction mode are different prediction modes.
  20. 제 19항에 있어서,According to clause 19,
    상기 제1 예측 모드는, 수평 방향에 기초한 평면 모드, 또는 수직 방향에 기초한 평면 모드 중 하나인, 비 일시적 저장 매체.The first prediction mode is one of a planar mode based on a horizontal direction, or a planar mode based on a vertical direction.
PCT/KR2023/012220 2022-08-17 2023-08-17 Video signal processing method and apparatus therefor WO2024039209A1 (en)

Applications Claiming Priority (14)

Application Number Priority Date Filing Date Title
KR10-2022-0102786 2022-08-17
KR20220102786 2022-08-17
KR20220115738 2022-09-14
KR10-2022-0115738 2022-09-14
KR20220121836 2022-09-26
KR10-2022-0121836 2022-09-26
KR20220131623 2022-10-13
KR10-2022-0131623 2022-10-13
KR10-2022-0138758 2022-10-25
KR20220138758 2022-10-25
KR20220154921 2022-11-17
KR10-2022-0154921 2022-11-17
KR10-2023-0003137 2023-01-09
KR20230003137 2023-01-09

Publications (1)

Publication Number Publication Date
WO2024039209A1 true WO2024039209A1 (en) 2024-02-22

Family

ID=89941954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/012220 WO2024039209A1 (en) 2022-08-17 2023-08-17 Video signal processing method and apparatus therefor

Country Status (1)

Country Link
WO (1) WO2024039209A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210031754A (en) * 2018-09-02 2021-03-22 엘지전자 주식회사 Image coding method based on multiple transformation selection and apparatus therefor
KR20210079379A (en) * 2019-01-12 2021-06-29 엘지전자 주식회사 Video coding method and apparatus based on quadratic transformation
KR20220006055A (en) * 2019-05-11 2022-01-14 베이징 바이트댄스 네트워크 테크놀로지 컴퍼니, 리미티드 Interactions between multiple intra-coding methods
KR102408742B1 (en) * 2019-03-26 2022-06-15 엘지전자 주식회사 Transformation-based video coding method and apparatus
KR102418700B1 (en) * 2017-12-04 2022-07-08 엘지전자 주식회사 Video decoding method and apparatus based on efficient conversion of chroma components in video coding system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102418700B1 (en) * 2017-12-04 2022-07-08 엘지전자 주식회사 Video decoding method and apparatus based on efficient conversion of chroma components in video coding system
KR20210031754A (en) * 2018-09-02 2021-03-22 엘지전자 주식회사 Image coding method based on multiple transformation selection and apparatus therefor
KR20210079379A (en) * 2019-01-12 2021-06-29 엘지전자 주식회사 Video coding method and apparatus based on quadratic transformation
KR102408742B1 (en) * 2019-03-26 2022-06-15 엘지전자 주식회사 Transformation-based video coding method and apparatus
KR20220006055A (en) * 2019-05-11 2022-01-14 베이징 바이트댄스 네트워크 테크놀로지 컴퍼니, 리미티드 Interactions between multiple intra-coding methods

Similar Documents

Publication Publication Date Title
WO2018026219A1 (en) Video signal processing method and device
WO2018030773A1 (en) Method and apparatus for image encoding/decoding
WO2020076143A1 (en) Video signal processing method and apparatus using multi-assumption prediction
WO2018066867A1 (en) Method and apparatus for encoding and decoding image, and recording medium for storing bitstream
WO2017176030A1 (en) Method and apparatus for processing video signal
WO2017222326A1 (en) Video signal processing method and device
WO2018012851A1 (en) Image encoding/decoding method and recording medium therefor
WO2019177354A1 (en) Method and device for encoding/decoding image and recording medium having bitstream stored thereon
WO2019083334A1 (en) Method and device for image encoding/decoding on basis of asymmetric sub-block
WO2019172705A1 (en) Image encoding/decoding method and apparatus using sample filtering
WO2019182385A1 (en) Image encoding/decoding method and device, and recording medium in which bitstream is stored
WO2020096389A1 (en) Image signal encoding/decoding method and apparatus therefor
WO2020111785A1 (en) Method for encoding/decoding video signal and apparatus therefor
WO2020076116A1 (en) Image encoding/decoding methods and apparatuses
WO2019022568A1 (en) Image processing method, and image encoding/decoding method and device which use same
WO2019039806A1 (en) Method and apparatus for encoding/decoding video, and recording medium storing bit stream
WO2019182292A1 (en) Method and apparatus for video signal processing
WO2021015524A1 (en) Method and device for processing video signal
WO2015133838A1 (en) Method for encoding/decoding image on basis of polygon unit and apparatus therefor
WO2020060329A1 (en) Method for encoding/decoding image signal and apparatus therefor
WO2020096426A1 (en) Method for encoding/decoding image signal, and device for same
WO2020004978A1 (en) Method and apparatus for processing video signal
WO2020060317A1 (en) Method and apparatus for encoding/decoding image, and recording medium for storing bitstream
WO2020171681A1 (en) Intra prediction-based video signal processing method and device
WO2020141904A1 (en) Image signal encoding/decoding method and device for same

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

Country of ref document: EP

Kind code of ref document: A1