KR20240024755A - Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method - Google Patents

Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method Download PDF

Info

Publication number
KR20240024755A
KR20240024755A KR1020230106471A KR20230106471A KR20240024755A KR 20240024755 A KR20240024755 A KR 20240024755A KR 1020230106471 A KR1020230106471 A KR 1020230106471A KR 20230106471 A KR20230106471 A KR 20230106471A KR 20240024755 A KR20240024755 A KR 20240024755A
Authority
KR
South Korea
Prior art keywords
prediction
block
unit
prediction unit
information
Prior art date
Application number
KR1020230106471A
Other languages
Korean (ko)
Inventor
이배근
Original Assignee
주식회사 엑스리스
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 엑스리스 filed Critical 주식회사 엑스리스
Publication of KR20240024755A publication Critical patent/KR20240024755A/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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness

Abstract

본 개시에 따른 영상 복호화 방법은, 현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계; 상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및 상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도될 수 있다. An image decoding method according to the present disclosure includes obtaining a first prediction block based on first prediction information for a first prediction unit in a current block; Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and obtaining a final prediction block for the current block based on the first prediction block and the second prediction block. At this time, in the blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, the first prediction samples in the first prediction block and the second prediction samples in the second prediction block The final prediction sample can be derived by blending the prediction samples.

Description

영상 신호 부호화/복호화 방법 및 이를 기초로 생성된 비트스트림을 저장하는 기록 매체{METHOD FOR ENCODING/DECODING A VIDEO SIGNAL AND RECORDING MEDIUM STORING A BITSTERAM GENERATED BASED ON THE METHOD}Video signal encoding/decoding method and recording medium for storing bitstream generated based on the same {METHOD FOR ENCODING/DECODING A VIDEO SIGNAL AND RECORDING MEDIUM STORING A BITSTERAM GENERATED BASED ON THE METHOD}

본 개시는 영상 신호 부호화/복호화 방법 및 이를 기초로 생성된 비트스트림을 저장하는 기록 매체에 관한 것이다.The present disclosure relates to a video signal encoding/decoding method and a recording medium for storing a bitstream generated based on the same.

디스플레이 패널이 점점 더 대형화되는 추세에 따라 점점 더 높은 화질의 비디오 서비스가 요구되고 있다. 고화질 비디오 서비스의 가장 큰 문제는 데이터량이 크게 증가하는 것이며, 이러한 문제를 해결하기 위해, 비디오 압축율을 향상시키기 위한 연구가 활발하게 진행되고 있다. 대표적인 예로, 2009년에 MPEG(Motion Picture Experts Group)과 ITU-T(International Telecommunication Union-Telecommunication) 산하의 VCEG(Video Coding Experts Group)에서는 JCT-VC(Joint Collaborative Team on Video Coding)를 결성하였다. JCT-VC는 H.264/AVC에 비해 약 2배의 압축 성능을 갖는 비디오 압축 표준인 HEVC(High Efficiency Video Coding)를 제안하였으며, 2013년 1월 25일에 표준 승인되었다. 고화질 비디오 서비스의 급격한 발전에 따라 HEVC의 성능도 점차 적으로 그 한계를 드러내고 있다.As display panels become increasingly larger, video services of higher quality are increasingly required. The biggest problem with high-definition video services is a significant increase in data volume, and to solve this problem, research is actively being conducted to improve video compression rates. As a representative example, in 2009, the Motion Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) under the International Telecommunication Union-Telecommunication (ITU-T) formed the Joint Collaborative Team on Video Coding (JCT-VC). JCT-VC proposed HEVC (High Efficiency Video Coding), a video compression standard with about twice the compression performance of H.264/AVC, and was approved as a standard on January 25, 2013. With the rapid development of high-definition video services, the performance of HEVC is gradually revealing its limitations.

본 개시는 비디오 신호를 부호화/복호화함에 있어서, 기하학 분할을 수반하는 머지 모드에 기반하여 블록을 예측하는 방법을 제공한다.The present disclosure provides a method for predicting blocks based on merge mode involving geometric partitioning when encoding/decoding video signals.

본 개시는 비디오 신호를 부호화/복호화함에 있어서, 기하학 분할을 수반하는 머지 모드가 적용되는 경우, 오프셋 벡터를 이용하여, 움직임 벡터를 수정하는 방법을 제공한다.The present disclosure provides a method for modifying a motion vector using an offset vector when a merge mode involving geometric segmentation is applied when encoding/decoding a video signal.

본 개시는 비디오 신호를 부호화/복호화함에 있어서, 블록 내 예측 유닛들 각각에 상이한 예측 모드를 설정하는 방법을 제공한다.The present disclosure provides a method of setting a different prediction mode for each prediction unit within a block when encoding/decoding a video signal.

본 개시는 비디오 신호를 부호화/복호화함에 있어서, 기하학 분할이 적용된 블록에 대한 블렌딩 영역의 크기를 가변적으로 결정하는 방법을 제공한다. The present disclosure provides a method of variably determining the size of a blending area for a block to which geometric division is applied when encoding/decoding a video signal.

본 개시에서 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급하지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical problems to be achieved by this disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned can be clearly understood by those skilled in the art from the description below. You will be able to.

본 개시에 따른 영상 복호화 방법은, 현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계; 상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및 상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도될 수 있다.An image decoding method according to the present disclosure includes obtaining a first prediction block based on first prediction information for a first prediction unit in a current block; Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and obtaining a final prediction block for the current block based on the first prediction block and the second prediction block. At this time, in the blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, the first prediction samples in the first prediction block and the second prediction samples in the second prediction block The final prediction sample can be derived by blending the prediction samples.

본 개시에 따른 영상 부호화 방법은, 현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계; 상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및 상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도될 수 있다.An image encoding method according to the present disclosure includes obtaining a first prediction block based on first prediction information for a first prediction unit in a current block; Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and obtaining a final prediction block for the current block based on the first prediction block and the second prediction block. At this time, in the blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, the first prediction samples in the first prediction block and the second prediction samples in the second prediction block The final prediction sample can be derived by blending the prediction samples.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 블렌딩 영역의 크기는, 복수의 블렌딩 영역 크기 후보들 중 하나에 기초하여 결정될 수 있다.In the video signal encoding/decoding method according to the present disclosure, the size of the blending area may be determined based on one of a plurality of blending area size candidates.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하는 것은, 비트스트림으로부터 복호화되는 인덱스 정보에 기반하여 수행될 수 있다.In the video signal encoding/decoding method according to the present disclosure, selecting one of the plurality of blending area size candidates may be performed based on index information decoded from a bitstream.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하는 것은, 상기 제1 예측 유닛의 움직임 정보 및 상기 제2 예측 유닛의 움직임 정보 중 적어도 하나를 기초로 수행될 수 있다. In the video signal encoding/decoding method according to the present disclosure, selecting one of the plurality of blending area size candidates is based on at least one of motion information of the first prediction unit and motion information of the second prediction unit. It can be done.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 블렌딩 영역 내 상기 제1 예측 샘플들에 적용되는 제1 가중치 및 상기 제2 예측 샘플들에 적용되는 제2 가중치는, 위치에 따라 적응적으로 결정될 수 있다.In the video signal encoding/decoding method according to the present disclosure, the first weight applied to the first prediction samples and the second weight applied to the second prediction samples in the blending region are adaptively adjusted according to location. can be decided.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 블렌딩 영역 내 상기 제1 가중치의 변화 정도를 나타내는 기울기는, 상기 블렌딩 영역의 크기와 반비례할 수 있다.In the video signal encoding/decoding method according to the present disclosure, a slope indicating the degree of change in the first weight within the blending area may be inversely proportional to the size of the blending area.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 복수의 블렌딩 영역 크기 후보는, 상기 경계를 기준으로, 상기 제1 예측 유닛 방향으로의 크기와 상기 제2 예측 유닛 방향으로의 크기가 상이한 비대칭 블렌딩 영역 크기 후보를 포함할 수 있다.In the video signal encoding/decoding method according to the present disclosure, the plurality of blending area size candidates are asymmetric in that the size in the direction of the first prediction unit is different from the size in the direction of the second prediction unit with respect to the boundary. Can include blending area size candidates.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 예측 모드가 상이한 경우, 상기 블렌딩 영역은, 상기 경계를 기준으로 비대칭 형태를 띌 수 있다.In the video signal encoding/decoding method according to the present disclosure, when prediction modes between the first prediction unit and the second prediction unit are different, the blending area may have an asymmetric shape with respect to the boundary.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛에 인트라 예측이 적용되고, 상기 제2 예측 유닛에 인터 예측이 적용되는 경우, 상기 경계를 기준으로, 상기 제1 예측 유닛 방향으로의 상기 블렌딩 영역의 크기가, 상기 제2 예측 유닛 방향으로의 상기 블렌딩 영역의 크기보다 작을 수 있다.In the video signal encoding/decoding method according to the present disclosure, when intra prediction is applied to the first prediction unit and inter prediction is applied to the second prediction unit, the direction of the first prediction unit is based on the boundary. The size of the blending area may be smaller than the size of the blending area in the second prediction unit direction.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛의 인트라 예측 모드는, 플래너 모드, 상기 현재 블록을 이분할하는 분할선에 평행인 인트라 예측 모드 또는 상기 분할선에 수직인 인트라 예측 모드 중 하나로 결정될 수 있다.In the video signal encoding/decoding method according to the present disclosure, the intra prediction mode of the first prediction unit is a planner mode, an intra prediction mode parallel to a dividing line dividing the current block into two, or an intra prediction mode perpendicular to the dividing line. It can be decided on one of the prediction modes.

본 개시에 대하여 위에서 간략하게 요약된 특징들은 후술하는 본 개시의 상세한 설명의 예시적인 양상일 뿐이며, 본 개시의 범위를 제한하는 것은 아니다.The features briefly summarized above with respect to the present disclosure are merely exemplary aspects of the detailed description of the present disclosure described below, and do not limit the scope of the present disclosure.

본 개시에 의하면, 기하학 분할을 수반하는 머지 모드를 이용함으로써, 블록의 예측 정확도를 향상시킬 수 있다. According to the present disclosure, block prediction accuracy can be improved by using a merge mode involving geometric partitioning.

본 개시에 의하면, 기하학 분할을 수반하는 머지 모드가 적용되는 경우, 오프셋 벡터를 이용하여, 움직임 벡터를 수정함으로써, 블록의 예측 정확도를 향상시킬 수 있다. According to the present disclosure, when a merge mode involving geometric partitioning is applied, prediction accuracy of a block can be improved by modifying a motion vector using an offset vector.

본 개시에 의하면, 블록 내 예측 유닛들 각각에 상이한 예측 모드를 설정하는 방법을 제공함으로써, 예측 정확도를 향상시킬 수 있다. According to the present disclosure, prediction accuracy can be improved by providing a method of setting a different prediction mode for each prediction unit in a block.

본 개시에 의하면, 블록 내 블렌딩이 수행되는 영역의 크기를 가변적으로 결정하는 방법을 제공함으로써, 예측 정확도를 향상시킬 수 있다. According to the present disclosure, prediction accuracy can be improved by providing a method for variably determining the size of an area where intra-block blending is performed.

본 개시에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the description below. will be.

도 1은 본 개시의 일 실시예에 따른 영상 부호화기(인코더기)의 블록도이다.
도 2는 본 개시의 일 실시예에 따른 영상 복호화기(디코더기)의 블록도이다.
도 3은 본 개시의 일 실시예에 따른 기본 코딩 트리 유닛을 도시한 도면이다.
도 4는 코딩 블록의 다양한 분할 형태를 나타낸 도면이다.
도 5는 코딩 트리 유닛의 분할 양상을 예시한 도면이다.
도 6은 본 개시의 일 실시예에 따른 인터 예측 방법의 흐름도이다.
도 7은 머지 모드 하에서 현재 블록의 움직임 정보를 유도하는 과정의 흐름도이다.
도 8은 머지 후보 블록들을 예시한 예시도이다.
도 9는 코딩 블록을 분할하는 분할선들의 종류를 나타낸 도면이다.
도 10은 제1 예측 유닛 및 제2 예측 유닛 각각에 상이한 예측 모드가 적용되는 예를 나타낸 것이다.
도 11은 제1 예측 유닛 및 제2 예측 유닛의 경계를 기준으로, 가중합 연산이 수행되는 위치에 따라, 제1 예측 샘플에 적용되는 가중치 및 제2 예측 샘플에 적용되는 가중치가 적응적으로 결정되는 예를 나타낸 도면이다.
도 12는 복수개의 블렌딩 영역 크기 후보들을 도시한 도면이다.
도 13은 본 개시의 일 실시예에 따른, 인트라 예측 방법의 흐름도이다.
도 14는 인트라 예측 모드들을 나타낸 도면이다.
도 15는 현재 블록의 인트라 예측 모드를 유도하기 위해 이용되는 이웃 블록들의 위치를 나타낸 것이다.
1 is a block diagram of a video encoder (encoder) according to an embodiment of the present disclosure.
Figure 2 is a block diagram of a video decoder (decoder) according to an embodiment of the present disclosure.
Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
Figure 4 is a diagram showing various types of division of a coding block.
Figure 5 is a diagram illustrating a division aspect of a coding tree unit.
Figure 6 is a flowchart of an inter prediction method according to an embodiment of the present disclosure.
Figure 7 is a flowchart of the process of deriving motion information of the current block under merge mode.
Figure 8 is an example diagram illustrating merge candidate blocks.
Figure 9 is a diagram showing the types of dividing lines that divide coding blocks.
Figure 10 shows an example in which different prediction modes are applied to each of the first prediction unit and the second prediction unit.
11 shows that the weight applied to the first prediction sample and the weight applied to the second prediction sample are adaptively determined depending on the location where the weighted sum operation is performed, based on the boundary between the first prediction unit and the second prediction unit. This is a drawing showing an example.
Figure 12 is a diagram showing a plurality of blending area size candidates.
13 is a flowchart of an intra prediction method according to an embodiment of the present disclosure.
Figure 14 is a diagram showing intra prediction modes.
Figure 15 shows the positions of neighboring blocks used to derive the intra prediction mode of the current block.

이하에서는 도면을 참조하여 본 개시의 실시예를 상세히 설명한다.Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings.

영상의 부호화 및 복호화는 블록 단위로 수행된다. 일 예로, 코딩 블록, 변환 블록, 또는 예측 블록에 대해, 변환, 양자화, 예측, 인루프 필터링, 또는 복원 등의 부호화/복호화 처리가 수행될 수 있다. Encoding and decoding of images are performed on a block basis. For example, encoding/decoding processing such as transformation, quantization, prediction, in-loop filtering, or restoration may be performed on a coding block, transform block, or prediction block.

이하, 부호화/복호화 대상인 블록을 '현재 블록'이라 호칭하기로 한다. 일 예로, 현재 블록은 현재 부호화/복호화 처리 단계에 따라, 코딩 블록, 변환 블록, 또는 예측 블록을 나타낼 수 있다.Hereinafter, the block subject to encoding/decoding will be referred to as the 'current block'. As an example, the current block may represent a coding block, a transform block, or a prediction block, depending on the current encoding/decoding processing step.

아울러, 본 명세서에서 사용되는 용어 '유닛'은 특정 부호화/복호화 프로세스를 수행하기 위한 기본 단위를 나타내고, '블록'은 소정 크기의 샘플 어레이를 나타내는 것으로 이해될 수 있다. 별도의 설명이 없는 한, '블록'과 '유닛'은 동등한 의미로 사용될 수 있다. 일 예로, 후술되는 실시예에서, 코딩 블록과 코딩 유닛은 상호 동등한 의미를 갖는 것으로 이해될 수 있다. In addition, the term 'unit' used in this specification may be understood to represent a basic unit for performing a specific encoding/decoding process, and the 'block' may be understood to represent a sample array of a predetermined size. Unless otherwise stated, ‘block’ and ‘unit’ can be used with the same meaning. For example, in an embodiment described later, a coding block and a coding unit may be understood to have equivalent meaning.

도 1은 본 개시의 일 실시예에 따른 영상 부호화기(인코더기)의 블록도이다.1 is a block diagram of a video encoder (encoder) according to an embodiment of the present disclosure.

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

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

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

픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 처리 단위로 분할할 수 있다. 이때, 처리 단위는 예측 단위(Prediction Unit: PU)일 수도 있고, 변환 단위(Transform Unit: TU)일 수도 있으며, 부호화 단위(Coding Unit: CU)일 수도 있다. 픽쳐 분할부(110)에서는 하나의 픽쳐에 대해 복수의 부호화 단위, 예측 단위 및 변환 단위의 조합으로 분할하고 소정의 기준(예를 들어, 비용 함수)으로 하나의 부호화 단위, 예측 단위 및 변환 단위 조합을 선택하여 픽쳐를 부호화 할 수 있다.The picture division unit 110 may divide the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (PU), a transformation unit (TU), or a coding unit (CU). The picture division unit 110 divides one picture into a combination of a plurality of coding units, prediction units, and transformation units, and combines one coding unit, prediction unit, and transformation unit based on a predetermined standard (for example, a cost function). You can encode the picture by selecting .

예를 들어, 하나의 픽쳐는 복수개의 부호화 단위로 분할될 수 있다. 픽쳐에서 부호화 단위를 분할하기 위해서는 쿼드 트리 구조(Quad Tree Structure)와 같은 재귀적인 트리 구조를 사용할 수 있는데 하나의 영상 또는 최대 크기 부호화 단위(largest coding unit)를 루트로 하여 다른 부호화 단위로 분할되는 부호화 유닛은 분할된 부호화 단위의 개수만큼의 자식 노드를 가지고 분할될 수 있다. 일정한 제한에 따라 더 이상 분할되지 않는 부호화 단위는 리프 노드가 된다. 즉, 하나의 코딩 유닛에 대하여 정방형 분할만이 가능하다고 가정하는 경우, 하나의 부호화 단위는 최대 4개의 다른 부호화 단위로 분할될 수 있다.For example, one picture may be divided into a plurality of coding units. To split the coding unit in a picture, a recursive tree structure such as the Quad Tree Structure can be used. Coding is split into other coding units with one image or the largest coding unit as the root. A unit can be divided into child nodes equal to the number of divided coding units. A coding unit that is no longer divided according to certain restrictions becomes a leaf node. That is, assuming that only square division is possible for one coding unit, one coding unit can be divided into up to four different coding units.

이하, 본 개시의 실시예에서는 부호화 단위는 부호화를 수행하는 단위의 의미로 사용할 수도 있고, 복호화를 수행하는 단위의 의미로 사용할 수도 있다.Hereinafter, in the embodiments of the present disclosure, the coding unit may be used to mean a unit that performs encoding or may be used to mean a unit that performs decoding.

예측 단위는 하나의 부호화 단위 내에서 동일한 크기의 적어도 하나의 정사각형 또는 직사각형 등의 형태를 가지고 분할된 것일 수도 있고, 하나의 부호화 단위 내에서 분할된 예측 단위 중 어느 하나의 예측 단위가 다른 하나의 예측 단위와 상이한 형태 및/또는 크기를 가지도록 분할된 것일 수도 있다.A prediction unit may be divided into at least one square or rectangular shape of the same size within one coding unit, and any one of the prediction units divided within one coding unit may be a prediction unit of another prediction unit. It may be divided to have a different shape and/or size than the unit.

부호화 단위를 기초로 인트라 예측을 수행하는 예측 단위를 생성시 최소 부호화 단위가 아닌 경우, 복수의 예측 단위 NxN 으로 분할하지 않고 인트라 예측을 수행할 수 있다.If the prediction unit for which intra prediction is performed based on the coding unit is not the minimum coding unit when generated, intra prediction can be performed without dividing the prediction unit into a plurality of prediction units NxN.

예측부(120, 125)는 인터 예측을 수행하는 인터 예측부(120)와 인트라 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화기에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(120, 125)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.The prediction units 120 and 125 may include an inter prediction unit 120 that performs inter prediction and an intra prediction unit 125 that performs intra prediction. It is possible to determine whether to use inter prediction or intra prediction for a prediction unit, and determine specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. At this time, the processing unit in which the prediction is performed and the processing unit in which the prediction method and specific contents are determined may be different. For example, the prediction method and prediction mode are determined in prediction units, and prediction may be performed in transformation units. The residual value (residual block) between the generated prediction block and the original block may be input to the conversion unit 130. Additionally, prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoder 165 together with the residual value and transmitted to the decoder. When using a specific encoding mode, it is possible to encode the original block as 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 on at least one picture among the pictures before or after the current picture, and in some cases, prediction based on information on a partially encoded region within the current picture. 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 interpolation unit may receive reference picture information from the memory 155 and generate pixel information of an integer number of pixels or less from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/4 pixel units. In the case of color difference signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/8 pixel units.

모션 예측부는 참조 픽쳐 보간부에 의해 보간된 참조 픽쳐를 기초로 모션 예측을 수행할 수 있다. 모션 벡터를 산출하기 위한 방법으로 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) 방법, 인트라 블록 카피(Intra Block Copy) 방법 등 다양한 방법이 사용될 수 있다.The motion prediction unit may perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to calculate the motion vector. 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 can predict the current prediction unit by using a different motion prediction method. As a motion prediction method, various methods such as the skip method, the merge method, the Advanced Motion Vector Prediction (AMVP) method, and the intra block copy method can be used.

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

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

인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행할 수 있다. 그러나 인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수 있다.When performing intra prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit is made based on the pixel on the left, the pixel on the top left, and the pixel on the top of the prediction unit. can be performed. However, when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using a reference pixel based on the transformation unit. Additionally, intra prediction using NxN partitioning can be used only for the minimum coding unit.

인트라 예측 방법은 예측 모드에 따라 참조 화소에 AIS(Adaptive Intra Smoothing) 필터를 적용한 후 예측 블록을 생성할 수 있다. 참조 화소에 적용되는 AIS 필터의 종류는 상이할 수 있다. 인트라 예측 방법을 수행하기 위해 현재 예측 단위의 인트라 예측 모드는 현재 예측 단위의 주변에 존재하는 예측 단위의 인트라 예측 모드로부터 예측할 수 있다. 주변 예측 단위로부터 예측된 모드 정보를 이용하여 현재 예측 단위의 예측 모드를 예측하는 경우, 현재 예측 단위와 주변 예측 단위의 인트라 예측 모드가 동일하면 소정의 플래그 정보를 이용하여 현재 예측 단위와 주변 예측 단위의 예측 모드가 동일하다는 정보를 전송할 수 있고, 만약 현재 예측 단위와 주변 예측 단위의 예측 모드가 상이하면 엔트로피 부호화를 수행하여 현재 블록의 예측 모드 정보를 부호화할 수 있다.The intra prediction method can 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. To perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted from the intra prediction mode of prediction units existing around the current prediction unit. When predicting the prediction mode of the current prediction unit using predicted mode information from neighboring prediction units, if the intra prediction mode of the current prediction unit and neighboring prediction units are the same, predetermined flag information is used to predict the current prediction unit and neighboring prediction units. Information that the prediction modes of are the same can be transmitted, and if the prediction modes of the current prediction unit and neighboring prediction units are different, entropy encoding can be performed to encode the prediction mode information of the current block.

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

변환부(130)에서는 원본 블록과 예측부(120, 125)를 통해 생성된 예측 단위의 잔차값(residual)정보를 포함한 잔차 블록을 DCT(Discrete Cosine Transform) 또는 DST(Discrete Sine Transform)와 같은 변환 방법을 사용하여 변환시킬 수 있다. 여기서, DCT 변환 코어는 DCT2 또는 DCT8 중 적어도 하나를 포함하고, DST 변환 코어는 DST7을 포함한다. 잔차 블록을 변환하기 위해 DCT를 적용할지 또는 DST를 적용할지는 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드 정보를 기초로 결정할 수 있다. 잔차 블록에 대한 변환을 스킵할 수도 있다. 잔차 블록에 대한 변환을 스킵할 것인지 여부를 나타내는 플래그를 부호화할 수 있다. 변환 스킵은, 크기가 문턱값 이하인 잔차 블록, 루마 성분 또는 4:4:4 포맷 하에서의 크로마 성분에 대해 허용될 수 있다.The transform unit 130 transforms the residual block including the original block and the residual value information of the prediction unit generated through the prediction units 120 and 125, such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform). It can be converted using the method. Here, the DCT conversion core includes at least one of DCT2 or DCT8, and the DST conversion core includes DST7. Whether to apply DCT or DST to transform the residual block can be determined based on intra prediction mode information of the prediction unit used to generate the residual block. Transformation for residual blocks can also be skipped. A flag indicating whether to skip transformation for the residual block can be encoded. Transform skipping may be allowed for residual blocks whose size is below a threshold, luma component, or chroma component under 4:4:4 format.

양자화부(135)는 변환부(130)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(135)에서 산출된 값은 역양자화부(140)와 재정렬부(160)에 제공될 수 있다.The quantization unit 135 may quantize the values converted to the frequency domain by the conversion unit 130. The quantization coefficient may change 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 realignment unit 160.

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

재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 지그-재그 스캔(Zig-Zag Scan)방법을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔 대신 2차원의 블록 형태 계수를 열 방향으로 스캔하는 수직 스캔, 2차원의 블록 형태 계수를 행 방향으로 스캔하는 수평 스캔이 사용될 수도 있다. 즉, 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔, 수직 방향 스캔 및 수평 방향 스캔 중 어떠한 스캔 방법이 사용될지 여부를 결정할 수 있다.The rearrangement unit 160 can change the coefficients in a two-dimensional block form into a one-dimensional vector form through a coefficient scanning method. For example, the realignment unit 160 can scan from DC coefficients to coefficients in the high frequency region using a zig-zag scan method and change it into a one-dimensional vector form. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional block-type coefficients in the column direction or a horizontal scan that scans the two-dimensional block-type coefficients in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it can be determined which scan method among zig-zag scan, vertical scan, and horizontal scan will be used.

엔트로피 부호화부(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 the values calculated by the reordering unit 160. Entropy coding can use various coding methods, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).

엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. The entropy encoding unit 165 receives the residual value coefficient information and block type information of the coding unit, prediction mode information, division unit information, prediction unit information and transmission unit information, and motion information 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.

엔트로피 부호화부(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)에서 변환된 값들을 역변환한다. 역양자화부(140) 및 역변환부(145)에서 생성된 잔차값(Residual)은 예측부(120, 125)에 포함된 움직임 추정부, 움직임 보상부 및 인트라 예측부를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다. The inverse quantization unit 140 and the inverse transformation unit 145 inversely quantize the values quantized in the quantization unit 135 and inversely transform the values transformed in the transformation unit 130. The residual value generated in the inverse quantization unit 140 and the inverse transform unit 145 is restored by combining prediction units predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction units 120 and 125. You can create a block (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 boundaries between blocks in the restored picture. To determine whether to perform deblocking, it is possible to determine whether to apply a deblocking filter to the current block based on the pixels included in several columns or rows included in the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. Additionally, when applying a deblocking filter, horizontal filtering and vertical filtering can be processed in parallel when vertical filtering and horizontal filtering are performed.

오프셋 보정부는 디블록킹을 수행한 영상에 대해 픽셀 단위로 원본 영상과의 오프셋을 보정할 수 있다. 특정 픽쳐에 대한 오프셋 보정을 수행하기 위해 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후 오프셋을 수행할 영역을 결정하고 해당 영역에 오프셋을 적용하는 방법 또는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법을 사용할 수 있다.The offset correction unit may correct the offset of the deblocked image from the original image in pixel units. In order to perform offset correction for a specific picture, the pixels included in the image are divided into a certain number of areas, then the area to perform offset is determined and the offset is applied to that area, or the offset is performed 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 필터가 적용될 수도 있다. Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered restored image and the original image. After dividing the pixels included in the image into predetermined groups, filtering can be performed differentially for each group by determining one filter to be applied to that group. Information related to whether to apply ALF may be transmitted for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied may vary for each block. Additionally, an ALF filter of the same type (fixed type) may be applied regardless of the characteristics of the block to which it is applied.

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

도 2는 본 개시의 일 실시예에 따른 영상 복호화기(디코더기)의 블록도이다.Figure 2 is a block diagram of a video decoder (decoder) according to an embodiment of the present disclosure.

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

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

엔트로피 복호화부(210)는 영상 부호화기의 엔트로피 부호화부에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. The entropy decoding unit 210 may perform entropy decoding in a procedure opposite to the procedure in which entropy encoding is performed in the entropy encoding unit of the video encoder. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be applied in response to the method performed in the image encoder.

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

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

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

역변환부(225)는 영상 부호화기에서 수행한 양자화 결과에 대해 변환부에서 수행한 변환 즉, DCT 또는 DST에 대해 역변환 즉, 역 DCT 또는 역 DST를 수행할 수 있다. 여기서, DCT 변환 코어는 DCT2 또는 DCT8 중 적어도 하나를 포함하고, DST 변환 코어는 DST7을 포함할 수 있다. 또는, 영상 부호화기에서 변환이 스킵된 경우, 역변환부(225)에서도 역변환을 수행하지 않을 수 있다. 역변환은 영상 부호화기에서 결정된 전송 단위를 기초로 수행될 수 있다. 영상 복호화기의 역변환부(225)에서는 예측 방법, 현재 블록의 크기 및 예측 방향 등 복수의 정보에 따라 변환 기법(예를 들어, DCT 또는 DST)이 선택적으로 수행될 수 있다.The inverse transform unit 225 may perform inverse transform, that is, inverse DCT or inverse DST, on the transform, that is, DCT or DST, performed by the transformer on the quantization result performed by the image encoder. Here, the DCT conversion core may include at least one of DCT2 or DCT8, and the DST conversion core may include DST7. Alternatively, if transformation is skipped in the video encoder, the inverse transformation unit 225 may not perform the inverse transformation. Inverse transformation can be performed based on the transmission unit determined by the video encoder. The inverse transform unit 225 of the video decoder may selectively perform a transformation technique (eg, DCT or DST) according to a plurality of information such as a prediction method, the size of the current block, and the prediction direction.

예측부(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 decoder 210 and previously decoded block or picture information provided by the memory 245.

전술한 바와 같이 영상 부호화기에서의 동작과 동일하게 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행하지만, 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수도 있다.As described above, when performing intra prediction in the same manner as in the operation of the video encoder, when the size of the prediction unit and the size of the transformation unit are the same, the pixel that exists on the left of the prediction unit, the pixel that exists in the upper left, and the pixel that exists on the top Intra prediction is performed for the prediction unit based on the pixel, but when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction is performed using a reference pixel based on the transformation unit. You can. Additionally, intra prediction using NxN partitioning only for the minimum coding unit can be used.

예측부(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 discriminator receives various information such as prediction unit information input from the entropy decoder 210, prediction mode information of the intra prediction method, and motion prediction-related information of the inter prediction method, distinguishes the prediction unit from the current coding unit, and makes predictions. It is possible to determine whether a unit performs inter-prediction or intra-prediction. The inter prediction unit 230 uses the information required for inter prediction of the current prediction unit provided by the video encoder to make current prediction based on information included in at least one picture of the picture before or after the current picture including the current prediction unit. Inter prediction for units can be performed. Alternatively, inter prediction may be performed based on information on a pre-restored partial region within the current picture including the current prediction unit.

인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), 모션 벡터 예측 모드(AMVP Mode), 인트라 블록 카피 모드 중 어떠한 방법인지 여부를 판단할 수 있다.To perform inter prediction, based on the coding unit, the motion prediction methods of the prediction unit included in the coding unit are Skip Mode, Merge Mode, Motion Vector Prediction Mode (AMVP Mode), and Intra Block Copy. It is possible to determine which of the modes is used.

인트라 예측부(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. If the prediction unit is a prediction unit that has performed intra prediction, intra prediction can be performed based on the intra prediction mode information of the prediction unit provided by the video 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 pixels of the current block, and can be applied by determining whether or not to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block using the prediction mode and AIS filter information of the prediction unit provided by the video encoder. If 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 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.If the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on pixel values obtained by interpolating the reference pixel, the reference pixel interpolator may interpolate the reference pixel to generate a reference pixel in pixel units of 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 the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.

복원된 블록 또는 픽쳐는 필터부(240)로 제공될 수 있다. 필터부(240)는 디블록킹 필터, 오프셋 보정부, ALF를 포함할 수 있다.The restored 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 on whether a deblocking filter has been applied to the corresponding block or picture can be received from the video encoder, and when a deblocking filter has been applied, information on whether a strong filter or a weak filter has been applied. In the deblocking filter of the video decoder, information related to the deblocking filter provided by the video encoder is provided and the video decoder can 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 applied to the image during encoding and offset value information.

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

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

도 3은 본 개시의 일 실시예에 따른 기본 코딩 트리 유닛을 도시한 도면이다.Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.

최대 크기의 코딩 블록을 코딩 트리 블록이라 정의할 수 있다. 하나의 픽처는 복수개의 코딩 트리 유닛(Coding Tree Unit, CTU)으로 분할된다. 코딩 트리 유닛은 최대 크기의 코딩 유닛으로, LCU (Largest Coding Unit)라 호칭될 수도 있다. 도 3은 하나의 픽처가 복수개의 코딩 트리 유닛으로 분할된 예를 나타낸 것이다.The coding block of the maximum size can be defined as a coding tree block. One picture is divided into a plurality of Coding Tree Units (CTU). The coding tree unit is the largest coding unit and may also be called LCU (Largest Coding Unit). Figure 3 shows an example in which one picture is divided into a plurality of coding tree units.

코딩 트리 유닛의 크기는 픽처 레벨 또는 시퀀스 레벨에서 정의될 수 있다. 이를 위해, 코딩 트리 유닛의 크기를 나타내는 정보가 픽처 파라미터 세트 또는 시퀀스 파라미터 세트를 통해 시그날링될 수 있다. The size of the coding tree unit can be defined at the picture level or sequence level. For this purpose, information indicating the size of the coding tree unit may be signaled through a picture parameter set or sequence parameter set.

일 예로, 시퀀스 내 전체 픽처에 대한 코딩 트리 유닛의 크기가 128x128로 설정될 수 있다. 또는, 픽처 레벨에서 128x128 또는 256x256 중 어느 하나를 코딩 트리 유닛의 크기로 결정할 수 있다. 일 예로, 제1 픽처에서는 코딩 트리 유닛의 크기가 128x128로 설정되고, 제2 픽처에서는 코딩 트리 유닛의 크기가 256x256으로 설정될 수 있다. As an example, the size of the coding tree unit for all pictures in the sequence may be set to 128x128. Alternatively, either 128x128 or 256x256 can be determined as the size of the coding tree unit at the picture level. For example, in the first picture, the size of the coding tree unit may be set to 128x128, and in the second picture, the size of the coding tree unit may be set to 256x256.

코딩 트리 유닛을 분할하여, 코딩 블록을 생성할 수 있다. 코딩 블록은 부호화/복호화 처리를 위한 기본 단위를 나타낸다. 일 예로, 코딩 블록 별로 예측 또는 변환이 수행되거나, 코딩 블록 별로 예측 부호화 모드가 결정될 수 있다. 여기서, 예측 부호화 모드는 예측 영상을 생성하는 방법을 나타낸다. 일 예로, 예측 부호화 모드는 화면 내 예측(Intra Prediction, 인트라 예측), 화면 간 예측(Inter Prediction, 인터 예측), 현재 픽처 참조(Current Picture Referencing, CPR, 또는 인트라 블록 카피(Intra Block Copy, IBC)) 또는 복합 예측(Combined Prediction)을 포함할 수 있다. 코딩 블록에 대해, 인트라 예측, 인터 예측, 현재 픽처 참조 또는 복합 예측 중 적어도 하나의 예측 부호화 모드를 이용하여, 코딩 블록에 대한 예측 블록을 생성할 수 있다. By dividing the coding tree unit, a coding block can be created. A coding block represents a basic unit for encoding/decoding processing. For example, prediction or transformation may be performed for each coding block, or a prediction encoding mode may be determined for each coding block. Here, the prediction encoding mode represents a method of generating a prediction image. As an example, the predictive coding mode may be Intra Prediction (Intra Prediction), Inter Prediction (Inter Prediction), Current Picture Referencing (CPR), or Intra Block Copy (IBC). ) or may include Combined Prediction. A prediction block for a coding block can be generated using at least one prediction coding mode among intra prediction, inter prediction, current picture reference, or complex prediction.

현재 블록의 예측 부호화 모드를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 상기 정보는 예측 부호화 모드가 인트라 모드인지 또는 인터 모드인지 여부를 나타내는 1비트 플래그일 수 있다. 현재 블록의 예측 부호화 모드가 인터 모드로 결정된 경우에 한하여, 현재 픽처 참조 또는 복합 예측이 이용 가능할 수 있다. Information indicating the prediction encoding mode of the current block may be signaled through a bitstream. As an example, the information may be a 1-bit flag indicating whether the predictive coding mode is intra mode or inter mode. Only when the prediction coding mode of the current block is determined to be inter mode, current picture reference or complex prediction may be used.

현재 픽처 참조는 현재 픽처를 참조 픽처로 설정하고, 현재 픽처 내 이미 부호화/복호화가 완료된 영역으로부터 현재 블록의 예측 블록을 획득하기 위한 것이다. 여기서, 현재 픽처는 현재 블록을 포함하는 픽처를 의미한다. 현재 블록에 현재 픽처 참조가 적용되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 상기 정보는 1비트의 플래그일 수 있다. 상기 플래그가 참인 경우, 현재 블록의 예측 부호화 모드는 현재 픽처 참조로 결정되고, 상기 플래그가 거짓인 경우, 현재 블록의 예측 모드는 인터 예측으로 결정될 수 있다.Current picture reference is used to set the current picture as a reference picture and obtain a prediction block of the current block from a region in the current picture that has already been encoded/decoded. Here, the current picture refers to a picture including the current block. Information indicating whether the current picture reference is applied to the current block may be signaled through the bitstream. As an example, the information may be a 1-bit flag. If the flag is true, the prediction coding mode of the current block may be determined as the current picture reference, and if the flag is false, the prediction mode of the current block may be determined as inter prediction.

또는, 참조 픽처 인덱스를 기초로, 현재 블록의 예측 부호화 모드가 결정될 수 있다. 일 예로, 참조 픽처 인덱스가 현재 픽처를 가리키는 경우, 현재 블록의 예측 부호화 모드는 현재 픽처 참조로 결정될 수 있다. 참조 픽처 인덱스가 현재 픽처가 아닌 다른 픽처를 가리키는 경우, 현재 블록의 예측 부호화 모드는 인터 예측으로 결정될 수 있다. 즉, 현재 픽처 참조는 현재 픽처 내 부호화/복호화가 완료된 영역의 정보를 이용한 예측 방법이고, 인터 예측은 부호화/복호화가 완료된 다른 픽처의 정보를 이용한 예측 방법이다.Alternatively, the prediction coding mode of the current block may be determined based on the reference picture index. For example, when the reference picture index points to the current picture, the prediction coding mode of the current block may be determined based on the current picture reference. If the reference picture index points to a picture other than the current picture, the prediction coding mode of the current block may be determined as inter prediction. In other words, current picture reference is a prediction method using information from a region in the current picture where coding/decoding has been completed, and inter prediction is a prediction method using information from another picture where coding/decoding has been completed.

복합 예측은 인트라 예측, 인터 예측 및 현재 픽처 참조 중 둘 이상을 조합된 부호화 모드를 나타낸다. 일 예로, 복합 예측이 적용되는 경우, 인트라 예측, 인터 예측 또는 현재 픽처 참조 중 어느 하나를 기초로 제1 예측 블록이 생성되고, 다른 하나를 기초로 제2 예측 블록이 생성될 수 있다. 제1 예측 블록 및 제2 예측 블록이 생성되면, 제1 예측 블록 및 제2 예측 블록의 평균 연산 또는 가중합 연산을 통해 최종 예측 블록이 생성될 수 있다. 복합 예측이 적용되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그일 수 있다. Complex prediction refers to a coding mode that combines two or more of intra prediction, inter prediction, and current picture reference. For example, when complex prediction is applied, a first prediction block may be generated based on one of intra prediction, inter prediction, or a current picture reference, and a second prediction block may be generated based on the other. When the first prediction block and the second prediction block are generated, the final prediction block may be generated through an average operation or a weighted sum operation of the first prediction block and the second prediction block. Information indicating whether complex prediction is applied may be signaled through the bitstream. The information may be a 1-bit flag.

도 4는 코딩 블록의 다양한 분할 형태를 나타낸 도면이다.Figure 4 is a diagram showing various types of division of a coding block.

코딩 블록은 쿼드 트리 분할, 바이너리 트리 분할 또는 트리플 트리 분할을 기초로 복수의 코딩 블록들로 분할될 수 있다. 분할된 코딩 블록도 다시 쿼드 트리 분할, 바이터리 트리 분할 또는 트리플 트리 분할을 기초로 다시 복수의 코딩 블록들로 분할될 수 있다.A coding block may be divided into a plurality of coding blocks based on quad tree partitioning, binary tree partitioning, or triple tree partitioning. The divided coding block may also be divided into a plurality of coding blocks based on quad tree division, binary tree division, or triple tree division.

쿼드 트리 분할은 현재 블록을 4개의 블록들로 분할하는 분할 기법을 나타낸다. 쿼드 트리 분할의 결과, 현재 블록은 4개의 정방 형태 파티션들로 분할될 수 있다 (도 4의 (a) 'SPLIT_QT' 참조).Quad tree partitioning refers to a partitioning technique that divides the current block into 4 blocks. As a result of quad tree partitioning, the current block can be divided into four square partitions (see 'SPLIT_QT' in (a) of Figure 4).

바이너리 트리 분할은 현재 블록을 2개의 블록들로 분할하는 분할 기법을 나타낸다. 수직 방향을 따라(즉, 현재 블록을 가로지르는 수직선을 이용) 현재 블록을 두개의 블록들로 분할하는 것을 수직 방향 바이너리 트리 분할이라 호칭할 수 있고, 수평 방향을 따라(즉, 현재 블록을 가로지르는 수평선을 이용) 현재 블록을 두개의 블록들로 분할하는 것을 수평 방향 바이너리 트리 분할이라 호칭할 수 있다. 바이너리 트리 분할 결과, 현재 블록은 2개의 비정방 형태 파티션들로 분할될 수 있다. 도 4의 (b) 'SPLIT_BT_VER'는 수직 방향 바이너리 트리 분할 결과를 나타낸 것이고, 도 4의 (c) 'SPLIT_BT_HOR'는 수평 방향 바이너리 트리 분할 결과를 나타낸 것이다. Binary tree splitting refers to a splitting technique that splits the current block into two blocks. Splitting the current block into two blocks along the vertical direction (i.e., using a vertical line across the current block) can be called vertical binary tree splitting, and dividing the current block into two blocks along the horizontal direction (i.e., using a vertical line across the current block) can be called vertical binary tree splitting. Splitting the current block into two blocks (using a horizontal line) can be called horizontal binary tree splitting. As a result of binary tree partitioning, the current block can be divided into two non-square partitions. 'SPLIT_BT_VER' in FIG. 4 shows the result of vertical binary tree division, and 'SPLIT_BT_HOR' in FIG. 4 (c) shows the result of horizontal binary tree division.

트리플 트리 분할은 현재 블록을 3개의 블록들로 분할하는 분할 기법을 나타낸다. 수직 방향을 따라(즉, 현재 블록을 가로지르는 두개의 수직선을 이용) 현재 블록을 세개의 블록들로 분할하는 것을 수직 방향 트리플 트리 분할이라 호칭할 수 있고, 수평 방향을 따라(즉, 현재 블록을 가로지르는 두개의 수평선을 이용) 현재 블록을 세개의 블록들로 분할하는 것을 수평 방향 트리플 트리 분할이라 호칭할 수 있다. 트리플 트리 분할 결과, 현재 블록은 3개의 비정방 형태 파티션들로 분할될 수 있다. 이때, 현재 블록의 중앙에 위치하는 파티션의 너비/높이는 다른 파티션들의 너비/높이 대비 2배일 수 있다. 도 4의 (d) 'SPLIT_TT_VER'는 수직 방향 트리플 트리 분할 결과를 나타낸 것이고, 도 4의 (e) 'SPLIT_TT_HOR'는 수평 방향 트리플 트리 분할 결과를 나타낸 것이다. Triple tree partitioning refers to a partitioning technique that divides the current block into three blocks. Splitting the current block into three blocks along the vertical direction (i.e., using two vertical lines crossing the current block) can be called vertical triple tree division, and along the horizontal direction (i.e., using two vertical lines across the current block). Splitting the current block into three blocks (using two horizontal lines crossing) can be called horizontal triple tree division. As a result of triple tree partitioning, the current block can be divided into three non-square partitions. At this time, the width/height of the partition located in the center of the current block may be twice the width/height of other partitions. 'SPLIT_TT_VER' in FIG. 4 shows the result of vertical triple tree division, and 'SPLIT_TT_HOR' in FIG. 4 (e) shows the result of triple tree division in the horizontal direction.

코딩 트리 유닛의 분할 횟수를 분할 깊이(Partitioning Depth)라 정의할 수 있다. 시퀀스 또는 픽처 레벨에서 코딩 트리 유닛의 최대 분할 깊이가 결정될 수 있다. 이에 따라, 시퀀스 또는 필처별로 코딩 트리 유닛의 최대 분할 깊이가 상이할 수 있다. The number of divisions of a coding tree unit can be defined as partitioning depth. The maximum division depth of a coding tree unit may be determined at the sequence or picture level. Accordingly, the maximum division depth of the coding tree unit may be different for each sequence or pilture.

또는, 분할 기법들 각각에 대한 최대 분할 깊이를 개별적으로 결정할 수 있다. 일 예로, 쿼드 트리 분할이 허용되는 최대 분할 깊이는 바이너리 트리 분할 및/또는 트리플 트리 분할이 허용되는 최대 분할 깊이와 상이할 수 있다.Alternatively, the maximum segmentation depth for each segmentation technique can be determined individually. As an example, the maximum splitting depth allowed for quad tree splitting may be different from the maximum splitting depth allowed for binary tree splitting and/or triple tree splitting.

부호화기는 현재 블록의 분할 형태 또는 분할 깊이 중 적어도 하나를 나타내는 정보를 비트스트림을 통해 시그날링할 수 있다. 복호화기는 비트스트림으로부터 파싱되는 상기 정보에 기초하여 코딩 트리 유닛의 분할 형태 및 분할 깊이를 결정할 수 있다. The encoder may signal information indicating at least one of the division type or division depth of the current block through a bitstream. The decoder may determine the division type and division depth of the coding tree unit based on the information parsed from the bitstream.

도 5는 코딩 트리 유닛의 분할 양상을 예시한 도면이다.Figure 5 is a diagram illustrating a division aspect of a coding tree unit.

쿼드 트리 분할, 바이너리 트리 분할 및/또는 트리플 트리 분할 등의 분할 기법을 이용하여 코딩 블록을 분할하는 것을 멀티 트리 분할(Multi Tree Partitioning)이라 호칭할 수 있다. Partitioning a coding block using a partitioning technique such as quad tree partitioning, binary tree partitioning, and/or triple tree partitioning may be referred to as multi tree partitioning.

코딩 블록에 멀티 트리 분할을 적용하여 생성되는 코딩 블록들을 하위 코딩 블록들이라 호칭할 수 있다. 코딩 블록의 분할 깊이가 k인 경우, 하위 코딩 블록들의 분할 깊이는 k+1로 설정된다. Coding blocks generated by applying multi-tree partitioning to a coding block may be called lower coding blocks. When the division depth of a coding block is k, the division depth of lower coding blocks is set to k+1.

반대로, 분할 깊이가 k+1인 코딩 블록들에 대해, 분할 깊이가 k인 코딩 블록을 상위 코딩 블록이라 호칭할 수 있다. Conversely, for coding blocks with a split depth of k+1, a coding block with a split depth of k may be called a higher coding block.

현재 코딩 블록의 분할 타입은 상위 코딩 블록의 분할 형태 또는 이웃 코딩 블록의 분할 타입 중 적어도 하나를 기초로 결정될 수 있다. 여기서, 이웃 코딩 블록은 현재 코딩 블록에 인접하는 것으로, 현재 코딩 블록의 상단 이웃 블록, 좌측 이웃 블록, 또는 좌측 상단 코너에 인접하는 이웃 블록 중 적어도 하나를 포함할 수 있다. 여기서, 분할 타입은, 쿼드 트리 분할 여부, 바이너리 트리 분할 여부, 바이너리 트리 분할 방향, 트리플 트리 분할 여부, 또는 트리플 트리 분할 방향 중 적어도 하나를 포함할 수 있다.The partition type of the current coding block may be determined based on at least one of the partition type of the upper coding block or the partition type of the neighboring coding block. Here, the neighboring coding block is adjacent to the current coding block and may include at least one of a top neighboring block, a left neighboring block, or a neighboring block adjacent to the upper left corner of the current coding block. Here, the split type may include at least one of quad tree split, binary tree split, binary tree split direction, triple tree split, and triple tree split direction.

코딩 블록의 분할 형태를 결정하기 위해, 코딩 블록이 분할되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그 'split_cu_flag'로, 상기 플래그가 참인 것은, 머리 트리 분할 기법에 의해 코딩 블록이 분할됨을 나타낸다.To determine the division type of the coding block, information indicating whether the coding block is divided may be signaled through the bitstream. The information is a 1-bit flag 'split_cu_flag', and if the flag is true, it indicates that the coding block is split by the head tree splitting technique.

split_cu_flag가 참인 경우, 코딩 블록이 쿼드 트리 분할되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그 split_qt_flag로, 상기 플래그가 참인 경우, 코딩 블록은 4개의 블록들로 분할될 수 있다.If split_cu_flag is true, information indicating whether the coding block is quad-tree split may be signaled through the bitstream. The information is a 1-bit flag split_qt_flag. When the flag is true, the coding block can be divided into 4 blocks.

일 예로, 도 5에 도시된 예에서는, 코딩 트리 유닛이 쿼드 트리 분할됨에 따라, 분할 깊이가 1인 4개의 코딩 블록들이 생성되는 것으로 도시되었다. 또한, 쿼드 트리 분할 결과로 생성된 4개의 코딩 블록들 중 첫번째 코딩 블록 및 네번째 코딩 블록에 다시 쿼드 트리 분할이 적용된 것으로 도시되었다. 그 결과, 분할 깊이가 2인 4개의 코딩 블록들이 생성될 수 있다. For example, in the example shown in FIG. 5, as the coding tree unit is divided into quad trees, four coding blocks with a division depth of 1 are generated. In addition, it is shown that quad-tree partitioning was applied again to the first and fourth coding blocks among the four coding blocks generated as a result of quad-tree partitioning. As a result, four coding blocks with a division depth of 2 can be generated.

또한, 분할 깊이가 2인 코딩 블록에 다시 쿼드 트리 분할을 적용함으로써, 분할 깊이가 3인 코딩 블록을 생성할 수 있다. Additionally, by applying quad tree division again to the coding block with a division depth of 2, a coding block with a division depth of 3 can be generated.

코딩 블록에 쿼드 트리 분할이 적용되지 않는 경우, 코딩 블록의 크기, 코딩 블록이 픽처 경계에 위치하는지 여부, 최대 분할 깊이 또는 이웃 블록의 분할 형태 중 적어도 하나를 고려하여, 상기 코딩 블록에 바이너리 트리 분할 또는 트리플 트리 분할을 수행할 것인지 여부를 결정할 수 있다. 상기 코딩 블록에 바이너리 트리 분할 또는 트리플 트리 분할이 수행되는 것으로 결정된 경우, 분할 방향을 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그 mtt_split_cu_vertical_flag일 수 있다. 상기 플래그에 기초하여, 분할 방향이 수직 방향인지 또는 수평 방향인지 여부가 결정될 수 있다. 추가로, 바이너리 트리 분할 또는 트리플 트리 분할 중 어느 것이 상기 코딩 블록에 적용되는지를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그 mtt_split_cu_binary_flag일 수 있다. 상기 플래그에 기초하여, 상기 코딩 블록에 바이너리 트리 분할이 적용되는지 또는 트리플 트리 분할이 적용되는지 여부가 결정될 수 있다.If quad tree partitioning is not applied to a coding block, binary tree partitioning is performed on the coding block, taking into account at least one of the size of the coding block, whether the coding block is located at a picture boundary, the maximum partition depth, or the partition type of the neighboring block. Alternatively, you can decide whether to perform triple tree partitioning. If it is determined that binary tree division or triple tree division is performed on the coding block, information indicating the division direction may be signaled through the bitstream. The information may be a 1-bit flag mtt_split_cu_vertical_flag. Based on the flag, it can be determined whether the division direction is vertical or horizontal. Additionally, information indicating whether binary tree partitioning or triple tree partitioning is applied to the coding block may be signaled through the bitstream. The information may be a 1-bit flag mtt_split_cu_binary_flag. Based on the flag, it can be determined whether binary tree partitioning or triple tree partitioning is applied to the coding block.

일 예로, 도 5에 도시된 예에서는, 분할 깊이 1인 코딩 블록에 수직 방향 바이너리 트리 분할이 적용되고, 상기 분할 결과로 생성된 코딩 블록들 중 좌측 코딩 블록에는 수직 방향 트리플 트리 분할이 적용되고, 우측 코딩 블록에는 수직 방향 바이너리 트리 분할이 적용된 것으로 도시되었다.For example, in the example shown in FIG. 5, vertical binary tree division is applied to a coding block with a division depth of 1, and vertical triple tree division is applied to the left coding block among the coding blocks generated as a result of the division, It is shown that vertical binary tree partitioning is applied to the right coding block.

인터 예측은 이전 픽처의 정보를 이용하여, 현재 블록을 예측하는 예측 부호화 모드이다. 일 예로, 이전 픽처 내 현재 블록과 동일한 위치의 블록(이하, 콜로케이티드 블록, Collocated block)을 현재 블록의 예측 블록으로 설정할 수 있다. 이하, 현재 블록과 동일한 위치의 블록을 기초로 생성된 예측 블록을 콜로케이티드 예측 블록(Collocated Prediction Block)이라 호칭하기로 한다. Inter prediction is a predictive coding mode that predicts the current block using information from the previous picture. As an example, a block at the same location as the current block in the previous picture (hereinafter referred to as collocated block) can be set as the prediction block of the current block. Hereinafter, a prediction block generated based on a block at the same location as the current block will be referred to as a collocated prediction block.

반면, 이전 픽처에 존재한 오브젝트가 현재 픽처에서는 다른 위치로 이동하였다면, 오브젝트의 움직임을 이용하여 효과적으로 현재 블록을 예측할 수 있다. 예를 들어, 이전 픽처와 현재 픽처를 비교함으로써 오브젝트의 이동 방향 및 크기를 알 수 있다면, 오브젝트의 움직임 정보를 고려하여 현재 블록의 예측 블록(또는, 예측 영상)을 생성할 수 있다. 이하, 움직임 정보를 이용하여 생성된 예측 블록을 움직임 예측 블록이라 호칭할 수 있다.On the other hand, if an object that existed in the previous picture has moved to a different location in the current picture, the current block can be effectively predicted using the movement of the object. For example, if the movement direction and size of an object can be known by comparing the previous picture and the current picture, a prediction block (or prediction image) of the current block can be generated by considering the movement information of the object. Hereinafter, a prediction block generated using motion information may be referred to as a motion prediction block.

현재 블록에서 예측 블록을 차분하여, 잔차 블록(residual block)을 생성할 수 있다. 이때, 오브젝트의 움직임이 존재하는 경우라면, 콜로케이티드 예측 블록 대신 움직임 예측 블록을 이용함으로써, 잔차 블록의 에너지를 줄이고, 이에 따라, 잔차 블록의 압축 성능을 향상시킬 수 있다.A residual block can be generated by differentiating the prediction block from the current block. At this time, if there is movement of the object, the energy of the residual block can be reduced by using a motion prediction block instead of a collocated prediction block, and thus the compression performance of the residual block can be improved.

위처럼, 움직임 정보를 이용하여 예측 블록을 생성하는 것을 움직임 보상 예측이라 호칭할 수 있다. 대부분의 인터 예측에서는 움직임 보상 예측에 기초하여 예측 블록을 생성할 수 있다.As above, generating a prediction block using motion information can be called motion compensation prediction. In most inter predictions, prediction blocks can be generated based on motion compensation prediction.

움직임 정보는 모션 벡터, 참조 픽처 인덱스, 예측 방향 또는 양방향 가중치 인덱스 중 적어도 하나를 포함할 수 있다. 모션 벡터는 오브젝트의 이동 방향 및 크기를 나타낸다. 참조 픽처 인덱스는 참조 픽처 리스트에 포함된 참조 픽처들 중 현재 블록의 참조 픽처를 특정한다. 예측 방향은 단방향 L0 예측, 단방향 L1 예측 또는 양방향 예측(L0 예측 및 L1 예측) 중 어느 하나를 가리킨다. 현재 블록의 예측 방향에 따라, L0 방향의 움직인 정보 또는 L1 방향의 움직임 정보 중 적어도 하나가 이용될 수 있다. 양방향 가중치 인덱스는 L0 예측 블록에 적용되는 가중치 및 L1 예측 블록에 적용되는 가중치를 특정한다.The motion information may include at least one of a motion vector, reference picture index, prediction direction, or bidirectional weight index. A motion vector represents the movement direction and size of an object. The reference picture index specifies the reference picture of the current block among reference pictures included in the reference picture list. The prediction direction refers to either one-way L0 prediction, one-way L1 prediction, or two-way prediction (L0 prediction and L1 prediction). Depending on the prediction direction of the current block, at least one of motion information in the L0 direction or motion information in the L1 direction may be used. The bidirectional weight index specifies the weight applied to the L0 prediction block and the weight applied to the L1 prediction block.

도 6은 본 개시의 일 실시예에 따른 인터 예측 방법의 흐름도이다.Figure 6 is a flowchart of an inter prediction method according to an embodiment of the present disclosure.

도 6을 참조하면, 인터 예측 방법은, 현재 블록의 인터 예측 모드를 결정하는 단계(S601), 결정된 인터 예측 모드에 따라 현재 블록의 움직임 정보를 획득하는 단계(S602) 및 획득된 움직임 정보에 기초하여, 현재 블록에 대한 움직임 보상 예측을 수행하는 단계(S603)를 포함한다.Referring to FIG. 6, the inter prediction method includes determining the inter prediction mode of the current block (S601), acquiring motion information of the current block according to the determined inter prediction mode (S602), and predicting motion information based on the obtained motion information. Thus, it includes a step of performing motion compensation prediction for the current block (S603).

여기서, 인터 예측 모드는 현재 블록의 움직임 정보를 결정하기 위한 다양한 기법들을 나타내는 것으로, 병진(Translation) 움직임 정보를 이용하는 인터 예측 모드와, 어파인(Affine) 움직임 정보를 이용하는 인터 예측 모드를 포함할 수 있다. 일 예로, 병진 움직임 정보를 이용하는 인터 예측 모드는, 머지 모드 및 모션 벡터 예측 모드를 포함하고, 어파인 움직임 정보를 이용하는 인터 예측 모드는 어파인 머지 모드 및 어파인 모션 벡터 예측 모드를 포함할 수 있다. 현재 블록의 움직임 정보는, 인터 예측 모드에 따라, 현재 블록에 이웃하는 이웃 블록 또는 비트스트림으로부터 파싱되는 정보를 기초로 결정될 수 있다.Here, the inter prediction mode represents various techniques for determining motion information of the current block and may include an inter prediction mode using translation motion information and an inter prediction mode using affine motion information. there is. As an example, the inter prediction mode using translational motion information may include a merge mode and a motion vector prediction mode, and the inter prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. . The motion information of the current block may be determined based on information parsed from a bitstream or a neighboring block neighboring the current block, depending on the inter prediction mode.

움직임 정보는, 움직임 벡터, 참조 픽처 인덱스, 예측 플래그, 양방향 가중치 인덱스 중 적어도 하나를 포함할 수 있다. 또한, L0 및 L1 방향 각각에 대해 움직임 정보가 개별적으로 유도/설정될 수 있다.The motion information may include at least one of a motion vector, a reference picture index, a prediction flag, and a bidirectional weight index. Additionally, motion information can be derived/set individually for each of the L0 and L1 directions.

여기서, 움직임 벡터는, 이전 픽처에 있는 오브젝트와 현재 픽처에 있는 오브젝트 사이의 위치 차분을 나타낸다. 이전 픽처는, 참조 픽처 인덱스에 의해 지시될 수 있다. Here, the motion vector represents the position difference between the object in the previous picture and the object in the current picture. The previous picture may be indicated by a reference picture index.

또한, 움직임 벡터의 정밀도를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는, 시퀀스 단위, 슬라이스 단위 또는 블록 단위로 결정될 수 있다. 움직임 벡터 정밀도는 옥토펠, 쿼터펠, 하프펠, 정수펠, 2 정수펠 또는 4 정수펠로 설정될 수 있다. 또는, 인터 예측 모드에 따라, 현재 블록의 움직임 벡터 정밀도가 결정되거나, 이용 가능한 움직임 벡터 정밀도 후보의 개수/종류가 적응적으로 결정될 수 있다. Additionally, information for determining the precision of the motion vector may be signaled through the bitstream. The information may be determined on a sequence basis, a slice basis, or a block basis. Motion vector precision can be set to octopel, quarterpel, halfpel, integerpel, 2 integerpel, or 4 integerpel. Alternatively, depending on the inter prediction mode, the motion vector precision of the current block may be determined, or the number/type of available motion vector precision candidates may be adaptively determined.

현재 블록의 움직임 정보는 현재 블록 타 블록의 움직임 정보로부터 유도될 수 있다. 여기서, 타 블록은 현재 블록보다 앞서 인터 예측으로 부호화/복호화된 블록일 수 있다. 현재 블록의 움직임 정보를 타 블록의 움직임 정보와 동일하게 설정하는 것을 머지 모드라 정의할 수 있다. 또한, 타 블록의 움직임 벡터를 현재 블록의 움직임 벡터의 예측값으로 설정하는 것을 모션 벡터 예측 모드라 정의할 수 있다. Motion information of the current block may be derived from motion information of other blocks in the current block. Here, the other block may be a block that has been encoded/decoded through inter prediction before the current block. Merge mode can be defined as setting the motion information of the current block to be the same as the motion information of other blocks. Additionally, setting the motion vector of another block as the predicted value of the motion vector of the current block can be defined as a motion vector prediction mode.

도 7은 머지 모드 하에서 현재 블록의 움직임 정보를 유도하는 과정의 흐름도이다.Figure 7 is a flowchart of the process of deriving motion information of the current block under merge mode.

현재 블록의 머지 후보를 유도할 수 있다(S701). 현재 블록의 머지 후보는 현재 블록보다 앞서 인터 예측으로 부호화/복호화된 블록으로부터 유도될 수 있다.A merge candidate for the current block can be derived (S701). The merge candidate for the current block may be derived from a block encoded/decoded by inter prediction prior to the current block.

이때, 머지 후보를 유도하는데 이용되는 블록을 '머지 후보 블록'으로 호칭할 수 있다. 머지 후보 블록은, 현재 블록에 인접하는 블록(인접 머지 후보 블록) 또는 현재 블록에 인접하지 않는 블록(비인접 머지 후보 블록) 중 적어도 하나를 포함할 수 있다. 머지 후보 블록의 움직임 정보를 기초로, 머지 후보의 움직임 정보가 설정될 수 있다. 일 예로, 머지 후보의 움직임 정보는 머지 후보 블록의 움직임 정보와 동일하게 설정될 수 있다. 또는, 머지 후보 블록의 L0 움직임 정보 또는 L1 움직임 정보 중 어느 하나만을 머지 후보의 움직임 정보로 설정할 수 있다. 또는, 머지 후보 블록의 움직임 벡터를 스케일링하여, 머지 후보의 움직임 벡터를 유도할 수도 있다.At this time, the block used to derive the merge candidate may be called a ‘merge candidate block’. The merge candidate block may include at least one of a block adjacent to the current block (adjacent merge candidate block) or a block that is not adjacent to the current block (non-adjacent merge candidate block). Based on the motion information of the merge candidate block, motion information of the merge candidate may be set. As an example, the motion information of the merge candidate may be set to be the same as the motion information of the merge candidate block. Alternatively, either the L0 motion information or the L1 motion information of the merge candidate block can be set as the motion information of the merge candidate. Alternatively, the motion vector of the merge candidate block may be derived by scaling the motion vector of the merge candidate block.

도 8은 머지 후보 블록들을 예시한 예시도이다. Figure 8 is an example diagram illustrating merge candidate blocks.

도 8에서는, 머지 후보 블록들의 위치를 결정하기 위한 샘플들의 위치를 표시하였다. 머지 후보 블록들을 결정하는 샘플의 위치를 기준 위치 샘플이라 호칭할 수 있다. In Figure 8, the positions of samples for determining the positions of merge candidate blocks are indicated. The position of the sample that determines the merge candidate blocks may be called a reference position sample.

인접 머지 후보 블록은, 현재 블록의 상단에 이웃하는 행 또는 현재 블록의 좌측에 인접하는 열에 속하는 기준 위치 샘플을 포함한다. 일 예로, 도 8의 예에서, 인덱스 1 내지 인덱스 5가 표기된 기준 위치 샘플들을 포함하는 블록들 각각이 인접 머지 후보 블록으로 설정될 수 있다. The adjacent merge candidate block includes a reference position sample belonging to a row adjacent to the top of the current block or a column adjacent to the left of the current block. For example, in the example of FIG. 8, each of blocks including reference position samples marked with index 1 to index 5 may be set as an adjacent merge candidate block.

비인접 머지 후보 블록은 현재 블록의 상단에 이웃하지 않는 행 또는 현재 블로그이 좌측에 이웃하지 않는 열에 속하는 기준 위치 샘플을 포함한다. 일 예로, 도 8의 예에서, 인덱스 6 내지 인덱스 23이 명기된 기준 위치 샘플들을 포함하는 블록들 각각이 비인접 머지 후보 블록으로 설정될 수 있다.A non-adjacent merge candidate block includes a reference position sample belonging to a row that is not adjacent to the top of the current block or a column that is not adjacent to the left of the current blog. For example, in the example of FIG. 8, each of blocks including reference position samples specified with index 6 to index 23 may be set as a non-adjacent merge candidate block.

인접 머지 후보 블록들 및/또는 비인접 머지 후보 블록들의 위치가 부호화기 및 복호화기에 기 정의되어 있을 수 있다. 일 예로, 도 8에 도시된 예에서와 같이, 현재 블록의 경계로부터 CTU 경계 사이, 소정의 간격 마다 기준 위치 샘플을 설정할 수 있다. 일 예로, x축 좌표 또는 y축 좌표 중 적어도 하나가, 인접 머지 후보 블록(즉, 현재 블록에 이웃하는 기준 위치 샘플)으로부터, 2n*N 만큼 이격된 비인접 블록이 비인접 머지 후보 블록으로 정의될 수 있다. 여기서, n은, 1, 2, 또는 3과 같은 자연수일 수 있다. 일 예로, 현재 블록의 좌상단 샘플의 좌표가 (0,0)이고, 인접 머지 후보 블록이 (-1, -1) 위치의 기준 위치 샘플을 포함하는 경우, (-1-4N, -1-4N) 위치의 기준 위치 샘플을 포함하는 블록들이 비인접 머지 후보 블록들로 정의될 수 있다. 이때, N의 최대값은, 현재 블록과 최대 CTU 경계 사이의 거리 또는 부호화기 및 복호화기에서 기 정의된 값 중 적어도 하나에 의해 결정될 수 있다. The positions of adjacent merge candidate blocks and/or non-adjacent merge candidate blocks may be predefined in the encoder and decoder. For example, as in the example shown in FIG. 8, reference position samples can be set at predetermined intervals between the boundary of the current block and the CTU boundary. As an example, a non-adjacent block in which at least one of the can be defined. Here, n may be a natural number such as 1, 2, or 3. For example, if the coordinates of the upper left sample of the current block are (0,0) and the adjacent merge candidate block includes a reference position sample at (-1, -1) position, (-1-4N, -1-4N ) Blocks containing the reference position sample of the position may be defined as non-adjacent merge candidate blocks. At this time, the maximum value of N may be determined by at least one of the distance between the current block and the maximum CTU boundary or a value predefined in the encoder and decoder.

도 8의 예시에서와 같이, 현재 블록이 속하는 CTU의 경계 밖에 기준 위치 샘플을 설정할 수 있다(도 8의 인덱스 19 내지 23). 이에 따라, 현재 블록과 상이한 CTU에 속하는 블록이 머지 후보 블록으로 설정될 수 있다. As in the example of FIG. 8, a reference position sample can be set outside the boundary of the CTU to which the current block belongs (indexes 19 to 23 in FIG. 8). Accordingly, a block belonging to a CTU different from the current block may be set as a merge candidate block.

다만, 라인 버퍼가 무차별적으로 증가하는 것을 방지하기 위해, CTU 경계를 인접하지 않는 샘플은 기준 위치 샘플로 사용하지 않을 수 있다. 이에 따라, CTU 경계에 인접하는 비인접 블록은 머지 후보 블록으로 이용 가능하나, CTU 경계에 인접하지 않는 비인접 블록은 머지 후보 블록으로 이용 불가하다. However, to prevent the line buffer from increasing indiscriminately, samples that are not adjacent to the CTU boundary may not be used as reference position samples. Accordingly, non-adjacent blocks adjacent to the CTU boundary can be used as merge candidate blocks, but non-adjacent blocks not adjacent to the CTU boundary cannot be used as merge candidate blocks.

머지 후보를 포함하는 머지 후보 리스트를 생성할 수 있다(S702). A merge candidate list including merge candidates can be created (S702).

머지 후보 리스트 내 머지 후보들의 인덱스는 소정 순서에 따라 할당될 수 있다. 일 예로, 좌측 이웃 블록으로부터 유도된 머지 후보, 상단 이웃 블록으로부터 유도된 머지 후보, 우측 상단 이웃 블록으로부터 유도된 머지 후보, 좌측 하단 이웃 블록으로부터 유도된 머지 후보, 좌측 상단 이웃 블록으로부터 유도된 머지 후보 및 시간적 이웃 블록으로부터 유도된 머지 후보 순으로 인덱스를 부여할 수 있다. 또는, 인접 머지 후보 블록들로부터 유도된 머지 후보들, 비인접 머지 후보 블록들로터 유도된 머지 후보들 및 시간적 이웃 블록으로부터 유도된 머지 후보 순으로 인덱스를 부여할 수 있다. The indices of merge candidates in the merge candidate list may be assigned according to a predetermined order. For example, a merge candidate derived from a left neighboring block, a merge candidate derived from a top neighboring block, a merge candidate derived from an upper right neighboring block, a merge candidate derived from a lower left neighboring block, a merge candidate derived from an upper left neighboring block. And indexes can be assigned in the order of merge candidates derived from temporal neighboring blocks. Alternatively, the index may be assigned in the following order: merge candidates derived from adjacent merge candidate blocks, merge candidates derived from non-adjacent merge candidate blocks, and merge candidates derived from temporal neighboring blocks.

머지 후보 리스트에 복수의 머지 후보들이 포함된 경우, 복수의 머지 후보들 중 적어도 하나를 선택할 수 있다(S703). 구체적으로, 복수의 머지 후보들 중 어느 하나를 특정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 머지 후보 리스트에 포함된 머지 후보들 중 어느 하나의 인덱스를 나타내는 정보 merge_idx가 비트스트림을 통해 시그날링될 수 있다. If the merge candidate list includes a plurality of merge candidates, at least one of the plurality of merge candidates can be selected (S703). Specifically, information for specifying one of a plurality of merge candidates may be signaled through a bitstream. As an example, information merge_idx indicating the index of one of the merge candidates included in the merge candidate list may be signaled through a bitstream.

코딩 블록을 복수의 예측 유닛들로 분할하고, 분할된 예측 유닛들 각각에 예측을 수행할 수 있다. 여기서, 예측 유닛은 예측을 수행하기 위한 기본 단위를 나타낸다. 코딩 블록을 복수의 예측 유닛들로 분할하여 예측을 수행하는 방법을 기하학적 파티션 모드(Geometric Partition Mode, GPM)이라 호칭할 수 있다. A coding block may be divided into a plurality of prediction units, and prediction may be performed on each of the divided prediction units. Here, the prediction unit represents the basic unit for performing prediction. A method of performing prediction by dividing a coding block into a plurality of prediction units may be called geometric partition mode (GPM).

적어도 하나의 분할선을 이용하여 코딩 블록을 분할할 수 있다. 일 예로, 수직선, 수평선, 사선 또는 대각선 중 적어도 하나를 이용하여 코딩 블록을 분할할 수 있다. A coding block can be divided using at least one dividing line. For example, a coding block may be divided using at least one of a vertical line, a horizontal line, an oblique line, or a diagonal line.

도 9는 코딩 블록을 분할하는 분할선들의 종류를 나타낸 도면이다.Figure 9 is a diagram showing the types of dividing lines that divide coding blocks.

코딩 블록을 분할하여 생성되는 예측 유닛들의 개수는, 2개, 3개, 4개 또는 그 이상일 수 있다. 설명의 편의를 위해, 후술되는 실시예들에서는, 코딩 블록이 2개의 예측 유닛들로 분할되는 것으로 가정하고, 2개의 예측 유닛들 각각을 제1 예측 유닛 및 제2 예측 유닛이라 호칭하기로 한다. The number of prediction units generated by dividing the coding block may be 2, 3, 4, or more. For convenience of explanation, in the embodiments described later, it is assumed that the coding block is divided into two prediction units, and each of the two prediction units is referred to as a first prediction unit and a second prediction unit.

코딩 블록의 파티션 형태를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 구체적으로, 위 정보에 의해, 코딩 블록을 분할하는 분할선의 개수, 분할선의 각도 또는 분할선의 위치 중 적어도 하나가 결정될 수 있다. Information for determining the partition type of a coding block may be signaled through a bitstream. Specifically, based on the above information, at least one of the number of dividing lines dividing the coding block, the angle of the dividing lines, or the position of the dividing lines can be determined.

일 예로, 분할선의 각도를 나타내는 변수 angleIdx 및 분할선의 위치를 나타내는 변수 distanceIdx의 조합 후보들 중 하나를 지시하는 신택스 merge_gpm_partition_idx가 비트스트림을 통해 명시적으로 시그날링될 수 있다. As an example, the syntax merge_gpm_partition_idx indicating one of the combination candidates of the variable angleIdx indicating the angle of the dividing line and the variable distanceIdx indicating the position of the dividing line may be explicitly signaled through the bitstream.

여기서, 변수 angleIdx는 복수의 각도 후보들 중 하나를 지시할 수 있고, 복수의 각도 후보들은 도 9에 도시된 예와 같이 정의되어 있을 수 있다. 변수 distanceIdx는, 코딩 블록의 중심부로부터 분할선까지의 거리를 나타내는 복수의 거리 후보들 중 하나를 나타낼 수 있다. 변수 distanceIdx에 따라, 코딩 블록 중심을 지나는 분할선을 기반으로 코딩 블록이 분할되거나, 코딩 블록의 중심을 지나지 않는 분할선을 기반으로 코딩 블록이 분할될 수 있다. Here, the variable angleIdx may indicate one of a plurality of angle candidates, and the plurality of angle candidates may be defined as in the example shown in FIG. 9. The variable distanceIdx may represent one of a plurality of distance candidates indicating the distance from the center of the coding block to the dividing line. Depending on the variable distanceIdx, the coding block may be divided based on a dividing line that passes through the center of the coding block, or the coding block may be divided based on a dividing line that does not pass through the center of the coding block.

표 1은 변수 angleIdx 및 변수 distanceIdx의 조합들 각각에 상이한 인덱스 값이 할당되는 예를 나타낸 것이다.Table 1 shows an example in which different index values are assigned to each combination of the variable angleIdx and the variable distanceIdx.

merge_gpm_partition_idxmerge_gpm_partition_idx 00 1One 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 angleIdxangleIdx 00 00 22 22 22 22 33 33 33 33 44 44 44 44 55 55 distanceIdxdistanceIdx 1One 33 00 1One 22 33 00 1One 22 33 00 1One 22 33 00 1One merge_gpm_partition_idxmerge_gpm_partition_idx 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131 angleIdxangleIdx 55 55 88 88 1111 1111 1111 1111 1212 1212 1212 1212 1313 1313 1313 1313 distanceIdxdistanceIdx 22 33 1One 33 00 1One 22 33 00 1One 22 33 00 1One 22 33 merge_gpm_partition_idxmerge_gpm_partition_idx 3232 3333 3434 3535 3636 3737 3838 3939 4040 4141 4242 4343 4444 4545 4646 4747 angleIdxangleIdx 1414 1414 1414 1414 1616 1616 1818 1818 1818 1919 1919 1919 2020 2020 2020 2121 distanceIdxdistanceIdx 00 1One 22 33 1One 33 1One 22 33 1One 22 33 1One 22 33 1One merge_gpm_partition_idxmerge_gpm_partition_idx 4848 4949 5050 5151 5252 5353 5454 5555 5656 5757 5858 5959 6060 6161 6262 6363 angleIdxangleIdx 2121 2121 2424 2424 2727 2727 2727 2828 2828 2828 2929 2929 2929 3030 3030 3030 distanceIdxdistanceIdx 22 33 1One 33 1One 22 33 1One 22 33 1One 22 33 1One 22 33

상술한 예와 달리, 분할선의 각도을 나타내는 변수 angleIdx를 결정하기 위한 신택스 및 분할선의 위치를 나타내는 변수 distanceIdx를 결정하기 위한 신택스를 개별적으로 시그날링할 수도 있다. 한편, 코딩 블록의 크기 및/또는 형태에 따라, 두 신택스들 중 하나의 시그날링이 생략될 수 있다.Unlike the above-described example, the syntax for determining the variable angleIdx indicating the angle of the dividing line and the syntax for determining the variable distanceIdx indicating the position of the dividing line may be signaled separately. Meanwhile, depending on the size and/or shape of the coding block, signaling of one of the two syntaxes may be omitted.

코딩 블록의 크기 및/또는 형태에 따라, 변수 angleIdx가 지시할 수 있는 각도 후보들의 개수 및/또는 변수 distanceIdx가 지시할 수 있는 거리 후보들의 개수가 적응적으로 결정될 수도 있다.Depending on the size and/or shape of the coding block, the number of angle candidates that the variable angleIdx can indicate and/or the number of distance candidates that the variable distanceIdx can indicate may be adaptively determined.

코딩 블록을 제1 예측 유닛 및 제2 예측 유닛으로 분할한 뒤, 제1 예측 유닛 및 제2 예측 유닛 각각에 대한 움직임 정보를 유도할 수 있다. 일 예로, 코딩 블록의 위치 및 크기를 기준으로 유도된 머지 후보 리스트를 기초로, 제1 예측 유닛 및 제2 예측 유닛 각각의 머지 후보를 선택하여, 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 유도할 수 있다.After dividing the coding block into a first prediction unit and a second prediction unit, motion information for each of the first prediction unit and the second prediction unit can be derived. As an example, based on a merge candidate list derived based on the position and size of the coding block, merge candidates for each of the first prediction unit and the second prediction unit are selected, and movement of each of the first prediction unit and the second prediction unit is performed. Information can be derived.

이를 위해, 제1 예측 유닛의 머지 후보를 가리키는 제1 머지 인덱스, 예컨대, gpm_merge_idx0 및 제2 예측 유닛의 머지 후보를 가리키는 제2 머지 인덱스, 예컨대, gpm_merge_idx1이 각각 시그날링될 수 있다. To this end, a first merge index, e.g., gpm_merge_idx0, indicating a merge candidate of the first prediction unit, and a second merge index, e.g., gpm_merge_idx1, indicating a merge candidate of the second prediction unit may be signaled, respectively.

제1 예측 유닛의 머지 후보와 제2 예측 유닛의 머지 후보는 상이할 수 있다. 이에 따라, 제1 머지 인덱스에 의해 머지 후보가 선택되면, 상기 머지 후보들을 제외한 잔여 머지 후보들 중에서 제2 예측 유닛의 머지 후보를 선택할 수 있다. 즉, 제1 머지 인덱스에 의해 지시되는 머지 후보를 제외한 잔여 머지 후보들의 인덱스를 재할당한 뒤, 재할당된 인덱스를 갖는 머지 후보들 중 하나를 지시하도록 제2 머지 인덱스를 부호화할 수 있다. 일 예로, 재할당의 결과, 제1 머지 인덱스에 의해 지시되는 머지 후보보다 인덱스가 큰 머지 후보들에는, 1이 감소된 인덱스가 배정될 수 있다. The merge candidate of the first prediction unit and the merge candidate of the second prediction unit may be different. Accordingly, when a merge candidate is selected based on the first merge index, a merge candidate for the second prediction unit can be selected from among the remaining merge candidates excluding the merge candidates. That is, after reallocating the indices of the remaining merge candidates excluding the merge candidate indicated by the first merge index, the second merge index can be encoded to indicate one of the merge candidates with the reallocated index. As an example, as a result of reallocation, an index of which 1 is reduced may be assigned to merge candidates whose index is larger than the merge candidate indicated by the first merge index.

복호화 단계에서는, 제1 머지 인덱스와 제2 머지 인덱스의 값을 비교하여, 제2 예측 유닛의 머지 후보를 선택할 수 있다. 일 예로, 제2 머지 인덱스 gpm_merge_idx1의 값이 제1 머지 인덱스 gpm_merge_idx0보다 작은 경우에는, 제2 머지 인덱스 gpm_merge_idx1의 값을 인덱스로 갖는 머지 후보가 선택될 수 있다. 반면, 제2 머지 인덱스 gpm_merge_idx1의 값이 제1 머지 인덱스 gpm_merge_idx0과 같거나 클 경우, 제2 머지 인덱스 gpm_merge_idx1에 1을 더한 값을 인덱스를 갖는 머지 후보가 선택될 수 있다. In the decoding step, the values of the first merge index and the second merge index can be compared to select a merge candidate for the second prediction unit. For example, when the value of the second merge index gpm_merge_idx1 is smaller than the first merge index gpm_merge_idx0, a merge candidate having the value of the second merge index gpm_merge_idx1 as an index may be selected. On the other hand, if the value of the second merge index gpm_merge_idx1 is equal to or greater than the first merge index gpm_merge_idx0, a merge candidate whose index is the second merge index gpm_merge_idx1 plus 1 may be selected.

제1 머지 인덱스에 의해 선택된 제1 머지 후보의 움직임 정보를 제1 예측 유닛의 움직임 정보로 설정하고, 제2 머지 인덱스에 의해 선택된 제2 머지 후보의 움직임 정보를 제2 예측 유닛의 움직임 정보로 설정할 수 있다. The motion information of the first merge candidate selected by the first merge index is set as the motion information of the first prediction unit, and the motion information of the second merge candidate selected by the second merge index is set as the motion information of the second prediction unit. You can.

이후, 제1 예측 유닛의 움직임 정보를 기초로 제1 예측 블록을 획득하고, 제2 예측 유닛의 움직임 정보를 기초로 제2 예측 블록을 획득할 수 있다. 이후, 제1 예측 블록 및 제2 예측 블록의 가중합 연산을 통해, 코딩 블록에 대한 최종 예측 블록을 획득할 수 있다. 이때, 제1 예측 블록에 포함된 예측 샘플들에 적용되는 가중치 및 제2 예측 블록에 포함된 예측 샘플들에 적용되는 가중치는, 최종 예측 샘플의 위치에 따라 적응적으로 결정될 수 있다. Thereafter, the first prediction block may be obtained based on the motion information of the first prediction unit, and the second prediction block may be obtained based on the motion information of the second prediction unit. Afterwards, the final prediction block for the coding block can be obtained through a weighted sum operation of the first prediction block and the second prediction block. At this time, the weight applied to the prediction samples included in the first prediction block and the weight applied to the prediction samples included in the second prediction block may be adaptively determined according to the location of the final prediction sample.

머지 후보 움직임 정보를 그대로 사용하는 대신, 머지 후보의 움직임 정보를 수정하고, 수정된 움직임 정보를 사용할 수 있다. 일 예로, 현재 블록에 대한 머지 후보가 선택되면, 선택된 머지 후보의 움직임 벡터에 오프셋 벡터를 가산 또는 감산한 것을, 현재 블록의 움직임 벡터로 설정할 수 있다. 위와 같이, 머지 후보의 움직임 벡터를 오프셋 벡터를 이용하여 수정하는 것을 움직임 벡터 차분이 있는 머지 모드(Merge mode with Motion vector Difference, MMVD)라 호칭할 수 있다. Instead of using the merge candidate motion information as is, the motion information of the merge candidate can be modified and the modified motion information can be used. For example, when a merge candidate for the current block is selected, an offset vector added or subtracted from the motion vector of the selected merge candidate can be set as the motion vector of the current block. As above, modifying the motion vector of a merge candidate using an offset vector can be called Merge mode with Motion vector Difference (MMVD).

오프셋 벡터를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 구체적으로, 오프셋 벡터의 방향을 나타내는 신택스 mvd_direction_idx 및 오프셋 벡터의 크기를 나타내는 신택스 mvd_distance_idx 각각이 부호화되어 시그날링될 수 있다. Information for determining the offset vector may be signaled through a bitstream. Specifically, the syntax mvd_direction_idx indicating the direction of the offset vector and the syntax mvd_distance_idx indicating the size of the offset vector may each be encoded and signaled.

신택스 mvd_direction_idx는, 복수의 방향 후보들 중 하나를 나타낸다. 일 예로, 표 2는 복수의 방향 후보들 각각에 할당되는 상이한 인덱스 값이 할당된 예를 나타낸 것이다. The syntax mvd_direction_idx represents one of a plurality of direction candidates. As an example, Table 2 shows an example in which different index values are assigned to each of a plurality of direction candidates.

mmvd_distance_idx[mmvd_distance_idx[ x0x0 ][][ y0y0 ]] MmvdDistance[MmvdDistance[ x0x0 ][][ y0y0 ]] ph_mmvd_fullpel_only_flagph_mmvd_fullpel_only_flag == == 00 ph_mmvd_fullpel_only_flagph_mmvd_fullpel_only_flag == == 1One 00 1One 44 1One 22 88 22 44 1616 33 88 3232 44 1616 6464 55 3232 128128 66 6464 256256 77 128128 512512

신택스 mvd_distance_idx는, 복수의 거리 후보들 중 하나를 나타낸다. 일 예로, 표 3은 복수의 거리 후보들 각각에 할당되는 상이한 인덱스 값이 할당된 예를 나타낸 것이다. The syntax mvd_distance_idx represents one of a plurality of distance candidates. As an example, Table 3 shows an example in which different index values are assigned to each of a plurality of distance candidates.

mmvd_direction_idx[mmvd_direction_idx[ x0x0 ][][ y0y0 ]] MmvdSign[MmvdSign[ x0x0 ][][ y0y0 ][][ 00 ]] MmvdSign[MmvdSign[ x0x0 ][][ y0y0 ][][ 1One ]] 00 +1+1 00 1One -1-One 00 22 00 +1+1 33 00 -1-One

위 두 신택스들에 의해, 방향 후보 및 거리 후보가 선택되면, 다음의 수학식 1을 기초로, 오프셋 벡터가 유도될 수 있다.If a direction candidate and a distance candidate are selected using the above two syntaxes, an offset vector can be derived based on Equation 1 below.

Figure pat00001
Figure pat00001

상기 수학식 1에서 MmvdOffset[x0][y0][0]는 오프셋 벡터의 수평 방향 성분을 나타내고, MmvdOffset[x0][y0][1]은 오프셋 벡터의 수직 방향 성분을 나타낸다. MmvdDistance는 mvd_distance_idx에 의해 선택된 거리 후보의 값을 나타내고, MmvdSign은, mvd_direction_idx에 의해 선택된 방향 후보의 값을 나타낸다.In Equation 1, MmvdOffset[x0][y0][0] represents the horizontal component of the offset vector, and MmvdOffset[x0][y0][1] represents the vertical component of the offset vector. MmvdDistance represents the value of the distance candidate selected by mvd_distance_idx, and MmvdSign represents the value of the direction candidate selected by mvd_direction_idx.

GPM 모드와 MMVD를 결합하여 사용할 수 있다. 일 예로, 제1 예측 유닛의 움직임 정보 또는 제2 예측 유닛의 움직임 정보 중 적어도 하나를 유도함에 있어서, MMVD를 적용할 수 있다. 즉, 제1 예측 유닛의 움직임 벡터 또는 제2 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터에 오프셋 벡터를 가산 또는 감산하여 유도될 수 있다. GPM mode and MMVD can be used in combination. For example, when deriving at least one of motion information of the first prediction unit or motion information of the second prediction unit, MMVD may be applied. That is, the motion vector of the first prediction unit or the motion vector of the second prediction unit can be derived by adding or subtracting the offset vector from the motion vector of the merge candidate.

GPM 모드 하에서 MMVD가 적용되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 상기 정보는 1비트의 플래그일 수 있다. 또한, 상기 정보는 예측 유닛들 각각에 대해 부호화되어 시그날링될 수 있다. Information indicating whether MMVD is applied under GPM mode may be signaled through a bitstream. As an example, the information may be a 1-bit flag. Additionally, the information may be encoded and signaled for each prediction unit.

표 4는 예측 유닛들 각각에 대해 MMVD 적용 여부를 나타내는 플래그가 시그날링되는 예를 나타낸 것이다.Table 4 shows an example in which a flag indicating whether to apply MMVD is signaled for each prediction unit.

merge_data( x0, y0, cbWidth, cbHeight, chType ) {merge_data( x0, y0, cbWidth, cbHeight, chType ) { DescriptorDescriptor ... ... gpm_mmvd_flag0gpm_mmvd_flag0 ae(v)ae(v) gpm_mmvd_flag1gpm_mmvd_flag1 ae(v)ae(v) if (gpm_mmvd_flag0){ if (gpm_mmvd_flag0){ gpm_merge_idx0gpm_merge_idx0 ae(v)ae(v) gpm_mmvd_idx0gpm_mmvd_idx0 ae(v)ae(v) Else Else gpm_merge_idx0gpm_merge_idx0 ae(v)ae(v) }} if (gpm_mmvd_flag1) if (gpm_mmvd_flag1) gpm_mmvd_idx1gpm_mmvd_idx1 ae(v)ae(v) if (!gpm_mmvd_flag0)if (!gpm_mmvd_flag0) gpm_merge_idx1 gpm_merge_idx1 ae(v)ae(v) else else gpm_merge_idx1 gpm_merge_idx1 ae(v)ae(v) ... ... }}

표 4에서, 신택스 gpm_mmvd_flag0는, 제1 예측 유닛에 대해 MMVD가 적용되는지 여부를 나타낸다. 신택스 gpm_mmvd_flag0의 값이 1인 것은, 제1 예측 유닛에 대해 MMVD가 적용됨을 나타낸다. 이 경우, 제1 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터에 오프셋 벡터를 가산 또는 감산하여 유도될 수 있다. 반면, 신택스 gpm_mmvd_flag0의 값이 0인 것은, 제1 예측 유닛에 대해 MMVD가 적용되지 않음을 나타낸다. 이 경우, 제1 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터와 동일하게 설정될 수 있다. In Table 4, the syntax gpm_mmvd_flag0 indicates whether MMVD is applied to the first prediction unit. The value of syntax gpm_mmvd_flag0 is 1, indicating that MMVD is applied to the first prediction unit. In this case, the motion vector of the first prediction unit can be derived by adding or subtracting the offset vector from the motion vector of the merge candidate. On the other hand, the value of syntax gpm_mmvd_flag0 is 0, indicating that MMVD is not applied to the first prediction unit. In this case, the motion vector of the first prediction unit may be set to be the same as the motion vector of the merge candidate.

또한, 신택스 gpm_mmvd_flag1는, 제2 예측 유닛에 대해 MMVD가 적용되는지 여부를 나타낸다. 신택스 gpm_mmvd_flag1의 값이 1인 것은, 제2 예측 유닛에 대해 MMVD가 적용됨을 나타낸다. 이 경우, 제2 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터에 오프셋 벡터를 가산 또는 감산하여 유도될 수 있다. 반면, 신택스 gpm_mmvd_flag1의 값이 0인 것은, 제2 예측 유닛에 대해 MMVD가 적용되지 않음을 나타낸다. 이 경우, 제2 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터와 동일하게 설정될 수 있다. Additionally, the syntax gpm_mmvd_flag1 indicates whether MMVD is applied to the second prediction unit. The value of syntax gpm_mmvd_flag1 is 1, indicating that MMVD is applied to the second prediction unit. In this case, the motion vector of the second prediction unit can be derived by adding or subtracting the offset vector from the motion vector of the merge candidate. On the other hand, the value of syntax gpm_mmvd_flag1 is 0, indicating that MMVD is not applied to the second prediction unit. In this case, the motion vector of the second prediction unit may be set to be the same as the motion vector of the merge candidate.

표 4의 예와 달리, 코딩 블록 레벨에서 MMVD 적용 여부를 나타내는 1비트 플래그가 시그날링될 수도 있다. 일 예로, 코딩 블록 레벨에서, GPM 모드에 MMVD 모드가 결합 적용되는지 여부를 나타내는 신택스 gpm_mmvd_flag가 부호화되어 시그날링될 수 있다. Unlike the example in Table 4, a 1-bit flag indicating whether MMVD is applied may be signaled at the coding block level. As an example, at the coding block level, the syntax gpm_mmvd_flag indicating whether the MMVD mode is applied in combination with the GPM mode may be encoded and signaled.

신택스 gpm_mmvd_flag의 값이 0인 경우, 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 벡터는, 그들각각의 머지 후보의 움직임 벡터와 동일하게 설정될 수 있다. When the value of the syntax gpm_mmvd_flag is 0, the motion vector of each of the first prediction unit and the second prediction unit may be set to be the same as the motion vector of their respective merge candidates.

신택스 gpm_mmvd_flag의 값이 1인 것은, 제1 예측 유닛 또는 제2 예측 유닛 중 적어도 하나의 움직임 벡터를 유도함에 있어서, MMVD가 이용됨을 나타낸다. 이 경우, 제1 예측 유닛 및 제2 예측 유닛 각각에 MMVD가 적용되는지 여부를 나타내는 정보가 추가 부호화되어 시그날링될 수 있다. 일 예로, 상기 정보는, MMVD가 적용될 수 있는 복수 경우들 중 하나를 지시하는 인덱스일 수 있다. 일 예로, 제1 예측 유닛에만 MMVD가 적용되는 경우, 제2 예측 유닛에만 MMVD가 적용되는 경우 및 제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 경우 각각에 상이한 인덱스를 할당한 뒤, 이들 중 하나를 가리키는 정보를 부호화하여 시그날링할 수 있다. The value of the syntax gpm_mmvd_flag is 1, indicating that MMVD is used in deriving the motion vector of at least one of the first prediction unit or the second prediction unit. In this case, information indicating whether MMVD is applied to each of the first prediction unit and the second prediction unit may be additionally encoded and signaled. As an example, the information may be an index indicating one of multiple cases to which MMVD can be applied. For example, when MMVD is applied only to the first prediction unit, when MMVD is applied only to the second prediction unit, and when MMVD is applied to both the first prediction unit and the second prediction unit, different indices are assigned to each, Information pointing to one of these can be encoded and signaled.

또는, 상기 정보는, 제1 예측 유닛에 MMVD가 적용되는지 여부를 나타내는 제1 MMVD 플래그 및 제2 예측 유닛에 MMVD가 적용되는지 여부를 나타내는 제2 MMVD 플래그를 포함할 수 있다. 제1 MMVD 플래그 및 제2 MMVD 플래그는 순차적으로 부/복호화되리 수 있다. 이때, 제1 MMVD 플래그가 제1 예측 유닛에 MMVD가 적용되지 않음을 나타내는 경우, 제2 MMVD 플래그의 부/복호화를 생략하고, 제2 예측 유닛에 MMVD가 적용되는 것으로 결정할 수도 있다. Alternatively, the information may include a first MMVD flag indicating whether MMVD is applied to the first prediction unit and a second MMVD flag indicating whether MMVD is applied to the second prediction unit. The first MMVD flag and the second MMVD flag may be sequentially encoded/decoded. At this time, when the first MMVD flag indicates that MMVD is not applied to the first prediction unit, encoding/decoding of the second MMVD flag may be omitted and it may be determined that MMVD is applied to the second prediction unit.

또는, 코딩 블록 레벨에서 MMVD가 적용되는 것으로 결정되는 경우, 제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 것을 디폴트로 설정할 수도 있다. Alternatively, when it is determined that MMVD is applied at the coding block level, it may be set as a default that MMVD is applied to both the first prediction unit and the second prediction unit.

또는, 코딩 블록 레벨에서 MMVD가 적용되는 것으로 결정되는 경우, 제1 예측 유닛을 위한 머지 후보의 인덱스 및 제2 예측 유닛을 위한 머지 후보의 인덱스를 기반으로, 제1 예측 유닛 및 제2 예측 유닛 각각에 MMVD가 적용되는지 여부를 결정할 수도 있다.Or, when it is determined that MMVD is applied at the coding block level, based on the index of the merge candidate for the first prediction unit and the index of the merge candidate for the second prediction unit, respectively, the first prediction unit and the second prediction unit You can also decide whether MMVD applies to .

일 예로, 제1 예측 유닛을 위한 머지 후보의 인덱스와 제2 예측 유닛을 위한 머지 후보의 인덱스를 비교한 뒤, 인덱스의 값이 작은 머지 후보를 이용하는 예측 유닛에만 MMVD를 적용할 수 있다.For example, after comparing the index of the merge candidate for the first prediction unit and the index of the merge candidate for the second prediction unit, MMVD can be applied only to the prediction unit that uses the merge candidate with a small index value.

또는, 머지 후보의 인덱스와 문턱값을 비교하여, 예측 유닛에 MMVD를 적용할 것인지 여부를 결정할 수 있다. 일 예로, 제1 예측 유닛을 위한 머지 후보의 인덱스와 문턱값을 비교한 뒤, 인덱스가 문턱값보다 작은 경우, 제1 예측 유닛에 MMVD를 적용할 수 있다. 반면, 인덱스가 문턱값 이상인 경우, 제1 예측 유닛에 MMVD가 적용되지 않는 것으로 결정될 수 있다. 마찬가지로, 제2 예측 유닛을 위한 머지 후보의 인덱스와 문턱값을 비교한 뒤, 인덱스가 문턱값보다 작은 경우, 제2 예측 유닛에 MMVD를 적용할 수 있다. 반면, 인덱스가 문턱값 이상인 경우, 제2 예측 유닛에 MMVD가 적용되지 않는 것으로 결정될 수 있다. Alternatively, it is possible to determine whether to apply MMVD to the prediction unit by comparing the index of the merge candidate and the threshold value. For example, after comparing the index of the merge candidate for the first prediction unit and the threshold, if the index is less than the threshold, MMVD can be applied to the first prediction unit. On the other hand, if the index is greater than or equal to the threshold, it may be determined that MMVD is not applied to the first prediction unit. Likewise, after comparing the index of the merge candidate for the second prediction unit and the threshold value, if the index is less than the threshold value, MMVD can be applied to the second prediction unit. On the other hand, if the index is greater than or equal to the threshold, it may be determined that MMVD is not applied to the second prediction unit.

MMVD가 적용된 경우와 그렇지 않은 경우에 있어서, 예측 유닛이 선택할 수 있는 머지 후보들의 최대 개수가 상이하게 설정될 수 있다. In cases where MMVD is applied and cases where it is not, the maximum number of merge candidates that a prediction unit can select may be set differently.

일 예로, 제1 예측 유닛에 MMVD가 적용되는 경우, 머지 후보 리스트에 포함된 N개의 머지 후보들 중 하나가 제1 예측 유닛을 위해 선택될 수 있다. 반면, MMVD가 적용되는 경우, 머지 후보 리스트에 포함된 N개의 머지 후보들 중 인덱스가 작은 2개의 머지 후보들 중 하나가 제1 예측 유닛을 위해 선택될 수 있다. For example, when MMVD is applied to the first prediction unit, one of N merge candidates included in the merge candidate list may be selected for the first prediction unit. On the other hand, when MMVD is applied, one of the two merge candidates with a small index among the N merge candidates included in the merge candidate list may be selected for the first prediction unit.

위 제약 사항은, 제2 예측 유닛에 대해서도 동일하게 적용될 수 있다. The above constraints can be equally applied to the second prediction unit.

제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 경우, 제2 예측 유닛에 대한 제2 머지 인덱스 gpm_merge_idx1의 부/복호화를 생략할 수도 있다. 일 예로, 표 4에서는, 제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 경우, 제2 머지 인덱스 gpm_merge_idx1의 부/복호화가 생략되는 것으로 예시되었다. 이 경우, 제2 머지 인덱스 gpm_merge_idx1의 값은 비트스트림을 통해 명시적으로 시그날링된 제1 머지 인덱스의 값을 기초로 유도된 값을 갖는 것으로 추론(infer)될 수 있다. 일 예로, 제2 머지 인덱스의 값은 다음의 수학식 2에 따라 추론될 수 있다.When MMVD is applied to both the first prediction unit and the second prediction unit, encoding/decoding of the second merge index gpm_merge_idx1 for the second prediction unit may be omitted. As an example, in Table 4, when MMVD is applied to both the first prediction unit and the second prediction unit, encoding/decoding of the second merge index gpm_merge_idx1 is omitted. In this case, the value of the second merge index gpm_merge_idx1 may be inferred to have a value derived based on the value of the first merge index explicitly signaled through the bitstream. As an example, the value of the second merge index can be inferred according to Equation 2 below.

Figure pat00002
Figure pat00002

또는, 제1 예측 유닛 및 제2 예측 유닛 중 어느 하나에만 MMVD가 적용되는 경우, MMVD가 적용되는 예측 유닛에 대해서는 머지 인덱스의 부/복호화를 생략하고, MMVD가 적용되지 않는 예측 유닛에 대해서만 머지 인덱스를 부/복호화할 수도 있다. Alternatively, when MMVD is applied to only one of the first prediction unit and the second prediction unit, omit encoding/decoding of the merge index for the prediction unit to which MMVD is applied, and merge index only for prediction units to which MMVD is not applied. You can also encode/decode.

일 예로, 제1 예측 유닛에는 MMVD가 적용되는 반면, 제2 예측 유닛에는 MMVD가 적용되지 않는 경우, 제1 머지 인덱스 merge_gpm_idx0의 부/복호화는 생략되는 반면, 제2 머지 인덱스 merge_gpm_idx1는 비트스트림을 통해 명시적으로 시그날링될 수 있다. 이 경우, 디폴트 값 또는 제2 머지 인덱스에서 오프셋을 가산 또는 감산한 값을 인덱스로 갖는 머지 후보가 제1 예측 유닛을 위해 이용될 수 있다. 마찬가지로, 제1 예측 유닛에는 MMVD가 적용되지 않는 반면, 제2 예측 유닛에는 MMVD가 적용되는 경우, 제1 머지 인덱스 merge_gpm_idx0는 비트스트림을 통해 명시적으로 시그날링되는 반면, 제2 머지 인덱스 merge_gpm_idx1의 부/복호화는 생략될 수 있다. 이 경우, 디폴트 값 또는 제1 머지 인덱스에서 오프셋을 가산 또는 감산한 값을 인덱스로 갖는 머지 후보가 제2 예측 유닛을 위해 이용될 수 있다. 여기서, 디폴트값은 0 또는 1과 같은 정수이고, 오프셋은 1 또는 2와 같은 정수일 수 있다. As an example, if MMVD is applied to the first prediction unit while MMVD is not applied to the second prediction unit, encoding/decoding of the first merge index merge_gpm_idx0 is omitted, while the second merge index merge_gpm_idx1 is transmitted through the bitstream. Can be signaled explicitly. In this case, a merge candidate whose index is a value obtained by adding or subtracting an offset from the default value or the second merge index can be used for the first prediction unit. Likewise, if MMVD is not applied to the first prediction unit, while MMVD is applied to the second prediction unit, the first merge index merge_gpm_idx0 is explicitly signaled through the bitstream, while the second merge index merge_gpm_idx1 /Decryption can be omitted. In this case, a merge candidate whose index is a default value or a value obtained by adding or subtracting an offset from the first merge index can be used for the second prediction unit. Here, the default value may be an integer such as 0 or 1, and the offset may be an integer such as 1 or 2.

MMVD가 적용되는 예측 유닛에 대해, 오프셋 벡터를 결정하기 위한 정보가 추가로 부/복호화될 수 있다. 일 예로, 제1 예측 유닛에 MMVD가 적용되는 경우, 제1 예측 유닛에 대한, 움직임 벡터 오프셋 벡터를 결정하기 위한 신택스 gpm_mmvd_idx0가 부/복호화될 수 있다. 마찬가지로, 제2 예측 유닛에 MMVD가 적용되는 경우, 제2 예측 유닛에 대한 움직임 벡터 오프셋 벡터를 결정하기 위한 신택스 gpm_mmvd_idx1이 부/복호화될 수 있다. 여기서, gpm_mmvd_idxX (X는 0 또는 1)은 복수개의 오프셋 벡터 후보들 중 하나를 지시할 수 있다. 나아가, 복수의 오프셋 벡터 후보들 각각은, 방향 또는 거리 중 적어도 하나가 상이할 수 있다.For prediction units to which MMVD is applied, information for determining an offset vector may be additionally encoded/decoded. As an example, when MMVD is applied to the first prediction unit, the syntax gpm_mmvd_idx0 for determining the motion vector offset vector for the first prediction unit may be encoded/decoded. Likewise, when MMVD is applied to the second prediction unit, the syntax gpm_mmvd_idx1 for determining the motion vector offset vector for the second prediction unit may be encoded/decoded. Here, gpm_mmvd_idxX (X is 0 or 1) may indicate one of a plurality of offset vector candidates. Furthermore, each of the plurality of offset vector candidates may be different in at least one of direction or distance.

또는, MMVD가 적용되는 예측 유닛에 대해, 복수의 방향 후보들 중 하나를 지시하는 정보, 예컨대, gpm_mmvd_direction_idxX 및 복수의 거리 후보들 중 하나를 지시하는 정보, 예컨대, gpm_mmvd_distance_idxX 각각이 부호화되어 시그날링될 수도 있다. Alternatively, for a prediction unit to which MMVD is applied, information indicating one of a plurality of direction candidates, such as gpm_mmvd_direction_idxX, and information indicating one of a plurality of distance candidates, such as gpm_mmvd_distance_idxX, may each be encoded and signaled.

제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 경우, 제1 예측 유닛 및 제2 예측 유닛이 동일한 머지 후보를 사용하도록 설정할 수도 있다. 표 5는 제1 예측 유닛 및 제2 예측 유닛이 동일한 머지 후보를 사용하는 경우, 신택스 구조를 나타낸 예시이다.When MMVD is applied to both the first prediction unit and the second prediction unit, the first prediction unit and the second prediction unit may be set to use the same merge candidate. Table 5 is an example of a syntax structure when the first prediction unit and the second prediction unit use the same merge candidate.

merge_data( x0, y0, cbWidth, cbHeight, chType ) {merge_data( x0, y0, cbWidth, cbHeight, chType ) { DescriptorDescriptor ... ... gpm_mmvd_flag0gpm_mmvd_flag0 ae(v)ae(v) gpm_mmvd_flag1gpm_mmvd_flag1 ae(v)ae(v) if (gpm_mmvd_flag0 ==1 && gpm_mmmvd_flag1==1){ if (gpm_mmvd_flag0 ==1 && gpm_mmmvd_flag1==1){ gpm_mmvd_idx0 gpm_mmvd_idx0 ae(v)ae(v) gpm_mmvd_idx1gpm_mmvd_idx1 ae(v)ae(v) if(gpm_mmvd_idx0 != gpm_mmvd_idx1 ) { if(gpm_mmvd_idx0 != gpm_mmvd_idx1 ) { gpm_merge_idx0gpm_merge_idx0 ae(v)ae(v) } else { } else { gpm_merge_idx0gpm_merge_idx0 ae(v)ae(v) gpm_merge_idx1gpm_merge_idx1 ae(v)ae(v) } } } else if (gpm_mmvd_flag0 ==1 && gpm_mmmvd_flag1==0){} else if (gpm_mmvd_flag0 ==1 && gpm_mmmvd_flag1==0){ gpm_mmvd_idx0 gpm_mmvd_idx0 ae(v)ae(v) gpm_merge_idx0gpm_merge_idx0 ae(v)ae(v) } else { } else { gpm_mmvd_idx1 gpm_mmvd_idx1 ae(v)ae(v) gpm_merge_idx1gpm_merge_idx1 ae(v)ae(v) } } }} ... ... }}

제1 예측 유닛 및 제2 예측 유닛에 모두 MMVD가 적용되는 경우, 제1 예측 유닛에 대해서만 머지 인덱스(즉, merge_gpm_idx0)가 시그날링되고, 제2 예측 유닛에 대해서는 머지 인덱스(즉, merge_gpm_idx1)가 부/복호화되지 않을 수 있다.When MMVD is applied to both the first prediction unit and the second prediction unit, the merge index (i.e. merge_gpm_idx0) is signaled only for the first prediction unit, and the merge index (i.e. merge_gpm_idx1) is signaled for the second prediction unit. /May not be decrypted.

나아가, 예측 유닛들 각각의 MMVD를 위한 오프셋 벡터를 결정한 뒤, 예측 유닛들 각각의 머지 후보를 선택할 수도 있다. 즉, 표 5의 예에서와 같이, 예측 유닛의 오프셋 벡터를 나타내는 신택스 gpm_mmvd_idxX를 부/복호화한 이후, 예측 유닛의 머지 후보를 가리키는 신택스 gpm_merge_idxX가 부/복호화될 수 있다. Furthermore, after determining the offset vector for the MMVD of each prediction unit, a merge candidate for each prediction unit may be selected. That is, as in the example of Table 5, after encoding/decoding the syntax gpm_mmvd_idxX indicating the offset vector of the prediction unit, the syntax gpm_merge_idxX indicating the merge candidate of the prediction unit can be encoded/decoded.

이때, 제1 예측 유닛에 대한 오프셋 벡터 및 제2 예측 유닛에 대한 오프셋 벡터가 동일한 경우, 제1 예측 유닛의 머지 후보와 상이한 머지 후보가 제2 예측 유닛을 위해 선택될 수 있다. 이를 위해, 제1 예측 유닛에 대한 오프셋 벡터 및 제2 예측 유닛에 대한 오프셋 벡터가 동일한 경우(즉, gpm_mmvd_idx0 및 gpm_mmvd_idx1이 같은 경우), 제1 예측 유닛에 대한 제1 머지 인덱스 gpm_merge_idx0 뿐만 아니라, 제2 예측 유닛에 대한 제2 머지 인덱스 gpm_merge_idx1도 부호화되어 시그날링될 수 있다. At this time, if the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same, a merge candidate different from the merge candidate of the first prediction unit may be selected for the second prediction unit. For this, if the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same (i.e., gpm_mmvd_idx0 and gpm_mmvd_idx1 are the same), then the first merge index gpm_merge_idx0 for the first prediction unit, as well as the second The second merge index gpm_merge_idx1 for the prediction unit may also be encoded and signaled.

또는, 제1 예측 유닛에 대한 오프셋 벡터 및 제2 예측 유닛에 대한 오프셋 벡터가 동일한 경우(즉, gpm_mmvd_idx0 및 gpm_mmvd_idx1이 같은 경우), 제2 예측 유닛에 대한 제2 머지 인덱스 gpm_merge_idx1의 부/복호화를 생략하고, 상술한 수학식 2에 따라, 제2 예측 유닛의 머지 후보를 선택할 수도 있다. Alternatively, if the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same (i.e., gpm_mmvd_idx0 and gpm_mmvd_idx1 are the same), omit encoding/decoding of the second merge index gpm_merge_idx1 for the second prediction unit. And, according to Equation 2 described above, a merge candidate for the second prediction unit may be selected.

표 4 및 표 5의 예에서는, 예측 유닛에 대해 MMVD가 적용되는지 여부를 나타내는 신택스 gpm_mmvd_flagX를 복호화한 이후, 예측 유닛의 머지 후보를 가리키는 신택스 gpm_merge_idxX가 복호화되는 것으로 예시되었다. 예시된 바와 달리, 예측 유닛의 머지 후보를 가리키는 신택스 gpm_merge_idxX를 부/복호화한 이후, MMVD가 적용되는지 여부를 나타내는 신택스 gpm_mmvd_flagX를 부/복호화할 수도 있다.In the examples of Tables 4 and 5, after decoding the syntax gpm_mmvd_flagX indicating whether MMVD is applied to the prediction unit, the syntax gpm_merge_idxX indicating the merge candidate of the prediction unit is decoded. Unlike the example, after encoding/decoding the syntax gpm_merge_idxX indicating the merge candidate of the prediction unit, the syntax gpm_mmvd_flagX indicating whether MMVD is applied may be encoded/decoded.

이때, 인덱스가 문턱값보다 작은 머지 후보를 이용하는 예측 유닛에만, MMVD 적용 여부를 나타내는 정보를 부호화하여 시그날링할 수 있다. 일 예로, 제1 예측 유닛을 위해 선택된 머지 후보의 인덱스가 문턱값보다 작은 경우, 제1 예측 유닛에 대해 MMVD 적용 여부를 나타내는 플래그 gpm_mmvd_flag0를 부호화하여 시그날링할 수 있다. 반면, 제1 예측 유닛을 위해 선택된 머지 후보의 인덱스가 문턱값 이상인 경우, 제1 예측 유닛에 대해 플래그 gpm_mmvd_flag0를 부/복호화하는 것을 생략하고, MMVD를 적용하지 않을 수 있다. 마찬가지로, 제2 예측 유닛을 위해 선택된 머지 후보의 인덱스가 문턱값보다 작은 경우, 제2 예측 유닛에 대해 MMVD 적용 여부를 나타내는 플래그 gpm_mmvd_flag1를 부호화하여 시그날링할 수 있다. 반면, 제2 예측 유닛을 위해 선택된 머지 후보의 인덱스가 문턱값 이상인 경우, 제2 예측 유닛에 대해 플래그 gpm_mmvd_flag1를 부/복호화하는 것을 생략하고, MMVD를 적용하지 않을 수 있다.At this time, information indicating whether MMVD is applied can be encoded and signaled only to prediction units that use a merge candidate whose index is smaller than the threshold. For example, if the index of the merge candidate selected for the first prediction unit is smaller than the threshold, the flag gpm_mmvd_flag0 indicating whether to apply MMVD to the first prediction unit may be encoded and signaled. On the other hand, if the index of the merge candidate selected for the first prediction unit is greater than or equal to the threshold, encoding/decoding the flag gpm_mmvd_flag0 for the first prediction unit may be omitted and MMVD may not be applied. Likewise, if the index of the merge candidate selected for the second prediction unit is smaller than the threshold, the flag gpm_mmvd_flag1 indicating whether to apply MMVD to the second prediction unit may be encoded and signaled. On the other hand, if the index of the merge candidate selected for the second prediction unit is greater than or equal to the threshold, encoding/decoding the flag gpm_mmvd_flag1 for the second prediction unit may be omitted and MMVD may not be applied.

나아가, 표 5의 예에서와 달리, 예측 유닛들 각각의 MMVD를 위한 오프셋 벡터를 결정한 뒤, 예측 유닛들 각각의 머지 후보를 선택할 수도 있다. 즉, 예측 유닛의 오프셋 벡터를 나타내는 신택스 gpm_mmvd_idxX를 부/복호화한 이후, 예측 유닛의 머지 후보를 가리키는 신택스 gpm_merge_idxX가 부/복호화될 수 있다. Furthermore, unlike the example in Table 5, after determining the offset vector for the MMVD of each prediction unit, a merge candidate for each prediction unit may be selected. That is, after encoding/decoding the syntax gpm_mmvd_idxX indicating the offset vector of the prediction unit, the syntax gpm_merge_idxX indicating the merge candidate of the prediction unit can be encoded/decoded.

이때, 제1 예측 유닛에 대한 오프셋 벡터 및 제2 예측 유닛에 대한 오프셋 벡터가 동일한 경우, 제1 예측 유닛의 머지 후보와 상이한 머지 후보가 제2 예측 유닛을 위해 선택될 수 있다. At this time, if the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same, a merge candidate different from the merge candidate of the first prediction unit may be selected for the second prediction unit.

GPM이 적용되는 경우, 제1 예측 유닛 및 제2 예측 유닛에 상이한 예측 모드를 적용하는 것도 가능하다. 여기서, 예측 모드는, 인트라 예측, 인터 예측 및 인트라 블록 카피 중 적어도 하나를 가리킬 수 있다. 설명의 편의를 위해, 후술되는 예에서는, 제1 예측 유닛 및 제2 예측 유닛 각각에 적용되는 예측 모드는, 인트라 예측 및 인터 예측 중 하나인 것으로 가정한다.When GPM is applied, it is also possible to apply different prediction modes to the first prediction unit and the second prediction unit. Here, the prediction mode may refer to at least one of intra prediction, inter prediction, and intra block copy. For convenience of explanation, in the example described later, it is assumed that the prediction mode applied to each of the first prediction unit and the second prediction unit is one of intra prediction and inter prediction.

도 10은 제1 예측 유닛 및 제2 예측 유닛 각각에 상이한 예측 모드가 적용되는 예를 나타낸 것이다.Figure 10 shows an example in which different prediction modes are applied to each of the first prediction unit and the second prediction unit.

도 10의 (a) 및 (b)에 도시된 예에서와 같이, 제1 예측 유닛에는 인트라 예측을 적용하는 한편, 제2 예측 유닛에는 인터 예측을 적용할 수 있다. 이때, 인터 예측은, 도 10의 (a)에 도시된 예에서와 같이, 머지 모드에 기반하는 것이거나, 도 10의 (b)에 도시된 예에서와 같이, 머지 모드에 MMVD를 적용한 것을 기반으로 하는 것일 수 있다. As in the example shown in Figures 10 (a) and (b), intra prediction may be applied to the first prediction unit, while inter prediction may be applied to the second prediction unit. At this time, inter prediction is based on merge mode, as in the example shown in (a) of FIG. 10, or based on applying MMVD to merge mode, as in the example shown in (b) of FIG. 10. It may be done by.

제1 예측 유닛의 인트라 예측 정보에 기반하여 제1 예측 블록을 획득하고, 제2 예측 유닛의 인터 예측 정보에 기반하여 제2 예측 블록을 획득할 수 있다. 이후, 제1 예측 블록 및 제2 예측 블록의 가중합 연산에 기반하여 최종 예측 블록을 획득할 수 있다.A first prediction block may be obtained based on intra prediction information of the first prediction unit, and a second prediction block may be obtained based on inter prediction information of the second prediction unit. Afterwards, the final prediction block can be obtained based on a weighted sum operation of the first prediction block and the second prediction block.

위와 같이, GPM이 적용된 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각에 상이한 예측 모드를 적용하는 것을 GPM-CIIP (Combined Intra-Inter Prediction) 모드라 정의할 수 있다. As above, applying different prediction modes to each of the first and second prediction units within a block to which GPM is applied can be defined as GPM-CIIP (Combined Intra-Inter Prediction) mode.

GPM-CIIP 모드가 적용되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 코딩 블록에 GPM이 적용되는 것으로 결정되는 경우, 해당 코딩 블록에 대해 CIIP가 적용되는지 여부를 나타내는 플래그가 추가로 부호화되어 시그날링될 수 있다.Information indicating whether the GPM-CIIP mode is applied may be signaled through a bitstream. For example, when it is determined that GPM is applied to a coding block, a flag indicating whether CIIP is applied to the coding block may be additionally encoded and signaled.

코딩 블록의 파티션 타입에 따라, GPM-CIIP 모드의 이용 가부가 결정될 수도 있다. 일 예로, 코딩 블록의 분할을 통해 생성되는 제1 예측 유닛 및 제2 예측 유닛이 동일한 크기를 갖는 경우 또는 코딩 블록을 분할하는 분할선이, 수평선, 수직선 또는 대각선인 경우에만 GPM-CIIP 모드가 이용 가능한 것으로 결정될 수 있다.Depending on the partition type of the coding block, the availability of GPM-CIIP mode may be determined. As an example, the GPM-CIIP mode is used only when the first prediction unit and the second prediction unit generated through division of the coding block have the same size, or when the dividing line dividing the coding block is a horizontal line, vertical line, or diagonal line. It can be determined that it is possible.

GPM-CIIP 모드가 이용 가능하지 않은 것으로 결정된 경우, 상술한 플래그의 부/복호화가 생략될 수 있다. 즉, 상술한 플래그는 GPM-CIIP 모드가 이용 가능한 것으로 결정된 경우에 한하여 부/복호화될 수 있다. If it is determined that the GPM-CIIP mode is not available, the encoding/decoding of the above-described flag may be omitted. That is, the above-described flag can be encoded/decoded only when it is determined that the GPM-CIIP mode is available.

GPM-CIIP 모드가 적용되는 경우, 제1 예측 유닛 및 제2 예측 유닛 각각의 예측 모드를 결정하기 위한 정보가 시그날링될 수 있다. When the GPM-CIIP mode is applied, information for determining the prediction mode of each of the first prediction unit and the second prediction unit may be signaled.

일 예로, 제1 예측 유닛에 인트라 예측이 적용되는지 또는 인터 예측이 적용되는지 여부를 나타내는 플래그가 부호화되어 시그날링될 수 있다. 상기 플래그가 제1 예측 유닛에 인트라 예측이 적용됨을 가리키는 경우, 제2 예측 유닛에는 인터 예측이 적용될 수 있다. 반면, 상기 플래그가 제1 예측 유닛에 인터 예측이 적용됨을 가리키는 경우, 제2 예측 유닛에는 인트라 예측이 적용될 수 있다. As an example, a flag indicating whether intra prediction or inter prediction is applied to the first prediction unit may be encoded and signaled. If the flag indicates that intra prediction is applied to the first prediction unit, inter prediction may be applied to the second prediction unit. On the other hand, if the flag indicates that inter prediction is applied to the first prediction unit, intra prediction may be applied to the second prediction unit.

다른 예로, CIIP가 적용되는지 여부를 나타내는 플래그를 부/복호화하는 대신, 제1 예측 유닛 및 제2 예측 유닛에 대한 예측 모드의 조합들 중 하나를 특정하는 인덱스 정보를 부호화하여 시그날링할 수도 있다. 일 예로, 인터 예측 및 인터 예측의 조합, 인트라 예측과 인터 예측의 조합 및 인터 예측과 인트라 예측의 조합 각각을 후보 조합들로 설정한 뒤, 상기 후보 조합들 중 하나를 지시하는 인덱스 정보를 부호화하여 시그날링할 수 있다. As another example, instead of encoding/decoding a flag indicating whether CIIP is applied, index information specifying one of the combinations of prediction modes for the first prediction unit and the second prediction unit may be encoded and signaled. For example, a combination of inter prediction and inter prediction, a combination of intra prediction and inter prediction, and a combination of inter prediction and intra prediction are each set as candidate combinations, and then index information indicating one of the candidate combinations is encoded. Signaling is possible.

제1 예측 유닛 및 제2 예측 유닛 중 인터 예측이 적용되는 예측 유닛의 움직임 정보는, 머지 후보로부터 유도될 수 있다. 이를 위해, 머지 후보 리스트에 포함된 머지 후보들 중 하나를 특정하는 머지 인덱스가, 인터 예측이 적용되는 예측 유닛을 위해 부호화되어 시그날링될 수 있다. The motion information of the prediction unit to which inter prediction is applied among the first prediction unit and the second prediction unit may be derived from the merge candidate. To this end, a merge index that specifies one of the merge candidates included in the merge candidate list may be encoded and signaled for the prediction unit to which inter prediction is applied.

나아가, 인터 예측이 적용되는 예측 유닛에 MMVD가 적용될 수도 있다. 이 경우, 인터 예측이 적용되는 예측 유닛에 MMVD가 적용되는지 여부를 나타내는 플래그가 부호화되어 시그날링될 수 있다. Furthermore, MMVD may be applied to a prediction unit to which inter prediction is applied. In this case, a flag indicating whether MMVD is applied to the prediction unit to which inter prediction is applied may be encoded and signaled.

이때, 예측 유닛을 위해 선택된 머지 후보의 인덱스가 문턱값보다 낮은지 여부를 고려하여, MMVD가 이용 가능한지 여부를 결정할 수도 있다. 즉, 상기 플래그는 머지 후보의 인덱스가 문턱값보다 작은 경우에만 시그날링될 수 있다.At this time, it may be determined whether MMVD is available by considering whether the index of the merge candidate selected for the prediction unit is lower than the threshold. That is, the flag can be signaled only when the index of the merge candidate is smaller than the threshold.

또는, MMVD의 적용 여부에 따라, 머지 인덱스를 통해 선택 가능한 머지 후보들의 개수를 상이하게 결정할 수도 있다. 일 예로, MMVD가 적용되지 않는 경우, 머지 후보 리스트에 포함된 N개의 머지 후보들 중 하나가 인터 예측이 적용되는 예측 유닛을 위해 선택될 수 있다. 반면, MMVD가 적용되는 경우, 머지 후보 리스트에 포함된 N개의 머지 후보들 중 인덱스가 작은 2개의 머지 후보들 중 하나가 인터 예측이 적용되는 예측 유닛을 위해 선택될 수 있다. Alternatively, depending on whether MMVD is applied, the number of selectable merge candidates may be determined differently through the merge index. For example, when MMVD is not applied, one of N merge candidates included in the merge candidate list may be selected for the prediction unit to which inter prediction is applied. On the other hand, when MMVD is applied, one of the two merge candidates with a small index among the N merge candidates included in the merge candidate list may be selected for the prediction unit to which inter prediction is applied.

다른 예로, GPM-CIIP 모드가 적용되는 경우, 인터 예측이 적용되는 예측 유닛에 디폴트로 MMVD를 적용할 수도 있다. 인터 예측이 적용되는 예측 유닛에 대해, 오프셋 벡터를 결정하기 위한 정보가 고정적으로 부호화되어 시그날링될 수 있다.As another example, when the GPM-CIIP mode is applied, MMVD may be applied by default to the prediction unit to which inter prediction is applied. For prediction units to which inter prediction is applied, information for determining an offset vector may be permanently encoded and signaled.

인트라 예측이 적용되는 예측 유닛의 인트라 예측 모드는 기 정의된 인트라 예측 모드로 설정될 수 있다. 일 예로, 기 정의된 인트라 예측 모드는 플래너(Planar) 모드일 수 있다. The intra prediction mode of the prediction unit to which intra prediction is applied may be set to a predefined intra prediction mode. As an example, the predefined intra prediction mode may be Planar mode.

또는, 기 정의된 인트라 예측 모드는, 코딩 블록을 분할하는 분할선과 평행인 인트라 예측 모드 또는 상기 분할선에 수직인 인트라 예측 모드일 수 있다.Alternatively, the predefined intra prediction mode may be an intra prediction mode parallel to the dividing line dividing the coding block or an intra prediction mode perpendicular to the dividing line.

다른 예로, 복수의 기 정의된 인트라 예측 모드들을 후보 모드들로 설정한 뒤, 복수의 후보 모드들 중 하나를 지시하는 인덱스에 기초하여, 예측 유닛의 인트라 예측 모드를 결정할 수도 있다. 일 예로, 복수의 후보 모드들 중 하나를 지시하는 신택스 gpm_intra_candidates_index가 부호화되어 비트스트림을 통해 시그날링될 수 있다. 복호화기에서는 상기 신택스 gpm_intra_candidates_index가 지시하는 후보 모드를 예측 유닛의 인트라 예측 모드로 설정할 수 있다.As another example, after setting a plurality of predefined intra prediction modes as candidate modes, the intra prediction mode of the prediction unit may be determined based on an index indicating one of the plurality of candidate modes. As an example, the syntax gpm_intra_candidates_index indicating one of a plurality of candidate modes may be encoded and signaled through a bitstream. The decoder can set the candidate mode indicated by the syntax gpm_intra_candidates_index as the intra prediction mode of the prediction unit.

상술한 바와 같이, GPM, 또는 GPM-CIIP 와 같이 GPM 기반의 예측이 적용되는 경우, 제1 예측 유닛의 예측 정보를 기반으로 획득되는 제1 예측 블록 및 제2 예측 유닛의 예측 정보를 기반으로 획득되는 제2 예측 블록을 가중합하여, 코딩 블록에 대한 최종 예측 블록이 유도될 수 있다. 한편, 후술되는 실시예에서는, 제1 예측 블록 내 예측 샘플에 할당되는 가중치를 제1 가중치라 호칭하고, 제2 예측 블록 내 예측 샘플에 할당되는 가중치를 제2 가중치라 호칭하기로 한다. 또한, 제1 예측 샘플은, 제1 예측 블록에 포함된 예측 샘플들 중 하나이고, 제2 예측 샘플은, 제2 예측 블록에 포함된 예측 샘플들 중 하나인 것으로 가정한다. As described above, when GPM-based prediction is applied, such as GPM or GPM-CIIP, the first prediction block is obtained based on the prediction information of the first prediction unit and the first prediction block is obtained based on the prediction information of the second prediction unit. By weighting the second prediction blocks, the final prediction block for the coding block can be derived. Meanwhile, in an embodiment described later, the weight assigned to the prediction sample in the first prediction block will be referred to as a first weight, and the weight assigned to the prediction sample in the second prediction block will be referred to as the second weight. Additionally, it is assumed that the first prediction sample is one of the prediction samples included in the first prediction block, and the second prediction sample is one of the prediction samples included in the second prediction block.

제1 예측 블록에 포함된 예측 샘플들에 적용되는 가중치 및 제2 예측 블록에 포함된 예측 샘플들에 적용되는 가중치는, 위치에 따라 적응적으로 결정될 수 있다. 구체적으로, 제1 예측 유닛 및 제2 예측 유닛 사이의 경계를 기준으로, 가중합 연산이 수행되는 위치가 상기 제2 예측 유닛으로부터 멀어질 경우, 제1 예측 샘플에 할당되는 가중치는 증가하는 한편, 제2 예측 샘플에 할당되는 가중치는 감소할 수 있다. 반면, 가중합 연산이 수행되는 위치가, 상기 제1 예측 유닛으로부터 멀어질 경우, 제1 예측 샘플에 할당되는 가중치는 감소하는 한편, 제2 예측 샘플에 할당되는 가중치는 증가할 수 있다.The weight applied to the prediction samples included in the first prediction block and the weight applied to the prediction samples included in the second prediction block may be adaptively determined depending on the location. Specifically, based on the boundary between the first prediction unit and the second prediction unit, if the location where the weighted sum operation is performed is distant from the second prediction unit, the weight assigned to the first prediction sample increases, The weight assigned to the second prediction sample may be reduced. On the other hand, when the location where the weighted sum calculation is performed is far from the first prediction unit, the weight assigned to the first prediction sample may decrease, while the weight assigned to the second prediction sample may increase.

도 11은 제1 예측 유닛 및 제2 예측 유닛의 경계를 기준으로, 가중합 연산이 수행되는 위치에 따라, 제1 예측 샘플에 적용되는 가중치 및 제2 예측 샘플에 적용되는 가중치가 적응적으로 결정되는 예를 나타낸 도면이다. 11 shows that the weight applied to the first prediction sample and the weight applied to the second prediction sample are adaptively determined depending on the location where the weighted sum operation is performed, based on the boundary between the first prediction unit and the second prediction unit. This is a drawing showing an example.

도 11에서는, 제1 예측 샘플의 위치에 따라, 제1 예측 샘플에 적용되는 가중치 W0의 값이 적응적으로 결정되는 예를 도시하였다. 구체적으로, 제1 예측 샘플 및 제2 예측 샘플의 경계(도 1의 GPM partitioning boundary)로부터 수직 방향으로의 거리가 τ 이내인 영역에 포함된 샘플들에 대한 제1 가중치 W0는, 위치에 따라 적응적으로 결정될 수 있다. FIG. 11 shows an example in which the value of the weight W0 applied to the first prediction sample is adaptively determined according to the location of the first prediction sample. Specifically, the first weight W0 for samples included in an area within τ in the vertical direction from the boundary of the first prediction sample and the second prediction sample (GPM partitioning boundary in FIG. 1) is adapted according to the location. can be decided negatively.

한편, 제1 예측 샘플에 적용되는 제1 가중치 W0 및 제2 예측 샘플에 적용되는 제2 가중치 W1의 합은, 상수일 수 있다. 일 예로, 제1 가중치 W0 및 제2 가중치 W1의 합은 8, 16 또는 32와 같이 2의 지수승으로 표현되는 자연수일 수 있다. 도 11에서는, 제1 가중치 W0 및 제2 가중치 W1의 합이 8인 것으로 예시되었다. 이에 따라, 제2 예측 샘플에 적용되는 제2 가중치 W1에 대한 그래프는, 제1 예측 유닛 및 제2 예측 유닛의 경계를 기준으로, 제1 가중치 W0에 대한 그래프와 대칭 형태일 수 있다.Meanwhile, the sum of the first weight W0 applied to the first prediction sample and the second weight W1 applied to the second prediction sample may be a constant. For example, the sum of the first weight W0 and the second weight W1 may be a natural number expressed as a power of 2, such as 8, 16, or 32. In FIG. 11, it is illustrated that the sum of the first weight W0 and the second weight W1 is 8. Accordingly, the graph for the second weight W1 applied to the second prediction sample may be symmetrical with the graph for the first weight W0 based on the boundary between the first prediction unit and the second prediction unit.

도시된 예에서와 같이, 블렌딩 영역 바깥에서는, 제1 예측 샘플에 적용되는 제1 가중치 W0 및 제2 예측 샘플에 적용되는 제2 가중치 W1 중 하나가 0으로 설정된다. 이에 따라, 제1 예측 블록 및 제2 예측 블록 간의 블렌딩(blending)은, 도 11에 도시된 -τ 부터 τ 사이의 영역에서만 수행되는 것으로 이해될 수 있다. 이와 같이, 제1 예측 샘플에 적용되는 제1 가중치 W0 및 제2 예측 샘플에 적용되는 제2 가중치 W1이, 샘플 위치에 따라 적응적으로 결정되어, 제1 예측 블록 및 제2 예측 블록 간의 블렌딩이 수행되는 영역을 블렌딩 영역이라 정의할 수 있다. 즉, 도 11에 도시된 예에서, 제1 예측 유닛 및 제2 예측 유닛의 경계의 수직 방향으로의 거리가 -τ 부터 τ 사이인 영역이 블렌딩 영역으로 정의될 수 있다. As in the illustrated example, outside the blending region, one of the first weight W0 applied to the first prediction sample and the second weight W1 applied to the second prediction sample is set to 0. Accordingly, it can be understood that blending between the first prediction block and the second prediction block is performed only in the region between -τ and τ shown in FIG. 11. In this way, the first weight W0 applied to the first prediction sample and the second weight W1 applied to the second prediction sample are adaptively determined according to the sample position, so that blending between the first prediction block and the second prediction block is performed. The area where this is performed can be defined as a blending area. That is, in the example shown in FIG. 11, an area where the distance in the vertical direction of the boundary between the first prediction unit and the second prediction unit is between -τ and τ may be defined as a blending area.

블렌딩 영역 바깥 영역, 즉, 제1 예측 유닛 및 제2 예측 유닛 사이의 경계로부터의 거리가 보다 큰 영역에 포함된 샘플들에 대한 제1 가중치 W0 및 제2 가중치 W1는, 고정된 값을 가질 수 있다. 일 예로, 블렌딩 영역의 바깥 영역 중 제2 예측 유닛에 포함된 영역에서는, 제1 예측 샘플에 할당되는 제1 가중치 W0는 0으로 설정될 수 있다. 반면, 블렌딩 영역의 바깥 영역 중 제1 예측 유닛에 포함된 영역에서는, 제1 예측 샘플에 할당되는 제1 가중치 W0는 8로 설정될 수 있다. The distance from the area outside the blending area, i.e. the boundary between the first prediction unit and the second prediction unit, is The first weight W0 and the second weight W1 for samples included in a larger area may have fixed values. For example, in the area included in the second prediction unit among the areas outside the blending area, the first weight W0 assigned to the first prediction sample may be set to 0. On the other hand, in the area included in the first prediction unit among the areas outside the blending area, the first weight W0 assigned to the first prediction sample may be set to 8.

요약하면, 블렌딩 영역 내 최종 예측 샘플 PDiag(x, y)는, 제1 예측 샘플 및 제2 예측 샘플에 각각 제1 가중치 W0 및 제2 가중치 W1를 적용하는 가중합 연산에 기초하여 획득될 수 있다. 구체적으로, 제1 가중치 W0 및 제2 가중치 W1의 합이 2^N 으로 표현되는 자연수인 경우, 제1 예측 샘플 및 제2 예측 샘플의 가중합 연산의 결과를 우측으로 N 만큼 시프팅하여, 최종 예측 샘플 PDiag(x, y)가 획득될 수 있다.In summary, the final prediction sample P Diag (x, y) in the blending region can be obtained based on a weighted sum operation that applies the first weight W0 and the second weight W1 to the first prediction sample and the second prediction sample, respectively. there is. Specifically, when the sum of the first weight W0 and the second weight W1 is a natural number expressed as 2^N, the result of the weighted sum operation of the first prediction sample and the second prediction sample is shifted to the right by N, and the final Predicted samples P Diag (x, y) can be obtained.

반면, 제1 예측 유닛에 포함되면서, 블렌딩 영역 바깥에 위치하는 최종 예측 샘플 PDiag(x, y)은, 해당 위치의 제1 예측 샘플과 동일하게 설정될 수 있다. 또한, 제2 예측 유닛에 포함되면서, 블렌딩 영역 바깥에 위치하는 최종 예측 샘플 PDiag(x, y)은, 해당 위치의 제2 예측 샘플과 동일하게 설정될 수 있다. On the other hand, the final prediction sample P Diag (x, y), which is included in the first prediction unit and is located outside the blending area, may be set to be the same as the first prediction sample at that location. Additionally, the final prediction sample P Diag (x, y), which is included in the second prediction unit and is located outside the blending area, may be set to be the same as the second prediction sample at that location.

하기 수학식 3은, 코딩 블록 내 최종 예측 샘플 PDiag(x,y)가 유도되는 예를 나타낸 것이다. Equation 3 below shows an example in which the final prediction sample P Diag (x,y) within a coding block is derived.

Figure pat00004
Figure pat00004

상기 수학식 3에서, P1은 및 P2는 각각 제1 예측 샘플 및 제2 예측 샘플을 나타낸다. 수학식 3의 예에서와 같이, 제2 가중치 w1은, 상수 N으로부터 제1 가중치 w0를 차분하여 유도될 수 있다. N은, 8, 16 또는 32와 같이, 2의 지수승으로 표현되는 자연수일 수 있다. N은 부호화기 및 복호화기에서 기 정의되어 있을 수 있다. 또는, N은 블렌딩 영역의 크기에 따라, 적응적으로 결정될 수 있다.In Equation 3, P 1 and P 2 represent the first prediction sample and the second prediction sample, respectively. As in the example of Equation 3, the second weight w1 can be derived by differentiating the first weight w0 from the constant N. N may be a natural number expressed as a power of 2, such as 8, 16, or 32. N may be predefined in the encoder and decoder. Alternatively, N may be adaptively determined depending on the size of the blending area.

임의 크기의 블록에 대한 블렌딩 영역의 크기는, 부호화기 및 복호화기에서 고정되어 있을 수 있다. 다른 예로, 복수개의 크기 후보들 중에서, 코딩 블록에 대한 블렌딩 영역의 크기에 대응하는 후보를 선택할 수도 있다. The size of the blending area for a block of arbitrary size may be fixed in the encoder and decoder. As another example, from a plurality of size candidates, a candidate corresponding to the size of the blending area for the coding block may be selected.

도 12는 복수개의 블렌딩 영역 크기 후보들을 도시한 도면이다. Figure 12 is a diagram showing a plurality of blending area size candidates.

도 12에 도시된 예에서는, (-τ/4, τ/4), (-τ/2, τ/2), (-τ, τ), (-2τ, 2τ) 및 (-4τ, 4τ)와 같이 총 5개의 블렌딩 영역 크기 후보들이 도시되었다.In the example shown in Figure 12, (-τ/4, τ/4), (-τ/2, τ/2), (-τ, τ), (-2τ, 2τ) and (-4τ, 4τ) A total of 5 blending area size candidates are shown as shown.

도시된 5개의 블렌딩 영역 크기 후보들 중 하나가, 코딩 블록에 적용될 수 있다. 일 예로, 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하여, 코딩 블록의 블렌딩 영역을 결정할 수 있다. One of the five blending area size candidates shown may be applied to the coding block. As an example, the blending area of a coding block may be determined by selecting one of a plurality of blending area size candidates.

한편, 블렌딩 영역 내 제1 가중치 W0 및 제2 가중치 W1는 선형적으로 변화할 수 있다. 이때, 제1 가중치 W0에 대한 그래프의 기울기 또는 기울기의 절대값은 블렌딩 영역 크기가 작을수록 증가할 수 있다. 즉, 블렌딩 영역의 크기가 작을수록, 제1 예측 유닛 및 제2 예측 유닛 사이의 경계와의 거리가 증가함에 따른, 제1 가중치 W0 또는 제2 가중치 W1의 변화 정도가 크게 나타난다.Meanwhile, the first weight W0 and the second weight W1 within the blending area may change linearly. At this time, the slope or absolute value of the slope of the graph with respect to the first weight W0 may increase as the size of the blending area becomes smaller. That is, the smaller the size of the blending area, the greater the degree of change in the first weight W0 or the second weight W1 as the distance from the boundary between the first prediction unit and the second prediction unit increases.

블렌딩 영역의 크기는, 코딩 블록 단위로 결정될 수 있다. 이를 위해, 코딩 블록 단위로, 블렌딩 영역의 크기를 결정하기 위한 정보가 명시적으로 부/복호화될 수 있다. 일 예로, 상기 정보는, 복수의 블렌딩 영역 크기 후보들 중 하나를 지시하는 인덱스 정보, blending_area_idx일 수 있다. 부호화기에서는, 복수의 블렌딩 크기 후보들 중에서, 코딩 블록에 적용된 블렌딩 크기 후보의 인덱스를 가리키는 신택스 blending_area_idx를 부호화하고, 복호화기에서는, 신택스 blending_area_idx의 값에 기초하여, 코딩 블록의 블렌딩 영역을 결정할 수 있다. 하기 표 6은, 신택스 blending_area_idx 값과 블렌딩 영역 크기 후보들 간의 매핑 관계를 예시한 것이다. The size of the blending area can be determined on a coding block basis. To this end, information for determining the size of the blending area can be explicitly encoded/decoded in units of coding blocks. As an example, the information may be index information, blending_area_idx, indicating one of a plurality of blending area size candidates. The encoder encodes the syntax blending_area_idx, which indicates the index of the blending size candidate applied to the coding block, among a plurality of blending size candidates, and the decoder encodes the blending area of the coding block based on the value of the syntax blending_area_idx. Table 6 below illustrates the mapping relationship between syntax blending_area_idx values and blending area size candidates.

blending_area_idxblending_area_idx 블렌딩 영역 크기 후보Blending area size candidates 00 ( ( 1One 22 33 44

표 6에 예시된 것보다, 더 적은 수 또는 더 많은 수의 블렌딩 영역 크기 후보가 부호화기 및 복호화기에 기 정의되어 있을 수 있다. 블렌딩 영역 크기 후보가 선택되면, 선택된 블렌딩 영역 크기 후보에 따라, 제1 가중치 W0 및 제2 가중치 W1이 결정될 수 있다.Fewer or more blending region size candidates than those illustrated in Table 6 may be predefined in the encoder and decoder. When a blending area size candidate is selected, the first weight W0 and the second weight W1 may be determined according to the selected blending area size candidate.

한편, 코딩 블록의 크기, 코딩 블록의 분할 형태, 코딩 블록 내 예측 유닛의 크기, 예측 유닛의 형태, 제1 예측 유닛 및 제2 예측 유닛의 예측 방향(예컨대, L0 방향 또는 L1 방향)이 동일한지 여부, 또는 제1 예측 유닛 및 제2 예측 유닛의 움직임 정보 중 적어도 하나에 기초하여, 코딩 블록에 대해 이용 가능한 블렌딩 영역 크기 후보들의 개수 또는 종류 중 적어도 하나가 적응적으로 결정될 수 있다. 여기서, 움직임 정보는, 움직임 벡터, 예측 방향, 참조 픽처 인덱스 또는 참조 픽처의 POC 중 적어도 하나에 관한 것일 수 있다.Meanwhile, whether the size of the coding block, the division type of the coding block, the size of the prediction unit within the coding block, the shape of the prediction unit, and the prediction direction (e.g., L0 direction or L1 direction) of the first prediction unit and the second prediction unit are the same. Based on at least one of motion information of the first prediction unit and the second prediction unit, at least one of the number or type of blending area size candidates available for the coding block may be adaptively determined. Here, the motion information may be related to at least one of a motion vector, prediction direction, reference picture index, or POC of the reference picture.

일 예로, 제1 예측 유닛 또는 제2 예측 유닛의 너비 또는 높이 중 적어도 하나가 제1 임계치보다 작은 경우, 블렌딩 영역 후보들 중 제2 임계치보다 큰 크기를 갖는 후보들은, 코딩 블록에 대해 이용 불가능한 것으로 설정될 수 있다. 일 예로, 제1 예측 유닛의 너비가 16 샘플들 보다 작은 경우, 블렌딩 영역 후보들 중 (-τ/4, τ/4), (-τ/2, τ/2) 및 (-τ, τ)는 코딩 블록에 대해 이용 가능한 반면, (-2τ, 2τ) 및 (-4τ, 4τ)는 코딩 블록에 대해 이용 불가능한 것으로 설정될 수 있다. For example, if at least one of the width or height of the first prediction unit or the second prediction unit is smaller than the first threshold, candidates with a size larger than the second threshold among the blending area candidates are set as unavailable for the coding block. It can be. As an example, when the width of the first prediction unit is smaller than 16 samples, (-τ/4, τ/4), (-τ/2, τ/2) and (-τ, τ) among the blending region candidates are While available for the coding block, (-2τ, 2τ) and (-4τ, 4τ) may be set as unavailable for the coding block.

또는, 제1 예측 유닛의 머지 후보로부터 유도된 움직임 벡터와 제2 예측 유닛의 머지 후보로부터 유도된 움직임 벡터 간의 차분의 제1 임계값 이하인지 여부에 따라, 이용 가능한 블렌딩 영역 크기 후보들의 개수 및/또는 종류가 결정될 수 있다. 제1 예측 유닛의 움직임 벡터와 제2 예측 유닛의 움직임 벡터 간의 차분은 다음의 수학식 4와 같이 유도할 수 있다.or, depending on whether the difference between the motion vector derived from the merge candidate of the first prediction unit and the motion vector derived from the merge candidate of the second prediction unit is less than or equal to a first threshold, the number of available blending region size candidates and/ Alternatively, the type may be determined. The difference between the motion vector of the first prediction unit and the motion vector of the second prediction unit can be derived as in Equation 4 below.

Figure pat00010
Figure pat00010

상기 수학식 4에서, MVgpm1_x 및 MVgpm1_y는 각각, 제1 예측 유닛의 움직임 벡터의 수평 방향 성분 및 수직 방향 성분을 나타낸다. MVgpm2_x 및 MVgpm2_y는 각각, 제2 예측 유닛의 움직임 벡터의 수평 방향 성분 및 수직 방향 성분을 나타낸다. In Equation 4, MVgpm1_x and MVgpm1_y represent the horizontal and vertical components of the motion vector of the first prediction unit, respectively. MVgpm2_x and MVgpm2_y represent the horizontal component and vertical component of the motion vector of the second prediction unit, respectively.

일 예로, 상기 차분이 제1 임계값 이하인 경우, 블렌딩 영역 크기 후보들 중 (-τ, τ) 만이 코딩 블록에 대해 이용 가능할 수 있다. 반면, 상기 차분이 제1 임계값보다 큰 경우, 복수개의 블렌딩 영역 후보들이 코딩 블록에 대해 이용 가능할 수 있다. As an example, if the difference is less than or equal to the first threshold, only (-τ, τ) among the blending region size candidates may be available for the coding block. On the other hand, when the difference is greater than the first threshold, a plurality of blending area candidates may be available for the coding block.

신택스 blending_area_idx는, 코딩 블록에 대해 이용 가능한 블렌딩 영역 크기 후보들 중 하나를 지시할 수 있다. 신택스 blending_area_idx를 부호화하는데 필요한 최대 비트 길이는, 코딩 블록에 대해 이용 가능한 블렌딩 영역 크기 후보들의 개수에 따라 조절될 수 있다. 한편, 코딩 블록에 대해 이용 가능한 블렌딩 영역 크기 후보들의 개수가 1개인 경우, 신택스 blending_area_idx의 부/복호화를 생략할 수 있다. The syntax blending_area_idx may indicate one of the available blending area size candidates for a coding block. The maximum bit length required to encode the syntax blending_area_idx can be adjusted according to the number of blending area size candidates available for the coding block. Meanwhile, when the number of blending area size candidates available for a coding block is 1, encoding/decoding of the syntax blending_area_idx can be omitted.

인덱스 정보의 부/복호화를 생략하고, 코딩 블록의 크기, 코딩 블록의 형태, 코딩 블록 내 파티션의 크기 코딩 블록의 분할 형태, 코딩 블록 내 예측 유닛들의 크기 비율 또는 예측 유닛들 각각의 움직임 정보 중 적어도 하나에 기초하여, 코딩 블록에 대한 블렌딩 영역 크기를 적응적으로 결정할 수도 있다. 일 예로, 제1 예측 유닛에 대한 참조 픽처의 POC와 제2 예측 유닛에 대한 참조 픽처의 POC에 기반하여, 코딩 블록에 대한 블렌딩 영역의 크기가 결정될 수 있다.Omitting the encoding/decoding of index information, at least one of the size of the coding block, the type of the coding block, the size of the partition within the coding block, the partition type of the coding block, the size ratio of the prediction units within the coding block, or the motion information of each prediction unit Based on one, the blending area size for the coding block may be adaptively determined. As an example, the size of the blending area for the coding block may be determined based on the POC of the reference picture for the first prediction unit and the POC of the reference picture for the second prediction unit.

또는, 코딩 블록의 크기, 코딩 블록의 형태, 코딩 블록 내 파티션의 크기 코딩 블록의 분할 형태, 코딩 블록 내 예측 유닛들의 크기 비율 또는 예측 유닛들 각각의 움직임 정보 중 적어도 하나에 기초하여, 인덱스 정보의 부/복호화 여부를 결정할 수도 있다. 인덱스 정보를 부/복호화하지 않는 것으로 결정된 경우, 디폴트 블렌딩 영역 크기 후보가, 코딩 블록에 적용될 수 있다. 여기서, 디폴트 블렌딩 영역 크기 후보는, (-τ, τ)일 수 있다. Alternatively, based on at least one of the size of the coding block, the type of the coding block, the size of the partition within the coding block, the partition type of the coding block, the size ratio of prediction units within the coding block, or motion information of each prediction unit, index information You can also decide whether to encode/decrypt. If it is determined not to encode/decode index information, a default blending area size candidate may be applied to the coding block. Here, the default blending area size candidate may be (-τ, τ).

한편, 도 12에서는, 블렌딩 영역 크기 후보들 각각이, 제1 예측 유닛 및 제2 예측 유닛 간의 경계를 기준으로, 대칭 형태인 것으로 예시되었다. 도시된 예와 달리, 블렌딩 영역이 비대칭 형태로 설정될 수도 있다. 일 예로, 제1 예측 유닛 및 제2 예측 유닛 간의 경계를 기준으로, 제1 예측 유닛 방향으로의 블렌딩 영역의 크기는 τ인 반면, 제2 예측 유닛 방향으로의 블렌딩 영역의 크기는 τ 보다 작은 값(예컨대, τ/2, τ/4 또는 τ/8)을 가질 수 있다. Meanwhile, in FIG. 12, each of the blending area size candidates is illustrated as being symmetrical based on the boundary between the first prediction unit and the second prediction unit. Unlike the example shown, the blending area may be set in an asymmetric form. For example, based on the boundary between the first prediction unit and the second prediction unit, the size of the blending area in the direction of the first prediction unit is τ, while the size of the blending area in the direction of the second prediction unit is a value smaller than τ. (e.g., τ/2, τ/4, or τ/8).

한편, 제1 예측 유닛 및 제2 예측 유닛 간의 경계를 기준으로, 제1 예측 유닛 방향으로의 블렌딩 영역의 크기와 제2 예측 유닛 방향으로의 블렌딩 영역의 크기가 상이한 것을, 비대칭 블렌딩 영역이라 호칭할 수 있다. Meanwhile, based on the boundary between the first prediction unit and the second prediction unit, the size of the blending area in the direction of the first prediction unit and the size of the blending area in the direction of the second prediction unit are different, and will be called an asymmetric blending area. You can.

코딩 블록의 블렌딩 영역이 비대칭으로 설정되는지 여부는, 코딩 블록의 크기, 코딩 블록의 분할 형태, 코딩 블록 내 예측 유닛의 크기, 예측 유닛의 형태, 제1 예측 유닛 및 제2 예측 유닛의 예측 방향(예컨대, L0 방향 또는 L1 방향)이 동일한지 여부, 또는 제1 예측 유닛 및 제2 예측 유닛의 움직임 정보 중 적어도 하나에 기초하여 결정될 수 있다.Whether the blending area of the coding block is set asymmetrically depends on the size of the coding block, the division type of the coding block, the size of the prediction unit within the coding block, the shape of the prediction unit, and the prediction direction of the first prediction unit and the second prediction unit ( For example, the L0 direction or the L1 direction) may be determined based on at least one of the same or motion information of the first prediction unit and the second prediction unit.

일 예로, 제1 예측 유닛 및 제2 예측 유닛의 너비 또는 높이 중 적어도 하나가 임계치보다 작은 경우, 적어도 하나의 비대칭 블렌딩 영역 크기 후보가 코딩 블록에 대해 이용 가능한 것으로 설정될 수 있다. 일 예로, 코딩 블록에 대한 블렌딩 영역의 크기는, (-τ, τ/2), (-2τ, τ), (-τ, τ/4) 또는 (-τ/2, τ/4)와 같은 비대칭 블렌딩 영역 크기 후보들 중 하나로 설정될 수 있다. As an example, if at least one of the width or height of the first prediction unit and the second prediction unit is smaller than the threshold, at least one asymmetric blending area size candidate may be set as available for the coding block. As an example, the size of the blending region for a coding block is, such as (-τ, τ/2), (-2τ, τ), (-τ, τ/4) or (-τ/2, τ/4). It can be set to one of the asymmetric blending area size candidates.

또는, 제1 예측 유닛의 움직임 벡터와 제2 예측 유닛의 움직임 벡터 사이의 차분이 임계값 이하인지 여부에 기초하여, 비대칭 블렌딩 영역 크기 후보의 이용 가능성이 결정될 수 있다. 일 예로, 상기 차분이 임계값보다 작은 경우, 비대칭 블렌딩 영역 크기 후보는, 코딩 블록에 대해 이용 불가능한 것으로 결정될 수 있다. 반면, 상기 차분이 임계값보다 큰 경우, 적어도 하나의 비대칭 블렌딩 영역 크기 후보가, 코딩 블록에 대해 이용 가능한 것으로 결정될 수 있다. Alternatively, the availability of the asymmetric blending area size candidate may be determined based on whether the difference between the motion vector of the first prediction unit and the motion vector of the second prediction unit is less than or equal to a threshold. As an example, if the difference is less than a threshold, the asymmetric blending region size candidate may be determined to be unavailable for the coding block. On the other hand, if the difference is greater than the threshold, it may be determined that at least one asymmetric blending region size candidate is available for the coding block.

한편, 제1 예측 유닛의 움직임 벡터 및 제2 예측 유닛의 움직임 벡터의 차분은, 상술한 수학식 4에 기초하여 유도되는 것일 수 있다. Meanwhile, the difference between the motion vector of the first prediction unit and the motion vector of the second prediction unit may be derived based on Equation 4 described above.

또는, 코딩 블록의 블렌딩 영역이 비대칭으로 설정되는지 여부를 나타내는 정보가 부호화되어 비트스트림을 통해 시그날링될 수 있다. Alternatively, information indicating whether the blending area of the coding block is set asymmetrically may be encoded and signaled through a bitstream.

한편, 제1 예측 유닛 및 제2 예측 유닛의 예측 모드를 고려하여, 비대칭 블렌딩 영역의 크기를 결정할 수도 있다. 일 예로, GPM-CIIP가 적용됨에 따라, 제1 예측 유닛에 인트라 예측이 적용되고, 제2 예측 유닛이 인터 예측이 적용되는 경우, 인트라 예측이 사용된 제1 예측 유닛에 대한 블렌딩 영역의 크기가 인터 예측이 사용된 제2 예측 유닛에 대한 블렌딩 영역의 크기보다 작게 설정될 수 있다. 또는, 이와 반대로, 인트라 예측이 사용된 제1 예측 유닛에 대한 블렌딩 영역의 크기가 인터 예측이 사용된 제2 예측 유닛에 대한 블렌딩 영역의 크기보다 크게 설정될 수 있다. Meanwhile, the size of the asymmetric blending area may be determined by considering the prediction modes of the first prediction unit and the second prediction unit. As an example, as GPM-CIIP is applied, when intra prediction is applied to the first prediction unit and inter prediction is applied to the second prediction unit, the size of the blending area for the first prediction unit in which intra prediction is used is Inter prediction may be set to be smaller than the size of the blending area for the second prediction unit used. Or, conversely, the size of the blending area for the first prediction unit using intra prediction may be set to be larger than the size of the blending area for the second prediction unit using inter prediction.

이하에서는, 인트라 예측에 대해 보다 상세히 설명하기로 한다.Below, intra prediction will be described in more detail.

인트라 예측은 현재 블록 주변에 부호화/복호화가 완료된 복원 샘플을 이용하여, 현재 블록을 예측하는 것이다. 이때, 현재 블록의 인트라 예측에는, 인루프 필터가 적용되기 전의 복원 샘플이 이용될 수 있다.Intra prediction is predicting the current block using restored samples that have been encoded/decoded around the current block. At this time, the restored sample before the in-loop filter is applied can be used for intra prediction of the current block.

인트라 예측 기법은 매트릭스(Matrix)에 기반한 인트라 예측 및 주변 복원 샘플과의 방향성을 고려한 일반 인트라 예측을 포함한다. 현재 블록의 인트라 예측 기법을 지시하는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그일 수 있다. 또는, 현재 블록의 위치, 크기, 형태 또는 이웃 블록의 인트라 예측 기법 중 적어도 하나에 기초하여, 현재 블록의 인트라 예측 기법을 결정할 수 있다. 일 예로, 현재 블록이 픽처 바운더리를 걸쳐 존재하는 경우, 현재 블록에는 매트릭트에 기반한 인트라 예측이 적용되지 않도록 설정될 수 있다. Intra prediction techniques include matrix-based intra prediction and general intra prediction that takes into account the directionality with surrounding reconstructed samples. Information indicating the intra prediction technique of the current block may be signaled through a bitstream. The information may be a 1-bit flag. Alternatively, the intra prediction technique of the current block may be determined based on at least one of the position, size, and shape of the current block or the intra prediction technique of a neighboring block. For example, if the current block spans a picture boundary, intra prediction based on the metric may be set not to be applied to the current block.

매트릭스에 기반한 인트라 예측은, 부호화기 및 복호화기에서 기 저장된 매트릭스와, 현재 블록 주변의 복원 샘플 사이의 행렬 곱에 기반하여, 현재 블록의 예측 블록을 획득하는 방법이다. 기 저장된 복수개의 매트릭스들 중 어느 하나를 특정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 복호화기는 상기 정보 및 현재 블록의 크기에 기초하여, 현재 블록의 인트라 예측을 위한 매트릭스를 결정할 수 있다.Matrix-based intra prediction is a method of obtaining a prediction block of the current block based on matrix multiplication between a matrix pre-stored in the encoder and decoder and restored samples around the current block. Information for specifying one of a plurality of pre-stored matrices may be signaled through a bitstream. The decoder may determine a matrix for intra prediction of the current block based on the information and the size of the current block.

일반 인트라 예측은, 비방향성 인트라 예측 모드 또는 방향성 인트라 예측 모드에 기초하여, 현재 블록에 대한 예측 블록을 획득하는 방법이다. 이하, 도면을 참조하여, 일반 인트라 예측에 기초한 인트라 예측 수행 과정에 대해 보다 상세히 살펴보기로 한다.General intra prediction is a method of obtaining a prediction block for the current block based on a non-directional intra prediction mode or a directional intra prediction mode. Hereinafter, with reference to the drawings, we will look at the intra prediction performance process based on general intra prediction in more detail.

도 13은 본 개시의 일 실시예에 따른, 인트라 예측 방법의 흐름도이다.13 is a flowchart of an intra prediction method according to an embodiment of the present disclosure.

현재 블록의 참조 샘플 라인을 결정할 수 있다(S1301). 참조 샘플 라인은 현재 블록의 상단 및/또는 좌측으로부터 k번째 떨어진 라인에 포함된 참조 샘플들의 집합을 의미한다. 참조 샘플은 현재 블록 주변 부호화/복호화가 완료된 복원 샘플로부터 유도될 수 있다. The reference sample line of the current block can be determined (S1301). The reference sample line refers to a set of reference samples included in the kth line from the top and/or left of the current block. The reference sample may be derived from a restored sample for which encoding/decoding around the current block has been completed.

복수의 참조 샘플 라인들 중 현재 블록의 참조 샘플 라인을 식별하는 인덱스 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 현재 블록의 참조 샘플 라인을 특정하기 위한 인덱스 정보 intra_luma_ref_idx가 비트스트림을 통해 시그날링될 수 있다. 상기 인덱스 정보는 코딩 블록 단위로 시그날링될 수 있다. Index information identifying a reference sample line of the current block among a plurality of reference sample lines may be signaled through a bitstream. As an example, index information intra_luma_ref_idx for specifying the reference sample line of the current block may be signaled through a bitstream. The index information may be signaled on a coding block basis.

복수의 참조 샘플 라인들은, 현재 블록에 상단 및/또는 좌측 1번째 라인, 2번째 라인, 3번째 라인 중 적어도 하나를 포함할 수 있다. 복수개의 참조 샘플 라인들 중 현재 블록의 상단에 인접하는 행 및 현재 블록의 좌측에 인접하는 열로 구성된 참조 샘플 라인을 인접 참조 샘플 라인이라 호칭하고, 그 이외의 참조 샘플 라인을 비인접 참조 샘플 라인이라 호칭할 수도 있다. The plurality of reference sample lines may include at least one of the first line, second line, and third line from the top and/or left of the current block. Among the plurality of reference sample lines, a reference sample line consisting of a row adjacent to the top of the current block and a column adjacent to the left of the current block is called an adjacent reference sample line, and other reference sample lines are called non-adjacent reference sample lines. You can also call it.

표 7은 후보 참조 샘플 라인들 각각에 할당되는 인덱스를 나타낸 것이다. Table 7 shows the indices assigned to each of the candidate reference sample lines.

인덱스 (intra_luma_ref_idx)index (intra_luma_ref_idx) 참조 샘플 라인Reference sample line 00 인접 참조 샘플 라인Adjacent reference sample line 1One 제1 비인접 참조 샘플 라인First non-adjacent reference sample line 22 제2 비인접 참조 샘플 라인Second non-adjacent reference sample line

현재 블록의 위치, 크기, 형태 또는 이웃 블록의 예측 부호화 모드 중 적어도 하나에 기초하여, 현재 블록의 참조 샘플 라인을 결정할 수도 있다. 일 예로, 현재 블록이 픽처, 타일, 슬라이스 또는 코딩 트리 유닛의 경계에 접하는 경우, 인접 참조 샘플 라인을 현재 블록의 참조 샘플 라인으로 결정할 수 있다.The reference sample line of the current block may be determined based on at least one of the position, size, and shape of the current block or the prediction coding mode of the neighboring block. For example, when the current block borders the boundary of a picture, tile, slice, or coding tree unit, an adjacent reference sample line may be determined as the reference sample line of the current block.

참조 샘플 라인은 현재 블록의 상단에 위치하는 상단 참조 샘플들 및 현재 블록의 좌측에 위치하는 좌측 참조 샘플들을 포함할 수 있다. 상단 참조 샘플들 및 좌측 참조 샘플들은 현재 블록 주변의 복원 샘플들로부터 유도될 수 있다. 상기 복원 샘플들은 인루프 필터가 적용되기 이전 상태일 수 있다.The reference sample line may include top reference samples located at the top of the current block and left reference samples located to the left of the current block. Top reference samples and left reference samples may be derived from reconstructed samples around the current block. The restored samples may be in a state before the in-loop filter is applied.

다음으로, 현재 블록의 인트라 예측 모드를 결정할 수 있다(S1302). 현재 블록의 인트라 예측 모드는 비방향성 인트라 예측 모드 또는 방향성 인트라 예측 모드 중 적어도 하나가 현재 블록의 인트라 예측 모드로 결정될 수 있다. 비방향성 인트라 예측 모드는, 플래너 및 DC를 포함하고, 방향성 인트라 예측 모드는 좌하단 대각 방향부터 우상단 대각 방향까지 33개 또는 65개의 모드들을 포함한다. Next, the intra prediction mode of the current block can be determined (S1302). At least one of a non-directional intra prediction mode or a directional intra prediction mode may be determined as the intra prediction mode of the current block. The non-directional intra prediction mode includes planar and DC, and the directional intra prediction mode includes 33 or 65 modes from the lower left diagonal direction to the upper right diagonal direction.

도 14는 인트라 예측 모드들을 나타낸 도면이다. Figure 14 is a diagram showing intra prediction modes.

도 14의 (a)는 35개의 인트라 예측 모드를 나타낸 것이고, 도 15의 (b)는 67개의 인트라 예측 모드들을 나타낸 것이다.Figure 14 (a) shows 35 intra prediction modes, and Figure 15 (b) shows 67 intra prediction modes.

도 14에 도시된 것보다 더 많은 수 혹은 더 적은 수의 인트라 예측 모드들이 정의될 수도 있다. More or fewer intra prediction modes than shown in FIG. 14 may be defined.

현재 블록에 이웃하는 이웃 블록의 정보를 이용하여, 현재 블록의 인트라 예측 모드를 결정 혹은 예측할 수 있다. 일 예로, 이웃 블록의 에지 방향 및/또는 각도에 기초하여 현재 블록의 인트라 예측 모드를 유도할 수 있다. 예컨대, 이웃 블록에 에지가 존재하는 경우, 에지의 방향 및/또는 에지가 형성하는 각도와 동일하거나 이와 가장 유사한 각도를 가진 인트라 예측 모드를 현재 블록의 예측 모드로 설정할 수 있다. The intra prediction mode of the current block can be determined or predicted using information on neighboring blocks neighboring the current block. As an example, the intra prediction mode of the current block may be derived based on the edge direction and/or angle of the neighboring block. For example, when an edge exists in a neighboring block, an intra prediction mode with an angle that is the same as or most similar to the direction of the edge and/or the angle formed by the edge may be set as the prediction mode of the current block.

이웃 블록은, 현재 블록의 좌측 이웃 블록 또는 상단 이웃 블록 중 적어도 하나를 포함할 수 있다 있다. 이에 따라, 좌측 이웃 블록의 에지 방향 및/또는 에지 각도와 동일하거나 가장 유사한 인트라 예측 모드 또는 상단 이웃 블록의 에지 방향 및/또는 에지 각도와 동일하거나 가장 유사한 인트라 예측 모드가 현재 블록의 예측 모드로 설정할 수 있다. The neighboring block may include at least one of a left neighboring block or a top neighboring block of the current block. Accordingly, the intra prediction mode that is identical or most similar to the edge direction and/or edge angle of the left neighboring block or the intra prediction mode that is identical or most similar to the edge direction and/or edge angle of the top neighboring block is set as the prediction mode of the current block. You can.

다른 예로, 이웃 블록의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로 설정할 수도 있다. As another example, the intra prediction mode of the neighboring block may be set to the intra prediction mode of the current block.

도 15는 현재 블록의 인트라 예측 모드를 유도하기 위해 이용되는 이웃 블록들의 위치를 나타낸 것이다. Figure 15 shows the positions of neighboring blocks used to derive the intra prediction mode of the current block.

도 15에 도시된 예에서와 같이, 좌측 이웃 블록(1), 상단 이웃 블록(2), 우상단 이웃 블록(3), 좌하단 이웃 블록(4) 또는 좌상단 이웃 블록(5) 중 적어도 하나를 이용하여, 현재 블록의 인트라 예측 모드를 유도할 수 있다. As in the example shown in Figure 15, at least one of the left neighboring block (1), the top neighboring block (2), the upper right neighboring block (3), the lower left neighboring block (4), or the upper left neighboring block (5) is used. Thus, the intra prediction mode of the current block can be derived.

이웃 블록의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로 설정하는 것을 인트라 머지 모드라 정의할 수 있다. 이 경우, 이웃 블록들 각각의 인트라 예측 모드를, 인트라 머지 후보로 설정할 수 있다. 복수개의 인트라 머지 후보들이 존재하는 경우, 복수개의 인트라 머지 후보들 중 하나를 식별하는 인덱스 정보가 비트스트림을 통해 시그날링될 수 있다. 또는, 복수개의 인트라 머지 후보들 중 빈도수가 가장 높은 인트라 예측 모드를 현재 블록의 인트라 예측 모드로 설정할 수도 있다.Setting the intra prediction mode of a neighboring block to the intra prediction mode of the current block can be defined as intra merge mode. In this case, the intra prediction mode of each neighboring block can be set as an intra merge candidate. When a plurality of intra merge candidates exist, index information identifying one of the plurality of intra merge candidates may be signaled through a bitstream. Alternatively, the intra prediction mode with the highest frequency among the plurality of intra merge candidates may be set as the intra prediction mode of the current block.

복수개의 인트라 머지 후보들 중 복수개를 선택한 뒤, 선택된 복수개의 인트라 예측 모드들 각각을 서브 블록에 할당할 수 있다. 이에 따라, 현재 블록 내 서브 블록 별 상이한 인트라 예측 모드가 할당될 수 있다. 일 예로, 현재 블록 내 제1 서브 블록의 인트라 예측 모드는, 제1 인트라 머지 후보와 동일하게 설정되고, 현재 블록 내 제2 서브 블록의 인트라 예측 모드는, 제2 인트라 머지 후보와 동일하게 설정될 수 있다. After selecting a plurality of intra merge candidates, each of the selected intra prediction modes can be assigned to a subblock. Accordingly, a different intra prediction mode may be assigned to each subblock within the current block. As an example, the intra prediction mode of the first subblock in the current block may be set to be the same as the first intra merge candidate, and the intra prediction mode of the second subblock in the current block may be set to be the same as the second intra merge candidate. You can.

현재 블록의 인트라 예측 모드가 결정되면, 결정된 인트라 예측 모드를 기초로, 현재 블록에 대한 예측 샘플들을 획득할 수 있다(S1303).When the intra prediction mode of the current block is determined, prediction samples for the current block can be obtained based on the determined intra prediction mode (S1303).

DC 모드가 선택된 경우, 참조 샘플들의 평균값을 기초로, 현재 블록에 대한 예측 샘플들이 생성된다. 구체적으로, 예측 블록 내 전체 샘플들의 값은 참조 샘플들의 평균값을 기초로 생성될 수 있다. 평균값은, 현재 블록의 상단에 위치하는 상단 참조 샘플들 및 현재 블록의 좌측에 위치하는 좌측 참조 샘플들 중 적어도 하나를 이용하여 유도될 수 있다. When DC mode is selected, prediction samples for the current block are generated based on the average value of reference samples. Specifically, the values of all samples within the prediction block may be generated based on the average value of the reference samples. The average value may be derived using at least one of top reference samples located at the top of the current block and left reference samples located to the left of the current block.

현재 블록의 형태에 따라, 평균값을 유도하는데 이용되는 참조 샘플들의 개수 또는 범위가 달라질 수 있다. 일 예로, 현재 블록이 너비가 높이보다 큰 비정방형 블록인 경우, 상단 참조 샘플들만을 이용하여 평균값을 계산할 수 있다. 반면, 현재 블록이 너비가 높이보다 작은 비정방형 블록인 경우, 좌측 참조 샘플들만을 이용하여 평균값을 계산할 수 있다. 즉, 현재 블록의 너비 및 높이가 상이한 경우, 길이가 더 긴 쪽에 인접하는 참조 샘플들만을 이용하여 평균값을 계산할 수 있다. 또는, 현재 블록의 너비와 높이 비율에 기초하여, 상단 참조 샘플들만을 이용하여 평균값을 계산할 것인지 여부 또는 좌측 참조 샘플들만을 이용하여 평균값을 계산할 것인지 여부를 결정할 수 있다.Depending on the type of the current block, the number or range of reference samples used to derive the average value may vary. For example, if the current block is a non-square block with a width greater than the height, the average value can be calculated using only the top reference samples. On the other hand, if the current block is a non-square block whose width is smaller than the height, the average value can be calculated using only the left reference samples. That is, if the width and height of the current block are different, the average value can be calculated using only reference samples adjacent to the longer side. Alternatively, based on the width and height ratio of the current block, it may be determined whether to calculate the average value using only the top reference samples or only the left reference samples.

플래너 모드가 선택된 경우, 수평 방향 예측 샘플과 수직 방향 예측 샘플을 이용하여, 예측 샘플을 획득할 수 있다. 여기서, 수평 방향 예측 샘플은, 예측 샘플과 동일한 수평선상에 위치하는 좌측 참조 샘플 및 우측 참조 샘플을 기초로 획득되고, 수직 방향 예측 샘플은, 예측 샘플과 동일한 수직선상에 위치하는 상단 참조 샘플 및 하단 참조 샘플을 기초로 획득된다. 여기서, 우측 참조 샘플은, 현재 블록의 우측 상단 코너에 인접하는 참조 샘플을 복사하여 생성되고, 하단 참조 샘플은, 현재 블록의 좌측 하단 코너에 인접하는 참조 샘플을 복사하여 생성될 수 있다. 수평 방향 예측 샘플은 좌측 참조 샘플 및 우측 참조 샘플의 가중합 연산을 기초로 획득되고, 수직 방향 예측 샘플은 상단 참조 샘플 및 하단 참조 샘플의 가중합 연산을 기초로 획득될 수 있다. 이때, 각 참조 샘플에 부여되는 가중치는 예측 샘플의 위치에 따라 결정될 수 있다. 예측 샘플은 수평 방향 예측 샘플 및 수직 방향 예측 샘플의 평균 연산 또는 가중합 연산을 기초로 획득될 수 있다. 가중합 연산이 수행되는 경우, 예측 샘플의 위치에 기초하여 수평 방향 예측 샘플 및 수직 방향 예측 샘플에 부여되는 가중치를 결정할 수 있다.When the planner mode is selected, prediction samples can be obtained using horizontal prediction samples and vertical prediction samples. Here, the horizontal prediction sample is obtained based on the left reference sample and the right reference sample located on the same horizontal line as the prediction sample, and the vertical prediction sample is the upper reference sample and the lower reference sample located on the same vertical line as the prediction sample. Obtained on the basis of a reference sample. Here, the right reference sample may be created by copying a reference sample adjacent to the upper right corner of the current block, and the lower reference sample may be created by copying a reference sample adjacent to the lower left corner of the current block. The horizontal prediction sample may be obtained based on a weighted sum operation of the left reference sample and the right reference sample, and the vertical prediction sample may be obtained based on the weighted sum operation of the upper reference sample and the lower reference sample. At this time, the weight given to each reference sample may be determined according to the location of the prediction sample. The prediction sample may be obtained based on an average operation or a weighted sum operation of the horizontal prediction sample and the vertical prediction sample. When a weighted sum operation is performed, weights given to the horizontal prediction sample and the vertical prediction sample may be determined based on the positions of the prediction samples.

방향성 예측 모드가 선택되는 경우, 선택된 방향성 예측 모드의 예측 방향(또는 예측 각도)을 나타내는 파라미터를 결정할 수 있다. 하기 표 8은 인트라 예측 모드 별 인트라 방향 파라미터 intraPredAng를 나타낸 것이다.When a directional prediction mode is selected, a parameter indicating the prediction direction (or prediction angle) of the selected directional prediction mode may be determined. Table 8 below shows the intra direction parameter intraPredAng for each intra prediction mode.

PredModeIntraPredModeIntra 1One 22 33 44 55 66 77 IntraPredAngIntraPredAng -- 3232 2626 2121 1717 1313 99 PredModeIntraPredModeIntra 88 99 1010 1111 1212 1313 1414 IntraPredAngIntraPredAng 55 22 00 -2-2 -5-5 -9-9 -13-13 PredModeIntraPredModeIntra 1515 1616 1717 1818 1919 2020 2121 IntraPredAngIntraPredAng -17-17 -21-21 -26-26 -32-32 -26-26 -21-21 -17-17 PredModeIntraPredModeIntra 2222 2323 2424 2525 2626 2727 2828 IntraPredAngIntraPredAng -13-13 -9-9 -5-5 -2-2 00 22 55 PredModeIntraPredModeIntra 2929 3030 3131 3232 3333 3434 IntraPredAngIntraPredAng 99 1313 1717 2121 2626 3232

표 8은 35개의 인트라 예측 모드가 정의되어 있을 때, 인덱스가 2 내지 34 중 어느 하나인 인트라 예측 모드들 각각의 인트라 방향 파라미터를 나타낸다. 33개보다 더 많은 방향성 인트라 예측 모드가 정의되어 있는 경우, 표 7을 보다 세분화하여, 방향성 인트라 예측 모드 각각의 인트라 방향 파라미터를 설정할 수 있다.현재 블록의 상단 참조 샘플들 및 좌측 참조 샘플들을 일렬로 배열한 뒤, 인트라 방향 파라미터의 값을 기초로, 예측 샘플을 획득할 수 있다. 이때, 인트라 방향 파라미터의 값이 음수인 경우, 좌측 참조 샘플들과 상단 참조 샘플들을 일렬로 배열할 수 있다. Table 8 shows the intra direction parameters for each of the intra prediction modes with an index of any one of 2 to 34 when 35 intra prediction modes are defined. If more than 33 directional intra prediction modes are defined, Table 7 can be further subdivided to set the intra direction parameters for each directional intra prediction mode. The top reference samples and left reference samples of the current block are lined up. After arrangement, prediction samples can be obtained based on the value of the intra direction parameter. At this time, if the value of the intra direction parameter is a negative number, the left reference samples and the top reference samples can be arranged in a row.

인트라 방향 파라미터에 기초하여, 참조 샘플 결정 파라미터를 결정할 수 있다. 참조 샘플 결정 파라미터는 참조 샘플을 특정하기 위한 참조 샘플 인덱스 및 참조 샘플에 적용되는 가중치를 결정하기 위한 가중치 파라미터를 포함할 수 있다. Based on the intra direction parameters, reference sample determination parameters can be determined. The reference sample determination parameter may include a reference sample index for specifying the reference sample and a weight parameter for determining the weight applied to the reference sample.

참조 샘플 인덱스 iIdx 및 가중치 파라미터 ifact는 각각 다음의 수학식 5 및 6을 통해 획득될 수 있다.The reference sample index iIdx and the weight parameter ifact can be obtained through the following equations 5 and 6, respectively.

Figure pat00011
Figure pat00011

Figure pat00012
Figure pat00012

수학식 5 및 6에서 Pang는 인트라 방향 파라미터를 나타낸다. 참조 샘플 인덱스 iIdx에 의해 특정되는 참조 샘플은 정수 펠(Integer pel)에 해당한다.In Equations 5 and 6, P ang represents the intra direction parameter. The reference sample specified by the reference sample index iIdx corresponds to an integer pel.

예측 샘플을 유도하기 위해, 적어도 하나 이상의 참조 샘플을 특정할 수 있다. 구체적으로, 예측 모드의 기울기를 고려하여, 예측 샘플을 유도하는데 이용되는 참조 샘플의 위치를 특정할 수 있다. 일 예로, 참조 샘플 인덱스 iIdx를 이용하여, 예측 샘플을 유도하는데 이용되는 참조 샘플을 특정할 수 있다.To derive a prediction sample, at least one reference sample may be specified. Specifically, by considering the slope of the prediction mode, the location of the reference sample used to derive the prediction sample can be specified. As an example, the reference sample index iIdx can be used to specify the reference sample used to derive the prediction sample.

이때, 인트라 예측 모드의 기울기가 하나의 참조 샘플로는 표현되지 않는 경우, 복수의 참조 샘플들을 보간하여 예측 샘플을 생성할 수 있다. 일 예로, 인트라 예측 모드의 기울기가 예측 샘플과 제1 참조 샘플 사이의 기울기 및 예측 샘플과 제2 참조 샘플 사이의 기울기 사이의 값인 경우, 제1 참조 샘플 및 제2 참조 샘플을 보간하여 예측 샘플을 획득할 수 있다. 즉, 인트라 예측 각도를 따르는 앵귤러 라인(Angular Line)이 정수 펠에 위치한 참조 샘플을 지나지 않는 경우, 상기 앵귤러 라인이 지나는 위치의 좌우 또는 상하에 인접 위치하는 참조 샘플들을 보간하여 예측 샘플을 획득할 수 있다.At this time, if the slope of the intra prediction mode is not expressed by one reference sample, a prediction sample can be generated by interpolating a plurality of reference samples. As an example, if the slope of the intra prediction mode is a value between the slope between the prediction sample and the first reference sample and the slope between the prediction sample and the second reference sample, the prediction sample is obtained by interpolating the first reference sample and the second reference sample. It can be obtained. That is, if the angular line following the intra prediction angle does not pass through a reference sample located at an integer pel, the prediction sample can be obtained by interpolating reference samples located adjacent to the left and right or above and below the location where the angular line passes. there is.

하기 수학식 7은 참조 샘플들을 기초로, 예측 샘플을 획득하는 예를 나타낸 것이다.Equation 7 below shows an example of obtaining a prediction sample based on reference samples.

Figure pat00013
Figure pat00013

수학식 7에서, P는 예측 샘플을 나타내고, Ref_1D은 일차원 배열된 참조 샘플들 중 어느 하나를 나타낸다. 이때, 참조 샘플의 위치는 예측 샘플의 위치 (x, y) 및 참조 샘플 인덱스 iIdx에 의해 결정될 수 있다.In Equation 7, P represents a prediction sample, and Ref_1D represents one of one-dimensionally arranged reference samples. At this time, the location of the reference sample can be determined by the location (x, y) of the prediction sample and the reference sample index iIdx.

인트라 예측 모드의 기울기가 하나의 참조 샘플로 표현 가능한 경우, 가중치 파라미터 ifact는 0으로 설정된다. 이에 따라, 수학식 7은 다음 수학식 8과 같이 간소화될 수 있다.If the gradient of the intra prediction mode can be expressed with one reference sample, the weight parameter i fact is set to 0. Accordingly, Equation 7 can be simplified as Equation 8 below.

Figure pat00014
Figure pat00014

원본 영상에서 예측 영상을 차분하여 유도된 잔차 영상을 유도할 수 있다. 이때, 잔차 영상을 주파수 도메인으로 변경하였을 때, 주파수 성분들 중 고주파 성분들을 제거하더라도, 영상의 주관적 화질은 크게 떨어지지 않는다. 이에 따라, 고주파 성분들의 값을 작게 변환하거나, 고주파 성분들의 값을 0으로 설정한다면, 시각적 왜곡이 크게 발생하지 않으면서도 압축 효율을 증가시킬 수 있는 효과가 있다. 위 특성을 반영하여, 잔차 영상을 2차원 주파수 성분들로 분해하기 위해 현재 블록을 변환할 수 있다. 상기 변환은 DCT(Discrete Cosine Transform) 또는 DST(Discrete Sine Tranform) 등의 변환 기법을 이용하여 수행될 수 있다. The derived residual image can be derived by subtracting the predicted image from the original image. At this time, when the residual image is changed to the frequency domain, even if high-frequency components among the frequency components are removed, the subjective image quality of the image does not decrease significantly. Accordingly, if the values of the high-frequency components are converted to small or the values of the high-frequency components are set to 0, compression efficiency can be increased without causing significant visual distortion. Reflecting the above characteristics, the current block can be transformed to decompose the residual image into two-dimensional frequency components. The transformation may be performed using a transformation technique such as Discrete Cosine Transform (DCT) or Discrete Sine Transform (DST).

DCT는 코사인 변환을 이용하여, 잔차 영상을 2차원 주파수 성분으로 분해(또는 변환)하는 것이고, DST는 사인 변환을 이용하여, 잔차 영상을 2차원 주파수 성분으로 분해(또는 변환)하는 것이다. 잔차 영상의 변환 결과, 주파수 성분들은 기저 영상으로 표현될 수 있다. 일 예로, NxN 크기의 블록에 대해 DCT 변환을 수행하는 경우, N2 개의 기본 패턴 성분이 획득될 수 있다. 변환을 통해 NxN 크기 블록에 포함된 기본 패턴 성분들 각각의 크기가 획득될 수 있다. 이용된 변환 기법에 따라, 기본 패턴 성분의 크기를 DCT 계수 또는 DST 계수라 호칭할 수 있다.DCT decomposes (or converts) the residual image into two-dimensional frequency components using cosine transform, and DST decomposes (or converts) the residual image into two-dimensional frequency components using sine transform. As a result of transforming the residual image, the frequency components can be expressed as a basis image. For example, when performing DCT transformation on a block of size NxN, N 2 basic pattern components can be obtained. Through conversion, the size of each basic pattern component included in the NxN size block can be obtained. Depending on the conversion technique used, the size of the basic pattern component may be called a DCT coefficient or DST coefficient.

변환 기법 DCT는 0이 아닌 저주파 성분들이 많이 분포하는 영상을 변환하는데 주로 이용된다. 변환 기법 DST는 고주파 성분들이 많이 분포하는 영상에 주로 이용된다. Transformation technique DCT is mainly used to transform images in which many non-zero low-frequency components are distributed. The transformation technique DST is mainly used for images with many high-frequency components distributed.

DCT 또는 DST 이외의 변환 기법을 사용하여 잔차 영상을 변환할 수도 있다.The residual image can also be transformed using a transformation technique other than DCT or DST.

이하, 잔차 영상을 2차원 주파수 성분들로 변환하는 것을 2차원 영상 변환이라 호칭하기로 한다. 아울러, 변환 결과 획득된 기본 패턴 성분들의 크기를 변환 계수라 호칭하기로 한다. 일 예로, 변환 계수는 DCT 계수 또는 DST 계수를 의미할 수 있다. 후술될 제1 변환 및 제2 변환이 모두 적용된 경우, 변환 계수는 제2 변환의 결과로 생성된 기본 패턴 성분의 크기를 의미할 수 있다. 또한, 변환 스킵이 적용된 잔차 샘플 역시 변환 계수라 호칭하기로 한다.Hereinafter, converting the residual image into two-dimensional frequency components will be referred to as two-dimensional image conversion. In addition, the sizes of basic pattern components obtained as a result of conversion are referred to as conversion coefficients. As an example, the transformation coefficient may mean a DCT coefficient or a DST coefficient. When both the first transformation and the second transformation, which will be described later, are applied, the transformation coefficient may mean the size of the basic pattern component generated as a result of the second transformation. Additionally, the residual sample to which transformation skip is applied will also be referred to as a transformation coefficient.

변환 기법은 블록 단위로 결정될 수 있다. 변환 기법은 현재 블록의 예측 부호화 모드, 현재 블록의 크기 또는 현재 블록의 형태 중 적어도 하나를 기초로 결정될 수 있다. 일 예로, 현재 블록이 인트라 예측 모드로 부호화되고, 현재 블록의 크기가 NxN보다 작은 경우에는 변환 기법 DST를 사용하여 변환이 수행될 수 있다. 반면, 상기 조건을 만족하지 않는 경우, 변환 기법 DCT를 사용하여 변환이 수행될 수 있다.The conversion technique can be determined on a block basis. The transformation technique may be determined based on at least one of the prediction coding mode of the current block, the size of the current block, or the shape of the current block. For example, if the current block is encoded in intra prediction mode and the size of the current block is smaller than NxN, transformation may be performed using the transformation technique DST. On the other hand, if the above conditions are not satisfied, conversion may be performed using the conversion technique DCT.

잔차 영상 중 일부 블록에 대해서는 2차원 영상 변환이 수행되지 않을 수도 있다. 2차원 영상 변환을 수행하지 않는 것을 변환 스킵(Transform Skip)이라 호칭할 수 있다. 변환 스킵은, 현재 블록에 제1 변환 및 제2 변환이 적용되지 않음을 나타낸다. 변환 스킵이 적용된 경우, 변환이 수행되지 않는 잔차값들을 대상으로 양자화가 적용될 수 있다. 2D image conversion may not be performed on some blocks of the residual image. Not performing 2D image transformation can be called transform skip. Transform skip indicates that the first transform and the second transform are not applied to the current block. When transform skip is applied, quantization may be applied to residual values for which transform is not performed.

현재 블록에 변환 스킵을 허용할 것인지 여부는, 현재 블록의 크기 또는 형태 중 적어도 하나에 기초하여 결정될 수 있다. 일 예로, 현재 블록의 크기가 문턱값보다 작은 경우에 한하여, 변환 스킵이 적용될 수 있다. 문턱값은 현재 블록의 너비, 높이 또는 샘플 개수 중 적어도 하나와 관한 것으로 32x32 등으로 정의될 수 있다. 또는, 정방형 블록에 대해서만 변환 스킵을 허용할 수 있다. 일 예로, 32x32, 16x16, 8x8 또는 4x4 크기의 정방형 블록에 대해 변환 스킵이 허용될 수 있다. 또는, 서브 파티션 인트라 부호화 방법이 사용되지 않은 경우에만, 변환 스킵을 허용할 수 있다. Whether to allow transformation skipping for the current block may be determined based on at least one of the size or shape of the current block. For example, transform skip may be applied only when the size of the current block is smaller than the threshold. The threshold is related to at least one of the width, height, or number of samples of the current block and may be defined as 32x32, etc. Alternatively, transformation skipping can be allowed only for square blocks. As an example, skipping transformation may be allowed for square blocks of size 32x32, 16x16, 8x8, or 4x4. Alternatively, conversion skipping may be allowed only when the sub-partition intra coding method is not used.

DCT 또는 DST를 이용하여 현재 블록을 변환한 뒤, 변환된 현재 블록을 다시 변환할 수 있다. 이때, DCT 또는 DST에 기초한 변환을 제1 변환이라 정의하고, 제1 변환이 적용된 블록을 다시 변환하는 것을 제2 변환이라 정의할 수 있다.After converting the current block using DCT or DST, the converted current block can be converted again. At this time, transformation based on DCT or DST can be defined as the first transformation, and re-transforming the block to which the first transformation has been applied can be defined as the second transformation.

제1 변환은 복수개의 변환 코어 후보들 중 어느 하나를 이용하여 수행될 수 있다. 일 예로, DCT2, DCT8 또는 DST7 중 어느 하나를 이용하여 제1 변환이 수행될 수 있다. The first transformation may be performed using one of a plurality of transformation core candidates. As an example, the first transformation may be performed using any one of DCT2, DCT8, or DST7.

수평 방향 및 수직 방향에 대해 상이한 변환 코어가 사용될 수도 있다. 수평 방향의 변환 코어 및 수직 방향의 변환 코어의 조합을 나타내는 정보가 비트스트림을 통해 시그날링될 수도 있다. 일 예로, tu_mts_idx는 수평 방향 변환 코어 및 수직 방향 변환 코어 조합들 중 하나를 가리킬 수 있다.Different conversion cores may be used for the horizontal and vertical directions. Information indicating the combination of the horizontal conversion core and the vertical conversion core may be signaled through the bitstream. As an example, tu_mts_idx may indicate one of a combination of a horizontal direction conversion core and a vertical direction conversion core.

제1 변환 및 제2 변환의 수행 단위가 상이할 수 있다. 일 예로, 8x8 블록에 대해 제1 변환을 수행하고, 변환된 8x8 블록 중 4x4 크기의 서브 블록에 대해 제2 변환을 수행할 수 있다. 또는, 4x4 크기의 서브 블록들 3개에 속한 변환 계수들에 대해 제2 변환을 수행할 수 있다. 상기 3개의 서브 블록들은, 현재 블록의 좌상단에 위치하는 서브 블록, 상기 서브 블록의 우측에 이웃하는 서브 블록 및 상기 서브 블록의 하단에 이웃하는 서브 블록을 포함할 수 있다. 또는, 8x8 크기의 블록에 대해 제2 변환을 수행할 수도 있다.The performance units of the first transformation and the second transformation may be different. As an example, a first transformation may be performed on an 8x8 block, and a second transformation may be performed on a 4x4 sub-block among the transformed 8x8 blocks. Alternatively, a second transform may be performed on transform coefficients belonging to three sub-blocks of 4x4 size. The three sub-blocks may include a sub-block located at the upper left of the current block, a sub-block neighboring to the right of the sub-block, and a sub-block neighboring to the bottom of the sub-block. Alternatively, the second transformation may be performed on an 8x8 block.

제2 변환이 수행되지 않는 잔여 영역들의 변환 계수는 0으로 설정될 수도 있다. Transform coefficients of remaining areas where the second transform is not performed may be set to 0.

또는, 4x4 블록에 대해 제1 변환을 수행하고, 변환된 4x4 블록을 포함하는 8x8 크기의 영역에 대해 제2 변환을 수행할 수도 있다.Alternatively, the first transformation may be performed on a 4x4 block, and the second transformation may be performed on an 8x8 area containing the transformed 4x4 block.

현재 블록의 변환 타입을 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 수평 방향에 대한 변환 타입 및 수직 방향에 대한 변환 타입의 조합들 중 하나를 나타내는 인덱스 정보 tu_mts_idx일 수 있다.Information indicating the conversion type of the current block may be signaled through a bitstream. The information may be index information tu_mts_idx indicating one of combinations of a transformation type for the horizontal direction and a transformation type for the vertical direction.

비트스트림으로부터 시그날링되는 정보에 기초하여 현재 블록의 변환 타입을명시적으로 결정할 것인지 여부가 결정될 수 있다. 상기 정보는, 시퀀스, 픽처 또는 슬라이스 헤더를 통해 시그날링될 수 있다. 일 예로, 시퀀스 레벨에서, 인트라 예측으로 부호화된 블록에 대해 명시적인 변환 타입 결정이 허용되는지 여부를 나타내는 정보 sps_explicit_intra_mts_flag 및/또는 인터 예측으로 부호화된 블록에 대해 명시적인 변환 타입 결정이 허용되는지 여부를 나타내는 정보 sps_explicit_inter_mts_flag가 시그날링될 수 있다.It may be determined whether to explicitly determine the transformation type of the current block based on information signaled from the bitstream. The information may be signaled through a sequence, picture, or slice header. As an example, at the sequence level, information sps_explicit_intra_mts_flag indicating whether explicit transform type determination is allowed for blocks encoded with intra prediction and/or information indicating whether explicit transform type determination is allowed for blocks encoded with inter prediction. Information sps_explicit_inter_mts_flag may be signaled.

명시적인 변환 타입 결정이 허용되는 경우, 비트스트림으로부터 시그날링되는 인덱스 정보 tu_mts_idx에 기초하여 현재 블록의 변환 타입을 결정할 수 있다. If explicit transformation type determination is allowed, the transformation type of the current block can be determined based on index information tu_mts_idx signaled from the bitstream.

반면, 명시적인 변환 타입 결정이 허용되지 않는 경우, 현재 블록의 크기, 형태, 서브 블록 단위의 변환이 허용되는지 여부 또는 0이 아닌 변환 계수를 포함하는 서브 블록의 위치 중 적어도 하나를 기초로 변환 타입이 결정될 수 있다. 일 예로, 현재 블록의 수평 방향 변환 타입은 현재 블록의 너비를 기초로 결정되고, 현재 블록의 수직 방향 변환 타입은 현재 블록의 높이를 기초로 결정될 수 있다. On the other hand, if explicit transformation type determination is not allowed, the transformation type is determined based on at least one of the size of the current block, the shape, whether transformation in subblock units is allowed, or the location of the subblock containing a non-zero transformation coefficient. This can be decided. For example, the horizontal transformation type of the current block may be determined based on the width of the current block, and the vertical transformation type of the current block may be determined based on the height of the current block.

예컨대, 현재 블록의 너비가 4 보다 작거나 16보다 큰 경우, 수평 방향의 변환 타입은 DCT2로 결정될 수 있다. 그렇지 않은 경우, 수평 방향의 변환 타입은 DST7로 결정될 수 있다. For example, if the width of the current block is less than 4 or greater than 16, the horizontal transformation type may be determined as DCT2. Otherwise, the transformation type in the horizontal direction may be determined as DST7.

현재 블록의 높이가 4보다 작거나 16보다 큰 경우, 수직 방향의 변환 타입은 DCT2로 결정될 수 있다. 그렇지 않은 경우, 수직 방향의 변환 타입은 DST7로 결정될 수 있다. If the height of the current block is less than 4 or greater than 16, the vertical transformation type may be determined as DCT2. Otherwise, the vertical transformation type may be determined as DST7.

여기서, 수평 방향의 변환 타입 및 수직 방향의 변환 타입을 결정하기 위해, 너비 및 높이와 비교되는 문턱값은, 부호화기 및 복호화기에서 기 정의된 것이거나, 현재 블록의 크기, 형태 또는 인트라 예측 모드 중 적어도 하나에 기초하여 적응적으로 결정되는 것일 수 있다.Here, in order to determine the horizontal transformation type and the vertical transformation type, the threshold value compared with the width and height is predefined in the encoder and decoder, or is determined by the size, shape, or intra prediction mode of the current block. It may be adaptively determined based on at least one.

부호화기에서 변환 및 양자화를 수행하면, 복호화기는 역양자화 및 역변환을 통해 잔차 블록을 획득할 수 있다. 복호화기에서는 예측 블록과 잔차 블록을 더하여, 현재 블록에 대한 복원 블록을 획득할 수 있다.If the encoder performs transformation and quantization, the decoder can obtain a residual block through inverse quantization and inverse transformation. The decoder can obtain a restored block for the current block by adding the prediction block and the residual block.

현재 블록의 복원 블록이 획득되면, 인루프 필터링(In-loop filtering)을 통해 양자화 및 부호화 과정에서 발생하는 정보의 손실을 줄일 수 있다. 인루프 필터는 디블록킹 필터(Deblocking filter), 샘플 적응적 오프셋 필터(Sample Adaptive Offset filter, SAO) 또는 적응적 루프 필터(Adaptive Loop Filter, ALF) 중 적어도 하나를 포함할 수 있다. When the restored block of the current block is obtained, information loss occurring during quantization and encoding can be reduced through in-loop filtering. The in-loop filter may include at least one of a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive loop filter (ALF).

상술한 실시예는 일련의 단계 또는 순서도를 기초로 설명되고 있으나, 이는 발명의 시계열적 순서를 한정한 것은 아니며, 필요에 따라 동시에 수행되거나 다른 순서로 수행될 수 있다. 또한, 상술한 실시예에서 블록도를 구성하는 구성요소(예를 들어, 유닛, 모듈 등) 각각은 하드웨어 장치 또는 소프트웨어로 구현될 수도 있고, 복수의 구성요소가 결합하여 하나의 하드웨어 장치 또는 소프트웨어로 구현될 수도 있다. 상술한 실시예는 다양한 컴퓨터 구성요소를 통하여 수행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 ROM, RAM, 플래시 메모리 등과 같은 프로그램 명령어를 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 상기 하드웨어 장치는 본 개시에 따른 처리를 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Although the above-described embodiments are explained based on a series of steps or flowcharts, this does not limit the chronological order of the invention, and may be performed simultaneously or in a different order as needed. Additionally, in the above-described embodiment, each of the components (e.g., units, modules, etc.) constituting the block diagram may be implemented as a hardware device or software, and a plurality of components may be combined to form a single hardware device or software. It may be implemented. The above-described embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc., singly or in combination. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROMs and DVDs, and magneto-optical media such as floptical disks. media), and hardware devices specifically configured to store and perform program instructions, such as ROM, RAM, flash memory, etc. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.

Claims (15)

현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계;
상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및
상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함하되,
상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도되는 것을 특징으로 하는, 영상 복호화 방법.
Obtaining a first prediction block based on first prediction information for the first prediction unit in the current block;
Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and
Comprising: obtaining a final prediction block for the current block based on the first prediction block and the second prediction block,
In a blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, first prediction samples in the first prediction block and second prediction samples in the second prediction block A video decoding method, characterized in that the final prediction sample is derived by blending the samples.
제1 항에 있어서,
상기 블렌딩 영역의 크기는, 복수의 블렌딩 영역 크기 후보들 중 하나에 기초하여 결정되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 1,
The size of the blending area is determined based on one of a plurality of blending area size candidates.
제2 항에 있어서,
상기 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하는 것은, 비트스트림으로부터 복호화되는 인덱스 정보에 기반하여 수행되는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 2,
An image decoding method, wherein selecting one of the plurality of blending area size candidates is performed based on index information decoded from a bitstream.
제2 항에 있어서,
상기 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하는 것은, 상기 제1 예측 유닛의 움직임 정보 및 상기 제2 예측 유닛의 움직임 정보 중 적어도 하나를 기초로 수행되는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 2,
An image decoding method, wherein selecting one of the plurality of blending area size candidates is performed based on at least one of motion information of the first prediction unit and motion information of the second prediction unit.
제2 항에 있어서,
상기 블렌딩 영역 내 상기 제1 예측 샘플들에 적용되는 제1 가중치 및 상기 제2 예측 샘플들에 적용되는 제2 가중치는, 위치에 따라 적응적으로 결정되는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 2,
An image decoding method, wherein the first weight applied to the first prediction samples and the second weight applied to the second prediction samples in the blending region are adaptively determined depending on the location.
제5 항에 있어서,
상기 블렌딩 영역 내 상기 제1 가중치의 변화 정도를 나타내는 기울기는, 상기 블렌딩 영역의 크기와 반비례하는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 5,
A slope indicating the degree of change of the first weight within the blending area is inversely proportional to the size of the blending area.
제2 항에 있어서,
상기 복수의 블렌딩 영역 크기 후보는, 상기 경계를 기준으로, 상기 제1 예측 유닛 방향으로의 크기와 상기 제2 예측 유닛 방향으로의 크기가 상이한 비대칭 블렌딩 영역 크기 후보를 포함하는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 2,
The plurality of blending region size candidates include asymmetric blending region size candidates whose sizes in the direction of the first prediction unit and in the direction of the second prediction unit are different with respect to the boundary. Decryption method.
제1 항에 있어서,
상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 예측 모드가 상이한 경우, 상기 블렌딩 영역은, 상기 경계를 기준으로 비대칭 형태를 띠는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 1,
When prediction modes between the first prediction unit and the second prediction unit are different, the blending area has an asymmetric shape with respect to the boundary.
제8 항에 있어서,
상기 제1 예측 유닛에 인트라 예측이 적용되고, 상기 제2 예측 유닛에 인터 예측이 적용되는 경우, 상기 경계를 기준으로, 상기 제1 예측 유닛 방향으로의 상기 블렌딩 영역의 크기가, 상기 제2 예측 유닛 방향으로의 상기 블렌딩 영역의 크기보다 작은 것을 특징으로 하는, 영상 복호화 방법.
According to clause 8,
When intra prediction is applied to the first prediction unit and inter prediction is applied to the second prediction unit, based on the boundary, the size of the blending area in the direction of the first prediction unit is equal to the size of the second prediction unit. An image decoding method, characterized in that it is smaller than the size of the blending area in the unit direction.
제9 항에 있어서,
상기 제1 예측 유닛의 인트라 예측 모드는, 플래너 모드, 상기 현재 블록을 이분할하는 분할선에 평행인 인트라 예측 모드 또는 상기 분할선에 수직인 인트라 예측 모드 중 하나로 결정되는 것을 특징으로 하는, 영상 복호화 방법.
According to clause 9,
The intra prediction mode of the first prediction unit is determined as one of a planner mode, an intra prediction mode parallel to a dividing line dividing the current block, or an intra prediction mode perpendicular to the dividing line. Image decoding method.
현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계;
상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및
상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함하되,
상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도되는 것을 특징으로 하는, 영상 부호화 방법.
Obtaining a first prediction block based on first prediction information for the first prediction unit in the current block;
Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and
Comprising: obtaining a final prediction block for the current block based on the first prediction block and the second prediction block,
In a blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, first prediction samples in the first prediction block and second prediction samples in the second prediction block An image encoding method, characterized in that the final prediction sample is derived by blending the samples.
제11 항에 있어서,
상기 블렌딩 영역의 크기는, 복수의 블렌딩 영역 크기 후보들 중 하나에 기초하여 결정되는 것을 특징으로 하는, 영상 부호화 방법.
According to claim 11,
An image encoding method, wherein the size of the blending area is determined based on one of a plurality of blending area size candidates.
제12 항에 있어서,
상기 복수의 블렌딩 영역 크기 후보들 중 하나를 특정하는 인덱스 정보가 명시적으로 비트스트림에 부호화되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 12,
An image decoding method, wherein index information specifying one of the plurality of blending area size candidates is explicitly encoded in a bitstream.
제12 항에 있어서,
상기 복수의 블렌딩 영역 크기 후보들 중 하나를 선택하는 것은, 상기 제1 예측 유닛의 움직임 정보 및 상기 제2 예측 유닛의 움직임 정보 중 적어도 하나를 기초로 수행되는 것을 특징으로 하는, 영상 부호화 방법.
According to claim 12,
An image encoding method, wherein selecting one of the plurality of blending area size candidates is performed based on at least one of motion information of the first prediction unit and motion information of the second prediction unit.
현재 블록 내 제1 예측 유닛에 대한 제1 예측 정보를 기초로, 제1 예측 블록을 획득하는 단계;
상기 현재 블록 내 제2 예측 유닛에 대한 제2 예측 정보를 기초로, 제2 예측 블록을 획득하는 단계; 및
상기 제1 예측 블록 및 상기 제2 예측 블록을 기초로, 상기 현재 블록에 대한 최종 예측 블록을 획득하는 단계를 포함하되,
상기 현재 블록 내 상기 제1 예측 유닛 및 상기 제2 예측 유닛 사이의 경계를 중심으로 형성되는 블렌딩 영역 내에서는, 상기 제1 예측 블록 내 제1 예측 샘플들 및 상기 제2 예측 블록 내 제2 예측 샘플들을 블렌딩하여 최종 예측 샘플이 유도되는 것을 특징으로 하는, 영상 부호화 방법에 의해 생성된 비트스트림을 저장하는 컴퓨터로 판독 가능한 기록 매체.
Obtaining a first prediction block based on first prediction information for the first prediction unit in the current block;
Obtaining a second prediction block based on second prediction information for a second prediction unit in the current block; and
Comprising: obtaining a final prediction block for the current block based on the first prediction block and the second prediction block,
In a blending area formed around the boundary between the first prediction unit and the second prediction unit in the current block, first prediction samples in the first prediction block and second prediction samples in the second prediction block A computer-readable recording medium for storing a bitstream generated by an image encoding method, characterized in that the final prediction sample is derived by blending the bitstream.
KR1020230106471A 2022-08-17 2023-08-14 Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method KR20240024755A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20220102792 2022-08-17
KR1020220102792 2022-08-17

Publications (1)

Publication Number Publication Date
KR20240024755A true KR20240024755A (en) 2024-02-26

Family

ID=90058259

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230106471A KR20240024755A (en) 2022-08-17 2023-08-14 Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method

Country Status (1)

Country Link
KR (1) KR20240024755A (en)

Similar Documents

Publication Publication Date Title
KR102608847B1 (en) Method for encoding/decoidng video signal and apparatus therefor
KR102416257B1 (en) Method and apparatus for processing a video signal
KR102383104B1 (en) Method and apparatus for processing a video signal
KR102424419B1 (en) Method and apparatus for processing a video signal
KR20240023059A (en) Video signal encoding/decoding method and device therefor
KR102617439B1 (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200063092A (en) Method for encodign/decodign video signal and apparatus therefor
KR102424420B1 (en) Method and apparatus for processing a video signal
KR20200041810A (en) Method for encodign/decodign video signal and apparatus therefor
KR102435000B1 (en) Method and apparatus for processing a video signal
KR102619997B1 (en) Method for encodign/decodign video signal and apparatus therefor
KR102597461B1 (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200078391A (en) Method for encodign/decodign video signal and apparatus therefor
KR20210123950A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20240024755A (en) Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method
KR20230063314A (en) Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method
KR20230063322A (en) Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method
KR20220134476A (en) Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method
KR20210103763A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210111602A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210103731A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210078768A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210078773A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210121528A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210118541A (en) Video signal encoding method and apparatus and video decoding method and apparatus