KR20230013146A - Method for intra prediction and apparatus thereof - Google Patents

Method for intra prediction and apparatus thereof Download PDF

Info

Publication number
KR20230013146A
KR20230013146A KR1020230005110A KR20230005110A KR20230013146A KR 20230013146 A KR20230013146 A KR 20230013146A KR 1020230005110 A KR1020230005110 A KR 1020230005110A KR 20230005110 A KR20230005110 A KR 20230005110A KR 20230013146 A KR20230013146 A KR 20230013146A
Authority
KR
South Korea
Prior art keywords
luma
pixels
block
pixel
neighboring
Prior art date
Application number
KR1020230005110A
Other languages
Korean (ko)
Other versions
KR102607887B1 (en
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 KR20230013146A publication Critical patent/KR20230013146A/en
Priority to KR1020230166008A priority Critical patent/KR20230165180A/en
Application granted granted Critical
Publication of KR102607887B1 publication Critical patent/KR102607887B1/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/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/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/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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

본 발명에 따른 인트라 예측 방법은, 현재 루마 블록 내 픽셀 및 현재 루마 블록 주변에 위치한 주변 루마 픽셀을 기반으로, 루마 참조 블록 내 픽셀 및 루마 참조 블록 주변에 위치한 주변 루마 참조 픽셀을 포함한 루마 참조 정보를 생성하는 단계, 주변 루마 참조 픽셀 및 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 주변 루마 참조 픽셀에 대응되는 제1 주변 크로마 픽셀을 기반으로, 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계 및 루마 참조 블록 내 픽셀 및 예측 파라미터를 기반으로, 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계를 포함한다.In the intra prediction method according to the present invention, luma reference information including pixels in a luma reference block and neighboring luma reference pixels located around a luma reference block is obtained based on pixels in a current luma block and neighboring luma pixels located around the current luma block. generating, deriving a prediction parameter for the current chroma block based on a neighboring luma reference pixel and a first neighboring chroma pixel corresponding to the neighboring luma reference pixel among neighboring chroma pixels positioned around the current chroma block, and deriving a luma reference parameter. and deriving a predicted value of a pixel in the current chroma block based on the pixel in the block and the prediction parameter.

Description

인트라 예측 방법 및 그 장치 {METHOD FOR INTRA PREDICTION AND APPARATUS THEREOF}Intra prediction method and device thereof {METHOD FOR INTRA PREDICTION AND APPARATUS THEREOF}

본 발명은 영상 처리에 관한 것으로서, 보다 상세하게는 인트라 예측 방법 및 장치에 관한 것이다.The present invention relates to image processing, and more particularly, to an intra prediction method and apparatus.

최근 HD(High Definition) 해상도를 가지는 방송 서비스가 국내뿐만 아니라 세계적으로 확대되면서, 많은 사용자들이 고해상도, 고화질의 영상에 익숙해지고 있으며 이에 따라 많은 기관들이 차세대 영상기기에 대한 개발에 박차를 가하고 있다. 또한 HDTV와 더불어 HDTV의 4배 이상의 해상도를 갖는 UHD(Ultra High Definition)에 대한 관심이 증대되면서 보다 높은 해상도, 고화질의 영상에 대한 압축기술이 요구되고 있다.Recently, as broadcasting services with high definition (HD) resolution are expanded not only domestically but also globally, many users are getting used to high-resolution and high-definition images, and many organizations are accelerating the development of next-generation video equipment. In addition, as interest in UHD (Ultra High Definition) having a resolution four times higher than that of HDTV increases along with HDTV, a compression technology for a higher resolution and higher quality image is required.

영상 압축을 위해, 시간적으로 이전 및/또는 이후의 픽쳐로부터 현재 픽쳐에 포함된 픽셀값을 예측하는 인터(inter) 예측 기술, 현재 픽쳐 내의 픽셀 정보를 이용하여 현재 픽쳐에 포함된 픽셀값을 예측하는 인트라(intra) 예측 기술, 출현 빈도가 높은 심볼(symbol)에 짧은 부호를 할당하고 출현 빈도가 낮은 심볼에 긴 부호를 할당하는 엔트로피 부호화 기술 등이 사용될 수 있다.For image compression, inter prediction technology predicts pixel values included in the current picture from temporally previous and/or subsequent pictures, and predicts pixel values included in the current picture using pixel information in the current picture. An intra prediction technique, an entropy coding technique in which short codes are assigned to symbols with a high frequency of occurrence and long codes are assigned to symbols with a low frequency of occurrence may be used.

본 발명의 기술적 과제는 영상 부호화/복호화 효율을 향상시킬 수 있는 영상 부호화 방법 및 장치를 제공함에 있다.A technical problem of the present invention is to provide an image encoding method and apparatus capable of improving image encoding/decoding efficiency.

본 발명의 다른 기술적 과제는 영상 부호화/복호화 효율을 향상시킬 수 있는 영상 복호화 방법 및 장치를 제공함에 있다.Another technical problem of the present invention is to provide an image decoding method and apparatus capable of improving image encoding/decoding efficiency.

본 발명의 또 다른 기술적 과제는 영상 부호화/복호화 효율을 향상시킬 수 있는 인트라 예측 방법 및 장치를 제공함에 있다.Another technical problem of the present invention is to provide an intra prediction method and apparatus capable of improving image encoding/decoding efficiency.

본 발명의 일 실시 형태는 인트라 예측 방법이다. 상기 방법은, 현재 루마 블록 내 픽셀 및 상기 현재 루마 블록 주변에 위치한 주변 루마 픽셀을 기반으로, 루마 참조 블록 내 픽셀 및 상기 루마 참조 블록 주변에 위치한 주변 루마 참조 픽셀을 포함한 루마 참조 정보를 생성하는 단계, 상기 주변 루마 참조 픽셀 및 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀에 대응되는 제1 주변 크로마 픽셀을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계 및 상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계를 포함할 수 있다. 여기서, 상기 루마 참조 정보 생성 단계에서는, 상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 픽셀에 대응되는 제2 주변 크로마 픽셀이 가용한지 여부에 따라 상기 주변 루마 픽셀이 가용한지 여부를 결정하고, 상기 주변 루마 픽셀이 가용한지 여부에 따라 상기 주변 루마 픽셀의 픽셀 값을 결정할 수 있다.One embodiment of the present invention is an intra prediction method. The method includes generating luma reference information including pixels in a luma reference block and neighboring luma reference pixels located around the luma reference block, based on pixels in a current luma block and neighboring luma pixels located around the current luma block. deriving a prediction parameter for the current chroma block based on a first neighboring chroma pixel corresponding to the neighboring luma reference pixel among neighboring luma reference pixels and neighboring chroma pixels located around the current chroma block, and The method may include deriving a predicted value of a pixel in the current chroma block based on a pixel in the reference block and the prediction parameter. In the generating of the luma reference information, whether or not a neighboring luma pixel is available is determined according to whether a second neighboring chroma pixel corresponding to the neighboring luma pixel is available among neighboring chroma pixels located around the current chroma block. and determine a pixel value of the peripheral luma pixel according to whether the peripheral luma pixel is available.

상기 루마 참조 정보 생성 단계에서는, 상기 제2 주변 크로마 픽셀이 가용한 경우에 상기 주변 루마 픽셀이 가용한 것으로 결정할 수 있다.In the generating of the luma reference information, when the second peripheral chroma pixel is available, it may be determined that the peripheral luma pixel is available.

상기 제2 주변 크로마 픽셀의 위치가 [x, y]이고, 상기 x는 -1이고 상기 y는 0 내지 NU*2-1 중 하나의 값을 갖는 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [x, 2y] 또는 [x, 2y+1]일 수 있고, 상기 NU는 상기 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다.When the position of the second neighboring chroma pixel is [x, y], the x is -1 and the y has a value of one of 0 to N U *2-1, based on the second neighboring chroma pixel The location of the neighboring luma pixel for which availability is determined may be [x, 2y] or [x, 2y+1], and N U may represent the horizontal and vertical lengths of the current chroma block.

상기 제2 주변 크로마 픽셀의 위치가 [x, y]이고, 상기 y는 -1이고 상기 x는 0 내지 NU*2-1 중 하나의 값을 갖는 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [2x, y] 또는 [2x+1, y]일 수 있고, 상기 NU는 상기 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다.When the position of the second neighboring chroma pixel is [x, y], y is -1 and x has a value of one of 0 to N U *2-1, based on the second neighboring chroma pixel The location of the neighboring luma pixel for which availability is determined may be [2x, y] or [2x+1, y], and N U may indicate the horizontal and vertical lengths of the current chroma block.

상기 제2 주변 크로마 픽셀의 위치가 [-1, -1]인 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [-1, -1]일 수 있다.When the position of the second neighboring chroma pixel is [-1, -1], the position of the neighboring luma pixel whose availability is determined based on the second neighboring chroma pixel may be [-1, -1] there is.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 가용하지 않은 것으로 결정된 경우, 상기 현재 루마 블록 주변에 위치한 픽셀들 중에서 가용한 픽셀의 픽셀 값을 상기 주변 루마 픽셀에 할당할 수 있다.In the generating luma reference information, when it is determined that the neighboring luma pixel is unavailable, a pixel value of an available pixel among pixels located around the current luma block may be allocated to the neighboring luma pixel.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 상기 현재 루마 블록의 좌측에 인접하여 위치한 좌측 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀의 좌측에 인접하여 위치한 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In the luma reference information generating step, when it is determined that the peripheral luma pixel is a pixel on a left pixel line located adjacent to the left side of the current luma block and the peripheral luma pixel is available, A pixel value of a luma pixel may be determined as a pixel value of the neighboring luma pixel.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 상기 현재 루마 블록의 상단에 인접하여 위치한 상단 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In the luma reference information generating step, if it is determined that the neighboring luma pixel is a pixel on an upper pixel line positioned adjacent to an upper end of the current luma block and the neighboring luma pixel is available, a luma pixel at the same position as the neighboring luma pixel A pixel value of may be determined as a pixel value of the surrounding luma pixel.

본 발명의 다른 실시 형태는 영상 복호화 방법이다. 상기 방법은, 현재 루마 블록 내 픽셀 및 상기 현재 루마 블록 주변에 위치한 주변 루마 픽셀을 기반으로, 루마 참조 블록 내 픽셀 및 상기 루마 참조 블록 주변에 위치한 주변 루마 참조 픽셀을 포함한 루마 참조 정보를 생성하는 단계, 상기 주변 루마 참조 픽셀 및 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀에 대응되는 제1 주변 크로마 픽셀을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계, 상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출함으로써, 상기 현재 크로마 블록에 대한 예측 블록을 생성하는 단계 및 상기 예측 블록을 기반으로 상기 현재 크로마 블록에 대한 복원 블록을 생성하는 단계를 포함할 수 있다. 여기서, 상기 루마 참조 정보 생성 단계에서는, 상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 픽셀에 대응되는 제2 주변 크로마 픽셀이 가용한지 여부에 따라 상기 주변 루마 픽셀이 가용한지 여부를 결정하고, 상기 주변 루마 픽셀이 가용한지 여부에 따라 상기 주변 루마 픽셀의 픽셀 값을 결정할 수 있다.Another embodiment of the present invention is a video decoding method. The method includes generating luma reference information including pixels in a luma reference block and neighboring luma reference pixels located around the luma reference block, based on pixels in a current luma block and neighboring luma pixels located around the current luma block. deriving a prediction parameter for the current chroma block based on a first neighboring chroma pixel corresponding to the neighboring luma reference pixel among neighboring luma reference pixels and neighboring chroma pixels located around the current chroma block, generating a prediction block for the current chroma block by deriving a predicted value of a pixel in the current chroma block based on a pixel in the reference block and the prediction parameter; and generating a prediction block for the current chroma block based on the prediction block. It may include generating a restoration block. In the generating of the luma reference information, whether or not a neighboring luma pixel is available is determined according to whether a second neighboring chroma pixel corresponding to the neighboring luma pixel is available among neighboring chroma pixels located around the current chroma block. and determine a pixel value of the peripheral luma pixel according to whether the peripheral luma pixel is available.

상기 루마 참조 정보 생성 단계에서는, 상기 제2 주변 크로마 픽셀이 가용한 경우에 상기 주변 루마 픽셀이 가용한 것으로 결정할 수 있다.In the generating of the luma reference information, when the second peripheral chroma pixel is available, it may be determined that the peripheral luma pixel is available.

상기 제2 주변 크로마 픽셀의 위치가 [x, y]이고, 상기 x는 -1이고 상기 y는 0 내지 NU*2-1 중 하나의 값을 갖는 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [x, 2y] 또는 [x, 2y+1]일 수 있고, 상기 NU는 상기 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다.When the position of the second neighboring chroma pixel is [x, y], the x is -1 and the y has a value of one of 0 to N U *2-1, based on the second neighboring chroma pixel The location of the neighboring luma pixel for which availability is determined may be [x, 2y] or [x, 2y+1], and N U may represent the horizontal and vertical lengths of the current chroma block.

상기 제2 주변 크로마 픽셀의 위치가 [x, y]이고, 상기 y는 -1이고 상기 x는 0 내지 NU*2-1 중 하나의 값을 갖는 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [2x, y] 또는 [2x+1, y]일 수 있고, 상기 NU는 상기 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다.When the position of the second neighboring chroma pixel is [x, y], y is -1 and x has a value of one of 0 to N U *2-1, based on the second neighboring chroma pixel The location of the neighboring luma pixel for which availability is determined may be [2x, y] or [2x+1, y], and N U may indicate the horizontal and vertical lengths of the current chroma block.

상기 제2 주변 크로마 픽셀의 위치가 [-1, -1]인 경우, 상기 제2 주변 크로마 픽셀을 기반으로 가용한지 여부가 결정되는 상기 주변 루마 픽셀의 위치는 [-1, -1]일 수 있다.When the position of the second neighboring chroma pixel is [-1, -1], the position of the neighboring luma pixel whose availability is determined based on the second neighboring chroma pixel may be [-1, -1] there is.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 가용하지 않은 것으로 결정된 경우, 상기 현재 루마 블록 주변에 위치한 픽셀들 중에서 가용한 픽셀의 픽셀 값을 상기 주변 루마 픽셀에 할당할 수 있다.In the generating luma reference information, when it is determined that the neighboring luma pixel is unavailable, a pixel value of an available pixel among pixels located around the current luma block may be allocated to the neighboring luma pixel.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 상기 현재 루마 블록의 좌측에 인접하여 위치한 좌측 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀의 좌측에 인접하여 위치한 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In the luma reference information generating step, when it is determined that the peripheral luma pixel is a pixel on a left pixel line located adjacent to the left side of the current luma block and the peripheral luma pixel is available, A pixel value of a luma pixel may be determined as a pixel value of the neighboring luma pixel.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 상기 현재 루마 블록의 상단에 인접하여 위치한 상단 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In the luma reference information generating step, if it is determined that the neighboring luma pixel is a pixel on an upper pixel line positioned adjacent to an upper end of the current luma block and the neighboring luma pixel is available, a luma pixel at the same position as the neighboring luma pixel A pixel value of may be determined as a pixel value of the surrounding luma pixel.

본 발명에 따른 영상 부호화 방법에 의하면, 영상 부호화/복호화 효율이 향상될 수 있다.According to the video encoding method according to the present invention, video encoding/decoding efficiency can be improved.

본 발명에 따른 영상 복호화 방법에 의하면, 영상 부호화/복호화 효율이 향상될 수 있다.According to the video decoding method according to the present invention, video encoding/decoding efficiency can be improved.

본 발명에 따른 인트라 예측 방법에 의하면, 영상 부호화/복호화 효율이 향상될 수 있다.According to the intra prediction method according to the present invention, image encoding/decoding efficiency can be improved.

도 1은 본 발명이 적용되는 영상 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 2는 본 발명이 적용되는 영상 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 3은 하나의 유닛이 복수의 하위 유닛으로 분할되는 실시예를 개략적으로 나타내는 개념도이다.
도 4는 인트라 예측 모드의 예측 방향 및 각 예측 방향에 할당된 모드 값의 실시예를 도시한다.
도 5는 루마 성분을 기반으로 하여 크로마 성분에 대한 예측을 수행하는 색 성분 간 예측 방법의 일 실시예를 개략적으로 나타내는 흐름도이다.
도 6은 현재 루마 블록의 크기 및 현재 크로마 블록의 크기가 서로 다른 경우, 루마 참조 정보를 도출하는 방법의 일 실시예를 나타낸다.
도 7은 부호화 파라미터를 기반으로 루마 참조 정보를 생성하는 과정의 실시예를 개략적으로 나타내는 도면이다.
도 8은 주변 루마 픽셀들 중에서 가용하지 않은 픽셀이 존재하는 경우에 루마 참조 정보를 생성하는 과정의 실시예를 개략적으로 나타내는 도면이다.
도 9는 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 실시예를 설명하기 위한 도면이다.
도 10은 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 다른 실시예를 설명하기 위한 도면이다.
도 11은 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 또 다른 실시예를 설명하기 위한 도면이다.
도 12는 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 또 다른 실시예를 설명하기 위한 도면이다.
도 13은 제1 색 성분 블록의 크기가 제2 색 성분 블록의 크기보다 작은 경우, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.
도 14는 제1 색 성분 블록의 크기가 제2 색 성분 블록의 크기와 동일한 경우, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.
도 15는 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들의 실시예를 개략적으로 나타내는 도면이다.
도 16은 예측 파라미터를 도출하는 과정 및 현재 크로마 블록 내 픽셀들의 예측값을 도출하는 과정의 실시예를 설명하기 위한 도면이다.
도 17은 본 발명에 따른 복호화 과정의 일 실시예를 개략적으로 나타내는 흐름도이다.
도 18은 도 17의 실시예에서와 같이 복호화 과정이 수행되는 경우, 현재 크로마 블록에 대한 루마 참조 정보 및 예측 파라미터를 도출하는 과정의 실시예를 설명하기 위한 도면이다.
도 19a 및 도 19b는 본 발명에 따른 복호화 과정의 다른 실시예를 설명하기 위한 도면이다.
1 is a block diagram showing a configuration according to an embodiment of an image encoding apparatus to which the present invention is applied.
2 is a block diagram showing a configuration according to an embodiment of a video decoding apparatus to which the present invention is applied.
3 is a conceptual diagram schematically illustrating an embodiment in which one unit is divided into a plurality of sub-units.
4 shows an example of prediction directions of intra prediction modes and mode values assigned to each prediction direction.
5 is a flowchart schematically illustrating an embodiment of an inter-color component prediction method for performing prediction on a chroma component based on a luma component.
6 illustrates an embodiment of a method of deriving luma reference information when a size of a current luma block and a size of a current chroma block are different from each other.
7 is a diagram schematically illustrating an embodiment of a process of generating luma reference information based on an encoding parameter.
8 schematically illustrates an embodiment of a process of generating luma reference information when an unavailable pixel exists among neighboring luma pixels.
9 is a diagram for explaining an embodiment of a process of generating luma reference information after performing a padding process.
10 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.
11 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.
12 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.
13 is a diagram schematically illustrating an embodiment of a process of deriving first color component reference information to be used for prediction of a second color component block when the size of the first color component block is smaller than the size of the second color component block. .
14 is a diagram schematically illustrating an embodiment of a process of deriving first color component reference information to be used for prediction of a second color component block when the size of the first color component block is the same as that of the second color component block. .
15 is a diagram schematically illustrating an example of peripheral luma pixels used to generate luma reference information.
16 is a diagram for explaining an embodiment of a process of deriving prediction parameters and a process of deriving predictive values of pixels in a current chroma block.
17 is a flowchart schematically illustrating an embodiment of a decryption process according to the present invention.
FIG. 18 is a diagram for explaining an embodiment of a process of deriving luma reference information and prediction parameters for a current chroma block when a decoding process is performed as in the embodiment of FIG. 17 .
19A and 19B are diagrams for explaining another embodiment of a decoding process according to the present invention.

이하, 도면을 참조하여 본 발명의 실시 형태에 대하여 구체적으로 설명한다. 본 명세서의 실시예를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.EMBODIMENT OF THE INVENTION Hereinafter, embodiment of this invention is described concretely with reference to drawings. In describing the embodiments of the present specification, if it is determined that a detailed description of a related known configuration or function may obscure the gist of the present specification, the detailed description thereof will be omitted.

어떤 구성 요소가 다른 구성 요소에 “연결되어” 있다거나 “접속되어” 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 아울러, 본 발명에서 특정 구성을 “포함”한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다. It is understood that when a component is referred to as “connected” or “connected” to another component, it may be directly connected or connected to the other component, but other components may exist in the middle. It should be. In addition, the description of "including" a specific configuration in the present invention does not exclude configurations other than the corresponding configuration, and means that additional configurations may be included in the practice of the present invention or the scope of the technical spirit of the present invention.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. These terms are only used for the purpose of distinguishing one component from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element, without departing from the scope of the present invention.

또한 본 발명의 실시예에 나타나는 구성부들은 서로 다른 특징적인 기능들을 나타내기 위해 독립적으로 도시되는 것으로, 각 구성부들이 분리된 하드웨어나 하나의 소프트웨어 구성단위로 이루어짐을 의미하지 않는다. 즉, 각 구성부는 설명의 편의상 각각의 구성부로 나열하여 포함한 것으로 각 구성부 중 적어도 두 개의 구성부가 합쳐져 하나의 구성부로 이루어지거나, 하나의 구성부가 복수 개의 구성부로 나뉘어져 기능을 수행할 수 있고 이러한 각 구성부의 통합된 실시예 및 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.In addition, components appearing in the embodiments of the present invention are shown independently to represent different characteristic functions, and do not mean that each component is made of separate hardware or a single software component unit. That is, each component is listed and included as each component for convenience of explanation, and at least two components of each component can be combined to form a single component, or one component can be divided into a plurality of components to perform a function, and each of these components can be divided into a plurality of components. Integrated embodiments and separated embodiments of components are also included in the scope of the present invention as long as they do not depart from the essence of the present invention.

또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.In addition, some of the components may be optional components for improving performance rather than essential components that perform essential functions in the present invention. The present invention can be implemented by including only components essential to implement the essence of the present invention, excluding components used for performance improvement, and a structure including only essential components excluding optional components used for performance improvement. Also included in the scope of the present invention.

도 1은 본 발명이 적용되는 영상 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.1 is a block diagram showing a configuration according to an embodiment of an image encoding apparatus to which the present invention is applied.

도 1을 참조하면, 상기 영상 부호화 장치(100)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽쳐 버퍼(190)를 포함한다. Referring to FIG. 1 , the video encoding apparatus 100 includes a motion estimation unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, and a transform unit 130. , a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.

영상 부호화 장치(100)는 입력 영상에 대해 인트라(intra) 모드 또는 인터(inter) 모드로 부호화를 수행하고 비트스트림을 출력할 수 있다. 인트라 예측은 화면 내 예측, 인터 예측은 화면 간 예측을 의미한다. 인트라 모드인 경우 스위치(115)가 인트라로 전환되고, 인터 모드인 경우 스위치(115)가 인터로 전환될 수 있다. 영상 부호화 장치(100)는 입력 영상의 입력 블록에 대한 예측 블록을 생성한 후, 입력 블록과 예측 블록의 차분(residual)을 부호화할 수 있다.The image encoding apparatus 100 may encode an input image in an intra mode or an inter mode and output a bitstream. Intra prediction means prediction within a picture, and inter prediction means prediction between pictures. In the case of the intra mode, the switch 115 may be switched to the intra mode, and in the case of the inter mode, the switch 115 may be switched to the inter mode. After generating a prediction block for an input block of an input image, the image encoding apparatus 100 may encode a residual between the input block and the prediction block.

인트라 모드인 경우, 인트라 예측부(120)는 현재 블록 주변의 이미 부호화된 블록의 픽셀값을 이용하여 공간적 예측을 수행하여 예측 블록을 생성할 수 있다.In the case of the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values of previously encoded blocks adjacent to the current block.

인터 모드인 경우, 움직임 예측부(111)는, 움직임 예측 과정에서 참조 픽쳐 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. 여기서, 움직임 벡터는 인터 예측에 사용되는 2차원 벡터이며, 현재 부호화/복호화 대상 영상과 참조 영상 사이의 오프셋을 나타낼 수 있다.In the case of the inter mode, the motion estimation unit 111 may obtain a motion vector by finding a region that best matches the input block in the reference picture stored in the reference picture buffer 190 during the motion prediction process. The motion compensator 112 may generate a prediction block by performing motion compensation using a motion vector. Here, the motion vector is a 2D vector used for inter prediction, and may represent an offset between a current encoding/decoding target image and a reference image.

인트라 예측부(120), 움직임 예측부(111) 및/또는 움직임 보상부(112)의 예측 과정에서 예측 방법이나 예측 모드가 정해지는 처리 단위 및 예측이 수행되는 처리 단위는 동일할 수도 있으나 서로 다를 수도 있다. 일례로, 예측 방법이 정해지는 처리 단위가 PU일 때 예측이 수행되는 처리 단위는 TU일 수도 있다.In the prediction process of the intra prediction unit 120, the motion prediction unit 111, and/or the motion compensation unit 112, the processing unit for which the prediction method or prediction mode is determined and the processing unit in which prediction is performed may be the same, but may be different from each other. may be For example, when a processing unit for which a prediction method is determined is a PU, a processing unit for which prediction is performed may be a TU.

감산기(125)는 입력 블록과 생성된 예측 블록의 차분에 의해 잔차 블록(residual block)을 생성할 수 있다. 변환부(130)는 잔차 블록에 대해 변환(transform)을 수행하여 변환 계수(transform coefficient)를 출력할 수 있다. 그리고 양자화부(140)는 입력된 변환 계수를 양자화 파라미터에 따라 양자화하여 양자화된 계수(quantized coefficient)를 출력할 수 있다. The subtractor 125 may generate a residual block by a difference between the input block and the generated prediction block. The transform unit 130 may output a transform coefficient by performing transform on the residual block. The quantization unit 140 may quantize the input transform coefficient according to a quantization parameter and output a quantized coefficient.

엔트로피 부호화부(150)는, 양자화부(140)에서 산출된 값들 또는 부호화 과정에서 산출된 부호화 파라미터 값 등을 기초로 엔트로피 부호화를 수행하여 비트스트림(bit stream)을 출력할 수 있다. The entropy encoding unit 150 may output a bit stream by performing entropy encoding based on the values calculated by the quantization unit 140 or the encoding parameter values calculated in the encoding process.

엔트로피 부호화가 적용되는 경우, 높은 발생 확률을 갖는 심볼(symbol)에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 부호화 대상 심볼들에 대한 비트열의 크기가 감소될 수 있다. 따라서 엔트로피 부호화를 통해서 영상 부호화의 압축 성능이 높아질 수 있다. 엔트로피 부호화부(150)는 엔트로피 부호화를 위해 지수 골룸(exponential golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 부호화 방법을 사용할 수 있다. When entropy encoding is applied, a small number of bits are allocated to a symbol with a high probability of occurrence and a large number of bits are allocated to a symbol with a low probability of occurrence to represent the symbol, thereby reducing the number of bits for symbols to be coded. The size of the column may be reduced. Therefore, compression performance of image encoding can be improved through entropy encoding. The entropy encoding unit 150 may use an encoding method such as exponential golomb, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC) for entropy encoding.

도 1의 실시예에 따른 영상 부호화 장치는 인터 예측 부호화, 즉 화면 간 예측 부호화를 수행하므로, 현재 부호화된 영상은 참조 영상으로 사용되기 위해 복호화되어 저장될 필요가 있다. 따라서 양자화된 계수는 역양자화부(160)에서 역양자화되고 역변환부(170)에서 역변환된다. 역양자화, 역변환된 계수는 가산기(175)를 통해 예측 블록과 더해지고 복원 블록이 생성된다. Since the video encoding apparatus according to the embodiment of FIG. 1 performs inter-prediction encoding, that is, inter-prediction encoding, a currently encoded video needs to be decoded and stored in order to be used as a reference video. Therefore, the quantized coefficient is inversely quantized in the inverse quantization unit 160 and inversely transformed in the inverse transformation unit 170. The inverse quantized and inverse transformed coefficients are added to the prediction block through an adder 175, and a reconstructed block is generated.

복원 블록은 필터부(180)를 거치고, 필터부(180)는 디블록킹 필터(deblocking filter), SAO(Sample Adaptive Offset), ALF(Adaptive Loop Filter) 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(180)는 적응적 인루프(in-loop) 필터로 불릴 수도 있다. 디블록킹 필터는 블록 간의 경계에 생긴 블록 왜곡을 제거할 수 있다. SAO는 코딩 에러를 보상하기 위해 픽셀값에 적정 오프셋(offset) 값을 더해줄 수 있다. ALF는 복원된 영상과 원래의 영상을 비교한 값을 기초로 필터링을 수행할 수 있다. 필터부(180)를 거친 복원 블록은 참조 픽쳐 버퍼(190)에 저장될 수 있다.The reconstructed block passes through a filter unit 180, and the filter unit 180 applies at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. can do. The filter unit 180 may also be called an adaptive in-loop filter. The deblocking filter may remove block distortion generated at a boundary between blocks. SAO may add an appropriate offset value to a pixel value to compensate for a coding error. ALF may perform filtering based on a value obtained by comparing a reconstructed image with an original image. A reconstructed block that has passed through the filter unit 180 may be stored in the reference picture buffer 190 .

도 2는 본 발명이 적용되는 영상 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.2 is a block diagram showing a configuration according to an embodiment of a video decoding apparatus to which the present invention is applied.

도 2를 참조하면, 상기 영상 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽쳐 버퍼(270)를 포함한다.Referring to FIG. 2 , the image decoding apparatus 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder ( 255), a filter unit 260, and a reference picture buffer 270.

영상 복호화 장치(200)는 부호화기에서 출력된 비트스트림을 입력 받아 인트라 모드 또는 인터 모드로 복호화를 수행하고 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 인트라 모드인 경우 스위치가 인트라로 전환되고, 인터 모드인 경우 스위치가 인터로 전환될 수 있다. 영상 복호화 장치(200)는 입력 받은 비트스트림으로부터 잔차 블록(residual block)을 얻고 예측 블록을 생성한 후 잔차 블록과 예측 블록을 더하여 재구성된 블록, 즉 복원 블록을 생성할 수 있다.The image decoding apparatus 200 may receive the bitstream output from the encoder, perform decoding in an intra mode or inter mode, and output a reconstructed image, that is, a reconstructed image. In the intra mode, the switch may be converted to intra, and in the case of the inter mode, the switch may be converted to inter. The image decoding apparatus 200 may generate a reconstructed block, that is, a reconstructed block, by obtaining a residual block from the input bitstream, generating a prediction block, and then adding the residual block and the prediction block.

엔트로피 복호화부(210)는, 입력된 비트스트림을 확률 분포에 따라 엔트로피 복호화하여, 양자화된 계수(quantized coefficient) 형태의 심볼을 포함한 심볼들을 생성할 수 있다. 엔트로피 복호화 방법은 상술한 엔트로피 부호화 방법과 유사하다.The entropy decoding unit 210 may generate symbols including symbols in the form of quantized coefficients by entropy decoding the input bitstream according to a probability distribution. The entropy decoding method is similar to the entropy encoding method described above.

엔트로피 복호화 방법이 적용되는 경우, 높은 발생 확률을 갖는 심볼에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 각 심볼들에 대한 비트열의 크기가 감소될 수 있다. 따라서 엔트로피 복호화 방법을 통해서 영상 복호화의 압축 성능이 높아질 수 있다. When the entropy decoding method is applied, a small number of bits are allocated to a symbol with a high probability of occurrence and a large number of bits are allocated to a symbol with a low probability of occurrence to express the symbol, thereby increasing the size of the bit stream for each symbol. can be reduced Therefore, compression performance of image decoding may be improved through the entropy decoding method.

양자화된 계수는 역양자화부(220)에서 역양자화되고 역변환부(230)에서 역변환되며, 양자화된 계수가 역양자화/역변환 된 결과, 잔차 블록(residual block)이 생성될 수 있다. The quantized coefficient is inversely quantized in the inverse quantization unit 220 and inversely transformed in the inverse transform unit 230, and as a result of inverse quantization/inverse transformation of the quantized coefficient, a residual block may be generated.

인트라 모드인 경우, 인트라 예측부(240)는 현재 블록 주변의 이미 부호화된 블록의 픽셀값을 이용하여 공간적 예측을 수행하여 예측 블록을 생성할 수 있다. 인터 모드인 경우, 움직임 보상부(250)는 움직임 벡터 및 참조 픽쳐 버퍼(270)에 저장되어 있는 참조 영상을 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. In the case of the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of previously encoded blocks adjacent to the current block. In the case of the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

인트라 예측부(240) 및/또는 움직임 보상부(250)에서의 예측 과정에서 예측 방법이나 예측 모드가 정해지는 처리 단위 및 예측이 수행되는 처리 단위는 동일할 수도 있으나 서로 다를 수도 있다. 일례로, 예측 방법이 정해지는 처리 단위가 PU일 때 예측이 수행되는 처리 단위는 TU일 수도 있다.In the prediction process of the intra prediction unit 240 and/or the motion compensation unit 250, a processing unit in which a prediction method or prediction mode is determined and a processing unit in which prediction is performed may be the same or may be different from each other. For example, when a processing unit for which a prediction method is determined is a PU, a processing unit for which prediction is performed may be a TU.

잔차 블록과 예측 블록은 가산기(255)를 통해 더해지고, 더해진 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO, ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(260)는 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽쳐 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The residual block and the prediction block are added through the adder 255, and the added block may pass through the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to a reconstructed block or a reconstructed picture. The filter unit 260 may output a reconstructed image, that is, a restored image. The reconstructed image may be stored in the reference picture buffer 270 and used for inter prediction.

이하, 유닛(unit)은 영상 부호화 및 복호화의 단위를 의미할 수 있다. 영상 부호화 및 복호화 시 부호화 혹은 복호화 단위는, 영상을 분할하여 부호화 혹은 복호화 할 때 그 분할된 단위를 의미하므로, 부호화 유닛 (CU: Coding Unit), 예측 유닛 (PU: Prediction Unit), 변환 유닛(TU: Transform Unit) 등으로 불릴 수 있다. 또한, 후술되는 실시예들에서 유닛은 블록으로도 지칭될 수 있다. 하나의 유닛은 크기가 더 작은 하위 유닛으로 더 분할될 수 있다. Hereinafter, a unit may mean a unit of image encoding and decoding. When encoding and decoding an image, the encoding or decoding unit refers to the divided unit when encoding or decoding an image by dividing it, such as a coding unit (CU), a prediction unit (PU), and a transform unit (TU). : Transform Unit). Also, in embodiments described below, a unit may also be referred to as a block. One unit can be further divided into sub-units of smaller size.

도 3은 하나의 유닛이 복수의 하위 유닛으로 분할되는 실시예를 개략적으로 나타내는 개념도이다. 3 is a conceptual diagram schematically illustrating an embodiment in which one unit is divided into a plurality of sub-units.

하나의 유닛은 트리 구조(tree structure)를 기초로 깊이 정보(depth)를 가지고 계층적으로 분할될 수 있다. 각각의 분할된 하위 유닛은 깊이 정보를 가질 수 있다. 상기 깊이 정보는 유닛이 분할된 회수 및/또는 정도를 나타내므로, 상기 하위 유닛의 크기에 관한 정보를 포함할 수도 있다.One unit may be hierarchically divided with depth information based on a tree structure. Each divided sub-unit may have depth information. Since the depth information indicates the number and/or degree of division of the unit, it may include information about the size of the sub-unit.

도 3의 310은 하나의 유닛이 복수의 하위 유닛으로 분할되는 트리 구조의 실시예를 도시한다. 또한, 도 3의 320은 복수의 하위 유닛으로 분할되는 유닛의 실시예를 도시한다. 도 3의 320에 도시된 유닛은 일례로 CU이거나 TU일 수 있다.310 of FIG. 3 shows an embodiment of a tree structure in which one unit is divided into a plurality of sub-units. Also, 320 in FIG. 3 shows an embodiment of a unit that is divided into a plurality of sub-units. The unit shown in 320 of FIG. 3 may be, for example, a CU or a TU.

도 3의 310을 참조하면, 가장 상위 노드는 루트 노드(root node)로 불릴 수 있고, 가장 작은 깊이 값을 가질 수 있다. 이 때, 가장 상위 노드는 레벨 0의 깊이를 가질 수 있으며, 분할되지 않은 최초의 유닛을 나타낼 수 있다. Referring to 310 of FIG. 3 , the highest node may be referred to as a root node and may have the smallest depth value. At this time, the highest node may have a depth of level 0 and may represent the first undivided unit.

레벨 1의 깊이를 갖는 하위 노드는 최초 유닛이 한 번 분할된 유닛을 나타낼 수 있으며, 레벨 2의 깊이를 갖는 하위 노드는 최초의 유닛이 두 번 분할된 유닛을 나타낼 수 있다. 예를 들어, 도 3의 320에서 노드 a에 대응하는 유닛 a는 최초 유닛에서 한 번 분할된 유닛이고, 레벨 1의 깊이를 가질 수 있다.A lower node having a depth of level 1 may represent a unit in which the first unit is divided once, and a lower node having a depth of level 2 may represent a unit in which the first unit is divided twice. For example, unit a corresponding to node a in 320 of FIG. 3 is a unit divided once from an initial unit and may have a depth of level 1.

레벨 3의 리프 노드(leaf node)는 최초 유닛이 3번 분할된 유닛을 나타낼 수 있다. 예를 들어, 도3의 320에서 노드 d에 대응하는 유닛 d는 최초 유닛에서 세 번 분할된 유닛이고, 레벨 3의 깊이를 가질 수 있다. 따라서, 가장 하위 노드인 레벨 3의 리프 노드는 가장 깊은 깊이를 가질 수 있다.A leaf node of level 3 may represent a unit in which the initial unit is divided 3 times. For example, unit d corresponding to node d in 320 of FIG. 3 is a unit divided three times from an initial unit and may have a depth of level 3. Accordingly, a leaf node of level 3, which is the lowest node, may have the deepest depth.

이하, 후술되는 실시예들에서 부호화/복호화 대상 블록은 경우에 따라 현재 블록으로 지칭될 수도 있다. 또한 부호화/복호화 대상 블록에 대해 인트라 예측이 수행되는 경우, 상기 부호화/복호화 대상 블록은 예측 대상 블록으로 불릴 수도 있다. Hereinafter, in embodiments to be described later, an encoding/decoding target block may be referred to as a current block in some cases. Also, when intra prediction is performed on an encoding/decoding object block, the encoding/decoding object block may be referred to as a prediction object block.

한편, 영상 신호는 색 공간(color space)을 이루는 구성 요소인 색 성분들(color components)로 구성될 수 있다. 일례로, 영상 신호는 일반적으로 빛의 3원색 성분을 나타내는 세 가지의 색 성분을 포함할 수 있다. 빛의 3원색 성분을 나타내는 세 가지의 색 성분은 R(Red), G(Green), B(Blue)로 나타내어질 수 있다. 상기 R, G, B 신호는 영상 처리를 위해 사용되는 주파수 대역을 감소시키기 위해 하나의 루마(luma) 성분 및 두 개의 크로마(chroma) 성분으로 변환될 수 있다. 이 때, 하나의 영상 신호는 하나의 루마 성분과 두 개의 크로마 성분을 포함할 수 있다. 여기서, 루마 성분은 화면의 밝기를 나타내는 성분으로 Y로 나타내어질 수 있다. 또한, 두 개의 크로마 성분은 화면의 색(color)을 나타내는 성분으로 U, V 또는 Cb, Cr로 나타내어질 수 있다. 따라서, 영상의 색 공간은 일례로 YUV로 나타내어지거나 YCbCr로 나타내어질 수 있다. 이하, 후술되는 실시예들에서 루마 성분을 갖는 블록은 루마 블록, 크로마 성분을 갖는 블록은 크로마 블록으로 지칭될 수 있다.Meanwhile, an image signal may be composed of color components that form a color space. For example, an image signal may generally include three color components representing three primary color components of light. Three color components representing the three primary color components of light can be represented by R (Red), G (Green), and B (Blue). The R, G, and B signals may be converted into one luma component and two chroma components in order to reduce a frequency band used for image processing. In this case, one image signal may include one luma component and two chroma components. Here, the luma component is a component representing the brightness of the screen and may be represented by Y. In addition, the two chroma components are components representing the color of the screen and may be represented by U, V, Cb, or Cr. Accordingly, the color space of the image may be expressed as YUV or YCbCr, for example. Hereinafter, in embodiments to be described later, a block having a luma component may be referred to as a luma block, and a block having a chroma component may be referred to as a chroma block.

인간의 눈은 루마 성분 신호에 대해서 민감하고 크로마 성분 신호에 대해서 둔감한 특성을 가진다. 이러한 특성을 이용하여 R, G, B 신호가 루마 신호 및 크로마 신호로 변환되는 경우, 영상 처리에 사용되는 주파수 대역이 감소될 수 있다. 또한, 이러한 특성에 의해 하나의 영상 또는 블록 내에서 크로마 성분의 픽셀 수가 루마 성분의 픽셀 수보다 작을 수 있다. Human eyes are sensitive to luma component signals and insensitive to chroma component signals. When R, G, and B signals are converted into luma and chroma signals using these characteristics, a frequency band used for image processing can be reduced. Also, due to this characteristic, the number of pixels of a chroma component within one image or block may be smaller than the number of pixels of a luma component.

예를 들어, 4:2:0 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 픽셀 수는 루마 블록의 수평 방향 픽셀 수의 1/2이고, 루마 블록에 대응되는 크로마 블록의 수직 방향 픽셀 수는 루마 블록의 수직 방향 픽셀 수의 1/2에 해당될 수 있다. 4:2:2 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 픽셀 수는 루마 블록의 수평 방향 픽셀 수의 1/2이고, 루마 블록에 대응되는 크로마 블록의 수직 방향 픽셀 수는 루마 블록의 수직 방향 픽셀 수와 동일할 수 있다. 4:4:4 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 및 수직 방향 픽셀 수는 각각 루마 블록의 수평 방향 및 수직 방향 픽셀 수와 동일할 수 있다.For example, in the 4:2:0 video format, the number of horizontal pixels of a chroma block corresponding to a luma block is 1/2 of the number of horizontal pixels of a luma block, and the vertical pixels of a chroma block corresponding to a luma block. The number may correspond to 1/2 of the number of pixels in the vertical direction of the luma block. In the 4:2:2 video format, the number of pixels in the horizontal direction of a chroma block corresponding to a luma block is 1/2 of the number of pixels in the horizontal direction of a luma block, and the number of pixels in the vertical direction of a chroma block corresponding to a luma block is 1/2 of the number of pixels in the horizontal direction of a luma block. may be equal to the number of pixels in the vertical direction of In the 4:4:4 video format, the number of pixels in the horizontal and vertical directions of a chroma block corresponding to a luma block may be equal to the number of pixels in the horizontal and vertical directions of the luma block, respectively.

한편, 인트라 예측은 현재 블록의 인트라 예측 모드에 따라 수행될 수 있다. 현재 블록의 인트라 예측 모드는 인접한 주변 블록(neighboring block)의 예측 모드와 상관성이 크기 때문에, 현재 블록 블록에 인접한 주변 블록의 예측 모드를 기반으로 현재 블록의 예측 모드가 부호화될 수 있다. 이 때, 현재 블록에 대한 MPM(Most Probable Mode)이 이용될 수도 있다.Meanwhile, intra prediction may be performed according to the intra prediction mode of the current block. Since the intra prediction mode of the current block has a high correlation with the prediction modes of neighboring blocks, the prediction mode of the current block may be encoded based on the prediction modes of the neighboring blocks of the current block. At this time, the most probable mode (MPM) for the current block may be used.

도 4는 인트라 예측 모드의 예측 방향 및 각 예측 방향에 할당된 모드 값의 실시예를 도시한다. 이하, 본 명세서에서 픽셀은 샘플과 동일한 의미를 가질 수 있으며, 후술되는 실시예들에서 픽셀은 경우에 따라 샘플로 지칭될 수도 있다.4 shows an example of prediction directions of intra prediction modes and mode values assigned to each prediction direction. Hereinafter, in this specification, a pixel may have the same meaning as a sample, and in embodiments to be described later, a pixel may be referred to as a sample in some cases.

도 1 및 도 2의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 현재 픽쳐 내의 픽셀 정보를 기초로 인트라 예측을 수행하여 예측 블록을 생성할 수 있다. 즉, 인트라 예측 수행 시에 부호화기 및 복호화기는 적어도 하나의 복원된 참조 픽셀을 기반으로 방향성 예측 및/또는 비방향성 예측을 수행할 수 있다. 여기서, 예측 블록은 인트라 예측 수행 결과 생성된 블록을 의미할 수 있다. 상기 예측 블록은 부호화 유닛(CU), 예측 유닛(PU) 및 변환 유닛(TU) 중에서 적어도 하나에 해당될 수 있다.As described above in the embodiments of FIGS. 1 and 2 , the encoder and decoder may generate a prediction block by performing intra prediction based on pixel information in the current picture. That is, when performing intra prediction, the encoder and decoder may perform directional prediction and/or non-directional prediction based on at least one reconstructed reference pixel. Here, the prediction block may refer to a block generated as a result of performing intra prediction. The prediction block may correspond to at least one of a coding unit (CU), a prediction unit (PU), and a transform unit (TU).

상술한 바와 같이 인트라 예측은 현재 블록의 인트라 예측 모드에 따라 수행될 수 있다. 현재 블록이 가질 수 있는 인트라 예측 모드의 개수는 소정의 고정된 값일 수 있으며, 예측 블록의 크기에 따라 다르게 결정되는 값일 수도 있다. 일례로, 현재 블록이 가질 수 있는 인트라 예측 모드의 개수는 35 또는 36일 수 있다.As described above, intra prediction may be performed according to the intra prediction mode of the current block. The number of intra prediction modes that the current block may have may be a predetermined fixed value or may be a value determined differently depending on the size of the prediction block. For example, the number of intra prediction modes that the current block may have may be 35 or 36.

도 4의 410을 참조하면, 예를 들어, 모드 값이 1인 수직 모드의 경우 참조 픽셀의 픽셀 값을 기반으로 수직 방향으로 예측이 수행될 수 있고, 모드 값이 2인 수평 모드의 경우 참조 픽셀의 픽셀 값을 기반으로 수평 방향으로 예측이 수행될 수 있다. 상술한 모드 이외의 방향성 모드의 경우에도, 부호화기 및 복호화기는 해당 각도에 따라 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다.Referring to 410 of FIG. 4 , for example, in the vertical mode where the mode value is 1, prediction may be performed in the vertical direction based on the pixel value of the reference pixel, and in the case of the horizontal mode where the mode value is 2, the reference pixel Prediction may be performed in a horizontal direction based on a pixel value of . Even in the case of a directional mode other than the above-described mode, the encoder and the decoder may perform intra prediction using a reference pixel according to a corresponding angle.

도 4의 410에서 0의 모드 값을 갖는 예측 모드는 플래너(planar) 모드로 불릴 수 있고, 3의 모드 값을 갖는 예측 모드는 DC 모드로 불릴 수 있다. 상기 플래너 모드(예컨대, Intra_Planar) 및 DC 모드(예컨대, Intra_DC)는 비방향성 모드에 해당될 수 있다. 예를 들어, DC 모드의 경우, 복수의 참조 픽셀의 픽셀 값 평균에 의해 예측 블록이 생성될 수 있다. 플래너 모드에서는 예측 대상 픽셀의 위치를 기반으로 상기 예측 대상 픽셀의 예측에 사용될 참조 픽셀의 위치가 결정될 수 있고, 결정된 위치에 존재하는 참조 픽셀을 기반으로 예측 대상 픽셀의 예측 값이 도출될 수 있다.In 410 of FIG. 4 , a prediction mode having a mode value of 0 may be referred to as a planar mode, and a prediction mode having a mode value of 3 may be referred to as a DC mode. The planar mode (eg, Intra_Planar) and the DC mode (eg, Intra_DC) may correspond to non-directional modes. For example, in the DC mode, a prediction block may be generated by averaging pixel values of a plurality of reference pixels. In the planner mode, the position of a reference pixel to be used for prediction of the target pixel may be determined based on the position of the target pixel to be predicted, and the predicted value of the target pixel may be derived based on the reference pixel existing at the determined position.

또한, 도 4의 410에서 35의 모드 값을 갖는 예측 모드는 LM 모드(예컨대, Intra_FromLuma)로 불릴 수 있다. LM 모드는 루마 성분(예컨대, Y)의 픽셀 값에 따라 크로마 성분(예컨대, U 또는 V) 픽셀의 예측 값이 결정되는 예측 모드를 의미할 수 있다. LM 모드에서의 인트라 예측에 대한 구체적인 실시예는 후술하기로 한다.Also, a prediction mode having a mode value of 35 in 410 of FIG. 4 may be called an LM mode (eg, Intra_FromLuma). The LM mode may refer to a prediction mode in which a prediction value of a pixel of a chroma component (eg, U or V) is determined according to a pixel value of a luma component (eg, Y). A specific embodiment of intra prediction in LM mode will be described later.

인트라 예측 모드의 개수 및/또는 각각의 인트라 예측 모드에 할당되는 모드값은 상술한 실시예에 한정되지 않으며, 구현 및/또는 필요에 따라 다르게 정해질 수도 있다. 예를 들어, 인트라 예측 모드의 예측 방향 및 각 예측 모드에 할당되는 모드값은 도 4의 420에서와 같이 도 4의 410과 다르게 정해질 수도 있다. 또한, 일례로 도 4의 420의 실시예에서도 도 4의 410에서와 같이 LM 모드가 적용될 수 있다. 이 경우 LM 모드에는 35의 모드 값이 할당될 수 있다. 이하, 후술되는 실시예들에서는 설명의 편의상 다른 언급이 없는 경우에는 도 4의 410에서와 같은 인트라 예측 모드에 기반하여 인트라 예측이 수행되는 것으로 가정한다. The number of intra prediction modes and/or the mode value assigned to each intra prediction mode is not limited to the above-described embodiment, and may be determined differently according to implementation and/or needs. For example, a prediction direction of an intra prediction mode and a mode value assigned to each prediction mode may be determined differently from 410 of FIG. 4 as in 420 of FIG. 4 . Also, as an example, the LM mode may be applied to the embodiment of 420 of FIG. 4 as in 410 of FIG. 4 . In this case, a mode value of 35 may be assigned to the LM mode. Hereinafter, in embodiments to be described later, for convenience of description, it is assumed that intra prediction is performed based on the intra prediction mode as shown in 410 of FIG. 4 unless otherwise specified.

한편, 영상 내의 루마 성분과 크로마 성분은 상관성을 가지므로, 크로마 성분의 예측 모드는 대응되는 루마 성분의 예측 모드를 기반으로 부호화될 수 있으며, 복호화기는 루마 성분의 예측 모드를 기반으로 크로마 성분의 예측 모드를 도출할 수 있다. 따라서, 부호화기에서 복호화기로 전송되는 크로마 성분의 예측 모드 정보는 크로마 성분의 예측 모드 자체가 아니라 루마 성분의 예측 모드와의 관계에서 크로마 성분의 예측 모드를 도출하는 데 이용되는 별도의 값일 수 있다. 다음 표 1은 루마 성분의 예측 모드와 전송되는 값에 따라 결정되는 크로마 예측 모드의 일 실시예를 나타낸다.Meanwhile, since the luma component and the chroma component in the image have a correlation, the prediction mode of the chroma component can be encoded based on the prediction mode of the corresponding luma component, and the decoder predicts the chroma component based on the prediction mode of the luma component. mode can be derived. Accordingly, the prediction mode information of the chroma component transmitted from the encoder to the decoder may be a separate value used to derive the prediction mode of the chroma component in relation to the prediction mode of the luma component, rather than the prediction mode of the chroma component itself. Table 1 below shows an embodiment of a chroma prediction mode determined according to a prediction mode of a luma component and a transmitted value.

[표 1][Table 1]

Figure pat00001
Figure pat00001

표 1을 참조하면, 부호화기에서 복호화기로 전송되는 값은 intra_chroma_pred_mode에 할당된 값일 수 있다. IntraPredMode는 루마 성분의 인트라 예측 모드를 나타낸다. 예를 들어, intra_chroma_pred_mode 값이 2이고 IntraPredMode의 값이 26인 경우, 크로마 성분의 인트라 예측 모드 값은 10일 수 있다. 상기 intra_chroma_pred_mode 및 IntraPredMode는 그 명칭에 한정되는 것은 아니다. 또한, 각각의 예측 모드에 할당되는 값들은 하나의 실시예로서 구현 및/또는 필요에 따라 다르게 정해질 수도 있다.Referring to Table 1, a value transmitted from an encoder to a decoder may be a value assigned to intra_chroma_pred_mode. IntraPredMode represents an intra prediction mode of a luma component. For example, when the intra_chroma_pred_mode value is 2 and the value of IntraPredMode is 26, the intra prediction mode value of the chroma component may be 10. The intra_chroma_pred_mode and IntraPredMode are not limited to their names. In addition, values assigned to each prediction mode may be determined differently according to implementation and/or needs as an example.

표 1의 실시예에서 intra_chroma_pred_mode의 값이 4일 때에 크로마 성분의 예측 모드는 LM모드로 불릴 수 있고, intra_chroma_pred_mode의 값이 5일 때에 크로마 성분의 예측 모드는 DM모드로 불릴 수 있다. LM 모드는 루마 성분의 픽셀값에 따라 크로마 성분 픽셀의 예측값이 결정되는 예측 모드이고, DM 모드는 루마 성분의 예측 모드가 그대로 크로마 성분의 예측 모드로 사용되는 예측 모드이다.In the example of Table 1, when the value of intra_chroma_pred_mode is 4, the prediction mode of chroma components may be called LM mode, and when the value of intra_chroma_pred_mode is 5, the prediction mode of chroma components may be called DM mode. The LM mode is a prediction mode in which a predicted value of a chroma component pixel is determined according to a pixel value of a luma component, and a DM mode is a prediction mode in which a prediction mode of a luma component is used as a prediction mode of a chroma component.

또한, 부호화기는 현재 시퀀스 내에서 크로마 성분의 예측 모드에 따라 LM 모드가 적용되는지, 즉 현재 시퀀스 내에서 크로마 성분의 인트라 예측에 LM 모드가 적용될 수 있는지 여부를 지시하는 LM 플래그 정보를 부호화하여 복호화기로 전송할 수 있다. LM 플래그 정보는 일례로 chroma_pred_from_luma_enabled_flag라는 구문 요소(syntax element)를 통해 복호화기로 전송될 수 있다. 예를 들어, chroma_pred_from_luma_enabled_flag에 1이 할당된 경우 상기 플래그는 크로마 성분의 인트라 예측에 LM 모드가 이용될 수 있음을 지시할 수 있다. 또한, chroma_pred_from_luma_enabled_flag에 0이 할당된 경우 상기 플래그는 크로마 성분의 인트라 예측에 LM 모드가 이용되지 않음을 지시할 수 있다.In addition, the encoder encodes LM flag information indicating whether the LM mode is applied according to the prediction mode of chroma components in the current sequence, that is, whether the LM mode can be applied to intra prediction of chroma components in the current sequence, and can transmit The LM flag information may be transmitted to the decoder through, for example, a syntax element called chroma_pred_from_luma_enabled_flag. For example, if 1 is allocated to chroma_pred_from_luma_enabled_flag, the flag may indicate that the LM mode can be used for intra prediction of chroma components. Also, when 0 is assigned to chroma_pred_from_luma_enabled_flag, the flag may indicate that the LM mode is not used for intra prediction of chroma components.

LM 플래그가 사용되는 경우, chroma_pred_from_luma_enabled_flag에 1이 할당되면 표 1의 실시예에 따라 크로마 예측 모드가 결정될 수 있다. 그러나, chroma_pred_from_luma_enabled_flag에 0이 할당되면 크로마 성분의 인트라 예측에 LM 모드가 이용되지 않으므로, 루마 성분의 예측 모드와 전송되는 값에 따라 결정되는 크로마 예측 모드는 표 1의 실시예에서와 다르게 결정될 수도 있다. 예를 들어, 크로마 성분의 인트라 예측에 LM 모드가 이용되지 않는 경우, 크로마 예측 모드는 다음 표 2의 실시예에서와 같이 나타내어질 수 있다.When the LM flag is used, if 1 is allocated to chroma_pred_from_luma_enabled_flag, the chroma prediction mode may be determined according to the embodiment of Table 1. However, if 0 is assigned to chroma_pred_from_luma_enabled_flag, since the LM mode is not used for intra prediction of chroma components, the chroma prediction mode determined according to the luma component prediction mode and transmitted value may be determined differently from the embodiment of Table 1. For example, when the LM mode is not used for intra prediction of a chroma component, the chroma prediction mode may be represented as in the embodiment of Table 2 below.

[표 2][Table 2]

Figure pat00002
Figure pat00002

한편, 색 공간을 구성하는 복수의 색 성분은 서로 상관성을 가지므로, 하나의 색 성분(제1 색 성분)을 기반으로 다른 색 성분(제2 색 성분)에 대한 예측을 수행함으로써, 제2 색 성분에 대한 부호화 효율이 향상될 수 있다. 이러한 예측 과정은 '색 성분 간 예측'으로도 불릴 수 있다. 상술한 바와 같이, 색 공간을 구성하는 색 성분에는 R, G, B, 루마 성분(예컨대, Y) 및/또는 크로마 성분(예컨대, U, V, Cb, Cr) 등이 있을 수 있다. Meanwhile, since a plurality of color components constituting the color space have a correlation with each other, by performing prediction on another color component (second color component) based on one color component (first color component), the second color component is predicted. Encoding efficiency for components may be improved. This prediction process may also be called 'inter-color component prediction'. As described above, the color components constituting the color space may include R, G, B, a luma component (eg, Y), and/or a chroma component (eg, U, V, Cb, and Cr).

일례로, 상술한 LM 모드에서는 루마 성분을 기반으로 크로마 성분에 대한 예측이 수행될 수 있다. 이 때, 제1 색 성분은 루마 성분에 해당될 수 있고, 제2 색 성분은 크로마 성분에 해당될 수 있다. LM 모드에서 루마 성분과 크로마 성분의 상관성은 예측 파라미터를 이용한 선형 관계로 표현될 수 있다. 루마 성분을 기반으로 크로마 성분에 대해 예측을 수행하는 과정의 구체적인 실시예는 후술하기로 한다.For example, in the above-described LM mode, prediction of a chroma component may be performed based on a luma component. In this case, the first color component may correspond to a luma component, and the second color component may correspond to a chroma component. In the LM mode, a correlation between a luma component and a chroma component may be expressed as a linear relationship using a prediction parameter. A detailed embodiment of a process of predicting a chroma component based on a luma component will be described later.

상기 제1 색 성분 및 상기 제2 색 성분은 다양한 조합을 가질 수 있으나, 본 명세서에서는 설명의 편의상 제1 색 성분은 루마 성분이라 하고, 제2 색 성분은 크로마 성분이라 한다. 다만, 후술되는 실시예들은 이에 한정되어 적용되는 것은 아니며, 제1 색 성분 및 제2 색 성분의 가능한 모든 조합에 대해 동일하거나 유사한 방식으로 적용될 수 있다. 이 때, 후술되는 실시예들에서 루마 성분은 제1 색 성분으로 볼 수 있으며, 크로마 성분은 제2 색 성분으로 볼 수 있다.The first color component and the second color component may have various combinations, but in this specification, for convenience of description, the first color component is referred to as a luma component and the second color component is referred to as a chroma component. However, embodiments to be described later are not limited thereto and may be applied in the same or similar manner to all possible combinations of the first color component and the second color component. In this case, in embodiments described later, the luma component may be regarded as a first color component, and the chroma component may be regarded as a second color component.

도 5는 루마 성분을 기반으로 하여 크로마 성분에 대한 예측을 수행하는 색 성분 간 예측 방법의 일 실시예를 개략적으로 나타내는 흐름도이다. 후술되는 예측 과정은 부호화 장치 및 복호화 장치의 인트라 예측부에서 수행될 수 있다.5 is a flowchart schematically illustrating an embodiment of an inter-color component prediction method for performing prediction on a chroma component based on a luma component. A prediction process described later may be performed by intra prediction units of the encoding device and the decoding device.

이하, 본 명세서에서 부호화/복호화 대상이 되는 크로마 블록은 현재 크로마 블록이라 한다. 또한, 상기 현재 크로마 블록에 대응되는 '복원된' 루마 블록은 현재 루마 블록이라 한다. 일례로 현재 루마 블록은 현재 크로마 블록과 동일한 위치에 존재하는 블록일 수 있다. 다른 예로 현재 루마 블록은 현재 크로마 블록에 대해 소정의 상대적인 위치에 존재하거나 소정의 고정된 위치에 존재하는 블록일 수도 있다.Hereinafter, in this specification, a chroma block to be encoded/decoded is referred to as a current chroma block. Also, a 'reconstructed' luma block corresponding to the current chroma block is referred to as a current luma block. For example, the current luma block may be a block existing at the same location as the current chroma block. As another example, the current luma block may be a block existing at a predetermined relative position or a predetermined fixed position with respect to the current chroma block.

도 5를 참조하면, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀 및 현재 루마 블록 주변의 픽셀을 기반으로 현재 크로마 블록의 예측에 사용될 루마 참조 정보를 도출할 수 있다(S510).Referring to FIG. 5 , the encoder and decoder may derive luma reference information to be used for prediction of the current chroma block based on pixels within the current luma block and pixels around the current luma block (S510).

루마 참조 정보는 현재 크로마 블록의 예측에 사용될 루마 성분의 픽셀 값들을 의미할 수 있다. 따라서, 본 명세서에서 루마 참조 정보는 '루마 참조 픽셀'로 지칭될 수도 있다. 이 때, 현재 크로마 블록 내의 픽셀들에 대응되는 루마 참조 픽셀들은 '루마 참조 블록'을 구성할 수 있다. 또한, 본 명세서에서 현재 루마 블록 주변에 위치하는 픽셀은 '주변 루마 픽셀'이라 하고, 현재 크로마 블록 주변에 위치하는 픽셀은 '주변 크로마 픽셀'이라 하며, 루마 참조 블록 주변에 위치하는 루마 참조 픽셀은 '주변 루마 참조 픽셀'이라 한다. 이 때, 루마 참조 블록은 현재 크로마 블록에 대응될 수 있고, 주변 루마 참조 픽셀은 주변 크로마 픽셀에 대응될 수 있다. 본 명세서에서, 루마 참조 정보는 루마 참조 블록 내의 픽셀 및 주변 루마 참조 픽셀을 포함한 개념으로 사용될 수 있다.Luma reference information may refer to pixel values of a luma component to be used for prediction of a current chroma block. Therefore, in this specification, luma reference information may also be referred to as a 'luma reference pixel'. In this case, luma reference pixels corresponding to pixels in the current chroma block may constitute a 'luma reference block'. Also, in this specification, pixels located around the current luma block are referred to as 'surrounding luma pixels', pixels located around the current chroma block are referred to as 'surrounding chroma pixels', and luma reference pixels located around the luma reference block are referred to as 'surrounding chroma pixels'. These are called 'peripheral luma reference pixels'. In this case, the luma reference block may correspond to the current chroma block, and the neighboring luma reference pixels may correspond to the neighboring chroma pixels. In this specification, luma reference information may be used as a concept including a pixel in a luma reference block and a neighboring luma reference pixel.

한편, 상술한 바와 같이 현재 루마 블록 및 현재 크로마 블록은 영상 포맷에 따라 서로 다른 크기를 가질 수도 있다. 이 경우, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 현재 루마 블록 주변의 픽셀들에 대해 다운 샘플링(down sampling) 및/또는 업 샘플링(up sampling)을 수행함으로써, 현재 크로마 블록과 동일한 크기의 루마 참조 블록 및 이에 대응되는 주변 루마 참조 픽셀들을 도출할 수 있다. Meanwhile, as described above, the current luma block and the current chroma block may have different sizes according to an image format. In this case, the encoder and decoder perform down-sampling and/or up-sampling on pixels in the current luma block and pixels around the current luma block, so that the luma block has the same size as the current chroma block. A reference block and corresponding neighboring luma reference pixels may be derived.

이 때, 부호화기 및 복호화기는 부호화 파라미터를 기반으로 루마 참조 정보를 다르게 생성할 수도 있다. 여기서, 부호화 파라미터는 부호화 및 복호화에 필요한 매개변수로서, 구문 요소와 같이 부호화기에서 부호화되어 복호화기로 전달되는 정보뿐만 아니라, 부호화 혹은 복호화 과정에서 유추될 수 있는 정보를 포함할 수 있으며 영상을 부호화하거나 복호화할 때 필요한 정보를 의미할 수 있다. 부호화 파라미터에는 예를 들어, 부호화 모드, 인트라 예측 모드, 인터 예측 모드, 양자화 파라미터(Quantization Parameter: QP) 등이 있을 수 있다.In this case, the encoder and the decoder may generate luma reference information differently based on the encoding parameter. Here, the encoding parameter is a parameter necessary for encoding and decoding, and may include information that can be inferred in the process of encoding or decoding, as well as information encoded in the encoder and transmitted to the decoder, such as syntax elements, and can be used to encode or decode an image. It can mean the information you need when you do it. Encoding parameters may include, for example, an encoding mode, an intra prediction mode, an inter prediction mode, and a quantization parameter (QP).

또한, 현재 루마 블록, 루마 참조 블록 및/또는 현재 크로마 블록의 주변에 위치한 픽셀들 중에서는 가용하지 않은(unavailable) 픽셀들이 있을 수 있다. 이 경우, 부호화기 및 복호화기는 가용하지 않은 픽셀들에 대해 패딩 과정(padding process)을 수행할 수도 있다. 여기서, 패딩은 가용하지 않은 픽셀의 위치에 가용한 픽셀을 기반으로 새로운 픽셀 값을 채워 넣는 프로세스를 의미할 수 있다.In addition, there may be unavailable pixels among pixels positioned around the current luma block, luma reference block, and/or current chroma block. In this case, the encoder and decoder may perform a padding process on unavailable pixels. Here, padding may refer to a process of filling an unavailable pixel with a new pixel value based on an available pixel.

루마 참조 정보 도출 과정의 구체적인 실시예들은 후술하기로 한다.Specific embodiments of the process of deriving luma reference information will be described later.

다시 도 5를 참조하면, 부호화기 및 복호화기는 루마 참조 정보 및 크로마 성분 정보를 기반으로 현재 크로마 블록에 대한 예측 파라미터를 도출할 수 있다(S520).Referring back to FIG. 5 , the encoder and decoder may derive a prediction parameter for the current chroma block based on luma reference information and chroma component information (S520).

일례로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들의 픽셀 값 및 주변 크로마 픽셀들의 픽셀 값을 기반으로 예측 파라미터를 도출할 수 있다. 여기서, 예측 파라미터는 최소 자승법을 기반으로 하는 알파(α) 및 베타(β)일 수 있다. For example, the encoder and decoder may derive prediction parameters based on pixel values of neighboring luma reference pixels and pixel values of neighboring chroma pixels. Here, the prediction parameters may be alpha (α) and beta (β) based on the least squares method.

예측 파라미터 도출 과정의 구체적인 실시예들은 후술하기로 한다.Specific embodiments of the prediction parameter derivation process will be described later.

다시 도 5를 참조하면, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록 내의 루마 참조 픽셀 값을 기반으로 현재 크로마 블록 내 픽셀들의 예측 값을 도출할 수 있다(S530). 즉, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록 내의 루마 참조 픽셀 값을 기반으로 현재 크로마 블록에 대해 인트라 예측을 수행할 수 있다. 현재 크로마 블록 내 픽셀들의 예측 값을 도출하는 과정의 구체적인 실시예는 후술하기로 한다.Referring back to FIG. 5 , the encoder and decoder may derive predicted values of pixels in the current chroma block based on the prediction parameter and the luma reference pixel value in the luma reference block (S530). That is, the encoder and decoder may perform intra prediction on the current chroma block based on the prediction parameter and the luma reference pixel value in the luma reference block. A detailed embodiment of a process of deriving predicted values of pixels in the current chroma block will be described later.

도 6은 현재 루마 블록의 크기 및 현재 크로마 블록의 크기가 서로 다른 경우, 루마 참조 정보를 도출하는 방법의 일 실시예를 나타낸다.6 illustrates an embodiment of a method of deriving luma reference information when a size of a current luma block and a size of a current chroma block are different from each other.

상술한 바와 같이 현재 루마 블록 및 현재 크로마 블록은 영상 포맷에 따라 서로 다른 크기를 가질 수 있다. 예를 들어, 영상의 색 공간(color space)이 YUV 4:2:0 또는 YCbCr 4:2:0인 경우, 현재 루마 블록의 크기가 현재 크로마 블록의 크기보다 4배 클 수 있다. 이 경우 부호화기 및 복호화기는 현재 루마 블록을 기반으로 현재 크로마 블록과 동일한 크기를 갖는 루마 참조 블록 내의 픽셀들을 도출할 수 있으며, 상기 루마 참조 블록의 주변에 위치한 주변 루마 참조 픽셀들을 도출할 수 있다. 즉, 이 경우 부호화기 및 복호화기는 현재 크로마 블록의 크기에 대응되도록 루마 참조 정보를 생성할 수 있다.As described above, the current luma block and the current chroma block may have different sizes depending on the image format. For example, when the color space of an image is YUV 4:2:0 or YCbCr 4:2:0, the size of the current luma block may be 4 times larger than the size of the current chroma block. In this case, the encoder and decoder may derive pixels in the luma reference block having the same size as the current chroma block based on the current luma block, and may derive neighboring luma reference pixels located around the luma reference block. That is, in this case, the encoder and decoder may generate luma reference information to correspond to the size of the current chroma block.

도 6의 610은 현재 루마 블록(612), 주변 루마 픽셀들(614), 현재 크로마 블록(616) 및 주변 크로마 픽셀들(618)의 실시예를 도시한다. 도 6의 610을 참조하면, 현재 크로마 블록(616)의 크기가 4x4일 때, 이에 대응되는 현재 루마 블록(612)의 크기는 8x8일 수 있다. 이 경우, 부호화기 및 복호화기는 4x4 크기의 루마 참조 블록에 대응되는 루마 참조 픽셀들을 생성할 수 있다.610 of FIG. 6 illustrates an embodiment of the current luma block 612 , surrounding luma pixels 614 , current chroma block 616 , and surrounding chroma pixels 618 . Referring to 610 of FIG. 6 , when the size of the current chroma block 616 is 4x4, the size of the corresponding current luma block 612 may be 8x8. In this case, the encoder and decoder may generate luma reference pixels corresponding to a 4x4 luma reference block.

도 6의 620은 루마 참조 정보 도출 방법의 일 실시예를 도시한다. 620 of FIG. 6 illustrates an embodiment of a luma reference information derivation method.

도 6의 620의 실시예에서는, 도 6의 610에서와 같이 현재 루마 블록(612)의 크기가 8x8이고 현재 크로마 블록(616)의 크기가 4x4인 경우의 루마 참조 정보(626, 628) 도출 방법이 도시된다.In the embodiment 620 of FIG. 6 , as in 610 of FIG. 6 , a method of deriving luma reference information 626 and 628 when the size of the current luma block 612 is 8x8 and the size of the current chroma block 616 is 4x4. this is shown

도 6의 620을 참조하면, 부호화기 및 복호화기는 현재 루마 블록(612) 내의 픽셀 및 주변 루마 픽셀들(624)을 기반으로, 현재 크로마 블록(616)의 예측에 사용될 루마 참조 블록(626) 및 주변 루마 참조 픽셀들(628)을 생성할 수 있다. 여기서, 루마 참조 정보 도출에 사용되는 주변 루마 픽셀들(624)은, 현재 루마 블록(612)의 좌측에 가장 가까이 위치한 두 개의 픽셀 라인에 포함된 픽셀들, 및 현재 루마 블록(612)의 상단에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들을 포함할 수 있다.Referring to 620 of FIG. 6 , an encoder and a decoder determine a luma reference block 626 and its surroundings to be used for prediction of the current chroma block 616 based on the pixels in the current luma block 612 and the surrounding luma pixels 624 . Luma reference pixels 628 may be created. Here, the neighboring luma pixels 624 used for deriving the luma reference information are pixels included in two pixel lines located closest to the left side of the current luma block 612 and pixels located on top of the current luma block 612. Pixels included in one pixel line located closest to each other may be included.

한편, 도 6의 620에서는 현재 루마 블록(612) 및 현재 크로마 블록(616)의 크기가 서로 다르므로, 부호화기 및 복호화기는 현재 크로마 블록(616)과 동일한 크기(4x4)의 루마 참조 블록(626) 및 이에 대응되는 주변 루마 참조 픽셀들(628)을 생성할 수 있다. 이 때, 현재 크로마 블록(616)의 크기가 현재 루마 블록(612)의 크기보다 작으므로, 부호화기 및 복호화기는 현재 루마 블록(612) 내의 픽셀들 및 주변 루마 픽셀들(624)에 대해 다운 샘플링(down sampling)을 수행함으로써 루마 참조 정보를 생성할 수 있다.Meanwhile, in 620 of FIG. 6 , since the size of the current luma block 612 and the current chroma block 616 are different from each other, the encoder and the decoder use a luma reference block 626 having the same size (4x4) as the current chroma block 616. and peripheral luma reference pixels 628 corresponding thereto. At this time, since the size of the current chroma block 616 is smaller than the size of the current luma block 612, the encoder and decoder down-samples pixels in the current luma block 612 and neighboring luma pixels 624 ( down sampling) may generate luma reference information.

이하, 본 명세서의 좌표들(예컨대, (x,y))은 블록 내의 가장 좌측 상단에 존재하는 픽셀의 위치를 기준으로 하는 좌표일 수 있다. 일례로 본 명세서에서 블록 내의 가장 좌측 상단에 존재하는 픽셀의 좌표는 (0,0)일 수 있다.Hereinafter, coordinates (eg, (x, y)) in this specification may be coordinates based on the position of the upper leftmost pixel in the block. For example, in this specification, the coordinates of the top leftmost pixel in the block may be (0,0).

일 실시예로, 부호화기 및 복호화기는 현재 루마 블록(612) 내의 픽셀들 및 주변 루마 픽셀들(624)에 대해 2 탭(2-tap) 필터, 3 탭(3-tap) 필터 및/또는 4 탭(4-tap) 필터 등을 적용함으로써 다운 샘플링을 수행할 수 있다. 이 때, 다운 샘플링 수행 과정은 일례로 다음 수학식 1에 의해 나타내어질 수 있다.In one embodiment, the encoder and decoder may use a 2-tap filter, a 3-tap filter and/or a 4-tap filter for the pixels in the current luma block 612 and surrounding luma pixels 624. Downsampling may be performed by applying a (4-tap) filter or the like. In this case, the downsampling process may be represented by Equation 1 below as an example.

[수학식 1][Equation 1]

p'[x,y] = (p[2x,2y] + p[2x,2y+1]) >> 1p'[x,y] = (p[2x,2y] + p[2x,2y+1]) >> 1

p'[x,y] = (p[2x+1,2y] + p[2x+1,2y+1]) >> 1p'[x,y] = (p[2x+1,2y] + p[2x+1,2y+1]) >> 1

p'[x,y] = (p[2x-1,2y+1] + 2*p[2x,2y+1] + p[2x+1,2y+1] + 2) >> 2p'[x,y] = (p[2x-1,2y+1] + 2*p[2x,2y+1] + p[2x+1,2y+1] + 2) >> 2

여기서, p[x,y]는 복원된 루마 성분 픽셀들, 즉 현재 루마 블록(612) 내의 픽셀들 및 주변 루마 픽셀들(624)의 픽셀 값을 나타낼 수 있다. 또한, p'[x,y]는 현재 크로마 블록(616)의 크기에 따라 생성된 루마 참조 픽셀들(626, 628)의 픽셀 값을 나타낼 수 있다.Here, p[x,y] may indicate pixel values of reconstructed luma component pixels, that is, pixels in the current luma block 612 and neighboring luma pixels 624 . Also, p'[x,y] may represent pixel values of the luma reference pixels 626 and 628 generated according to the size of the current chroma block 616 .

다른 실시예로, 부호화기 및 복호화기는 소정의 연산에 따라 현재 루마 블록(612) 내의 픽셀들 및 주변 루마 픽셀들(624) 중에서 루마 참조 픽셀로 사용될 픽셀들을 선택함으로써, 다운 샘플링을 수행할 수도 있다. 이 때, 일례로 부호화기 및 복호화기는 소정의 크기를 갖는 픽셀 그룹 내에서 하나의 픽셀을 선택하여 루마 참조 픽셀로 사용할 수 있다. 이러한 다운 샘플링 수행 과정은 일례로 다음 수학식 2, 수학식 3 및 수학식 4 에 의해 나타내어지는 다운 샘플링 방식 중에서 적어도 하나의 방식으로 수행될 수 있다.In another embodiment, the encoder and decoder may perform downsampling by selecting pixels to be used as luma reference pixels from among pixels in the current luma block 612 and neighboring luma pixels 624 according to a predetermined operation. In this case, for example, the encoder and decoder may select one pixel from a pixel group having a predetermined size and use it as a luma reference pixel. This down-sampling process may be performed by at least one of the down-sampling methods represented by Equations 2, 3, and 4 below, for example.

[수학식 2][Equation 2]

p'[x,y] = p[2x,2y]p'[x,y] = p[2x,2y]

[수학식 3][Equation 3]

p'[x,y] = p[2x,2y+1]p'[x,y] = p[2x,2y+1]

[수학식 4][Equation 4]

p'[x,y] = p[2x+1,2y]p'[x,y] = p[2x+1,2y]

또한, 현재 루마 블록(612) 내의 픽셀들, 현재 루마 블록(612)의 상단에 위치한 주변 루마 픽셀들 및 현재 루마 블록(612)의 좌측에 위치한 주변 루마 픽셀들에는 서로 다른 다운 샘플링 방식이 적용될 수도 있다. 일례로, 현재 루마 블록(612) 내의 픽셀들에 수학식 1에 의한 다운 샘플링 방식이 적용될 때, 현재 루마 블록(612)의 상단에 위치한 주변 루마 픽셀들에는 수학식 2에 의한 다운 샘플링 방식이 적용될 수도 있고, 현재 루마 블록(612)의 좌측에 위치한 주변 루마 픽셀들에는 수학식 3에 의한 다운 샘플링 방식이 적용될 수도 있다. 여기서, 다운 샘플링 방식이 적용되는 가능한 실시예들의 조합이 모두 서술되지는 않지만, 당해 분야에서 통상의 지식을 가진 자라면, 상술한 다운 샘플링 방식들의 다른 조합의 사용이 가능함을 인식할 수 있을 것이다.In addition, different downsampling schemes may be applied to pixels in the current luma block 612, neighboring luma pixels positioned on top of the current luma block 612, and neighboring luma pixels positioned on the left side of the current luma block 612. there is. For example, when the downsampling method according to Equation 1 is applied to pixels within the current luma block 612, the downsampling method according to Equation 2 is applied to neighboring luma pixels located on top of the current luma block 612. Alternatively, the downsampling method according to Equation 3 may be applied to the neighboring luma pixels located to the left of the current luma block 612 . Here, although combinations of possible embodiments to which the downsampling scheme is applied are not all described, those skilled in the art will recognize that other combinations of the above-described downsampling schemes may be used.

도 6의 630은 루마 참조 정보 도출 방법의 다른 실시예를 도시한다.630 of FIG. 6 illustrates another embodiment of a luma reference information derivation method.

도 6의 630의 실시예에서는, 도 6의 610에서와 같이 현재 루마 블록(612)의 크기가 8x8이고 현재 크로마 블록(616)의 크기가 4x4인 경우의 루마 참조 정보(636, 638) 도출 방법이 도시된다.In the embodiment 630 of FIG. 6 , as in 610 of FIG. 6 , a method of deriving luma reference information 636 and 638 when the size of the current luma block 612 is 8x8 and the size of the current chroma block 616 is 4x4. this is shown

도 6의 630을 참조하면, 부호화기 및 복호화기는 현재 루마 블록(612) 내의 픽셀 및 주변 루마 픽셀들(634)을 기반으로, 현재 크로마 블록(616)의 예측에 사용될 루마 참조 블록(636) 및 주변 루마 참조 픽셀들(638)을 생성할 수 있다.Referring to 630 of FIG. 6 , the encoder and the decoder determine a luma reference block 636 and its surroundings to be used for prediction of the current chroma block 616 based on the pixel in the current luma block 612 and the surrounding luma pixels 634 . Luma reference pixels 638 may be created.

도 6의 630에서는, 도 6의 620에서와 달리 현재 루마 블록(612)의 좌측에 가장 가까이 위치한 “한 개”의 픽셀 라인에 포함된 픽셀들, 및 현재 루마 블록(612)의 상단에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들을 기반으로 다운 샘플링을 수행함으로써, 루마 참조 정보(636, 638)가 도출될 수 있다. 즉, 도 6의 630의 실시예에서는, 현재 루마 블록(612) 좌측 및 상단에서 각각 한 개의 픽셀 라인에 포함된 픽셀들(634)만이 루마 참조 정보 (636, 638) 도출에 사용될 수 있다. In 630 of FIG. 6 , unlike 620 of FIG. 6 , pixels included in “one” pixel line located closest to the left side of the current luma block 612 and closest to the top of the current luma block 612 Luma reference information 636 and 638 may be derived by performing down-sampling based on pixels included in one located pixel line. That is, in the embodiment 630 of FIG. 6 , only pixels 634 included in one pixel line at the left and top of the current luma block 612 may be used to derive the luma reference information 636 and 638 .

도 6의 630에서 다운 샘플링 수행 방법은 도 6의 620에서와 동일하므로 다운 샘플링 수행 방법에 관한 구체적인 설명은 생략하기로 한다.Since the method of performing downsampling in 630 of FIG. 6 is the same as that of 620 of FIG. 6 , a detailed description of the method of performing downsampling will be omitted.

한편, 부호화기 및 복호화기는 주변 루마 픽셀들을 포함하는 블록 및/또는 현재 루마 블록의 부호화 파라미터를 기반으로 루마 참조 정보를 다르게 생성할 수도 있다. 상술한 바와 같이, 부호화 파라미터에는 부호화 모드, 인트라 예측 모드, 인터 예측 모드, 양자화 파라미터(Quantization Parameter: QP) 등이 있을 수 있다. 예를 들어, 부호화기 및 복호화기는 왜곡이 작은 픽셀들의 픽셀 값만을 이용하여 루마 참조 정보를 생성할 수 있다.Meanwhile, the encoder and decoder may generate luma reference information differently based on a block including neighboring luma pixels and/or an encoding parameter of the current luma block. As described above, the encoding parameter may include an encoding mode, an intra prediction mode, an inter prediction mode, a quantization parameter (QP), and the like. For example, the encoder and decoder may generate luma reference information using only pixel values of pixels having small distortion.

일 실시예로, 부호화기 및 복호화기는 부호화 모드를 기반으로 루마 참조 정보를 다르게 생성할 수 있다. 일례로, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 주변 루마 픽셀들 중에서 인트라 모드로 부호화된 블록 내의 픽셀들만을 루마 참조 정보 도출에 이용할 수 있다. As an embodiment, an encoder and a decoder may generate luma reference information differently based on an encoding mode. For example, the encoder and decoder may use only pixels within a block encoded in an intra mode among pixels within a current luma block and neighboring luma pixels to derive luma reference information.

부호화 파라미터를 기반으로 루마 참조 정보를 생성하는 방법의 추가 실시예는 도 7에서 후술된다.An additional embodiment of a method of generating luma reference information based on an encoding parameter will be described later with reference to FIG. 7 .

도 7은 부호화 파라미터를 기반으로 루마 참조 정보를 생성하는 과정의 실시예를 개략적으로 나타내는 도면이다.7 is a diagram schematically illustrating an embodiment of a process of generating luma reference information based on an encoding parameter.

도 7의 710은 현재 루마 블록(712)의 인트라 예측 모드를 기반으로 루마 참조 정보(716, 718)를 생성하는 방법의 일 실시예를 나타낸다. 도 7의 710에서, 현재 루마 블록(712)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 710 of FIG. 7 represents an embodiment of a method of generating luma reference information 716 and 718 based on the intra prediction mode of the current luma block 712 . In 710 of FIG. 7 , it is assumed that the size of the current luma block 712 is 8x8 and the size of the current chroma block is 4x4.

도 7의 710에서는 현재 루마 블록(712) 내의 픽셀들 및 주변 루마 픽셀들(714)을 기반으로, 현재 크로마 블록의 예측에 사용될 루마 참조 블록(716) 및 주변 루마 참조 픽셀들(718)이 생성될 수 있다. 현재 크로마 블록의 크기는 4x4이므로, 생성된 루마 참조 블록(716)의 크기는 4x4일 수 있다. In 710 of FIG. 7 , a luma reference block 716 and neighboring luma reference pixels 718 to be used for prediction of the current chroma block are generated based on the pixels in the current luma block 712 and the neighboring luma pixels 714. It can be. Since the size of the current chroma block is 4x4, the size of the generated luma reference block 716 may be 4x4.

이 때, 현재 루마 블록(712)의 인트라 예측 모드는 수직(vertical) 모드(722)이므로, 부호화기 및 복호화기는 주변 루마 픽셀들(714) 중에서 현재 루마 블록(712)의 상단에 인접하여 위치한 픽셀들만을 루마 참조 정보(716, 718) 생성에 이용할 수 있다. 따라서, 도 7의 710에서 도출되는 주변 루마 참조 픽셀들(718)은 루마 참조 블록(716)의 상단에 인접하여 위치한 픽셀들일 수 있다.At this time, since the intra prediction mode of the current luma block 712 is the vertical mode 722, the encoder and the decoder select only pixels located adjacent to the top of the current luma block 712 from among the surrounding luma pixels 714. may be used to generate luma reference information (716, 718). Accordingly, the peripheral luma reference pixels 718 derived from 710 of FIG. 7 may be pixels positioned adjacent to an upper end of the luma reference block 716 .

도 7의 710에서와 달리 현재 루마 블록의 인트라 예측 모드가 수평(horizontal) 모드이면, 부호화기 및 복호화기는 주변 루마 픽셀들 중에서 현재 루마 블록의 좌측에 인접하여 위치한 픽셀들만을 루마 참조 정보 생성에 이용할 수도 있다. 이 경우 도출되는 주변 루마 참조 픽셀들은 루마 참조 블록의 좌측에 인접하여 위치한 픽셀들일 수 있다. 현재 루마 블록의 인트라 예측 모드가 DC 모드 또는 플래너 모드이면, 부호화기 및 복호화기는 현재 루마 블록의 좌측에 위치한 픽셀들 및 현재 루마 블록의 상단에 위치한 픽셀들이 모두 루마 참조 정보 생성에 이용될 수 있다. 이 경우 도출되는 주변 루마 참조 픽셀들은 루마 참조 블록의 좌측에 위치한 픽셀들 및 루마 참조 블록의 상단에 위치한 픽셀들을 모두 포함할 수 있다.Unlike 710 of FIG. 7 , if the intra prediction mode of the current luma block is a horizontal mode, the encoder and decoder may use only pixels adjacent to the left side of the current luma block among neighboring luma pixels to generate luma reference information. there is. In this case, the derived peripheral luma reference pixels may be pixels positioned adjacent to the left side of the luma reference block. When the intra prediction mode of the current luma block is the DC mode or the planner mode, the encoder and decoder can use both pixels located on the left side of the current luma block and pixels located on the top side of the current luma block to generate luma reference information. In this case, the derived peripheral luma reference pixels may include both pixels located on the left side of the luma reference block and pixels located on top of the luma reference block.

도 7의 730은 현재 루마 블록(732)의 주변에 위치한 주변 루마 블록(734, 736, 738)의 양자화 파라미터를 기반으로 루마 참조 정보(752, 754)를 생성하는 방법의 일 실시예를 나타낸다. 도 7의 730에서, 현재 루마 블록(732)의 크기는 8x8이고, 현재 크로마 블록의 크기는 4x4라 가정한다.730 of FIG. 7 shows an embodiment of a method of generating luma reference information 752 and 754 based on quantization parameters of neighboring luma blocks 734 , 736 , and 738 located around the current luma block 732 . In 730 of FIG. 7 , it is assumed that the size of the current luma block 732 is 8x8 and the size of the current chroma block is 4x4.

도 7의 730을 참조하면, 현재 루마 블록(732)의 상단에 인접하여 위치한 상단 주변 루마 블록(734)의 양자화 파라미터 값은 22이고, 현재 루마 블록(732) 외부의 좌측 상단 코너에 위치한 좌측 상단 주변 루마 블록(736)의 양자화 파라미터 값은 26이다. 또한, 현재 루마 블록(732)의 좌측에 인접하여 위치한 좌측 주변 루마 블록(738)의 양자화 파라미터 값은 28이다. 이 때, 부호화기 및 복호화기는 주변 루마 픽셀들(744, 746, 748) 중에서, 가장 작은 양자화 파라미터 값을 갖는 주변 루마 블록에 속한 주변 루마 픽셀들을 루마 참조 정보 생성에 이용할 수 있다. Referring to 730 in FIG. 7 , the quantization parameter value of the luma block 734 adjacent to the upper end adjacent to the upper end of the current luma block 732 is 22, and the upper left corner located at the upper left corner outside the current luma block 732. The value of the quantization parameter of the peripheral luma block 736 is 26. In addition, the quantization parameter value of the left peripheral luma block 738 positioned adjacent to the left side of the current luma block 732 is 28. In this case, the encoder and decoder may use neighboring luma pixels belonging to a neighboring luma block having the smallest quantization parameter value among the neighboring luma pixels 744 , 746 , and 748 to generate luma reference information.

도 7의 730에서는 상단 주변 루마 블록(734), 좌측 상단 주변 루마 블록(736) 및 좌측 주변 루마 블록(738) 중에서 상단 주변 루마 블록(734)이 가장 작은 양자화 파라미터 값(예컨대, 22)을 가지므로, 상단 주변 루마 블록(734) 내의 주변 루마 픽셀들(744)이 루마 참조 정보 생성에 이용될 수 있다. 즉, 도 7의 730에서 부호화기 및 복호화기는 현재 루마 블록(732) 내의 픽셀들 및 상단 주변 루마 블록(734) 내의 주변 루마 픽셀들(744)이 루마 참조 블록(752) 및 주변 루마 참조 픽셀들(754)의 생성에 이용될 수 있다. In 730 of FIG. 7 , among the top peripheral luma block 734, the upper left peripheral luma block 736, and the left peripheral luma block 738, the upper peripheral luma block 734 has the smallest quantization parameter value (eg, 22). Therefore, the peripheral luma pixels 744 in the upper peripheral luma block 734 may be used to generate luma reference information. That is, in 730 of FIG. 7 , the encoder and decoder determine that the pixels in the current luma block 732 and the peripheral luma pixels 744 in the upper peripheral luma block 734 are the luma reference block 752 and the peripheral luma reference pixels ( 754) can be used.

도 7의 730에서 현재 크로마 블록의 크기는 4x4이므로, 생성된 루마 참조 블록(752)의 크기는 4x4일 수 있다. 또한, 도 7의 730에서 도출되는 주변 루마 참조 픽셀들(754)은 루마 참조 블록(752)의 상단에 인접하여 위치한 픽셀들일 수 있다.In 730 of FIG. 7 , since the size of the current chroma block is 4x4, the size of the generated luma reference block 752 may be 4x4. Also, the peripheral luma reference pixels 754 derived from 730 of FIG. 7 may be pixels positioned adjacent to an upper end of the luma reference block 752 .

도 7의 실시예에서, 루마 참조 정보를 생성하기 위해 수행되는 다운 샘플링 과정은 도 6의 실시예에서와 유사하므로 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.In the embodiment of FIG. 7 , a downsampling process performed to generate luma reference information is similar to that in the embodiment of FIG. 6 , so a detailed description thereof will be omitted here.

도 8은 주변 루마 픽셀들 중에서 가용하지 않은 픽셀이 존재하는 경우에 루마 참조 정보를 생성하는 과정의 실시예를 개략적으로 나타내는 도면이다.8 schematically illustrates an embodiment of a process of generating luma reference information when an unavailable pixel exists among neighboring luma pixels.

상술한 바와 같이, 현재 루마 블록의 주변에 위치한 주변 루마 픽셀들 중에서는 가용하지 않은(unavailable) 픽셀들이 있을 수 있다. 주변 루마 픽셀이 가용하지 않은 경우로는 현재 루마 블록이 현재 픽쳐의 경계에 인접하여 위치한 경우, 현재 루마 블록이 현재 슬라이스(slice)의 경계에 인접하여 위치한 경우 및 현재 루마 블록에 대해 CIP(Constrained Intra Prediction)가 적용되는 경우 등이 있을 수 있다. As described above, there may be unavailable pixels among the neighboring luma pixels located around the current luma block. Cases in which the neighboring luma pixels are not available are when the current luma block is located adjacent to the boundary of the current picture, when the current luma block is located adjacent to the boundary of the current slice, and CIP (Constrained Intra Prediction) may be applied.

도 8의 810은 현재 루마 블록이 현재 픽쳐 및/또는 현재 슬라이스의 경계에 인접하여 위치하는 경우 루마 참조 정보를 도출하는 방법의 실시예를 도시한다. 도 8의 810을 참조하면, 현재 루마 블록(812)은 현재 픽쳐 및/또는 현재 슬라이스의 좌측 경계(818)에 인접하여 위치한 블록일 수 있다. 이 경우, 현재 루마 블록(812)의 좌측에 위치하는 주변 루마 픽셀들(816)은 현재 픽쳐 및/또는 현재 슬라이스의 외부에 위치하므로, 가용하지 않은 픽셀들에 해당될 수 있다.810 of FIG. 8 illustrates an embodiment of a method of deriving luma reference information when a current luma block is positioned adjacent to a boundary of a current picture and/or a current slice. Referring to 810 of FIG. 8 , the current luma block 812 may be a block located adjacent to the left boundary 818 of the current picture and/or current slice. In this case, since the neighboring luma pixels 816 positioned to the left of the current luma block 812 are positioned outside the current picture and/or current slice, they may correspond to unavailable pixels.

이 때, 일 실시예로 부호화기 및 복호화기는 다운 샘플링 과정을 수행하기에 앞서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다. 상술한 바와 같이, 패딩은 가용하지 않은 픽셀의 위치에 새로운 픽셀 값을 채워 넣는 프로세스를 의미할 수 있다. At this time, according to an embodiment, the encoder and decoder may perform a padding process on unavailable pixels prior to performing the downsampling process. As described above, padding may refer to a process of filling in unavailable pixel positions with new pixel values.

도 8의 810에서와 같이 현재 루마 블록(812)의 좌측에 위치하는 주변 루마 픽셀들(816)이 가용하지 않은 경우, 부호화기 및 복호화기는 현재 루마 블록(812)의 상단에 위치한 가용한 주변 루마 픽셀들(814) 중에서 적어도 하나의 픽셀의 픽셀 값을 현재 루마 블록(812)의 좌측에 위치한 주변 루마 픽셀들의 위치에 채워 넣을 수 있다. 일례로, 현재 루마 블록(812)의 좌측에 가장 가까이 위치한 제1 픽셀 라인에 픽셀 값을 채워 넣는 과정은 다음 수학식 5에 의해 나타내어질 수 있다.As shown in 810 of FIG. 8 , when the surrounding luma pixels 816 located on the left side of the current luma block 812 are not available, the encoder and decoder use the available surrounding luma pixels located on the top side of the current luma block 812. A pixel value of at least one pixel among the pixels 814 may be filled in with positions of neighboring luma pixels positioned to the left of the current luma block 812 . For example, a process of filling pixel values into a first pixel line located closest to the left of the current luma block 812 may be expressed by Equation 5 below.

[수학식 5][Equation 5]

p[-1,y] = p[0,-1], (y=0~7)p[-1,y] = p[0,-1], (y=0~7)

여기서, p[x,y]는 루마 성분의 복원된 픽셀 값을 나타낼 수 있다.Here, p[x,y] may represent a reconstructed pixel value of a luma component.

현재 루마 블록(812)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 픽셀 라인의 좌측에 인접하여 위치한 제2 픽셀 라인에 픽셀 값을 채워 넣는 과정은 일례로 다음 수학식 6에 의해 나타내어질 수 있다.A process of filling a pixel value into a pixel line located second closest to the left side of the current luma block 812, that is, a second pixel line located adjacent to the left side of the first pixel line, is represented by Equation 6 below as an example. can

[수학식 6][Equation 6]

p[-2,y] = p[0,-1], (y=0~7)p[-2,y] = p[0,-1], (y=0~7)

패딩 과정이 수행된 경우 부호화기 및 복호화기는 새로이 채워진 픽셀 값을 루마 참조 정보 생성에 이용할 수 있다. 즉, 부호화기 및 복호화기는 가용한 주변 루마 픽셀들(814)의 픽셀 값, 패딩 과정에 의해 채워진 픽셀들(816)의 픽셀 값 및 현재 루마 블록(812) 내의 픽셀들의 픽셀 값을 기반으로 루마 참조 정보를 생성할 수 있다. When the padding process is performed, the encoder and decoder may use newly filled pixel values to generate luma reference information. That is, the encoder and decoder generate luma reference information based on the pixel values of available neighboring luma pixels 814, the pixel values of pixels 816 filled by the padding process, and the pixel values of pixels in the current luma block 812. can create

다른 실시예로 부호하기 및 복호화기는 가용하지 않은 주변 루마 픽셀들은 루마 참조 정보 생성에 이용하지 않을 수도 있다. 즉, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 가용한 주변 루마 픽셀들을 기반으로 루마 참조 정보를 생성할 수 있다. 예를 들어, 도 8의 810에서는 현재 루마 블록(812) 내의 픽셀들 및 현재 루마 블록(812)의 상단에 위치한 가용한 주변 루마 픽셀들(814)이 루마 참조 정보 생성에 이용될 수 있다.In another embodiment, the encoder and decoder may not use unavailable neighboring luma pixels to generate luma reference information. That is, the encoder and decoder may generate luma reference information based on pixels in the current luma block and available neighboring luma pixels. For example, in 810 of FIG. 8 , pixels in the current luma block 812 and available peripheral luma pixels 814 located on top of the current luma block 812 may be used to generate luma reference information.

도 8의 810에서 루마 참조 정보 생성 과정에서는 도 6 및 도 7의 실시예에서 상술한 루마 참조 정보 생성 방법들 중에서 적어도 하나가 상술한 실시예들과 함께 적용될 수도 있다.In the luma reference information generation process in 810 of FIG. 8 , at least one of the luma reference information generation methods described above in the embodiments of FIGS. 6 and 7 may be applied together with the above-described embodiments.

도 8의 820은 CIP(Constrained Intra Prediction)가 적용되는 경우에 루마 참조 정보를 도출하는 방법의 실시예를 도시한다.820 of FIG. 8 illustrates an embodiment of a method of deriving luma reference information when Constrained Intra Prediction (CIP) is applied.

CIP는 예측 대상 블록의 주변에 위치한 블록들 중에서 인트라 예측에 의해 부호화/복호화되는 블록 내의 픽셀들만을 예측에 이용하는 인트라 예측 방식을 의미할 수 있다. CIP가 적용되는 경우, 인터 예측에 의해 부호화/복호화된 블록 내의 픽셀들은 인트라 예측에 이용되지 않을 수 있다. CIP may refer to an intra prediction method in which only pixels within a block to be encoded/decoded by intra prediction among blocks located around a block to be predicted are used for prediction. When CIP is applied, pixels in a block encoded/decoded by inter prediction may not be used for intra prediction.

일례로 부호화기는 CIP가 적용되는지 여부에 대한 플래그 정보를 복호화기로 전송할 수 있다. 이 때, 복호화기는 상기 플래그 정보를 기반으로 CIP 적용 여부를 결정할 수 있다. CIP가 적용되는지 여부에 대한 플래그 정보는 일례로 'constrained_intra_pred_flag'로 나타내어질 수 있다.For example, the encoder may transmit flag information on whether CIP is applied to the decoder. At this time, the decoder may determine whether to apply CIP based on the flag information. Flag information on whether CIP is applied may be represented as 'constrained_intra_pred_flag', for example.

도 8의 820을 참조하면, 현재 루마 블록(822)의 상단에 위치한 상단 주변 루마 블록(824)은 인트라(intra) 모드로 부호화/복호화된 블록이고, 현재 루마 블록(822)의 좌측에 위치한 좌측 주변 루마 블록(826)은 인터(inter) 모드로 부호화/복호화된 블록일 수 있다. 이 경우, 좌측 주변 루마 블록(826) 내에 위치하는 주변 루마 픽셀들(836)은 가용하지 않은 픽셀들에 해당될 수 있다.Referring to 820 of FIG. 8 , an upper peripheral luma block 824 located on top of the current luma block 822 is a block encoded/decoded in an intra mode, and is located on the left side of the current luma block 822. The peripheral luma block 826 may be a block encoded/decoded in an inter mode. In this case, the peripheral luma pixels 836 located in the left peripheral luma block 826 may correspond to unavailable pixels.

이 때, 일 실시예로 부호화기 및 복호화기는 다운 샘플링 과정을 수행하기에 앞서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다. 상술한 바와 같이, 패딩은 가용하지 않은 픽셀의 위치에 새로운 픽셀 값을 채워 넣는 프로세스를 의미할 수 있다. 이 때, 부호화기 및 복호화기는 가용하지 않은 주변 루마 픽셀들을 가용한 주변 루마 픽셀의 픽셀 값으로 채워 넣을 수 있다.At this time, according to an embodiment, the encoder and decoder may perform a padding process on unavailable pixels prior to performing the downsampling process. As described above, padding may refer to a process of filling in unavailable pixel positions with new pixel values. In this case, the encoder and decoder may fill unavailable peripheral luma pixels with pixel values of available peripheral luma pixels.

일례로, 도 8의 820에서와 같이 좌측 주변 루마 블록(826) 내에 위치하는 주변 루마 픽셀들(836)이 가용하지 않은 경우, 부호화기 및 복호화기는 상단 주변 루마 블록(824) 내에 위치하는 가용한 주변 루마 픽셀들(834) 중에서 적어도 하나의 픽셀의 픽셀 값을 가용하지 않은 주변 루마 픽셀들(836)의 위치에 채워 넣을 수 있다. 일례로, 상단 주변 루마 블록(824) 내의 픽셀을 기반으로 패딩을 수행하는 과정은 다음 수학식 7에 의해 나타내어질 수 있다. For example, as shown in 820 of FIG. 8 , when the peripheral luma pixels 836 located within the left peripheral luma block 826 are not available, the encoder and decoder use the available peripherals located within the upper peripheral luma block 824. A pixel value of at least one pixel from among the luma pixels 834 may be filled in at locations of unavailable neighboring luma pixels 836 . As an example, a process of performing padding based on pixels in the upper peripheral luma block 824 may be expressed by Equation 7 below.

[수학식 7][Equation 7]

p[-2,y] = p[-2,-1] (y=0~7) 또는p[-2,y] = p[-2,-1] (y=0~7) or

p[-2,y] = p[-1,-1] (y=0~7) 또는p[-2,y] = p[-1,-1] (y=0~7) or

p[-1,y] = p[-1,-1] (y=0~7)p[-1,y] = p[-1,-1] (y=0~7)

다른 예로, 좌측 주변 루마 블록(826)의 하단에 인접하여 위치한 픽셀들(838)은 인트라 모드로 부호화/복호화된 블록 내의 픽셀일 수 있다. 이 때, 부호화기 및 복호화기는 좌측 주변 루마 블록의 상단에 위치한 픽셀(예컨대, (-2,-1)의 위치에 존재하는 픽셀 또는 (-1,-1)의 위치에 존재하는 픽셀) 및 좌측 주변 루마 블록의 하단에 위치한 픽셀(예컨대, (-2,8)의 위치에 존재하는 픽셀 또는 (-1,8)의 위치에 존재하는 픽셀)의 픽셀 평균 값을 가용하지 않은 주변 루마 픽셀들(836)의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 8에 의해 나타내어질 수 있다.As another example, the pixels 838 positioned adjacent to the lower end of the left peripheral luma block 826 may be pixels in a block encoded/decoded in an intra mode. At this time, the encoder and the decoder use a pixel located on top of the left peripheral luma block (eg, a pixel located at a position of (-2,-1) or a pixel located at a position of (-1,-1)) and a left periphery. Neighboring luma pixels 836 for which the pixel average value of the pixel located at the lower end of the luma block (eg, the pixel located at the position of (-2,8) or the pixel located at the position of (-1,8)) is not available ) can be filled in. This padding process may be represented by Equation 8 below as an example.

[수학식 8][Equation 8]

p[-2,y] = (p[-2,-1] + p[-2,8] + 1)>>1, (y=0~7) 또는p[-2,y] = (p[-2,-1] + p[-2,8] + 1)>>1, (y=0~7) or

p[-2,y] = (p[-1,-1] + p[-1,8] + 1)>>1, (y=0~7)p[-2,y] = (p[-1,-1] + p[-1,8] + 1)>>1, (y=0~7)

*163패딩 과정이 수행된 경우 부호화기 및 복호화기는 새로이 채워진 픽셀 값을 루마 참조 정보 생성에 이용할 수 있다. 즉, 부호화기 및 복호화기는 가용한 주변 루마 픽셀들(834)의 픽셀 값, 패딩 과정에 의해 채워진 픽셀들(836)의 픽셀 값 및 현재 루마 블록(822) 내의 픽셀들의 픽셀 값을 기반으로 루마 참조 정보를 생성할 수 있다.When the *163 padding process is performed, the encoder and decoder may use newly filled pixel values to generate luma reference information. That is, the encoder and decoder generate luma reference information based on the pixel values of available neighboring luma pixels 834, the pixel values of pixels 836 filled by the padding process, and the pixel values of pixels in the current luma block 822. can create

다른 실시예로 도 8의 820에서 부호하기 및 복호화기는 가용하지 않은 주변 루마 픽셀들은 루마 참조 정보 생성에 이용하지 않을 수도 있다. 즉, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 가용한 주변 루마 픽셀들을 기반으로 루마 참조 정보를 생성할 수 있다. 예를 들어, 도 8의 820에서는 현재 루마 블록(822) 내의 픽셀들 및 상단 주변 루마 블록(824) 내에 위치한 가용한 주변 루마 픽셀들(834)이 루마 참조 정보 생성에 이용될 수 있다.As another embodiment, the encoder and decoder in 820 of FIG. 8 may not use unavailable neighboring luma pixels to generate luma reference information. That is, the encoder and decoder may generate luma reference information based on pixels in the current luma block and available neighboring luma pixels. For example, in 820 of FIG. 8 , pixels in the current luma block 822 and available peripheral luma pixels 834 located in the upper peripheral luma block 824 may be used to generate luma reference information.

도 8의 820에서 루마 참조 정보 생성 과정에서는 도 6 및 도 7의 실시예에서 상술한 루마 참조 정보 생성 방법들 중에서 적어도 하나가 상술한 실시예들과 함께 적용될 수도 있다.In the luma reference information generation process in 820 of FIG. 8 , at least one of the luma reference information generation methods described above in the embodiments of FIGS. 6 and 7 may be applied together with the above-described embodiments.

도 9는 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 실시예를 설명하기 위한 도면이다. 9 is a diagram for explaining an embodiment of a process of generating luma reference information after performing a padding process.

도 9의 실시예는 현재 루마 블록(910)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 및 현재 루마 블록(910)의 상단에 가장 가까이 위치한 제1 상단 픽셀 라인 내의 주변 루마 픽셀들이 루마 참조 정보 생성에 사용되는 경우의 실시예를 도시한다. 도 9의 실시예에서, 현재 루마 블록(910)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 픽셀 라인은 제2 좌측 픽셀 라인이라 지칭하기로 한다. 또한, 현재 루마 블록(910)의 상단에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 상단 픽셀 라인의 상단에 인접하여 위치한 픽셀 라인은 제2 상단 픽셀 라인이라 지칭하기로 한다.In the embodiment of FIG. 9 , luma reference information is generated by neighboring luma pixels in the first left pixel line closest to the left side of the current luma block 910 and the first upper pixel line closest to the top of the current luma block 910 . It shows an embodiment when used in . In the embodiment of FIG. 9 , a pixel line positioned second closest to the left side of the current luma block 910, that is, a pixel line positioned adjacent to the left side of the first left pixel line will be referred to as a second left pixel line. Also, a pixel line positioned second closest to the top of the current luma block 910, that is, a pixel line positioned adjacent to the top of the first top pixel line will be referred to as a second top pixel line.

도 9의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 9에서 현재 루마 블록(910)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 9의 실시예에서 도출되는 루마 참조 블록(930)의 크기는 4x4일 수 있다. In the embodiment of FIG. 9 , it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, the LM mode may be represented as Intra_FromLuma. Also, in FIG. 9 , it is assumed that the size of the current luma block 910 is 8x8 and the size of the current chroma block is 4x4. As described above, the size of the luma reference block to be used for prediction of the current chroma block may be the same as the size of the current chroma block. Accordingly, the size of the luma reference block 930 derived in the embodiment of FIG. 9 may be 4x4.

또한, 도 9의 실시예에 도시된 주변 루마 픽셀들(922, 924, 926, 928) 중에서, 922에 해당되는 주변 루마 픽셀들 및 926에 해당되는 주변 루마 픽셀들은 가용한(available) 픽셀이고, 924에 해당되는 주변 루마 픽셀들 및 928에 해당되는 주변 루마 픽셀들은 가용하지 않은(unavailable) 픽셀이라 가정한다. 이 경우, 부호화기 및 복호화기는 가용하지 않은 주변 루마 픽셀에 대해 패딩 과정을 수행한 후에 루마 참조 정보를 생성할 수 있다.In addition, among the peripheral luma pixels 922, 924, 926, and 928 shown in the embodiment of FIG. 9, the peripheral luma pixels corresponding to 922 and 926 are available pixels, It is assumed that peripheral luma pixels corresponding to 924 and 928 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable neighboring luma pixels.

도 9의 실시예에서, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피(copy)한 후에 패딩 과정을 수행할 수 있다. 즉 부호화기 및 복호화기는 제1 좌측 픽셀 라인의 주변 루마 픽셀 값들을 제2 좌측 픽셀 라인의 주변 루마 픽셀 값으로 대체한 후에, 제1 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행할 수 있다. 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피(copy)하는 과정은 일례로 다음 수학식 9에 의해 나타내어질 수 있다.In the embodiment of FIG. 9 , the encoder and decoder may perform a padding process after copying peripheral luma pixel values on the second left pixel line to the first left pixel line. That is, the encoder and decoder replaces the peripheral luma pixel values of the first left pixel line with the peripheral luma pixel values of the second left pixel line, and then outputs values to the unavailable peripheral luma pixels on the first left pixel line and the first upper pixel line. A padding process can be performed for A process of copying the peripheral luma pixel values on the second left pixel line to the first left pixel line may be expressed by Equation 9 below, for example.

[수학식 9][Equation 9]

PY[x,y] = PY[x-1,y], (x=-1, y=0~2*nS-1)P Y [x,y] = P Y [x-1,y], (x=-1, y=0~2*nS-1)

*173여기서, PY 는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, nS는 현재 루마 블록(910)의 가로 길이 및 세로 길이를 나타낼 수 있다. *173 Here, P Y may represent a pixel value of a neighboring luma pixel. Also, nS may represent the horizontal and vertical lengths of the current luma block 910 .

제2 촤즉 픽셀 라인 상의 주변 루마 픽셀 값들이 제1 좌측 픽셀 라인에 카피된 후, 부호화기 및 복호화기는 주변 루마 픽셀에 대한 패딩 과정을 수행함으로써, 루마 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값을 도출할 수 있다. 루마 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값들은 다음 수학식 10에 의해 나타내어질 수 있다.After the neighboring luma pixel values on the second, that is, pixel line are copied to the first left pixel line, the encoder and decoder perform a padding process on the neighboring luma pixels to derive pixel values of the neighboring luma pixels to be used for generating luma reference information. can do. Pixel values of neighboring luma pixels to be used for generating luma reference information may be expressed by Equation 10 below.

[수학식 10][Equation 10]

PY[x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)P Y [x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)

주변 루마 픽셀들 중에서 가용하지 않은 픽셀들은 도 9의 924, 928과 같이 픽셀 그룹을 구성할 수 있다. 도 9의 실시예에서는 설명의 편의상 제1 좌측 픽셀 라인 상의 가용하지 않은 픽셀들(예컨대, 도 9의 928에서 좌측에 위치한 네 개의 픽셀들)의 그룹은 좌측 픽셀 그룹이라 하고, 제1 상단 픽셀 라인 상의 가용하지 않은 픽셀들(924)의 그룹은 상단 픽셀 그룹이라 한다. 도 9의 실시예에서, 상단 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=nS~nS*2-1, y=-1)로 나타내어질 수 있고, 좌측 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=-1, y=nS~nS+(nS>>1)-1)로 나타내어질 수 있다. Unavailable pixels among the surrounding luma pixels may constitute a pixel group as shown in 924 and 928 of FIG. 9 . In the embodiment of FIG. 9 , for convenience of description, a group of unavailable pixels on the first left pixel line (eg, four pixels located on the left side in 928 of FIG. 9 ) is referred to as a left pixel group, and the first upper pixel line The group of unavailable pixels 924 on the top is referred to as the top pixel group. In the embodiment of FIG. 9 , pixels belonging to the upper pixel group may be represented by P Y [x,y], (x=nS˜nS*2-1, y=-1), and pixels belonging to the left pixel group can be represented by P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

부호화기 및 복호화기는 패딩을 수행하기 위해 각각의 픽셀 그룹(예컨대, 좌측 픽셀 그룹, 상단 픽셀 그룹)의 양 쪽 끝에 상기 픽셀 그룹에 인접하여 위치한 가용한 픽셀이 존재하는지 여부를 판단할 수 있다.To perform padding, the encoder and decoder may determine whether available pixels located adjacent to the pixel group exist at both ends of each pixel group (eg, the left pixel group and the top pixel group).

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 9를 참조하면, 상단 픽셀 그룹(924)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(924)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.In one example, available pixels located adjacent to a pixel group may exist at only one end of the pixel group. Referring to FIG. 9 , no available pixels may exist on the right side of the upper pixel group 924, and there may be available pixels c on the left side of the upper pixel group 924. Here, pixel c may be represented by P Y [nS-1,-1].

이 경우, 제1 상단 픽셀 라인 내에서 상단 픽셀 그룹(924)에 인접하여 위치한 가용한 픽셀은 하나만 존재할 수 있다. 따라서, 부호화기 및 복호화기는 상단 픽셀 그룹에 인접하여 위치한 가용한 픽셀(c)의 픽셀 값을, 상단 픽셀 그룹(924) 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 11에 의해 나타내어질 수 있다.In this case, only one available pixel positioned adjacent to the upper pixel group 924 within the first upper pixel line may exist. Accordingly, the encoder and decoder may fill positions of unavailable pixels in the upper pixel group 924 with the pixel value of the available pixel c located adjacent to the upper pixel group 924 . This padding process may be represented by Equation 11 below as an example.

[수학식 11][Equation 11]

PY[x,y] = PY[nS-1,-1], (x=nS~nS*2-1, y=-1)P Y [x,y] = P Y [nS-1,-1], (x=nS~nS*2-1, y=-1)

다른 예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 양 쪽 끝에 존재할 수도 있다. 도 9를 참조하면, 좌측 픽셀 그룹의 상단에는 가용한 픽셀 b가 인접하여 위치할 수 있고, 좌측 픽셀 그룹의 하단에는 가용한 픽셀 a가 인접하여 위치할 수 있다. 여기서, 픽셀 a는 PY[-1, nS+(nS>>1)]로 나타내어질 수 있고, 픽셀 b는 PY[-1, nS-1]로 나타내어질 수 있다.As another example, available pixels located adjacent to a pixel group may exist at both ends of the pixel group. Referring to FIG. 9 , an available pixel b may be adjacently positioned at the top of the left pixel group, and an available pixel a may be adjacently positioned at the bottom of the left pixel group. Here, pixel a may be represented by P Y [-1, nS+(nS>>1)], and pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 12에 의해 나타내어질 수 있다.In this case, two available pixels positioned adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and decoder may fill the positions of the unavailable pixels in the left pixel group with the average pixel value of the available pixels (a, b) located adjacent to the left pixel group. This padding process may be represented by Equation 12 below as an example.

[수학식 12][Equation 12]

PY[x,y] = (PY[-1,nS-1] + PY[-1,nS+(nS>>1)] + 1) >> 1,P Y [x,y] = (P Y [-1,nS-1] + P Y [-1,nS+(nS>>1)] + 1) >> 1,

*187(x=-1, y=nS~nS+(nS>>1)-1)*187(x=-1, y=nS~nS+(nS>>1)-1)

상술한 패딩 과정에 의해 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들 및 제1 상단 픽셀 라인 상의 주변 루마 픽셀들의 픽셀 값들이 결정될 수 있다. 이 때, 부호화기 및 복호화기는 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(910) 내의 픽셀들의 픽셀 값을 기반으로, 루마 참조 정보(루마 참조 블록(930) 및 주변 루마 참조 픽셀들(940))를 생성할 수 있다. 다만, [-1,-1]의 위치에 존재하는 주변 루마 픽셀은 루마 참조 정보 생성에 사용되지 않을 수도 있다. 도 9의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 13에 의해 나타내어질 수 있다.Pixel values of the peripheral luma pixels on the first left pixel line and the peripheral luma pixels on the first upper pixel line may be determined through the above-described padding process. At this time, the encoder and the decoder use luma reference information (luma reference information) based on pixel values of neighboring luma pixels on the first left pixel line, neighboring luma pixels on the first upper pixel line, and pixels in the current luma block 910. Block 930 and surrounding luma reference pixels 940 may be created. However, a neighboring luma pixel existing at a position of [-1,-1] may not be used to generate luma reference information. In the embodiment of FIG. 9 , the process of generating luma reference information may be represented by Equation 13 below as an example.

[수학식 13][Equation 13]

PY'[x,y] = (PY[2x-1,y] + 2*PY[2x,y] + PY[2x+1,y] + 2) >> 2, (x=0~nS-1, y=-1)P Y '[x,y] = (P Y [2x-1,y] + 2*P Y [2x,y] + P Y [2x+1,y] + 2) >> 2, (x=0 ~nS-1, y=-1)

PY'[x,y] = (PY[x,2y] + PY[x,2y+1]) >> 1, (x=-1, y=0~nS-1)P Y '[x,y] = (P Y [x,2y] + P Y [x,2y+1]) >> 1, (x=-1, y=0~nS-1)

PY'[x,y] =(PRecY[2x,2y] + PRecY[2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)P Y '[x,y] = (P RecY [2x,2y] + P RecY [2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)

여기서, PRecY 는 현재 루마 블록 내 픽셀의 픽셀 값을 나타낼 수 있다. 또한, PY'는 루마 참조 정보에 해당되는 픽셀 값(예컨대, 루마 참조 블록 내의 픽셀 및/또는 주변 루마 참조 픽셀의 픽셀 값)을 나타낼 수 있다.Here, P RecY may represent a pixel value of a pixel in the current luma block. Also, P Y ′ may indicate a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a neighboring luma reference pixel).

도 10은 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 다른 실시예를 설명하기 위한 도면이다. 10 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.

도 10의 실시예는 현재 루마 블록(1010)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 및 현재 루마 블록(1010)의 상단에 가장 가까이 위치한 제1 상단 픽셀 라인 내의 주변 루마 픽셀들이 루마 참조 정보 생성에 사용되는 경우의 실시예를 도시한다. 도 10의 실시예에서, 현재 루마 블록(1010)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 픽셀 라인은 제2 좌측 픽셀 라인이라 지칭하기로 한다. 또한, 현재 루마 블록(1010)의 상단에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 상단 픽셀 라인의 상단에 인접하여 위치한 픽셀 라인은 제2 상단 픽셀 라인이라 지칭하기로 한다.In the embodiment of FIG. 10 , luma reference information is generated by neighboring luma pixels in the first left pixel line closest to the left side of the current luma block 1010 and the first upper pixel line closest to the top of the current luma block 1010 . It shows an embodiment when used in . In the embodiment of FIG. 10 , a pixel line positioned second closest to the left side of the current luma block 1010, that is, a pixel line positioned adjacent to the left side of the first left pixel line will be referred to as a second left pixel line. Also, a pixel line positioned second closest to the top of the current luma block 1010, that is, a pixel line positioned adjacent to the top of the first top pixel line will be referred to as a second top pixel line.

도 10의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 10에서 현재 루마 블록(1010)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 10의 실시예에서 도출되는 루마 참조 블록(1030)의 크기는 4x4일 수 있다. In the embodiment of FIG. 10 , it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, the LM mode may be represented as Intra_FromLuma. Also, in FIG. 10 , it is assumed that the size of the current luma block 1010 is 8x8 and the size of the current chroma block is 4x4. As described above, the size of the luma reference block to be used for prediction of the current chroma block may be the same as the size of the current chroma block. Accordingly, the size of the luma reference block 1030 derived in the embodiment of FIG. 10 may be 4x4.

또한, 도 10의 실시예에 도시된 주변 루마 픽셀들(1022, 1024, 1026, 1028) 중에서, 1022에 해당되는 주변 루마 픽셀들 및 1026에 해당되는 주변 루마 픽셀들은 가용한(available) 픽셀이고, 1024에 해당되는 주변 루마 픽셀들 및 1028에 해당되는 주변 루마 픽셀들은 가용하지 않은(unavailable) 픽셀이라 가정한다. 이 경우, 부호화기 및 복호화기는 가용하지 않은 주변 루마 픽셀에 대해 패딩 과정을 수행한 후에 루마 참조 정보를 생성할 수 있다.In addition, among the peripheral luma pixels 1022, 1024, 1026, and 1028 shown in the embodiment of FIG. 10 , peripheral luma pixels corresponding to 1022 and 1026 are available pixels, It is assumed that peripheral luma pixels corresponding to 1024 and 1028 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable neighboring luma pixels.

도 10의 실시예에서, 부호화기 및 복호화기는 제1 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행함으로써, 주변 루마 픽셀들의 픽셀 값 PY[x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)을 도출할 수 있다. 여기서, PY 는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, nS는 현재 루마 블록(1010)의 가로 길이 및 세로 길이를 나타낼 수 있다. In the embodiment of FIG. 10 , the encoder and decoder perform a padding process on unavailable peripheral luma pixels on the first left pixel line and the first upper pixel line, thereby obtaining pixel values P Y [x,y] of the peripheral luma pixels. , (x = -1, y = -1 ~ nS * 2-1), (x = 0 ~ nS * 2-1, y = -1) can be derived. Here, P Y may represent a pixel value of a neighboring luma pixel. Also, nS may represent the horizontal and vertical lengths of the current luma block 1010 .

주변 루마 픽셀들 중에서 가용하지 않은 픽셀들은 도 10의 1024, 1028과 같이 픽셀 그룹을 구성할 수 있다. 도 10의 실시예에서는 설명의 편의상 제1 좌측 픽셀 라인 상의 가용하지 않은 픽셀들(예컨대, 도 10의 1028에서 좌측에 위치한 네 개의 픽셀들)의 그룹은 좌측 픽셀 그룹이라 하고, 제1 상단 픽셀 라인 상의 가용하지 않은 픽셀들(1024)의 그룹은 상단 픽셀 그룹이라 한다. 도 10의 실시예에서, 상단 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=nS~nS*2-1, y=-1)로 나타내어질 수 있고, 좌측 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=-1, y=nS~nS+(nS>>1)-1)로 나타내어질 수 있다. Unavailable pixels among the surrounding luma pixels may constitute a pixel group as shown in 1024 and 1028 of FIG. 10 . In the embodiment of FIG. 10 , for convenience of description, a group of unavailable pixels on the first left pixel line (eg, four pixels located on the left side in 1028 of FIG. 10 ) is referred to as a left pixel group, and the first upper pixel line The group of unavailable pixels 1024 on the top is referred to as the top pixel group. 10 , pixels belonging to the upper pixel group may be represented by P Y [x,y], (x=nS˜nS*2-1, y=-1), and pixels belonging to the left pixel group can be represented by P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

부호화기 및 복호화기는 패딩을 수행하기 위해 각각의 픽셀 그룹(예컨대, 좌측 픽셀 그룹, 상단 픽셀 그룹)의 양 쪽 끝에 상기 픽셀 그룹에 인접하여 위치한 가용한 픽셀이 존재하는지 여부를 판단할 수 있다.To perform padding, the encoder and decoder may determine whether available pixels located adjacent to the pixel group exist at both ends of each pixel group (eg, the left pixel group and the top pixel group).

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 10을 참조하면, 상단 픽셀 그룹(1024)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1024)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.In one example, available pixels located adjacent to a pixel group may exist at only one end of the pixel group. Referring to FIG. 10 , no available pixels may exist on the right side of the upper pixel group 1024, and there may be available pixels c on the left side of the upper pixel group 1024. Here, pixel c may be represented by P Y [nS-1,-1].

이 경우, 제1 상단 픽셀 라인 내에서 상단 픽셀 그룹(1024)에 인접하여 위치한 가용한 픽셀은 하나만 존재할 수 있다. 따라서, 부호화기 및 복호화기는 상단 픽셀 그룹에 인접하여 위치한 가용한 픽셀(c)의 픽셀 값을, 상단 픽셀 그룹(1024) 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 14에 의해 나타내어질 수 있다.In this case, only one available pixel positioned adjacent to the upper pixel group 1024 within the first upper pixel line may exist. Accordingly, the encoder and decoder may fill positions of unavailable pixels in the upper pixel group 1024 with the pixel value of the available pixel c located adjacent to the upper pixel group. This padding process may be represented by Equation 14 below as an example.

[수학식 14][Equation 14]

PY[x,y] = PY[nS-1,-1], (x=nS~nS*2-1, y=-1)P Y [x,y] = P Y [nS-1,-1], (x=nS~nS*2-1, y=-1)

다른 예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 양 쪽 끝에 존재할 수도 있다. 도 10을 참조하면, 좌측 픽셀 그룹의 상단에는 가용한 픽셀 b가 인접하여 위치할 수 있고, 좌측 픽셀 그룹의 하단에는 가용한 픽셀 a가 인접하여 위치할 수 있다. 여기서, 픽셀 a는 PY[-1, nS+(nS>>1)]로 나타내어질 수 있고, 픽셀 b는 PY[-1, nS-1]로 나타내어질 수 있다.As another example, available pixels located adjacent to a pixel group may exist at both ends of the pixel group. Referring to FIG. 10 , an available pixel b may be adjacently positioned at the top of the left pixel group, and an available pixel a may be adjacently positioned at the bottom of the left pixel group. Here, pixel a may be represented by P Y [-1, nS+(nS>>1)], and pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 15에 의해 나타내어질 수 있다.In this case, two available pixels positioned adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and decoder may fill the positions of the unavailable pixels in the left pixel group with the average pixel value of the available pixels (a, b) located adjacent to the left pixel group. This padding process may be represented by Equation 15 below as an example.

[수학식 15][Equation 15]

PY[x,y] = (PY[-1,nS-1] + PY[-1,nS+(nS>>1)] + 1) >> 1,P Y [x,y] = (P Y [-1,nS-1] + P Y [-1,nS+(nS>>1)] + 1) >> 1,

*209(x=-1, y=nS~nS+(nS>>1)-1)*209(x=-1, y=nS~nS+(nS>>1)-1)

상술한 패딩 과정에 의해 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들 및 제1 상단 픽셀 라인 상의 주변 루마 픽셀들의 픽셀 값들이 결정될 수 있다. 부호화기 및 복호화기는 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(1010) 내의 픽셀들의 픽셀 값을 기반으로, 루마 참조 정보(루마 참조 블록(1030) 및 주변 루마 참조 픽셀들(1040))를 생성할 수 있다. Pixel values of the peripheral luma pixels on the first left pixel line and the peripheral luma pixels on the first upper pixel line may be determined through the above-described padding process. The encoder and the decoder use luma reference information (the luma reference block 1030) based on pixel values of neighboring luma pixels on the first left pixel line, neighboring luma pixels on the first upper pixel line, and pixels in the current luma block 1010. ) and surrounding luma reference pixels 1040).

이 때, 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 제2 좌측 픽셀 라인 상의 픽셀들 중에는 가용한 픽셀들이 존재할 수 있다. 제1 좌측 픽셀 라인 상의 픽셀의 좌측에 인접하여 위치한 픽셀(제2 좌측 픽셀 라인 상의 픽셀)이 가용한 경우, 부호화기 및 복호화기는 상기 제1 좌측 픽셀 라인 상의 픽셀 대신 이에 인접하여 위치한 제2 좌측 픽셀 라인 상의 픽셀을 루마 참조 정보 생성에 이용할 수 있다. 그러나, 제1 좌측 픽셀 라인 상의 픽셀의 좌측에 인접하여 위치한 픽셀(제2 좌측 픽셀 라인 상의 픽셀)이 가용하지 않은 경우, 부호화기 및 복호화기는 패딩 과정이 수행된 제1 좌측 픽셀 라인 상의 픽셀을 루마 참조 정보 생성에 이용할 수 있다. In this case, available pixels may exist among pixels on the second left pixel line adjacent to the left side of the first left pixel line. If a pixel located adjacent to the left of a pixel on the first left pixel line (a pixel on a second left pixel line) is available, the encoder and decoder use a pixel located adjacent to the second left pixel line instead of a pixel on the first left pixel line. Pixels of the image may be used to generate luma reference information. However, if a pixel located adjacent to the left side of a pixel on the first left pixel line (a pixel on the second left pixel line) is not available, the encoder and decoder refer to the pixel on the first left pixel line on which the padding process has been performed as luma. Can be used to generate information.

도 10의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 16에 의해 나타내어질 수 있다.In the embodiment of FIG. 10 , the process of generating luma reference information may be represented by Equation 16 below as an example.

[수학식 16][Equation 16]

PY'[x,y] = (PY[2x-1,y] + 2*PY[2x,y] + PY[2x+1,y] + 2) >> 2, (x=0~nS-1, y=-1)P Y '[x,y] = (P Y [2x-1,y] + 2*P Y [2x,y] + P Y [2x+1,y] + 2) >> 2, (x=0 ~nS-1, y=-1)

PY'[x,y] = (PRecY[2x,2y] + PRecY[2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)P Y '[x,y] = (P RecY [2x,2y] + P RecY [2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)

만일, PY[2x,2y], (x=-1, y=0~nS-1)이 가용하면,If P Y [2x,2y], (x=-1, y=0~nS-1) is available,

PY'[x,y] = (PY[2x,2y] + PY[2x,2y+1]) >> 1, (x=-1, y=0~nS-1)P Y '[x,y] = (P Y [2x,2y] + P Y [2x,2y+1]) >> 1, (x=-1, y=0~nS-1)

만일, PY[2x,2y], (x=-1, y=0~nS-1)이 가용하지 않으면,If P Y [2x,2y], (x=-1, y=0~nS-1) is not available,

PY'[x,y] = (PY[x,2y] + PY[x,2y+1]) >> 1, (x=-1, y=0~nS-1)P Y '[x,y] = (P Y [x,2y] + P Y [x,2y+1]) >> 1, (x=-1, y=0~nS-1)

여기서, PRecY 는 현재 루마 블록 내 픽셀의 픽셀 값을 나타낼 수 있다. 또한, PY'는 루마 참조 정보에 해당되는 픽셀 값(예컨대, 루마 참조 블록 내의 픽셀 및/또는 주변 루마 참조 픽셀의 픽셀 값)을 나타낼 수 있다.Here, P RecY may represent a pixel value of a pixel in the current luma block. Also, P Y ′ may indicate a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a neighboring luma reference pixel).

도 11은 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 또 다른 실시예를 설명하기 위한 도면이다. 11 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.

도 11의 실시예는 현재 루마 블록(1110)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 및 현재 루마 블록(1110)의 상단에 가장 가까이 위치한 제1 상단 픽셀 라인 내의 주변 루마 픽셀들이 루마 참조 정보 생성에 사용되는 경우의 실시예를 도시한다. 도 11의 실시예에서, 현재 루마 블록(1110)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 픽셀 라인은 제2 좌측 픽셀 라인이라 지칭하기로 한다. 또한, 현재 루마 블록(1110)의 상단에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 상단 픽셀 라인의 상단에 인접하여 위치한 픽셀 라인은 제2 상단 픽셀 라인이라 지칭하기로 한다.In the embodiment of FIG. 11 , luma reference information is generated by neighboring luma pixels in the first left pixel line closest to the left side of the current luma block 1110 and the first upper pixel line closest to the top of the current luma block 1110 . It shows an embodiment when used in . In the embodiment of FIG. 11 , a pixel line positioned second closest to the left side of the current luma block 1110, that is, a pixel line positioned adjacent to the left side of the first left pixel line will be referred to as a second left pixel line. Also, a pixel line positioned second closest to the top of the current luma block 1110, that is, a pixel line positioned adjacent to the top of the first top pixel line will be referred to as a second top pixel line.

도 11의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 11에서 현재 루마 블록(1110)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 11의 실시예에서 도출되는 루마 참조 블록(1130)의 크기는 4x4일 수 있다. In the embodiment of FIG. 11 , it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, the LM mode may be represented as Intra_FromLuma. 11, it is assumed that the size of the current luma block 1110 is 8x8 and the size of the current chroma block is 4x4. As described above, the size of the luma reference block to be used for prediction of the current chroma block may be the same as the size of the current chroma block. Accordingly, the size of the luma reference block 1130 derived in the embodiment of FIG. 11 may be 4x4.

또한, 도 11의 실시예에 도시된 주변 루마 픽셀들(1122, 1124, 1126, 1128) 중에서, 1122에 해당되는 주변 루마 픽셀들 및 1126에 해당되는 주변 루마 픽셀들은 가용한(available) 픽셀이고, 1124에 해당되는 주변 루마 픽셀들 및 1128에 해당되는 주변 루마 픽셀들은 가용하지 않은(unavailable) 픽셀이라 가정한다. 이 경우, 부호화기 및 복호화기는 가용하지 않은 주변 루마 픽셀에 대해 패딩 과정을 수행한 후에 루마 참조 정보를 생성할 수 있다.In addition, among the peripheral luma pixels 1122, 1124, 1126, and 1128 shown in the embodiment of FIG. 11, the peripheral luma pixels corresponding to 1122 and 1126 are available pixels, It is assumed that peripheral luma pixels corresponding to 1124 and 1128 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable neighboring luma pixels.

도 11의 실시예에서, 부호화기 및 복호화기는 제1 좌측 픽셀 라인, 제2 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행할 수 있다. 그리고, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피할 수 있다. 상술한 과정에 의해 생성되는, 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값은 다음 수학식 17에 의해 나타내어질 수 있다.In the embodiment of FIG. 11 , the encoder and decoder may perform a padding process on unavailable peripheral luma pixels on the first left pixel line, the second left pixel line, and the first upper pixel line. Also, the encoder and decoder may copy peripheral luma pixel values on the second left pixel line to the first left pixel line. Pixel values of neighboring luma pixels generated by the above-described process and used for generating reference information may be expressed by Equation 17 below.

[수학식 17][Equation 17]

PY[x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)P Y [x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)

여기서, PY 는 제1 좌측 픽셀 라인 및/또는 제1 상단 픽셀 라인에 속한 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, nS는 현재 루마 블록(1110)의 가로 길이 및 세로 길이를 나타낼 수 있다. Here, P Y may represent pixel values of peripheral luma pixels belonging to the first left pixel line and/or the first upper pixel line. Also, nS may represent the horizontal and vertical lengths of the current luma block 1110 .

주변 루마 픽셀들 중에서 가용하지 않은 픽셀들은 도 11의 1124, 1128과 같이 픽셀 그룹을 구성할 수 있다. 도 11의 실시예에서는 설명의 편의상 제1 좌측 픽셀 라인 상의 가용하지 않은 픽셀들(예컨대, 도 11의 1128에서 좌측에 위치한 네 개의 픽셀들)의 그룹은 제1 좌측 픽셀 그룹이라 하고, 제2 좌측 픽셀 라인 상의 가용하지 않은 픽셀들(예컨대, 도 11의 1128에서 우측에 위치한 네 개의 픽셀들)의 그룹은 제2 좌측 픽셀 그룹이라 하며, 제1 상단 픽셀 라인 상의 가용하지 않은 픽셀들(1124)의 그룹은 상단 픽셀 그룹이라 한다. 도 11의 실시예에서, 상단 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=nS~nS*2-1, y=-1)로 나타내어질 수 있고, 제1 좌측 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=-1, y=nS~nS+(nS>>1)-1)로 나타내어질 수 있으며, 제2 좌측 픽셀 그룹에 속한 픽셀들은 PY2[x,y], (x=-2, y=nS~nS+(nS>>1)-1)로 나타내어질 수 있다. 여기서, PY2 는 제2 좌측 픽셀 라인에 속한 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다.Unavailable pixels among the surrounding luma pixels may constitute a pixel group as shown in 1124 and 1128 of FIG. 11 . In the embodiment of FIG. 11, for convenience of explanation, a group of unavailable pixels on the first left pixel line (eg, four pixels located on the left side in 1128 of FIG. 11) is referred to as a first left pixel group, and a second left pixel group The group of unavailable pixels on the pixel line (e.g., the four pixels located on the right in 1128 of FIG. The group is referred to as the top pixel group. 11 , pixels belonging to the upper pixel group may be represented by P Y [x,y], (x=nS˜nS*2-1, y=-1), and in the first left pixel group The belonging pixels may be represented by P Y [x, y], (x = -1, y = nS ~ nS + (nS>> 1) -1), and the pixels belonging to the second left pixel group are P Y2 [x ,y], (x=-2, y=nS~nS+(nS>>1)-1). Here, P Y2 may indicate a pixel value of a peripheral luma pixel belonging to the second left pixel line.

부호화기 및 복호화기는 패딩을 수행하기 위해 각각의 픽셀 그룹(예컨대, 제1 좌측 픽셀 그룹, 제2 좌측 픽셀 그룹, 상단 픽셀 그룹)의 양 쪽 끝에 상기 픽셀 그룹에 인접하여 위치한 가용한 픽셀이 존재하는지 여부를 판단할 수 있다.The encoder and the decoder determine whether there are available pixels located adjacent to the pixel group at both ends of each pixel group (e.g., the first left pixel group, the second left pixel group, and the top pixel group) to perform padding. can judge

일 실시예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 11을 참조하면, 상단 픽셀 그룹(1124)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1124)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.In one embodiment, usable pixels located adjacent to a pixel group may exist at only one end of the pixel group. Referring to FIG. 11 , no usable pixels may exist on the right side of the upper pixel group 1124, and there may be an available pixel c on the left side of the upper pixel group 1124. Here, pixel c may be represented by P Y [nS-1,-1].

이 경우, 제1 상단 픽셀 라인 내에서 상단 픽셀 그룹(1124)에 인접하여 위치한 가용한 픽셀은 하나만 존재할 수 있다. 따라서, 부호화기 및 복호화기는 상단 픽셀 그룹에 인접하여 위치한 가용한 픽셀(c)의 픽셀 값을, 상단 픽셀 그룹(1124) 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 18에 의해 나타내어질 수 있다.In this case, only one available pixel positioned adjacent to the upper pixel group 1124 within the first upper pixel line may exist. Accordingly, the encoder and decoder may fill positions of unavailable pixels in the upper pixel group 1124 with the pixel value of the available pixel c located adjacent to the upper pixel group. This padding process may be represented by Equation 18 below as an example.

[수학식 18][Equation 18]

PY[x,y] = PY[nS-1,-1], (x=nS~nS*2-1, y=-1)P Y [x,y] = P Y [nS-1,-1], (x=nS~nS*2-1, y=-1)

다른 실시예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 양 쪽 끝에 존재할 수도 있다. In another embodiment, available pixels located adjacent to a pixel group may exist at both ends of the pixel group.

일례로, 도 11의 실시예에서 제1 좌측 픽셀 그룹의 상단에는 가용한 픽셀 b가 인접하여 위치할 수 있고, 제1 좌측 픽셀 그룹의 하단에는 가용한 픽셀 a가 인접하여 위치할 수 있다. 여기서, 픽셀 a는 PY[-1, nS+(nS>>1)]로 나타내어질 수 있고, 픽셀 b는 PY[-1, nS-1]로 나타내어질 수 있다.For example, in the embodiment of FIG. 11 , an available pixel b may be adjacently located at the upper end of the first left pixel group, and an available pixel a may be adjacently located at the lower end of the first left pixel group. Here, pixel a may be represented by P Y [-1, nS+(nS>>1)], and pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 제1 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 제1 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 19에 의해 나타내어질 수 있다.In this case, two available pixels positioned adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and decoder may fill the positions of the unavailable pixels in the first left pixel group with the average pixel values of the available pixels a and b located adjacent to the first left pixel group. This padding process may be represented by Equation 19 below as an example.

[수학식 19][Equation 19]

PY[x,y] = (PY[-1,nS-1] + PY[-1,nS+(nS>>1)] + 1) >> 1,P Y [x,y] = (P Y [-1,nS-1] + P Y [-1,nS+(nS>>1)] + 1) >> 1,

(x=-1, y=nS~nS+(nS>>1)-1)(x=-1, y=nS~nS+(nS>>1)-1)

다른 예로, 도 11의 실시예에서 제2 좌측 픽셀 그룹의 상단에는 가용한 픽셀 e가 인접하여 위치할 수 있고, 제2 좌측 픽셀 그룹의 하단에는 가용한 픽셀 d가 인접하여 위치할 수 있다. 여기서, 픽셀 d는 PY2[-2, nS+(nS>>1)]로 나타내어질 수 있고, 픽셀 e는 PY2[-2, nS-1]로 나타내어질 수 있다.As another example, in the embodiment of FIG. 11 , an available pixel e may be adjacently located at the upper end of the second left pixel group, and an available pixel d may be adjacently located at the lower end of the second left pixel group. Here, pixel d may be represented by P Y2 [-2, nS+(nS>>1)], and pixel e may be represented by P Y2 [-2, nS-1].

이 경우, 제2 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 제2 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(e,d)의 픽셀 평균 값을, 제2 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 20에 의해 나타내어질 수 있다.In this case, two available pixels positioned adjacent to the left pixel group in the second left pixel line may exist. Accordingly, the encoder and decoder may fill the positions of the unavailable pixels in the second left pixel group with the average pixel values of the available pixels e and d located adjacent to the second left pixel group. This padding process may be represented by Equation 20 below as an example.

[수학식 20][Equation 20]

PY2[x,y] = (PY2[-2,nS-1] + PY2[-2,nS+(nS>>1)] + 1) >> 1,P Y2 [x,y] = (P Y2 [-2,nS-1] + P Y2 [-2,nS+(nS>>1)] + 1) >> 1,

(x=-2, y=nS~nS+(nS>>1)-1)(x=-2, y=nS~nS+(nS>>1)-1)

패딩 과정이 수행된 후에 결정된 제2 좌측 픽셀 라인 상의 픽셀 값들은 일례로 PY2[x,y], (x=-2, y=-1~2*nS-1)로 나타내어질 수 있다.Pixel values on the second left pixel line determined after the padding process is performed may be expressed as, for example, P Y2 [x,y], (x=-2, y=-1 to 2*nS-1).

상술한 패딩 과정에 의해 제1 좌측 픽셀 라인, 제2 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 주변 루마 픽셀들의 픽셀 값들이 결정될 수 있다. 이 때, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피함으로써, 루마 참조 정보 생성에 사용될 제1 좌측 픽셀 라인 상의 픽셀 값들을 도출할 수 있다. 즉, 부호화기 및 복호화기는 제1 좌측 픽셀 라인의 주변 루마 픽셀 값들을 제2 좌측 픽셀 라인의 주변 루마 픽셀 값으로 대체할 수 있다. 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피하는 과정은 일례로 다음 수학식 21에 의해 나타내어질 수 있다.Pixel values of peripheral luma pixels on the first left pixel line, the second left pixel line, and the first upper pixel line may be determined by the padding process described above. In this case, the encoder and the decoder may copy peripheral luma pixel values on the second left pixel line to the first left pixel line to derive pixel values on the first left pixel line to be used for generating luma reference information. That is, the encoder and decoder may replace the luma pixel values of the first left pixel line with the luma pixel values of the second left pixel line. A process of copying the peripheral luma pixel values on the second left pixel line to the first left pixel line may be expressed by Equation 21 below, for example.

[수학식 21][Equation 21]

PY[x,y] = PY2[x-1,y], (x=-1, y=0~2*nS-1)P Y [x,y] = P Y2 [x-1,y], (x=-1, y=0~2*nS-1)

제2 촤즉 픽셀 라인 상의 주변 루마 픽셀 값들이 제1 좌측 픽셀 라인에 카피된 후, 부호화기 및 복호화기는 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(1110) 내의 픽셀들의 픽셀 값을 기반으로, 루마 참조 정보(루마 참조 블록(1130) 및 주변 루마 참조 픽셀들(1140))을 생성할 수 있다. 도 11의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 22에 의해 나타내어질 수 있다.After the ambient luma pixel values on the second, i.e., pixel line are copied to the first left pixel line, the encoder and decoder calculate the ambient luma pixels on the first left pixel line, the ambient luma pixels on the first top pixel line, and the current luma block. Based on the pixel values of pixels in 1110 , luma reference information (a luma reference block 1130 and neighboring luma reference pixels 1140 ) may be generated. In the embodiment of FIG. 11 , the process of generating luma reference information may be represented by Equation 22 below as an example.

[수학식 22][Equation 22]

PY'[x,y] = (PY[2x-1,y] + 2*PY[2x,y] + PY[2x+1,y] + 2) >> 2, (x=0~nS-1, y=-1)P Y '[x,y] = (P Y [2x-1,y] + 2*P Y [2x,y] + P Y [2x+1,y] + 2) >> 2, (x=0 ~nS-1, y=-1)

PY'[x,y] = (PY[x,2y] + PY[x,2y+1]) >> 1, (x=-1, y=0~nS-1)P Y '[x,y] = (P Y [x,2y] + P Y [x,2y+1]) >> 1, (x=-1, y=0~nS-1)

PY'[x,y] = (PRecY[2x,2y] + PRecY[2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)P Y '[x,y] = (P RecY [2x,2y] + P RecY [2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)

여기서, PRecY 는 현재 루마 블록 내 픽셀의 픽셀 값을 나타낼 수 있다. 또한, PY'는 루마 참조 정보에 해당되는 픽셀 값(예컨대, 루마 참조 블록 내의 픽셀 및/또는 주변 루마 참조 픽셀의 픽셀 값)을 나타낼 수 있다.Here, P RecY may represent a pixel value of a pixel in the current luma block. Also, P Y ′ may indicate a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a neighboring luma reference pixel).

도 12는 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 또 다른 실시예를 설명하기 위한 도면이다.12 is a diagram for explaining another embodiment of a process of generating luma reference information after performing a padding process.

도 12의 실시에는 현재 루마 블록(1210)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 및 현재 루마 블록(1210)의 상단에 가장 가까이 위치한 제1 상단 픽셀 라인 내의 주변 루마 픽셀들이 루마 참조 정보 생성에 사용되는 경우의 실시예를 도시한다. 도 12의 실시예에서, 현재 루마 블록(1210)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 픽셀 라인은 제2 좌측 픽셀 라인이라 지칭하기로 한다. 또한, 현재 루마 블록(1210)의 상단에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 상단 픽셀 라인의 상단에 인접하여 위치한 픽셀 라인은 제2 상단 픽셀 라인이라 지칭하기로 한다.In the embodiment of FIG. 12 , the surrounding luma pixels in the first left pixel line closest to the left side of the current luma block 1210 and the first upper pixel line closest to the top of the current luma block 1210 generate luma reference information. It shows an example of a case in which it is used. In the embodiment of FIG. 12 , a pixel line positioned second closest to the left side of the current luma block 1210, that is, a pixel line positioned adjacent to the left side of the first left pixel line will be referred to as a second left pixel line. Also, a pixel line positioned second closest to the top of the current luma block 1210, that is, a pixel line positioned adjacent to the top of the first top pixel line will be referred to as a second top pixel line.

도 12의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 12에서 현재 루마 블록(1210)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 12의 실시예에서 도출되는 루마 참조 블록(1230)의 크기는 4x4일 수 있다. In the embodiment of FIG. 12 , it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, the LM mode may be represented as Intra_FromLuma. 12, it is assumed that the size of the current luma block 1210 is 8x8 and the size of the current chroma block is 4x4. As described above, the size of the luma reference block to be used for prediction of the current chroma block may be the same as the size of the current chroma block. Accordingly, the size of the luma reference block 1230 derived in the embodiment of FIG. 12 may be 4x4.

또한, 도 12의 실시예에 도시된 주변 루마 픽셀들(1222, 1224, 1226, 1228) 중에서, 1222에 해당되는 주변 루마 픽셀들 및 1226에 해당되는 주변 루마 픽셀들은 가용한(available) 픽셀이고, 1224에 해당되는 주변 루마 픽셀들 및 1228에 해당되는 주변 루마 픽셀들은 가용하지 않은(unavailable) 픽셀이라 가정한다. 이 경우, 부호화기 및 복호화기는 가용하지 않은 주변 루마 픽셀에 대해 패딩 과정을 수행한 후에 루마 참조 정보를 생성할 수 있다.In addition, among the peripheral luma pixels 1222, 1224, 1226, and 1228 shown in the embodiment of FIG. 12, the peripheral luma pixels corresponding to 1222 and 1226 are available pixels, It is assumed that peripheral luma pixels corresponding to 1224 and 1228 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable neighboring luma pixels.

도 12의 실시예에서, 부호화기 및 복호화기는 제1 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행함으로써, 주변 루마 픽셀들의 픽셀 값 PY[x,y], (x=-1, y=-1~nS*2-1), (x=0~nS*2-1, y=-1)을 도출할 수 있다. 여기서, PY 는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, nS는 현재 루마 블록(1210)의 가로 길이 및 세로 길이를 나타낼 수 있다.In the embodiment of FIG. 12 , the encoder and decoder perform a padding process on unavailable peripheral luma pixels on the first left pixel line and the first upper pixel line, thereby obtaining pixel values of the peripheral luma pixels P Y [x,y] , (x = -1, y = -1 ~ nS * 2-1), (x = 0 ~ nS * 2-1, y = -1) can be derived. Here, P Y may represent a pixel value of a neighboring luma pixel. Also, nS may represent the horizontal and vertical lengths of the current luma block 1210 .

주변 루마 픽셀들 중에서 가용하지 않은 픽셀들은 도 12의 1224, 1228과 같이 픽셀 그룹을 구성할 수 있다. 도 12의 실시예에서는 설명의 편의상 제1 좌측 픽셀 라인 상의 가용하지 않은 픽셀들(예컨대, 도 12의 1228에서 좌측에 위치한 네 개의 픽셀들)의 그룹은 좌측 픽셀 그룹이라 하고, 제1 상단 픽셀 라인 상의 가용하지 않은 픽셀들(1224)의 그룹은 상단 픽셀 그룹이라 한다. 도 12의 실시예에서, 상단 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=nS~nS*2-1, y=-1)로 나타내어질 수 있고, 좌측 픽셀 그룹에 속한 픽셀들은 PY[x,y], (x=-1, y=nS~nS+(nS>>1)-1)로 나타내어질 수 있다. Unavailable pixels among the surrounding luma pixels may constitute a pixel group as shown in 1224 and 1228 of FIG. 12 . In the embodiment of FIG. 12, for convenience of description, a group of unavailable pixels on the first left pixel line (eg, four pixels located on the left side in 1228 of FIG. 12) is referred to as a left pixel group, and the first upper pixel line The group of unavailable pixels 1224 on the top is referred to as the top pixel group. 12 , pixels belonging to the upper pixel group may be represented by P Y [x,y], (x=nS˜nS*2-1, y=-1), and pixels belonging to the left pixel group can be represented by P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

부호화기 및 복호화기는 패딩을 수행하기 위해 각각의 픽셀 그룹(예컨대, 좌측 픽셀 그룹, 상단 픽셀 그룹)의 양 쪽 끝에 상기 픽셀 그룹에 인접하여 위치한 가용한 픽셀이 존재하는지 여부를 판단할 수 있다.To perform padding, the encoder and decoder may determine whether available pixels located adjacent to the pixel group exist at both ends of each pixel group (eg, the left pixel group and the top pixel group).

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 12를 참조하면, 상단 픽셀 그룹(1224)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1224)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.In one example, available pixels located adjacent to a pixel group may exist at only one end of the pixel group. Referring to FIG. 12 , there may be no available pixels on the right side of the upper pixel group 1224, and an available pixel c on the left side of the upper pixel group 1224. Here, pixel c may be represented by P Y [nS-1,-1].

이 경우, 제1 상단 픽셀 라인 내에서 상단 픽셀 그룹(1224)에 인접하여 위치한 가용한 픽셀은 하나만 존재할 수 있다. 따라서, 부호화기 및 복호화기는 상단 픽셀 그룹에 인접하여 위치한 가용한 픽셀(c)의 픽셀 값을, 상단 픽셀 그룹(1224) 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 23에 의해 나타내어질 수 있다.In this case, only one available pixel positioned adjacent to the upper pixel group 1224 within the first upper pixel line may exist. Accordingly, the encoder and decoder may fill positions of unavailable pixels in the upper pixel group 1224 with the pixel value of the available pixel c located adjacent to the upper pixel group. This padding process may be represented by Equation 23 below as an example.

[수학식 23][Equation 23]

PY[x,y] = PY[nS-1,-1], (x=nS~nS*2-1, y=-1)P Y [x,y] = P Y [nS-1,-1], (x=nS~nS*2-1, y=-1)

다른 예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 양 쪽 끝에 존재할 수도 있다. 도 12를 참조하면, 좌측 픽셀 그룹의 상단에는 가용한 픽셀 b가 인접하여 위치할 수 있고, 좌측 픽셀 그룹의 하단에는 가용한 픽셀 a가 인접하여 위치할 수 있다. 여기서, 픽셀 a는 PY[-1, nS+(nS>>1)]로 나타내어질 수 있고, 픽셀 b는 PY[-1, nS-1]로 나타내어질 수 있다.As another example, available pixels located adjacent to a pixel group may exist at both ends of the pixel group. Referring to FIG. 12 , an available pixel b may be adjacently positioned at the top of the left pixel group, and an available pixel a may be adjacently positioned at the bottom of the left pixel group. Here, pixel a may be represented by P Y [-1, nS+(nS>>1)], and pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 24에 의해 나타내어질 수 있다.In this case, two available pixels positioned adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and decoder may fill the positions of the unavailable pixels in the left pixel group with the average pixel value of the available pixels (a, b) located adjacent to the left pixel group. This padding process may be represented by Equation 24 below as an example.

[수학식 24][Equation 24]

PY[x,y] = (PY[-1,nS-1] + PY[-1,nS+(nS>>1)] + 1) >> 1,P Y [x,y] = (P Y [-1,nS-1] + P Y [-1,nS+(nS>>1)] + 1) >> 1,

*271(x=-1, y=nS~nS+(nS>>1)-1)*271(x=-1, y=nS~nS+(nS>>1)-1)

상술한 패딩 과정에 의해 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들 및 제1 상단 픽셀 라인 상의 주변 루마 픽셀들의 픽셀 값들이 결정될 수 있다. 부호화기 및 복호화기는 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(1210) 내의 픽셀들의 픽셀 값을 기반으로, 루마 참조 정보(루마 참조 블록(1230) 및 주변 루마 참조 픽셀들(1240))를 생성할 수 있다. 도 12의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 25에 의해 나타내어질 수 있다.Pixel values of the peripheral luma pixels on the first left pixel line and the peripheral luma pixels on the first upper pixel line may be determined through the above-described padding process. The encoder and the decoder use luma reference information (the luma reference block 1230 based on pixel values of neighboring luma pixels on the first left pixel line, neighboring luma pixels on the first upper pixel line, and pixels in the current luma block 1210). ) and surrounding luma reference pixels 1240). In the embodiment of FIG. 12 , the process of generating luma reference information may be represented by Equation 25 below as an example.

[수학식 25][Equation 25]

PY'[x,y] = (PY[2x-1,y] + 2*PY[2x,y] + PY[2x+1,y] + 2) >> 2, (x=0~nS-1, y=-1)P Y '[x,y] = (P Y [2x-1,y] + 2*P Y [2x,y] + P Y [2x+1,y] + 2) >> 2, (x=0 ~nS-1, y=-1)

PY'[x,y] =(PRecY[2x,2y] + PRecY[2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)P Y '[x,y] = (P RecY [2x,2y] + P RecY [2x,2y+1]) >> 1, (x=0~nS-1, y=0~nS-1)

PY'[x,y] = (PY[x,2y] + PY[x,2y+1]) >> 1, (x=-1, y=0~nS-1)P Y '[x,y] = (P Y [x,2y] + P Y [x,2y+1]) >> 1, (x=-1, y=0~nS-1)

여기서, PRecY 는 현재 루마 블록 내 픽셀의 픽셀 값을 나타낼 수 있다. 또한, PY'는 루마 참조 정보에 해당되는 픽셀 값(예컨대, 루마 참조 블록 내의 픽셀 및/또는 주변 루마 참조 픽셀의 픽셀 값)을 나타낼 수 있다.Here, P RecY may represent a pixel value of a pixel in the current luma block. Also, P Y ′ may indicate a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a neighboring luma reference pixel).

상술한 내용을 참고하면, 도 12의 실시예에서는 제2 좌측 픽셀 라인 상의 픽셀들은 루마 참조 정보 생성에 사용되지 않고, 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(1210) 내의 픽셀들만이 루마 참조 정보(루마 참조 블록(1230) 및 주변 루마 참조 픽셀들(1240)) 생성에 사용될 수 있다.Referring to the foregoing, in the embodiment of FIG. 12 , pixels on the second left pixel line are not used to generate luma reference information, and peripheral luma pixels on the first left pixel line and peripheral luma pixels on the first upper pixel line are not used to generate luma reference information. and only the pixels within the current luma block 1210 may be used for generating luma reference information (the luma reference block 1230 and surrounding luma reference pixels 1240).

한편, 상술한 도 5 내지 도 12에서는 제1 색 성분이 루마 성분이고 제2 색 성분이 크로마 성분인 경우의 실시예들이 서술되고 있으나, 본 발명은 이에 한정되어 적용되는 것은 아니다. 상술한 바와 같이 본 발명은 제1 색 성분 및 제2 색 성분의 가능한 모든 조합에 대해 동일하거나 유사한 방식으로 적용될 수 있다.Meanwhile, in FIGS. 5 to 12 described above, embodiments in which the first color component is a luma component and the second color component is a chroma component are described, but the present invention is not limited thereto. As described above, the present invention can be applied in the same or similar manner to all possible combinations of the first color component and the second color component.

또한, 상술한 도 6 내지 도 12에서는 제1 색 성분 블록(예컨대, 루마 블록)의 크기가 제2 색 성분 블록(예컨대, 크로마 블록)의 크기보다 큰 경우의 실시예들이 서술되었으나, 제1 색 성분 블록은 제2 색 성분 블록보다 작은 크기를 가질 수도 있고 또는 동일한 크기를 가질 수도 있다. In addition, in FIGS. 6 to 12 described above, embodiments in which the size of the first color component block (eg, luma block) is greater than the size of the second color component block (eg, chroma block) have been described, but the first color component block (eg, chroma block) has been described. The component block may have a smaller size than or the same size as the second color component block.

이러한 경우에도 부호화기 및 복호화기는 제1 색 성분 블록 내의 픽셀 및 제1 색 성분 블록 주변의 픽셀을 기반으로 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출할 수 있다. Even in this case, the encoder and decoder may derive first color component reference information to be used for prediction of the second color component block based on pixels in the first color component block and pixels around the first color component block.

여기서, 제1 색 성분 참조 정보는 제2 색 성분 블록의 예측에 사용될 제1 색 성분의 픽셀 값들을 의미할 수 있다. 따라서, 본 명세서에서 제1 색 성분 정보는 '제1 색 성분 픽셀'로 지칭될 수도 있다. 이 때, 제2 색 성분 블록 내의 픽셀들에 대응되는 제1 색 성분 픽셀들은 '제1 색 성분 참조 블록'을 구성할 수 있다. 또한, 본 명세서에서 제1 색 성분 블록 주변에 위치하는 픽셀은 '주변 제1 색 성분 픽셀'이라 하고, 제2 색 성분 블록 주변에 위치하는 픽셀은 '주변 제2 색 성분 픽셀'이라 하며, 제1 색 성분 참조 블록 주변에 위치하는 픽셀은 '주변 제1 색 성분 참조 픽셀'이라 한다. 이 때, 제1 색 성분 참조 블록은 제2 색 성분 블록에 대응될 수 있고, 주변 제1 색 성분 참조 픽셀은 주변 제2 색 성분 픽셀에 대응될 수 있다. 본 명세서에서, 제1 색 성분 참조 정보는 제1 색 성분 참조 블록 내의 픽셀 및 주변 제1 색 성분 참조 픽셀을 포함한 개념으로 사용될 수 있다.Here, the first color component reference information may mean pixel values of the first color component to be used for prediction of the second color component block. Accordingly, in this specification, the first color component information may be referred to as a 'first color component pixel'. In this case, first color component pixels corresponding to pixels in the second color component block may constitute a 'first color component reference block'. Further, in this specification, pixels located around the first color component block are referred to as 'surrounding first color component pixels', and pixels located around the second color component block are referred to as 'surrounding second color component pixels'. Pixels positioned around the 1 color component reference block are referred to as 'surrounding first color component reference pixels'. In this case, the first color component reference block may correspond to the second color component block, and the neighboring first color component reference pixels may correspond to the neighboring second color component pixels. In this specification, the first color component reference information may be used as a concept including pixels in the first color component reference block and neighboring first color component reference pixels.

제1 색 성분 블록이 제2 색 성분 블록보다 작은 크기를 갖거나 동일한 크기를 갖는 경우, 제1 색 성분 블록을 기반으로 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정은 상술한 도 6 내지 도 12의 실시예에서와는 다를 수 있다.Deriving first color component reference information to be used for prediction of a second color component block based on the first color component block when the first color component block has a size smaller than or equal to that of the second color component block may be different from those in the above-described embodiments of FIGS. 6 to 12 .

도 13은 제1 색 성분 블록의 크기가 제2 색 성분 블록의 크기보다 작은 경우, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.13 is a diagram schematically illustrating an embodiment of a process of deriving first color component reference information to be used for prediction of a second color component block when the size of the first color component block is smaller than the size of the second color component block. .

도 13의 1310은 제1 색 성분 블록(1312), 주변 제1 색 성분 픽셀들(1314), 제2 색 성분 블록(1316) 및 주변 제2 색 성분 픽셀들(1318)의 실시예를 도시한다. 도 13의 1310을 참조하면, 제2 색 성분 블록(1316)의 크기가 8x8일 때, 이에 대응되는 제1 색 성분 블록(1312)의 크기는 4x4일 수 있다. 이 경우, 부호화기 및 복호화기는 8x8 크기의 제1 색 성분 참조 블록에 대응되는 제1 색 성분 참조 픽셀들을 생성할 수 있다.1310 of FIG. 13 illustrates an embodiment of the first color component block 1312, the surrounding first color component pixels 1314, the second color component block 1316, and the surrounding second color component pixels 1318. . Referring to 1310 of FIG. 13 , when the size of the second color component block 1316 is 8x8, the size of the corresponding first color component block 1312 may be 4x4. In this case, the encoder and decoder may generate first color component reference pixels corresponding to the 8x8 first color component reference block.

도 13의 1320은 제1 색 성분 참조 정보 도출 방법의 일 실시예를 도시한다.1320 of FIG. 13 illustrates an embodiment of a method of deriving first color component reference information.

도 13의 1320의 실시예에서는, 도 13의 1310에서와 같이 제1 색 성분 블록(1312)의 크기가 4x4이고 제2 색 성분 블록(1316)의 크기가 8x8인 경우의 제1 색 성분 참조 정보 도출 방법이 도시된다.In the example 1320 of FIG. 13 , as in 1310 of FIG. 13 , the first color component reference information when the size of the first color component block 1312 is 4x4 and the size of the second color component block 1316 is 8x8. The derivation method is shown.

도 13의 1320을 참조하면, 부호화기 및 복호화기는 제1 색 성분 블록(1312) 내의 픽셀 및 주변 제1 색 성분 픽셀들(1314)을 기반으로, 제2 색 성분 블록(1316)의 예측에 사용될 제1 색 성분 참조 블록(1326) 및 주변 제1 색 성분 참조 픽셀들(1328)을 생성할 수 있다. 여기서, 제1 색 성분 참조 정보 도출에 사용되는 주변 제1 색 성분 픽셀들(1314)은 일례로, 제1 색 성분 블록(1312)의 좌측에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들, 및 제1 색 성분 블록(1312)의 상단에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들을 포함할 수 있다.Referring to 1320 of FIG. 13 , the encoder and the decoder are to be used for prediction of the second color component block 1316 based on the pixel in the first color component block 1312 and the surrounding first color component pixels 1314 . A 1 color component reference block 1326 and surrounding first color component reference pixels 1328 may be generated. Here, the neighboring first color component pixels 1314 used to derive the first color component reference information are, for example, pixels included in one pixel line located closest to the left side of the first color component block 1312, and pixels included in one pixel line located closest to the top of the first color component block 1312 .

한편, 도 13의 1320에서는 제1 색 성분 블록(1312) 및 제2 색 성분 블록(1316)의 크기가 서로 다르므로, 부호화기 및 복호화기는 제2 색 성분 블록(1316)과 동일한 크기(8x8)의 제1 색 성분 참조 블록(1326) 및 이에 대응되는 주변 제1 색 성분 참조 픽셀들(1328)을 생성할 수 있다. 이 때, 제1 색 성분 블록(1312)의 크기가 제2 색 성분 블록(1316)의 크기보다 작으므로, 부호화기 및 복호화기는 제1 색 성분 블록(1312) 내의 픽셀들 및 주변 제1 색 성분 픽셀들(1314)에 대해 업 샘플링(up sampling)을 수행함으로써 제1 색 성분 참조 정보를 생성할 수 있다. Meanwhile, in 1320 of FIG. 13 , since the sizes of the first color component block 1312 and the second color component block 1316 are different, the encoder and the decoder have the same size (8x8) as the second color component block 1316. The first color component reference block 1326 and neighboring first color component reference pixels 1328 corresponding to the first color component reference block 1326 may be generated. At this time, since the size of the first color component block 1312 is smaller than the size of the second color component block 1316, the encoder and decoder use pixels in the first color component block 1312 and neighboring first color component pixels. First color component reference information may be generated by up-sampling the s 1314 .

주변 제1 색 성분 픽셀들(1314) 중에서 가용하지 않은 픽셀들이 존재하는 경우, 부호화기 및 복호화기는 가용하지 않은 픽셀들에 대해 패딩 과정을 수행한 후에 업 샘플링을 수행할 수도 있다. 패딩 과정은 상술한 실시예들에서와 유사하므로 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.When there are unavailable pixels among the neighboring first color component pixels 1314, the encoder and decoder may perform upsampling after performing a padding process on the unavailable pixels. Since the padding process is similar to that in the above-described embodiments, a detailed description thereof will be omitted here.

제1 색 성분 블록(1312) 내의 픽셀들 및 주변 제1 색 성분 픽셀들(1314)에 대해 업 샘플링을 수행하는 과정은 일례로 다음 수학식 26에 의해 나타내어질 수 있다.A process of performing up-sampling on pixels in the first color component block 1312 and neighboring first color component pixels 1314 may be expressed by Equation 26 below, for example.

[수학식 26][Equation 26]

*293p'[2x,2y] = p[x,y]*293p'[2x,2y] = p[x,y]

p'[2x+1,2y] = (p[x,y] + p[x+1,y])>>1p'[2x+1,2y] = (p[x,y] + p[x+1,y])>>1

p'[2x,2y+1] = (p[x,y] + p[x,y+1])>>1p'[2x,2y+1] = (p[x,y] + p[x,y+1])>>1

p'[2x+1,2y+1] = (p[x+1,y] + p[x,y+1])>>1p'[2x+1,2y+1] = (p[x+1,y] + p[x,y+1])>>1

여기서, p[x,y]는 복원된 제1 색 성분 픽셀들, 즉 제1 색 성분 블록(1312) 내의 픽셀들 및 주변 제1 색 성분 픽셀들(1314)의 픽셀 값을 나타낼 수 있다. 또한, p'[x,y]는 제2 색 성분 블록(1316)의 크기에 따라 생성된 제1 색 성분 참조 픽셀들(1326, 1328)의 픽셀 값을 나타낼 수 있다.Here, p[x,y] may represent pixel values of restored first color component pixels, that is, pixels in the first color component block 1312 and neighboring first color component pixels 1314 . Also, p'[x,y] may represent pixel values of the first color component reference pixels 1326 and 1328 generated according to the size of the second color component block 1316 .

도 14는 제1 색 성분 블록의 크기가 제2 색 성분 블록의 크기와 동일한 경우, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.14 is a diagram schematically illustrating an embodiment of a process of deriving first color component reference information to be used for prediction of a second color component block when the size of the first color component block is the same as that of the second color component block. .

상술한 바와 같이, 4:4:4 영상 포맷이 사용되는 경우, 즉 영상의 색 공간이 RGB 4:4:4 또는 YUV 4:4:4인 경우에는 루마 블록과 크로마 블록의 크기가 동일할 수 있다. 따라서, 이 경우 제1 색 성분 블록이 루마 블록이고 제2 색 성분 블록이 크로마 블록이라고 하면, 제1 색 성분 블록의 크기와 제2 색 성분 블록의 크기가 동일할 수 있다. 또한, 제1 색 성분 블록이 U에 해당되는 크로마 블록이고 제2 색 성분 블록이 V에 해당되는 크로마 블록인 경우, 제1 색 성분 블록의 크기와 제2 색 성분 블록의 크기가 동일할 수 있다. 도 14의 실시예에서는 제1 색 성분 블록(1412)의 크기가 8x8이고 제2 색 성분 블록(1422)의 크기가 8x8이라 가정한다.As described above, when the 4:4:4 video format is used, that is, when the color space of the video is RGB 4:4:4 or YUV 4:4:4, the size of the luma block and the chroma block may be the same. there is. Accordingly, in this case, if the first color component block is a luma block and the second color component block is a chroma block, the size of the first color component block and the size of the second color component block may be the same. Also, when the first color component block is a chroma block corresponding to U and the second color component block is a chroma block corresponding to V, the size of the first color component block and the size of the second color component block may be the same. . In the embodiment of FIG. 14 , it is assumed that the size of the first color component block 1412 is 8x8 and the size of the second color component block 1422 is 8x8.

도 14를 참조하면, 부호화기 및 복호화기는 제1 색 성분 블록(1412) 내의 픽셀 및 주변 제1 색 성분 픽셀들(1414)을 기반으로, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 블록(1422) 및 주변 제1 색 성분 참조 픽셀들(1424)을 생성할 수 있다. 생성된 제1 색 성분 참조 블록(1422)은 제2 색 성분 블록에 대응되는 위치에 존재할 수 있다. 여기서, 제1 색 성분 참조 정보 도출에 사용되는 주변 제1 색 성분 픽셀들(1414)은 일례로, 제1 색 성분 블록(1412)의 좌측에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들, 및 제1 색 성분 블록(1412)의 상단에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들을 포함할 수 있다.Referring to FIG. 14 , an encoder and a decoder are configured to use a first color component reference block to be used for prediction of a second color component block based on a pixel in a first color component block 1412 and neighboring first color component pixels 1414 . 1422 and neighboring first color component reference pixels 1424 may be generated. The generated first color component reference block 1422 may exist at a position corresponding to the second color component block. Here, the neighboring first color component pixels 1414 used to derive the first color component reference information are, for example, pixels included in one pixel line located closest to the left side of the first color component block 1412, and pixels included in one pixel line located closest to the top of the first color component block 1412 .

이 때, 제1 색 성분 블록(1412)의 크기가 제2 색 성분 블록의 크기와 동일하므로, 부호화기 및 복호화기는 제1 색 성분 정보 생성 시에 다운 샘플링(down sampling), 서브 샘플링(sub smapling) 및 업 샘플링(up sampling) 등을 수행하지 않을 수 있다. 따라서, 제1 색 성분 블록(1412) 내 픽셀들의 픽셀 값 및 주변 제1 색 성분 픽셀들(1414)의 픽셀 값이 그대로 제1 색 성분 참조 정보로 사용될 수 있다.At this time, since the size of the first color component block 1412 is the same as the size of the second color component block, the encoder and decoder perform down sampling and sub sampling when generating the first color component information. and up sampling may not be performed. Accordingly, pixel values of pixels in the first color component block 1412 and pixel values of neighboring first color component pixels 1414 may be used as first color component reference information.

또한, 인트라 모드에서는 변환/양자화 등이 이용되는 손실 부호화/복호화 방식 대신 무손실 부호화/복호화 방식이 적용될 수도 있다. 무손실 부호화/복호화 방식에서는 부호화 대상 블록에 대해 변환 양자화 등의 과정이 적용되지 않을 수 있다. 제1 색 성분 블록(1412)의 크기가 제2 색 성분 블록의 크기와 동일할 때에는, 무손실 부호화/복호화 방식이 적용되는 경우에도, 상술한 실시예에서와 같이 제1 색 성분 참조 정보가 도출될 수 있다. 이 경우, 부호화기 및 복호화기는 제1 색 성분 정보 생성 시에 다운 샘플링, 서브 샘플링 및 업 샘플링 등을 수행하지 않을 수 있다. 생성된 제1 색 성분 참조 블록(1422)은 제2 색 성분 블록에 대응되는 위치에 존재할 수 있다.Also, in the intra mode, a lossless encoding/decoding method may be applied instead of a lossy encoding/decoding method using transform/quantization. In the lossless encoding/decoding method, a process such as transform quantization may not be applied to an encoding target block. When the size of the first color component block 1412 is equal to the size of the second color component block, even when the lossless encoding/decoding method is applied, the first color component reference information can be derived as in the above-described embodiment. can In this case, the encoder and decoder may not perform downsampling, subsampling, and upsampling when generating the first color component information. The generated first color component reference block 1422 may exist at a position corresponding to the second color component block.

한편, 상술한 실시예들에서는 현재 루마 블록의 상단에 위치하는 상단 주변 루마 픽셀들 및 현재 루마 블록의 좌측에 위치하는 좌측 주변 루마 픽셀들이 모두 루마 참조 정보 생성에 사용될 수 있다. 그러나, 본 발명은 이에 한정되는 것은 아니며, 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들은 다양한 방법으로 정해질 수 있다. 예컨대, 상단 주변 루마 픽셀들만이 루마 참조 정보 생성에 사용될 수도 있고, 좌측 주변 루마 픽셀들만이 루마 참조 정보 생성에 사용될 수도 있다. 또한, 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들은 현재 루마 블록의 인트라 예측 모드에 따라 정해질 수도 있다. Meanwhile, in the above-described embodiments, both upper peripheral luma pixels positioned on top of the current luma block and left peripheral luma pixels positioned on the left side of the current luma block may be used to generate luma reference information. However, the present invention is not limited thereto, and neighboring luma pixels used to generate luma reference information may be determined in various ways. For example, only upper peripheral luma pixels may be used to generate luma reference information, and only left peripheral luma pixels may be used to generate luma reference information. Also, neighboring luma pixels used to generate luma reference information may be determined according to an intra prediction mode of a current luma block.

도 15는 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들의 실시예를 개략적으로 나타내는 도면이다.15 is a diagram schematically illustrating an example of peripheral luma pixels used to generate luma reference information.

*305도 15의 실시예에서, 현재 루마 블록(1512)의 크기는 8x8이고 이에 대응되는 현재 크로마 블록의 크기는 4x4라 가정한다. 일례로, 도 15는 YUV 4:2:0의 영상 포맷이 이용되는 경우의 실시예에 해당될 수 있다. 또한, 도 15에 도시된 주변 루마 픽셀들(A, B, C, D, E, F)에는 상술한 패딩 과정을 통해 이미 픽셀 값이 채워져 있다고 가정한다. 그리고, 도 15에서는 상술한 도 4의 410에서와 같은 인트라 예측 모드의 모드 값이 사용된다고 가정한다.In the embodiment of *305 FIG. 15, it is assumed that the size of the current luma block 1512 is 8x8 and the size of the corresponding current chroma block is 4x4. As an example, FIG. 15 may correspond to an embodiment in which a video format of YUV 4:2:0 is used. In addition, it is assumed that the peripheral luma pixels A, B, C, D, E, and F shown in FIG. 15 are already filled with pixel values through the above-described padding process. And, in FIG. 15, it is assumed that the mode value of the intra prediction mode as in 410 of FIG. 4 is used.

도 15의 실시예에서는 주변 루마 픽셀들(A, B, C, D, E, F) 중에서 적어도 하나 및 현재 루마 블록(1512) 내의 픽셀들을 기반으로, 현재 크로마 블록의 예측에 사용될 루마 참조 블록(1522, 1532 또는 1542) 및 주변 루마 참조 픽셀들(1524, 1534 또는 1544)이 생성될 수 있다. 이 때, 현재 크로마 블록의 크기는 4x4이므로, 생성된 루마 참조 블록(1522, 1532 또는 1542)의 크기는 4x4일 수 있다. In the embodiment of FIG. 15 , a luma reference block (a luma reference block (a 1522, 1532 or 1542) and peripheral luma reference pixels 1524, 1534 or 1544 may be generated. In this case, since the size of the current chroma block is 4x4, the size of the generated luma reference block 1522, 1532 or 1542 may be 4x4.

도 15의 실시예에서, 루마 참조 정보 생성에 이용될 주변 루마 픽셀들은 일례로 다음 표 3에 나타내어진 조합들 중에서 적어도 하나에 의해 획득될 수 있다. In the embodiment of FIG. 15 , peripheral luma pixels to be used for generating luma reference information may be obtained by, for example, at least one of the combinations shown in Table 3 below.

[표 3][Table 3]

Figure pat00003
Figure pat00003

표 3의 실시예에서 P는 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들 및 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 또한, Q는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 그리고, R은 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다.In the example of Table 3, P may mean that left peripheral luma pixels located on the left side of the current luma block 1512 and upper peripheral luma pixels located on the top side of the current luma block 1512 are used to generate luma reference information. . Also, Q may mean that upper peripheral luma pixels located on the upper side of the current luma block 1512 are used to generate luma reference information. Also, R may mean that left peripheral luma pixels located on the left side of the current luma block 1512 are used to generate luma reference information.

또한, 표 3의 실시예에서 L은 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용되는 경우, 현재 루마 블록(1512)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 상의 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 그리고, M은 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용되는 경우, 현재 루마 블록(1512)의 좌측에 두 번째로 가까이 위치한 제2 좌측 픽셀 라인 상의 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 이 경우에는, 서브 샘플링을 위해 제1 좌측 픽셀 라인 상의 픽셀들이 함께 이용될 수도 있다. In addition, in the example of Table 3, L indicates that when left peripheral luma pixels are used to generate luma reference information, pixels on the first left pixel line located closest to the left side of the current luma block 1512 are used to generate luma reference information. can mean Further, M may mean that, when left peripheral luma pixels are used to generate luma reference information, pixels on a second left pixel line located second closest to the left side of the current luma block 1512 are used to generate luma reference information. there is. In this case, pixels on the first left pixel line may be used together for subsampling.

또한, N은 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로 루마 참조 정보 생성에 이용될 주변 루마 픽셀들이 결정됨을 의미할 수 있다. 이 경우 루마 참조 정보는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로 적응적으로 생성될 수 있다. 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로 루마 참조 정보가 생성되는 경우에 사용되는 좌측 주변 루마 픽셀들은 일례로 제1 좌측 픽셀 라인 상의 픽셀들일 수도 있고 다른 예로 제2 좌측 픽셀 라인 상의 픽셀들일 수도 있다.Also, N may mean that neighboring luma pixels to be used for generating luma reference information are determined based on the intra prediction mode of the current luma block 1512 . In this case, luma reference information may be adaptively generated based on the intra prediction mode of the current luma block 1512 . The left peripheral luma pixels used when luma reference information is generated based on the intra prediction mode of the current luma block 1512 may be, for example, pixels on the first left pixel line or, for example, pixels on the second left pixel line. may be

일례로, P 및 L의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들 및 제1 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [A, D] 또는 [A, B, D, F]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. For example, in an embodiment in which a combination of P and L is applied, upper peripheral luma pixels positioned at an upper portion of the current luma block 1512 and left peripheral luma pixels on the first left pixel line may be used to generate luma reference information. . Accordingly, in this case, neighboring luma pixels of [A, D] or [A, B, D, F] shown in 1510 of FIG. 15 may be used to generate luma reference information.

[A, D]를 기반으로 루마 참조 정보가 생성된 경우, 생성된 루마 참조 정보는 일례로 도 15의 1520에서와 같이 도시될 수 있다. 도 15의 1520에서, 주변 루마 참조 픽셀들(1524)은 루마 참조 블록(1522)의 상단에 인접한 픽셀들 및 루마 참조 블록(1522)의 좌측에 인접한 픽셀들을 포함할 수 있다.When luma reference information is generated based on [A, D], the generated luma reference information may be shown as 1520 of FIG. 15 as an example. In 1520 of FIG. 15 , the peripheral luma reference pixels 1524 may include pixels adjacent to an upper end of the luma reference block 1522 and pixels adjacent to a left side of the luma reference block 1522 .

다른 예로, Q 및 L의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [A, B]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. As another example, in an embodiment in which a combination of Q and L is applied, upper peripheral luma pixels located on an upper portion of the current luma block 1512 may be used to generate luma reference information. Accordingly, in this case, neighboring luma pixels of [A, B] shown in 1510 of FIG. 15 may be used to generate luma reference information.

[A, B]를 기반으로 루마 참조 정보가 생성된 경우, 생성된 루마 참조 정보는 일례로 도 15의 1530에서와 같이 도시될 수 있다. 도 15의 1530에서, 주변 루마 참조 픽셀들(1534)은 루마 참조 블록(1532)의 상단에 위치한 픽셀들일 수 있다.When luma reference information is generated based on [A, B], the generated luma reference information may be shown as 1530 of FIG. 15 as an example. In 1530 of FIG. 15 , the peripheral luma reference pixels 1534 may be pixels located on top of the luma reference block 1532 .

또 다른 예로, R 및 L의 조합이 적용되는 실시예에서는 제1 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [D, F]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. As another example, in an embodiment in which a combination of R and L is applied, left peripheral luma pixels on the first left pixel line may be used to generate luma reference information. Accordingly, in this case, neighboring luma pixels of [D, F] shown in 1510 of FIG. 15 may be used to generate luma reference information.

[D, F]를 기반으로 루마 참조 정보가 생성된 경우, 생성된 루마 참조 정보는 일례로 도 15의 1540에서와 같이 도시될 수 있다. 도 15의 1540에서, 주변 루마 참조 픽셀들(1544)은 루마 참조 블록(1542)의 좌측에 위치한 픽셀들일 수 있다.When luma reference information is generated based on [D, F], the generated luma reference information may be shown as 1540 of FIG. 15 as an example. In 1540 of FIG. 15 , the peripheral luma reference pixels 1544 may be pixels positioned to the left of the luma reference block 1542 .

또 다른 예로, P 및 M의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들 및 제2 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [A, C] 또는 [A, B, C, E]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. P 및 M의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1520에서와 같이 도시될 수 있다.As another example, in an embodiment in which a combination of P and M is applied, upper peripheral luma pixels positioned at an upper portion of the current luma block 1512 and left peripheral luma pixels on the second left pixel line may be used to generate luma reference information. there is. Accordingly, in this case, neighboring luma pixels of [A, C] or [A, B, C, E] shown in 1510 of FIG. 15 may be used to generate luma reference information. Luma reference information generated when a combination of P and M is applied may be shown as 1520 of FIG. 15 as an example.

또 다른 예로, Q 및 M의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [A, B]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. Q 및 M의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1530에서와 같이 도시될 수 있다.As another example, in an embodiment in which a combination of Q and M is applied, upper peripheral luma pixels positioned at an upper portion of the current luma block 1512 may be used to generate luma reference information. Accordingly, in this case, neighboring luma pixels of [A, B] shown in 1510 of FIG. 15 may be used to generate luma reference information. Luma reference information generated when a combination of Q and M is applied may be shown as 1530 of FIG. 15 as an example.

또 다른 예로, R 및 M의 조합이 적용되는 실시예에서는 제2 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [C, E]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. R 및 M의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1540에서와 같이 도시될 수 있다.As another example, in an embodiment in which a combination of R and M is applied, left peripheral luma pixels on the second left pixel line may be used to generate luma reference information. Accordingly, in this case, neighboring luma pixels of [C, E] shown in 1510 of FIG. 15 may be used to generate luma reference information. Luma reference information generated when a combination of R and M is applied may be shown as 1540 in FIG. 15 as an example.

또 다른 예로, P 및 N의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로, 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들 및 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 주변 루마 픽셀로 결정될 수 있다. As another example, in an embodiment in which a combination of P and N is applied, based on the intra prediction mode of the current luma block 1512, upper peripheral luma pixels located on top of the current luma block 1512 and the current luma block 1512 ) may be determined as peripheral luma pixels to be used for generating luma reference information.

이 때, 현재 루마 블록(1512)의 인트라 예측 모드는 현재 루마 블록(1512)의 상단 및 좌측에 위치한 픽셀을 모두 이용하는 제1 인트라 예측 모드일 수 있다. 일례로, 상기 제1 인트라 예측 모드는 DC 모드, 플래너 모드 또는 4, 19, 11, 20, 5, 21, 12, 22, 27, 15, 28, 8, 29, 16 또는 30의 모드 값을 갖는 모드일 수 있다.In this case, the intra prediction mode of the current luma block 1512 may be a first intra prediction mode using all pixels located on the top and left sides of the current luma block 1512 . For example, the first intra prediction mode has a DC mode, a planner mode, or a mode value of 4, 19, 11, 20, 5, 21, 12, 22, 27, 15, 28, 8, 29, 16, or 30. can be a mod

P 및 N의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1520에서와 같이 도시될 수 있다.Luma reference information generated when a combination of P and N is applied may be shown as 1520 of FIG. 15 as an example.

또 다른 예로, Q 및 N의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로, 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 주변 루마 픽셀로 결정될 수 있다. As another example, in an embodiment in which a combination of Q and N is applied, luma pixels located on top of the current luma block 1512 are used to generate luma reference information based on the intra prediction mode of the current luma block 1512 . It can be determined as a peripheral luma pixel to be.

이 때, 현재 루마 블록(1512)의 인트라 예측 모드는 현재 루마 블록(1512)의 상단에 위치한 픽셀을 주로 이용하는 제2 인트라 예측 모드일 수 있다. 일례로, 제2 인트라 예측 모드는 1, 23, 13, 24, 6, 25, 14, 26 또는 7의 모드 값을 갖는 모드일 수 있다.In this case, the intra prediction mode of the current luma block 1512 may be a second intra prediction mode mainly using pixels located on top of the current luma block 1512 . For example, the second intra prediction mode may be a mode having a mode value of 1, 23, 13, 24, 6, 25, 14, 26, or 7.

Q 및 N의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1530에서와 같이 도시될 수 있다.Luma reference information generated when a combination of Q and N is applied may be shown as 1530 in FIG. 15 as an example.

또 다른 예로, R 및 N의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로, 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 주변 루마 픽셀로 결정될 수 있다. As another example, in an embodiment in which a combination of R and N is applied, left peripheral luma pixels located on the left side of the current luma block 1512 are used to generate luma reference information based on the intra prediction mode of the current luma block 1512. It can be determined as a peripheral luma pixel to be.

이 때, 현재 루마 블록(1512)의 인트라 예측 모드는 현재 루마 블록(1512)의 좌측에 위치한 픽셀을 주로 이용하는 제3 인트라 예측 모드일 수 있다. 일례로, 제3 인트라 예측 모드는 2, 31, 17, 32, 9, 33, 18, 34 또는 10의 모드 값을 갖는 모드일 수 있다.In this case, the intra prediction mode of the current luma block 1512 may be a third intra prediction mode mainly using pixels located on the left side of the current luma block 1512 . For example, the third intra prediction mode may be a mode having a mode value of 2, 31, 17, 32, 9, 33, 18, 34, or 10.

R 및 N의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1540에서와 같이 도시될 수 있다.Luma reference information generated when a combination of R and N is applied may be shown as 1540 in FIG. 15 as an example.

상술한 실시예에 따라 결정된 주변 루마 픽셀들을 기반으로 주변 루마 참조 픽셀들의 픽셀 값이 도출된 경우에는, 각각의 주변 루마 참조 픽셀과 동일한 위치에 있는 주변 크로마 픽셀들을 이용하여 예측 파라미터를 도출할 수 있다. 예측 파라미터 도출 과정의 구체적인 실시예는 후술하기로 한다.When the pixel values of the neighboring luma reference pixels are derived based on the neighboring luma pixels determined according to the above-described embodiment, a prediction parameter may be derived using the neighboring chroma pixels located at the same location as each neighboring luma reference pixel. . A specific embodiment of the process of deriving the prediction parameters will be described later.

도 16은 예측 파라미터를 도출하는 과정 및 현재 크로마 블록 내 픽셀들의 예측값을 도출하는 과정의 실시예를 설명하기 위한 도면이다.16 is a diagram for explaining an embodiment of a process of deriving prediction parameters and a process of deriving predictive values of pixels in a current chroma block.

도 16은 루마 참조 블록(1610), 주변 루마 참조 픽셀들(1620), 현재 크로마 블록(1630) 및 복원된 주변 크로마 픽셀들(1640)을 도시한다. 도 16의 실시예에서, 루마 참조 블록(1610)의 크기 및 현재 크로마 블록(1630)의 크기는 각각 8x8일 수 있다.16 shows a luma reference block 1610 , surrounding luma reference pixels 1620 , a current chroma block 1630 and reconstructed surrounding chroma pixels 1640 . In the embodiment of FIG. 16 , the size of the luma reference block 1610 and the size of the current chroma block 1630 may each be 8x8.

일 실시예로, 부호화기 및 복호화기는 루마 참조 정보 및 크로마 성분 정보를 기반으로 현재 크로마 블록(1630)에 대한 예측 파라미터를 도출할 수 있다. 일례로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들(1620)의 픽셀 값 및 주변 크로마 픽셀들(1640)의 픽셀 값을 기반으로 예측 파라미터를 도출할 수 있다. 여기서, 예측 파라미터는 최소 자승법을 기반으로 하는 알파(α) 및 베타(β)일 수 있다. As an embodiment, the encoder and decoder may derive a prediction parameter for the current chroma block 1630 based on luma reference information and chroma component information. For example, the encoder and decoder may derive a prediction parameter based on pixel values of neighboring luma reference pixels 1620 and pixel values of neighboring chroma pixels 1640 . Here, the prediction parameters may be alpha (α) and beta (β) based on the least squares method.

주변 루마 참조 픽셀들(1620) 및 주변 크로마 픽셀들(1640)의 픽셀 값을 기반으로 예측 파라미터를 도출하는 과정은 일례로 다음 수학식 27에 의해 나타내어질 수 있다.A process of deriving a prediction parameter based on the pixel values of the neighboring luma reference pixels 1620 and the neighboring chroma pixels 1640 may be expressed by Equation 27 below, for example.

[수학식 27][Equation 27]

Figure pat00004
Figure pat00004

Figure pat00005
Figure pat00005

Figure pat00006
Figure pat00006

수학식 27에서, p1은 주변 루마 참조 픽셀들(1620)의 픽셀 값을 나타내고, p2는 주변 크로마 픽셀들(1640)의 픽셀 값을 나타낼 수 있다. 또한, nS는 루마 참조 블록(1610) 및 현재 크로마 블록(1630)의 가로 길이 및 세로 길이를 나타내고, 'Bitdepth'는 크로마 성분 픽셀의 비트 심도를 나타낼 수 있다. 그리고, abs(x)는 x의 절대값을 나타낼 수 있다. 'lmDiv'는 'a2s'의 값에 따라 결정되는 변수로서, 일례로 다음 표 4에 의해 결정될 수 있다.In Equation 27, p1 may represent a pixel value of the neighboring luma reference pixels 1620, and p2 may represent a pixel value of the neighboring chroma pixels 1640. Also, nS may represent the horizontal and vertical lengths of the luma reference block 1610 and the current chroma block 1630, and 'Bitdepth' may represent the bit depth of a chroma component pixel. And, abs(x) may represent the absolute value of x. 'lmDiv' is a variable determined according to the value of 'a2s', and may be determined by Table 4 below, for example.

[표 4][Table 4]

Figure pat00007
Figure pat00007

수학식 27에서 a는 알파(α)를 나타내고, b는 베타(β)를 나타낼 수 있다.In Equation 27, a may represent alpha (α) and b may represent beta (β).

상술한 예측 파라미터 도출 과정에서, 주변 루마 참조 픽셀들(1620) 및/또는 주변 크로마 픽셀들(1640) 중에서는 가용하지 않은 픽셀이 존재할 수도 있다. 이 경우, 일례로 부호화기 및 복호화기에서는 주변 루마 참조 픽셀들(1620) 및/또는 주변 크로마 픽셀들(1640) 중에서 가용한 픽셀들만을 기반으로 예측 파라미터를 도출할 수 있다.In the process of deriving the prediction parameters described above, an unavailable pixel may exist among the neighboring luma reference pixels 1620 and/or the neighboring chroma pixels 1640 . In this case, for example, the encoder and decoder may derive a prediction parameter based on only available pixels among the neighboring luma reference pixels 1620 and/or the neighboring chroma pixels 1640 .

다른 실시예로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들(1620) 및 주변 크로마 픽셀들(1640)을 기반으로 예측 파라미터를 도출하지 않고, 기본 예측 파라미터(default prediction parameter)를 현재 크로마 블록(1630)의 예측에 이용할 수도 있다. 예를 들어, 기본 예측 파라미터로 사용되는 알파(α)는 1일 수 있고, 기본 예측 파라미터로 사용되는 베타(β)는 0일 수 있다.In another embodiment, the encoder and decoder do not derive a prediction parameter based on the neighboring luma reference pixels 1620 and the neighboring chroma pixels 1640, but use a default prediction parameter as the current chroma block 1630. can also be used for prediction of For example, alpha (α) used as a basic prediction parameter may be 1, and beta (β) used as a basic prediction parameter may be 0.

상술한 실시예들에 따라 예측 파라미터가 도출되면, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록(1610) 내의 픽셀들의 픽셀 값을 기반으로, 현재 크로마 블록(1630) 내 픽셀들의 예측 값을 도출할 수 있다. 일례로, 부호화기 및 복호화기는 수학식 27에 의해 도출된 예측 파라미터 'a', 'k', 'b'와 도 16에 도시된 루마 참조 블록(1610) 내 픽셀들의 픽셀 값을 기반으로 현재 크로마 블록(1630) 내 픽셀들의 예측 값을 도출할 수 있다. 이 때, 현재 크로마 블록(1630) 내 픽셀들의 예측 값을 도출하는 과정은 일례로 다음 수학식 28에 의해 나타내어질 수 있다.When prediction parameters are derived according to the above-described embodiments, the encoder and decoder may derive prediction values of pixels in the current chroma block 1630 based on the prediction parameters and pixel values of pixels in the luma reference block 1610. there is. For example, the encoder and the decoder are based on the prediction parameters 'a', 'k', and 'b' derived by Equation 27 and pixel values of pixels in the luma reference block 1610 shown in FIG. Prediction values of pixels in 1630 may be derived. In this case, a process of deriving predicted values of pixels within the current chroma block 1630 may be expressed by Equation 28 below, for example.

[수학식 28][Equation 28]

predSamples[x,y] = Clip1(((p1[x,y]*a)>>k)+b), (x,y=0~(nS-1))predSamples[x,y] = Clip1(((p1[x,y]*a)>>k)+b), (x,y=0~(nS-1))

Clip1(i) = Clip3(0,(1<<BitDepth)-1,i)Clip1(i) = Clip3(0,(1<<BitDepth)-1,i)

여기서, 'predSamples[x,y]'는 현재 크로마 블록(1630) 내 픽셀의 예측 값을 나타낼 수 있다. 또한, clip(x,y,z)는 z가 x보다 작으면 x이고 z가 y보다 크면 y이고 그렇지 않으면 z일 수 있다.Here, 'predSamples[x,y]' may indicate a predicted value of a pixel in the current chroma block 1630. Also, clip(x,y,z) may be x if z is less than x, y if z is greater than y, and z otherwise.

도 17은 본 발명에 따른 복호화 과정의 일 실시예를 개략적으로 나타내는 흐름도이다.17 is a flowchart schematically illustrating an embodiment of a decryption process according to the present invention.

도 17의 실시예에서, PY는 현재 루마 블록의 예측에 사용되는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, NY는 현재 루마 블록의 가로 길이 및 세로 길이를 나타낼 수 있고, PLM은 LM 모드에서 루마 참조 정보 생성에 사용되는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 여기서, PY[x,y]와 PLM[x,y]는 서로 동일한 값을 가질 수 있다.In the embodiment of FIG. 17 , P Y may represent pixel values of neighboring luma pixels used for prediction of a current luma block. Also, N Y may indicate the horizontal and vertical lengths of the current luma block, and P LM may indicate pixel values of neighboring luma pixels used to generate luma reference information in the LM mode. Here, P Y [x,y] and P LM [x,y] may have the same value.

도 17의 실시예는 루마 성분(Y)을 기준으로 서술된다. 그러나, 본 발명은 이에 한정되는 것은 아니며, 도 17의 실시예는 루마 성분(Y)이 아닌 크로마 성분(U,V)에 대해서도 루마 성분에서와 동일하거나 유사한 방식으로 적용될 수 있다. 또한, 이 경우에는 변수 PY 대신 PC가 사용될 수 있고, 변수 NY 대신 NC가 사용될 수 있으며, cIdx에 할당되는 값은 0이 아닌 1 또는 2일 수 있다. 여기서, cIdx는 현재 블록의 색 성분이 Y, U, V 중에서 어떤 성분에 해당되는지를 지시하는 인덱스일 수 있다. 일례로, 현재 블록의 색 성분이 Y인 경우 cIdx에는 0이 할당될 수 있고, 현재 블록의 색 성분이 U인 경우 cIdx에 1이 할당될 수 있으며, 현재 블록의 색 성분이 V인 경우 cIdx에는 2가 할당될 수 있다. 색 성분에 따라 도 17의 실시예에 적용되는 변수들의 관계는 일례로 다음 표 5에 의해 나타내어질 수 있다.The embodiment of FIG. 17 is described based on the luma component (Y). However, the present invention is not limited thereto, and the embodiment of FIG. 17 may be applied to the chroma components (U and V) other than the luma component (Y) in the same or similar manner as the luma component. Also, in this case, P C may be used instead of variable P Y , N C may be used instead of variable N Y , and a value assigned to cIdx may be 1 or 2 other than 0. Here, cIdx may be an index indicating which component of Y, U, and V corresponds to the color component of the current block. For example, if the color component of the current block is Y, 0 may be assigned to cIdx, if the color component of the current block is U, 1 may be assigned to cIdx, and if the color component of the current block is V, cIdx may be assigned 2 can be assigned. The relationship between variables applied to the embodiment of FIG. 17 according to color components may be represented by Table 5 below, for example.

[표 5][Table 5]

Figure pat00008
Figure pat00008

여기서, PC는 현재 크로마 블록의 주변에 위치한 주변 크로마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, NC는 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다.Here, P C may represent pixel values of neighboring chroma pixels located around the current chroma block. Also, N C may represent the horizontal and vertical lengths of the current chroma block.

일례로, 도 17의 실시예는 색 공간을 구성하는 각각의 색 성분에 대해, Y 성분, U 성분, V 성분의 순서로 적용될 수 있다.As an example, the embodiment of FIG. 17 may be applied in order of a Y component, a U component, and a V component to each color component constituting the color space.

도 17을 참조하면, 부호화기 및 복호화기는 PY[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1)가 가용한지 여부를 체크하여 마킹(marking)할 수 있다(S1710). 여기서, 마킹이라 함은 가용성(availability)에 대한 정보를 저장하거나 표시하는 과정을 의미할 수 있다. 주변 루마 픽셀이 가용하지 않은 경우의 실시예들은 도 8의 실시예에서 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.Referring to FIG. 17, the encoder and decoder are P Y [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=- 1) may be marked by checking whether or not is available (S1710). Here, marking may mean a process of storing or displaying information on availability. Since the embodiments in which the peripheral luma pixels are not available have been described above in the embodiment of FIG. 8 , a detailed description thereof will be omitted here.

다시 도 17을 참조하면, 부호화기 및 복호화기는 현재 루마 블록에 대해 조건 A 및 조건 B가 만족되는지 여부를 판단할 수 있다(S1720). Referring back to FIG. 17 , the encoder and decoder may determine whether conditions A and B are satisfied for the current luma block (S1720).

여기서, 조건 A는 현재 루마 블록에 대응되는 현재 크로마 블록의 인트라 예측에 LM 모드가 적용될 수 있음을 나타내는 조건이다. 일례로, 조건 A는 LM 플래그(chroma_pred_from_luma_enabled_flag)에 1이 할당되어 있는 경우에 만족될 수 있다. 상술한 바와 같이, chroma_pred_from_luma_enabled_flag는 현재 크로마 블록의 인트라 예측에 대해 LM 모드가 지원될 수 있는지 여부를 나타낼 수 있다. 또한, 조건 B는 현재 블록이 루마 성분 블록(Y)임을 나타내는 조건이다. 일례로, 조건 B는 cIdx에 0이 할당되어 있는 경우에 만족될 수 있다.Here, condition A is a condition indicating that the LM mode can be applied to intra prediction of the current chroma block corresponding to the current luma block. For example, condition A may be satisfied when 1 is allocated to the LM flag (chroma_pred_from_luma_enabled_flag). As described above, chroma_pred_from_luma_enabled_flag may indicate whether the LM mode can be supported for intra prediction of the current chroma block. Also, condition B is a condition indicating that the current block is the luma component block (Y). As an example, condition B can be satisfied when 0 is assigned to cIdx.

조건 A 및 조건 B가 만족되는 경우, 부호화기 및 복호화기는 PLM을 생성할 수 있다.When conditions A and B are satisfied, the encoder and decoder can generate P LM .

다시 도 17을 참조하면, 조건 A 및 조건 B가 만족되는 경우 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1)가 가용한지 여부를 체크하여 마킹(marking)할 수 있다(S1730). Referring back to FIG. 17, if conditions A and B are satisfied, the encoder and decoder P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~ N Y *2-1, y = -1) may be checked to mark whether or not is available (S1730).

이 때, PY[x,y]와 PLM[x,y]는 서로 동일한 값을 가질 수 있으므로, PY[x,y]가 가용한 경우 PLM[x,y]도 가용한 것으로 마킹될 수 있고 PY[x,y]가 가용하지 않은 경우 PLM[x,y]도 가용하지 않은 것으로 마킹될 수 있다.At this time, since P Y [x,y] and P LM [x,y] can have the same value, if P Y [x,y] is available, P LM [x,y] is also marked as available. and if P Y [x,y] is not available, P LM [x,y] may also be marked as not available.

또한, 일례로 PLM 에 대한 마킹 과정이 수행된 후 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=0~NY*2-1)에 해당되는 픽셀들 중에서 가용한 것으로 판별된 픽셀들의 픽셀 값을 [x-1,y] 위치의 루마 픽셀 값으로 대체할 수도 있다. In addition, for example, after the marking process for P LM is performed, the encoder and decoder are available among pixels corresponding to P LM [x,y], (x = -1, y = 0 to N Y * 2-1) The pixel values of the pixels determined to be correct may be replaced with the luma pixel values at the [x-1,y] position.

다시 도 17을 참조하면, 부호화기 및 복호화기는 현재 루마 블록의 예측에 사용될 주변 루마 픽셀들에 대해 조건 C가 만족되는지 여부를 판단할 수 있다(S1740). 여기서, 조건 C는 PY[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring back to FIG. 17 , the encoder and decoder may determine whether condition C is satisfied with respect to neighboring luma pixels to be used for prediction of the current luma block (S1740). Here, condition C is at least one of P Y [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=-1) A condition indicating that a pixel in is not available.

조건 C가 만족되는 경우, 즉 현재 루마 블록의 예측에 사용될 주변 루마 픽셀들 중에서 적어도 하나의 픽셀이 가용하지 않은 경우, 부호화기 및 복호화기는 PY[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다(S1750). 패딩 과정의 실시예들은 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.If condition C is satisfied, that is, if at least one pixel among the neighboring luma pixels to be used for prediction of the current luma block is not available, the encoder and decoder P Y [x,y], (x=-1, y= A padding process may be performed on unavailable pixels among -1 to N Y *2-1 and x=0 to N Y *2-1, y = -1 (S1750). Since the embodiments of the padding process have been described above, a detailed description thereof will be omitted here.

다시 도 17을 참조하면, 부호화기 및 복호화기는 루마 참조 정보 생성에 사용될 주변 루마 픽셀들에 대해 조건 A, B 및 D가 만족되는지 여부를 판단할 수 있다(S1760). 여기서, 조건 D는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring back to FIG. 17 , the encoder and decoder may determine whether conditions A, B, and D are satisfied with respect to neighboring luma pixels to be used for generating luma reference information (S1760). Here, condition D is at least one of P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=-1) A condition indicating that a pixel in is not available.

조건 A, B 및 D가 만족되는 경우, 즉 루마 참조 정보 생성에 사용될 주변 루마 픽셀들 중에서 적어도 하나의 픽셀이 가용하지 않은 경우, 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다(S1770). 패딩 과정의 실시예들은 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.When conditions A, B, and D are satisfied, that is, when at least one pixel among the surrounding luma pixels to be used for luma reference information generation is unavailable, the encoder and decoder P LM [x,y], (x=-1 , y = -1 to N Y *2-1 and x = 0 to N Y *2-1, y = -1), a padding process may be performed on unavailable pixels (S1770). Since the embodiments of the padding process have been described above, a detailed description thereof will be omitted here.

상술한 패딩 과정이 수행된 후, 부호화기 및 복호화기는 주변 루마 픽셀들을 기반으로 현재 루마 블록에 대한 예측 및 복호화 과정을 수행함으로써, 현재 루마 블록에 대한 복원 블록을 생성할 수 있다(S1780). 도 17의 실시예가 크로마 성분(U 또는 V)에 대해 적용된 경우, 부호화기 및 복호화기는 주변 루마 픽셀들, 복원된 현재 루마 블록 내 픽셀들 및 주변 크로마 픽셀들을 기반으로 현재 크로마 블록에 대한 예측 블록을 생성할 수 있으며, 생성된 예측 블록을 기반으로 현재 크로마 블록에 대한 복원 블록을 생성할 수 있다.After the above-described padding process is performed, the encoder and decoder may generate a reconstructed block for the current luma block by performing a process of predicting and decoding the current luma block based on neighboring luma pixels (S1780). When the embodiment of FIG. 17 is applied to a chroma component (U or V), the encoder and decoder generate a prediction block for the current chroma block based on neighboring luma pixels, pixels in the reconstructed current luma block, and neighboring chroma pixels. and a reconstruction block for the current chroma block may be generated based on the generated prediction block.

도 18은 도 17의 실시예에서와 같이 복호화 과정이 수행되는 경우, 현재 크로마 블록에 대한 루마 참조 정보 및 예측 파라미터를 도출하는 과정의 실시예를 설명하기 위한 도면이다.FIG. 18 is a diagram for explaining an embodiment of a process of deriving luma reference information and prediction parameters for a current chroma block when a decoding process is performed as in the embodiment of FIG. 17 .

도 18은 예측 대상이 되는 루마 성분 블록(1810), 루마 성분 블록의 예측에 사용되는 주변 루마 픽셀들(1820, PY), 복원된 현재 루마 블록(1830, PRecY), 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들(1840, PLM), 현재 크로마 블록(1850) 및 주변 크로마 픽셀들(1860, PC)을 도시한다. 도 18의 실시예에서, 예측 대상이 되는 루마 성분 블록(1810) 및 복원된 현재 루마 블록(1830, PRecY)의 크기는 8x8이고 현재 크로마 블록(1850)의 크기는 4x4일 수 있다.18 shows a luma component block 1810 to be predicted, neighboring luma pixels 1820 (P Y ) used for prediction of the luma component block, a reconstructed current luma block (1830, P RecY ), and luma reference information generation It shows the surrounding luma pixels 1840 (P LM ) used, the current chroma block 1850 and the surrounding chroma pixels 1860 (P C ). In the embodiment of FIG. 18 , the size of the luma component block 1810 to be predicted and the reconstructed current luma block 1830 (P RecY ) may be 8x8, and the size of the current chroma block 1850 may be 4x4.

상술한 바와 같이, 도 17의 실시예는 루마 성분(Y)이 아닌 크로마 성분(U,V)에 대해서도 적용될 수 있다. 현재 크로마 블록(1850)의 예측 모드가 LM 모드인 경우, 패딩 과정이 수행된 후에 부호화기 및 복호화기는 현재 크로마 블록(1850)에 대한 루마 참조 정보 및 예측 파라미터를 도출할 수 있다.As described above, the embodiment of FIG. 17 may be applied to chroma components (U and V) other than the luma component (Y). When the prediction mode of the current chroma block 1850 is the LM mode, the encoder and decoder may derive luma reference information and prediction parameters for the current chroma block 1850 after the padding process is performed.

부호화기 및 복호화기는 주변 루마 픽셀들(1820, PY)을 기반으로 예측 대상이 되는 루마 성분 블록(1810) 내 픽셀들의 예측 값을 도출할 수 있다. 이 때, 부호화기 및 복호화기는 도출된 예측 값을 기반으로 루마 성분의 복원 블록을 생성할 수 있으며, 이는 복원된 현재 루마 블록(1830, PRecY)에 해당될 수 있다. 또한, 부호화기 및 복호화기는 루마 성분 블록(1810)의 예측에 사용된 주변 루마 픽셀들(1820, PY)을 기반으로, 루마 참조 정보 생성에 사용될 주변 루마 픽셀들(1840, PLM)을 결정할 수 있다. The encoder and decoder may derive predicted values of pixels within the luma component block 1810 to be predicted based on the neighboring luma pixels 1820 (P Y ). In this case, the encoder and decoder may generate a reconstructed block of a luma component based on the derived prediction value, which may correspond to the reconstructed current luma block 1830 (P RecY ). In addition, the encoder and decoder may determine neighboring luma pixels 1840 (P LM ) to be used for generating luma reference information based on the neighboring luma pixels 1820 (P Y ) used in prediction of the luma component block 1810. there is.

부호화기 및 복호화기는 주변 루마 픽셀들(1840, PLM) 및 복원된 현재 루마 블록(1830, PRecY)을 기반으로 현재 크로마 블록(1850)의 예측에 사용될 루마 참조 정보를 생성할 수 있다. 도 18에서는 복원된 현재 루마 블록(1830) 및 현재 크로마 블록(1850)의 크기가 서로 다르므로, 부호화기 및 복호화기는 현재 크로마 블록(1850)과 동일한 크기(4x4)의 루마 참조 블록 및 이에 대응되는 주변 루마 참조 픽셀들을 생성할 수 있다. 이 때, 현재 크로마 블록(1850)의 크기가 복원된 현재 루마 블록(1830)의 크기보다 작으므로, 부호화기 및 복호화기는 복원된 현재 루마 블록(1830) 내의 픽셀들 및 주변 루마 픽셀들(1840)에 대해 다운 샘플링을 수행함으로써 루마 참조 정보를 생성할 수 있다.The encoder and decoder may generate luma reference information to be used for prediction of the current chroma block 1850 based on the neighboring luma pixels 1840 (P LM ) and the reconstructed current luma block 1830 (P RecY ). In FIG. 18, since the sizes of the reconstructed current luma block 1830 and the current chroma block 1850 are different, the encoder and the decoder use a luma reference block of the same size (4x4) as the current chroma block 1850 and its surroundings. Luma reference pixels can be created. At this time, since the size of the current chroma block 1850 is smaller than the size of the reconstructed current luma block 1830, the encoder and the decoder use pixels in the reconstructed current luma block 1830 and neighboring luma pixels 1840. Luma reference information may be generated by performing down-sampling for .

복원된 현재 루마 블록(1830)의 상단에 위치한 주변 루마 픽셀들에 대해서는 일례로 다음 수학식 29에 의해 다운 샘플링 과정이 수행될 수 있다.A down-sampling process may be performed, for example, by Equation 29 below on the neighboring luma pixels positioned above the reconstructed current luma block 1830 .

[수학식 29][Equation 29]

PY'[x,-1] = (PLM[2x-1,-1] + 2*PLM[2x,-1] + PLM[2x+1,-1] + 2) >> 2,P Y '[x,-1] = (P LM [2x-1,-1] + 2*P LM [2x,-1] + P LM [2x+1,-1] + 2) >> 2,

(x = 0~NC-1)(x = 0 to N C -1)

여기서, PY'은 루마 참조 정보에 해당되는 픽셀(예컨대, 루마 참조 블록 내의 픽셀 또는 주변 루마 참조 픽셀)의 픽셀 값을 나타낼 수 있다. 또한, PLM은 루마 참조 정보 생성에 사용될 주변 루마 픽셀(1840)의 픽셀 값을 나타낼 수 있다. 그리고, NC는 현재 크로마 블록(1850)의 가로 길이 및 세로 길이를 나타낼 수 있다.Here, P Y ' may indicate a pixel value of a pixel corresponding to luma reference information (eg, a pixel in a luma reference block or a neighboring luma reference pixel). Also, P LM may indicate a pixel value of a neighboring luma pixel 1840 to be used for generating luma reference information. Also, N C may represent the horizontal length and vertical length of the current chroma block 1850 .

복원된 현재 루마 블록(1830)의 좌측에 위치한 주변 루마 픽셀들에 대해서는 일례로 다음 수학식 30에 의해 다운 샘플링 과정이 수행될 수 있다.A down-sampling process may be performed, for example, by Equation 30 below for peripheral luma pixels positioned to the left of the reconstructed current luma block 1830 .

[수학식 30][Equation 30]

PY'[-1,y] = (PLM[-1,2y] + PLM[-1,2y+1]) >> 1, (y = 0~NC-1)P Y '[-1,y] = (P LM [-1,2y] + P LM [-1,2y+1]) >> 1, (y = 0~N C -1)

복원 현재 루마 블록(1830) 내의 픽셀들에 대해서는 일례로 다음 수학식 31에 의해 다운 샘플링 과정이 수행될 수 있다. 다음 수학식 31에 의해서 현재 크로마 블록(1850)에 대응되는 루마 참조 블록이 생성될 수 있다.For the pixels in the reconstructed current luma block 1830, a downsampling process may be performed, for example, by Equation 31 below. A luma reference block corresponding to the current chroma block 1850 may be generated by Equation 31 below.

[수학식 31][Equation 31]

PY'[x,y] = (PRecY[2x,2y] + PRecY[2x,2y+1]) >> 1, (x,y = 0~NC-1)P Y '[x,y] = (P RecY [2x,2y] + P RecY [2x,2y+1]) >> 1, (x,y = 0~N C -1)

여기서, PRecY는 현재 루마 블록(1830) 내 픽셀의 픽셀 값을 나타낼 수 있다.Here, P RecY may indicate a pixel value of a pixel in the current luma block 1830 .

상술한 과정에 의해 루마 참조 정보가 생성되면, 부호화기 및 복호화기는 루마 참조 정보 및 크로마 성분 정보를 기반으로 현재 크로마 블록(1850)에 대한 예측 파라미터를 도출할 수 있다. 일례로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들(1840)의 픽셀 값 및 주변 크로마 픽셀들(1860)의 픽셀 값을 기반으로 예측 파라미터를 도출할 수 있다. 다음 수학식 32는 예측 파라미터를 도출하는 과정의 일부를 나타낼 수 있다.When luma reference information is generated by the above-described process, the encoder and decoder may derive a prediction parameter for the current chroma block 1850 based on the luma reference information and chroma component information. For example, the encoder and decoder may derive a prediction parameter based on pixel values of the neighboring luma reference pixels 1840 and pixel values of the neighboring chroma pixels 1860 . Equation 32 below may represent a part of a process of deriving a prediction parameter.

[수학식 32][Equation 32]

Figure pat00009
Figure pat00009

여기서, PC는 루마 참조 정보 생성에 사용될 주변 크로마 픽셀(1860)의 픽셀 값을 나타낼 수 있고, 'Bitdepth'는 크로마 성분 픽셀의 비트 심도를 나타낼 수 있다. Here, P C may indicate a pixel value of a neighboring chroma pixel 1860 to be used for generating luma reference information, and 'Bitdepth' may indicate a bit depth of a chroma component pixel.

수학식 32에 의해 도출된 k3, L, C, LL, LC를 기반으로 k2, a1, a2, k1, a1s, a2s, a3, α(알파), k 및 β(베타) 를 도출하는 과정의 실시예는 수학식 27의 실시예에서와 유사하므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다. 다만, 이 경우 수학식 27의 실시예에서 nS는 NC로 대체될 수 있고, p1은 PY'으로 대체될 수 있으며, p2는 PC로 대체될 수 있다. Implementation of the process of deriving k2, a1, a2, k1, a1s, a2s, a3, α (alpha), k and β (beta) based on k3, L, C, LL, LC derived by Equation 32 Since the example is similar to the embodiment of Equation 27, a detailed description thereof will be omitted here. However, in this case, in the embodiment of Equation 27, nS may be replaced with N C , p1 may be replaced with P Y ', and p2 may be replaced with P C .

예측 파라미터가 도출되면, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록(1830) 내 픽셀들의 픽셀 값을 기반으로, 현재 크로마 블록(1850) 내 픽셀들의 예측 값을 도출할 수 있다. 현재 크로마 블록(1850) 내 픽셀들의 예측 값을 도출하는 과정의 실시예는 수학식 28의 실시예에서와 유사하므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다. 다만, 이 경우 수학식 28의 실시예에서 nS는 NC로 대체될 수 있고, p1은 PRecY로 대체될 수 있다. After the prediction parameters are derived, the encoder and decoder may derive prediction values of pixels in the current chroma block 1850 based on the prediction parameters and pixel values of pixels in the luma reference block 1830 . Since an embodiment of a process of deriving predicted values of pixels in the current chroma block 1850 is similar to the embodiment of Equation 28, a detailed description thereof will be omitted here. However, in this case, in the embodiment of Equation 28, nS may be replaced with N C , and p1 may be replaced with P RecY .

도 19a 및 도 19b는 본 발명에 따른 복호화 과정의 다른 실시예를 설명하기 위한 도면이다. 19A and 19B are diagrams for explaining another embodiment of a decoding process according to the present invention.

도 19a는 본 발명에 따른 복호화 과정의 실시예를 나타낸다. 또한, 도 19b는 하나의 CU(1990)가 쿼드 트리 구조(quad-tree structure)를 기반으로 복수의 TU로 분할된 것을 나타낸다.19a shows an embodiment of a decryption process according to the present invention. 19B shows that one CU 1990 is divided into a plurality of TUs based on a quad-tree structure.

도 19a 및 도 19b(이하, 도 19라 함)의 실시예에서, Pk는 PY, PU 또는 PV일 수 있고, Nk는 NY, NU 또는 NV일 수 있다. 여기서, PY는 현재 루마 블록의 예측에 사용되는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 또한, PU 및 PV 는 현재 크로마 블록의 예측에 사용되는 주변 크로마 픽셀의 픽셀 값을 나타낼 수 있다. 여기서, PU 및 PV 는 PC로 나타내어질 수도 있다. 그리고, NY는 현재 루마 블록의 가로 길이 및 세로 길이를 나타내고, NU 및 NV 는 현재 크로마 블록의 가로 길이 및 세로 길이를 나타낼 수 있다. 여기서, NU 및 NV 는 NC로 나타내어질 수도 있다. 도 19의 실시예에서, PLM은 LM 모드에서 루마 참조 정보 생성에 사용되는 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다. 여기서, PY[x,y]와 PLM[x,y]는 서로 동일한 값을 가질 수 있다.19A and 19B (hereinafter referred to as FIG. 19 ), P k may be P Y , P U or P V , and N k may be N Y , N U or N V . Here, P Y may represent pixel values of neighboring luma pixels used for prediction of the current luma block. Also, P U and P V may represent pixel values of neighboring chroma pixels used for prediction of the current chroma block. Here, P U and P V may be represented by P C . Also, N Y may represent the horizontal and vertical lengths of the current luma block, and N U and N V may represent the horizontal and vertical lengths of the current chroma block. Here, N U and N V may be represented by N C . In the example of FIG. 19 , P LM may represent pixel values of neighboring luma pixels used to generate luma reference information in LM mode. Here, P Y [x,y] and P LM [x,y] may have the same value.

도 19의 실시예에서 k는 Y, U 또는 V일 수 있으므로, 도 19의 실시예는 루마 성분(Y) 및 크로마 성분(U, V)에 대해 모두 적용될 수 있다. 색 성분에 따라 도 19의 실시예에 적용되는 변수들의 관계는 일례로 다음 표 6에 의해 나타내어질 수 있다.In the embodiment of FIG. 19 , since k may be Y, U, or V, the embodiment of FIG. 19 may be applied to both the luma component Y and chroma components U and V. The relationship between variables applied to the embodiment of FIG. 19 according to color components may be represented by Table 6 below, for example.

[표 6][Table 6]

Figure pat00010
Figure pat00010

여기서, cIdx는 현재 블록의 색 성분이 Y, U(Cb), V(Cr) 중에서 어떤 성분에 해당되는지를 지시하는 인덱스일 수 있다. 일례로, 현재 블록의 색 성분이 Y인 경우 cIdx에는 0이 할당될 수 있고, 현재 블록의 색 성분이 U(Cb)인 경우 cIdx에 1이 할당될 수 있으며, 현재 블록의 색 성분이 V(Cr)인 경우 cIdx에는 2가 할당될 수 있다.Here, cIdx may be an index indicating which color component of the current block corresponds to Y, U(Cb), and V(Cr). For example, if the color component of the current block is Y, 0 may be assigned to cIdx, if the color component of the current block is U(Cb), 1 may be assigned to cIdx, and if the color component of the current block is V( Cr), 2 may be assigned to cIdx.

또한, 도 19의 실시예는 일례로 하나의 CU에서 색 공간을 구성하는 각각의 색 성분에 대해, Y 성분, U(Cb) 성분, V(Cr) 성분의 순서로 적용될 수 있다. In addition, the embodiment of FIG. 19 may be applied in order of a Y component, a U(Cb) component, and a V(Cr) component to each color component constituting a color space in one CU, for example.

도 19b를 참조하면, 하나의 CU(1990)는 쿼드 트리 구조를 기반으로 복수 개의 TU(1, 2, 3, 4, 5, 6, 7)로 분할될 수 있다. 이 때, 부호화기 및 복호화기는 우선 CU(1990) 내의 Y 성분 블록들에 대해 도 19a의 실시예에 따른 복호화 과정을 수행할 수 있다. 그리고 부호화기 및 복호화기는 CU(1990) 내의 U 성분 블록들 및 V 성분 블록들에 대해 순서대로 도 19a의 실시예에 따른 복호화 과정을 수행할 수 있다. 일례로, 도 19의 실시예에 따른 복호화 과정은 [Y1->Y2->...->Y7->U1->U2->...->U7->V1->V2...->V7]의 순서로 수행될 수 있다. 여기서 일례로, Y1은 도 19b에서 블록 1의 루마 성분에 대해 복호화가 수행됨을 의미할 수 있다. Referring to FIG. 19B, one CU 1990 may be divided into a plurality of TUs (1, 2, 3, 4, 5, 6, 7) based on a quad tree structure. At this time, the encoder and decoder may first perform the decoding process according to the embodiment of FIG. 19A on the Y component blocks in the CU 1990. Also, the encoder and decoder may sequentially perform the decoding process according to the embodiment of FIG. 19A on U component blocks and V component blocks in the CU 1990. As an example, the decoding process according to the embodiment of FIG. 19 is [Y1->Y2->...->Y7->U1->U2->...->U7->V1->V2...- >V7]. As an example, Y1 may mean that decoding is performed on the luma component of block 1 in FIG. 19B.

도 19a를 참조하면, 부호화기 및 복호화기는 Pk[x,y], (x=-1, y=-1~Nk*2-1 및 x=0~Nk*2-1, y=-1)가 가용한지 여부를 체크하여 마킹(marking)할 수 있다(S1910). 상술한 바와 같이, 마킹이라 함은 가용성(availability)에 대한 정보를 저장하거나 표시하는 과정을 의미할 수 있다. 주변 루마 픽셀이 가용하지 않은 경우의 실시예들은 도 8의 실시예에서 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.Referring to FIG. 19A, the encoder and decoder P k [x,y], (x = -1, y = -1 to N k *2-1 and x = 0 to N k *2-1, y = - 1) can be marked by checking whether it is available (S1910). As described above, marking may mean a process of storing or displaying information about availability. Since the embodiments in which the peripheral luma pixels are not available have been described above in the embodiment of FIG. 8 , a detailed description thereof will be omitted here.

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 A, 조건 B 및 조건 C가 만족되는지 여부를 판단할 수 있다(S1920). Referring back to FIG. 19A, the encoder and decoder may determine whether conditions A, B, and C are satisfied (S1920).

여기서, 조건 A는 현재 크로마 블록의 인트라 예측에 LM 모드가 적용될 수 있음을 나타내는 조건이다. 일례로, 조건 A는 LM 플래그(chroma_pred_from_luma_enabled_flag)에 1이 할당되어 있는 경우에 만족될 수 있다. 상술한 바와 같이, chroma_pred_from_luma_enabled_flag는 현재 크로마 블록의 인트라 예측에 대해 LM 모드가 지원될 수 있는지 여부를 나타낼 수 있다. 또한, 조건 B는 현재 블록의 인트라 예측 모드가 LM 모드임을 나타내는 조건이다. 여기서, 일례로 LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 조건 C는 현재 블록이 크로마 성분 블록(U(Cb) 또는 V(Cr))임을 나타내는 조건이다. 일례로, 조건 C는 cIdx에 1 또는 2가 할당되어 있는 경우에 만족될 수 있다.Here, condition A is a condition indicating that the LM mode can be applied to intra prediction of the current chroma block. For example, condition A may be satisfied when 1 is allocated to the LM flag (chroma_pred_from_luma_enabled_flag). As described above, chroma_pred_from_luma_enabled_flag may indicate whether the LM mode can be supported for intra prediction of the current chroma block. Also, condition B is a condition indicating that the intra prediction mode of the current block is the LM mode. Here, as an example, the LM mode may be represented as Intra_FromLuma. Also, condition C is a condition indicating that the current block is a chroma component block (U(Cb) or V(Cr)). As an example, condition C can be satisfied when 1 or 2 is assigned to cIdx.

조건 A, 조건 B 및 조건 C가 만족되는 경우, 부호화기 및 복호화기는 PLM을 생성할 수 있다.When condition A, condition B, and condition C are satisfied, the encoder and decoder can generate P LM .

다시 도 19a를 참조하면, 조건 A, 조건 B 및 조건 C가 만족되는 경우 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1)가 가용한지 여부를 체크하여 마킹(marking)할 수 있다(S1930). Referring back to FIG. 19A, if condition A, condition B, and condition C are satisfied, the encoder and decoder P LM [x,y], (x=-1, y=-1 to N Y *2-1 and x = 0 to N Y * 2-1, y = -1) may be checked and marked (S1930).

이 때 일례로 일례로 PLM 에 대한 마킹 과정이 수행된 후 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=0~NY*2-1)에 해당되는 픽셀들 중에서 가용한 것으로 판별된 픽셀들의 픽셀 값을 [x-1,y] 위치의 픽셀 값 즉, PLM[x-1,y]의 픽셀 값으로 대체할 수도 있다. At this time, for example, after the marking process for P LM is performed, the encoder and decoder pixels corresponding to P LM [x,y], (x=-1, y=0 to N Y *2-1) The pixel values of the pixels determined to be usable may be replaced with the pixel value at the position [x-1,y], that is, the pixel value of P LM [x-1,y].

또한 이 때 일 실시예로, 부호화기 및 복호화기는 주변 루마 픽셀들에 대응되는 주변 크로마 픽셀, 즉 PU 또는 PV의 가용성을 기반으로 PLM이 가용한지 여부를 체크할 수 있다. 이 때, PU 또는 PV가 가용한지 여부는 S1910 단계에서 이미 마킹되어 있을 수 있다. 일례로, 부호화기 및 보호화기는 PU에 해당되는 픽셀이 가용한지 여부를 기반으로 PLM이 가용한지 여부를 판단할 수 있다.Also at this time, as an embodiment, the encoder and decoder may check whether P LM is available based on the availability of neighboring chroma pixels corresponding to neighboring luma pixels, that is, P U or P V . At this time, whether P U or P V is available may be already marked in step S1910. For example, the encoder and protector may determine whether the P LM is available based on whether a pixel corresponding to P U is available.

예를 들어, x=-1, y=0~NU*2-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용하지 않은 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[x,2y] 및 PLM[x,2y+1]도 가용하지 않은 것으로 판단할 수 있다. 반면, x=-1, y=0~NU*2-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용한 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[x,2y] 및 PLM[x,2y+1]도 가용한 것으로 판단할 수 있다. For example, if the surrounding chroma pixel P U [x,y] is marked as unavailable for x=-1, y=0~N U *2-1, then the encoder and decoder can use the surrounding luma pixel P LM [x ,2y] and P LM [x,2y+1] can also be determined to be unavailable. On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x=-1, y=0~N U *2-1, then the encoder and decoder use the surrounding luma pixel P LM [x,2y] and P LM [x, 2y + 1] may also be determined to be available.

이 때, 부호화기 및 복호화기는 [x-1,2y] 및 [x-1,2y+1]에 위치한 루마 픽셀 값을 각각 PLM[x,2y] 및 PLM[x,2y+1]에 할당할 수 있다. 따라서, 주변 루마 픽셀이 현재 루마 블록의 좌측에 인접하여 위치한 좌측 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀의 좌측에 인접하여 위치한 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.At this time, the encoder and decoder assign luma pixel values located at [x-1,2y] and [x-1,2y+1] to P LM [x,2y] and P LM [x,2y+1], respectively. can do. Accordingly, if it is determined that a peripheral luma pixel is a pixel on the left pixel line located adjacent to the left side of the current luma block and the peripheral luma pixel is available, the pixel value of the luma pixel located adjacent to the left side of the peripheral luma pixel is the pixel value of the adjacent luma pixel. It may be determined as a pixel value of a luma pixel.

또한, x=0~NU*2-1, y=-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용하지 않은 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[2x,y] 및 PLM[2x+1,y]도 가용하지 않은 것으로 판단할 수 있다. 반면, x=0~NU*2-1, y=-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용한 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[2x,y] 및 PLM[2x+1,y]도 가용한 것으로 판단할 수 있다. Also, if the surrounding chroma pixel P U [x,y] is marked as unavailable for x=0~N U *2-1, y=-1, then the encoder and decoder use the surrounding luma pixel P LM [2x,y ] and P LM [2x+1,y] can also be determined to be unavailable. On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x=0~N U *2-1, y=-1, then the encoder and decoder use the surrounding luma pixel P LM [2x,y] and P LM [2x+1,y] may also be determined to be available.

이 때, 부호화기 및 복호화기는 [2x,y] 및 [2x+1,y]에 위치한 루마 픽셀 값을 각각 PLM[2x,y] 및 PLM[2x+1,y]에 할당할 수 있다. 따라서, 주변 루마 픽셀이 현재 루마 블록의 상단에 인접하여 위치한 상단 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In this case, the encoder and decoder may allocate luma pixel values located at [2x,y] and [2x+1,y] to P LM [2x,y] and P LM [2x+1,y], respectively. Accordingly, if it is determined that the peripheral luma pixel is a pixel on the top pixel line located adjacent to the top of the current luma block and the peripheral luma pixel is available, the pixel value of the luma pixel at the same location as the peripheral luma pixel is the peripheral luma pixel It can be determined as a pixel value of

또한, x=-1, y=-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용하지 않은 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[x,y]도 가용하지 않은 것으로 판단할 수 있다. 반면, x=-1, y=-1에 대해 주변 크로마 픽셀 PU[x,y]가 가용한 것으로 마킹된다면, 부호화기 및 복호화기는 주변 루마 픽셀 PLM[x,y]도 가용한 것으로 판단할 수 있다. Also, if the surrounding chroma pixel P U [x,y] is marked as unavailable for x=-1, y=-1, then the encoder and decoder determine that the surrounding luma pixel P LM [x,y] is also unavailable. can judge On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x = -1 and y = -1, the encoder and decoder will determine that the surrounding luma pixel P LM [x,y] is also available. can

이 때, 부호화기 및 복호화기는 [x,y]에 위치한 루마 픽셀 값을 PLM[x,y]에 할당할 수 있다. 따라서, 주변 루마 픽셀의 위치가 [-1,-1]이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.At this time, the encoder and decoder may allocate the luma pixel value located at [x,y] to P LM [x,y]. Therefore, if the position of the neighboring luma pixel is [-1,-1] and it is determined that the neighboring luma pixel is available, the pixel value of the luma pixel at the same position as the neighboring luma pixel is determined as the pixel value of the neighboring luma pixel. can

상술한 실시예에서는 PU를 기반으로 PLM이 가용한지 여부를 체크하는 과정이 서술되고 있지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, PLM이 가용한지 여부는 PV를 기반으로 체크될 수도 있다.In the above-described embodiment, a process of checking whether P LM is available based on P U is described, but the present invention is not limited thereto. For example, whether P LM is available may be checked based on P V .

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 D가 만족되는지 여부를 판단할 수 있다(S1940). 여기서, 조건 D는 Pk[x,y], (x=-1, y=-1~Nk*2-1 및 x=0~Nk*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring back to FIG. 19A, the encoder and decoder may determine whether condition D is satisfied (S1940). Here, condition D is at least one of P k [x,y], (x=-1, y=-1~N k *2-1 and x=0~N k *2-1, y=-1) A condition indicating that a pixel in is not available.

조건 D가 만족되는 경우, 부호화기 및 복호화기는 Pk[x,y], (x=-1, y=-1~Nk*2-1 및 x=0~Nk*2-1, y=-1) 중에서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다(S1950). 패딩 과정의 실시예들은 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.If condition D is satisfied, the encoder and decoder P k [x,y], (x=-1, y=-1~N k *2-1 and x=0~N k *2-1, y= A padding process may be performed on unavailable pixels among -1) (S1950). Since the embodiments of the padding process have been described above, a detailed description thereof will be omitted here.

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 A, 조건 B, 조건 C 및 조건 E가 만족되는지 여부를 판단할 수 있다(S1960). 여기서, 조건 E는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring back to FIG. 19A , the encoder and decoder may determine whether conditions A, B, C, and E are satisfied (S1960). Here, condition E is at least one of P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=-1) A condition indicating that a pixel in is not available.

조건 A, 조건 B, 조건 C 및 조건 E가 만족되는 경우, 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 가용하지 않은 픽셀들에 대해 패딩 과정을 수행할 수 있다(S1970). 패딩 과정의 구체적인 실시예들은 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.If condition A, condition B, condition C and condition E are satisfied, the encoder and decoder P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~ A padding process may be performed on unavailable pixels among N Y *2-1, y = -1 (S1970). Since specific embodiments of the padding process have been described above, a detailed description thereof will be omitted here.

상술한 패딩 과정이 수행된 후, 부호화기 및 복호화기는 현재 루마 블록 및/또는 현재 크로마 블록에 대한 예측 및 복호화 과정을 수행함으로써, 현재 루마 블록에 대한 복원 블록 및/또는 현재 크로마 블록에 대한 복원 블록을 생성할 수 있다(S1980). After the above-described padding process is performed, the encoder and the decoder perform a process of predicting and decoding the current luma block and/or the current chroma block to obtain a reconstruction block for the current luma block and/or a reconstruction block for the current chroma block. It can be created (S1980).

이 때, 현재 크로마 블록에 대해서는 LM 모드 예측이 적용될 수도 있다. LM 모드에서의 예측 과정은 도 18의 실시예에서와 유사하므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.In this case, LM mode prediction may be applied to the current chroma block. Since the prediction process in the LM mode is similar to that in the embodiment of FIG. 18, a detailed description thereof will be omitted here.

상술한 실시예들에서, 방법들은 일련의 단계 또는 블록으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the foregoing embodiments, the methods are described on the basis of a flowchart as a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order or concurrently with other steps as described above. can In addition, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, that other steps may be included, or that one or more steps of the flow chart may be deleted without affecting the scope of the present invention. You will understand.

상술한 실시예는 다양한 양태의 예시들을 포함한다. 다양한 양태들을 나타내기 위한 모든 가능한 조합을 기술할 수는 없지만, 해당 기술 분야의 통상의 지식을 가진 자는 다른 조합이 가능함을 인식할 수 있을 것이다. 따라서, 본 발명은 이하의 특허청구범위 내에 속하는 모든 다른 교체, 수정 및 변경을 포함한다고 할 것이다.The foregoing embodiment includes examples of various aspects. It is not possible to describe all possible combinations to represent the various aspects, but those skilled in the art will recognize that other combinations are possible. Accordingly, it is intended that the present invention cover all other substitutions, modifications and variations falling within the scope of the following claims.

Claims (9)

현재 크로마 블록의 인트라 예측 모드를 나타내는 인트라 예측 모드 정보에 따라, 상기 현재 크로마 블록에 LM 모드가 적용되는지 여부를 판단하는 단계;
상기 현재 크로마 블록에 LM 모드가 적용됨에 따라, 상기 현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계; 및
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 복호화 방법.
determining whether an LM mode is applied to the current chroma block according to intra prediction mode information indicating the intra prediction mode of the current chroma block;
When the LM mode is applied to the current chroma block, whether left neighboring luma pixels adjacent to the left side of the luma reference block among the neighboring luma pixels of the luma reference block corresponding to the current chroma block are available and of the luma reference block determining whether top perimeter luma pixels adjacent to the top are available;
determining peripheral luma reference pixels according to whether the left peripheral luma pixels are available and whether the top peripheral luma pixels are available;
determining neighboring chroma reference pixels corresponding to the neighboring luma reference pixels from among neighboring chroma pixels located around the current chroma block;
deriving a prediction parameter for the current chroma block based on the neighboring luma reference pixels and the neighboring chroma reference pixels; and
Deriving a predicted value of a pixel in the current chroma block based on a pixel in the luma reference block and the prediction parameter;
the left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left of the first left peripheral luma pixel;
If the left peripheral luma pixels are available, a downsampled peripheral luma reference pixel determined based on the first left peripheral luma pixel and the second left peripheral luma pixel and a peripheral chroma corresponding to the downsampled peripheral luma reference pixel Based on a reference pixel, the prediction parameter for the current chroma block is derived.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 좌측 주변 루마 픽셀들이 이용가능하지 않은 경우, 상기 좌측 주변 루마 픽셀들은 주변 루마 참조 픽셀들에 포함되지 않고,
상기 상단 주변 루마 픽셀들이 이용가능하지 않은 경우, 상기 상단 주변 루마 픽셀들은 주변 루마 참조 픽셀들에 포함되지 않는 것을 특징으로 하는 영상 복호화 방법.
According to claim 1,
Determining the peripheral luma reference pixels,
if the left peripheral luma pixels are not available, the left peripheral luma pixels are not included in peripheral luma reference pixels;
When the upper peripheral luma pixels are not available, the upper peripheral luma pixels are not included in peripheral luma reference pixels.
제 1항에 있어서,
상기 예측 파라미터를 도출하는 단계에서,
상기 주변 루마 픽셀들은 소정의 크기를 갖는 픽셀 그룹들에 포함되고,
상기 픽셀 그룹들 각각에 대하여, 상기 주변 루마 픽셀들 중 소정 위치의 주변 루마 샘플이 선택되고,
상기 선택된 소정 위치의 주변 루마 샘플에 기초하여, 상기 주변 루마 픽셀들이 다운샘플링되고,
상기 다운샘플링된 주변 루마 픽셀들에 기초하여, 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 복호화 방법.
According to claim 1,
In the step of deriving the prediction parameter,
The peripheral luma pixels are included in pixel groups having a predetermined size;
For each of the pixel groups, a peripheral luma sample at a predetermined position among the peripheral luma pixels is selected;
Based on the selected peripheral luma sample of the predetermined location, the peripheral luma pixels are downsampled;
Wherein the prediction parameter is derived based on the downsampled neighboring luma pixels.
제 1항에 있어서,
상기 상단 주변 루마 픽셀들은, 상기 제1 상단 주변 루마 픽셀의 상단에 바로 인접한 제2 상단 주변 루마 픽셀을 더 포함하는 것을 특징으로 하는 영상 복호화 방법.
According to claim 1,
The image decoding method of claim 1 , wherein the upper peripheral luma pixels further include a second upper peripheral luma pixel immediately adjacent to an upper end of the first upper peripheral luma pixel.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 좌측 주변 루마 픽셀들이 이용가능한 경우, 상기 좌측 주변 루마 픽셀들 및 좌하측 주변 루마 픽셀들에 따라, 상기 주변 루마 참조 픽셀들을 결정하는 것을 특징으로 하는 영상 복호화 방법.
According to claim 1,
Determining the peripheral luma reference pixels,
and determining the peripheral luma reference pixels according to the left peripheral luma pixels and the lower-left peripheral luma pixels when the left peripheral luma pixels are available.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 상단 주변 루마 픽셀들이 이용가능한 경우, 상기 상단 주변 루마 픽셀들 및 우상측 주변 루마 픽셀에 따라, 상기 주변 루마 참조 픽셀들을 결정하는 것을 특징으로 하는 영상 복호화 방법.
According to claim 1,
Determining the peripheral luma reference pixels,
and determining the peripheral luma reference pixels according to the top peripheral luma pixels and the top right peripheral luma pixel when the upper peripheral luma pixels are available.
제1항에 있어서,
상기 영상 복호화 방법은,
상기 현재 크로마 블록이 포함된 현재 시퀀스에서 크로마 블록의 인트라 예측에 LM 모드가 적용될 수 있는지 여부를 나타내는 LM 플래그 정보를 획득하는 단계; 및
상기 LM 플래그 정보가 상기 현재 시퀀스에서 크로마 블록의 인트라 예측에 LM 모드가 적용됨을 나타낼 때, 상기 현재 크로마 블록의 인트라 예측 모드를 나타내는 인트라 예측 모드 정보에 따라, 상기 현재 크로마 블록에 LM 모드가 적용되는지 여부를 판단하는 단계를 더 포함하는 영상 복호화 방법.
According to claim 1,
The video decoding method,
obtaining LM flag information indicating whether an LM mode can be applied to intra prediction of a chroma block in a current sequence including the current chroma block; and
When the LM flag information indicates that the LM mode is applied to intra prediction of a chroma block in the current sequence, whether the LM mode is applied to the current chroma block according to intra prediction mode information indicating the intra prediction mode of the current chroma block An image decoding method further comprising the step of determining whether or not.
현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계;
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계; 및
상기 현재 크로마 블록의 예측 결과에 따라, 상기 현재 크로마 블록에 LM 모드가 적용되는지 여부를 판단하고, 상기 판단 결과에 따라, 현재 크로마 블록의 인트라 예측 모드를 나타내는 인트라 예측 모드 정보를 부호화하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 부호화 방법.
Determine whether left neighboring luma pixels adjacent to the left side of the luma reference block among the neighboring luma pixels of the luma reference block corresponding to the current chroma block are available and whether upper neighboring luma pixels adjacent to the top of the luma reference block are available doing;
determining peripheral luma reference pixels according to whether the left peripheral luma pixels are available and whether the top peripheral luma pixels are available;
determining neighboring chroma reference pixels corresponding to the neighboring luma reference pixels from among neighboring chroma pixels located around the current chroma block;
deriving a prediction parameter for the current chroma block based on the neighboring luma reference pixels and the neighboring chroma reference pixels;
deriving a predicted value of a pixel in the current chroma block based on a pixel in the luma reference block and the prediction parameter; and
Determining whether the LM mode is applied to the current chroma block according to a prediction result of the current chroma block, and encoding intra prediction mode information indicating an intra prediction mode of the current chroma block according to the determination result do,
the left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left of the first left peripheral luma pixel;
If the left peripheral luma pixels are available, a downsampled peripheral luma reference pixel determined based on the first left peripheral luma pixel and the second left peripheral luma pixel and a peripheral chroma corresponding to the downsampled peripheral luma reference pixel Based on a reference pixel, the prediction parameter for the current chroma block is derived.
비트스트림을 저장한 컴퓨터로 판독 가능한 기록 매체로서,
상기 비트스트림은 영상 복호화 방법에 의해 복호화되는 영상 데이터를 포함하고,
상기 영상 데이터는 현재 크로마 블록의 인트라 예측 모드를 나타내는 인트라 예측 모드 정보를 포함하고,
상기 영상 복호화 방법은,
상기 인트라 예측 모드 정보에 따라, 상기 현재 크로마 블록에 LM 모드가 적용되는지 여부를 판단하는 단계;
상기 현재 크로마 블록에 LM 모드가 적용됨에 따라, 상기 현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계; 및
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 컴퓨터로 판독 가능한 기록 매체.
A computer-readable recording medium storing a bitstream,
The bitstream includes image data decoded by an image decoding method,
The image data includes intra prediction mode information indicating an intra prediction mode of a current chroma block;
The video decoding method,
determining whether an LM mode is applied to the current chroma block according to the intra prediction mode information;
When the LM mode is applied to the current chroma block, whether left neighboring luma pixels adjacent to the left side of the luma reference block among the neighboring luma pixels of the luma reference block corresponding to the current chroma block are available and of the luma reference block determining whether top perimeter luma pixels adjacent to the top are available;
determining peripheral luma reference pixels according to whether the left peripheral luma pixels are available and whether the top peripheral luma pixels are available;
determining neighboring chroma reference pixels corresponding to the neighboring luma reference pixels from among neighboring chroma pixels located around the current chroma block;
deriving a prediction parameter for the current chroma block based on the neighboring luma reference pixels and the neighboring chroma reference pixels; and
Deriving a predicted value of a pixel in the current chroma block based on a pixel in the luma reference block and the prediction parameter;
the left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left of the first left peripheral luma pixel;
If the left peripheral luma pixels are available, a downsampled peripheral luma reference pixel determined based on the first left peripheral luma pixel and the second left peripheral luma pixel and a peripheral chroma corresponding to the downsampled peripheral luma reference pixel Based on a reference pixel, the prediction parameter for the current chroma block is derived.
KR1020230005110A 2011-11-08 2023-01-13 Method for intra prediction and apparatus thereof KR102607887B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020230166008A KR20230165180A (en) 2011-11-08 2023-11-24 Method for intra prediction and apparatus thereof

Applications Claiming Priority (11)

Application Number Priority Date Filing Date Title
KR20110116096 2011-11-08
KR1020110116096 2011-11-08
KR1020110119992 2011-11-17
KR20110119992 2011-11-17
KR20120005946 2012-01-18
KR1020120005946 2012-01-18
KR20120006657 2012-01-20
KR1020120006657 2012-01-20
KR1020120010004 2012-01-31
KR20120010004 2012-01-31
KR1020220121818A KR102489735B1 (en) 2011-11-08 2022-09-26 Method for intra prediction and apparatus thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020220121818A Division KR102489735B1 (en) 2011-11-08 2022-09-26 Method for intra prediction and apparatus thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020230166008A Division KR20230165180A (en) 2011-11-08 2023-11-24 Method for intra prediction and apparatus thereof

Publications (2)

Publication Number Publication Date
KR20230013146A true KR20230013146A (en) 2023-01-26
KR102607887B1 KR102607887B1 (en) 2023-11-29

Family

ID=48661126

Family Applications (6)

Application Number Title Priority Date Filing Date
KR1020120125858A KR20130050900A (en) 2011-11-08 2012-11-08 Method for intra prediction and apparatus thereof
KR1020210079558A KR102409444B1 (en) 2011-11-08 2021-06-18 Method for intra prediction and apparatus thereof
KR1020220070901A KR102449210B1 (en) 2011-11-08 2022-06-10 Method for intra prediction and apparatus thereof
KR1020220121818A KR102489735B1 (en) 2011-11-08 2022-09-26 Method for intra prediction and apparatus thereof
KR1020230005110A KR102607887B1 (en) 2011-11-08 2023-01-13 Method for intra prediction and apparatus thereof
KR1020230166008A KR20230165180A (en) 2011-11-08 2023-11-24 Method for intra prediction and apparatus thereof

Family Applications Before (4)

Application Number Title Priority Date Filing Date
KR1020120125858A KR20130050900A (en) 2011-11-08 2012-11-08 Method for intra prediction and apparatus thereof
KR1020210079558A KR102409444B1 (en) 2011-11-08 2021-06-18 Method for intra prediction and apparatus thereof
KR1020220070901A KR102449210B1 (en) 2011-11-08 2022-06-10 Method for intra prediction and apparatus thereof
KR1020220121818A KR102489735B1 (en) 2011-11-08 2022-09-26 Method for intra prediction and apparatus thereof

Family Applications After (1)

Application Number Title Priority Date Filing Date
KR1020230166008A KR20230165180A (en) 2011-11-08 2023-11-24 Method for intra prediction and apparatus thereof

Country Status (1)

Country Link
KR (6) KR20130050900A (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103313055B (en) * 2013-06-03 2016-04-20 电子科技大学 A kind of chroma intra prediction method based on segmentation and video code and decode method
US10602138B2 (en) 2015-08-27 2020-03-24 Lg Electronics Inc. Method and device for chroma sample intra prediction in video coding system
CN109804625A (en) * 2016-10-04 2019-05-24 韩国电子通信研究院 The recording medium of method and apparatus and stored bits stream to encoding/decoding image
US10880546B2 (en) 2016-10-11 2020-12-29 Lg Electronics Inc. Method and apparatus for deriving intra prediction mode for chroma component
WO2019198997A1 (en) * 2018-04-11 2019-10-17 엘지전자 주식회사 Intra-prediction-based image coding method and apparatus thereof
WO2019203487A1 (en) * 2018-04-19 2019-10-24 엘지전자 주식회사 Method and apparatus for encoding image on basis of intra prediction
WO2020050607A1 (en) * 2018-09-05 2020-03-12 엘지전자 주식회사 Image prediction method and device for deriving chroma intra-prediction mode
WO2020116848A1 (en) * 2018-12-05 2020-06-11 엘지전자 주식회사 Image prediction method and device for deriving chroma intra prediction mode
CA3152834A1 (en) * 2019-08-29 2021-03-04 Lg Electronics Inc. Cross-component adaptive loop filtering-based image coding apparatus and method
KR20220044766A (en) 2019-08-29 2022-04-11 엘지전자 주식회사 Cross-component filtering-based video coding apparatus and method
WO2023182751A1 (en) * 2022-03-21 2023-09-28 주식회사 케이티 Image encoding/decoding method and apparatus
WO2023200302A1 (en) * 2022-04-14 2023-10-19 주식회사 케이티 Image encoding/decoding method and apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140019388A (en) * 2011-06-03 2014-02-14 소니 주식회사 Image processing device and image processing method
KR20140029525A (en) * 2011-07-12 2014-03-10 인텔 코오퍼레이션 Luma-based chroma intra prediction

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140019388A (en) * 2011-06-03 2014-02-14 소니 주식회사 Image processing device and image processing method
KR20140029525A (en) * 2011-07-12 2014-03-10 인텔 코오퍼레이션 Luma-based chroma intra prediction

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
B. Bross, et al. High Efficiency Video Coding (HEVC) text specification draft 6. JCT-VC of ITU-T and ISO/IEC. JCTVC-H1003 Ver.1, Feb. 10, 2012, pp.1-211 *
B. Bross, et al. WD4: Working Draft 4 of High-Efficiency Video Coding. JCT-VC of ITU-T and ISO/IEC. JCTVC-F803 Ver.7, Oct. 28, 2011, pp.1-217* *
J. Lee, et al. Inconsistency of intra LM mode between HM and WD. JCT-VC of ITU-T and ISO/IEC. JCTVC-G419 Ver.3, Nov. 28, 2011, pp.1-7 *

Also Published As

Publication number Publication date
KR20130050900A (en) 2013-05-16
KR20230165180A (en) 2023-12-05
KR20220133170A (en) 2022-10-04
KR102607887B1 (en) 2023-11-29
KR102449210B1 (en) 2022-09-29
KR20210079254A (en) 2021-06-29
KR20220083654A (en) 2022-06-20
KR102489735B1 (en) 2023-01-18
KR102409444B1 (en) 2022-06-15

Similar Documents

Publication Publication Date Title
KR102489735B1 (en) Method for intra prediction and apparatus thereof
KR102431537B1 (en) Encoders, decoders and corresponding methods using IBC dedicated buffers and default value refreshing for luma and chroma components
KR20240051331A (en) Cclm-based intra-prediction method and apparatus
JP2019004491A (en) Image encoding/decoding method and apparatus for the same
TW201830964A (en) Deriving bilateral filter information based on a prediction mode in video coding
CN115244924A (en) Signaling across component adaptive loop filters
KR20200112964A (en) Method and apparatus for predicting residual code in transform domain
KR102424973B1 (en) Methods For Encoding and Decoding Candidate Mode List in Intra Prediction Mode
KR20210125088A (en) Encoders, decoders and corresponding methods harmonizing matrix-based intra prediction and quadratic transform core selection
JP7486595B2 (en) Method and apparatus for video filtering
KR20220100991A (en) Video filtering method and device
WO2019010315A1 (en) Division-free bilateral filter
KR20220080738A (en) Image encoding/decoding method, apparatus, and bitstream transmission method using lossless color conversion
EP4118822A1 (en) Adaptive non-linear mapping for sample offset
KR20220128468A (en) Sample offset by predefined filters
KR20220127308A (en) Method and apparatus for video coding
CN114747212A (en) Method and apparatus for shifting in video filtering
CN116325734A (en) Chroma codec enhancement in cross-component sample adaptive offset with virtual boundaries
CN113647103A (en) Method and apparatus for quantizing coefficients for matrix-based intra prediction techniques
KR102349435B1 (en) The method of encoding and decoding of quantization matrix and the apparatus for using the same
JP2018530956A (en) Video encoding / decoding method and apparatus therefor
WO2013069972A1 (en) Method for intra-prediction and device thereof
JP7408834B2 (en) Method and apparatus for video filtering
KR20220131225A (en) Method and apparatus for video coding
JP2024510600A (en) Adaptive application of generalized sample offset

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right