KR20190112249A - Method and apparatus for image encoding/decoding - Google Patents

Method and apparatus for image encoding/decoding Download PDF

Info

Publication number
KR20190112249A
KR20190112249A KR1020190033765A KR20190033765A KR20190112249A KR 20190112249 A KR20190112249 A KR 20190112249A KR 1020190033765 A KR1020190033765 A KR 1020190033765A KR 20190033765 A KR20190033765 A KR 20190033765A KR 20190112249 A KR20190112249 A KR 20190112249A
Authority
KR
South Korea
Prior art keywords
block
prediction
mode
pixel
reference pixel
Prior art date
Application number
KR1020190033765A
Other languages
Korean (ko)
Inventor
김기백
Original Assignee
김기백
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 김기백 filed Critical 김기백
Publication of KR20190112249A publication Critical patent/KR20190112249A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • 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/124Quantisation
    • 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

Abstract

A prediction method in a screen according to the present invention may identify a reference pixel area designated for obtaining correlation information, determine reference pixel processing setting based on the availability determination of the reference pixel area, and perform prediction in a screen according to the determined reference pixel processing.

Description

영상 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR IMAGE ENCODING/DECODING}Image Encoding / Decoding Method and Apparatus {METHOD AND APPARATUS FOR IMAGE ENCODING / DECODING}

본 발명은 영상 부호화/복호화 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for image encoding / decoding.

최근 HD(High Definition) 영상 및 UHD(Ultra High Definition) 영상과 같은 고해상도, 고품질의 영상에 대한 수요가 다양한 응용 분야에서 증가하고 있고, 이에 따라 고효율의 영상 압축 기술들이 논의되고 있다.Recently, the demand for high resolution and high quality images such as high definition (HD) and ultra high definition (UHD) images is increasing in various applications, and high efficiency image compression technologies are being discussed.

영상 압축 기술로 현재 픽쳐의 이전 또는 이후 픽쳐로부터 현재 픽쳐에 포함된 화소값을 예측하는 화면간 예측 기술, 현재 픽쳐 내의 화소 정보를 이용하여 현재 픽쳐에 포함된 화소값을 예측하는 화면내 예측 기술, 출현 빈도가 높은 값에 짧은 부호를 할당하고 출현 빈도가 낮은 값에 긴 부호를 할당하는 엔트로피 부호화 기술 등 다양한 기술이 존재하고 이러한 영상 압축 기술을 이용해 영상 데이터를 효과적으로 압축하여 전송 또는 저장할 수 있다.An inter-screen prediction technique for predicting pixel values included in the current picture from a picture before or after the current picture using an image compression technology, an intra-prediction technology for predicting pixel values included in the current picture using pixel information in the current picture, Various techniques exist, such as an entropy encoding technique for allocating a short code to a high frequency of appearance and a long code to a low frequency of appearance, and the image data can be effectively compressed and transmitted or stored.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은 참조 화소의 사용 가능성에 기반하여 화면내 예측을 수행하는 영상 부호화/복호화 방법 및 장치를 제공하는데 있다.An object of the present invention for solving the above problems is to provide an image encoding / decoding method and apparatus for performing intra prediction based on the availability of a reference pixel.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 화면내 예측을 수행하는 방법은 상관성 정보 획득을 위해 지정된 참조 화소 영역을 확인하는 단계, 참조 화소 영역의 사용 가능성 판단에 기반하여 참조 화소 처리 설정을 결정하는 단계, 결정된 참조 화소 처리 설정에 따른 화면내 에측을 수행하는 단계를 포함할 수 있다.According to an aspect of the present invention, there is provided a method of performing intra prediction according to an embodiment of the present invention. The method may include: identifying a reference pixel region designated for obtaining correlation information, and setting reference pixel processing based on a determination of the availability of the reference pixel region. The method may include determining an image, and performing an intra prediction based on the determined reference pixel processing setting.

상기와 같은 본 발명의 참조 화소의 사용 가능성에 기반하여 화면내 예측을 수행하는 방법을 이용하는 경우 부호화 성능을 향상시킬 수 있다.In the case of using the method of performing intra prediction based on the availability of the reference pixel of the present invention as described above, encoding performance may be improved.

도 1은 본 발명의 실시예에 따른 영상 부호화 및 복호화 시스템에 대한 개념도이다.
도 2는 본 발명의 일 실시예에 따른 영상 부호화 장치에 대한 블록 구성도이다.
도 3은 본 발명의 일 실시예에 따른 영상 복호화 장치에 대한 블록 구성도이다.
도 4는 본 발명의 일 실시예에 따른 화면내 예측 모드를 나타낸 예시도이다.
도 5는 본 발명의 일 실시예에 따른 방향성 모드와 비방향성 모드에 관한 화면내 예측을 나타내는 개념도이다.
도 6은 본 발명의 일 실시예에 따른 컬러 복사 모드에 관한 화면내 예측을 나타내는 개념도이다.
도 7은 본 발명의 일 실시예에 따른 컬러 복사 모드와 관련하여 각 컬러 공간의 대응되는 블록과 그에 인접한 영역을 나타내는 예시도이다.
도 8은 본 발명의 일 실시예에 따른 컬러 복사 모드의 상관성 정보 획득을 위한 영역 설정에 관한 예시도이다.
도 9는 본 발명의 일 실시예에 따른 화면내 예측에 사용되는 참조 화소 구성을 설명하기 위한 예시도이다.
도 10은 본 발명의 일 실시예에 따른 화면내 예측의 대상 블록과 인접한 블록을 나타내는 개념도이다.
도 11은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 참조 화소 사용 가능성을 설명하기 위한 예시도이다.
도 12는 본 발명의 일 실시예에 따른 컬러 복사 모드에서 참조 화소 사용 가능성을 설명하기 위한 예시도이다.
도 13은 본 발명의 일 실시예에 따른 컬러 복사 모드에서 참조 화소 사용 가능성을 설명하기 위한 예시도이다.
도 14는 본 발명의 일 실시예에 따른 컬러 복사 모드의 화면내 예측 방법을 설명한 순서도이다.
도 15는 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다.
도 16은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다.
도 17은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다.
도 18은 본 발명의 일 실시예에 따른 컬러 복사 모드에 보정을 수행하는 과정의 순서도이다.
도 19는 본 발명의 일 실시예에 따른 보정 대상 화소에 적용되는 필터의 종류를 설명하기 위한 예시도이다.
도 20은 본 발명의 일 실시예에 따른 보정 대상 화소에 적용되는 필터의 종류를 설명하기 위한 예시도이다.
1 is a conceptual diagram of an image encoding and decoding system according to an embodiment of the present invention.
2 is a block diagram of a video encoding apparatus according to an embodiment of the present invention.
3 is a block diagram of an image decoding apparatus according to an embodiment of the present invention.
4 is an exemplary diagram illustrating an intra prediction mode according to an embodiment of the present invention.
5 is a conceptual diagram illustrating in-screen prediction of a directional mode and a non-directional mode according to an embodiment of the present invention.
6 is a conceptual diagram illustrating an intra prediction according to a color copy mode according to an embodiment of the present invention.
FIG. 7 is an exemplary diagram illustrating a corresponding block of each color space and an area adjacent thereto in relation to a color copy mode according to an embodiment of the present invention.
8 is an exemplary diagram for setting a region for obtaining correlation information of a color copy mode according to an embodiment of the present invention.
9 is an exemplary diagram for describing a configuration of a reference pixel used for intra prediction according to an embodiment of the present invention.
10 is a conceptual diagram illustrating a block adjacent to a target block of intra prediction according to an embodiment of the present invention.
11 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention.
12 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention.
13 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention.
14 is a flowchart illustrating an intra prediction method of a color copy mode according to an embodiment of the present invention.
15 is an exemplary diagram for describing prediction in color copy mode according to an embodiment of the present invention.
16 is an exemplary diagram for describing prediction in color copy mode according to an embodiment of the present invention.
17 is an exemplary diagram for explaining prediction in color copy mode according to an embodiment of the present invention.
18 is a flowchart of a process of performing correction in a color copy mode according to an embodiment of the present invention.
19 is an exemplary diagram for describing a type of filter applied to a correction target pixel according to an exemplary embodiment of the present invention.
20 is an exemplary diagram for describing a type of filter applied to a correction target pixel according to an exemplary embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.As the present invention allows for various changes and numerous embodiments, particular embodiments will be illustrated in the drawings and described in detail in the written description. However, this is not intended to limit the present invention to specific embodiments, it should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다. Terms such as first, second, A, and B may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes a combination of a plurality of related items or any item of a plurality of related items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.

본 발명에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 발명에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In the present invention, the terms "comprise" or "have" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 것을 의미한다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 것으로 해석되어야 하며, 본 발명에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, mean the same as generally understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed in accordance with their meaning in the context of the related art and should not be construed in an ideal or excessively formal sense unless explicitly defined in the present invention.

통상적으로 영상의 컬러 포맷(Color Format)에 따라 하나 이상의 컬러 공간으로 구성될 수 있다. 컬러 포맷에 따라 일정 크기를 갖는 1개 이상의 픽쳐 또는 다른 크기를 갖는 1개 이상의 픽쳐로 구성될 수 있다. 일 예로, YCbCr 컬러 구성에서 4:4:4, 4:2:2, 4:2:0, Monochrome(Y로만 구성) 등의 컬러 포맷이 지원될 수 있다. 일 예로, YCbCr 4:2:0인 경우 1개의 휘도 성분(본 예에서, Y)과 2개의 색차 성분(본 예에서, Cb/Cr)으로 구성될 수 있으며, 이때 색차 성분과 휘도 성분의 구성 비는 가로, 세로 1:2를 가질 수 있다. 일 예로, 4:4:4인 경우 가로, 세로 동일한 구성 비를 가질 수 있다. 상기 예처럼 하나 이상의 컬러 공간으로 구성이 되는 경우 픽쳐는 각 컬러 공간으로의 분할을 수행할 수 있다.Typically, one or more color spaces may be configured according to a color format of an image. It may consist of one or more pictures with a certain size or one or more pictures with other sizes, depending on the color format. For example, in the YCbCr color configuration, color formats such as 4: 4: 4, 4: 2: 2, 4: 2: 0, and Monochrome (only Y) may be supported. For example, in the case of YCbCr 4: 2: 0, one luminance component (Y in this example) and two chrominance components (Cb / Cr in this example) may be configured, wherein the chrominance component and the luminance component are configured. The ratio may have a length of 1: 2. For example, 4: 4: 4 may have the same ratio of width and length. When the picture is composed of one or more color spaces as described above, the picture may be divided into each color space.

영상은 영상 타입(예를 들어, 픽쳐 타입, 슬라이스 타입, 타일 타입 등)에 따라 I, P, B 등으로 분류할 수 있는데, I 영상 타입은 참조 픽쳐를 사용하지 않고 자체적으로 부/복호화되는 영상을 의미할 수 있고, P 영상 타입은 참조 픽쳐를 사용하여 부/복호화를 하되 전방향 예측만을 허용하는 영상을 의미할 수 있으며, B 영상 타입은 참조 픽쳐를 사용하여 부/복호화를 하며 전/후방향 예측을 허용하는 영상을 의미할 수 있으나, 부/복호화 설정에 따라 상기 타입의 일부가 결합(P와 B를 결합)되거나 다른 구성의 영상 타입이 지원될 수도 있다.Images can be classified into I, P, B, etc. according to the image type (eg, picture type, slice type, tile type, etc.). The I image type is an image which is encoded / decoded by itself without using a reference picture. The P image type may mean an image that is encoded / decoded using a reference picture but allows only omnidirectional prediction, and the B image type may be encoded / decoded by using a reference picture. Although it may mean an image that allows direction prediction, a part of the type may be combined (P and B are combined) or another type of image type may be supported according to the encoding / decoding setting.

도 1은 본 발명의 실시예에 따른 영상 부호화 및 복호화 시스템에 대한 개념도이다.1 is a conceptual diagram of an image encoding and decoding system according to an embodiment of the present invention.

도 1을 참조하면, 영상 부호화 장치(105) 및 복호화 장치(100)는 개인용 컴퓨터(PC:Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 무선 통신 단말기(Wireless Communication Terminal), 스마트폰(Smart Phone) 또는 TV 등과 같은 사용자 단말기이거나 응용 서버와 서비스 서버 등 서버 단말기일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 부호화 또는 복호화를 위해 인터 또는 인트라 예측하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리(memory, 120, 125) 또는 프로그램을 실행하여 연산 및 제어하기 위한 프로세서(processor, 110, 115) 등을 구비하는 다양한 장치를 포함할 수 있다. Referring to FIG. 1, the video encoding apparatus 105 and the decoding apparatus 100 may include a personal computer (PC), a notebook computer, a personal digital assistant (PDA), and a portable multimedia player (PMP). Player), PlayStation Portable (PSP: PlayStation Portable), wireless communication terminal (Wireless Communication Terminal), smart phone (Smart Phone) or a user terminal such as a TV, or a server terminal such as an application server and a service server, etc. A communication device such as a communication modem for communicating with a wired / wireless communication network, a memory (memory, 120, 125) or a program for storing various programs and data for inter or intra prediction for encoding or decoding an image and executing the operation And various devices including processors (processors 110 and 115) for controlling.

또한, 영상 부호화 장치(105)에 의해 비트스트림으로 부호화된 영상은 실시간 또는 비실시간으로 인터넷, 근거리 무선 통신망, 무선랜망, 와이브로망 또는 이동통신망 등의 유무선 통신망(Network) 등을 통하거나 케이블 또는 범용 직렬 버스(USB: Universal Serial Bus) 등과 같은 다양한 통신 인터페이스를 통해 영상 복호화 장치(100)로 전송되어 영상 복호화 장치(100)에서 복호화되어 영상으로 복원되고 재생될 수 있다. 또한, 영상 부호화 장치(105)에 의해 비트스트림으로 부호화된 영상은 컴퓨터 판독 가능한 기록 매체를 통하여 영상 부호화 장치(105)에서 영상 복호화 장치(100)로 전달될 수 있다.In addition, the image encoded in the bitstream by the image encoding apparatus 105 is real-time or non-real-time via the wired or wireless communication network (Network), such as the Internet, local area wireless communication network, wireless LAN network, WiBro network or mobile communication network, or cable or general purpose The image decoding apparatus 100 may be transmitted to the image decoding apparatus 100 through various communication interfaces such as a universal serial bus (USB), and may be decoded by the image decoding apparatus 100 to restore and reproduce the image. Also, an image encoded in the bitstream by the image encoding apparatus 105 may be transferred from the image encoding apparatus 105 to the image decoding apparatus 100 through a computer-readable recording medium.

전술한 영상 부호화 장치와 영상 복호화 장치는 각각 별도의 장치들일 수 있으나, 구현에 따라서 하나의 영상 부호화/복호화 장치로 만들어질 수 있다. 그 경우, 영상 부호화 장치의 일부 구성은 영상 복호화 장치의 일부 구성과 실질적으로 동일한 기술요소로서 적어도 동일한 구조를 포함하거나 적어도 동일한 기능을 수행하도록 구현될 수 있다.The above-described image encoding apparatus and the image decoding apparatus may be separate apparatuses, but may be made of one image encoding / decoding apparatus according to implementation. In this case, some components of the image encoding apparatus may be implemented to include at least the same structure or to perform at least the same function as substantially the same technical elements as some components of the image decoding apparatus.

따라서, 이하의 기술요소들과 이들의 작동 원리 등에 대한 상세 설명에서는 대응 기술요소들의 중복되는 설명을 생략하기로 한다. 또한, 영상 복호화 장치는 영상 부호화 장치에서 수행되는 영상 부호화 방법을 복호화에 적용하는 컴퓨팅 장치에 대응하므로, 이하의 설명에서는 영상 부호화 장치를 중심으로 설명하기로 한다.Therefore, in the following detailed description of the technical elements and their operation principle, overlapping description of the corresponding technical elements will be omitted. Also, since the image decoding apparatus corresponds to a computing device applying the image encoding method performed by the image encoding apparatus to the decoding, the following description will focus on the image encoding apparatus.

컴퓨팅 장치는 영상 부호화 방법 및/또는 영상 복호화 방법을 구현하는 프로그램이나 소프트웨어 모듈을 저장하는 메모리와 메모리에 연결되어 프로그램을 수행하는 프로세서를 포함할 수 있다. 여기서, 영상 부호화 장치는 부호화기로, 영상 복호화 장치는 복호화기로 각각 지칭될 수 있다.The computing device may include a memory for storing a program or a software module for implementing an image encoding method and / or an image decoding method, and a processor connected to the memory and executing a program. Here, the image encoding apparatus may be referred to as an encoder, and the image decoding apparatus may be referred to as a decoder.

도 2는 본 발명의 일 실시예에 따른 영상 부호화 장치에 대한 블록 구성도이다.2 is a block diagram of a video encoding apparatus according to an embodiment of the present invention.

도 2를 참조하면, 영상 부호화 장치(20)는 예측부(200), 감산부(205), 변환부(210), 양자화부(215), 역양자화부(220), 역변환부(225), 가산부(230), 필터부(235), 부호화 픽쳐 버퍼(240) 및 엔트로피 부호화부(245)를 포함할 수 있다.Referring to FIG. 2, the image encoding apparatus 20 may include a predictor 200, a subtractor 205, a transformer 210, a quantizer 215, an inverse quantizer 220, an inverse transformer 225, An adder 230, a filter 235, an encoded picture buffer 240, and an entropy encoder 245 may be included.

예측부(200)는 소프트웨어 모듈인 예측 모듈(prediction module)을 이용하여 구현될 수 있고, 부호화할 블록에 대하여 화면내 예측 방식(Intra Prediction)이나 화면간 예측 방식(Inter Prediction)으로 예측 블록을 생성할 수 있다. 예측부(200)는 영상에서 현재 부호화하고자 하는 현재 블록을 예측하여 예측 블록을 생성할 수 있다. 다시 말해, 예측부(200)는 영상에서 부호화하고자 하는 현재 블록의 각 화소의 화소값(pixel value)을 화면내 예측 또는 화면간 예측에 따라 예측하여 생성된 각 화소의 예측 화소값(prediced pixel value)를 갖는 예측 블록을 생성할 수 있다. 또한, 예측부(200)는 화면내 예측 모드 또는 화면간 예측 모드와 같은 예측 모드에 대한 정보와 같은 예측 블록을 생성하는데 필요한 정보를 부호화부로 전달하여 부호화부로 하여금 예측 모드에 대한 정보를 부호화하도록 할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 부/복호화 설정에 따라 정해질 수 있다. 예를 들어, 예측 방법, 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수 있다.The prediction unit 200 may be implemented using a prediction module, which is a software module, and generates a prediction block with an intra prediction or inter prediction for a block to be encoded. can do. The prediction unit 200 may generate a prediction block by predicting a current block to be currently encoded in an image. In other words, the prediction unit 200 predicts the pixel value of each pixel of the current block to be encoded in the image according to the intra prediction or the inter prediction. Can generate a prediction block with In addition, the prediction unit 200 may transmit information necessary for generating a prediction block, such as information about a prediction mode such as an intra prediction mode or an inter prediction mode, to the encoder so that the encoder encodes the information about the prediction mode. Can be. In this case, the processing unit for which the prediction is performed, the processing method for which the prediction method and the details are determined may be determined according to the encoding / decoding setting. For example, the prediction method, the prediction mode, etc. may be determined in the prediction unit, and the performance of the prediction may be performed in the transformation unit.

화면간 예측부에서 움직임 예측 방법에 따라 이동 움직임 모델(Translation motion model)과 이동외 움직임 모델(Affine motion model)로 구분할 수 있다. 이동 움직임 모델의 경우 평행 이동만을 고려하여 예측을 수행하고, 이동외 움직임 모델의 경우 평행 이동뿐만 아니라 회전, 원근, 줌 인/아웃(Zoom in/out) 등과 같은 움직임을 고려하여 예측을 수행할 수 있다. 단방향 예측을 가정할 때 이동 움직임 모델의 경우 하나의 움직임 벡터가 필요할 수 있지만, 이동외 움직임 모델의 경우 하나 이상의 움직임 벡터가 필요할 수 있다. 이동외 움직임 모델의 경우 각 움직임 벡터는 현재 블록의 좌상측 꼭지점, 우상측 꼭지점 등과 같이 현재 블록의 기 설정된 위치에 적용되는 정보일 수 있고, 해당 움직임 벡터를 통해 현재 블록의 예측하고자 하는 영역의 위치를 화소 단위 또는 서브 블록 단위로 획득할 수 있다. 화면간 예측부는 상기 움직임 모델에 따라 후술하는 일부 과정은 공통으로 적용될 수 있고 일부 과정은 개별적으로 적용될 수 있다.The inter prediction unit may be classified into a translation motion model and an affine motion model according to a motion prediction method. In the case of the moving motion model, the prediction is performed by considering only the parallel movement. In the case of the out-of-movement model, the prediction can be performed by considering not only the parallel movement but also movements such as rotation, perspective, and zoom in / out. have. Assuming one-way prediction, one motion vector may be required for a motion model, but one or more motion vectors may be required for an out-of-motion motion model. In the case of an out-of-movement motion model, each motion vector may be information applied to a predetermined position of the current block, such as an upper left vertex and an upper right vertex of the current block, and a position of an area to be predicted of the current block through the corresponding motion vector. May be obtained in a pixel unit or a sub block unit. The inter prediction unit may apply some processes to be described later in common according to the motion model, and some processes may be applied separately.

화면간 예측부는 참조 픽쳐 구성부, 움직임 추정부, 움직임 보상부, 움직임 정보 결정부, 움직임 정보 부호화부를 포함할 수 있다. 참조 픽쳐 구성부는 현재 픽쳐를 중심으로 이전 또는 이후에 부호화된 픽쳐를 참조 픽쳐 리스트(L0, L1)에 포함할 수 있다. 상기 참조 픽쳐 리스트에 포함된 참조 픽쳐로부터 예측 블록을 획득할 수 있으며, 부호화 설정에 따라 현재 영상 또한 참조 픽쳐로 구성되어 참조 픽쳐 리스트 중 적어도 한 곳에 포함될 수 있다.The inter prediction unit may include a reference picture configuration unit, a motion estimation unit, a motion compensator, a motion information determiner, and a motion information encoder. The reference picture configuration unit may include, in the reference picture lists L0 and L1, pictures encoded before or after the current picture. A prediction block may be obtained from a reference picture included in the reference picture list, and the current picture may also be configured as a reference picture and included in at least one of the reference picture lists according to encoding settings.

화면간 예측부에서 참조 픽쳐 구성부는 참조 픽쳐 보간부를 포함할 수 있으며, 보간 정밀도에 따라 소수 단위 화소를 위한 보간 과정을 수행할 수 있다. 예를 들어, 휘도 성분의 경우 8-tap DCT 기반의 보간 필터를 적용하고, 색차 성분의 경우 4-tap DCT 기반의 보간 필터를 적용할 수 있다.In the inter prediction unit, the reference picture component may include a reference picture interpolator, and may perform an interpolation process for a fractional pixel according to interpolation precision. For example, an 8-tap DCT based interpolation filter may be applied in the case of luminance components, and a 4-tap DCT based interpolation filter may be applied in the case of chrominance components.

화면간 예측부에서 움직임 추정부는 현재 블록과 상관성이 높은 블록을 참조 픽쳐를 통해 탐색하는 과정이며 FBMA(Full search-based block matching algorithm), TSS(Three step search) 등의 다양한 방법이 사용될 수 있고, 움직임 보상부는 움직임 추정 과정을 통해 예측 블록을 획득하는 과정을 의미한다.In the inter prediction unit, the motion estimation unit searches a block having a high correlation with the current block through a reference picture, and various methods such as a full search-based block matching algorithm (FBMA) and a three step search (TSS) may be used. The motion compensator means a process of obtaining a prediction block through a motion estimation process.

화면간 예측부에서 움직임 정보 결정부는 현재 블록의 최적의 움직임 정보를 선정하기 위한 과정이 수행될 수 있으며, 움직임 정보는 스킵 모드(Skip Mode), 병합 모드(Merge Mode), 경쟁 모드(Competition Mode) 등의 움직임 정보 부호화 모드에 의해 부호화될 수 있다. 상기 모드는 움직임 모델에 따라 지원되는 모드가 결합되어 구성될 수 있으며, 스킵 모드(이동), 스킵 모드(이동외), 병합 모드(이동), 병합 모드(이동외), 경쟁 모드(이동), 경쟁 모드(이동외)가 그에 대한 예가 될 수 있다. 부호화 설정에 따라 상기 모드 중 일부가 후보군에 포함될 수 있다.The motion information determiner may perform a process for selecting the optimal motion information of the current block in the inter prediction unit, and the motion information may be a skip mode, a merge mode, or a competition mode. It may be encoded by a motion information encoding mode. The mode may be configured by combining the supported modes according to the motion model, skip mode (movement), skip mode (movement), merge mode (movement), merge mode (movement), competition mode (movement), Competitive mode (outside the move) may be an example. Some of the modes may be included in the candidate group according to the encoding setting.

상기 움직임 정보 부호화 모드는 적어도 하나의 후보 블록에서 현재 블록의 움직임 정보(움직임 벡터, 참조 픽쳐, 예측 방향 등)의 예측값을 획득할 수 있으며, 둘 이상의 후보 블록이 지원되는 경우에는 최적의 후보 선택 정보가 발생할 수 있다. 스킵 모드(잔차 신호 없음)와 병합 모드(잔차 신호 존재)는 상기 예측값을 그대로 현재 블록의 움직임 정보로 사용할 수 있고, 경쟁 모드는 현재 블록의 움직임 정보와 상기 예측값과의 차분치 정보가 발생할 수 있다.In the motion information encoding mode, a prediction value of motion information (motion vector, reference picture, prediction direction, etc.) of the current block may be obtained from at least one candidate block, and optimal candidate selection information is provided when two or more candidate blocks are supported. May occur. In the skip mode (no residual signal) and the merge mode (the residual signal present), the prediction value may be used as the motion information of the current block, and in the contention mode, difference information between the motion information of the current block and the prediction value may be generated. .

현재 블록의 움직임 정보 예측값을 위한 후보군은 움직임 정보 부호화 모드에 따라 적응적이고 다양한 구성을 가질 수 있다. 현재 블록에 공간적으로 인접한 블록(예를 들어, 좌, 상, 좌상, 우상, 좌하 블록 등)의 움직임 정보가 후보군에 포함될 수 있고, 시간적으로 인접한 블록의 움직임 정보가 후보군에 포함될 수 있으며, 공간적 후보와 시간적 후보의 혼합 움직임 정보 등이 후보군에 포함될 수 있다. The candidate group for the motion information prediction value of the current block may be adaptive and have various configurations according to the motion information encoding mode. The motion information of a block spatially adjacent to the current block (eg, left, top, top left, top right, bottom left block, etc.) may be included in the candidate group, and the motion information of a temporally adjacent block may be included in the candidate group, and the spatial candidate And mixed motion information of temporal candidates may be included in the candidate group.

상기 시간적으로 인접한 블록은 현재 블록과 대응(또는 상응)하는 다른 영상 내 블록을 포함하고, 해당 블록을 중심으로 좌, 우, 상, 하, 좌상, 우상, 좌하, 우하 블록 등에 위치한 블록을 의미할 수 있다. 상기 혼합 움직임 정보는 공간적으로 인접한 블록의 움직임 정보와 시간적으로 인접한 블록의 움직임 정보를 통해 평균, 중앙값 등으로 획득되는 정보를 의미할 수 있다.The temporally adjacent block may include a block in another image corresponding to (or corresponding to) the current block, and mean a block located in a left, right, up, down, top, right, left, bottom, and bottom block with respect to the block. Can be. The mixed motion information may mean information obtained by an average, a median value, etc. through motion information of spatially adjacent blocks and motion information of blocks adjacent in time.

움직임 정보 예측값 후보군 구성을 위한 우선 순위가 존재할 수 있다. 상기 우선 순위에 따라 예측값 후보군 구성에 포함되는 순서가 정해질 수 있으며, 상기 우선 순위에 따라 후보군의 개수(움직임 정보 부호화 모드에 따라 정해짐)만큼 채워지면 후보군 구성을 완료할 수 있다. 이때, 공간적으로 인접한 블록의 움직임 정보, 시간적으로 인접한 블록의 움직임 정보, 공간적 후보와 시간적 후보의 혼합 움직임 정보 순서로 우선 순위가 정해질 수 있으나, 그 외의 변형 또한 가능하다.There may be a priority for constructing the motion information prediction value candidate group. The order of inclusion in the prediction value candidate group configuration may be determined according to the priority, and the candidate group configuration may be completed when the number of candidate groups (determined according to the motion information encoding mode) is filled according to the priority. In this case, priority may be determined in order of motion information of spatially adjacent blocks, motion information of temporally adjacent blocks, and mixed motion information of spatial candidates and temporal candidates, but other modifications are also possible.

예를 들어, 공간적으로 인접한 블록 중에서는 좌 - 상 - 우상 - 좌하 - 좌상 블록 등의 순서로 후보군에 포함할 수 있고, 시간적으로 인접한 블록 중에서는 우하 - 중 - 우 - 하 블록 등의 순서로 후보군에 포함할 수 있다.For example, among spatially adjacent blocks, candidates may be included in the candidate group in the order of left-up-top-right-bottom-left-top block, and candidate blocks in order of right-bottom-middle-right-bottom block among temporally adjacent blocks. It can be included in.

감산부(205)는 현재 블록에서 예측 블록을 감산하여 잔차 블록(residual block)을 생성할 수 있다. 다시 말해, 감산부(205)는 부호화하고자 하는 현재 블록의 각 화소의 화소값과 예측부를 통해 생성된 예측 블록의 각 화소의 예측 화소값의 차이를 계산하여 블록 형태의 잔차 신호(residual signal)인 잔차 블록을 생성할 수 있다. 또한, 감산부(205)는 후술하는 블록 분할부를 통해 획득된 블록 단위 이외의 단위에 따라 잔차 블록을 생성할 수도 있다.The subtraction unit 205 may generate a residual block by subtracting the prediction block from the current block. In other words, the subtractor 205 calculates a difference between the pixel value of each pixel of the current block to be encoded and the predicted pixel value of each pixel of the prediction block generated through the prediction unit, and is a residual signal in the form of a block. Residual blocks can be created. In addition, the subtraction unit 205 may generate the residual block according to units other than the block unit obtained through the block division unit described below.

변환부(210)는 공간 영역에 속하는 신호를 주파수 영역에 속하는 신호로 변환할 수 있으며, 변환 과정을 거쳐 획득되는 신호를 변환 계수(Transformed Coefficient)라고 한다. 예를 들어, 감산부로부터 전달받은 잔차 신호를 갖는 잔차 블록을 변환하여 변환 계수를 갖는 변환 블록을 획득할 수 있는데, 입력 받은 신호는 부호화 설정에 따라 결정되며 이는 잔차 신호에 한정되지 않는다.The transform unit 210 may convert a signal belonging to a spatial domain into a signal belonging to a frequency domain, and a signal obtained through a transformation process is called a transformed coefficient. For example, a transform block having a transform coefficient may be obtained by transforming the residual block having the residual signal received from the subtractor, but the input signal is determined according to an encoding setting, which is not limited to the residual signal.

변환부는 잔차 블록을 하다마드 변환(Hadamard Transform), 이산 사인 변환(DST Based-Transform: Discrete Sine Transform), 이산 코사인 변환(DCT Based-Transform: Discrete Cosine Transform) 등과 같은 변환 기법을 사용하여 변환할 수 있으며, 이에 한정되지 않고 이를 개량 및 변형한 다양한 변환 기법이 사용될 수 있다.The transform unit can transform the residual block using transformation techniques such as a Hadamard transform, a Discrete Sine Transform (DST Based-Transform), or a Discrete Cosine Transform (DCT Based-Transform). The present invention is not limited thereto, and various transformation techniques may be used.

상기 변환 기법 중 적어도 하나의 변환 기법이 지원될 수 있으며, 각 변환 기법에서 적어도 하나의 세부 변환 기법이 지원될 수 있다. 이때, 상기 세부 변한 기법은 각 변환 기법에서 기저 벡터의 일부가 달리 구성되는 변환 기법일 수 있다.At least one of the transformation schemes may be supported, and at least one detailed transformation scheme may be supported in each transformation scheme. In this case, the detailed changed technique may be a transformation technique in which a part of the basis vector is configured differently in each transformation technique.

예를 들어, DCT의 경우 DCT-I 내지 DCT-VIII 중 하나 이상의 세부 변환 기법이 지원될 수 있고, DST의 경우 DST-I 내지 DST-VIII 중 하나 이상의 세부 변환 기법이 지원될 수 있다. 상기 세부 변환 기법의 일부를 구성하여 변환 기법 후보군을 구성할 수 있다. 일 예로, DCT-II, DCT-VIII, DST-VII를 변환 기법 후보군으로 구성하여 변환을 수행할 수 있다.For example, in the case of DCT, one or more detailed transformation schemes of DCT-I through DCT-VIII may be supported, and in the case of DST, one or more detailed transformation schemes of DST-I through DST-VIII may be supported. A portion of the detailed transformation scheme may be configured to form a transformation technique candidate group. For example, the transformation may be performed by configuring DCT-II, DCT-VIII, and DST-VII as candidate candidates for transformation techniques.

변환은 수평/수직 방향으로 수행될 수 있다. 예를 들어, DCT-II의 변환 기법을 사용하여 수평 방향으로 1차원 변환을 수행하고, DST-VIII의 변환 기법을 사용하여 수직 방향으로 1차원 변환을 수행하여 총 2차원 변환을 수행함으로써 공간 영역의 화소값을 주파수 영역으로 변환할 수 있다.The conversion can be performed in the horizontal / vertical direction. For example, one-dimensional transform is performed in the horizontal direction using the transform technique of DCT-II, and a total two-dimensional transform is performed by performing one-dimensional transform in the vertical direction using the transform technique of DST-VIII. The pixel value of can be converted into the frequency domain.

고정적인 하나의 변환 기법을 사용하여 변환을 수행할 수 있거나 부/복호화 설정에 따라 변환 기법을 적응적으로 선택하여 변환을 수행할 수 있다. 이때, 적응적인 경우에는 명시적 또는 묵시적인 방법을 사용하여 변환 기법을 선택할 수 있다. 명시적인 경우에는 수평, 수직 방향에 적용되는 각각의 변환 기법 선택 정보 또는 변환 기법 세트 선택 정보가 블록 등의 단위에서 발생할 수 있다. 묵시적인 경우는 영상 타입(I/P/B), 컬러 성분, 블록의 크기, 형태, 화면내 예측 모드 등에 따라 부호화 설정이 정의될 수 있으며, 이에 따라 기 정의된 변환 기법이 선택될 수 있다. The transformation can be performed using one fixed transformation technique, or the transformation can be performed by adaptively selecting the transformation scheme according to the encoding / decoding. In this case, the adaptation method may be selected using an explicit or implicit method. In the explicit case, each transformation technique selection information or transformation technique set selection information applied to the horizontal and vertical directions may occur in a unit such as a block. In an implicit case, encoding settings may be defined according to an image type (I / P / B), a color component, a size, a shape of a block, an intra prediction mode, and a predetermined transformation scheme may be selected.

또한, 부호화 설정에 따라 상기 일부 변환이 생략되는 경우가 가능할 수 있다. 즉, 명시적 또는 묵시적으로 수평/수직 단위 중 하나 이상을 생략할 수 있음을 의미한다.In addition, it may be possible that the partial transform is omitted depending on the encoding setting. That is, one or more of the horizontal / vertical units may be omitted, either explicitly or implicitly.

또한, 변환부는 변환 블록을 생성하는데 필요한 정보를 부호화부로 전달하여 이를 부호화하도록 할 수 있고, 그에 따른 정보를 비트스트림에 수록하여 이를 복호화기에 전송하고, 복호화기의 복호화부는 이에 대한 정보를 파싱하여 역변환 과정에 사용할 수 있다.In addition, the transformer may transmit information necessary to generate a transform block to the encoder to encode the information, and store the information in the bitstream and transmit the information to the decoder, and the decoder of the decoder parses the information and inversely transforms the information. Can be used for the process.

양자화부(215)는 입력 받은 신호를 양자화할 수 있으며, 이때 양자화 과정을 거쳐 획득되는 신호를 양자화 계수(Quantized Coefficient)라고 한다. 예를 들어, 변환부로부터 전달받은 잔차 변환 계수를 갖는 잔차 블록을 양자화하여 양자화 계수를 갖는 양자화 블록을 획득할 수 있는데, 입력 받은 신호는 부호화 설정에 따라 결정되며 이는 잔차 변환 계수에 한정되지 않는다.The quantization unit 215 may quantize the input signal. In this case, the signal obtained through the quantization process is referred to as a quantized coefficient. For example, a quantization block having a quantization coefficient may be obtained by quantizing a residual block having a residual transform coefficient received from a transform unit. The received signal is determined according to an encoding setting, which is not limited to the residual transform coefficient.

양자화부는 변환된 잔차 블록을 데드존 균일 경계 양자화(Dead Zone Uniform Threshold Quantization), 양자화 가중치 매트릭스(Quantization Weighted Matrix) 등과 같은 양자화 기법을 사용하여 양자화할 수 있으며, 이에 한정되지 않고 이를 개량 및 변형한 다양한 양자화 기법이 사용될 수 있다.The quantization unit may quantize the transformed residual block using a quantization technique such as dead zone uniform threshold quantization, quantization weighted matrix, and the like, but is not limited thereto. Quantization techniques can be used.

부호화 설정에 따라 양자화 과정은 생략할 수 있다. 예를 들어, 부호화 설정(예를 들어, 양자화 파라미터가 0. 즉, 무손실 압축 환경)에 따라 양자화 과정을 생략(역과정도 포함)할 수 있다. 다른 예로, 영상의 특성에 따라 양자화를 통한 압축 성능이 발휘되지 않는 경우에는 양자화 과정을 생략할 수 있다. 이때, 양자화 블록(M x N) 중 양자화 과정이 생략되는 영역은 전체 영역이거나 또는 일부 영역(M/2 x N/2, M x N/2, M/2 x N 등)일 수 있으며, 양자화 생략 선택 정보는 묵시적 또는 명시적으로 정해질 수 있다.The quantization process may be omitted according to the encoding setting. For example, the quantization process may be omitted (including the inverse process) according to the encoding setting (for example, the quantization parameter is 0. That is, the lossless compression environment). As another example, the quantization process may be omitted when the compression performance through quantization is not exhibited according to the characteristics of the image. In this case, the region in which the quantization process is omitted among the quantization blocks M x N may be an entire region or a partial region (M / 2 x N / 2, M x N / 2, M / 2 x N, etc.) and may be quantized. The omission selection information may be determined implicitly or explicitly.

양자화부는 양자화 블록을 생성하는데 필요한 정보를 부호화부로 전달하여 이를 부호화하도록 할 수 있고, 그에 따른 정보를 비트스트림에 수록하여 이를 복호화기에 전송하고, 복호화기의 복호화부는 이에 대한 정보를 파싱하여 이를 역양자화 과정에 사용할 수 있다.The quantization unit may transmit information necessary for generating a quantization block to the encoding unit and encode the information. The quantization unit stores the information in a bitstream and transmits the information to the decoder, and the decoder of the decoder parses the information and dequantizes it. Can be used for the process.

상기 예에서는 변환부와 양자화부를 통해 잔차 블록을 변환하고 양자화하는 가정 하에 설명하였지만, 잔차 블록을 잔차 신호를 변환하여 변환 계수를 갖는 잔차 블록을 생성하고 양자화 과정을 수행하지 않을 수 있으며, 잔차 블록의 잔차 신호를 변환 계수로 변환하지 않고 양자화 과정만을 수행할 수 있을 뿐만 아니라, 변환과 양자화 과정 모두 수행하지 않을 수 있다. 이는 부호화기 설정에 따라 결정될 수 있다.Although the above example has been described under the assumption that the residual block is transformed and quantized through the transform unit and the quantization unit, the residual block may be transformed from the residual signal to generate a residual block having transform coefficients, and the quantization process may not be performed. Not only may the quantization process be performed without converting the residual signal into transform coefficients, but neither the transformation nor the quantization process may be performed. This may be determined according to the encoder setting.

역양자화부(220)는 양자화부(215)에 의해 양자화된 잔차 블록을 역 양자화한다. 즉, 역양자화부(220)는 양자화 주파수 계수열을 역양자화하여 주파수 계수를 갖는 잔차 블록을 생성한다.The inverse quantization unit 220 inverse quantizes the residual block quantized by the quantization unit 215. That is, the inverse quantizer 220 inversely quantizes the quantized frequency coefficient sequence to generate a residual block having the frequency coefficient.

역변환부(225)는 역양자화부(220)에 의해 역양자화된 잔차 블록을 역변환한다. 즉, 역변환부(225)는 역양자화된 잔차 블록의 주파수 계수들을 역변환하여 화소값을 갖는 잔차 블록, 즉 복원된 잔차 블록을 생성한다. 여기서, 역변환부(225)는 변환부(210)에서 사용한 변환한 방식을 역으로 사용하여 역변환을 수행할 수 있다.The inverse transform unit 225 inversely transforms the residual block inversely quantized by the inverse quantization unit 220. That is, the inverse transformer 225 inversely transforms frequency coefficients of the inversely quantized residual block to generate a residual block having a pixel value, that is, a reconstructed residual block. Here, the inverse transform unit 225 may perform inverse transform by using the transformed method used in the transform unit 210 as the inverse.

가산부(230)는 예측부(200)에서 예측된 예측 블록과 역변환부(225)에 의해 복원된 잔차 블록을 가산하여 현재 블록을 복원한다. 복원된 현재 블록은 부호화 픽쳐 버퍼(240)에 참조 픽쳐(또는 참조 블록)로서 저장되어 현재 블록의 다음 블록이나 향후 다른 블록, 다른 픽쳐를 부호화할 때 참조 픽쳐로서 사용될 수 있다.The adder 230 reconstructs the current block by adding the prediction block predicted by the predictor 200 and the residual block reconstructed by the inverse transform unit 225. The reconstructed current block may be stored as a reference picture (or a reference block) in the coded picture buffer 240 and may be used as a reference picture when encoding the next block of the current block, another block in the future, or another picture.

필터부(235)는 디블록킹 필터, SAO(Sample Adaptive Offset), ALF(Adaptive Loop Filter) 등의 하나 이상의 후처리 필터 과정을 포함할 수 있다. 디블록킹 필터는 복원된 픽쳐에서 블록 간의 경계에 생긴 블록 왜곡을 제거할 수 있다. ALF는 디블록킹 필터를 통해 블록이 필터링된 후 복원된 영상과 원래의 영상을 비교한 값을 기초로 필터링을 수행할 수 있다. SAO는 디블록킹 필터가 적용된 잔차 블록에 대하여, 화소 단위로 원본 영상과의 오프셋 차이를 복원할 수 있다. 이와 같은 후처리 필터는 복원된 픽쳐 또는 블록에 적용될 수 있다. The filter unit 235 may include one or more post-processing filter processes such as a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter (ALF), and the like. The deblocking filter may remove block distortion generated at the boundary between blocks in the reconstructed picture. The ALF may perform filtering based on a value obtained by comparing the reconstructed image with the original image after the block is filtered through the deblocking filter. The SAO may restore the offset difference from the original image on a pixel basis with respect to the residual block to which the deblocking filter is applied. Such a post-processing filter may be applied to the reconstructed picture or block.

부호화 픽쳐 버퍼(240)는 필터부(235)를 통해 복원된 블록 또는 픽쳐를 저장할 수 있다. 부호화 픽쳐 버퍼(240)에 저장된 복원 블록 또는 픽쳐는 화면내 예측 또는 화면간 예측을 수행하는 예측부(200)에 제공될 수 있다.The encoded picture buffer 240 may store a block or a picture reconstructed by the filter unit 235. The reconstructed block or picture stored in the encoded picture buffer 240 may be provided to the prediction unit 200 that performs intra prediction or inter prediction.

엔트로피 부호화부(245)는 생성된 양자화 주파수 계수열을 다양한 스캔 방식에 따라 스캔하여 양자화 계수열을 생성하고, 이를 엔트로피 부호화 기법 등을 이용하여 부호화 함으로써 출력한다. 스캔 패턴은 지그재그, 대각선, 래스터(raster) 등 다양한 패턴들 중 하나로 설정할 수 있다. 또한, 각 구성부로부터 전달되는 부호화 정보를 포함하는 부호화 데이터를 생성하여 비트스트림으로 출력할 수 있다.The entropy encoder 245 scans the generated quantization frequency coefficient sequence according to various scan methods to generate a quantization coefficient sequence, and outputs the encoded quantization coefficient sequence by encoding it using an entropy encoding technique. The scan pattern may be set to one of various patterns such as zigzag, diagonal lines, and rasters. In addition, encoded data including encoded information transmitted from each component may be generated and output as a bitstream.

도 3은 본 발명의 일 실시예에 따른 영상 복호화 장치에 대한 블록 구성도이다.3 is a block diagram of an image decoding apparatus according to an embodiment of the present invention.

도 3을 참조하면, 영상 복호화 장치(30)는 엔트로피 복호화부(305), 예측부(310), 역양자화부(315), 역변환부(320), 가감산기(325), 필터(330) 및 복호화 픽쳐 버퍼(335)를 포함하여 구성될 수 있다.Referring to FIG. 3, the image decoding apparatus 30 includes an entropy decoder 305, a predictor 310, an inverse quantizer 315, an inverse transformer 320, an adder and subtractor 325, a filter 330, and the like. The decoded picture buffer 335 may be configured.

또한, 예측부(310)는 다시 화면내 예측 모듈 및 화면간 예측 모듈을 포함하여 구성될 수 있다.In addition, the prediction unit 310 may be configured to include an intra prediction module and an inter prediction module.

먼저, 영상 부호화 장치(20)로부터 전달된 영상 비트스트림이 수신되면, 엔트로피 복호화부(305)로 전달될 수 있다.First, when an image bitstream transmitted from the image encoding apparatus 20 is received, the image bitstream may be transferred to the entropy decoder 305.

엔트로피 복호화부(305)는 비트스트림을 복호화하여 양자화된 계수들과 각 구성부로 전달되는 복호화 정보를 포함하는 복호화 데이터를 복호화할 수 있다.The entropy decoder 305 may decode the bitstream to decode the decoded data including the quantized coefficients and the decoded information transmitted to each component.

예측부(310)는 엔트로피 복호화부(305)로부터 전달된 데이터들에 기초하여 예측 블록을 생성할 수 있다. 이때, 복호화된 픽쳐 버퍼(335)에 저장된 참조 영상에 기초하여, 디폴트(default) 구성 기법을 이용한 참조 픽쳐 리스트를 구성할 수도 있다.The prediction unit 310 may generate a prediction block based on the data transferred from the entropy decoding unit 305. In this case, the reference picture list using a default construction technique may be constructed based on the reference picture stored in the decoded picture buffer 335.

화면간 예측부는 참조 픽쳐 구성부, 움직임 보상부, 움직임 정보 복호화부를 포함할 수 있으며, 일부는 부호화기와 동일한 과정을 수행하고 일부는 역으로 유도하는 과정을 수행할 수 있다.The inter prediction unit may include a reference picture component unit, a motion compensator, and a motion information decoder, and some of the processes may be performed in the same process as the encoder, and some may be reversed.

역양자화부(315)는 비트스트림으로 제공되어 엔트로피 복호화부(305)에 의해 복호화된 양자화된 변환 계수들을 역양자화할 수 있다.The inverse quantizer 315 may inverse quantize the quantized transform coefficients provided in the bitstream and decoded by the entropy decoder 305.

역변환부(320)는 역 DCT, 역 정수 변환 또는 그와 유사한 개념의 역변환 기법들을 변환 계수에 적용하여 잔차 블록을 생성할 수 있다.The inverse transform unit 320 may generate a residual block by applying inverse transform techniques of inverse DCT, inverse integer transform, or the like to a transform coefficient.

이때, 역양자화부(315), 역변환부(320)는 앞서 설명한 영상 부호화 장치(20)의 변환부(210) 및 양자화부(215)에서 수행한 과정을 역으로 수행하며 다양한 방법으로 구현될 수 있다. 예를 들어, 변환부(210) 및 양자화부(215)와 공유하는 동일한 과정 및 역변환을 사용할 수도 있고, 영상 부호화 장치(20)로부터 변환 및 양자화 과정에 관한 정보(예를 들면, 변환 크기, 변환 모양, 양자화 타입 등)를 이용하여 변환 및 양자화 과정을 역으로 수행할 수 있다.In this case, the inverse quantization unit 315 and the inverse transform unit 320 perform the processes performed by the transform unit 210 and the quantization unit 215 of the image encoding apparatus 20 described above, and may be implemented in various ways. have. For example, the same process and inverse transform shared with the transform unit 210 and the quantization unit 215 may be used, and information about the transform and quantization process from the image encoding apparatus 20 (for example, transform size and transform). Shape, quantization type, etc.) may be used to reverse the transform and quantization processes.

역양자화 및 역변환 과정을 거친 잔차 블록은 예측부(310)에 의해 도출된 예측 블록과 가산되어 복원된 영상 블록이 생성될 수 있다. 이러한 가산은 가감산기(325)에 의해 이루어 질 수 있다.The residual block that has undergone inverse quantization and inverse transformation may be added to the prediction block derived by the prediction unit 310 to generate an image block reconstructed. This addition can be made by the adder and subtractor 325.

필터(330)는 복원된 영상 블록에 대하여, 필요에 따라 블록킹(blocking) 현상을 제거하기 위하여 디블록킹 필터를 적용할 수도 있고, 상기 복호화 과정 전 후에 다른 루프 필터들을 비디오 품질을 향상시키기 위해 추가로 사용할 수도 있다.The filter 330 may apply a deblocking filter to the reconstructed image block to remove blocking if necessary, and further add other loop filters to improve video quality before and after the decoding process. Can also be used.

복원 및 필터를 거친 영상 블록은 복호화 픽쳐 버퍼(335)에 저장될 수 있다.The reconstructed and filtered image block may be stored in the decoded picture buffer 335.

도면에 도시하지 않았지만 영상 부호화/복호화 장치에 픽쳐 분할부와 블록 분할부를 더 포함할 수 있다.Although not shown in the figure, the picture encoding / decoding apparatus may further include a picture divider and a block divider.

픽쳐 분할부는 픽쳐를 컬러 공간(예를 들어, YCbCr, RGB 또는 XYZ 등), 타일, 슬라이스, 기본 부호화 단위(또는 최대 부호화 단위) 등과 같은 적어도 하나의 처리 단위로 분할(또는 구획)할 수 있고, 블록 분할부는 기본 부호화 단위를 적어도 하나의 처리 단위(예를 들어, 부호화, 예측, 변환, 양자화, 엔트로피 및 인루프 필터 단위 등)로 분할할 수 있다.The picture splitter may divide (or partition) a picture into at least one processing unit such as a color space (eg, YCbCr, RGB, XYZ, etc.), a tile, a slice, a basic coding unit (or a maximum coding unit), or the like. The block splitter may divide the basic coding unit into at least one processing unit (for example, encoding, prediction, transform, quantization, entropy, in-loop filter unit, etc.).

기본 부호화 단위는 가로 방향과 세로 방향으로 픽쳐를 일정한 간격으로 분할하여 획득될 수 있다. 이를 기반으로 타일, 슬라이스 등의 분할이 수행될 수 있으나 이에 한정하지는 않는다. 상기 타일과 슬라이스와 같은 분할 단위는 기본 부호화 블록의 정수배로 구성될 수 있으나, 영상 경계에 위치한 분할 단위에서는 예외적인 경우가 발생할 수 있다. 이를 위해 기본 부호화 블록 크기의 조정이 발생할 수도 있다.The basic coding unit may be obtained by dividing a picture at regular intervals in a horizontal direction and a vertical direction. Based on this, division of tiles, slices, etc. may be performed, but is not limited thereto. The division unit such as the tile and the slice may be configured as an integer multiple of the basic coding block, but an exceptional case may occur in the division unit located at the image boundary. To this end, adjustment of the basic coding block size may occur.

예를 들어, 픽쳐를 기본 부호화 단위로 구획한 후에 상기 단위로 분할할 수 있거나 또는 픽쳐를 상기 단위로 구획한 후에 기본 부호화 단위로 분할할 수 있다. 본 발명에서는 각 단위의 구획 및 분할 순서가 전자인 경우를 가정하여 설명하나 이에 한정되지 않고, 부/복호화 설정에 따라 후자의 경우 또한 가능할 수 있다. 후자의 경우 기본 부호화 단위의 크기가 분할 단위(타일 등)에 따라 적응적인 경우로의 변형이 가능할 수 있다. 즉, 각 분할 단위마다 다른 크기를 갖는 기본 부호화 블록이 지원될 수 있음을 의미한다.For example, a picture may be divided into basic coding units and then divided into the units, or a picture may be divided into basic units and then divided into basic coding units. In the present invention, a description will be given on the assumption that the division and division order of each unit is the former, but the present invention is not limited thereto. In the latter case, the size of the basic coding unit may be changed to an adaptive case according to the division unit (tile, etc.). That is, it means that the basic coding block having a different size for each division unit can be supported.

본 발명에서는 픽쳐를 기본 부호화 단위로 구획하는 경우를 기본 설정으로 두어 후술하는 예를 설명할 것이다. 상기 기본 설정은 픽쳐가 타일 또는 슬라이스로 분할되지 않거나 또는 픽쳐가 하나의 타일 또는 하나의 슬라이스인 경우를 의미할 수 있다. 그러나 전술한 것처럼 각 분할 단위(타일, 슬라이스 등)를 먼저 구획하고 획득된 단위에 기반하여 기본 부호화 단위로 분할하는 경우(즉, 각 분할 단위가 기본 부호화 단위의 정수배가 되지 않는 경우 등)에도 후술하는 다양한 실시예가 동일하거나 변경되어 적용될 수 있음이 이해되어야 한다.In the present invention, a case of dividing a picture into basic coding units as a default setting will be described below. The default setting may mean that the picture is not divided into tiles or slices or the picture is one tile or one slice. However, as described above, when each division unit (tile, slice, etc.) is first partitioned and then divided into basic coding units based on the obtained unit (that is, each division unit is not an integer multiple of the basic coding unit, etc.). It should be understood that various embodiments may be applied in the same or modified form.

상기 분할 단위 중 슬라이스의 경우 스캔 패턴에 따라 연속하는 적어도 하나의 블록들의 묶음으로 구성될 수 있고, 타일의 경우 공간적으로 인접한 블록들의 직사각형 형태의 묶음으로 구성될 수 있으며, 그 외의 추가적인 분할 단위가 지원되어 그에 따른 정의에 의해 구성될 수 있다. 슬라이스와 타일은 병렬 처리 등을 위한 목적으로 지원되는 분할 단위일 수 있으며, 이를 위해 분할 단위 간의 참조는 제한(즉, 참조할 수 없음)할 수 있다. In the case of the slice unit, a slice may be composed of a bundle of at least one consecutive block according to a scan pattern, and in the case of a tile, the slice may be composed of a rectangular bundle of spatially adjacent blocks, and other additional division units are supported. And can be constructed by definition accordingly. The slice and the tile may be divided units supported for the purpose of parallel processing, and for this purpose, references between the divided units may be limited (that is, cannot be referred to).

슬라이스는 연속하는 블록의 시작 위치에 대한 정보로 각 단위의 분할 정보를 생성할 수 있고, 타일의 경우 수평, 수직 방향의 분할 선에 대한 정보를 생성하거나 또는 타일의 위치 정보(예를 들어, 좌상, 우상, 좌하, 우하 위치)를 생성할 수 있다.A slice may generate split information of each unit as information about a start position of consecutive blocks, and in the case of a tile, generate slice information about horizontal and vertical split lines or tile position information (for example, upper left corner). , Upper right, lower left, and lower right positions).

이때, 슬라이스와 타일은 부/복호화 설정에 따라 복수의 단위로 구분될 수 있다. In this case, the slice and the tile may be divided into a plurality of units according to the encoding / decoding.

예를 들어, 일부 단위<A>는 부/복호화 과정에 영향을 주는 설정 정보를 포함하는 단위(즉, 타일 헤더 또는 슬라이스 헤더를 포함)일 수 있고, 일부 단위<B>는 설정 정보를 포함하지 않는 단위일 수 있다. 또는, 일부 단위<A>는 부/복호화 과정에서 다른 단위를 참조할 수 없는 단위일 수 있고, 일부 단위<B>는 참조할 수 있는 단위일 수 있다. 또한, 일부 단위<A>는 다른 단위<B>를 포함하는 상하 관계일 수 있거나 일부 단위<A>는 다른 단위<B>와 대등한 관계일 수 있다.For example, some units <A> may be units containing setting information that affects the encoding / decoding process (ie, including tile headers or slice headers), and some units <B> do not include setting information. May be a unit. Alternatively, some units <A> may be units that cannot refer to other units in the encoding / decoding process, and some units <B> may be units that may be referred to. In addition, some units <A> may be in a vertical relationship including other units <B> or some units <A> may be in a relationship equivalent to other units <B>.

여기서 A와 B는 슬라이스와 타일(또는 타일과 슬라이스)일 수 있다. 또는, A와 B는 슬라이스나 타일 중 하나로 구성될 수 있다. 예를 들어, A는 슬라이스/타일<타입 1>이고 B는 슬라이스/타일<타입 2>와 같은 구성이 가능할 수 있다.Here, A and B may be slices and tiles (or tiles and slices). Alternatively, A and B may be composed of one of slices or tiles. For example, A may be a slice / tile <type 1> and B may be configured as a slice / tile <type 2>.

여기서 타입 1과 타입 2는 각각 하나의 슬라이스 또는 타일일 수 있다. 또는, 타입 1은 (타입 2를 포함하는) 복수의 슬라이스 또는 타일(슬라이스 집합 또는 타일 집합)일 수 있고, 타입 2는 하나의 슬라이스 또는 타일일 수 있다.Here, Type 1 and Type 2 may each be one slice or tile. Alternatively, type 1 may be a plurality of slices or tiles (including type 2) (slice set or tile set), and type 2 may be one slice or tile.

이미 전술한 것과 같이 본 발명은 픽쳐가 하나의 슬라이스 또는 타일로 구성되는 경우를 가정하여 설명하지만, 둘 이상의 분할 단위가 발생하는 경우라면 위의 설명이 후술하는 실시예에 적용되어 이해될 수 있다. 또한, A와 B는 분할 단위가 가질 수 있는 특성에 대한 예시로 각 예시의 A와 B가 혼합 구성되는 예 또한 가능하다.As described above, the present invention is described assuming that a picture is composed of one slice or tile. However, when two or more division units occur, the above description may be applied to an embodiment to be described below. In addition, A and B are examples of properties that a division unit may have, and an example in which A and B of each example are mixed is also possible.

한편, 블록 분할부를 통해 다양한 크기의 블록으로 분할할 수 있다. 이때, 블록은 컬러 포맷에 따라 하나 이상의 블록으로 구성(예를 들어, 하나의 휘도 블록 및 둘의 색차 블록 등)될 수 있으며, 컬러 포맷에 따라 블록의 크기가 결정될 수 있다. 이하에서는 설명의 편의를 위해 하나의 컬러 성분(휘도 성분)에 따른 블록을 기준으로 설명한다.Meanwhile, the block divider may be divided into blocks of various sizes. In this case, the block may be composed of one or more blocks according to the color format (for example, one luminance block and two chrominance blocks, etc.), and the size of the block may be determined according to the color format. In the following description, for convenience of description, a block corresponding to one color component (luminance component) will be described.

후술하는 내용은 하나의 컬러 성분을 대상으로 하지만 컬러 포맷에 따른 비율(예를 들어, YCbCr 4:2:0의 경우 휘도 성분과 색차 성분의 가로 및 세로 길이 비율은 2:1)에 비례하여 다른 컬러 성분에 변경 적용될 수 있음을 이해하여야 한다. 또한, 다른 컬러 성분에 의존적인 블록 분할(예를 들어, Cb/Cr에서 Y의 블록 분할 결과에 의존적인 경우)이 가능할 수 있지만, 각 컬러 성분에 독립적인 블록 분할이 가능할 수 있음을 이해하여야 한다. 또한, 공통되는 하나의 블록 분할 설정(길이 비율에 비례하는 것은 고려)을 사용할 수 있지만, 컬러 성분에 따라 개별적인 블록 분할 설정이 사용되는 것 또한 고려하여 이해할 필요가 있다.The following description applies to one color component but differs in proportion to the color format (e.g., in the case of YCbCr 4: 2: 0, the ratio of the width and height of the luminance component and the chrominance component is 2: 1). It should be understood that modifications may be made to the color components. It should also be understood that block partitioning that is dependent on other color components (e.g., depending on the block partitioning result of Y in Cb / Cr) may be possible, but block partitioning independent of each color component may be possible. . In addition, although one common block division setting (which is proportional to the length ratio) can be used, it is also necessary to consider and consider that the individual block division setting is used according to the color component.

블록은 M × N(M과 N은 4, 8, 16, 32, 64, 128 등의 정수)과 같은 가변 크기를 가질 수 있으며, 부호화 수행을 위한 단위(부호화 블록. Coding Block)일 수 있다. 상세하게는 예측, 변환, 양자화 및 엔트로피 부호화 등의 기초가 되는 단위일 수 있으며, 본 발명에서는 이를 통칭하여 블록이라 표현한다. 여기서 블록은 사각형의 블록만을 의미하는 것이 아니라 삼각형, 원형 등 다양한 형태의 영역을 포함하는 넓은 개념으로 이해될 수 있으며, 본 발명에서는 사각형 형태인 경우를 중심으로 설명한다.The block may have a variable size such as M × N (M and N are integers such as 4, 8, 16, 32, 64, 128, etc.) and may be a unit (coding block) for performing encoding. In detail, the present invention may be a unit that is a basis for prediction, transform, quantization, and entropy encoding, and in the present invention, this is collectively referred to as a block. Herein, the block may be understood as a broad concept including not only a rectangular block but also various types of regions such as a triangle and a circle, and the present invention will be described based on the case of a rectangular shape.

블록 분할부는 영상 부호화 장치 및 복호화 장치의 각 구성부에 관계되어 설정될 수 있으며, 이 과정을 통해 블록의 크기와 형태가 정해질 수 있다. 이때, 설정되는 블록은 구성부에 따라 달리 정의될 수 있으며, 예측부의 경우 예측 블록(Prediction Block), 변환부의 경우 변환 블록(Transform Block), 양자화부의 경우 양자화 블록(Quantization Block) 등이 이에 해당할 수 있다. 다만, 이에 한정되지 않고 다른 구성부에 따른 블록 단위가 추가로 정의될 수 있다. 본 발명에서는 각 구성부에서 입력과 출력이 블록(즉, 직사각 형태)인 경우를 가정하여 설명하지만, 일부 구성부에서는 다른 형태(예를 들어, 사각형, 삼각형 등)의 입/출력이 가능할 수도 있다.The block divider may be set in relation to each component of the image encoding apparatus and the decoding apparatus, and the size and shape of the block may be determined through this process. In this case, the set block may be defined differently according to the configuration unit, and a prediction block in the prediction unit, a transform block in the transform unit, and a quantization block in the quantization unit may correspond to this. Can be. However, the present invention is not limited thereto, and a block unit according to another component may be further defined. In the present invention, it is assumed that the inputs and outputs are blocks (that is, rectangular shapes) in each component, but some components may be input / output in other forms (eg, squares, triangles, etc.). .

블록 분할부의 초기(또는 시작) 블록의 크기 및 형태는 상위 단위로부터 결정될 수 있다. 예를 들어, 부호화 블록의 경우 기본 부호화 블록이 초기 블록일 수 있고, 예측 블록의 경우 부호화 블록이 초기 블록일 수 있다. 또한, 변환 블록의 경우 부호화 블록 또는 예측 블록이 초기 블록일 수 있으며, 이는 부/복호화 설정에 따라 정해질 수 있다. The size and shape of the initial (or starting) block of the block division may be determined from higher units. For example, in the case of a coding block, a basic coding block may be an initial block, and in the case of a prediction block, a coding block may be an initial block. In addition, in the case of a transform block, a coding block or a prediction block may be an initial block, which may be determined according to a sub / decoding setting.

예를 들어, 부호화 모드가 인트라(intra)일 경우 예측 블록은 변환 블록의 상위 단위일 수 있고, 인터(inter)일 경우 예측 블록은 변환 블록에 독립적인 단위일 수 있다. 분할의 시작 단위인 초기 블록은 작은 크기의 블록으로 분할될 수 있으며, 블록의 분할에 따른 최적의 크기 및 형태가 결정되면 그 블록은 하위 단위의 초기 블록으로 결정될 수 있다. 분할의 시작 단위인 초기 블록을 상위 단위의 초기 블록이라 볼 수 있다. 여기서, 상위 단위는 부호화 블록, 하위 단위는 예측 블록 또는 변환 블록일 수 있으나, 이에 한정되는 것은 아니다. 상기 예와 같이 하위 단위의 초기 블록이 정해지면 상위 단위와 같이 최적의 크기 및 형태의 블록을 찾기 위한 분할 과정이 수행될 수 있다.For example, when the encoding mode is intra, the prediction block may be an upper unit of the transform block, and in the inter case, the prediction block may be an independent unit of the transform block. The initial block, which is the start unit of the partition, may be divided into blocks of small size, and when the optimal size and shape according to the partition of the block is determined, the block may be determined as the initial block of the lower unit. The initial block, which is the start unit of the division, may be referred to as the initial block of the upper unit. Here, the upper unit may be a coding block and the lower unit may be a prediction block or a transform block, but is not limited thereto. When the initial block of the lower unit is determined as in the above example, a partitioning process for searching for a block having an optimal size and shape like the upper unit may be performed.

정리하면, 블록 분할부는 기본 부호화 단위(또는 최대 부호화 단위)를 적어도 하나의 부호화 단위(또는 하위 부호화 단위)로 분할을 수행할 수 있다. 또한, 부호화 단위는 적어도 하나의 예측 단위로 분할을 수행할 수 있고, 적어도 하나의 변환 단위로 분할을 수행할 수 있다. 부호화 단위는 적어도 하나의 부호화 블록으로 분할을 수행할 수 있고, 부호화 블록은 적어도 하나의 예측 블록으로 분할을 수행할 수 있고, 적어도 하나의 변환 블록으로 분할을 수행할 수 있다. 예측 단위는 적어도 하나의 예측 블록으로 분할을 수행할 수 있고, 변환 단위는 적어도 하나의 변환 블록으로 분할을 수행할 수 있다.In summary, the block division unit may divide the basic coding unit (or the largest coding unit) into at least one coding unit (or the lower coding unit). In addition, the coding unit may perform division in at least one prediction unit and may perform division in at least one transformation unit. The coding unit may perform splitting into at least one coding block, the coding block may perform splitting into at least one prediction block, and may split into at least one transform block. The prediction unit may perform division into at least one prediction block, and the transform unit may perform division into at least one transform block.

이때, 일부 블록의 경우 다른 블록과 결합되어 하나의 분할 과정을 수행할 수 있다. 예를 들어, 부호화 블록과 변환 블록이 하나의 단위로 결합할 경우 최적의 블록의 크기 및 형태를 획득하기 위한 분할 과정이 수행되며, 이는 부호화 블록의 최적의 크기 및 형태뿐만 아니라 변환 블록의 최적의 크기 및 형태일 수 있다. 또는, 부호화 블록과 변환 블록이 하나의 단위로 결합할 수 있고, 예측 블록과 변환 블록이 하나의 단위로 결합할 수 있고, 부호화 블록과 예측 블록과 변환 블록이 하나의 단위로 결합할 수 있고, 그 외의 블록들의 결합이 가능할 수 있다. 단, 상기 결합 여부는 영상(픽쳐, 슬라이스, 타일 등) 내에서 일괄적으로 적용되는 것이 아니라 블록 단위의 세부 조건(예를 들어, 영상 타입, 부호화 모드, 블록의 크기/형태, 예측 모드 정보 등)에 따라 적응적으로 결합 여부 등이 정해질 수 있다.In this case, some blocks may be combined with other blocks to perform one division process. For example, when the coding block and the transform block are combined into one unit, a partitioning process is performed to obtain an optimal block size and shape, which is optimized for the transform block as well as the optimal size and shape of the coding block. Size and shape. Alternatively, the coding block and the transform block may be combined in one unit, the prediction block and the transform block may be combined in one unit, the coding block, the prediction block and the transform block may be combined in one unit, Combination of other blocks may be possible. However, the combination or not is not applied collectively in an image (picture, slice, tile, etc.), but detailed conditions in units of blocks (for example, image type, encoding mode, block size / shape, prediction mode information, etc.). ) May be adaptively determined.

상술한 바와 같이 최적의 크기 및 형태의 블록을 찾은 경우, 이에 대한 모드 정보(예를 들어, 분할 정보 등)가 생성될 수 있다. 모드 정보는 블록이 속하는 구성부에서 발생하는 정보(예를 들어, 예측 관련 정보 및 변환 관련 정보 등)과 함께 비트스트림에 수록되어 복호화기로 전송될 수 있고, 복호화기에서 동일 수준의 단위로 파싱되어 영상 복호화 과정에서 사용될 수 있다.As described above, when a block having an optimal size and shape is found, mode information (for example, split information, etc.) for this may be generated. The mode information may be stored in the bitstream together with information generated by the component to which the block belongs (for example, prediction related information and transform related information) and transmitted to the decoder, and may be parsed in units of the same level by the decoder. Can be used in the video decoding process.

이하에서는 분할 방식에 대한 설명할 것이며, 설명의 편의를 위해 초기 블록이 정사각 형태인 것을 가정하지만, 초기 블록이 직사각 형태인 경우에도 동일하거나 유사하게 적용할 수 있으므로, 이에 한정되는 것은 아니다.Hereinafter, the division scheme will be described. For convenience of explanation, it is assumed that the initial block is in the form of a square, but the same may be similarly or similarly applied to the case where the initial block is in the form of a rectangle.

블록 분할을 위한 다양한 방법이 지원될 수 있지만 본 발명에서는 트리 기반의 분할에 중점을 두어 설명할 것이며, 최소 하나의 트리 분할이 지원될 수 있다. 이때, 트리 방식은 쿼드 트리(Quad Tree. QT), 바이너리 트리(Binary Tree. BT), 터너리 트리(Ternary Tree. TT) 등이 지원될 수 있다. 하나의 트리 방식이 지원되는 경우는 단일 트리 분할, 둘 이상의 트리 방식이 지원되는 경우는 다중 트리 방식이라 지칭할 수 있다.Various methods for block partitioning may be supported, but the present invention will be described with emphasis on tree-based partitioning, and at least one tree partitioning may be supported. In this case, a quad tree (Quad Tree. QT), a binary tree (BT), a ternary tree (TT), etc. may be supported. When one tree method is supported, it may be referred to as a single tree split, and when two or more tree methods are supported, a multi-tree method.

쿼드 트리 분할의 경우 블록이 가로와 세로 방향으로 각각 2분할되는 방식을 의미하고, 바이너리 트리 분할의 경우 블록이 가로 또는 세로 중 한 방향으로 2분할되는 방식을 의미하며, 터너리 트리 분할의 경우 블록이 가로 또는 세로 중 한 방향으로 3분할되는 방식을 의미한다.In the case of quad-tree splitting, this means that the blocks are divided into two in the horizontal and vertical directions, and in the case of binary tree splitting, the blocks are divided into two in either the horizontal or vertical directions. This means that the system is divided into three directions in either the horizontal or vertical direction.

본 발명에서 분할 전 블록이 M x N일 경우 쿼드 트리 분할은 4개의 M/2 x N/2으로 분할되고, 바이너리 트리 분할은 2개의 M/2 x N 또는 M x N/2로 분할되고, 터너리 트리 분할의 경우 M/4 x N / M/2 x N / M/4 x N 또는 M x N/4 / M x N/2 / M x N/4로 분할되는 경우를 가정한다. 하지만 분할 결과가 위의 경우에만 한정되지는 않으며, 다양한 변형의 예가 가능할 수 있다.In the present invention, when the pre-division block is M x N, the quad tree division is divided into four M / 2 x N / 2, and the binary tree division is divided into two M / 2 x N or M x N / 2, In the case of ternary tree partitioning, it is assumed that the partition is divided into M / 4 x N / M / 2 x N / M / 4 x N or M x N / 4 / M x N / 2 / M x N / 4. However, the splitting result is not limited to the above case, and various modification examples may be possible.

부/복호화 설정에 따라 상기 트리 분할 중 하나 이상의 방식이 지원될 수 있다. 예를 들어, 쿼드 트리 분할을 지원할 수 있거나 또는 쿼드 트리 분할과 바이너리 트리 분할을 지원할 수 있거나 또는 쿼드 트리 분할과 터너리 트리 분할을 지원할 수 있거나 또는 쿼드 트리 분할과 바이너리 트리 분할과 터너리 트리 분할을 지원할 수 있다.One or more of the tree divisions may be supported according to the encoding / decoding setting. For example, it can support quad-tree splitting, or can support quad-tree splitting and binary tree splitting, or it can support quad-tree splitting and ternary tree splitting, or it can support quad-tree splitting and binary tree splitting and ternary tree splitting. Can support

상기 예는 기본 분할 방식이 쿼드 트리이며 기타 트리 지원 여부에 따라 바이너리 트리 분할과 터너리 트리 분할이 추가 분할 방식에 포함되는 경우에 대한 예이지만, 다양한 변형이 가능할 수 있다. 이때, 기타 트리 지원 여부에 대한 정보(bt_enabled_flag, tt_enabled_flag, bt_tt_enabled_flag 등. 0 또는 1의 값을 가질 수 있고, 0이면 지원하지 않고 1이면 지원)는 부/복호화 설정에 따라 묵시적으로 정해지거나 또는 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위로 명시적으로 결정될 수 있다.The above example is a case where the basic partitioning scheme is a quad tree and binary tree partitioning and ternary tree partitioning are included in the additional partitioning scheme depending on whether other trees are supported, but various modifications may be possible. In this case, information on whether or not the other tree is supported (bt_enabled_flag, tt_enabled_flag, bt_tt_enabled_flag, etc., may have a value of 0 or 1, 0 is not supported, 1 is supported) or is implicitly determined according to the encoding / decoding setting or sequence, It may be determined explicitly in units of a picture, a slice, a tile, and the like.

분할 정보는 분할 여부에 대한 정보(tree_part_flag. 또는, qt_part_flag, bt_part_flag, tt_part_flag, bt_tt_part_flag. 0 또는 1의 값을 가질 수 있고, 0이면 분할되지 않고 1이면 분할)가 포함될 수 있다. 또한, 분할 방식(바이너리 트리, 터너리 트리)에 따라 분할 방향(dir_part_flag. 또는, bt_dir_part_flag, tt_dir_part_flag, bt_tt_dir_part_flag. 0 또는 1의 값을 가질 수 있고, 0이면 <가로/수평>이고 1이면 <세로/수직>)에 대한 정보가 추가될 수 있으며, 이는 분할이 수행되는 경우에 발생 가능한 정보일 수 있다.The split information may include information on whether to split (tree_part_flag. Or qt_part_flag, bt_part_flag, tt_part_flag, bt_tt_part_flag. The value may be 0 or 1, and 0 may be split and 1 is split). In addition, depending on the partitioning scheme (binary tree, ternary tree), the split direction (dir_part_flag., Or bt_dir_part_flag, tt_dir_part_flag, bt_tt_dir_part_flag. Vertical>) may be added, which may be information that may occur when splitting is performed.

복수의 트리 분할이 지원되는 경우에는 다양한 분할 정보 구성이 가능할 수 있다. 다음은 하나의 깊이(Depth) 수준(즉, 지원되는 분할 깊이가 하나 이상으로 설정되어 재귀적인 분할이 가능할 수도 있지만 설명의 편의를 위한 목적)에서 분할 정보가 어떻게 구성되어 있는지에 대한 예로 가정하여 설명한다.When a plurality of tree partitions are supported, various partition information configurations may be possible. The following description assumes an example of how the partition information is configured at one depth level (ie, for the convenience of explanation, although recursive partitioning may be possible because one or more supported partition depths are set to one or more). do.

일 예(1)로, 분할 여부에 대한 정보를 확인한다. 이때, 분할이 수행되지 않는 경우라면 분할이 종료된다.As an example (1), information on whether to divide is checked. At this time, if the division is not performed, the division ends.

만약 분할이 수행되는 경우라면 분할 종류에 대한 선택 정보(예를 들어, tree_idx. 0이면 QT, 1이면 BT, 2이면 TT)를 확인한다. 이때, 선택되는 분할 종류에 따라 분할 방향 정보를 추가로 확인하고 다음 단계(분할 깊이가 최대에 도달하지 않은 경우 등의 이유로 추가 분할이 가능하다면 다시 처음부터 시작하고, 분할이 불가한 경우라면 분할 종료)로 넘어간다.If the split is performed, the selection information on the split type (for example, tree_idx. 0 is QT, 1 is BT, 2 is TT) is checked. At this time, additionally check the split direction information according to the selected split type, and start again from the beginning if additional splitting is possible due to the next step (when the split depth has not reached the maximum, or end splitting if splitting is not possible). Go to).

일 예(2)로, 일부 트리 방식(QT)에 대한 분할 여부에 대한 정보를 확인하고 다음 단계로 넘어간다. 이때, 분할이 수행되지 않는 경우라면 일부 트리 방식(BT)의 분할 여부에 대한 정보를 확인한다. 이때, 분할이 수행되지 않는 경우라면 일부 트리 방식(TT)의 분할 여부에 대한 정보를 확인한다. 이때, 분할이 수행되지 않는 경우라면 분할이 종료된다.In one example (2), the information on whether to split some tree methods (QT) is checked and the process proceeds to the next step. In this case, if the split is not performed, information on whether or not the partial tree method BT is split is checked. In this case, if the split is not performed, information on whether or not the partial tree method TT is split is checked. At this time, if the division is not performed, the division ends.

만약 일부 트리 방식(QT)의 분할이 수행되는 경우라면 다음 단계로 넘어간다. 또한, 만약 일부 트리 방식(BT)의 분할이 수행되는 경우라면 분할 방향 정보를 확인하고 다음 단계로 넘어간다. 또한, 만약 일부 트리 분할 방식(TT)의 분할이 수행되는 경우라면 분할 방향 정보를 확인하고 다음 단계로 넘어간다.If splitting of some tree type (QT) is performed, the process proceeds to the next step. In addition, if the splitting of some tree methods BT is performed, the split direction information is checked and the process proceeds to the next step. In addition, if the split of some tree split schemes (TT) is performed, the split direction information is checked and the process proceeds to the next step.

일 예(3)로, 일부 트리 방식(QT)에 대한 분할 여부에 대한 정보를 확인한다. 이때, 분할이 수행되지 않는 경우라면 일부 트리 방식(BT와 TT)의 분할 여부에 대한 정보를 확인한다. 이때, 분할이 수행되지 않는 경우라면 분할이 종료된다.In one example (3), the information on whether to split for some tree method (QT) is checked. At this time, if the split is not performed, the information on whether or not to split some tree methods (BT and TT) is checked. At this time, if the division is not performed, the division ends.

만약 일부 트리 방식(QT)의 분할이 수행되는 경우라면 다음 단계로 넘어간다. 또한, 만약 일부 트리 방식(BT와 TT)의 분할이 수행되는 경우라면 분할 방향 정보를 확인하고 다음 단계로 넘어간다.If splitting of some tree type (QT) is performed, the process proceeds to the next step. In addition, if splitting of some tree methods BT and TT is performed, the split direction information is checked and the process proceeds to the next step.

상기 예는 트리 분할의 우선 순위가 존재(2번과 3번 예)하거나 존재하지 않는 경우(1번 예)일 수 있으나, 다양한 변형의 예가 가능할 수 있다. 또한, 상기 예에서 현재 단계의 분할은 이전 단계의 분할 결과와는 무관한 경우를 설명하는 예이지만, 현재 단계의 분할이 이전 단계의 분할 결과에 의존적인 설정 또한 가능할 수 있다.The above example may be the case where the priority of the tree split exists (examples 2 and 3) or does not exist (example 1), but various modification examples may be possible. In addition, in the above example, the division of the current step is an example for explaining a case that is not related to the division result of the previous step, but it may also be possible to set the division of the current step depending on the division result of the previous step.

예를 들어, 1 내지 3번 예의 경우 이전 단계에서 일부 트리 방식의 분할(QT)이 수행되어 현재 단계로 넘어온 경우라면 현재 단계에서도 동일 트리 방식(QT)의 분할이 지원될 수 있다. For example, in the case of the first to third examples, if the tree-type partitioning (QT) is performed in the previous step and the current step is transferred to the current step, the splitting of the same tree method (QT) may be supported in the current step.

반면, 이전 단계에서 일부 트리 방식의 분할(QT)이 수행되지 않고 다른 트리 방식의 분할(BT 또는 TT)이 수행되어 현재 단계로 넘어온 경우라면 일부 트리 방식의 분할(QT)을 제외하고 일부 트리 방식의 분할(BT와 TT)이 현재 단계를 포함한 후속 단계에 지원되는 설정 또한 가능할 수 있다.On the other hand, if some tree-type splitting (QT) is not performed in the previous step and another tree-type splitting (BT or TT) is carried out to the current step, except for some tree-type splitting (QT), some tree-type splitting is performed. It may also be possible that the division of (BT and TT) is supported for subsequent steps, including the current step.

위와 같은 경우에는 블록 분할에 지원되는 트리 구성이 적응적일 수 있다는 것을 의미하므로, 전술한 분할 정보 구성 또한 달리 구성될 수 있음을 의미한다. (후술하는 예는 3번 예로 가정) 즉, 상기 예에서 일부 트리 방식(QT)의 분할이 이전 단계에서 수행되지 않았을 경우, 현재 단계에서는 일부 트리 방식(QT)은 고려하지 않고 분할 과정이 수행될 수 있다. 또한, 관련 트리 방식에 관한 분할 정보(예를 들어, 분할 여부에 대한 정보, 분할 방향 정보 등. 본 예<QT>에서는 분할 여부에 대한 정보)는 제거하여 구성될 수 있다.In the above case, since the tree configuration supported for block partitioning may be adaptive, the partitioning information configuration described above may also be configured differently. (Examples to be described below are assumed to be examples 3) In other words, if the splitting of some tree methods (QT) is not performed in the previous step, the splitting process may be performed without considering some tree methods (QT) in the present step. Can be. In addition, splitting information (eg, splitting information, splitting direction information, etc.) regarding the related tree method may be configured by removing the splitting information.

상기 예는 블록 분할이 허용되는 경우(예를 들어, 블록 크기가 최대값과 최소값 사이의 범위 내에 존재, 각 트리 방식의 분할 깊이가 최대 깊이<허용 깊이>에 도달하지 않음 등)에 대한 적응적인 분할 정보 구성에 관한 경우이며, 블록 분할이 제한되는 경우(예를 들어, 블록 크기가 최대값과 최소값 사이의 범위에 존재하지 않음, 각 트리 방식의 분할 깊이가 최대 깊이에 도달함 등)에도 적응적인 분할 정보 구성이 가능할 수 있다.The above example is adaptive for the case where block partitioning is allowed (e.g., block size is within the range between the maximum and minimum values, the partitioning depth of each tree method does not reach the maximum depth <allowed depth>, etc.). It is related to the structure of partitioning information, and adapts to the case where the block partitioning is limited (for example, the block size does not exist in the range between the maximum value and the minimum value, the partitioning depth of each tree method reaches the maximum depth, etc.). Partitioning information may be configured.

이미 언급한 것과 같이 본 발명에서 트리 기반의 분할은 재귀적인 방식을 사용하여 수행될 수 있다. 예를 들어, 분할 깊이가 k인 부호화 블록의 분할 플래그가 0인 경우 부호화 블록의 부호화는 분할 깊이가 k인 부호화 블록에서 수행되며, 분할 깊이가 k인 부호화 블록의 분할 플래그가 1인 경우 부호화 블록의 부호화는 분할 방식에 따라 분할 깊이가 k+1인 N개의 서브 부호화 블록(이때, N은 2, 3, 4와 같은 2 이상의 정수)에서 수행된다.As already mentioned, tree-based partitioning in the present invention can be performed using a recursive manner. For example, when the partition flag of the coding block having the partition depth k is 0, encoding of the coding block is performed in the coding block having the partition depth k, and when the partition flag of the coding block having the partition depth k is 1, the coding block. The encoding of is performed in N sub-coding blocks having a division depth of k + 1 (wherein N is an integer of 2 or more, such as 2, 3, 4) according to a division scheme.

상기 서브 부호화 블록은 다시 부호화 블록(k+1)으로 설정되어 상기 과정을 거쳐 서브 부호화 블록(k+2)으로 분할될 수 있으며, 이러한 계층적 분할 방식은 분할 범위 및 분할 허용 깊이 등의 분할 설정에 따라 결정될 수 있다.The sub coded block may be set again to a coded block k + 1 and divided into sub coded blocks k + 2 through the above process. It can be determined according to.

이때, 분할 정보를 표현하기 위한 비트스트림 구조는 하나 이상의 스캔 방법 중 선택할 수 있다. 예를 들어, 분할 깊이 순서 기준으로 분할 정보의 비트스트림을 구성할 수 있거나 분할 여부 기준으로 분할 정보의 비트스트림을 구성할 수 있다.In this case, the bitstream structure for expressing the partition information may be selected from one or more scan methods. For example, the bitstream of the split information may be configured based on the split depth order, or the bitstream of the split information may be configured based on whether the split information is divided.

예를 들어, 분할 깊이 순서 기준의 경우 최초 블록 기준으로 현 수준의 깊이에서의 분할 정보를 획득한 후 다음 수준의 깊이에서의 분할 정보를 획득하는 방법이며, 분할 여부 기준의 경우 최초 블록 기준으로 분할된 블록에서의 추가 분할 정보를 우선적으로 획득하는 방법을 의미하며, 다른 추가적인 스캔 방법이 고려될 수 있다. 본 발명에서는 분할 여부 기준으로 분할 정보의 비트스트림을 구성하는 경우를 가정한다.For example, in the case of the partition depth ordering method, after obtaining partitioning information at the current level of depth based on the first block, the partitioning information is obtained at the next level of depth. A method of preferentially acquiring additional splitting information in the received block, and another additional scanning method may be considered. In the present invention, it is assumed that a bitstream of partitioning information is configured based on partitioning.

전술한 것과 같이 블록 분할에 관한 다양한 경우를 살펴보았으며, 블록 분할에 관한 고정적이거나 적응적인 설정이 지원될 수 있다.As described above, various cases regarding block partitioning have been described, and a fixed or adaptive setting regarding block partitioning may be supported.

이때, 블록 분할에 관한 설정은 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에서 관련 정보를 명시적으로 포함할 수 있다. 또는, 부/복호화 설정에 따라 묵시적으로 블록 분할 설정이 정해질 수 있으며, 여기서 부/복호화 설정은 영상 타입(I/P/B), 컬러 성분, 분할 종류, 분할 깊이 등의 다양한 부/복호화 요소 중 하나 또는 둘 이상의 조합에 따라 구성될 수 있다.In this case, the setting regarding block division may explicitly include related information in units of a sequence, a picture, a slice, a tile, and the like. Alternatively, the block division setting may be implicitly determined according to the sub / decoding setting, wherein the sub / decoding setting includes various sub / decoding elements such as image type (I / P / B), color component, type of division, and depth of division. It may be configured according to one or a combination of two or more.

본 발명의 일 실시예에 따른 영상 부호화 방법에서 화면내 예측은 다음과 같이 구성될 수 있다. 예측부의 화면내 예측은 참조 화소 구성 단계, 예측 블록 생성 단계, 예측 모드 결정 단계, 예측 모드 부호화 단계를 포함할 수 있다. 또한, 영상 부호화 장치는 참조 화소 구성 단계, 예측 블록 생성 단계, 예측 모드 결정 단계, 예측 모드 부호화 단계를 구현하는 참조 화소 구성부, 예측 블록 생성부, 예측 모드 부호화부를 포함하도록 구성할 수 있다. 전술한 과정의 일부는 생략될 수 있거나 다른 과정이 추가될 수 있고, 상기 기재된 순서가 아닌 다른 순서로 변경될 수 있다.In the image encoding method according to an embodiment of the present invention, the intra prediction may be configured as follows. The intra prediction of the prediction unit may include a reference pixel construction step, a prediction block generation step, a prediction mode determination step, and a prediction mode encoding step. In addition, the image encoding apparatus may be configured to include a reference pixel constructing unit, a predictive block generating unit, and a prediction mode encoding unit for implementing a reference pixel constructing step, a predictive block generating step, a prediction mode determining step, and a prediction mode encoding step. Some of the processes described above may be omitted or other processes may be added, and may be changed in an order other than the order described above.

도 4는 본 발명의 일 실시예에 따른 화면내 예측 모드를 나타낸 예시도이다.4 is an exemplary diagram illustrating an intra prediction mode according to an embodiment of the present invention.

도 4를 참조하면, 67개의 예측 모드가 화면내 예측을 위한 예측 모드 후보군으로 구성되어 있으며, 이 중 65개는 방향성 모드이고 2개는 비방향성 모드(DC, Planar)인 경우를 가정하여 설명하지만 이에 한정되지 않고 다양한 구성이 가능할 수 있다. 이때, 방향성 모드는 기울기(예를 들어, dy/dx) 또는 각도 정보(Degree)로 구분할 수 있다. 또한, 상기 예측 모드의 전부 또는 일부가 휘도 성분 또는 색차 성분의 예측 모드 후보군에 포함될 수 있고, 그 외의 추가적인 모드가 예측 모드 후보군에 포함될 수 있다.Referring to FIG. 4, it is assumed that 67 prediction modes are configured as prediction mode candidate groups for intra prediction, of which 65 are directional modes and 2 are non-directional modes (DC, Planar). Not limited to this, various configurations may be possible. In this case, the directional mode may be divided into tilt (eg, dy / dx) or angle information (Degree). In addition, all or part of the prediction mode may be included in the prediction mode candidate group of the luminance component or the chrominance component, and other additional modes may be included in the prediction mode candidate group.

본 발명에서 방향성 모드의 방향은 직선형(Straight line)을 의미할 수 있으며, 곡선형(Curve)의 방향성 모드 또한 추가로 예측 모드로 구성할 수 있다. 또한, 비방향성 모드의 경우 현재 블록의 인접한 주변 블록(예를 들어, 좌, 상, 좌상, 우상, 좌하 블록 등)의 화소의 평균(또는 가중치 평균 등)으로 예측 블록을 획득하는 DC 모드, 주변 블록의 화소를 선형 보간 등을 통해 예측 블록을 획득하는 Planar 모드를 포함할 수 있다.In the present invention, the direction of the directional mode may mean a straight line, and the curvature directional mode may further be configured as a prediction mode. In addition, in the non-directional mode, the DC mode for obtaining a prediction block with an average (or weighted average, etc.) of pixels of adjacent neighboring blocks (eg, left, top, top left, top right, bottom left blocks, etc.) of the current block. The pixel of the block may include a planar mode for obtaining a prediction block through linear interpolation.

여기서, DC 모드의 경우 예측 블록 생성에 사용되는 참조 화소는 좌, 상, 좌+상, 좌+좌하, 상+우상, 좌+상+좌하+우상 등과 같은 다양한 조합으로 묶인 블록에서 획득될 수 있으며, 영상 타입, 컬러 성분, 블록의 크기/형태/위치 등에 의해 정의되는 부/복호화 설정에 따라 참조 화소 획득 블록 위치가 정해질 수 있다.In the DC mode, the reference pixel used to generate the prediction block may be obtained from blocks that are bound in various combinations such as left, top, left + top, left + left, top + top, left + top + bottom + top, and the like. The reference pixel acquisition block position may be determined according to a sub / decoding setting defined by an image type, a color component, and a size / shape / position of a block.

여기서, Planar 모드의 경우 예측 블록 생성에 사용되는 화소는 참조 화소로 구성된 영역(예를 들어, 좌, 상, 좌상, 우상, 좌하 등)과 참조 화소로 구성되지 않는 영역(예를 들어, 우, 하, 우하 등)에서 획득될 수 있는데, 참조 화소로 구성되지 않는 영역(즉, 부호화되지 않음)의 경우 참조 화소로 구성된 영역에서 하나 이상의 화소를 사용(예를 들어, 그대로 복사, 가중치 평균 등)하여 묵시적으로 획득할 수 있거나 또는 참조 화소로 구성되지 않는 영역의 최소 하나의 화소에 대한 정보를 명시적으로 발생시킬 수 있다. 그래서 위와 같이 참조 화소로 구성된 영역과 참조 화소로 구성되지 않는 영역을 사용하여 예측 블록을 생성할 수 있다.Here, in the planar mode, the pixel used for generating the prediction block includes a region consisting of reference pixels (eg, left, top, top left, top right, bottom left, etc.) and a region not consisting of reference pixels (eg, right, Lower, lower right, etc.), in the case of areas not configured as reference pixels (i.e., uncoded), one or more pixels are used in the area configured as reference pixels (e.g., copy as is, weighted average, etc.) It is possible to explicitly generate information on at least one pixel of an area which may be obtained implicitly or not constituted of a reference pixel. Thus, a prediction block can be generated using an area composed of reference pixels and an area not composed of reference pixels as described above.

도 5는 본 발명의 일 실시예에 따른 방향성 모드와 비방향성 모드에 관한 화면내 예측을 나타내는 개념도이다.5 is a conceptual diagram illustrating in-screen prediction of a directional mode and a non-directional mode according to an embodiment of the present invention.

도 5의 (a)를 참조하면 수직(5a), 수평(5b), 대각선(5c 내지 5e) 방향의 모드에 따른 화면내 예측을 나타내고 있다. 도 5의 (b)를 참조하면, DC 모드에 따른 화면내 예측을 나타내고 있다. 도 5의 (c)를 참조하면, Planar 모드에 따른 화면내 예측을 나타내고 있다.Referring to FIG. 5A, intra prediction is shown according to modes in the vertical 5a, horizontal 5b, and diagonal 5c to 5e directions. Referring to FIG. 5B, intra prediction according to the DC mode is illustrated. Referring to FIG. 5C, the intra prediction according to the planar mode is illustrated.

상기 설명 외의 추가적인 비방향성 모드가 포함될 수 있으며, 본 발명에서는 직선형 방향성 모드와 DC, Planar의 비방향성 모드를 중심으로 설명하지만, 다른 경우로의 변경 적용 또한 가능할 수 있다.Additional non-directional modes other than the above description may be included, and the present invention will be described based on the linear directional mode and the non-directional modes of DC and Planar. However, changes to other cases may also be possible.

도 4는 블록의 크기에 상관없이 고정적으로 지원되는 예측 모드일 수 있다. 또한, 블록의 크기에 따라 지원되는 예측 모드는 도 4와 다를 수 있다.4 may be a prediction mode fixedly supported regardless of the size of a block. In addition, the prediction mode supported according to the size of the block may be different from FIG. 4.

예를 들어, 예측 모드 후보군의 개수가 적응적(예를 들어, 예측 모드 사이의 각도는 등간격이지만, 각도를 달리 설정함. 방향성 모드를 기준으로 9, 17, 33, 65, 129개 등)이거나 또는 예측 모드 후보군의 개수는 고정적이지만 다른 구성(예를 들어, 방향성 모드 각도, 비방향성 종류 등)으로 이뤄질 수 있다.For example, the number of prediction mode candidates is adaptive (for example, the angles between the prediction modes are equally spaced, but the angles are set differently. 9, 17, 33, 65, 129, etc. based on the directional mode). The number of prediction mode candidates may be fixed but may be of different configuration (eg, directional mode angle, non-directional type, etc.).

또한, 도 4는 블록의 형태에 상관없이 고정적으로 지원되는 예측 모드일 수 있다. 또한, 블록의 형태에 따라 지원되는 예측 모드는 도 4와 다를 수 있다. In addition, FIG. 4 may be a prediction mode fixedly supported regardless of the shape of a block. In addition, the prediction mode supported according to the shape of the block may be different from FIG. 4.

예를 들어, 예측 모드 후보군의 개수가 적응적(예를 들어, 블록의 가로/세로 비에 따라 수평 또는 수직 방향에서 파생되는 예측 모드의 개수를 적거나 많게 설정)이거나 또는 예측 모드 후보군의 개수는 고정적이지만 다른 구성(예를 들어, 블록의 가로/세로 비에 따라 수평 또는 수직 방향에서 파생되는 예측 모드를 더 세밀하게 설정)으로 이뤄질 수 있다.For example, the number of prediction mode candidates is adaptive (e.g., the number of prediction modes derived from the horizontal or vertical direction depending on the aspect ratio of the block is small or high) or the number of prediction mode candidates is It may be fixed but in a different configuration (e.g., more precisely set the prediction mode derived from the horizontal or vertical direction depending on the aspect ratio of the block).

또는, 블록의 길이가 긴 쪽의 예측 모드는 더 많은 개수를, 블록의 길이가 짧은 쪽의 예측 모드는 더 적은 개수를 지원할 수 있으며, 블록의 길이가 긴 쪽의 경우 예측 모드 간격을 도 4에서 66번 모드의 오른쪽에 위치한 모드(예를 들어, 50번 모드 기준으로 +45도 이상의 각도를 갖는 모드. 즉, 67 내지 80번 등의 번호를 갖는 모드) 또는 2번 모드의 왼쪽에 위치한 모드(예를 들어, 18번 모드 기준으로 -45도 이상의 각도를 갖는 모드. 즉, -1 내지 -14번 등의 번호를 갖는 모드)를 지원할 수도 있다. 이는 블록의 가로와 세로의 길이 비에 따라 결정될 수 있으며, 그 반대의 상황이 가능할 수도 있다.Alternatively, the prediction mode of the longer block may support a larger number, and the prediction mode of a shorter block may support a smaller number. In the case of a longer block, the prediction mode interval may be represented in FIG. 4. The mode located to the right of mode 66 (for example, a mode with an angle of +45 degrees or more relative to mode 50, that is, a mode with numbers such as 67 to 80) or the mode to the left of mode 2 ( For example, a mode having an angle of -45 degrees or more based on mode 18, that is, a mode having a number such as -1 to -14 may be supported. This can be determined by the ratio of the width to the length of the block, and vice versa.

본 발명에서는 도 4와 같이 예측 모드가 (어떤 부/복호화 요소에 상관없이) 고정적으로 지원되는 예측 모드인 경우를 중심으로 설명하지만, 부호화 설정에 따라 적응적으로 지원되는 예측 모드 설정 또한 가능할 수 있다.In the present invention, the prediction mode will be described with reference to the case where the prediction mode is fixedly supported (regardless of any sub / decoding factor) as shown in FIG. 4, but it is also possible to set the prediction mode that is adaptively supported according to the encoding setting. .

또한, 예측 모드를 분류할 때 수평과 수직 모드(18번과 50번 모드), 일부 대각선 모드(Diagonal up right<2번>, Diagonal down right<34번>, Diagonal down left<66번> 등) 등이 기준이 될 수 있는데, 이는 일부 방향성(또는 각도. 45도, 90도 등)에 기반하여 수행되는 분류 방법일 수 있다. In addition, when classifying prediction modes, horizontal and vertical modes (modes 18 and 50), some diagonal modes (Diagonal up right <2>, Diagonal down right <34>, Diagonal down left <66>, etc.) Etc. may be a reference, which may be a classification method performed based on some directionality (or angle, 45 degrees, 90 degrees, etc.).

그리고 방향성 모드 중 양 끝에 위치한 일부 모드(2번과 66번 모드)가 예측 모드 분류에 기준이 되는 모드일 수 있는데, 이는 도 4와 같은 화면내 예측 모드 구성일 때 가능한 예이다. 즉, 예측 모드 구성이 적응적일 경우에는 상기 기준이 되는 모드가 변경되는 예 또한 가능할 수 있다. 예를 들어, 2번 모드가 2보다 작거나 큰 번호를 갖는 모드(-2, -1, 3, 4 등)로 대체되거나, 66번 모드가 66보다 작거나 큰 번호를 갖는 모드(64, 66, 67, 68 등)로 대체되는 것이 가능할 수 있다.In addition, some modes (modes 2 and 66) located at both ends of the directional mode may be a mode used as the reference mode for classification of prediction modes, which is an example when the intra prediction mode is configured as shown in FIG. 4. That is, when the prediction mode configuration is adaptive, an example in which the reference mode is changed may also be possible. For example, mode 2 may be replaced with a mode with a number less than or greater than 2 (-2, -1, 3, 4, etc.), or mode 66 with a number less than or greater than 66 (64, 66). , 67, 68, etc.).

또한, 컬러 성분에 관한 추가적인 예측 모드가 예측 모드 후보군에 포함될 수 있다. 다음을 통해 상기 예측 모드에 대한 예로 컬러 복사 모드와 컬러 모드에 대한 설명을 이어간다.In addition, an additional prediction mode regarding the color component may be included in the prediction mode candidate group. The following describes the color copy mode and the color mode as an example of the prediction mode through the following.

(컬러 복사 모드)(Color Copy Mode)

다른 컬러 공간 내 위치한 영역으로부터 예측 블록 생성을 위한 데이터를 획득하는 방법과 관련된 예측 모드가 지원될 수 있다.A prediction mode related to a method of obtaining data for generating a prediction block from an area located in another color space may be supported.

예를 들어, 컬러 공간 간의 상관성을 이용하여 예측 블록 생성을 위한 데이터를 다른 컬러 공간에서 획득하는 방법에 대한 예측 모드가 그에 대한 예가 될 수 있다.For example, a prediction mode for a method of obtaining data for generating a prediction block in another color space using correlation between color spaces may be an example.

도 6은 본 발명의 일 실시예에 따른 컬러 복사 모드에 관한 화면내 예측을 나타내는 개념도이다. 도 6을 참조하면, 현재 컬러 공간(M)의 현재 블록(C)은 동일 시간(t)에 다른 컬러 공간(N)의 대응되는 영역(D)의 데이터를 사용하여 예측을 수행할 수 있다.6 is a conceptual diagram illustrating an intra prediction according to a color copy mode according to an embodiment of the present invention. Referring to FIG. 6, the current block C of the current color space M may perform prediction using data of a corresponding area D of another color space N at the same time t.

이때, 컬러 공간 간의 상관성은 YCbCr을 예로 들 경우 Y와 Cb, Y와 Cr, Cb와 Cr 간의 상관성을 의미할 수 있다. 즉, 색차 성분(Cb 또는 Cr)의 경우 현재 블록과 대응되는 휘도 성분(Y)의 복원된 블록을 현재 블록의 예측 블록으로 사용할 수 있다(색차 vs 휘도가 후술하는 예의 기본 설정). 또는, 일부 색차 성분(Cr 또는 Cb)의 현재 블록과 대응되는 일부 색차 성분(Cb 또는 Cr)의 복원된 블록을 현재 블록의 예측 블록으로 사용할 수 있다.In this case, the correlation between the color space may mean the correlation between Y and Cb, Y and Cr, and Cb and Cr when YCbCr is taken as an example. That is, in the case of the color difference component Cb or Cr, a reconstructed block of the luminance component Y corresponding to the current block may be used as the prediction block of the current block (basic setting of an example in which color difference vs luminance is described later). Alternatively, a reconstructed block of some color difference components Cb or Cr corresponding to the current block of some color difference components Cr or Cb may be used as a prediction block of the current block.

여기서, 현재 블록과 대응되는 영역은 일부 컬러 포맷(예로, YCbCr 4:4:4 등)의 경우 각 영상 내 절대적인 위치가 동일할 수 있다. 또는, 일부 컬러 포맷(예로, YCbCr 4:2:0 등)의 경우 각 영상 내 상대적인 위치가 동일할 수 있다. 이는 컬러 포맷에 따른 가로와 세로 길이 비에 따라 대응되는 위치가 정해질 수 있으며, 현재 영상의 화소와 다른 컬러 공간의 대응되는 화소는 현재 화소의 좌표의 각 구성 성분에 컬러 포맷에 따른 가로와 세로의 길이 비로 곱하거나 나눠줌으로써 획득 가능할 수 있다.Here, in some color formats (eg, YCbCr 4: 4: 4, etc.), an area corresponding to the current block may have the same absolute position in each image. Alternatively, in some color formats (eg, YCbCr 4: 2: 0, etc.), relative positions within each image may be the same. The corresponding position may be determined according to the ratio of width and height according to the color format, and the corresponding pixel in the color space different from the pixel of the current image has width and height according to the color format in each component of the coordinates of the current pixel. It can be obtained by multiplying or dividing by the length ratio of.

설명의 편의를 위해 일부 컬러 포맷(4:4:4)인 경우를 중심으로 설명하지만, 다른 컬러 공간의 대응되는 영역의 위치는 컬러 포맷에 따른 가로/세로 길이 비에 따라 결정될 수 있음을 이해하여야 한다.For convenience of description, some color formats (4: 4: 4) will be mainly described, but it should be understood that the position of the corresponding area in another color space may be determined according to the width / length length ratio according to the color format. do.

컬러 복사 모드에서 다른 컬러 공간의 복원된 블록을 그대로 예측 블록으로 사용할 수 있거나 컬러 공간 간의 상관성을 고려하여 획득된 블록을 예측 블록으로 사용할 수 있다. 컬러 공간 간의 상관성을 고려하여 획득된 블록은 기존 블록에 보정을 수행하여 획득될 수 있는 블록을 의미한다. 상세하게는, {P = a * R + b}의 수식에서 a와 b는 보정을 위해 사용되는 값을 의미하고, R과 P는 각각 다른 컬러 공간에서 획득된 값과 현재 컬러 공간의 예측값을 의미할 수 있다. 여기서 P가 컬러 공간 간의 상관성을 고려하여 획득된 블록을 의미한다.In the color copy mode, a reconstructed block of another color space may be used as a prediction block as it is, or a block obtained in consideration of correlation between color spaces may be used as a prediction block. A block obtained by considering correlation between color spaces refers to a block that can be obtained by performing correction on an existing block. Specifically, in the formula {P = a * R + b}, a and b denote values used for correction, and R and P denote values obtained from different color spaces and prediction values of the current color space, respectively. can do. Here, P means a block obtained in consideration of the correlation between color spaces.

본 예에서는 컬러 공간 간의 상관성을 이용하여 획득되는 데이터를 현재 블록의 예측값으로 사용하는 경우를 가정하여 설명하나, 해당 데이터를 이미 존재하는 현재 블록의 예측값에 적용되는 보정값으로 사용되는 경우 또한 가능할 수 있다. 즉, 다른 컬러 공간의 잔차값으로 현재 블록의 예측값을 보정할 수 사용할 수 있다.In this example, it is assumed that data obtained by using the correlation between color spaces is used as a prediction value of the current block, but it may also be possible when the data is used as a correction value applied to the prediction value of a current block that already exists. have. That is, the prediction value of the current block may be corrected using the residual value of another color space.

본 발명에서는 전자의 경우를 가정하여 설명하오나 이에 한정되지 않고 보정값으로 사용되는 경우로의 동일하거나 변경 적용이 가능할 수 있다.In the present invention, it is assumed that the former case is described, but the present invention is not limited thereto, and the same or modified application to the case used as a correction value may be possible.

컬러 복사 모드는 부/복호화 설정에 따라 명시적 또는 묵시적으로 지원 여부가 정해질 수 있다. 이때, 영상 타입, 컬러 성분, 블록의 위치/크기/형태, 블록의 가로/세로 비 등에서 하나 또는 둘 이상의 조합에 따라 부/복호화 설정이 정의될 수 있다. 그리고 명시적인 경우에는 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위로 관련 정보가 포함될 수 있다. 또한, 부/복호화 설정에 따라 컬러 복사 모드의 지원 여부는 일부 경우에 묵시적으로 정해질 수 있고, 일부 경우에는 명시적으로 관련 정보가 발생할 수도 있다.The color copy mode may be supported explicitly or implicitly depending on the encoding / decoding setting. In this case, the encoding / decoding setting may be defined according to one or more combinations of the image type, color component, position / size / shape of the block, aspect ratio of the block, and the like. In an explicit case, related information may be included in units of a sequence, a picture, a slice, a tile, and the like. In addition, depending on the encoding / decoding setting, whether or not the color copy mode is supported may be implicitly determined in some cases, and related information may be explicitly generated in some cases.

컬러 복사 모드에서 컬러 공간 간의 상관성 정보(a와 b 등)는 부/복호화 설정에 따라 명시적으로 발생하거나 묵시적으로 획득될 수 있다.In the color copy mode, correlation information (a and b, etc.) between color spaces may be explicitly generated or implicitly obtained according to the encoding / decoding setting.

이때, 상관성 정보를 획득하기 위해 비교(또는 참조)되는 영역은 현재 블록(도 6의 C)과 다른 컬러 공간의 대응되는 영역(도 6의 D)일 수 있다. 또는, 현재 블록의 인접한 영역(도 6의 C를 중심으로 좌, 상, 좌상, 우상, 좌하 블록 등)과 다른 컬러 공간이 대응되는 영역의 인접한 영역(도 6의 D를 중심으로 좌, 상, 좌상, 우상, 좌하 블록 등)일 수 있다.In this case, an area to be compared (or referenced) to obtain correlation information may be a corresponding area (D of FIG. 6) of a different color space from the current block (C of FIG. 6). Alternatively, adjacent areas of the current block (left, upper, upper left, upper right, lower left block, etc. centering on C of FIG. 6) and adjacent areas (left, upper, Upper left, upper right, lower left block, etc.).

상기 설명에서 전자의 경우 상관성 정보는 현재 블록과 대응되는 블록의 데이터를 사용하여 직접 획득되어야 하므로 관련 정보를 명시적으로 처리하는 예에 해당할 수 있다. 즉, 현재 블록의 데이터는 아직 부호화가 완료되지 않았기 때문에 상관성 정보가 생성되어야 하는 경우일 수 있다. 후자의 경우 상관성 정보를 현재 블록의 인접한 영역과 대응되는 블록의 인접한 영역의 데이터를 사용하여 간접적으로 획득될 수 있으므로 관련 정보를 묵시적으로 처리하는 예에 해당할 수 있다.In the former case, since the correlation information needs to be directly obtained by using data of a block corresponding to the current block, it may correspond to an example of explicitly processing related information. That is, the data of the current block may be a case where correlation information has to be generated because encoding has not been completed yet. In the latter case, since correlation information may be obtained indirectly using data of an adjacent area of a block corresponding to an adjacent area of the current block, this may correspond to an example of implicitly processing related information.

정리하면, 전자의 경우 현재 블록과 대응되는 블록을 비교하여 상관성 정보를 획득하고, 후자의 경우 현재 블록과 대응되는 블록에 각각 인접한 영역을 비교하여 상관성 정보를 획득한다. 그리고 상관성 정보를 대응되는 블록에 적용하여 획득된 데이터를 현재 블록의 예측 화소로 사용할 수 있다.In summary, in the former case, correlation information is obtained by comparing a block corresponding to the current block, and in the latter case, correlation information is obtained by comparing regions adjacent to the block corresponding to the current block. Data obtained by applying the correlation information to the corresponding block may be used as the prediction pixel of the current block.

여기서, 전자의 경우 상관성 정보를 그대로 부호화할 수 있거나 또는 인접한 영역을 비교하여 획득되는 상관성 정보를 예측값으로 삼아 그 차분치에 대한 정보를 부호화할 수 있다. 상기 상관성 정보는 컬러 복사 모드가 예측 모드로 선정될 경우 발생 가능한 정보일 수 있다.Here, in the former case, the correlation information may be encoded as it is, or information on the difference may be encoded using the correlation information obtained by comparing adjacent regions as a prediction value. The correlation information may be information that may occur when the color copy mode is selected as the prediction mode.

여기서, 후자의 경우 예측 모드 후보군에서 컬러 복사 모드가 최적의 모드로 선정되는 것을 제외하면 추가적으로 발생하는 정보가 없는 것으로 묵시적인 경우의 일 예로 이해할 수 있다. 즉, 이것은 하나의 상관성 정보가 지원되는 설정 하에 가능한 예일 수 있다.The latter case may be understood as an example of an implied case in which no additional information is generated except that the color copy mode is selected as the optimal mode in the prediction mode candidate group. That is, this may be an example possible under the setting in which one correlation information is supported.

만약 둘 이상의 상관성 정보가 지원되는 설정 하에서는 컬러 복사 모드가 최적의 모드로 선정되는 것에 추가적으로 상관성 정보에 대한 선택 정보가 요구될 수 있다. 상기 예와 같이 부/복호화 설정에 따라 명시적인 경우와 묵시적인 경우가 혼합되는 구성 또한 가능할 수도 있다.If two or more types of correlation information are supported, selection information for correlation information may be required in addition to selecting a color copy mode as an optimal mode. Like the above example, a configuration in which the explicit case and the implicit case are mixed according to the encoding / decoding setting may be possible.

본 발명에서는 상관성 정보가 간접적으로 획득되는 경우를 중심으로 설명할 것이며, 이때 획득되는 상관성 정보는 N개 이상(N은 1, 2, 3과 같은 1 이상의 정수)일 수 있다. 상관성 정보의 개수에 대한 설정 정보는 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에서 포함될 수 있다. 후술하는 예 중 일부에서 상관성 정보가 k개 지원되는 경우는 컬러 복사 모드가 k개 지원되는 경우와 동일한 의미일 수 있음을 이해하여야 한다.In the present invention, description will be made mainly on the case where the correlation information is obtained indirectly, and the correlation information obtained may be N or more (N is an integer of 1 or more such as 1, 2, 3). The setting information about the number of correlation information may be included in units of a sequence, a picture, a slice, a tile, and the like. In some of the examples described below, it should be understood that the case where k correlation information is supported may mean the same as the case where k color copy modes are supported.

도 7은 본 발명의 일 실시예에 따른 컬러 복사 모드와 관련하여 각 컬러 공간의 대응되는 블록과 그에 인접한 영역을 나타내는 예시도이다. 도 7을 참조하면, 현재 컬러 공간(M)과 다른 컬러 공간(N)에서 화소 간 대응되는 예시(p와 q)를 나타내고 있으며, 일부 컬러 포맷(4:2:0)인 경우에 발생 가능한 예시로 이해할 수 있다. 그리고 상관성 정보 획득을 위해 대응되는 관계(7a)와 예측값 적용을 위해 대응되는 관계(7b)를 확인할 수 있다.FIG. 7 is an exemplary diagram illustrating a corresponding block of each color space and an area adjacent thereto in relation to a color copy mode according to an embodiment of the present invention. Referring to FIG. 7, examples (p and q) corresponding to pixels in a current color space M and a different color space N are shown, and examples that may occur in some color formats (4: 2: 0) It can be understood as. In addition, the corresponding relationship 7a for obtaining correlation information and the corresponding relationship 7b for applying a predicted value may be confirmed.

다음은 컬러 복사 모드에서 상관성 정보를 획득하는 것과 관련된 설명을 이어간다. 상관성 정보를 획득하기 위해서는 각 컬러 공간의 기 설정되는 영역(현재 블록과 대응되는 블록 각각의 인접한 영역의 전부 또는 일부) 내의 화소의 화소값이 비교(또는 사용)될 수 있다(즉, 1:1 화소값 비교 과정이 수행). 이때, 비교되는 화소값은 각 컬러 공간의 대응되는 화소 위치에 기반하여 획득될 수 있다. 상기 화소값은 각 컬러 공간에서 적어도 하나의 화소로부터 유도되는 값일 수 있다.The following follows the description related to obtaining correlation information in color copy mode. In order to obtain the correlation information, pixel values of pixels in a predetermined area (all or part of adjacent areas of each block corresponding to the current block) of each color space may be compared (or used) (ie, 1: 1). Pixel value comparison process). In this case, the compared pixel values may be obtained based on corresponding pixel positions of each color space. The pixel value may be a value derived from at least one pixel in each color space.

예를 들어, 일부 컬러 포맷(4:4:4)의 경우 색차 공간의 하나의 화소의 화소값과 휘도 공간의 하나의 화소의 화소값이 상관성 정보 획득 과정에 대응되는 화소값으로 사용될 수 있다. 또는, 일부 컬러 포맷(4:2:0)의 경우 색차 공간의 하나의 화소의 화소값과 휘도 공간의 하나 이상의 화소로부터 유도되는 화소값(즉, 다운 샘플링 과정을 통해 획득)이 상관성 정보 획득 과정에 대응되는 화소값으로 사용될 수 있다.For example, in some color formats (4: 4: 4), the pixel value of one pixel in the chrominance space and the pixel value of one pixel in the luminance space may be used as the pixel value corresponding to the correlation information acquisition process. Alternatively, in the case of some color formats (4: 2: 0), a pixel value of one pixel of a chrominance space and a pixel value derived from one or more pixels of a luminance space (that is, obtained through a down sampling process) are obtained from the correlation information acquisition process. It may be used as a pixel value corresponding to.

상세하게는, 전자의 경우 색차 공간의 p[x, y]은 휘도 공간의 q[x, y]와 비교될 수 있다. 이때, 화소값은 하나의 화소가 갖는 밝기값이 그대로 사용될 수 있다. 후자의 경우 색차 공간의 p[x, y]은 휘도 공간의 q[2x, 2y], q[2x, 2y+1], q[2x+1, 2y], q[2x+1, 2y+1] 등과 비교될 수 있다.Specifically, in the former case, p [x, y] of the chrominance space can be compared with q [x, y] of the luminance space. In this case, the brightness value of one pixel may be used as the pixel value. In the latter case, p [x, y] in the chrominance space is q [2x, 2y], q [2x, 2y + 1], q [2x + 1, 2y], q [2x + 1, 2y + 1 in the luminance space. ] And the like.

여기서 1:1 화소값 비교가 수행되어야 하기 때문에 휘도 공간의 경우 상기 복수의 화소 중 하나를 색차 화소의 화소값과 비교하는 값으로 사용할 수 있다. 즉, 상기 복수의 화소 중 하나의 화소가 갖는 밝기값이 그대로 사용됨을 의미한다. 또는, 상기 복수의 화소 중 둘 이상의 화소(k개. k는 2, 4, 6 등 2 이상 정수)로부터 하나의 화소값을 유도하여 비교하는 값으로 사용할 수 있다. 즉, 둘 이상의 화소에 가중치 평균(각 화소에 가중치가 균등 할당될 수 있거나 또는 비균등 할당될 수 있음) 등을 적용할 수 있다. Since a 1: 1 pixel value comparison must be performed, one of the plurality of pixels may be used as a value for comparing the pixel value of the color difference pixel in the luminance space. That is, the brightness value of one of the plurality of pixels is used as it is. Alternatively, one pixel value from two or more pixels (k. K is an integer of 2 or more, such as 2, 4, 6, etc.) may be used as a value for deriving and comparing the pixel values. That is, a weighted average (weights may be equally assigned or non-uniformly assigned) to two or more pixels may be applied.

상기 예와 같이 대응되는 화소가 복수로 존재할 경우 기 설정된 하나의 화소의 화소값 또는 둘 이상의 화소로부터 유도되는 화소값을 비교되는 값으로 사용할 수 있다. 이때, 부/복호화 설정에 따라 각 컬러 공간에서 비교되는 화소값 유도에 관한 상기 두 방법 중 하나를 단독으로 사용하거나 또는 혼합하여 사용할 수 있다.As described above, when there are a plurality of corresponding pixels, a pixel value of one preset pixel or a pixel value derived from two or more pixels may be used as a comparison value. In this case, one of the above two methods for deriving pixel values compared in each color space may be used alone or in combination according to a sub / decoding setting.

다음은 현재 컬러 공간에서 하나의 화소의 화소값이 비교에 사용되고, 다른 컬러 공간에서 하나 이상의 화소가 화소값 유도에 사용될 수 있음을 전제하는 설명일 수 있다. 예를 들어, 컬러 포맷은 YCbCr 4:2:0이고 현재 컬러 공간은 색차 공간이고 다른 컬러 공간은 휘도 공간인 경우를 가정한다. 화소값 유도에 관한 방법은 다른 컬러 공간을 중심으로 설명한다.The following description may be based on the assumption that pixel values of one pixel in the current color space are used for comparison, and that one or more pixels may be used for deriving pixel values in another color space. For example, assume that the color format is YCbCr 4: 2: 0, the current color space is the chrominance space, and the other color space is the luminance space. The method for deriving pixel values will be described based on other color spaces.

일 예로, 블록의 형태(가로/세로 길이 비)에 따라 정해질 수 있다. 상세한 예로, 현재 블록(또는 예측 대상 블록)의 길이가 긴 쪽에 인접한 색차 공간의 p[x, y]은 휘도 공간의 q[2x, 2y]와 비교될 수 있고, 길이가 짧은 쪽에 인접한 색차 공간의 p[x, y]은 휘도 공간의 q[2x, 2y]와 q[2x+1, 2y]의 평균과 비교될 수 있다.For example, it may be determined according to the shape of the block (horizontal / vertical length ratio). As a detailed example, p [x, y] of the color difference space adjacent to the longer side of the current block (or predicted block) can be compared with q [2x, 2y] of the luminance space, and p [x, y] can be compared with the average of q [2x, 2y] and q [2x + 1, 2y] of the luminance space.

이때, 가로/세로 길이 비에 관계없이 일부 블록 형태(직사각)에 상기 내용이 적용될 수 있거나 또는 가로/세로 길이 비가 일정 비율(k:1 또는 1:k. 예로, 2:1, 4:1 등과 같이 k는 2 이상) 이상/초과인 경우에만 적용될 수 있는 등의 적응적인 설정이 가능할 수 있다.In this case, the above content may be applied to some block shapes (rectangular) regardless of the horizontal / vertical length ratio, or the ratio of horizontal / vertical length may be a certain ratio (k: 1 or 1: k, for example, 2: 1, 4: 1, etc.). Similarly, k may be applied only when the value is greater than or equal to 2) or more.

일 예로, 블록의 크기에 따라 정해질 수 있다. 상세한 예로, 현재 블록의 크기가 일정 크기(M x N. 예로, 2m x 2n으로 m과 n은 2 ~ 6 과 같은 1 이상 정수) 이상/초과인 경우에 색차 공간의 p[x, y]은 휘도 공간의 q[2x+1, 2y]와 비교될 수 있고, 일정 크기 이하/미만인 경우에 색차 공간의 p[x, y]은 휘도 공간의 q[2x, 2y], q[2x, 2y+1]의 평균과 비교될 수 있다.For example, it may be determined according to the size of the block. As a detailed example, p [x, y of chrominance space when the size of the current block is greater than or over a certain size (M x N. For example, 2 m x 2 n where m and n are integers greater than or equal to 2 to 6). ] Can be compared with q [2x + 1, 2y] of the luminance space, and in the case of less than / less than a certain size, p [x, y] of the chrominance space is q [2x, 2y], q [2x, 2y + 1].

이때, 크기 비교를 위한 경계값이 상기 예와 같이 하나 존재할 수 있거나 또는 둘 이상 존재(M1 x N1, M2 x N2 등)하는 등의 적응적인 설정이 가능할 수 있다.In this case, one boundary value for size comparison may exist as in the above example, or an adaptive setting such as two or more (M 1 x N 1 , M 2 x N 2, etc.) may be possible.

상기 예들은 연산량 측면에서 고려될 수 있는 일부 경우이며, 상기 예와 반대되는 경우를 포함한 다양한 변형의 예가 가능하다.The above examples are some cases that can be considered in terms of calculation amount, and examples of various modifications are possible, including cases opposite to the above examples.

일 예로, 블록의 위치에 따라 정해질 수 있다. 상세한 예로, 현재 블록이 기 설정된 영역(본 예에서 최대 부호화 블록이라 가정)의 내부에 위치할 경우 색차 공간의 p[x, y]은 휘도 공간의 q[2x, 2y]. q[2x+1, 2y], q[2x, 2y+1], q[2x+1, 2y+1]의 평균과 비교될 수 있고, 기 설정된 영역의 경계(본 예에서 왼쪽 위 경계라 가정)에 위치할 경우 색차 공간의 p[x, y]은 휘도 공간의 q[2x+1, 2y+1]와 비교될 수 있다. 상기 기 설정된 영역은 슬라이스, 타일, 블록 등에 기반하여 설정되는 영역을 의미할 수 있다. 상세하게는, 슬라이스, 타일, 최대 부호화/예측/변환 블록의 정수배에 기반하여 획득될 수 있다.For example, it may be determined according to the position of the block. As a detailed example, when the current block is located inside a preset area (assuming a maximum coding block in this example), p [x, y] of the color difference space is q [2x, 2y] of the luminance space. It can be compared with the average of q [2x + 1, 2y], q [2x, 2y + 1], q [2x + 1, 2y + 1], and the boundary of the preset area (assuming the upper left boundary in this example). ), P [x, y] of the chrominance space can be compared with q [2x + 1, 2y + 1] of the luminance space. The preset area may mean an area set based on a slice, a tile, a block, and the like. In detail, it may be obtained based on an integer multiple of a slice, a tile, and a maximum coding / prediction / transformation block.

다른 예로, 현재 블록이 상기 영역의 일부 경계(본 예에서 위쪽 경계라 가정)에 위치할 경우 일부 경계(위쪽)에 인접한 색차 공간의 p[x, y]는 휘도 공간의 q[2x+1, 2y+1]와 비교될 수 있고, 상기 영역 내부(왼쪽)에 인접한 색차 공간의 p[x, y]는 휘도 공간의 q[2x, 2y]. q[2x+1, 2y], q[2x, 2y+1], q[2x+1, 2y+1]의 평균과 비교될 수 있다.As another example, when the current block is located at some boundary of the region (assuming an upper boundary in this example), p [x, y] of the color difference space adjacent to the some boundary (upper) is q [2x + 1, 2y + 1], and p [x, y] of the color difference space adjacent to the inside (left) of the area is q [2x, 2y] of the luminance space. It can be compared with an average of q [2x + 1, 2y], q [2x, 2y + 1], q [2x + 1, 2y + 1].

상기 예는 메모리 측면에서 고려될 수 있는 일부 경우이며, 상기 예와 반대되는 경우를 포함한 다양한 변형의 예가 가능하다.The above examples are some cases that can be considered in terms of memory, and examples of various modifications are possible, including cases opposite to the above examples.

전술한 예를 통해 각 컬러 공간에서 비교되는 화소값 유도에 관한 다양한 경우를 살펴보았다. 상기 예와 같이 블록의 크기/형태/위치뿐만 아니라 다양한 부/복호화 요소를 고려하여 상기 상관성 정보 획득을 위한 화소값 유도 설정이 정해질 수 있다.Through the above-described example, various cases regarding derivation of pixel values compared in each color space have been described. As described above, the pixel value derivation setting for acquiring the correlation information may be determined in consideration of various sub / decoding elements as well as the size / shape / position of the block.

상기 예를 통해 상관성 정보 획득을 위해 비교되는 영역은 도 7과 같이 현재 블록과 대응되는 블록의 각각 1개 또는 2개의 참조 화소 라인이 사용되는 경우를 설명하였다. 즉, YCbCr 4:4:4와 같은 경우 각각 1개의 참조 화소 라인을 사용하고, 그 외의 포맷의 경우 일부 컬러 공간에서는 도 7의 일부 컬러 공간<color N>과 같이 2개의 참조 화소 라인을 사용하는 경우를 의미하나, 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다.As described above, the region compared for acquiring correlation information has been described in which one or two reference pixel lines of a block corresponding to the current block are used as shown in FIG. 7. That is, in the case of YCbCr 4: 4: 4, one reference pixel line is used, and in other formats, in some color spaces, two reference pixel lines are used as in some color spaces <color N> of FIG. 7. Means a case, but is not limited to this, various modifications may be possible.

다음은 현재 컬러 공간의 참조 화소 라인에 중점을 두어 설명할 것이며, 다른 컬러 공간의 경우 컬러 포맷에 따라 참조 화소 라인이 정해질 수 있음을 이해하여야 한다. 예를 들어, 동일한 참조 화소 라인 개수가 사용되거나 또는 2배의 참조 화소 라인이 사용될 수 있다.The following will focus on the reference pixel lines of the current color space, and it should be understood that the reference pixel lines may be determined according to the color format in other color spaces. For example, the same number of reference pixel lines may be used or twice the reference pixel lines may be used.

본 발명의 컬러 복사 모드에서는 k개의 참조 화소 라인(여기서 k는 1, 2와 같은 1 이상 정수)이 상관성 정보 획득을 위해 사용(또는 비교)될 수 있다. 또한, k개의 참조 화소 라인이 고정적으로 사용되거나 또는 적응적으로 사용될 수 있다. 다음은 참조 화소 라인 개수 설정에 관한 다양한 예를 살펴본다.In the color copy mode of the present invention, k reference pixel lines (where k is an integer greater than or equal to 1 and 2) may be used (or compared) to obtain correlation information. In addition, k reference pixel lines may be fixedly used or adaptively used. Next, various examples of setting the number of reference pixel lines will be described.

일 예로, 블록의 형태(가로/세로 길이 비)에 따라 정해질 수 있다. 상세한 예로, 현재 블록의 길이가 긴 쪽에 인접한 2개의 참조 화소 라인이 사용될 수 있고, 길이가 짧은 쪽에 인접한 1개의 참조 화소 라인이 사용될 수 있다.For example, it may be determined according to the shape of the block (horizontal / vertical length ratio). As a detailed example, two reference pixel lines adjacent to the longer side of the current block may be used, and one reference pixel line adjacent to the shorter side of the current block may be used.

이때, 가로/세로 길이 비에 관계없이 일부 블록 형태(직사각)에 상기 내용이 적용될 수 있거나 또는 가로/세로 길이 비가 일정 비율(k:1 또는 1:k. 예로, 2:1, 4:1 등과 같이 k는 2 이상) 이상/초과인 경우에만 적용될 수 있다. 또한, 가로/세로 길이 비에 대한 경계값은 2개 이상 존재하여, 2:1 또는 1:2인 경우에는 길이가 긴 쪽(또는 짧은 쪽)에 인접한 2개의 참조 화소 라인을 사용하고, 4:1 또는 1:4인 경우에는 길이가 긴 쪽(또는 짧은 쪽)에 인접한 3개의 참조 화소 라인을 사용하는 등의 확장이 가능할 수도 있다.In this case, the above content may be applied to some block shapes (rectangular) regardless of the horizontal / vertical length ratio, or the ratio of horizontal / vertical length may be a certain ratio (k: 1 or 1: k, for example, 2: 1, 4: 1, etc.). Likewise, k may be applied only if the value is greater than or greater than 2). In addition, two or more boundary values for the horizontal / vertical length ratio exist, so that in the case of 2: 1 or 1: 2, two reference pixel lines adjacent to the long side (or the short side) are used, and 4: In the case of 1 or 1: 4, expansion such as using three reference pixel lines adjacent to the long side (or the short side) may be possible.

상기 예는 가로/세로 길이 비에 따라 길이가 긴 쪽(또는 짧은 쪽)은 s개의 참조 화소 라인을 사용하고, 길이가 짧은 쪽(또는 긴 쪽)은 t개의 참조 화소 라인을 사용하며, 이때, s가 t보다 크거나 같은 경우(즉, s와 t는 1 이상 정수)에 대한 일 예일 수 있다.In the above example, the long side (or the short side) uses s reference pixel lines and the short side (or the long side) uses t reference pixel lines according to the ratio of width to length. It may be an example for the case where s is greater than or equal to t (that is, s and t are integers of 1 or more).

일 예로, 블록의 크기에 따라 정해질 수 있다. 상세한 예로, 현재 블록의 크기가 일정 크기(M x N. 예로, 2m x 2n으로 m과 n은 2 ~ 6 과 같은 1 이상 정수) 이상/초과인 경우에 2개의 참조 화소 라인이 사용될 수 있고, 일정 크기 이하/미만인 경우 1개의 참조 화소 라인이 사용될 수 있다.For example, it may be determined according to the size of the block. As a detailed example, two reference pixel lines may be used when the size of the current block is greater than or over a certain size (M x N. For example, 2 m x 2 n where m and n are integers greater than or equal to 2 to 6). And one reference pixel line may be used when the size is less than / less than a predetermined size.

이때, 크기 비교를 위한 경계값이 상기 예와 같이 하나 존재할 수 있거나 또는 둘 이상 존재(M1 x N1, M2 x N2 등)하는 등의 적응적인 설정이 가능할 수 있다.In this case, one boundary value for size comparison may exist as in the above example, or an adaptive setting such as two or more (M 1 x N 1 , M 2 x N 2, etc.) may be possible.

일 예로, 블록의 위치에 따라 정해질 수 있다. 상세한 예로, 현재 블록이 기 설정된 영역(상관성 정보 획득과 관련된 이전 설명에서 유도 가능. 본 예에서 최대 부호화 블록이라 가정)의 내부에 위치할 경우 2개의 참조 화소 라인이 사용될 수 있고, 기 설정된 영역의 경계(본 예에서 왼쪽 위 경계라 가정)에 위치할 경우 1개의 참조 화소 라인이 사용될 수 있다.For example, it may be determined according to the position of the block. As a detailed example, when the current block is located inside a preset area (which can be derived from a previous description related to obtaining correlation information. In this example, it is assumed to be the largest coding block), two reference pixel lines may be used. One reference pixel line may be used when located at a boundary (assuming an upper left boundary in this example).

다른 예로, 현재 블록이 상기 영역의 일부 경계(본 예에서 위쪽 경계라 가정)에 위치할 경우 일부 경계(위쪽)에 인접한 1개의 참조 화소 라인이 사용될 수 있고, 상기 영역 내부(왼쪽)에 인접한 2개의 참조 화소 라인이 사용될 수 있다.As another example, when the current block is located at some boundary of the region (assuming an upper boundary in this example), one reference pixel line adjacent to the some boundary (upper) may be used, and 2 adjacent to the inside of the region (left) Reference pixel lines may be used.

상기 예는 상관성 정보의 정확성과 메모리 측면 등에서 고려될 수 있는 일부 경우이며, 상기 예와 반대되는 경우를 포함한 다양한 변형의 예가 가능하다.The above examples are some cases that can be considered in terms of accuracy of the correlation information, memory, and the like, and examples of various modifications are possible, including cases opposite to the above examples.

전술한 예를 통해 각 컬러 공간에서 상관성 정보를 획득하기 위해 사용되는 참조 화소 라인 설정에 관한 다양한 경우를 살펴보았다. 상기 예와 같이 블록의 크기/형태/위치뿐만 아니라 다양한 부/복호화 요소를 고려하여 상관성 정보 획득을 위한 참조 화소 라인 설정이 정해질 수 있다.In the above-described example, various cases regarding reference pixel line settings used to obtain correlation information in each color space have been described. As described above, the reference pixel line setting for obtaining correlation information may be determined in consideration of various sub / decoding elements as well as the size / shape / position of a block.

다음은 상관성 정보 획득을 위해 비교(또는 참조)되는 영역에 대한 다른 경우를 살펴본다. 상기 비교되는 영역은 현재 컬러 공간의 현재 블록에 인접한 좌, 상, 좌상, 우상, 좌하 등의 위치에 인접한 화소가 대상일 수 있다.Next, another case of a region to be compared (or referenced) for obtaining correlation information will be described. The area to be compared may be a pixel adjacent to a position of a left, an upper, a left top, a right top and a bottom left adjacent to a current block of a current color space.

이때, 비교되는 영역은 좌, 상, 좌상, 우상, 좌하 위치의 블록을 모두 포함하여 설정할 수 있다. 또는, 일부 위치의 블록의 조합으로 참조 화소 영역을 구성할 수 있다. 예를 들어, 좌 / 상 / 좌 + 상 / 좌 + 상 + 좌상 / 좌 + 좌하 / 상 + 우상 / 좌 + 좌상 + 좌하 / 상 + 좌상 + 우상 / 좌 + 상 + 우상 / 좌 + 상 + 좌하 등의 인접한 블록의 조합으로 비교되는 영역을 구성할 수 있다.In this case, the area to be compared may be set to include all blocks of the left, top, top left, top right, and bottom left positions. Alternatively, the reference pixel area may be configured by a combination of blocks of some positions. For example, left / top / left + top / left + top + top / left + left / top + top / left + left + top + bottom / top + top + top / left + top + top / left + top + bottom, etc. It is possible to construct regions that are compared by a combination of adjacent blocks.

도 8은 본 발명의 일 실시예에 따른 컬러 복사 모드의 상관성 정보 획득을 위한 영역 설정에 관한 예시도이다. 도 8의 a 내지 e의 경우 이미 전술한 예시(좌 + 상, 상 + 우상, 좌 + 좌하, 좌 + 상 + 우상, 좌 + 상 + 좌하)에 해당할 수 있으며, 일부 위치의 블록은 하나 이상의 서브 블록으로 분할되어 그 중 일부가 상관성 정보 획득을 위한 영역으로 설정되는 예(도 8의 f, g)가 가능할 수 있다. 즉, 일부 방향에 위치한 하나 이상의 서브 블록들로 상관성 정보 획득을 위한 영역이 설정될 수 있다. 또는, 일부 방향(a)에 위치한 하나 이상의 블록과 일부 방향(b)에 위치한 하나 이상의 서브 블록으로 상관성 정보 획득을 위한 영역이 설정(여기서 a와 b는 다른 방향을 의미)될 수 있다. 또한, 연속하지 않은 블록으로 상관성 정보 획득을 위한 영역 설정의 예(도 8의 h, i) 또한 가능할 수 있다. 8 is an exemplary diagram for setting a region for obtaining correlation information of a color copy mode according to an embodiment of the present invention. In the case of a to e of FIG. 8, it may correspond to the above-described example (left + top, top + right, left + left, left + top + right, left + top + bottom), and blocks of some positions may be one or more. An example (f and g of FIG. 8) may be possible in which the sub-block is divided into a part of which is set as an area for obtaining correlation information. That is, an area for obtaining correlation information may be set to one or more subblocks located in some directions. Alternatively, regions for obtaining correlation information may be set in one or more blocks located in some directions (a) and one or more sub blocks located in some directions (b), where a and b mean different directions. Also, an example of area setting (h, i in FIG. 8) for acquiring correlation information with non-contiguous blocks may also be possible.

정리하면, 상관성 정보 획득을 위해 비교되는 영역은 기 설정된 영역으로 구성할 수 있다. 또는, 일부 영역의 다양한 조합으로 구성할 수 있다. 즉, 부/복호화 설정에 따라 상기 비교되는 영역은 고정적이거나 적응적으로 구성될 수 있다.In summary, the areas to be compared for obtaining correlation information may be configured as preset areas. Alternatively, the present invention may be configured in various combinations of some regions. That is, the area to be compared may be fixed or adaptively configured according to the negative / decryption setting.

다음은 현재 컬러 공간의 현재 블록을 중심으로 어떤 방향의 인접한 영역이 참조 영역으로 구성되는 지에 대한 다양한 예를 살펴볼 것이다. 여기서, 다른 컬러 공간의 대응되는 블록에서는 어떤 방향의 인접한 영역이 참조 영역으로 구성되는지는 현재 컬러 블록의 참조 영역 구성에 따라 정해짐을 전제한다. 또한, 기본 참조 영역은 좌, 상 블록으로 구성됨을 전제한다.Next, we will look at various examples of which directions of adjacent areas are composed of reference areas around the current block of the current color space. Here, it is assumed that in a corresponding block of another color space, which direction adjacent areas are configured as the reference area is determined according to the configuration of the reference area of the current color block. In addition, it is assumed that the basic reference region is composed of left and upper blocks.

일 예로, 블록의 형태(가로/세로 길이 비)에 따라 정해질 수 있다. 상세한 예로, 현재 블록이 가로로 긴 경우 좌, 상, 우상 블록이 참조 영역으로 설정되고, 세로로 긴 경우 좌, 상, 좌하 블록이 참조 영역으로 설정될 수 있다.For example, it may be determined according to the shape of the block (horizontal / vertical length ratio). As a detailed example, when the current block is long horizontally, the left, top, and right upper blocks may be set as the reference area, and when the vertical block is long, the left, upper, lower left blocks may be set as the reference area.

이때, 가로/세로 길이 비에 관계없이 일부 블록 형태(직사각)에 상기 내용이 적용될 수 있거나 또는 가로/세로 길이 비가 일정 비율(k:1 또는 1:k. 예로, 2:1, 4:1 등과 같이 k는 2 이상) 이상/초과인 경우에만 적용될 수 있다. 또한, 가로/세로 길이 비에 대한 경계값은 2개 이상 존재하여, 2:1(또는 1:2)인 경우에는 좌, 상, 우상(또는 좌, 상, 좌하) 블록이 참조 영역으로 설정되고, 4:1(또는 1:4)인 경우에는 상, 우상(또는 좌, 좌하) 블록이 참조 영역으로 설정되는 등의 확장이 가능할 수 있다.In this case, the above content may be applied to some block shapes (rectangular) regardless of the horizontal / vertical length ratio, or the ratio of horizontal / vertical length may be a certain ratio (k: 1 or 1: k, for example, 2: 1, 4: 1, etc.). Likewise, k may be applied only if the value is greater than or greater than 2). In addition, two or more boundary values for the horizontal / vertical length ratio exist so that in the case of 2: 1 (or 1: 2), the left, top, and right top (or left, top, bottom left) blocks are set as reference regions. , 4: 1 (or 1: 4) may be extended such that upper, upper right (or left, lower left) blocks are set as reference regions.

일 예로, 블록의 크기에 따라 정해질 수 있다. 상세한 예로, 현재 블록의 크기가 일정 크기(M x N. 예로, 2m x 2n으로 m과 n은 2 ~ 6 과 같은 1 이상 정수) 이상/초과인 경우에 좌, 상 블록이 참조 영역으로 설정되고, 일정 크기 이하/미만인 경우에 좌, 상, 좌상 블록이 참조 영역으로 설정될 수 있다.For example, it may be determined according to the size of the block. As a detailed example, when the size of the current block is greater than or equal to a certain size (M x N. For example, 2 m x 2 n where m and n are one or more integers such as 2 to 6), the left and upper blocks are referred to as reference regions. In the case of being set to less than / less than a predetermined size, the left, top, and top left blocks may be set as reference regions.

이때, 크기 비교를 위한 경계값이 상기 예와 같이 하나 존재할 수 있거나 또는 둘 이상 존재(M1 x N1, M2 x N2 등)하는 등의 적응적인 설정이 가능할 수 있다.In this case, one boundary value for size comparison may exist as in the above example, or an adaptive setting such as two or more (M 1 x N 1 , M 2 x N 2, etc.) may be possible.

일 예로, 블록의 위치에 따라 정해질 수 있다. 상세한 예로, 현재 블록이 기 설정된 영역(상관성 정보 획득과 관련된 이전 설명에서 유도 가능. 본 예에서 최대 부호화 블록이라 가정)의 내부에 위치할 경우 좌, 상, 좌상, 우상, 좌하 블록이 참조 영역으로 설정되고, 기 설정된 영역의 경계(본 예에서 왼쪽 위 경계라 가정)에 위치할 경우 좌, 상 블록이 참조 영역으로 설정될 수 있다.For example, it may be determined according to the position of the block. As a detailed example, when the current block is located inside a preset area (which can be derived from a previous description related to obtaining correlation information. In this example, it is assumed to be the largest coding block), the left, top, top left, top right, and bottom left blocks are referred to as reference areas. If it is set and located at the boundary of the preset area (assuming the upper left boundary in this example), the left and upper blocks may be set as the reference area.

다른 예로, 현재 블록이 상기 영역의 일부 경계(본 예에서 위쪽 경계라 가정)에 위치할 경우 일부 경계(위쪽 경계)에 인접한 블록을 제외하고, 상기 영역 내부에 인접한 좌, 좌하 블록이 참조 영역으로 설정될 수 있다. 즉, 좌, 좌하 블록이 참조 영역으로 설정될 수 있다.As another example, if the current block is located at some boundary of the region (assuming the upper boundary in this example), except for the block adjacent to the some boundary (upper boundary), the left and lower blocks adjacent to the inside of the region are referred to as the reference region. Can be set. That is, the left and lower left blocks may be set as reference regions.

상기 예는 연산량, 메모리 측면 등에서 고려될 수 있는 일부 경우이며, 상기 예와 반대되는 경우를 포함한 다양한 변형의 예가 가능하다.The above examples are some cases that can be considered in terms of calculation amount, memory, and the like, and examples of various modifications are possible, including cases opposite to the above examples.

전술한 예를 통해 각 컬러 공간에서 상관성 정보를 획득하기 위해 사용되는 참조 영역 설정에 관한 다양한 경우를 살펴보았다. 상기 예와 같이 블록의 크기/형태/위치뿐만 아니라 다양한 부/복호화 요소를 고려하여 상관성 정보 획득을 위한 참조 영역 설정이 정해질 수 있다.In the above-described example, various cases regarding the reference region setting used to obtain correlation information in each color space have been described. As described above, the reference region setting for obtaining correlation information may be determined in consideration of various sub / decoding elements as well as the size / shape / position of the block.

또한, 상기 비교되는 영역은 현재 컬러 공간의 현재 블록에 인접한 화소가 그 대상이 될 수 있다. 여기서 참조 화소 모두를 상관성 정보를 획득하기 위해 사용할 수 있거나 또는 그 중 일부 화소를 사용할 수 있다.In addition, the comparison area may be a pixel adjacent to a current block of a current color space. Here, all of the reference pixels may be used to obtain correlation information, or some of them may be used.

예를 들어, (도 7의 color M을 기준) 현재 블록이 (a, b) ~ (a+7, b+7)의 화소 범위를 갖는 블록(즉, 8 x 8)일 경우, 상기 비교되는 영역(대응되는 블록은 컬러 포맷에 따라 설명이 유도 가능하므로 생략)은 현재 블록의 좌, 상 블록의 하나의 참조 화소 라인이라고 가정한다.For example, when the current block (based on color M of FIG. 7) is a block having a pixel range of (a, b) to (a + 7, b + 7) (that is, 8 × 8), the comparison is performed. It is assumed that the region (the corresponding block is omitted since the description can be derived according to the color format) is one reference pixel line of the left and upper blocks of the current block.

이때, 상기 비교되는 영역에 (a, b-1) ~ (a+7, b-1)과 (a-1, b) ~ (a-1, b+7)의 범위 내의 모든 화소가 포함될 수 있다. 또는, 상기 범위 중 일부 화소인 (a, b-1), (a+2, b-1), (a+4, b-1), (a+6, b-1)과 (a-1, b), (a-1, b+2), (a-1, b+4), (a-1, b+6)가 포함될 수 있다. 또는, 상기 범위 중 일부 화소인 (a, b-1), (a+4, b-1)과 (a-1, b), (a-1, b+4)가 포함될 수 있다.In this case, all of the pixels within the range of (a, b-1) to (a + 7, b-1) and (a-1, b) to (a-1, b + 7) may be included in the region to be compared. have. Or (a, b-1), (a + 2, b-1), (a + 4, b-1), (a + 6, b-1) and (a-1) which are some pixels in the above range , b), (a-1, b + 2), (a-1, b + 4), and (a-1, b + 6). Alternatively, some pixels in the range may include (a, b-1), (a + 4, b-1), and (a-1, b), (a-1, b + 4).

상기 예는 상관성 획득을 위해 요구되는 연산량을 줄이기 위한 목적으로 적용 가능할 수 있다. 이미 전술한 많은 예와 함께 상관성 정보 획득을 위한 비교되는 영역의 참조 화소 샘플링에 관한 설정은 블록의 크기/형태/위치 등의 다양한 부/복호화 요소가 고려될 수 있으며, 이전 예로부터 관련 적용에 대한 예는 유도 가능하므로 상세한 설명은 생략한다.The above example may be applicable for the purpose of reducing the amount of computation required for obtaining correlation. In addition to the many examples already described above, various sub / decoding elements such as the size / shape / position of a block may be considered in setting the reference pixel sampling of the compared area for obtaining correlation information. The examples are derivable, and thus detailed descriptions are omitted.

전술한 다양한 예를 통해 상관성 정보 획득에 영향을 주는 다양한 요소(대응되는 화소값 유도, 참조 화소 라인 개수, 참조 영역 방향 설정, 참조 화소 샘플링 등)를 살펴보았다. 상기 예가 단독 또는 혼합되어 상관성 정보 획득에 영향을 주는 다양한 경우의 수가 가능할 수 있다.Through the various examples described above, various factors (such as deriving corresponding pixel values, number of reference pixel lines, reference region direction setting, reference pixel sampling, etc.) that influence the acquisition of correlation information have been described. The number of cases where the above examples are alone or mixed to affect the acquisition of correlation information may be possible.

상기 설명은 하나의 상관성 정보를 획득하기 위한 사전 설정 과정으로 이해할 수 있다. 또한, 이미 언급한 것과 같이 부/복호화 설정에 따라 하나 이상의 상관성 정보가 지원될 수 있다. 이때, 둘 이상의 상관성 정보는 상기 사전 설정(즉, 상관성 정보 획득에 영향을 주는 요소의 조합)을 둘 이상 둠으로써 지원될 수 있다.The above description may be understood as a preset process for obtaining one piece of correlation information. In addition, as mentioned above, one or more correlation information may be supported according to encoding / decoding settings. In this case, two or more correlation information may be supported by leaving two or more of the above-described presetting (ie, a combination of factors affecting acquisition of correlation information).

정리하면, 현재 블록의 인접한 영역과 대응되는 블록의 인접한 영역으로부터 상관성 정보에 기반한 파라미터 정보를 유도할 수 있다. 즉, 상관성 정보에 기반하여 적어도 하나의 파라미터(예를 들어, <a1, b1>, <a2, b2>, <a3, b3> 등)가 생성될 수 있으며, 이는 다른 컬러 공간의 복원된 블록의 화소에 곱해지거나 더해지는 값으로 사용될 수 있다.In summary, parameter information based on correlation information may be derived from an adjacent area of a block corresponding to an adjacent area of the current block. That is, at least one parameter (eg, <a1, b1>, <a2, b2>, <a3, b3>, etc.) may be generated based on the correlation information, which may be generated in a restored block of another color space. It can be used as a value that is multiplied or added to the pixel.

다음은 컬러 복사 모드에서 적용되는 선형 모델에 관한 설명을 이어간다. 상기 과정을 통해 획득되는 파라미터를 적용하여 다음과 같은 선형 모델에 기반한 예측을 수행할 수 있다.The following is a description of the linear model applied in color copy mode. By applying the parameters obtained through the above process, prediction based on a linear model may be performed.

pred_sample_C(i,j) = a x rec_sample_D(i,j) + bpred_sample_C (i, j) = a x rec_sample_D (i, j) + b

상기 수식에서 pred_sample_C는 현재 컬러 공간의 현재 블록의 예측 화소값을 의미하고, rec_sample_D는 다른 컬러 공간의 대응되는 블록의 복원 화소값을 의미한다. a와 b는 현재 블록의 인접한 영역과 대응되는 블록의 인접한 영역 사이의 regression error를 최소화하여 얻어질 수 있으며, 다음의 수식을 통해 계산될 수 있다.In the above formula, pred_sample_C means a predicted pixel value of a current block of a current color space, and rec_sample_D means a reconstructed pixel value of a corresponding block of another color space. a and b may be obtained by minimizing a regression error between the adjacent area of the current block and the corresponding area of the block, and may be calculated by the following equation.

Figure pat00001
Figure pat00001

상기 수식에서 D(n)은 대응되는 블록의 인접한 영역을 의미하고, C(n)은 현재 블록의 인접한 영역을 의미하며, N은 현재 블록의 가로 또는 세로 길이에 기반하여 설정되는 값(본 예에서 가로, 세로 중 최소값의 2배라 가정)을 의미한다.In the above formula, D (n) means an adjacent area of the corresponding block, C (n) means an adjacent area of the current block, and N is a value set based on the horizontal or vertical length of the current block (this example Is assumed to be twice the minimum of width and length).

또한, 각 컬러 공간의 인접한 영역의 최소값과 최대값에 기반하여 상관성 정보를 획득하는 직선 모델(Straight-Line Equation) 등의 다양한 방법이 사용될 수 있다. 이때, 상관성 정보를 구하는 모델은 기 설정된 하나의 모델이 사용될 수 있거나 또는 복수의 모델 중 하나가 선택될 수 있다. 여기서 복수의 모델 중 하나가 선택되는 것의 의미는 상관성 정보에 기반한 파라미터 정보에 대한 부/복호화 요소로 모델 정보가 고려될 수 있음을 의미한다. 즉, 복수의 파라미터가 지원되는 경우에 나머지 상관성 정보 관련 설정은 동일하더라도 상관성 구하는 모델이 다름에 따라 다른 파라미터 정보로 구분될 수 있음을 의미할 수 있다.In addition, various methods, such as a straight-line equation, may be used to obtain correlation information based on minimum and maximum values of adjacent areas of each color space. In this case, one model may be used as a model for obtaining correlation information, or one of a plurality of models may be selected. In this case, the selection of one of the plurality of models means that the model information may be considered as a sub / decoding element for parameter information based on the correlation information. That is, when a plurality of parameters are supported, it may mean that even if the remaining correlation information related settings are the same, different correlation information may be divided according to different models for obtaining correlation.

일부 컬러 포맷의 경우(4:4:4가 아닌 경우) 현재 블록의 1개 화소는 대응되는 블록의 1개 이상(2개, 4개 등) 화소에 대응될 수 있다. 예를 들어, 4:2:0인 경우 색차 공간의 p[x, y]는 휘도 공간의 q[2x, 2y], q[2x, 2y+1], q[2x+1, 2y], q[2x+1, 2y+1] 등과 대응될 수 있다.In the case of some color formats (not 4: 4: 4), one pixel of the current block may correspond to one or more (two, four, etc.) pixels of the corresponding block. For example, in the case of 4: 2: 0, p [x, y] in the color space is q [2x, 2y], q [2x, 2y + 1], q [2x + 1, 2y], q in the luminance space. [2x + 1, 2y + 1] and the like.

하나의 예측 화소값을 위해 상기 대응되는 복수의 화소 중 기 설정된 하나의 화소의 화소값(또는 예측값) 또는 둘 이상의 화소로부터 하나의 화소값을 유도(7b)할 수 있다. 즉, 하나의 예측 화소값 획득을 위해 다른 컬러 공간의 대응되는 하나 이상의 화소에서 상관성 정보를 적용하기 전인 복원값을 획득할 수 있다. 부/복호화 설정에 따라 다양한 경우의 수가 가능할 수 있으며, 이는 상관성 정보 획득하기 위해 대응되는 화소값 유도(7a)에 관한 부분에서 관련 설명을 유도할 수 있으므로 상세한 설명은 생략한다. 단, 7a와 7b는 동일하거나 다른 설정이 적용될 수도 있다. For one prediction pixel value, one pixel value may be derived (7b) from a predetermined pixel value (or a prediction value) or two or more pixels among the corresponding plurality of pixels. That is, a reconstruction value may be obtained before applying the correlation information in at least one corresponding pixel in another color space to obtain one prediction pixel value. The number of various cases may be possible according to the encoding / decoding setting, and since the related description may be derived from the corresponding pixel value derivation 7a in order to obtain correlation information, the detailed description thereof will be omitted. However, the same or different settings may be applied to 7a and 7b.

(컬러 모드)(Color mode)

다른 컬러 공간 내 위치한 영역으로부터 예측 블록 생성을 위한 예측 모드를 획득하는 방법과 관련된 예측 모드가 지원될 수 있다.A prediction mode related to a method of obtaining a prediction mode for generating a prediction block from a region located in another color space may be supported.

예를 들어, 컬러 공간 간의 상관성을 이용하여 예측 블록 생성을 위한 예측 모드를 다른 컬러 공간에서 획득하는 방법에 대한 예측 모드가 그에 대한 예가 될 수 있다. 즉, 컬러 모드는 어떤 특정한 예측 방향이나 예측 방법을 갖는 것이 아니라 기존의 존재하는 예측 방향 및 방법을 사용하되 다른 컬러 공간에 대응되는 블록의 예측 모드에 따라 적응적으로 정해지는 모드일 수 있다.For example, a prediction mode for a method of obtaining a prediction mode for generating a prediction block in another color space using correlation between color spaces may be an example. That is, the color mode may be a mode that does not have any particular prediction direction or prediction method, but is adaptively determined according to a prediction mode of a block corresponding to another color space using existing prediction directions and methods.

이때, 블록 분할 설정에 따라 다양한 컬러 모드가 획득되는 경우가 가능할 수 있다.In this case, various color modes may be obtained according to the block division setting.

예를 들어, 일부 컬러 성분(휘도)에 대한 블록 분할 결과에 따라 일부 컬러 성분(색차)에 대한 블록 분할이 묵시적으로 정해지는 설정(즉, 휘도 성분의 블록 분할은 명시적으로 정해지는 경우)에서는 일부 컬러 성분(색차)의 하나의 블록이 일부 컬러 공간(휘도)의 하나의 블록과 대응될 수 있다. 그렇기 때문에 (4:4:4인 경우를 가정. 그 외의 포맷의 경우 가로/세로 길이 비에 따라 본 예에 대한 설명이 유도 가능) 현재 블록(색차)이 (a, b) ~ (a+m, b+n)의 화소 범위를 갖는다면, 이에 대응되는 블록(휘도)의 (a, b) ~ (a+m, b+n)의 화소 범위 내의 어떤 화소 위치를 가리키더라도 하나의 블록을 가리키므로 해당 화소를 포함하는 블록에서 하나의 예측 모드가 획득될 수 있다.For example, in a setting where the block division for some color components (color difference) is implicitly determined according to the result of the block division for some color components (luminance), that is, when the block division of luminance components is explicitly determined, One block of some color components (color difference) may correspond to one block of some color space (luminance). Therefore (assuming 4: 4: 4. For other formats, the description of this example can be derived from the ratio of width to height.) The current block (color difference) is (a, b) to (a + m , b + n), a block may be referred to any pixel position within the pixel range of (a, b) to (a + m, b + n) of the corresponding block (luminance). In this case, one prediction mode may be obtained in a block including the corresponding pixel.

또는, 각 컬러 성분에 따라 개별적인 블록 분할이 지원되는 경우(즉, 각 컬러 공간의 블록 분할이 명시적으로 정해지는 경우)에서는 일부 컬러 성분(색차)의 하나의 블록이 일부 컬러 공간(휘도)의 하나 이상의 블록과 대응될 수 있다. 그렇기 때문에 현재 블록(색차)이 상기 예와 동일한 화소 범위를 갖더라도, 대응되는 블록(휘도)은 블록 분할 결과에 따라 하나 이상의 블록으로 구성될 수 있다. 그래서 현재 블록의 화소 범위 내의 화소 위치에 따라 해당 화소가 가리키는 대응되는 블록에서 다른 예측 모드(즉, 하나 이상의 모드)가 획득될 수도 있다.Alternatively, when separate block division is supported according to each color component (that is, when the block division of each color space is explicitly determined), one block of some color components (color difference) is used in some color space (luminance). It may correspond to one or more blocks. Therefore, even if the current block (color difference) has the same pixel range as the above example, the corresponding block (luminance) may be composed of one or more blocks according to the block division result. Thus, different prediction modes (ie, one or more modes) may be obtained in the corresponding block indicated by the pixel according to the pixel position within the pixel range of the current block.

만약 색차 성분을 위한 화면내 예측 모드 후보군에서 하나의 컬러 모드를 지원하는 경우, 대응되는 블록의 어떤 위치에서 예측 모드를 가져올 지 설정할 수 있다.If one color mode is supported in the intra prediction mode candidate group for the color difference component, it may be set at which position of the corresponding block to obtain the prediction mode.

예를 들어, 대응되는 블록의 중앙 - 좌상 - 우상 - 좌하 - 우하 등의 위치에서 예측 모드를 가져올 수 있다. 즉, 상기 순서대로 예측 모드를 가져오되 대응되는 블록이 이용 불가한 경우(예를 들어, 부호화 모드가 Inter 등)에는 그 다음 순서에 해당하는 위치의 예측 모드를 가져올 수 있다. 또는, 상기 위치의 블록들에서 빈도수(2번 이상)가 높은 예측 모드를 가져올 수도 있다.For example, the prediction mode may be obtained at a position such as center-upper left-upper right-lower left-lower right of the corresponding block. That is, when the prediction mode is brought in the above order but the corresponding block is not available (for example, the encoding mode is Inter, etc.), the prediction mode of the position corresponding to the next order may be brought. Alternatively, the prediction mode may have a high frequency (more than 2 times) in the blocks of the position.

또는, 복수의 컬러 모드를 지원한다고 할 경우, 상기 우선 순위에 따라 어디서 예측 모드를 가져올 지 설정할 수 있다. 또는, 상기 우선 순위에 따라 일부 예측 모드를 가져오고, 상기 위치의 블록들에서 빈도수가 높은 일부 예측 모드를 가져오는 조합이 가능할 수도 있다. 여기서 상기 우선 순위의 경우 하나의 예이며, 다양한 변형의 예가 가능할 수 있다.Alternatively, when supporting a plurality of color modes, it is possible to set where to obtain the prediction mode according to the priority. Alternatively, a combination of bringing some prediction modes according to the priority and bringing some prediction modes with high frequency in blocks of the position may be possible. In this case, the priority is one example, and various modifications may be possible.

컬러 모드와 컬러 복사 모드는 색차 성분에 지원 가능한 예측 모드일 수 있다. 예를 들어, 수평, 수직, DC, Planar, 대각선 모드 등을 포함하여 색차 성분을 위한 예측 모드 후보군을 구성할 수 있다. 또는, 컬러 모드와 컬러 복사 모드를 포함하여 화면내 예측 모드 후보군을 구성할 수 있다. The color mode and the color copy mode may be prediction modes that can support the color difference component. For example, the prediction mode candidate group for the color difference component may be configured including horizontal, vertical, DC, planar, and diagonal modes. Alternatively, the intra prediction mode candidate group may be configured to include a color mode and a color copy mode.

즉, 방향성 + 비방향성 + 컬러 모드로 구성하거나 또는 방향성 + 비방향성 + 컬러 복사 모드로 구성할 수 있고, 방향성 + 비방향성 + 컬러 모드 + 컬러 복사 모드로 구성할 수도 있으며, 이 밖의 추가적인 색차 성분을 위한 모드가 포함되어 구성될 수도 있다.That is, directional + non-directional + color mode or directional + non-directional + color copy mode, directional + non-directional + color mode + color copy mode, and other additional color difference components It may be configured to include a mode for.

부/복호화 설정에 따라 컬러 모드와 컬러 복사 모드의 지원 여부가 정해질 수 있으며, 이는 묵시적 또는 명시적인 처리가 가능할 수 있다. 또는, 명시적 + 묵시적인 혼합 구성의 처리가 가능할 수 있다. 여기에 컬러 모드와 컬러 복사 모드에 관련된 세부 설정(예를 들어, 지원되는 모드 개수 등)이 포함되어 묵시적 또는 명시적인 처리가 가능할 수 있다.Depending on the encoding / decoding setting, it may be determined whether the color mode and the color copy mode are supported, which may be implicit or explicit. Alternatively, processing of explicit + implicit mixed configurations may be possible. This may include detailed settings related to the color mode and the color copy mode (eg, the number of supported modes, etc.) to allow for implicit or explicit processing.

예를 들어, 상기 관련 정보는 시퀀스, 픽쳐, 슬라이스, 타일, 블록 등의 단위로 명시적으로 관련 정보가 포함될 수 있거나 또는 다양한 부/복호화 요소(예를 들어, 영상 타입, 블록의 위치, 블록의 크기, 블록의 형태, 블록의 가로/세로 비 등)에 따라 묵시적으로 정해질 수 있다. 또는, 부/복호화 요소에 따라 일부 조건에는 묵시적으로 정해지거나 또는 일부 조건에는 명시적으로 관련 정보가 발생할 수도 있다.For example, the related information may include related information explicitly in units of a sequence, a picture, a slice, a tile, a block, or the like, or various sub / decoding elements (eg, image type, position of a block, Size, type of block, width / length ratio of the block, etc.). Alternatively, some conditions may be implicit in some conditions or explicitly related information in some conditions.

도 9는 본 발명의 일 실시예에 따른 화면내 예측에 사용되는 참조 화소 구성을 설명하기 위한 예시도이다. 예측 블록의 크기 및 형태(M x N)은 블록 분할부를 통해 획득될 수 있다.9 is an exemplary diagram for describing a configuration of a reference pixel used for intra prediction according to an embodiment of the present invention. The size and shape (M x N) of the prediction block may be obtained through the block partitioner.

화면내 예측을 위한 최소 블록 및 최대 블록 크기 등으로 정의되는 블록 범위 정보는 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에 관련 정보가 포함될 수 있다. 일반적으로 가로와 세로 길이가 특정(예를 들어, 32 x 32, 64 x 64 등)되어 크기 정보가 설정될 수 있으나, 가로와 세로 길이의 곱의 형태로 크기 정보가 설정될 수도 있다. 예를 들어, 최소 블록의 크기는 가로와 세로의 곱이 64일 경우, 4 x 16, 8 x 8, 16 x 4 등이 해당될 수 있다.The block range information defined by the minimum block and the maximum block size for intra prediction may include related information in units of a sequence, a picture, a slice, a tile, and the like. In general, the size information may be set because the horizontal and vertical lengths are specified (for example, 32 x 32, 64 x 64, etc.), but the size information may be set in the form of the product of the horizontal and vertical lengths. For example, the minimum block size may correspond to 4 x 16, 8 x 8, 16 x 4, and the like when the product of the width and the length is 64.

또한, 가로와 세로 길이를 특정하여 크기 정보를 설정하거나 곱의 형태로 크기 정보를 설정하는 것이 혼합되어 사용될 수 있다. 예를 들어, 최대 블록의 크기는 가로와 세로 길이의 곱이 4096이고 둘 중 하나의 길이가 갖는 최대값이 64일 경우, 64 x 64가 최대 블록의 크기에 해당될 수 있다.In addition, setting the size information by specifying the horizontal and vertical lengths or setting the size information in the form of a product may be used in combination. For example, if the maximum block size is 4096, the product of width and length is 4096, and the maximum value of one of the lengths is 64, 64 x 64 may correspond to the size of the maximum block.

상기 예와 같이 최소 블록과 최대 블록 크기 정보 외에 블록 분할 정보가 혼합되어 예측 블록의 크기 및 형태가 최종 결정될 수 있다. 본 발명에서는 예측 블록은 가로와 세로 길이의 곱이 s(예를 들어, s는 16, 32 등 2의 배수)보다 크거나 같아야 하며 가로/세로 길이 중 하나가 k(예를 들어, k는 4, 8 등 2의 배수)보다 크거나 같아야 한다. 또한, 블록의 가로와 세로가 각각 v와 w(예를 들어, v와 w는 16, 32, 64 등 2의 배수)보다 작거나 같은 설정 하에 정의될 수 있으나. 이에 한정되지 않고 다양한 블록 범위 설정이 가능할 수 있다.As in the above example, block division information may be mixed in addition to the minimum block and maximum block size information to finally determine the size and shape of the prediction block. In the present invention, the prediction block requires that the product of the width and length is greater than or equal to s (for example, s is a multiple of 2, such as 16 and 32), and one of the width and length lengths is k (for example, k is 4, Must be greater than or equal to 8). In addition, the width and height of the block may be defined under a setting equal to or less than v and w (for example, v and w are multiples of 2, such as 16, 32, and 64). Not limited to this, various block range settings may be possible.

화면내 예측은 예측 블록 단위로 수행되는 것이 일반적일 수 있으나 블록 분할부의 설정에 따라 부호화 블록, 변환 블록 등의 단위로 수행될 수 있다. 블록 정보를 확인한 후 참조 화소 구성부에서는 현재 블록의 예측에 사용되는 참조 화소를 구성할 수 있다. 이때, 참조 화소는 임시 메모리(예를 들어, 배열<Array>. 1차, 2차 배열 등)를 통해 관리될 수 있으며, 블록의 화면내 예측 과정마다 생성 및 제거되고, 임시 메모리의 크기는 참조 화소의 구성에 따라 결정될 수 있다.Intra prediction may be generally performed in units of prediction blocks, but may be performed in units of coding blocks, transform blocks, or the like according to the setting of the block partitioner. After checking the block information, the reference pixel configuration unit may configure a reference pixel used for prediction of the current block. In this case, the reference pixel may be managed through a temporary memory (for example, an array <Array>, a primary or a secondary array, etc.), generated and removed for each intra-prediction process of the block, and the size of the temporary memory is referred to. It may be determined according to the configuration of the pixel.

본 예에서는 현재 블록을 중심으로 좌, 상, 좌상, 우상, 좌하 블록이 현재 블록의 예측에 사용되는 경우를 가정하여 설명하지만, 이에 한정되지 않고 다른 구성의 블록 후보군이 현재 블록의 예측에 사용될 수도 있다. 예를 들어, 상기 참조 화소를 위한 이웃 블록의 후보군은 래스터 또는 Z 스캔을 따르는 경우의 일 예일 수 있으며, 스캔 순서에 따라 상기 후보군 중 일부를 제거할 수 있거나 또는 다른 블록 후보군(예를 들어, 우, 하, 우하 블록 등이 추가 구성)을 포함하여 구성될 수 있다.In the present example, it is assumed that left, top, top left, top right, and bottom left blocks are used for prediction of the current block with respect to the current block. However, the present invention is not limited thereto, and block candidate groups having other configurations may be used for prediction of the current block. have. For example, the candidate group of neighboring blocks for the reference pixel may be an example when following a raster or Z scan, and some of the candidate groups may be removed according to the scanning order, or other block candidate groups (eg, right , Lower, lower right block, etc. may be configured).

또한, 일부 예측 모드(컬러 복사 모드)가 지원되는 경우라면 다른 컬러 공간의 일부 영역이 현재 블록의 예측에 사용될 수 있기 때문에 이 또한 참조 화소로 고려할 수 있다. 기존의 참조 화소(현재 블록의 공간적 인접한 영역)과 상기 추가적인 참조 화소를 하나로 관리할 수 있거나 또는 따로 관리(예를 들어, 참조 화소 A와 참조 화소 B. 즉, 임시 메모리가 따로 사용되는 것처럼 참조 화소 메모리도 따로 명명할 수 있음)할 수 있다.In addition, if some prediction modes (color copy modes) are supported, this may also be considered a reference pixel since some regions of other color spaces may be used for prediction of the current block. An existing reference pixel (spatially adjacent area of the current block) and the additional reference pixel can be managed as one or separately (for example, reference pixel A and reference pixel B. That is, the reference pixel is used as if the temporary memory is used separately). Memory can be named separately).

예를 들어, 기본 참조 화소의 임시 메모리는 (하나의 참조 화소 라인 기준) <2 x blk_width + 2 x blk_height + 1>의 크기를 가질 수 있고, 추가적인 참조 화소의 임시 메모리는 (4:4:4인 경우) <blk_width x blk_height>의 크기(4:2:0인 경우에는 blk_width/2 x blk_height/2가 필요)를 가질 수 있다. 상기 임시 메모리 크기는 하나의 예이며 이에 한정되지 않는다.For example, the temporary memory of the base reference pixel may have a size of <2 x blk_width + 2 x blk_height + 1> (based on one reference pixel line), and the temporary memory of the additional reference pixel may be (4: 4: 4 In the case of 4), the size of <blk_width x blk_height> (in case of 4: 2: 0, blk_width / 2 x blk_height / 2 is required). The temporary memory size is one example and is not limited thereto.

또한, 상관성 정보를 획득하기 위해 비교(또는 참조)되는 현재 블록과 대응되는 블록의 인접한 영역까지 포함하여 참조 화소로 관리될 수도 있다. 즉, 컬러 복사 모드에 따라 추가적인 참조 화소가 관리될 수 있다는 것을 의미한다.In addition, a neighboring area of a block corresponding to the current block to be compared (or referenced) to obtain correlation information may be managed as a reference pixel. That is, additional reference pixels may be managed according to the color copy mode.

정리하면, 현재 블록의 인접한 영역이 현재 블록의 화면내 예측을 위한 참조 화소로 포함될 수 있고, 예측 모드에 따라 다른 컬러 공간의 대응되는 블록과 그 인접한 영역까지 참조 화소로 포함될 수 있다.In summary, adjacent regions of the current block may be included as reference pixels for intra prediction of the current block, and corresponding blocks of other color spaces and their adjacent regions may be included as reference pixels according to a prediction mode.

도 10은 본 발명의 일 실시예에 따른 화면내 예측의 대상 블록과 인접한 블록을 나타내는 개념도이다. 상세하게는, 도 10의 좌측은 현재 컬러 공간의 현재 블록과 인접한 블록을 나타내고, 우측은 다른 컬러 공간의 대응되는 블록을 나타낸다. 후술하는 내용은 설명의 편의를 위해 현재 컬러 공간의 현재 블록과 인접한 블록이 기본 참조 화소 구성인 경우를 가정하여 설명한다.10 is a conceptual diagram illustrating a block adjacent to a target block of intra prediction according to an embodiment of the present invention. Specifically, the left side of FIG. 10 represents a block adjacent to the current block of the current color space, and the right side represents a corresponding block of another color space. For convenience of explanation, the following description assumes that a block adjacent to the current block of the current color space has a basic reference pixel configuration.

도 9와 같이 현재 블록의 예측에 사용되는 참조 화소는 좌, 상, 좌상, 우상, 좌하 블록의 인접한 화소(도 9의 Ref_L, Ref_T, Ref_TL, Ref_TR, Ref_BL)로 구성할 수 있다. 이때, 참조 화소는 현재 블록과 가장 인접한 이웃 블록의 화소들(도 9의 a. 이것을 참조 화소 라인으로 표현)로 구성하는 것이 일반적이나 그 외의 화소들(도 9의 b와 그 외의 바깥 라인의 화소들)도 참조 화소에 구성하는 것이 가능할 수 있다.As illustrated in FIG. 9, the reference pixels used for prediction of the current block may include adjacent pixels (Ref_L, Ref_T, Ref_TL, Ref_TR, and Ref_BL in FIG. 9) of the left, top, left top, right top, and bottom left blocks. In this case, the reference pixel is generally composed of pixels of a neighboring block closest to the current block (a of FIG. 9 is represented by a reference pixel line), but other pixels (b of FIG. 9 and other outer lines of pixels) May also be configured in the reference pixel.

현재 블록과 인접한 화소는 적어도 하나의 참조 화소 라인으로 분류할 수 있는데, 현재 블록과 가장 인접한 화소는 ref_0{예를 들어, 현재 블록의 경계 화소와 화소 간 거리가 1인 화소들. p(-1,-1) ~ p(2m-1,-1), p(-1,0) ~ p(-1,2n-1)}, 그 다음 인접한 화소{예를 들어, 현재 블록의 경계 화소와 화소 간 거리가 2. p(-2,-2) ~ p(2m,-2), p(-2,-1) ~ p(-2,2n)}는 ref_1, 그 다음 인접한 화소{예를 들어, 현재 블록의 경계 화소와 화소 간 거리가 3. p(-3,-3) ~ p(2m+1, -3), p(-3,-2) ~ p(-3,2n+1)}는 ref_2 등으로 나눌 수 있다. 즉, 현재 블록의 경계 화소와 인접한 화소 거리에 따라 참조 화소 라인으로 분류할 수 있다.Pixels adjacent to the current block may be classified into at least one reference pixel line, and pixels closest to the current block are ref_0 {for example, pixels having a distance between the boundary pixel of the current block and the pixel 1. p (-1, -1) to p (2m-1, -1), p (-1,0) to p (-1,2n-1)}, and the next adjacent pixel {e.g., The distance between the boundary pixel and the pixel is 2.p (-2, -2) to p (2m, -2), p (-2, -1) to p (-2,2n)} is ref_1, and then the adjacent pixel. {For example, the distance between the boundary pixel and the pixel of the current block is 3.p (-3, -3) to p (2m + 1, -3), p (-3, -2) to p (-3, 2n + 1)} may be divided into ref_2 and the like. That is, it may be classified as a reference pixel line according to a pixel distance adjacent to the boundary pixel of the current block.

여기서 지원되는 참조 화소 라인은 N개 이상일 수 있으며, N은 1 내지 5와 같은 1 이상의 정수일 수 있다. 이때, 현재 블록에 최인접한 참조 화소 라인부터 순차적으로 참조 화소 라인 후보군에 포함되는 것이 일반적이나, 이에 한정되지 않는다. 예를 들어, N이 3일 경우 <ref_0, ref_1, ref_2>와 같이 순차적으로 상기 후보군이 구성될 수 있거나 또는 <ref_0, ref_1, ref_3>, <ref_0, ref_2, ref_3>, <ref_1, ref_2, ref_3>와 같이 순차적이지 않거나 최인접한 참조 화소 라인을 제외하는 구성으로 상기 후보군이 구성되는 것 또한 가능할 수 있다.Here, the supported reference pixel lines may be N or more, and N may be an integer of 1 or more, such as 1 to 5. In this case, the reference pixel line candidate group is sequentially included in the reference pixel line closest to the current block, but is not limited thereto. For example, when N is 3, the candidate group may be sequentially configured as <ref_0, ref_1, ref_2>, or <ref_0, ref_1, ref_3>, <ref_0, ref_2, ref_3>, <ref_1, ref_2, ref_3 It may also be possible for the candidate group to be configured in such a manner as to exclude non-sequential or closest reference pixel lines such as >

상기 후보군 내의 모든 참조 화소 라인을 사용하여 예측을 수행하거나 또는 일부 참조 화소 라인(하나 이상)을 사용하여 예측을 수행할 수 있다.Prediction may be performed using all reference pixel lines in the candidate group, or prediction may be performed using some reference pixel lines (one or more).

예를 들어, 부/복호화 설정에 따라 복수의 참조 화소 라인 중 하나가 선택되어 해당 참조 화소 라인을 사용하여 화면내 예측을 수행할 수 있다. 또는, 복수의 참조 화소 라인 중 둘 이상이 선택되어 해당 참조 화소 라인을 사용(예를 들어, 각 참조 화소 라인의 데이터에 가중치 평균 등을 적용)하여 화면내 예측을 수행할 수 있다.For example, one of a plurality of reference pixel lines may be selected according to a negative / decoding setting to perform intra prediction using the reference pixel lines. Alternatively, two or more of the plurality of reference pixel lines may be selected to perform intra prediction by using the reference pixel lines (for example, applying a weighted average to data of each reference pixel line).

여기서 참조 화소 라인 선택은 묵시적 또는 명시적으로 정해질 수 있다. 예를 들어, 묵시적인 경우에는 영상 타입, 컬러 성분, 블록의 크기/형태/위치 등의 요소 중 하나 또는 둘 이상의 조합에 따라 정의되는 부/복호화 설정에 따라 정해지는 것을 의미한다. 또한, 명시적인 경우는 블록 등의 단위에서 참조 화소 라인 선택 정보가 발생할 수 있음을 의미한다.Here, the reference pixel line selection may be determined implicitly or explicitly. For example, in the case of implied, it means that it is determined according to an encoding / decoding setting defined by one or a combination of two or more elements such as an image type, a color component, and a size / shape / position of a block. In addition, the explicit case means that reference pixel line selection information may occur in a unit such as a block.

본 발명에서는 최인접한 참조 화소 라인을 사용하여 화면내 예측을 수행하는 경우를 중심으로 설명하지만, 후술하는 다양한 실시예가 복수의 참조 화소 라인을 사용하는 경우에도 동일하거나 비슷한 적용이 가능함을 이해하여야 한다.Although the present invention will be described based on the case of performing intra-prediction using the nearest reference pixel line, it should be understood that various embodiments described below may be applied in the same or similar manner even when a plurality of reference pixel lines are used.

본 발명의 화면내 예측의 참조 화소 구성부는 참조 화소 생성부, 참조 화소 보간부, 참조 화소 필터부 등을 포함할 수 있으며, 상기 구성의 전부 또는 일부를 포함하여 구성할 수 있다.The reference pixel component of the intra prediction according to the present invention may include a reference pixel generator, a reference pixel interpolator, a reference pixel filter, and the like, and may include all or part of the above configuration.

참조 화소 구성부에서 참조 화소 사용 가능성(Availability)을 확인하여 사용 가능한 참조 화소와 사용 불가한 참조 화소를 분류할 수 있다. 여기서 상기 참조 화소 사용 가능성은 다음의 조건 중 적어도 하나를 만족하는 경우에 사용 불가로 판단한다. 물론 후술하는 예에서 언급되지 않은 추가적인 조건에 의해 참조 화소 사용 가능성을 판단할 수도 있지만, 본 발명에서는 후술하는 예시에서의 조건에 한정되는 경우를 가정하여 설명한다.The reference pixel configuration unit may check the availability of the reference pixel to classify the available reference pixel and the unavailable reference pixel. Here, the availability of the reference pixel is determined to be unavailable when at least one of the following conditions is satisfied. Of course, although the possibility of using the reference pixel may be determined by additional conditions not mentioned in the examples described below, the present invention will be described on the assumption that it is limited to the conditions in the examples described below.

예를 들어, 픽쳐 경계 바깥에 위치하는 경우, 현재 블록과 동일한 분할 단위(예를 들어, 슬라이스, 타일 등과 같이 서로 참조가 불가능한 단위. 단, 슬라이스나 타일과 같은 단위라도 서로 참조 가능한 특성을 갖는 경우에는 동일한 분할 단위가 아니더라도 예외 처리)에 속하지 않는 경우, 부/복호화가 완료되지 않은 경우 중 하나라도 만족하는 경우에는 사용 불가로 판단할 수 있다. 즉, 상기 조건을 하나도 만족하지 않는 경우에는 사용 가능으로 판단할 수 있다.For example, when located outside the picture boundary, the same division unit as the current block (for example, a unit that cannot be referred to each other such as a slice or a tile, etc., but a unit such as a slice or a tile has characteristics that can be referred to each other) If it does not belong to the exception processing, even if not in the same partition unit, it can be determined that it is unavailable if any one of the cases where encoding / decoding is not completed is satisfied. That is, when none of the above conditions are satisfied, it can be determined that it can be used.

또한, 부/복호화 설정에 의해 참조 화소 사용을 제한할 수 있다. 예를 들어, 상기 조건에 따라 사용 가능으로 판단된 경우라 할지라도 제한된 화면내 예측(예를 들어, constrained_intra_pred_flag)의 수행 여부에 따라 참조 화소 사용이 제한될 수 있다. 제한된 화면내 예측은 통신 환경 등의 외부 요인에 에러 강인한 부/복호화를 수행하고자 할 때 다른 영상으로부터 참조되어 복원된 블록을 참조 화소로 사용을 금지하고자 할 때 수행될 수 있다.In addition, the use of the reference pixel can be restricted by the negative / decoding settings. For example, even when it is determined to be usable according to the above condition, the use of the reference pixel may be limited according to whether limited intra prediction (eg, constrained_intra_pred_flag) is performed. The limited intra prediction may be performed when an attempt is made to prohibit the use of a block reconstructed by referencing from another image as a reference pixel when attempting to perform error robust encoding / decoding to an external factor such as a communication environment.

제한된 화면내 예측이 비활성화된 경우(예를 들어, I 영상 타입. 또는 P나 B 영상 타입에서 constrained_intra_pred_flag가 0으로 설정)에 참조 화소 후보 블록(단, 픽쳐 경계 안쪽에 위치하는 등의 전술한 조건을 만족하는 경우)은 사용 가능할 수 있다.If the limited intra prediction is deactivated (e.g., I picture type or constrained_intra_pred_flag is set to 0 in P or B picture type), the above-described conditions such as being located inside the picture boundary are excluded. If satisfied) may be available.

또는, 제한된 화면내 예측이 활성화된 경우(예를 들어, P나 B 영상 타입에서 constrained_intra_pred_flag가 1으로 설정)에 참조 화소 후보 블록은 부호화 모드(Intra or Inter)에 따라 사용 여부가 판단될 수 있다. 일반적으로 Intra 모드일 경우에는 사용 가능하고 Inter 모드일 경우에는 사용 불가하다. 상기 예에서 부호화 모드에 따라 사용 여부가 정해지는 경우를 가정하지만, 그 외의 다양한 부/복호화 요소에 따라 상기 사용 여부가 판단될 수도 있다.Alternatively, when limited intra prediction is activated (for example, constrained_intra_pred_flag is set to 1 in a P or B picture type), it may be determined whether a reference pixel candidate block is used according to an encoding mode (Intra or Inter). In general, it can be used in Intra mode, but not in Inter mode. In the above example, it is assumed that use is determined according to an encoding mode. However, the use may be determined according to various other encoding / decoding elements.

참조 화소는 하나 이상의 블록으로 구성되어 있기 때문에 상기 참조 화소 가능성을 확인한 후 분류하면 <모두 사용 가능>, <일부 사용 가능>, <모두 사용 불가>와 같이 세 가지 경우로 분류할 수 있다. 모두 사용 가능한 경우를 제외한 나머지 경우에는 사용 불가한 후보 블록 위치의 참조 화소를 채우거나 생성할 수 있다(A). 또는, 사용 불가한 후보 블록 위치의 참조 화소는 예측 과정에 사용하지 않을 수 있고, 해당 위치의 참조 화소로부터 예측이 수행되는 예측 모드는 제외하여 예측 모드 부/복호화를 수행할 수 있다(B).Since the reference pixel is composed of one or more blocks, when the possibility of the reference pixel is identified and classified, the reference pixel may be classified into three cases, such as <usable for all>, <some for some use>, and <not for all use>. In other cases except when all are available, reference pixels of candidate block positions that are not available may be filled or generated (A). Alternatively, the reference pixel of the unusable candidate block position may not be used in the prediction process, and the prediction mode encoding / decoding may be performed except for the prediction mode in which the prediction is performed from the reference pixel of the corresponding position (B).

참조 화소 후보 블록이 사용 가능한 경우에는 해당 위치의 화소를 현재 블록의 참조 화소 메모리에 포함할 수 있다. 이때, 상기 화소 데이터는 그대로 복사되거나 참조 화소 필터링, 참조 화소 보간 등의 과정을 통해 참조 화소 메모리에 포함할 수 있다.When the reference pixel candidate block is available, the pixel at the corresponding position may be included in the reference pixel memory of the current block. In this case, the pixel data may be copied as it is or included in the reference pixel memory through processes such as reference pixel filtering and reference pixel interpolation.

참조 화소 후보 블록이 사용 불가한 경우에는 참조 화소 처리 A 또는 B 설정 하에 처리될 수 있다. 다음을 통해 각 설정에 따라 참조 화소 후보 블록이 사용 불가한 경우의 처리 예를 살펴본다.If the reference pixel candidate block is unavailable, it can be processed under the reference pixel processing A or B setting. An example of processing when the reference pixel candidate block is unavailable according to each setting is described below.

(A) 참조 화소 후보 블록이 사용 불가한 경우에는 참조 화소 생성 과정을 통해 획득된 해당 위치의 화소를 현재 블록의 참조 화소 메모리에 포함할 수 있다.(A) When the reference pixel candidate block is unavailable, the pixel of the corresponding position obtained through the reference pixel generation process may be included in the reference pixel memory of the current block.

다음은 참조 화소 생성 과정에 대한 예로 사용 불가한 위치의 참조 화소를 생성하는 방법을 설명한다.The following describes a method of generating a reference pixel at a position that cannot be used as an example of a reference pixel generation process.

예를 들어, 임의의 화소값을 사용하여 참조 화소를 생성할 수 있다. 여기서 임의의 화소값이란 화소값 범위(예를 들어, 비트 심도에 기초한 화소값 범위 또는 해당 영상 내 화소 분포에 따른 화소값 범위)에 속하는 하나의 화소값(예를 들어, 화소값 범위의 최소값, 최대값, 중앙값 등)일 수 있다. 상세하게는, 참조 화소 후보 블록이 모두 사용 불가한 경우에 적용되는 예일 수 있으나, 이에 한정되지 않으며 일부만 사용 불가한 경우에도 적용 가능할 수 있다.For example, the reference pixel may be generated using any pixel value. Here, the arbitrary pixel value means one pixel value (for example, the minimum value of the pixel value range) belonging to the pixel value range (for example, the pixel value range based on the bit depth or the pixel value range according to the pixel distribution in the corresponding image). Maximum value, median value, etc.). In more detail, the present invention may be an example in which all of the reference pixel candidate blocks are unavailable, but the present invention is not limited thereto and may be applicable even when only some of the reference pixel candidate blocks are unavailable.

또는, 영상의 부/복호화가 완료된 영역으로부터 참조 화소를 생성할 수 있다. 상세하게는, 사용 불가한 블록에 인접한 적어도 하나의 사용 가능한 블록(또는 사용 가능한 참조 화소)에 기반하여 참조 화소를 생성할 수 있다. 이때, 외삽, 내삽, 복사 등의 방법 중 적어도 하나를 사용할 수 있다.Alternatively, the reference pixel may be generated from an area in which encoding / decoding of the image is completed. In detail, the reference pixel may be generated based on at least one available block (or available reference pixel) adjacent to the unavailable block. In this case, at least one of extrapolation, interpolation, and copying may be used.

(B) 참조 화소 후보 블록이 사용 불가한 경우에는 해당 위치의 화소를 사용하는 예측 모드는 사용을 제한할 수 있다. 예를 들어, 도 9에서 TR 위치의 참조 화소가 사용 불가한 경우 해당 위치의 화소를 사용하여 예측을 수행하는 51번 내지 66번 모드(도 4)의 사용을 제한하고, TR 위치의 참조 화소가 아닌 T, TL, L, BL 위치의 참조 화소를 사용하여 예측을 수행하는 2번 내지 50번 모드(수직 모드)의 사용을 허용(본 예에서는 방향성 모드에 한정하여 설명)할 수 있다.(B) When the reference pixel candidate block is unavailable, the prediction mode using the pixel at the corresponding position may limit the use. For example, when the reference pixel at the TR position is not available in FIG. 9, the use of the 51 to 66 modes (FIG. 4) that perform prediction using the pixel at the corresponding position is limited, and the reference pixel at the TR position is limited. In addition, the use of modes 2 to 50 (vertical mode) in which prediction is performed using reference pixels at positions T, TL, L, and BL may be allowed (this example is limited to the directional mode).

다른 예로, 모든 위치의 참조 화소가 사용 불가한 경우 허용되는 예측 모드는 존재하지 않을 수 있다. 이 경우 A 설정의 일부 구성과 같이 임의의 화소값을 사용하여 예측 블록을 생성할 수 있으며, 다음 블록의 예측 모드 부/복호화 과정에 참조를 위한 목적으로 기 설정된 예측 모드(예를 들어, DC 모드 등)를 해당 블록의 예측 모드로 설정할 수 있다. 즉, 예측 모드 부/복호화 과정이 묵시적으로 생략될 수 있다.As another example, an allowable prediction mode may not exist when reference pixels of all positions are unavailable. In this case, a prediction block may be generated using an arbitrary pixel value as in some configurations of the A setting, and a prediction mode (for example, a DC mode) is set for reference in the prediction mode encoding / decoding process of the next block. Etc.) may be set as the prediction mode of the corresponding block. That is, the prediction mode encoding / decoding process may be implicitly omitted.

상기 예는 예측 모드 부/복호화 과정과 연계되는 경우일 수 있다. 본 발명의 예측 모드 부/복호화부는 A 설정이 지원되는 경우를 가정하여 후술하였다. 만약 B 설정이 지원되는 경우라면 예측 모드 부/복호화부의 일부 구성이 변경될 수 있다. 모든 위치의 참조 화소가 사용 불가한 경우에 대해서는 이미 전술하였으므로, 일부 위치의 참조 화소가 사용 불가한 경우에 대해 후술한다.The above example may be a case associated with a prediction mode encoding / decoding process. The prediction mode encoder / decoder of the present invention is described below on the assumption that the A setting is supported. If the B setting is supported, some components of the prediction mode encoder / decoder may be changed. Since the case where the reference pixels at all positions are not available has already been described above, the case where the reference pixels at some positions are not available will be described later.

예를 들어, MPM 후보군에 이웃 블록의 예측 모드가 포함되는 경우를 가정하자. 이웃 블록의 예측 모드가 현재 블록에서 사용 불가한 블록 위치의 참조 화소를 사용하는 예측 모드인 경우에는 해당 모드를 MPM 후보군에서 제외하는 과정이 추가될 수 있다. 즉, 예측 모드 부/복호화부에서 후술할 중복성 확인 과정에 사용 불가 모드 확인 과정이 추가될 수 있다. 여기서, 사용 불가 모드는 다양한 정의에 의해 지정될 수 있으나 본 예에서는 사용 불가한 블록 위치의 참조 화소를 사용하는 예측 모드라 가정한다. 그래서 우선 순위에 따라 예측 모드의 MPM 후보군 구성 과정을 수행하되, 중복성 확인 과정 및/또는 사용 불가 모드 확인 과정을 통해 MPM 후보군에 포함할 지 여부를 결정할 수 있다. 여기서 해당 순위의 예측 모드가 상기 확인 과정을 통과하지 못할 경우 다음 우선 순위의 예측 모드가 MPM 후보군 구성 과정의 후보가 될 수 있다.For example, suppose that the MPM candidate group includes the prediction mode of the neighboring block. When the prediction mode of the neighboring block is a prediction mode using a reference pixel of a block position that is not available in the current block, a process of excluding the corresponding mode from the MPM candidate group may be added. That is, the unavailable mode check process may be added to the redundancy check process to be described later in the prediction mode encoder / decoder. Here, the unusable mode may be specified by various definitions, but in the present example, it is assumed that the unusable mode is a prediction mode using a reference pixel of an unusable block position. Therefore, the process of constructing the MPM candidate group in the prediction mode according to the priority may be performed, and whether to include it in the MPM candidate group through the redundancy check process and / or the unavailable mode check process may be determined. If the prediction mode of the corresponding rank does not pass the checking process, the prediction mode of the next priority may be a candidate for the MPM candidate group formation process.

또는, 도 9의 TR, T, TL 위치의 참조 화소가 사용 불가한 경우 해당 위치의 화소를 사용하여 예측을 수행하는 19번 내지 66번의 사용을 제한한다고 가정하자. 이 경우 L과 BL 위치의 참조 화소를 사용하여 예측을 수행하는 2번 내지 18번 모드가 사용 가능한 예측 모드일 수 있는데, 이 경우 MPM 후보군에 포함되는 개수가 6개라고 가정하면, non-MPM 후보군에 포함되는 개수는 12개일 수 있다. 이때, MPM 후보군의 개수를 6개로 유지하는 것(전체 모드 대비 많은 개수)은 비효율적일 수 있는 것과 같이 사용 불가한 참조 화소로 인하여 예측 모드 사용이 제한될 때 MPM 후보군의 개수 조정(예를 들어, p개 -> q개. p > q) 및 이진화(예를 들어, 가변 길이 이진화 A -> 가변 길이 이진화 B 등) 등의 엔트로피 부/복호화 설정 변경 또한 발생할 수 있다. 즉, 적응적인 예측 모드 부/복호화가 지원되는 상황일 수 있으며, 이에 대한 상세한 설명은 생략한다.Or, suppose that when reference pixels of the TR, T, and TL positions of FIG. 9 are not available, use of Nos. 19 to 66 for performing prediction using the pixels of the corresponding positions is limited. In this case, modes 2 to 18 in which prediction is performed using reference pixels at L and BL positions may be available prediction modes. In this case, assuming that the number of MPM candidate groups is 6, the non-MPM candidate group may be used. The number included in may be twelve. At this time, maintaining the number of MPM candidate groups to 6 (larger number than the total mode) may be inefficient, such as adjusting the number of MPM candidate groups when the use of the prediction mode is restricted due to the unavailable reference pixels. Changes in entropy portion / decoding settings such as p-> q. p> q) and binarization (e.g., variable length binarization A-> variable length binarization B, etc.) can also occur. That is, it may be a situation in which adaptive prediction mode encoding / decoding is supported, and a detailed description thereof will be omitted.

또한, non-MPM 후보군에도 사용 불가한 참조 화소에 의하여 사용이 제한되는 예측 모드는 발생 가능성이 없는 것은 동일하기 때문에 해당 모드를 후보군에 포함할 필요가 없을 수 있다. 이는 non-MPM 후보군의 개수 조정(예를 들어, s개 -> t개. s > t) 및 이진화(예를 들어, 고정 길이 이진화 -> 가변 길이 이진화 등) 등의 엔트로피 부/복호화 설정이 MPM 후보군과 같이 변경이 가능한 적응적인 예측 모드 부/복호화가 지원되는 상황일 수 있다.In addition, since prediction modes in which use is restricted by reference pixels that are not available to non-MPM candidate groups are not likely to occur, it may not be necessary to include the corresponding modes in the candidate groups. This can be achieved by entropy min / decoding settings such as adjusting the number of non-MPM candidates (e.g. s-> t. S> t) and binarization (e.g., fixed length binarization-> variable length binarization, etc.). It may be a situation in which adaptive prediction mode encoding / decoding which can be changed, such as a candidate group, is supported.

상기 예를 통해 참조 화소가 사용 불가한 경우의 다양한 처리 예를 살펴보았다. 이는 일반적인 예측 모드뿐만 아니라 컬러 복사 모드의 경우에도 발생 가능한 경우일 수 있다. Various examples of processing when the reference pixel is not available have been described through the above examples. This may be the case in the case of the color copy mode as well as the general prediction mode.

다음은 컬러 복사 모드가 지원될 때 참조 화소 사용 가능성에 기반하여 사용 가능한 참조 화소와 사용 불가한 참조 화소로 분류를 수행하고, 그에 대한 다양한 처리에 관한 예를 살펴보기로 한다.Next, when the color copy mode is supported, classification is performed into usable reference pixels and unusable reference pixels based on the availability of reference pixels, and examples of various processes thereof will be described.

도 11은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 참조 화소 사용 가능성을 설명하기 위한 예시도이다. 도 11은 현재 블록(현재 컬러 공간)과 대응되는 블록(다른 컬러 공간)의 좌, 상 블록이 상관성 정보 획득에 사용되는 영역을 의미하는 경우와 일부 컬러 포맷(YCbCr 4:4:4)인 경우를 가정한다.11 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention. 11 illustrates a case in which left and upper blocks of a block (another color space) corresponding to a current block (current color space) mean an area used for acquiring correlation information, and in some color formats (YCbCr 4: 4: 4). Assume

참조 화소 사용 가능성은 현재 블록의 위치에 기반(예를 들어, 픽쳐 경계의 바깥에 위치하는지 등)하여 판단될 수 있다고 이미 언급하였다. 도 11은 현재 블록의 위치에 기반하여 가질 수 있는 참조 화소 사용 가능성의 다양한 예를 나타내고 있다.It has already been mentioned that the reference pixel availability can be determined based on the position of the current block (eg, located outside the picture boundary). 11 illustrates various examples of the possibility of using a reference pixel that may have based on a position of a current block.

도 11에서 현재 블록의 참조 화소 사용 가능성은 대응되는 블록과 동일한 경우(결과)를 의미한다. 단, 다른 컬러 공간에서 현재 컬러 공간과 동일한 분할 단위(타일, 슬라이스 등)로 구획되는 경우(단, 컬러 포맷의 성분 비를 고려 필요)임을 가정한다.In FIG. 11, the possibility of using the reference pixel of the current block means the same case as the corresponding block (result). However, it is assumed that the case is divided into the same division unit (tile, slice, etc.) as the current color space in another color space (but it is necessary to consider the component ratio of the color format).

도 11의 a는 참조 화소가 모두 사용 가능한 경우이며, 도 11의 b과 c는 참조 화소의 일부가 사용 가능한 경우(각각 상, 좌 블록)이며, 도 11의 d는 참조 화소가 모두 사용 불가한 경우를 의미한다.FIG. 11A illustrates a case in which all of the reference pixels are usable. FIG. 11B illustrates a case in which some of the reference pixels are available (the upper and left blocks, respectively). In FIG. 11D, all reference pixels are unavailable. It means the case.

도 11의 a를 제외하면 적어도 하나의 참조 화소가 사용 불가한 경우에 속하므로 이를 위한 처리가 필요하다. 참조 화소 처리 A 설정에 따를 경우 참조 화소 생성 과정을 통해 사용 불가한 영역을 채우는 과정이 수행될 수 있다. 이때, 현재 블록의 참조 화소는 이미 전술한 참조 화소 생성 과정(일반적인 화면내 예측)을 통해 처리 가능할 수 있다. Except for a of FIG. 11, at least one reference pixel belongs to a case where it is not available, and thus processing for this is necessary. According to the reference pixel processing A setting, a process of filling the unusable region through the reference pixel generation process may be performed. In this case, the reference pixel of the current block may be processed through the aforementioned reference pixel generation process (general intra prediction).

대응되는 블록의 참조 화소는 현재 블록과 동일하거나 다른 처리가 가능할 수 있다. 예를 들어, 현재 블록의 참조 화소 중 L2 위치(도 10 참조)의 참조 화소가 사용 불가할 경우 임의의 화소값을 통해 생성하거나 또는 사용 가능한 참조 화소을 통해 생성할 수 있다. 상세하게는, 사용 가능한 참조 화소는 사용 불가한 참조 화소의 좌/우 또는 상/하 방향(본 예에서 L1, L3 등)에 위치할 수 있거나 또는 동일한 참조 화소 라인(본 예에서 R3 등)에 위치할 수 있다.The reference pixel of the corresponding block may be the same as or different from the current block. For example, when the reference pixel at the L2 position (see FIG. 10) among the reference pixels of the current block is unavailable, the reference pixel may be generated through an arbitrary pixel value or through an available reference pixel. Specifically, the usable reference pixel may be located in the left / right or up / down direction (L1, L3, etc. in this example) of the unavailable reference pixel, or in the same reference pixel line (R3, etc. in this example). Can be located.

반면, 대응되는 블록의 참조 화소 역시 임의의 화소값을 통해 생성하거나 또는 사용 가능한 참조 화소를 통해 생성할 수 있다. 단, 사용 가능한 참조 화소의 위치가 현재 블록과 동일하거나 다를 수 있다. 상세하게는, 사용 가능한 참조 화소는 사용 불가한 참조 화소의 좌/우/상/하 방향뿐만 아니라 좌상, 우상, 좌하, 우하 등의 다양한 방향에 위치할 수 있다. 현재 블록의 경우 아직 부/복호화가 완료되지 않았기 때문에 도 10의 a 내지 p의 화소는 사용 가능한 참조 화소에 속하지 않지만, 대응되는 블록의 경우 부/복호화가 완료되었기 때문에 도 10의 aa 내지 pp의 화소 또한 사용 가능한 참조 화소에 속할 수 있다. 그렇기 때문에 사용 가능한 참조 화소의 내삽, 외삽, 복사, 필터링 등의 다양한 방법을 사용하여 사용 불가한 위치의 참조 화소를 생성할 수 있다.On the other hand, the reference pixel of the corresponding block may also be generated through an arbitrary pixel value or through an available reference pixel. However, the position of the available reference pixel may be the same as or different from the current block. In detail, the usable reference pixel may be located in various directions such as left, right, top, bottom, right and bottom as well as left, right, up, and down directions of the unavailable reference pixel. The pixels of a to p in FIG. 10 do not belong to usable reference pixels because the encoding / decoding is not yet completed in the case of the current block, but the pixels of aa to pp in FIG. It may also belong to the available reference pixel. Therefore, various methods such as interpolation, extrapolation, copying, and filtering of usable reference pixels may be used to generate reference pixels at unusable positions.

상기 과정을 통해 도 11의 b 내지 d와 같은 사용 불가한 위치의 참조 화소를 생성하여 참조 화소 메모리에 포함할 수 있으며, 도 11의 a와 같이 상관성 정보 획득을 위해 해당 위치의 참조 화소를 사용할 수 있다.Through the above process, reference pixels of unusable positions such as b to d of FIG. 11 may be generated and included in the reference pixel memory, and reference pixels of corresponding positions may be used to obtain correlation information as shown in FIG. have.

다음은 참조 화소 처리 B 설정을 따를 경우에 대한 설명을 이어간다. 사용 불가한 위치의 참조 화소의 사용을 제한할 수 있다. 또한, 사용 불가한 위치의 참조 화소로부터 예측이 수행되는 예측 모드의 사용을 제한(적응적인 예측 모드 부/복호화 등이 적용)하거나 그 외의 처리가 가능할 수 있다.The following is a description of the case where the reference pixel processing B setting is followed. The use of the reference pixel at an unusable position can be restricted. In addition, the use of a prediction mode in which prediction is performed from a reference pixel at an unusable position may be restricted (adapted by adaptive prediction mode decoding / decoding) or other processing may be possible.

우선, 사용 불가한 위치의 참조 화소 사용을 제한하는 경우를 설명한다. 도 11의 a와 같이 현재 블록과 대응되는 블록의 각각의 좌, 상 블록이 상관성 정보 획득에 사용되어야 하지만, 도 11의 b와 c는 일부 참조 화소가 사용 불가한 경우에 해당한다. 이때, 사용 불가한 참조 화소는 사용하지 않고 사용 가능한 참조 화소를 사용하여 상관성 정보를 획득할 수 있다. 한편, 상관성 정보 획득을 위한 데이터가 충분하지 않을 경우에 대한 고려가 필요할 수 있다.First, a case of limiting the use of the reference pixel at an unusable position will be described. As shown in a of FIG. 11, each of the left and top blocks of the block corresponding to the current block should be used to obtain correlation information. However, b and c of FIG. 11 correspond to cases in which some reference pixels are unavailable. In this case, the correlation information may be obtained by using the reference pixel that is not used and the usable reference pixel. On the other hand, consideration may be necessary when there is not enough data for obtaining correlation information.

예를 들어, 현재 블록(M x N)의 좌(N), 상(M) 블록이 상관성 정보 획득 영역일 경우, 사용 가능한 참조 화소가 k개(k는 0 초과 <M+N> 이하) 이상/초과일 때 해당 참조 화소는 상관성 정보 획득 과정에 사용될 수 있다. 만약 사용 가능한 참조 화소 개수가 k개 이하/미만일 때 해당 참조 화소는 상관성 정보 획득 과정에 사용될 수 없다.For example, when the left (N) and the upper (M) blocks of the current block (M x N) are the correlation information acquisition region, there are k or more reference pixels available (k is greater than 0 and less than <M + N>). When / is exceeded, the reference pixel may be used in the process of acquiring correlation information. If the number of usable reference pixels is less than / less than k, the reference pixels may not be used in the correlation information acquisition process.

또는, 좌 블록에서 사용 가능한 참조 화소가 p개(p는 0 초과 N 이하) 이상/초과이며 상 블록에서 사용 가능한 참조 화소가 q개(q는 0 초과 M 이하) 이상/초과일 때, 해당 참조 화소는 상관성 정보 획득 과정에 사용될 수 있다. 만약 좌 블록에서 사용 가능한 참조 화소 개수가 p개 이하/미만이거나 상 블록에서 사용 가능한 참조 화소 개수가 q개 이하/미만일 때, 해당 참조 화소는 상관성 정보 획득 과정에 사용될 수 없다.Alternatively, when there are at least p reference pixels (p is greater than 0 or less N) and / or more than the number of reference pixels available in the upper block and q or more (q is greater than or equal to M and less than 0), the corresponding reference is used. The pixel may be used in the process of obtaining correlation information. If the number of reference pixels usable in the left block is less than or equal to p or the number of reference pixels usable in the upper block is less than or equal to q, the corresponding reference pixels cannot be used in the correlation information acquisition process.

전자의 경우 상관성 정보 획득을 위한 전체 영역에서의 경계값 조건에 따른 분류일 수 있고, 후자의 경우 상관성 정보 획득을 위한 일부(부분) 영역에서의 경계값 조건에 따른 분류일 수 있다. 후자의 경우 상관성 정보 획득을 위한 인접 영역을 좌, 상, 좌상, 우상, 좌하 위치로 분류한 경우에 대한 일 예일 수 있으나, 다양한 인접 영역 구분을 기준으로 분류한 경우(예를 들어, 좌, 상 위치로 구분. 이때, 상기 상 + 우상 블록을 상*으로 분류하고, 좌 + 좌하 블록을 좌*로 분류)에도 적용 가능한 예일 수 있다.The former may be a classification according to the boundary value condition in the entire region for obtaining correlation information, and the latter may be a classification according to the boundary value condition in the partial (partial) region for obtaining correlation information. In the latter case, the adjacent region for acquiring correlation information may be classified into left, top, top left, top right, and bottom left positions, but may be classified based on the classification of various adjacent regions (for example, left and top). In this case, the upper + right block may be classified as upper * , and the left + lower block may be classified as left * .

그리고 후자의 경우 각 영역에 따라 경계값 설정을 동일하거나 다르게 둘 수 있다. 예를 들어, 좌 블록은 모든 참조 화소(N개)가 사용 가능한 경우에 해당 참조 화소가 상관성 정보 획득 과정에 사용될 수 있고, 상 블록은 적어도 하나 이상의 참조 화소가 사용 가능한 경우(즉, 일부 참조 화소가 사용 가능한 경우)에 해당 참조 화소가 상관성 정보 획득 과정에 사용될 수 있다.In the latter case, the boundary value setting may be the same or different according to each area. For example, in the left block, when all the reference pixels (N) are available, the reference pixel may be used in the correlation information acquisition process, and in the upper block, when at least one or more reference pixels are available (that is, some reference pixels) Is used), the corresponding reference pixel may be used in the correlation information acquisition process.

또한, 상기 예는 컬러 복사 모드(예를 들어, 도 8의 a, b, c 등이 지원되는 경우)에 따라 동일하거나 다른 설정이 지원되는 경우가 가능할 수 있다. 그 외의 부/복호화 설정(예를 들어, 영상 타입, 블록의 크기, 형태, 위치, 블록 분할 타입 등)에 따라 관련 설정이 상이하게 정의될 수도 있다.In addition, the above example may be the case that the same or different settings are supported according to the color copy mode (for example, when a, b, c, etc. of FIG. 8 is supported). Related settings may be defined differently according to other encoding / decoding settings (eg, image type, block size, shape, position, block division type, etc.).

상관성 정보 획득 과정이 수행되지 않는 경우(즉, 하나의 참조 화소라도 상관성 정보 획득 과정에 사용되지 않는 경우) 상관성 정보는 묵시적으로 획득될 수 있다. 예를 들어, 컬러 복사 모드 수식에서 a와 b를 각각 1과 0으로 설정(즉, 대응 블록의 데이터를 그대로 현재 블록의 예측값으로 사용)할 수 있다. 또는, 컬러 복사 모드로 부/복호화가 완료된 블록의 상관성 정보 또는 기 설정된 상관성 정보를 사용할 수 있다.If the correlation information acquisition process is not performed (that is, even one reference pixel is not used in the correlation information acquisition process), the correlation information may be implicitly obtained. For example, in the color copy mode equation, a and b may be set to 1 and 0 (that is, the data of the corresponding block may be used as the prediction value of the current block as it is). Alternatively, in the color copy mode, correlation information or preset correlation information of a block in which encoding / decoding is completed may be used.

또는, 현재 블록의 예측값을 임의의 값(예를 들어, 비트 심도 또는 화소값 범위의 최소값, 중앙값, 최대값 등)으로 채울 수 있다. 즉, 일반적인 화면내 예측에서 모든 참조 화소가 사용 가능하지 않는 경우에 수행되는 방법과 비슷한 경우일 수 있다.Alternatively, the predicted value of the current block may be filled with an arbitrary value (eg, a minimum value, a median value, a maximum value, etc. of a bit depth or a pixel value range). That is, the method may be similar to the method performed when all the reference pixels are not available in the general intra prediction.

상기 예와 같은 상관성 정보가 묵시적으로 획득되는 경우 또는 예측값을 임의의 값으로 채우는 경우는 도 11의 d와 같은 경우에 적용 가능한 예일 수 있다. 즉, 하나의 참조 화소라도 상관성 정보 획득 과정에 사용되지 않는 경우이기 때문이다.When correlation information such as the above example is obtained implicitly, or when the prediction value is filled with an arbitrary value, it may be an example applicable to the case of d of FIG. 11. That is, even one reference pixel is not used in the correlation information acquisition process.

다음은 사용 불가한 위치의 참조 화소로부터 예측이 수행되는 예측 모드의 사용을 제한하는 경우를 설명한다.The following describes a case of restricting the use of the prediction mode in which prediction is performed from a reference pixel at an unusable position.

도 12는 본 발명의 일 실시예에 따른 컬러 복사 모드에서 참조 화소 사용 가능성을 설명하기 위한 예시도이다. 후술하는 예에서는 현재 블록과 대응되는 블록의 좌, 상, 우상, 좌하 블록이 상관성 정보 획득에 사용되는 영역임을 가정한다. 또한, 3개의 컬러 복사 모드(mode_A, mode_B, mode_C)가 지원되는데, 각 모드는 각 블록의 좌+상, 상+우상, 좌+좌하 블록에서 상관성 정보를 획득하는 것으로 구분된다고 가정하자.12 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention. In the following example, it is assumed that left, top, right and bottom left blocks of a block corresponding to the current block are areas used for obtaining correlation information. In addition, it is assumed that three color copy modes (mode_A, mode_B, mode_C) are supported, and each mode is divided into obtaining correlation information in the left + top, top + top, and left + bottom blocks of each block.

도 12를 참조하면, 도 12의 a는 현재 블록의 위치가 영상 내부(픽쳐, 슬라이스, 타일 등)에 위치하는 경우, 도 12의 b는 현재 블록의 위치가 영상 왼쪽 경계에 위치하는 경우, 도 12의 c는 현재 블록의 위치가 영상 위쪽 경계인 위치하는 경우, 도 12의 d는 현재 블록의 위치가 영상 왼쪽 위 경계에 위치하는 경우를 나타낸다. 즉, 참조 화소 사용 가능성이 현재 블록의 위치에 기반하여 판단되는 경우를 가정한다.Referring to FIG. 12, FIG. 12A illustrates a case in which a current block position is located inside an image (picture, slice, tile, etc.), and FIG. 12B illustrates a case in which the current block position is positioned on an image left boundary. 12c illustrates a case in which the position of the current block is located at the upper boundary of the image, and d in FIG. 12 illustrates a case in which the position of the current block is located at the upper left boundary of the image. That is, it is assumed that the availability of the reference pixel is determined based on the position of the current block.

도 12를 참조하면, 도 12의 a에서 mode_A, mode_B, mode_C가 지원될 수 있고, 도 12의 b에서 mode_B가 지원될 수 있고, 도 12의 c에서 mode_C가 지원될 수 있으며, 도 12의 d에서는 어떠한 모드도 지원될 수 없다. 즉, 상관성 정보 획득을 위해 사용되는 참조 화소가 하나라도 사용 불가한 경우라면 해당 모드는 지원되지 않는 경우에 대한 설명일 수 있다. Referring to FIG. 12, mode_A, mode_B, and mode_C may be supported in FIG. 12A, mode_B may be supported in FIG. 12B, mode_C may be supported in FIG. 12C, and d of FIG. 12. No mode can be supported in. That is, when at least one reference pixel used for acquiring correlation information is unavailable, the corresponding mode may not be supported.

예를 들어, 색차 성분을 위한 화면내 예측 모드 후보군을 구성할 때, 방향성 및 비방향성 모드와 컬러 모드, 그리고 컬러 복사 모드를 포함하여 구성할 수 있다. 이때, DC, Planar, 수직, 수평, 대각선 모드 등의 4개의 예측 모드와 1개의 컬러 모드, 그리고 3개의 컬러 복사 모드로 총 7개의 예측 모드가 후보군에 포함되는 경우를 가정하자.For example, when configuring the intra prediction mode candidate group for the chrominance component, the directional and non-directional modes, the color mode, and the color copy mode may be configured. In this case, assume that the candidate group includes a total of seven prediction modes including four prediction modes, one color mode, and three color copy modes such as DC, planar, vertical, horizontal, and diagonal modes.

상기 예와 같이 사용 불가한 참조 화소로부터 상관성 정보가 획득되는 컬러 복사 모드는 제외할 수 있는데, 도 12의 c의 상황에서는 mode_c를 제외하고 나머지 6개의 예측 모드로 색차 성분을 위한 후보군이 구성될 수 있다. 즉, m개의 예측 모드 후보군에서 n개(m > n. n은 1 이상 정수)로 조정되는 경우가 가능할 수 있다. 이 역시 예측 모드 인덱스 설정 및 이진화 등의 엔트로피 부/복호화가 변경되는 것이 요구될 수 있다.As shown in the above example, the color copy mode in which the correlation information is obtained from the unavailable reference pixel may be excluded. In the situation of FIG. 12C, the candidate group for the color difference component may be configured with the remaining six prediction modes except mode_c. have. That is, it may be possible to adjust the number of m prediction mode candidate groups to n (m> n. N is an integer greater than or equal to 1). This may also be required to change the entropy encoding / decoding such as prediction mode index setting and binarization.

도 12의 d의 상황에서는 mode_A, mode_B, mode_C가 제외될 수 있고, 나머지 예측 모드인 방향성 및 비방향성 모드와 컬러 모드로 총 4개의 후보군이 구성될 수 있다.In the situation of d of FIG. 12, mode_A, mode_B, and mode_C may be excluded, and a total of four candidate groups may be configured in the remaining prediction modes, directional and non-directional modes and color modes.

상기 예와 같이 사용 불가한 참조 화소에 기반하여 예측 모드 사용 제한 설정이 적용되어 화면내 예측 모드 후보군이 구성되는 경우가 가능할 수 있다.As described above, it may be possible to configure an intra prediction mode candidate group by applying a prediction mode usage restriction setting based on an unavailable reference pixel.

상기 예와 같이 참조 화소 처리 B 설정을 따를 경우 다양한 처리 방법이 지원될 수 있다. 부/복호화 설정에 따라 묵시적 또는 명시적으로 하나의 처리 방법에 기반하여 참조 화소 처리 및 화면내 예측을 수행할 수 있다.As described above, when the reference pixel processing B is set, various processing methods may be supported. Depending on the encoding / decoding, reference pixel processing and intra prediction may be performed based on one processing method either implicitly or explicitly.

상기 예는 현재 블록의 위치에 기반하여 인접하는 영역의 참조 화소 사용 가능성이 판단되는 경우를 설명하였다. 즉, 현재 블록과 대응되는 블록은 영상(픽쳐, 슬라이스, 타일, 최대 부호화 블록 등) 내 위치가 동일하며, 그로 인해 어떤 특정 블록(현재 블록 또는 대응되는 블록)이 영상 경계에 인접하면 대응되는 블록 또한 영상 경계에 위치하는 등의 관계가 존재한다. 그렇기 때문에 각 블록의 위치에 기반하여 참조 화소 사용 가능성이 판단될 때 동일한 결과를 낳았다.The above example has described a case where it is determined that the availability of reference pixels in adjacent areas is determined based on the position of the current block. That is, the block corresponding to the current block has the same position in the image (picture, slice, tile, maximum coding block, etc.), and thus, if a specific block (current block or corresponding block) is adjacent to the image boundary, the corresponding block There is also a relationship such as being located at the image boundary. Therefore, the same result was obtained when the possibility of using the reference pixel was determined based on the position of each block.

또한, 참조 화소 가능성을 판단하는 기준으로 제한된 화면내 예측 등에 대해 전술하였다. 이는 현재 블록과 대응되는 블록의 인접한 영역의 참조 화소 가능성이 동일하지 않는 가능성을 포함하는 결과를 낳을 수 있다.In addition, the above-described intra-picture prediction and the like have been described as a reference for determining the possibility of the reference pixel. This may result in the possibility that the reference pixel possibilities of adjacent areas of the block corresponding to the current block are not equal.

도 13은 본 발명의 일 실시예에 따른 컬러 복사 모드에서 참조 화소 사용 가능성을 설명하기 위한 예시도이다. 후술하는 예에서는 현재 블록과 대응되는 블록의 좌, 상 블록이 상관성 정보 획득에 사용되는 영역임을 가정한다. 즉, 도 12의 mode_A에 관한 설명일 수 있으며, 그 밖의 컬러 복사 모드에서는 후술하는 내용을 동일하거나 비슷하게 적용 가능함을 전제한다.13 is an exemplary diagram for describing a possibility of using a reference pixel in a color copy mode according to an embodiment of the present invention. In the following example, it is assumed that left and top blocks of a block corresponding to the current block are regions used for obtaining correlation information. That is, it may be a description of the mode_A of FIG. 12, and it is assumed that the following descriptions may be similarly or similarly applied in other color copy modes.

도 13을 참조하면, 양 블록(현재 블록과 대응되는 블록)의 인접한 모든 영역이 사용 가능한 경우(i)와 일부만 사용 가능한 경우(ii), 그리고 모두 사용 불가한 경우(iii)로 구분할 수 있다. 여기서, 일부만 사용한 경우(ii)는 양 블록에서 공동으로 사용 가능한 영역이 존재하는 경우(ii-1)와 존재하지 않는 경우(ii-2)로 구분할 수 있다. 여기서, 공동으로 사용 가능한 영역이 존재하는 경우(ii-1)는 양 블록에서 해당 영역이 완벽하게 일치하는 경우(ii-1-1)와 일부만 일치하는 경우(ii-1-2)로 구분할 수 있다.Referring to FIG. 13, a case in which all adjacent areas of both blocks (the block corresponding to the current block) is available (i), only a part of them (ii), and all of them (iii) are unavailable. Here, the case of using only a part (ii) may be divided into a case where there is a region that can be used jointly in both blocks (ii-1) and a case where there is no (ii-2). Here, if there is a jointly available area (ii-1), it can be classified into a case where the corresponding area is perfectly matched in both blocks (ii-1-1) and a case where only a part (ii-1-2) is matched. have.

도 13을 참조하면, 상기 분류 중 i와 iii는 도 13의 a와 f에 해당하고, ii-2는 도 13의 d, e에 해당하고, ii-1-1은 도 13의 c에 해당하고, ii-1-2는 도 13의 b에 해당한다. 여기서, 현재 블록(또는 대응되는 블록)의 위치에 기반하여 참조 화소 가능성을 판단하는 경우와 비교하면 ii-2와 ii-1-2는 새롭게 고려해야 할 상황일 수 있다.Referring to FIG. 13, i and iii of the above classification correspond to a and f of FIG. 13, ii-2 corresponds to d and e of FIG. 13, and ii-1-1 corresponds to c of FIG. 13. , ii-1-2 corresponds to b of FIG. 13. Here, ii-2 and ii-1-2 may be a new situation to be compared with the case where the reference pixel possibility is determined based on the position of the current block (or corresponding block).

상기 과정은 컬러 복사 모드의 참조 화소 가능성을 판단하는 단계에 포함되는 구성일 수 있다. 상기 판단 결과에 따라 참조 화소에 관한 처리를 포함한 컬러 복사 모드의 화면내 예측 설정이 정해질 수 있다. 다음을 통해 현재 블록과 대응되는 블록의 각각 인접한 영역의 사용 가능성에 기반한 참조 화소 처리 및 화면내 예측에 관한 예를 살펴보자.The process may be a component included in the determining of the possibility of the reference pixel in the color copy mode. According to the determination result, the intra prediction setting of the color copy mode including the processing related to the reference pixel may be determined. Next, an example of reference pixel processing and intra prediction based on the availability of each adjacent region of a block corresponding to the current block will be described.

참조 화소 처리 A 설정의 경우 이미 전술한 다양한 방법을 통해 사용 불가한 위치의 참조 화소를 채울 수 있다. 단, 상기 양 블록의 인접한 영역의 사용 가능성에 따른 분류에 따라 세부 설정을 달리 둘 수 있다. 다음은 ii-2와 ii-1-2의 경우를 중심으로 설명하며, 다른 분류에 대한 설명은 본 발명의 전술한 내용과 중복될 수 있으므로 상세한 설명은 생략한다.In the case of setting the reference pixel processing A, the reference pixels at positions which are not usable may be filled through the aforementioned various methods. However, the detailed setting may be different according to the classification according to the availability of the adjacent areas of the two blocks. The following description will focus on the case of ii-2 and ii-1-2, and descriptions of other classifications may be overlapped with the above description of the present invention, and thus detailed descriptions thereof will be omitted.

예를 들어, 도 13의 d(ii-2)는 현재 블록과 대응되는 블록에서 공동으로 사용 가능한 영역이 존재하지 않는 경우일 수 있다. 또한, 도 13의 b(ii-1-2)는 현재 블록과 대응되는 블록에서 사용 가능한 인접한 일부 영역이 중첩되는 경우일 수 있다. 이 경우 사용 불가한 위치의 인접한 영역의 데이터를 채우는 과정(예를 들어, 사용 가능한 영역으로부터 채움)을 통해 상관성 정보 획득 과정에 사용할 수 있다.For example, d (ii-2) of FIG. 13 may be a case in which there is no jointly available area in the block corresponding to the current block. In addition, b (ii-1-2) of FIG. 13 may be a case where some adjacent areas available in the block corresponding to the current block overlap. In this case, the data may be used in the process of acquiring correlation information through a process of filling data of an adjacent area of an unusable location (for example, filling from an available area).

또는, 도 13의 e(ii-2)는 현재 블록 또는 대응되는 블록 중 하나는 인접한 영역이 모두 사용 불가한 경우일 수 있다. 즉, 양 블록 중 한 쪽은 상관성 정보 획득 과정에 사용할 데이터가 없는 경우인데, 해당 영역에 다양한 데이터를 사용하여 채울 수 있다. Alternatively, in FIG. 13E (ii-2), one of the current block or the corresponding block may be a case where all adjacent areas are unavailable. That is, one of the two blocks is when there is no data to be used for the correlation information acquisition process, and may be filled with various data in the corresponding area.

여기서, 해당 영역은 임의의 값을 사용하여 채울 수 있으며, 영상의 화소값 범위(또는 비트 심도)에 기반한 최소값, 중앙값, 최대값 등이 사용될 수 있다. Here, the corresponding area may be filled using any value, and a minimum value, a median value, or a maximum value based on a pixel value range (or bit depth) of an image may be used.

여기서, 해당 영역은 다른 컬러 공간의 사용 가능한 인접한 영역에서 복사 등의 방법을 통해 채울 수 있다. 이 경우, 양 블록의 인접한 영역은 상기 과정을 통해 동일한 영상 특성(즉, 같은 데이터)을 갖게 되므로 기 설정된 상관성 정보을 획득할 수 있다. 예를 들어, 상관성 관련 수식에서 a는 1, b는 0으로 설정함으로써 대응되는 블록의 데이터를 현재 블록의 예측값으로 그대로 복사하는 경우에 해당하며, 그 밖의 다양한 상관성 정보 설정이 가능할 수 있다.Herein, the corresponding area may be filled by a method such as copying in an adjacent adjacent area of another color space. In this case, since adjacent areas of both blocks have the same image characteristic (that is, the same data) through the above process, predetermined correlation information may be obtained. For example, in a correlation-related formula, a corresponds to 1 and b corresponds to 0 so that data of the corresponding block is copied as the predicted value of the current block as it is, and various other correlation information may be set.

참조 화소 처리 B 설정의 경우 이미 전술한 다양한 방법을 통해 사용 불가한 위치의 참조 화소의 사용 또는 해당 컬러 복사 모드의 사용을 제한할 수 있다. 단, 상기 사용 가능성에 대한 분류에 따라 세부 설정을 달리 둘 수 있다. 다음은 ii-2와 ii-1-2의 경우를 중심으로 설명하여, 다른 분류에 대한 설명은 본 발명의 전술한 내용과 중복될 수 있으므로 상세한 설명은 생략한다.In the case of setting the reference pixel processing B, it is possible to limit the use of the reference pixel at a location that cannot be used or the use of the corresponding color copy mode through the aforementioned various methods. However, the detailed setting may be changed according to the classification of the availability. The following description will focus on the cases of ii-2 and ii-1-2, and descriptions of other classifications may be duplicated with the above description of the present invention, and thus detailed descriptions thereof will be omitted.

예를 들어, 도 13의 d와 e(ii-2)는 현재 블록과 대응되는 블록에서 공동으로 사용 가능한 영역이 존재하지 않는 경우일 수 있다. 양 블록에서 상관성 정보 획득을 위해 비교 가능한 중첩되는 영역이 존재하지 않기 때문에 해당 컬러 복사 모드의 사용을 제한할 수 있다. 또는, 현재 블록의 예측값을 임의의 값 등으로 채울 수 있다. 즉, 상관성 정보 획득 과정을 수행하지 않는다는 것을 의미할 수 있다.For example, d and e (ii-2) of FIG. 13 may be a case in which there is no jointly available area in the block corresponding to the current block. Since there is no comparable overlapping area for obtaining correlation information in both blocks, the use of the corresponding color copy mode can be restricted. Alternatively, the prediction value of the current block may be filled with an arbitrary value or the like. That is, it may mean that the correlation information acquisition process is not performed.

또는, 도 13의 b(ii-1-2)는 현재 블록과 대응되는 블록에서 사용 가능한 인접한 일부 영역이 중첩되는 경우일 수 있다. 그렇기 때문에 사용 가능한 인접한 일부 영역에 한정해서라도 상관성 정보 획득 과정을 수행할 수 있다.Alternatively, b (ii-1-2) of FIG. 13 may be a case where some adjacent areas available in the block corresponding to the current block overlap. Therefore, the correlation information acquisition process may be performed even if only limited areas are available.

도 14는 본 발명의 일 실시예에 따른 컬러 복사 모드의 화면내 예측 방법을 설명한 순서도이다. 도 14를 참조하면, 상관성 정보 획득을 위해 지정된 참조 화소 영역을 확인할 수 있다(S1400). 그리고 지정된 참조 화소 영역의 사용 가능성 판단에 기반하여 참조 화소에 관한 처리 설정을 결정할 수 있다(S1410). 그리고 결정된 참조 화소에 관한 처리 설정에 따라 화면내 예측을 수행할 수 있다(S1420). 여기서 참조 화소 처리 설정에 따라 사용 가능성이 존재하는 참조 화소 영역의 데이터를 기반으로 상관성 정보를 획득하여 컬러 복사 모드에 따른 예측 블록을 생성할 수 있거나 또는 임의의 값 등으로 채워지는 예측 블록을 생성할 수도 있다.14 is a flowchart illustrating an intra prediction method of a color copy mode according to an embodiment of the present invention. Referring to FIG. 14, a reference pixel region designated for obtaining correlation information may be checked (S1400). In operation S1410, a process setting regarding the reference pixel may be determined based on the determination of the availability of the designated reference pixel area. Intra-prediction may be performed according to the processing setting for the determined reference pixel (S1420). In this case, the correlation block may be generated based on data of a reference pixel region in which availability is available according to the reference pixel processing setting, and a prediction block according to a color copy mode may be generated, or a prediction block filled with an arbitrary value may be generated. It may be.

정리하면, 색차 성분의 화면내 예측을 위해 컬러 복사 모드가 지원될 경우 컬러 복사 모드에 의해 지정되는 상관성 정보 획득을 위한 비교 영역을 확인할 수 있다. 일반적인 화면내 예측 모드와 달리 컬러 복사 모드는 현재 블록의 인접한 영역(특히, 상관성 정보 비교에 사용되는 영역)뿐만 아니라 대응되는 블록의 참조 화소의 사용 가능성까지 포함하여 확인할 수도 있다. 기 설정된 참조 화소 처리 설정 또는 복수의 참조 화소 처리 설정 중 하나와 상기 참조 화소의 사용 가능성에 따라 전술한 다양한 예에 따른 참조 화소 처리 및 화면내 예측을 수행할 수 있다.In summary, when the color copy mode is supported for the intra prediction of the color difference component, the comparison region for acquiring correlation information designated by the color copy mode may be identified. Unlike the general intra prediction mode, the color copy mode may check not only an adjacent region (particularly, an area used for comparing correlation information) of the current block but also the possibility of using the reference pixel of the corresponding block. Reference pixel processing and intra prediction may be performed according to the aforementioned various examples according to one of a preset reference pixel processing setting or a plurality of reference pixel processing settings and the availability of the reference pixel.

여기서 참조 화소 처리 설정은 영상 타입, 컬러 성분, 블록의 크기/위치/형태, 블록의 가로/세로 길이 비, 부호화 모드, 화면내 예측 모드(예를 들어, 컬러 복사 모드의 상관성 정보 획득에 비교되는 영역의 범위, 위치, 화소 개수 등), 제한된 화면내 예측 설정 등에 따라 묵시적으로 정해질 수 있거나 또는 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에서 명시적으로 관련 정보가 발생할 수 있다. 이때, 참조 화소 처리 설정은 현재 블록(또는 현재 영상)의 상태 정보에 한정, 또는 대응되는 블록(또는 다른 컬러 영상)의 상태 정보에 한정되어 정의될 수 있거나 또는 복수의 상태 정보가 결합되어 정의될 수도 있다.Here, the reference pixel processing setting is compared to the image type, color component, block size / position / shape, block width / vertical length ratio, encoding mode, and intra prediction mode (eg, obtaining correlation information of color copy mode). Range, location, number of pixels, etc.), limited intra prediction prediction settings, or the like, or related information may be explicitly generated in units of a sequence, a picture, a slice, a tile, and the like. In this case, the reference pixel processing setting may be defined limited to the state information of the current block (or the current image), or limited to the state information of the corresponding block (or another color image), or may be defined by combining a plurality of state information. It may be.

상기 예를 통해 참조 화소 처리 설정 A와 B를 구분하여 설명하였지만, 두 설정은 단독으로 사용되거나 혼합되어 사용될 수 있으며, 이 역시 상기 상태 정보 또는 명시적인 정보에 기반하여 정해질 수 있다.Although the reference pixel processing settings A and B have been separately described through the above examples, the two settings may be used alone or in combination, and may also be determined based on the state information or explicit information.

참조 화소 보간부에서 상기 참조 화소 구성을 완료한 후 참조 화소의 선형 보간을 통해 소수 단위의 참조 화소를 생성할 수 있다. 또는, 후술하는 참조 화소 필터 과정을 수행한 후에 참조 화소 보간 과정을 수행할 수도 있다. After completing the configuration of the reference pixel in the reference pixel interpolator, the reference pixel may be generated in a decimal unit through linear interpolation of the reference pixel. Alternatively, the reference pixel interpolation process may be performed after the reference pixel filter process described later.

이때, 수평, 수직, 일부 대각선 모드(예를 들어, Diagonal up right, Diagonal down right, Diagonal down left와 같이 수직/수평에 45도 차이의 모드. 도 4에서 2번, 34번, 66번 모드에 대응)와 비방향성 모드, 컬러 복사 모드 등의 경우에는 보간 과정을 수행하지 않으며, 그 외의 모드(다른 대각선 모드)의 경우 보간 과정을 수행할 수 있다.At this time, the horizontal, vertical, some diagonal mode (e.g., a mode of 45 degree difference in the vertical and horizontal, such as Diagonal up right, Diagonal down right, Diagonal down left. Correspondence), non-directional mode, color copy mode, etc., do not perform interpolation process, and other modes (diagonal mode) may perform interpolation process.

예측 모드(예를 들어, 예측 모드의 방향성. dy/dx 등)와 참조 화소 및 예측 화소의 위치에 따라 보간이 수행되는 화소 위치(즉, 어느 소수 단위가 보간되는지. 1/2 ~ 1/64 등에서 정해짐)가 정해질 수 있다. 이때, 소수 단위의 정밀도에 상관없이 하나의 필터(예를 들어, 필터 계수나 필터 탭의 길이를 결정하기 위해 사용되는 수학식은 동일한 필터를 가정. 단, 소수 단위의 정밀도<예로, 1/32, 7/32, 19/32>에 따라 계수만 조정되는 필터를 가정)가 적용될 수 있거나 또는 복수의 필터(예를 들어, 필터 계수나 필터 탭의 길이를 결정하기 위해 사용되는 수학식이 구분되는 필터를 가정) 중 하나가 소수 단위에 따라 선택되어 적용될 수 있다.The pixel position at which interpolation is performed (ie, which fractional units are interpolated) depending on the prediction mode (e.g. directionality of the prediction mode, dy / dx, etc.) and the position of the reference pixel and the prediction pixel. And the like) can be determined. In this case, one filter (for example, the equation used to determine the filter coefficient or the length of the filter tap is assumed to be the same filter regardless of the precision of the decimal unit, except that the precision of the decimal unit is <1/2, 7/32, 19/32> can be applied, or a filter in which the equations used to determine the length of the filter coefficients or filter taps can be applied. Hypothesis) can be selected and applied according to the decimal unit.

전자의 경우 소수 단위 화소의 보간을 위해 정수 단위의 화소를 입력으로 사용하는 예일 수 있고, 후자의 경우 단계별로 입력 화소를 달리하는 예(예를 들어, 1/2 단위의 경우 정수 화소 사용. 1/4 단위의 경우 정수와 1/2 단위 화소 사용 등)일 수 있으나, 이에 한정되지 않으며 본 발명에서는 전자인 경우를 중심으로 설명한다.In the former case, an integer pixel may be used as an input for interpolation of fractional pixels, and in the latter case, an input pixel may be changed in stages (for example, an integer pixel in a 1/2 unit). In the case of the / 4 unit, an integer and a 1/2 unit pixel, etc.) may be used, but the present invention is not limited thereto.

참조 화소 보간을 위해 고정적인 필터링 또는 적응적인 필터링을 수행할 수 있으며, 이는 부/복호화 설정(예를 들어, 영상 타입, 컬러 성분, 블록의 위치/크기/형태, 블록의 가로/세로 비, 예측 모드 등에서 하나 또는 둘 이상의 조합)에 따라 정해질 수 있다.Fixed or adaptive filtering may be performed for reference pixel interpolation, which may include sub / decoding settings (e.g., image type, color component, block position / size / shape, block aspect ratio, prediction). Mode or one or more combinations).

고정적인 필터링은 하나의 필터를 사용하여 참조 화소 보간을 수행할 수 있고, 적응적인 필터링은 복수의 필터 중 하나를 사용하여 참조 화소 보간을 수행할 수 있다.Fixed filtering may perform reference pixel interpolation using one filter, and adaptive filtering may perform reference pixel interpolation using one of a plurality of filters.

이때, 적응적인 필터링의 경우 부/복호화 설정에 따라 복수의 필터 중 하나가 묵시적으로 정해질 수 있거나 명시적으로 결정될 수 있다. 이때, 필터의 종류는 4-tap DCT-IF 필터, 4-tap 큐빅 필터, 4-tap 가우시안 필터, 6-tap 위너 필터, 8-tap 칼만 필터 등으로 구성될 수 있으며, 컬러 성분에 따라 지원되는 필터 후보군이 달리 정의되는 것(예를 들어, 필터의 종류가 일부는 같거나 다르거나, 그리고 필터 탭의 길이가 짧거나 길거나 등) 또한 가능할 수 있다.In this case, in the case of adaptive filtering, one of the plurality of filters may be implicitly determined or explicitly determined according to the encoding / decoding setting. At this time, the type of filter may be composed of a 4-tap DCT-IF filter, a 4-tap cubic filter, a 4-tap Gaussian filter, a 6-tap winner filter, and an 8-tap Kalman filter. It may also be possible for the filter candidate group to be defined differently (eg, some types of filters are the same or different, and short or long filter taps, etc.).

참조 화소 필터부에서 부/복호화 과정을 통해 남아있는 열화를 줄여줌으로써 예측의 정확도를 높이는 목적으로 참조 화소에 필터링을 수행할 수 있으며, 이때 사용되는 필터는 저역 통과 필터(Low-pass Filter)일 수 있으나 이에 한정되지 않는다. 부/복호화 설정(전술한 설명에서 유도 가능)에 따라 필터링의 적용 유무가 결정될 수 있다. 또한, 필터링이 적용되는 경우에는 고정적인 필터링 또는 적응적인 필터링이 적용될 수 있다.In the reference pixel filter unit, filtering may be performed on the reference pixel for the purpose of improving the accuracy of prediction by reducing the deterioration remaining through the decoding / decoding process. The filter used may be a low-pass filter. However, the present invention is not limited thereto. Whether or not filtering is applied may be determined according to the encoding / decoding setting (derived from the above description). In addition, when filtering is applied, fixed filtering or adaptive filtering may be applied.

고정적인 필터링은 참조 화소 필터링이 수행되지 않거나 또는 하나의 필터를 사용하여 참조 화소 필터링이 적용되는 것을 의미한다. 적응적인 필터링은 필터링의 적용 여부가 부/복호화 설정에 따라 결정되며 지원되는 필터 종류가 둘 이상인 경우 그 중 하나가 선택될 수 있음을 의미한다.Fixed filtering means that reference pixel filtering is not performed or reference pixel filtering is applied using one filter. Adaptive filtering means that filtering is applied according to the encoding / decoding setting, and if more than one filter type is supported, one of them may be selected.

이때, 필터의 종류는 [1, 2, 1] / 4와 같은 3-tap 필터, [2, 3, 6, 3, 2] / 16과 같은 5-tap 필터 등과 같은 다양한 필터 계수, 필터 탭 길이 등으로 구분되는 복수의 필터가 지원될 수 있다.At this time, the type of the filter is various filter coefficients such as 3-tap filter such as [1, 2, 1] / 4, 5-tap filter such as [2, 3, 6, 3, 2] / 16, and filter tap length. A plurality of filters separated by the like may be supported.

상기 참조 화소 구성 단계에서 소개된 참조 화소 보간부와 참조 화소 필터부는 예측의 정확성 향상을 위해 필요한 구성일 수 있다. 상기 두 과정은 독립적으로 수행되는 과정일 수 있으나, 두 과정을 혼합하는 구성(즉, 하나의 필터링으로 처리) 또한 가능할 수 있다.The reference pixel interpolator and the reference pixel filter introduced in the reference pixel configuration step may be necessary to improve the accuracy of prediction. The two processes may be independently performed, but a combination of the two processes (ie, one filtering) may be possible.

예측 블록 생성부에서 적어도 하나의 예측 모드에 따라 예측 블록을 생성할 수 있으며, 상기 예측 모드에 기반하여 참조 화소를 사용할 수 있다. 이때, 참조 화소는 예측 모드에 따라 외삽(Extrapolation) 등의 방법(방향성 모드)에 사용될 수 있고, 내삽(Interpolation) 또는 평균(DC) 또는 복사(Copy) 등의 방법(비방향성 모드)에 사용될 수 있다.The prediction block generator may generate a prediction block according to at least one prediction mode, and use a reference pixel based on the prediction mode. In this case, the reference pixel may be used in a method such as extrapolation (directional mode) according to a prediction mode, and may be used in a method such as interpolation or average (DC) or copy (non-directional mode). have.

다음을 통해 예측 모드에 따라 사용되는 참조 화소에 대한 설명을 이어간다.The following describes the reference pixel used according to the prediction mode.

방향성 모드의 경우 수평과 일부 대각선 모드(Diagonal up right) 사이의 모드(도 4에서 2번 내지 17번 모드)는 좌하+좌 블록(도 10에서 Ref_BL, Ref_L), 수평 모드는 좌 블록, 수평과 수직 사이의 모드(도 4에서 19번 내지 49번 모드)는 좌+좌상+상 블록(도 10에서 Ref_L, Ref_TL, Ref_T), 수직 모드는 상 블록(도 10에서 Ref_L), 수직과 일부 대각선 모드(Diagonal down left) 사이의 모드(도 4에서 51번 내지 66번 모드)는 상+우상 블록(도 10에서 Ref_T, Ref_TR)의 참조 화소를 사용할 수 있다.For directional mode, the mode between horizontal and some diagonal up (modes 2 to 17 in FIG. 4) is the lower left + left block (Ref_BL, Ref_L in FIG. 10), and the horizontal mode is the left block, horizontal and The mode between the verticals (modes 19 to 49 in FIG. 4) is the left + left + up block (Ref_L, Ref_TL, Ref_T in FIG. 10), the vertical mode is the upper block (Ref_L in FIG. 10), the vertical and some diagonal modes. In the mode between (Diagonal down left) (modes 51 to 66 in FIG. 4), reference pixels of the upper and upper right blocks (Ref_T and Ref_TR in FIG. 10) may be used.

또한, 비방향성 모드의 경우 좌하, 좌, 좌상, 상, 우상 블록(도 10에서 Ref_BL, Ref_L, Ref_TL, Ref_T, Ref_TR)의 블록 중 하나 이상의 블록에 위치하는 참조 화소를 사용할 수 있다. 예를 들어, 좌, 상, 좌+상, 좌+상+좌상, 좌+상+좌상+우상+좌하 등의 다양한 참조 화소 조합의 형태로 화면내 예측에 사용될 수 있으며, 이는 비방향성 모드(DC, Planar 등)에 따라 결정될 수 있다. 후술하는 예에서 DC 모드는 좌+상 블록, Planar 모드는 좌+상+좌하+우상 블록이 참조 화소로 예측에 사용되는 경우를 가정한다.In addition, in the non-directional mode, reference pixels positioned in one or more blocks among blocks of the lower left, left, upper left, upper, and upper right blocks (Ref_BL, Ref_L, Ref_TL, Ref_T, and Ref_TR in FIG. 10) may be used. For example, it can be used for intra prediction in the form of various reference pixel combinations such as left, top, left + top, left + top + top left, top + top + top left + top right + bottom, which is used in non-directional mode (DC , Planar, etc.). In the example to be described later, it is assumed that the DC mode is a left + up block, and the planar mode is a left + up + lower left + right block as a reference pixel.

또한, 컬러 복사 모드의 경우 다른 컬러 공간의 복원된 블록(도 10에서 Ref_C)을 참조 화소로 사용할 수 있다. 후술하는 예에서 현재 블록과 대응되는 블록이 참조 화소로 예측에 사용되는 경우를 중심으로 설명한다.In addition, in the color copy mode, a reconstructed block (Ref_C in FIG. 10) of another color space may be used as a reference pixel. In the following example, a case in which a block corresponding to the current block is used for prediction as a reference pixel will be described.

여기서 화면내 예측에 사용되는 참조 화소는 복수의 개념(또는 단위)으로 구분할 수 있다. 예를 들어, 화면내 예측에 사용되는 참조 화소는 제 1 참조 화소와 제 2 참조 화소와 같은 하나 이상의 카테고리로 구분할 수 있다. 설명의 편의를 위해 제 1 참조 화소와 제 2 참조 화소로 구분하여 설명하지만, 그 밖의 추가적인 참조 화소 또한 지원되는 것으로 이해할 수 있다.Here, the reference pixels used for intra prediction may be divided into a plurality of concepts (or units). For example, reference pixels used for intra prediction may be classified into one or more categories, such as a first reference pixel and a second reference pixel. For convenience of description, the first reference pixel and the second reference pixel will be described separately, but it may be understood that other additional reference pixels are also supported.

여기서, 제 1 참조 화소는 현재 블록의 예측값 생성에 직접적으로 사용되는 화소일 수 있고, 제 2 참조 화소는 현재 블록의 예측값 생성에 간접적으로 사용되는 화소일 수 있다. 또는, 제 1 참조 화소는 현재 블록 내 모든 화소의 예측값 생성에 사용되는 화소일 수 있고, 제 2 참조 화소는 현재 블록 내 일부 화소의 예측값 생성에 사용되는 화소일 수 있다. 또는, 제 1 참조 화소는 현재 블록의 1차 예측값 생성에 사용되는 화소일 수 있고, 제 2 참조 화소는 현재 블록의 2차 예측값 생성에 사용되는 화소일 수 있다. 또는, 제 1 참조 화소는 현재 블록의 예측 방향의 시작점(또는 기원)에 기반하여 위치하는 화소일 수 있고, 제 2 참조 화소는 현재 블록의 예측 방향과 상관없이 위치하는 화소일 수 있다.Here, the first reference pixel may be a pixel used directly to generate the predicted value of the current block, and the second reference pixel may be a pixel used indirectly to generate the predicted value of the current block. Alternatively, the first reference pixel may be a pixel used to generate predicted values of all pixels in the current block, and the second reference pixel may be a pixel used to generate predicted values of some pixels in the current block. Alternatively, the first reference pixel may be a pixel used to generate the first prediction value of the current block, and the second reference pixel may be a pixel used to generate the second prediction value of the current block. Alternatively, the first reference pixel may be a pixel located based on a start point (or origin) of the prediction direction of the current block, and the second reference pixel may be a pixel located regardless of the prediction direction of the current block.

상기 설명과 같이 제 2 참조 화소를 사용하여 예측을 수행하는 것을 예측 블록(또는 보정) 과정이라 지칭할 수 있다. 즉, 본 발명의 예측 블록 생성부에는 예측 블록 보정부를 추가하는 구성이 가능할 수 있다.As described above, performing the prediction using the second reference pixel may be referred to as a prediction block (or correction) process. That is, the prediction block generator may be configured to add a prediction block corrector.

이때, 예측 블록 생성부와 예측 블록 보정부에 사용되는 참조 화소는 각 구성에서 제 1 참조 화소와 제 2 참조 화소에 한정되지 않는다. 즉, 예측 블록 생성부는 제 1 참조 화소를 사용하거나 또는 제 1 참조 화소와 제 2 참조 화소를 사용하여 예측을 수행할 수 있고, 예측 블록 보정부는 제 2 참조 화소를 사용하거나 또는 제 1 참조 화소와 제 2 참조 화소를 사용하여 예측(또는 보정)을 수행할 수 있다. 본 발명에서는 설명의 편의를 위해 복수의 화소 개념으로 구분하여 설명함을 이해할 필요가 있다.In this case, the reference pixels used in the prediction block generator and the prediction block corrector are not limited to the first reference pixel and the second reference pixel in each configuration. That is, the prediction block generator may perform prediction using the first reference pixel or the first reference pixel and the second reference pixel, and the prediction block corrector may use the second reference pixel or the first reference pixel. Prediction (or correction) may be performed using the second reference pixel. In the present invention, it is necessary to understand that the description is divided into a plurality of pixel concepts for convenience of description.

본 발명의 화면내 예측에서는 제 1 참조 화소를 사용하여 예측을 수행하는 것뿐만 아니라 제 2 참조 화소를 사용하여 예측을 수행하는 것(즉, 보정을 수행하는 것)이 가능할 수 있으며, 이는 부/복호화 설정에 따라 정해질 수 있다. 우선, 제 2 참조 화소의 지원 여부(즉, 예측값 보정의 지원 여부)에 관한 정보가 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에서 발생할 수 있다. 그리고 명시적 또는 묵시적으로 제 2 참조 화소를 지원한다고 정해지더라도 모든 블록에서 지원할 지 또는 일부 블록에서 지원할지, 지원되는 블록에서의 제 2 참조 화소 관련 세부 설정(관련 내용은 후술하는 내용에서 참고 가능) 등은 영상 타입, 컬러 성분, 블록의 크기/형태/위치, 블록의 가로/세로 길이 비, 부호화 모드, 화면내 예측 모드, 제한된 화면내 예측 설정 등에 따라 정의되는 부/복호화 설정에 따를 수 있다. 또는, 시퀀스, 픽쳐, 슬라이스, 타일 등의 단위에서 관련 설정 정보를 명시적으로 정할 수도 있다.In the intra prediction of the present invention, it may be possible not only to perform the prediction using the first reference pixel but also to perform the prediction using the second reference pixel (i.e., perform the correction). It may be determined according to the decoding setting. First, information about whether the second reference pixel is supported (that is, whether the prediction value correction is supported) may be generated in units of a sequence, a picture, a slice, a tile, and the like. And even if it is determined that the second reference pixel is explicitly or implicitly supported, whether to support all blocks or some blocks, detailed settings related to the second reference pixel in the supported block (refer to the following description). ) May be based on encoding / decoding settings defined according to image type, color component, block size / shape / position, block width / length length ratio, encoding mode, intra picture prediction mode, limited intra picture prediction setting, and the like. . Alternatively, the relevant setting information may be explicitly determined in units of a sequence, a picture, a slice, a tile, and the like.

여기서, 하나의 화소의 예측값에 사용되는 제 1 참조 화소와 제 2 참조 화소의 개수는 각각 m, n개일 수 있으며, m과 n은 (1 : 1), (1 : 2 이상), (2 이상: 1), (2 이상 : 2 이상)의 화소 개수 비율을 가질 수 있으며, 이는 예측 모드, 현재 블록의 크기/형태/위치, 화소 위치 등에 따라 정해질 수 있다. 즉, m은 1, 2, 3 등과 같은 1 이상의 정수일 수 있고, n은 1, 2, 3, 4, 5, 8 등과 같은 1 이상의 정수일 수 있다.Here, the number of the first reference pixel and the second reference pixel used for the prediction value of one pixel may be m and n, respectively, where m and n are (1: 1), (1: 1 or more), (2 or more) : 1), (2 or more: 2 or more) may have a pixel number ratio, which may be determined according to the prediction mode, the size / shape / position of the current block, the pixel position, and the like. That is, m may be an integer of 1 or more, such as 1, 2, 3, and the like, and n may be an integer of 1 or more, such as 1, 2, 3, 4, 5, 8, or the like.

제 1 참조 화소와 제 2 참조 화소에 적용되는 가중치(본 예에서 각각 하나의 화소가 사용됨을 가정)가 p와 q일 때, p는 q보다 크거나 같을 수 있고, p는 양수의 값을 갖고 q는 양수 또는 음수의 값을 가질 수 있다.When weights applied to the first reference pixel and the second reference pixel (assuming that one pixel is used in this example) are p and q, p may be greater than or equal to q, and p has a positive value. q may have a positive or negative value.

다음은 제 1 참조 화소를 사용하여 예측 블록을 생성하는 것과 추가적으로 제 2 참조 화소를 함께 사용하여 예측을 수행하는 경우를 설명한다.Next, a case in which a prediction block is generated using a first reference pixel and a case in which prediction is performed by using a second reference pixel together will be described.

예를 들어, (도 10을 참고) Diagonal up right 방향 모드는 <Ref_BL + Ref_L> 블록 또는 <Ref_BL + Ref_L + Ref_T + Ref_TR> 블록을 사용하여 예측을 수행할 수 있다. 또한, 수평 모드는 Ref_L 블록 또는 <Ref_L + Ref_T + Ref_TL> 블록을 사용하여 예측을 수행할 수 있다. 또한, Diagonal down right 방향 모드는 <Ref_TL + Ref_T + Ref_L> 블록 또는 <Ref_TL + Ref_T + Ref_L + Ref_TR + Ref_BL> 블록을 사용하여 예측을 수행할 수 있다. 또한, 수직 모드는 Ref_T 블록 또는 <Ref_T + Ref_L + Ref_TL> 블록을 사용하여 예측을 수행할 수 있다. 또한, Diagonal down left 방향 모드는 <Ref_TR + Ref_T> 블록 또는 <Ref_TR + Ref_T + Ref_L + Ref_BL> 블록을 사용하여 예측을 수행할 수 있다.For example, in the Diagonal up right direction mode (see FIG. 10), prediction may be performed using a <Ref_BL + Ref_L> block or a <Ref_BL + Ref_L + Ref_T + Ref_TR> block. In addition, the horizontal mode may perform prediction using a Ref_L block or a <Ref_L + Ref_T + Ref_TL> block. In addition, the Diagonal down right direction mode may perform prediction using a <Ref_TL + Ref_T + Ref_L> block or a <Ref_TL + Ref_T + Ref_L + Ref_TR + Ref_BL> block. In addition, the vertical mode may perform prediction using a Ref_T block or a <Ref_T + Ref_L + Ref_TL> block. In addition, the diagonal down left direction mode may perform prediction using a <Ref_TR + Ref_T> block or a <Ref_TR + Ref_T + Ref_L + Ref_BL> block.

다른 예로, DC 모드는 <Ref_T + Ref_L> 블록 또는 <Ref_T + Ref_L + Ref_TL + Ref_TR + Ref_BL> 블록을 사용하여 예측을 수행할 수 있다. 또한, Planar 모드는 <Ref_T + Ref_L + Ref_TR + Ref_BL> 블록 또는 <Ref_T + Ref_L + Ref_TR + Ref_BL + Ref_TL> 블록을 사용하여 예측을 수행할 수 있다.As another example, the DC mode may perform prediction using a <Ref_T + Ref_L> block or a <Ref_T + Ref_L + Ref_TL + Ref_TR + Ref_BL> block. In addition, the planar mode may perform prediction using a <Ref_T + Ref_L + Ref_TR + Ref_BL> block or a <Ref_T + Ref_L + Ref_TR + Ref_BL + Ref_TL> block.

또한, 컬러 복사 모드는 Ref_C 블록 또는 <Ref_C + (Ref_T or Ref_L or Ref_TL or Ref_TR or Ref_BL)> 블록을 사용하여 예측을 수행할 수 있다. 또는, <Ref_C + (Def_T or Def_B or Def_L or Def_R or Def_TL or Def_TR or Def_BL or Def_BR)> 블록을 사용하여 예측을 수행할 수 있다. 여기서 Def는 도 10에는 도시되지 않았지만 Ref_C(현재 블록과 대응되는 블록)의 인접한 블록을 지칭하기 위해 사용된 용어이며, Def_T 내지 Def_BR은 Ref_F의 상, 하, 좌, 우, 좌상, 우상, 좌하, 우하 방향에 인접한 블록일 수 있다. 즉, 컬러 복사 모드는 Ref_C 블록에 현재 블록과 인접한 참조 화소 또는 Ref_C(대응되는 블록)과 인접한 참조 화소 등을 사용하여 예측을 수행할 수 있다.In addition, the color copy mode may perform prediction using a Ref_C block or a <Ref_C + (Ref_T or Ref_L or Ref_TL or Ref_TR or Ref_BL)> block. Alternatively, prediction may be performed using a block <Ref_C + (Def_T or Def_B or Def_L or Def_R or Def_TL or Def_TR or Def_BL or Def_BR)>. Here, Def is a term used to refer to an adjacent block of Ref_C (the block corresponding to the current block) although not shown in FIG. 10, and Def_T to Def_BR are the top, bottom, left, right, top, left, top, bottom, and bottom of Ref_F. It may be a block adjacent to the lower right direction. That is, in the color copy mode, prediction may be performed using a reference pixel adjacent to the current block or a reference pixel adjacent to Ref_C (corresponding block) in the Ref_C block.

상기 예는 제 1 참조 화소를 사용하여 예측을 수행하거나 또는 제 1 참조 화소와 제 2 참조 화소를 사용하여 예측을 수행하는 일부 예를 나타내며, 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다. The above example illustrates some examples of performing prediction using the first reference pixel or performing the prediction using the first reference pixel and the second reference pixel, and various modifications may be possible.

복수의 참조 화소를 사용하여 예측 블록을 생성 또는 보정하는 것은 기존의 예측 모드의 단점을 보완하기 위한 목적으로 수행되는 경우일 수 있다.The generation or correction of the prediction block using the plurality of reference pixels may be performed for the purpose of compensating for the disadvantages of the existing prediction mode.

예를 들어, 방향성 모드의 경우 현재 블록의 특정 방향의 에지가 존재함을 가정하여 예측의 정확도를 높이고자 하는 목적으로 지원되는 모드일 수 있으나, 예측 방향의 시작점에 위치한 참조 화소만으로 블록 내의 변화를 정확하게 반영하지 못할 수 있어 예측의 정확도가 감소할 수 있다. 또는, 컬러 복사 모드의 경우 동일한 시간에 다른 컬러 영상으로부터의 상관성 정보를 반영하여 예측을 수행하고자 함이지만, 다른 컬러 영상 내의 블록 경계에 남아있는 열화가 반영될 수 있어 예측의 정확도가 감소할 수 있다. 상기 문제점을 해결하기 위해 제 2 참조 화소를 추가적으로 사용하여 예측의 정확도를 높일 수 있다. For example, the directional mode may be a mode supported for the purpose of improving the accuracy of assuming that there is an edge in a specific direction of the current block, but only a reference pixel located at the start of the prediction direction may change the block in the block. It may not reflect accurately, which may reduce the accuracy of the prediction. Or, in the color copy mode, the prediction is performed by reflecting correlation information from another color image at the same time, but the degradation remaining at the block boundary in the other color image may be reflected, thereby reducing the accuracy of the prediction. . In order to solve the problem, the second reference pixel may be additionally used to increase the accuracy of prediction.

다음은 컬러 복사 모드에서 복수의 참조 화소를 사용하여 예측을 수행하는 경우를 살펴본다. 후술하는 예의 도면에서 기재되지 않은 부분은 도 10을 참고하여 유도할 수 있다. 여기서, 컬러 복사 모드의 상관성 정보 획득 과정 등은 이전 과정에서 수행되거나 또는 이후 과정에서 수행될 수 있음을 가정하며 개념적인 부분을 중점에 두어 설명한다. 또한, 다른 컬러 공간으로부터 예측값을 획득하는 것을 제외하고 후술하는 컬러 복사 모드에서의 화면내 예측은 다른 화면내 예측 모드에도 동일하거나 비슷한 적용이 가능할 수 있다. Next, a case of performing prediction using a plurality of reference pixels in the color copy mode will be described. Portions not described in the drawings of the following examples may be derived with reference to FIG. 10. Here, it is assumed that the process of acquiring correlation information of the color copy mode may be performed in a previous process or in a later process, and the following description focuses on a conceptual part. In addition, except for obtaining prediction values from other color spaces, the intra prediction in the color copy mode described later may be equally or similarly applied to other intra prediction modes.

도 15는 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다. 도 15를 참조하면, 컬러 복사 모드에서 대응되는 블록의 참조 화소를 사용하여 예측 블록을 생성할 수 있다. 15 is an exemplary diagram for describing prediction in color copy mode according to an embodiment of the present invention. Referring to FIG. 15, a prediction block may be generated using reference pixels of a corresponding block in the color copy mode.

상세하게는, 현재 블록과 대응되는 블록 각각의 인접한 영역(컬러 복사 모드에 의해서 지정됨)으로부터 상관성 정보를 획득할 수 있다(p1). 그리고 대응되는 블록으로부터 데이터를 획득(p2)하여 앞서 구한 상관성 정보를 적용(p3)한 예측 블록(pred_t)를 획득할 수 있다. 이를 현재 블록의 예측 블록(pred_f)으로 보상(p4)할 수 있다.In detail, correlation information may be obtained from an adjacent region (designated by the color copy mode) of each block corresponding to the current block (p1). The prediction block pred_t may be obtained by obtaining data from the corresponding block (p2) and applying the previously obtained correlation information (p3). This may be compensated (p4) by the prediction block pred_f of the current block.

상기 예는 전술한 컬러 복사 모드에서 관련 설명을 유도할 수 있으므로 상세한 설명은 생략한다.The above example may lead to a related description in the color copy mode described above, and thus the detailed description thereof will be omitted.

도 16은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다. 도 16을 참조하면, 컬러 복사 모드에서 대응되는 블록과 그 인접한 참조 화소를 사용하여 예측 블록을 생성 및 보정할 수 있다. 16 is an exemplary diagram for describing prediction in color copy mode according to an embodiment of the present invention. Referring to FIG. 16, a prediction block may be generated and corrected by using a corresponding block and an adjacent reference pixel in a color copy mode.

상세하게는, 현재 블록과 대응되는 블록 각각의 인접한 영역으로부터 상관성 정보를 획득할 수 있다(p1). 그리고 대응되는 블록의 데이터에 보정을 수행할 수 있다. 이때, 보정은 대응되는 블록 내부에 한정(d5)할 수 있거나 또는 대응되는 블록과 인접한 블록 경계에 한정할 수 있거나(d5를 제외한 d1 내지 d9) 또는 대응되는 블록 내부와 외부 경계에 걸쳐 수행(d1 내지 d9)할 수 있다. 즉, 대응되는 블록과 대응되는 블록의 인접한 영역의 데이터가 보정에 사용될 수 있다. 이때, 보정이 수행되는 외부 경계는 상, 하, 좌, 우, 좌상, 우상, 좌하, 우하 방향(각각 d1 내지 d9. 단, d5 제외) 중 하나 이상(모두 포함 가능)일 수 있다.In detail, correlation information may be obtained from an adjacent region of each block corresponding to the current block (p1). The correction may be performed on the data of the corresponding block. In this case, the correction may be defined within the corresponding block (d5) or may be limited to a block boundary adjacent to the corresponding block (d1 to d9 except d5) or may be performed across the corresponding block inner and outer boundaries (d1). To d9). That is, data of the adjacent area of the corresponding block and the corresponding block may be used for the correction. In this case, the outer boundary on which the correction is performed may be one or more (including all of them) of the up, down, left, right, top, left, top, bottom, and bottom directions (d1 to d9, except d5, respectively).

그리고 대응되는 블록의 보정 과정을 통해 데이터를 획득(p2)하여 앞서 구한 상관성 정보를 적용(p3)한 예측 블록(pred_t)를 획득할 수 있다. 이를 현재 블록의 예측 블록(pred_f)으로 보상(p4)할 수 있다.In addition, the prediction block pred_t obtained by applying the previously obtained correlation information (p3) may be obtained by acquiring data (p2) through a correction process of the corresponding block. This may be compensated (p4) by the prediction block pred_f of the current block.

도 17은 본 발명의 일 실시예에 따른 컬러 복사 모드에서의 예측을 설명하기 위한 예시도이다. 도 17을 참조하면, 컬러 복사 모드에서 대응되는 블록과 현재 블록의 인접한 참조 화소를 사용하여 예측 블록을 생성 및 보정할 수 있다.17 is an exemplary diagram for explaining prediction in color copy mode according to an embodiment of the present invention. Referring to FIG. 17, a prediction block may be generated and corrected by using a corresponding block and a neighboring reference pixel of a current block in a color copy mode.

상세하게는, 현재 블록과 대응되는 블록 각각의 인접한 영역으로부터 상관성 정보를 획득할 수 있다(p1). 그리고 대응되는 블록으로부터 데이터를 획득(p2)하여 앞서 구한 상관성 정보를 적용(p3)한 예측 블록(pred_t)를 획득할 수 있다. 이를 현재 블록의 1차 예측 블록으로 보상(p4)할 수 있으며, 1차 예측 블록(예측 블록이라 지칭)에 보정을 수행할 수 있다. 이때, 보정은 예측 블록 내부에 한정(c5)할 수 있거나 또는 예측 블록과 인접한 블록 경계에 한정할 수 있거나(c5를 제외한 c1 내지 c6) 또는 예측 블록 내부와 외부 경계에 걸쳐 수행(c1 내지 c6)할 수 있다. 즉, 예측 블록(즉, 대응되는 블록에 기초한 데이터. 여기서, 기초란 표현은 상관성 정보 등이 적용되었기 때문)과 예측 블록의 인접한 데이터(현재 블록의 인접한 영역의 데이터)가 보정에 사용될 수 있다. 이때, 보정이 수행되는 외부 경계는 상, 좌, 좌상, 우상, 좌하 방향(각각 c1 내지 c6. 단, c5 제외) 중 하나 이상(모두 포함 가능)일 수 있다.In detail, correlation information may be obtained from an adjacent region of each block corresponding to the current block (p1). The prediction block pred_t may be obtained by obtaining data from the corresponding block (p2) and applying the previously obtained correlation information (p3). This may be compensated (p4) by the first prediction block of the current block, and correction may be performed on the first prediction block (called a prediction block). In this case, the correction may be limited (c5) inside the prediction block, or may be limited to a block boundary adjacent to the prediction block (c1 to c6 except c5) or may be performed across the prediction block internal and outer boundaries (c1 to c6). can do. That is, the prediction block (that is, data based on the corresponding block. Here, the representation of the base line is because correlation information or the like has been applied) and the adjacent data of the prediction block (data of the adjacent region of the current block) may be used for the correction. In this case, the outer boundary on which the correction is performed may be one or more (including all) of the upper, left, upper left, upper right and lower left directions (except c1 to c6, except c5).

상기 예측 블록의 보정 과정을 통해 획득된 데이터를 현재 블록의 (2차 또는 최종) 예측 블록(pred_f)으로 보상(p5)할 수 있다.The data obtained through the correction process of the prediction block may be compensated (p5) by the (second or final) prediction block pred_f of the current block.

도 18은 본 발명의 일 실시예에 따른 컬러 복사 모드에 보정을 수행하는 과정의 순서도이다. 상세하게는, 도 16과 도 17를 통해 설명한 보정 과정의 중 하나를 선택하여 보정을 수행하는 과정을 나타낸다.18 is a flowchart of a process of performing correction in a color copy mode according to an embodiment of the present invention. In detail, it illustrates a process of selecting one of the correction processes described with reference to FIGS. 16 and 17 to perform correction.

도 18을 참조하면, 현재 블록과 대응되는 블록의 인접한 영역으로부터 상관성 정보를 획득할 수 있다(S1800). 그리고 대응되는 블록의 데이터를 획득할 수 있다(S1800). 다음 설명은 예측 블록의 보정이 수행되는 것이 묵시적 또는 명시적으로 결정된 경우를 가정한다. 현재 컬러 공간에서 예측 블록 보정을 수행할지 또는 다른 컬러 공간에서 예측 블록 보정을 수행할지 확인할 수 있다(S1820).Referring to FIG. 18, correlation information may be obtained from an adjacent area of a block corresponding to the current block (S1800). In operation S1800, data of a corresponding block may be acquired. The following description assumes the case where it is determined implicitly or explicitly that the correction of the prediction block is performed. It may be determined whether the prediction block correction is performed in the current color space or the prediction block correction in another color space (S1820).

만약 현재 컬러 공간에서 예측 블록을 보정할 경우 대응되는 블록의 데이터에 상관성 정보를 적용하여 예측 블록을 생성할 수 있다(S1830). 이는 일반적인 컬러 복사 모드의 과정과 동일할 수 있다. 그리고 현재 블록의 인접한 영역을 사용하여 예측 블록의 보정을 수행할 수 있다(S1840). 이때, 현재 블록의 인접한 영역뿐만 아니라 획득된 예측 블록 내부 데이터도 이용될 수 있다.If the prediction block is corrected in the current color space, the prediction block may be generated by applying correlation information to the data of the corresponding block (S1830). This may be the same as the process of the general color copy mode. In operation S1840, the prediction block may be corrected using an adjacent region of the current block. In this case, the acquired prediction block internal data may be used as well as an adjacent region of the current block.

만약 다른 컬러 공간에서 예측 블록을 보정할 경우 대응되는 블록의 인접한 영역을 사용하여 대응되는 블록의 보정을 수행할 수 있다(S1850). 이때, 대응되는 블록의 인접한 영역뿐만 아니라 대응되는 블록 내부 데이터도 이용될 수 있다. 그리고 보정된 대응되는 블록에 상관성 정보를 적용하여 예측 블록을 생성할 수 있다(S1860).If the prediction block is corrected in another color space, the corresponding block may be corrected using an adjacent region of the corresponding block (S1850). In this case, not only an adjacent area of the corresponding block but also corresponding block internal data may be used. In operation S1860, the prediction block may be generated by applying the correlation information to the corrected corresponding block.

상기 과정을 통해 획득된 데이터를 현재 블록의 예측 블록으로 보상할 수 있다(S1870).Data obtained through the above process may be compensated with a prediction block of the current block (S1870).

상기 예에서의 컬러 공간에 따른 구분으로 인해 도 16과 도 17의 적용 예가 양립 불가한 것은 아니다. 즉, 도 16과 도 17의 적용 예가 혼합 구성되는 것이 가능할 수 있다. 예를 들어, 도 16와 같이 대응되는 블록의 보정 과정 등을 통해 현재 블록의 예측 블록으로 획득할 수 있고, 도 17과 같이 획득된 예측 블록의 보정 과정을 통해 최종 예측 블록을 획득할 수도 있다.The application examples of FIGS. 16 and 17 are not incompatible due to the division according to the color space in the above example. That is, it may be possible that the application examples of FIGS. 16 and 17 are mixed. For example, the prediction block of the current block may be obtained through a correction process of a corresponding block as shown in FIG. 16, and the final prediction block may be obtained through the correction process of the obtained prediction block as shown in FIG. 17.

본 발명의 화면내 예측에서 보정을 수행하는 것은 보정 대상이 되는 화소와 그 외의 화소(본 예에서 인접한 화소)에 필터링 적용하는 것을 의미할 수 있다. 이때, 필터링은 기 설정된 하나의 필터링 설정에 따르거나 또는 복수의 필터링 설정 중 하나를 선정하여 해당 필터링 설정에 따를 수 있다. 여기서, 필터링 설정은 전술한 제 2 참조 화소 관련 세부 설정에 포함되는 내용일 수 있다.Performing the correction in the intra prediction according to the present invention may mean applying filtering to a pixel to be corrected and other pixels (adjacent pixels in this example). In this case, the filtering may be based on one preset filtering setting or by selecting one of the plurality of filtering settings and depending on the corresponding filtering setting. Here, the filtering setting may be content included in the above-described detailed setting related to the second reference pixel.

상기 필터링 설정은 필터링 적용 여부를 포함하며, 필터의 종류, 필터의 계수, 필터에 사용되는 화소 위치 등이 포함될 수 있다. 여기서 필터링 설정이 적용되는 단위는 블록 또는 화소 단위일 수 있다. 이때, 영상 타입, 컬러 성분, 컬러 포맷(즉, 컬러 성분 간의 구성 비), 부호화 모드(Intra/Inter), 블록의 크기/형태/위치, 블록의 가로/세로 길이 비, 블록 내 화소 위치, 화면내 예측 모드, 제한된 화면내 예측 등에 따라 부/복호화 설정이 정의되어 필터링 설정에 관여할 수 있다. 여기서 블록이란 현재 블록을 가정하여 설명하지만, 현재 블록의 인접한 블록 또는 컬러 복사 모드에서 대응되는 블록의 인접한 블록 등을 포함하는 개념으로 이해할 수도 있다. 즉, 현재 블록과 그 외의 블록의 상태 정보가 필터링 설정에 입력 변수로 작용할 수 있다는 것을 의미한다. 또한, 시퀀스, 픽쳐, 슬라이스, 타일, 블록 등의 단위에서 필터링 설정에 관한 정보가 명시적으로 포함될 수 있다.The filtering setting includes whether to apply filtering, and may include a type of filter, a coefficient of a filter, a pixel position used for the filter, and the like. The unit to which the filtering setting is applied may be a block or a pixel unit. In this case, the image type, color component, color format (that is, the ratio between components), encoding mode (Intra / Inter), block size / shape / position, block width / vertical length ratio, pixel position in the block, screen The encoding / decoding settings may be defined according to the prediction mode, the limited intra prediction, and may be involved in the filtering setting. Here, the block is assumed to be a current block, but may be understood as a concept including an adjacent block of the current block or an adjacent block of a corresponding block in the color copy mode. That is, the state information of the current block and other blocks can act as an input variable in the filtering configuration. In addition, information about a filtering setting may be explicitly included in units of a sequence, a picture, a slice, a tile, a block, and the like.

다음은 필터링 설정 중 필터의 종류에 관하여 설명한다. 보정 대상 화소를 중심으로 수평, 수직, 대각선 등의 하나의 라인 상의 인접한 화소들에 필터링을 적용(즉, 1차원)할 수 있다. 또는, 보정 대상 화소를 중심으로 좌, 우, 상, 하, 좌상, 우상, 좌하, 우하 방향의 공간적으로 인접한 화소들에 필터링을 적(즉, 2차원)할 수 있다. 즉, 보정 대상 화소를 중심으로 M x N 내에 인접한 화소들에 필터링을 적용할 수 있다. 후술하는 예에서는 M과 N이 모두 3 이하인 경우를 가정하여 설명하지만, M 또는 N이 3 초과의 값을 가질 수도 있다. 일반적으로 보정 대상 화소를 중심으로 대칭한 인접한 화소가 필터링에 적용될 수 있지만, 비대칭한 구성 또한 가능할 수 있다.The following describes the types of filters in the filtering configuration. Filtering may be applied (ie, one-dimensional) to adjacent pixels on one line such as horizontal, vertical, and diagonal lines around the correction target pixel. Alternatively, filtering may be applied (ie, two-dimensional) to spatially adjacent pixels in the left, right, up, down, left, top, right, bottom, and bottom directions with respect to the pixel to be corrected. That is, filtering may be applied to pixels adjacent to M x N around the correction target pixel. In the following example, it is assumed that both M and N are 3 or less, but M or N may have a value greater than 3. In general, adjacent pixels symmetric about the correction target pixel may be applied to the filtering, but an asymmetrical configuration may also be possible.

도 19는 본 발명의 일 실시예에 따른 보정 대상 화소에 적용되는 필터의 종류를 설명하기 위한 예시도이다. 상세하게는, 보정 대상 화소(도면에서 굵은 선)를 중심으로 대칭하여 필터 적용 위치가 정해지는 경우에 대한 예시를 나타내고 있다.19 is an exemplary diagram for describing a type of filter applied to a correction target pixel according to an exemplary embodiment of the present invention. In detail, an example of the case where the filter application position is determined symmetrically about the correction target pixel (bold line in the drawing) is shown.

도 19를 참조하면, 도 19의 a와 b는 수평, 수직 방향의 3-tap 필터를 의미한다. 또한, 도 19의 c와 d는 대각선 방향(수직선을 기준으로 -45, +45도 기울어진 각도)의 3-tap 필터를 의미한다. 또한, 도 19의 e와 f는 (+) 또는 (x) 형태를 갖는 5-tap 필터를 의미한다. 또한, 도 19의 g는 정사각 형태의 9-tap 필터를 의미한다. Referring to FIG. 19, a and b in FIG. 19 mean 3-tap filters in a horizontal and vertical direction. In addition, c and d of FIG. 19 refers to a 3-tap filter in a diagonal direction (an angle of inclination of -45 and +45 degrees with respect to the vertical line). Also, e and f of FIG. 19 mean a 5-tap filter having a (+) or (x) form. In addition, g of FIG. 19 means a square 9-tap filter.

필터링 적용에 대한 예시로, 블록의 내부 또는 외부(또는 경계)에 도 19의 a 내지 g를 적용할 수 있다. As an example of the filtering application, a to g of FIG. 19 may be applied to the inside or the outside (or the boundary) of the block.

다른 예로, 블록의 내부에 도 19의 e 내지 g를 적용할 수 있다. 또는, 블록의 경계에 도 19의 a 내지 d를 적용할 수 있다. 상세하게는, 블록의 좌측 경계에서 도 19의 a, 블록의 상측 경계에서 도 19의 b를 적용할 수 있다. 블록의 좌상측 경계에서 도 19의 c, 블록의 우상측과 좌하측 경계에서 도 19의 d를 적용할 수 있다.As another example, the steps e to g of FIG. 19 may be applied to the inside of the block. Alternatively, a to d of FIG. 19 may be applied to the boundary of the block. In detail, a of FIG. 19 at the left boundary of the block and b of FIG. 19 may be applied at the upper boundary of the block. 19c at the upper left boundary of the block and d of FIG. 19 may be applied at the upper left and lower left boundaries of the block.

상기 예는 보정 대상 화소의 위치에 기반한 필터 선택에 대한 일부 경우이며, 이에 한정되지 않고 반대되는 경우 등을 포함한 다양한 적용 예가 가능할 수 있다.The above example is a partial case of filter selection based on the position of the pixel to be corrected, and various applications may be possible, including but not limited to the above.

도 20은 본 발명의 일 실시예에 따른 보정 대상 화소에 적용되는 필터의 종류를 설명하기 위한 예시도이다. 상세하게는, 보정 대상 화소를 중심으로 비대칭하여 필터 적용 위치가 정해지는 경우에 대한 예시를 나타내고 있다.20 is an exemplary diagram for describing a type of filter applied to a correction target pixel according to an exemplary embodiment of the present invention. In detail, an example of a case where the filter application position is determined asymmetrically about the correction target pixel is shown.

도 20을 참조하면, 도 20의 a와 b는 각각 좌, 상측의 화소만을 이용하는 2-tap 필터를 의미하고, 도 20의 c는 좌, 상측 화소를 이용하는 3-tap 필터를 의미한다. 도 20의 d 내지 f는 각각 좌상측 방향, 상측 방향, 좌측 방향의 4-tap 필터를 의미한다. 도 20의 g 내지 j는 각각 좌우상 방향, 좌상하 방향, 좌우하, 우상하 방향의 6-tap 필터를 의미한다.Referring to FIG. 20, a and b in FIG. 20 denote 2-tap filters using only left and upper pixels, respectively, and c in FIG. 20 means 3-tap filters using left and upper pixels. D to f in FIG. 20 denote 4-tap filters in an upper left direction, an upper direction, and a left direction, respectively. G to j in FIG. 20 refer to 6-tap filters in left, right, up, down, left, and right and up and down directions, respectively.

필터링 적용에 대한 예시로, 블록의 내부 또는 외부에 도 20의 a 내지 j를 적용할 수 있다.As an example of the filtering application, a to j of FIG. 20 may be applied to the inside or the outside of the block.

다른 예로, 블록의 내부에 도 20의 g 내지 j를 적용할 수 있다. 또는, 블록의 경계에 도 20의 a 내지 f를 적용할 수 있다. 상세하게는, 블록의 좌측 경계에서 도 20의 a와 f, 블록의 상측 경계에서 도 20의 b와 e를 적용할 수 있다. 블록의 좌상측 경계에서 도 20의 c와 d를 적용할 수 있다.As another example, g to j of FIG. 20 may be applied to the inside of the block. Alternatively, a to f of FIG. 20 may be applied to the boundary of the block. Specifically, a and f of FIG. 20 may be applied at the left boundary of the block, and b and e of FIG. 20 may be applied at the upper boundary of the block. 20 c and d may be applied at the upper left boundary of the block.

상기 예는 보정 대상 화소의 위치에 기반한 필터 선택에 대한 일부 경우이며, 이에 한정되지 않고 반대되는 경우 등을 포함한 다양한 적용 예가 가능할 수 있다.The above example is a partial case of filter selection based on the position of the pixel to be corrected, and various applications may be possible, including but not limited to the above.

도 19와 도 20의 필터 계수는 다양한 설정이 가능할 수 있다. 예를 들어, 2-tap 필터의 경우 1:1 또는 1:3 비율의 가중치(여기서 1과 3이 보정 대상 화소의 가중치), 3-tap 필터의 경우 1:1:2 비율의 가중치(여기서 2가 보정 대상 화소의 가중치), 4-tap 필터의 경우 1:1:1:5 또는 1:1:2:4 비율의 가중치(여기서 4와 5가 보정 대상 화소의 가중치), 5-tap 필터의 경우 1:1:1:1:4 비율의 가중치(여기서 4가 보정 대상 화소의 가중치), 6-tap 필터의 경우 1:1:1:1:2:2 비율의 가중치(여기서 2가 보정 대상 화소의 가중치), 9-tap 필터의 경우 1:1:1:1:1:1:1:1:8 또는 1:1:1:1:2:2:2:2:4 비율의 가중치(여기서 8과 4가 보정 대상 화소의 가중치)가 적용될 수 있다. 상기 예에서 보정 대상 화소의 가중치 다음으로 높은 가중치가 적용되는 화소는 보정 대상 화소와의 거리가 짧거나(수직, 수평 방향에 인접) 또는 대칭 구조에서 보정 대상 화소와 같이 중앙에 위치한 화소일 수 있다. 상기 예는 가중치 설정에 관한 일부 경우에 그칠 뿐 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다. The filter coefficients of FIGS. 19 and 20 may be variously set. For example, for a 2-tap filter, a weight of 1: 1 or 1: 3 ratio (where 1 and 3 are the weights of the pixels to be corrected), and for a 3-tap filter, a weight of 1: 1: 2 ratio (where 2 Is the weight of the pixel to be corrected), the weight is 1: 1: 1: 5 or 1: 1: 2: 4 for the 4-tap filter (where 4 and 5 are the weights of the pixel to be corrected), and Weight ratio of 1: 1: 1: 1: 4 ratio (where 4 is the weight of the pixel to be corrected), and 6-tap filter weight ratio of 1: 1: 1: 1: 2: 2 (where 2 is the weight to be corrected) Weight of the pixel), or 1: 1: 1: 1: 1: 1: 1: 1: 8 or 1: 1: 1: 1: 2: 2: 2: 2: 4 ratio for a 9-tap filter ( Here, 8 and 4 may be applied to the weight of the pixel to be corrected). In the above example, the pixel to which the next highest weight is applied after the weight of the pixel to be corrected may be a short distance from the pixel to be corrected (adjacent to the vertical or horizontal direction) or may be a pixel positioned at the center of the pixel in the symmetrical structure. . The above example is only limited to some cases related to weight setting, and various modification examples may be possible.

보정에 사용되는 필터는 부/복호화 설정에 따라 묵시적으로 정해지거나 시퀀스, 픽쳐, 슬라이스, 타일 등에 단위에서 명시적으로 포함될 수 있다. 여기서 부/복호화 설정를 정의하는 설명은 본 발명의 전술한 다양한 예에서 유도할 수 있다.The filter used for the correction may be implicitly determined according to the encoding / decoding setting, or may be explicitly included in a unit such as a sequence, a picture, a slice, a tile, and the like. The description of defining the encoding / decoding here can be derived from the various examples described above of the present invention.

이때, 복수의 필터 지원 여부를 나타내는 정보가 상기 단위에서 발생할 수 있다. 만약 복수의 필터가 지원되지 않는다면 기 설정된 필터가 사용될 수 있고, 복수의 필터가 지원된다면 필터 선택 정보가 추가로 발생할 수 있다. 이때, 상기 필터는 도 19과 도 20에 도시된 필터 또는 그 외의 필터가 후보군에 포함될 수 있다.In this case, information indicating whether a plurality of filters are supported may occur in the unit. If a plurality of filters is not supported, a predetermined filter may be used. If a plurality of filters are supported, filter selection information may be additionally generated. In this case, the filter may include a filter shown in FIGS. 19 and 20 or other filters in the candidate group.

다음은 도 16과 같은 다른 컬러 공간에서 보정을 수행하는 경우를 가정하며 이를 위해 도 10을 참조(즉, 보정 대상 블록은 Ref_C)한다. 후술하는 예에서는 이전 과정을 통해 해당 블록에서 사용되는 필터가 결정되고, 해당 필터는 해당 블록의 모든 또는 대부분의 화소에 적용되는 경우를 가정한다.Next, it is assumed that the correction is performed in another color space as shown in FIG. 16, and for this purpose, reference is made to FIG. In the following example, it is assumed that a filter used in a corresponding block is determined through a previous process, and the corresponding filter is applied to all or most pixels of the corresponding block.

보정 대상 블록의 인접한 영역의 상태 정보에 기반하여 일괄적인 필터를 지원하되 보정 대상 화소 위치에 기반한 적응적인 필터도 지원될 수 있다. A batch filter may be supported based on state information of adjacent areas of the block to be corrected, but an adaptive filter based on the position of the pixel to be corrected may also be supported.

예를 들어, 보정 대상 화소를 중심으로 5-tap 필터(도 19의 e)를 Ref_C의 aa 내지 pp에 적용할 수 있다. 이 경우 보정 대상 화소의 위치에 관계없이 동일한 필터가 적용되는 예일 수 있다. 또한, 보정이 수행되는 블록의 인접한 영역은 필터링을 적용하는데 제한 사항이 없는 경우일 수 있다.For example, a 5-tap filter (e of FIG. 19) may be applied to aa to pp of Ref_C around the correction target pixel. In this case, the same filter may be applied regardless of the position of the pixel to be corrected. In addition, an adjacent region of the block where correction is performed may be a case where there is no limitation in applying filtering.

또는, 보정 대상 화소를 중심으로 5-tap 필터를 Ref_C의 ff, gg, jj, kk(즉, 블록의 내부)에 적용할 수 있고, 그 외의 화소(블록의 경계)는 인접한 블록의 상태에 기반하여 필터링을 적용할 수 있다. 상세하게는, Ref_C의 왼쪽 블록이 픽쳐 외곽이던지 또는 부호화 모드가 Inter(즉, 제한된 화면내 예측 설정이 활성화된 경우)라 해당 화소의 사용 가능성(본 발명의 참조 화소 사용 가능성을 확인하는 부분에서 관련 설명 유도 가능)이 불가로 판단되는 경우, 수직 방향의 필터(예를 들어, 도 19의 b 등)가 Ref_C의 aa, ee, ii, mm에 적용될 수 있다. 또는, Ref_C의 위쪽 블록이 사용 불가인 경우 수평 방향의 필터(예를 들어, 도 19의 a 등)가 Ref_C의 aa 내지 dd에 적용될 수 있다.Alternatively, a 5-tap filter can be applied to ff, gg, jj, and kk (that is, the inside of a block) of Ref_C centered on the pixel to be corrected, and other pixels (the boundary of the block) are based on the state of an adjacent block. Filtering can be applied. Specifically, the left block of Ref_C is outside the picture, or the encoding mode is Inter (i.e., when the limited intra picture prediction setting is enabled), so that the availability of the corresponding pixel (in the part of confirming the availability of the reference pixel of the present invention) is related. When it is determined that the description can be induced), a vertical filter (for example, b in FIG. 19) may be applied to aa, ee, ii, and mm of Ref_C. Alternatively, when the upper block of Ref_C is not available, a horizontal filter (for example, a in FIG. 19) may be applied to aa to dd of Ref_C.

화면내 예측 모드에 기반하여 일괄적인 필터를 지원하되 보정 대상 화소 위치에 기반한 적응적인 필터도 지원될 수 있다.A batch filter may be supported based on an intra prediction mode, but an adaptive filter based on a pixel position to be corrected may also be supported.

예를 들어, 컬러 복사 모드 중 좌, 상 블록으로부터 상관성 정보를 획득하는 모드인 경우 9-tap 필터(도 19의 g)를 Ref_C의 aa 내지 pp에 적용할 수 있다. 이 경우 보정 대상 화소의 위치에 관계없이 동일한 필터가 적용되는 예일 수 있다.For example, in the case of obtaining the correlation information from the left and upper blocks in the color copy mode, the 9-tap filter (g of FIG. 19) may be applied to aa to pp of Ref_C. In this case, the same filter may be applied regardless of the position of the pixel to be corrected.

또는, 컬러 복사 모드 중 좌, 좌하 블록으로부터 상관성 정보를 획득하는 모드인 경우 9-tap 필터를 Ref_C의 ee 내지 pp에 적용할 수 있고, 그 외의 화소(상측 경계)는 예측 모드 설정에 기반하여 필터링을 적용할 수 있다. 본 예에서는 상관성 정보를 좌, 좌하 블록에서 획득하기 때문에 상 블록과는 상관성이 낮을 것이라는 추정을 할 수 있다. 그렇기 때문에 좌우하 방향의 필터(예를 들어, 도 20의 i 등)가 Ref_C의 aa 내지 dd에 적용될 수 있다.Alternatively, in the case of obtaining the correlation information from the lower left and lower blocks among the color copy modes, the 9-tap filter may be applied to ee to pp of Ref_C, and other pixels (upper boundary) are filtered based on the prediction mode setting. Can be applied. In this example, since correlation information is obtained from the left and the lower left blocks, it can be estimated that the correlation with the upper block is low. For this reason, the left and right filters (for example, i in FIG. 20) may be applied to aa to dd of Ref_C.

본 발명에서 컬러 복사 모드에 대한 설명은 일부 컬러 포맷(4:4:4)인 경우를 중심으로 설명하였다. 컬러 포맷에 따라 보정에 관한 세부 구성의 차이가 존재할 수 있다. 본 예는 다른 컬러 공간에서 보정을 수행하는 경우를 가정한다.In the present invention, the description of the color copy mode has been described based on the case of some color formats (4: 4: 4). Depending on the color format, there may be a difference in the detailed configuration regarding the correction. This example assumes a case of performing correction in another color space.

컬러 복사 모드에서의 상관성 정보 및 예측값 획득은 일부 컬러 포맷(4:4:4)의 경우 현재 컬러 공간의 하나의 화소가 다른 컬러 공간의 하나의 화소와 대응되기 때문에 해당 화소에서 관련 데이터를 직접 획득할 수 있다.In the color copy mode, the correlation information and the prediction value acquisition can directly obtain the relevant data from the pixel because in some color formats (4: 4: 4), one pixel in the current color space corresponds to one pixel in the other color space. can do.

반면, 일부 컬러 포맷(4:2:0)의 경우 현재 컬러 공간의 하나의 화소가 다른 컬러 공간의 하나 이상의 화소(본 예에서 4개)와 대응되는 경우이다. 만약 기 설정된 하나의 화소가 선정되어 해당 화소에서 관련 데이터를 획득하는 경우가 아니라면 대응되는 복수의 화소에서 관련 데이터를 획득하는 다운 샘플링 과정이 요구될 수 있다.On the other hand, in some color formats (4: 2: 0), one pixel in the current color space corresponds to one or more pixels (four in this example) in another color space. If a predetermined pixel is not selected to obtain related data from the corresponding pixel, a down sampling process of acquiring related data from a plurality of corresponding pixels may be required.

다음을 통해 각 컬러 포맷에 따라 컬러 복사 모드의 예측 및 보정 과정을 살펴본다. 후술하는 예에서 일부 포맷(4:2:0)은 다운 샘플링 과정이 수행되는 경우를 가정한다. 또한, 현재 블록과 대응되는 블록을 각각 A, B 블록이라 지칭한다.The following describes the prediction and correction process of the color copy mode for each color format. In the following example, some formats (4: 2: 0) assume a case where a downsampling process is performed. In addition, blocks corresponding to the current block are referred to as A and B blocks, respectively.

<1> 4:4:4 포맷에서의 화면내 예측<1> Intra prediction in 4: 4: 4 format

<1-1> A 블록의 인접한 영역에서 화소값 획득<1-1> Acquisition of pixel value in adjacent area of A block

<1-2> B 블록의 인접한 영역에서 <1-1>의 화소와 대응되는 화소값 획득Acquisition of pixel value corresponding to pixel of <1-1> in adjacent area of <1-2> B block

<1-3> 각 컬러 공간에서 인접한 영역의 화소값에 기초하여 상관성 정보 획득<1-3> Acquisition of correlation information based on pixel values of adjacent areas in each color space

<1-4> B 블록의 화소와 그에 인접한 화소 추출<1-4> Extracting Pixels of B Blocks and Pixels Adjacent to It

<1-5> <1-4>의 화소에 필터링을 적용하여 B 블록 보정<1-5> B block correction by applying filtering to <1-4> pixels

<1-6> A 블록(M x N)의 화소에 대응되는 B 블록(M x N)의 화소값 획득<1-6> Acquisition of pixel value of B block (M x N) corresponding to pixel of A block (M x N)

<1-7> <1-6>의 화소값에 상관성 정보를 적용하여 예측 화소 생성<1-7> Prediction pixel generation by applying correlation information to pixel values of <1-6>

<2> 4:2:0 포맷에서의 화면내 예측(1)<2> Intra prediction in 4: 2: 0 format (1)

<2-1> A 블록의 인접한 영역에서 화소값 획득<2-1> Acquisition of pixel value in adjacent area of A block

<2-2> B 블록의 인접한 영역에서 <2-1>의 화소와 대응되는 화소와 그에 인접한 화소 추출Extracting the pixel corresponding to the pixel of <2-1> and the pixel adjacent thereto in the adjacent region of the <2-2> B block

<2-3> <2-2>의 화소에 다운 샘플링을 적용하여 B 블록의 인접한 영역에서 <2-1>의 화소와 대응되는 화소값 획득<2-3> Applying downsampling to pixels of <2-2> to obtain pixel values corresponding to pixels of <2-1> in adjacent areas of B block

<2-4> 각 컬러 공간에서 인접한 영역의 화소값에 기초하여 상관성 정보 획득<2-4> Obtaining Correlation Information Based on Pixel Values of Adjacent Regions in Each Color Space

<2-5> B 블록의 화소와 그에 인접한 화소 추출<2-5> Extracting Pixels of B Blocks and Pixels Adjacent to It

<2-6> <2-5>의 화소에 필터링을 적용하여 B 블록 보정<2-6> B block correction by applying filtering to <2-5> pixels

<2-7> A 블록(M x N)의 화소에 대응되는 B 블록(2M x 2N)의 화소와 그에 인접한 화소 추출<2-7> Extracting Pixels of B Blocks (2M x 2N) Corresponding to Pixels of A Blocks (M x N) and Pixels Adjacent thereto

<2-8> <2-7>의 화소에 다운 샘플링을 적용하여 B 블록의 화소값 획득<2-8> Acquisition of pixel value of B block by applying down sampling to pixels of <2-7>

<2-9> <2-8>의 화소값에 상관성 정보를 적용하여 예측 화소 생성<2-9> Prediction pixel generation by applying correlation information to pixel values of <2-8>

<1>과 <2>의 과정을 살펴보면 <1>은 <1-5>에서 한 번의 필터링이 적용되는 것에 비해, <2>는 <2-6>과 <2-8>에서 복수의 필터링이 적용되는 것을 확인할 수 있다. <2-6>의 경우 예측 화소 획득에 사용되는 데이터의 보정을 위한 과정일 수 있고, <2-8>의 경우 예측 화소 획득을 위한 다운 샘플링 과정일 수 있으며, 각 과정에서의 필터도 달리 구성될 수 있다. 물론, 각 과정으로 인해 부호화 성능이 향상될 수 있지만, 중복적인 필터링 효과가 나타날 수 있다. 또한, 필터링 횟수의 증가로 복잡도가 높아지는 것이 일부 프로파일 등에는 적합하지 않은 구성일 수 있다. 이를 위해 일부 컬러 포맷의 경우 이를 통합하는 필터링이 지원되는 것이 필요할 수 있다.Looking at the process of <1> and <2>, <1> has one filtering in <1-5>, whereas <2> has multiple filtering in <2-6> and <2-8>. You can see that it applies. In the case of <2-6>, it may be a process for correcting data used to acquire a predictive pixel, and in the case of <2-8>, it may be a down sampling process for obtaining a predictive pixel, and a filter in each process may be configured differently. Can be. Of course, the encoding performance may be improved by each process, but a redundant filtering effect may appear. In addition, an increase in complexity due to an increase in the number of filtering may be a configuration that is not suitable for some profiles. This may require some color formats to support filtering that incorporates them.

<3> 4:2:0 포맷에서의 화면내 예측(2)<3> Intra-picture prediction in 4: 2: 0 format (2)

<3-1> A 블록의 인접한 영역에서 화소값 획득<3-1> Acquisition of pixel value in adjacent area of A block

<3-2> B 블록의 인접한 영역에서 <3-1>의 화소와 대응되는 화소와 그에 인접한 화소 추출Extracting the pixel corresponding to the pixel of <3-1> and the pixel adjacent thereto in the adjacent region of the <3-2> B block

<3-3> <3-2>의 화소에 다운 샘플링을 적용하여 B 블록의 인접한 영역에서 <3-1>의 화소와 대응되는 화소값 획득<3-3> Applying downsampling to pixels of <3-2> to obtain pixel values corresponding to pixels of <3-1> in adjacent areas of B block

<3-4> 각 컬러 공간에서 인접한 영역의 화소값에 기초하여 상관성 정보 획득<3-4> Obtaining Correlation Information Based on Pixel Values of Adjacent Regions in Each Color Space

<3-5> B 블록의 화소와 그에 인접한 화소 추출<3-5> Pixel Extraction of B Block and Pixels Adjacent to It

<3-6> <3-5>의 화소에 필터링을 적용하여 B 블록 보정<3-6> B block correction by applying filtering to pixels of <3-5>

<3-7> A 블록(M x N)의 화소에 대응되는 B 블록(2M x 2N)의 화소값 획득<3-7> Acquisition of pixel value of B block (2M x 2N) corresponding to pixel of A block (M x N)

<3-8> <3-7>의 화소값에 상관성 정보를 적용하여 예측 화소 생성<3-8> Prediction pixel generation by applying correlation information to pixel values of <3-7>

<4> 4:2:0 포맷에서의 화면내 예측(3)<4> Intra-picture prediction in 4: 2: 0 format (3)

<4-1> A 블록의 인접한 영역에서 화소값 획득<4-1> Acquisition of pixel value in adjacent area of A block

<4-2> B 블록의 인접한 영역에서 <4-1>의 화소와 대응되는 화소와 그에 인접한 화소 추출Extracting the pixel corresponding to the pixel of <4-1> and the pixel adjacent thereto in the adjacent region of the <4-2> B block

<4-3> <4-2>의 화소에 다운 샘플링을 적용하여 B 블록의 인접한 영역에서 <4-1>의 화소와 대응되는 화소값 획득<4-3> Applying downsampling to pixels of <4-2> to obtain pixel values corresponding to pixels of <4-1> in adjacent areas of B block

<4-4> 각 컬러 공간에서 인접한 영역의 화소값에 기초하여 상관성 정보 획득<4-4> Obtaining Correlation Information Based on Pixel Values of Adjacent Regions in Each Color Space

<4-5> A 블록(M x N)의 화소에 대응되는 B 블록(2M x 2N)의 화소와 그에 인접한 화소 추출<4-5> Pixels of B blocks (2M x 2N) corresponding to pixels of A block (M x N) and pixels adjacent thereto

<4-6> <4-5>의 화소에 다운 샘플링을 적용하여 B 블록의 화소값 획득<4-6> Acquire pixel value of B block by applying down sampling to pixels of <4-5>

<4-7> <4-6>의 화소값에 상관성 정보를 적용하여 예측 화소 생성<4-7> Prediction pixel generation by applying correlation information to pixel values of <4-6>

<3>의 과정을 살펴보면 B 블록의 다운 샘플링 과정이 생략되어 기 설정된 위치의 하나의 화소에 상관성 정보가 적용되는 경우이다. 대신 보정 과정이 수행되기 때문에 다운 샘플링 과정에서의 단점을 제거하는 효과가 발생할 수 있다. Referring to the process of <3>, the downsampling process of the B block is omitted and the correlation information is applied to one pixel at a preset position. Instead, the calibration process is performed, which can eliminate the disadvantages of the downsampling process.

반면, <4>의 과정을 살펴보면 보정 과정이 생략되고 B 블록의 다운 샘플링 과정이 수행되는 경우이다. 대신 다운 샘플링 과정에서 보정의 효과까지 낼 수 있는 필터를 사용할 수 있다. 보정 과정이 다운 샘플링에 포함되는 구성으로 변형이 일어날 수 있지만, 전술한 보정 과정에서의 설정 등은 그대로 적용되는 것이 가능할 수 있다. 즉, 다운 샘플링에 대한 필터 선택 정보 등이 상위 단위에서 명시적으로 정해지거나 부/복호화 설정 등에 따라 묵시적으로 정해질 수 있다. 또한, B 블록의 내부 데이터만을 사용하여 다운 샘플링을 수행할지 또는 B 블록과 좌, 우, 상, 하, 좌상, 우상, 좌하, 우하 방향에서 하나 이상의 방향의 외부 데이터도 함께 사용하여 다운 샘플링을 수행할 지 등을 묵시적 또는 명시적으로 정할 수 있다.On the other hand, the process of <4> is a case where the correction process is omitted and the down sampling process of the B block is performed. Instead, a filter can be used to effect the correction during downsampling. Deformation may occur to the configuration in which the correction process is included in the downsampling, but the above-described settings in the correction process may be applied as it is. That is, the filter selection information for the downsampling may be explicitly determined in an upper unit or implicitly determined according to the encoding / decoding. In addition, down sampling is performed using only the internal data of the B block, or down sampling is performed using the B block and external data in one or more directions in the left, right, up, down, top, right, left, and bottom directions together. You can decide whether to do so, either implicitly or explicitly.

예측 모드 결정부에서는 복수의 예측 모드 후보군 중 최적의 모드를 선정하기 위한 과정이 수행된다. 일반적으로 블록의 왜곡{예를 들어, 현재 블록과 복원 블록의 Distortion. SAD(Sum of Absolute Difference), SSD(Sum of Square Difference 등}과 해당 모드에 따른 발생 비트량이 고려되는 율-왜곡(Rate-Distortion) 기법을 이용하여 부호화 비용 측면에서 최적인 모드를 결정할 수 있다. 상기 과정을 통해 결정되는 예측 모드에 기반하여 생성되는 예측 블록을 감산부와 가산부로 송신할 수 있다.The prediction mode determiner performs a process for selecting an optimal mode among a plurality of prediction mode candidate groups. In general, block distortion (eg, Distortion of current and reconstructed blocks). A mode that is optimal in terms of coding cost may be determined using a sum-of-absolute difference (SAD), a sum of square difference (SSD), etc., and a rate-distortion technique that takes into account the amount of bits generated according to a corresponding mode. The prediction block generated based on the prediction mode determined through the above process may be transmitted to the subtractor and the adder.

최적의 예측 모드를 결정하기 위해 예측 모드 후보군에 존재하는 모든 예측 모드를 탐색할 수 있거나 또는 연산량/복잡도 감소를 위한 목적으로 다른 결정 과정를 거처 최적의 예측 모드를 선정할 수 있다. 예를 들어, 첫번째 단계에서는 화면내 예측 모드 후보 전체에 대해 화질 열화 관점에서 좋은 성능을 보이는 일부 모드를 선정하고, 두번째 단계에서는 첫번째 단계에서 선정된 모드에 대해 화질 열화뿐만 아니라 발생 비트량까지 고려하여 최적의 예측 모드를 선정할 수 있다. 상기 방법 외 연산량/복잡도 감소 측면의 다양한 방법이 적용될 수 있다.In order to determine the optimal prediction mode, all prediction modes present in the prediction mode candidate group may be searched, or the optimal prediction mode may be selected through other decision processes for the purpose of reducing the amount of computation / complexity. For example, the first stage selects some modes that perform well in terms of image quality deterioration for all intra prediction prediction candidates, and the second stage considers not only the image quality degradation but also the amount of bits generated for the mode selected in the first stage. The optimal prediction mode can be selected. In addition to the above method, various methods of reducing the amount of computation / complexity may be applied.

또한, 예측 모드 결정부는 일반적으로 부호화기에만 포함되는 구성일 수 있으나, 부/복호화 설정에 따라 복호화기에도 포함되는 구성일 수 있다. 예를 들어, 템플릿 매칭을 예측 방법으로 포함하거나 또는 화면내 예측 모드를 현재 블록의 인접한 영역에서 유도하는 방법을 포함하는 경우. 후자의 경우 예측 모드를 복호화기에서 묵시적으로 획득하는 방법이 사용되었다고 이해할 수 있다.In addition, the prediction mode determiner may generally be included only in the encoder, but may also be included in the decoder according to a sub / decoding setting. For example, when a template matching is included as a prediction method or a method of deriving an in-picture prediction mode in an adjacent region of the current block. In the latter case, it can be understood that the method of implicitly obtaining the prediction mode in the decoder is used.

예측 모드 부호화부에서는 예측 모드 결정부를 통해 선정된 예측 모드를 부호화할 수 있다. 예측 모드 후보군에서 상기 예측 모드에 대응하는 인덱스 정보를 부호화할 수 있거나 또는 상기 예측 모드를 예측하여 그에 관한 정보를 부호화할 수 있다. 전자의 경우 휘도 성분에 적용되는 방법일 수 있고 후자의 경우 색차 성분에 적용되는 방법일 수 있으나 이에 한정되지 않는다.The prediction mode encoder may encode the prediction mode selected by the prediction mode determiner. In the prediction mode candidate group, index information corresponding to the prediction mode may be encoded, or the information about the prediction mode may be predicted. The former may be a method applied to the luminance component and the latter may be a method applied to the color difference component, but is not limited thereto.

예측 모드를 예측하여 부호화하는 경우 예측 모드의 예측값(또는 예측 정보)을 MPM(Most Probable Mode)으로 지칭할 수 있다. MPM은 하나의 예측 모드로 구성할 수 있거나 또는 복수의 예측 모드로 구성할 수 있는데, 예측 모드 후보군 개수 등에 따라 MPM의 개수(k개. k는 1, 2, 3, 6 등과 같은 1 이상 정수)가 정해질 수 있다. MPM이 복수의 예측 모드로 구성되는 경우로 MPM 후보군이라 지칭할 수 있다.When the prediction mode is predicted and encoded, the prediction value (or prediction information) of the prediction mode may be referred to as Most Probable Mode (MPM). The MPM may be configured in one prediction mode or in a plurality of prediction modes. The number of MPMs (k. K is an integer of 1 or more, such as 1, 2, 3, 6, etc.) according to the number of prediction mode candidates. Can be determined. When the MPM is composed of a plurality of prediction modes, it may be referred to as an MPM candidate group.

MPM은 예측 모드를 효율적으로 부호화하기 위해 지원되는 개념으로, 실제로 현재 블록의 예측 모드로 발생 가능성이 높은 예측 모드로 후보군을 구성할 수 있다.MPM is a concept supported for efficiently encoding a prediction mode. In fact, the candidate group may be configured as a prediction mode that is more likely to occur in the prediction mode of the current block.

예를 들어, MPM 후보군은 기 설정된 예측 모드(또는 통계적으로 자주 발생하는 예측 모드. DC, Plaanr, 수직, 수평, 일부 대각선 모드 등), 인접한 블록(좌, 상, 좌상, 우상, 좌하 블록 등)의 예측 모드 등으로 구성할 수 있다. 이때, 인접한 블록의 예측 모드는 도 10에서 L0 내지 L3(좌 블록), T0 내지 T3(상 블록), TL(좌상 블록), R0 내지 R3(우상 블록), B0 내지 B3(좌하 블록)에서 획득할 수 있다.For example, the MPM candidate group may be a preset prediction mode (or a statistically frequently occurring prediction mode such as DC, Plaanr, vertical, horizontal, and some diagonal modes), adjacent blocks (left, top, left top, right top, bottom left blocks, etc.). Can be configured as a prediction mode. In this case, the prediction modes of the adjacent blocks are obtained at L0 to L3 (left block), T0 to T3 (upper block), TL (upper left block), R0 to R3 (upper right block), and B0 to B3 (lower left block) in FIG. 10. can do.

인접한 블록(예를 들어, 좌 블록)에서 둘 이상의 서브 블록 위치(예를 들어, L0, L2 등)로부터 MPM 후보군을 구성할 수 있을 경우 기 정의된 우선 순위(예를 들어, L0 - L1 - L2 등)에 따라 해당 블록의 예측 모드를 후보군에 구성할 수 있다. 또는, 둘 이상 서브 블록 위치로부터 MPM 후보군을 구성할 수 없는 경우 기 정의된 위치(예를 들어, L0 등)에 해당하는 서브 블록의 예측 모드를 후보군에 구성할 수 있다. 상세하게는, 인접한 블록 중 L3, T3, TL, R0, B0 위치의 예측 모드를 해당 인접한 블록의 예측 모드로 선정하여 MPM 후보군에 포함할 수 있다. 상기 설명은 인접한 블록의 예측 모드를 후보군에 구성하는 일부 경우이며, 이에 한정되지 않는다. 후술하는 예에서 기 정의된 위치의 예측 모드를 후보군에 구성하는 경우를 가정한다.Predefined priority (e.g., L0-L1-L2) when MPM candidates can be constructed from two or more subblock positions (e.g., L0, L2, etc.) in adjacent blocks (e.g., left block). Etc.), the prediction mode of the block may be configured in the candidate group. Alternatively, when the MPM candidate group cannot be formed from two or more subblock positions, the prediction mode of the subblock corresponding to the predefined position (eg, L0) may be configured in the candidate group. In detail, a prediction mode of positions L3, T3, TL, R0, and B0 among adjacent blocks may be selected as a prediction mode of the adjacent block and included in the MPM candidate group. The above description is in some cases configuring the prediction mode of the adjacent block in the candidate group, but is not limited thereto. In the example described below, it is assumed that a candidate mode is configured with a prediction mode of a predefined position.

또한, 하나 이상의 예측 모드가 MPM 후보군으로 구성되어 있는 경우 기 포함된 하나 이상의 예측 모드로부터 유도되는 모드 또한 MPM 후보군으로 추가 구성할 수 있다. 상세하게는, k번 모드(방향성 모드)가 MPM 후보군에 포함된 경우 해당 모드로부터 유도 가능한 모드(k 기준으로 +a, -b의 간격을 갖는 모드. a와 는 1, 2, 3 등의 1 이상의 정수)를 MPM 후보군에 추가로 포함할 수 있다.In addition, when one or more prediction modes are configured with the MPM candidate group, a mode derived from one or more included prediction modes may be further configured as the MPM candidate group. In detail, when mode k (directional mode) is included in the MPM candidate group, a mode that can be derived from the mode (a mode having an interval of + a and -b on the basis of k. A and 1 are 1, 2, 3, etc.). Above integer) may be further included in the MPM candidate group.

MPM 후보군 구성을 위한 우선 순위가 존재할 수 있는데, 인접한 블록의 예측 모드 - 기 설정된 예측 모드 - 유도되는 예측 모드 등의 순서로 MPM 후보군을 구성할 수 있다. MPM 후보군을 구성하는 과정은 우선 순위에 따라 최대 MPM 후보 개수만큼 채우면 완료할 수 있다. 상기 과정에서 기 포함된 예측 모드와 일치하는 경우에는 해당 예측 모드는 후보군에 구성하지 않고 다음 우선 순위의 후보로 순서가 넘어가는 중복성 확인 과정이 포함될 수 있다.There may be a priority for configuring the MPM candidate group, and the MPM candidate group may be configured in the order of the prediction mode of the adjacent block, the preset prediction mode, the derived prediction mode, and the like. The process of configuring the MPM candidate group may be completed by filling the maximum number of MPM candidates according to the priority. If the prediction mode coincides with the previously included prediction mode, the prediction mode may include a redundancy check process in which an order is passed to a candidate of the next priority without configuring the candidate group.

다음은 MPM 후보군이 6개의 예측 모드로 구성되는 경우를 전제한다.The following presupposes that the MPM candidate group consists of six prediction modes.

예를 들어, L - T - TL - TR - BL - Planar - DC - 수직 - 수평 - 대각선 모드 등의 순서로 후보군을 구성할 수 있다. 인접한 블록의 예측 모드를 후보군에 우선적으로 구성하며, 기 설정된 예측 모드를 추가 구성하고자 하는 경우일 수 있다.For example, candidate groups may be configured in the order of L-T-TL-TR-BL-Planar-DC-Vertical-Horizontal-Diagonal mode. It may be the case that a prediction mode of an adjacent block is preferentially configured in a candidate group and additional configuration of a preset prediction mode is performed.

또는, L - T - Planar - DC - <L+1> - <L-1> - <T+1> - <T-1> - 수직 - 수평 - 대각선 모드 등의 순서로 후보군을 구성할 수 있다. 일부 인접한 블록의 예측 모드와 기 설정된 예측 모드의 일부를 우선적으로 구성하며, 인접한 블록의 예측 모드와 비슷한 방향의 예측 모드가 발생할 것이라는 가정 하에 유도되는 모드와 기 설정된 예측 모드의 일부를 추가 구성하고자 하는 경우일 수 있다.Alternatively, candidate groups may be configured in the order of L-T-Planar-DC-<L + 1>-<L-1>-<T + 1>-<T-1>-Vertical-Horizontal-Diagonal mode. . First of all, a prediction mode of some adjacent blocks and a part of a preset prediction mode are configured first, and a mode and a part of a preset prediction mode derived based on the assumption that a prediction mode in a direction similar to that of an adjacent block will occur will be configured. It may be the case.

상기 예는 MPM 후보군 구성에 관한 일부 경우이며, 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다.The above example is part of the MPM candidate group configuration, and various modifications may be possible without being limited thereto.

MPM 후보군은 후보군 내 인덱스에 기반하여 단항 이진화(Unary Binarization), 절단된 Rice 이진화(Truncated Rice Binarization) 등의 이진화가 사용될 수 있다. 즉, 작은 인덱스를 갖는 후보에는 짧은 비트를 할당하고, 큰 인덱스를 갖는 후보에는 긴 비트를 할당하여 모드 비트를 표현할 수 있다.The MPM candidate group may be binarized such as unary binarization or truncated rice binarization based on the index in the candidate group. That is, mode bits can be represented by allocating short bits to candidates having a small index and assigning long bits to candidates having a large index.

MPM 후보군에 포함되지 못한 모드는 non-MPM 후보군으로 분류될 수 있다. 또한, 부/복호화 설정에 따라 non-MPM 후보군은 2개 이상의 후보군으로 분류될 수 있다.Modes not included in the MPM candidate group may be classified as non-MPM candidate groups. In addition, the non-MPM candidate group may be classified into two or more candidate groups according to the encoding / decoding setting.

다음은 예측 모드 후보군에 방향성 모드와 비방향성 모드를 포함하는 67개의 모드가 존재하며 MPM 후보는 6개가 지원되어 non-MPM 후보군에 61개의 예측 모드로 구성되는 경우를 전제한다.The following presupposes that there are 67 modes including a directional mode and a non-directional mode in the prediction mode candidate group, and 6 MPM candidates are supported to include 61 prediction modes in the non-MPM candidate group.

non-MPM 후보군이 하나로 구성되는 경우는 MPM 후보군 구성 과정에 포함되지 못한 예측 모드가 남은 것이기 때문에 추가적인 후보군 구성 과정은 요구되지 않는다. 그래서 non-MPM 후보군 내 인덱스에 기반하여 고정 길이 이진화(Fixed Length Binarization), 절단된 단항 이진화(Truncated Unary Binarization) 등의 이진화가 사용될 수 있다.If the non-MPM candidate group consists of one, the prediction mode that is not included in the MPM candidate group configuration process is left, so no additional candidate group formation process is required. Therefore, binarization such as fixed length binarization and truncated unary binarization may be used based on indexes in the non-MPM candidate group.

non-MPM 후보군이 둘 이상의 후보군으로 구성되는 경우를 가정하여 본 예에서 non-MPM 후보군은 non-MPM_A(이상 A 후보군)와 non-MPM_B(이상 B 후보군)으로 분류한다. A 후보군(p개. MPM 후보군 개수 이상)이 B 후보군(q개. A 후보군 개수 이상)보다 현재 블록의 예측 모드로 발생 가능성이 높은 예측 모드로 후보군을 구성한다고 가정한다. 이때, A 후보군 구성 과정이 추가될 수 있다. On the assumption that the non-MPM candidate group is composed of two or more candidate groups, the non-MPM candidate group is classified into non-MPM_A (ideal A candidate group) and non-MPM_B (ideal B candidate group). It is assumed that a candidate group (p. MPM candidate groups or more) constitutes the candidate group in a prediction mode that is more likely to occur in the prediction mode of the current block than the B candidate group (q. Or more than the A candidate group numbers). At this time, the A candidate group configuration process may be added.

예를 들어, 방향성 모드 중 균등한 간격(예를 들어, 2번, 4번, 6번 모드 등)을 갖는 일부 예측 모드를 A 후보군에 구성하거나 기 설정된 예측 모드(예를 들어, MPM 후보군에 포함된 예측 모드로부터 유도되는 모드 등)를 구성할 수 있다. 상기 MPM 후보군 구성과 A 후보군 구성을 통해 남은 예측 모드는 B 후보군으로 구성될 수 있으며, 추가적인 후보군 구성 과정은 요구되지 않는다. A 후보군와 B 후보군 내 인덱스에 기반하여 고정 길이 이진화, 절단된 단항 이진화 등의 이진화가 사용될 수 있다.For example, some prediction modes having even intervals (eg, 2nd, 4th, 6th, etc.) among the directional modes may be configured in the candidate A group or included in the preset prediction mode (eg, the MPM candidate group). Mode derived from the predicted mode). The prediction mode remaining through the MPM candidate group configuration and the A candidate group configuration may be configured as a B candidate group, and an additional candidate group configuration process is not required. Binarization, such as fixed length binarization and truncated unary binarization, may be used based on indices in candidate A and candidate B groups.

상기 예는 non-MPM 후보군이 둘 이상으로 구성되어 있는 일부 경우이며, 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다.The above example is a case in which the non-MPM candidate group is composed of two or more, but is not limited thereto, and various modification examples may be possible.

다음은 예측 모드를 예측하여 부호화하는 경우에 대한 과정을 나타낸다.The following is a process for the case of predicting and encoding a prediction mode.

현재 블록의 예측 모드가 MPM(또는 MPM 후보군 내 일부 모드)과 일치하는지 여부에 대한 정보(mpm_flag)를 확인할 수 있다.Information (mpm_flag) about whether the prediction mode of the current block matches the MPM (or some modes in the MPM candidate group) may be checked.

MPM과 일치하는 경우에 MPM의 구성(1개 또는 2개 이상)에 따라 MPM 인덱스 정보(mpm_idx)가 추가로 확인할 수 있다. 이후 현재 블록의 부호화 과정을 완료한다.In case of matching with the MPM, the MPM index information (mpm_idx) may be additionally checked according to the configuration of the MPM (one or two or more). After that, the encoding process of the current block is completed.

MPM과 일치하지 않는 경우에 non-MPM 후보군이 하나로 구성되어 있으면 non-MPM 인덱스 정보(remaining_idx)를 확인할 수 있다. 이후 현재 블록의 부호화 과정을 완료한다.If the MPM does not match the non-MPM candidate group consists of one, non-MPM index information (remaining_idx) can be confirmed. After that, the encoding process of the current block is completed.

만약 non-MPM 후보군이 복수(본 예에서 2개)로 구성되어 있으면 현재 블록의 예측 모드가 A 후보군 내 일부 예측 모드와 일치하는지 여부에 대한 정보(non_mpm_flag)를 확인할 수 있다.If the non-MPM candidate group includes a plurality (two in this example), information (non_mpm_flag) about whether the prediction mode of the current block matches some prediction mode in the A candidate group may be checked.

A 후보군과 일치하는 경우 A 후보군 인덱스 정보(non_mpm_A_idx)를 확인할 수 있고, A 후보군과 일치하지 않는 경우 B 후보군 인덱스 정보(remaining_idx)를 확인할 수 있다. 이후 현재 블록의 부호화 과정을 완료한다.If the A candidate group matches, the A candidate group index information (non_mpm_A_idx) may be checked. If the A candidate group does not match, the B candidate group index information (remaining_idx) may be checked. After that, the encoding process of the current block is completed.

예측 모드 후보군 구성이 고정적인 경우에 현재 블록에서 지원되는 예측 모드와 인접한 블록에서 지원되는 예측 모드, 그리고 기 설정된 예측 모드는 동일한 예측 번호 인덱스를 사용할 수 있다.When the prediction mode candidate group configuration is fixed, the same prediction number index may be used for the prediction mode supported in the current block, the prediction mode supported in the adjacent block, and the preset prediction mode.

한편, 예측 모드 후보군 구성이 적응적인 경우에는 현재 블록에서 지원되는 예측 모드와 인접한 블록에서 지원되는 예측 모드, 그리고 기 설정된 예측 모드는 동일한 예측 번호 인덱스를 사용하거나 다른 예측 번호 인덱스를 사용할 수 있다. 다음 설명을 위해 도 4를 참조한다.Meanwhile, when the prediction mode candidate group configuration is adaptive, the prediction mode supported by the current block, the prediction mode supported by the adjacent block, and the preset prediction mode may use the same prediction number index or different prediction number indexes. Reference is made to FIG. 4 for the following description.

상기 예측 모드 부호화 과정에서 MPM 후보군 등의 구성을 위한 예측 모드 후보군 통일(또는 조정) 과정이 수행될 수 있다. 예를 들어, 현재 블록의 예측 모드는 -5번 내지 61번 모드의 예측 모드 후보군 중 하나이고, 인접한 블록의 예측 모드는 2번 내지 66번 모드의 예측 모드 후보군 중 하나일 수 있다. 이 경우 인접한 블록의 예측 모드 일부(66번 모드)는 현재 블록의 예측 모드에 지원되지 않는 모드일 수 있기 때문에 예측 모드 부호화 과정에서 이를 통일시키는 과정이 수행될 수 있다. 즉, 고정적인 화면내 예측 모드 후보군 구성이 지원되는 경우에 요구되지 않는 과정일 수 있고, 적응적인 화면내 예측 모드 후보군 구성이 지원되는 경우에는 요구되는 과정일 수 있으며, 이에 대한 상세한 설명은 생략한다.In the prediction mode encoding process, a prediction mode candidate group unification (or adjustment) process for configuring an MPM candidate group or the like may be performed. For example, the prediction mode of the current block may be one of prediction mode candidate groups of modes -5 to 61, and the prediction mode of an adjacent block may be one of prediction mode candidate groups of modes 2 to 66. In this case, since a part of the prediction mode (mode 66) of the adjacent block may be a mode that is not supported by the prediction mode of the current block, a process of unifying it in the prediction mode encoding process may be performed. That is, the process may not be required when the fixed intra prediction mode candidate group configuration is supported, or the process may be required when the adaptive intra screen prediction mode candidate group configuration is supported, and a detailed description thereof will be omitted. .

상기 MPM을 이용하는 방식과 달리 예측 모드 후보군에 속한 예측 모드에 인덱스를 할당하여 부호화를 수행할 수 있다.Unlike the method using the MPM, encoding may be performed by assigning an index to a prediction mode belonging to a prediction mode candidate group.

예를 들어, 기 정의된 우선 순위에 따라 예측 모드에 인덱스를 할당하고 현재 블록의 예측 모드가 선정되면 해당 인덱스를 부호화하는 방법이 그에 해당한다. 이는 고정적으로 예측 모드 후보군이 구성되고 예측 모드에 고정적인 인덱스가 할당되는 경우를 의미한다.For example, when an index is assigned to a prediction mode according to a predefined priority and a prediction mode of a current block is selected, the method of encoding a corresponding index corresponds to this. This means that the prediction mode candidate group is fixed and a fixed index is assigned to the prediction mode.

또는, 예측 모드 후보군이 적응적으로 구성되는 경우에는 상기 고정적인 인덱스 할당 방법이 적합하지 않을 수 있다. 이를 위해 적응적인 우선 순위에 따라 예측 모드에 인덱스를 할당하고 현재 블록의 예측 모드가 선정되면 해당 인덱스를 부호화하는 방법을 적용할 수 있다. 이는 예측 모드 후보군의 적응적인 구성으로 인해 예측 모드에 할당되는 인덱스를 달리 하여 예측 모드를 효율적으로 부호화할 수 있다. 즉, 적응적인 우선 순위는 현재 블록의 예측 모드로 선정될 가능성이 높은 후보를 짧은 모드 비트가 발생하는 인덱스에 할당하고자 함일 수 있다.Or, if the prediction mode candidate group is adaptively configured, the fixed index allocation method may not be suitable. To this end, an index may be allocated to a prediction mode according to an adaptive priority, and a method of encoding a corresponding index may be applied when the prediction mode of the current block is selected. Because of the adaptive configuration of the prediction mode candidate group, it is possible to efficiently encode the prediction mode by changing the indices assigned to the prediction modes. That is, the adaptive priority may be to assign a candidate having a high probability of being selected as the prediction mode of the current block to an index in which a short mode bit occurs.

다음은 예측 모드 후보군에 기 설정된 예측 모드(방향성 모드과 비방향성 모드), 컬러 복사 모드와 컬러 모드를 포함하는 8개의 예측 모드가 지원되는 경우(색차 성분)를 전제한다.The following presupposes that eight prediction modes including a prediction mode (directional mode and non-directional mode), a color copy mode, and a color mode preset in the prediction mode candidate group are supported (color difference component).

예를 들어, 기 설정된 예측 모드는 Planar, DC, 수평, 수직, 대각선 모드(본 예에서 Diagonal down left) 중에서 4개가 지원되고, 컬러 모드 1개(C)와 컬러 복사 모드 3개(CP1, CP2, CP3)가 지원되는 경우를 가정하자. 예측 모드에 할당되는 인덱스의 기본 순서는 기 설정된 예측 모드 - 컬러 복사 모드 - 컬러 모드 등으로 주어질 수 있다.For example, four preset modes are supported: Planar, DC, horizontal, vertical, and diagonal modes (Diagonal down left in this example), one color mode (C), and three color copy modes (CP1, CP2). Assume that CP3) is supported. The basic order of the indexes allocated to the prediction modes may be given in a preset prediction mode-color copy mode-color mode.

이때, 기 설정된 예측 모드인 방향성 모드, 비방향성 모드와 컬러 복사 모드는 예측 방법이 구분되는 예측 모드로 쉽게 구분할 수 있다. 다만, 컬러 모드의 경우 방향성 모드 또는 비방향성 모드일 수 있으며, 이는 기 설정된 예측 모드와 중복될 가능성이 존재할 수 있다. 일 예로, 컬러 모드가 수직 모드인 경우 기 설정된 예측 모드 중 하나인 수직 모드와 중복되는 경우가 발생할 수 있다.In this case, the preset prediction modes such as the directional mode, the non-directional mode, and the color copy mode may be easily classified into prediction modes in which the prediction methods are divided. However, the color mode may be a directional mode or a non-directional mode, and there may be a possibility of overlapping with the preset prediction mode. For example, when the color mode is a vertical mode, a case in which the color mode overlaps with the vertical mode which is one of the preset prediction modes may occur.

부/복호화 설정에 따라 예측 모드 후보군의 수를 적응적으로 조정하는 경우 상기 중복적인 경우가 발생하면 후보군의 수를 조정(8개 -> 7개)할 수 있다. 또는, 예측 모드 후보군의 수를 고정적으로 유지하는 경우 상기 중복적인 경우가 발생하면 다른 후보를 추가 및 고려하여 인덱스를 할당할 수 있으며, 본 설정을 가정하여 후술한다. 또한, 적응적인 예측 모드 후보군은 컬러 모드와 같이 가변적인 모드를 포함하는 경우에도 지원되는 구성일 수 있다. 따라서 적응적인 인덱스 할당이 수행되는 경우는 적응적인 예측 모드 후보군 구성의 일 예로 간주할 수 있다.In the case of adaptively adjusting the number of prediction mode candidate groups according to the encoding / decoding setting, if the overlapping case occurs, the number of candidate groups may be adjusted (8-> 7). Alternatively, in the case where the number of prediction mode candidate groups is fixed, an index may be allocated by adding and considering other candidates when the overlapping case occurs, which will be described below on the assumption of this setting. In addition, the adaptive prediction mode candidate group may be a supported configuration even when a variable mode such as a color mode is included. Therefore, when adaptive index allocation is performed, it can be regarded as an example of adaptive prediction mode candidate group configuration.

다음은 컬러 모드에 따라 적응적인 인덱스 할당이 수행되는 경우를 설명한다. 기본 인덱스는 Planar(0) - 수직(1) - 수평(2) - DC(3) - CP1(4) - CP2(5) - CP3(6) - C(7)의 순서로 할당된다고 전제한다. 또한, 컬러 모드가 기 설정된 예측 모드와 일치하지 않는 경우에는 상기 순서로 인덱스 할당이 수행됨을 전제한다.The following describes a case where adaptive index allocation is performed according to the color mode. The basic index is assumed to be allocated in the order of Planar (0)-vertical (1)-horizontal (2)-DC (3)-CP1 (4)-CP2 (5)-CP3 (6)-C (7). In addition, when the color mode does not match the preset prediction mode, it is assumed that index allocation is performed in the above order.

예를 들어, 컬러 모드가 기 설정된 예측 모드(Planar, 수직, 수평, DC 모드) 중 하나와 일치하는 경우에는 컬러 모드의 인덱스(7)에 일치하는 예측 모드가 채워진다. 일치하는 예측 모드의 인덱스(0 내지 3 중 하나)에는 기 설정된 예측 모드(Diagoanl down left)가 채워진다. 상세하게는, 컬러 모드가 수평 모드인 경우 Planar(0) - 수직(1) - Diagoanal down left(2) - DC(3) - CP1(4) - CP2(5) - CP3(6) - 수평(7)와 같은 인덱스 할당이 수행될 수 있다.For example, when the color mode matches one of the preset prediction modes (Planar, vertical, horizontal, and DC modes), the prediction mode corresponding to the index 7 of the color mode is filled. The index (one of 0 to 3) of the matching prediction mode is filled with a preset prediction mode (Diagoanl down left). Specifically, when the color mode is horizontal mode, Planar (0)-Vertical (1)-Diagoanal down left (2)-DC (3)-CP1 (4)-CP2 (5)-CP3 (6)-Horizontal ( Index allocation as shown in 7) may be performed.

또는, 컬러 모드가 기 설정된 예측 모드 중 하나와 일치하는 경우에는 0번 인덱스에 일치하는 예측 모드가 채워진다. 그리고 컬러 모드의 인덱스(7)에 기 설정된 예측 모드(Diagoanal down left)가 채워진다. 이때, 채워진 예측 모드가 기존의 0번 인덱스가 아닌 경우(즉, Planar 모드가 아닌 경우)라면 기존 인덱스 구성이 조정될 수 있다. 상세하게는, 컬러 모드가 DC 모드인 경우 DC(0) - Planar(1) - 수직(2) - 수평(3) - CP1(4) - CP2(5) - CP3(6) - Diagonal down left(7)와 같은 인덱스 할당이 수행될 수 있다.Alternatively, when the color mode matches one of the preset prediction modes, the prediction mode corresponding to the index 0 is filled. The preset prediction mode (Diagoanal down left) is filled in the index 7 of the color mode. In this case, if the filled prediction mode is not the existing index 0 (that is, not the planar mode), the existing index configuration may be adjusted. Specifically, when the color mode is DC mode, DC (0)-Planar (1)-Vertical (2)-Horizontal (3)-CP1 (4)-CP2 (5)-CP3 (6)-Diagonal down left ( Index allocation as shown in 7) may be performed.

상기 예는 적응적인 인덱스 할당에 관한 일부 경우이며, 이에 한정되지 않고 다양한 변형의 예가 가능할 수 있다. 또한, 상기 후보군 내 인덱스에 기반하여 고정 길이 이진화, 단항 이진화, 절단된 단항 이진화, 절단된 Rice 이진화 등의 이진화가 사용될 수 있다.The above examples are some cases related to adaptive index allocation, and various modifications may be possible without being limited thereto. In addition, binarization such as fixed length binarization, unary binarization, truncated unary binarization, truncated Rice binarization, or the like may be used based on the index within the candidate group.

다음은 예측 모드 후보군에 속한 예측 모드에 인덱스를 할당하여 부호화를 수행하는 다른 예를 살펴본다.Next, another example of performing encoding by assigning an index to a prediction mode belonging to the prediction mode candidate group will be described.

예를 들어, 예측 모드, 예측 방법 등으로 구분하여 복수의 예측 모드 후보군으로 분류하고 해당 후보군에 속한 예측 모드에 인덱스를 할당하여 부호화하는 방법이 그에 해당한다. 이 경우 후보군 선택 정보 부호화가 상기 인덱스 부호화에 선행할 수 있다. 일 예로, 동일한 컬러 공간에서 예측을 수행하는 예측 모드인 방향성 모드, 비방향성 모드, 컬러 모드가 하나의 후보군(이상 S 후보군)에 속할 수 있고, 다른 컬러 공간에서 예측을 수행하는 예측 모드인 컬러 복사 모드가 하나의 후보군(이상 D 후보군)에 속할 수 있다.For example, a method of dividing into a prediction mode, a prediction method, and the like into a plurality of prediction mode candidate groups, and assigning and encoding an index to a prediction mode belonging to the candidate group corresponds thereto. In this case, candidate group selection information encoding may precede the index encoding. For example, the directional mode, the non-directional mode, and the color mode, which are prediction modes for performing prediction in the same color space, may belong to one candidate group (or more S candidate groups), and the color copy, which is a prediction mode for performing prediction in another color space. The mode may belong to one candidate group (or more than D candidate group).

다음은 예측 모드 후보군에 기 설정된 예측 모드, 컬러 복사 모드와 컬러 모드를 포함하는 9개의 예측 모드가 지원되는 경우(색차 성분)를 전제한다.The following presupposes that nine prediction modes including a prediction mode, a color copying mode, and a color mode that are preset in the prediction mode candidate group are supported (color difference component).

예를 들어, 기 설정된 예측 모드는 Planar, DC, 수평, 수직, 대각선 모드 중에서 4개가 지원되고, 컬러 모드 1개(C)와 컬러 복사 모드 4개(CP1, CP2, CP3, CP4)가 지원되는 경우를 가정하자. S 후보군은 기 설정된 예측 모드와 컬러 모드로 구성되는 5개의 후보를 가질 수 있고, D 후보군은 컬러 복사 모드로 구성되는 4개의 후보를 가질 수 있다.For example, four preset prediction modes are supported among planar, DC, horizontal, vertical, and diagonal modes, and one color mode (C) and four color copy modes (CP1, CP2, CP3, CP4) are supported. Assume the case. The S candidate group may have five candidates configured with a preset prediction mode and a color mode, and the D candidate group may have four candidates configured with the color copy mode.

S 후보군은 적응적으로 구성되는 예측 모드 후보군의 일 예이고 적응적인 인덱스 할당에 관한 예는 전술하였으므로 상세한 설명은 생략한다. D 후보군은 고정적으로 구성되는 예측 모드 후보군의 일 예이므로 고정적인 인덱스 할당 방법을 사용할 수 있다. 예를 들어, CP1(0) - CP2(1) - CP3(2) -CP4(3)와 같은 인덱스 할당이 수행될 수 있다.The S candidate group is an example of an adaptive mode candidate group that is adaptively configured, and an example of adaptive index allocation has been described above, and thus a detailed description thereof will be omitted. Since the D candidate group is an example of a fixed prediction mode candidate group, a fixed index allocation method may be used. For example, an index allocation such as CP1 (0)-CP2 (1)-CP3 (2)-CP4 (3) may be performed.

상기 후보군 내 인덱스에 기반하여 고정 길이 이진화, 단항 이진화, 절단된 단항 이진화, 절단된 Rice 이진화 등의 이진화가 사용될 수 있다. 또한, 상기 예에 한정되지 않고 다양한 변형의 예가 가능할 수 있다.Binarization, such as fixed length binarization, unary binarization, truncated unary binarization, truncated Rice binarization, or the like, may be used based on the index within the candidate group. In addition, various modifications may be possible without being limited to the above examples.

예측 모드 부호화부를 통해 생성되는 예측 관련 정보는 부호화부로 전송되어 비트스트림에 수록될 수 있다.The prediction related information generated by the prediction mode encoder may be transmitted to the encoder and may be included in the bitstream.

본 발명의 일 실시예에 따른 영상 복호화 방법에서 화면내 예측은 다음과 같이 구성될 수 있다. 예측부의 화면내 예측은 예측 모드 복호화 단계, 참조 화소 구성 단계, 예측 블록 생성 단계를 포함할 수 있다. 또한, 영상 복호화 장치는 예측 모드 복호화 단계, 참조 화소 구성 단계, 예측 블록 생성 단계를 구현하는 예측 모드 복호화부, 참조 화소 구성부, 예측 블록 생성부를 포함하도록 구성할 수 있다. 전술한 과정의 일부는 생략될 수 있거나 다른 과정이 추가될 수 있고, 상기 기재된 순서가 아닌 다른 순서로 변경될 수 있다.In the image decoding method according to an embodiment of the present invention, the intra prediction may be configured as follows. The intra prediction of the prediction unit may include a prediction mode decoding step, a reference pixel construction step, and a prediction block generation step. Also, the image decoding apparatus may be configured to include a prediction mode decoding unit, a reference pixel construction unit, and a prediction block generation unit that implement the prediction mode decoding step, the reference pixel construction step, and the prediction block generation step. Some of the processes described above may be omitted or other processes may be added, and may be changed in an order other than the order described above.

영상 복호화 장치의 참조 화소 구성부, 예측 블록 생성부는 영상 부호화 장치의 대응되는 구성과 동일한 역할을 수행하므로 상세한 설명은 생략하며, 예측 모드 복호화부는 예측 모드 부호화부에서 사용한 방식을 역으로 사용하여 수행될 수 있다.Since the reference pixel component and the prediction block generator of the image decoding apparatus play the same role as the corresponding components of the image encoding apparatus, a detailed description thereof will be omitted, and the prediction mode decoder may be performed by using the inverse method used by the prediction mode encoder. Can be.

본 발명에 따른 방법들은 다양한 컴퓨터 수단을 통해 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 컴퓨터 판독 가능 매체에 기록되는 프로그램 명령은 본 발명을 위해 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다.The methods according to the invention can be implemented in the form of program instructions that can be executed by various computer means and recorded on a computer readable medium. Computer-readable media may include, alone or in combination with the program instructions, data files, data structures, and the like. The program instructions recorded on the computer readable medium may be those specially designed and constructed for the present invention, or may be known and available to those skilled in computer software.

컴퓨터 판독 가능 매체의 예에는 롬(ROM), 램(RAM), 플래시 메모리(flash memory) 등과 같이 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함될 수 있다. 프로그램 명령의 예에는 컴파일러(compiler)에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터(interpreter) 등을 사용해서 컴퓨터에 의해 실행될 수 있는 고급 언어 코드를 포함할 수 있다. 상술한 하드웨어 장치는 본 발명의 동작을 수행하기 위해 적어도 하나의 소프트웨어 모듈로 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Examples of computer readable media may include hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions may include high-level language code that can be executed by a computer using an interpreter, as well as machine code such as produced by a compiler. The hardware device described above may be configured to operate with at least one software module to perform the operations of the present invention, and vice versa.

또한, 상술한 방법 또는 장치는 그 구성이나 기능의 전부 또는 일부가 결합되어 구현되거나, 분리되어 구현될 수 있다. In addition, the above-described method or apparatus may be implemented by combining all or part of the configuration or function, or may be implemented separately.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although described above with reference to a preferred embodiment of the present invention, those skilled in the art will be variously modified and changed within the scope of the invention without departing from the spirit and scope of the invention described in the claims below I can understand that you can.

Claims (1)

상관성 정보 획득을 위해 지정된 참조 화소 영역을 확인하는 단계;
상기 참조 화소 영역의 사용 가능성 판단에 기반하여 참조 화소 처리 설정을 결정하는 단계; 및
상기 참조 화소 처리 설정에 기반하여 화면내 예측을 수행하는 단계를 포함하는 영상 복호화 방법.
Identifying a reference pixel region designated for obtaining correlation information;
Determining a reference pixel processing setting based on the availability determination of the reference pixel area; And
And performing intra prediction on the basis of the reference pixel processing setting.
KR1020190033765A 2018-03-25 2019-03-25 Method and apparatus for image encoding/decoding KR20190112249A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20180034174 2018-03-25
KR1020180034174 2018-03-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020210007518A Division KR20210009417A (en) 2018-03-25 2021-01-19 Method and apparatus for image encoding/decoding

Publications (1)

Publication Number Publication Date
KR20190112249A true KR20190112249A (en) 2019-10-04

Family

ID=68208076

Family Applications (2)

Application Number Title Priority Date Filing Date
KR1020190033765A KR20190112249A (en) 2018-03-25 2019-03-25 Method and apparatus for image encoding/decoding
KR1020210007518A KR20210009417A (en) 2018-03-25 2021-01-19 Method and apparatus for image encoding/decoding

Family Applications After (1)

Application Number Title Priority Date Filing Date
KR1020210007518A KR20210009417A (en) 2018-03-25 2021-01-19 Method and apparatus for image encoding/decoding

Country Status (1)

Country Link
KR (2) KR20190112249A (en)

Also Published As

Publication number Publication date
KR20210009417A (en) 2021-01-26

Similar Documents

Publication Publication Date Title
KR102378882B1 (en) Video encoding/decoding method and apparatus
CA3095124C (en) Image encoding/decoding method and device
KR102296536B1 (en) Intra-prediction encoding/decoding method and apparatus for chrominance components
JP7453236B2 (en) Image encoding/decoding method and device
KR20190112249A (en) Method and apparatus for image encoding/decoding
KR20190087329A (en) Image encoding/decoding method and apparatus for performing intra prediction using a plurality of prediction mode candidates
CN111602400B (en) Intra-frame prediction encoding/decoding method and apparatus for chrominance components

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
E90F Notification of reason for final refusal
E601 Decision to refuse application
A107 Divisional application of patent