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

Method for intra prediction and apparatus thereof Download PDF

Info

Publication number
KR102607887B1
KR102607887B1 KR1020230005110A KR20230005110A KR102607887B1 KR 102607887 B1 KR102607887 B1 KR 102607887B1 KR 1020230005110 A KR1020230005110 A KR 1020230005110A KR 20230005110 A KR20230005110 A KR 20230005110A KR 102607887 B1 KR102607887 B1 KR 102607887B1
Authority
KR
South Korea
Prior art keywords
luma
pixels
pixel
block
peripheral
Prior art date
Application number
KR1020230005110A
Other languages
Korean (ko)
Other versions
KR20230013146A (en
Inventor
이진호
김휘용
임성창
최진수
김진웅
Original Assignee
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원 filed Critical 한국전자통신연구원
Publication of KR20230013146A publication Critical patent/KR20230013146A/en
Priority to KR1020230166008A priority Critical patent/KR20230165180A/en
Application granted granted Critical
Publication of KR102607887B1 publication Critical patent/KR102607887B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Abstract

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

Description

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

이하, 도면을 참조하여 본 발명의 실시 형태에 대하여 구체적으로 설명한다. 본 명세서의 실시예를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the 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 will be omitted.

어떤 구성 요소가 다른 구성 요소에 “연결되어” 있다거나 “접속되어” 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 아울러, 본 발명에서 특정 구성을 “포함”한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다. When a component is said to be “connected” or “connected” to another component, it is understood that it may be directly connected or connected to the other component, but 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 configuration, and means that additional configurations may be included in the practice of the present invention or the scope of the technical idea of the present invention.

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

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

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

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

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

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

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

인터 모드인 경우, 움직임 예측부(111)는, 움직임 예측 과정에서 참조 픽쳐 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. 여기서, 움직임 벡터는 인터 예측에 사용되는 2차원 벡터이며, 현재 부호화/복호화 대상 영상과 참조 영상 사이의 오프셋을 나타낼 수 있다.In the case of inter mode, the motion prediction unit 111 can obtain a motion vector by finding an area that best matches the input block in the reference image stored in the reference picture buffer 190 during the motion prediction process. The motion compensation unit 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 represent the 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, motion prediction unit 111, and/or motion compensation unit 112, the processing unit in which the prediction method or prediction mode is determined and the processing unit in which prediction is performed may be the same, but may be different from each other. It may be possible. For example, when the processing unit in which the prediction method is determined is PU, the processing unit in which prediction is performed may be 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 and output a transform coefficient. Additionally, the quantization unit 140 may quantize the input transform coefficient according to the quantization parameter and output a quantized coefficient.

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

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

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

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

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

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

영상 복호화 장치(200)는 부호화기에서 출력된 비트스트림을 입력 받아 인트라 모드 또는 인터 모드로 복호화를 수행하고 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 인트라 모드인 경우 스위치가 인트라로 전환되고, 인터 모드인 경우 스위치가 인터로 전환될 수 있다. 영상 복호화 장치(200)는 입력 받은 비트스트림으로부터 잔차 블록(residual block)을 얻고 예측 블록을 생성한 후 잔차 블록과 예측 블록을 더하여 재구성된 블록, 즉 복원 블록을 생성할 수 있다.The image decoding device 200 may receive a bitstream output from an encoder, perform decoding in intra mode or inter mode, and output a reconstructed image, that is, a reconstructed image. In the case of intra mode, the switch may be converted to intra, and in the case of inter mode, the switch may be converted to inter. The image decoding apparatus 200 may obtain a residual block from an input bitstream, generate a prediction block, and then add the residual block and the prediction block to generate a reconstructed block, that is, a restored 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 symbols with a high probability of occurrence and a large number of bits are allocated to symbols with a low probability of occurrence to represent the symbols, thereby reducing the size of the bit string for each symbol. can be reduced. Therefore, the compression performance of video decoding can be improved through the entropy decoding method.

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

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

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

잔차 블록과 예측 블록은 가산기(255)를 통해 더해지고, 더해진 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO, ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(260)는 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽쳐 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The residual block and the prediction block are added through the adder 255, and the added block may pass through the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to a restored block or a restored picture. The filter unit 260 may output a reconstructed image, that is, a restored image. The reconstructed image can 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 refer to a unit of video encoding and decoding. When encoding or decoding a video, the encoding or decoding unit refers to the divided unit when the video is divided and encoded or decoded, so it is a coding unit (CU: Coding Unit), prediction unit (PU: Prediction Unit), and transformation unit (TU). : Transform Unit), etc. Additionally, in embodiments described later, a unit may also be referred to as a block. One unit may be further divided into smaller sized subunits.

도 3은 하나의 유닛이 복수의 하위 유닛으로 분할되는 실시예를 개략적으로 나타내는 개념도이다. Figure 3 is a conceptual diagram schematically showing 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 extent to which the unit is divided, it may also include information about the size of the sub-unit.

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

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

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

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

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

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

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

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

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

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

상술한 바와 같이 인트라 예측은 현재 블록의 인트라 예측 모드에 따라 수행될 수 있다. 현재 블록이 가질 수 있는 인트라 예측 모드의 개수는 소정의 고정된 값일 수 있으며, 예측 블록의 크기에 따라 다르게 결정되는 값일 수도 있다. 일례로, 현재 블록이 가질 수 있는 인트라 예측 모드의 개수는 35 또는 36일 수 있다.As described above, intra prediction may be performed according to the intra prediction mode of the current block. The number of intra prediction modes that the current block can have may be a fixed value, or it may be a value determined differently depending on the size of the prediction block. For example, the number of intra prediction modes that the current block can 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 with a mode value of 1, prediction may be performed in the vertical direction based on the pixel value of the reference pixel, and in the horizontal mode with a mode value of 2, prediction may be performed in the vertical direction based on the pixel value of the reference pixel. Prediction can be performed in the horizontal direction based on the pixel values of . Even in the case of directional modes other than the modes described above, the encoder and decoder can perform intra prediction using reference pixels according to the angle.

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

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

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

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

[표 1][Table 1]

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

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

또한, 부호화기는 현재 시퀀스 내에서 크로마 성분의 예측 모드에 따라 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 within the current sequence, that is, whether the LM mode can be applied to intra prediction of the chroma component within the current sequence and transmits it to the decoder. Can be transmitted. For example, LM flag information may be transmitted to the decoder through a syntax element called chroma_pred_from_luma_enabled_flag. For example, if 1 is assigned to chroma_pred_from_luma_enabled_flag, the flag may indicate that LM mode can be used for intra prediction of the chroma component. Additionally, if 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 the 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, if 1 is assigned to chroma_pred_from_luma_enabled_flag, the chroma prediction mode can be determined according to the embodiment in Table 1. However, if 0 is assigned to chroma_pred_from_luma_enabled_flag, the LM mode is not used for intra prediction of the chroma component, so 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 in Table 1. For example, when the LM mode is not used for intra prediction of the chroma component, the chroma prediction mode can be expressed as in the example in Table 2 below.

[표 2][Table 2]

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

일례로, 상술한 LM 모드에서는 루마 성분을 기반으로 크로마 성분에 대한 예측이 수행될 수 있다. 이 때, 제1 색 성분은 루마 성분에 해당될 수 있고, 제2 색 성분은 크로마 성분에 해당될 수 있다. LM 모드에서 루마 성분과 크로마 성분의 상관성은 예측 파라미터를 이용한 선형 관계로 표현될 수 있다. 루마 성분을 기반으로 크로마 성분에 대해 예측을 수행하는 과정의 구체적인 실시예는 후술하기로 한다.For example, in the LM mode described above, prediction of the chroma component may be performed based on the luma component. At this time, the first color component may correspond to a luma component, and the second color component may correspond to a chroma component. In LM mode, the correlation between the luma component and the chroma component can be expressed as a linear relationship using prediction parameters. A specific example of the process of predicting 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 this specification, for convenience of explanation, the first color component is referred to as a luma component, and the second color component is referred to as a chroma component. However, the embodiments described below are not limited to this and may be applied in the same or similar manner to all possible combinations of the first color component and the second color component. At this time, in embodiments described later, the luma component can be viewed as a first color component, and the chroma component can be viewed as a second color component.

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

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

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

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

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

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

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

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

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

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

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

다시 도 5를 참조하면, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록 내의 루마 참조 픽셀 값을 기반으로 현재 크로마 블록 내 픽셀들의 예측 값을 도출할 수 있다(S530). 즉, 부호화기 및 복호화기는 예측 파라미터 및 루마 참조 블록 내의 루마 참조 픽셀 값을 기반으로 현재 크로마 블록에 대해 인트라 예측을 수행할 수 있다. 현재 크로마 블록 내 픽셀들의 예측 값을 도출하는 과정의 구체적인 실시예는 후술하기로 한다.Referring again to FIG. 5, the encoder and 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 decoder can 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 example of the process of deriving predicted values of pixels in the current chroma block will be described later.

도 6은 현재 루마 블록의 크기 및 현재 크로마 블록의 크기가 서로 다른 경우, 루마 참조 정보를 도출하는 방법의 일 실시예를 나타낸다.Figure 6 shows an embodiment of a method for 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 depending on the video format. For example, if 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 four times larger than the size of the current chroma block. In this case, the encoder and decoder can derive pixels in the luma reference block having the same size as the current chroma block based on the current luma block, and derive surrounding luma reference pixels located around the luma reference block. That is, in this case, the encoder and decoder can generate luma reference information to correspond to the size of the current chroma block.

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

도 6의 620은 루마 참조 정보 도출 방법의 일 실시예를 도시한다. 620 in 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, a method of deriving luma reference information 626 and 628 when the size of the current luma block 612 is 8x8 and the size of the current chroma block 616 is 4x4 as in 610 of FIG. 6 This is shown.

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

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

이하, 본 명세서의 좌표들(예컨대, (x,y))은 블록 내의 가장 좌측 상단에 존재하는 픽셀의 위치를 기준으로 하는 좌표일 수 있다. 일례로 본 명세서에서 블록 내의 가장 좌측 상단에 존재하는 픽셀의 좌표는 (0,0)일 수 있다.Hereinafter, coordinates (eg, (x,y)) in this specification may be coordinates based on the position of the pixel that exists at the top left of the block. For example, in this specification, the coordinates of the pixel located at the top 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 apply a 2-tap filter, a 3-tap filter, and/or a 4-tap filter for pixels within the current luma block 612 and surrounding luma pixels 624. Down sampling can be performed by applying a (4-tap) filter, etc. At this time, the down sampling process can be expressed as an example by Equation 1 below.

[수학식 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 pixel values of the restored luma component pixels, that is, pixels within the current luma block 612 and surrounding luma pixels 624. Additionally, p'[x,y] may represent pixel values of the luma reference pixels 626 and 628 generated according to the size of the current chroma block 616.

다른 실시예로, 부호화기 및 복호화기는 소정의 연산에 따라 현재 루마 블록(612) 내의 픽셀들 및 주변 루마 픽셀들(624) 중에서 루마 참조 픽셀로 사용될 픽셀들을 선택함으로써, 다운 샘플링을 수행할 수도 있다. 이 때, 일례로 부호화기 및 복호화기는 소정의 크기를 갖는 픽셀 그룹 내에서 하나의 픽셀을 선택하여 루마 참조 픽셀로 사용할 수 있다. 이러한 다운 샘플링 수행 과정은 일례로 다음 수학식 2, 수학식 3 및 수학식 4 에 의해 나타내어지는 다운 샘플링 방식 중에서 적어도 하나의 방식으로 수행될 수 있다.In another embodiment, the encoder and decoder may perform down-sampling by selecting pixels to be used as luma reference pixels from pixels in the current luma block 612 and surrounding luma pixels 624 according to a predetermined operation. At this time, for example, the encoder and decoder can select one pixel from a pixel group with a predetermined size and use it as a luma reference pixel. For example, this down-sampling process may be performed by at least one of the down-sampling methods represented by Equation 2, Equation 3, and Equation 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에 의한 다운 샘플링 방식이 적용될 수도 있다. 여기서, 다운 샘플링 방식이 적용되는 가능한 실시예들의 조합이 모두 서술되지는 않지만, 당해 분야에서 통상의 지식을 가진 자라면, 상술한 다운 샘플링 방식들의 다른 조합의 사용이 가능함을 인식할 수 있을 것이다.Additionally, different down-sampling methods may be applied to pixels in the current luma block 612, surrounding luma pixels located on top of the current luma block 612, and surrounding luma pixels located to the left of the current luma block 612. there is. For example, when the down-sampling method according to Equation 1 is applied to the pixels in the current luma block 612, the down-sampling method according to Equation 2 is applied to the surrounding 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 surrounding luma pixels located to the left of the current luma block 612. Here, not all combinations of possible embodiments in which the down-sampling method is applied are described, but those skilled in the art will recognize that other combinations of the above-described down-sampling methods can be used.

도 6의 630은 루마 참조 정보 도출 방법의 다른 실시예를 도시한다.630 in FIG. 6 shows 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, a method of deriving luma reference information 636 and 638 when the size of the current luma block 612 is 8x8 and the size of the current chroma block 616 is 4x4 as in 610 of FIG. 6 This is shown.

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

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

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

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

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

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

도 7은 부호화 파라미터를 기반으로 루마 참조 정보를 생성하는 과정의 실시예를 개략적으로 나타내는 도면이다.Figure 7 is a diagram schematically showing 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 represents an embodiment of a method for generating luma reference information 716 and 718 based on the intra prediction mode of the current luma block 712. At 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 surrounding luma reference pixels 718 to be used for prediction of the current chroma block are generated based on pixels in the current luma block 712 and surrounding luma pixels 714. It can be. Since the size of the current chroma block is 4x4, the size of the generated luma reference block 716 may be 4x4.

이 때, 현재 루마 블록(712)의 인트라 예측 모드는 수직(vertical) 모드(722)이므로, 부호화기 및 복호화기는 주변 루마 픽셀들(714) 중에서 현재 루마 블록(712)의 상단에 인접하여 위치한 픽셀들만을 루마 참조 정보(716, 718) 생성에 이용할 수 있다. 따라서, 도 7의 710에서 도출되는 주변 루마 참조 픽셀들(718)은 루마 참조 블록(716)의 상단에 인접하여 위치한 픽셀들일 수 있다.At this time, since the intra prediction mode of the current luma block 712 is the vertical mode 722, the encoder and decoder only use pixels located adjacent to the top of the current luma block 712 among the surrounding luma pixels 714. Can be used to generate luma reference information (716, 718). Accordingly, the peripheral luma reference pixels 718 derived from 710 of FIG. 7 may be pixels 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 horizontal, the encoder and decoder may use only pixels located adjacent to the left of the current luma block among surrounding luma pixels to generate luma reference information. there is. In this case, the derived surrounding luma reference pixels may be pixels located adjacent to the left side of the luma reference block. If the intra prediction mode of the current luma block is DC mode or planar mode, the encoder and decoder can use both pixels located on the left of the current luma block and pixels located on the top of the current luma block to generate luma reference information. In this case, the derived surrounding luma reference pixels may include both pixels located on the left of the luma reference block and pixels located on the top of the luma reference block.

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

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

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

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

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

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

상술한 바와 같이, 현재 루마 블록의 주변에 위치한 주변 루마 픽셀들 중에서는 가용하지 않은(unavailable) 픽셀들이 있을 수 있다. 주변 루마 픽셀이 가용하지 않은 경우로는 현재 루마 블록이 현재 픽쳐의 경계에 인접하여 위치한 경우, 현재 루마 블록이 현재 슬라이스(slice)의 경계에 인접하여 위치한 경우 및 현재 루마 블록에 대해 CIP(Constrained Intra Prediction)가 적용되는 경우 등이 있을 수 있다. As described above, there may be unavailable pixels among surrounding luma pixels located around the current luma block. Cases in which surrounding 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 when CIP (Constrained Intra) is used for the current luma block. There may be cases where prediction) is applied.

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

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

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

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

[수학식 6][Equation 6]

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

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

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

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

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

CIP는 예측 대상 블록의 주변에 위치한 블록들 중에서 인트라 예측에 의해 부호화/복호화되는 블록 내의 픽셀들만을 예측에 이용하는 인트라 예측 방식을 의미할 수 있다. CIP가 적용되는 경우, 인터 예측에 의해 부호화/복호화된 블록 내의 픽셀들은 인트라 예측에 이용되지 않을 수 있다. CIP may refer to an intra prediction method that uses only pixels within a block encoded/decoded by intra prediction among blocks located around the prediction target block for prediction. When CIP is applied, pixels within 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 about whether CIP is applied to the decoder. At this time, the decoder can decide whether to apply CIP based on the flag information. Flag information about whether 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 in FIG. 8, the upper peripheral luma block 824 located at the top of the current luma block 822 is a block encoded/decoded in intra mode, and the left side located to the left of the current luma block 822 The peripheral luma block 826 may be a block encoded/decoded in inter mode. In this case, the peripheral luma pixels 836 located within the left peripheral luma block 826 may correspond to unavailable pixels.

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

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

[수학식 7][Equation 7]

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

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

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

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

[수학식 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 decoder can use the newly filled pixel value to generate luma reference information. That is, the encoder and decoder generate luma reference information based on the pixel values of the available surrounding luma pixels 834, the pixel values of the pixels 836 filled by the padding process, and the pixel values of pixels in the current luma block 822. can be created.

다른 실시예로 도 8의 820에서 부호하기 및 복호화기는 가용하지 않은 주변 루마 픽셀들은 루마 참조 정보 생성에 이용하지 않을 수도 있다. 즉, 부호화기 및 복호화기는 현재 루마 블록 내의 픽셀들 및 가용한 주변 루마 픽셀들을 기반으로 루마 참조 정보를 생성할 수 있다. 예를 들어, 도 8의 820에서는 현재 루마 블록(822) 내의 픽셀들 및 상단 주변 루마 블록(824) 내에 위치한 가용한 주변 루마 픽셀들(834)이 루마 참조 정보 생성에 이용될 수 있다.In another embodiment, the encoder and decoder in 820 of FIG. 8 may not use unavailable surrounding luma pixels to generate luma reference information. That is, the encoder and decoder can generate luma reference information based on pixels in the current luma block and available surrounding luma pixels. For example, in 820 of FIG. 8 , pixels within the current luma block 822 and available surrounding luma pixels 834 located within 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 at 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 along with the above-described embodiments.

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

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

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

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

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

[수학식 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)의 가로 길이 및 세로 길이를 나타낼 수 있다. *173Here, P Y may represent the pixel value of the surrounding luma pixel. Additionally, nS may represent the horizontal and vertical lengths of the current luma block 910.

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

[수학식 10][Equation 10]

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

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

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

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

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

[수학식 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, available pixel b may be located adjacent to the top of the left pixel group, and available pixel a may be located adjacent to the bottom of the left pixel group. Here, pixel a can be represented as P Y [-1, nS+(nS>>1)], and pixel b can be represented as P Y [-1, nS-1].

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

[수학식 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에 의해 나타내어질 수 있다.The pixel values of the surrounding luma pixels on the first left pixel line and the surrounding luma pixels on the first top pixel line may be determined through the above-described padding process. At this time, the encoder and the decoder use luma reference information (luma reference) based on the pixel values of the surrounding luma pixels on the first left pixel line, the surrounding luma pixels on the first top pixel line, and the pixels in the current luma block 910. A block 930 and peripheral luma reference pixels 940) may be generated. However, the surrounding luma pixels present at the position [-1,-1] may not be used to generate luma reference information. In the embodiment of FIG. 9, the luma reference information generation process can be expressed by the following equation (13), for 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 the pixel value of a pixel in the current luma block. Additionally, P Y 'may represent a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a surrounding luma reference pixel).

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

도 10의 실시예는 현재 루마 블록(1010)의 좌측에 가장 가까이 위치한 제1 좌측 픽셀 라인 및 현재 루마 블록(1010)의 상단에 가장 가까이 위치한 제1 상단 픽셀 라인 내의 주변 루마 픽셀들이 루마 참조 정보 생성에 사용되는 경우의 실시예를 도시한다. 도 10의 실시예에서, 현재 루마 블록(1010)의 좌측에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 좌측 픽셀 라인의 좌측에 인접하여 위치한 픽셀 라인은 제2 좌측 픽셀 라인이라 지칭하기로 한다. 또한, 현재 루마 블록(1010)의 상단에 두 번째로 가까이 위치한 픽셀 라인, 즉 제1 상단 픽셀 라인의 상단에 인접하여 위치한 픽셀 라인은 제2 상단 픽셀 라인이라 지칭하기로 한다.10 , the first left pixel line located closest to the left of the current luma block 1010 and the surrounding luma pixels within the first top pixel line located closest to the top of the current luma block 1010 generate luma reference information. An example of when used is shown. In the embodiment of FIG. 10, the pixel line located second closest to the left of the current luma block 1010, that is, the pixel line located adjacent to the left of the first left pixel line, will be referred to as the second left pixel line. Additionally, the pixel line located second closest to the top of the current luma block 1010, that is, the pixel line located adjacent to the top of the first top pixel line, will be referred to as the 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, LM mode may be indicated as Intra_FromLuma. Additionally, in FIG. 10, it is assumed that the size of the current luma block 1010 is 8x8 and the size of the current chroma block is 4x4. As described above, the size of the luma reference block to be used for prediction of the current chroma block may be the same as the size of the current chroma block. Accordingly, the size of the luma reference block 1030 derived in the embodiment of FIG. 10 may be 4x4.

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

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

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

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

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

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

[수학식 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, available pixel b may be located adjacent to the top of the left pixel group, and available pixel a may be located adjacent to the bottom of the left pixel group. Here, pixel a can be represented as P Y [-1, nS+(nS>>1)], and pixel b can be represented as P Y [-1, nS-1].

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

[수학식 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))를 생성할 수 있다. The pixel values of the surrounding luma pixels on the first left pixel line and the surrounding luma pixels on the first top pixel line may be determined through the above-described padding process. The encoder and the decoder generate luma reference information (luma reference block 1030 ) and surrounding luma reference pixels 1040) can be generated.

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

도 10의 실시예에서, 루마 참조 정보 생성 과정은 일례로 다음 수학식 16에 의해 나타내어질 수 있다.In the embodiment of FIG. 10, the luma reference information generation process can be expressed by the following equation (16), for 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 the pixel value of a pixel in the current luma block. Additionally, P Y 'may represent a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a surrounding luma reference pixel).

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

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

도 11의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 11에서 현재 루마 블록(1110)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 11의 실시예에서 도출되는 루마 참조 블록(1130)의 크기는 4x4일 수 있다. In the embodiment of FIG. 11, it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, LM mode may be indicated as Intra_FromLuma. Additionally, 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 peripheral luma pixels 1122, 1124, 1126, and 1128 shown in the embodiment of FIG. 11, the peripheral luma pixels corresponding to 1122 and the peripheral luma pixels corresponding to 1126 are available pixels, It is assumed that the surrounding luma pixels corresponding to 1124 and the surrounding luma pixels corresponding to 1128 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable surrounding luma pixels.

도 11의 실시예에서, 부호화기 및 복호화기는 제1 좌측 픽셀 라인, 제2 좌측 픽셀 라인 및 제1 상단 픽셀 라인 상의 가용하지 않은 주변 루마 픽셀에 대한 패딩 과정을 수행할 수 있다. 그리고, 부호화기 및 복호화기는 제2 좌측 픽셀 라인 상의 주변 루마 픽셀 값들을 제1 좌측 픽셀 라인에 카피할 수 있다. 상술한 과정에 의해 생성되는, 참조 정보 생성에 사용될 주변 루마 픽셀들의 픽셀 값은 다음 수학식 17에 의해 나타내어질 수 있다.In the embodiment of FIG. 11, the encoder and decoder may perform a padding process on unavailable peripheral luma pixels on the first left pixel line, the second left pixel line, and the first top pixel line. Additionally, the encoder and decoder may copy surrounding luma pixel values on the second left pixel line to the first left pixel line. The pixel values of the surrounding luma pixels generated through the above-described process to be used for generating reference information can 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 the pixel value of the surrounding luma pixel belonging to the first left pixel line and/or the first top pixel line. Additionally, nS may represent the horizontal and vertical lengths of the current luma block 1110.

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

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

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

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

[수학식 18][Equation 18]

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

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

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

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

[수학식 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, available pixel e may be located adjacent to the top of the second left pixel group, and available pixel d may be located adjacent to the bottom of the second left pixel group. Here, pixel d can be represented as P Y2 [-2, nS+(nS>>1)], and pixel e can be represented as P Y2 [-2, nS-1].

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

[수학식 20][Equation 20]

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

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

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

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

[수학식 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 pixel line are copied to the first left pixel line, the encoder and decoder output the peripheral luma pixels on the first left pixel line, the peripheral luma pixels on the first top pixel line, and the current luma block. Based on the pixel values of pixels within 1110, luma reference information (luma reference block 1130 and surrounding luma reference pixels 1140) may be generated. In the embodiment of FIG. 11, the luma reference information generation process can be expressed by the following equation 22, for 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 the pixel value of a pixel in the current luma block. Additionally, P Y 'may represent a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a surrounding luma reference pixel).

도 12는 패딩 과정을 수행한 후 루마 참조 정보를 생성하는 과정의 또 다른 실시예를 설명하기 위한 도면이다.FIG. 12 is a diagram illustrating another embodiment of a process for 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 located closest to the left of the current luma block 1210 and the surrounding luma pixels within the first top pixel line located closest to the top of the current luma block 1210 are used to generate luma reference information. An example of use is shown. In the embodiment of FIG. 12 , the pixel line located second closest to the left of the current luma block 1210, that is, the pixel line located adjacent to the left of the first left pixel line, will be referred to as the second left pixel line. Additionally, the pixel line located second closest to the top of the current luma block 1210, that is, the pixel line located adjacent to the top of the first top pixel line, will be referred to as the second top pixel line.

도 12의 실시예에서, 예측 대상이 되는 현재 크로마 블록의 인트라 예측 모드는 LM 모드라 가정한다. 일례로, LM 모드는 Intra_FromLuma로 나타내어질 수 있다. 또한, 도 12에서 현재 루마 블록(1210)의 크기는 8x8이고 현재 크로마 블록의 크기는 4x4라 가정한다. 상술한 바와 같이 현재 크로마 블록의 예측에 사용될 루마 참조 블록의 크기는 현재 크로마 블록의 크기와 동일할 수 있다. 따라서, 도 12의 실시예에서 도출되는 루마 참조 블록(1230)의 크기는 4x4일 수 있다. In the embodiment of FIG. 12, it is assumed that the intra prediction mode of the current chroma block to be predicted is the LM mode. As an example, LM mode may be indicated as Intra_FromLuma. Additionally, 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 peripheral luma pixels 1222, 1224, 1226, and 1228 shown in the embodiment of FIG. 12, the peripheral luma pixels corresponding to 1222 and the peripheral luma pixels corresponding to 1226 are available pixels, It is assumed that the surrounding luma pixels corresponding to 1224 and the surrounding luma pixels corresponding to 1228 are unavailable pixels. In this case, the encoder and decoder may generate luma reference information after performing a padding process on unavailable surrounding luma pixels.

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

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

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

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

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

[수학식 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, available pixel b may be located adjacent to the top of the left pixel group, and available pixel a may be located adjacent to the bottom of the left pixel group. Here, pixel a can be represented as P Y [-1, nS+(nS>>1)], and pixel b can be represented as P Y [-1, nS-1].

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

[수학식 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에 의해 나타내어질 수 있다.The pixel values of the surrounding luma pixels on the first left pixel line and the surrounding luma pixels on the first top pixel line may be determined through the above-described padding process. The encoder and decoder generate luma reference information (luma reference block 1230 ) and peripheral luma reference pixels 1240) can be generated. In the embodiment of FIG. 12, the luma reference information generation process can be expressed by the following equation 25, for 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 the pixel value of a pixel in the current luma block. Additionally, P Y 'may represent a pixel value corresponding to luma reference information (eg, a pixel value of a pixel in a luma reference block and/or a surrounding luma reference pixel).

상술한 내용을 참고하면, 도 12의 실시예에서는 제2 좌측 픽셀 라인 상의 픽셀들은 루마 참조 정보 생성에 사용되지 않고, 제1 좌측 픽셀 라인 상의 주변 루마 픽셀들, 제1 상단 픽셀 라인 상의 주변 루마 픽셀들 및 현재 루마 블록(1210) 내의 픽셀들만이 루마 참조 정보(루마 참조 블록(1230) 및 주변 루마 참조 픽셀들(1240)) 생성에 사용될 수 있다.Referring to the above, in the embodiment of FIG. 12, the pixels on the second left pixel line are not used to generate luma reference information, but the peripheral luma pixels on the first left pixel line and the peripheral luma pixels on the first top pixel line Only pixels within the current luma block 1210 and the current luma block 1210 may be used for generating 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 described above, embodiments where the first color component is a luma component and the second color component is a chroma component are described, but the application of the present invention is not limited thereto. As described above, the present invention can be applied in the same or similar manner to all possible combinations of the first color component and the second color component.

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

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

제1 색 성분 블록이 제2 색 성분 블록보다 작은 크기를 갖거나 동일한 크기를 갖는 경우, 제1 색 성분 블록을 기반으로 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정은 상술한 도 6 내지 도 12의 실시예에서와는 다를 수 있다.When the first color component block has a smaller size or the same size as the second color component block, 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 may be different from the embodiments of FIGS. 6 to 12 described above.

도 13은 제1 색 성분 블록의 크기가 제2 색 성분 블록의 크기보다 작은 경우, 제2 색 성분 블록의 예측에 사용될 제1 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.FIG. 13 is a diagram schematically showing an embodiment of a process for deriving first color component reference information to be used for prediction of the 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 in FIG. 13 illustrates an embodiment of the first color component block 1312, the surrounding first color component pixels 1314, the second color component block 1316, and the surrounding second color component pixels 1318. . Referring to 1310 in FIG. 13, when the size of the second color component block 1316 is 8x8, the size of the corresponding first color component block 1312 may be 4x4. In this case, the encoder and decoder may generate first color component reference pixels corresponding to an 8x8 first color component reference block.

도 13의 1320은 제1 색 성분 참조 정보 도출 방법의 일 실시예를 도시한다.1320 in FIG. 13 shows an example 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, 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 as in 1310 of FIG. 13. 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 decoder generate a first color component to be used for prediction of the second color component block 1316 based on the pixel in the first color component block 1312 and the surrounding first color component pixels 1314. A first color component reference block 1326 and surrounding first color component reference pixels 1328 may be generated. Here, the surrounding first color component pixels 1314 used to derive the first color component reference information are, for example, pixels included in one pixel line located closest to the left of the first color component block 1312, and pixels included in one pixel line located closest to the top of the first color component block 1312.

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

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

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

[수학식 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 restored first color component pixels, that is, pixels within the first color component block 1312 and surrounding first color component pixels 1314. Additionally, 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 색 성분 참조 정보를 도출하는 과정의 실시예를 개략적으로 나타내는 도면이다.FIG. 14 is a diagram schematically showing an embodiment of a process for deriving first color component reference information to be used for prediction of the 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 video format is used, that is, when the color space of the video is RGB 4:4:4 or YUV 4:4:4, the sizes of the luma block and chroma block may be the same. there is. Therefore, 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. Additionally, 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 decoder select a first color component reference block to be used for prediction of the second color component block based on the pixel in the first color component block 1412 and the 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 surrounding first color component pixels 1414 used to derive the first color component reference information are, for example, pixels included in one pixel line located closest to the left of the first color component block 1412, and pixels included in one pixel line located closest to the top of the first color component block 1412.

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

또한, 인트라 모드에서는 변환/양자화 등이 이용되는 손실 부호화/복호화 방식 대신 무손실 부호화/복호화 방식이 적용될 수도 있다. 무손실 부호화/복호화 방식에서는 부호화 대상 블록에 대해 변환 양자화 등의 과정이 적용되지 않을 수 있다. 제1 색 성분 블록(1412)의 크기가 제2 색 성분 블록의 크기와 동일할 때에는, 무손실 부호화/복호화 방식이 적용되는 경우에도, 상술한 실시예에서와 같이 제1 색 성분 참조 정보가 도출될 수 있다. 이 경우, 부호화기 및 복호화기는 제1 색 성분 정보 생성 시에 다운 샘플링, 서브 샘플링 및 업 샘플링 등을 수행하지 않을 수 있다. 생성된 제1 색 성분 참조 블록(1422)은 제2 색 성분 블록에 대응되는 위치에 존재할 수 있다.Additionally, in intra mode, a lossless coding/decoding method may be applied instead of a lossy coding/decoding method that uses transform/quantization, etc. In the lossless encoding/decoding method, processes such as transform quantization may not be applied to the encoding target 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 the lossless encoding/decoding method is applied, the first color component reference information may be derived as in the above-described embodiment. You can. In this case, the encoder and decoder may not perform down-sampling, sub-sampling, or 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 the top peripheral luma pixels located on top of the current luma block and the left peripheral luma pixels located on the left of the current luma block can be used to generate luma reference information. However, the present invention is not limited to this, and surrounding luma pixels used to generate luma reference information may be determined in various ways. For example, only the top peripheral luma pixels may be used to generate luma reference information, and only the left peripheral luma pixels may be used to generate luma reference information. Additionally, surrounding luma pixels used to generate luma reference information may be determined according to the intra prediction mode of the current luma block.

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

*305도 15의 실시예에서, 현재 루마 블록(1512)의 크기는 8x8이고 이에 대응되는 현재 크로마 블록의 크기는 4x4라 가정한다. 일례로, 도 15는 YUV 4:2:0의 영상 포맷이 이용되는 경우의 실시예에 해당될 수 있다. 또한, 도 15에 도시된 주변 루마 픽셀들(A, B, C, D, E, F)에는 상술한 패딩 과정을 통해 이미 픽셀 값이 채워져 있다고 가정한다. 그리고, 도 15에서는 상술한 도 4의 410에서와 같은 인트라 예측 모드의 모드 값이 사용된다고 가정한다.In the embodiment of *305 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, Figure 15 may correspond to an embodiment when the video format of YUV 4:2:0 is used. Additionally, it is assumed that the surrounding luma pixels (A, B, C, D, E, F) shown in FIG. 15 are already filled with pixel values through the padding process described above. And, in FIG. 15, it is assumed that the mode value of the intra prediction mode as in 410 of FIG. 4 described above 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 surrounding luma pixels (A, B, C, D, E, F) and pixels in the current luma block 1512, a luma reference block ( 1522, 1532 or 1542) and surrounding luma reference pixels 1524, 1534 or 1544 may be generated. At this time, 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, surrounding luma pixels to be used for generating luma reference information may be obtained, for example, by at least one of the combinations shown in Table 3 below.

[표 3][Table 3]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[수학식 27][Equation 27]

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

[표 4][Table 4]

수학식 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 derivation process, unavailable pixels may exist among the peripheral luma reference pixels 1620 and/or the peripheral chroma pixels 1640. In this case, for example, the encoder and decoder may derive prediction parameters based only on available pixels among the surrounding luma reference pixels 1620 and/or the surrounding chroma pixels 1640.

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

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

[수학식 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 represent the predicted value of a pixel in the current chroma block 1630. Additionally, clip(x,y,z) can be x if z is less than x, y if z is greater than y, and z otherwise.

도 17은 본 발명에 따른 복호화 과정의 일 실시예를 개략적으로 나타내는 흐름도이다.Figure 17 is a flowchart schematically showing an embodiment of the 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 the pixel value of the surrounding luma pixel used for prediction of the current luma block. Additionally, N Y may represent the horizontal and vertical lengths of the current luma block, and P LM may represent the pixel value of the surrounding luma pixel used to generate luma reference information in 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 Figure 17 is described based on the luma component (Y). However, the present invention is not limited to this, and the embodiment of FIG. 17 can be applied to the chroma components (U, V) rather than the luma component (Y) in the same or similar manner as the luma component. Additionally, in this case, P 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 color component of the current block corresponds to Y, U, or V. For example, if the color component of the current block is Y, cIdx may be assigned 0, if the color component of the current block is U, cIdx may be assigned 1, and if the color component of the current block is V, cIdx may be assigned 2 may be assigned. The relationship between variables applied to the embodiment of FIG. 17 according to color components can be shown, for example, in Table 5 below.

[표 5][Table 5]

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

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

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

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

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

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

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

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

또한, 일례로 PLM 에 대한 마킹 과정이 수행된 후 부호화기 및 복호화기는 PLM[x,y], (x=-1, y=0~NY*2-1)에 해당되는 픽셀들 중에서 가용한 것으로 판별된 픽셀들의 픽셀 값을 [x-1,y] 위치의 루마 픽셀 값으로 대체할 수도 있다. In addition, for example, after the marking process for P LM is performed, the encoder and decoder select available pixels from among 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 correct may be replaced 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 again to FIG. 17, the encoder and decoder may determine whether condition C is satisfied for the surrounding 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) This condition indicates that the pixels in are 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 the surrounding luma pixels to be used for prediction of the current luma block is not available, the encoder and decoder perform P Y [x,y], (x=-1, y= A padding process can be performed on pixels that are not available among -1~N Y *2-1 and x=0~N Y *2-1, y=-1) (S1750). Since embodiments of the padding process have been described above, detailed description thereof will be omitted here.

다시 도 17을 참조하면, 부호화기 및 복호화기는 루마 참조 정보 생성에 사용될 주변 루마 픽셀들에 대해 조건 A, B 및 D가 만족되는지 여부를 판단할 수 있다(S1760). 여기서, 조건 D는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring again to FIG. 17, the encoder and decoder may determine whether conditions A, B, and D are satisfied for the surrounding 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) This condition indicates that the pixels in are not available.

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

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

도 18은 도 17의 실시예에서와 같이 복호화 과정이 수행되는 경우, 현재 크로마 블록에 대한 루마 참조 정보 및 예측 파라미터를 도출하는 과정의 실시예를 설명하기 위한 도면이다.FIG. 18 is a diagram illustrating an embodiment of a process for deriving luma reference information and prediction parameters for the 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일 수 있다.Figure 18 shows the luma component block 1810 to be predicted, the surrounding luma pixels 1820 (P Y ) used for prediction of the luma component block, the restored current luma block 1830 (P RecY ), and the luma reference information generation. It shows the surrounding luma pixels (1840, P LM ) being used, the current chroma block (1850), and the surrounding chroma pixels (1860, P C ). In the embodiment of FIG. 18, the size of the luma component block 1810 to be predicted and the reconstructed current luma block 1830 (P RecY ) may be 8x8, and the size of the current chroma block 1850 may be 4x4.

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

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

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

복원된 현재 루마 블록(1830)의 상단에 위치한 주변 루마 픽셀들에 대해서는 일례로 다음 수학식 29에 의해 다운 샘플링 과정이 수행될 수 있다.For example, a down-sampling process may be performed on surrounding luma pixels located at the top of the restored current luma block 1830 according to 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 represent the pixel value of a pixel corresponding to luma reference information (eg, a pixel within a luma reference block or a surrounding luma reference pixel). Additionally, P LM may represent the pixel value of the peripheral luma pixel 1840 to be used to generate luma reference information. And, N C may represent the horizontal and vertical lengths of the current chroma block 1850.

복원된 현재 루마 블록(1830)의 좌측에 위치한 주변 루마 픽셀들에 대해서는 일례로 다음 수학식 30에 의해 다운 샘플링 과정이 수행될 수 있다.For example, a down-sampling process may be performed on surrounding luma pixels located to the left of the restored current luma block 1830 according to 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 example, a down-sampling process may be performed on pixels in the restored current luma block 1830 according to Equation 31 below. A luma reference block corresponding to the current chroma block 1850 can be generated using 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 the pixel value of a pixel in the current luma block 1830.

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

[수학식 32][Equation 32]

여기서, PC는 루마 참조 정보 생성에 사용될 주변 크로마 픽셀(1860)의 픽셀 값을 나타낼 수 있고, 'Bitdepth'는 크로마 성분 픽셀의 비트 심도를 나타낼 수 있다. Here, P C may represent the pixel value of the surrounding chroma pixel 1860 to be used for generating luma reference information, and 'Bitdepth' may represent the bit depth of the 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, detailed description thereof will be omitted here. However, in this case, in the embodiment of Equation 27, nS can be replaced with N C , p1 can be replaced with P Y ', and p2 can be replaced with P C.

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

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

도 19a는 본 발명에 따른 복호화 과정의 실시예를 나타낸다. 또한, 도 19b는 하나의 CU(1990)가 쿼드 트리 구조(quad-tree structure)를 기반으로 복수의 TU로 분할된 것을 나타낸다.Figure 19a shows an embodiment of the decryption process according to the present invention. Additionally, Figure 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]는 서로 동일한 값을 가질 수 있다.In the embodiments of FIGS. 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 NY , NU , or N V. Here, P Y may represent the pixel value of the surrounding luma pixel used for prediction of the current luma block. Additionally, P U and P V may represent pixel values of surrounding chroma pixels used for prediction of the current chroma block. Here, P U and P V may be expressed as P C . Additionally, N Y may represent the horizontal and vertical lengths of the current luma block, and N U and N V may represent the horizontal and vertical lengths of the current chroma block. Here, N U and N V may also be expressed as N C. In the embodiment of FIG. 19, P LM may represent a pixel value of a surrounding luma pixel used to generate luma reference information in LM mode. Here, P Y [x,y] and P LM [x,y] may have the same value.

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

[표 6][Table 6]

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

또한, 도 19의 실시예는 일례로 하나의 CU에서 색 공간을 구성하는 각각의 색 성분에 대해, Y 성분, U(Cb) 성분, V(Cr) 성분의 순서로 적용될 수 있다. Additionally, the embodiment of FIG. 19 may be applied in the order of the Y component, U(Cb) component, and V(Cr) component to each color component constituting the 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) can be divided into a plurality of TUs (1, 2, 3, 4, 5, 6, 7) based on a quad tree structure. At this time, the encoder and decoder may first perform a decoding process according to the embodiment of FIG. 19A on the Y component blocks within the CU (1990). Additionally, the encoder and decoder may sequentially perform the decoding process on the U component blocks and V component blocks within the CU 1990 according to the embodiment of FIG. 19A. For example, the decoding process according to the embodiment of Figure 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 Figure 19a, the encoder and decoder are P k [x,y], (x=-1, y=-1~N k *2-1 and x=0~N k *2-1, y=- 1) can be marked by checking whether it is available (S1910). As described above, marking may refer to the process of storing or displaying information about availability. Embodiments in which peripheral luma pixels are not available have been described above in the embodiment of FIG. 8, so detailed description thereof will be omitted here.

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 A, 조건 B 및 조건 C가 만족되는지 여부를 판단할 수 있다(S1920). Referring again to FIG. 19A, the encoder and decoder can 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 LM mode can be applied to intra prediction of the current chroma block. For 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 LM mode can be supported for intra prediction of the current chroma block. Additionally, condition B is a condition indicating that the intra prediction mode of the current block is LM mode. Here, for example, LM mode may be represented as Intra_FromLuma. Additionally, condition C is a condition indicating that the current block is a chroma component block (U(Cb) or V(Cr)). As an example, condition C may be satisfied when 1 or 2 is assigned to cIdx.

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

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

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

또한 이 때 일 실시예로, 부호화기 및 복호화기는 주변 루마 픽셀들에 대응되는 주변 크로마 픽셀, 즉 PU 또는 PV의 가용성을 기반으로 PLM이 가용한지 여부를 체크할 수 있다. 이 때, PU 또는 PV가 가용한지 여부는 S1910 단계에서 이미 마킹되어 있을 수 있다. 일례로, 부호화기 및 보호화기는 PU에 해당되는 픽셀이 가용한지 여부를 기반으로 PLM이 가용한지 여부를 판단할 수 있다.Also, in this case, in one embodiment, the encoder and decoder may check whether P LM is available based on the availability of neighboring chroma pixels, that is, P U or P V , corresponding to neighboring luma pixels. At this time, whether P U or P V is available may already be marked in step S1910. For example, the encoder and protector can determine whether P LM is available based on whether the 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 use the surrounding luma pixel P LM [x ,2y] and P LM [x,2y+1] can also be determined to be unavailable. On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x=-1, y=0~N U *2-1, the encoder and decoder select the surrounding luma pixel P LM [x,2y] and P LM [x,2y+1] can also be determined to be available.

이 때, 부호화기 및 복호화기는 [x-1,2y] 및 [x-1,2y+1]에 위치한 루마 픽셀 값을 각각 PLM[x,2y] 및 PLM[x,2y+1]에 할당할 수 있다. 따라서, 주변 루마 픽셀이 현재 루마 블록의 좌측에 인접하여 위치한 좌측 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀의 좌측에 인접하여 위치한 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.At this time, the encoder and decoder assign luma pixel values located at [x-1,2y] and [x-1,2y+1] to P LM [x,2y] and P LM [x,2y+1], respectively. can do. Therefore, if the surrounding luma pixel is a pixel on the left pixel line located adjacent to the left of the current luma block, and it is determined that the surrounding luma pixel is available, the pixel value of the luma pixel located adjacent to the left of the surrounding luma pixel is the surrounding luma pixel. It can be determined by the pixel value of the 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]도 가용한 것으로 판단할 수 있다. Additionally, 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 decoder use the surrounding luma pixel P LM [2x,y ] and P LM [2x+1,y] can also be determined to be unavailable. On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x=0~N U *2-1, y=-1, the encoder and decoder select the surrounding luma pixel P LM [2x,y] and P LM [2x+1,y] can also be determined to be available.

이 때, 부호화기 및 복호화기는 [2x,y] 및 [2x+1,y]에 위치한 루마 픽셀 값을 각각 PLM[2x,y] 및 PLM[2x+1,y]에 할당할 수 있다. 따라서, 주변 루마 픽셀이 현재 루마 블록의 상단에 인접하여 위치한 상단 픽셀 라인상의 픽셀이고 상기 주변 루마 픽셀이 가용한 것으로 결정된 경우, 상기 주변 루마 픽셀과 동일한 위치의 루마 픽셀의 픽셀 값이 상기 주변 루마 픽셀의 픽셀 값으로 결정될 수 있다.At this time, the encoder and decoder may assign luma pixel values located at [2x,y] and [2x+1,y] to P LM [2x,y] and P LM [2x+1,y], respectively. Therefore, if the surrounding luma pixel is a pixel on the top pixel line located adjacent to the top of the current luma block, and the surrounding luma pixel is determined to be available, the pixel value of the luma pixel at the same location as the surrounding luma pixel is the surrounding luma pixel. It can 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]도 가용한 것으로 판단할 수 있다. Additionally, if the surrounding chroma pixel P U [x,y] is marked as unavailable for x=-1, y=-1, the encoder and decoder mark the surrounding luma pixel P LM [x,y] as unavailable. You can judge. On the other hand, if the surrounding chroma pixel P U [x,y] is marked as available for x=-1, y=-1, the encoder and decoder may determine that the surrounding luma pixel P LM [x,y] is also available. You can.

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

상술한 실시예에서는 PU를 기반으로 PLM이 가용한지 여부를 체크하는 과정이 서술되고 있지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, PLM이 가용한지 여부는 PV를 기반으로 체크될 수도 있다.In the above-described embodiment, a process of checking whether P LM is available based on P U is described, but the present invention is not limited to this. 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 again to FIG. 19A, the encoder and decoder can determine whether condition D is satisfied (S1940). Here, condition D is at least one of P k [x,y], (x=-1, y=-1~N k *2-1 and x=0~N k *2-1, y=-1) This condition indicates that the pixels in are not available.

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

다시 도 19a를 참조하면, 부호화기 및 복호화기는 조건 A, 조건 B, 조건 C 및 조건 E가 만족되는지 여부를 판단할 수 있다(S1960). 여기서, 조건 E는 PLM[x,y], (x=-1, y=-1~NY*2-1 및 x=0~NY*2-1, y=-1) 중에서 적어도 하나의 픽셀이 가용하지 않음을 나타내는 조건이다.Referring again to FIG. 19A, the encoder and decoder can determine whether condition A, condition B, condition C, and condition E are satisfied (S1960). Here, condition E is at least one of P LM [x,y], (x=-1, y=-1~N Y *2-1 and x=0~N Y *2-1, y=-1) This condition indicates that the pixels in are 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 are P LM [x,y], (x=-1, y=-1~N Y *2-1, and x=0~ A padding process can be performed on unavailable pixels among N Y *2-1, y=-1) (S1970). Since specific embodiments of the padding process have been described above, detailed description thereof will be omitted here.

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

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

상술한 실시예들에서, 방법들은 일련의 단계 또는 블록으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described embodiments, the methods are described based on flowcharts 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 simultaneously with other steps as described above. You can. Additionally, a person of ordinary skill in the art will recognize that the steps shown in the flowchart are not exclusive and that other steps may be included or one or more steps in 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. Although it is not possible to describe all possible combinations for representing the various aspects, those skilled in the art will recognize that other combinations are possible. Accordingly, the present invention is intended to include all other substitutions, modifications and changes falling within the scope of the following claims.

Claims (9)

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

Priority Applications (1)

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

Applications Claiming Priority (11)

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

Related Parent Applications (1)

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

Related Child Applications (1)

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

Publications (2)

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

Family

ID=48661126

Family Applications (6)

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

Family Applications Before (4)

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

Family Applications After (1)

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

Country Status (1)

Country Link
KR (6) KR20130050900A (en)

Families Citing this family (11)

* 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
WO2017034331A1 (en) * 2015-08-27 2017-03-02 엘지전자 주식회사 Method and device for chroma sample intra prediction in video coding system
WO2018070713A1 (en) * 2016-10-11 2018-04-19 엘지전자(주) 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
CN114600466A (en) 2019-08-29 2022-06-07 Lg电子株式会社 Image encoding apparatus and method based on cross component filtering
KR20220050088A (en) * 2019-08-29 2022-04-22 엘지전자 주식회사 Cross-component adaptive loop 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
WO2013006986A1 (en) * 2011-07-12 2013-01-17 Intel Corporation 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
KR20210079254A (en) 2021-06-29
KR102449210B1 (en) 2022-09-29
KR102409444B1 (en) 2022-06-15
KR20130050900A (en) 2013-05-16
KR20220133170A (en) 2022-10-04
KR102489735B1 (en) 2023-01-18
KR20230165180A (en) 2023-12-05
KR20220083654A (en) 2022-06-20
KR20230013146A (en) 2023-01-26

Similar Documents

Publication Publication Date Title
KR102607887B1 (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
CN108028940B (en) Limiting escape pixel signal values in palette mode video coding
JP2019004491A (en) Image encoding/decoding method and apparatus for the same
TW201830964A (en) Deriving bilateral filter information based on a prediction mode in video coding
WO2019076138A1 (en) Encoding method and apparatus
CN117528097A (en) Cross-component adaptive loop filter
KR20210125088A (en) Encoders, decoders and corresponding methods harmonizing matrix-based intra prediction and quadratic transform core selection
CN115428449A (en) Cross-component adaptive loop filter
KR20220080738A (en) Image encoding/decoding method, apparatus, and bitstream transmission method using lossless color conversion
EP3649777A1 (en) Division-free bilateral filter
JP2023100834A (en) Method and apparatus of mode- and size-dependent block-level restriction
WO2021045654A9 (en) Method and apparatus of filtering for cross-component linear model prediction
KR102349435B1 (en) The method of encoding and decoding of quantization matrix and the apparatus for using the same
CN116325734A (en) Chroma codec enhancement in cross-component sample adaptive offset with virtual boundaries
US20230319315A1 (en) Coding enhancement in cross-component sample adaptive offset
KR20220065880A (en) Use of DCT-based interpolation filters and enhanced bilinear interpolation filters in affine motion compensation
CN113647103A (en) Method and apparatus for quantizing coefficients for matrix-based intra prediction techniques
WO2013069972A1 (en) Method for intra-prediction and device thereof
JP7408834B2 (en) Method and apparatus for video filtering
RU2809192C2 (en) Encoder, decoder and related methods of interframe prediction
RU2785816C2 (en) Position-dependent intra-prediction combination expanded with angular modes
CN117596409A (en) Method, apparatus and computer readable storage medium for processing video data
KR20220131225A (en) Method and apparatus for video coding
JP2024510600A (en) Adaptive application of generalized sample offset

Legal Events

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