KR20200043352A - Method and apparatus for encoding/decoding a video signal - Google Patents

Method and apparatus for encoding/decoding a video signal Download PDF

Info

Publication number
KR20200043352A
KR20200043352A KR1020200046561A KR20200046561A KR20200043352A KR 20200043352 A KR20200043352 A KR 20200043352A KR 1020200046561 A KR1020200046561 A KR 1020200046561A KR 20200046561 A KR20200046561 A KR 20200046561A KR 20200043352 A KR20200043352 A KR 20200043352A
Authority
KR
South Korea
Prior art keywords
block
intra prediction
current coding
coding block
current
Prior art date
Application number
KR1020200046561A
Other languages
Korean (ko)
Other versions
KR102435493B1 (en
Inventor
문주희
원동재
임성원
Original Assignee
세종대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 세종대학교산학협력단 filed Critical 세종대학교산학협력단
Publication of KR20200043352A publication Critical patent/KR20200043352A/en
Priority to KR1020220103515A priority Critical patent/KR20220119583A/en
Application granted granted Critical
Publication of KR102435493B1 publication Critical patent/KR102435493B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • 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/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Abstract

The present invention relates to a method and a device for efficiently encoding/decoding an image signal to improve compression efficiency of an image. According to the present invention, the method for decoding an image signal can comprise the steps of: decoding division information indicating whether or not a current decoding block is divided into two partial blocks; decoding information on a division pattern of the current decoding block, when the division information indicates that the current decoding block is divided into two partial blocks; and dividing the current decoding block into two partial blocks based on the information on the division pattern.

Description

영상 신호 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR ENCODING/DECODING A VIDEO SIGNAL}METHOD AND APPARATUS FOR ENCODING / DECODING A VIDEO SIGNAL}

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

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(Channel)의 대역폭(Bandwidth)이 발전하는 속도는 급격히 증가하고 있는 멀티미디어 데이터의 양을 따라가기 힘든 상황이다. Recently, the demand for multimedia data such as video has been rapidly increasing on the Internet. However, the speed at which the bandwidth of the channel is developing is difficult to keep up with the rapidly increasing amount of multimedia data.

본 발명은 영상을 부호화/복호화함에 있어서, 부호화/복호화 대상 블록의 분할 방법을 효율적으로 부호화/복호화함으로써, 영상의 압축 효율을 향상시키는 것에 주된 목적이 있다. The present invention mainly aims to improve the compression efficiency of an image by efficiently encoding / decoding a method of dividing an encoding / decoding target block in encoding / decoding an image.

본 발명은 영상을 부호화/복호화함에 있어서, 부호화/복호화 대상 블록의 인트라 예측 모드 정보를 효율적으로 부호화/복호화 함으로써, 영상의 압축 효율을 향상시키는 것에 주된 목적이 있다.The present invention mainly aims to improve the compression efficiency of an image by efficiently encoding / decoding intra prediction mode information of an encoding / decoding target block in encoding / decoding an image.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 현재 복호화 블록이 2개의 부분 블록으로 분할되는지 여부를 나타내는 분할 정보를 복호화하고, 상기 분할 정보가 상기 현재 복호화 블록이 2개의 부분 블록으로 분할됨을 나타내는 경우, 상기 현재 복호화 블록의 분할 패턴에 대한 정보를 복호화하고, 상기 분할 패턴에 대한 정보를 기초로, 상기 현재 복호화 블록을 2개의 부분 블록으로 분할할 수 있다. The video signal decoding method and apparatus according to the present invention decodes split information indicating whether a current decoding block is divided into two sub-blocks, and the split information indicates that the current decoding block is divided into two sub-blocks , The information on the split pattern of the current decoding block may be decoded, and the current decoding block may be divided into two partial blocks based on the information on the split pattern.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 분할 패턴에 대한 정보는, 상기 현재 복호화 블록의 분할 방향을 나타내는 방향 정보 또는 상기 현재 복호화 블록이 분할함으로써 생성되는 부분 블록의 크기를 특정하는 정밀도 정보 중 적어도 하나를 포함할 수 있다.In the video signal decoding method and apparatus according to the present invention, the information on the division pattern is precision specifying a direction information indicating a division direction of the current decoding block or a size of a partial block generated by division of the current decoding block It may include at least one of the information.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부분 블록의 가로 또는 세로 길이는, 상기 복호화 블록의 가로 또는 세로 길이를 상기 정밀도 정보가 특정하는 값(N)의 2의 지수승(2N)으로 나눈 값을 가질 수 있다.In the video signal decoding method and apparatus according to the present invention, the horizontal or vertical length of the partial block is a power of 2 (N) of a value (N) of the precision information specifying the horizontal or vertical length of the decoding block (2 N ).

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 분할 패턴에 대한 정보는, 상기 현재 복호화 블록의 분할된 형태를 특정하는 인덱스 정보를 포함할 수 있다.In the method and apparatus for decoding a video signal according to the present invention, the information on the divided pattern may include index information specifying a divided form of the current decoding block.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 상기 현재 복호화 블록에 이웃한 이웃 블록의 인트라 예측 모드를 기초로, 상기 현재 복호화 블록에 대한 MPM (Most Probable Mode) 후보를 결정하고, 상기 현재 복호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는지 여부를 나타내는 정보를 복호화하고, 상기 정보에 따라, 상기 현재 복호화 블록의 인트라 예측 모드를 유도할 수 있다.The video signal decoding method and apparatus according to the present invention determines an MPM (Most Probable Mode) candidate for the current decoding block based on the intra prediction mode of a neighboring block adjacent to the current decoding block, and the current decoding block Information indicating whether or not the same MPM candidate as the intra prediction mode of A may be decoded, and according to the information, an intra prediction mode of the current decoding block may be derived.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 복호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 상기 현재 복호화 블록의 크기, 형태 또는 상기 이웃 블록의 인트라 예측 모드에 따라 가변적으로 결정될 수 있다.In the video signal decoding method and apparatus according to the present invention, the number of intra prediction modes that can be used by the current decoding block may be variably determined according to the size, shape, or intra prediction mode of the neighboring block. have.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 복호화 블록이 이용할 수 있는 인트라 예측 모드의 개수와, 상기 이웃 블록이 이용할 수 있는 인트라 예측 모드의 개수가 다른 경우, 방향성 예측 모드에 대응하는 MPM 후보는, 상기 방향성 예측 모드의 예측 각도로 설정될 수 있다.In the video signal decoding method and apparatus according to the present invention, when the number of intra prediction modes available for the current decoding block is different from the number of intra prediction modes available for the neighboring block, it corresponds to a directional prediction mode The MPM candidate may be set as a prediction angle of the directional prediction mode.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 현재 부호화 블록이 2개의 부분 블록으로 분할되는지 여부를 판단하고, 상기 판단 결과에 따라, 상기 현재 부호화 블록이 2개의 부분 블록으로 분할되는지 여부를 나타내는 분할 정보를 부호화하고, 상기 현재 부호화 블록이 2개의 부분 블록으로 분할되는 것으로 판단되는 경우, 상기 현재 부호화 블록의 분할 패턴을 결정하고, 상기 결정에 기초하여, 상기 현재 부호화 블록의 분할 패턴에 관한 정보를 부호화할 수 있다. The video signal encoding method and apparatus according to the present invention determines whether the current coding block is divided into two sub-blocks, and according to the determination result, splits indicating whether the current coding block is divided into two sub-blocks When it is determined that the current coding block is divided into two sub-blocks, information about the split pattern of the current coding block is determined based on the determination of the split pattern of the current coding block. Can be coded.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 분할 패턴에 대한 정보는, 상기 현재 부호화 블록의 분할 방향을 나타내는 방향 정보 또는 상기 현재 부호화 블록이 분할함으로써 생성되는 부분 블록의 크기를 특정하는 정밀도 정보 중 적어도 하나를 포함할 수 있다.In the video signal encoding method and apparatus according to the present invention, the information on the split pattern is precision specifying a direction information indicating a split direction of the current coding block or a size of a partial block generated by the current coding block splitting It may include at least one of the information.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부분 블록의 가로 또는 세로 길이는, 상기 부호화 블록의 가로 또는 세로 길이를 상기 정밀도 정보가 특정하는 값(N)의 2의 지수승(2N)으로 나눈 값을 가질 수 있다.In the video signal encoding method and apparatus according to the present invention, the horizontal or vertical length of the partial block is a power of 2 (N) of the value (N) of the precision information specifying the horizontal or vertical length of the coding block (2 N ).

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 분할 패턴에 대한 정보는, 상기 현재 부호화 블록의 분할된 형태를 특정하는 인덱스 정보를 포함할 수 있다.In the video signal encoding method and apparatus according to the present invention, the information on the split pattern may include index information specifying a split form of the current coding block.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 상기 현재 부호화 블록에 이웃한 이웃 블록의 인트라 예측 모드를 기초로, 상기 현재 부호화 블록에 대한 MPM (Most Probable Mode) 후보를 결정하고, 상기 현재 부호화 블록의 인트라 예측 모드를 결정하고, 상기 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는지 여부를 나타내는 정보를 부호화할 수 있다.The video signal encoding method and apparatus according to the present invention determines a MPM (Most Probable Mode) candidate for the current coding block based on the intra prediction mode of a neighboring block adjacent to the current coding block, and the current coding block The intra prediction mode of may be determined, and information indicating whether the same MPM candidate as the intra prediction mode of the current coding block exists may be encoded.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 상기 현재 부호화 블록의 크기, 형태 또는 상기 이웃 블록의 인트라 예측 모드에 따라 가변적으로 결정될 수 있다.In the video signal encoding method and apparatus according to the present invention, the number of intra prediction modes that can be used by the current coding block may be variably determined according to the size, shape, or intra prediction mode of the neighboring block. have.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수와, 상기 이웃 블록이 이용할 수 있는 인트라 예측 모드의 개수가 다른 경우, 방향성 예측 모드에 대응하는 MPM 후보는, 상기 방향성 예측 모드의 예측 각도로 설정될 수 있다.In the video signal encoding method and apparatus according to the present invention, when the number of intra prediction modes available for the current coding block is different from the number of intra prediction modes available for the neighboring block, it corresponds to a directional prediction mode The MPM candidate may be set as a prediction angle of the directional prediction mode.

본 발명에 따르면, 부호화/복호화 대상 블록의 분할 방법을 효율적으로 부호화/복호화함으로써, 영상의 압축 효율을 향상시킬수 있다.According to the present invention, the compression efficiency of an image can be improved by efficiently encoding / decoding a method of dividing a block to be encoded / decoded.

본 발명에 따르면, 부호화/복호화 대상 블록의 인트라 예측 모드 정보를 효율적으로 부호화/복호화 함으로써, 영상의 압축 효율을 향상시킬 수 있다.According to the present invention, the compression efficiency of an image can be improved by efficiently encoding / decoding the intra prediction mode information of a block to be encoded / decoded.

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 본 발명의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 3은 DC 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.
도 4는 플래너 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.
도 5는 방향성 예측 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.
도 6은 부호화 블록에 대한 QT 분할 정보를 부호화하는 방법을 나타낸 도면이다.
도 7은 부호화 블록에 대한 BT 분할 정보를 부호화하는 방법을 나타낸 도면이다.
도 8은 복호화 블록에 대한 QT 분할 정보를 복호화하는 방법을 나타낸 도면이다.
도 9는 복호화 블록에 대한 BT 분할 정보를 복호화하는 방법을 나타낸 도면이다.
도 10은 부호화 블록 내 분할 상태를 예시한 도면이다.
도 11은 도 10에 도시된 입력 부호화 블록의 최적 분할 상태를 트리 구조를 이용하여 표현한 것이다.
도 12는 부호화 장치에서, 예측 모드의 개수 또는 종류를 제어하는 과정을 나타낸 흐름도이다.
도 13 및 도 14는 현재 부호화 블록에서 이용할 수 있는 방향성 예측 모드가 13개인 경우의 예를 나타낸다.
도 15 및 도 16은 현재 블록에서 이용할 수 있는 방향성 예측 모드가 21개인 경우의 예를 나타낸다.
도 17은 현재 부호화 블록에 대한 최적의 인트라 예측 모드를 부호화는 과정을 나타낸 흐름도이다.
도 18은 MPM 후보를 설정하는 일 예를 나타낸 도면이다.
도 19 및 도 20은 예측 각도를 양자화하는 예를 나타낸다.
도 21은 MPM 후보를 설정하는 다른 예를 나타낸 도면이다.
도 22는 현재 부호화 블록의 MPM 후보를 유도하기 위해 이용되는 주변 블록의 예를 나타낸다.
도 23은 현재 부호화 블록에 인접하지 않은 주변 블록으로부터 MPM 후보를 유도하는 예를 나타낸 도면이다.
도 24는 현재 복호화 블록에 대한 인트라 예측 모드를 복호화하는 과정을 나타낸 흐름도이다.
1 is a block diagram showing an image encoding apparatus according to an embodiment of the present invention.
2 is a block diagram showing an image decoding apparatus according to an embodiment of the present invention.
3 is a diagram for explaining an intra prediction method using a DC mode.
4 is a diagram for explaining an intra prediction method using a planner mode.
5 is a diagram for explaining an intra prediction method using a directional prediction mode.
6 is a diagram illustrating a method of encoding QT split information for an encoding block.
7 is a diagram illustrating a method of encoding BT segmentation information for an encoding block.
8 is a diagram illustrating a method of decoding QT segmentation information for a decoding block.
9 is a diagram illustrating a method of decoding BT segmentation information for a decoding block.
10 is a diagram illustrating a split state in a coding block.
FIG. 11 shows an optimal splitting state of the input coding block shown in FIG. 10 using a tree structure.
12 is a flowchart illustrating a process of controlling the number or type of prediction modes in the encoding device.
13 and 14 show examples of 13 directional prediction modes that can be used in the current coding block.
15 and 16 show examples of 21 directional prediction modes available in the current block.
17 is a flowchart illustrating a process of encoding an optimal intra prediction mode for a current coding block.
18 is a diagram showing an example of setting an MPM candidate.
19 and 20 show an example of quantizing a prediction angle.
21 is a diagram showing another example of setting an MPM candidate.
22 shows an example of a neighboring block used to derive an MPM candidate of a current coding block.
23 is a diagram showing an example of deriving an MPM candidate from neighboring blocks that are not adjacent to the current coding block.
24 is a flowchart illustrating a process of decoding an intra prediction mode for a current decoding block.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.The present invention can be applied to various changes and may have various embodiments, and specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, and should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. In describing each drawing, similar reference numerals are used for similar components.

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

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어"있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어"있다거나 "직접 접속되어"있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When an element is said to be "connected" or "connected" to another component, it is understood that other components may be directly connected to or connected to the other component, but other components may exist in the middle. It 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 no other component exists in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in this application are only used to describe specific embodiments, and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "include" or "have" are intended to indicate the presence of features, numbers, steps, actions, components, parts or combinations thereof described herein, one or more other features. It should be understood that the existence or addition possibilities of fields or numbers, steps, operations, components, parts or combinations thereof are not excluded in advance.

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same reference numerals are used for the same components in the drawings, and duplicate descriptions for the same components are omitted.

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다. 1 is a block diagram showing an image encoding apparatus according to an embodiment of the present invention.

도 1을 참조하면, 영상 부호화 장치(100)는 픽쳐 분할부(110), 예측부(120, 125), 변환부(130), 양자화부(135), 재정렬부(160), 엔트로피 부호화부(165), 역양자화부(140), 역변환부(145), 필터부(150) 및 메모리(155)를 포함할 수 있다.Referring to FIG. 1, the image encoding apparatus 100 includes a picture splitter 110, a prediction unit 120, 125, a transform unit 130, a quantization unit 135, a reordering unit 160, and an entropy coding unit ( 165), an inverse quantization unit 140, an inverse conversion unit 145, a filter unit 150 and a memory 155.

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

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

픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 블록으로 분할할 수 있다. 이때, 블록은 부호화 단위(CU), 예측 단위(PU) 또는 변환 단위(TU)를 의미할 수 있다. 상기 분할은 쿼드 트리(Quadtree) 또는 바이너리 트리(Biniary tree) 중 적어도 하나에 기반하여 수행될 수 있다. 쿼드 트리는 상위 블록을 너비와 높이가 상위 블록의 절반인 하위 블록으로 사분할하는 방식이다. 바이너리 트리는 상위 블록을 너비 또는 높이 중 어느 하나가 상위 블록의 절반인 하위 블록으로 이분할하는 방식이다. 전술한 바이너리 트리 기반의 분할을 통해, 블록은 정방형뿐만 아니라 비정방형의 형태를 가질 수 있다.The picture division unit 110 may divide the input picture into at least one block. In this case, the block may mean a coding unit (CU), a prediction unit (PU), or a transformation unit (TU). The splitting may be performed based on at least one of a quadtree or a binary tree. Quad tree divides the upper block into lower blocks whose width and height are half of the upper block. The binary tree is a method of dividing the upper block into lower blocks, which are either half or higher of the upper block. Through the above-described binary tree-based partitioning, blocks may have a square shape as well as a square shape.

이하, 본 발명의 실시예에서는 부호화 단위는 부호화를 수행하는 단위의 의미로 사용할 수도 있고, 복호화를 수행하는 단위의 의미로 사용할 수도 있다.Hereinafter, in an embodiment of the present invention, a coding unit may be used as a meaning of a unit that performs coding or may be used as a meaning of a unit that performs decoding.

예측부(120, 125)는 인터 예측을 수행하는 인터 예측부(120)와 인트라 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. The prediction units 120 and 125 may include an inter prediction unit 120 performing inter prediction and an intra prediction unit 125 performing intra prediction. It is determined whether to use inter prediction or intra prediction for a prediction unit, and specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method can be determined. At this time, the processing unit for which prediction is performed and the processing unit for which the prediction method and specific content are determined may be different. For example, a method of prediction, a prediction mode, and the like are determined in a prediction unit, and prediction performance may be performed in a transformation unit.

부호화 장치는, 원본 블록과 예측 블록을 뺀 잔차 블록에 대한 율-왜곡 최적화(RDO: Rate-Distortion Optimization) 등을 수행하는 등 다양한 기법을 이용하여 부호화 블록에 대한 최적 예측 모드를 결정할 수 있다. 일 예로, RDO는 하기 수학식 1에 의해 결정될 수 있다.The encoding apparatus may determine an optimal prediction mode for the encoding block by using various techniques such as performing rate-distortion optimization (RDO) on the residual block minus the original block and the prediction block. As an example, RDO may be determined by Equation 1 below.

Figure pat00001
Figure pat00001

상기 수학식 1에서, D는 양자화에 의한 열화, R은 압축 스트림의 레이트, J는 RD 비용을 나타낸다. 또한, Φ는 부호화 모드, λ는 라그랑지안 승수(Lagrangian multiplier)를 나타낸다. λ는 에러의 양과 비트량 간의 단위를 일치시키기 위한 스케일 보정용 계수로 이용될 수 있다. 부호화 과정에서 부호화 장치는, RD 비용값이 최소인 모드를 부호화 블록에 대한 최적 모드로 결정할 수 있다. 이때, RD-비용값은, 비트율과 에러를 동시에 고려하여 계산한다.In Equation 1, D represents deterioration due to quantization, R represents a rate of a compressed stream, and J represents an RD cost. In addition, Φ represents an encoding mode, and λ represents a Lagrangian multiplier. [lambda] can be used as a scale correction coefficient to match the unit between the amount of error and the amount of bit. In the encoding process, the encoding apparatus may determine a mode having the smallest RD cost value as an optimal mode for the encoding block. At this time, the RD-cost value is calculated considering both the bit rate and the error at the same time.

인트라 모드들 중, 비방향성 예측 모드(또는 비각도 예측 모드)인 DC 모드는 현재 블록의 주변 화소들의 평균값을 이용한다. 도 3은 DC 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.Among the intra modes, the DC mode, which is a non-directional prediction mode (or a non-angle prediction mode), uses an average value of surrounding pixels of a current block. 3 is a diagram for explaining an intra prediction method using a DC mode.

예측 블록에 주변 화소들의 평균값을 채워 넣은 뒤, 예측 블록의 경계에 위치하는 화소들에 대해 필터링을 수행할 수 있다. 일 예로, 예측 블록의 좌측 또는 상단 경계에 위치하는 화소들에는, 주변 참조 화소들과의 가중합 필터링이 적용될 수 있다. 일 예로, 수학식 2는 구역별 DC 모드를 통한 예측 화소를 생성하는 예를 나타낸 도면이다. 하기 수학식 1에서, R1, R2, R3 영역은, 예측 블록의 최외각(즉, 경계)에 위치하는 영역으로, 상기 영역에 포함된 화소들에는 가중합 필터링이 적용될 수 있다.After filling the prediction block with the average value of the surrounding pixels, filtering may be performed on pixels located at the boundary of the prediction block. For example, weighted filtering with neighboring reference pixels may be applied to pixels located at the left or upper boundary of the prediction block. As an example, Equation 2 is a view showing an example of generating a prediction pixel through a DC mode for each zone. In Equation 1 below, regions R1, R2, and R3 are regions located at the outermost (ie, boundary) of the prediction block, and weighted filtering may be applied to pixels included in the region.

Figure pat00002
Figure pat00002

수학식 2의 Wid는 예측 블록의 가로 길이, Hei는 예측 블록의 세로 길이를 의미한다. x, y는 예측 블록의 맨 왼쪽 상단 지점을 (0,0)으로 정하였을 때의 각 예측 화소 별 좌표 위치를 의미한다. R은 주변 화소를 의미한다. 일 예로, 도 3에 도시된 s화소를 R[-1][-1]로 정의할 경우, a화소부터 i화소 까지는 R[0][-1]~R[8][-1]로 나타내고 j화소부터 r화소까지는 R[-1][0]~R[-1][8]로 나타낼 수 있다. 도 3에 도시된 예에서, R1~R4 구역 별로 수학식 2와 같이 가중합 필터링 방식에 따라 예측 화소값 Pred를 구하게 된다.Wid in Equation 2 means the horizontal length of the prediction block, and Hei means the vertical length of the prediction block. x and y denote the coordinate position of each prediction pixel when the upper leftmost point of the prediction block is set to (0,0). R means surrounding pixels. For example, when the s pixel shown in FIG. 3 is defined as R [-1] [-1], the pixels a through i are represented by R [0] [-1] to R [8] [-1]. From j pixels to r pixels, it can be represented by R [-1] [0] to R [-1] [8]. In the example illustrated in FIG. 3, the predicted pixel value Pred is obtained according to a weighted filtering method as shown in Equation 2 for each R1 to R4 region.

비방향성 모드 중 플래너(Planar) 모드는, 현재 블록 주변 화소들을 거리에 따라 선형 보간하여, 현재 블록의 예측 화소를 생성하는 방법이다. 일 예로, 도 4는 플래너 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.Among non-directional modes, a planar mode is a method of linearly interpolating pixels around a current block according to a distance to generate a prediction pixel of the current block. As an example, FIG. 4 is a diagram illustrating an intra prediction method using a planner mode.

예를 들어서 8x8 부호화 블록에서 도 4에 도시된 Pred를 예측 하고자 하는 경우를 가정한다. 이 경우, Pred의 위쪽에 있는 화소 e화소와 왼쪽 아래에 있는 r화소를 Pred의 맨 아래쪽에 복사 하여 세로 방향으로 거리에 따른 선형 보간 방식으로 세로 예측 값을 구할 수 있다. 또한, Pred의 왼쪽에 있는 n화소와 위쪽 오른편에 있는 i화소를 Pred의 맨 오른쪽에 복사 하여 가로 방향으로 거리에 따른 선형 보간 방식으로 가로 예측 값을 구할 수 있다. 이후, 가로 세로 예측 값의 평균값을 Pred의 값으로 정할 수 있다. 수학식 3은 플래너 모드 하에서, 예측값 Pred를 구하는 과정을 수식으로 표현한 것이다.For example, it is assumed that Pred shown in FIG. 4 is predicted in an 8x8 coding block. In this case, the vertical prediction value can be obtained by linearly interpolating the distance in the vertical direction by copying the pixel e pixel at the top of the Pred and the r pixel at the bottom of the left at the bottom of the Pred. Also, by copying the n pixels on the left of Pred and the i-pixel on the upper right to the far right of Pred, the horizontal prediction value can be obtained by linear interpolation according to the distance in the horizontal direction. Thereafter, the average value of the horizontal and vertical prediction values may be determined as the value of Pred. Equation 3 expresses the process of obtaining the predicted value Pred under the planner mode as an equation.

Figure pat00003
Figure pat00003

수학식 3의 Wid는 예측 블록의 가로 길이, Hei는 예측 블록의 세로 길이를 의미한다. x, y는 예측 블록의 맨 왼쪽 상단 지점을 (0, 0)으로 정하였을 때의 각 예측 화소 별 좌표 위치를 의미한다. R은 주변 화소를 의미한다. 일 예로, 도 4에 도시된 s화소를 R[-1][-1]로 정의할 경우, a화소부터 i화소 까지는 R[0][-1]~R[8][-1]로 나타내고 j화소부터 r화소까지는 R[-1][0]~R[-1][8]로 나타낼 수 있다.Wid in Equation 3 means the horizontal length of the prediction block, and Hei means the vertical length of the prediction block. x and y denote the coordinate position of each prediction pixel when the upper leftmost point of the prediction block is set to (0, 0). R means surrounding pixels. For example, when the s pixel shown in FIG. 4 is defined as R [-1] [-1], the pixels a through i are represented by R [0] [-1] to R [8] [-1]. From j pixels to r pixels, it can be represented by R [-1] [0] to R [-1] [8].

도 5는 방향성 예측 모드를 이용한 인트라 예측 방법을 설명하기 위한 도면이다.5 is a diagram for explaining an intra prediction method using a directional prediction mode.

방향성 예측 모드(또는 각도 예측 모드)는 현재 블록의 주변 화소들 중, 미리 정해 놓은 N가지 방향 중 어느 하나의 방향에 위치하는 적어도 하나 이상의 화소를 예측 샘플로 생성하는 방식이다. The directional prediction mode (or the angular prediction mode) is a method of generating at least one pixel located in any one of N predetermined directions among neighboring pixels of the current block as a prediction sample.

방향성 예측 모드는, 가로 방향 모드와 세로 방향 모드를 포함할 수 있다. 여기서, 가로 방향 모드란 좌상단으로 45도 방향을 향하는 각도 예측 모드보다 가로 방향성이 큰 모드들을 의미하고, 세로 방향 모드란 좌상단으로 45도 방향을 향하는 각도 예측 모드 보다 세로 방향성이 큰 모드들을 의미한다. 좌상단으로 45도 방향으로 향하는 예측 방향을 갖는 방향성 예측 모드는, 가로 방향 모드로 취급될 수도 있고, 세로 방향 모드로 취급될 수도 있다. 도 5에, 가로 방향 모드 및 세로 방향 모드가 도시되어 있다. The directional prediction mode may include a horizontal direction mode and a vertical direction mode. Here, the horizontal direction mode means modes in which the horizontal direction is larger than the angle prediction mode in the upper left direction toward the 45 degree direction, and the vertical direction mode means modes in which the vertical direction is larger than the angle prediction mode in the upper left direction toward the 45 degree direction. The directional prediction mode having a prediction direction directed toward the top left in a 45 degree direction may be treated as a horizontal direction mode or a vertical direction mode. In FIG. 5, a horizontal mode and a vertical mode are shown.

도 5를 참조하면, 각 방향 별로 정수 화소 부분에 부합이 안 되는 방향도 있는데, 이런 경우는 주변 화소와 화소 사이를 거리에 따른 선형 보간 방식이나 DCT-IF 방식, Cubic convolution 보간 방식 등 다양한 보간 방식을 이용하여 보간을 한 후, 그 화소 값을 예측 블록 방향에 부합하는 화소 위치에 넣을 수 있다.Referring to FIG. 5, there is a direction that does not correspond to an integer pixel portion for each direction. In this case, various interpolation methods such as a linear interpolation method, a DCT-IF method, and a cubic convolution interpolation method according to a distance between a peripheral pixel and a pixel, After interpolation using, the pixel value can be put in a pixel position that matches the prediction block direction.

생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록 또는 변환 블록)은 변환부(130)로 입력될 수 있다. 잔차 블록은 변환 및 양자화 과정을 위한 최소 단위이다. 부호화 블록의 분할 방식이 변환 블록에도 적용될 수 있다. 일 예로, 변환 블록은 4개 또는 2개의 부분 블록으로 분할될 수 있다. The residual value (residual block or transform block) between the generated prediction block and the original block may be input to the transform unit 130. The residual block is the minimum unit for the transformation and quantization process. A coding block division method may be applied to a transform block. For example, the transform block may be divided into 4 or 2 sub-blocks.

예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화기에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(120, 125)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.Prediction mode information, motion vector information, and the like used for prediction may be encoded by the entropy encoding unit 165 together with the residual value and transmitted to the decoder. When a specific coding mode is used, it is also possible to encode the original block as it is and transmit it to the decoder without generating a prediction block through the prediction units 120 and 125.

인터 예측부(120)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 단위를 예측할 수도 있고, 경우에 따라서는 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로 예측 단위를 예측할 수도 있다. 인터 예측부(120)는 참조 픽쳐 보간부, 모션 예측부, 움직임 보상부를 포함할 수 있다. The inter-prediction unit 120 may predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture, and in some cases, prediction based on information of some regions where encoding in the current picture is completed. Units can also be predicted. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

참조 픽쳐 보간부에서는 메모리(155)로부터 참조 픽쳐 정보를 제공받고 참조 픽쳐에서 정수 화소 이하의 화소 정보를 생성할 수 있다. 휘도 화소의 경우, 1/4 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 8탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다. 색차 신호의 경우 1/8 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 4탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다.The reference picture interpolator may receive reference picture information from the memory 155 and generate pixel information of integer pixels or less in the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter (DCT-based interpolation filter) having different filter coefficients may be used to generate pixel information of integer pixels or less in units of 1/4 pixels. In the case of a color difference signal, a DCT-based interpolation filter (DCT-based interpolation filter) having different filter coefficients may be used to generate pixel information of an integer pixel or less in units of 1/8 pixels.

모션 예측부는 참조 픽쳐 보간부에 의해 보간된 참조 픽쳐를 기초로 모션 예측을 수행할 수 있다. 모션 벡터를 산출하기 위한 방법으로 FBMA(Full search-based Block Matching Algorithm), TSS(Three Step Search), NTS(New Three-Step Search Algorithm) 등 다양한 방법이 사용될 수 있다. 모션 벡터는 보간된 화소를 기초로 1/2 또는 1/4 화소 단위의 모션 벡터값을 가질 수 있다. 모션 예측부에서는 모션 예측 방법을 다르게 하여 현재 예측 단위를 예측할 수 있다. 모션 예측 방법으로 스킵(Skip) 방법, 머지(Merge) 방법, AMVP(Advanced Motion Vector Prediction) 방법 등 다양한 방법이 사용될 수 있다.The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. As a method for calculating the motion vector, various methods such as Full Search-based Block Matching Algorithm (FBMA), Three Step Search (TSS), and New Three-Step Search Algorithm (NTS) can be used. The motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on the interpolated pixels. The motion prediction unit may predict the current prediction unit by differently using a motion prediction method. Various methods such as a skip method, a merge method, and an advanced motion vector prediction (AMVP) method may be used as a motion prediction method.

부호화 장치는, 움직임 추정 또는 이웃 블록의 움직임 정보에 기초하여 현재 블록의 움직임 정보를 생성할 수 있다. 여기서, 움직임 정보는, 움직임 벡터, 참조 영상 인덱스 및 예측 방향 중 적어도 하나를 포함할 수 있다. The encoding device may generate motion information of a current block based on motion estimation or motion information of a neighboring block. Here, the motion information may include at least one of a motion vector, a reference image index, and a prediction direction.

인트라 예측부(125)는 현재 픽쳐 내의 화소 정보인 현재 블록 주변의 참조 픽셀 정보를 기초로 예측 단위를 생성할 수 있다. 현재 예측 단위의 주변 블록이 인터 예측을 수행한 블록이어서, 참조 픽셀이 인터 예측을 수행한 픽셀일 경우, 인터 예측을 수행한 블록에 포함되는 참조 픽셀을 주변의 인트라 예측을 수행한 블록의 참조 픽셀 정보로 대체하여 사용할 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.The intra prediction unit 125 may generate a prediction unit based on reference pixel information around a current block, which is pixel information in a current picture. If the neighboring block of the current prediction unit is a block that has undergone inter prediction, and the reference pixel is a pixel that has undergone inter prediction, the reference pixel included in the block that has undergone inter prediction is a reference pixel of the block that has performed intra prediction around it. It can be used as a substitute for information. That is, when the reference pixel is not available, the available reference pixel information may be replaced with at least one reference pixel among the available reference pixels.

인트라 예측에서 예측 모드는 참조 픽셀 정보를 예측 방향에 따라 사용하는 방향성 예측 모드와 예측을 수행시 방향성 정보를 사용하지 않는 비방향성 모드를 가질 수 있다. 휘도 정보를 예측하기 위한 모드와 색차 정보를 예측하기 위한 모드가 상이할 수 있고, 색차 정보를 예측하기 위해 휘도 정보를 예측하기 위해 사용된 인트라 예측 모드 정보 또는 예측된 휘도 신호 정보를 활용할 수 있다.In intra prediction, the prediction mode may have a directional prediction mode that uses reference pixel information according to a prediction direction and a non-directional mode that does not use directional information when performing prediction. A mode for predicting luminance information and a mode for predicting color difference information may be different, and intra prediction mode information or predicted luminance signal information used for predicting luminance information may be used to predict color difference information.

인트라 예측 방법은 예측 모드에 따라 참조 화소에 AIS(Adaptive Intra Smoothing) 필터를 적용한 후 예측 블록을 생성할 수 있다. 참조 화소에 적용되는 AIS 필터의 종류는 상이할 수 있다. 인트라 예측 방법을 수행하기 위해 현재 예측 단위의 인트라 예측 모드는 현재 예측 단위의 주변에 존재하는 예측 단위의 인트라 예측 모드로부터 예측할 수 있다. 주변 예측 단위로부터 예측된 모드 정보를 이용하여 현재 예측 단위의 예측 모드를 예측하는 경우, 현재 예측 단위와 주변 예측 단위의 인트라 예측 모드가 동일하면 소정의 플래그 정보를 이용하여 현재 예측 단위와 주변 예측 단위의 예측 모드가 동일하다는 정보를 전송할 수 있고, 만약 현재 예측 단위와 주변 예측 단위의 예측 모드가 상이하면 엔트로피 부호화를 수행하여 현재 블록의 예측 모드 정보를 부호화할 수 있다.The intra prediction method may generate a prediction block after applying an adaptive intra smoothing (AIS) filter to the reference pixel according to the prediction mode. The type of AIS filter applied to the reference pixel may be different. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted from the intra prediction mode of the prediction unit existing around the current prediction unit. When the prediction mode of the current prediction unit is predicted using the mode information predicted from the neighboring prediction unit, if the intra prediction mode of the current prediction unit and the neighboring prediction unit are the same, the current prediction unit and the neighboring prediction unit using predetermined flag information It is possible to transmit the information that the prediction mode of is the same, and if the prediction mode of the current prediction unit and the neighboring prediction unit are different, entropy encoding may be performed to encode the prediction mode information of the current block.

또한, 예측부(120, 125)에서 생성된 예측 단위를 기초로 예측을 수행한 예측 단위와 예측 단위의 원본 블록과 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력될 수 있다. In addition, a residual block including prediction unit performing prediction based on the prediction unit generated by the prediction units 120 and 125 and residual information that is a difference value from the original block of the prediction unit may be generated. The generated residual block may be input to the conversion unit 130.

변환부(130)에서는 잔차 신호를 주파수 영역으로 변환하여 변환 계수를 갖는 잔차 블록(또는 변환 블록)을 생성한다. 여기서 잔차 신호를 주파수 영역으로 변환하기 위해, 이산 코사인 변환(DCT: Discrete Cosine Transform)기반 변환, 이산 사인 변환(DST: Discreate Sine Transform), KLT(Karhunen Loeve Transform) 등 다양한 변환 기법이 이용될 수 있다. 변환 기법을 편하게 사용하기 위해 기저벡터(basis vector)를 이용하여 행렬 연산을 하게 된다. 이때, 예측 블록이 어떤 예측 모드로 부호화 되었는지에 따라서 행렬 연산 시 변환 기법들을 다양하게 혼합하여 사용할 수도 있다. 예를 들어, 인트라 예측 시 예측 모드에 따라 가로 방향으로는 이산 코사인 변환을 사용하고 세로 방향으로는 이산 사인 변환을 사용 할 수도 있다.The transform unit 130 converts the residual signal into the frequency domain to generate a residual block (or transform block) having a transform coefficient. Here, in order to transform the residual signal into the frequency domain, various transform techniques such as Discrete Cosine Transform (DCT) based transform, Discreate Sine Transform (DST), and Karhunen Loeve Transform (KLT) can be used. . In order to conveniently use the transformation technique, matrix operations are performed using a basis vector. In this case, depending on which prediction mode the prediction block is coded, various transformation techniques may be mixed and used in matrix calculation. For example, in intra prediction, a discrete cosine transform may be used in the horizontal direction and a discrete sine transform may be used in the vertical direction according to the prediction mode.

양자화부(135)는 변환부(130)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 즉, 양자화부(135)는 변환부(130)로부터 생성된 변환 블록의 변환 계수들을 양자화하여, 양자화된 변환 계수를 갖는 양자화된 변환 블록을 생성할 수 있다. 여기서, 양자화 기법은, 데드존 균일 경계 양자화(DZUTQ: Dead Zone Uniform Threshold Quantization) 또는 양자화 가중치 행렬 (Quantization Weighted Matrix) 등을 포함할 수 있다. 이들 양자화 기법을 개량한 개량된 양자화 기법을 이용할 수도 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(135)에서 산출된 값은 역양자화부(140)와 재정렬부(160)에 제공될 수 있다.The quantization unit 135 may quantize the values converted from the conversion unit 130 to the frequency domain. That is, the quantization unit 135 quantizes transform coefficients of the transform block generated by the transform unit 130 to generate a quantized transform block having quantized transform coefficients. Here, the quantization technique may include Dead Zone Uniform Threshold Quantization (DZUTQ) or Quantization Weighted Matrix. It is also possible to use an improved quantization technique in which these quantization techniques are improved. The quantization coefficient may vary depending on the block or the importance of the image. The value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

상기 변환부(130) 및/또는 양자화부(135)는, 영상 부호화 장치(100)에 선택적으로 포함될 수 있다. 즉, 영상 부호화 장치(100)는, 잔차 블록의 잔차 데이터에 대해 변환 또는 양자화 중 적어도 하나를 수행하거나, 변환 및 양자화를 모두 스킵하여 잔차 블록을 부호화할 수 있다. 영상 부호화 장치(100)에서 변환 또는 양자화 중 어느 하나가 수행되지 않거나, 변환 및 양자화 모두 수행되지 않더라도, 엔트로피 부호화부(165)의 입력으로 들어가는 블록을 통상적으로 변환 블록(또는 양자화된 변환 블록)이라 일컫는다.The transformation unit 130 and / or the quantization unit 135 may be selectively included in the image encoding apparatus 100. That is, the image encoding apparatus 100 may encode the residual block by performing at least one of transformation or quantization on the residual data of the residual block, or skipping both transformation and quantization. Even if neither of the transformation or quantization is performed by the image encoding apparatus 100, or both transformation and quantization are not performed, a block that enters the input of the entropy encoding unit 165 is generally called a transform block (or a quantized transform block). Refers to.

재정렬부(160)는 양자화된 잔차값에 대해 계수값의 재정렬을 수행할 수 있다.The rearrangement unit 160 may rearrange the coefficient values with respect to the quantized residual value.

재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 소정의 스캔 타입을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. The reordering unit 160 may change the block shape coefficient of the 2D into a vector form of the 1D through a coefficient scanning method. For example, the reordering unit 160 may scan a DC coefficient to a coefficient in a high frequency region using a predetermined scan type and change it to a one-dimensional vector form.

엔트로피 부호화부(165)는 재정렬부(160)에 의해 산출된 값들을 기초로 엔트로피 부호화를 수행할 수 있다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다.The entropy encoding unit 165 may perform entropy encoding based on values calculated by the reordering unit 160. For the entropy encoding, various encoding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be used.

엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. 엔트로피 부호화부(165)에서, 변환 블록의 계수는, 변환 블록 내 부분 블록 단위로, 0이 아닌 계수, 절대값이 1 또는 2보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 부호화될 수 있다. 상기 플래그만으로 부호화되지 않는 계수는, 플래그를 통해 부호화된 계수와 실제 변환 블록의 계수 간의 차이의 절대값을 통해 부호화될 수 있다. The entropy encoding unit 165 includes residual value coefficient information of the coding unit and block type information, prediction mode information, split unit information, prediction unit information and transmission unit information, motion from the reordering unit 160 and the prediction units 120 and 125 Various information such as vector information, reference frame information, block interpolation information, and filtering information can be encoded. In the entropy encoding unit 165, coefficients of a transform block are encoded in various block units in a transform block, and non-zero coefficients, coefficients whose absolute value is greater than 1 or 2, and various types of flags indicating codes of the coefficients and the like. Can be. Coefficients not encoded by the flag alone may be encoded through absolute values of differences between coefficients encoded through flags and coefficients of an actual transform block.

엔트로피 부호화부(165)에서는 재정렬부(160)에서 입력된 부호화 단위의 계수값을 엔트로피 부호화할 수 있다.The entropy encoding unit 165 may entropy encode the coefficient value of the coding unit input from the reordering unit 160.

역양자화부(140) 및 역변환부(145)에서는 양자화부(135)에서 양자화된 값들을 역양자화하고 변환부(130)에서 변환된 값들을 역변환한다. The inverse quantization unit 140 and the inverse transformation unit 145 inverse quantize the values quantized by the quantization unit 135 and inversely transform the values converted by the conversion unit 130.

한편, 역양자화부(140)와 역변환부(145)는 양자화부(135)와 변환부(130)에서 사용한 양자화 방식과 변환 방식을 역으로 사용하여 역 양자화 및 역 변환 할 수 있다. 또한 변환부(130)와 양자화부(135)에서 양자화만을 수행하고 변환을 수행하지 않은 경우에는 역 양자화만을 수행하고 역 변환을 수행하지 않을 수 있다. 만약, 변환 및 양자화를 모두 수행하지 않은 경우, 역 양자화부(140)와역 변환부(145)도 역 변환 및 역 양자화를 모두 수행하지 않거나 영상 부호화 장치(100)에 포함되지 않고 생략 될 수 있다.Meanwhile, the inverse quantization unit 140 and the inverse transform unit 145 may perform inverse quantization and inverse transform using the quantization method and the transformation method used by the quantization unit 135 and the transformation unit 130 inversely. Also, if only the quantization unit 130 and the quantization unit 135 do not perform the quantization, only the inverse quantization may be performed and the inverse transformation may not be performed. If both the transform and the quantization are not performed, the inverse quantization unit 140 and the inverse transform unit 145 also do not perform both inverse transform and inverse quantization or may be omitted without being included in the image encoding apparatus 100.

역양자화부(140) 및 역변환부(145)에서 생성된 잔차값(Residual)은 예측부(120, 125)에 포함된 움직임 추정부, 움직임 보상부 및 인트라 예측부를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다. The residual values generated by the inverse quantization unit 140 and the inverse transformation unit 145 are restored by being combined with the prediction units predicted through the motion estimation unit, the motion compensation unit, and the intra prediction unit included in the prediction units 120 and 125 You can create a Reconstructed Block.

필터부(150)는 디블록킹 필터, 오프셋 보정부, ALF(Adaptive Loop Filter)중 적어도 하나를 포함할 수 있다.The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

디블록킹 필터는 복원된 픽쳐에서 블록간의 경계로 인해 생긴 블록 왜곡을 제거할 수 있다. 디블록킹을 수행할지 여부를 판단하기 위해 블록에 포함된 몇 개의 열 또는 행에 포함된 픽셀을 기초로 현재 블록에 디블록킹 필터 적용할지 여부를 판단할 수 있다. 블록에 디블록킹 필터를 적용하는 경우 필요한 디블록킹 필터링 강도에 따라 강한 필터(Strong Filter) 또는 약한 필터(Weak Filter)를 적용할 수 있다. 또한 디블록킹 필터를 적용함에 있어 수직 필터링 및 수평 필터링 수행시 수평 방향 필터링 및 수직 방향 필터링이 병행 처리되도록 할 수 있다.The deblocking filter can remove block distortion caused by boundary between blocks in the reconstructed picture. In order to determine whether to perform deblocking, it may be determined whether to apply a deblocking filter to the current block based on pixels included in a few columns or rows included in the block. When a deblocking filter is applied to a block, a strong filter or a weak filter may be applied according to the required deblocking filtering strength. In addition, in applying the deblocking filter, when performing vertical filtering and horizontal filtering, horizontal filtering and vertical filtering may be processed in parallel.

오프셋 보정부는 디블록킹을 수행한 영상에 대해 픽셀 단위로 원본 영상과의 오프셋을 보정할 수 있다. 특정 픽쳐에 대한 오프셋 보정을 수행하기 위해 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후 오프셋을 수행할 영역을 결정하고 해당 영역에 오프셋을 적용하는 방법 또는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법을 사용할 수 있다.The offset correction unit may correct an offset from the original image in units of pixels for the deblocking image. In order to perform offset correction for a specific picture, after dividing the pixels included in the image into a certain number of regions, determining the region to perform the offset and applying the offset to the region, or offset by considering the edge information of each pixel You can use the method of applying.

ALF(Adaptive Loop Filtering)는 필터링한 복원 영상과 원래의 영상을 비교한 값을 기초로 수행될 수 있다. 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행할 수 있다. ALF를 적용할지 여부에 관련된 정보는 휘도 신호는 부호화 단위(Coding Unit, CU) 별로 전송될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수는 달라질 수 있다. 또한, 적용 대상 블록의 특성에 상관없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다. ALF (Adaptive Loop Filtering) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After dividing the pixels included in the image into a predetermined group, one filter to be applied to the corresponding group may be determined to perform filtering differently for each group. For information related to whether to apply ALF, the luminance signal may be transmitted for each coding unit (CU), and the shape and filter coefficient of the ALF filter to be applied may be changed according to each block. Also, the ALF filter of the same form (fixed form) may be applied regardless of the characteristics of the block to be applied.

메모리(155)는 필터부(150)를 통해 산출된 복원 블록 또는 픽쳐를 저장할 수 있고, 저장된 복원 블록 또는 픽쳐는 인터 예측을 수행 시 예측부(120, 125)에 제공될 수 있다.The memory 155 may store reconstructed blocks or pictures calculated through the filter unit 150, and the stored reconstructed blocks or pictures may be provided to the predictors 120 and 125 when performing inter prediction.

도 2는 본 발명의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.2 is a block diagram showing an image decoding apparatus according to an embodiment of the present invention.

도 2를 참조하면, 영상 복호화기(200)는 엔트로피 복호화부(210), 재정렬부(215), 역양자화부(220), 역변환부(225), 예측부(230, 235), 필터부(240), 메모리(245)가 포함될 수 있다.Referring to FIG. 2, the image decoder 200 includes an entropy decoding unit 210, a reordering unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, 235, and a filter unit ( 240), a memory 245 may be included.

영상 부호화기에서 영상 비트스트림이 입력된 경우, 입력된 비트스트림은 영상 부호화기와 반대의 절차로 복호화될 수 있다.When an image bitstream is input from the image encoder, the input bitstream may be decoded in a procedure opposite to that of the image encoder.

엔트로피 복호화부(210)는 영상 부호화기의 엔트로피 부호화부에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. 엔트로피 복호화부(210)에서, 변환 블록의 계수는, 변환 블록 내 부분 블록 단위로, 0이 아닌 계수, 절대값이 1 또는 2보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 기반으로 복호화될 수 있다. 상기 플래그만으로 표현되지 않는 계수는, 플래그를 통해 표현되는 계수와 시그날링된 계수의 합을 통해 복호화될 수 있다. The entropy decoding unit 210 may perform entropy decoding in a procedure opposite to that performed by entropy encoding in the entropy encoding unit of the image encoder. For example, various methods such as Exponential Golomb (CAVLC), Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied to the method performed in the image encoder. In the entropy decoding unit 210, coefficients of a transform block are based on various types of flags indicating a non-zero coefficient, a coefficient whose absolute value is greater than 1 or 2, and a sign of the coefficient, etc., in units of partial blocks in the transform block. Can be decrypted. Coefficients not represented by the flag alone may be decoded through the sum of coefficients expressed through flags and signaled coefficients.

엔트로피 복호화부(210)에서는 부호화기에서 수행된 인트라 예측 및 인터 예측에 관련된 정보를 복호화할 수 있다.The entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed by the encoder.

재정렬부(215)는 엔트로피 복호화부(210)에서 엔트로피 복호화된 비트스트림을 부호화부에서 재정렬한 방법을 기초로 재정렬을 수행할 수 있다. 1차원 벡터 형태로 표현된 계수들을 다시 2차원의 블록 형태의 계수로 복원하여 재정렬할 수 있다. 재정렬부(215)에서는 부호화부에서 수행된 계수 스캐닝에 관련된 정보를 제공받고 해당 부호화부에서 수행된 스캐닝 순서에 기초하여 역으로 스캐닝하는 방법을 통해 재정렬을 수행할 수 있다.The rearrangement unit 215 may rearrange the bitstream entropy-decoded by the entropy decoding unit 210 based on a method of rearranging the bitstream. The coefficients expressed in the form of a one-dimensional vector can be reconstructed into coefficients in a two-dimensional block form and rearranged. The reordering unit 215 may receive information related to coefficient scanning performed by the encoding unit and perform reordering through a reverse scanning method based on a scanning order performed by the encoding unit.

역양자화부(220)는 부호화기에서 제공된 양자화 파라미터와 재정렬된 블록의 계수값을 기초로 역양자화를 수행할 수 있다. The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter provided by the encoder and the coefficient values of the rearranged blocks.

역변환부(225)는 역양자화된 변환 계수를 소정의 변환 방법으로 역변환을 수행할 수 있다. 이때, 변환 방법은 예측 방법(인터/인트라 예측), 블록의 크기/형태, 인트라 예측 모드 등에 관한 정보를 기반으로 결정될 수 있다.The inverse transform unit 225 may inverse transform the inverse-quantized transform coefficient by a predetermined transform method. In this case, the transform method may be determined based on information on a prediction method (inter / intra prediction), block size / shape, intra prediction mode, and the like.

예측부(230, 235)는 엔트로피 복호화부(210)에서 제공된 예측 블록 생성 관련 정보와 메모리(245)에서 제공된 이전에 복호화된 블록 또는 픽쳐 정보를 기초로 예측 블록을 생성할 수 있다. The prediction units 230 and 235 may generate a prediction block based on prediction block generation related information provided by the entropy decoding unit 210 and previously decoded block or picture information provided by the memory 245.

예측부(230, 235)는 예측 단위 판별부, 인터 예측부 및 인트라 예측부를 포함할 수 있다. 예측 단위 판별부는 엔트로피 복호화부(210)에서 입력되는 예측 단위 정보, 인트라 예측 방법의 예측 모드 정보, 인터 예측 방법의 모션 예측 관련 정보 등 다양한 정보를 입력 받고 현재 부호화 단위에서 예측 단위를 구분하고, 예측 단위가 인터 예측을 수행하는지 아니면 인트라 예측을 수행하는지 여부를 판별할 수 있다. 인터 예측부(230)는 영상 부호화기에서 제공된 현재 예측 단위의 인터 예측에 필요한 정보를 이용해 현재 예측 단위가 포함된 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐에 포함된 정보를 기초로 현재 예측 단위에 대한 인터 예측을 수행할 수 있다. 또는, 현재 예측 단위가 포함된 현재 픽쳐 내에서 기-복원된 일부 영역의 정보를 기초로 인터 예측을 수행할 수도 있다.The prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit discrimination unit receives various information such as prediction unit information input from the entropy decoding unit 210, prediction mode information of an intra prediction method, and motion prediction related information of an inter prediction method, classifies the prediction unit in the current coding unit, and predicts It is possible to determine whether the unit performs inter prediction or intra prediction. The inter prediction unit 230 uses the information necessary for inter prediction of the current prediction unit provided by the image encoder to predict the current based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit. Inter prediction for a unit may be performed. Alternatively, inter-prediction may be performed based on information of some regions pre-restored in the current picture including the current prediction unit.

인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), AMVP 모드(AMVP Mode) 중 어떠한 방법인지 여부를 판단할 수 있다.In order to perform inter prediction, whether a motion prediction method of a prediction unit included in a corresponding coding unit based on a coding unit is one of Skip Mode, Merge Mode, and AMVP Mode I can judge.

인트라 예측부(235)는 현재 픽쳐 내의 화소 정보를 기초로 예측 블록을 생성할 수 있다. 예측 단위가 인트라 예측을 수행한 예측 단위인 경우, 영상 부호화기에서 제공된 예측 단위의 인트라 예측 모드 정보를 기초로 인트라 예측을 수행할 수 있다. 인트라 예측부(235)에는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 부분으로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 결정하여 적용할 수 있다. 영상 부호화기에서 제공된 예측 단위의 예측 모드 및 AIS 필터 정보를 이용하여 현재 블록의 참조 화소에 AIS 필터링을 수행할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.The intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit performing intra prediction, intra prediction may be performed based on intra prediction mode information of a prediction unit provided by an image encoder. The intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixel of the current block and can be applied by determining whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering may be performed on a reference pixel of a current block by using prediction mode and AIS filter information of a prediction unit provided by an image encoder. When the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

참조 화소 보간부는 예측 단위의 예측 모드가 참조 화소를 보간한 화소값을 기초로 인트라 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 정수값 이하의 화소 단위의 참조 화소를 생성할 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.When the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on a pixel value obtained by interpolating a reference pixel, the reference pixel interpolation unit may interpolate the reference pixel to generate a pixel reference pixel in an integer value or less. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating a reference pixel, the reference pixel may not be interpolated. The DC filter may generate a prediction block through filtering when the prediction mode of the current block is the DC mode.

복원된 블록 또는 픽쳐는 필터부(240)로 제공될 수 있다. 필터부(240)는 디블록킹 필터, 오프셋 보정부, ALF를 포함할 수 있다.The reconstructed block or picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.

영상 부호화기로부터 해당 블록 또는 픽쳐에 디블록킹 필터를 적용하였는지 여부에 대한 정보 및 디블록킹 필터를 적용하였을 경우, 강한 필터를 적용하였는지 또는 약한 필터를 적용하였는지에 대한 정보를 제공받을 수 있다. 영상 복호화기의 디블록킹 필터에서는 영상 부호화기에서 제공된 디블록킹 필터 관련 정보를 제공받고 영상 복호화기에서 해당 블록에 대한 디블록킹 필터링을 수행할 수 있다. Information about whether a deblocking filter is applied to a corresponding block or picture and information about whether a strong filter is applied or a weak filter is applied may be provided from a video encoder. In the deblocking filter of the video decoder, information related to the deblocking filter provided by the video encoder may be provided, and the video decoder may perform deblocking filtering on the corresponding block.

오프셋 보정부는 부호화시 영상에 적용된 오프셋 보정의 종류 및 오프셋 값 정보 등을 기초로 복원된 영상에 오프셋 보정을 수행할 수 있다.The offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction and offset value information applied to the image during encoding.

ALF는 부호화기로부터 제공된 ALF 적용 여부 정보, ALF 계수 정보 등을 기초로 부호화 단위에 적용될 수 있다. 이러한 ALF 정보는 특정한 파라메터 셋에 포함되어 제공될 수 있다.ALF may be applied to a coding unit based on ALF application information provided by an encoder, ALF coefficient information, and the like. Such ALF information may be provided by being included in a specific parameter set.

메모리(245)는 복원된 픽쳐 또는 블록을 저장하여 참조 픽쳐 또는 참조 블록으로 사용할 수 있도록 할 수 있고 또한 복원된 픽쳐를 출력부로 제공할 수 있다.The memory 245 may store the restored picture or block so that it can be used as a reference picture or a reference block, and may also provide the restored picture to an output unit.

부호화 블록은 적어도 하나 이상의 블록으로 분할될 수 있다. 구체적으로, 이때, 부호화 블록은, 쿼드 트리 분할 또는 이진 트리 분할(또는 듀얼 트리 분할) 등에 기초하여, 최대 크기 부호화 블록부터 최소 크기 부호화 블록까지 분할될 수 있다. 최대 크기 부호화 블록 및 최소 크기 부호화 블록에 대한 정보 또는, 최대 크기 부호화 블록 및 최소 크기 부호화 블록간의 차분값 등에 대한 정보는 비트스트림을 통해 복호화 장치로 시그널링될 수 있다.The coding block may be divided into at least one block. Specifically, at this time, the coding block may be divided from a maximum size coding block to a minimum size coding block based on quad tree splitting or binary tree splitting (or dual tree splitting). Information on a maximum sized coding block and a minimum sized coding block, or information on a difference value between a maximum sized coding block and a minimum sized coding block, may be signaled to a decoding apparatus through a bitstream.

쿼드 트리(Quad Tree, QT) 분할은, 부호화 블록을 네개의 블록으로 분할하는 방법이다. QT 분할에 의해, 부호화 블록은 가로 및 세로 길이가 1/2로 감소한 네개의 블록으로 분할될 수 있다. QT 분할이 가능한 부호화 블록의 최대 크기 또는 최소 크기, QT 분할 회수(또는 최대 분할 깊이), 최소 크기 블록의 분할 깊이, QT 분할이 가능한 최대 크기 부호화 블록으로부터 분할 가능한 깊이 또는 현재 부호화 블록에서 분할 가능한 깊이 등은 상위 헤더를 통해 시그널링될 수 있다. 여기서, 상위 헤더는, 슬라이스 계층, 픽쳐 계층, 시퀀스 계층 또는 비디오 계층 등을 포함할 수 있다.Quad tree (QT) splitting is a method of dividing a coded block into four blocks. By QT splitting, the coding block can be divided into four blocks whose horizontal and vertical lengths are reduced by 1/2. Maximum or minimum size of QT splittable coding block, number of times of QT splitting (or maximum splitting depth), splitting depth of minimum sized block, depth splittable from maximum sized codingable block capable of QT splitting, or depth splittable in current coding block The back may be signaled through the upper header. Here, the upper header may include a slice layer, a picture layer, a sequence layer, or a video layer.

이진 트리(Binary Tree, BT) 분할은, 부호화 블록을 두개의 블록으로 분할하는 방법이다. BT 분할에 의해, 부호화 블록은 가로 또는 세로 방향으로 두개의 블록으로 분할될 수 있다. 일 예로, 부호화 블록은, BT 분할에 의해, 가로 또는 세로 길이가 1/2 로 감소한 두개의 블록 또는, 가로 또는 세로 길이가 각각, 3/4, 1/4로 감소한 두개의 블록으로 분할될 수 있다. 이처럼, BT 분할은, 1/N (N≥2) 의 정밀도로, 부호화 블록을 분할하는 방식을 의미할 수 있다. BT 분할이 가능한 부호화 블록의 최대 크기 또는 최소 크기, BT 분할 회수(또는 최대 분할 깊이), 최소 크기 블록의 분할 깊이, BT 분할이 가능한 최대 크기 부호화 블록으로부터 분할 가능한 깊이, 현재 부호화 블록에서 분할 가능한 깊이 또는 분할 정밀도 등은 상위 헤더를 통해 시그널링될 수 있다.Binary tree (BT) splitting is a method of dividing a coded block into two blocks. By BT division, the coding block can be divided into two blocks in the horizontal or vertical direction. For example, the coding block may be divided into two blocks in which the horizontal or vertical length is reduced to 1/2 or two blocks in which the horizontal or vertical length is reduced to 3/4 and 1/4, respectively, by BT division. have. As described above, BT division may mean a method of dividing an encoding block with a precision of 1 / N (N≥2). The maximum or minimum size of the BT-encoded coding block, the number of BT divisions (or the maximum division depth), the division depth of the minimum-sized block, the depth that can be divided from the maximum-sized encoding block capable of BT division, and the depth that can be split in the current encoding block Or, the division precision and the like may be signaled through the upper header.

이하, 도면을 참조하여, QT 분할 및 BT 분할에 대해 상세히 살펴보기로 한다.Hereinafter, the QT segmentation and the BT segmentation will be described in detail with reference to the drawings.

도 6은 부호화 블록에 대한 QT 분할 정보를 부호화하는 방법을 나타낸 도면이다. 본 실시예에서, '현재' 부호화 블록은, 특정 시점에서의 부호화 대상 블록을 나타낸다. 일 예로, 현재 부호화 블록은, 현재 부호화가 진행되는 분할 깊이를 갖는 블록을 의미할 수 있다. 일 예로, 부호화를 위해, 부호화 블록이 입력되면, 최초, 입력된 부호화 블록이 '현재 부호화 블록'으로 취급될 수 있다. 이후, 상기 부호화 블록이 분할됨에 따라, 분할된 블록에 대한 부호화가 진행되면, 분할된 블록이 '현재 부호화 블록'으로 취급될 수 있다.6 is a diagram illustrating a method of encoding QT split information for an encoding block. In this embodiment, the 'current' coding block indicates a block to be coded at a specific time point. For example, the current coding block may mean a block having a split depth in which current coding is performed. For example, when an encoding block is input for encoding, the first, input encoding block may be treated as a 'current encoding block'. Subsequently, as the coding block is split, if coding for the split block is performed, the split block may be treated as a 'current coding block'.

부호화 블록이 입력되면, 입력된 부호화 블록을 '현재 부호화 블록'이라 취급할 수 있다(S601). 최초 입력되는 부호화 블록은, 부호화하고자 하는 최상위 분할 깊이를 갖는 부호화 블록(즉, 깊이가 0인 부호화 블록)을 의미할 수 있다. When an encoding block is input, the input encoding block may be treated as a 'current encoding block' (S601). The first input encoding block may mean an encoding block having a highest split depth to be encoded (ie, an encoding block having a depth of 0).

부호화 장치는, 현재 부호화 블록에 대한 QT 분할 정보를 부호화할 수 있다(S602). 여기서, QT 분할 정보는, 현재 부호화 블록에 대해 QT 분할이 진행되었는지 여부를 나타낸다. 현재 부호화 블록이 QT 분할된 경우, QT 분할 정보는 '참'으로 설정될 수 있고, 현재 부호화 블록이 QT 분할되지 않은 경우, QT 분할 정보는 '거짓'으로 설정될 수 있다.The encoding device may encode QT split information for the current coding block (S602). Here, the QT segmentation information indicates whether QT segmentation has been performed for the current coding block. If the current coding block is QT split, the QT split information may be set to 'True', and if the current coding block is not QT split, the QT split information may be set to 'False'.

현재 부호화 블록이 QT 분할되지 않는 것으로 판단되는 경우(S603), 현재 부호화 블록에 대한 QT 분할 과정은 종료된다. 반면, 현재 부호화 블록이 QT 분할되는 것으로 판단되는 경우(S603), QT 분할을 통해 현재 부호화 블록에 포함된 4개의 부분 블록(또는 서브 블록)을 생성할 수 있다(S604). If it is determined that the current coding block is not QT-divided (S603), the QT splitting process for the current coding block is ended. On the other hand, if it is determined that the current coding block is QT split (S603), four partial blocks (or subblocks) included in the current coding block may be generated through QT splitting (S604).

현재 부호화 블록이 4개의 부분 블록으로 분할된 경우, 부호화 순서에 따라, 현재 부호화 블록에 포함된 부분 블록 중 어느 하나를 현재 부분 블록으로 설정하고, 현재 부분 블록의 QT 분할 정보를 부호화할 수 있다(S605). 여기서, 부분 블록 간의 부호화 순서는 래스터 스캔(Raster scan) 또는 Z 스캔 등을 따를 수도 있고, 기 정의된 순서를 따를 수도 있다. 즉, 부분 블록들의 부호화 순서에 따라, 부분 블록들의 QT 분할 정보가 순차적으로 부호화될 수 있다. When the current coding block is divided into four sub-blocks, according to an encoding order, one of the sub-blocks included in the current coding block may be set as the current sub-block, and QT split information of the current sub-block may be encoded ( S605). Here, the encoding order between the partial blocks may follow a raster scan or a Z scan, or may follow a predefined order. That is, according to the coding order of the partial blocks, QT split information of the partial blocks may be sequentially encoded.

현재 부분 블록이 QT 분할되는 않는 것으로 판단되는 경우(S606), 현재 부분 블록이, 현재 부호화 블록 및 입력 부호화 블록 내 마지막 블록인지 여부에 따라(S607, S608), QT 분할 과정이 종료될 수 있다. 일 예로, 현재 부분 블록이 QT 분할되지 않고, 현재 부분 블록이 현재 부호화 블록 및 입력 부호화 블록 내 마지막 블록인 경우, QT 분할 과정이 종료될 수 있다. 반면, 현재 부분 블록이 현재 부호화 블록의 마지막 부분 블록이 아니거나, 현재 부호화 블록이 현재 부호화 블록의 마지막 부분 블록이지만, 입력 부호화 블록 내 마지막 부분 블록은 아닌 경우, 스캔 순서 상 다음 부분 블록을 현재 부분 블록으로 삼아 QT 분할 정보 부호화 과정을 수행할 수 있다(S609).If it is determined that the current partial block is not QT-divided (S606), the QT splitting process may be terminated according to whether the current partial block is the last block in the current coding block and the input coding block (S607, S608). For example, if the current partial block is not QT split and the current partial block is the last block in the current coding block and the input coding block, the QT splitting process may end. On the other hand, if the current partial block is not the last partial block of the current coding block, or if the current coding block is the last partial block of the current coding block, but is not the last partial block in the input coding block, the next partial block in the scan order is the current part. As a block, a QT split information encoding process may be performed (S609).

반면, 현재 부분 블록이 QT 분할되는 것으로 판단되는 경우(S606), 현재 부분 블록을 현재 부호화 블록으로 설정하고(S610), 새롭게 설정된 현재 부호화 블록을 4개의 부분 블록으로 분할할 수 있다(S604). 새롭게 설정된 현재 부호화 블록이 4개의 부분 블록으로 분할되면, 새롭게 생성된 4개의 부분 블록에 대한 QT 분할 정보 부호화 과정이 반복적으로 수행될 수 있다(S605~S610).On the other hand, if it is determined that the current partial block is QT divided (S606), the current partial block may be set as the current coding block (S610), and the newly set current coding block may be divided into four partial blocks (S604). When the newly set current coding block is divided into four partial blocks, a QT split information encoding process for the four newly generated partial blocks may be repeatedly performed (S605 to S610).

부호화 장치는 현재 부호화 블록의 분할 결과를 기초로, 상위 헤더를 통해, QT 분할이 가능한 부호화 블록의 최대 크기 및 QT 분할이 가능한 부호화 블록의 깊이 등을 부호화할 수 있다. Based on the split result of the current coding block, the encoding apparatus may encode, through an upper header, a maximum size of a coding block capable of QT splitting and a depth of a coding block capable of QT splitting.

현재 부호화 블록의 분할 결과는, 다음 부호화 블록에 대한, QT 분할이 가능한 부호화 블록의 최대 크기 및 QT 분할이 가능한 부호화 블록의 깊이 등을 결정하는데 이용될 수도 있다. The split result of the current coding block may be used to determine a maximum size of a coding block capable of QT splitting and a depth of a coding block capable of QT splitting, for the next coding block.

도 7은 부호화 블록에 대한 BT 분할 정보를 부호화하는 방법을 나타낸 도면이다. 7 is a diagram illustrating a method of encoding BT segmentation information for an encoding block.

부호화 블록이 입력되면, 입력된 부호화 블록을 현재 부호화 블록이라 취급할 수 있다(S701). 최초 입력되는 부호화 블록은, 부호화하고자 하는 최상위 분할 깊이를 갖는 부호화 블록(즉, 깊이가 0인 부호화 블록)을 의미할 수 있다. When an encoding block is input, the input encoding block may be treated as a current encoding block (S701). The first input encoding block may mean an encoding block having a highest split depth to be encoded (ie, an encoding block having a depth of 0).

부호화 장치는, 현재 부호화 블록에 대한 BT 분할 정보를 부호화할 수 있다(S702). 여기서, BT 분할 정보는, 현재 부호화 블록에 대해 BT 분할이 진행되었는지 여부를 나타낸다. 현재 부호화 블록이 BT 분할된 경우, BT 분할 정보는 '참'으로 설정될 수 있고, 현재 부호화 블록이 BT 분할되지 않은 경우, BT 분할 정보는 '거짓'으로 설정될 수 있다.The encoding apparatus may encode BT splitting information for the current coding block (S702). Here, the BT splitting information indicates whether BT splitting has been performed on the current coding block. If the current coding block is BT split, the BT split information may be set to 'true', and if the current coding block is not BT split, the BT split information may be set to 'false'.

현재 부호화 블록이 2개의 부분 블록으로 분할되는 경우, 부호화 장치는 분할 패턴에 관한 정보를 더 부호화할 수 있다. 일 예로, 분할 패턴에 관한 정보는, 분할 방향 또는 정밀도에 대한 정보 중 적어도 하나를 더 포함할 수도 있다. 여기서, 분할 방향은, 현재 부호화 블록이 가로 방향 또는 세로 방향으로 분할되는지 여부를 나타낸다. 또한, 현재 블록의 정밀도는, 부분 블록의 크기를 결정하는 요소로 이용될 수 있다. 일 예로, 현재 블록의 정밀도에 따라, 상위 블록 대비 가로 또는 세로 길이가 각각 1/4, 3/4인 2개의 부분 블록 또는 상위 블록 대비 가로 또는 세로 길이가 각각 1/2인 2개의 부분 블록으로 분할될 수 있다.When the current coding block is divided into two sub-blocks, the encoding device may further encode information about the split pattern. For example, the information about the division pattern may further include at least one of information about the division direction or precision. Here, the split direction indicates whether the current coding block is split in the horizontal direction or the vertical direction. In addition, the precision of the current block can be used as an element for determining the size of the partial block. As an example, depending on the precision of the current block, two or more partial blocks having a horizontal or vertical length of 1/4 or 3/4 respectively compared to the upper block or two partial blocks having a horizontal or vertical length of 1/2 compared to the upper block. Can be divided.

다른 예로, 분할 패턴에 대한 정보는, 분할 인덱스를 포함할 수도 있다. 여기서, 분할 인덱스는, 현재 부호화 블록의 분할 형태를 나타낸다. 일 예로, 현재 부호화 블록은, 정밀도에 따라, 상위 블록 대비 가로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 1/2인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 3/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/2인 부분 블록으로 분할되는 경우 및 상위 블록 대비 세로길이가 3/4인 부분 블록으로 분할되는 경우 등을 포함할 수 있다. 이에 따라, 부호화 장치는 현재 복호화 블록의 분할 패턴이 상기 7개의 경우 중 어느 것에 해당하는지를 판단한 뒤, 판단 결과에 따라, 현재 복호화 블록의 분할 패턴에 대응하는 인덱스를 부호화할 수 있다.As another example, the information on the partition pattern may include a partition index. Here, the split index indicates a split form of the current coding block. As an example, if the current coding block is divided into a partial block having a horizontal length of 1/4 compared to an upper block according to precision, when the horizontal block is divided into a partial block having 1/2 of the horizontal length compared to the upper block, the horizontal compared to the upper block When the length is divided into 3/4 partial blocks, when compared to the upper block, when the length is divided into 1/4 partial blocks, when compared to the upper block, when the length is divided into 1/2 partial block and compared to the upper block It may include a case where the length is divided into 3/4 partial blocks. Accordingly, the encoding apparatus may determine which of the seven cases the split pattern of the current decoding block corresponds to, and then encode an index corresponding to the split pattern of the current decoding block according to the determination result.

현재 부호화 블록이 BT 분할되지 않는 것으로 판단되는 경우(S703), 현재 부호화 블록에 대한 BT 분할 과정은 종료된다. 반면, 현재 부호화 블록이 BT 분할되는 것으로 판단되는 경우(S703), BT 분할을 통해 현재 부호화 블록에 포함된 2개의 부분 블록(또는 서브 블록)을 생성할 수 있다(S704). If it is determined that the current coding block is not BT-divided (S703), the BT splitting process for the current coding block is ended. On the other hand, if it is determined that the current coding block is BT split (S703), two partial blocks (or subblocks) included in the current coding block may be generated through BT splitting (S704).

현재 부호화 블록이 2개의 부분 블록으로 분할된 경우, 부호화 순서에 따라, 현재 부호화 블록에 포함된 부분 블록 중 어느 하나를 현재 부분 블록으로 설정하고, 현재 부분 블록의 BT 분할 정보를 부호화할 수 있다(S705). 여기서, 부분 블록 간의 부호화 순서는 래스터 스캔(Raster scan) 또는 Z 스캔 등을 따를 수도 있고, 기 정의된 순서를 따를 수도 있다. 즉, 부분 블록들의 부호화 순서에 따라, 부분 블록들의 BT 분할 정보가 순차적으로 부호화될 수 있다. When the current coding block is divided into two sub-blocks, according to an encoding order, one of the sub-blocks included in the current coding block may be set as the current sub-block, and BT split information of the current sub-block may be encoded ( S705). Here, the encoding order between the partial blocks may follow a raster scan or a Z scan, or may follow a predefined order. That is, according to the coding order of the partial blocks, the BT splitting information of the partial blocks may be sequentially encoded.

현재 부분 블록이 BT 분할되는 않는 것으로 판단되는 경우(S706), 현재 부분 블록이, 현재 부호화 블록 및 입력 부호화 블록 내 마지막 블록인지 여부에 따라(S707, S708), BT 분할 과정이 종료될 수 있다. 일 예로, 현재 부분 블록이 BT 분할되지 않고, 현재 부분 블록이 현재 부호화 블록 및 입력 부호화 블록 내 마지막 블록인 경우, BT 분할 과정이 종료될 수 있다. 반면, 현재 부분 블록이 현재 부호화 블록의 마지막 부분 블록이 아니거나, 현재 부호화 블록이 현재 부호화 블록의 마지막 부분 블록이지만, 입력 부호화 블록 내 마지막 부분 블록은 아닌 경우, 스캔 순서 상 다음 부분 블록을 현재 부분 블록으로 삼아 BT 분할 정보 부호화 과정을 수행할 수 있다(S709).If it is determined that the current partial block is not BT-divided (S706), the BT splitting process may be terminated according to whether the current partial block is the last block in the current coding block and the input coding block (S707, S708). For example, if the current partial block is not BT-divided and the current partial block is the last block in the current coding block and the input coding block, the BT splitting process may be terminated. On the other hand, if the current partial block is not the last partial block of the current coding block, or if the current coding block is the last partial block of the current coding block, but is not the last partial block in the input coding block, the next partial block in the scan order is the current part. As a block, a BT split information encoding process may be performed (S709).

반면, 현재 부분 블록이 BT 분할되는 것으로 판단되는 경우(S706), 현재 부분 블록을 현재 부호화 블록으로 설정하고(S710), 새롭게 설정된 현재 부호화 블록을 2개의 부분 블록으로 분할할 수 있다(S704). 새롭게 설정된 현재 부호화 블록이 2개의 부분 블록으로 분할되면, 새롭게 생성된 2개의 부분 블록에 대한 BT 분할 정보 부호화 과정이 반복적으로 수행될 수 있다(S705~S710).On the other hand, if it is determined that the current partial block is BT divided (S706), the current partial block may be set as the current coding block (S710), and the newly set current coding block may be divided into two partial blocks (S704). When the newly set current coding block is divided into two sub-blocks, the BT split information encoding process for the two newly generated sub-blocks may be repeatedly performed (S705 to S710).

부호화 장치는 현재 부호화 블록의 분할 결과를 기초로, 상위 헤더를 통해, BT 분할이 가능한 부호화 블록의 최대 크기, BT 분할이 가능한 부호화 블록의 깊이 및 분할 정밀도 등을 부호화할 수 있다.Based on the split result of the current coding block, the encoding apparatus may encode a maximum size of a coding block capable of BT splitting, a depth and a splitting accuracy of a coding block capable of BT splitting, through an upper header.

현재 부호화 블록의 분할 결과는, 다음 부호화 블록에 대한, BT 분할이 가능한 부호화 블록의 최대 크기, BT 분할이 가능한 부호화 블록의 깊이 및 분할 정밀도 등을 결정하는데 이용될 수도 있다. The split result of the current coding block may be used to determine a maximum size of a coding block capable of BT splitting, a depth and a splitting precision of a coding block capable of BT splitting, for the next coding block.

도 8은 복호화 블록에 대한 QT 분할 정보를 복호화하는 방법을 나타낸 도면이다. 본 실시예에서, '현재' 복호화 블록은, 특정 시점에서의 복호화 대상 블록을 나타낸다. 일 예로, 현재 복호화 블록은, 현재 복호화가 진행되는 분할 깊이를 갖는 블록을 의미할 수 있다. 일 예로, 복호화를 위해, 복호화 블록이 입력되면, 최초, 입력된 복호화 블록이 '현재 복호화 블록'으로 취급될 수 있다. 이후, 상기 복호화 블록이 분할됨에 따라, 분할된 블록에 대한 복호화가 진행되면, 분할된 블록이 '현재 복호화 블록'으로 취급될 수 있다.8 is a diagram illustrating a method of decoding QT segmentation information for a decoding block. In the present embodiment, the 'current' decoding block indicates a decoding target block at a specific time. For example, the current decoding block may refer to a block having a split depth in which current decoding is performed. For example, when a decoding block is input for decoding, the first, inputted decoding block may be treated as a 'current decoding block'. Thereafter, as the decoding block is divided, if decoding of the divided block is performed, the divided block may be treated as a 'current decoding block'.

복호화 블록이 입력되면, 입력된 복호화 블록을 '현재 복호화 블록'이라 취급할 수 있다(S801). 최초 입력되는 복호화 블록은, 복호화하고자 하는 최상위 분할 깊이를 갖는 복호화 블록(즉, 깊이가 0인 복호화 블록)을 의미할 수 있다. When the decryption block is input, the input decryption block may be treated as a 'current decryption block' (S801). The first input decoding block may mean a decoding block having a highest split depth to be decoded (ie, a decoding block having a depth of 0).

복호화 장치는, 현재 복호화 블록에 대한 QT 분할 정보를 복호화할 수 있다(S802). 여기서, QT 분할 정보는, 현재 복호화 블록에 대해 QT 분할이 진행되었는지 여부를 나타낸다. QT 분할 정보는 '참'인 경우, 현재 복호화 블록은 QT 분할되고, QT 분할 정보가 '거짓'인 경우, 현재 복호화 블록은 QT 분할되지 않을 수 있다.The decoding apparatus may decode the QT segmentation information for the current decoding block (S802). Here, the QT segmentation information indicates whether QT segmentation has been performed for the current decoding block. When the QT split information is 'true', the current decoding block is QT split, and when the QT split information is 'false', the current decoding block may not be QT split.

QT 분할 정보가 거짓인 경우, 즉, 현재 복호화 블록이 QT 분할되지 않는 것으로 판단되는 경우(S803) 현재 복호화 블록에 대한 QT 분할 과정은 종료된다. 반면, QT 분할 정보가 참인 경우, 즉, 현재 복호화 블록이 QT 분할되는 것으로 판단되는 경우(S803), QT 분할을 통해 현재 복호화 블록에 포함된 4개의 부분 블록(또는 서브 블록)을 생성할 수 있다(S804). When the QT split information is false, that is, when it is determined that the current decoding block is not QT split (S803), the QT splitting process for the current decoding block ends. On the other hand, when the QT split information is true, that is, when it is determined that the current decoding block is QT split (S803), four partial blocks (or sub blocks) included in the current decoding block may be generated through the QT split. (S804).

현재 복호화 블록이 4개의 부분 블록으로 분할된 경우, 복호화 순서에 따라, 현재 복호화 블록에 포함된 부분 블록 중 어느 하나를 현재 부분 블록으로 설정하고, 현재 부분 블록의 QT 분할 정보를 복호화할 수 있다(S805). 여기서, 부분 블록 간의 복호화 순서는 래스터 스캔(Raster scan) 또는 Z 스캔 등을 따를 수도 있고, 기 정의된 순서를 따를 수도 있다. 즉, 부분 블록들의 복호화 순서에 따라, 부분 블록들의 QT 분할 정보가 순차적으로 복호화될 수 있다. When the current decoding block is divided into four partial blocks, according to a decoding order, any one of the partial blocks included in the current decoding block may be set as the current partial block, and QT split information of the current partial block may be decoded ( S805). Here, the decoding order between partial blocks may follow a raster scan or a Z scan, or may follow a predefined order. That is, according to the decoding order of the partial blocks, QT split information of the partial blocks may be sequentially decoded.

현재 부분 블록의 QT 분할 정보가 거짓인 경우, 즉, 현재 부분 블록이 QT 분할되는 않는 것으로 판단되는 경우(S806), 현재 부분 블록이, 현재 복호화 블록 및 입력 복호화 블록 내 마지막 블록인지 여부에 따라(S807, S808), QT 분할 과정이 종료될 수 있다. 일 예로, 현재 부분 블록이 QT 분할되지 않고, 현재 부분 블록이 현재 복호화 블록 및 입력 복호화 블록 내 마지막 블록인 경우, QT 분할 과정이 종료될 수 있다. 반면, 현재 부분 블록이 현재 복호화 블록의 마지막 부분 블록이 아니거나, 현재 복호화 블록이 현재 복호화 블록의 마지막 부분 블록이지만, 입력 복호화 블록 내 마지막 부분 블록은 아닌 경우, 스캔 순서 상 다음 부분 블록을 현재 부분 블록으로 삼아 QT 분할 정보 복호화 과정을 수행할 수 있다(S809).When the QT split information of the current partial block is false, that is, when it is determined that the current partial block is not QT split (S806), depending on whether the current partial block is the last block in the current decoding block and the input decoding block ( S807, S808), the QT splitting process may be ended. For example, if the current partial block is not QT split and the current partial block is the last block in the current decoding block and the input decoding block, the QT splitting process may end. On the other hand, if the current partial block is not the last partial block of the current decoding block, or if the current decoding block is the last partial block of the current decoding block, but not the last partial block in the input decoding block, the next partial block in the scan order is the current portion. As a block, a QT split information decoding process may be performed (S809).

반면, 현재 부분 블록의 QT 분할 정보가 참인 경우, 즉, 현재 부분 블록이 QT 분할되는 것으로 판단되는 경우(S806), 현재 부분 블록을 현재 복호화 블록으로 설정하고(S810), 새롭게 설정된 현재 복호화 블록을 4개의 부분 블록으로 분할할 수 있다(S804). 새롭게 설정된 현재 복호화 블록이 4개의 부분 블록으로 분할되면, 새롭게 생성된 4개의 부분 블록에 대한 QT 분할 정보 복호화 과정이 반복적으로 수행될 수 있다(S805~S810).On the other hand, when the QT split information of the current partial block is true, that is, when it is determined that the current partial block is QT split (S806), the current partial block is set as the current decoding block (S810), and the newly set current decoding block is set. It can be divided into four partial blocks (S804). When the newly set current decoding block is divided into four partial blocks, the QT split information decoding process for the four newly generated partial blocks may be repeatedly performed (S805 to S810).

상술한 실시예에서, 현재 복호화 블록의 크기가, 상위 헤더로부터 시그널링되는 QT 분할이 가능한 최대 블록 크기와 같거나 작은 경우, 또는 현재 복호화 블록의 깊이가, 상위 헤더로부터 시그널링되는 QT 분할이 가능한 최대 블록 깊이와 같거나 큰 경우, 현재 복호화 블록에 대한 분할 정보를 복호화하는 것을 생략하고, 현재 복호화 블록에 대해 더 이상 QT 분할을 진행하지 않을 수 있다. In the above-described embodiment, when the size of the current decoding block is equal to or smaller than the maximum block size capable of QT segmentation signaled from the upper header, or the depth of the current decoding block, the maximum block capable of QT segmentation signaled from the upper header If it is equal to or greater than the depth, decoding of split information for the current decoding block may be omitted, and QT splitting may not be performed for the current decoding block any more.

도 9는 복호화 블록에 대한 BT 분할 정보를 복호화하는 방법을 나타낸 도면이다. 9 is a diagram illustrating a method of decoding BT segmentation information for a decoding block.

복호화 블록이 입력되면, 입력된 복호화 블록을 현재 복호화 블록이라 취급할 수 있다(S901). 최초 입력되는 복호화 블록은, 복호화하고자 하는 최상위 분할 깊이를 갖는 복호화 블록(즉, 깊이가 0인 복호화 블록)을 의미할 수 있다. When a decoding block is input, the input decoding block may be treated as a current decoding block (S901). The first input decoding block may mean a decoding block having a highest split depth to be decoded (ie, a decoding block having a depth of 0).

복호화 장치는, 현재 복호화 블록에 대한 BT 분할 정보를 복호화할 수 있다(S902). 여기서, BT 분할 정보는, 현재 복호화 블록에 대해 BT 분할이 진행되었는지 여부를 나타낸다. BT 분할 정보가 '참'인 경우, 현재 복호화 블록은 BT 분할되고, BT 분할 정보가 '거짓'인 경우, 현재 복호화 블록은 BT 분할되지 않을 수 있다.The decoding apparatus may decode BT segmentation information for the current decoding block (S902). Here, the BT splitting information indicates whether BT splitting has been performed on the current decoding block. When the BT split information is 'true', the current decoding block is BT split, and when the BT split information is 'false', the current decoding block may not be BT split.

BT 분할 정보가 참인 경우, 즉, 현재 복호화 블록이 BT 분할되는 경우, 복호화 장치는 분할 패턴에 관한 정보를 더 복호화할 수 있다. 일 예로, 분할 패턴에 관한 정보는, 분할 방향 또는 정밀도에 대한 정보 중 적어도 하나를 더 포함할 수도 있다. 현재 복호화 블록은, 분할 방향에 따라, 가로 방향의 경계선을 기준으로 2개의 부분 블록으로 분할되거나, 세로 방향의 경계선을 기준으로 2개의 부분 블록으로 분할될 수 있다. 또한, 현재 복호화 블록은, 현재 블록의 정밀도에 따라, 상위 블록 대비 가로 또는 세로 길이가 각각 1/4, 3/4인 2개의 부분 블록 또는 상위 블록 대비 가로 또는 세로 길이가 각각 1/2인 2개의 부분 블록으로 분할될 수 있다.When the BT split information is true, that is, when the current decoding block is BT split, the decoding apparatus may further decode information related to the split pattern. For example, the information about the division pattern may further include at least one of information about the division direction or precision. The current decoding block may be divided into two sub-blocks based on a horizontal boundary line or two sub-blocks based on a vertical boundary line, according to a division direction. In addition, according to the precision of the current block, the current decoding block has two partial blocks each having a horizontal or vertical length of 1/4 or 3/4 compared to the upper block, or 2 each having a horizontal or vertical length of 1/2 compared to the upper block. It can be divided into four sub-blocks.

다른 예로, 분할 패턴에 대한 정보는, 분할 인덱스를 포함할 수도 있다. 여기서, 분할 인덱스는, 현재 복호화 블록의 분할 형태를 나타낸다. 일 예로, 현재 복호화 블록은, 정밀도에 따라, 상위 블록 대비 가로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 1/2인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 3/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/2인 부분 블록으로 분할되는 경우 및 상위 블록 대비 세로길이가 3/4인 부분 블록으로 분할되는 경우 등을 포함할 수 있다. 이에 따라, 복호화 장치는 상기 7개의 경우 중 어느 하나를 나타내는 인덱스 정보를 복호화하여, 현재 복호화 블록에 대한 분할 패턴(형태)를 결정할 수도 있다. As another example, the information on the partition pattern may include a partition index. Here, the split index indicates a split form of the current decoding block. For example, when the current decoding block is divided into a partial block having a horizontal length of 1/4 compared to an upper block according to precision, when the horizontal decoding block is divided into a partial block having 1/2 of the horizontal length compared to the upper block, the horizontal compared to the upper block. When the length is divided into 3/4 partial blocks, when compared to the upper block, when the length is divided into 1/4 partial blocks, when compared to the upper block, when the length is divided into 1/2 partial block and compared to the upper block It may include a case where the length is divided into 3/4 partial blocks. Accordingly, the decoding apparatus may decode index information indicating any one of the seven cases and determine a split pattern (form) for the current decoding block.

BT 분할 정보가 거짓인 경우, 즉, 현재 복호화 블록이 BT 분할되지 않는 것으로 판단되는 경우(S903), 현재 복호화 블록에 대한 BT 분할 과정은 종료된다. 반면, BT 분할 정보가 참인 경우, 즉, 현재 복호화 블록이 BT 분할되는 것으로 판단되는 경우(S903), BT 분할을 통해 현재 복호화 블록에 포함된 2개의 부분 블록(또는 서브 블록)을 생성할 수 있다(S904). When the BT splitting information is false, that is, when it is determined that the current decoding block is not BT-segmented (S903), the BT splitting process for the current decoding block is ended. On the other hand, when the BT partitioning information is true, that is, when it is determined that the current decoding block is BT-segmented (S903), two partial blocks (or sub-blocks) included in the current decoding block may be generated through BT partitioning. (S904).

현재 복호화 블록이 2개의 부분 블록으로 분할된 경우, 복호화 순서에 따라, 현재 복호화 블록에 포함된 부분 블록 중 어느 하나를 현재 부분 블록으로 설정하고, 현재 부분 블록의 BT 분할 정보를 복호화할 수 있다(S905). 여기서, 부분 블록 간의 복호화 순서는 래스터 스캔(Raster scan) 또는 Z 스캔 등을 따를 수도 있고, 기 정의된 순서를 따를 수도 있다. 즉, 부분 블록들의 복호화 순서에 따라, 부분 블록들의 BT 분할 정보가 순차적으로 복호화될 수 있다. When the current decoding block is divided into two sub-blocks, according to decoding order, one of the sub-blocks included in the current decoding block may be set as the current sub-block, and BT segmentation information of the current sub-block may be decoded ( S905). Here, the decoding order between partial blocks may follow a raster scan or a Z scan, or may follow a predefined order. That is, according to the decoding order of the partial blocks, BT split information of the partial blocks may be sequentially decoded.

현재 부분 블록이 BT 분할되는 않는 것으로 판단되는 경우(S906), 현재 부분 블록이, 현재 복호화 블록 및 입력 복호화 블록 내 마지막 블록인지 여부에 따라(S907, S708), BT 분할 과정이 종료될 수 있다. 일 예로, 현재 부분 블록이 BT 분할되지 않고, 현재 부분 블록이 현재 복호화 블록 및 입력 부보화 블록 내 마지막 블록인 경우, BT 분할 과정이 종료될 수 있다. 반면, 현재 부분 블록이 현재 복호화 블록의 마지막 부분 블록이 아니거나, 현재 복호화 블록이 현재 복호화 블록의 마지막 부분 블록이지만, 입력 복호화 블록 내 마지막 부분 블록은 아닌 경우, 스캔 순서 상 다음 부분 블록을 현재 부분 블록으로 삼아 BT 분할 정보 복호화 과정을 수행할 수 있다(S909).If it is determined that the current partial block is not BT divided (S906), the BT partitioning process may be terminated according to whether the current partial block is the last block in the current decoding block and the input decoding block (S907, S708). For example, if the current partial block is not BT-divided and the current partial block is the last block in the current decoding block and the input sub-block, the BT dividing process may be terminated. On the other hand, if the current partial block is not the last partial block of the current decoding block, or if the current decoding block is the last partial block of the current decoding block, but not the last partial block in the input decoding block, the next partial block in the scan order is the current portion. As a block, a BT segmentation information decoding process may be performed (S909).

반면, 현재 부분 블록이 BT 분할되는 것으로 판단되는 경우(S906), 현재 부분 블록을 현재 복호화 블록으로 설정하고(S910), 새롭게 설정된 현재 복호화 블록을 2개의 부분 블록으로 분할할 수 있다(S904). 새롭게 설정된 현재 복호화 블록이 2개의 부분 블록으로 분할되면, 새롭게 생성된 2개의 부분 블록에 대한 BT 분할 정보 복호화 과정이 반복적으로 수행될 수 있다(S905~S910).On the other hand, if it is determined that the current partial block is BT divided (S906), the current partial block may be set as the current decoding block (S910), and the newly set current decoding block may be divided into two partial blocks (S904). When the newly set current decoding block is divided into two sub-blocks, the BT partition information decoding process for the two newly generated sub-blocks may be repeatedly performed (S905 to S910).

상술한 실시예에서, 현재 복호화 블록의 크기가, 상위 헤더로부터 시그널링되는 BT 분할이 가능한 최대 블록 크기와 같거나 작은 경우, 또는 현재 복호화 블록의 깊이가, 상위 헤더로부터 시그널링되는 BT 분할이 가능한 최대 블록 깊이와 같거나 큰 경우, 현재 복호화 블록에 대한 분할 정보를 복호화하는 것을 생략하고, 현재 복호화 블록에 대해 더 이상 BT 분할을 진행하지 않을 수 있다.In the above-described embodiment, when the size of the current decoding block is equal to or smaller than the maximum block size capable of BT division signaled from the upper header, or the depth of the current decoding block is the maximum block capable of BT division signaled from the upper header. If it is equal to or greater than the depth, omitting decoding of the split information for the current decoding block may be omitted, and BT splitting may not be performed for the current decoding block.

도 6 내지 도 9에 도시된 예에서는, QT 분할 또는 BT 분할을 이용하여 최대 크기의 부호화/복호화 블록을 재귀적으로 분할하는 방법에 대해 설명하였다. 이때, 부호화/복호화 블록을 복수의 부분 블록으로 분할하는데 있어서, QT 분할 방법 및 BT 분할 방법이 혼용되어 이용되고, 이때, QT 분할 및 BT 분할의 순서는 다양하게 설정될 수 있다. 예를 들어, 부호화 장치는, QT 분할을 이용하여, 최대 부호화 블록을 분할해 나가다가, BT 분할이 최적으로 판단되는 부분 블록이 나올 경우, QT 분할을 종료하고, BT 분할을 통해 부분 블록을 분할해 나갈 수 있다. 또는 BT 분할로 인해 생성된 부분 블록이라 하더라도, QT 분할이 최적이라고 판단되는 경우, 다시 QT 분할을 이용하여 부분 블록을 분할해 나갈 수 있다. 이처럼, 부호화 장치는 각 블록별 최적의 분할 방법을 파악하고, 그에 따라 각 블록별 최적의 분할 방법을 나타내는 정보를 부호화할 수 있다. In the example illustrated in FIGS. 6 to 9, a method of recursively dividing a coding / decoding block having the largest size using QT splitting or BT splitting has been described. At this time, in dividing the coding / decoding block into a plurality of sub-blocks, a QT splitting method and a BT splitting method are used interchangeably, and the order of the QT splitting and BT splitting may be variously set. For example, the coding apparatus divides the largest coding block by using QT splitting, and when a partial block for which BT splitting is optimally found, ends the QT splitting and splits the partial block through BT splitting. I can do it. Alternatively, even if a partial block generated by BT partitioning is determined to be optimal for QT partitioning, the partial block may be further divided using QT partitioning. In this way, the encoding device can grasp the optimal division method for each block, and accordingly encode information indicating the optimal division method for each block.

다른 예로, 복호화 장치는 QT 분할 정보 또는 BT 분할 정보를 복호화하여, 복호화 블록의 최적 분할 상태를 판단한다. 이때, QT 분할 방법 및 BT 분할 방법 중 어느 하나는 다른 하나의 방법을 적용할 수 없을 때에만 적용될 수도 있다. 일 예로, 소정 블록에 대한 BT 분할 정보는, 소정 블록에 대한 QT 분할 정보가 거짓인 경우 또는 소정 블록을 포함하는 상위 블록이 BT 분할된 경우에만 복호화될 수 있다. As another example, the decoding apparatus decodes QT segmentation information or BT segmentation information to determine an optimal segmentation state of the decoding block. At this time, either the QT splitting method or the BT splitting method may be applied only when the other one cannot be applied. For example, the BT splitting information for a given block can be decoded only when the QT splitting information for a given block is false or when an upper block including the given block is BT-split.

블록 분할 정보를 부호화함에 있어서, 부호화 장치는 각 분할 방법이 사용되는지 여부를 나타내는 정보를 상위 헤더를 통해 부호화할 수 있다. 일 예로, 부호화 장치는 상위 헤더를 통해 QT 분할이 사용되는지 여부 또는 BT 분할이 사용되는지 여부 등을 타나내는 정보를 부호화할 수 있다. 일 예로, QT 분할은 사용되나, BT 분할이 사용되지 않는 것으로 판단되는 경우, 부호화 블록은 QT 분할만을 이용하여 분할될 수 있다. 이 경우, 부호화 블록이 BT 분할 되었는지 여부를 나타내는 BT 분할 정보에 대한 부호화는 생략될 수 있을 것이다. 다른 예로, QT 분할 및 BT 분할이 모두 사용되는 것이라 판단되는 경우, QT 및 BT 분할 모드를 이용하여 부호화 블록이 분할될 수 있다. In encoding the block division information, the encoding device may encode information indicating whether each division method is used through an upper header. For example, the encoding device may encode information indicating whether QT splitting is used or whether BT splitting is used through an upper header. For example, QT splitting is used, but when it is determined that BT splitting is not used, the coding block may be split using only QT splitting. In this case, encoding for BT splitting information indicating whether or not the coding block is BT splitted may be omitted. As another example, when it is determined that both the QT split and the BT split are used, the coding block may be split using the QT and BT split modes.

도 10은 부호화 블록 내 분할 상태를 예시한 도면이다. 10 is a diagram illustrating a split state in a coding block.

설명의 편의를 위해, 블록이 BT 분할된 경우, BT 분할에 의해 생성된 부분 블록은 더 이상 BT 블록으로 분할될 수 없는 것으로 가정한다. 도 10에 도시된 예에서, 실선은, QT 분할 방법을 이용하여 분할된 것을 나타내고, 점선은, BT 분할 방법을 이용하여 분할된 것을 나타낸다. 도 10을 참조하면, QT 분할에 의해 상위 블록보다 가로 및 세로 길이가 1/2로 감소한 서브 를록이 생성되고, BT 분할에 의해, 상위 블록보다 가로 또는 세로 길이 중 어느 하나가 1/2로 감소한 서브 블록 또는 상위 블록보다 가로 떠는 세로 길이 중 어느 하나가 1/4로 감소한 서브 블록이 생성되는 것으로 도시되었다. 이에 따라, 도시된 예에서, 부호화 블록의 최대 분할 정밀도는 1/4라 할 수 있다. 각 분할선에 표기된 번호는 분할 순서를 나타낸다.For convenience of description, when a block is BT-divided, it is assumed that a partial block generated by BT dividing can no longer be divided into a BT block. In the example shown in Fig. 10, a solid line indicates division using the QT division method, and a dotted line indicates division using the BT division method. Referring to FIG. 10, sub-locks in which the horizontal and vertical lengths are reduced by 1/2 from the upper block are generated by QT division, and by BT division, either the horizontal or vertical length is reduced by 1/2 from the upper block. It has been shown that a sub-block in which any one of the vertical lengths of the sub-blocks or higher blocks is reduced to 1/4 is generated. Accordingly, in the illustrated example, the maximum division precision of the coding block may be 1/4. The number indicated on each dividing line indicates the dividing order.

도 10을 참조하면, ①번 분할선은, 최초의 입력 부호화 블록에서 QT 분할이 최적임을 나타낸다. ②번 분할선은 ①번 분할선을 통해 분할된 좌상단 부분 블록에서 BT 가로 1/2 분할이 최적 분할임을 나타낸다. ③번 분할선은 ②번 분할선을 통해 분할된 상단 부분 블록에서 BT 세로 1/2 분할이 최적 분할로 결정된 것이다. ④번 분할선은 ②번 분할선을 통해 분할된 하단 부분 블록에서 BT 가로 1/2 분할이 최적 분할임을 나타낸다. ⑤번 분할선은 ①번 분할선을 통해 분할된 우상단 부분 블록에서 BT 세로 1/2 분할이 최적 분할임을 나타낸다. ⑥번 분할선은 ⑤번 분할선을 통해 분할된 좌측 부분 블록에서 BT 세로 1/2 분할이 최적 분할임을 나타낸다. ⑦번 분할선은 ⑤번 분할선을 통해 분할된 우측 부분 블록에서 BT 세로 1/2 분할이 최적 분할임을 나타낸다. ⑧번 분할선은 ①번 분할선을 통해 분할된 좌하단 부분 블록에서 QT 분할이 최적 분할임을 나타낸다. ⑨번 분할선은 ⑧번 분할선을 통해 분할된 좌상단 부분 블록에서 BT 가로 1/2 분할이 최적 분할임을 나타낸다. ⑩번 분할선은 ⑨번 분할선을 통해 분할된 하단 부분 블록에서 BT 3/4 가로 분할이 최적 분할임을 나타낸다. ⑪번 분할선은 ⑧번 분할선을 통해 분할된 좌하단 부분 블록에서 BT 가로 1/4 분할이 최적 분할임을 나타낸다. ⑫번 분할선은 ①번 분할선을 통해 분할된 우하단 부분 블록에서 BT 가로 1/2 분할이 최적 분할임을 나타낸다. ⑬번 분할선은 ⑫번 분할선을 통해 분할된 상단 부분 블록에서 BT 세로 3/4 분할이 최적 분할임을 나타낸다. ⑭번 분할선은 ⑫번 분할선을 통해 분할된 하단 부분 블록에서 BT 세로 1/2 분할이 최적 분할임을 나타낸다. ⑮번 분할선은 ⑭번 분할선을 통해 분할된 우측 부분 블록에서 BT 세로 3/4 분할이 최적 분할임을 나타낸다.Referring to FIG. 10, a dividing line 1 indicates that the QT split is optimal in the first input coding block. The division line ② indicates that the BT horizontal 1/2 division is the optimal division in the upper left partial block divided through the division line ①. As for the division line ③, the BT vertical 1/2 division is determined as the optimal division in the upper part block divided through the division line ②. The division line ④ indicates that the BT horizontal 1/2 division is the optimal division in the lower part block divided through the division line ②. The division line ⑤ indicates that the BT vertical 1/2 division is the optimal division in the upper right partial block divided through the division line ①. The division line ⑥ indicates that the BT vertical 1/2 division is the optimal division in the left part block divided through the division line ⑤. The division line ⑦ indicates that the BT vertical 1/2 division is the optimal division in the right part block divided through the division line ⑤. The division line ⑧ indicates that the QT division is the optimal division in the lower left partial block divided through the division line ①. The division line ⑨ indicates that the BT horizontal 1/2 division is the optimal division in the upper left partial block divided through the division line ⑧. The dividing line ⑩ indicates that the BT 3/4 horizontal dividing is optimal in the lower partial block divided through the dividing line ⑨. The division line ⑪ indicates that the BT horizontal quarter division is the optimal division in the lower left sub-block divided through the division line ⑧. The dividing line ⑫ indicates that the BT horizontal 1/2 dividing is the optimal dividing in the lower right part block divided through dividing line ①. The division line ⑬ indicates that the BT vertical 3/4 division is the optimal division in the upper part block divided through the division line ⑫. The division line ⑭ indicates that the BT vertical 1/2 division is the optimal division in the lower part block divided through the division line ⑫. The division line ⑮ indicates that the BT vertical 3/4 division is the optimal division in the right part block divided through the division line 선.

도 11은 도 10에 도시된 입력 부호화 블록의 최적 분할 상태를 트리 구조를 이용하여 표현한 것이다. FIG. 11 shows an optimal splitting state of the input coding block shown in FIG. 10 using a tree structure.

QT 분할의 경우, QT 분할이 수행되지 않는 경우 및 QT 분할에 따라, 블록이 4개의 부분 블록으로 분할되는 경우(즉, 가로 및 세로를 1/2 분할) 등 2가지 이므로, QT 분할 정보는 0 또는 1로 표현될 수 있다. BT 분할의 경우, BT 분할이 수행되지 않는 경우 및 BT 분할에 따라, 블록이 2개의 부분 블록으로 분할되는 경우를 포함할 수 있다. 이때, 블록이 2개 부분 블록으로 분할되는 경우는, 정밀도에 따라, 상위 블록 대비 가로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 1/2인 부분 블록으로 분할되는 경우, 상위 블록 대비 가로길이가 3/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/4인 부분 블록으로 분할되는 경우, 상위 블록 대비 세로길이가 1/2인 부분 블록으로 분할되는 경우 및 상위 블록 대비 세로길이가 3/4인 부분 블록으로 분할되는 경우 등을 포함할 수 있다. 이에 따라, BT 분할 정보는, 0~6까지의 분할 정보로 표현될 수 있다. In the case of QT partitioning, QT partitioning information is 0 because QT partitioning is not performed, and according to QT partitioning, the block is divided into 4 sub-blocks (that is, horizontally and vertically divided into 1/2). Or it can be expressed as 1. In the case of BT partitioning, a case in which BT partitioning is not performed and a block is divided into two partial blocks according to BT partitioning may be included. In this case, when a block is divided into two partial blocks, according to precision, when a block is divided into a partial block having a horizontal length of 1/4 compared to an upper block, the block is divided into a partial block having a horizontal length of 1/2 compared to the upper block. In case, it is divided into sub-blocks whose horizontal length is 3/4 compared to the upper block, and if it is divided into partial blocks whose vertical length is 1/4 compared to the upper block, it is divided into partial blocks whose vertical length is 1/2 compared to the upper block. And a partial block having a vertical length of 3/4 compared to an upper block. Accordingly, the BT segmentation information can be expressed as segmentation information from 0 to 6.

도 11에서는, 트리 구조에 QT 분할 정보 및 BT 분할 정보를 표기하였다. In FIG. 11, QT segmentation information and BT segmentation information are indicated in a tree structure.

상술한 설명을 기초로, 부호화/복호화 블록 내 인트라 예측 모드의 개수 또는 종류를 제어하고, 이를 부호화/복호화하는 방법에 대해 상세히 살펴보기로 한다.Based on the above description, the number or type of intra prediction modes in the encoding / decoding block is controlled, and a method of encoding / decoding it will be described in detail.

도 12는 부호화 장치에서, 예측 모드의 개수 또는 종류를 제어하는 과정을 나타낸 흐름도이다. 도 12에서는, 각각의 과정이 일련의 흐름으로 연결된 것으로 나타나 있으나, 각 과정이 도시된 순서에 따라 진행되어야 하는 것은 아니다. 일 예로, 예측 블록의 인트라 예측 모드의 개수 또는 종류에 대한 결정 결과에 영향이 없다면, 그 순서가 바뀌어도 무방하다. 일 예로, S1201 단계와 S1202 단계의 순서가 바뀌어도, 인트라 예측 모드의 개수 또는 종류의 변화가 없다면, 이들의 순서가 바뀔 수 있다. 또한, 도 12에 도시된 각 단계 중 일부가 생략될 수도 있다. 일 예로, 예측 블록의 모양과 상관 없이 인트라 예측 모드의 개수 또는 종류의 제어가 가능하다면, S1202 단계는 생략될 수 있다. 12 is a flowchart illustrating a process of controlling the number or type of prediction modes in the encoding device. In FIG. 12, each process is shown as being connected in a series of flows, but each process is not required to be performed in the order shown. As an example, if there is no influence on the determination result of the number or type of intra prediction modes of the prediction block, the order may be changed. For example, even if the order of steps S1201 and S1202 is changed, if there is no change in the number or type of intra prediction modes, their order may be changed. In addition, some of the steps illustrated in FIG. 12 may be omitted. For example, if it is possible to control the number or type of intra prediction modes regardless of the shape of the prediction block, step S1202 may be omitted.

본 실시예에서, 현재 부호화 블록은, 예측 블록 또는 예측 블록을 포함하는 부호화 블록 등을 나타낼 수 있다. 이하, 도 12를 참조하여, 본 발명에 대해 상세히 설명하기로 한다.In the present embodiment, the current coding block may represent a prediction block or a coding block including a prediction block. Hereinafter, the present invention will be described in detail with reference to FIG. 12.

S1201에서는, 현재 부호화 블록의 크기에 따라, 인트라 예측 모드의 개수 또는 종류가 제어될 수 있음이 도시되었다. 이에 대해 상세히 설명하면, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록의 크기에 따라, 가변적으로 결정될 수 있다. 일 예로, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록의 크기가 클수록 증가할 수 있다. 예컨대, 예측 블록의 최소 크기가 4x4 이고, 최대 크기가 256x256 이라 가정할 경우, 현재 부호화 블록의 크기가 4x4 이상, 32x32 이하라면, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 35개로 설정되고, 현재 부호화 블록의 크기가 64x64 이사, 256x256 이하라면, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 67개로 설정될 수 있다.In S1201, it has been shown that the number or type of intra prediction modes can be controlled according to the size of the current coding block. In detail, the number of intra prediction modes that can be used by the current coding block may be variably determined according to the size of the current coding block. For example, the number of intra prediction modes that the current coding block can use may increase as the size of the current coding block increases. For example, assuming that the minimum size of the prediction block is 4x4 and the maximum size is 256x256, if the size of the current coding block is 4x4 or more and 32x32 or less, the number of intra prediction modes available for the current coding block is set to 35, If the size of the current coding block is 64x64 or less and 256x256 or less, the number of intra prediction modes available for the current coding block may be set to 67.

반대로, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록의 크기가 작을수록 증가할 수도 있다. 예컨대, 예측 블록의 최소 크기가 4x4 이고, 최대 크기가 256x256 이라 가정할 경우, 현재 부호화 블록의 크기가 4x4 이상, 32x32 이하라면, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 67개로 설정되고, 현재 부호화 블록의 크기가 64x64 이사, 256x256 이하라면, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 35개로 설정될 수 있다.Conversely, the number of intra prediction modes that can be used by the current coding block may increase as the size of the current coding block is smaller. For example, assuming that the minimum size of the prediction block is 4x4 and the maximum size is 256x256, if the size of the current coding block is 4x4 or more and 32x32 or less, the number of intra prediction modes available for the current coding block is set to 67, If the size of the current coding block is 64x64 or less and 256x256 or less, the number of intra prediction modes available for the current coding block may be set to 35.

현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록의 크기가 기준 크기와의 비교 결과에 따라 결정될 수 도 있다. 여기서, 기준 크기는 상위 헤더를 통해 시그널링될 수도 있고, 부호화 장치 및 복호화 장치에서 동일한 조건으로 유도할 수도 있다. 일 예로, 기준 크기가 32x32라 가정했을 때, 기준 크기에 대한 정보는 로그 함수를 취한, 'log232'로 정의되어 비트스트림을 통해 전송될 수 있다. 현재 부호화 블록의 크기가 기준 크기보다 작거나 클수록, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는 증가할 수 있다. 일 예로, 현재 부호화 블록의 크기가 32x32 인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 19개이고, 현재 부호화 블록의 크기가 64x64 이상, 128x128 이하인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 35개이며, 현재 부호화 블록의 크기가 256x256인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 67개일 수 있다. 현재 부호화 블록의 크기가 16x16이하, 8x8 이상인 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 블록의 개수는 35개이고, 현재 부호화 블록의 크기가, 4x4인 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 블록의 개수는 67개일 수 있다.The number of intra prediction modes that can be used by the current coding block may be determined according to a comparison result of a size of the current coding block with a reference size. Here, the reference size may be signaled through an upper header or may be derived under the same conditions in the encoding device and the decoding device. For example, assuming that the reference size is 32x32, information about the reference size may be defined as 'log 2 32' taking a log function and transmitted through a bitstream. As the size of the current coding block is smaller or larger than the reference size, the number of intra prediction modes that the current coding block can use may increase. For example, if the size of the current coding block is 32x32, the number of intra prediction modes available for the current coding block is 19, and if the size of the current coding block is 64x64 or more and 128x128 or less, the intra prediction mode available for the current coding block The number of is 35, and if the size of the current coding block is 256x256, the number of intra prediction modes available for the current coding block may be 67. When the size of the current coding block is 16x16 or less and 8x8 or more, the number of intra prediction blocks that can be used by the current coding block is 35, and when the size of the current coding block is 4x4, intra prediction blocks that can be used by the current coding block The number of may be 67.

반대로, 현재 부호화 블록의 크기가 기준 크기보다 작거나 클수록, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는 감소할 수도 있다.일 예로, 현재 부호화 블록의 크기가 32x32 인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 67개이고, 현재 부호화 블록의 크기가 64x64 이상, 128x128 이하인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 35개이며, 현재 부호화 블록의 크기가 256x256인 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드의 개수는 19개일 수 있다. 현재 부호화 블록의 크기가 16x16이하, 8x8 이상인 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 블록의 개수는 35개이고, 현재 부호화 블록의 크기가, 4x4인 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 블록의 개수는 19개일 수 있다.Conversely, as the size of the current coding block is smaller or larger than the reference size, the number of intra prediction modes that can be used by the current coding block may decrease. For example, when the size of the current coding block is 32x32, the current coding block is If the number of available intra prediction modes is 67, and the size of the current coding block is 64x64 or more and 128x128 or less, the number of intra prediction modes available for the current coding block is 35, and the size of the current coding block is 256x256, The number of intra prediction modes currently available for the coding block may be 19. When the size of the current coding block is 16x16 or less and 8x8 or more, the number of intra prediction blocks that can be used by the current coding block is 35, and when the size of the current coding block is 4x4, intra prediction blocks that can be used by the current coding block The number of may be 19.

현재 부호화 블록의 크기와는 무관하게, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드는 비 방향성 인트라 예측 모드(또는, 비 각도 예측 모드)를 포함할 수 있다. 즉, 현재 부호화 블록의 크기와 상관없이, 현재 부호화 블록은, 비 방향성 인트라 예측 모드를 이용하여 부호화될 수 있다. 반면, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드(즉, 각도 예측 모드)의 수는 현재 부호화 블록의 크기에 따라 변화할 수 있다. 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 수가 작아지거나 증가할수록, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드의 수도 감소 또는 증가할 수 있다.Regardless of the size of the current coding block, an intra prediction mode that can be used by the current coding block may include a non-directional intra prediction mode (or a non-angular prediction mode). That is, regardless of the size of the current coding block, the current coding block can be coded using a non-directional intra prediction mode. On the other hand, the number of directional prediction modes (ie, angular prediction modes) that can be used by the current coding block may vary according to the size of the current coding block. As the number of intra prediction modes available for the current coding block decreases or increases, the number of directional prediction modes available for the current coding block may decrease or increase.

현재 부호화 블록이 이용할 수 있는 방향성 예측 모드의 수가 감소하는 경우, 현재 부호화 블록은, 정수 단위 방향성 예측 모드 또는 이와 유사한 모드를 사용할 수 있다. 여기서, 정수 단위 방향성 예측 모드는, 정수 단위 참조 샘플을 이용하여 인트라 예측을 수행할 수 있는 모드를 의미한다. 여기서, 정수 단위 참조 샘플은, 참조 샘플의 보간을 거쳐 생성된 추가 참조 샘플이 아닌 참조 샘플 그 자체를 의미할 수 있다. 일 예로, 수평 방향, 수직 방향 또는 대각선 방향의 인트라 예측 모드가 정수 단위 방향성 예측 모드일 수 있다. When the number of directional prediction modes that can be used by the current coding block decreases, the current coding block may use an integer unit directional prediction mode or a similar mode. Here, the integer unit directional prediction mode refers to a mode that can perform intra prediction using an integer unit reference sample. Here, the integer unit reference sample may mean the reference sample itself, not an additional reference sample generated through interpolation of the reference sample. For example, an intra prediction mode in a horizontal direction, a vertical direction, or a diagonal direction may be an integer unit directional prediction mode.

또는, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드는, 방향성 예측 모드 전체 구간을 이용하고자 하는 방향성 예측 모드의 개수(N)만큼 분할(N-1 등분)함으로써 결정될 수도 있다. Alternatively, the directional prediction mode that can be used by the current coding block may be determined by dividing (equal to N-1) by the number (N) of directional prediction modes to use the entire section of the directional prediction mode.

도 13 및 도 14는 현재 부호화 블록에서 이용할 수 있는 방향성 예측 모드가 13개인 경우의 예를 나타낸다. 13 and 14 show examples of 13 directional prediction modes that can be used in the current coding block.

도 13을 참조하면, 현재 부호화 블록이 이용 가능한 인트라 예측 모드는, 정수 단위 방향성 예측 모드 및 정수 단위 방향성 예측 모드에 인접한 방향성 예측 모드일 수 있다. 일 예로, 도 13 에서는, 수직 방향, 수평 방향 및 3개의 대각선 방향의 인트라 예측 모드와 이들에 인접한 인트라 예측 모드(오프셋이 ±1인 인트라 예측 모드)들이 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드인 것으로 도시되었다. Referring to FIG. 13, an intra prediction mode in which the current coding block is available may be an integer directional prediction mode and an directional prediction mode adjacent to the integer directional prediction mode. As an example, in FIG. 13, vertical prediction mode, horizontal prediction direction, and three diagonal prediction modes and adjacent prediction modes (intra prediction modes with an offset of ± 1) are directional prediction modes that can be used by the current coding block. As shown.

도 14를 참조하면, 현재 부호화 블록이 이용 가능한 방향성 예측 모드는, 방향성 예측 모드 전체 구간을 12등분함으로써 균일한 간격으로 할당되는 13개의 방향성 예측 모드일 수 있다.Referring to FIG. 14, the directional prediction modes in which the current coding block is available may be 13 directional prediction modes allocated at equal intervals by dividing the entire section of the directional prediction mode into 12 equal parts.

현재 예측 블록이 이용할 수 있는 인트라 예측 모드의 수가 증가하는 경우, 정수 단위 방향성 예측 모드와 인접한 인트라 예측 모드를 더욱 많이 사용하거나, 방향성 예측 모드의 총 구간을 더 많은 구간으로 분할할 수 있다.When the number of intra prediction modes that can be used by the current prediction block increases, the intra prediction mode adjacent to the integer unit directional prediction mode may be used more or the total section of the directional prediction mode may be divided into more sections.

일 예로, 도 15 및 도 16은 현재 블록에서 이용할 수 있는 방향성 예측 모드가 21개인 경우의 예를 나타낸다.As an example, FIGS. 15 and 16 show an example of a case in which there are 21 directional prediction modes available in the current block.

도 15에서는, 현재 부호화 블록이 이용 가능한 인트라 예측 모드는, 수직 방향, 수평 방향 및 3개의 대각선 방향의 인트라 예측 모드와 이들에 인접한 인트라 예측 모드(오프셋이 ±2인 인트라 예측 모드)들이 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드인 것으로 도시되었다. In FIG. 15, the intra prediction modes in which the current coding block is available include the vertical, horizontal and three diagonal intra prediction modes and the intra prediction modes adjacent thereto (intra prediction modes with offset ± 2). It has been shown that this is the directional prediction mode available.

도 16에서는, 현재 부호화 블록이 이용 가능한 인트라 예측 모드는, 방향성 예측 모드 전체 구간을 20등분함으로써 균일한 간격으로 할당되는 21개의 방향성 예측 모드인 것으로 도시되었다.In FIG. 16, the intra prediction mode that can be used for the current coding block is shown as 21 directional prediction modes allocated at equal intervals by dividing the entire section of the directional prediction mode into 20 equal parts.

부호화 장치는, 예측 블록의 크기별로, 이용 가능한 인트라 예측 모드의 수를 부호화하여 복호화기로 전송할 수도 있다. 이때, 예측 블록의 크기별로 이용 가능한 인트라 예측 모드 수를 나타내는 정보는 상위 헤더에서 부호화될 수 있다. 일 예로, 예측 블록의 최소 크기가 4x4이고, 최대 크기가 256x256으로 가정할 때, 32x32 블록 보다 작거나 같은 예측 블록이 이용할 수 있는 인트라 예측 모드의 개수가 64개로 결정된 경우, 이용 가능한 개수에 로그를 취한 값(log264)을 부호화하여, 복호화 장치로 전송할 수 있다. 64x64 예측 블록이 이용할 수 있는 인트라 예측 모드의 개수가 32개로 결정된 경우, 이용 가능한 개수에 로그를 취한 값(log232)을 부호화하고, 128x128 예측 블록이 이용할 수 있는 인트라 예측 모드의 개수가 16개인 경우, 이용 가능한 개수에 로그를 취한 값(log216)을 부호화하고, 256x256 예측 블록이 이용할 수 있는 인트라 예측 모드의 개수가 8개인 경우, 이용 가능한 개수에 로그를 취한 값(log28)을 부호화할 수 있다.The encoding apparatus may encode the number of available intra prediction modes for each size of the prediction block and transmit it to the decoder. At this time, information indicating the number of intra prediction modes available for each size of the prediction block may be encoded in an upper header. For example, assuming that the minimum size of the prediction block is 4x4 and the maximum size is 256x256, when the number of intra prediction modes that can be used by prediction blocks smaller than or equal to 32x32 blocks is determined to be 64, log the available number of logs. The taken value (log 2 64) can be encoded and transmitted to a decoding device. If the number of intra prediction modes that can be used by the 64x64 prediction block is determined to be 32, the value (log 2 32) that has been logged to the available number is encoded, and the number of intra prediction modes that can be used by the 128x128 prediction block is 16. If the number of available logs is logged (log 2 16), and the number of intra prediction modes available for the 256x256 prediction block is 8, the number of logged values (log 2 8) is used. Can be coded.

다른 예로, 상위 헤더에서, 예측 블록의 크기별 이용 가능한 인트라 예측 모드의 개수를 기 설정하고, 예측 블록 별로 최적의 인트라 예측 모드 개수를 결정하여, 예측 블록 단위로 이용 가능한 인트라 예측 모드의 개수를 나타내는 색인 정보를 부호화할 수 있다. 일 예로, 32x32 인 예측 블록이 이용 가능한 인트라 예측 모드의 개수가 19개, 35개 또는 67개라면, 32x32 크기의 예측 블록에 대해, 19개, 35개 또는 67개 중 어느 것이 최적인지를 나타내는 색인 정보가 부호화될 수 있다.As another example, in the upper header, the number of intra prediction modes available for each size of the prediction block is preset, and an optimal number of intra prediction modes is determined for each prediction block, and an index indicating the number of intra prediction modes available for each prediction block unit Information can be encoded. For example, if the number of intra prediction modes for which a 32x32 prediction block is available is 19, 35, or 67, an index indicating which of 19, 35, or 67 is optimal for a prediction block of 32x32 size Information can be encoded.

부호화 장치는, 예측 블록의 크기에 따라 인트라 예측 모드의 개수 또는 종류를 조절할 것인지 여부를 나타내는 정보를 부호화할 수 있다. 부호화된 정보는 상위 헤더를 통해 복호화기를 전송할 수 있다. 이때, 상기 정보는 1비트의 플래그 일 수 있으나, 이에 한정되는 것은 아니다. 복호화 장치는 상기 플래그 정보에 기초하여, 예측 블록 크기별로, 인트라 예측 모드의 개수 또는 종류가 조절되는지 여부를 미리 결정할 수 있다.The encoding apparatus may encode information indicating whether to adjust the number or type of intra prediction modes according to the size of the prediction block. The coded information may transmit a decoder through an upper header. At this time, the information may be a flag of 1 bit, but is not limited thereto. The decoding apparatus may determine in advance whether the number or type of intra prediction modes is adjusted for each prediction block size based on the flag information.

상위 헤더에서 부호화된 정보가, 예측 블록의 크기에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타낸다 하더라도, 현재 부호화 블록은, 종래의 방법으로 인트라 예측을 수행할 수도 있고, 상술한 예측 블록의 크기에 따라 이용 가능한 인트라 예측 모드의 수를 조절함으로써 인트라 예측을 수행할 수도 있다. 이에 따라, 부호화 장치는, 상위 헤더에서 부호화된 정보가, 예측 블록의 크기에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타내는 경우, 예측 블록 단위로, 해당 예측 블록이 종래의 방법(즉, 고정된 개수의 인트라 예측 모드를 사용하는 것)으로 부호화되는지 또는 예측 블록 크기에 따라 이용 가능한 인트라 예측 모드의 수가 조절되는 방법을 이용하여 부호화되는지 여부를 나타내는 정보를 추가로 부호화할 수도 있다. 이때, 부호화되는 정보는 1비트의 플래그일 수 있으나, 이에 한정되는 것은 아니다.Even if the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the size of the prediction block, the current coding block may perform intra prediction in a conventional method, or the above-described prediction block Intra prediction may be performed by adjusting the number of available intra prediction modes according to the size of. Accordingly, when the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the size of the prediction block, the encoding device, in units of prediction blocks, uses the corresponding prediction block in a conventional method (ie , Using a fixed number of intra prediction modes) or information indicating whether the number of available intra prediction modes is adjusted according to a prediction block size may be additionally encoded. In this case, the encoded information may be a flag of 1 bit, but is not limited thereto.

S1202에서는, 현재 부호화 블록의 형태에 따라, 인트라 예측 모드의 개수 또는 종류가 제어될 수 있음이 도시되었다. 이에 대해 상세히 설명하면, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록의 형태에 따라 가변적으로 결정될 수 있다. 일 예로, 현재 부호화 블록이 비정방형(예컨대, 직사각형)인 경우, 현재 부호화 블록은 세로 방향의 인트라 예측 모드보다 가로 방향의 인트라 예측 모드를 더 많이 이용할 수 있거나, 가로 방향의 인트라 예측 모드보다 세로 방향의 인트라 예측 모드를 더 많이 이용할 수 있도록 설정될 수 있다. In S1202, it is illustrated that the number or type of intra prediction modes can be controlled according to the type of the current coding block. In detail, the number of intra prediction modes that can be used by the current coding block may be variably determined according to the type of the current coding block. For example, when the current coding block is non-square (eg, rectangular), the current coding block may use the intra prediction mode in the horizontal direction more than the intra prediction mode in the vertical direction, or the vertical direction than the intra prediction mode in the horizontal direction. It can be set to use more of the intra prediction mode.

구체적으로, 현재 부호화 블록의 모양이 비정방형인 경우, 현재 부호화 블록의 너비 및 높이 비율에 따라, 현재 블록이 이용 가능한 가로 방향의 인트라 예측 모드 및 세로 방향의 인트라 예측 모드의 개수가 결정될 수 있다. 일 예로, 현재 부호화 블록의 크기가 8x16인 경우, 현재 부호화 블록의 높이가 너비의 2배이므로, 현재 부호화 블록이 이용할 수 있는 가로 방향 인트라 예측 모드들의 수는 세로 방향 인트라 예측 모드들에 비해 2배 가량일 수 있다. 예컨대, 현재 부호화 블록이 이용 가능한 방향성 인트라 예측 모드의 수가 25개라면, 현재 부호화 블록은 16개의 가로 방향 인트라 예측 모드 및 9개의 세로 방향 인트라 예측 모드를 이용할 수 있도록 설정될 수 있다. Specifically, when the shape of the current coding block is non-square, the number of horizontal prediction modes and vertical prediction modes that are available for the current block may be determined according to the width and height ratios of the current coding block. For example, when the size of the current coding block is 8x16, since the height of the current coding block is twice the width, the number of horizontal intra prediction modes that the current coding block can use is twice that of the vertical intra prediction modes. It can be about. For example, if the number of directional intra prediction modes available for the current coding block is 25, the current coding block may be set to use 16 transverse intra prediction modes and 9 vertical intra prediction modes.

현재 부호화 블록이 이용 가능한 인트라 예측 모드의 수는 현재 부호화 블록의 너비 또는 높이를 기 설정된 임계값과 비교함으로써 결정될 수도 있다. 여기서, 임계값은 상위 헤더를 통해 시그널링될 수 있다. 일 예로, 임계값에 로그(Log2)를 취한 값이 상위 헤더를 통해 시그널링될 수 잇다. 또는, 부호화 장치 및 복호화 장치가 동일한 조건으로 임계값을 유도할 수도 있다. 이때, 임계값은 너비 및 높이 각각에 대해 설정될 수도 있고, 너비 및 높이에 대해 동일한 값을 사용할 수도 있다. 일 예로, 너비에 대한 임계값이 32일 때, 현재 부호화 블록의 너비가 임계값보다 작은 경우, 현재 부호화 블록은 N 개의 가로 방향 인트라 예측 모드 중 1/2N 개만을 이용할 수 있다. 일 예로, 가로 방향 방향성 예측 모드가 33개인 경우, 현재 부호화 블록은 17개의 가로 방향 방향성 예측 모드를 이용할 수 있다.The number of intra prediction modes available for the current coding block may be determined by comparing the width or height of the current coding block with a preset threshold. Here, the threshold may be signaled through the upper header. As an example, a value obtained by taking a log (Log 2 ) as a threshold value may be signaled through an upper header. Or, the encoding device and the decoding device may derive the threshold under the same condition. In this case, the threshold may be set for each of the width and height, or the same value may be used for the width and height. For example, when the threshold for width is 32, if the width of the current coding block is smaller than the threshold, only 1 / 2N of the N horizontal intra prediction modes may be used for the current coding block. For example, if there are 33 transverse directional prediction modes, the current coding block may use 17 transverse directional prediction modes.

현재 부호화 블록의 형태와는 무관하게, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드는 비 방향성 인트라 예측 모드(또는, 비 각도 예측 모드)를 포함할 수 있다. 반면, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드(즉, 각도 예측 모드)의 수는 현재 부호화 블록의 형태에 따라 변화할 수 있다. 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 수가 작아지거나 증가할수록, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드의 수도 감소 또는 증가할 수 있다.Regardless of the form of the current coding block, the intra prediction mode that can be used by the current coding block may include a non-directional intra prediction mode (or a non-angular prediction mode). On the other hand, the number of directional prediction modes (ie, angle prediction modes) that can be used by the current coding block may vary according to the type of the current coding block. As the number of intra prediction modes available for the current coding block decreases or increases, the number of directional prediction modes available for the current coding block may decrease or increase.

현재 부호화 블록이 이용할 수 있는 방향성 예측 모드는, 정수 단위 방향성 예측 모드 또는 이와 유사한 모드로 결정될 수 있다. 또는, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드는, 방향성 예측 모드 전체 구간을 이용하고자 하는 방향성 예측 모드의 개수(N)만큼 분할(N-1 등분)함으로써 결정될 수도 있다. 이는, 앞서 도 13 내지 도 16을 통해 설명한 바 있으므로, 이에 대한 상세한 설명은 생략한다. The directional prediction mode that the current coding block can use may be determined as an integer unit directional prediction mode or a similar mode. Alternatively, the directional prediction mode that can be used by the current coding block may be determined by dividing (equal to N-1) by the number (N) of directional prediction modes to use the entire section of the directional prediction mode. This has been described with reference to FIGS. 13 to 16 above, and thus detailed description thereof will be omitted.

부호화 장치는, 예측 블록의 형태에 따라 인트라 예측 모드의 개수 또는 종류를 조절할 것인지 여부를 나타내는 정보를 부호화할 수 있다. 부호화된 정보는 상위 헤더를 통해 복호화기를 전송할 수 있다. 이때, 상기 정보는 1비트의 플래그 일 수 있으나, 이에 한정되는 것은 아니다. 복호화 장치는 상기 플래그 정보에 기초하여, 예측 블록의 형태별로, 인트라 예측 모드의 개수 또는 종류가 조절되는지 여부를 미리 결정할 수 있다.The encoding apparatus may encode information indicating whether to adjust the number or type of intra prediction modes according to the shape of the prediction block. The coded information may transmit a decoder through an upper header. At this time, the information may be a flag of 1 bit, but is not limited thereto. The decoding apparatus may determine in advance whether the number or type of intra prediction modes is adjusted for each type of prediction block based on the flag information.

상위 헤더에서 부호화된 정보가, 예측 블록의 형태에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타낸다 하더라도, 현재 부호화 블록은, 종래의 방법으로 인트라 예측을 수행할 수도 있고, 상술한 예측 블록의 형태에 따라 이용 가능한 인트라 예측 모드의 수를 조절함으로써 인트라 예측을 수행할 수도 있다. 이에 따라, 부호화 장치는, 상위 헤더에서 부호화된 정보가, 예측 블록의 형태에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타내는 경우, 예측 블록 단위로, 해당 예측 블록이 종래의 방법(즉, 고정된 개수의 인트라 예측 모드를 사용하는 것)으로 부호화되는지 또는 예측 블록 형태에 따라 이용 가능한 인트라 예측 모드의 수가 조절되는 방법을 이용하여 부호화되는지 여부를 나타내는 정보를 추가로 부호화할 수도 있다. 이때, 부호화되는 정보는 1비트의 플래그일 수 있으나, 이에 한정되는 것은 아니다.Even if the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the type of the prediction block, the current coding block may perform intra prediction in a conventional method or the above-described prediction block Intra prediction may be performed by adjusting the number of available intra prediction modes according to the form of. Accordingly, when the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the type of the prediction block, the encoding device, in units of prediction blocks, uses the corresponding prediction block in a conventional method (ie , Using a fixed number of intra prediction modes) or information indicating whether the number of available intra prediction modes is adjusted according to a prediction block type may be additionally encoded. In this case, the encoded information may be a flag of 1 bit, but is not limited thereto.

S1203에서는, 현재 부보화 블록의 주변 블록에 따라, 인트라 예측 모드의 개수 또는 종류가 제어될 수 있음이 도시되었다. 이에 대해 상세히 설명하면, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수는, 현재 부호화 블록에 이웃하는 이웃 블록들의 인트라 예측 모드에 따라 결정될 수 있다.In S1203, it has been shown that the number or type of intra prediction modes can be controlled according to the neighboring blocks of the current sub-block. In detail, the number of intra prediction modes that can be used by the current coding block may be determined according to intra prediction modes of neighboring blocks neighboring the current coding block.

일 예로, 현재 부호화 블록 주변 블록들의 인트라 예측 모드들의 통계를 참조할 때, 비방향성 예측 모드 및 방향성 예측 모드가 혼재되어 있어, 비방향성 예측 모드 및 방향성 예측 모드의 비율이 임계 비율 이상 또는 이하가 되지 않는 경우, 현재 부호화 블록의 인트라 예측 특성은 모호한 것으로 판단될 수 있다. 현재 부호화 블록의 인트라 예측 특성이 모호한 것으로 판단되는 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수 또는 종류에는 변화가 가해지지 않을 수 있다. 이에 따라, 현재 부호화 블록은, 모든 인트라 예측 모드를 이용할 수 있다. For example, when referring to statistics of intra prediction modes of blocks around a current coded block, a non-directional prediction mode and a directional prediction mode are mixed, so that the ratio of the non-directional prediction mode and the directional prediction mode is not greater than or equal to a threshold ratio. If not, the intra prediction characteristic of the current coding block may be determined to be ambiguous. When it is determined that the intra prediction characteristics of the current coding block are ambiguous, a change may not be applied to the number or type of intra prediction modes that the current coding block can use. Accordingly, all intra prediction modes can be used for the current coding block.

예를 들어, 현재 부호화 블록 주변 블록의 인트라 예측 모드들을 참조했을 때, 비방향성 모드가 9개, 방향성 모드가 8개이고, 방향성 모드 중에서도 가로 방향의 모드가 4개, 세로 방향의 모드가 4개라면, 현재 부호화 블록이 비방향성, 세로 방향 또는 가로 방향 중 어느 것을 이용하여야 바람직한지 결정하기 어렵다. 이처럼, 현재 예측 블록 주변의 주변 블록들의 비방향성 예측 모드와 방향성 예측 모드의 비율이 1:1에 가까워 주변 예측 블록들이 주로 사용하는 인트라 예측 모드의 판정이 어려울 경우, 또는 주변 예측 블록들이 방향성 예측 모드를 이용하여 부호화되었으나, 가로 방향 모드 및 세로 방향 모드가 혼재되어 있어, 주변 예측 블록들의 주된 방향성 판단이 어려울 경우, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 개수 또는 종류에 변화를 주지 않을 수 있다. For example, when referring to intra prediction modes of a block around a current coding block, if there are 9 non-directional modes, 8 directional modes, and 4 directional modes and 4 vertical modes among directional modes, , It is difficult to determine whether the current coding block should be used in a non-directional, vertical or horizontal direction. As such, when the ratio of the non-directional prediction mode and the directional prediction mode of the neighboring blocks around the current prediction block is close to 1: 1, it is difficult to determine the intra prediction mode mainly used by the neighboring prediction blocks, or the neighboring prediction blocks are the directional prediction mode It is coded using, but if the horizontal direction mode and the vertical direction mode are mixed and it is difficult to determine the main directionality of neighboring prediction blocks, the number or type of intra prediction modes that the current coding block can use may not be changed. .

반면, 현재 부호화 블록 주변의 인트라 예측 모드의 통계를 참조했을 때, 비방향성 예측 모드가 방향성 예측 모드보다 임계 비율 이상 더 많이 사용된 것으로 판단되는 경우, 현재 부호화 블록의 예측 특성은 비방향성 모드인 것으로 판단할 수 있다. 이 경우, 현재 부호화 블록이 이용 가능한 인트라 예측 모드는 비 방향성 모드를 반드시 포함하고, 부수적으로, 소정 개수의 방향성 모드를 포함할 수 있다. 현재 부호화 블록의 주변 블록들이 대부분 비방향성 예측 모드를 통해 부호화된 경우, 현재 부호화 블록에도 특정향 방향성을 가진 윤곽선이 나타날 확률이 매우 낮다. 이에 따라, 비방향성 예측 모드만을 이용하거나, 비방향성 예측 모드와 소정 개수의 방향성 예측 모드(예컨대, 수직 방향 예측 모드 및 수평 방향 예측 모드 2개)만을 이용하더라도, 현재 부호화 블록에 대한 최적의 인트라 예측 모드를 파악할 수 있다. On the other hand, when the statistics of the intra prediction mode around the current coding block are referred to, when it is determined that the non-directional prediction mode is used more than a threshold ratio than the directional prediction mode, the prediction characteristic of the current coding block is that the non-directional mode I can judge. In this case, the intra prediction mode in which the current coding block is available necessarily includes a non-directional mode and, incidentally, a predetermined number of directional modes. When the neighboring blocks of the current coding block are mostly coded through the non-directional prediction mode, the probability that a contour having a specific directionality appears in the current coding block is very low. Accordingly, even if only the non-directional prediction mode is used or only the non-directional prediction mode and a predetermined number of directional prediction modes (for example, two vertical prediction modes and two horizontal prediction modes) are used, optimal intra prediction for the current coding block I can figure out the mode.

현재 부호화 블록 주변의 인트라 예측 모드의 통계를 참조했을 때, 방향성 예측 모드가 비방향성 예측 모드보다 임계 비율 이상 더 많이 사용된 것으로 판단되는 경우, 현재 부호화 블록의 예측 특성은 방향성 모드인 것으로 판단할 수 있다. 이웃 블록들의 인트라 예측 모드들에 대한 가로 방향 예측 모드들과, 세로 방향 예측 모드들의 비율이 어느 한쪽으로 치우처진 형태(예컨대, 가로 방향 예측 모드가 세로 방향 예측 모드보다 임계 비율 이상 더 많이 사용된 경우 또는 세로 방향 예측 모드가 가로 방향 예측 모드보다 임계 비율 이상 더 많이 사용된 경우 등)를 띠는 경우, 가로 방향 예측 모드 및 세로 방향 예측 모드 중 더 많이 사용된 방향성 예측 모드를 이용하여, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드를 구성할 수 있다. 이때, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드는 가로 방향 또는 세로 방향 예측 모드와 함께 비방향성 예측 모드를 더 포함할 수 있다.When it is determined that the directional prediction mode is used more than a threshold ratio more than the non-directional prediction mode when referring to the statistics of the intra prediction mode around the current coding block, it may be determined that the prediction characteristic of the current coding block is the directional mode. have. The ratio of the horizontal prediction modes to the intra prediction modes of neighboring blocks and the vertical prediction modes is skewed to one side (for example, when the horizontal prediction mode is used more than a threshold ratio than the vertical prediction mode) Or, when the vertical prediction mode is used more than a threshold ratio than the horizontal prediction mode, etc.), the current coding block using the directional prediction mode, which is the more used of the horizontal prediction mode and the vertical prediction mode The intra prediction mode that can be used can be configured. In this case, the intra prediction mode that can be used by the current coding block may further include a non-directional prediction mode along with a horizontal or vertical prediction mode.

일 예로, 현재 부호화 블록 주변의 인트라 예측 모드가 모두 방향성 예측 모드이고, 주변 블록들의 인트라 예측 모드들 중 가로 방향 모드가 11개, 세로 방향 모드가 2개인 경우, 현재 블록도 가로 방향 특성을 가질 것으로 예측할 수 있다. 이에 따라, 비방향성 예측 모드 및 가로 방향 예측 모드를 이용하여, 현재 부호화 블록에 대한 최적의 인트라 예측 모드를 판단할 수 있다. For example, if all of the intra prediction modes around the current coding block are directional prediction modes, and 11 horizontal modes and 2 vertical modes are among the intra prediction modes of the neighboring blocks, the current block will also have lateral characteristics. Predictable. Accordingly, the optimal intra prediction mode for the current coding block may be determined using the non-directional prediction mode and the horizontal prediction mode.

상술한 예에서, 임계 비율(방향성 모드와 비방향성 모드 사이의 기준이 되는 임계 비율 및 가로 방향 모드와 세로 방향 모드 사이의 기준이 되는 임계 비율 등)은, 상위 헤더를 통해 시그널링될 수 있다. 일 예로, 임계 비율에 로그(log2)를 취한 값이 상위 헤더를 통해 전송될 수 있다. In the above-described example, a threshold ratio (such as a threshold ratio that is a reference between a directional mode and a non-directional mode and a threshold ratio that is a reference between a horizontal mode and a vertical mode) may be signaled through an upper header. For example, a value obtained by taking a log (log 2 ) for a threshold ratio may be transmitted through an upper header.

현재 부호화 블록 주변의 인트라 예측 모드와는 무관하게, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드는 비 방향성 인트라 예측 모드(또는, 비 각도 예측 모드)를 포함할 수 있다. 반면, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드(즉, 각도 예측 모드)의 수는 현재 부호화 블록 주변의 인트라 예측 모드의 이용 패턴에 따라 변화할 수 있다. 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드의 수가 작아지거나 증가할수록, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드의 수도 감소 또는 증가할 수 있다.Regardless of the intra prediction mode around the current coding block, the intra prediction mode that can be used by the current coding block may include a non-directional intra prediction mode (or a non-angular prediction mode). On the other hand, the number of directional prediction modes (ie, angle prediction modes) that can be used by the current coding block may vary according to the usage pattern of the intra prediction mode around the current coding block. As the number of intra prediction modes available for the current coding block decreases or increases, the number of directional prediction modes available for the current coding block may decrease or increase.

현재 부호화 블록이 이용할 수 있는 방향성 예측 모드는, 정수 단위 방향성 예측 모드 또는 이와 유사한 모드로 결정될 수 있다. 또는, 현재 부호화 블록이 이용할 수 있는 방향성 예측 모드는, 방향성 예측 모드 전체 구간을 이용하고자 하는 방향성 예측 모드의 개수(N)만큼 분할(N-1 등분)함으로써 결정될 수도 있다. 이는, 앞서 도 13 내지 도 16을 통해 설명한 바 있으므로, 이에 대한 상세한 설명은 생략한다. The directional prediction mode that the current coding block can use may be determined as an integer unit directional prediction mode or a similar mode. Alternatively, the directional prediction mode that can be used by the current coding block may be determined by dividing (equal to N-1) by the number (N) of directional prediction modes to use the entire section of the directional prediction mode. This has been described with reference to FIGS. 13 to 16 above, and thus detailed description thereof will be omitted.

부호화 장치는, 예측 블록 주변의 주변 블록들의 인트라 예측 모드 이용 패턴에 따라 인트라 예측 모드의 개수 또는 종류를 조절할 것인지 여부를 나타내는 정보를 부호화할 수 있다. 부호화된 정보는 상위 헤더를 통해 복호화기를 전송할 수 있다. 이때, 상기 정보는 1비트의 플래그 일 수 있으나, 이에 한정되는 것은 아니다. 복호화 장치는 상기 플래그 정보에 기초하여, 예측 블록의 형태별로, 인트라 예측 모드의 개수 또는 종류가 조절되는지 여부를 미리 결정할 수 있다.The encoding apparatus may encode information indicating whether to adjust the number or type of intra prediction modes according to the intra prediction mode usage pattern of neighboring blocks around the prediction block. The coded information may transmit a decoder through an upper header. At this time, the information may be a flag of 1 bit, but is not limited thereto. The decoding apparatus may determine in advance whether the number or type of intra prediction modes is adjusted for each type of prediction block based on the flag information.

상위 헤더에서 부호화된 정보가, 예측 블록 주변의 주변 블록들의 인트라 예측 모드 이용 패턴에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타낸다 하더라도, 현재 부호화 블록은, 종래의 방법으로 인트라 예측을 수행할 수도 있고, 상술한 주변 블록들의 인트라 예측 모드 이용 패턴에 따라 이용 가능한 인트라 예측 모드의 수를 조절함으로써 인트라 예측을 수행할 수도 있다. 이에 따라, 부호화 장치는, 상위 헤더에서 부호화된 정보가, 주변 블록의 인트라 예측 모드 이용 패턴에 따라 이용 가능한 인트라 예측 모드의 수가 조절될 수 있음을 나타내는 경우, 예측 블록 단위로, 해당 예측 블록이 종래의 방법(즉, 고정된 개수의 인트라 예측 모드를 사용하는 것)으로 부호화되는지 또는 주변 블록의 인트라 예측 모드 이용 패턴에 따라 이용 가능한 인트라 예측 모드의 수가 조절되는 방법을 이용하여 부호화되는지 여부를 나타내는 정보를 추가로 부호화할 수도 있다. 이때, 부호화되는 정보는 1비트의 플래그일 수 있으나, 이에 한정되는 것은 아니다.Although the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the intra prediction mode usage pattern of neighboring blocks around the prediction block, the current coding block performs intra prediction in a conventional method Alternatively, intra prediction may be performed by adjusting the number of available intra prediction modes according to the above-described intra prediction mode usage pattern of neighboring blocks. Accordingly, when the information encoded in the upper header indicates that the number of available intra prediction modes can be adjusted according to the intra prediction mode usage pattern of the neighboring block, the encoding apparatus, in prediction block units, the prediction block is conventional Information indicating whether it is encoded using the method of (i.e., using a fixed number of intra prediction modes) or by using a method in which the number of available intra prediction modes is adjusted according to the intra prediction mode usage pattern of neighboring blocks. May be additionally encoded. In this case, the encoded information may be a flag of 1 bit, but is not limited thereto.

도 12는 부호화 과정을 중심으로 설명하였으나, 복호화 과정에서도 현재 복호화 대상 블록이 이용할 수 있는 인트라 예측 모드의 개수를 조절하는 것도 가능하다. 복호화 장치는 비트스트림을 통해 시그널링되는 정보에 기초하여, 현재 복호화 블록의 크기, 형태 또는 주변 블록의 인트라 예측 모드 이용 패턴 등을 고려하여, 현재 복호화 블록이 이용할 수 있는 인트라 예측 모드의 개수를 조절할 수 있다.12 illustrates the encoding process, it is also possible to adjust the number of intra prediction modes that can be used by the current decoding target block in the decoding process. Based on the information signaled through the bitstream, the decoding apparatus may adjust the number of intra prediction modes that can be used by the current decoding block in consideration of the size, shape of the current decoding block, or a pattern of using the intra prediction mode of neighboring blocks. have.

현재 부호화 블록에 대해 이용 가능한 인트라 예측 모드의 개수가 결정되면, 부호화 장치는 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드 중 현재 부호화 블록의 인트라 예측 모드를 결정하고, 이에 대한 정보를 부호화할 수 있다. 이하, 현재 블록에 대한 인트라 예측 모드를 부호화/복호화하는 방법에 대해 상세히 설명하기로 한다. If the number of intra prediction modes available for the current coding block is determined, the encoding apparatus may determine an intra prediction mode of the current coding block among intra prediction modes that can be used by the current coding block, and encode information about the intra prediction mode. Hereinafter, a method of encoding / decoding an intra prediction mode for a current block will be described in detail.

도 17은 현재 부호화 블록에 대한 최적의 인트라 예측 모드를 부호화는 과정을 나타낸 흐름도이다.17 is a flowchart illustrating a process of encoding an optimal intra prediction mode for a current coding block.

도 17을 참조하면, 먼저, 부호화 장치는, 현재 부호화 블록에 대한 MPM 후보를 결정할 수 있다(S1701). 이때, 부호화 장치는, 현재 부호화 블록과 현재 부호화 블록 주변 블록들이 이용할 수 있는 방향성 예측 모드의 개수가 다름을 고려하여, 방향성 예측 모드에 대해서는, 양자화된 방향성 예측 모드(또는 양자화된 방향성 예측 모드의 각도)를 MPM 후보로 설정할 수 있다. Referring to FIG. 17, first, the encoding apparatus may determine an MPM candidate for the current coding block (S1701). In this case, the encoding apparatus considers the number of directional prediction modes that can be used by the current coding block and blocks around the current coding block, and for the directional prediction mode, the quantized directional prediction mode (or the angle of the quantized directional prediction mode) ) As an MPM candidate.

일 예로, 도 18은 MPM 후보를 설정하는 일 예를 나타낸 도면이다. 도 18에서는 3개의 MPM 후보가 이용되는 것으로 예시되었다. 도 18에 도시된 예에서, L는 현재 부호화 블록의 좌측에 인접한 주변 블록들 중 발생 빈도가 가장 높은 인트라 예측 모드이거나, 현재 부호화 블록의 좌측에 인접한 소정 위치의 주변 블록(또는 임의 주변 블록)의 인트라 예측 모드일 수 있다. A는 현재 부호화 블록의 상단에 인접한 주변 블록들 중 발생 빈도가 가장 높은 인트라 예측 모드이거나, 현재 부호화 블록의 상단에 인접한 소정 위치의 주변 블록(또는 임의 주변 블록)의 인트라 예측 모드일 수 있다. As an example, FIG. 18 is a diagram illustrating an example of setting an MPM candidate. In FIG. 18, three MPM candidates are illustrated as being used. In the example shown in FIG. 18, L is an intra prediction mode having the highest frequency among neighboring blocks adjacent to the left side of the current coding block, or a neighboring block (or an arbitrary neighboring block) at a predetermined location adjacent to the left side of the current coding block. It may be an intra prediction mode. A may be an intra prediction mode having the highest frequency among neighboring blocks adjacent to the top of the current coding block, or an intra prediction mode of a neighboring block (or an arbitrary neighboring block) at a predetermined position adjacent to the top of the current coding block.

상기 L, L-1, L+1 및 A는 인트라 예측 모드의 색인을 나타낼 수 있다. 다만, 현재 부호화 블록 및 주변 블록이 이용할 수 있는 방향성 예측 모드의 수가 다른 경우, 주변 블록이 이용한 방향성 예측 모드가, 현재 부호화 블록에서는 이용할 수 없는 경우가 나타날 수 있다. 예를 들어, 현재 부호화 블록이 이용할 수 있는 인트라 예측 모드 중 18번 모드는 수평 방향 예측 모드를 의미하는 반면, 주변 블록이 이용할 수 있는 방향성 예측 모드 중 18번은 수평 방향이 아닌 좌상단 방향의 예측 모드를 의미할 수도 있다. The L, L-1, L + 1 and A may represent the index of the intra prediction mode. However, when the number of directional prediction modes that can be used by the current coding block and the neighboring blocks is different, a case in which the directional prediction mode used by the neighboring blocks cannot be used in the current coding block may appear. For example, 18 of the intra prediction modes that can be used by the current coding block means a horizontal prediction mode, whereas 18 of the directional prediction modes that can be used by neighboring blocks indicate a prediction mode in the upper left direction rather than the horizontal direction. It can also mean.

이와 같은 불일치를 해결하기 위해, MPM 후보에 비방향성 예측 모드를 할당하는 경우에는 색인 정보를 그대로 이용하고, MPM 후보에 방향성 예측 모드를 할당하는 경우에는 방향성 예측 모드에 대응하는 예측 각도를 할당할 수 있다. 양자화된 각도가 MPM 후보로 설정됨에 따라, 부호화 장치는 현재 부호화 블록에 대한 최적 방향성 예측 모드의 예측 각도가 MPM 후보에 포함된 양자화 각도와 동일한지 여부에 기초하여, 현재 부호화 블록의 인트라 예측 모드를 결정할 수 있다. 이에 따라, MPM 후보가 비방향성 예측 모드인 경우, L, L-1, L+1, A 등 인트라 예측 모드의 색인을 MPM 후보로 사용하는 반면, MPM 후보가 방향성 예측 모드인 경우, L', (L-1)', (L+1)', A' 등 인트라 예측 모드의 각도를 MPM 후보로 사용할 수 있다. To solve this mismatch, when the non-directional prediction mode is allocated to the MPM candidate, index information is used as it is, and when the directional prediction mode is allocated to the MPM candidate, a prediction angle corresponding to the directional prediction mode can be allocated. have. As the quantized angle is set as the MPM candidate, the encoding apparatus determines the intra prediction mode of the current coding block based on whether the prediction angle of the optimal directional prediction mode for the current coding block is the same as the quantization angle included in the MPM candidate. Can decide. Accordingly, when the MPM candidate is a non-directional prediction mode, indexes of intra prediction modes such as L, L-1, L + 1, and A are used as MPM candidates, whereas when the MPM candidate is a directional prediction mode, L ', The angles of the intra prediction modes such as (L-1) ', (L + 1)' and A 'can be used as MPM candidates.

만약, 주변 블록의 예측 각도와 일치하는 방향성 예측 모드를 현재 부호화 블록이 이용할 수 없는 경우, 주변 블록의 예측 각도를, 현재 예측 블록이 이용할 수 있는 방향성 모드의 예측 각도와 가장 유사한 것으로 줄이는 양자화를 수행할 수 있다. 이에 따라, MPM 후보가 방향성 예측 모드인 경우, L', (L-1)', (L+1)', A' 등 방향성 예측 모드의 양자화된 각도를 나타내는 MPM 후보를 이용할 수 있다.If the current coding block cannot use the directional prediction mode matching the prediction angle of the neighboring block, quantization is performed to reduce the prediction angle of the neighboring block to the most similar prediction angle of the directional mode available to the current prediction block. can do. Accordingly, when the MPM candidate is a directional prediction mode, an MPM candidate indicating a quantized angle of a directional prediction mode such as L ', (L-1)', (L + 1) ', A' can be used.

일 예로, 도 19 및 도 20은 예측 각도를 양자화하는 예를 나타낸다. 도 20은 현재 부호화 블록에 이웃한 주변 블록에서 이용할 수 있는 방향성 예측 모드를 나타낸 것이고, 도 19는 현재 부호화 블록에서 이용할 수 있는 방향성 예측 모드를 나타낸 것이다. 도 19 및 도 20을 비교하면, 도 20에서 점선으로 표시한 방향성 예측 모드는 현재 부호화 블록에서 이용할 수 없는 것임을 확인할 수 있다. 이에 따라, 주변 블록이 점선으로 표시한 방향성 예측 모드를 이용하여 부호화되었을 경우, 점선으로 표시한 방향성 예측 모드의 예측 각도를, 현재 블록이 이용할 수 있는 방향성 예측 모드 중 가장 유사한 예측 모드의 예측 각도로 변환하여, 변환된 각도를 MPM 후보로 설정할 수 있다.As an example, FIGS. 19 and 20 show an example of quantizing a prediction angle. FIG. 20 shows a directional prediction mode that can be used in neighboring blocks adjacent to the current coding block, and FIG. 19 shows a directional prediction mode that can be used in the current coding block. 19 and 20, it can be confirmed that the directional prediction mode indicated by the dotted line in FIG. 20 is not available in the current coding block. Accordingly, when the neighboring block is encoded using the directional prediction mode indicated by a dotted line, the prediction angle of the directional prediction mode indicated by a dotted line is the prediction angle of the most similar prediction mode among the directional prediction modes that can be used by the current block. By converting, the converted angle can be set as an MPM candidate.

상술한 실시예에서는, 현재 부호화 블록 및 주변 블록들이 이용할 수 있는 인트라 예측 모드의 수가 다른 경우를 고려하여, 방향성 예측 모드에 대해 MPM 후보가 예측 각도로 설정되는 것으로 설명하였다. In the above-described embodiment, it has been described that the MPM candidate is set as the prediction angle for the directional prediction mode in consideration of the case where the number of intra prediction modes that can be used by the current coding block and neighboring blocks is different.

다른 예로, 현재 부호화 블록 및 주변 블록들이 이용할 수 있는 인트라 예측 모드의 수가 동일하다면, 상기 MPM 후보는 방향성 예측 모드에 대해서도, 인트라 모드의 색인을 나타낼 수 있다. 또는, 현재 부호화 블록 및 주변 블록들이 이용할 수 있는 인트라 예측 모드의 수가 다른 경우라 하더라도, 상기 MPM 후보는 방향성 예측 모드에 대해서도, 인트라 예측 모드 색인을 나타내도록 설정될 수 있다. 이 경우, 이웃 블록의 방향성 예측 모드는, 현재 블록이 이용할 수 있는 방향성 예측 모드 중 가장 유사한 방향을 갖는 모드의 색인으로 양자화(또는 변환)될 수 있다. As another example, if the number of intra prediction modes that can be used by the current coding block and neighboring blocks is the same, the MPM candidate may indicate an index of the intra mode also for the directional prediction mode. Alternatively, even if the number of intra prediction modes available for the current coding block and neighboring blocks is different, the MPM candidate may be set to indicate an intra prediction mode index even for the directional prediction mode. In this case, the directional prediction mode of the neighboring block may be quantized (or transformed) into an index of a mode having the most similar direction among the directional prediction modes that the current block can use.

도 21은 MPM 후보를 설정하는 다른 예를 나타낸 도면이다. 21 is a diagram showing another example of setting an MPM candidate.

부호화 장치는 현재 부호화 블록에 이웃한 주변 블록을 기초로, 현재 부호화 블록에 대한 MPM 후보를 유도할 수 있다. 이때, 현재 부호화 블록에 이웃한 주변 블록은, 현재 부호화 블록의 상단에 인접한 블록, 현재 부호화 블록의 좌측에 인접한 블록 및 현재 부호화 블록의 코너에 인접한 블록 중 적어도 하나를 포함할 수 있다. The encoding apparatus may derive an MPM candidate for the current coding block based on neighboring blocks adjacent to the current coding block. In this case, the neighboring block adjacent to the current coding block may include at least one of a block adjacent to the top of the current coding block, a block adjacent to the left of the current coding block, and a block adjacent to a corner of the current coding block.

일 예로, 도 22는 현재 부호화 블록의 MPM 후보를 유도하기 위해 이용되는 주변 블록의 예를 나타낸다. 도 22를 참조하면, 현재 부호화 블록의 MPM 후보를 유도하기 위해, 현재 부호화 블록의 좌측 이웃 블록(A), 상단 이웃 블록(B), 좌측 하단 이웃 블록(C), 우측 상단 이웃 블록(D) 및 좌측 상단 이웃 블록(E)이 이용될 수 있다. As an example, FIG. 22 shows an example of a neighboring block used to derive an MPM candidate of a current coding block. Referring to FIG. 22, in order to derive an MPM candidate of a current coding block, a left neighboring block (A), a top neighboring block (B), a bottom left neighboring block (C), and a top right neighboring block (D) of the current coding block And the upper left neighboring block E may be used.

부호화 장치는 도 21에 도시된 우선 순위에 따라, MPM 후보를 생성할 수 있다. 현재 부호화 블록의 MPM 후보의 개수가 5개라 가정하면, 먼저, 주변 블록 A 및 주변 블록 B의 순서로 주변 블록의 인트라 예측 모드를 MPM 후보로 추가할 수 있다. 다음으로, Planar 모드 및 DC 모드 등 비방향성 모드를 MPM 후보로 추가할 수 있다. 다음으로, 주변 블록 C, 주변 블록 D 및 주변 블록 E의 순서로, 주변 블록의 인트라 예측 모드를 MPM 후보로 추가할 수 있다.The encoding apparatus may generate an MPM candidate according to the priority shown in FIG. 21. Assuming that the number of MPM candidates of the current coding block is 5, first, the intra prediction mode of the neighboring blocks may be added as MPM candidates in the order of neighboring blocks A and B. Next, non-directional modes such as a Planar mode and a DC mode can be added as MPM candidates. Next, the intra prediction mode of the neighboring blocks may be added as an MPM candidate in the order of the neighboring blocks C, D, and E.

MPM 후보의 개수가 최대 개수에 도달하지 않은 경우, 부호화 장치는 현재까지 결정된 MPM 후보 중 방향성 모드가 존재하는 경우, 방향성 모드와 유사한 방향을 갖는 모드(예컨대, 오프셋이 ±1인 방향성 모드)를 MPM 후보로 추가할 수 있다.If the number of MPM candidates has not reached the maximum number, the encoding apparatus MPMs a mode having a direction similar to the directional mode (eg, a directional mode with an offset of ± 1) if a directional mode is among the determined MPM candidates so far. Can be added as a candidate.

그럼에도 불구하고, MPM 후보의 개수가 최대 개수에 도달하지 않은 경우, 수직 모드, 수평 모드, 대각선 방향의 예측 모드(예컨대, 좌측 하단 방향의 예측 모드(인덱스 2인 예측 모드), 좌측 상단 방향의 예측 모드 또는 우측 상단 방향의 예측 모드 등)를 MPM 후보에 추가할 수 있다. Nevertheless, if the number of MPM candidates has not reached the maximum number, the vertical mode, the horizontal mode, the prediction mode in the diagonal direction (eg, the prediction mode in the lower left direction (the prediction mode with index 2), the prediction in the upper left direction Mode or a prediction mode in the upper right).

도 22에서는, 현재 부호화 블록에 인접한 주변 블록으로터 MPM 후보를 유도할 수 있는 것으로 도시되었다. 도 18 및 도 21에 도시한 실시예에 있어서, MPM 후보는, 현재 부호화 블록 또는 현재 부호화 블록에 인접한 주변 블록의 크기, 모양 또는 복호화 상태에 따라, 현재 부호화 블록에 인접하지 않은 주변 블록의 인트라 예측 모드에 기초하여 유도될 수도 있다. In FIG. 22, it is shown that MPM candidates can be derived from neighboring blocks adjacent to the current coding block. In the embodiments shown in FIGS. 18 and 21, the MPM candidates are intra predicted of neighboring blocks not adjacent to the current coding block, depending on the size, shape, or decoding state of the current coding block or neighboring blocks adjacent to the current coding block. It may be derived based on the mode.

일 예로, 도 23은 현재 부호화 블록에 인접하지 않은 주변 블록으로부터 MPM 후보를 유도하는 예를 나타낸 도면이다. For example, FIG. 23 is a diagram illustrating an example of deriving an MPM candidate from neighboring blocks that are not adjacent to the current coding block.

현재 부호화 블록의 상단 방향으로 연속하여 비정방형 블록(일 예로, 너비가 높이보다 큰 직사각형 형태의 블록), 현재 부호화 블록에 인접한 상단 주변 블록의 높이가, 현재 부호화 블록의 높이보다 작은 경우, 부호화 장치는, 상단 주변 블록의 인트라 예측 모드가 현재 부호화 블록의 인트라 예측 모드와 같지 않을 것으로 예측할 수 있다. 또는, 부호화 장치는 현재 부호화 블록의 상단에 인접한 주변 블록의 인트라 예측 모드가 세로 방향 예측 모드들 중 하나인 경우, 상단 주변 블록의 인트라 예측 모드가 현재 부호화 블록의 인트라 예측 모드와 같지 않을 것으로 예측할 수 있다.If the non-square block (eg, a rectangular block having a width greater than a height) continuously in the upper direction of the current coding block, and the height of the upper peripheral block adjacent to the current coding block is less than the height of the current coding block, the encoding device It may be predicted that the intra prediction mode of the upper neighboring block is not the same as the intra prediction mode of the current coding block. Alternatively, if the intra prediction mode of the neighboring block adjacent to the top of the current coding block is one of the vertical prediction modes, the encoding apparatus may predict that the intra prediction mode of the upper neighboring block is not the same as the intra prediction mode of the current coding block. have.

이 경우, 부호화 장치는 현재 부호화 블록에 인접한 블록, 즉, 좌측, 좌상단, 우상단 및 좌하단 주변 블록 중 적어도 하나로부터 추가 MPM 후보를 유도할 것을 고려할 수 있다. 또는, 부호화 장치는, 현재 부호화 블록에 인접하지 않지만, 주변 블록에 인접한 블록으로부터 추가 MPM 후보를 유도할 수도 있다. 일 예로, 도 23에 도시된 예에서, 부호화 장치는 현재 부호화 블록의 상단 방향에 인접한 블록(즉, 1st 상단 블록) 대신 두번째 상단 블록(즉, 2nd 상단 블록) 또는 그보다 더 상단에 있는 블록에 기초하여 MPM 후보를 유도할 수 있다. 또는 부호화 장치는 상단 방향이 아닌 특정 방향의 주변 블록의 인트라 예측 모드만을 이용하여 MPM 후보를 고려할 수도 있다.In this case, the encoding apparatus may consider deriving an additional MPM candidate from at least one of blocks adjacent to the current encoding block, that is, a left, upper left, upper right, and lower left peripheral blocks. Alternatively, the encoding apparatus may derive additional MPM candidates from blocks adjacent to the current block, but not adjacent to the current block. For example, in the example shown in Figure 23, the encoder is a block adjacent to the upper direction of the current coded block (i.e., 1 st upper block) instead of the second upper block (i.e., 2 nd upper block) or smaller blocks in the further top Based on the MPM candidate can be derived. Alternatively, the encoding apparatus may consider the MPM candidate by using only the intra prediction mode of neighboring blocks in a specific direction, not the top direction.

또한, 현재 부호화 블록의 좌측 방향으로 연속하여 비정방형 블록(일 예로, 높이가 너비보다 큰 직사각형 형태의 블록), 현재 부호화 블록에 인접한 좌측 주변 블록의 너비가, 현재 부호화 블록의 너비보다 작은 경우, 부호화 장치는, 좌측 주변 블록의 인트라 예측 모드가 현재 부호화 블록의 인트라 예측 모드와 같지 않을 것으로 예측할 수 있다. 또는, 부호화 장치는 현재 부호화 블록의 좌측에 인접한 주변 블록의 인트라 예측 모드가 가로 방향 예측 모드들 중 하나인 경우, 좌측 주변 블록의 인트라 예측 모드가 현재 부호화 블록의 인트라 예측 모드와 같지 않을 것으로 예측할 수 있다.In addition, when the non-square block (eg, a rectangular block having a height greater than the width) continuously in the left direction of the current coding block, and the width of the left peripheral block adjacent to the current coding block is smaller than the width of the current coding block, The encoding apparatus may predict that the intra prediction mode of the left neighboring block is not the same as the intra prediction mode of the current coding block. Alternatively, if the intra prediction mode of the neighboring block adjacent to the left side of the current coding block is one of the horizontal prediction modes, the encoding apparatus may predict that the intra prediction mode of the left neighboring block is not the same as the intra prediction mode of the current coding block. have.

이 경우, 부호화 장치는 현재 부호화 블록에 인접한 블록, 즉, 상단, 좌상단, 우상단 및 좌하단 주변 블록 중 적어도 하나로부터 추가 MPM 후보를 유도할 것을 고려할 수 있다. 또는, 부호화 장치는, 현재 부호화 블록에 인접하지 않지만, 주변 블록에 인접한 블록으로부터 추가 MPM 후보를 유도할 수도 있다. 일 예로, 도 23에 도시된 예에서, 부호화 장치는 현재 부호화 블록의 좌측 방향에 인접한 블록(즉, 1st 좌측 블록) 대신 두번째 좌측 블록(즉, 2nd 좌측 블록) 또는 그보다 더 좌측에 있는 블록에 기초하여 MPM 후보를 유도할 수 있다. 또는 부호화 장치는 좌측 방향이 아닌 특정 방향의 주변 블록의 인트라 예측 모드만을 이용하여 MPM 후보를 고려할 수도 있다.In this case, the encoding apparatus may consider deriving an additional MPM candidate from at least one of blocks adjacent to the current coding block, that is, upper, upper left, upper right, and lower left peripheral blocks. Alternatively, the encoding apparatus may derive additional MPM candidates from blocks adjacent to the current block, but not adjacent to the current block. For example, in the example shown in Figure 23, the encoder is now a block adjacent to the left direction of the encoded block (i.e., 1 st left block) instead of the second left block (i.e., 2 nd left blocks), or block than the more left Based on the MPM candidate can be derived. Alternatively, the encoding apparatus may consider the MPM candidate by using only the intra prediction mode of neighboring blocks in a specific direction, not the left direction.

현재 부호화 블록의 MPM 후보가 결정되면, 현재 부호화 블록의 인트라 예측 모드와 MPM 후보들을 비교하여, 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는지 판단할 수 있다. 부호화 장치는 상기 판단 결과에 따라, 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는지 여부를 나타내는 정보를 부호화할 수 있다(S1702). 일 예로, 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는 경우, 상기 정보는 참으로 부호화되고, 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하지 않는 경우, 상기 정보는 거짓으로 부호화될 수 있다.When the MPM candidate of the current coding block is determined, it is possible to compare the intra prediction mode and the MPM candidates of the current coding block to determine whether there is the same MPM candidate as the intra prediction mode of the current coding block. According to the determination result, the encoding apparatus may encode information indicating whether an MPM candidate identical to the intra prediction mode of the current coding block exists (S1702). For example, if the same MPM candidate as the intra prediction mode of the current coding block exists, the information is indeed encoded, and if the same MPM candidate as the intra prediction mode of the current coding block does not exist, the information is falsely encoded Can be.

현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는 것으로 판단되는 경우(S1703), 부호화 장치는 MPM 후보 중 현재 부호화 블록의 인트라 예측 모드와 동일한 MPM 후보를 특정하는 인덱스 정보를 부호화할 수 있다(S1704). When it is determined that the same MPM candidate as the intra prediction mode of the current coding block exists (S1703), the encoding apparatus may encode index information specifying the same MPM candidate as the intra prediction mode of the current coding block among the MPM candidates (S1703). S1704).

반면, 현재 부호화 블록이 인트라 예측 모드와 동일한 MPM 후보가 존재하지 않는 것으로 판단되는 경우(S1703), 부호화 장치는 MPM 후보로 설정된 인트라 예측 모드를 제외한 인트라 예측 모드들 중 현재 부호화 블록에 대해 최적인 인트라 예측 모드를 부호화한다(S1705). 구체적으로, 현재 부호화 블록이 이용할 수 있는 모든 인트라 예측 모드에서, MPM 후보로 설정된 인트라 예측 모드들을 제외한 뒤, 잔여 인트라 예측 모드를 표현할 수 있을 만큼 비트를 할당하여, 잔여 예측 모드들 중 현재 부호화 블록의 인트라 예측 모드에 해당하는 정보를 부호화할 수 있다. On the other hand, if it is determined that the current coding block does not have the same MPM candidate as the intra prediction mode (S1703), the encoding device is the intra intra optimal for the current coding block among the intra prediction modes except the intra prediction mode set as the MPM candidate. The prediction mode is encoded (S1705). Specifically, in all intra prediction modes that can be used by the current coding block, after excluding intra prediction modes set as MPM candidates, bits are allocated to express the remaining intra prediction modes, and the current coding block among the remaining prediction modes is Information corresponding to the intra prediction mode can be encoded.

잔여 인트라 예측 모드들을 부호화할 때, 비트를 할당함에 있어서, 잔여 인트라 예측 모드를 표현할수 있을 만큼의 비트를 고정적으로 할당할 수도 있지만, 잔여 인트라 예측 모드들을 N개의 그룹으로 나누고, 각 그룹 별로 할당 비트를 달리 설정할 수도 있다. 일 예로, 현재 부호화 블록에서 이용 가능한 인트라 예측 모드의 수가 67개이고, MPM 후보의 개수가 6개 일 때, 잔여 인트라 예측 모드의 개수는 61개이다. 이 때, 잔여 인트라 예측 모드들을 (A, B) 2개의 그룹으로 나눌 때, A 그룹에는 16개의 인트라 예측 모드를, B 그룹에는 45개의 인트라 예측 모드를 할당한다. 여기서, 현재 부호화 블록의 인트라 예측 모드가 어떤 그룹에 속하는지를 알려주는 플래그 정보를 부호화할 수도 있다. A 그룹은 4비트를 할당하여 현재 부호화 블록의 인트라 예측 모드를 부호화할 수 있고, B 그룹은 다시 (B-1, B-2) 2개의 서브 그룹으로 나누어, B-1 그룹에는 19개의 인트라 예측 모드, B-2 그룹에는 26개의 인트라 예측 모드를 할당하고, B-1 그룹은 5비트, B-2 그룹은 6비트를 할당하여 현재 부호화 블록의 인트라 예측 모드를 부호화할 수도 있다. 상기 부호화된 정보들은 부호화되어, 비트스트림을 통해 복호화 장치로 전송될 수 있다.When encoding the residual intra prediction modes, while allocating bits, bits sufficient to express the residual intra prediction modes may be fixedly allocated, but the remaining intra prediction modes are divided into N groups and allocated bits for each group. Can be set differently. For example, when the number of intra prediction modes available in the current coding block is 67 and the number of MPM candidates is 6, the number of remaining intra prediction modes is 61. At this time, when the remaining intra prediction modes are divided into two groups (A, B), 16 intra prediction modes are assigned to the A group, and 45 intra prediction modes are assigned to the B group. Here, flag information indicating to which group the intra prediction mode of the current coding block belongs may be encoded. The group A can allocate 4 bits to encode the intra prediction mode of the current coding block, and the group B is divided into (B-1, B-2) two subgroups, and 19 intra predictions for the group B-1. 26 intra prediction modes are allocated to the mode and the B-2 group, and 5 bits are allocated to the B-1 group and 6 bits are allocated to the B-2 group to encode the intra prediction mode of the current coding block. The encoded information may be encoded and transmitted to a decoding device through a bitstream.

다음으로, 복호화 장치에서 현재 복호화 블록에 대한 인트라 예측 모드를 복호화하는 것에 대해 살펴보기로 한다.Next, decoding of the intra prediction mode for the current decoding block in the decoding apparatus will be described.

도 24는 현재 복호화 블록에 대한 인트라 예측 모드를 복호화하는 과정을 나타낸 흐름도이다.24 is a flowchart illustrating a process of decoding an intra prediction mode for a current decoding block.

도 24를 참조하면, 먼저 복호화 장치는, 현재 복호화 블록에 대한 MPM 후보를 결정할 수 있다(S2401). 복호화 장치는 앞서 설명한 부호화 과정에서와 동일하게, 현재 복호화 블록에 이웃하는 이웃 블록들의 인트라 예측 모드를 고려하여, 현재 복호화 블록에 대한 MPM 후보를 결정할 수 있다.Referring to FIG. 24, first, the decoding apparatus may determine an MPM candidate for the current decoding block (S2401). The decoding apparatus may determine the MPM candidate for the current decoding block in consideration of the intra prediction mode of neighboring blocks neighboring the current decoding block, as in the encoding process described above.

이후, 복호화 장치는, 비트스트림으로부터, MPM 후보들 중, 현재 복호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는지 여부를 타나내는 정보를 복호화할 수 있다(S2402). 상기 정보는 1비트의 플래그일 수 있으나, 이에 한정되는 것은 아니다. Thereafter, the decoding apparatus may decode information indicating whether an MPM candidate identical to the intra prediction mode of the current decoding block is present among the MPM candidates from the bitstream (S2402). The information may be a flag of 1 bit, but is not limited thereto.

상기 정보에 기초하여, 현재 복호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하는 것으로 판단되는 경우(S2403), 복호화 장치는 MPM 후보 중 현재 복호화 블록의 인트라 예측 모드와 동일한 MPM 후보를 특정하는 색인 정보를 복호화할 수 있다(S2404).Based on the above information, when it is determined that the same MPM candidate as the intra prediction mode of the current decoding block exists (S2403), the decoding apparatus index information specifying the same MPM candidate as the intra prediction mode of the current decoding block among the MPM candidates Can be decoded (S2404).

반면, 현재 복호화 블록의 인트라 예측 모드와 동일한 MPM 후보가 존재하지 않는 것으로 판단되는 경우(S2403), 복호화 장치는, MPM 후보로 설정된 인트라 예측 모드를 제외한 잔여 인트라 예측 모드들 중 현재 복호화 블록에 대해 최적의 예측 모드를 가리키는 잔여 예측 모드 정보를 복호화할 수 있다(S2405).On the other hand, if it is determined that the same MPM candidate as the intra prediction mode of the current decoding block does not exist (S2403), the decoding apparatus is optimal for the current decoding block among the remaining intra prediction modes except the intra prediction mode set as the MPM candidate. Residual prediction mode information indicating the prediction mode may be decoded (S2405).

상술한 예에서는, MPM 후보를 이용하여, 현재 부호화/복호화 블록의 인트라 예측 모드를 결정하는 것으로 설명하였으나, MPM 후보를 이용함이 없이, 현재 부호화/복호화 블록의 인트라 예측 모드를 결정할 수도 있다. 이 경우, 현재 부호화/복호화 블록의 인트라 예측 모드를 특정하는 정보가 비트스트림을 통해 복호화 장치로 전송될 수 있다. In the above-described example, the intra prediction mode of the current encoding / decoding block is determined by using the MPM candidate, but the intra prediction mode of the current encoding / decoding block may be determined without using the MPM candidate. In this case, information specifying the intra prediction mode of the current encoding / decoding block may be transmitted to the decoding apparatus through a bitstream.

본 개시의 예시적인 방법들은 설명의 명확성을 위해서 동작의 시리즈로 표현되어 있지만, 이는 단계가 수행되는 순서를 제한하기 위한 것은 아니며, 필요한 경우에는 각각의 단계가 동시에 또는 상이한 순서로 수행될 수도 있다. 본 개시에 따른 방법을 구현하기 위해서, 예시하는 단계에 추가적으로 다른 단계를 포함하거나, 일부의 단계를 제외하고 나머지 단계를 포함하거나, 또는 일부의 단계를 제외하고 추가적인 다른 단계를 포함할 수도 있다.Exemplary methods of the present disclosure are expressed as a series of operations for clarity of description, but are not intended to limit the order in which the steps are performed, and each step may be performed simultaneously or in a different order if necessary. In order to implement the method according to the present disclosure, the steps illustrated may include other steps in addition, other steps may be included in addition to the remaining steps, or other additional steps may be included in addition to some steps.

본 개시의 다양한 실시 예는 모든 가능한 조합을 나열한 것이 아니고 본 개시의 대표적인 양상을 설명하기 위한 것이며, 다양한 실시 예에서 설명하는 사항들은 독립적으로 적용되거나 또는 둘 이상의 조합으로 적용될 수도 있다.Various embodiments of the present disclosure are not intended to list all possible combinations, but are intended to describe representative aspects of the present disclosure, and the items described in various embodiments may be applied independently or in combination of two or more.

또한, 본 개시의 다양한 실시 예는 하드웨어, 펌웨어(firmware), 소프트웨어, 또는 그들의 결합 등에 의해 구현될 수 있다. 하드웨어에 의한 구현의 경우, 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 범용 프로세서(general processor), 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다. In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. For implementation by hardware, one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), Universal It can be implemented by a processor (general processor), a controller, a microcontroller, a microprocessor.

본 개시의 범위는 다양한 실시 예의 방법에 따른 동작이 장치 또는 컴퓨터 상에서 실행되도록 하는 소프트웨어 또는 머신-실행가능한 명령들(예를 들어, 운영체제, 애플리케이션, 펌웨어(firmware), 프로그램 등), 및 이러한 소프트웨어 또는 명령 등이 저장되어 장치 또는 컴퓨터 상에서 실행 가능한 비-일시적 컴퓨터-판독가능 매체(non-transitory computer-readable medium)를 포함한다. The scope of the present disclosure includes software or machine-executable instructions (eg, operating systems, applications, firmware, programs, etc.) that cause an operation according to the method of various embodiments to be executed on a device or computer, and such software or Instructions include a non-transitory computer-readable medium that is stored and executable on a device or computer.

Claims (9)

현재 부호화 블록이 이용 가능한 인트라 예측 모드 중에서 상기 현재 부호화 블록의 인트라 예측 모드를 유도하는 단계; 및
상기 유도된 인트라 예측 모드를 기반으로 인트라 예측을 수행하여, 상기 현재 부호화 블록의 예측 블록을 생성하는 단계를 포함하되,
상기 현재 부호화 블록이 이용 가능한 인트라 예측 모드는 K개의 그룹으로 나누어지고,
상기 현재 부호화 블록의 인트라 예측 모드는 상기 K개의 그룹 중 어느 하나으로부터 유도되며,
상기 K는 3 또는 그 이상의 자연수인, 영상 신호 복호화 방법.
Deriving an intra prediction mode of the current coding block among intra prediction modes in which the current coding block is available; And
And performing intra prediction based on the derived intra prediction mode to generate a prediction block of the current coding block,
The intra prediction mode in which the current coding block is available is divided into K groups,
The intra prediction mode of the current coding block is derived from any one of the K groups,
The K is a natural number of 3 or more, video signal decoding method.
제1항에 있어서,
비트스트림으로부터, 상기 K개의 그룹 중 상기 현재 부호화 블록의 인트라 예측 모드가 속한 그룹을 특정하는 플래그를 획득하는 단계; 및
상기 획득된 플래그를 기반으로, 상기 현재 부호화 블록의 인트라 예측 모드가 속한 그룹을 결정하는 단계를 더 포함하는, 영상 신호 복호화 방법.
According to claim 1,
Obtaining, from a bitstream, a flag specifying a group to which the intra prediction mode of the current coding block belongs among the K groups; And
And determining a group to which the intra prediction mode of the current coding block belongs, based on the obtained flag.
제2항에 있어서,
상기 현재 부호화 블록에 대해서 획득되는 플래그의 최대 개수는 (K-1)개인, 영상 신호 복호화 방법.
According to claim 2,
The maximum number of flags acquired for the current coding block is (K-1) individual, and the video signal decoding method.
제1항에 있어서,
상기 K개의 그룹 중 어느 하나는 5개의 MPM 후보로 구성되는, 영상 신호 복호화 방법.
According to claim 1,
Any one of the K groups is composed of 5 MPM candidates, video signal decoding method.
제4항에 있어서,
상기 MPM 후보는 상기 현재 부호화 블록에 이웃한 주변 블록의 인트라 예측 모드를 기반으로 유도되고,
상기 주변 블록은 상기 현재 부호화 블록의 좌측 주변 블록 또는 상단 주변 블록 중 적어도 하나를 포함하는, 영상 신호 복호화 방법.
According to claim 4,
The MPM candidate is derived based on an intra prediction mode of neighboring blocks adjacent to the current coding block,
The peripheral block includes at least one of a left peripheral block or an upper peripheral block of the current coding block.
제5항에 있어서,
상기 상단 주변 블록이 복수개인 경우, 상기 상단 주변 블록 중 최-우측에 위치한 블록이 상기 현재 블록의 MPM 후보를 유도하기 위해 이용되는, 영상 신호 복호화 방법.
The method of claim 5,
When there are a plurality of upper peripheral blocks, a block located at the rightmost of the upper peripheral blocks is used to derive an MPM candidate of the current block.
제5항에 있어서,
상기 좌측 주변 블록이 복수개인 경우, 상기 좌측 주변 블록 중 최-하단에 위치한 블록이 상기 현재 블록의 MPM 후보를 유도하기 위해 이용되는, 영상 신호 복호화 방법.
The method of claim 5,
When there are a plurality of left peripheral blocks, a block located at the bottom-most of the left peripheral blocks is used to derive an MPM candidate of the current block.
현재 부호화 블록이 이용 가능한 인트라 예측 모드 중에서 상기 현재 부호화 블록의 인트라 예측 모드를 결정하는 단계; 및
상기 결정된 인트라 예측 모드를 기반으로 인트라 예측을 수행하여, 상기 현재 부호화 블록의 예측 블록을 생성하는 단계를 포함하되,
상기 현재 부호화 블록이 이용 가능한 인트라 예측 모드는 K개의 그룹으로 나누어지고,
상기 현재 부호화 블록의 인트라 예측 모드는 상기 K개의 그룹 중 어느 하나으로부터 결정되고,
상기 K는 3 또는 그 이상의 자연수인, 영상 신호 부호화 방법.
Determining an intra prediction mode of the current coding block among intra prediction modes in which the current coding block is available; And
And performing intra prediction based on the determined intra prediction mode to generate a prediction block of the current coding block,
The intra prediction mode in which the current coding block is available is divided into K groups,
The intra prediction mode of the current coding block is determined from any one of the K groups,
The K is a natural number of 3 or more, video signal encoding method.
영상 신호 복호화 방법에 의해 복호화되는 비트스트림을 저장하는 컴퓨터로 판독가능한 기록 매체에 있어서,
상기 영상 신호 복호화 방법은,
현재 부호화 블록이 이용 가능한 인트라 예측 모드 중에서 상기 현재 부호화 블록의 인트라 예측 모드를 유도하는 단계; 및
상기 유도된 인트라 예측 모드를 기반으로 인트라 예측을 수행하여, 상기 현재 부호화 블록의 예측 블록을 생성하는 단계를 포함하고,
상기 현재 부호화 블록이 이용 가능한 인트라 예측 모드는 K개의 그룹으로 나누어지며,
상기 현재 부호화 블록의 인트라 예측 모드는 상기 K개의 그룹 중 어느 하나으로부터 유도되고,
상기 K는 3 또는 그 이상의 자연수인, 컴퓨터로 판독가능한 기록 매체.
A computer-readable recording medium storing a bitstream decoded by a video signal decoding method, comprising:
The video signal decoding method,
Deriving an intra prediction mode of the current coding block among intra prediction modes in which the current coding block is available; And
And performing intra prediction based on the derived intra prediction mode to generate a prediction block of the current coding block,
The intra prediction mode in which the current coding block is available is divided into K groups,
The intra prediction mode of the current coding block is derived from any one of the K groups,
Where K is a natural number of 3 or more, computer-readable recording medium.
KR1020200046561A 2016-04-29 2020-04-17 Method and apparatus for encoding/decoding a video signal KR102435493B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220103515A KR20220119583A (en) 2016-04-29 2022-08-18 Method and apparatus for encoding/decoding a video signal

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
KR1020160052706 2016-04-29
KR20160052706 2016-04-29
KR1020170050053A KR102360795B1 (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020170050053A Division KR102360795B1 (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020220103515A Division KR20220119583A (en) 2016-04-29 2022-08-18 Method and apparatus for encoding/decoding a video signal

Publications (2)

Publication Number Publication Date
KR20200043352A true KR20200043352A (en) 2020-04-27
KR102435493B1 KR102435493B1 (en) 2022-08-23

Family

ID=60385681

Family Applications (4)

Application Number Title Priority Date Filing Date
KR1020170050053A KR102360795B1 (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal
KR1020200046561A KR102435493B1 (en) 2016-04-29 2020-04-17 Method and apparatus for encoding/decoding a video signal
KR1020220014823A KR20220020325A (en) 2016-04-29 2022-02-04 Method and apparatus for encoding/decoding a video signal
KR1020220103515A KR20220119583A (en) 2016-04-29 2022-08-18 Method and apparatus for encoding/decoding a video signal

Family Applications Before (1)

Application Number Title Priority Date Filing Date
KR1020170050053A KR102360795B1 (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal

Family Applications After (2)

Application Number Title Priority Date Filing Date
KR1020220014823A KR20220020325A (en) 2016-04-29 2022-02-04 Method and apparatus for encoding/decoding a video signal
KR1020220103515A KR20220119583A (en) 2016-04-29 2022-08-18 Method and apparatus for encoding/decoding a video signal

Country Status (1)

Country Link
KR (4) KR102360795B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020040439A1 (en) * 2018-08-21 2020-02-27 엘지전자 주식회사 Intra prediction method and device in image coding system
CN112640453B (en) 2018-09-13 2023-03-10 华为技术有限公司 Method and apparatus for intra prediction
WO2023163374A1 (en) * 2022-02-22 2023-08-31 현대자동차주식회사 Method for configuring mpm list in intra prediction

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120062306A (en) * 2010-12-06 2012-06-14 에스케이 텔레콤주식회사 Method and apparatus for image encoding/decoding by inter prediction using arbitrary shape block
US20150365692A1 (en) * 2013-04-09 2015-12-17 Mediatek Singapore Pte. Ltd. Method and Apparatus for Non-Square Intra Mode Coding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120062306A (en) * 2010-12-06 2012-06-14 에스케이 텔레콤주식회사 Method and apparatus for image encoding/decoding by inter prediction using arbitrary shape block
US20150365692A1 (en) * 2013-04-09 2015-12-17 Mediatek Singapore Pte. Ltd. Method and Apparatus for Non-Square Intra Mode Coding

Also Published As

Publication number Publication date
KR20220020325A (en) 2022-02-18
KR20170124081A (en) 2017-11-09
KR20220119583A (en) 2022-08-30
KR102435493B1 (en) 2022-08-23
KR102360795B1 (en) 2022-02-10

Similar Documents

Publication Publication Date Title
KR102391235B1 (en) Video signal encoding/decoding method and apparatus
KR102618513B1 (en) Encoding And Decoding Methods For Video Information
US20230291923A1 (en) Method and apparatus for processing video signal
KR102470831B1 (en) Method and apparatus for processing a video signal
KR102383105B1 (en) Method and apparatus for processing a video signal
CN109328461B (en) Video signal encoding/decoding method and apparatus
US20190281297A1 (en) Method and apparatus for processing video signal
KR102061201B1 (en) Methods of transformation based on block information and appratuses using the same
KR102471209B1 (en) Method and apparatus for processing a video signal
KR102435493B1 (en) Method and apparatus for encoding/decoding a video signal
KR20230110701A (en) Method and apparatus for encoding/decoding a video signal
KR20190113656A (en) Method and apparatus for processing video signal
CN116916000A (en) Video signal encoding/decoding method and apparatus
KR20220007541A (en) Encoding information determination method based on Neural Network
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20200074877A (en) A video encoding/decoding method and apparatus
KR102365937B1 (en) Method and apparatus for encoding/decoding a video signal
KR20170124077A (en) Method and apparatus for encoding/decoding a video signal
KR20200026394A (en) A method and an apparatus for encoding/decoding a intra prediction
KR102557740B1 (en) Method and apparatus for encoding/decoding a video signal
KR102516137B1 (en) Methods of coding intra prediction mode using two candidate intra prediction modes and apparatuses using the same
KR102525555B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR102390731B1 (en) A method and an apparatus for encoding/decoding residual coefficient
KR20220061085A (en) Method and apparatus for encoding/decoding a video signal
KR20220024390A (en) Method and apparatus for encoding/decoding a video signal

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
AMND Amendment
X701 Decision to grant (after re-examination)
A107 Divisional application of patent
GRNT Written decision to grant