KR20230063314A - 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
KR20230063314A
KR20230063314A KR1020220137670A KR20220137670A KR20230063314A KR 20230063314 A KR20230063314 A KR 20230063314A KR 1020220137670 A KR1020220137670 A KR 1020220137670A KR 20220137670 A KR20220137670 A KR 20220137670A KR 20230063314 A KR20230063314 A KR 20230063314A
Authority
KR
South Korea
Prior art keywords
prediction unit
prediction
block
merge
current block
Prior art date
Application number
KR1020220137670A
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 KR20230063314A publication Critical patent/KR20230063314A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • 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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • 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/174Methods 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 slice, e.g. a line of blocks or a group of blocks
    • 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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Abstract

본 개시에 따른 영상 복호화 방법은, 현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계, 상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계, 상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계, 및 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 움직임 정보를 획득하는 단계는, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함할 수 있다. An image decoding method according to the present disclosure includes determining whether Geometry Partitioning with Merge mode (GPM) is applied to a current block, and when it is determined that the GPM is applied to the current block, a partition type for the current block. Determining, obtaining motion information of each of the first prediction unit and the second prediction unit in the current block, and based on the motion information of each of the first prediction unit and the second prediction unit, the current block Obtaining a prediction block for . In this case, the obtaining of the motion information may include determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit.

Figure P1020220137670
Figure P1020220137670

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 a bitstream generated based thereon

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

디스플레이 패널이 점점 더 대형화되는 추세에 따라 점점 더 높은 화질의 비디오 서비스가 요구되고 있다. 고화질 비디오 서비스의 가장 큰 문제는 데이터량이 크게 증가하는 것이며, 이러한 문제를 해결하기 위해, 비디오 압축율을 향상시키기 위한 연구가 활발하게 진행되고 있다. 대표적인 예로, 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 larger and larger, higher quality video services are increasingly required. The biggest problem of high-definition video service is the large increase in the amount of data, and in order to solve this problem, research to improve video compression rate is being actively conducted. 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 a Joint Collaborative Team on Video Coding (JCT-VC). JCT-VC proposed HEVC (High Efficiency Video Coding), which is a video compression standard having compression performance about twice that 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 of predicting a block based on a merge mode involving geometric segmentation in encoding/decoding a video signal.

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

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

본 개시에 따른 영상 복호화 방법은, 현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계, 상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계, 상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계, 및 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 움직임 정보를 획득하는 단계는, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함할 수 있다. An image decoding method according to the present disclosure includes determining whether Geometry Partitioning with Merge mode (GPM) is applied to a current block, and when it is determined that the GPM is applied to the current block, a partition type for the current block. Determining, obtaining motion information of each of the first prediction unit and the second prediction unit in the current block, and based on the motion information of each of the first prediction unit and the second prediction unit, the current block Obtaining a prediction block for . In this case, the obtaining of the motion information may include determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit.

본 개시에 따른 영상 부호화 방법은, 현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계, 상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계, 상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계, 및 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함한다. 이때, 상기 움직임 정보를 획득하는 단계는, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함할 수 있다. An image encoding method according to the present disclosure includes determining whether Geometry Partitioning with Merge mode (GPM) is applied to a current block, and when it is determined that the GPM is applied to the current block, a partition type for the current block. Determining, obtaining motion information of each of the first prediction unit and the second prediction unit in the current block, and based on the motion information of each of the first prediction unit and the second prediction unit, the current block Obtaining a prediction block for . In this case, the obtaining of the motion information may include determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 움직임 정보를 획득하는 단계는, 제1 머지 인덱스에 기초하여, 상기 제1 예측 유닛에 대한 제1 머지 후보를 선택하는 단계, 및 제2 머지 인덱스에 기초하여 상기 제2 예측 유닛에 대한 제2 머지 후보를 선택하는 단계를 포함할 수 있다.In the method for encoding/decoding a video signal according to the present disclosure, the obtaining of the motion information may include selecting a first merge candidate for the first prediction unit based on a first merge index; The method may include selecting a second merge candidate for the second prediction unit based on the index.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛에 상기 MMVD가 적용되는지 여부는, 상기 제1 머지 후보의 인덱스를 문턱값과 비교한 결과를 기초로 결정되고, 상기 제2 예측 유닛에 상기 MMVD가 적용되는지 여부는, 상기 제2 머지 후보의 인덱스를 문턱값과 비교한 결과를 기초로 결정될 수 있다.In the video signal encoding/decoding method according to the present disclosure, whether the MMVD is applied to the first prediction unit is determined based on a result of comparing the index of the first merge candidate with a threshold value, and the second Whether or not the MMVD is applied to the prediction unit may be determined based on a result of comparing the index of the second merge candidate with a threshold value.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 머지 인덱스는, 비트스트림을 통해 시그날링되는 한편, 상기 제2 머지 인덱스는, 상기 제1 예측 유닛 및 상기 제2 예측 유닛에 모두 상기 MMVD가 적용되는지 여부에 기초하여 선택적으로 시그날링될 수 있다. In the video signal encoding/decoding method according to the present disclosure, the first merge index is signaled through a bitstream, while the second merge index is applied to both the first prediction unit and the second prediction unit. It may be selectively signaled based on whether MMVD is applied.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제2 머지 인덱스의 시그날링이 생략되는 경우, 디폴트 값 또는 상기 제1 머지 인덱스에서 오프셋을 가산 또는 감산한 값이 상기 제2 머지 인덱스로 추론될 수 있다.In the video signal encoding/decoding method according to the present disclosure, when the signaling of the second merge index is omitted, a default value or a value obtained by adding or subtracting an offset from the first merge index is inferred as the second merge index It can be.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛 및 상기 제2 예측 유닛에 모두 상기 MMVD가 적용되는 경우, 상기 제2 머지 인덱스의 시그날링이 생략되고, 상기 제2 머지 후보는, 상기 제1 머지 후보와 동일하게 설정될 수 있다. In the video signal encoding/decoding method according to the present disclosure, when the MMVD is applied to both the first prediction unit and the second prediction unit, the signaling of the second merge index is omitted, and the second merge candidate may be set identically to the first merge candidate.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 머지 후보의 인덱스와 상기 제2 머지 후보의 인덱스의 비교 결과에 따라, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 중 하나에 상기 MMVD가 적용될 수 있다.In the video signal encoding/decoding method according to the present disclosure, the MMVD is assigned to one of the first prediction unit and the second prediction unit according to a comparison result of the index of the first merge candidate and the index of the second merge candidate. may be applied.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 머지 후보의 인덱스가 상기 제2 머지 후보의 인덱스보다 작은 경우, 상기 제1 예측 유닛에 상기 MMVD가 적용되고, 상기 제2 머지 후보의 인덱스가 상기 제1 머지 후보의 인덱스보다 작은 경우, 상기 제2 예측 유닛에 상기 MMVD가 적용될 수 있다.In the video signal encoding/decoding method according to the present disclosure, when the index of the first merge candidate is smaller than the index of the second merge candidate, the MMVD is applied to the first prediction unit, and the second merge candidate When the index is smaller than the index of the first merge candidate, the MMVD may be applied to the second prediction unit.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛에 MMVD가 적용되는 경우와 그렇지 않은 경우에 있어서, 상기 제1 머지 인덱스가 지시할 수 있는 머지 후보들의 개수는 상이할 수 있다. In the video signal encoding/decoding method according to the present disclosure, the number of merge candidates indicated by the first merge index may be different between a case where MMVD is applied to the first prediction unit and a case where MMVD is not applied. .

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 예측 유닛에 MMVD가 적용되는 경우, 상기 제1 예측 유닛의 움직임 벡터는, 상기 제1 머지 후보의 움직임 벡터에 제1 오프셋 벡터를 가산하여 유도되고, 상기 제2 예측 유닛에 MMVD가 적용되는 경우, 상기 제2 예측 유닛의 움직임 벡터는, 상기 제1 머지 후보의 움직임 벡터에 제2 오프셋 벡터를 가산하여 유도되고, 상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터는, 별개의 인덱스 정보를 기반으로 결정될 수 있다.In the video signal encoding/decoding method according to the present disclosure, when MMVD is applied to the first prediction unit, a motion vector of the first prediction unit is obtained by adding a first offset vector to a motion vector of the first merge candidate , and when MMVD is applied to the second prediction unit, the motion vector of the second prediction unit is derived by adding a second offset vector to the motion vector of the first merge candidate, and the first offset vector And the second offset vector may be determined based on separate index information.

본 개시에 따른 비디오 신호 부호화/복호화 방법에 있어서, 상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터가 동일한 경우, 상기 제1 머지 후보는 상기 제2 머지 후보와 상이하고, 상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터가 상이한 경우, 상기 제1 머지 후보와 상기 제2 머지 후보는 동일할 수 있다. In the video signal encoding/decoding method according to the present disclosure, when the first offset vector and the second offset vector are the same, the first merge candidate is different from the second merge candidate, and the first offset vector and the second merge candidate are different. When the second offset vectors are different, the first merge candidate and the second merge candidate may be the same.

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

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

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

본 개시에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.Effects obtainable in the present disclosure are not limited to the effects mentioned above, and other effects not mentioned may 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은 본 개시의 일 실시예에 따른, 인트라 예측 방법의 흐름도이다.
도 11은 인트라 예측 모드들을 나타낸 도면이다.
도 12은 현재 블록의 인트라 예측 모드를 유도하기 위해 이용되는 이웃 블록들의 위치를 나타낸 것이다.
1 is a block diagram of an image encoder (encoder) according to an embodiment of the present disclosure.
2 is a block diagram of an image decoder (decoder) according to an embodiment of the present disclosure.
3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
4 is a diagram illustrating various division types of a coding block.
5 is a diagram illustrating a splitting aspect of a coding tree unit.
6 is a flowchart of an inter prediction method according to an embodiment of the present disclosure.
7 is a flowchart of a process of deriving motion information of a current block under merge mode.
8 is an exemplary diagram illustrating merge candidate blocks.
9 is a diagram illustrating types of dividing lines dividing a coding block.
10 is a flowchart of an intra prediction method according to an embodiment of the present disclosure.
11 is a diagram illustrating intra prediction modes.
12 shows locations of neighboring blocks used to derive an intra prediction mode of a current block.

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

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

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

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

도 1은 본 개시의 일 실시예에 따른 영상 부호화기(인코더기)의 블록도이다.1 is a block diagram of an image 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 , an image encoding apparatus 100 includes a picture division unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, 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 made of separate hardware or a single software component. That is, each component is listed and included as each component for convenience of explanation, and at least two components 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 separated embodiments of components are also included in the scope of the present disclosure unless departing from the essence of the present disclosure.

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

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

예를 들어, 하나의 픽쳐는 복수개의 부호화 단위로 분할될 수 있다. 픽쳐에서 부호화 단위를 분할하기 위해서는 쿼드 트리 구조(Quad Tree Structure)와 같은 재귀적인 트리 구조를 사용할 수 있는데 하나의 영상 또는 최대 크기 부호화 단위(largest coding unit)를 루트로 하여 다른 부호화 단위로 분할되는 부호화 유닛은 분할된 부호화 단위의 개수만큼의 자식 노드를 가지고 분할될 수 있다. 일정한 제한에 따라 더 이상 분할되지 않는 부호화 단위는 리프 노드가 된다. 즉, 하나의 코딩 유닛에 대하여 정방형 분할만이 가능하다고 가정하는 경우, 하나의 부호화 단위는 최대 4개의 다른 부호화 단위로 분할될 수 있다.For example, one picture may be divided into a plurality of coding units. In order to divide coding units in a picture, a recursive tree structure such as a quad tree structure can be used. Coding that is divided into different coding units with one image or largest coding unit as the root A unit may be divided with as many child nodes as the number of divided coding units. A coding unit that is not further divided according to a certain limit becomes a leaf node. That is, when it is assumed 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 an embodiment of the present disclosure, a coding unit may be used as a unit for performing encoding or a unit for performing decoding.

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

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

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

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

인트라 예측부(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 a block adjacent to the current prediction unit is a block on which inter prediction is performed, and the reference pixel is a pixel on which inter prediction is performed, the reference pixel of the block on which intra prediction is performed surrounding the reference pixel included in the block on which inter prediction is performed information can be used instead. That is, when a reference pixel is unavailable, information on the unavailable reference pixel may be replaced with at least one reference pixel among available reference pixels.

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

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

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

또한, 예측부(120, 125)에서 생성된 예측 단위를 기초로 예측을 수행한 예측 단위와 예측 단위의 원본 블록과 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력될 수 있다. In addition, a residual block may be generated that includes residual information that is a difference between a prediction unit performed prediction based on the prediction unit generated by the prediction units 120 and 125 and an original block of the prediction unit. The generated residual block may be input to the transform 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 original block and the residual block including the residual information of the prediction unit generated through the predictor units 120 and 125 into DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform). method can be used to transform. Here, the DCT conversion core includes at least one of DCT2 and DCT8, and the DST conversion core includes DST7. Whether to apply DCT or DST to transform the residual block may be determined based on intra prediction mode information of a prediction unit used to generate the residual block. Transformation on the residual block may be skipped. A flag representing whether or not to skip transformation of a residual block may be encoded. Transform skipping may be allowed for residual blocks whose size is less than or equal to the threshold, luma components, or chroma components under the 4:4:4 format.

양자화부(135)는 변환부(130)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(135)에서 산출된 값은 역양자화부(140)와 재정렬부(160)에 제공될 수 있다.The quantization unit 135 may quantize the values converted to the frequency domain by the transform unit 130 . A quantization coefficient may change according to a block or an importance of an image. The value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160 .

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

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

엔트로피 부호화부(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 encoding may use various encoding methods such as, for example, 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 residual value coefficient information and block type information of a coding unit from the reordering unit 160 and the prediction units 120 and 125, prediction mode information, division unit information, prediction unit information and transmission unit information, motion 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 transform unit 145 inversely quantize the values quantized by the quantization unit 135 and inverse transform the values transformed by the transform unit 130 . The residual generated by the inverse quantization unit 140 and the inverse transform unit 145 is combined with the prediction unit predicted through the motion estimation unit, the motion compensation unit, and the intra prediction unit included in the prediction units 120 and 125 and restored. You can create a Reconstructed Block.

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

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

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

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

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

도 2는 본 개시의 일 실시예에 따른 영상 복호화기(디코더기)의 블록도이다.2 is a block diagram of an image 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 decoding unit 210, a rearrangement unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230 and 235, a filter unit ( 240), memory 245 may be included.

영상 부호화기에서 영상 비트스트림이 입력된 경우, 입력된 비트스트림은 영상 부호화기와 반대의 절차로 복호화될 수 있다.When a video bitstream is input from the video encoder, the input bitstream may be decoded by 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 by a procedure opposite to that performed by the entropy encoding unit of the image encoder. For example, various methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied corresponding to the method performed by the image encoder.

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

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

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

역변환부(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 transform unit on the quantization result performed by the video encoder. Here, the DCT conversion core may include at least one of DCT2 or DCT8, and the DST conversion core may include DST7. Alternatively, when transform is skipped in the video encoder, the inverse transform unit 225 may also not perform inverse transform. Inverse transformation may be performed based on the transmission unit determined by the video encoder. In the inverse transform unit 225 of the video decoder, a transform technique (eg, DCT or DST) may be selectively performed according to a plurality of pieces of information such as a prediction method, a size of a current block, and a prediction direction.

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

전술한 바와 같이 영상 부호화기에서의 동작과 동일하게 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행하지만, 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수도 있다.As described above, when intra prediction is performed in the same way as the operation in the video encoder, when the size of the prediction unit and the size of the transformation unit are the same, the pixel existing on the left, the pixel existing on the upper left, and the pixel existing on the upper side of the prediction unit are the same. Intra prediction is performed on a prediction unit based on a pixel to perform intra prediction, but when performing intra prediction, when 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. can In addition, intra prediction using NxN division may be used only for the smallest coding unit.

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

인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), 모션 벡터 예측 모드(AMVP Mode), 인트라 블록 카피 모드 중 어떠한 방법인지 여부를 판단할 수 있다.In order to perform inter prediction, the motion prediction method of the prediction unit included in the corresponding coding unit based on the coding unit is skip mode, merge mode, motion vector prediction mode (AMVP mode), 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. When the prediction unit is a prediction unit that has undergone intra prediction, intra prediction may be performed based on intra prediction mode information of the prediction unit provided by the video encoder. The intra predictor 235 may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolator, and a DC filter. The AIS filter is a part that performs filtering on reference pixels of the current block, and can be applied by determining whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering may be performed on reference pixels of the current block using the prediction mode of the prediction unit and AIS filter information provided by the image encoder. When the prediction mode of the current block is a mode in which AIS filtering is not performed, AIS filter may not be applied.

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

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

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

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

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

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

도 3은 본 개시의 일 실시예에 따른 기본 코딩 트리 유닛을 도시한 도면이다.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은 하나의 픽처가 복수개의 코딩 트리 유닛으로 분할된 예를 나타낸 것이다.A coding block of the maximum size may be defined as a coding tree block. One picture is divided into a plurality of Coding Tree Units (CTUs). A coding tree unit is a coding unit having the largest size and may be referred to as a largest coding unit (LCU). 3 illustrates an example in which one picture is divided into a plurality of coding tree units.

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

일 예로, 시퀀스 내 전체 픽처에 대한 코딩 트리 유닛의 크기가 128x128로 설정될 수 있다. 또는, 픽처 레벨에서 128x128 또는 256x256 중 어느 하나를 코딩 트리 유닛의 크기로 결정할 수 있다. 일 예로, 제1 픽처에서는 코딩 트리 유닛의 크기가 128x128로 설정되고, 제2 픽처에서는 코딩 트리 유닛의 크기가 256x256으로 설정될 수 있다. For example, the size of a coding tree unit for all pictures in a sequence may be set to 128x128. Alternatively, either 128x128 or 256x256 may 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)을 포함할 수 있다. 코딩 블록에 대해, 인트라 예측, 인터 예측, 현재 픽처 참조 또는 복합 예측 중 적어도 하나의 예측 부호화 모드를 이용하여, 코딩 블록에 대한 예측 블록을 생성할 수 있다. Coding tree units may be split to generate coding blocks. 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 coding mode may be determined for each coding block. Here, the prediction encoding mode indicates a method of generating a prediction image. For example, the prediction coding mode includes intra prediction (Intra Prediction), inter prediction (Inter Prediction), current picture referencing (Current Picture Referencing, CPR, or Intra Block Copy (IBC)). ) or combined prediction. For the coding block, a prediction block for the coding block may be generated using at least one prediction coding mode of intra prediction, inter prediction, current picture reference, or composite prediction.

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

현재 픽처 참조는 현재 픽처를 참조 픽처로 설정하고, 현재 픽처 내 이미 부호화/복호화가 완료된 영역으로부터 현재 블록의 예측 블록을 획득하기 위한 것이다. 여기서, 현재 픽처는 현재 블록을 포함하는 픽처를 의미한다. 현재 블록에 현재 픽처 참조가 적용되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 상기 정보는 1비트의 플래그일 수 있다. 상기 플래그가 참인 경우, 현재 블록의 예측 부호화 모드는 현재 픽처 참조로 결정되고, 상기 플래그가 거짓인 경우, 현재 블록의 예측 모드는 인터 예측으로 결정될 수 있다.Current picture reference is for setting a current picture as a reference picture and obtaining a prediction block of a current block from an already encoded/decoded region within the current picture. Here, the current picture means a picture including the current block. Information indicating whether current picture reference is applied to the current block may be signaled through a bitstream. For 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 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 indicates the current picture, the prediction encoding mode of the current block may be determined as the current picture reference. When the reference picture index indicates a picture other than the current picture, the prediction coding mode of the current block may be determined as inter prediction. That is, current picture reference is a prediction method using information of a coded/decoded region within the current picture, and inter prediction is a prediction method using information of another coded/decoded picture.

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

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

코딩 블록은 쿼드 트리 분할, 바이너리 트리 분할 또는 트리플 트리 분할을 기초로 복수의 코딩 블록들로 분할될 수 있다. 분할된 코딩 블록도 다시 쿼드 트리 분할, 바이터리 트리 분할 또는 트리플 트리 분할을 기초로 다시 복수의 코딩 블록들로 분할될 수 있다.A coding block may be partitioned 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 further divided into a plurality of coding blocks based on quad tree partitioning, bitary tree partitioning, or triple tree partitioning.

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

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

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

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

또는, 분할 기법들 각각에 대한 최대 분할 깊이를 개별적으로 결정할 수 있다. 일 예로, 쿼드 트리 분할이 허용되는 최대 분할 깊이는 바이너리 트리 분할 및/또는 트리플 트리 분할이 허용되는 최대 분할 깊이와 상이할 수 있다.Alternatively, the maximum segmentation depth for each of the segmentation techniques may be individually determined. For 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 a division type and a division depth of the current block through a bitstream. The decoder may determine the splitting type and splitting depth of the coding tree unit based on the information parsed from the bitstream.

도 5는 코딩 트리 유닛의 분할 양상을 예시한 도면이다.5 is a diagram illustrating a splitting 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 referred to as lower coding blocks. When the depth of division of a coding block is k, the depth of division of lower coding blocks is set to k+1.

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

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

코딩 블록의 분할 형태를 결정하기 위해, 코딩 블록이 분할되는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그 'split_cu_flag'로, 상기 플래그가 참인 것은, 머리 트리 분할 기법에 의해 코딩 블록이 분할됨을 나타낸다.Information indicating whether the coding block is divided may be signaled through a bitstream in order to determine the division type of the coding block. The information is a 1-bit flag 'split_cu_flag', and when 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개의 블록들로 분할될 수 있다.When split_cu_flag is true, information indicating whether a coding block is quad-tree split may be signaled through a bitstream. The information is a 1-bit flag split_qt_flag, and if 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 , it is illustrated that 4 coding blocks having a split depth of 1 are generated as a coding tree unit is quad-tree split. Also, it is shown that quad tree splitting is applied again to the first and fourth coding blocks among four coding blocks generated as a result of quad tree splitting. As a result, 4 coding blocks with a split depth of 2 can be generated.

또한, 분할 깊이가 2인 코딩 블록에 다시 쿼드 트리 분할을 적용함으로써, 분할 깊이가 3인 코딩 블록을 생성할 수 있다. In addition, by applying quad tree partitioning to a coding block having a split depth of 2, a coding block having a split depth of 3 may be generated.

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

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

인터 예측은 이전 픽처의 정보를 이용하여, 현재 블록을 예측하는 예측 부호화 모드이다. 일 예로, 이전 픽처 내 현재 블록과 동일한 위치의 블록(이하, 콜로케이티드 블록, Collocated block)을 현재 블록의 예측 블록으로 설정할 수 있다. 이하, 현재 블록과 동일한 위치의 블록을 기초로 생성된 예측 블록을 콜로케이티드 예측 블록(Collocated Prediction Block)이라 호칭하기로 한다. Inter prediction is a prediction coding mode in which a current block is predicted using information of a previous picture. For example, a block at the same position as the current block in the previous picture (hereinafter referred to as a collocated block) may be set as a 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 existing in the previous picture moves to a different location in the current picture, the current block can be effectively predicted using the motion 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 may be generated in consideration of motion 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 may be generated by differentiating a prediction block from the current block. At this time, if the motion of the object exists, by using the motion prediction block instead of the collocated prediction block, the energy of the residual block can be reduced and, accordingly, the compression performance of the residual block can be improved.

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

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

도 6은 본 개시의 일 실시예에 따른 인터 예측 방법의 흐름도이다.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 an inter prediction mode of a current block (S601), obtaining motion information of a current block according to the determined inter prediction mode (S602), and based on the obtained motion information. and performing motion compensation prediction on the current block (S603).

여기서, 인터 예측 모드는 현재 블록의 움직임 정보를 결정하기 위한 다양한 기법들을 나타내는 것으로, 병진(Translation) 움직임 정보를 이용하는 인터 예측 모드와, 어파인(Affine) 움직임 정보를 이용하는 인터 예측 모드를 포함할 수 있다. 일 예로, 병진 움직임 정보를 이용하는 인터 예측 모드는, 머지 모드 및 모션 벡터 예측 모드를 포함하고, 어파인 움직임 정보를 이용하는 인터 예측 모드는 어파인 머지 모드 및 어파인 모션 벡터 예측 모드를 포함할 수 있다. 현재 블록의 움직임 정보는, 인터 예측 모드에 따라, 현재 블록에 이웃하는 이웃 블록 또는 비트스트림으로부터 파싱되는 정보를 기초로 결정될 수 있다.Here, the inter prediction mode indicates various techniques for determining the 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. For example, an inter prediction mode using translational motion information may include a merge mode and a motion vector prediction mode, and an inter prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. . Motion information of the current block may be determined based on information parsed from a neighboring block or a bitstream neighboring the current block according to an 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 bi-directional weight index. In addition, motion information may be individually induced/set for each of the L0 and L1 directions.

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

또한, 움직임 벡터의 정밀도를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는, 시퀀스 단위, 슬라이스 단위 또는 블록 단위로 결정될 수 있다. 움직임 벡터 정밀도는 옥토펠, 쿼터펠, 하프펠, 정수펠, 2 정수펠 또는 4 정수펠로 설정될 수 있다. 또는, 인터 예측 모드에 따라, 현재 블록의 움직임 벡터 정밀도가 결정되거나, 이용 가능한 움직임 벡터 정밀도 후보의 개수/종류가 적응적으로 결정될 수 있다. Also, information for determining the precision of a motion vector may be signaled through a bitstream. The information may be determined in units of sequences, slices, or blocks. Motion vector precision can be set to octopels, quarter pels, half pels, integer pels, 2 integer pels, or 4 integer pels. Alternatively, according to 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 of the current block. Here, the other block may be a block encoded/decoded by inter prediction prior to the current block. Setting motion information of the current block to be the same as motion information of another block may be defined as a merge mode. In addition, setting a motion vector of another block as a predicted value of a motion vector of a current block may be defined as a motion vector prediction mode.

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

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

이때, 머지 후보를 유도하는데 이용되는 블록을 '머지 후보 블록'으로 호칭할 수 있다. 머지 후보 블록은, 현재 블록에 인접하는 블록(인접 머지 후보 블록) 또는 현재 블록에 인접하지 않는 블록(비인접 머지 후보 블록) 중 적어도 하나를 포함할 수 있다. 머지 후보 블록의 움직임 정보를 기초로, 머지 후보의 움직임 정보가 설정될 수 있다. 일 예로, 머지 후보의 움직임 정보는 머지 후보 블록의 움직임 정보와 동일하게 설정될 수 있다. 또는, 머지 후보 블록의 L0 움직임 정보 또는 L1 움직임 정보 중 어느 하나만을 머지 후보의 움직임 정보로 설정할 수 있다. 또는, 머지 후보 블록의 움직임 벡터를 스케일링하여, 머지 후보의 움직임 벡터를 유도할 수도 있다.In this case, a block used to derive a merge candidate may be referred to as 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 not adjacent to the current block (non-adjacent merge candidate block). Motion information of a merge candidate may be set based on motion information of a merge candidate block. For example, motion information of a merge candidate may be set to be the same as motion information of a merge candidate block. Alternatively, only one of the L0 motion information and the L1 motion information of the merge candidate block may 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은 머지 후보 블록들을 예시한 예시도이다. 8 is an exemplary diagram illustrating merge candidate blocks.

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

인접 머지 후보 블록은, 현재 블록의 상단에 이웃하는 행 또는 현재 블록의 좌측에 인접하는 열에 속하는 기준 위치 샘플을 포함한다. 일 예로, 도 8의 예에서, 인덱스 1 내지 인덱스 5가 표기된 기준 위치 샘플들을 포함하는 블록들 각각이 인접 머지 후보 블록으로 설정될 수 있다. The adjacent merge candidate block includes reference position samples 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 indices 1 to 5 may be set as an adjacent merge candidate block.

비인접 머지 후보 블록은 현재 블록의 상단에 이웃하지 않는 행 또는 현재 블로그이 좌측에 이웃하지 않는 열에 속하는 기준 위치 샘플을 포함한다. 일 예로, 도 8의 예에서, 인덱스 6 내지 인덱스 23이 명기된 기준 위치 샘플들을 포함하는 블록들 각각이 비인접 머지 후보 블록으로 설정될 수 있다.The non-adjacent merge candidate block includes a reference position sample belonging to a row not adjacent to the top of the current block or a column 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 indexes 6 to 23 may be set as non-adjacent merge candidate blocks.

인접 머지 후보 블록들 및/또는 비인접 머지 후보 블록들의 위치가 부호화기 및 복호화기에 기 정의되어 있을 수 있다. 일 예로, 도 8에 도시된 예에서와 같이, 현재 블록의 경계로부터 CTU 경계 사이, 소정의 간격 마다 기준 위치 샘플을 설정할 수 있다. 일 예로, x축 좌표 또는 y축 좌표 중 적어도 하나가, 인접 머지 후보 블록(즉, 현재 블록에 이웃하는 기준 위치 샘플)으로부터, 2n*N 만큼 이격된 비인접 블록이 비인접 머지 후보 블록으로 정의될 수 있다. 여기서, n은, 1, 2, 또는 3과 같은 자연수일 수 있다. 일 예로, 현재 블록의 좌상단 샘플의 좌표가 (0,0)이고, 인접 머지 후보 블록이 (-1, -1) 위치의 기준 위치 샘플을 포함하는 경우, (-1-4N, -1-4N) 위치의 기준 위치 샘플을 포함하는 블록들이 비인접 머지 후보 블록들로 정의될 수 있다. 이때, N의 최대값은, 현재 블록과 최대 CTU 경계 사이의 거리 또는 부호화기 및 복호화기에서 기 정의된 값 중 적어도 하나에 의해 결정될 수 있다. Positions of adjacent merge candidate blocks and/or non-adjacent merge candidate blocks may be previously defined in an encoder and a decoder. For example, as in the example shown in FIG. 8 , reference position samples may be set at predetermined intervals between the boundary of the current block and the boundary of the CTU. For example, at least one of the x-axis coordinate and the y-axis coordinate is a non-adjacent block spaced apart by 2 n * N from an adjacent merge candidate block (ie, a reference position sample adjacent to the current block) as a non-adjacent merge candidate block. can be defined Here, n may be a natural number such as 1, 2, or 3. For example, when the coordinates of the top-left sample of the current block are (0,0) and the adjacent merge candidate block includes the reference position sample at the (-1, -1) position, (-1-4N, -1-4N ) may be defined as non-adjacent merge candidate blocks. In this case, the maximum value of N may be determined by at least one of a 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 , reference position samples may be set outside the boundary of the CTU to which the current block belongs (indexes 19 to 23 of 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, in order to prevent the line buffer from indiscriminately increasing, samples not adjacent to the CTU boundary may not be used as reference position samples. Accordingly, a non-adjacent block adjacent to the CTU boundary can be used as a merge candidate block, but a non-adjacent block not adjacent to the CTU boundary cannot be used as a merge candidate block.

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

머지 후보 리스트 내 머지 후보들의 인덱스는 소정 순서에 따라 할당될 수 있다. 일 예로, 좌측 이웃 블록으로부터 유도된 머지 후보, 상단 이웃 블록으로부터 유도된 머지 후보, 우측 상단 이웃 블록으로부터 유도된 머지 후보, 좌측 하단 이웃 블록으로부터 유도된 머지 후보, 좌측 상단 이웃 블록으로부터 유도된 머지 후보 및 시간적 이웃 블록으로부터 유도된 머지 후보 순으로 인덱스를 부여할 수 있다. 또는, 인접 머지 후보 블록들로부터 유도된 머지 후보들, 비인접 머지 후보 블록들로터 유도된 머지 후보들 및 시간적 이웃 블록으로부터 유도된 머지 후보 순으로 인덱스를 부여할 수 있다. Indexes of merge candidates in the merge candidate list may be allocated in a predetermined order. For example, a merge candidate derived from a left neighboring block, a merge candidate derived from an upper neighboring block, a merge candidate derived from an upper right neighboring block, a merge candidate derived from a lower left neighboring block, and a merge candidate derived from an upper left neighboring block. And indexes may be assigned in the order of merge candidates derived from temporal neighboring blocks. Alternatively, indexes may be assigned in the order of 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가 비트스트림을 통해 시그날링될 수 있다. When a plurality of merge candidates are included in the merge candidate list, at least one of the plurality of merge candidates may be selected (S703). Specifically, information for specifying one of a plurality of merge candidates may be signaled through a bitstream. For example, information merge_idx indicating an index of any one of 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 a basic unit for performing prediction. A method of performing prediction by dividing a coding block into a plurality of prediction units may be referred to as a geometric partition mode (GPM).

적어도 하나의 분할선을 이용하여 코딩 블록을 분할할 수 있다. 일 예로, 수직선, 수평선, 사선 또는 대각선 중 적어도 하나를 이용하여 코딩 블록을 분할할 수 있다. A coding block may 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는 코딩 블록을 분할하는 분할선들의 종류를 나타낸 도면이다.9 is a diagram illustrating types of dividing lines dividing a coding block.

코딩 블록을 분할하여 생성되는 예측 유닛들의 개수는, 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 below, it is assumed that a 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 a partition type of a coding block may be signaled through a bitstream. Specifically, at least one of the number of dividing lines dividing the coding block, the angle of the dividing line, or the position of the dividing line may be determined by the above information.

일 예로, 분할선의 각도를 나타내는 변수 angleIdx 및 분할선의 위치를 나타내는 변수 distanceIdx의 조합 후보들 중 하나를 지시하는 신택스 merge_gpm_partition_idx가 비트스트림을 통해 명시적으로 시그날링될 수 있다. For example, syntax merge_gpm_partition_idx indicating one of combination candidates of the variable angleIdx representing the angle of the dividing line and the variable distanceIdx representing the position of the dividing line may be explicitly signaled through a 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 representing a distance from the center of the coding block to the dividing line. According to the variable distanceIdx, the coding block may be divided based on a dividing line passing through the center of the coding block or the coding block may be divided based on a dividing line not passing through the center of the coding block.

표 1은 변수 angleIdx 및 변수 distanceIdx의 조합들 각각에 상이한 인덱스 값이 할당되는 예를 나타낸 것이다.Table 1 shows an example in which different index values are assigned to respective combinations 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 example, the syntax for determining the variable angleIdx representing the angle of the division line and the syntax for determining the variable distanceIdx representing the position of the division line may be separately signaled. Meanwhile, depending on the size and/or shape of a coding block, signaling of one of the two syntaxes may be omitted.

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

코딩 블록을 제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 may be derived. For example, based on the merge candidate list derived based on the position and size of the coding block, a merge candidate for each of the first prediction unit and the second prediction unit is selected, and the motion 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 indicating a merge candidate of the first prediction unit, eg, gpm_merge_idx0, and a second merge index, eg, gpm_merge_idx1, indicating a merge candidate of the second prediction unit may be signaled.

제1 예측 유닛의 머지 후보와 제2 예측 유닛의 머지 후보는 상이할 수 있다. 이에 따라, 제1 머지 인덱스에 의해 머지 후보가 선택되면, 상기 머지 후보들을 제외한 잔여 머지 후보들 중에서 제2 예측 유닛의 머지 후보를 선택할 수 있다. 즉, 제1 머지 인덱스에 의해 지시되는 머지 후보를 제외한 잔여 머지 후보들의 인덱스를 재할당한 뒤, 재할당된 인덱스를 갖는 머지 후보들 중 하나를 지시하도록 제2 머지 인덱스를 부호화할 수 있다. 일 예로, 재할당의 결과, 제1 머지 인덱스에 의해 지시되는 머지 후보보다 인덱스가 큰 머지 후보들에는, 1이 감소된 인덱스가 배정될 수 있다. A merge candidate of the first prediction unit and a merge candidate of the second prediction unit may be different. Accordingly, when a merge candidate is selected by the first merge index, a merge candidate of the second prediction unit may be selected from among the remaining merge candidates excluding the merge candidates. That is, after reallocating indexes of the remaining merge candidates excluding the merge candidate indicated by the first merge index, the second merge index may be encoded to indicate one of the merge candidates having the reallocated index. As an example, as a result of reassignment, an index decreased by 1 may be assigned to merge candidates having a greater index 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, values of the first merge index and the second merge index may be compared to select a merge candidate of the second prediction unit. For example, when the value of the second merge index gpm_merge_idx1 is smaller than the value of 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, when 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 having an index obtained by adding 1 to the second merge index gpm_merge_idx1 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. can

이후, 제1 예측 유닛의 움직임 정보를 기초로 제1 예측 블록을 획득하고, 제2 예측 유닛의 움직임 정보를 기초로 제2 예측 블록을 획득할 수 있다. 이후, 제1 예측 블록 및 제2 예측 블록의 가중합 연산을 통해, 코딩 블록에 대한 최종 예측 블록을 획득할 수 있다. 이때, 제1 예측 블록에 포함된 예측 샘플들에 적용되는 가중치 및 제2 예측 블록에 포함된 예측 샘플들에 적용되는 가중치는, 최종 예측 샘플의 위치에 따라 적응적으로 결정될 수 있다. Thereafter, a first prediction block may be obtained based on motion information of the first prediction unit, and a second prediction block may be obtained based on motion information of the second prediction unit. Thereafter, a final prediction block for the coding block may be obtained through a weighted sum operation of the first prediction block and the second prediction block. In this case, the weights applied to the prediction samples included in the first prediction block and the weights 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 it is, the motion information of the merge candidate may be modified and the corrected motion information may be used. For example, when a merge candidate for the current block is selected, a motion vector obtained by adding or subtracting an offset vector to the motion vector of the selected merge candidate may be set as the motion vector of the current block. As described above, modifying the motion vector of the merge candidate using the offset vector may be referred to as Merge mode with Motion Vector Difference (MMVD).

오프셋 벡터를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 구체적으로, 오프셋 벡터의 방향을 나타내는 신택스 mvd_direction_idx 및 오프셋 벡터의 크기를 나타내는 신택스 mvd_distance_idx 각각이 부호화되어 시그날링될 수 있다. Information for determining an 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 be coded 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을 기초로, 오프셋 벡터가 유도될 수 있다.When a direction candidate and a distance candidate are selected by 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 a value of a distance candidate selected by mvd_distance_idx, and MmvdSign represents a value of a 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, in deriving at least one of the motion information of the first prediction unit and the 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 may be derived by adding or subtracting the offset vector to the motion vector of the merge candidate.

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

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

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, syntax gpm_mmvd_flag0 indicates whether MMVD is applied to the first prediction unit. A value of 1 in the syntax gpm_mmvd_flag0 indicates that MMVD is applied to the first prediction unit. In this case, the motion vector of the first prediction unit may be derived by adding or subtracting the offset vector to the motion vector of the merge candidate. On the other hand, a value of 0 in the syntax gpm_mmvd_flag0 indicates that MMVD is not applied to the first prediction unit. In this case, the motion vector of the first prediction unit may be set equal to 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 예측 유닛의 움직임 벡터는, 머지 후보의 움직임 벡터와 동일하게 설정될 수 있다. Also, syntax gpm_mmvd_flag1 indicates whether MMVD is applied to the second prediction unit. A value of 1 in the syntax gpm_mmvd_flag1 indicates that MMVD is applied to the second prediction unit. In this case, the motion vector of the second prediction unit may be derived by adding or subtracting the offset vector to the motion vector of the merge candidate. On the other hand, a value of 0 in the syntax gpm_mmvd_flag1 indicates that MMVD is not applied to the second prediction unit. In this case, the motion vector of the second prediction unit may be set equal to the motion vector of the merge candidate.

표 4의 예와 달리, 코딩 블록 레벨에서 MMVD 적용 여부를 나타내는 1비트 플래그가 시그날링될 수도 있다. 일 예로, 코딩 블록 레벨에서, GPM 모드에 MMVD 모드가 결합 적용되는지 여부를 나타내는 신택스 gpm_mmvd_flag가 부호화되어 시그날링될 수 있다. Unlike the example of Table 4, a 1-bit flag indicating whether MMVD is applied may be signaled at the coding block level. For example, at the coding block level, a syntax gpm_mmvd_flag indicating whether the MMVD mode is combined and applied to 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 vectors of each of the first prediction unit and the second prediction unit may be set equal to the motion vectors of their respective merge candidates.

신택스 gpm_mmvd_flag의 값이 1인 것은, 제1 예측 유닛 또는 제2 예측 유닛 중 적어도 하나의 움직임 벡터를 유도함에 있어서, MMVD가 이용됨을 나타낸다. 이 경우, 제1 예측 유닛 및 제2 예측 유닛 각각에 MMVD가 적용되는지 여부를 나타내는 정보가 추가 부호화되어 시그날링될 수 있다. 일 예로, 상기 정보는, MMVD가 적용될 수 있는 복수 경우들 중 하나를 지시하는 인덱스일 수 있다. 일 예로, 제1 예측 유닛에만 MMVD가 적용되는 경우, 제2 예측 유닛에만 MMVD가 적용되는 경우 및 제1 예측 유닛 및 제2 예측 유닛 모두에 MMVD가 적용되는 경우 각각에 상이한 인덱스를 할당한 뒤, 이들 중 하나를 가리키는 정보를 부호화하여 시그날링할 수 있다. A value of 1 in the syntax gpm_mmvd_flag indicates that MMVD is used in deriving a motion vector of at least one of the first prediction unit and 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. For example, the information may be an index indicating one of a plurality of 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 indexes are assigned to each, Information indicating one of these may 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. In this case, 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가 적용되는지 여부를 결정할 수도 있다.Alternatively, when it is determined that MMVD is applied at the coding block level, the first prediction unit and the second prediction unit are respectively 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. It may be determined whether MMVD is applied to.

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

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

MMVD가 적용된 경우와 그렇지 않은 경우에 있어서, 예측 유닛이 선택할 수 있는 머지 후보들의 최대 개수가 상이하게 설정될 수 있다. In a case where MMVD is applied and a case where MMVD is not applied, the maximum number of merge candidates that can be selected by a prediction unit 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 the 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 two merge candidates having a small index among N merge candidates included in the merge candidate list may be selected for the first prediction unit.

위 제약 사항은, 제2 예측 유닛에 대해서도 동일하게 적용될 수 있다. The above constraints may 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. For 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. For example, the value of the second merge index may be inferred according to Equation 2 below.

Figure pat00002
Figure pat00002

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

일 예로, 제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와 같은 정수일 수 있다. For example, when MMVD is applied to the first prediction unit but 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 a bitstream. Can be explicitly signaled. In this case, a merge candidate having a default value or a value obtained by adding or subtracting an offset from the second merge index as an index may be used for the first prediction unit. Similarly, when 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, whereas the second merge index merge_gpm_idx1 is /decryption can be omitted. In this case, a merge candidate having a default value or a value obtained by adding or subtracting an offset from the first merge index as an index may 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 a prediction unit to which MMVD is applied, information for determining an offset vector may be additionally encoded/decoded. For example, when MMVD is applied to the first prediction unit, syntax gpm_mmvd_idx0 for determining a motion vector offset vector for the first prediction unit may be encoded/decoded. Similarly, when MMVD is applied to the second prediction unit, syntax gpm_mmvd_idx1 for determining a 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 from each other in at least one of a direction and a 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, eg, gpm_mmvd_direction_idxX and information indicating one of a plurality of distance candidates, eg, gpm_mmvd_distance_idxX, may be coded 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 (ie, merge_gpm_idx0) is signaled only for the first prediction unit, and the merge index (ie, merge_gpm_idx1) is added to 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 of the prediction units, a merge candidate of each of the prediction units may be selected. That is, as in the example of Table 5, after encoding/decoding the syntax gpm_mmvd_idxX representing 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도 부호화되어 시그날링될 수 있다. In this case, when 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 that of the first prediction unit may be selected for the second prediction unit. To this end, when the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same (ie, gpm_mmvd_idx0 and gpm_mmvd_idx1 are the same), in addition to the first merge index gpm_merge_idx0 for the first prediction unit, 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, when the offset vector for the first prediction unit and the offset vector for the second prediction unit are the same (ie, gpm_mmvd_idx0 and gpm_mmvd_idx1 are the same), encoding/decoding of the second merge index gpm_merge_idx1 for the second prediction unit is omitted. And, according to Equation 2 described above, a merge candidate of 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, it is exemplified that 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를 적용하지 않을 수 있다.In this case, information indicating whether MMVD is applied may be encoded and signaled only to a prediction unit using a merge candidate having an index smaller than the threshold. For example, when the index of the merge candidate selected for the first prediction unit is smaller than the threshold value, a flag gpm_mmvd_flag0 indicating whether MMVD is applied 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 equal to or greater than the threshold, encoding/decoding of the flag gpm_mmvd_flag0 for the first prediction unit may be omitted and MMVD may not be applied. Similarly, when the index of the merge candidate selected for the second prediction unit is smaller than the threshold value, a flag gpm_mmvd_flag1 indicating whether MMVD is applied 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 equal to or greater than the threshold, encoding/decoding of the flag gpm_mmvd_flag1 may be omitted and MMVD may not be applied to the second prediction unit.

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

이때, 제1 예측 유닛에 대한 오프셋 벡터 및 제2 예측 유닛에 대한 오프셋 벡터가 동일한 경우, 제1 예측 유닛의 머지 후보와 상이한 머지 후보가 제2 예측 유닛을 위해 선택될 수 있다. In this case, when 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 that of the first prediction unit may be selected for the second prediction unit.

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

인트라 예측 기법은 매트릭스(Matrix)에 기반한 인트라 예측 및 주변 복원 샘플과의 방향성을 고려한 일반 인트라 예측을 포함한다. 현재 블록의 인트라 예측 기법을 지시하는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그일 수 있다. 또는, 현재 블록의 위치, 크기, 형태 또는 이웃 블록의 인트라 예측 기법 중 적어도 하나에 기초하여, 현재 블록의 인트라 예측 기법을 결정할 수 있다. 일 예로, 현재 블록이 픽처 바운더리를 걸쳐 존재하는 경우, 현재 블록에는 매트릭트에 기반한 인트라 예측이 적용되지 않도록 설정될 수 있다. Intra prediction techniques include intra prediction based on a matrix and normal intra prediction considering directionality with neighboring reconstructed samples. Information indicating an 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 location, size, and shape of the current block, or intra prediction techniques of neighboring blocks. For example, if the current block exists across picture boundaries, matrix-based intra prediction may not be applied to the current block.

매트릭스에 기반한 인트라 예측은, 부호화기 및 복호화기에서 기 저장된 매트릭스와, 현재 블록 주변의 복원 샘플 사이의 행렬 곱에 기반하여, 현재 블록의 예측 블록을 획득하는 방법이다. 기 저장된 복수개의 매트릭스들 중 어느 하나를 특정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 복호화기는 상기 정보 및 현재 블록의 크기에 기초하여, 현재 블록의 인트라 예측을 위한 매트릭스를 결정할 수 있다.Matrix-based intra prediction is a method of obtaining a prediction block of a current block based on matrix multiplication between a matrix pre-stored in an encoder and a decoder and a reconstructed sample 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.

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

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

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

복수의 참조 샘플 라인들 중 현재 블록의 참조 샘플 라인을 식별하는 인덱스 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 현재 블록의 참조 샘플 라인을 특정하기 위한 인덱스 정보 intra_luma_ref_idx가 비트스트림을 통해 시그날링될 수 있다. 상기 인덱스 정보는 코딩 블록 단위로 시그날링될 수 있다. Index information identifying a reference sample line of a current block among a plurality of reference sample lines may be signaled through a bitstream. For 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 in units of coding blocks.

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

표 6은 후보 참조 샘플 라인들 각각에 할당되는 인덱스를 나타낸 것이다. Table 6 shows indexes 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

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

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

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

도 11은 인트라 예측 모드들을 나타낸 도면이다. 11 is a diagram illustrating intra prediction modes.

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

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

현재 블록에 이웃하는 이웃 블록의 정보를 이용하여, 현재 블록의 인트라 예측 모드를 결정 혹은 예측할 수 있다. 일 예로, 이웃 블록의 에지 방향 및/또는 각도에 기초하여 현재 블록의 인트라 예측 모드를 유도할 수 있다. 예컨대, 이웃 블록에 에지가 존재하는 경우, 에지의 방향 및/또는 에지가 형성하는 각도와 동일하거나 이와 가장 유사한 각도를 가진 인트라 예측 모드를 현재 블록의 예측 모드로 설정할 수 있다. An intra-prediction mode of the current block may be determined or predicted using information of neighboring blocks adjacent to the current block. For 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 having the same or most similar angle as the direction and/or 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 an upper neighboring block of the current block. Accordingly, an intra prediction mode that is the same as or most similar to the edge direction and/or edge angle of the left neighboring block or an intra prediction mode that is the same as 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. can

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

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

도 12에 도시된 예에서와 같이, 좌측 이웃 블록(1), 상단 이웃 블록(2), 우상단 이웃 블록(3), 좌하단 이웃 블록(4) 또는 좌상단 이웃 블록(5) 중 적어도 하나를 이용하여, 현재 블록의 인트라 예측 모드를 유도할 수 있다. As in the example shown in FIG. 12, at least one of the left neighboring block 1, the upper 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 may be defined as an intra merge mode. In this case, the intra prediction mode of each of the neighboring blocks may 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, an intra prediction mode having the highest frequency among a 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 plurality of selected intra prediction modes may be assigned to a sub-block. Accordingly, different intra prediction modes may be allocated for each sub-block within the current block. For example, the intra prediction mode of the first subblock in the current block is set to be the same as that of the first intra merge candidate, and the intra prediction mode of the second subblock in the current block is set to be the same as that of the second intra merge candidate. can

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

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

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

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

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

표 7은 35개의 인트라 예측 모드가 정의되어 있을 때, 인덱스가 2 내지 34 중 어느 하나인 인트라 예측 모드들 각각의 인트라 방향 파라미터를 나타낸다. 33개보다 더 많은 방향성 인트라 예측 모드가 정의되어 있는 경우, 표 7을 보다 세분화하여, 방향성 인트라 예측 모드 각각의 인트라 방향 파라미터를 설정할 수 있다.현재 블록의 상단 참조 샘플들 및 좌측 참조 샘플들을 일렬로 배열한 뒤, 인트라 방향 파라미터의 값을 기초로, 예측 샘플을 획득할 수 있다. 이때, 인트라 방향 파라미터의 값이 음수인 경우, 좌측 참조 샘플들과 상단 참조 샘플들을 일렬로 배열할 수 있다. 인트라 방향 파라미터에 기초하여, 참조 샘플 결정 파라미터를 결정할 수 있다. 참조 샘플 결정 파라미터는 참조 샘플을 특정하기 위한 참조 샘플 인덱스 및 참조 샘플에 적용되는 가중치를 결정하기 위한 가중치 파라미터를 포함할 수 있다. Table 7 shows an intra direction parameter of each intra prediction mode having 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 parameter of each directional intra prediction mode. Top reference samples and left reference samples of the current block are arranged in a row. After arranging, a prediction sample may be obtained based on the value of the intra-direction parameter. In this case, when the value of the intra direction parameter is a negative number, the left reference samples and the top reference samples may be arranged in a row. Based on the intra-direction parameter, a reference sample determination parameter may be determined. The reference sample determination parameter may include a reference sample index for specifying a reference sample and a weight parameter for determining a weight applied to the reference sample.

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

Figure pat00003
Figure pat00003

Figure pat00004
Figure pat00004

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

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

이때, 인트라 예측 모드의 기울기가 하나의 참조 샘플로는 표현되지 않는 경우, 복수의 참조 샘플들을 보간하여 예측 샘플을 생성할 수 있다. 일 예로, 인트라 예측 모드의 기울기가 예측 샘플과 제1 참조 샘플 사이의 기울기 및 예측 샘플과 제2 참조 샘플 사이의 기울기 사이의 값인 경우, 제1 참조 샘플 및 제2 참조 샘플을 보간하여 예측 샘플을 획득할 수 있다. 즉, 인트라 예측 각도를 따르는 앵귤러 라인(Angular Line)이 정수 펠에 위치한 참조 샘플을 지나지 않는 경우, 상기 앵귤러 라인이 지나는 위치의 좌우 또는 상하에 인접 위치하는 참조 샘플들을 보간하여 예측 샘플을 획득할 수 있다.In this case, when the slope of the intra prediction mode is not represented by one reference sample, a prediction sample may be generated by interpolating a plurality of reference samples. For example, when 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. can be obtained That is, when an angular line along the intra prediction angle does not pass through a reference sample located in an integer pel, a prediction sample may be obtained by interpolating reference samples located adjacent to the left or right or above and below the position through which the angular line passes there is.

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

Figure pat00005
Figure pat00005

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

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

Figure pat00006
Figure pat00006

원본 영상에서 예측 영상을 차분하여 유도된 잔차 영상을 유도할 수 있다. 이때, 잔차 영상을 주파수 도메인으로 변경하였을 때, 주파수 성분들 중 고주파 성분들을 제거하더라도, 영상의 주관적 화질은 크게 떨어지지 않는다. 이에 따라, 고주파 성분들의 값을 작게 변환하거나, 고주파 성분들의 값을 0으로 설정한다면, 시각적 왜곡이 크게 발생하지 않으면서도 압축 효율을 증가시킬 수 있는 효과가 있다. 위 특성을 반영하여, 잔차 영상을 2차원 주파수 성분들로 분해하기 위해 현재 블록을 변환할 수 있다. 상기 변환은 DCT(Discrete Cosine Transform) 또는 DST(Discrete Sine Tranform) 등의 변환 기법을 이용하여 수행될 수 있다. A residual image derived by differentiating a predicted image from an original image may be derived. In this case, when the residual image is changed to the frequency domain, subjective image quality of the image does not significantly deteriorate even when high-frequency components among frequency components are removed. Accordingly, if the values of the high-frequency components are reduced or the values of the high-frequency components are set to 0, there is an effect of increasing compression efficiency without greatly generating visual distortion. Reflecting the above characteristics, the current block may be transformed to decompose the residual image into 2D frequency components. The transform may be performed using a transform 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 transforms) the residual image into 2D frequency components using cosine transform, and DST decomposes (or transforms) the residual image into 2D frequency components using sine transform. As a result of transforming the residual image, frequency components may be expressed as a basis image. For example, when DCT transform is performed on an NxN-sized block, N 2 basic pattern components may be obtained. Through transformation, the size of each of the basic pattern components included in the NxN size block may be obtained. Depending on the transform technique used, the magnitude of the basic pattern component may be referred to as a DCT coefficient or a DST coefficient.

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

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

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

변환 기법은 블록 단위로 결정될 수 있다. 변환 기법은 현재 블록의 예측 부호화 모드, 현재 블록의 크기 또는 현재 블록의 형태 중 적어도 하나를 기초로 결정될 수 있다. 일 예로, 현재 블록이 인트라 예측 모드로 부호화되고, 현재 블록의 크기가 NxN보다 작은 경우에는 변환 기법 DST를 사용하여 변환이 수행될 수 있다. 반면, 상기 조건을 만족하지 않는 경우, 변환 기법 DCT를 사용하여 변환이 수행될 수 있다.A conversion technique may be determined in units of blocks. A transform technique may be determined based on at least one of a prediction encoding mode of the current block, a size of the current block, or a shape of the current block. For example, when the current block is coded in intra prediction mode and the size of the current block is smaller than NxN, transformation may be performed using DST. On the other hand, if the above condition is 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 may be referred to as a 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 on which transform is not performed.

현재 블록에 변환 스킵을 허용할 것인지 여부는, 현재 블록의 크기 또는 형태 중 적어도 하나에 기초하여 결정될 수 있다. 일 예로, 현재 블록의 크기가 문턱값보다 작은 경우에 한하여, 변환 스킵이 적용될 수 있다. 문턱값은 현재 블록의 너비, 높이 또는 샘플 개수 중 적어도 하나와 관한 것으로 32x32 등으로 정의될 수 있다. 또는, 정방형 블록에 대해서만 변환 스킵을 허용할 수 있다. 일 예로, 32x32, 16x16, 8x8 또는 4x4 크기의 정방형 블록에 대해 변환 스킵이 허용될 수 있다. 또는, 서브 파티션 인트라 부호화 방법이 사용되지 않은 경우에만, 변환 스킵을 허용할 수 있다. Whether or not to allow transform skip 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 value. The threshold value is related to at least one of the width, height, or number of samples of the current block and may be defined as 32x32 or the like. Alternatively, transform skipping may be allowed only for square blocks. For example, transform skip may be allowed for a square block having a size of 32x32, 16x16, 8x8, or 4x4. Alternatively, transform 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 may be converted again. In this case, a transform based on DCT or DST may be defined as a first transform, and transforming a block to which the first transform is applied may be defined as a second transform.

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

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

제1 변환 및 제2 변환의 수행 단위가 상이할 수 있다. 일 예로, 8x8 블록에 대해 제1 변환을 수행하고, 변환된 8x8 블록 중 4x4 크기의 서브 블록에 대해 제2 변환을 수행할 수 있다. 또는, 4x4 크기의 서브 블록들 3개에 속한 변환 계수들에 대해 제2 변환을 수행할 수 있다. 상기 3개의 서브 블록들은, 현재 블록의 좌상단에 위치하는 서브 블록, 상기 서브 블록의 우측에 이웃하는 서브 블록 및 상기 서브 블록의 하단에 이웃하는 서브 블록을 포함할 수 있다. 또는, 8x8 크기의 블록에 대해 제2 변환을 수행할 수도 있다.Performance units of the first transformation and the second transformation may be different. For example, a first transformation may be performed on an 8x8 block, and a second transformation may be performed on a subblock having a size of 4x4 among the transformed 8x8 blocks. Alternatively, the second transform may be performed on transform coefficients belonging to three 4x4 subblocks. The three sub-blocks may include a sub-block positioned 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 lower end of the sub-block. Alternatively, the second transformation may be performed on an 8x8 block.

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

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

현재 블록의 변환 타입을 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 수평 방향에 대한 변환 타입 및 수직 방향에 대한 변환 타입의 조합들 중 하나를 나타내는 인덱스 정보 tu_mts_idx일 수 있다.Information representing the transform 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 transform type for the horizontal direction and a transform type for the vertical direction.

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

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

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

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

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

여기서, 수평 방향의 변환 타입 및 수직 방향의 변환 타입을 결정하기 위해, 너비 및 높이와 비교되는 문턱값은, 부호화기 및 복호화기에서 기 정의된 것이거나, 현재 블록의 크기, 형태 또는 인트라 예측 모드 중 적어도 하나에 기초하여 적응적으로 결정되는 것일 수 있다.Here, in order to determine the transform type in the horizontal direction and the transform type in the vertical direction, the threshold values compared with the width and height are predefined in the encoder and decoder, or among 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 may obtain a residual block through inverse quantization and inverse transformation. The decoder may obtain a reconstructed 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 a reconstructed block of the current block is acquired, loss of information occurring in quantization and encoding processes 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), and an adaptive loop filter (ALF).

상술한 실시예는 일련의 단계 또는 순서도를 기초로 설명되고 있으나, 이는 발명의 시계열적 순서를 한정한 것은 아니며, 필요에 따라 동시에 수행되거나 다른 순서로 수행될 수 있다. 또한, 상술한 실시예에서 블록도를 구성하는 구성요소(예를 들어, 유닛, 모듈 등) 각각은 하드웨어 장치 또는 소프트웨어로 구현될 수도 있고, 복수의 구성요소가 결합하여 하나의 하드웨어 장치 또는 소프트웨어로 구현될 수도 있다. 상술한 실시예는 다양한 컴퓨터 구성요소를 통하여 수행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 ROM, RAM, 플래시 메모리 등과 같은 프로그램 명령어를 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 상기 하드웨어 장치는 본 개시에 따른 처리를 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Although the foregoing embodiments have been described 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. In addition, each of the components (eg, units, modules, etc.) constituting the block diagram in the above-described embodiment may be implemented as a hardware device or software, or a plurality of components may be combined to form a single hardware device or software. may be implemented. The above-described embodiment 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. alone 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 specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. The hardware device may be configured to act as one or more software modules to perform processing according to the present disclosure and vice versa.

Claims (13)

현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계;
상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계;
상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계; 및
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함하되,
상기 움직임 정보를 획득하는 단계는,
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함하는 것을 특징으로 하는, 영상 복호화 방법.
determining whether Geometry Partitioning with Merge mode (GPM) is applied to the current block;
determining a partition type for the current block when it is determined that the GPM is applied to the current block;
obtaining motion information of each of a first prediction unit and a second prediction unit within the current block; and
Obtaining a prediction block for the current block based on motion information of each of the first prediction unit and the second prediction unit,
Obtaining the motion information,
And determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit.
제1 항에 있어서,
상기 움직임 정보를 획득하는 단계는,
제1 머지 인덱스에 기초하여, 상기 제1 예측 유닛에 대한 제1 머지 후보를 선택하는 단계; 및
제2 머지 인덱스에 기초하여 상기 제2 예측 유닛에 대한 제2 머지 후보를 선택하는 단계를 포함하는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 1,
Obtaining the motion information,
selecting a first merge candidate for the first prediction unit based on a first merge index; and
And selecting a second merge candidate for the second prediction unit based on a second merge index.
제2 항에 있어서,
상기 제1 예측 유닛에 상기 MMVD가 적용되는지 여부는, 상기 제1 머지 후보의 인덱스를 문턱값과 비교한 결과를 기초로 결정되고,
상기 제2 예측 유닛에 상기 MMVD가 적용되는지 여부는, 상기 제2 머지 후보의 인덱스를 문턱값과 비교한 결과를 기초로 결정되는 것을 특징으로 하는 영상 복호화 방법.
According to claim 2,
Whether or not the MMVD is applied to the first prediction unit is determined based on a result of comparing the index of the first merge candidate with a threshold value,
Whether or not the MMVD is applied to the second prediction unit is determined based on a result of comparing an index of the second merge candidate with a threshold value.
제2 항에 있어서,
상기 제1 머지 인덱스는, 비트스트림을 통해 시그날링되는 한편,
상기 제2 머지 인덱스는, 상기 제1 예측 유닛 및 상기 제2 예측 유닛에 모두 상기 MMVD가 적용되는지 여부에 기초하여 선택적으로 시그날링되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 2,
While the first merge index is signaled through a bitstream,
The second merge index is selectively signaled based on whether the MMVD is applied to both the first prediction unit and the second prediction unit.
제4 항에 있어서,
상기 제2 머지 인덱스의 시그날링이 생략되는 경우, 디폴트 값 또는 상기 제1 머지 인덱스에서 오프셋을 가산 또는 감산한 값이 상기 제2 머지 인덱스로 추론되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 4,
When the signaling of the second merge index is omitted, a default value or a value obtained by adding or subtracting an offset from the first merge index is inferred as the second merge index.
제4 항에 있어서,
상기 제1 예측 유닛 및 상기 제2 예측 유닛에 모두 상기 MMVD가 적용되는 경우, 상기 제2 머지 인덱스의 시그날링이 생략되고, 상기 제2 머지 후보는, 상기 제1 머지 후보와 동일하게 설정되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 4,
When the MMVD is applied to both the first prediction unit and the second prediction unit, the signaling of the second merge index is omitted, and the second merge candidate is set to be the same as the first merge candidate. Characterized by, video decoding method.
제2 항에 있어서,
상기 제1 머지 후보의 인덱스와 상기 제2 머지 후보의 인덱스의 비교 결과에 따라, 상기 제1 예측 유닛 및 상기 제2 예측 유닛 중 하나에 상기 MMVD가 적용되는 것을 특징으로 하는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 2,
Characterized in that, the MMVD is applied to one of the first prediction unit and the second prediction unit according to a comparison result of the index of the first merge candidate and the index of the second merge candidate. decryption method.
제7 항에 있어서,
상기 제1 머지 후보의 인덱스가 상기 제2 머지 후보의 인덱스보다 작은 경우, 상기 제1 예측 유닛에 상기 MMVD가 적용되고,
상기 제2 머지 후보의 인덱스가 상기 제1 머지 후보의 인덱스보다 작은 경우, 상기 제2 예측 유닛에 상기 MMVD가 적용되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 7,
When the index of the first merge candidate is smaller than the index of the second merge candidate, the MMVD is applied to the first prediction unit;
When the index of the second merge candidate is smaller than the index of the first merge candidate, the MMVD is applied to the second prediction unit.
제2 항에 있어서,
상기 제1 예측 유닛에 MMVD가 적용되는 경우와 그렇지 않은 경우에 있어서, 상기 제1 머지 인덱스가 지시할 수 있는 머지 후보들의 개수는 상이한 것을 특징으로 하는, 영상 복호화 방법.
According to claim 2,
The video decoding method, characterized in that the number of merge candidates indicated by the first merge index is different between a case where MMVD is applied to the first prediction unit and a case where MMVD is not applied.
제2 항에 있어서,
상기 제1 예측 유닛에 MMVD가 적용되는 경우, 상기 제1 예측 유닛의 움직임 벡터는, 상기 제1 머지 후보의 움직임 벡터에 제1 오프셋 벡터를 가산하여 유도되고,
상기 제2 예측 유닛에 MMVD가 적용되는 경우, 상기 제2 예측 유닛의 움직임 벡터는, 상기 제1 머지 후보의 움직임 벡터에 제2 오프셋 벡터를 가산하여 유도되고,
상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터는, 별개의 인덱스 정보를 기반으로 결정되는 것을 특징으로 하는, 영상 복호화 방법.
According to claim 2,
When MMVD is applied to the first prediction unit, a motion vector of the first prediction unit is derived by adding a first offset vector to a motion vector of the first merge candidate;
When MMVD is applied to the second prediction unit, a motion vector of the second prediction unit is derived by adding a second offset vector to the motion vector of the first merge candidate;
The first offset vector and the second offset vector are determined based on separate index information.
제10 항에 있어서,
상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터가 동일한 경우, 상기 제1 머지 후보는 상기 제2 머지 후보와 상이하고,
상기 제1 오프셋 벡터 및 상기 제2 오프셋 벡터가 상이한 경우, 상기 제1 머지 후보와 상기 제2 머지 후보는 동일한 것을 특징으로 하는, 영상 복호화 방법.
According to claim 10,
When the first offset vector and the second offset vector are the same, the first merge candidate is different from the second merge candidate;
When the first offset vector and the second offset vector are different, the first merge candidate and the second merge candidate are identical.
현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계;
상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계;
상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계; 및
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함하되,
상기 움직임 정보를 획득하는 단계는,
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함하는 것을 특징으로 하는, 영상 부호화 방법.
determining whether Geometry Partitioning with Merge mode (GPM) is applied to the current block;
determining a partition type for the current block when it is determined that the GPM is applied to the current block;
obtaining motion information of each of a first prediction unit and a second prediction unit within the current block; and
Obtaining a prediction block for the current block based on motion information of each of the first prediction unit and the second prediction unit,
Obtaining the motion information,
And determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit.
현재 블록에 GPM (Geometry Partitioning with Merge mode)이 적용되는지 여부를 결정하는 단계;
상기 현재 블록에 상기 GPM이 적용되는 것으로 결정되는 경우, 상기 현재 블록에 대한 파티션 타입을 결정하는 단계;
상기 현재 블록 내 제1 예측 유닛 및 제2 예측 유닛 각각의 움직임 정보를 획득하는 단계; 및
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각의 움직임 정보를 기초로, 상기 현재 블록에 대한 예측 블록을 획득하는 단계를 포함하되,
상기 움직임 정보를 획득하는 단계는,
상기 제1 예측 유닛 및 상기 제2 예측 유닛 각각에 MMVD (Merge mode with Motion Vector Difference)가 적용되는지 여부를 결정하는 단계를 포함하는 것을 특징으로 하는, 영상 부호화 방법에 의해 생성된 비트스트림을 저장하는 컴퓨터로 판독 가능한 기록 매체.
determining whether Geometry Partitioning with Merge mode (GPM) is applied to the current block;
determining a partition type for the current block when it is determined that the GPM is applied to the current block;
obtaining motion information of each of a first prediction unit and a second prediction unit within the current block; and
Obtaining a prediction block for the current block based on motion information of each of the first prediction unit and the second prediction unit,
Obtaining the motion information,
Storing a bitstream generated by an image encoding method, comprising the step of determining whether merge mode with motion vector difference (MMVD) is applied to each of the first prediction unit and the second prediction unit A computer-readable recording medium.
KR1020220137670A 2021-11-01 2022-10-24 Method for encoding/decoding a video signal and recording medium storing a bitsteram generated based on the method KR20230063314A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20210148179 2021-11-01
KR1020210148179 2021-11-01

Publications (1)

Publication Number Publication Date
KR20230063314A true KR20230063314A (en) 2023-05-09

Family

ID=86408491

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220137670A KR20230063314A (en) 2021-11-01 2022-10-24 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) KR20230063314A (en)

Similar Documents

Publication Publication Date Title
KR102608847B1 (en) Method for encoding/decoidng video signal and apparatus therefor
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
KR20200104253A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200063092A (en) Method for encodign/decodign video signal and apparatus therefor
KR20200041810A (en) Method for encodign/decodign video signal and apparatus therefor
KR20200054110A (en) Method for encodign/decodign video signal and apparatus therefor
KR102597461B1 (en) Method for encoding/decoidng video signal and apparatus therefor
KR102619997B1 (en) Method for encodign/decodign 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
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
KR20240024755A (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
KR20210111602A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210103763A (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
KR20210120243A (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
KR20210075552A (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
KR20210116093A (en) Video signal encoding method and apparatus and video decoding method and apparatus