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

Method for intra prediction and apparatus thereof Download PDF

Info

Publication number
KR102449210B1
KR102449210B1 KR1020220070901A KR20220070901A KR102449210B1 KR 102449210 B1 KR102449210 B1 KR 102449210B1 KR 1020220070901 A KR1020220070901 A KR 1020220070901A KR 20220070901 A KR20220070901 A KR 20220070901A KR 102449210 B1 KR102449210 B1 KR 102449210B1
Authority
KR
South Korea
Prior art keywords
luma
pixels
pixel
block
neighboring
Prior art date
Application number
KR1020220070901A
Other languages
Korean (ko)
Other versions
KR20220083654A (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 KR20220083654A publication Critical patent/KR20220083654A/en
Priority to KR1020220121818A priority Critical patent/KR102489735B1/en
Application granted granted Critical
Publication of KR102449210B1 publication Critical patent/KR102449210B1/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/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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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, based on a pixel in a current luma block and a neighboring luma pixel located around the current luma block, luma reference information including a pixel in a luma reference block and a neighboring luma reference pixel located around the luma reference block generating, based on a first neighboring chroma reference pixel corresponding to a neighboring luma reference pixel among neighboring luma reference pixels and neighboring chroma pixels located around the current chroma block, deriving a prediction parameter for the current chroma block and luma reference and deriving a prediction value of the 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 therefor

본 발명은 영상 처리에 관한 것으로서, 보다 상세하게는 인트라 예측 방법 및 장치에 관한 것이다.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 expanding not only domestically but also worldwide, many users are getting used to high-resolution and high-definition images, and accordingly, many institutions are spurring the development of next-generation imaging devices. 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 higher resolution and high-definition images is required.

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

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

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

본 발명의 또 다른 기술적 과제는 영상 부호화/복호화 효율을 향상시킬 수 있는 인트라 예측 방법 및 장치를 제공함에 있다.Another technical object 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 a pixel in a luma reference block and a neighboring luma reference pixel located in the vicinity of the luma reference block, based on a pixel in the current luma block and a neighboring luma pixel 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 the neighboring luma reference pixel and neighboring chroma pixels located around the current chroma block, and the luma The method may include deriving a prediction value of a pixel in the current chroma block based on the pixel in the reference block and the prediction parameter. Here, in the generating of the luma reference information, it is determined whether the neighboring luma pixel is available according to whether a second neighboring chroma pixel corresponding to the neighboring luma pixel is available from among the neighboring chroma pixels located around the current chroma block. and a pixel value of the neighboring luma pixel may be determined according to whether the neighboring luma pixel is available.

상기 루마 참조 정보 생성 단계에서는, 상기 제2 주변 크로마 픽셀이 가용한 경우에 상기 주변 루마 픽셀이 가용한 것으로 결정할 수 있다.In the generating of the luma reference information, when the second neighboring chroma pixels are available, it may be determined that the neighboring luma pixels are 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 one of 0 to N U *2-1, based on the second neighboring chroma pixel A location of the neighboring luma pixel, at which availability is determined, may be [x, 2y] or [x, 2y+1], and N U may indicate a horizontal length and a vertical length 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], the y is -1, and the x has one of 0 to N U *2-1, based on the second neighboring chroma pixel A location of the neighboring luma pixel, at which availability is determined, may be [2x, y] or [2x+1, y], and N U may indicate a horizontal length and a vertical length 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 at which availability is determined based on the second neighboring chroma pixel may be [-1, -1]. have.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 가용하지 않은 것으로 결정된 경우, 상기 현재 루마 블록 주변에 위치한 픽셀들 중에서 가용한 픽셀의 픽셀 값을 상기 주변 루마 픽셀에 할당할 수 있다.In the generating of the luma reference information, when it is determined that the neighboring luma pixel is not available, 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 generating of the luma reference information, when it is determined that the neighboring luma pixel is a pixel on a left pixel line located adjacent to the left side of the current luma block and it is determined that the neighboring luma pixel is available, it is located adjacent to the left side of the neighboring luma pixel A pixel value of the luma pixel may be determined as a pixel value of the neighboring luma pixel.

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

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

상기 루마 참조 정보 생성 단계에서는, 상기 제2 주변 크로마 픽셀이 가용한 경우에 상기 주변 루마 픽셀이 가용한 것으로 결정할 수 있다.In the generating of the luma reference information, when the second neighboring chroma pixels are available, it may be determined that the neighboring luma pixels are 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 one of 0 to N U *2-1, based on the second neighboring chroma pixel A location of the neighboring luma pixel, at which availability is determined, may be [x, 2y] or [x, 2y+1], and N U may indicate a horizontal length and a vertical length 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], the y is -1, and the x has one of 0 to N U *2-1, based on the second neighboring chroma pixel A location of the neighboring luma pixel, at which availability is determined, may be [2x, y] or [2x+1, y], and N U may indicate a horizontal length and a vertical length 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 at which availability is determined based on the second neighboring chroma pixel may be [-1, -1]. have.

상기 루마 참조 정보 생성 단계에서는, 상기 주변 루마 픽셀이 가용하지 않은 것으로 결정된 경우, 상기 현재 루마 블록 주변에 위치한 픽셀들 중에서 가용한 픽셀의 픽셀 값을 상기 주변 루마 픽셀에 할당할 수 있다.In the generating of the luma reference information, when it is determined that the neighboring luma pixel is not available, 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 generating of the luma reference information, when it is determined that the neighboring luma pixel is a pixel on a left pixel line located adjacent to the left side of the current luma block and it is determined that the neighboring luma pixel is available, it is located adjacent to the left side of the neighboring luma pixel A pixel value of the luma pixel may be determined as a pixel value of the neighboring luma pixel.

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

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

본 발명에 따른 영상 복호화 방법에 의하면, 영상 부호화/복호화 효율이 향상될 수 있다.According to the image decoding method according to the present invention, image 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 illustrating a configuration of an image encoding apparatus to which the present invention is applied according to an embodiment.
2 is a block diagram illustrating a configuration of an image decoding apparatus to which the present invention is applied according to an embodiment.
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 a prediction direction of an intra prediction mode and a mode value 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 the size of the current luma block and the size of the current chroma block are different from each other.
7 is a diagram schematically illustrating an embodiment of a process for generating luma reference information based on encoding parameters.
8 is a diagram schematically illustrating an embodiment of a process for 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 the size of the second color component block .
15 is a diagram schematically illustrating an embodiment of neighboring luma pixels used to generate luma reference information.
16 is a diagram for explaining an embodiment of a process of deriving a prediction parameter and a process of deriving prediction values of pixels in a current chroma block.
17 is a flowchart schematically illustrating an embodiment of a decoding 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.

어떤 구성 요소가 다른 구성 요소에 “연결되어” 있다거나 “접속되어” 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 아울러, 본 발명에서 특정 구성을 “포함”한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다. When it is said that a component is “connected” or “connected” to another component, it may be directly connected or connected to the other component, but it is understood that other components may exist in between. 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, second, etc. may be used to describe various elements, but the elements should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.

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

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

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

도 1을 참조하면, 상기 영상 부호화 장치(100)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽쳐 버퍼(190)를 포함한다. Referring to FIG. 1 , the image encoding apparatus 100 includes a motion prediction unit 111 , a motion compensation unit 112 , an intra prediction unit 120 , a switch 115 , a subtractor 125 , and a transform unit 130 . , a quantizer 140 , an entropy encoder 150 , an inverse quantizer 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 refers to intra prediction, and inter prediction refers to inter prediction. In the intra mode, the switch 115 may be switched to the intra mode, and in the inter mode, the switch 115 may be switched to the inter mode. The image encoding apparatus 100 may generate a prediction block for an input block of an input image, and then encode a residual between the input block and the prediction block.

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

인터 모드인 경우, 움직임 예측부(111)는, 움직임 예측 과정에서 참조 픽쳐 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. 여기서, 움직임 벡터는 인터 예측에 사용되는 2차원 벡터이며, 현재 부호화/복호화 대상 영상과 참조 영상 사이의 오프셋을 나타낼 수 있다.In the inter mode, the motion prediction unit 111 may obtain a motion vector by finding a region that best matches the input block in the reference image 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 two-dimensional vector used for inter prediction, and may indicate an offset between the current encoding/decoding target image and the 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 , a processing unit in which a prediction method or a prediction mode is determined and a processing unit in which prediction is performed may be the same, but may be different from each other. may be As an example, when a processing unit for which a prediction method is determined is a PU, a processing unit on 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 the difference between the input block and the generated prediction block. The transform unit 130 may perform transform on the residual block to output a transform coefficient. In addition, the quantization unit 140 may quantize the input transform coefficient according to the quantization parameter to 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 encoding parameter values calculated during 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 having a high probability of occurrence and a large number of bits are allocated to a symbol having a low probability of occurrence to express the symbol, so that bits for symbols to be encoded The size of the column may be reduced. Accordingly, compression performance of image encoding may be improved through entropy encoding. The entropy encoder 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 image encoding apparatus according to the embodiment of FIG. 1 performs inter prediction encoding, that is, inter prediction encoding, the currently encoded image needs to be decoded and stored to be used as a reference image. Accordingly, the quantized coefficient is inverse quantized by the inverse quantization unit 160 and inversely transformed by the inverse transformation unit 170 . The inverse-quantized and inverse-transformed coefficients are added to the prediction block through an adder 175 to generate a reconstructed block.

복원 블록은 필터부(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 the 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 be referred to as an adaptive in-loop filter. The deblocking filter can remove block distortion at the boundary between blocks. The SAO may add an appropriate offset value to a pixel value to compensate for a coding error. The ALF may perform filtering based on a value obtained by comparing the reconstructed image and the original image. The reconstructed block passing through the filter unit 180 may be stored in the reference picture buffer 190 .

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

도 2를 참조하면, 상기 영상 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽쳐 버퍼(270)를 포함한다.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 compensator 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 a bitstream output from the encoder, perform decoding in an intra mode or an inter mode, and output a reconstructed image, that is, a reconstructed image. In the case of the intra mode, the switch may be switched to the intra mode, and in the case of the inter mode, the switch may be switched to the inter mode. The image decoding apparatus 200 may generate a reconstructed block, that is, a reconstructed block by obtaining a residual block from the received bitstream, generating a prediction block, and adding the residual block and the prediction block.

엔트로피 복호화부(210)는, 입력된 비트스트림을 확률 분포에 따라 엔트로피 복호화하여, 양자화된 계수(quantized coefficient) 형태의 심볼을 포함한 심볼들을 생성할 수 있다. 엔트로피 복호화 방법은 상술한 엔트로피 부호화 방법과 유사하다.The entropy decoding unit 210 may entropy-decode the input bitstream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients. 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 having a high occurrence probability and a large number of bits are allocated to a symbol having a low occurrence probability to represent the symbol, so that the size of the bit stream for each symbol is can be reduced. Accordingly, the compression performance of image decoding may be improved through the entropy decoding method.

양자화된 계수는 역양자화부(220)에서 역양자화되고 역변환부(230)에서 역변환되며, 양자화된 계수가 역양자화/역변환 된 결과, 잔차 블록(residual block)이 생성될 수 있다. The quantized coefficient is inverse quantized by the inverse quantizer 220 and inverse transformed by 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 intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of an already encoded block around the current block. In the inter mode, the motion compensator 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 compensator 250 , a processing unit in which a prediction method or a prediction mode is determined and a processing unit in which prediction is performed may be the same or different from each other. As an example, when a processing unit for which a prediction method is determined is a PU, a processing unit on which prediction is performed may be a TU.

잔차 블록과 예측 블록은 가산기(255)를 통해 더해지고, 더해진 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO, ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(260)는 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽쳐 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The residual block and the prediction block may be 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 reconstructed 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, an encoding or decoding unit means a divided unit when encoding or decoding an image by dividing it, so a coding unit (CU), a prediction unit (PU: Prediction Unit), and a transformation unit (TU). : Transform Unit), etc. In addition, in the embodiments to be described later, a unit may also be referred to as a block. One unit may be further divided into smaller sub-units.

도 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 on 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. In addition, reference numeral 320 of FIG. 3 shows an embodiment of a unit divided into a plurality of sub-units. The unit shown at 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. In this case, the highest node may have a depth of level 0 and may represent an undivided first unit.

레벨 1의 깊이를 갖는 하위 노드는 최초 유닛이 한 번 분할된 유닛을 나타낼 수 있으며, 레벨 2의 깊이를 갖는 하위 노드는 최초의 유닛이 두 번 분할된 유닛을 나타낼 수 있다. 예를 들어, 도 3의 320에서 노드 a에 대응하는 유닛 a는 최초 유닛에서 한 번 분할된 유닛이고, 레벨 1의 깊이를 가질 수 있다.A lower node having a depth of level 1 may indicate a unit in which the initial unit is divided once, and a lower node having a depth of level 2 may indicate a unit in which the initial unit is divided twice. For example, in 320 of FIG. 3 , a unit a corresponding to a node a is a unit divided once from the 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 indicate a unit in which the initial unit is divided three times. For example, unit d corresponding to node d in 320 of FIG. 3 is a unit divided three times in the initial unit, and may have a depth of level 3. Accordingly, the leaf node of level 3, which is the lowest node, may have the deepest depth.

이하, 후술되는 실시예들에서 부호화/복호화 대상 블록은 경우에 따라 현재 블록으로 지칭될 수도 있다. 또한 부호화/복호화 대상 블록에 대해 인트라 예측이 수행되는 경우, 상기 부호화/복호화 대상 블록은 예측 대상 블록으로 불릴 수도 있다. Hereinafter, in embodiments to be described below, the 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로 나타내어질 수 있다. 이하, 후술되는 실시예들에서 루마 성분을 갖는 블록은 루마 블록, 크로마 성분을 갖는 블록은 크로마 블록으로 지칭될 수 있다.On the other hand, the image signal may be composed of color components (color components) constituting the color space (color space). For example, the image signal may include three color components representing three primary color components of light. The three color components representing the three primary color components of light may 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 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 expressed as U, V, Cb, or Cr. Accordingly, the color space of the image may be expressed as YUV or YCbCr as an example. Hereinafter, in embodiments to be described below, 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 신호가 루마 신호 및 크로마 신호로 변환되는 경우, 영상 처리에 사용되는 주파수 대역이 감소될 수 있다. 또한, 이러한 특성에 의해 하나의 영상 또는 블록 내에서 크로마 성분의 픽셀 수가 루마 성분의 픽셀 수보다 작을 수 있다. The human eye has a characteristic of being sensitive to a luma component signal and insensitive to a chroma component signal. When the R, G, and B signals are converted into a luma signal and a chroma signal using these characteristics, a frequency band used for image processing may be reduced. Also, due to this characteristic, the number of pixels of the chroma component in one image or block may be smaller than the number of pixels of the luma component.

예를 들어, 4:2:0 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 픽셀 수는 루마 블록의 수평 방향 픽셀 수의 1/2이고, 루마 블록에 대응되는 크로마 블록의 수직 방향 픽셀 수는 루마 블록의 수직 방향 픽셀 수의 1/2에 해당될 수 있다. 4:2:2 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 픽셀 수는 루마 블록의 수평 방향 픽셀 수의 1/2이고, 루마 블록에 대응되는 크로마 블록의 수직 방향 픽셀 수는 루마 블록의 수직 방향 픽셀 수와 동일할 수 있다. 4:4:4 영상 포맷에서, 루마 블록에 대응되는 크로마 블록의 수평 방향 및 수직 방향 픽셀 수는 각각 루마 블록의 수평 방향 및 수직 방향 픽셀 수와 동일할 수 있다.For example, in a 4:2:0 image format, the number of pixels in the horizontal direction of the chroma block corresponding to the luma block is 1/2 of the number of pixels in the horizontal direction of the luma block, and the number of pixels in the vertical direction of the chroma block corresponding to the 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 image format, the number of pixels in the horizontal direction of the chroma block corresponding to the luma block is 1/2 of the number of pixels in the horizontal direction of the luma block, and the number of pixels in the vertical direction of the chroma block corresponding to the luma block is the luma block may be equal to the number of pixels in the vertical direction of In the 4:4:4 image format, the number of pixels in the horizontal direction and the vertical direction of the chroma block corresponding to the luma block may be the same as the number of pixels in the horizontal direction and the vertical direction 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 mode of a neighboring block, the prediction mode of the current block may be encoded based on the prediction mode of the neighboring block adjacent to the current block block. In this case, MPM (Most Probable Mode) for the current block may be used.

도 4는 인트라 예측 모드의 예측 방향 및 각 예측 방향에 할당된 모드 값의 실시예를 도시한다. 이하, 본 명세서에서 픽셀은 샘플과 동일한 의미를 가질 수 있으며, 후술되는 실시예들에서 픽셀은 경우에 따라 샘플로 지칭될 수도 있다.4 shows an example of a prediction direction of an intra prediction mode and a mode value assigned to each prediction direction. Hereinafter, in the present 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 the 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 the decoder may perform directional prediction and/or non-directional prediction based on at least one reconstructed reference pixel. Here, the prediction block may mean 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 can have may be a predetermined fixed value, or a value determined differently according to 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 case of a vertical mode in which 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 a horizontal mode in which the mode value is 2, the reference pixel Prediction may be performed in the horizontal direction based on the pixel value of . Even in a directional mode other than the above-described mode, the encoder and the decoder may perform intra prediction using the reference pixel according to the 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 the non-directional mode. 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 the reference pixel to be used for prediction of the prediction pixel may be determined based on the position of the prediction object pixel, and the prediction value of the prediction object 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 모드에서의 인트라 예측에 대한 구체적인 실시예는 후술하기로 한다.In addition, a prediction mode having a mode value of 35 in 410 of FIG. 4 may be referred to as an LM mode (eg, Intra_FromLuma). The LM mode may refer to a prediction mode in which a prediction value of a chroma component (eg, U or V) pixel is determined according to a pixel value of a luma component (eg, Y). A specific embodiment of intra prediction in the 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 a mode value assigned to each intra prediction mode are not limited to the above-described embodiment, and may be differently determined according to implementation and/or necessity. For example, the prediction direction of the intra prediction mode and the 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 in the embodiment 420 of FIG. 4 , the LM mode may be applied as in 410 of FIG. 4 . In this case, a mode value of 35 may be assigned to the LM mode. Hereinafter, in the embodiments to be described below, it is assumed that intra prediction is performed based on the intra prediction mode as in 410 of FIG. 4 , unless otherwise stated for convenience of description.

한편, 영상 내의 루마 성분과 크로마 성분은 상관성을 가지므로, 크로마 성분의 예측 모드는 대응되는 루마 성분의 예측 모드를 기반으로 부호화될 수 있으며, 복호화기는 루마 성분의 예측 모드를 기반으로 크로마 성분의 예측 모드를 도출할 수 있다. 따라서, 부호화기에서 복호화기로 전송되는 크로마 성분의 예측 모드 정보는 크로마 성분의 예측 모드 자체가 아니라 루마 성분의 예측 모드와의 관계에서 크로마 성분의 예측 모드를 도출하는 데 이용되는 별도의 값일 수 있다. 다음 표 1은 루마 성분의 예측 모드와 전송되는 값에 따라 결정되는 크로마 예측 모드의 일 실시예를 나타낸다.Meanwhile, since the luma component and the chroma component in the image have a correlation, the prediction mode of the chroma component may 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, not the prediction mode of the chroma component itself. Table 1 below shows an embodiment of a prediction mode of a luma component and a chroma prediction mode determined according to a transmitted value.

[표 1][Table 1]

Figure 112022060919799-pat00001
Figure 112022060919799-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 the encoder to the decoder may be a value assigned to intra_chroma_pred_mode. IntraPredMode indicates an intra prediction mode of a luma component. For example, when the intra_chroma_pred_mode value is 2 and the IntraPredMode value 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 differently determined according to implementation and/or necessity as an embodiment.

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

또한, 부호화기는 현재 시퀀스 내에서 크로마 성분의 예측 모드에 따라 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 the chroma component in the current sequence, that is, whether the LM mode can be applied to the intra prediction of the chroma component in the current sequence, to the decoder. can be transmitted 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, when 1 is assigned to chroma_pred_from_luma_enabled_flag, the flag may indicate that the LM mode may be used for intra prediction of a chroma component. In addition, 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 a chroma component.

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, when 1 is assigned to chroma_pred_from_luma_enabled_flag, the chroma prediction mode may be determined according to the embodiment of Table 1. However, when 0 is assigned to chroma_pred_from_luma_enabled_flag, since the LM mode is not used for intra prediction of the chroma component, the chroma prediction mode determined according to the prediction mode of the luma component and the 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 example of Table 2 below.

[표 2][Table 2]

Figure 112022060919799-pat00002
Figure 112022060919799-pat00002

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

일례로, 상술한 LM 모드에서는 루마 성분을 기반으로 크로마 성분에 대한 예측이 수행될 수 있다. 이 때, 제1 색 성분은 루마 성분에 해당될 수 있고, 제2 색 성분은 크로마 성분에 해당될 수 있다. LM 모드에서 루마 성분과 크로마 성분의 상관성은 예측 파라미터를 이용한 선형 관계로 표현될 수 있다. 루마 성분을 기반으로 크로마 성분에 대해 예측을 수행하는 과정의 구체적인 실시예는 후술하기로 한다.For example, in the above-described LM mode, prediction of the chroma component may be performed based on the luma component. In this case, the first color component may correspond to the luma component, and the second color component may correspond to the chroma component. In the LM mode, the correlation between the luma component and the chroma component may be expressed as a linear relationship using a prediction parameter. A specific example of a process of performing prediction on the chroma component based on the 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 the present specification, the first color component is referred to as a luma component and the second color component is referred to as a chroma component for convenience of description. However, the embodiments described below 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 to be described later, the luma component may be viewed as a first color component, and the chroma component may be viewed 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, which will be described later, may be performed by the intra prediction unit of the encoding apparatus and the decoding apparatus.

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

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

루마 참조 정보는 현재 크로마 블록의 예측에 사용될 루마 성분의 픽셀 값들을 의미할 수 있다. 따라서, 본 명세서에서 루마 참조 정보는 '루마 참조 픽셀'로 지칭될 수도 있다. 이 때, 현재 크로마 블록 내의 픽셀들에 대응되는 루마 참조 픽셀들은 '루마 참조 블록'을 구성할 수 있다. 또한, 본 명세서에서 현재 루마 블록 주변에 위치하는 픽셀은 '주변 루마 픽셀'이라 하고, 현재 크로마 블록 주변에 위치하는 픽셀은 '주변 크로마 픽셀'이라 하며, 루마 참조 블록 주변에 위치하는 루마 참조 픽셀은 '주변 루마 참조 픽셀'이라 한다. 이 때, 루마 참조 블록은 현재 크로마 블록에 대응될 수 있고, 주변 루마 참조 픽셀은 주변 크로마 픽셀에 대응될 수 있다. 본 명세서에서, 루마 참조 정보는 루마 참조 블록 내의 픽셀 및 주변 루마 참조 픽셀을 포함한 개념으로 사용될 수 있다.The luma reference information may mean pixel values of a luma component to be used for prediction of a current chroma block. Accordingly, in this specification, the luma reference information may 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'. In addition, in the present specification, a pixel positioned around the current luma block is referred to as a 'peripheral luma pixel', a pixel positioned near the current chroma block is referred to as a 'peripheral chroma pixel', and a luma reference pixel positioned around the luma reference block is referred to as a 'peripheral chroma pixel'. This is called the 'peripheral luma reference pixel'. In this case, the luma reference block may correspond to the current chroma block, and the neighboring luma reference pixel may correspond to the neighboring chroma pixel. In this specification, the 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 depending on the image format. In this case, the encoder and the decoder perform down-sampling and/or up-sampling on pixels in the current luma block and pixels around the current luma block, thereby performing luma having the same size as the current chroma block. A reference block and its corresponding neighboring luma reference pixels may be derived.

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

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

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

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

일례로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들의 픽셀 값 및 주변 크로마 픽셀들의 픽셀 값을 기반으로 예측 파라미터를 도출할 수 있다. 여기서, 예측 파라미터는 최소 자승법을 기반으로 하는 알파(α) 및 베타(β)일 수 있다. As an example, the encoder and the decoder may derive a prediction parameter 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 the decoder may derive prediction 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 the 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 specific embodiment of the process of deriving prediction 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 the size of the current luma block and the size of the 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 according to an image format. For example, when the color space of the 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 the 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 the decoder may generate the 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 , the neighboring luma pixels 614 , the current chroma block 616 , and the neighboring 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 the decoder may generate luma reference pixels corresponding to the 4x4 luma reference block.

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

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

도 6의 620을 참조하면, 부호화기 및 복호화기는 현재 루마 블록(612) 내의 픽셀 및 주변 루마 픽셀들(624)을 기반으로, 현재 크로마 블록(616)의 예측에 사용될 루마 참조 블록(626) 및 주변 루마 참조 픽셀들(628)을 생성할 수 있다. 여기서, 루마 참조 정보 도출에 사용되는 주변 루마 픽셀들(624)은, 현재 루마 블록(612)의 좌측에 가장 가까이 위치한 두 개의 픽셀 라인에 포함된 픽셀들, 및 현재 루마 블록(612)의 상단에 가장 가까이 위치한 한 개의 픽셀 라인에 포함된 픽셀들을 포함할 수 있다.Referring to 620 of FIG. 6 , the encoder and the decoder, based on the pixel in the current luma block 612 and the neighboring luma pixels 624 , the luma reference block 626 and the neighboring luma reference block 626 to be used for prediction of the current chroma block 616 . Luma reference pixels 628 may be generated. Here, the neighboring luma pixels 624 used for deriving the luma reference information are pixels included in the two pixel lines closest to the left of the current luma block 612 , and at the 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 sizes of the current luma block 612 and the current chroma block 616 are different from each other, the encoder and the decoder have the same size (4x4) as the luma reference block 626 of the current chroma block 616 . and corresponding neighboring luma reference pixels 628 may be generated. 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 the decoder down-sample the pixels in the current luma block 612 and neighboring luma pixels 624 ( luma reference information can be generated by performing down sampling).

이하, 본 명세서의 좌표들(예컨대, (x,y))은 블록 내의 가장 좌측 상단에 존재하는 픽셀의 위치를 기준으로 하는 좌표일 수 있다. 일례로 본 명세서에서 블록 내의 가장 좌측 상단에 존재하는 픽셀의 좌표는 (0,0)일 수 있다.Hereinafter, the coordinates (eg, (x, y)) of the present specification may be coordinates based on the position of the pixel present at the upper leftmost corner in the block. For example, in the present specification, the coordinates of the pixel present at the upper left of 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 are a 2-tap filter, 3-tap filter and/or 4-tap filter for 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 down-sampling process may be expressed 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 represent the pixel values of the restored 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 the decoder may perform down-sampling by selecting pixels to be used as luma reference pixels from among the pixels in the current luma block 612 and the neighboring luma pixels 624 according to a predetermined operation. In this case, for example, the encoder and the 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, for example, at least one of the down-sampling methods represented by Equations 2, 3, and 4 below.

[수학식 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에 의한 다운 샘플링 방식이 적용될 수도 있다. 여기서, 다운 샘플링 방식이 적용되는 가능한 실시예들의 조합이 모두 서술되지는 않지만, 당해 분야에서 통상의 지식을 가진 자라면, 상술한 다운 샘플링 방식들의 다른 조합의 사용이 가능함을 인식할 수 있을 것이다.Also, different downsampling schemes may be applied to pixels in the current luma block 612 , neighboring luma pixels located at the top of the current luma block 612 , and neighboring luma pixels located to the left of the current luma block 612 . have. For example, when the down-sampling method according to Equation 1 is applied to pixels in the current luma block 612 , the down-sampling method according to Equation 2 is applied to neighboring luma pixels located at the top of the current luma block 612 . Alternatively, the down-sampling method according to Equation 3 may be applied to neighboring luma pixels located on the left side of the current luma block 612 . Here, although not all combinations of possible embodiments to which the down-sampling method is applied are described, those skilled in the art will recognize that other combinations of the above-described down-sampling methods may be used.

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

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

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

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

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

한편, 부호화기 및 복호화기는 주변 루마 픽셀들을 포함하는 블록 및/또는 현재 루마 블록의 부호화 파라미터를 기반으로 루마 참조 정보를 다르게 생성할 수도 있다. 상술한 바와 같이, 부호화 파라미터에는 부호화 모드, 인트라 예측 모드, 인터 예측 모드, 양자화 파라미터(Quantization Parameter: QP) 등이 있을 수 있다. 예를 들어, 부호화기 및 복호화기는 왜곡이 작은 픽셀들의 픽셀 값만을 이용하여 루마 참조 정보를 생성할 수 있다.Meanwhile, the encoder and the decoder may differently generate luma reference information 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, and a quantization parameter (QP). For example, the encoder and the decoder may generate luma reference information by using only pixel values of pixels having low distortion.

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

부호화 파라미터를 기반으로 루마 참조 정보를 생성하는 방법의 추가 실시예는 도 7에서 후술된다.A further embodiment of a method for 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 for generating luma reference information based on encoding parameters.

도 7의 710은 현재 루마 블록(712)의 인트라 예측 모드를 기반으로 루마 참조 정보(716, 718)를 생성하는 방법의 일 실시예를 나타낸다. 도 7의 710에서, 현재 루마 블록(712)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 710 of FIG. 7 illustrates 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 . 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 a vertical mode 722 , the encoder and the decoder use only pixels located adjacent to the top of the current luma block 712 among the neighboring luma pixels 714 . may be used to generate luma reference information 716 and 718 . Accordingly, the peripheral luma reference pixels 718 derived from 710 of FIG. 7 may be pixels located adjacent to the top of the luma reference block 716 .

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

도 7의 730은 현재 루마 블록(732)의 주변에 위치한 주변 루마 블록(734, 736, 738)의 양자화 파라미터를 기반으로 루마 참조 정보(752, 754)를 생성하는 방법의 일 실시예를 나타낸다. 도 7의 730에서, 현재 루마 블록(732)의 크기는 8x8이고, 현재 크로마 블록의 크기는 4x4라 가정한다.730 of FIG. 7 illustrates 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 in the vicinity of 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 of FIG. 7 , the quantization parameter value of the upper peripheral luma block 734 located 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 quantization parameter value of the peripheral luma block 736 is 26. Also, the quantization parameter value of the left peripheral luma block 738 located adjacent to the left side of the current luma block 732 is 28. In this case, the encoder and the decoder may use the neighboring luma pixels belonging to the neighboring luma block having the smallest quantization parameter value among the neighboring luma pixels 744 , 746 , and 748 to generate the luma reference information.

도 7의 730에서는 상단 주변 루마 블록(734), 좌측 상단 주변 루마 블록(736) 및 좌측 주변 루마 블록(738) 중에서 상단 주변 루마 블록(734)이 가장 작은 양자화 파라미터 값(예컨대, 22)을 가지므로, 상단 주변 루마 블록(734) 내의 주변 루마 픽셀들(744)이 루마 참조 정보 생성에 이용될 수 있다. 즉, 도 7의 730에서 부호화기 및 복호화기는 현재 루마 블록(732) 내의 픽셀들 및 상단 주변 루마 블록(734) 내의 주변 루마 픽셀들(744)이 루마 참조 블록(752) 및 주변 루마 참조 픽셀들(754)의 생성에 이용될 수 있다. In 730 of FIG. 7 , the upper peripheral luma block 734 among the upper peripheral luma block 734, the upper left peripheral luma block 736, and the left peripheral luma block 738 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 the decoder convert the pixels in the current luma block 732 and the neighboring luma pixels 744 in the upper peripheral luma block 734 to the luma reference block 752 and the neighboring luma reference pixels ( 754) can be used.

도 7의 730에서 현재 크로마 블록의 크기는 4x4이므로, 생성된 루마 참조 블록(752)의 크기는 4x4일 수 있다. 또한, 도 7의 730에서 도출되는 주변 루마 참조 픽셀들(754)은 루마 참조 블록(752)의 상단에 인접하여 위치한 픽셀들일 수 있다.Since the size of the current chroma block in 730 of FIG. 7 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 located adjacent to the upper end of the luma reference block 752 .

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

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

상술한 바와 같이, 현재 루마 블록의 주변에 위치한 주변 루마 픽셀들 중에서는 가용하지 않은(unavailable) 픽셀들이 있을 수 있다. 주변 루마 픽셀이 가용하지 않은 경우로는 현재 루마 블록이 현재 픽쳐의 경계에 인접하여 위치한 경우, 현재 루마 블록이 현재 슬라이스(slice)의 경계에 인접하여 위치한 경우 및 현재 루마 블록에 대해 CIP(Constrained Intra Prediction)가 적용되는 경우 등이 있을 수 있다. As described above, among the neighboring luma pixels located in the vicinity of the current luma block, there may be unavailable pixels. Cases in which the neighboring luma pixels are not available include 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 constrained intra (CIP) for the current luma block 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 located 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 the current slice. In this case, the neighboring luma pixels 816 located on the left side of the current luma block 812 are located outside the current picture and/or the current slice, and thus may correspond to pixels that are not available.

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

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

현재 루마 블록(812)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 픽셀 라인의 좌측에 인접하여 위치한 제2 픽셀 라인에 픽셀 값을 채워 넣는 과정은 일례로 다음 수학식 6에 의해 나타내어질 수 있다.The process of filling a pixel value into a pixel line located second closest to the left of the current luma block 812 , that is, a second pixel line located adjacent to the left side of the first pixel line, may be expressed 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 the decoder may use the newly filled pixel value to generate the luma reference information. That is, the encoder and the decoder based on the pixel values of the available neighboring luma pixels 814, the pixel values of the pixels 816 filled by the padding process, and the pixel values of the pixels in the current luma block 812 luma reference information can create

다른 실시예로 부호하기 및 복호화기는 가용하지 않은 주변 루마 픽셀들은 루마 참조 정보 생성에 이용하지 않을 수도 있다. 즉, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 가용한 주변 루마 픽셀들을 기반으로 루마 참조 정보를 생성할 수 있다. 예를 들어, 도 8의 810에서는 현재 루마 블록(812) 내의 픽셀들 및 현재 루마 블록(812)의 상단에 위치한 가용한 주변 루마 픽셀들(814)이 루마 참조 정보 생성에 이용될 수 있다.In another embodiment, the encoder and decoder may not use neighboring luma pixels that are not available to generate luma reference information. That is, the encoder and the 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 neighboring luma pixels 814 positioned above the current luma block 812 may be used to generate luma reference information.

도 8의 810에서 루마 참조 정보 생성 과정에서는 도 6 및 도 7의 실시예에서 상술한 루마 참조 정보 생성 방법들 중에서 적어도 하나가 상술한 실시예들과 함께 적용될 수도 있다.In the process of generating the luma reference information in 810 of FIG. 8 , at least one of the luma reference information generating 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가 적용되는 경우, 인터 예측에 의해 부호화/복호화된 블록 내의 픽셀들은 인트라 예측에 이용되지 않을 수 있다. The CIP may refer to an intra prediction method in which only pixels within a block encoded/decoded by intra prediction among blocks located in the vicinity of the prediction object block 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 or not CIP is applied to the decoder. In this case, the decoder may determine whether to apply the CIP based on the flag information. Flag information on whether or not CIP is applied may be expressed as 'constrained_intra_pred_flag', for example.

도 8의 820을 참조하면, 현재 루마 블록(822)의 상단에 위치한 상단 주변 루마 블록(824)은 인트라(intra) 모드로 부호화/복호화된 블록이고, 현재 루마 블록(822)의 좌측에 위치한 좌측 주변 루마 블록(826)은 인터(inter) 모드로 부호화/복호화된 블록일 수 있다. 이 경우, 좌측 주변 루마 블록(826) 내에 위치하는 주변 루마 픽셀들(836)은 가용하지 않은 픽셀들에 해당될 수 있다.Referring to 820 of FIG. 8 , the upper peripheral luma block 824 located at the upper end of the current luma block 822 is a block encoded/decoded in the intra mode, and the left side 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 neighboring luma pixels 836 located in the left peripheral luma block 826 may correspond to pixels that are not available.

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

일례로, 도 8의 820에서와 같이 좌측 주변 루마 블록(826) 내에 위치하는 주변 루마 픽셀들(836)이 가용하지 않은 경우, 부호화기 및 복호화기는 상단 주변 루마 블록(824) 내에 위치하는 가용한 주변 루마 픽셀들(834) 중에서 적어도 하나의 픽셀의 픽셀 값을 가용하지 않은 주변 루마 픽셀들(836)의 위치에 채워 넣을 수 있다. 일례로, 상단 주변 루마 블록(824) 내의 픽셀을 기반으로 패딩을 수행하는 과정은 다음 수학식 7에 의해 나타내어질 수 있다. For example, when the neighboring luma pixels 836 located in the left peripheral luma block 826 are not available as in 820 of FIG. A pixel value of at least one pixel among the luma pixels 834 may be filled in positions of adjacent luma pixels 836 that are not available. As an example, a process of performing padding based on pixels in the upper peripheral luma block 824 may be represented 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 the intra-mode coded/decoded block. In this case, the encoder and the decoder include a pixel located at the top of the left peripheral luma block (eg, a pixel present at a position of (-2,-1) or a pixel present at a position of (-1, -1)) and a left periphery of the luma block. Neighboring luma pixels 836 in which the pixel average value of a pixel located at the bottom of the luma block (eg, a pixel at a position of (-2,8) or a pixel at a position of (-1,8)) is not available ) can be filled in. This padding process may be expressed 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) 내의 픽셀들의 픽셀 값을 기반으로 루마 참조 정보를 생성할 수 있다.*163 When the padding process is performed, the encoder and the decoder may use the newly filled pixel value to generate luma reference information. That is, the encoder and the decoder based on the pixel values of the available neighboring luma pixels 834, the pixel values of the pixels 836 filled by the padding process, and the pixel values of the pixels in the current luma block 822, luma reference information can create

다른 실시예로 도 8의 820에서 부호하기 및 복호화기는 가용하지 않은 주변 루마 픽셀들은 루마 참조 정보 생성에 이용하지 않을 수도 있다. 즉, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 가용한 주변 루마 픽셀들을 기반으로 루마 참조 정보를 생성할 수 있다. 예를 들어, 도 8의 820에서는 현재 루마 블록(822) 내의 픽셀들 및 상단 주변 루마 블록(824) 내에 위치한 가용한 주변 루마 픽셀들(834)이 루마 참조 정보 생성에 이용될 수 있다.As another embodiment, in 820 of FIG. 8 , neighboring luma pixels that are not available to the encoder and decoder may not be used to generate luma reference information. That is, the encoder and the 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 neighboring 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 , the first left pixel line closest to the left of the current luma block 910 and the neighboring luma pixels in the first upper pixel line closest to the top of the current luma block 910 generate luma reference information. Examples of when used in In the embodiment of FIG. 9 , a pixel line located second closest to the left of the current luma block 910 , that is, a pixel line located 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 that is second closest to the upper end of the current luma block 910 , that is, a pixel line positioned adjacent to the upper end of the first upper pixel line will be referred to as a second upper 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 by 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 neighboring luma pixels 922, 924, 926, 928 shown in the embodiment of FIG. 9, the neighboring luma pixels corresponding to 922 and the neighboring luma pixels corresponding to 926 are available pixels, It is assumed that the neighboring luma pixels corresponding to 924 and the neighboring luma pixels corresponding to 928 are unavailable pixels. In this case, the encoder and the decoder may generate luma reference information after performing a padding process on the neighboring luma pixels that are not available.

도 9의 실시예에서, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피(copy)한 후에 패딩 과정을 수행할 수 있다. 즉 부호화기 및 복호화기는 제1 좌측 픽셀 라인의 주변 루마 픽셀 값들을 제2 좌측 픽셀 라인의 주변 루마 픽셀 값으로 대체한 후에, 제1 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행할 수 있다. 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피(copy)하는 과정은 일례로 다음 수학식 9에 의해 나타내어질 수 있다.9 , the encoder and the decoder may perform a padding process after copying neighboring luma pixel values on the second left pixel line to the first left pixel line. That is, the encoder and the decoder replace 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, after A padding process may be performed. A process of copying the peripheral luma pixel values on the second left pixel line to the first left pixel line may be represented 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 indicate the horizontal length and vertical length of the current luma block 910 .

제2 촤즉 픽셀 라인 상의 주변 루마 픽셀 값들이 제1 좌측 픽셀 라인에 카피된 후, 부호화기 및 복호화기는 주변 루마 픽셀에 대한 패딩 과정을 수행함으로써, 루마 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값을 도출할 수 있다. 루마 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값들은 다음 수학식 10에 의해 나타내어질 수 있다.After the neighboring luma pixel values on the second pixel line are copied to the first left pixel line, the encoder and the decoder perform a padding process on the neighboring luma pixels, thereby deriving pixel values of 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)로 나타내어질 수 있다. Pixels that are not available 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 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. 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 expressed as P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

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

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 9를 참조하면, 상단 픽셀 그룹(924)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(924)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.For example, an available pixel located adjacent to a pixel group may exist only at one end of the pixel group. Referring to FIG. 9 , an available pixel may not exist on the right side of the upper pixel group 924 , and an available pixel c may exist 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, there may be only one available pixel positioned adjacent to the upper pixel group 924 within the first upper pixel line. Accordingly, the encoder and the decoder may fill the pixel values of the available pixels c located adjacent to the upper pixel group into positions of the unavailable pixels in the upper pixel group 924 . This padding process may be expressed 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 adjacent to an upper end of the left pixel group, and an available pixel a may be adjacent to a lower end of the left pixel group. Here, the pixel a may be represented by P Y [-1, nS+(nS>>1)], and the pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 12에 의해 나타내어질 수 있다.In this case, two available pixels located adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and the decoder may fill the pixel average values of the available pixels (a, b) located adjacent to the left pixel group into the positions of the unavailable pixels in the left pixel group. This padding process may be expressed 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에 의해 나타내어질 수 있다.By the above-described padding process, pixel values of the neighboring luma pixels on the first left pixel line and the neighboring luma pixels on the first upper pixel line may be determined. At this time, the encoder and the decoder based on the pixel values of the neighboring luma pixels on the first left pixel line, the neighboring luma pixels on the first upper pixel line, and the pixels in the current luma block 910, luma reference information (see luma). A block 930 and peripheral luma reference pixels 940 may be generated. However, the neighboring luma pixels existing at the position of [-1,-1] may not be used to generate the luma reference information. In the embodiment of FIG. 9 , the luma reference information generation process may be expressed 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. In addition, 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 pixel value of 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 , the first left pixel line closest to the left of the current luma block 1010 and the neighboring luma pixels in the first upper pixel line closest to the top of the current luma block 1010 generate luma reference information. Examples of when used in In the embodiment of FIG. 10 , a pixel line located second to the left of the current luma block 1010 , that is, a pixel line located adjacent to the left of the first left pixel line, will be referred to as a second left pixel line. Also, a pixel line that is 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 by 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 neighboring luma pixels 1022, 1024, 1026, and 1028 shown in the embodiment of FIG. 10, the neighboring luma pixels corresponding to 1022 and the neighboring luma pixels corresponding to 1026 are available pixels, It is assumed that the neighboring luma pixels corresponding to 1024 and the neighboring luma pixels corresponding to 1028 are unavailable pixels. In this case, the encoder and the decoder may generate luma reference information after performing a padding process on the neighboring luma pixels that are not available.

도 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 the decoder perform a padding process on the neighboring luma pixels that are not available on the first left pixel line and the first upper pixel line, so that the pixel values of the neighboring luma pixels P Y [x,y] , (x=-1, y=-1 to nS*2-1), (x=0 to nS*2-1, y=-1) can be derived. Here, P Y may represent a pixel value of a neighboring luma pixel. Also, nS may indicate the horizontal length and vertical length 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)로 나타내어질 수 있다. Pixels that are not available 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 in 1028 of FIG. 10 ) is referred to as a left pixel group, and the first upper pixel line The group of pixels 1024 that are not available on the top is referred to as the top pixel group. In the embodiment of FIG. 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 expressed as P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

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

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 10을 참조하면, 상단 픽셀 그룹(1024)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1024)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.For example, an available pixel located adjacent to a pixel group may exist only at one end of the pixel group. Referring to FIG. 10 , an available pixel may not exist on the right side of the upper pixel group 1024 , and an available pixel c may exist 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, there may be only one available pixel positioned adjacent to the upper pixel group 1024 within the first upper pixel line. Accordingly, the encoder and the decoder may fill the pixel values of the available pixels c located adjacent to the upper pixel group into positions of the unavailable pixels in the upper pixel group 1024 . This padding process may be expressed 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 adjacent to an upper end of the left pixel group, and an available pixel a may be adjacent to a lower end of the left pixel group. Here, the pixel a may be represented by P Y [-1, nS+(nS>>1)], and the pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 15에 의해 나타내어질 수 있다.In this case, two available pixels located adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and the decoder may fill the pixel average values of the available pixels (a, b) located adjacent to the left pixel group into the positions of the unavailable pixels in the left pixel group. This padding process may be expressed 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))를 생성할 수 있다. By the above-described padding process, pixel values of the neighboring luma pixels on the first left pixel line and the neighboring luma pixels on the first upper pixel line may be determined. Based on the pixel values of the neighboring luma pixels on the first left pixel line, the neighboring luma pixels on the first upper pixel line, and the pixels in the current luma block 1010 , the encoder and the decoder determine the luma reference information (luma reference block 1030 ). ) and peripheral luma reference pixels 1040 ).

이 때, 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 제2 좌측 픽셀 라인 상의 픽셀들 중에는 가용한 픽셀들이 존재할 수 있다. 제1 좌측 픽셀 라인 상의 픽셀의 좌측에 인접하여 위치한 픽셀(제2 좌측 픽셀 라인 상의 픽셀)이 가용한 경우, 부호화기 및 복호화기는 상기 제1 좌측 픽셀 라인 상의 픽셀 대신 이에 인접하여 위치한 제2 좌측 픽셀 라인 상의 픽셀을 루마 참조 정보 생성에 이용할 수 있다. 그러나, 제1 좌측 픽셀 라인 상의 픽셀의 좌측에 인접하여 위치한 픽셀(제2 좌측 픽셀 라인 상의 픽셀)이 가용하지 않은 경우, 부호화기 및 복호화기는 패딩 과정이 수행된 제1 좌측 픽셀 라인 상의 픽셀을 루마 참조 정보 생성에 이용할 수 있다. In this case, available pixels may exist among the pixels on the second left pixel line positioned adjacent to the left of the first left pixel line. 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 available, the encoder and decoder instead of the pixel on the first left pixel line located adjacent thereto a second left pixel line A pixel on the image may be used to generate luma reference information. However, if a pixel located adjacent to the left 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. It can be used to generate information.

도 10의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 16에 의해 나타내어질 수 있다.In the embodiment of FIG. 10 , a process of generating the luma reference information may be expressed 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. In addition, 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 pixel value of 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 , peripheral luma pixels in the first left pixel line closest to the left of the current luma block 1110 and the first upper pixel line closest to the top of the current luma block 1110 generate luma reference information. Examples of when used in In the embodiment of FIG. 11 , a pixel line located second closest to the left of the current luma block 1110, that is, a pixel line located adjacent to the left of the first left pixel line, will be referred to as a second left pixel line. Also, a pixel line that is second closest to the upper end of the current luma block 1110 , that is, a pixel line positioned adjacent to the upper end of the first upper pixel line will be referred to as a second upper 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 by Intra_FromLuma. Also, in FIG. 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 neighboring luma pixels 1122, 1124, 1126, and 1128 shown in the embodiment of FIG. 11, the neighboring luma pixels corresponding to 1122 and the neighboring luma pixels corresponding to 1126 are available pixels, It is assumed that the neighboring luma pixels corresponding to 1124 and the neighboring luma pixels corresponding to 1128 are unavailable pixels. In this case, the encoder and the decoder may generate luma reference information after performing a padding process on the neighboring luma pixels that are not available.

도 11의 실시예에서, 부호화기 및 복호화기는 제1 좌측 픽셀 라인, 제2 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행할 수 있다. 그리고, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피할 수 있다. 상술한 과정에 의해 생성되는, 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값은 다음 수학식 17에 의해 나타내어질 수 있다.In the embodiment of FIG. 11 , the encoder and the decoder may perform a padding process on neighboring luma pixels that are not available on the first left pixel line, the second left pixel line, and the first upper pixel line. In addition, the encoder and the decoder may copy neighboring luma pixel values on the second left pixel line to the first left pixel line. Pixel values of neighboring luma pixels to be used for generating reference information, which are generated by the above-described process, 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 a pixel value of a neighboring luma pixel belonging to the first left pixel line and/or the first upper pixel line. Also, nS may indicate the horizontal length and vertical length 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 좌측 픽셀 라인에 속한 주변 루마 픽셀의 픽셀 값을 나타낼 수 있다.Pixels that are not available 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 in 1128 of FIG. 11 ) is referred to as a first left pixel group, and the second left pixel group is referred to as a first left pixel group. The group of unavailable pixels on the pixel line (eg, the four pixels located on the right in 1128 in FIG. 11 ) is referred to as the second left pixel group, and the group of unavailable pixels 1124 on the first top pixel line The group is called the top pixel group. In the embodiment of FIG. 11 , pixels belonging to the upper pixel group may be represented by P Y [x,y], (x=nS~nS*2-1, y=-1), and are located in the first left pixel group. Pixels belonging to P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1) may be expressed, and 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 represent a pixel value of a neighboring 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 (eg, the first left pixel group, the second left pixel group, and the top pixel group) to perform padding. can be judged

일 실시예로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 11을 참조하면, 상단 픽셀 그룹(1124)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1124)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.In one embodiment, an available pixel located adjacent to a pixel group may exist only at one end of the pixel group. Referring to FIG. 11 , an available pixel may not exist on the right side of the upper pixel group 1124 , and an available pixel c may exist 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, there may be only one available pixel positioned adjacent to the upper pixel group 1124 within the first upper pixel line. Accordingly, the encoder and the decoder may fill the pixel values of the available pixels c located adjacent to the upper pixel group into positions of the unavailable pixels in the upper pixel group 1124 . This padding process may be expressed 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 group of pixels may exist at both ends of the group of pixels.

일례로, 도 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 adjacent to an upper end of the first left pixel group, and an available pixel a may be adjacent to a lower end of the first left pixel group. Here, the pixel a may be represented by P Y [-1, nS+(nS>>1)], and the pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 제1 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 제1 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 19에 의해 나타내어질 수 있다.In this case, two available pixels located adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and the decoder may fill the pixel average values of the available pixels a and b located adjacent to the first left pixel group into positions of the unavailable pixels in the first left pixel group. This padding process may be expressed 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 adjacent to an upper end of the second left pixel group, and an available pixel d may be adjacent to a lower end of the second left pixel group. Here, the pixel d may be represented by P Y2 [-2, nS+(nS>>1)], and the pixel e may be represented by P Y2 [-2, nS-1].

이 경우, 제2 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 제2 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(e,d)의 픽셀 평균 값을, 제2 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 20에 의해 나타내어질 수 있다.In this case, there may be two available pixels positioned adjacent to the left pixel group in the second left pixel line. Accordingly, the encoder and the decoder may fill the pixel average values of the available pixels (e, d) located adjacent to the second left pixel group into positions of the unavailable pixels in the second left pixel group. This padding process may be expressed 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)로 나타내어질 수 있다.The 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에 의해 나타내어질 수 있다.By the above-described padding process, pixel values of neighboring luma pixels on the first left pixel line, the second left pixel line, and the first upper pixel line may be determined. In this case, the encoder and the decoder may derive pixel values on the first left pixel line to be used for generating luma reference information by copying the neighboring luma pixel values on the second left pixel line to the first left pixel line. That is, the encoder and the decoder may replace the peripheral luma pixel values of the first left pixel line with the peripheral 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 represented by Equation 21 below as an 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 peripheral luma pixel values on the second primary pixel line are copied to the first left pixel line, the encoder and decoder perform the first left pixel line peripheral luma pixels, the first upper pixel line peripheral luma pixels on the first top pixel line and the current luma block. Based on the pixel values of the pixels in 1110 , luma reference information (the luma reference block 1130 and the neighboring luma reference pixels 1140 ) may be generated. In the embodiment of FIG. 11 , the luma reference information generation process may be expressed 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. In addition, 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 pixel value of 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 상단 픽셀 라인이라 지칭하기로 한다.12 , the first left pixel line closest to the left of the current luma block 1210 and the neighboring luma pixels within the first upper pixel line closest to the top of the current luma block 1210 are used to generate luma reference information. Examples of when used are shown. In the embodiment of FIG. 12 , the pixel line located second closest to the left side of the current luma block 1210, that is, the pixel line located 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 that is second closest to the upper end of the current luma block 1210 , that is, a pixel line positioned adjacent to the upper end of the first upper pixel line, will be referred to as a second upper 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 by Intra_FromLuma. Also, in FIG. 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 neighboring luma pixels 1222, 1224, 1226, and 1228 shown in the embodiment of FIG. 12, the neighboring luma pixels corresponding to 1222 and the neighboring luma pixels corresponding to 1226 are available pixels, It is assumed that the neighboring luma pixels corresponding to 1224 and the neighboring luma pixels corresponding to 1228 are unavailable pixels. In this case, the encoder and the decoder may generate luma reference information after performing a padding process on the neighboring luma pixels that are not available.

도 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 the decoder perform a padding process on the neighboring luma pixels that are not available on the first left pixel line and the first upper pixel line, so that the pixel values of the neighboring luma pixels P Y [x,y] , (x=-1, y=-1 to nS*2-1), (x=0 to nS*2-1, y=-1) can be derived. Here, P Y may represent a pixel value of a neighboring luma pixel. Also, nS may indicate the horizontal length and vertical length 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)로 나타내어질 수 있다. Among the neighboring luma pixels, pixels that are not available 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 in 1228 of FIG. 12 ) is referred to as a left pixel group, and the first upper pixel line The group of pixels 1224 that are not available 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 expressed as P Y [x,y], (x=-1, y=nS~nS+(nS>>1)-1).

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

일례로, 픽셀 그룹에 인접하여 위치한 가용한 픽셀은 픽셀 그룹의 한 쪽 끝에만 존재할 수 있다. 도 12를 참조하면, 상단 픽셀 그룹(1224)의 우측에는 가용한 픽셀이 존재하지 않고, 상단 픽셀 그룹(1224)의 좌측에는 가용한 픽셀(c)이 존재할 수 있다. 여기서, 픽셀 c는 PY[nS-1,-1]로 나타내어질 수 있다.For example, an available pixel located adjacent to a pixel group may exist only at one end of the pixel group. Referring to FIG. 12 , an available pixel may not exist on the right side of the upper pixel group 1224 , and an available pixel c may exist 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, there may be only one available pixel positioned adjacent to the upper pixel group 1224 within the first upper pixel line. Accordingly, the encoder and the decoder may fill the pixel values of the available pixels c located adjacent to the upper pixel group into positions of the unavailable pixels in the upper pixel group 1224 . This padding process may be expressed 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 adjacent to an upper end of the left pixel group, and an available pixel a may be adjacent to a lower end of the left pixel group. Here, the pixel a may be represented by P Y [-1, nS+(nS>>1)], and the pixel b may be represented by P Y [-1, nS-1].

이 경우, 제1 좌측 픽셀 라인 내에서 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들은 두 개가 존재할 수 있다. 따라서, 부호화기 및 복호화기는 좌측 픽셀 그룹에 인접하여 위치한 가용한 픽셀들(a,b)의 픽셀 평균 값을, 좌측 픽셀 그룹 내의 가용하지 않은 픽셀들의 위치에 채워 넣을 수 있다. 이러한 패딩 수행 과정은 일례로 다음 수학식 24에 의해 나타내어질 수 있다.In this case, two available pixels located adjacent to the left pixel group in the first left pixel line may exist. Accordingly, the encoder and the decoder may fill the pixel average values of the available pixels (a, b) located adjacent to the left pixel group into the positions of the unavailable pixels in the left pixel group. This padding process may be expressed 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에 의해 나타내어질 수 있다.By the above-described padding process, pixel values of the neighboring luma pixels on the first left pixel line and the neighboring luma pixels on the first upper pixel line may be determined. Based on the pixel values of the neighboring luma pixels on the first left pixel line, the neighboring luma pixels on the first upper pixel line, and the pixels in the current luma block 1210 , the encoder and the decoder determine the luma reference information (luma reference block 1230 ). ) and peripheral luma reference pixels 1240 ). In the embodiment of FIG. 12 , the luma reference information generation process may be expressed 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. In addition, 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 pixel value of a neighboring luma reference pixel).

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

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

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

이러한 경우에도 부호화기 및 복호화기는 제1 색 성분 블록 내의 픽셀 및 제1 색 성분 블록 주변의 픽셀을 기반으로 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출할 수 있다. Even in this case, the encoder and the decoder may derive the first color component reference information to be used for prediction of the second color component block based on the 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, the first color component pixels corresponding to the pixels in the second color component block may constitute a 'first color component reference block'. In addition, in the present specification, a pixel located around the first color component block is referred to as a 'peripheral first color component pixel', and a pixel located near the second color component block is referred to as a 'peripheral second color component pixel', A pixel positioned around the one color component reference block is referred to as a 'peripheral first color component reference pixel'. In this case, the first color component reference block may correspond to the second color component block, and the neighboring first color component reference pixel may correspond to the neighboring second color component pixel. In this specification, the first color component reference information may be used as a concept including a pixel in the first color component reference block and a neighboring first color component reference pixel.

제1 색 성분 블록이 제2 색 성분 블록보다 작은 크기를 갖거나 동일한 크기를 갖는 경우, 제1 색 성분 블록을 기반으로 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정은 상술한 도 6 내지 도 12의 실시예에서와는 다를 수 있다.A process of deriving first color component reference information to be used for prediction of the 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 the above-described embodiment 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 shows an embodiment of a first color component block 1312 , peripheral first color component pixels 1314 , a second color component block 1316 , and peripheral 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 the 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 for deriving first color component reference information.

도 13의 1320의 실시예에서는, 도 13의 1310에서와 같이 제1 색 성분 블록(1312)의 크기가 4x4이고 제2 색 성분 블록(1316)의 크기가 8x8인 경우의 제1 색 성분 참조 정보 도출 방법이 도시된다.In the embodiment of 1320 of FIG. 13 , as in 1310 of FIG. 13 , 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 configured to use a first color component block 1316 to be predicted based on a pixel in the first color component block 1312 and surrounding first color component pixels 1314 . A one color component reference block 1326 and peripheral first color component reference pixels 1328 may be generated. Here, the peripheral first color component pixels 1314 used for deriving 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 upper end 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 from each other, the encoder and the decoder have the same size (8x8) as the second color component block 1316 . A first color component reference block 1326 and corresponding neighboring first color component reference pixels 1328 may be generated. In this case, 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 the decoder are configured to include pixels in the first color component block 1312 and surrounding first color component pixels. The first color component reference information may be generated by performing up-sampling on the elements 1314 .

주변 제1 색 성분 픽셀들(1314) 중에서 가용하지 않은 픽셀들이 존재하는 경우, 부호화기 및 복호화기는 가용하지 않은 픽셀들에 대해 패딩 과정을 수행한 후에 업 샘플링을 수행할 수도 있다. 패딩 과정은 상술한 실시예들에서와 유사하므로 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.When unavailable pixels exist among the neighboring first color component pixels 1314 , the encoder and the 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 herein.

제1 색 성분 블록(1312) 내의 픽셀들 및 주변 제1 색 성분 픽셀들(1314)에 대해 업 샘플링을 수행하는 과정은 일례로 다음 수학식 26에 의해 나타내어질 수 있다.A process of performing up-sampling on the pixels in the first color component block 1312 and the surrounding 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 the reconstructed first color component pixels, that is, pixels in the first color component block 1312 and surrounding 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 the size 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 image format is used, that is, when the color space of the image is RGB 4:4:4 or YUV 4:4:4, the size of the luma block and the chroma block may be the same. have. 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 , the encoder and the decoder use a first color component reference block to be used for prediction of a second color component block based on a pixel in the first color component block 1412 and surrounding first color component pixels 1414 . 1422 and surrounding 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 peripheral first color component pixels 1414 used for deriving 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 upper end of the first color component block 1412 .

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

또한, 인트라 모드에서는 변환/양자화 등이 이용되는 손실 부호화/복호화 방식 대신 무손실 부호화/복호화 방식이 적용될 수도 있다. 무손실 부호화/복호화 방식에서는 부호화 대상 블록에 대해 변환 양자화 등의 과정이 적용되지 않을 수 있다. 제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 the encoding object block. When the size of the first color component block 1412 is the same as the size of the second color component block, even when a lossless encoding/decoding method is applied, the first color component reference information may be derived as in the above-described embodiment. can In this case, the encoder and the decoder may not perform down-sampling, sub-sampling, and up-sampling 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 at the top of the current luma block and left peripheral luma pixels positioned to the left 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 for generating luma reference information may be determined in various ways. For example, only the upper peripheral luma pixels may be used to generate the luma reference information, and only the left peripheral luma pixels may be used to generate the luma reference information. Also, neighboring luma pixels used to generate luma reference information may be determined according to the intra prediction mode of the current luma block.

도 15는 루마 참조 정보 생성에 사용되는 주변 루마 픽셀들의 실시예를 개략적으로 나타내는 도면이다.15 is a diagram schematically illustrating an embodiment of neighboring 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에서와 같은 인트라 예측 모드의 모드 값이 사용된다고 가정한다.*305 In the embodiment of 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 an image format of YUV 4:2:0 is used. Also, it is assumed that pixel values are already filled in the peripheral luma pixels A, B, C, D, E, and F shown in FIG. 15 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 , based on at least one of the neighboring luma pixels A, B, C, D, E, and F and pixels within the current luma block 1512, a luma reference block ( 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 , the neighboring luma pixels to be used for generating the luma reference information may be obtained by, for example, at least one of the combinations shown in Table 3 below.

[표 3][Table 3]

Figure 112022060919799-pat00003
Figure 112022060919799-pat00003

표 3의 실시예에서 P는 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들 및 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 또한, Q는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다. 그리고, R은 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 사용됨을 의미할 수 있다.In the embodiment 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 upper side of the current luma block 1512 are used to generate luma reference information. . Also, Q may mean that upper peripheral luma pixels located at the upper end of the current luma block 1512 are used to generate luma reference information. And, R may mean that the 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 embodiment of Table 3, L indicates that when the left peripheral luma pixels are used to generate the luma reference information, pixels on the first left pixel line closest to the left of the current luma block 1512 are used to generate the luma reference information can mean And, M may mean that when the left neighboring luma pixels are used to generate the luma reference information, pixels on the second left pixel line located second to the left of the current luma block 1512 are used to generate the luma reference information. have. In this case, pixels on the first left pixel line may be used together for sub-sampling.

또한, 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, the luma reference information may be adaptively generated based on the intra prediction mode of the current luma block 1512 . When the luma reference information is generated based on the intra prediction mode of the current luma block 1512 , the left peripheral luma pixels used may be, for example, pixels on the first left pixel line, or pixels on the second left pixel line as another example. may be

일례로, P 및 L의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들 및 제1 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [A, D] 또는 [A, B, D, F]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. For example, in an embodiment to which a combination of P and L is applied, upper peripheral luma pixels located at the upper end 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, peripheral 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 the luma reference information is generated based on [A, D], the generated luma reference information may be shown, for example, as shown in 1520 of FIG. 15 . In 1520 of FIG. 15 , the neighboring luma reference pixels 1524 may include pixels adjacent to an upper end of the luma reference block 1522 and pixels adjacent to the left side of the luma reference block 1522 .

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

또 다른 예로, R 및 L의 조합이 적용되는 실시예에서는 제1 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [D, F]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. As another example, in an embodiment to 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, the neighboring luma pixels of [D, F] shown in 1510 of FIG. 15 may be used to generate the luma reference information.

[D, F]를 기반으로 루마 참조 정보가 생성된 경우, 생성된 루마 참조 정보는 일례로 도 15의 1540에서와 같이 도시될 수 있다. 도 15의 1540에서, 주변 루마 참조 픽셀들(1544)은 루마 참조 블록(1542)의 좌측에 위치한 픽셀들일 수 있다.When the luma reference information is generated based on [D, F], the generated luma reference information may be illustrated, for example, as in 1540 of FIG. 15 . In 1540 of FIG. 15 , the peripheral luma reference pixels 1544 may be pixels located on the left side 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 to which a combination of P and M is applied, upper peripheral luma pixels located at the upper end 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. have. Accordingly, in this case, the surrounding luma pixels of [A, C] or [A, B, C, E] shown in 1510 of FIG. 15 may be used to generate the luma reference information. The luma reference information generated when the combination of P and M is applied may be illustrated, for example, as in 1520 of FIG. 15 .

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

또 다른 예로, R 및 M의 조합이 적용되는 실시예에서는 제2 좌측 픽셀 라인 상의 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. 따라서, 이 경우에는 도 15의 1510에 도시된 [C, E]의 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 수 있다. R 및 M의 조합이 적용되는 경우에 생성되는 루마 참조 정보는 일례로 도 15의 1540에서와 같이 도시될 수 있다.As another example, in an embodiment to 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, peripheral luma pixels of [C, E] shown in 1510 of FIG. 15 may be used to generate luma reference information. The luma reference information generated when the combination of R and M is applied may be illustrated, for example, as in 1540 of FIG. 15 .

또 다른 예로, P 및 N의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로, 현재 루마 블록(1512)의 상단에 위치한 상단 주변 루마 픽셀들 및 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 주변 루마 픽셀로 결정될 수 있다. As another example, in an embodiment to 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 at the upper end of the current luma block 1512 and the current luma block 1512 ), left neighboring luma pixels located on the left side may be determined as neighboring 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 that uses both pixels located at the top and the left of the current luma block 1512 . As an example, the first intra prediction mode is a DC mode, a planar 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 mode.

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

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

또 다른 예로, R 및 N의 조합이 적용되는 실시예에서는 현재 루마 블록(1512)의 인트라 예측 모드를 기반으로, 현재 루마 블록(1512)의 좌측에 위치한 좌측 주변 루마 픽셀들이 루마 참조 정보 생성에 이용될 주변 루마 픽셀로 결정될 수 있다. As another example, in an embodiment to which a combination of R and N is applied, based on the intra prediction mode of the current luma block 1512 , left neighboring luma pixels located on the left side of the current luma block 1512 are used to generate luma reference information It may be determined by the surrounding luma pixels 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 a pixel located to the left 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에서와 같이 도시될 수 있다.The luma reference information generated when a combination of R and N is applied may be illustrated, for example, as in 1540 of FIG. 15 .

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

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

도 16은 루마 참조 블록(1610), 주변 루마 참조 픽셀들(1620), 현재 크로마 블록(1630) 및 복원된 주변 크로마 픽셀들(1640)을 도시한다. 도 16의 실시예에서, 루마 참조 블록(1610)의 크기 및 현재 크로마 블록(1630)의 크기는 각각 8x8일 수 있다.16 illustrates a luma reference block 1610 , neighboring luma reference pixels 1620 , a current chroma block 1630 , and reconstructed neighboring 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 be 8x8, respectively.

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

[수학식 27][Equation 27]

Figure 112022060919799-pat00004
Figure 112022060919799-pat00004

Figure 112022060919799-pat00005
Figure 112022060919799-pat00005

Figure 112022060919799-pat00006
Figure 112022060919799-pat00006

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

[표 4][Table 4]

Figure 112022060919799-pat00007
Figure 112022060919799-pat00007

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

상술한 예측 파라미터 도출 과정에서, 주변 루마 참조 픽셀들(1620) 및/또는 주변 크로마 픽셀들(1640) 중에서는 가용하지 않은 픽셀이 존재할 수도 있다. 이 경우, 일례로 부호화기 및 복호화기에서는 주변 루마 참조 픽셀들(1620) 및/또는 주변 크로마 픽셀들(1640) 중에서 가용한 픽셀들만을 기반으로 예측 파라미터를 도출할 수 있다.In the above-described prediction parameter deriving process, 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 the decoder may derive the 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 the 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 . It 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 the prediction parameters are derived according to the above-described embodiments, the encoder and the decoder may derive the prediction values of the pixels in the current chroma block 1630 based on the prediction parameter and the pixel values of the pixels in the luma reference block 1610 . have. As an example, the encoder and the decoder based on the prediction parameters 'a', 'k', and 'b' derived by Equation 27 and the pixel values of the pixels in the luma reference block 1610 shown in FIG. 16 , the current chroma block A prediction value of pixels within 1630 may be derived. In this case, a process of deriving prediction values of pixels in 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) can 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 decoding 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 a pixel value of a neighboring luma pixel used for prediction of a current luma block. Also, N Y may indicate a horizontal length and a vertical length of the current luma block, and P LM may indicate a pixel value of a neighboring luma pixel 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, V) other than the luma component (Y) in the same or similar manner to the luma component. Also, in this case, PC C may be used instead of the variable P Y , N C may be used instead of the variable N Y , and the value assigned to cIdx may be 1 or 2 instead of 0. Here, cIdx may be an index indicating which component among Y, U, and V the color component of the current block corresponds. For example, if the color component of the current block is Y, 0 may be allocated to cIdx, if the color component of the current block is U, 1 may be allocated to cIdx, and if the color component of the current block is V, cIdx may be allocated to cIdx. 2 may be assigned. A relationship between variables applied to the embodiment of FIG. 17 according to color components may be represented by Table 5 below as an example.

[표 5][Table 5]

Figure 112022060919799-pat00008
Figure 112022060919799-pat00008

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

일례로, 도 17의 실시예는 색 공간을 구성하는 각각의 색 성분에 대해, Y 성분, U 성분, V 성분의 순서로 적용될 수 있다.For example, the embodiment of FIG. 17 may be applied in the 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 the decoder are P Y [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=- It is possible to mark by checking whether 1) is available (S1710). Here, the marking may refer to 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 herein.

다시 도 17을 참조하면, 부호화기 및 복호화기는 현재 루마 블록에 대해 조건 A 및 조건 B가 만족되는지 여부를 판단할 수 있다(S1720). Referring back to FIG. 17 , the encoder and the decoder may determine whether the 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. As an example, condition A may be satisfied when 1 is assigned 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. In addition, condition B is a condition indicating that the current block is a luma component block (Y). For example, condition B may be satisfied when 0 is assigned to cIdx.

조건 A 및 조건 B가 만족되는 경우, 부호화기 및 복호화기는 PLM을 생성할 수 있다.When condition A and condition B are satisfied, the encoder and the decoder may generate a 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, when conditions A and B are satisfied, the encoder and the decoder are P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~ It can be marked by checking whether N Y *2-1, y=-1) 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 P LM [x,y] may also be marked as unavailable if P Y [x,y] is not available.

또한, 일례로 PLM 에 대한 마킹 과정이 수행된 후 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=0~NY*2-1)에 해당되는 픽셀들 중에서 가용한 것으로 판별된 픽셀들의 픽셀 값을 [x-1,y] 위치의 루마 픽셀 값으로 대체할 수도 있다. In addition, as an 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~N Y *2-1). It is also possible to replace the pixel value of the pixels determined to be one with the luma pixel value 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 the 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 the pixel of ' is not available.

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

다시 도 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 the 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 the pixel of ' 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 generating luma reference information is not available, the encoder and the decoder perform 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 pixels that are not available (S1770). Since the embodiments of the padding process have been described above, a detailed description thereof will be omitted herein.

상술한 패딩 과정이 수행된 후, 부호화기 및 복호화기는 주변 루마 픽셀들을 기반으로 현재 루마 블록에 대한 예측 및 복호화 과정을 수행함으로써, 현재 루마 블록에 대한 복원 블록을 생성할 수 있다(S1780). 도 17의 실시예가 크로마 성분(U 또는 V)에 대해 적용된 경우, 부호화기 및 복호화기는 주변 루마 픽셀들, 복원된 현재 루마 블록 내 픽셀들 및 주변 크로마 픽셀들을 기반으로 현재 크로마 블록에 대한 예측 블록을 생성할 수 있으며, 생성된 예측 블록을 기반으로 현재 크로마 블록에 대한 복원 블록을 생성할 수 있다.After the above-described padding process is performed, the encoder and the decoder may generate a reconstructed block for the current luma block by performing prediction and decoding processes on the current luma block based on the neighboring luma pixels ( S1780 ). When the embodiment of FIG. 17 is applied to a chroma component (U or V), the encoder and the 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 may generate a reconstructed block for the current chroma block 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 that is a prediction target, 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. It shows the used peripheral luma pixels 1840 , P LM , the current chroma block 1850 and the peripheral chroma pixels 1860 , P C . 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 the chroma components (U, V) other than the luma component (Y). When the prediction mode of the current chroma block 1850 is the LM mode, after the padding process is performed, the encoder and the decoder may derive luma reference information and prediction parameters for the current chroma block 1850 .

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

부호화기 및 복호화기는 주변 루마 픽셀들(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 from each other, the encoder and the decoder have the same size (4x4) as the current chroma block 1850 and the luma reference block and its corresponding surroundings. Luma reference pixels may be generated. 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 are used in pixels within the reconstructed current luma block 1830 and adjacent luma pixels 1840 . The luma reference information may be generated by performing down-sampling on the .

복원된 현재 루마 블록(1830)의 상단에 위치한 주변 루마 픽셀들에 대해서는 일례로 다음 수학식 29에 의해 다운 샘플링 과정이 수행될 수 있다.For example, a downsampling process may be performed on neighboring luma pixels located at the upper end of the restored current luma block 1830 by Equation 29 below.

[수학식 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~N C -1)

여기서, PY'은 루마 참조 정보에 해당되는 픽셀(예컨대, 루마 참조 블록 내의 픽셀 또는 주변 루마 참조 픽셀)의 픽셀 값을 나타낼 수 있다. 또한, PLM은 루마 참조 정보 생성에 사용될 주변 루마 픽셀(1840)의 픽셀 값을 나타낼 수 있다. 그리고, NC는 현재 크로마 블록(1850)의 가로 길이 및 세로 길이를 나타낼 수 있다.Here, P Y ′ may indicate a pixel value of a pixel corresponding to the 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. And, N C may represent the horizontal length and vertical length of the current chroma block 1850 .

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

[수학식 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 pixels in the restored current luma block 1830 , for example, a downsampling process may be performed according to 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 represent a pixel value of a pixel in the current luma block 1830 .

상술한 과정에 의해 루마 참조 정보가 생성되면, 부호화기 및 복호화기는 루마 참조 정보 및 크로마 성분 정보를 기반으로 현재 크로마 블록(1850)에 대한 예측 파라미터를 도출할 수 있다. 일례로, 부호화기 및 복호화기는 주변 루마 참조 픽셀들(1840)의 픽셀 값 및 주변 크로마 픽셀들(1860)의 픽셀 값을 기반으로 예측 파라미터를 도출할 수 있다. 다음 수학식 32는 예측 파라미터를 도출하는 과정의 일부를 나타낼 수 있다.When the luma reference information is generated by the above-described process, the encoder and the decoder may derive prediction parameters for the current chroma block 1850 based on the luma reference information and the chroma component information. As an example, the encoder and the 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 112022060919799-pat00009
Figure 112022060919799-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, and LC derived by Equation 32 Since the example is similar to the embodiment of Equation 27, a detailed description thereof will be omitted herein. 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 PC C .

예측 파라미터가 도출되면, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록(1830) 내 픽셀들의 픽셀 값을 기반으로, 현재 크로마 블록(1850) 내 픽셀들의 예측 값을 도출할 수 있다. 현재 크로마 블록(1850) 내 픽셀들의 예측 값을 도출하는 과정의 실시예는 수학식 28의 실시예에서와 유사하므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다. 다만, 이 경우 수학식 28의 실시예에서 nS는 NC로 대체될 수 있고, p1은 PRecY로 대체될 수 있다. When the prediction parameter is derived, the encoder and the decoder may derive prediction values of the pixels in the current chroma block 1850 based on the prediction parameter and the pixel values of the pixels in the luma reference block 1830 . Since the embodiment of the process of deriving the prediction values of the pixels in the current chroma block 1850 is similar to the embodiment of Equation 28, a detailed description thereof will be omitted herein. 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 decoding process according to the present invention. Also, FIG. 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 a pixel value of a neighboring luma pixel used for prediction of the current luma block. In addition, 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 PC C . In addition, N Y may represent the horizontal length and vertical length of the current luma block, and N U and N V may represent the horizontal length and vertical length of the current chroma block. Here, N U and N V may be represented by N C . In the embodiment of FIG. 19 , P LM may indicate a pixel value of a neighboring luma pixel 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.

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

[표 6][Table 6]

Figure 112022060919799-pat00010
Figure 112022060919799-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 among 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 the color component of the current block may be V( Cr), 2 may be assigned to cIdx.

또한, 도 19의 실시예는 일례로 하나의 CU에서 색 공간을 구성하는 각각의 색 성분에 대해, Y 성분, U(Cb) 성분, V(Cr) 성분의 순서로 적용될 수 있다. Also, the embodiment of FIG. 19 may be applied in the 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. In this case, the encoder and the decoder may first perform the decoding process according to the embodiment of FIG. 19A on Y component blocks in the CU 1990 . In addition, the encoder and the decoder may sequentially perform the decoding process according to the embodiment of FIG. 19A on the U component blocks and the V component blocks in the CU 1990 . For example, the decoding process according to the embodiment of FIG. 19 is [Y1->Y2->...->Y7->U1->U2->...->U7->V1->V2...- >V7]. Here, 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 the decoder are P k [x,y], (x=-1, y=-1~N k *2-1 and x=0~N k *2-1, y=- It is possible to mark by checking whether 1) is available (S1910). As described above, the marking may refer to 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 herein.

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 A, 조건 B 및 조건 C가 만족되는지 여부를 판단할 수 있다(S1920). Referring back to FIG. 19A , the encoder and the decoder may determine whether condition A, condition B, and condition 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. As an example, condition A may be satisfied when 1 is assigned 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. In addition, 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 by Intra_FromLuma. In addition, condition C is a condition indicating that the current block is a chroma component block (U(Cb) or V(Cr)). For example, condition C may 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 the decoder may generate a 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, when condition A, condition B, and condition C are satisfied, the encoder and the decoder are P LM [x,y], (x=-1, y=-1~N Y *2-1 and x =0~N Y *2-1, y=-1) may be checked by checking whether it is available and marked (S1930).

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

또한 이 때 일 실시예로, 부호화기 및 복호화기는 주변 루마 픽셀들에 대응되는 주변 크로마 픽셀, 즉 PU 또는 PV의 가용성을 기반으로 PLM이 가용한지 여부를 체크할 수 있다. 이 때, PU 또는 PV가 가용한지 여부는 S1910 단계에서 이미 마킹되어 있을 수 있다. 일례로, 부호화기 및 보호화기는 PU에 해당되는 픽셀이 가용한지 여부를 기반으로 PLM이 가용한지 여부를 판단할 수 있다.Also at this time, according to an embodiment, the encoder and the decoder may check whether the P LM is available based on the availability of the neighboring chroma pixels corresponding to the neighboring luma pixels, that is, PU or P V . At this time, whether PU or P V is available may be already marked in step S1910. For example, the encoder and the 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, the encoder and decoder ,2y] and P LM [x,2y+1] may 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, the encoder and the decoder are the neighboring luma pixels 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]에 할당할 수 있다. 따라서, 주변 루마 픽셀이 현재 루마 블록의 좌측에 인접하여 위치한 좌측 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀의 좌측에 인접하여 위치한 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In this case, the encoder and the decoder allocate the luma pixel values located in [x-1,2y] and [x-1,2y+1] to P LM [x,2y] and P LM [x,2y+1], respectively. can do. Accordingly, when the neighboring luma pixel is a pixel on the left pixel line located adjacent to the left side of the current luma block and it is determined that the neighboring luma pixel is available, the pixel value of the luma pixel located adjacent to the left side of the neighboring luma pixel is the neighboring 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]도 가용한 것으로 판단할 수 있다. In addition, if the surrounding chroma pixel P U [x,y] is marked as unavailable for x=0~N U *2-1, y=-1, the encoder and the decoder ] 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, the encoder and the decoder are the neighboring luma pixels 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 the decoder may allocate the luma pixel values located at [2x,y] and [2x+1,y] to P LM [2x,y] and P LM [2x+1,y], respectively. Accordingly, when the neighboring luma pixel is a pixel on the upper pixel line located adjacent to the top of the current luma block 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 the neighboring luma pixel may be determined by the 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, the encoder and decoder assume that the surrounding luma pixel P LM [x,y] is also not available. 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 can determine that the surrounding luma pixel P LM [x,y] is also available. can

이 때, 부호화기 및 복호화기는 [x,y]에 위치한 루마 픽셀 값을 PLM[x,y]에 할당할 수 있다. 따라서, 주변 루마 픽셀의 위치가 [-1,-1]이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.In this case, the encoder and the decoder may allocate the luma pixel value located at [x,y] to P LM [x,y]. Accordingly, when 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 PU has been 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 the decoder may determine whether the condition D is satisfied ( S1940 ). Here, the 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 the pixel of ' is not available.

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

다시 도 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 the decoder may determine whether condition A, condition B, condition C, and condition E are satisfied ( S1960 ). Here, the 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 the pixel of ' 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). 패딩 과정의 구체적인 실시예들은 상술한 바 있으므로, 여기서는 이에 대한 구체적인 설명은 생략하기로 한다.When condition A, condition B, condition C, and condition E are satisfied, the encoder and decoder perform P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~ A padding process may be performed on pixels that are not available 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 herein.

상술한 패딩 과정이 수행된 후, 부호화기 및 복호화기는 현재 루마 블록 및/또는 현재 크로마 블록에 대한 예측 및 복호화 과정을 수행함으로써, 현재 루마 블록에 대한 복원 블록 및/또는 현재 크로마 블록에 대한 복원 블록을 생성할 수 있다(S1980). After the above-described padding process is performed, the encoder and the decoder perform prediction and decoding processes on the current luma block and/or the current chroma block to obtain a reconstructed block for the current luma block and/or a reconstructed block for the current chroma block. 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 herein.

상술한 실시예들에서, 방법들은 일련의 단계 또는 블록으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described 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 at the same time as other steps as described above. can In addition, those of ordinary skill in the art will recognize that the steps shown in the flowchart are not exclusive, other steps may be included, or that one or more steps of the flowchart may be deleted without affecting the scope of the present invention. You will understand.

상술한 실시예는 다양한 양태의 예시들을 포함한다. 다양한 양태들을 나타내기 위한 모든 가능한 조합을 기술할 수는 없지만, 해당 기술 분야의 통상의 지식을 가진 자는 다른 조합이 가능함을 인식할 수 있을 것이다. 따라서, 본 발명은 이하의 특허청구범위 내에 속하는 모든 다른 교체, 수정 및 변경을 포함한다고 할 것이다.The above-described embodiments include examples of various aspects. It is not possible to describe every possible combination for representing the various aspects, but one of ordinary skill 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)

현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계;
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계; 및
상기 예측 값에 기초하여, 상기 현재 크로마 블록 내 픽셀을 복원하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 복호화 방법.
Determining whether left peripheral luma pixels adjacent to the left of the luma reference block are available among the peripheral luma pixels of the luma reference block corresponding to the current chroma block and whether upper peripheral luma pixels adjacent to the top of the luma reference block are available to do;
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 prediction value of a pixel in the current chroma block based on the pixel in the luma reference block and the prediction parameter; and
based on the prediction value, reconstructing a pixel in the current chroma block;
The left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left side of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left side of the first left peripheral luma pixel,
When 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 The image decoding method according to claim 1, wherein the prediction parameter for the current chroma block is derived based on a reference pixel.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 좌측 주변 루마 픽셀들이 이용가능하지 않은 경우, 상기 좌측 주변 루마 픽셀들은 주변 루마 참조 픽셀들에 포함되지 않고,
상기 상단 주변 루마 픽셀들이 이용가능하지 않은 경우, 상기 상단 주변 루마 픽셀들은 주변 루마 참조 픽셀들에 포함되지 않는 것을 특징으로 하는 영상 복호화 방법.
The method of claim 1,
The determining of the peripheral luma reference pixels comprises:
when the left peripheral luma pixels are not available, the left peripheral luma pixels are not included in the peripheral luma reference pixels;
When the upper peripheral luma pixels are not available, the upper peripheral luma pixels are not included in the peripheral luma reference pixels.
제 1항에 있어서,
상기 예측 파라미터를 도출하는 단계에서,
상기 주변 루마 픽셀들은 소정의 크기를 갖는 픽셀 그룹들에 포함되고,
상기 픽셀 그룹들 각각에 대하여, 상기 주변 루마 픽셀들 중 소정 위치의 주변 루마 샘플이 선택되고,
상기 선택된 소정 위치의 주변 루마 샘플에 기초하여, 상기 주변 루마 픽셀들이 다운샘플링되고,
상기 다운샘플링된 주변 루마 픽셀들에 기초하여, 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 복호화 방법.
The method of 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;
the peripheral luma pixels are downsampled based on the peripheral luma sample of the selected predetermined position;
The image decoding method according to claim 1, wherein the prediction parameter is derived based on the downsampled neighboring luma pixels.
제 1항에 있어서,
상기 상단 주변 루마 픽셀들은, 상기 루마 참조 블록의 상단에 바로 인접한 제1 상단 주변 루마 픽셀과, 상기 제1 상단 주변 루마 픽셀의 상단에 바로 인접한 제2 상단 주변 루마 픽셀을 포함하는 것을 특징으로 하는 영상 복호화 방법.
The method of claim 1,
The upper peripheral luma pixels include a first upper peripheral luma pixel immediately adjacent to an upper end of the luma reference block and a second upper peripheral luma pixel immediately adjacent to an upper end of the first upper peripheral luma pixel. Decryption method.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 좌측 주변 루마 픽셀들이 이용가능한 경우, 상기 좌측 주변 루마 픽셀들 및 좌하측 주변 루마 픽셀들에 따라, 상기 주변 루마 참조 픽셀들을 결정하는 것을 특징으로 하는 영상 복호화 방법.
The method of claim 1,
The determining of the peripheral luma reference pixels comprises:
When the left peripheral luma pixels are available, the peripheral luma reference pixels are determined according to the left peripheral luma pixels and the lower left peripheral luma pixels.
제 1항에 있어서,
상기 주변 루마 참조 픽셀들을 결정하는 단계는,
상기 상단 주변 루마 픽셀들이 이용가능한 경우, 상기 상단 주변 루마 픽셀들 및 우상측 주변 루마 픽셀에 따라, 상기 주변 루마 참조 픽셀들을 결정하는 것을 특징으로 하는 영상 복호화 방법.
The method of claim 1,
The determining of the peripheral luma reference pixels comprises:
If the upper peripheral luma pixels are available, the peripheral luma reference pixels are determined according to the upper peripheral luma pixels and the right peripheral luma pixel.
제1항에 있어서,
상기 영상 복호화 방법은,
상기 현재 크로마 블록이 포함된 현재 시퀀스에서 크로마 블록의 인트라 예측에 LM 모드가 적용될 수 있는지 여부를 나타내는 LM 플래그 정보를 획득하는 단계; 및
상기 LM 플래그 정보가 상기 현재 시퀀스에서 크로마 블록의 인트라 예측에 LM 모드가 적용됨을 나타낼 때, 상기 현재 크로마 블록의 인트라 예측 모드를 나타내는 인트라 예측 모드 정보에 따라, 상기 현재 크로마 블록에 LM 모드가 적용되는지 여부를 판단하는 단계를 더 포함하는 영상 복호화 방법.
According to claim 1,
The video decoding method comprises:
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 the 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 Video decoding method further comprising the step of determining whether.
현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계;
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계; 및
상기 예측 값에 기초하여, 상기 현재 크로마 블록 내 픽셀을 부호화하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 영상 부호화 방법.
Determining whether left peripheral luma pixels adjacent to the left of the luma reference block are available among the peripheral luma pixels of the luma reference block corresponding to the current chroma block and whether upper peripheral luma pixels adjacent to the top of the luma reference block are available to do;
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 prediction value of a pixel in the current chroma block based on the pixel in the luma reference block and the prediction parameter; and
encoding a pixel in the current chroma block based on the prediction value;
The left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left side of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left side of the first left peripheral luma pixel,
When 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 The video encoding method according to claim 1, wherein the prediction parameter for the current chroma block is derived based on a reference pixel.
비트스트림을 저장한 컴퓨터로 판독 가능한 기록 매체로서,
상기 비트스트림은 영상 복호화 방법에 의해 복호화되는 영상 데이터를 포함하고,
상기 영상 복호화 방법은,
현재 크로마 블록에 대응되는 루마 참조 블록의 주변 루마 픽셀들 중 상기 루마 참조 블록의 좌측에 인접한 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 루마 참조 블록의 상단에 인접한 상단 주변 루마 픽셀들이 이용가능한지 여부를 결정하는 단계;
상기 좌측 주변 루마 픽셀들이 이용가능한지 여부 및 상기 상단 주변 루마 픽셀들이 이용가능한지 여부에 따라, 주변 루마 참조 픽셀들을 결정하는 단계;
상기 현재 크로마 블록 주변에 위치한 주변 크로마 픽셀들 중에서 상기 주변 루마 참조 픽셀들에 대응되는 주변 크로마 참조 픽셀들을 결정하는 단계;
상기 주변 루마 참조 픽셀들 및 상기 주변 크로마 참조 픽셀들을 기반으로, 상기 현재 크로마 블록에 대한 예측 파라미터를 도출하는 단계;
상기 루마 참조 블록 내 픽셀 및 상기 예측 파라미터를 기반으로, 상기 현재 크로마 블록 내 픽셀의 예측 값을 도출하는 단계; 및
상기 예측 값에 기초하여, 상기 현재 크로마 블록 내 픽셀을 복원하는 단계를 포함하고,
상기 좌측 주변 루마 픽셀들은, 상기 루마 참조 블록의 좌측에 바로 인접한 제1 좌측 주변 루마 픽셀과, 상기 제1 좌측 주변 루마 픽셀의 좌측에 바로 인접한 제2 좌측 주변 루마 픽셀을 포함하고,
상기 좌측 주변 루마 픽셀들이 이용가능할 경우, 상기 제1 좌측 주변 루마 픽셀 및 상기 제2 좌측 주변 루마 픽셀에 기초하여 결정된 다운샘플링된 주변 루마 참조 픽셀과 상기 다운샘플링된 주변 루마 참조 픽셀에 대응되는 주변 크로마 참조 픽셀에 기반하여, 상기 현재 크로마 블록에 대한 상기 예측 파라미터가 도출되는 것을 특징으로 하는 컴퓨터로 판독 가능한 기록 매체.
A computer-readable recording medium storing a bitstream, comprising:
The bitstream includes image data decoded by an image decoding method,
The video decoding method comprises:
Determining whether left peripheral luma pixels adjacent to the left of the luma reference block are available among the peripheral luma pixels of the luma reference block corresponding to the current chroma block and whether upper peripheral luma pixels adjacent to the top of the luma reference block are available to do;
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 prediction value of a pixel in the current chroma block based on the pixel in the luma reference block and the prediction parameter; and
based on the prediction value, reconstructing a pixel in the current chroma block;
The left peripheral luma pixels include a first left peripheral luma pixel immediately adjacent to the left side of the luma reference block and a second left peripheral luma pixel immediately adjacent to the left side of the first left peripheral luma pixel,
When 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.
KR1020220070901A 2011-11-08 2022-06-10 Method for intra prediction and apparatus thereof KR102449210B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220121818A KR102489735B1 (en) 2011-11-08 2022-09-26 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
KR1020210079558A KR102409444B1 (en) 2011-11-08 2021-06-18 Method for intra prediction and apparatus thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020210079558A Division KR102409444B1 (en) 2011-11-08 2021-06-18 Method for intra prediction and apparatus thereof

Related Child 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

Publications (2)

Publication Number Publication Date
KR20220083654A KR20220083654A (en) 2022-06-20
KR102449210B1 true KR102449210B1 (en) 2022-09-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 (2)

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

Family Applications After (3)

Application Number Title Priority Date Filing Date
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

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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013034162A (en) * 2011-06-03 2013-02-14 Sony Corp Image processing device and image processing method
CN103650512B (en) * 2011-07-12 2017-04-19 英特尔公司 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
KR20230013146A (en) 2023-01-26
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
KR102449210B1 (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
JP7087071B2 (en) Coding method and equipment
KR20210156826A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
JP2020080568A (en) Video encoding/decoding method and device thereof
JP6162212B2 (en) Merge signaling and loop filter on / off signaling
TW201830964A (en) Deriving bilateral filter information based on a prediction mode in video coding
TW201711461A (en) Slice level intra block copy and other video coding improvements
KR20200112964A (en) Method and apparatus for predicting residual code in transform domain
GB2531004A (en) Residual colour transform signalled at sequence level for specific coding modes
KR20150052259A (en) Weighted prediction mode for scalable video coding
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
EP3649777A1 (en) Division-free bilateral filter
KR20210088697A (en) Method of adapting encoders, decoders and corresponding deblocking filters
KR20210091322A (en) Method and apparatus for mode- and size-dependent block-level restriction
KR20220127314A (en) Encoders, decoders, and corresponding methods for adaptive loop filtering
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
WO2013069972A1 (en) Method for intra-prediction and device thereof
JP7408834B2 (en) Method and apparatus for video filtering
RU2801326C2 (en) Coder, decoder and corresponding methods using allocated ibc buffer and default value updated brightness and colour component
RU2785816C2 (en) Position-dependent intra-prediction combination expanded with angular modes
CN117596409A (en) Method, apparatus and computer readable storage medium for processing video data

Legal Events

Date Code Title Description
A107 Divisional application of patent
E701 Decision to grant or registration of patent right
A107 Divisional application of patent
GRNT Written decision to grant