KR20200095982A - A method and an apparatus for processing a video signal using merge with motion vector difference - Google Patents

A method and an apparatus for processing a video signal using merge with motion vector difference Download PDF

Info

Publication number
KR20200095982A
KR20200095982A KR1020190014057A KR20190014057A KR20200095982A KR 20200095982 A KR20200095982 A KR 20200095982A KR 1020190014057 A KR1020190014057 A KR 1020190014057A KR 20190014057 A KR20190014057 A KR 20190014057A KR 20200095982 A KR20200095982 A KR 20200095982A
Authority
KR
South Korea
Prior art keywords
merge
flag
mmvd
mode
prediction
Prior art date
Application number
KR1020190014057A
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 주식회사 윌러스표준기술연구소
Priority to KR1020190014057A priority Critical patent/KR20200095982A/en
Publication of KR20200095982A publication Critical patent/KR20200095982A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention relates to a processing method of a video signal and to a device thereof. More particularly, provided are a video signal processing method encoding or decoding a video signal and the device thereof. According to one embodiment of the present invention, an image decoding method includes a step of efficiently receiving a prediction mode selected by an encoder in an intra prediction method.

Description

모션 벡터 차이를 사용하는 머지를 기반으로 한 모션 예측을 이용한 비디오 신호 처리 방법 및 장치{A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL USING MERGE WITH MOTION VECTOR DIFFERENCE}Video signal processing method and apparatus using motion prediction based on merge-based motion vector difference {A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL USING MERGE WITH MOTION VECTOR DIFFERENCE}

본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.The present invention relates to a video signal processing method and apparatus, and more particularly, to a video signal processing method and apparatus for encoding or decoding a video signal.

압축 부호화란 디지털화한 정보를 통신 회선을 통해 전송하거나, 저장 매체에 적합한 형태로 저장하기 위한 일련의 신호 처리 기술을 의미한다. 압축 부호화의 대상에는 음성, 영상, 문자 등의 대상이 존재하며, 특히 영상을 대상으로 압축 부호화를 수행하는 기술을 비디오 영상 압축이라고 일컫는다. 비디오 신호에 대한 압축 부호화는 공간적인 상관관계, 시간적인 상관관계, 확률적인 상관관계 등을 고려하여 잉여 정보를 제거함으로써 이루어진다. 그러나 최근의 다양한 미디어 및 데이터 전송 매체의 발전으로 인해, 더욱 고효율의 비디오 신호 처리 방법 및 장치가 요구되고 있다.Compression coding refers to a series of signal processing techniques for transmitting digitized information through a communication line or storing it in a form suitable for a storage medium. Objects of compression encoding include audio, video, and text, and in particular, a technique for performing compression encoding on an image is called video image compression. Compression coding of a video signal is performed by removing redundant information in consideration of spatial correlation, temporal correlation, and probability correlation. However, due to the recent development of various media and data transmission media, a more efficient video signal processing method and apparatus is required.

본 발명의 목적은 비디오 신호의 코딩 효율을 높이고자 함에 있다.An object of the present invention is to increase the coding efficiency of a video signal.

상기와 같은 과제를 해결하기 위해, 본 발명의 일 실시예를 따른 영상 복호화 방법은 화면내 예측 방법에서 인코더가 선택한 예측 모드를 효율적으로 수신하는 단계를 포함한다.In order to solve the above problems, an image decoding method according to an embodiment of the present invention includes the step of efficiently receiving a prediction mode selected by an encoder in an intra prediction method.

본 발명의 실시예에 따르면, 비디오 신호의 코딩 효율이 높아질 수 있다.According to an embodiment of the present invention, coding efficiency of a video signal can be improved.

도 1은 본 발명의 실시예에 따른 비디오 신호 인코더 장치의 개략적인 블록도.
도 2는 본 발명의 실시예에 따른 비디오 신호 디코더 장치의 개략적인 블록도.
도 3은 코딩 유닛을 분할하는 본 발명의 일 실시예를 나타내는 도면.
도 4는 도 3의 분할 구조를 계층적으로 나타내는 방법의 일 실시예를 도시한 도면.
도 5는 코딩 유닛을 분할하는 본 발명의 추가적인 실시예를 나타낸 도면.
도 6은 화면내 예측을 위한 참조 픽셀 획득 방법을 나타낸 도면.
도 7은 화면내 예측에 사용되는 예측 모드들의 일 실시예를 도시한 도면.
도 8은 본 발명의 일 실시예에 따른 inter prediction을 나타낸 도면.
도 9는 본 발명의 일 실시예에 따른 모션 벡터 시그날링 방법을 나타낸 도면.
도 10은 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면.
도 11은 본 발명의 일 실시예에 따른 adaptive motion vector resolution 시그날링을 나타낸 도면.
도 12는 본 발명의 일 실시예에 따른 inter prediction 관련 syntax를 나타낸 도면.
도 13은 본 발명의 일 실시예에 따른 merge with MVD(MMVD)를 나타낸 도면.
도 14는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 15는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 16은 본 발명의 일 실시예에 따른 MMVD 관련 syntax를 나타낸 도면.
도 17은 본 발명의 일 실시예에 따른 MMVD 관련 syntax를 나타낸 도면.
도 18은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 19는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 20은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 21은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 22는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면.
도 23은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면.
도 24는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 25는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 26은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 27은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 28은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면.
도 29는 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면.
도 30은 본 발명의 일 실시예에 따른 merge mode 시그날링을 나타낸 도면.
도 31은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 32는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면.
도 33은 도 30 내지 도 32에서 설명한 syntax 구조를 나타낸 도면.
도 34는 본 발명의 일 실시예에 따른 syntax 구조를 나타낸 도면.
도 35는 본 발명의 일 실시예에 따른 syntax 구조를 나타낸 도면.
도 36은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면.
도 37은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면.
도 38은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면.
도 39는 본 발명의 일 실시예에 따른 motion information derivation을 나타낸 도면.
도 40은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면.
도 41은 본 발명의 일 실시예에 따른 motion information derivation을 나타낸 도면.
도 42는 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면.
1 is a schematic block diagram of a video signal encoder apparatus according to an embodiment of the present invention.
2 is a schematic block diagram of a video signal decoder device according to an embodiment of the present invention.
3 is a diagram showing an embodiment of the present invention for dividing a coding unit.
FIG. 4 is a diagram illustrating an embodiment of a method for hierarchically representing the division structure of FIG. 3.
5 shows a further embodiment of the present invention for dividing a coding unit.
6 is a diagram illustrating a method of obtaining a reference pixel for intra prediction.
7 is a diagram illustrating an embodiment of prediction modes used for intra prediction.
8 is a diagram showing inter prediction according to an embodiment of the present invention.
9 is a diagram showing a motion vector signaling method according to an embodiment of the present invention.
10 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.
11 is a diagram showing adaptive motion vector resolution signaling according to an embodiment of the present invention.
12 is a diagram showing syntax related to inter prediction according to an embodiment of the present invention.
13 is a view showing merge with MVD (MMVD) according to an embodiment of the present invention.
14 is a diagram showing MMVD syntax according to an embodiment of the present invention.
15 is a diagram showing MMVD syntax according to an embodiment of the present invention.
16 is a diagram showing syntax related to MMVD according to an embodiment of the present invention.
17 is a diagram showing syntax related to MMVD according to an embodiment of the present invention.
18 is a diagram showing MMVD syntax according to an embodiment of the present invention.
19 is a diagram showing MMVD syntax according to an embodiment of the present invention.
20 is a diagram showing MMVD syntax according to an embodiment of the present invention.
21 is a diagram showing MMVD syntax according to an embodiment of the present invention.
22 is a diagram showing MMVD syntax according to an embodiment of the present invention.
23 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
24 is a diagram showing a merge data syntax according to an embodiment of the present invention.
25 is a diagram showing merge data syntax according to an embodiment of the present invention.
26 is a diagram showing merge data syntax according to an embodiment of the present invention.
27 is a diagram showing a merge data syntax according to an embodiment of the present invention.
28 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
29 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
30 is a diagram showing merge mode signaling according to an embodiment of the present invention.
31 is a diagram showing merge data syntax according to an embodiment of the present invention.
32 is a diagram showing merge data syntax according to an embodiment of the present invention.
33 is a diagram illustrating a syntax structure described in FIGS. 30 to 32.
34 is a diagram showing a syntax structure according to an embodiment of the present invention.
35 is a diagram showing a syntax structure according to an embodiment of the present invention.
36 is a view showing MVD derivation of MMVD according to an embodiment of the present invention.
37 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.
38 is a view showing MVD derivation of MMVD according to an embodiment of the present invention.
39 is a view showing motion information derivation according to an embodiment of the present invention.
40 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.
41 is a view showing motion information derivation according to an embodiment of the present invention.
42 is a view showing MVD derivation of MMVD according to an embodiment of the present invention.

본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.The terms used in the present specification have been selected as currently widely used general terms as possible while taking functions of the present invention into consideration, but this may vary according to the intention, custom, or the emergence of new technologies of the skilled person in the art. In addition, in certain cases, there are terms arbitrarily selected by the applicant, and in this case, the meaning will be described in the description of the corresponding invention. Therefore, it is to be noted that terms used in the present specification should be interpreted based on the actual meaning of the term and the entire contents of the present specification, not a simple name of the term.

본 발명에서 다음 용어는 다음과 같은 기준으로 해석될 수 있고, 기재되지 않은 용어라도 하기 취지에 따라 해석될 수 있다. 코딩은 경우에 따라 인코딩 또는 디코딩으로 해석될 수 있고, 정보(information)는 값(values), 파라미터(parameter), 계수(coefficients), 성분(elements) 등을 모두 포함하는 용어로서, 경우에 따라 의미는 달리 해석될 수 있으므로 본 발명은 이에 한정되지 아니한다. '유닛'은 영상(픽쳐) 처리의 기본 단위 또는 픽쳐의 특정 위치를 지칭하는 의미로 사용되었으며, 경우에 따라서는 '블록', '파티션' 또는 '영역' 등의 용어와 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 유닛은 코딩 유닛, 예측 유닛, 변환 유닛을 모두 포함하는 개념으로 사용될 수 있다.In the present invention, the following terms may be interpreted according to the following criteria, and even terms that are not described may be interpreted according to the following purpose. Coding may be interpreted as encoding or decoding in some cases, and information is a term that includes all values, parameters, coefficients, elements, etc., meaning in some cases As can be interpreted differently, the present invention is not limited thereto. 'Unit' is used to refer to a basic unit of image (picture) processing or a specific position of a picture, and in some cases, it may be used interchangeably with terms such as'block','partition' or'area'. . In addition, in the present specification, a unit may be used as a concept including all of a coding unit, a prediction unit, and a transform unit.

도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 인코딩 장치(100)는 크게 변환부(110), 양자화부(115), 역양자화부(120), 역변환부(125), 필터링부(130), 예측부(150) 및 엔트로피 코딩부(160)를 포함한다.1 is a schematic block diagram of an apparatus for encoding a video signal according to an embodiment of the present invention. Referring to FIG. 1, the encoding apparatus 100 of the present invention is largely a transform unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transform unit 125, a filtering unit 130, and a prediction unit ( 150) and an entropy coding unit 160.

변환부(110)는 입력 받은 비디오 신호에 대한 화소값을 변환하여 변환 계수 값을 획득한다. 예를 들어, 이산 코사인 변환(Discrete Cosine Transform, DCT) 또는 웨이블릿 변환(Wavelet Transform) 등이 사용될 수 있다. 특히 이산 코사인 변환은 입력된 픽쳐 신호를 일정 크기의 블록 형태로 나누어 변환을 수행하게 된다. 변환에 있어서 변환 영역 내의 값들의 분포와 특성에 따라서 코딩 효율이 달라질 수 있다.The conversion unit 110 obtains a transform coefficient value by converting a pixel value of an input video signal. For example, Discrete Cosine Transform (DCT) or Wavelet Transform may be used. Particularly, the discrete cosine transform is performed by dividing the input picture signal into blocks having a predetermined size. In transformation, coding efficiency may vary depending on the distribution and characteristics of values in the transformation region.

양자화부(115)는 변환부(110)에서 출력된 변환 계수 값을 양자화한다. 역양자화부(120)에서는 변환 계수 값을 역양자화하고, 역변환부(125)에서는 역양자화된 변환 계수값을 이용하여 원래의 화소값을 복원한다.The quantization unit 115 quantizes a transform coefficient value output from the transform unit 110. The inverse quantization unit 120 inverse quantizes the transform coefficient value, and the inverse transform unit 125 restores the original pixel value by using the inverse quantization transform coefficient value.

필터링부(130)는 복원된 픽쳐의 품질 개선을 위한 필터링 연산을 수행한다. 예를 들어, 디블록킹 필터 및 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, 156)에 저장된다.The filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture. For example, a deblocking filter and an adaptive loop filter may be included. The filtered picture is output or stored in a decoded picture buffer 156 to be used as a reference picture.

코딩 효율을 높이기 위하여 픽쳐 신호를 그대로 코딩하는 것이 아니라, 예측부(150)를 통해 이미 코딩된 영역을 이용하여 픽쳐를 예측하고, 예측된 픽쳐에 원 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 더하여 복원 픽쳐를 획득하는 방법이 사용된다. 인트라 예측부(152)에서는 현재 픽쳐 내에서 화면내 예측을 수행하며, 인터 예측부(154)에서는 복호 픽쳐 버퍼(156)에 저장된 참조 픽쳐를 이용하여 현재 픽쳐를 예측한다. 인트라 예측부(152)는 현재 픽쳐 내의 복원된 영역들로부터 화면내 예측을 수행하여, 화면내 부호화 정보를 엔트로피 코딩부(160)에 전달한다. 인터 예측부(154)는 다시 모션 추정부(154a) 및 모션 보상부(154b)를 포함하여 구성될 수 있다. 모션 추정부(154a)에서는 복원된 특정 영역을 참조하여 현재 영역의 모션 벡터값을 획득한다. 모션 추정부(154a)에서는 참조 영역의 위치 정보(참조 프레임, 모션 벡터 등) 등을 엔트로피 코딩부(160)로 전달하여 비트스트림에 포함될 수 있도록 한다. 모션 추정부(154a)에서 전달된 모션 벡터값을 이용하여 모션 보상부(154b)에서는 화면간 모션 보상을 수행한다.In order to improve coding efficiency, the picture signal is not coded as it is, but a picture is predicted by using a region already coded through the prediction unit 150, and a residual value between the original picture and the predicted picture is added to the predicted picture. The method of obtaining is used. The intra prediction unit 152 performs intra prediction within the current picture, and the inter prediction unit 154 predicts the current picture using a reference picture stored in the decoded picture buffer 156. The intra prediction unit 152 performs intra prediction from reconstructed regions in the current picture and transmits the intra prediction information to the entropy coding unit 160. The inter prediction unit 154 may again include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value of the current region by referring to the restored specific region. The motion estimating unit 154a transfers position information (reference frame, motion vector, etc.) of the reference region to the entropy coding unit 160 to be included in the bitstream. The motion compensation unit 154b performs inter-screen motion compensation using the motion vector value transmitted from the motion estimation unit 154a.

엔트로피 코딩부(160)는 양자화된 변환 계수, 화면간 부호화 정보, 화면내 부호화 정보 및 인터 예측부(154)로부터 입력된 참조 영역 정보 등을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성한다. 여기서 엔트로피 코딩부(160)에서는 가변 길이 코딩(Variable Length Coding, VLC) 방식과 산술 코딩(arithmetic coding) 등이 사용될 수 있다. 가변 길이 코딩(VLC) 방식은 입력되는 심볼들을 연속적인 코드워드로 변환하는데, 코드워드의 길이는 가변적일 수 있다. 예를 들어, 자주 발생하는 심볼들을 짧은 코드워드로, 자주 발생하지 않은 심볼들은 긴 코드워드로 표현하는 것이다. 가변 길이 코딩 방식으로서 컨텍스트 기반 적응형 가변 길이 코딩(Context-based Adaptive Variable Length Coding, CAVLC) 방식이 사용될 수 있다. 산술 코딩은 연속적인 데이터 심볼들을 하나의 소수로 변환하는데, 산술 코딩은 각 심볼을 표현하기 위하여 필요한 최적의 소수 비트를 얻을 수 있다. 산술 코딩으로서 컨텍스트 기반 적응형 산술 부호화(Context-based Adaptive Binary Arithmetic Code, CABAC)가 이용될 수 있다.The entropy coding unit 160 entropy-codes quantized transform coefficients, inter-picture encoding information, intra-picture encoding information, and reference region information input from the inter prediction unit 154 to generate a video signal bitstream. Here, the entropy coding unit 160 may use a variable length coding (VLC) scheme and arithmetic coding. The variable length coding (VLC) method converts input symbols into consecutive codewords, and the length of the codeword may be variable. For example, frequently occurring symbols are represented by a short codeword, and infrequently occurring symbols are represented by a long codeword. As a variable length coding scheme, a context-based adaptive variable length coding (CAVLC) scheme may be used. Arithmetic coding converts consecutive data symbols into a single prime number, and arithmetic coding can obtain an optimal decimal bit necessary to represent each symbol. Context-based Adaptive Binary Arithmetic Code (CABAC) may be used as arithmetic coding.

상기 생성된 비트스트림은 NAL(Network Abstraction Layer) 유닛을 기본 단위로 캡슐화 되어 있다. NAL 유닛은 부호화된 슬라이스 세그먼트를 포함하는데, 상기 슬라이스 세그먼트는 정수 개의 코딩 트리 유닛(Coding Tree Unit)으로 이루어진다. 비디오 디코더에서 비트스트림을 디코딩하기 위해서는 먼저 비트스트림을 NAL 유닛 단위로 분리한 후, 분리 된 각각의 NAL 유닛을 디코딩해야 한다.The generated bitstream is encapsulated in a basic unit of a Network Abstraction Layer (NAL) unit. The NAL unit includes a coded slice segment, and the slice segment consists of an integer number of coding tree units. In order to decode a bitstream in a video decoder, the bitstream must first be separated into NAL units, and then each separated NAL unit must be decoded.

도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치(200)의 개략적인 블록도이다. 도 2를 참조하면 본 발명의 디코딩 장치(200)는 크게 엔트로피 디코딩부(210), 역양자화부(220), 역변환부(225), 필터링부(230), 예측부(250)를 포함한다.2 is a schematic block diagram of a video signal decoding apparatus 200 according to an embodiment of the present invention. Referring to FIG. 2, the decoding apparatus 200 of the present invention largely includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230, and a prediction unit 250.

엔트로피 디코딩부(210)는 비디오 신호 비트스트림을 엔트로피 디코딩하여, 각 영역에 대한 변환 계수, 모션 정보 등을 추출한다. 역양자화부(220)는 엔트로피 디코딩된 변환 계수를 역양자화하고, 역변환부(225)는 역양자화된 변환 계수를 이용하여 원래의 화소값을 복원한다.The entropy decoding unit 210 entropy-decodes the video signal bitstream, and extracts transform coefficients and motion information for each region. The inverse quantization unit 220 inverse quantizes the entropy-decoded transform coefficient, and the inverse transform unit 225 restores the original pixel value by using the inverse quantization transform coefficient.

한편, 필터링부(230)는 픽쳐에 대한 필터링을 수행하여 화질을 향상시킨다. 여기에는 블록 왜곡 현상을 감소시키기 위한 디블록킹 필터 및/또는 픽쳐 전체의 왜곡 제거를 위한 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 다음 프레임에 대한 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, 256)에 저장된다.Meanwhile, the filtering unit 230 improves image quality by performing filtering on a picture. This may include a deblocking filter for reducing block distortion and/or an adaptive loop filter for removing distortion of an entire picture. The filtered picture is output or stored in a decoded picture buffer 256 to be used as a reference picture for the next frame.

또한, 본 발명의 예측부(250)는 인트라 예측부(252) 및 인터 예측부(254)를 포함하고, 전술한 엔트로피 디코딩부(210)를 통해 디코딩된 부호화 타입, 각 영역에 대한 변환 계수, 모션 정보 등을 활용하여 예측 픽쳐를 복원하게 된다.In addition, the prediction unit 250 of the present invention includes an intra prediction unit 252 and an inter prediction unit 254, and the encoding type decoded through the entropy decoding unit 210 described above, transform coefficients for each region, The predicted picture is reconstructed using motion information and the like.

이와 관련하여, 상기 인트라 예측부(252)에서는 현재 픽쳐 내의 디코딩된 샘플로부터 화면내 예측을 수행하게 된다. 인터 예측부(254)는 복호 픽쳐 버퍼(256)에 저장된 참조 픽쳐 및 모션 정보를 이용하여 예측 픽쳐를 생성한다. 인터 예측부(254)는 다시 모션 추정부(254a) 및 모션 보상부(254b)를 포함하여 구성될 수 있다. 모션 추정부(254a)에서는 현재 블록과 코딩에 사용하는 참조 픽쳐의 참조 블록간의 위치 관계를 나타내는 모션 벡터를 획득하여 모션 보상부(254b)로 전달한다.In this regard, the intra prediction unit 252 performs intra prediction from decoded samples in the current picture. The inter prediction unit 254 generates a prediction picture using the reference picture and motion information stored in the decoded picture buffer 256. The inter prediction unit 254 may again include a motion estimation unit 254a and a motion compensation unit 254b. The motion estimation unit 254a obtains a motion vector indicating a positional relationship between the current block and a reference block of a reference picture used for coding, and transmits the obtained motion vector to the motion compensation unit 254b.

상기 인트라 예측부(252) 또는 인터 예측부(254)로부터 출력된 예측값, 및 역변환부(225)로부터 출력된 화소값이 더해져서 복원된 비디오 프레임이 생성된다.A reconstructed video frame is generated by adding the prediction value output from the intra prediction unit 252 or the inter prediction unit 254 and the pixel value output from the inverse transform unit 225.

이하에서는, 상기 인코딩 장치(100)와 디코딩 장치(200)의 동작에 있어서, 도 3 내지 도 5를 참조하여 코딩 유닛 및 예측 유닛 등을 분할하는 방법을 설명하기로 한다.Hereinafter, in the operation of the encoding device 100 and the decoding device 200, a method of dividing a coding unit, a prediction unit, and the like will be described with reference to FIGS. 3 to 5.

코딩 유닛이란 상기에서 설명한 비디오 신호의 처리 과정에서, 예를 들어 화면내(intra)/화면간(inter) 예측, 변환(transform), 양자화(quantization) 및/또는 엔트로피 코딩(entropy coding) 등의 과정에서 픽쳐를 처리하기 위한 기본 단위를 의미한다. 하나의 픽쳐를 코딩하는 데 있어서 사용되는 코딩 유닛의 크기는 일정하지 않을 수 있다. 코딩 유닛은 사각형 형태를 가질 수 있고, 하나의 코딩 유닛은 다시 여러 개의 코딩 유닛으로 분할 가능하다.The coding unit is a process such as intra/inter prediction, transform, quantization, and/or entropy coding in the process of processing the video signal described above. It means the basic unit for processing pictures in. The size of a coding unit used to code one picture may not be constant. The coding unit may have a square shape, and one coding unit may be divided into several coding units.

도 3은 코딩 유닛을 분할하는 본 발명의 일 실시예를 나타낸다. 예를 들어, 2N X 2N 크기를 가지는 하나의 코딩 유닛은 다시 N X N 크기를 가지는 네 개의 코딩 유닛으로 분할될 수 있다. 이러한 코딩 유닛의 분할은 재귀적으로 이루어질 수 있으며, 모든 코딩 유닛들이 동일한 형태로 분할될 필요는 없다. 다만, 코딩 및 처리과정에서의 편의를 위하여 최대 코딩 유닛의 크기 및/또는 최소 코딩 유닛의 크기에 대한 제한이 있을 수 있다.3 shows an embodiment of the present invention for dividing a coding unit. For example, one coding unit having a size of 2N X 2N may be divided into four coding units having a size of N X N. The division of the coding unit may be performed recursively, and all coding units need not be divided into the same form. However, for convenience in coding and processing, there may be restrictions on the size of the maximum coding unit and/or the size of the minimum coding unit.

하나의 코딩 유닛에 대하여, 해당 코딩 유닛이 분할되는지 여부를 나타내는 정보를 저장할 수 있다. 도 4는 도 3에서 도시하는 코딩 유닛의 분할 구조를 플래그 값을 이용하여 계층적으로 나타내는 방법에 대한 일 실시예를 도시한 것이다. 코딩 유닛의 분할 여부를 나타내는 정보는 해당 유닛이 분할 된 경우 '1', 분할되지 않은 경우 '0'의 값으로 할당할 수 있다. 도 4에서 도시하듯이, 분할 여부를 나타내는 플래그 값이 1이면 해당 노드에 대응하는 코딩 유닛은 다시 4개의 코딩 유닛으로 나누어지고, 0이면 더 이상 나누어지지 않고 해당 코딩 유닛에 대한 처리 프로세스가 수행될 수 있다.For one coding unit, information indicating whether the corresponding coding unit is divided may be stored. FIG. 4 illustrates an embodiment of a method of hierarchically representing the partition structure of the coding unit shown in FIG. 3 using flag values. Information indicating whether the coding unit is divided may be assigned a value of '1' when the corresponding unit is divided and '0' when the corresponding unit is not divided. As shown in FIG. 4, if the flag value indicating whether to divide is 1, the coding unit corresponding to the node is divided into 4 coding units again, and if it is 0, the coding unit is no longer divided and a processing process for the coding unit is performed. I can.

상기에서 설명한 코딩 유닛의 구조는 재귀적인 트리 구조를 이용하여 나타낼 수 있다. 즉, 하나의 픽쳐 또는 최대 크기 코딩 유닛을 루트(root)로 하여, 다른 코딩 유닛으로 분할되는 코딩 유닛은 분할된 코딩 유닛의 개수만큼의 자식(child) 노드를 가지게 된다. 따라서, 더 이상 분할되지 않는 코딩 유닛이 리프(leaf) 노드가 된다. 하나의 코딩 유닛에 대하여 정방형 분할만이 가능하다고 가정할 때, 하나의 코딩 유닛은 최대 4개의 다른 코딩 유닛으로 분할될 수 있으므로 코딩 유닛을 나타내는 트리는 쿼드 트리(Quad tree) 형태가 될 수 있다.The structure of the coding unit described above can be represented by using a recursive tree structure. That is, with one picture or a maximum size coding unit as a root, a coding unit divided into other coding units has as many child nodes as the number of divided coding units. Thus, a coding unit that is no longer divided becomes a leaf node. Assuming that only square partitioning is possible for one coding unit, since one coding unit can be divided into up to four different coding units, the tree representing the coding unit may be in the form of a quad tree.

인코더에서는 비디오 픽쳐의 특성(예를 들어, 해상도)에 따라서 혹은 코딩의 효율을 고려하여 최적의 코딩 유닛의 크기가 선택되고 이에 대한 정보 또는 이를 유도할 수 있는 정보가 비트스트림에 포함될 수 있다. 예를 들면, 최대 코딩 유닛의 크기 및 트리의 최대 깊이가 정의될 수 있다. 정방형 분할을 할 경우, 코딩 유닛의 높이 및 너비는 부모 노드의 코딩 유닛의 높이 및 너비의 반이 되므로, 상기와 같은 정보를 이용하면 최소 코딩 유닛 크기를 구할 수 있다. 혹은 역으로, 최소 코딩 유닛 크기 및 트리의 최대 깊이를 미리 정의하여 이용하고, 이를 이용하여 최대 코딩 유닛의 크기를 유도하여 이용할 수 있다. 정방형 분할에서 유닛의 크기는 2의 배수 형태로 변화하기 때문에, 실제 코딩 유닛의 크기는 2를 밑으로 하는 로그값으로 나타내어 전송 효율을 높일 수 있다.In the encoder, the optimal coding unit size is selected according to a characteristic (eg, resolution) of a video picture or in consideration of coding efficiency, and information about this or information for inducing it may be included in the bitstream. For example, the size of the maximum coding unit and the maximum depth of the tree can be defined. In the case of square division, since the height and width of the coding unit is half the height and width of the coding unit of the parent node, the minimum coding unit size can be obtained by using the above information. Or, conversely, the minimum coding unit size and the maximum depth of the tree can be defined and used in advance, and the size of the maximum coding unit can be derived and used by using them. In square division, since the size of the unit is changed in a multiple of 2, the size of the actual coding unit is represented by a log value of 2 to increase transmission efficiency.

디코더에서는 현재 코딩 유닛이 분할되었는지 여부를 나타내는 정보를 획득할 수 있다. 이러한 정보는 특정 조건 하에만 획득하게(전송되게) 하면 효율을 높일 수 있다. 예를 들어 현재 코딩 유닛이 분할 가능한 조건은 현재 위치에서 현재 코딩 유닛 크기를 더한 것이 픽쳐의 크기보다 작고, 현재 유닛 크기가 기 설정된 최소 코딩 유닛 크기보다 큰 경우이므로, 이러한 경우에만 현재 코딩 유닛이 분할되었는지를 나타내는 정보를 획득할 수 있다.The decoder may obtain information indicating whether the current coding unit is divided. If such information is acquired (transmitted) only under certain conditions, efficiency can be improved. For example, the condition in which the current coding unit can be divided is when the size of the current coding unit added at the current position is smaller than the size of the picture and the current unit size is larger than the preset minimum coding unit size, so that the current coding unit is divided only in this case. It is possible to obtain information indicating whether or not.

만약 상기 정보가 코딩 유닛이 분할되었음을 나타내는 경우, 분할될 코딩 유닛의 크기는 현재 코딩 유닛의 반이 되고, 현재 처리 위치를 기준으로 하여 4개의 정방형 코딩 유닛들로 분할된다. 각 분할된 코딩 유닛들에 대해서 상기와 같은 처리를 반복할 수 있다.If the information indicates that the coding unit is divided, the size of the coding unit to be divided becomes half of the current coding unit, and is divided into four square coding units based on the current processing position. The above-described processing may be repeated for each of the divided coding units.

도 5는 코딩 유닛을 분할하는 본 발명의 추가적인 실시예를 나타낸다. 본 발명의 추가적인 실시예에 따르면, 전술한 쿼드 트리 형태의 코딩 유닛은 수평 분할 또는 수직 분할의 바이너리 트리(binary tree) 구조로 더욱 분할될 수 있다. 즉, 루트 코딩 유닛에 대하여 정사각형의 쿼드 트리 분할이 먼저 적용되며, 쿼드 트리의 리프 노드에서 직사각형의 바이너리 트리 분할이 추가적으로 적용될 수 있다. 일 실시예에 따르면, 바이너리 트리 분할은 대칭적인 수평 분할 또는 대칭적인 수직 분할일 수 있으나, 본 발명은 이에 한정되지 않는다.5 shows a further embodiment of the present invention for dividing the coding unit. According to a further embodiment of the present invention, the coding unit in the form of a quad tree may be further divided into a binary tree structure of horizontal division or vertical division. That is, quadtree division of a square is first applied to the root coding unit, and rectangular binary tree division may be additionally applied at a leaf node of the quad tree. According to an embodiment, the binary tree division may be a symmetric horizontal division or a symmetric vertical division, but the present invention is not limited thereto.

바이너리 트리의 각 분할 노드에서, 분할 형태(즉, 수평 분할 또는 수직 분할)를 지시하는 플래그가 추가적으로 시그널링 될 수 있다. 일 실시예에 따르면, 상기 플래그의 값이 ‘0’인 경우 수평 분할이 지시되고, 상기 플래그의 값이 ‘1’인 경우 수직 분할이 지시될 수 있다.In each split node of the binary tree, a flag indicating a split type (ie, horizontal split or vertical split) may be additionally signaled. According to an embodiment, when the value of the flag is “0”, horizontal division may be indicated, and when the value of the flag is “1”, vertical division may be indicated.

다만, 본 발명의 실시예에서 코딩 유닛의 분할 방법은 전술한 방법들로 한정되지 않으며, 비대칭적인 수평/수직 분할, 3개의 직사각형 코딩 유닛으로 분할되는 트리플 트리(triple tree) 등이 적용될 수도 있다.However, in the embodiment of the present invention, a method of dividing a coding unit is not limited to the above-described methods, and asymmetric horizontal/vertical division, a triple tree divided into three rectangular coding units, and the like may be applied.

코딩을 위한 픽쳐 예측(모션 보상)은 더 이상 나누어지지 않는 코딩 유닛(즉 코딩 유닛 트리의 리프 노드)을 대상으로 이루어진다. 이러한 예측을 수행하는 기본 단위를 이하에서는 예측 유닛(prediction unit) 또는 예측 블록(prediction block)이라고 한다.Picture prediction (motion compensation) for coding is performed for coding units that are no longer divided (ie, leaf nodes of the coding unit tree). The basic unit that performs such prediction is hereinafter referred to as a prediction unit or a prediction block.

이하, 본 명세서에서 사용되는 유닛 이라는 용어는 예측을 수행하는 기본 단위인 상기 예측 유닛을 대체하는 용어로 사용될 수 있다. 다만, 본 발명이 이에 한정되는 것은 아니며, 더욱 광의적으로는 상기 코딩 유닛을 포함하는 개념으로 이해될 수 있다.Hereinafter, the term unit used in the present specification may be used as a term to replace the prediction unit, which is a basic unit for performing prediction. However, the present invention is not limited thereto, and more broadly, it may be understood as a concept including the coding unit.

디코딩이 수행되는 현재 유닛을 복원하기 위해서 현재 유닛이 포함된 현재 픽쳐 또는 다른 픽쳐들의 디코딩된 부분이 이용될 수 있다. 복원에 현재 픽쳐만을 이용하는, 즉 화면내 예측만을 수행하는 픽쳐(슬라이스)를 인트라 픽쳐 또는 I 픽쳐(슬라이스), 화면내 예측과 화면간 예측을 모두 수행할 수 있는 픽쳐(슬라이스)를 인터 픽쳐(슬라이스)라고 한다. 인터 픽쳐(슬라이스) 중 각 유닛을 예측하기 위하여 최대 하나의 모션 벡터 및 레퍼런스 인덱스를 이용하는 픽쳐(슬라이스)를 예측 픽쳐(predictive picture) 또는 P 픽쳐(슬라이스)라고 하며, 최대 두 개의 모션 벡터 및 레퍼런스 인덱스를 이용하는 픽쳐(슬라이스)를 쌍예측 픽쳐(Bi-predictive picture) 또는 B 픽쳐(슬라이스) 라고 한다.The current picture including the current unit or a decoded portion of other pictures may be used to restore the current unit on which decoding is performed. An intra picture or an I picture (slice) using only the current picture for restoration, i.e., a picture (slice) performing only intra prediction, and a picture (slice) capable of performing both intra prediction and inter prediction are inter-picture (slice). ). A picture (slice) using at most one motion vector and a reference index to predict each unit among inter-pictures (slices) is called a predictive picture or a P picture (slice), and up to two motion vectors and a reference index A picture (slice) using is referred to as a bi-predictive picture or a B picture (slice).

인트라 예측부에서는 현재 픽쳐 내의 복원된 영역들로부터 대상 유닛의 픽셀값을 예측하는 화면내 예측(Intra prediction)을 수행한다. 예를 들어, 현재 유닛을 중심으로, 좌측 및/또는 상단에 위치한 유닛들의 복원된 픽셀로부터 현재 유닛의 픽셀값을 예측할 수 있다. 이때, 현재 유닛의 좌측에 위치한 유닛들은 현재 유닛에 인접한 좌측 유닛, 좌측 상단 유닛 및 좌측 하단 유닛을 포함할 수 있다. 또한, 현재 유닛의 상단에 위치한 유닛들은 현재 유닛에 인접한 상단 유닛, 좌측 상단 유닛 및 우측 상단 유닛을 포함할 수 있다.The intra prediction unit performs intra prediction for predicting pixel values of the target unit from reconstructed regions in the current picture. For example, the pixel value of the current unit may be predicted from reconstructed pixels of units located on the left and/or upper side, centering on the current unit. In this case, units located to the left of the current unit may include a left unit, an upper left unit, and a lower left unit adjacent to the current unit. Also, units located at the top of the current unit may include an upper unit, an upper left unit, and an upper right unit adjacent to the current unit.

한편, 인터 예측부에서는 현재 픽쳐가 아닌 복원된 다른 픽쳐들의 정보를 이용하여 대상 유닛의 픽셀값을 예측하는 화면간 예측(Inter prediction)을 수행한다. 이때, 예측에 이용되는 픽쳐를 참조 픽쳐(reference picture)라고 한다. 화면간 예측 과정에서 현재 유닛을 예측하는데 어떤 참조 영역을 이용하는지는, 해당 참조 영역이 포함된 참조 픽쳐를 나타내는 인덱스 및 모션 벡터(motion vector) 정보 등을 이용하여 나타낼 수 있다.Meanwhile, the inter prediction unit performs inter prediction to predict a pixel value of a target unit by using information of reconstructed pictures other than the current picture. In this case, a picture used for prediction is referred to as a reference picture. In the inter prediction process, which reference region is used to predict the current unit may be indicated using an index indicating a reference picture including the reference region and motion vector information.

화면간 예측에는 L0 예측, L1 예측 및 쌍예측(Bi-prediction)이 있을 수 있다. L0 예측은 L0 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측이고, L1 예측은 L1 필쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측을 의미한다. 이를 위해서는 1세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 필요할 수 있다. 쌍예측 방식에서는 최대 2개의 참조 영역을 이용할 수 있는데, 이 2개의 참조 영역은 동일한 참조 픽쳐에 존재할 수도 있고, 서로 다른 픽쳐에 각각 존재할 수도 있다. 즉, 쌍예측 방식에서는 최대 2세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 이용될 수 있는데, 2개의 모션 벡터가 동일한 참조 픽쳐 인덱스에 대응될 수도 있고 서로 다른 참조 픽쳐 인덱스에 대응될 수도 있다. 이때, 참조 픽쳐들은 시간적으로 현재 픽쳐 이전이나 이후 모두에 표시(또는 출력)될 수 있다.Inter prediction may include L0 prediction, L1 prediction, and Bi-prediction. L0 prediction means prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 filter list. For this, one set of motion information (eg, a motion vector and a reference picture index) may be required. In the bi-prediction scheme, up to two reference regions may be used, and the two reference regions may exist in the same reference picture or may exist in different pictures. That is, in the bi-prediction method, up to two sets of motion information (for example, a motion vector and a reference picture index) may be used, and two motion vectors may correspond to the same reference picture index or to different reference picture indexes. May correspond. In this case, reference pictures may be displayed (or output) temporally before or after the current picture.

모션 벡터 및 참조 픽쳐 인덱스를 이용하여 현재 유닛의 참조 유닛을 획득할 수 있다. 상기 참조 유닛은 상기 참조 픽쳐 인덱스를 가진 참조 픽쳐 내에 존재한다. 또한, 상기 모션 벡터에 의해서 특정된 유닛의 픽셀값 또는 보간(interpolation)된 값이 상기 현재 유닛의 예측값(predictor)으로 이용될 수 있다. 서브펠(sub-pel) 단위의 픽셀 정확도를 갖는 모션 예측을 위하여 이를 테면, 휘도 신호에 대하여 8-탭 보간 필터가, 색차 신호에 대하여 4-탭 보간 필터가 사용될 수 있다. 다만, 서브펠 단위의 모션 예측을 위한 보간 필터는 이에 한정되지 않는다. 이와 같이 모션 정보를 이용하여, 이전에 디코딩된 픽쳐로부터 현재 유닛의 텍스쳐를 예측하는 모션 보상(motion compensation)이 수행된다.The reference unit of the current unit may be obtained using the motion vector and the reference picture index. The reference unit exists in a reference picture having the reference picture index. Further, a pixel value or an interpolated value of a unit specified by the motion vector may be used as a predictor of the current unit. For motion prediction with pixel accuracy in sub-pel units, for example, an 8-tap interpolation filter may be used for a luminance signal and a 4-tap interpolation filter may be used for a color difference signal. However, the interpolation filter for motion prediction in units of subpels is not limited thereto. In this way, motion compensation for predicting the texture of the current unit from the previously decoded picture is performed using the motion information.

이하, 도 6 및 도 7을 참고로 본 발명의 실시예에 따른 화면내 예측 방법을 더욱 구체적으로 설명하도록 한다. 전술한 바와 같이, 인트라 예측부에서는 현재 유닛의 좌측 및/또는 상단에 위치한 인접 픽셀들을 참조 픽셀로 이용하여 현재 유닛의 픽셀값을 예측한다.Hereinafter, an intra prediction method according to an embodiment of the present invention will be described in more detail with reference to FIGS. 6 and 7. As described above, the intra prediction unit predicts the pixel value of the current unit by using the adjacent pixels located on the left and/or top of the current unit as reference pixels.

도 6에 도시된 바와 같이, 현재 유닛의 크기가 NXN일 경우, 현재 유닛의 좌측 및/또는 상단에 위치한 최대 4N+1개의 인접 픽셀들을 사용하여 참조 픽셀들이 설정될 수 있다. 참조 픽셀로 사용될 적어도 일부의 인접 픽셀이 아직 복원되지 않은 경우, 인트라 예측부는 기 설정된 규칙에 따른 참조 샘플 패딩 과정을 수행하여 참조 픽셀을 획득할 수 있다. 또한, 인트라 예측부는 화면내 예측의 오차를 줄이기 위해 참조 샘플 필터링 과정을 수행할 수 있다. 즉, 인접 픽셀들 및/또는 참조 샘플 패딩 과정에 의해 획득된 픽셀들에 필터링을 수행하여 참조 픽셀들이 획득할 수 있다. 인트라 예측부는 이와 같이 획득된 참조 픽셀들을 이용하여 현재 유닛의 픽셀들을 예측한다.As illustrated in FIG. 6, when the size of the current unit is NXN, reference pixels may be set using up to 4N+1 adjacent pixels located on the left and/or top of the current unit. When at least some adjacent pixels to be used as reference pixels have not yet been reconstructed, the intra predictor may obtain a reference pixel by performing a reference sample padding process according to a preset rule. Also, the intra prediction unit may perform a reference sample filtering process to reduce an error in intra prediction. That is, reference pixels may be obtained by filtering adjacent pixels and/or pixels obtained by the reference sample padding process. The intra prediction unit predicts the pixels of the current unit by using the obtained reference pixels.

도 7은 화면내 예측에 사용되는 예측 모드들의 일 실시예를 도시한다. 화면내 예측을 위해, 화면내 예측 방향을 지시하는 화면내 예측 모드 정보가 시그널링될 수 있다. 현재 유닛이 화면내 예측 유닛일 경우, 비디오 신호 디코딩 장치는 비트스트림으로부터 현재 유닛의 화면내 예측 모드 정보를 추출한다. 비디오 신호 디코딩 장치의 인트라 예측부는 추출된 화면내 예측 모드 정보에 기초하여 현재 유닛에 대한 화면내 예측을 수행한다.7 illustrates an embodiment of prediction modes used for intra prediction. For intra prediction, intra prediction mode information indicating an intra prediction direction may be signaled. When the current unit is an intra prediction unit, the video signal decoding apparatus extracts intra prediction mode information of the current unit from the bitstream. The intra prediction unit of the video signal decoding apparatus performs intra prediction on the current unit based on the extracted intra prediction mode information.

본 발명의 일 실시예에 따르면, 화면내 예측 모드는 총 67개의 모드를 포함할 수 있다. 각각의 화면내 예측 모드는 기 설정된 인덱스(즉, 인트라 모드 인덱스)를 통해 지시될 수 있다. 예를 들어, 도 7에 도시된 바와 같이 인트라 모드 인덱스 0은 평면(planar) 모드를 지시하고, 인트라 모드 인덱스 1은 DC 모드를 지시하며, 인트라 모드 인덱스 2~66은 서로 다른 방향 모드들(즉, 각도 모드들)을 각각 지시할 수 있다. 화면내 예측부는 현재 유닛의 화면내 예측 모드 정보에 기초하여, 현재 유닛의 화면내 예측에 사용될 참조 픽셀들 및/또는 보간된 참조 픽셀들을 결정한다. 인트라 모드 인덱스가 특정 방향 모드를 지시할 경우, 현재 유닛의 현재 픽셀로부터 상기 특정 방향에 대응하는 참조 픽셀 또는 보간된 참조 픽셀이 현재 픽셀의 예측에 사용된다. 따라서, 화면내 예측 모드에 따라 서로 다른 세트의 참조 픽셀들 및/또는 보간된 참조 픽셀들이 화면내 예측에 사용될 수 있다.According to an embodiment of the present invention, the intra prediction mode may include a total of 67 modes. Each intra prediction mode may be indicated through a preset index (ie, an intra mode index). For example, as shown in FIG. 7, intra mode index 0 indicates planar mode, intra mode index 1 indicates DC mode, and intra mode indexes 2 to 66 indicate different direction modes (i.e. , Angle modes) can be indicated respectively. The intra prediction unit determines reference pixels and/or interpolated reference pixels to be used for intra prediction of the current unit based on the intra prediction mode information of the current unit. When the intra mode index indicates a specific direction mode, a reference pixel or an interpolated reference pixel corresponding to the specific direction from the current pixel of the current unit is used for prediction of the current pixel. Accordingly, different sets of reference pixels and/or interpolated reference pixels may be used for intra prediction according to the intra prediction mode.

참조 픽셀들 및 화면내 예측 모드 정보를 이용하여 현재 유닛의 화면내 예측이 수행되고 나면, 비디오 신호 디코딩 장치는 역변환부로부터 획득된 현재 유닛의 잔차 신호를 현재 유닛의 화면내 예측값과 더하여 현재 유닛의 픽셀 값들을 복원한다.After intra prediction of the current unit is performed using reference pixels and intra prediction mode information, the video signal decoding apparatus adds the residual signal of the current unit obtained from the inverse transform unit with the intra prediction value of the current unit. Restore pixel values.

도 8은 본 발명의 일 실시예에 따른 inter prediction을 나타낸 도면이다.8 is a diagram showing inter prediction according to an embodiment of the present invention.

앞서 설명한 것처럼 현재 픽쳐 또는 블락을 인코딩, 디코딩할 때 다른 픽쳐 또는 블락으로부터 예측할 수 있다. 즉, 다른 픽쳐 또는 블락과의 유사성에 기반하여 인코딩, 디코딩하는 것이 가능하다. 다른 픽쳐 또는 블락과 유사한 부분을 현재 픽쳐 또는 블락에서는 생략한 시그날링으로 인코딩, 디코딩할 수 있고, 이에 대해 이하에서 더 설명한다. 블락 단위의 예측을 하는 것이 가능하다.As described above, when encoding or decoding the current picture or block, prediction can be made from another picture or block. In other words, it is possible to encode and decode based on similarity with other pictures or blocks. A portion similar to another picture or block may be encoded and decoded by signaling omitted in the current picture or block, which will be described further below. It is possible to make predictions in blocks.

도 8을 참조하면 왼쪽에 Reference picture(참조 픽쳐)가 있고, 오른쪽에 Current picture(현재 픽쳐)가 있는데, current picture 또는 current picture의 일부를 reference picture 또는 reference picture의 일부와의 유사성을 이용해서 예측할 수 있다. 도 8의 current picture 안에 실선으로 나타낸 사각형이 현재 인코딩, 디코딩하는 블락이라고 했을 때 reference picture의 점선으로 나타낸 사각형으로부터 현재 블락을 예측할 수 있다. 이때 현재 블락이 참조해야할 블락(참조 블락)을 지시하는 정보가 존재할 수 있고, 이는 직접 시그날링 될 수도 있고, 시그날링 오버헤드를 줄이기 위해 어떠한 약속에 의해 만들어낼 수 있을 수도 있다. 상기 현재 블락이 참조해야할 블락을 지시하는 정보는 모션 벡터(motion vector)을 포함할 수 있다. 이는 현재 블락과 참조 블락 간의 픽쳐 내에서의 상대적인 위치를 나타내는 벡터일 수 있다. 도 8을 참조하면 reference picture의 점선으로 나타낸 부분이 존재하는데 현재 블락이 어떻게 이동하면 reference picture의 참조해야할 블락으로 이동할 수 있는지 나타내는 벡터가 모션 벡터일 수 있다. 즉, 현재 블락을 모션 벡터에 따라 움직이면 나오는 블락은 도 8의 current picture에 점선으로 나타낸 부분일 수 있고, 이 점선으로 나타낸 부분은 picture 안에서의 위치가 reference picture의 참조 블락 위치와 같을 수 있다.Referring to FIG. 8, there is a reference picture (reference picture) on the left and a current picture (current picture) on the right, and a current picture or a part of the current picture can be predicted using similarity with the reference picture or a part of the reference picture. have. Assuming that a rectangle indicated by a solid line in the current picture of FIG. 8 is a block currently encoding and decoding, the current block may be predicted from a rectangle indicated by a dotted line of the reference picture. At this time, information indicating a block (reference block) to be referred to by the current block may exist, which may be signaled directly or may be generated by a certain promise to reduce signaling overhead. Information indicating a block to be referred to by the current block may include a motion vector. This may be a vector indicating a relative position in the picture between the current block and the reference block. Referring to FIG. 8, there is a portion indicated by a dotted line of a reference picture, and a vector indicating how a current block can move to a block to be referred to of a reference picture may be a motion vector. That is, the block that appears when the current block is moved according to the motion vector may be a portion indicated by a dotted line in the current picture of FIG. 8, and the portion indicated by the dotted line may have a position in the picture equal to the reference block position of the reference picture.

또한 상기 현재 블락이 참조해야할 블락을 지시하는 정보는 레퍼런스 픽쳐(reference picture)를 나타내는 정보를 포함할 수 있다. 레퍼런스 픽쳐를 나타내는 정보를 레퍼런스 픽쳐 리스트와 레퍼런스 픽쳐 인덱스를 포함할 수 있다. 레퍼런스 픽쳐 리스트는 레퍼런스 픽쳐들을 나타내는 리스트이고 레퍼런스 픽쳐 리스트에 포함된 레퍼런스 픽쳐에서 레퍼런스 블락을 사용하는 것이 가능하다. 즉 레퍼런스 픽쳐 리스트에 포함된 레퍼런스 픽쳐로부터 현재 블락을 예측하는 것이 가능하다. 또한 레퍼런스 픽쳐 인덱스는 사용할 레퍼런스 픽쳐를 지시하기 위한 인덱스일 수 있다.In addition, information indicating a block to be referred to by the current block may include information indicating a reference picture. Information indicating the reference picture may include a reference picture list and a reference picture index. The reference picture list is a list representing reference pictures, and it is possible to use a reference block in a reference picture included in the reference picture list. That is, it is possible to predict the current block from the reference picture included in the reference picture list. Also, the reference picture index may be an index for indicating a reference picture to be used.

도 9는 본 발명의 일 실시예에 따른 모션 벡터 시그날링 방법을 나타낸 도면이다.9 is a diagram illustrating a motion vector signaling method according to an embodiment of the present invention.

본 발명의 일 실시예에 따르면 모션 벡터(motion vector; MV)는 motion vector predictor(MVP)에 기초하여 생성하는 것이 가능하다. 예를 들면 아래와 같이 motion vector predictor가 motion vector가 될 수 있다.According to an embodiment of the present invention, a motion vector (MV) can be generated based on a motion vector predictor (MVP). For example, the motion vector predictor can be a motion vector as shown below.

MV = MVPMV = MVP

또다른 예를 들면 아래와 같이 motion vector는 motion vector difference(MVD)에 기초할 수 있다. motion vector predictor에 정확한 motion vector를 나타내기 위해 motion vector difference(MVD)를 더해줄 수 있다.As another example, the motion vector can be based on the motion vector difference (MVD) as follows. Motion vector difference (MVD) can be added to the motion vector predictor to represent the correct motion vector.

MV = MVP + MVDMV = MVP + MVD

또한 비디오 코딩에서 인코더에서 결정한 motion vector 정보를 디코더로 전송하고, 디코더는 수신한 motion vector 정보로부터 motion vector를 생성하고 예측 블록을 결정하는 것이 가능하다. 예를 들어 상기 motion vector 정보는 motion vector predictor에 관한 정보, motion vector difference를 포함할 수 있다. 이때 모드에 따라서 상기 motion vector 정보의 구성 요소가 달라질 수 있다. 예를 들어 merge mode에서는 상기 motion vector 정보는 motion vector predictor에 관한 정보를 포함하고, motion vector difference를 포함하지 않을 수 있다. 또다른 예로 AMVP(advanced motion vector prediction) mode에서는 상기 motion vector 정보는 motion vector predictor에 관한 정보를 포함하고, motion vector difference를 포함할 수 있다.In addition, in video coding, motion vector information determined by an encoder is transmitted to a decoder, and the decoder can generate a motion vector from the received motion vector information and determine a prediction block. For example, the motion vector information may include information on a motion vector predictor and a motion vector difference. In this case, a component of the motion vector information may vary depending on the mode. For example, in the merge mode, the motion vector information may include information on a motion vector predictor and may not include a motion vector difference. As another example, in the advanced motion vector prediction (AMVP) mode, the motion vector information may include information on a motion vector predictor and may include a motion vector difference.

Motion vector predictor에 관한 정보를 결정, 송신, 수신하기 위해서 인코더와 디코더는 동일한 방법으로 MVP candidates를 생성할 수 있다. 예를 들어 인코더와 디코더는 동일한 순서로 동일한 MVP candidate를 생성할 수 있다. 그리고 인코더는 생성한 MVP candidates 중에서 결정한 MVP를 나타내는 인덱스를 디코더로 전송하고, 디코더는 이 인덱스를 기초로 결정된 MVP 및 MV를 알아내는 것이 가능하다.In order to determine, transmit, and receive information about the motion vector predictor, the encoder and decoder can generate MVP candidates in the same way. For example, the encoder and the decoder can generate the same MVP candidate in the same order. In addition, the encoder transmits an index representing the determined MVP among the generated MVP candidates to the decoder, and the decoder can find out the MVP and MV determined based on this index.

MVP candidate 및 MVP candidate 생성 방법은 spatial candidate, temporal candidate 등을 포함할 수 있다. Spatial candidate는 현재 블록으로부터 일정한 위치에 있는 블록에 대한 motion vector일 수 있다. 예를 들어 현재 블록과 인접하거나 인접하지 않은 블록이나 위치에 해당하는 motion vector일 수 있다. Temporal candidate는 현재 픽쳐와 다른 픽쳐 내의 블록에 해당하는 motion vector일 수 있다. 또는 MVP candidate는 affine motion vector, ATMVP, STMVP, 앞서 설명한 motion vector 들의 combination, 앞서 설명한 motion vector 들의 평균 vector, zero motion vector 등을 포함할 수 있다.The MVP candidate and MVP candidate generation method may include a spatial candidate and a temporal candidate. Spatial candidate may be a motion vector for a block located at a certain position from the current block. For example, it may be a motion vector corresponding to a block or position adjacent to or not adjacent to the current block. The temporal candidate may be a motion vector corresponding to a block in a picture different from the current picture. Alternatively, the MVP candidate may include an affine motion vector, ATMVP, STMVP, a combination of motion vectors described above, an average vector of motion vectors described above, a zero motion vector, and the like.

또한 앞서 설명한 레퍼런스 픽쳐를 나타내는 정보 또한 인코더에서 디코더로 전송될 수 있다. 또한 MVP candidate에 해당하는 레퍼런스 픽쳐가 레퍼런스 픽쳐를 나타내는 정보에 해당하지 않을 때 motion vector scaling을 할 수 있다. Motion vector scaling은 현재 픽쳐의 POC(picture order count), 현재 블록의 레퍼런스 픽쳐의 POC, MVP candidate의 레퍼런스 픽쳐의 POC, MVP candidate에 기초한 계산일 수 있다.In addition, information indicating the reference picture described above may also be transmitted from the encoder to the decoder. Also, motion vector scaling can be performed when the reference picture corresponding to the MVP candidate does not correspond to information indicating the reference picture. Motion vector scaling may be a calculation based on a picture order count (POC) of a current picture, a POC of a reference picture of a current block, a POC of a reference picture of an MVP candidate, and an MVP candidate.

도 10은 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.10 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.

Motion vector difference는 motion vector difference의 sign과 absolute value가 나누어서 코딩될 수 있다. 즉, motion vector difference의 sign과 absolute value는 다른 syntax일 수 있다. 또한 motion vector difference의 absolute value는 값이 직접 코딩될 수도 있지만 도 10과 같이 absolute value가 N보다 큰지 여부를 나타내는 flag를 포함하여 코딩될 수 있다. 만약 absolute value가 N보다 큰 경우 (absolute value - N)의 값이 함께 시그날링 될 수 있다. 도 10의 예에서는 abs_mvd_greater0_flag가 전송될 수 있고, 이 flag는 absolute value가 0보다 큰지를 나타내는 flag일 수 있다. 만약 absolute value가 0보다 크지 않다고 abs_mvd_greater0_flag가 나타내진 경우 absolute value가 0인 것으로 결정할 수 있다. 또한 만약 absolute value가 0보다 크다고 abs_mvd_greater0_flag가 나타내진 경우 추가 syntax가 존재할 수 있다. 예를 들어 abs_mvd_greater1_flag가 존재할 수 있고, 이 flag는 absolute value가 1보다 큰지를 나타내는 flag일 수 있다. 만약 absolute value가 1보다 크지 않다고 abs_mvd_greater1_flag가 나타내진 경우 absolute value가 1인 것으로 결정할 수 있다. 만약 absolute value가 1보다 크다고 abs_mvd_greater1_flag가 나타내진 경우 추가 syntax가 존재할 수 있다. 예를 들어 abs_mvd_minus2가 존재할 수 있는데, 이것은 (absolute value - 2)의 값일 수 있다. 앞서 설명한 abs_mvd_greater0_flag, abs_mvd_greater1_flag를 통해 absolute value가 1보다 크다고(2 이상이라고) 결정되었으므로 (absolute value - 2)를 나타내는 것이다. abs_mvd_minus2가 variable length로 binarization 되는 경우 더 적은 비트로 시그날링하기 위한 것이다. 예를 들면 Exp-Golomb, truncated unary, truncated Rice 등의 variable length인 binarization 방법이 존재한다. 또한 mvd_sign_flag는 motion vector difference의 sign을 나타내는 flag일 수 있다.The motion vector difference can be coded by dividing the sign and absolute value of the motion vector difference. That is, the sign and absolute value of the motion vector difference may have different syntax. In addition, the absolute value of the motion vector difference may be directly coded, but may be coded by including a flag indicating whether the absolute value is greater than N as shown in FIG. 10. If the absolute value is greater than N, the value of (absolute value-N) can be signaled together. In the example of FIG. 10, abs_mvd_greater0_flag may be transmitted, and this flag may be a flag indicating whether the absolute value is greater than 0. If abs_mvd_greater0_flag indicates that the absolute value is not greater than 0, it can be determined that the absolute value is 0. Also, if abs_mvd_greater0_flag is indicated when the absolute value is greater than 0, additional syntax may exist. For example, abs_mvd_greater1_flag may exist, and this flag may be a flag indicating whether the absolute value is greater than 1. If abs_mvd_greater1_flag is indicated that the absolute value is not greater than 1, it can be determined that the absolute value is 1. If abs_mvd_greater1_flag is indicated when the absolute value is greater than 1, additional syntax may exist. For example, abs_mvd_minus2 may exist, which may be a value of (absolute value-2). It is determined that the absolute value is greater than 1 (more than 2) through abs_mvd_greater0_flag and abs_mvd_greater1_flag described above, indicating (absolute value-2). When abs_mvd_minus2 is binarized to a variable length, this is for signaling with fewer bits. For example, there are variable length binarization methods such as Exp-Golomb, truncated unary, and truncated Rice. Also, mvd_sign_flag may be a flag indicating a sign of a motion vector difference.

이 실시예에서 코딩 방법을 motion vector difference를 통해 설명했지만 motion vector difference 이외의 정보도 sign과 absolute value에 관해 나누고, absolute value는 absolute value가 어떤 값보다 큰지 여부를 나타내는 flag와 absolute value에서 상기 어떤 값을 뺀 값으로 코딩하는 것이 가능하다.In this embodiment, the coding method was described through motion vector difference, but information other than motion vector difference is also divided about sign and absolute value, and the absolute value is a flag indicating whether the absolute value is greater than a certain value and the value of the absolute value. It is possible to code by subtracting.

또한 도 10에서 [0]과 [1]은 component index를 나타낼 수 있다. 예를 들면 x-component, y-component를 나타낼 수 있다.In addition, in FIG. 10, [0] and [1] may represent component indexes. For example, it can represent x-component and y-component.

도 11은 본 발명의 일 실시예에 따른 adaptive motion vector resolution 시그날링을 나타낸 도면이다.11 is a diagram showing adaptive motion vector resolution signaling according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 motion vector 또는 motion vector difference를 나타내는 resolution은 다양할 수 있다. 다시 말하면 motion vector 또는 motion vector difference가 코딩되는 resolution은 다양할 수 있다. 예를 들면 resolution은 pixel(pel)을 기초로 나타낼 수 있다. 예를 들어 1/4(quarter), 1/2(half), 1(integer), 2, 4 pixel 등의 단위로 motion vector 또는 motion vector difference를 시그날링할 수 있다. 예를 들어 16을 나타내고 싶을 때 1/4 단위로 하면 64로 코딩하고(1/4 * 64 = 16), 1 단위로 하면 16으로 코딩하고(1 * 16 = 16), 4 단위로 하면 4로 코딩할 수 있다(4 *. 4 = 16). 즉 다음과 같이 값을 결정할 수 있다.According to an embodiment of the present invention, resolution representing a motion vector or a motion vector difference may vary. In other words, the resolution at which the motion vector or motion vector difference is coded may vary. For example, resolution can be expressed based on pixel (pel). For example, a motion vector or a motion vector difference may be signaled in units such as 1/4 (quarter), 1/2 (half), 1 (integer), 2, and 4 pixels. For example, if you want to represent 16, if you use a 1/4 unit, you code 64 (1/4 * 64 = 16), and if you use 1 unit, you code 16 (1 * 16 = 16), and if you use 4 units, it is 4 Can code (4 *. 4 = 16). That is, the value can be determined as follows.

valueDetermined = resolution*valuePerResolutionvalueDetermined = resolution*valuePerResolution

여기서 valueDetermined는 전달하는 값, 본 실시예에서는 motion vector 또는 motion vector difference 일 수 있다. 또한 valuePerResolution은 valueDetermined는 [/resolution] 단위로 나타낸 값일 수 있다.Here, valueDetermined may be a value to be transferred, and in this embodiment, a motion vector or a motion vector difference. In addition, valuePerResolution may be a value expressed in units of valueDetermined in [/resolution].

이때 motion vector 또는 motion vector difference로 시그날링하는 값이 resolution으로 나누어 떨어지지 않는 경우 rounding 등으로 prediction 성능이 가장 좋은 motion vector 또는 motion vector difference가 아닌 부정확한 값을 보낼 수 있다. High resolution을 사용하면 부정확함이 떨어질 수 있지만 코딩되는 값이 크므로 많은 비트를 사용할 수 있고, low resolution을 사용하면 부정확함이 높아질 수 있지만 코딩되는 값이 작으므로 적은 비트를 사용할 수 있다.At this time, if the value signaled by the motion vector or the motion vector difference is not divided by the resolution, an incorrect value other than the motion vector or the motion vector difference with the best prediction performance may be transmitted through rounding or the like. If high resolution is used, inaccuracy may be reduced, but many bits can be used because the coded value is large, and if low resolution is used, inaccuracy may be increased, but because the coded value is small, fewer bits can be used.

또한 상기 resolution을 블락, CU, slice 등의 단위로 다르게 설정하는 것이 가능하다. 따라서 단위에 맞도록 adaptive하게 resolution을 적용할 수 있다.Also, it is possible to set the resolution differently in units of block, CU, slice, etc. Therefore, resolution can be adaptively applied to fit the unit.

상기 resolution은 인코더에서 디코더로 시그날링될 수 있다. 이때 resolution에 대한 시그날링은 앞서 설명한 variable length로 binarization한 시그날링일 수 있다. 이러한 경우 가장 작은 값(가장 앞에 있는 값)에 해당하는 인덱스로 시그날링하는 경우 시그날링 오버헤드가 적어지게 된다.The resolution can be signaled from the encoder to the decoder. At this time, the signaling for resolution may be the signaling binarized with the variable length described above. In this case, when signaling with an index corresponding to the smallest value (the value in front of it), the signaling overhead is reduced.

일 실시예로 high resolution(자세히 시그날링)부터 low resolution 순서대로 시그날링 인덱스에 매칭시킬 수 있다.In one embodiment, the signaling index may be matched in order from high resolution (detail signaling) to low resolution.

도 11은 3가지 resolution에 대한 시그날링을 나타내고 있다. 이러한 경우 3가지 시그날링은 0, 10, 11일 수 있고, 3가지 시그날링 각각이 resolution 1, resolution 2, resolution 3에 해당할 수 있다. resolution 1을 시그날링 하는 데에는 1비트가 필요하고 나머지 resolution을 시그날링 하는 데에 2비트가 필요하므로 resolution 1을 시그날링 할 때 시그날링 오버헤드가 적다. 도 11의 예에서는 resolution 1, resolution 2, resolution 3이 각각 1/4, 1, 4 pel이다.11 shows signaling for three resolutions. In this case, the three signaling can be 0, 10, 11, and each of the three signaling can correspond to resolution 1, resolution 2, and resolution 3. Signaling overhead is small when signaling resolution 1 because 1 bit is required to signal resolution 1 and 2 bits are required to signal the remaining resolution. In the example of FIG. 11, resolution 1, resolution 2, and resolution 3 are 1/4, 1, and 4 pel, respectively.

이하의 발명들에서 motion vector resolution은 motion vector difference의 resolution을 의미하는 것일 수 있다.In the following inventions, motion vector resolution may mean resolution of motion vector difference.

도 12는 본 발명의 일 실시예에 따른 inter prediction 관련 syntax를 나타낸 도면이다.12 is a diagram showing syntax related to inter prediction according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 inter prediction 방법은 skip mode, merge mode, inter mode 등을 포함할 수 있다. 일 실시예를 따르면 skip mode에서는 residual signal이 전송되지 않을 수 있다. 또한 skip mode에서 merge mode와 같은 MV 결정 방법을 사용할 수 있다. Skip mode 사용 여부는 skip flag에 따라 결정될 수 있다. 도 12를 참조하면 cu_skip_flag 값에 따라 skip mode 사용 여부가 결정될 수 있다.According to an embodiment of the present invention, the inter prediction method may include a skip mode, a merge mode, and an inter mode. According to an embodiment, a residual signal may not be transmitted in the skip mode. Also, in skip mode, the same MV determination method as merge mode can be used. Whether to use the skip mode may be determined according to the skip flag. Referring to FIG. 12, whether to use the skip mode may be determined according to a cu_skip_flag value.

일 실시예를 따르면 merge mode에서는 motion vector difference를 사용하지 않을 수 있다. Motion candidate index를 기초로 motion vector를 결정할 수 있다. Merge mode 사용 여부는 merge flag에 따라 결정될 수 있다. 도 12를 참조하면 merge_flag 값에 따라 merge mode 사용 여부가 결정될 수 있다. 또한 skip mode를 사용하지 않는 경우에 merge mode를 사용하는 것이 가능하다.According to an embodiment, the motion vector difference may not be used in the merge mode. A motion vector can be determined based on the motion candidate index. Whether to use the merge mode may be determined according to the merge flag. Referring to FIG. 12, whether to use a merge mode may be determined according to a merge_flag value. Also, it is possible to use merge mode when skip mode is not used.

Skip mode 또는 merge mode에서 하나 이상의 candidate list 종류 중에서 선택적으로 사용하는 것이 가능하다. 예를 들어 merge candidate 또는 subblock merge candidate를 사용하는 것이 가능하다. 또한 merge candidate은 spatial neighboring candidate, temporal candidate 등을 포함할 수 있다. 또한 merge candidate는 현재 block(CU) 전체에 대한 motion vector를 사용하는 candidate를 포함할 수 있다. 즉, 현재 block에 속하는 각 subblock의 motion vector가 같은 candidate를 포함할 수 있다. 또한 subblock merge candidate는 subblock-based temporal MV, affine merge candidate 등을 포함할 수 있다. 또한 subblock merge candidate는 현재 block(CU)의 subblock 별로 다른 motion vector를 사용하는 것이 가능한 candidate를 포함할 수 있다. Affine merge candidate는 affine motion prediction의 control point motion vector를 결정할 때 motion vector difference를 사용하지 않고 결정하는 방법으로 만든 방법일 수 있다. 또한 subblock merge candidate는 현재 block에서 subblock 단위로 motion vector를 결정하는 방법들을 포함할 수 있다. 예를 들어 subblock merge candidate는 앞서 언급한 subblock-based temporal MV와 affine merge candidate 이외에도 planar MV, regression based MV, STMVP 등을 포함할 수 있다.It is possible to selectively use one or more candidate list types in skip mode or merge mode. For example, it is possible to use a merge candidate or a subblock merge candidate. In addition, the merge candidate may include a spatial neighboring candidate and a temporal candidate. Also, the merge candidate may include a candidate that uses a motion vector for the entire current block (CU). That is, the motion vector of each subblock belonging to the current block may contain the same candidate. In addition, the subblock merge candidate may include subblock-based temporal MV, affine merge candidate, etc. In addition, the subblock merge candidate may include a candidate capable of using a different motion vector for each subblock of the current block (CU). Affine merge candidate may be a method created by determining a control point motion vector of affine motion prediction without using a motion vector difference. In addition, the subblock merge candidate may include methods of determining a motion vector in units of subblocks in the current block. For example, the subblock merge candidate may include planar MV, regression based MV, STMVP, etc. in addition to the subblock-based temporal MV and affine merge candidate mentioned above.

일 실시예를 따르면 inter mode에서는 motion vector difference를 사용할 수 있다. Motion candidate index를 기초로 motion vector predictor를 결정하고 상기 motion vector predictor와 motion vector difference를 기초로 motion vector를 결정할 수 있다. Inter mode 사용 여부는 다른 mode들의 사용 여부에 따라 결정될 수 있다. 또다른 실시예로 inter mode 사용 여부는 flag에 의해 결정될 수 있다. 도 12에서는 다른 mode들인 skip mode와 merge mode를 사용하지 않는 경우에 inter mode를 사용하는 예를 나타내고 있다.According to an embodiment, a motion vector difference may be used in inter mode. A motion vector predictor may be determined based on a motion candidate index, and a motion vector may be determined based on the motion vector predictor and a motion vector difference. Whether to use the inter mode may be determined according to whether other modes are used. In another embodiment, whether to use the inter mode may be determined by a flag. 12 shows an example of using the inter mode when other modes such as skip mode and merge mode are not used.

Inter mode는 AMVP mode, affine inter mode 등을 포함할 수 있다. Inter mode는 motion vector predictor와 motion vector difference를 기초로 motion vector를 결정하는 모드일 수 있다. Affine inter mode는 affine motion prediction의 control point motion vector를 결정할 때 motion vector difference를 사용하는 방법일 수 있다.Inter mode may include AMVP mode, affine inter mode, and the like. Inter mode may be a mode for determining a motion vector based on a motion vector predictor and a motion vector difference. Affine inter mode may be a method of using a motion vector difference when determining a control point motion vector of affine motion prediction.

도 12를 참조하면 skip mode 또는 merge mode로 결정된 후에 subblock merge candidate를 사용할 지, merge candidate를 사용할 지 결정할 수 있다. 예를 들면 특정 조건을 만족하는 경우에 subblock merge candidate를 사용하는지 여부를 나타내는 merge_subblock_flag를 parsing할 수 있다. 또한 상기 특정 조건은 block size와 관련된 조건일 수 있다. 예를 들면 width, height, area 등에 관한 조건일 수 있고, 이것들을 조합하여 사용할 수도 있다. 도 12를 참조하면 예를 들어 현재 block(CU)의 width 및 height가 특정값 이상일 때의 조건일 수 있다. merge_subblock_flag를 parsing하는 경우에는 그 값을 0으로 infer할 수 있다. 만약 merge_subblock_flag가 1인 경우에 subblock merge candidate를 사용하고 0인 경우에 merge candidate를 사용하는 것일 수 있다. Subblock merge candidate를 사용하는 경우에 candidate index인 merge_subblock_idx를 parsing할 수 있고, merge candidate를 사용하는 경우에 candidate index인 merge_idx를 parsing할 수 있다. 이때 candidate list의 maximum 개수가 1인 경우에는 parsing하지 않을 수 있다. merge_subblock_idx 또는 merge_idx를 parsing하지 않는 경우에는 0으로 infer할 수 있다.Referring to FIG. 12, it is possible to determine whether to use a subblock merge candidate or a merge candidate after determining as a skip mode or a merge mode. For example, when a specific condition is satisfied, a merge_subblock_flag indicating whether to use a subblock merge candidate can be parsed. Also, the specific condition may be a condition related to block size. For example, it can be conditions related to width, height, area, etc. You can also use them in combination. Referring to FIG. 12, for example, it may be a condition when the width and height of the current block (CU) are greater than or equal to a specific value. When parsing the merge_subblock_flag, the value can be inferred to 0. If merge_subblock_flag is 1, the subblock merge candidate may be used, and if it is 0, the merge candidate may be used. When using the subblock merge candidate, the candidate index merge_subblock_idx can be parsed, and when the merge candidate is used, the candidate index merge_idx can be parsed. In this case, if the maximum number of candidate list is 1, parsing may not be performed. If merge_subblock_idx or merge_idx is not parsed, it can be inferred to 0.

도 12는 coding_unit 함수를 나타내고 있는데, intra prediction 관련 내용은 생략된 것일 수 있고, 도 12는 inter prediction으로 결정된 경우를 나타내는 것일 수 있다.12 shows a coding_unit function, and content related to intra prediction may be omitted, and FIG. 12 may indicate a case where inter prediction is determined.

도 13은 본 발명의 일 실시예에 따른 merge with MVD(MMVD)를 나타낸 도면이다.13 is a diagram illustrating merge with MVD (MMVD) according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 MVP(motion vector predictor)와 MVD(motion vector difference)에 기초하여 MV(motion vector)를 결정하는 것이 가능하다. 이때 MVP를 base MV(baseMV)라고 부를 수 있다. 도 13을 참조하면 base MV와 MVD를 더해서 MV를 결정하는 것이 가능하다. MVD는 MVP를 refine하는 값일 수 있고, refineMV일 수 있다.According to an embodiment of the present invention, it is possible to determine a motion vector (MV) based on a motion vector predictor (MVP) and a motion vector difference (MVD). At this time, the MVP may be called a base MV (baseMV). Referring to FIG. 13, it is possible to determine the MV by adding the base MV and the MVD. The MVD may be a value that refines MVP or may be refineMV.

본 발명의 일 실시예를 따르면 MMVD에서 MV는 base MV, distance, direction에 의해 결정하는 것이 가능하다.According to an embodiment of the present invention, in MMVD, MV can be determined by base MV, distance, and direction.

또한 본 발명의 일 실시예에 따르면 base MV는 다른 candidate list로부터 결정되는 것이 가능하다. 예를 들면 base MV는 merge candidate list로부터 결정되는 것이 가능하다. 또한 다른 candidate list의 일부로부터 base MV를 결정하는 것이 가능하다. 또한 상기 다른 candidate list의 일부는 상기 다른 candidate list의 앞부분 일부(인덱스가 작은 쪽)인 것이 가능하다. 더 구체적으로 merge candidates 중 앞쪽 2개의 candidates를 이용해 base MV를 결정하는 것이 가능하다. 또한 이를 위해 candidate index를 인코더에서 디코더로 시그날링하는 것이 가능하다. 도 13을 참조하면 base MV를 시그날링하는 인덱스인 Base candidate IDX를 나타내고 있다. 이 인덱스에 따라 candidate list의 candidates 중에서 어떤 것을 base MV로 사용할지 결정할 수 있다.In addition, according to an embodiment of the present invention, the base MV may be determined from another candidate list. For example, the base MV can be determined from a merge candidate list. It is also possible to determine the base MV from some of the other candidate lists. In addition, a part of the other candidate list may be a part of the front part of the other candidate list (the side with a smaller index). More specifically, it is possible to determine the base MV using the first two candidates among merge candidates. Also, for this, it is possible to signal the candidate index from the encoder to the decoder. Referring to FIG. 13, Base candidate IDX, which is an index signaling base MV, is shown. According to this index, it is possible to determine which of the candidates in the candidate list to use as the base MV.

본 발명의 일 실시예를 따르면 도 9 내지 도 12에서 설명한 MVD와 다른 MVD가 존재할 수 있다. 예를 들면 MMVD에서의 MVD는 도 9 내지 도 12에서 설명한 MVD와 다를 수 있다. 다른 MVD라는 것은 간략화된 MVD, 적은 분해능의 MVD, 가능한 경우의 수가 적은 MVD(가짓수가 적은 MVD), 시그날링 방법이 다른 MVD 등을 의미할 수 있다.According to an embodiment of the present invention, an MVD different from the MVD described in FIGS. 9 to 12 may exist. For example, the MVD in MMVD may be different from the MVD described in FIGS. 9 to 12. The different MVD may mean a simplified MVD, an MVD having a small resolution, an MVD having a small number of possible cases (a small number of MVDs), an MVD having a different signaling method, and the like.

예를 들어 도 9 내지 도 12에서 설명한 기존 AMVP, affine inter mode 등에서 사용하는 MVD는 어떤 시그날링 단위(예를 들면 x-pel)에 대해 x, y 축으로 모든 영역, 예를 들면 picture를 기초로한 영역(예를 들면 picture 영역 또는 picture와 주변 영역을 포함한 영역)을 균일한 간격으로 모두 나타낼 수 있지만 MMVD에서의 MVD는 어떤 시그날링 단위에 대해 나타낼 수 있는 단위가 한정적일 수 있다. 또한 나타낼 수 있는 부분이 간격상 균일하지 않을 수 있다. 또한 MMVD에서의 MVD는 어떤 시그날링 단위에 대해 특정 방향만을 나타낼 수 있을 수 있다.For example, the MVD used in the existing AMVP, affine inter mode, etc. described in FIGS. 9 to 12 is based on all regions, e.g., pictures, in the x and y axes for a certain signaling unit (e.g. Although one area (eg, a picture area or an area including a picture and a surrounding area) can be expressed at uniform intervals, the MVD in MMVD may have a limited number of units that can be expressed for a certain signaling unit. In addition, the visible portion may not be uniform in intervals. In addition, MVD in MMVD may indicate only a specific direction for a certain signaling unit.

또한 MMVD에서의 MVD는 distance와 direction에 기초하는 것이 가능하다. 도 13을 참조하면 MMVD에서의 distance 시그날링인 Distance IDX와 direction 시그날링인 Direction IDX에 따른 distance와 direction이 기설정되어있을 수 있다. Distance는 x-pel 단위의 MVD 크기(절대값일 수 있다.)를 나타낼 수 있고, direction은 MVD의 방향을 나타낼 수 있다. 또한 distance 시그날링에서 작은 distance를 작은 index로 시그날링하는 것이 가능하다. 즉, fixed length signaling이 아닌 경우 작은 distance를 적은 비트로 시그날링하는 것이 가능하다.Also, MVD in MMVD can be based on distance and direction. Referring to FIG. 13, distance and direction according to Distance IDX, which is distance signaling in MMVD, and Direction IDX, which is direction signaling, may be preset. Distance may represent the size of the MVD (may be an absolute value) in units of x-pel, and direction may represent the direction of the MVD. Also, in distance signaling, it is possible to signal a small distance with a small index. That is, in the case of non-fixed length signaling, it is possible to signal a small distance with fewer bits.

또한 MVD는 시그날링된 MV 또는 시그날링된 MV에 기초한 MV를 사용하는 것이 가능하다. 예를 들어 상기 시그날링된 MV에 기초한 MV는 상기 시그날링된 MV의 부호를 반대로 한 것일 수 있다. 예를 들어 MVD 시그날링이 어떤 reference list에 해당하는 값을 기초로 이루어지고 상기 어떤 reference list와 다른 reference list에 해당하는 값은 상기 어떤 reference list에 해당하는 값(즉 시그날링된 MVD)을 그대로 쓰거나 부호를 바꾸어서 쓸 수 있다. 그대로 쓸 지, 부호를 바꾸어서 쓸 지는 현재 picture와 어떤 reference list의 reference picture 간의 POC 관계 및 현재 picture와 상기 어떤 reference list와 다른 reference list의 reference picture 간의 POC 관계에 의해 결정될 수 있다. 더 구체적으로 reference list L0와 L1을 모두 사용하는 경우에도 MVD는 1개만 시그날링될 수 있다. 예를 들어 L0에 해당하는 MVD가 시그날링될 수 있다. 그리고 L1에 해당하는 MVD는 L0에 해당하는 MVD를 기초로 결정될 수 있다. 예를 들어 L1에 해당하는 MVD는 L0에 해당하는 MVD 그대로이거나 L0에 해당하는 MVD의 부호를 바꾼 값일 수 있다. 또한 이것은 현재 picture와 L0 reference picture 간의 POC 관계 및 현재 picture와 L1 reference pictrue 간의 POC 관계에 의해 결정될 수 있다. 예를 들어 DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ] ) 값이 0보다 큰지, 작은지에 따라 L0에 해당하는 MVD를 L1에 그대로 쓸지 변형하여 쓸지 결정할 수 있다. 또한 DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ] )가 0보다 크다는 것은 L0 reference picture와 L1 reference picture가 모두 현재 picture보다 시간적으로 앞에 있거나 모두 현재 picture보다 시간적으로 뒤에 있는 것일 수 있다. 따라서 이 경우 L0 MVD와 L1 MVD의 부호가 같은 것이 가능하다. 또한 DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ] )가 0보다 작다는 것은 L0 reference picture와 L1 reference picture 중 하나는 현재 picture보다 시간적으로 앞에 있고 나머지 하나는 현재 picture보다 시간적으로 뒤에 있는 것일 수 있다. 따라서 이 경우 L0 MVD와 L1 MVD의 부호가 다른 것이 가능하다. 또한 시간적으로 앞에 있는 것은 POC가 작은 것 시간적으로 뒤에 있는 것은 POC가 큰 것일 수 있다. POC는 picture order count를 의미할 수 있다.It is also possible for the MVD to use a signaled MV or an MV based on the signaled MV. For example, the MV based on the signaled MV may be a sign of the signaled MV inverted. For example, MVD signaling is performed based on a value corresponding to a reference list, and the value corresponding to the reference list and other reference list is written as it is, or the value corresponding to the reference list (that is, signaled MVD) It can be written by changing the sign. Whether to write as it is or by changing the code may be determined by the POC relationship between the current picture and the reference picture of a reference list, and the POC relationship between the current picture and the reference picture of the reference list and another reference list. More specifically, even when both the reference lists L0 and L1 are used, only one MVD can be signaled. For example, an MVD corresponding to L0 may be signaled. In addition, the MVD corresponding to L1 may be determined based on the MVD corresponding to L0. For example, the MVD corresponding to L1 may be the same as the MVD corresponding to L0 or a value obtained by changing the sign of the MVD corresponding to L0. Also, this may be determined by the POC relationship between the current picture and the L0 reference picture and the POC relationship between the current picture and the L1 reference pictrue. For example, depending on whether the value of DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1]) is greater than or less than 0, it is possible to determine whether to write the MVD corresponding to L0 in L1 as it is or transform it. In addition, the fact that DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1]) is greater than 0 means that both the L0 reference picture and the L1 reference picture are temporally ahead of the current picture, or both are temporally behind the current picture. I can. Therefore, in this case, it is possible that the codes of L0 MVD and L1 MVD are the same. In addition, when DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1]) is less than 0, one of the L0 reference picture and the L1 reference picture is temporally ahead of the current picture, and the other is temporally ahead of the current picture. May be the one behind. Therefore, in this case, it is possible that the codes of L0 MVD and L1 MVD are different. Also, those that are in front in time may have a small POC and those that are behind in time may have a large POC. POC may mean picture order count.

또한 앞의 설명에서 MV scaling 과정이 추가될 수 있다. 즉, 시그날링된 MV 혹은 시그날링된 MV를 변형한 MV(예를 들면 부호를 반대로한 MV)를 MV scaling하는 과정이 추가될 수 있다.Also, the MV scaling process can be added in the preceding description. That is, a process of MV scaling a signaled MV or an MV transformed from the signaled MV (for example, an MV whose sign is reversed) may be added.

도 14는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.14 is a diagram showing MMVD syntax according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 도 13에서 설명한 MMVD 사용 여부를 나타내는 시그날링이 존재할 수 있다. 도 14를 참조하면 상기 MMVD 사용 여부를 나타내는 시그날링은 mmvd_flag일 수 있다.According to an embodiment of the present invention, signaling indicating whether to use the MMVD described in FIG. 13 may exist. Referring to FIG. 14, the signaling indicating whether the MMVD is used may be mmvd_flag.

또한 MMVD를 skip mode 또는 merge mode에 적용하는 것이 가능하다.In addition, it is possible to apply MMVD to skip mode or merge mode.

본 발명의 일 실시예를 따르면 MMVD를 사용하는 경우에 MMVD 관련 syntax를 parsing하는 것이 가능하다. 또한 도 14를 참조하면 MMVD 관련 syntax는 mmvd_idx_coding에서 parsing 할 수 있다.According to an embodiment of the present invention, when using MMVD, it is possible to parse MMVD related syntax. Also, referring to FIG. 14, MMVD-related syntax can be parsed in mmvd_idx_coding.

일 실시예로 MMVD를 사용하지 않는 경우에 merge index를 parsing하는 것이 가능하다. 기존 skip mode 및 merge mode에서 merge index가 필요할 수 있는데 MMVD를 skip mode 또는 merge mode에 적용할 수 있는 경우 MMVD를 사용하지 않는 경우에 merge index를 parsing 할 수 있다. 도 14를 참조하면 merge index는 merge_idx일 수 있다. 또한 skip mode가 아닌 merge mode인 경우 merge_flag를 parsing 한 후에 merge_flag가 1인 경우에 mmvd_flag를 parsing 할 수 있다. merge_flag는 merge mode, sunblock merge mode 등을 사용한다는 것을 지시할 수 있다. 또한 merge_flag는 AMVP, inter mode, affine inter mode 등을 사용하지 않는다는 것을 지시할 수 있다. 이 실시예에서 merge_idx는 도 13에서 설명한 base candidate IDX와는 다른 index일 수 있다.In an embodiment, when MMVD is not used, it is possible to pars the merge index. In the existing skip mode and merge mode, a merge index may be required. If MMVD can be applied to skip mode or merge mode, when MMVD is not used, the merge index can be parsed. Referring to FIG. 14, the merge index may be merge_idx. Also, in the merge mode other than the skip mode, after parsing the merge_flag, the mmvd_flag can be parsed when the merge_flag is 1. merge_flag may indicate that a merge mode, a sunblock merge mode, etc. are used. In addition, merge_flag may indicate that AMVP, inter mode, affine inter mode, etc. are not used. In this embodiment, merge_idx may be an index different from the base candidate IDX described in FIG. 13.

본 발명의 일 실시예를 따르면 merge candidates의 최대 개수를 나타내는 시그날링이 존재할 수 있다. 또한 상기 merge candidates의 최대 개수를 나타내는 시그날링은 CU, prediction unit보다 큰 단위에서 시그날링하는 것이 가능하다. 예를 들면 slice 또는 tile 단위에서 상기 merge candidates의 최대 개수를 나타내는 시그날링이 있을 수 있다. 또한 merge candidates의 최대 개수를 나타내는 시그날링에 기초한 조건을 만족하는 경우 merge index를 parsing하는 것이 가능하다. 일 실시예로 merge candidates의 최대 개수를 나타내는 시그날링이 merge candidates의 최대 개수가 1이라고 나타내는 경우 merge index를 0으로 infer할 수 있다. 즉 merge candidates의 최대 개수를 나타내는 시그날링이 merge candidates의 최대 개수가 1이라고 나타내는 경우 index를 parsing하지 않고 자동으로 candidate가 결정될 수 있다. 도 14를 참조하면 merge candidates의 최대 개수를 나타내는 시그날링에 기초한 값인 MaxNumMergeCand가 있을 수 있고, MaxNumMergeCand는 merge candidates의 최대 개수를 의미할 수 있다. MaxNumMergeCand는 1 이상의 숫자인 것이 가능하다. 또한 표준에서 지원 가능한 merge candidates의 최대 개수와 merge candidates의 최대 개수를 나타내는 시그날링에 기초해서 상기 merge candidates의 최대 개수를 나타내는 시그날링 단위에 대한 merge candidates의 최대 개수를 결정하는 것이 가능하다. 예를 들어 표준에서 지원 가능한 merge candidates의 최대 개수에서 merge candidates의 최대 개수를 나타내는 시그날링 값을 빼서 상기 merge candidates의 최대 개수를 나타내는 시그날링 단위에 대한 merge candidates의 최대 개수를 결정하는 것이 가능하다. 또한 merge candidates의 최대 개수를 설명하였으나 같은 개념의 subblock merge candidates의 최대 개수 및 최대 개수 시그날링이 존재할 수 있다.According to an embodiment of the present invention, signaling indicating the maximum number of merge candidates may exist. In addition, the signaling indicating the maximum number of merge candidates may be signaled in a unit larger than the CU and prediction unit. For example, there may be signaling indicating the maximum number of merge candidates in a slice or tile unit. In addition, it is possible to pars the merge index when the condition based on signaling indicating the maximum number of merge candidates is satisfied. In an embodiment, when signaling indicating the maximum number of merge candidates indicates that the maximum number of merge candidates is 1, the merge index may be inferred to 0. That is, when the signaling indicating the maximum number of merge candidates indicates that the maximum number of merge candidates is 1, the candidate can be automatically determined without parsing the index. Referring to FIG. 14, there may be MaxNumMergeCand, which is a value based on signaling indicating the maximum number of merge candidates, and MaxNumMergeCand may mean the maximum number of merge candidates. MaxNumMergeCand can be a number of 1 or more. In addition, it is possible to determine the maximum number of merge candidates for a signaling unit indicating the maximum number of merge candidates based on signaling indicating the maximum number of merge candidates supported by the standard and the maximum number of merge candidates. For example, it is possible to determine the maximum number of merge candidates for a signaling unit representing the maximum number of merge candidates by subtracting a signaling value representing the maximum number of merge candidates from the maximum number of merge candidates supported by the standard. In addition, although the maximum number of merge candidates has been described, signaling of the maximum number and maximum number of subblock merge candidates of the same concept may exist.

또한 merge_idx는 skip mode 또는 merge mode를 사용하는 경우에 parsing하는 것이 가능하고, skip mode 또는 merge mode를 사용하는 조건을 만족하는 경우에 merge index를 parsing하는 것이 가능하다. 예를 들어 subblock merge mode를 사용하지 않는 경우에 skip mode 또는 merge mode를 사용하는 것이 가능하다.In addition, merge_idx can be parsed when the skip mode or merge mode is used, and the merge index can be parsed when the condition of using the skip mode or merge mode is satisfied. For example, it is possible to use skip mode or merge mode when subblock merge mode is not used.

도 14의 실시예에서 mmvd_flag 다음 merge_idx를 parsing하게 되는데 이는 MMVD를 기존의 skip mode 또는 merge mode보다 우선적으로 고려하는 것일 수 있다.In the embodiment of FIG. 14, merge_idx after mmvd_flag is parsed, which may be to prioritize MMVD over the existing skip mode or merge mode.

또한 subblock merge mode 사용 여부를 나타내는 시그날링이 있을 수 있고, 그것은 subblock_merge_flag 일 수 있다.In addition, there may be signaling indicating whether to use the subblock merge mode, and it may be subblock_merge_flag.

도 15는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.15 is a diagram showing MMVD syntax according to an embodiment of the present invention.

도 14에서 설명한 부분이 도 15에서도 적용될 수 있다. 도 15에서는 도 14에 비해 subblock merge에 관한 내용을 추가하였다. 또한 도 15 및 이하 도면에서 intra prediction 관련 부분, inter prediction 중 inter mode, AMVP mode, affine inter mode 등에 관한 부분은 생략되었을 수 있다.The parts described in FIG. 14 may also be applied to FIG. In FIG. 15, content about subblock merge is added compared to FIG. 14. In addition, in FIGS. 15 and hereinafter, parts related to intra prediction and parts related to inter mode, AMVP mode, affine inter mode, and the like among inter prediction may be omitted.

본 발명의 일 실시예를 따르면 subblock_merge_flag는 mmvd_flag 및 merge_idx보다 먼저 parsing 할 수 있다. 이것은 subblock merge mode를 skip mode, merge mode, MMVD 등보다 우선적으로 고려하는 것일 수 있다. Subblock merge mode를 사용하지 않는 경우에 mmvd_flag, merge_idx 등을 parsing하는 것이 가능하다.According to an embodiment of the present invention, subblock_merge_flag may be parsed before mmvd_flag and merge_idx. This may prioritize subblock merge mode over skip mode, merge mode, MMVD, etc. When the subblock merge mode is not used, it is possible to pars the mmvd_flag and merge_idx.

도 16은 본 발명의 일 실시예에 따른 MMVD 관련 syntax를 나타낸 도면이다.16 is a diagram showing syntax related to MMVD according to an embodiment of the present invention.

도 16에서 나타낸 함수는 도 14 내지 도 15 및 이하 MMVD syntax를 나타낸 도면에서 나타낸 MMVD 관련 syntax를 parsing하는 부분일 수 있다. 도 13에서 설명한 것처럼 MMVD는 base MV, distance, direction에 기초해서 결정될 수 있고, 이를 시그날링하는 index들이 있을 수 있다. 도 16을 참조하면 base MV, distance, direction 각각의 index들이 base_mv_idx, distance_idx, direction_idx로 있을 수 있다.The function shown in FIG. 16 may be a part for parsing the MMVD related syntax shown in FIGS. 14 to 15 and a diagram showing the MMVD syntax below. As described in FIG. 13, MMVD may be determined based on a base MV, distance, and direction, and there may be indexes signaling this. Referring to FIG. 16, indexes of base MV, distance, and direction may be base_mv_idx, distance_idx, and direction_idx.

도 14 내지 도 15에서 설명한 것처럼 MMVD를 사용한다고 시그날링한 경우 MMVD 관련 syntax를 도 14, 도 15, 도 16에 나타낸 것과 같이 항상 시그날링할 수 있다.In the case of signaling that MMVD is used as described with reference to FIGS. 14 to 15, the MMVD related syntax can always be signaled as shown in FIGS. 14, 15 and 16.

도 17은 본 발명의 일 실시예에 따른 MMVD 관련 syntax를 나타낸 도면이다.17 is a diagram illustrating syntax related to MMVD according to an embodiment of the present invention.

도 17에서 나타낸 함수는 도 14 내지 도 15 및 이하 MMVD syntax를 나타낸 도면에서 나타낸 MMVD 관련 syntax를 parsing하는 부분일 수 있다.The function shown in FIG. 17 may be a part for parsing the syntax related to MMVD shown in FIGS. 14 to 15 and a diagram showing the MMVD syntax below.

본 발명의 일 실시예를 따르면 MMVD 관련 syntax 중 일부를 특정 조건을 만족시키는 경우에 parsing하는 것이 가능하다. 예를 들어 MMVD를 사용하는 것으로 결정된 이후에 특정 조건을 만족시키는 경우에 MMVD 관련 syntax 중 일부를 parsing하는 것이 가능하다.According to an embodiment of the present invention, it is possible to pars some of MMVD related syntax when a specific condition is satisfied. For example, after it is determined to use MMVD, it is possible to pars some of the MMVD related syntax when certain conditions are satisfied.

일 실시예를 따르면 상기 MMVD 관련 syntax 중 일부는 base MV 관련 시그날링일 수 있다.According to an embodiment, some of the MMVD-related syntax may be base MV-related signaling.

MMVD를 사용하는 것으로 결정되는 것은 mmvd_flag 값에 따른 것일 수 있다. mmvd_flag를 parsing하거나 mmvd_flag가 infer되어 특정값 (예를 들어 1)을 나타내는 경우 MMVD를 사용하는 것으로 결정되는 것일 수 있다.It may be determined to use MMVD according to the mmvd_flag value. When mmvd_flag is parsed or mmvd_flag is inferred to indicate a specific value (eg, 1), it may be determined to use MMVD.

일 실시예를 따르면 상기 특정 조건은 base MV candidates로 가능한 최대 개수에 관한 것일 수 있다. 예를 들어 base MV candidates로 가능한 최대 개수가 2 이상인 경우에 base MV 관련 syntax를 parsing하고, base MV candidates로 가능한 최대 개수가 1인 경우에 base MV 관련 syntax를 parsing하지 않을 수 있다. Base MV 관련 syntax가 존재하지 않을 때 infer하는 것이 가능하다. infer할 때 0으로 infer 할 수 있다. 만약 base MV candidates가 merge candidates인 경우 merge candidates로 가능한 최대 개수에 기초한 조건에 의해 base MV 관련 syntax를 parsing하는지 여부를 결정할 수 있다.According to an embodiment, the specific condition may be regarding the maximum number of possible base MV candidates. For example, when the maximum number of possible base MV candidates is 2 or more, the syntax related to base MV may be parsed, and when the maximum number of possible base MV candidates is 1, the syntax related to base MV may not be parsed. It is possible to infer when there is no base MV related syntax. When infering, you can infer to 0. If the base MV candidates are merge candidates, it is possible to determine whether to parse the base MV related syntax according to a condition based on the maximum number of merge candidates possible.

Base MV candidates로 가능한 최대 개수는 도 14에서 설명한 merge candidates의 최대 개수를 나타내는 시그날링이 가리키는 값일 수 있고, 그 값은 MaxNumMergeCand일 수 있다.The maximum number possible as Base MV candidates may be a value indicated by signaling indicating the maximum number of merge candidates described in FIG. 14, and the value may be MaxNumMergeCand.

도 17을 참조하면 merge candiates로 가능한 최대 개수를 나타내는 MaxNumMergeCand가 1보다 큰 경우에만 base_mv_idx를 parsing하고 있다. 만약 base_mv_idx가 존재하지 않는 경우, 예를 들어 parsing하지 않아서 존재하지 않는 경우 그 값을 0으로 infer할 수 있다. 가능한 최대 candiate 개수가 1인 경우 index를 시그날링하지 않아도 결정하는 것이 가능하기 때문이다.Referring to FIG. 17, base_mv_idx is parsed only when MaxNumMergeCand indicating the maximum number of merge candiates is greater than 1. If base_mv_idx does not exist, for example, if it does not exist because it is not parsed, the value can be inferred to 0. This is because when the maximum number of candiates possible is 1, it is possible to determine the index without signaling.

도 18은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.18 is a diagram showing MMVD syntax according to an embodiment of the present invention.

도 15에서 설명한 syntax 구조의 경우 MMVD를 사용하지 않고 skip mode 또는 merge mode를 사용하는 경우에도 항상 mmvd_flag를 parsing하여야 한다. 또한 MMVD를 사용하는 경우와 사용하지 않는 경우 모두 base MV index 또는 merge index를 parsing 해야할 수 있다.In the case of the syntax structure described in FIG. 15, mmvd_flag must always be parsed even when the skip mode or merge mode is used without using MMVD. In addition, in the case of using and not using MMVD, the base MV index or merge index may need to be parsed.

도 18의 실시예에서는 MMVD를 사용하지 않고 skip mode 또는 merge mode를 사용하는 경우에도 mmvd_flag를 parsing하지 않는 경우가 있을 수 있다.In the embodiment of FIG. 18, there may be a case in which mmvd_flag is not parsed even when the MMVD is not used and the skip mode or the merge mode is used.

본 발명의 일 실시예를 따르면 base MV 관련 syntax와 merge_idx가 동일할 수 있다. 예를 들어 base MV index와 merge_index가 동일할 수 있다. 동일하다는 것은 같은 syntax로 나타내어진다는 것을 의미할 수 있다.According to an embodiment of the present invention, the base MV related syntax and merge_idx may be the same. For example, the base MV index and merge_index may be the same. To be identical can mean that they are expressed in the same syntax.

본 발명의 일 실시예를 따르면 base MV 관련 syntax parsing을 하고 조건에 따라 mmvd_flag를 parsing하는 것이 가능하다. 그리고 mmvd_flag가 MMVD 사용을 지시하는 경우에 base MV 관련 syntax 이외의 MMVD 관련 syntax를 parsing할 수 있다.According to an embodiment of the present invention, it is possible to perform syntax parsing related to base MV and to pars mmvd_flag according to conditions. And when mmvd_flag instructs to use MMVD, syntax related to MMVD other than syntax related to base MV can be parsed.

예를 들어 merge index를 parsing한 후에 해당하는 candidate가 MMVD에 사용될 수 있는 candidate인지 아닌지를 구별할 수 있다. 그리고 MMVD에 사용될 수 있는 candidate인 경우 mmvd_flag를 parsing하고 MMVD에 사용될 수 없는 candidate인 경우 mmvd_flag를 parsing하지 않을 수 있다. 또한 mmvd_flag가 존재하지 않는 경우 MMVD를 사용하지 않는 것으로 infer할 수 있다.For example, after parsing the merge index, it is possible to distinguish whether the corresponding candidate is a candidate that can be used for MMVD. In addition, in the case of a candidate that can be used for MMVD, mmvd_flag may be parsed, and in the case of a candidate that cannot be used in MMVD, mmvd_flag may not be parsed. In addition, if mmvd_flag does not exist, it can be inferred to not use MMVD.

더 구체적으로 MMVD의 base MV가 merge candidate list의 앞 쪽(index가 작은 쪽) num_mmvd_baseCand개까지 될 수 있을 때, parsing한 index가 num_mmvd_baseCand보다 작은 경우 mmvd_flag를 parsing하고, 그렇지 않은 경우 mmvd_flag를 parsing하지 않고 MMVD를 사용하지 않는 것으로 결정할 수 있다.More specifically, when the base MV of MMVD can be up to num_mmvd_baseCand in front of merge candidate list (the side with smaller index), mmvd_flag is parsed when the parsed index is smaller than num_mmvd_baseCand, otherwise, mmvd_flag is not parsed and MMVD You can decide not to use.

이러한 경우 num_mmvd_baseCand 이상의 candidate index를 사용하는 경우에 mmvd_flag에 대한 bit을 아낄 수 있는 장점이 있다.In this case, when using a candidate index greater than num_mmvd_baseCand, there is an advantage of saving bits for mmvd_flag.

도 18을 참조하면 merge_idx를 parsing한 후 merge_idx가 num_mmvd_baseCand보다 작은 경우 mmvd_flag를 parsing하고 있다. num_mmvd_baseCand는 MMVD의 base MV로 가능한 candidates 수일 수 있다. 또한 MMVD의 base MV index가 merge_idx에 기초할 수 있다.Referring to FIG. 18, after parsing merge_idx, when merge_idx is smaller than num_mmvd_baseCand, mmvd_flag is parsed. num_mmvd_baseCand may be the number of candidates possible as the base MV of MMVD. Also, the base MV index of MMVD may be based on merge_idx.

도 19는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.19 is a diagram showing MMVD syntax according to an embodiment of the present invention.

도 19를 참조하면 mmvd_flag는 merge_flag보다 상위에 있을 수 있다. 예를 들면 mmvd_flag에 기초하여 merge_flag를 parsing 할 지 여부를 결정할 수 있다. 또한 이것은 skip mode가 아닌 경우에 적용하는 것이 가능하다. 상기 mmvd_flag와 상기 merge_flag는 앞선 도면들에서 설명한 의미를 가질 수 있다.Referring to FIG. 19, mmvd_flag may be higher than merge_flag. For example, it is possible to determine whether to pars the merge_flag based on mmvd_flag. Also, it is possible to apply this in cases other than skip mode. The mmvd_flag and the merge_flag may have the meaning described in the previous drawings.

예를 들어 mmvd_flag가 MMVD를 사용한다고 지시하는 경우 merge_flag를 parsing하지 않을 수 있다. 예를 들어 MMVD의 base MV candidate가 merge candidate 중에서 정해지는 경우 mmvd_flag가 MMVD를 사용한다고 지시하는 경우 merge_flag를 parsing하지 않을 수 있다. MMVD를 사용하는 경우(mmvd_flag가 1인 경우), merge mode를 사용하는 것으로 merge_flag를 infer 할 수 있다. 도 19를 참조하면 skip mode를 사용하는 경우, 즉 cu_skip_flag가 1인 경우 MMVD 사용 여부와 관계 없이 merge_flag를 1로 infer할 수 있다. 또한 merge_flag가 존재하지 않고 skip mode를 사용하지 않으면 MMVD를 사용하는 경우 merge_flag를 1로 infer하고, MMVD를 사용하지 않는 경우 merge_flag를 0으로 infer할 수 있다. 또는 merge_flag가 존재하지 않고 skip mode를 사용하지 않으면 merge_flag를 1로 infer 하는 것도 가능하다.For example, when mmvd_flag indicates that MMVD is used, merge_flag may not be parsed. For example, when the base MV candidate of MMVD is determined among merge candidates, when mmvd_flag indicates that MMVD is used, the merge_flag may not be parsed. When using MMVD (when mmvd_flag is 1), merge_flag can be inferred by using merge mode. Referring to FIG. 19, when a skip mode is used, that is, when cu_skip_flag is 1, merge_flag may be inferred to 1 regardless of whether MMVD is used. Also, if merge_flag does not exist and skip mode is not used, merge_flag can be inferred to 1 when MMVD is used, and merge_flag can be infered to 0 when MMVD is not used. Alternatively, if merge_flag does not exist and skip mode is not used, it is possible to infer merge_flag to 1.

또한 도 19를 참조하면 skip mode가 아닌 경우 mmvd_flag가 1이면 MMVD 관련 syntax를 parsing하고, mmvd_flag가 0이면 merge_flag를 parsing하고 있다.In addition, referring to FIG. 19, when mmvd_flag is 1 when not in skip mode, MMVD related syntax is parsed, and when mmvd_flag is 0, merge_flag is parsed.

본 발명의 일 실시예를 따르면 subblock_merge_flag가 merge_flag보다 상위에 있는 경우 subblock_merge_flag가 1인 경우 merge_flag를 parsing하지 않을 수 있고, merge_flag를 1로 infer할 수 있다. 또한 subblock_merge_flag가 mmvd_flag보다 상위에 있는 경우 subblock_merge_flag가 1인 경우 mmvd_flag를 parsing하지 않을 수 있고, mmvd_flag를 0으로 infer할 수 있다.According to an embodiment of the present invention, when subblock_merge_flag is higher than merge_flag, when subblock_merge_flag is 1, merge_flag may not be parsed, and merge_flag may be inferred to 1. In addition, when subblock_merge_flag is higher than mmvd_flag, when subblock_merge_flag is 1, mmvd_flag may not be parsed, and mmvd_flag may be inferred to 0.

또한 이 발명의 실시예들에서 modeX_flag가 1인 것은 modeX를 사용하는 것을 의미하고 modeX_flag가 0인 것은 modeX를 사용하지 않는 것을 의미할 수 있다.In addition, in the embodiments of the present invention, when modeX_flag is 1, it means that modeX is used, and when modeX_flag is 0, it may mean that modeX is not used.

도 20은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.20 is a diagram showing MMVD syntax according to an embodiment of the present invention.

본 발명의 일 실시예에 따르면 MMVD의 base MV candidate로 사용하는 candidate list에서 일부 candidates에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 MMVD의 base MV candidate가 merge candidate list로부터 정해질 때 merge candidate list 일부에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 정해진 candidate index에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 candidate index가 기설정된 값보다 작을 때 항상 MMVD를 사용하는 것이 가능하다.According to an embodiment of the present invention, it is possible to always use MMVD for some candidates in a candidate list used as a base MV candidate for MMVD. For example, when the base MV candidate of MMVD is determined from the merge candidate list, it is always possible to use MMVD for a part of the merge candidate list. For example, it is possible to always use MMVD for a given candidate index. For example, it is always possible to use MMVD when the candidate index is smaller than a preset value.

이러한 경우 candidate index로부터 MMVD 사용 여부를 결정하는 것이 가능하다. 또한 mmvd_flag parsing이 존재하지 않을 수 있다.In this case, it is possible to determine whether to use MMVD from the candidate index. Also, mmvd_flag parsing may not exist.

예를 들어 merge_idx를 parsing한 수 merge_idx가 MMVD를 사용하는 것으로 정해진 값에 해당하는 경우 MMVD를 사용하는 것으로 결정할 수 있다. 또한 이러한 경우 MMVD 관련 syntax(예를 들면 distance, direction 시그날링 등)를 parsing할 수 있다.For example, if the number merge_idx parsed by merge_idx corresponds to a value determined as using MMVD, it may be determined to use MMVD. Also, in this case, MMVD related syntax (eg, distance, direction signaling, etc.) can be parsed.

도 20을 참조하면 merge candidate list 앞쪽의 num_mmvd_baseCand개까지에 해당할 때까지는 항상 MMVD를 사용할 수 있다. 이러한 경우 candidate index가 num_mmvd_baseCand보다 작은 경우 MMVD를 사용하는 것으로 결정할 수 있고, MMVD 관련 syntax를 parsing 할 수 있다.Referring to FIG. 20, MMVD can always be used until the number of num_mmvd_baseCand in front of the merge candidate list is reached. In this case, if the candidate index is smaller than num_mmvd_baseCand, it can be determined to use MMVD, and MMVD-related syntax can be parsed.

도 21은 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.21 is a diagram showing MMVD syntax according to an embodiment of the present invention.

도 20에서의 설명과 같이 본 발명의 일 실시예에 따르면 MMVD의 base MV candidate로 사용하는 candidate list에서 일부 candidates에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 MMVD의 base MV candidate가 merge candidate list로부터 정해질 때 merge candidate list 일부에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 정해진 candidate index에 대해서 항상 MMVD를 사용하는 것이 가능하다. 예를 들어 candidate index가 기설정된 값보다 작을 때 항상 MMVD를 사용하는 것이 가능하다.As described in FIG. 20, according to an embodiment of the present invention, it is possible to always use MMVD for some candidates in a candidate list used as a base MV candidate for MMVD. For example, when the base MV candidate of MMVD is determined from the merge candidate list, it is always possible to use MMVD for a part of the merge candidate list. For example, it is possible to always use MMVD for a given candidate index. For example, it is always possible to use MMVD when the candidate index is smaller than a preset value.

본 발명의 일 실시예에 따르면 mmvd_flag가 merge_flag보다 상위에 있을 수 있다. 이러한 경우 mmvd_flag가 1인 경우 MMVD 관련 syntax를 parsing 할 수 있다. 또한 mmvd_flag가 1인 경우 merge_flag를 1로 infer할 수 있다. 또한 mmvd_flag가 0인 경우 merge_flag를 parsing할 수 있다. merge_flag가 1인 경우 merge_idx를 parsing할 수 있다. 이때 merge_idx를 parsing하기 위한 추가 조건이 존재할 수 있다. 이때 일 실시예로 실제 사용할 merge_idx는 parsing한 merge_idx를 기초로 변형하여 결정하는 것이 가능하다. 예를 들어 실제 사용할 merge_idx는 parsing한 merge_idx에 parsing한 merge_idx보다 작은 값 중 MMVD를 항상 사용하도록 정해진 candidate의 개수를 더한 것으로 결정하는 것이 가능하다. 예를 들어 candidate list 앞쪽 num_mmvd_baseCand개에 대해 MMVD를 항상 사용하도록 정해진 경우 parsing한 merge_idx에 num_mmvd_baseCand를 더한 값을 merge_idx로 사용할 수 있다. mmvd_flag가 merge_flag보다 앞에 있는 경우 mmvd_flag가 0인 경우 MMVD를 사용하는 candidate를 candidate list에서 제외시킬 수 있기 때문이다.According to an embodiment of the present invention, mmvd_flag may be higher than merge_flag. In this case, if mmvd_flag is 1, MMVD related syntax can be parsed. In addition, when mmvd_flag is 1, merge_flag may be inferred to 1. In addition, when mmvd_flag is 0, merge_flag can be parsed. When merge_flag is 1, merge_idx can be parsed. In this case, there may be an additional condition for parsing merge_idx. In this case, according to an embodiment, the merge_idx to be actually used may be determined by transforming it based on the parsed merge_idx. For example, it is possible to determine that the actual merge_idx to be used is the sum of the number of candidates determined to always use MMVD among values smaller than the parsed merge_idx to the parsed merge_idx. For example, if MMVD is always used for num_mmvd_baseCand in front of the candidate list, the value obtained by adding num_mmvd_baseCand to the parsed merge_idx can be used as merge_idx. This is because the candidate using MMVD can be excluded from the candidate list when mmvd_flag is before merge_flag and mmvd_flag is 0.

도 21을 참조하면 mmvd_flag가 merge_flag보다 앞에 존재한다. 또한 mmvd_flag가 1인 경우 MMVD 관련 syntax를 parsing할 수 있다. 또한 mmvd_flag가 0인 경우 merge_flag를 parsing할 수 있다. 또한 mmvd_flag가 0이고 merge_flag가 1인 경우 merge_idx를 parsing 할 수 있다. 이때 merge_idx를 parsing하기 위한 추가 조건이 존재할 수 있다. 또한 MMVD의 base MV로 사용할 수 있는 candidates 개수인 num_mmvd_baseCand를 parsing한 merge_idx에 더해서 실제 사용할 merge_idx를 결정할 수 있다.Referring to FIG. 21, mmvd_flag exists before merge_flag. Also, if mmvd_flag is 1, MMVD related syntax can be parsed. In addition, when mmvd_flag is 0, merge_flag can be parsed. Also, when mmvd_flag is 0 and merge_flag is 1, merge_idx can be parsed. In this case, there may be an additional condition for parsing merge_idx. In addition, merge_idx to be actually used can be determined by adding num_mmvd_baseCand, which is the number of candidates that can be used as the base MV of MMVD, to the parsed merge_idx.

도 22는 본 발명의 일 실시예에 따른 MMVD syntax를 나타낸 도면이다.22 is a diagram showing MMVD syntax according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 candidate index가 mode 사용 여부를 나타내는 flag보다 앞에 존재할 수 있다. 예를 들어 candidate index가 mmvd_flag 또는 merge_flag보다 앞에 존재할 수 있다. 이러한 경우 candidate index를 parsing한 후에 parsing한 index가 MMVD를 사용할 수 있는 candidate인지 아닌지에 따라 mmvd_flag parsing 여부를 결정할 수 있다. 예를 들어 parsing한 candidate index가 MMVD를 사용할 수 있는 candidate인 경우 mmvd_flag를 parsing하고, MMVD를 사용할 수 없는 candidate인 경우 mmvd_flag를 parsing하지 않고 0으로 infer할 수 있다. 또한 mmvd_flag가 0인 경우 merge_flag를 parsing할 수 있다. merge_flag를 통해 merge mode 또는 subblock merge mode가 쓰이는지, inter mode 또는 AMVP mode 또는 affine inter mode가 쓰이는지 결정할 수 있다.According to an embodiment of the present invention, a candidate index may exist before a flag indicating whether to use a mode. For example, the candidate index may exist before mmvd_flag or merge_flag. In this case, after parsing the candidate index, it is possible to determine whether to pars the mmvd_flag according to whether the parsed index is a candidate that can use MMVD. For example, if the parsed candidate index is a candidate that can use MMVD, mmvd_flag can be parsed, and if the candidate index cannot use MMVD, mmvd_flag can be inferred to 0 without parsing. In addition, when mmvd_flag is 0, merge_flag can be parsed. Through merge_flag, it is possible to determine whether merge mode or subblock merge mode is used, inter mode, AMVP mode, or affine inter mode is used.

예를 들어 mode 1로 가능한 candidate 개수가 num1, mode 2로 가능한 candidate 개수가 num2이고, num1 < num2인 경우, candidate index를 parsing 했을 때 parsing한 index가 num 1 이상인 경우 mode 1과 mode 2 중 결정하는 syntax(예를 들면 mode 1 사용 여부를 나타내는 syntax)를 parsing하지 않을 수 있고, mode 1을 사용하지 않는 것으로 infer할 수 있다. 그리고 parsing한 index가 num 1보다 작은 경우 mode 1과 mode 2 중 결정하는 syntax를 parsing할 수 있다.For example, if the number of candidates possible in mode 1 is num1, the number of candidates possible in mode 2 is num2, and num1 <num2, when the candidate index is parsed and the parsed index is num 1 or more, it is determined between mode 1 and mode 2 You can not pars the syntax (for example, the syntax indicating whether or not to use mode 1), and you can infer to not using mode 1. In addition, when the parsed index is less than num 1, the syntax that determines between mode 1 and mode 2 can be parsed.

도 22를 참조하면 merge_idx를 parsing 한 후, merge_idx가 MMVD를 사용할 수 있는 candiate 개수인 num_mmvd_baseCand보다 작은 경우 mmvd_flag를 parsing 할 수 있다. 또한 merge_idx가 num_mmvd_baseCand 이상인 경우 mmvd_flag를 parsing하지 않을 수 있고, 이때 mmvd_flag를 0으로 infer할 수 있다. 또한 mmvd_flag가 1인 경우 MMVD 관련 syntax인 distance_idx, direction_idx 등을 parsing하고 있다. 또한 mmvd_flag가 0인 경우 merge_flag를 parsing하고 그에 따라 merge mode 또는 subblock merge mode인지 아니면 inter mode 또는 AMVP mode 또는 affine mode인지 구분할 수 있다.Referring to FIG. 22, after parsing merge_idx, mmvd_flag may be parsed when merge_idx is smaller than num_mmvd_baseCand, which is the number of candiates that can use MMVD. Also, when merge_idx is greater than or equal to num_mmvd_baseCand, mmvd_flag may not be parsed, and in this case, mmvd_flag may be inferred to 0. In addition, when mmvd_flag is 1, MMVD related syntax distance_idx, direction_idx, etc. are parsed. In addition, when mmvd_flag is 0, merge_flag is parsed, and accordingly, whether it is merge mode or subblock merge mode, inter mode, AMVP mode, or affine mode can be distinguished.

도 23은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.23 is a diagram showing a coding unit syntax according to an embodiment of the present invention.

도 23에 나타낸 것처럼 merge_flag가 1인 경우 merge_data 를 수행할 수 있다. 일 실시예를 따르면 merge_data는 merge 관련 syntax parsing하는 부분을 포함할 수 있다. 또한 merge_data를 merge data syntax라고 부를 수도 있다. 예를 들면 merge_data는 도 12 내지 도 22에서 merge_flag가 1일 때 수행하는 syntax parsing하는 부분을 포함할 수 있다. 또한 merge_flag가 1인 것은 merge mode를 사용한다는 것을 의미할 수 있다. 또한 merge_flag가 1인 것은 도 10 또는 도 12 등에 나타낸 mvd_coding을 사용하지 않는 inter prediction을 사용하는 것을 나타낼 수 있다.As shown in FIG. 23, when merge_flag is 1, merge_data can be performed. According to an embodiment, merge_data may include a part for parsing merge-related syntax. Also, merge_data may be called a merge data syntax. For example, merge_data may include a syntax parsing part performed when merge_flag is 1 in FIGS. 12 to 22. Also, when the merge_flag is 1, it may mean that the merge mode is used. In addition, when the merge_flag is 1, it may indicate that the inter prediction that does not use mvd_coding shown in FIG. 10 or 12 is used.

도 24는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.24 is a diagram illustrating a merge data syntax according to an embodiment of the present invention.

도 23에서 설명한 것처럼 merge_flag가 1인 경우 merge data syntax를 parsing할 수 있다. 또한 앞서 설명한 것처럼 merge mode 또는 skip mode를 사용하는 경우 merge_flag가 1로 설정될 수 있다. 또한 도 24를 참조하면 merge data syntax에서 mmvd_flag가 가장 먼저 parsing될 수 있다. 또한 mmvd_flag는 merge_flag가 1인 것을 확인한 후 가장 먼저 parsing할 수 있는 syntax일 수 있다. 또한 mmvd_flag가 merge_flag를 1로 설정하는 다른 prediction mode의 사용 여부를 나타내는 시그날링보다 먼저 parsing될 수 있다. 또한 mmvd_flag는 MMVD를 사용하는지 나타내는 시그날링일 수 있다. 이것은 도 14 등에 나타낸 실시예와 같을 수 있다. 도 24는 subblock merge mode, MH intra (multi-hypothesis prediction, intra and inter combined prediction), triangle prediction 등에 대한 syntax를 포함하고 있다.As described in FIG. 23, when merge_flag is 1, the merge data syntax can be parsed. Also, as described above, when the merge mode or skip mode is used, merge_flag may be set to 1. In addition, referring to FIG. 24, mmvd_flag may be parsed first in the merge data syntax. Also, mmvd_flag may be a syntax that can be parsed first after confirming that merge_flag is 1. In addition, mmvd_flag may be parsed prior to signaling indicating whether to use another prediction mode in which merge_flag is set to 1. Also, mmvd_flag may be a signaling indicating whether MMVD is used. This may be the same as the embodiment shown in Fig. 14 and the like. 24 includes syntax for subblock merge mode, MH intra (multi-hypothesis prediction, intra and inter combined prediction), triangle prediction, and the like.

본 발명의 일 실시예를 따르면 MH intra는 prediction block을 생성할 때 두 개 이상의 prediction block을 생성하여 결합하는 방법일 수 있다. 또는 MH intra는 prediction block을 생성할 때 inter prediction과 intra prediction을 모두 사용하는 방법일 수 있다. 또한 inter prediction과 intra prediction은 각각 prediction을 수행할 때 현재 block이 포함된 picture와 다른 picture, 같은 picture를 사용하는 방법일 수 있다. 도 24를 참조하면 mh_intra_flag는 MH intra를 사용하는지를 나타내는 시그날링일 수 있다.According to an embodiment of the present invention, MH intra may be a method of generating and combining two or more prediction blocks when generating a prediction block. Alternatively, MH intra may be a method of using both inter prediction and intra prediction when generating a prediction block. In addition, inter prediction and intra prediction may be a method of using a picture different from the picture including the current block, or the same picture when performing prediction, respectively. Referring to FIG. 24, mh_intra_flag may be signaling indicating whether MH intra is used.

본 발명의 일 실시예를 따르면 subblock merge mode는 현재 block(coding unit 또는 prediction unit 등)을 prediction할 때 subblock 단위로 motion compensation을 하는(motion vector가 결정되는) 방법일 수 있다. Subblock merge mode는 subblock-based temporal motion vector prediction (ATMVP), affine motion prediction 등의 방법을 포함할 수 있다. 도 24를 참조하면 merge_subblock_flag는 subblock merge mode를 사용하는지 나타내는 시그날링일 수 있다.According to an embodiment of the present invention, the subblock merge mode may be a method of performing motion compensation in subblock units (motion vector is determined) when predicting a current block (coding unit or prediction unit, etc.). The subblock merge mode may include methods such as subblock-based temporal motion vector prediction (ATMVP) and affine motion prediction. Referring to FIG. 24, merge_subblock_flag may be a signaling indicating whether a subblock merge mode is used.

본 발명의 일 실시예를 따르면 triangle prediction은 현재 block 내에서 사각형이 아닌 영역에 대해 motion compensation을 하는 방법일 수 있다. 즉, triangle prediction에서 현재 block 내에서 motion vector가 동일한 단위가 사각형이 아닐 수 있다. 도 24를 참조하면 merge_triangle_flag는 triangle prediction을 사용하는지 나타내는 시그날링일 수 있다.According to an embodiment of the present invention, triangle prediction may be a method of performing motion compensation for a non-rectangular area within the current block. That is, in triangle prediction, the unit of the same motion vector within the current block may not be a square. Referring to FIG. 24, merge_triangle_flag may be signaling indicating whether triangle prediction is used.

본 발명의 일 실시예를 따르면 mmvd_flag는 MMVD가 아닌 어떤 merge mode를 사용하는 것을 나타내는 시그날링보다 먼저 parsing 될 수 있다. 상기 MMVD가 아닌 어떤 merge mode를 사용하는 것을 나타내는 시그날링은 mh_intra_flag, merge_subblock_flag, merge_triangle_flag 등을 포함할 수 있다.According to an embodiment of the present invention, mmvd_flag may be parsed before signaling indicating that a merge mode other than MMVD is used. Signaling indicating the use of a merge mode other than the MMVD may include mh_intra_flag, merge_subblock_flag, merge_triangle_flag, and the like.

도 24를 참조하면 mmvd_merge_idx는 MMVD의 base MV로 어떤 것을 사용할지 나타내는 시그날링일 수 있다. 만약 MMVD를 사용하는 경우 merge_idx는 mmvd_merge_flag로 infer 될 수 있다.Referring to FIG. 24, mmvd_merge_idx may be a signaling indicating which one to use as the base MV of MMVD. If MMVD is used, merge_idx can be inferred to mmvd_merge_flag.

도 25는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.25 is a diagram showing a merge data syntax according to an embodiment of the present invention.

도 25의 실시예는 도 23에서 merge_flag가 1인 경우 수행되는 merge_data 부분일 수 있다.The embodiment of FIG. 25 may be a merge_data part performed when merge_flag is 1 in FIG. 23.

본 발명의 일 실시예를 따르면 mmvd_flag는 merge_idx보다 뒤에 parsing될 수 있다. 예를 들면 mmvd_flag는 merge_idx 바로 다음에 parsing될 수 있다.According to an embodiment of the present invention, mmvd_flag may be parsed after merge_idx. For example, mmvd_flag may be parsed immediately after merge_idx.

예를 들면 mmvd_flag는 merge data syntax에서 가장 앞이 아닌 위치에서 parsing되지 않을 수 있다. 즉, merge_flag가 1인 것을 확인한 뒤 mmvd_flag가 아닌 다른 syntax를 parsing한 뒤에 mmvd_flag를 parsing할 수 있다.For example, mmvd_flag may not be parsed at a position other than the earliest in the merge data syntax. That is, after confirming that merge_flag is 1, after parsing syntax other than mmvd_flag, mmvd_flag can be parsed.

또한 본 발명의 일 실시예를 따르면 도 13에서 설명한 것처럼 MMVD의 base MV는 다른 candidate list로부터 결정될 수 있고, 일 실시예로 상기 다른 candidate list의 일부로부터 base MV가 결정되는 것이 가능하다. 따라서 도 18에서 설명한 것처럼 본 일 실시예를 따르면 MMVD의 base MV로 사용될 수 있는 다른 candidate list와 관련된 index에 기초하여 mmvd_flag parsing 여부를 결정할 수 있다. 예를 들어 MMVD의 base MV로 사용될 수 있는 다른 candidate list와 관련된 index를 mmvd_flag보다 먼저 parsing 할 수 있다. 그리고 상기 다른 candidate list와 관련된 index가 MMVD의 base MV로 사용될 수 있는 것을 나타내는 경우에 mmvd_flag를 parsing하고, 그렇지 않은 경우 mmvd_flag를 parsing하지 않는 것이 가능하다. 도 25를 참조하면 MMVD의 base MV는 merge candidate로부터 결정되는 것이 가능하다. 따라서 일 실시예로 merge_idx가 MMVD의 base MV로 사용될 수 있는 것을 나타내는 경우에 mmvd_flag를 parsing하고 그렇지 않은 경우 mmvd_flag를 parsing하지 않을 수 있다. 또는 MMVD의 base MV가 merge candidate list의 앞 부분 n개 중에서 선택될 수 있는 경우에, merge_idx가 n보다 작을 때(merge_idx는 0부터 시작할 수 있다.) mmvd_flag를 parsing하고, merge_idx가 n보다 작지 않은 경우 mmvd_flag를 parsing하지 않을 수 있다. 더 구체적으로 MMVD의 base MV는 merge candidate list의 첫 번째 또는 두 번째 candidate인 것이 가능하고, 도 25를 참조하면 merge_idx가 2보다 작은 경우, 즉 0이나 1인 경우 mmvd_flag를 parsing할 수 있다. merge_idx는 merge candidate index를 나타낼 수 있다. 이에 따라 merge mode이지만 merge_idx가 MMVD를 사용할 수 없는 것을 나타내는 경우에 mmvd_flag를 parsing하지 않을 수 있고, 이에 따라 코딩 효율이 향상될 수 있다.In addition, according to an embodiment of the present invention, as described in FIG. 13, the base MV of MMVD may be determined from another candidate list, and in an embodiment, the base MV may be determined from a part of the other candidate list. Therefore, as described in FIG. 18, according to the present embodiment, whether to pars the mmvd_flag may be determined based on an index related to another candidate list that can be used as the base MV of MMVD. For example, an index related to another candidate list that can be used as the base MV of MMVD can be parsed before mmvd_flag. In addition, when the index related to the other candidate list indicates that the base MV of MMVD can be used, it is possible to pars mmvd_flag, otherwise it is possible not to pars the mmvd_flag. Referring to FIG. 25, the base MV of MMVD may be determined from a merge candidate. Therefore, in an embodiment, when merge_idx indicates that it can be used as the base MV of MMVD, mmvd_flag may be parsed, otherwise mmvd_flag may not be parsed. Or, when the base MV of MMVD can be selected from among the n front parts of the merge candidate list, when merge_idx is less than n (merge_idx can start from 0), parsing mmvd_flag and merge_idx is not less than n The mmvd_flag may not be parsed. More specifically, the base MV of MMVD may be the first or second candidate of the merge candidate list, and referring to FIG. 25, when merge_idx is less than 2, that is, 0 or 1, mmvd_flag may be parsed. merge_idx may represent a merge candidate index. Accordingly, in a merge mode, but when merge_idx indicates that MMVD cannot be used, mmvd_flag may not be parsed, and thus coding efficiency may be improved.

또한 MMVD의 base MV는 어떤 mode의 candidate list로부터 결정될 수 있다. 따라서 본 발명의 일 실시예를 따르면 각종 mode의 사용여부를 나타내는 시그날링이 다수 존재할 때 상기 어떤 mode를 사용하는 것으로 결정된 후에 mmvd_flag를 parsing하는 것이 가능하다. 예를 들어 mode 1, mode 2, mode 3 등이 존재하고 MMVD는 mode 3에 기초하여 결정되는 경우, 또는 MMVD의 base MV가 mode 3의 candidate로부터 결정되는 경우, mode 3을 사용하는 것으로 결정된 뒤에 mmvd_flag를 parsing하는 것이 가능하다. 예를 들어 mode 3을 사용하는지 나타내는 시그날링을 통해 mode 3을 사용하는 것으로 결정될 수 있다. 또는 예를 들어 mode 3 이외에 가능한 mode, 예를 들면 mode 1과 mode2가 사용되지 않는 것으로 결정된 경우 mode 3을 사용하는 것으로 결정될 수 있다. 예를 들어 subblock merge mode, MH intra, triangle prediction, conventional merge mode 등이 존재할 때, 또한 MMVD가 conventional merge mode에 적용할 수 있는 경우, 열거한 mode들 중 conventional merge mode 또는 MMVD를 사용하는 것으로 결정된 뒤에 mmvd_flag를 parsing할 수 있다.Also, the base MV of MMVD can be determined from the candidate list of any mode. Therefore, according to an embodiment of the present invention, when there are multiple signaling indicating whether various modes are used, it is possible to pars the mmvd_flag after determining which mode to use. For example, when mode 1, mode 2, and mode 3 exist and MMVD is determined based on mode 3, or when the base MV of MMVD is determined from the candidate of mode 3, mmvd_flag after it is determined to use mode 3 It is possible to parsing. For example, it may be determined to use mode 3 through signaling indicating whether mode 3 is used. Or, for example, when it is determined that possible modes other than mode 3, for example, mode 1 and mode 2 are not used, it may be determined to use mode 3. For example, when there is a subblock merge mode, MH intra, triangle prediction, conventional merge mode, and if MMVD can be applied to the conventional merge mode, after it is determined to use the conventional merge mode or MMVD among the listed modes You can pars the mmvd_flag.

또한 MMVD의 base MV로 사용될 수 있는 다른 candidate list와 관련된 index에 기초하여 mmvd_flag를 parsing하는 경우 MMVD의 base MV를 나타내는 시그날링이 따로 존재할 필요가 없다. 예를 들어 도 16 또는 도 17 등에서는 base_mv_idx와 같은 시그날링이 merge_idx와 따로 존재하였다. 또한 도 24를 참조하면 mmvd_merge_flag는 MMVD의 base MV를 나타내는 시그날링일 수 있다. 본 발명의 일 실시예를 따르면 도 25와 같이 mmvd_merge_flag가 존재하지 않을 수 있다. 예를 들면 MMVD 관련 syntax는 mmvd_flag, MMVD distance를 나타내는 시그날링(도 24 내지 도 25에서 mmvd_distance_idx), MMVD direction을 나타내는 시그날링(도 24 내지 도 25에서 mmvd_direction_idx)만을 포함하는 것이 가능하다. 또한 MMVD의 base MV는 merge_idx에 의해 결정되는 것이 가능하다. 이에 따라 도 24에서 존재했던 MMVD의 base MV는 나타내는 시그날링 및 그 context model이 도 25의 실시예에서는 존재하지 않을 수 있다.Also, when parsing mmvd_flag based on an index related to another candidate list that can be used as the base MV of MMVD, there is no need for a separate signaling indicating the base MV of MMVD. For example, in FIG. 16 or 17, signaling such as base_mv_idx existed separately from merge_idx. Also, referring to FIG. 24, mmvd_merge_flag may be a signaling indicating the base MV of MMVD. According to an embodiment of the present invention, mmvd_merge_flag may not exist as shown in FIG. 25. For example, the MMVD related syntax may include only mmvd_flag, a signaling indicating the MMVD distance (mmvd_distance_idx in FIGS. 24 to 25), and a signaling indicating the MMVD direction (mmvd_direction_idx in FIGS. 24 to 25). Also, the base MV of MMVD can be determined by merge_idx. Accordingly, the signaling and context model of the base MV of the MMVD that existed in FIG. 24 may not exist in the embodiment of FIG. 25.

또한 본 발명의 일 실시예를 따르면 mmvd_flag는 앞서 설명한 MMVD가 아닌 어떤 merge mode를 사용하는 것을 나타내는 시그날링보다 뒤에 parsing 될 수 있다. 도 25를 참조하면 mmvd_flag는 merge_subblock_flag, merge_triangle_flag, mh_intra_flag 등보다 뒤에 parsing 될 수 있다.In addition, according to an embodiment of the present invention, mmvd_flag may be parsed after signaling indicating that a merge mode other than MMVD described above is used. Referring to FIG. 25, mmvd_flag may be parsed after merge_subblock_flag, merge_triangle_flag, mh_intra_flag, and the like.

또한 어떤 merge mode는 MMVD와 함께 사용될 수 없을 수 있다. 그러한 경우 상기 어떤 merge mode를 사용하는지 여부를 나타내는 flag가 사용하지 않는 것을 나타내는 경우 mmvd_flag를 parsing하는 것이 가능하다. 도 25를 참조하면 MMVD는 triangle prediction와 함께 사용될 수 없는 것이 가능하고, merge_triangle_flag가 0인 경우에 mmvd_flag가 parsing되는 것이 가능하다. 또는 MMVD는 MH intra와 함께 사용될 수 없는 것이 가능하고, mh_intra_flag가 0인 경우에 mmvd_flag가 parsing되는 것이 가능하다. 또는 MMVD는 subblock merge mode와 함께 사용될 수 없는 것이 가능하고, merge_subblock_flag가 0인 경우에 mmvd_flag가 parsing되는 것이 가능하다.Also, some merge modes may not be used with MMVD. In such a case, it is possible to pars the mmvd_flag when the flag indicating which merge mode is used indicates not being used. Referring to FIG. 25, it is possible that MMVD cannot be used with triangle prediction, and when merge_triangle_flag is 0, mmvd_flag may be parsed. Alternatively, MMVD may not be used with MH intra, and mmvd_flag may be parsed when mh_intra_flag is 0. Alternatively, MMVD may not be used together with the subblock merge mode, and mmvd_flag may be parsed when merge_subblock_flag is 0.

도 26은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.26 is a diagram showing merge data syntax according to an embodiment of the present invention.

도 26의 실시예는 도 23에서 merge_flag가 1인 경우 수행되는 merge_data 부분일 수 있다.The embodiment of FIG. 26 may be a merge_data part performed when merge_flag is 1 in FIG. 23.

본 발명의 일 실시예를 따르면 mmvd_flag는 다른 mode를 사용하는지 나타내는 시그날링보다 뒤에 parsing될 수 있다. 또는 mmvd_flag는 merge_flag가 1로 설정되는 MMVD가 아닌 다른 mode를 사용하는지 나타내는 시그날링보다 뒤에 parsing될 수 있다. 예를 들어 mmvd_flag는 merge_subblock_flag, mh_intra_flag, merge_triangle_flag보다 뒤에 parsing될 수 있다.According to an embodiment of the present invention, mmvd_flag may be parsed after signaling indicating whether another mode is used. Alternatively, mmvd_flag may be parsed after signaling indicating whether a mode other than MMVD in which merge_flag is set to 1 is used. For example, mmvd_flag may be parsed after merge_subblock_flag, mh_intra_flag, and merge_triangle_flag.

또한 mmvd_flag는 MMVD 이외의 다른 mode를 사용하지 않는 경우에 parsing될 수 있다. 예를 들어 merge_subblock_flag가 0인 경우 mmvd_flag가 parsing될 수 있다. 또한 mh_intra_flag가 0인 경우 mmvd_flag가 parsing될 수 있다. 또한 merge_triangle_flag가 0인 경우 mmvd_flag가 parsing될 수 있다. 어떤 mode를 사용하는지 나타내는 flag가 0인 것은 상기 어떤 mode를 사용하지 않는다는 것을 나타낼 수 있다.Also, mmvd_flag may be parsed when a mode other than MMVD is not used. For example, when merge_subblock_flag is 0, mmvd_flag may be parsed. In addition, when mh_intra_flag is 0, mmvd_flag may be parsed. Also, when merge_triangle_flag is 0, mmvd_flag may be parsed. If the flag indicating which mode is used is 0, it may indicate that the mode is not used.

또한 MMVD를 conventional merge mode에 적용할 수 있는 경우, mmvd_flag를 conventional merge mode 또는 MMVD가 사용된다고 결정된 뒤에 parsing하는 것이 가능하다.In addition, when MMVD can be applied to the conventional merge mode, it is possible to pars mmvd_flag after it is determined that the conventional merge mode or MMVD is used.

또한 이 실시예에서는 MMVD를 사용하는 경우 MMVD 관련 syntax를 parsing하고, MMVD를 사용하지 않는 경우 merge_idx를 parsing할 수 있다. 또는 MMVD를 사용하는 경우 mmvd_merge_flag, mmvd_distance_idx, mmvd_direction_idx 등을 parsing하고, MMVD를 사용하지 않는 경우 merge_idx를 parsing할 수 있다. Also, in this embodiment, when MMVD is used, MMVD-related syntax may be parsed, and when MMVD is not used, merge_idx may be parsed. Alternatively, when MMVD is used, mmvd_merge_flag, mmvd_distance_idx, mmvd_direction_idx, etc. can be parsed, and when MMVD is not used, merge_idx can be parsed.

또한 도 26과 같이 mmvd_flag를 다른 mode를 사용하는지 여부를 나타내는 flag보다 뒤에 parsing하는 경우에 MMVD의 base MV를 나타내는 시그날링이 merge_idx와는 따로 존재할 수 있다. 도 26을 참조하면 MMVD의 base MV를 나타내는 시그날링은 mmvd_merge_flag일 수 있다. 예를 들면 conventional merge mode 또는 MMVD를 사용하는 것으로 결정된 뒤에 mmvd_flag를 parsing할 수 있다.In addition, when parsing mmvd_flag behind a flag indicating whether to use a different mode as shown in FIG. 26, signaling indicating the base MV of the MMVD may exist separately from the merge_idx. Referring to FIG. 26, the signaling indicating the base MV of MMVD may be mmvd_merge_flag. For example, mmvd_flag can be parsed after it is determined to use conventional merge mode or MMVD.

본 발명의 일 실시예를 따르면 conventional merge mode는 HEVC에서 사용된 merge mode를 의미할 수 있다.According to an embodiment of the present invention, the conventional merge mode may mean a merge mode used in HEVC.

본 발명의 일 실시예를 따르면 MMVD의 base MV가 어떤 candidate list로부터 결정되고, 상기 어떤 candidate list의 maximum number of candidates가 가변적일 수 있다. 예를 들면 high level syntax로부터 maximum number of candidates가 결정될 수 있다. High level syntax는 현재 coding unit보다 더 상위 level의 syntax일 수 있다. 예를 들면 high level syntax는 sequence, slice, tile 등의 level의 syntax일 수 있다. 일 실시예를 따르면 이러한 경우 MMVD의 base MV의 maximum number of candidates는 MMVD의 base MV가 될 수 있는 candidate list의 maximum number of candidates를 따라갈 수 있다. 따라서 MMVD의 base MV가 될 수 있는 candidate list의 maximum number of candidates가 줄어드는 경우에 MMVD의 base MV가 될 수 있는 candidate의 maximum number of candidates도 줄어들 수 있다.According to an embodiment of the present invention, the base MV of MMVD may be determined from a candidate list, and a maximum number of candidates of the candidate list may be variable. For example, the maximum number of candidates can be determined from the high level syntax. The high level syntax may be a syntax of a higher level than the current coding unit. For example, the high level syntax may be a level syntax such as sequence, slice, or tile. According to an embodiment, in this case, the maximum number of candidates of the base MV of MMVD may follow the maximum number of candidates of the candidate list that can be the base MV of MMVD. Therefore, when the maximum number of candidates of the candidate list that can be the base MV of MMVD decreases, the maximum number of candidates of the candidate that can be the base MV of MMVD can also be reduced.

예를 들어 MMVD의 base MV가 merge candidate list로부터 결정되고, maximum number of merge candidates가 MaxNumMergeCand일 수 있다. 또한 MaxNumMergeCand는 high level syntax로부터 결정될 수 있다. 이러한 경우 MMVD의 base MV가 될 수 있는 maximum number of candidates는 MaxNumMergeCand 이하일 수 있다. 따라서 도 17에 나타낸 것처럼 MaxNumMergeCand에 따라 MMVD의 base MV를 나타내는 시그날링을 parsing할지 여부가 결정될 수 있다. 예를 들어 MaxNumMergeCand가 1인 경우 MMVD의 base MV를 나타내는 시그날링을 parsing하지 않을 수 있고, MMVD의 base MV를 나타내는 시그날링이 존재하지 않는 경우 0으로 infer할 수 있다.For example, the base MV of MMVD may be determined from the merge candidate list, and the maximum number of merge candidates may be MaxNumMergeCand. Also, MaxNumMergeCand can be determined from high level syntax. In this case, the maximum number of candidates that can be the base MV of MMVD may be less than MaxNumMergeCand. Therefore, as shown in FIG. 17, it may be determined whether to pars the signaling indicating the base MV of MMVD according to MaxNumMergeCand. For example, if MaxNumMergeCand is 1, the signaling indicating the base MV of MMVD may not be parsed, and if there is no signaling indicating the base MV of MMVD, it may be inferred to 0.

또다른 실시예로 MaxNumMergeCand가 1인 경우 MMVD를 사용하지 않을 수 있다. 이것은 MMVD 관련 syntax에 대한 overhead를 줄이기 위한 것일 수 있다. 따라서 MaxNumMergeCand가 1인 경우 mmvd_flag를 parsing하지 않을 수 있다. 또한 mmvd_flag가 존재하지 않는 경우 0으로 infer할 수 있다.In another embodiment, when MaxNumMergeCand is 1, MMVD may not be used. This may be to reduce the overhead for MMVD related syntax. Therefore, when MaxNumMergeCand is 1, mmvd_flag may not be parsed. Also, if mmvd_flag does not exist, it can infer to 0.

도 27은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.27 is a diagram illustrating a merge data syntax according to an embodiment of the present invention.

도 27의 실시예는 도 23에서 merge_flag가 1인 경우 수행되는 merge_data 부분일 수 있다.The embodiment of FIG. 27 may be a merge_data part performed when merge_flag is 1 in FIG. 23.

도 27을 참조하면 merge_triangle_flag는 mh_intra_flag를 사용하지 않는 경우에만 parsing하는 것이 가능하다. 만약 merge_triangle_flag가 존재하지 않는 경우 0으로 infer하는 것이 가능하다. 또한 도 27의 실시예는 도 25에서 설명한 실시예들을 포함할 수 있다.Referring to FIG. 27, merge_triangle_flag can be parsed only when mh_intra_flag is not used. If merge_triangle_flag does not exist, it is possible to infer to 0. In addition, the embodiment of FIG. 27 may include the embodiments described with reference to FIG. 25.

본 발명의 일 실시예를 따르면 함께 사용할 수 없는 mode들이 다수 있을 수 있다. 예를 들면 subblock merge mode, triangle prediction, MH intra, MMVD를 함께 사용할 수 없을 수 있다. 또한 함께 사용할 수 없는 다수의 mode들 각각의 사용 여부를 나타내는 시그날링이 기설정된 순서에 따라 parsing될 수 있다. 이러한 경우 상기 다수의 mode들 중 어떤 mode의 사용 여부를 나타내는 시그날링은, 그보다 앞에 parsing된 상기 다수의 mode들 중 다른 어떤 mode의 사용 여부를 나타내는 시그날링들이 모두 사용하지 않는 것으로 판단된 경우에만 parsing하는 것이 가능하다.According to an embodiment of the present invention, there may be a plurality of modes that cannot be used together. For example, subblock merge mode, triangle prediction, MH intra, and MMVD may not be used together. In addition, signaling indicating whether to use each of a plurality of modes that cannot be used together may be parsed according to a preset order. In this case, the signaling indicating the use of any mode among the plurality of modes is parsed only when it is determined that all the signaling indicating the use of any other mode among the plurality of modes parsed before it is determined not to be used. It is possible to do.

도 28은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.28 is a diagram showing a coding unit syntax according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 mmvd_flag는 merge_flag가 0인 경우(merge mode를 사용하지 않는 경우) 시그날링되는 것이 가능하다. 또한 MMVD 관련 syntax element들이 merge_flag가 0인 경우(merge mode를 사용하지 않는 경우) 시그날링되는 것이 가능하다.According to an embodiment of the present invention, mmvd_flag may be signaled when merge_flag is 0 (when the merge mode is not used). In addition, MMVD-related syntax elements may be signaled when merge_flag is 0 (when merge mode is not used).

앞서 설명한 것처럼 MMVD는 base candidate로부터의 motion vector difference를 시그날링하는 방법일 수 있다. 이러한 점에서 MVD를 시그날링하는 AMVP, affine AMVP(affine inter) 등의 mode와 유사성을 가질 수 있다. 이에 따라 merge_flag가 0인 경우 시그날링하는 것이 가능할 수 있다.As described above, MMVD may be a method of signaling a motion vector difference from a base candidate. In this respect, it may have similarity to modes such as AMVP and affine AMVP (affine inter) signaling MVD. Accordingly, when merge_flag is 0, signaling may be possible.

또한 본 발명의 일 실시예를 따르면 CuPredMode는 현재 block의 prediction mode를 나타내는 값일 수 있다. 또는 CuPredMode는 현재 block이 intra prediction되는지 inter prediction되는지를 나타내는 값일 수 있다. 또는 CuPredMode는 pred_mode_flag에 의해 결정되는 값일 수 있다. 만약 pred_mode_flag가 0인 경우 CuPredMode는 inter prediction을 사용하는 것을 나타내는 값으로 설정될 수 있다. Inter prediction을 사용하는 것을 나타내는 값은 MODE_INTER일 수 있다. 만약 pred_mode_flag가 1인 경우 CuPredMode는 intra prediction을 사용하는 것을 나타내는 값으로 설정될 수 있다. Intra prediction을 사용하는 것을 나타내는 값은 MODE_INTRA일 수 있다. 만약 pred_mode_flag가 존재하지 않는 경우 CuPredMode를 기설정된 값으로 설정하는 것이 가능하다. 또한 상기 기설정된 값은 MODE_INTRA일 수 있다.In addition, according to an embodiment of the present invention, CuPredMode may be a value indicating a prediction mode of a current block. Alternatively, CuPredMode may be a value indicating whether the current block is intra prediction or inter prediction. Alternatively, CuPredMode may be a value determined by pred_mode_flag. If pred_mode_flag is 0, CuPredMode may be set to a value indicating inter prediction is used. A value indicating the use of inter prediction may be MODE_INTER. If pred_mode_flag is 1, CuPredMode may be set to a value indicating that intra prediction is used. A value indicating the use of intra prediction may be MODE_INTRA. If pred_mode_flag does not exist, it is possible to set CuPredMode to a preset value. Also, the preset value may be MODE_INTRA.

또한 cu_cbf는 transform과 관련된 syntax가 존재하는지를 지시하는 값일 수 있다. 상기 transform과 관련된 syntax는 transform tree syntax structure일 수 있다. 또한 상기 transform과 관련된 syntax는 도 28의 transform_tree를 통해 시그날링되는 syntax일 수 있다. 또한 cu_cbf가 0인 경우 transform과 관련된 syntax가 존재하지 않을 수 있다. 또한 cu_cbf가 1인 경우 transform과 관련된 syntax가 존재할 수 있다. 도 28을 참조하면 cu_cbf가 1인 경우 transform_tree를 수행할 수 있다. 만약 cu_cbf가 존재하지 않는 경우 cu_skip_flag에 기초하여 cu_cbf 값이 결정되는 것이 가능하다. 예를 들어 cu_skip_flag가 1인 경우 cu_cbf가 0일 수 있다. 또한 cu_skip_flag가 0인 경우 cu_cbf가 1일 수 있다. 앞서 설명한 것처럼 cu_skip_flag는 skip mode 사용 여부를 나타낼 수 있고, skip mode를 사용하는 것은 residual 신호를 사용하지 않는 것일 수 있다. 즉 prediction signal에 residual을 더하지 않고 복원하는 mode일 수 있다. 따라서 cu_skip_flag가 1이라는 것은 transform과 관련된 syntax가 존재하지 않는 것을 의미할 수 있다.Also, cu_cbf may be a value indicating whether syntax related to transform exists. The syntax related to the transform may be a transform tree syntax structure. In addition, the syntax related to the transform may be a syntax signaled through the transform_tree of FIG. 28. In addition, when cu_cbf is 0, the syntax related to transform may not exist. Also, when cu_cbf is 1, there may be syntax related to transform. Referring to FIG. 28, when cu_cbf is 1, transform_tree may be performed. If cu_cbf does not exist, it is possible to determine the cu_cbf value based on cu_skip_flag. For example, when cu_skip_flag is 1, cu_cbf may be 0. Also, when cu_skip_flag is 0, cu_cbf may be 1. As described above, cu_skip_flag may indicate whether the skip mode is used, and the use of the skip mode may indicate that a residual signal is not used. In other words, it may be a mode that restores the prediction signal without adding residuals. Therefore, when cu_skip_flag is 1, it may mean that the syntax related to transform does not exist.

본 발명의 일 실시예를 따르면 intra prediction을 사용하지 않는 경우 cu_cbf를 parsing 할 수 있다. 또한 cu_skip_flag가 0인 경우 cu_cbf를 parsing 할 수 있다. 또한 merge_flag가 0인 경우 cu_cbf를 parsing 할 수 있다. 또한 이러한 조건들은 결합하여 수행될 수 있다. 예를 들어 CuPredMode가 MODE_INTRA가 아니고, merge_flag가 0인 경우 cu_cbf를 parsing 할 수 있다. 또는 CuPredMode가 MODE_INTER이고, merge_flag가 0인 경우 cu_cbf를 parsing 할 수 있다. 이것은 merge mode가 아닌 inter prediction의 경우 skip mode를 사용할 수도 있고, 사용하지 않을 수도 있기 때문일 수 있다.According to an embodiment of the present invention, cu_cbf can be parsed when intra prediction is not used. Also, when cu_skip_flag is 0, cu_cbf can be parsed. Also, when merge_flag is 0, cu_cbf can be parsed. Also, these conditions can be performed in combination. For example, if CuPredMode is not MODE_INTRA and merge_flag is 0, cu_cbf can be parsed. Alternatively, when CuPredMode is MODE_INTER and merge_flag is 0, cu_cbf can be parsed. This may be because the skip mode may or may not be used in the case of inter prediction other than the merge mode.

도 29는 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.29 is a diagram showing a coding unit syntax according to an embodiment of the present invention.

도 29는 도 28의 MMVD 시그날링을 기초로 cu_cbf 및 transform 관련 syntax가 변경된 예이다.FIG. 29 is an example in which syntax related to cu_cbf and transform is changed based on the MMVD signaling of FIG. 28.

본 발명의 일 실시예를 따르면 특정 mode를 사용하는 경우 skip mode 사용 여부가 결정될 수 있다. 예를 들어 MMVD를 사용하는 경우 skip mode 사용 여부가 결정될 수 있다. Skip mode 사용 여부가 결정되므로 그에 따라 cu_cbf를 parsing할 지 여부가 결정되는 것이 가능하다. 즉, skip mode 사용 여부가 명확한 경우 cu_cbf를 parsing하지 않을 수 있다.According to an embodiment of the present invention, when a specific mode is used, whether to use the skip mode may be determined. For example, when using MMVD, whether to use skip mode can be determined. It is possible to determine whether to use the skip mode or not to pars the cu_cbf accordingly. That is, if it is clear whether to use skip mode, cu_cbf may not be parsed.

일 실시예를 따르면 MMVD를 사용하는 경우 skip mode를 사용하지 않을 수 있다. MMVD는 MVD를 AMVP와 같이 정확히 나타낼 수 있지 않고, 앞서 설명한 것처럼 한정된 범위에서만 표현할 수 있기 때문에 residual을 통해 더 정확하게 복원하는 것이 가능하다. 따라서 MMVD 사용 여부에 기초해서 cu_cbf의 parsing 여부를 결정하는 것이 가능하다. 예를 들어 MMVD를 사용하는 경우 cu_cbf를 parsing하지 않는 것이 가능하다. 또한 MMVD를 사용하지 않는 경우 cu_cbf를 parsing하는 것이 가능하다. 도 29를 참조하면 mmvd_flag가 0인 경우 cu_cbf를 parsing할 수 있고, mmvd_flag가 1인 경우 cu_cbf를 parsing하지 않고 있다.According to an embodiment, when using MMVD, skip mode may not be used. Since MMVD cannot accurately represent MVD like AMVP, but can only be expressed in a limited range as described above, it is possible to more accurately restore through residuals. Therefore, it is possible to determine whether to pars the cu_cbf based on whether or not MMVD is used. For example, in the case of using MMVD, it is possible not to parsing cu_cbf. Also, it is possible to pars cu_cbf when MMVD is not used. Referring to FIG. 29, when mmvd_flag is 0, cu_cbf can be parsed, and when mmvd_flag is 1, cu_cbf is not parsed.

또한 cu_cbf가 존재하지 않는 경우 cu_cbf 값을 infer하는 방법이 필요할 수 있다. 도 28에서 설명한 방법을 따르면 cu_skip_flag 값에 기초하여 cu_cbf를 infer할 수 있다. 본 발명의 실시예를 따르면 merge_flag에 기초하여 cu_cbf 값을 infer 하는 것이 가능하다. 만약 merge_flag가 0인 경우 cu_cbf를 1로 infer할 수 있다. Merge mode를 사용하지 않는 경우 transform과 관련된 syntax가 존재하는 것을 나타낼 수 있다. 이에 따라 도 28 내지 도 29의 실시예에서 MMVD를 사용하는 경우 cu_cbf를 1로 infer하게 될 수 있다. 도 28에서 설명한 cu_cbf infer 방법과 결합하면 1) merge_flag가 1이고, cu_skip_flag가 1인 경우 cu_cbf를 0으로 infer하고, 2) merge_flag가 1이고, cu_skip_flag가 0인 경우 cu_cbf를 1로 infer하고, 3) merge_flag가 0인 경우 cu_cbf를 1로 infer할 수 있다. 또는 도 28과 같이 1) cu_skip_flag가 1인 경우 cu_cbf를 0으로 infer하고, 2) cu_skip_flag가 0인 경우 cu_cbf를 1로 infer할 수 있다.Also, if cu_cbf does not exist, a method of inferring cu_cbf value may be required. According to the method described with reference to FIG. 28, cu_cbf may be inferred based on the cu_skip_flag value. According to an embodiment of the present invention, it is possible to infer a cu_cbf value based on the merge_flag. If merge_flag is 0, cu_cbf can be inferred to 1. If merge mode is not used, it may indicate that there is syntax related to transform. Accordingly, in the case of using the MMVD in the embodiments of FIGS. 28 to 29, cu_cbf may be inferred to 1. When combined with the cu_cbf infer method described in FIG. 28, 1) when merge_flag is 1 and cu_skip_flag is 1, cu_cbf is inferred to 0, 2) merge_flag is 1, when cu_skip_flag is 0, cu_cbf is inferred to 1, and 3) When merge_flag is 0, cu_cbf can be inferred to 1. Alternatively, as shown in FIG. 28, 1) cu_cbf may be inferred to 0 when cu_skip_flag is 1, and 2) cu_cbf may be inferred to 1 when cu_skip_flag is 0.

본 발명의 또다른 실시예를 따르면 mmvd_flag에 기초하여 cu_cbf 값을 infer하는 것이 가능하다. mmvd_flag가 1인 경우 cu_cbf를 1로 infer하는 것이 가능하다. 또한 mmvd_flag가 0인 경우에는 cu_cbf를 0이나 1로 infer하는 것이 가능하다. 도 28에서 설명한 infer 방법과 결합하면 1) mmvd_flag가 1인 경우 cu_cbf를 1로 infer하고, 2) mmvd_flag가 0인 경우, cu_skip_flag가 1인 경우 cu_cbf를 0으로 infer하고, 3) mmvd_flag가 0인 경우, cu_skip_flag가 0인 경우 cu_cbf를 1로 infer할 수 있다.According to another embodiment of the present invention, it is possible to infer a cu_cbf value based on mmvd_flag. When mmvd_flag is 1, it is possible to infer cu_cbf to 1. Also, when mmvd_flag is 0, it is possible to infer cu_cbf to 0 or 1. When combined with the infer method described in FIG. 28, 1) when mmvd_flag is 1, cu_cbf is inferred to 1, 2) when mmvd_flag is 0, cu_skip_flag is 1, cu_cbf is inferred to 0, and 3) mmvd_flag is 0 , If cu_skip_flag is 0, cu_cbf can be inferred to 1.

또한 도 28 내지 도 29의 실시예에서 mmvd_flag가 merge_data 안에 존재하지 않는 것이 가능하다. merge_data는 도 28 내지 도 29에 나타낸 merge_data일 수 있고, 도 24 내지 도 27 등에서 나타낸 merge_data일 수 있다.In addition, in the embodiments of FIGS. 28 to 29, it is possible that mmvd_flag does not exist in merge_data. merge_data may be merge_data shown in FIGS. 28 to 29, merge_data shown in FIGS. 24 to 27, and the like.

도 30은 본 발명의 일 실시예에 따른 merge mode 시그날링을 나타낸 도면이다.30 is a diagram illustrating merge mode signaling according to an embodiment of the present invention.

도 30을 참조하면 merge mode 시그날링을 regular flag, MMVD flag, subblock flag, CIIP flag 등을 통해 하는 것이 가능하다. 도 30 (a)와 도 30 (b)는 각각 skip이 아닌 merge mode, skip인 merge mode에 해당하는 것일 수 있다. 도 30의 실시예에서 앞선 도면들의 merge data syntax와 다르게 regular flag가 존재할 수 있다. 또한 triangle flag가 존재하지 않을 수 있다. 상기 regular flag는 기존의 merge mode를 사용하는 것을 지시하는 시그날링일 수 있다. 기존의 merge mode는 HEVC에서 사용한 것과 같은 merge mode일 수 있다. 또한 기존의 merge mode는 merge_idx에 의해 지시되는 candidate를 사용하며 motion vector difference를 사용하지 않는 merge mode일 수 있다. Regular flag, MMVD flag, subblock flag, CIIP flag는 기설정된 순서대로 시그날링될 수 있다. MMVD flag는 MMVD 사용 여부를 나타내는 시그날링, subblock flag는 앞선 도면들의 merge_subblock_flag, CIIP flag는 앞선 도면들의 mh_intra_flag일 수 있다. 상기 Regular flag, MMVD flag, subblock flag, CIIP flag 들 중에 해당 mode를 사용한다고 나타내는 시그날링은 많아야 1일 수 있다. 따라서 상기 Regular flag, MMVD flag, subblock flag, CIIP flag 중 1인 값이 발생하면 그 뒤에 있는 flag들은 0인 것으로 판단할 수 있다. 또한 상기 Regular flag, MMVD flag, subblock flag, CIIP flag가 모두 0인 경우 상기 Regular flag, MMVD flag, subblock flag, CIIP flag가 나타내지 않는 mode가 사용되는 것일 수 있다. 상기 Regular flag, MMVD flag, subblock flag, CIIP flag가 나타내지 않는 mode는 triangle prediction일 수 있다. 상기 Regular flag, MMVD flag, subblock flag, CIIP flag가 나타내지 않는 mode의 사용 여부를 나타내는 시그날링은 앞선 도면들에서 merge_triangle_flag일 수 있다.Referring to FIG. 30, it is possible to perform merge mode signaling through a regular flag, an MMVD flag, a subblock flag, a CIIP flag, or the like. 30(a) and 30(b) may correspond to a merge mode that is not a skip and a merge mode that is a skip, respectively. In the embodiment of FIG. 30, different from the merge data syntax of the previous figures, a regular flag may exist. Also, the triangle flag may not exist. The regular flag may be signaling indicating to use an existing merge mode. The existing merge mode may be the same merge mode as used in HEVC. Also, the existing merge mode may be a merge mode that uses a candidate indicated by merge_idx and does not use a motion vector difference. The regular flag, MMVD flag, subblock flag, and CIIP flag may be signaled in a preset order. The MMVD flag may be signaling indicating whether to use MMVD, the subblock flag may be merge_subblock_flag of the previous drawings, and the CIIP flag may be mh_intra_flag of the previous drawings. Among the regular flags, MMVD flags, subblock flags, and CIIP flags, signaling indicating that a corresponding mode is used may be 1 at most. Therefore, when a value of 1 among the Regular flag, MMVD flag, subblock flag, and CIIP flag occurs, the flags behind it may be determined to be 0. In addition, when the Regular flag, MMVD flag, subblock flag, and CIIP flag are all 0, a mode not indicated by the Regular flag, MMVD flag, subblock flag, and CIIP flag may be used. A mode not indicated by the Regular flag, MMVD flag, subblock flag, and CIIP flag may be triangle prediction. The signaling indicating whether to use a mode not indicated by the Regular flag, MMVD flag, subblock flag, and CIIP flag may be merge_triangle_flag in the preceding drawings.

도 31은 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.31 is a diagram illustrating a merge data syntax according to an embodiment of the present invention.

도 31은 도 30에서 설명한 syntax 구조를 나타낼 수 있다. 도 30에서 설명한 regular flag는 도 31에서 regular_merge_flag일 수 있다. 본 발명의 일 실시예를 따르면 regular_merge_flag는 merge data syntax의 가장 앞에 있을 수 있다. 즉, merge_flag가 1인 것을 확인한 뒤 parsing하는 첫 번째 syntax가 regular_merge_flag일 수 있다. 또한 regular_merge flag가 0인 경우 mmvd_flag를 parsing하는 것이 가능하다. 또한 regular_merge_flag가 0인 경우 merge_subblock_flag 또는 mh_intra_flag 또는 merge_triangle_flag를 parsing하는 것이 가능하다. 도 31을 참조하면 어떤 block size 조건을 만족시킬 때 mmvd_flag를 parsing하는 것이 가능하다. 또한 merge_triangle_flag는 !regular_merge_flag && !mmvd_flag && !merge_subblock_flag && !mh_intra_flag 로 결정되는 것이 가능하다. 즉 regular_merge_flag, mmvd_flag, merge_subblock_flag, mh_intra_flag 가 모두 0일 때 merge_triangle_flag는 1이고, regular_merge_flag, mmvd_flag, merge_subblock_flag, mh_intra_flag 중 하나라도 1일 때 merge_triangle_flag는 0일 수 있다.FIG. 31 may show the syntax structure described in FIG. 30. The regular flag described in FIG. 30 may be a regular_merge_flag in FIG. 31. According to an embodiment of the present invention, regular_merge_flag may be in front of the merge data syntax. That is, the first syntax parsed after confirming that merge_flag is 1 may be regular_merge_flag. Also, when the regular_merge flag is 0, it is possible to pars the mmvd_flag. In addition, when regular_merge_flag is 0, it is possible to pars merge_subblock_flag or mh_intra_flag or merge_triangle_flag. Referring to FIG. 31, it is possible to pars mmvd_flag when a certain block size condition is satisfied. Also, the merge_triangle_flag may be determined as !regular_merge_flag && !mmvd_flag && !merge_subblock_flag && !mh_intra_flag. That is, when regular_merge_flag, mmvd_flag, merge_subblock_flag, and mh_intra_flag are all 0, merge_triangle_flag is 1, and when any one of regular_merge_flag, mmvd_flag, merge_subblock_flag, mh_intra_flag is 1, merge_triangle_flag may be 0.

도 32는 본 발명의 일 실시예에 따른 merge data syntax를 나타낸 도면이다.32 is a diagram illustrating a merge data syntax according to an embodiment of the present invention.

도 32는 도 30에서 설명한 syntax 구조를 나타낼 수 있다. 도 32를 참조하면 regular_merge_flag가 1인 경우 merge_idx를 parsing할 수 있다. 또한 MaxNumMergeCand가 1보다 큰 경우 merge_idx를 parsing할 수 있다. 또한 regular_merge_flag가 0인 경우 mmvd_flag, merge_subblock_flag, mh_intra_flag 등을 parsing하는 것이 가능할 수 있다. 또한 merge_triangle_flag의 값은 도 30 내지 도 31에서 설명한 방법에 의해 결정될 수 있다. 즉, merge_triangle_flag는 다른 flag 값에 기초하여 결정될 수 있다. 만약 merge_triangle_flag가 1인 경우 triangle prediction과 관련된 syntax를 parsing하는 것이 가능하다. 예를 들면 merge_triangle_idx를 parsing하는 것이 가능하다.32 may show the syntax structure described in FIG. 30. Referring to FIG. 32, when regular_merge_flag is 1, merge_idx can be parsed. Also, when MaxNumMergeCand is greater than 1, merge_idx can be parsed. In addition, when regular_merge_flag is 0, it may be possible to parsing mmvd_flag, merge_subblock_flag, mh_intra_flag, and the like. Also, the value of merge_triangle_flag may be determined by the method described with reference to FIGS. 30 to 31. That is, merge_triangle_flag may be determined based on another flag value. If merge_triangle_flag is 1, it is possible to pars the syntax related to triangle prediction. For example, it is possible to pars the merge_triangle_idx.

도 31의 실시예와 같은 경우에는 regular merge mode에 필요한 merge_idx가 merge data syntax의 뒤쪽에 존재하고, regular_merge_flag와 merge_idx 사이에 예를 들면 mmvd_flag, merge_subblock_flag, mh_intra_flag와 같은 시그날링들이 존재하기 때문에 regular merge mode를 사용하는 경우 시그날링이 비효율적일 수 있다. 그러나 도 32의 실시예에서는 regular_merge_flag가 1인 경우 regular_merge_flag 다음에 바로 merge_idx를 parsing할 수 있기 때문에 regular merge mode와 관계없는 다른 시그날링들을 parsing할 필요가 없을 수 있고, 이에 따라 압축 효율이 향상될 수 있다.In the case of the embodiment of FIG. 31, the merge_idx required for the regular merge mode exists at the back of the merge data syntax, and signals such as mmvd_flag, merge_subblock_flag, and mh_intra_flag exist between the regular_merge_flag and the merge_idx. If used, signaling can be inefficient. However, in the embodiment of FIG. 32, when regular_merge_flag is 1, since merge_idx can be parsed immediately after regular_merge_flag, it may not be necessary to pars other signals irrelevant to the regular merge mode, and thus compression efficiency can be improved. .

도 33은 도 30 내지 도 32에서 설명한 syntax 구조를 나타낸 도면이다.33 is a diagram illustrating a syntax structure described in FIGS. 30 to 32.

도 33을 참조하면 Mode A, Mode B, Mode C 등이 존재할 수 있다. 또한 Mode A, Mode B, Mode C 중에서 1개만 사용되는 것이 가능하다. 또한 Mode A를 사용하기 위한 조건이 존재할 수 있다. Mode A를 사용하기 위한 조건은 A1, A2, A3 등일 수 있고, 이것들을 모두 만족할 때 Mode A를 사용할 수 있는 것이 가능하다. 또한 Mode B를 사용하기 위한 조건은 B1, B2, B3 등일 수 있고, 이것들을 모두 만족할 때 Mode B를 사용할 수 있는 것이 가능하다. 또한 Mode C를 사용하기 위한 조건은 C1, C2, C3 등일 수 있고, 이것들을 모두 만족할 때 Mode C를 사용할 수 있는 것이 가능하다. Mode X의 사용 여부를 나타내는 시그날링은 mode_X_flag일 수 있다. 또한 도 33을 참조하면 mode A, mode B, mode C 순서대로 mode가 결정되며 관련 syntax를 parsing하는 것이 가능하다. 또는 mode_A_flag, mode_B_flag, mode_C_flag 순서대로 시그날링하는 것이 가능하다. 만약 Mode A를 사용하기 위한 조건을 만족시킬 경우 mode_A_flag를 parsing할 수 있다. 만약 mode_A_flag가 1인 경우 mode A와 관련된 syntax를 parsing하고, 나머지 mode와 관련된 mode_X_flag 및 관련 syntax를 parsing하지 않을 수 있다. 만약 mode_A_flag가 0인 경우 mode B 또는 mode C를 사용할 가능성이 있을 수 있다. 따라서 만약 mode B를 사용하기 위한 조건을 만족시킬 경우 mode_B_flag를 parsing할 수 있다. 만약 mode_B_flag가 1인 경우 mode B와 관련된 syntax를 parsing하고, 나머지 mode(mode C)와 관련된 mode_X_flag 및 관련 syntax를 parsing하지 않을 수 있다. 만약 mode_B_flag가 0인 경우 mode C를 사용하는 것으로 판단할 수 있다. 즉 mode C에 해당하지 않는 mode_X_flag들이 모두 0인 경우 mode C를 사용하는 것으로 결정할 수 있다. 그리고 mode C와 관련된 syntax를 parsing할 수 있다.Referring to FIG. 33, there may be Mode A, Mode B, Mode C, and the like. Also, it is possible to use only one of Mode A, Mode B, and Mode C. There may also be conditions for using Mode A. Conditions for using Mode A may be A1, A2, A3, etc., and it is possible to use Mode A when all of these are satisfied. Also, the conditions for using Mode B may be B1, B2, B3, etc., and it is possible to use Mode B when all of these are satisfied. In addition, conditions for using Mode C may be C1, C2, C3, etc., and it is possible to use Mode C when all of these are satisfied. Signaling indicating whether to use Mode X may be mode_X_flag. Also, referring to FIG. 33, modes are determined in the order of mode A, mode B, and mode C, and related syntax can be parsed. Alternatively, it is possible to signal in the order of mode_A_flag, mode_B_flag, and mode_C_flag. If the condition for using Mode A is satisfied, mode_A_flag can be parsed. If mode_A_flag is 1, syntax related to mode A may be parsed, and mode_X_flag related to the remaining modes and related syntax may not be parsed. If mode_A_flag is 0, there may be a possibility to use mode B or mode C. Therefore, if the condition for using mode B is satisfied, mode_B_flag can be parsed. If mode_B_flag is 1, syntax related to mode B may be parsed, and mode_X_flag related to the remaining mode (mode C) and related syntax may not be parsed. If mode_B_flag is 0, it may be determined that mode C is used. That is, if all of the mode_X_flags that do not correspond to mode C are 0, it may be determined to use mode C. And you can parsing syntax related to mode C.

도 34는 본 발명의 일 실시예에 따른 syntax 구조를 나타낸 도면이다.34 is a diagram showing a syntax structure according to an embodiment of the present invention.

도 33에서 설명한 것처럼 Mode A, Mode B, Mode C 등이 존재할 수 있고, 그에 따른 mode 사용 여부 시그날링인 mode_X_flag, 관련 syntax 등이 존재할 수 있다. 또한 mode X를 사용하기 위한 조건인 X1, X2, X3 등이 존재할 수 있다. 또한 mode A, mode B, mode C 순서대로 mode가 결정되고 관련 syntax가 parsing될 수 있다.As described with reference to FIG. 33, Mode A, Mode B, Mode C, etc. may exist, and accordingly, mode_X_flag indicating whether to use a mode, related syntax, etc. may exist. In addition, there may be conditions for using mode X, such as X1, X2, X3, etc. Also, mode is determined in the order of mode A, mode B, and mode C, and related syntax can be parsed.

이때 본 발명의 일 실시예를 따르면 mode X보다 뒤에서 결정되는 mode들이 모두 사용 불가한 경우 mode X를 사용하는 것으로 결정할 수 있다. 또한 이때 mode_X_flag를 parsing하지 않을 수 있다. 또한 mode가 사용 불가한 것은 앞서 언급한 mode를 사용하기 위한 조건을 만족하는지 여부에 따라서 결정될 수 있다. 예를 들어 mode A, mode B, mode C가 존재할 때 mode B, mode C가 모두 사용 불가한 경우 mode_A_flag를 parsing하지 않을 수 있고, mode A를 사용하는 것으로 판단할 수 있다. Mode A, mode B, mode C 이외에 더 많은 mode가 존재하는 경우에도 이 방법을 사용하여 mode를 결정하는 것이 가능하다. 예를 들어 mode A, mode B, mode C, mode D가 존재할 때 mode B, mode C, mode D를 모두 사용 불가할 때 mode A를 사용하는 것으로 판단할 수 있다. 또한 mode A를 사용하지 않는 것으로 판단한 후, mode C, mode D를 모두 사용 불가할 때 mode B를 사용하는 것으로 판단할 수 있다.In this case, according to an embodiment of the present invention, when all modes determined after mode X are not available, it may be determined to use mode X. Also, at this time, mode_X_flag may not be parsed. Also, whether the mode is unavailable may be determined according to whether or not the conditions for using the above-mentioned mode are satisfied. For example, when mode A, mode B, and mode C exist and mode B and mode C are both unavailable, mode_A_flag may not be parsed, and it may be determined that mode A is used. Even if there are more modes other than Mode A, Mode B, and Mode C, it is possible to determine the mode using this method. For example, when mode A, mode B, mode C, and mode D exist, it can be determined that mode A is used when mode B, mode C, and mode D are all unavailable. In addition, after determining that mode A is not used, it can be determined that mode B is used when both mode C and mode D are unavailable.

도 34를 참조하면 mode X를 사용할 수 없는 조건은 X1, X2, X3 중 하나라도 만족시키지 않을 때일 수 있다. 즉 !X1 || !X2 || !X3 인 경우 mode X를 사용할 수 없을 수 있다. 따라서 도 34를 참조하면 mode B와 mode C를 모두 사용할 수 없는 경우는 ((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3)) 를 만족시키는 경우일 수 있고, 이러한 경우 mode_A_flag를 parsing하지 않을 수 있고, 그 값을 1로 infer할 수 있다. 즉, mode A를 사용하는 것으로 판단할 수 있다. 또한 ((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3))를 만족시키지 않는 경우 mode_A_flag를 parsing할 수 있다. 이때 mode A를 사용하기 위한 조건까지 고려한다면 !((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3)) 를 만족시키고, (A1 && A2 && A3) 인 경우 mode_A_flag를 parsing할 수 있다. 다른 말로 하면 mode B를 사용하기 위한 조건과 mode C를 사용하기 위한 조건 중 하나라도 만족키시면 mode_A_flag를 parsing할 수 있다. 즉 (B1 && B2 && B3) 또는 (C1 && C2 && C3)인 경우 mode_A_flag를 parsing할 수 있다.Referring to FIG. 34, a condition in which mode X cannot be used may be when any one of X1, X2, and X3 is not satisfied. I.e. !X1 || !X2 || If !X3, mode X may not be available. Therefore, referring to FIG. 34, when both mode B and mode C cannot be used, ((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3)) is satisfied. In this case, mode_A_flag may not be parsed, and its value may be inferred to 1. That is, it can be determined that mode A is used. Also, if ((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3)) is not satisfied, mode_A_flag can be parsed. At this time, if the conditions for using mode A are also considered, !((!B1 || !B2 || !B3) && (!C1 || !C2 || !C3)) is satisfied, and (A1 && A2 && A3) If it is, mode_A_flag can be parsed. In other words, mode_A_flag can be parsed if either the condition for using mode B or the condition for using mode C is satisfied. That is, in the case of (B1 && B2 && B3) or (C1 && C2 && C3), mode_A_flag can be parsed.

또한 mode_A_flag가 존재하지 않는다면 (B1 && B2 && B3) 또는 (C1 && C2 && C3)일 때 0으로 infer하고, 그렇지 않을 때 1로 infer할 수 있다. 즉, mode B와 mode C를 모두 사용 불가할 때 mode_A_flag가 존재하지 않는다면 1로(사용하는 것으로) infer할 수 있다.In addition, if mode_A_flag does not exist, it can infer to 0 when it is (B1 && B2 && B3) or (C1 && C2 && C3), and infer it to 1 otherwise. In other words, when both mode B and mode C are unavailable, if mode_A_flag does not exist, it can be inferred to 1 (the one that is used).

도 35는 본 발명의 일 실시예에 따른 syntax 구조를 나타낸 도면이다.35 is a diagram showing a syntax structure according to an embodiment of the present invention.

도 35는 도 34에서 설명한 방법에 기초할 수 있다. 또한 도 30 내지 도 31에 설명한 것과 같이 regular_merge_flag가 존재하는 실시예일 수 있다.FIG. 35 may be based on the method described in FIG. 34. Also, as described in FIGS. 30 to 31, it may be an embodiment in which regular_merge_flag exists.

앞서 설명한 것처럼 본 발명의 일 실시예를 따르면 어떤 mode의 사용 여부가 결정되는 것보다 사용 여부가 늦게 결정되는 mode들이 모두 사용 불가한 경우 상기 어떤 mode의 사용 여부를 나타내는 시그날링을 parsing하지 않고, 상기 어떤 mode를 사용하는 것으로 판단할 수 있다. 예를 들어 subblock merge mode의 사용 여부가 결정되는 것보다 사용 여부가 늦게 결정되는 mode들이 모두 사용 불가한 경우 subblock merge mode의 사용 여부를 나타내는 시그날링을 parsing하지 않고, subblock merge mode를 사용하는 것으로 판단할 수 있다. 상기 사용 여부가 늦게 결정되는 mode들은 mh_intra, triangle prediction을 포함할 수 있다.As described above, according to an embodiment of the present invention, when all modes in which the use is determined later than the one in which the mode is used are not available, the signaling indicating the use of the mode is not parsed, and the It can be determined that some mode is used. For example, if all the modes that are used later than the subblock merge mode are determined are not available, it is determined that the subblock merge mode is used without parsing the signaling indicating whether the subblock merge mode is used. can do. The modes in which the use or not is determined late may include mh_intra and triangle prediction.

예를 들어 MMVD의 사용 여부가 결정되는 것보다 사용 여부가 늦게 결정되는 mode들이 모두 사용 불가한 경우 MMVD의 사용 여부를 나타내는 시그날링을 parsing하지 않고, MMVD를 사용하는 것으로 판단할 수 있다. 상기 사용 여부가 늦게 결정되는 mode들은 subblock merge mode, mh_intra, triangle prediction을 포함할 수 있다.For example, if all the modes in which the use of MMVD is determined later than that of the use of MMVD are not available, it may be determined that the MMVD is used without parsing the signaling indicating whether to use the MMVD. The modes in which the use or not is determined late may include a subblock merge mode, mh_intra, and triangle prediction.

또한 상기 실시예들에서 mh_intra를 사용할 수 있는 조건(도 35에서 mh_intra_conditions)은 1) sps_mh_intra_enabled_flag, 2) cu_skip_flag[ x0 ][ y0 ] == 0, 3) block size 조건 등을 포함할 수 있다. 또한 block size 조건은 (( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight < 128) 일 수 있다.In addition, the conditions for using mh_intra in the above embodiments (mh_intra_conditions in FIG. 35) may include 1) sps_mh_intra_enabled_flag, 2) cu_skip_flag[x0][y0] == 0, 3) block size conditions, and the like. In addition, the block size condition may be (( cbWidth * cbHeight) >= 64 && cbWidth <128 && cbHeight <128).

또한 상기 실시예들에서 triangle prediction을 사용할 수 있는 조건(도 35에서 merge_triangle_conditions)은 1) sps_triangle_enabled_flag, 2) tile_group_type == B, 3) block size 조건 등을 포함할 수 있다. 또한 block size 조건은 (cbWidth * cbHeight >= 64) 일 수 있다.In addition, in the above embodiments, conditions for using triangle prediction (merge_triangle_conditions in FIG. 35) may include 1) sps_triangle_enabled_flag, 2) tile_group_type == B, 3) block size conditions, and the like. Also, the block size condition may be (cbWidth * cbHeight >= 64).

또한 상기 실시예들에서 subblock merge를 사용할 수 있는 조건(도 35에서 merge_subblock_conditions)은 1) MaxNumSubblockMergeCand > 0, 2) block size 조건 등을 포함할 수 있다. 또한 block size 조건은 (cbWidth >= 8 && cbHeight >= 8) 일 수 있다.In addition, in the above embodiments, conditions for using subblock merge (merge_subblock_conditions in FIG. 35) may include 1) MaxNumSubblockMergeCand> 0, 2) block size conditions, and the like. Also, the block size condition may be (cbWidth >= 8 && cbHeight >= 8).

따라서 (!mh_intra_conditions && !merge_triangle_conditions)인 경우 merge_subblock_flag를 parsing하지 않을 수 있다. 또한 merge_subblock_flag가 존재하지 않는 경우 (!mh_intra_conditions && !merge_triangle_conditions)이면 merge_subblock_flag를 1로 infer하고, 그렇지 않은 경우 0으로 infer할 수 있다.Therefore, in the case of (!mh_intra_conditions && !merge_triangle_conditions), the merge_subblock_flag may not be parsed. In addition, if merge_subblock_flag does not exist (!mh_intra_conditions && !merge_triangle_conditions), merge_subblock_flag may be inferred to 1, otherwise, inferred to 0.

또한 (!merge_subblock_conditions && !mh_intra_conditions && !merge_triangle_conditions)인 경우 mmvd_flag를 parsing하지 않을 수 있다. 또한 mmvd_flag가 존재하지 않는 경우 (!merge_subblock_conditions && !mh_intra_conditions && !merge_triangle_conditions)이면 mmvd_flag를 1로 infer하고, 그렇지 않은 경우 0으로 infer할 수 있다.Also, in the case of (!merge_subblock_conditions && !mh_intra_conditions && !merge_triangle_conditions), mmvd_flag may not be parsed. In addition, if mmvd_flag does not exist (!merge_subblock_conditions && !mh_intra_conditions && !merge_triangle_conditions), mmvd_flag can be inferred to 1, otherwise it can infer to 0.

예를 들어 (!sps_mh_intra_enabled_flag && !sps_triangle_enabled_flag)인 경우 merge_subblock_flag를 parsing하지 않을 수 있고, 1로 infer할 수 있다. 또는 cu_skip_flag가 1이고, tile_group_type이 B가 아닌 경우 merge_subblock_flag를 parsing하지 않을 수 있고, 1로 infer할 수 있다. 또는 width 및 height가 각각 128, 128이고, tile_group_type이 B가 아닌 경우 merge_subblock_flag를 parsing하지 않을 수 있고, 1로 infer할 수 있다.For example, in the case of (!sps_mh_intra_enabled_flag && !sps_triangle_enabled_flag), merge_subblock_flag may not be parsed and may be inferred to 1. Alternatively, when cu_skip_flag is 1 and tile_group_type is not B, merge_subblock_flag may not be parsed and may be inferred to 1. Alternatively, when width and height are 128 and 128, respectively, and tile_group_type is not B, merge_subblock_flag may not be parsed, and may be inferred to 1.

도 36은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면이다.36 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 시그날링된 MVD로부터 MVD를 결정할 수 있다. 이것은 도 13에서 설명한 것처럼 시그날링된 MVD 혹은 시그날링된 MV를 변형한 MV를 사용하는 방법을 나타낸 것이다. 또한 도 13에서 설명한 POC에 기초한 변형을 나타낸 것일 수 있다.According to an embodiment of the present invention, the MVD may be determined from the signaled MVD. This shows a method of using a signaled MVD or an MV modified from the signaled MV as described in FIG. 13. In addition, it may represent a modification based on the POC described in FIG. 13.

도 36을 참조하면 MmvdOffset은 시그날링된 MV일 수 있다. 예를 들어 앞서 MMVD를 설명한 것처럼 MMVD distance와 MMVD direction에 기초하여 MmvdOffset을 결정할 수 있다. 예를 들면 mmvd_distance_idx에 기초해서 MmvdDistance가 결정될 수 있다. 예를 들어 MmvdDistance 후보가 다수 있을 때 mmvd_distance_idx에 기초해서 MmvdDistance가 결정될 수 있다. 예를 들면 MmvdDistance는 {1, 2, 4, 8, 16, 32, 64, 128} 중에서 선택될 수 있다. 또한 mmvd_direction_idx에 기초해서 MmvdSign이 결정될 수 있다. 또한 mmvd_direction_idx에 기초해서 MmvdSign[0]과/또는 MmvdSign[1]이 결정될 수 있다. MmvdSign[0]은 x축에 해당되는 값이고, MmvdSign[1]은 y축에 해당되는 값일 수 있다. 상기 MMVD distance는 MmvdDistance이고, 상기 MMVD direction은 MmvdSign일 수 있다. 또한 MmvdOffset은 MmvdDistance와 MmvdSign에 기초해서 결정될 수 있다. 예를 들면 다음과 같이 MmvdOffset이 결정될 수 있다.Referring to FIG. 36, MmvdOffset may be a signaled MV. For example, as previously described with MMVD, MmvdOffset may be determined based on MMVD distance and MMVD direction. For example, MmvdDistance may be determined based on mmvd_distance_idx. For example, when there are multiple MmvdDistance candidates, MmvdDistance may be determined based on mmvd_distance_idx. For example, MmvdDistance may be selected from {1, 2, 4, 8, 16, 32, 64, 128}. In addition, MmvdSign may be determined based on mmvd_direction_idx. In addition, MmvdSign[0] and/or MmvdSign[1] may be determined based on mmvd_direction_idx. MmvdSign[0] may be a value corresponding to the x-axis, and MmvdSign[1] may be a value corresponding to the y-axis. The MMVD distance may be MmvdDistance, and the MMVD direction may be MmvdSign. Also, MmvdOffset may be determined based on MmvdDistance and MmvdSign. For example, MmvdOffset may be determined as follows.

MmvdOffset[ x0 ][ y0 ][ 0 ] = ( MmvdDistance[ x0 ][ y0 ] << 2 ) * MmvdSign[ x0 ][ y0 ][0]MmvdOffset[ x0 ][ y0 ][ 0] = (MmvdDistance[ x0 ][ y0] << 2) * MmvdSign[ x0 ][ y0 ][0]

MmvdOffset[ x0 ][ y0 ][ 1 ] = ( MmvdDistance[ x0 ][ y0 ] << 2 ) * MmvdSign[ x0 ][ y0 ][1]MmvdOffset[ x0 ][ y0 ][ 1] = (MmvdDistance[ x0 ][ y0] << 2) * MmvdSign[ x0 ][ y0 ][1]

MmvdOffset[ x0 ][ y0 ][ 0 ]은 x축에 해당하는 값이고, MmvdOffset[ x0 ][ y0 ][ 0 ]은 y축에 해당하는 값일 수 있다. 또한 MmvdOffset을 계산하는 식에서 MmvdDistance를 bit shift하였는데, 실시예에 따라 bit shift 개수가 달라질 수 있다.MmvdOffset[x0][y0][0] may be a value corresponding to the x-axis, and MmvdOffset[x0][y0][0] may be a value corresponding to the y-axis. In addition, MmvdDistance was bit shifted in the formula for calculating MmvdOffset, and the number of bit shifts may vary according to embodiments.

도 36에 나타낸 것과 같이 MmvdOffset을 기초로 mMvdLX를 derive할 수 있다. LX는 reference list를 나타낼 수 있다. LX는 L0 또는 L1일 수 있다.As shown in Fig. 36, mMvdLX can be derived based on MmvdOffset. LX can represent a reference list. LX may be L0 or L1.

또한 본 발명의 일 실시예를 따르면 motion vector mvLX가 있을 때 mvLX += mMvdLX 를 통해 mvLX를 결정, 도출할 수 있다. 예를 들면 mvLX는 merge motion vector일 수 있다. 또한 이러한 mvLX 결정 동작은 MMVD를 사용하는 경우에 수행하는 것이 가능하다. 즉, merge candidate로부터 mvLX를 결정하고, mMvdLX를 이용하여 mvLX를 수정할 수 있다. 예를 들면 mvLX는 다음과 같이 계산될 수 있다.In addition, according to an embodiment of the present invention, when there is a motion vector mvLX, mvLX may be determined and derived through mvLX += mMvdLX. For example, mvLX may be a merge motion vector. In addition, this mvLX determination operation can be performed when using MMVD. That is, mvLX can be determined from the merge candidate, and mvLX can be modified using mMvdLX. For example, mvLX can be calculated as follows.

mvLX[ 0 ][ 0 ][ 0 ] += mMvdLX[ 0 ]mvLX[ 0 ][ 0 ][ 0] += mMvdLX[ 0]

mvLX[ 0 ][ 0 ][ 1 ] += mMvdLX[ 1 ]mvLX[ 0 ][ 0 ][ 1] += mMvdLX[ 1]

상기 식에서 mMvdLX[ 0 ]를 사용한 것은 x축에 해당하는 식이고, mMvdLX[ 1 ]을 사용한 것은 y축에 해당하는 식일 수 있다.In the above formula, using mMvdLX[0] corresponds to the x-axis, and using mMvdLX[1] may correspond to the y-axis.

도 36을 참조하면 predFlagL0와 predFlagL1이 모두 1인 경우와 그렇지 않은 경우로 나누어 동작할 수 있다. 또한 predFlagL0와 predFlagL1이 모두 1인 경우는 bi-prediction인 경우일 수 있다. 또한 그렇지 않은 경우는 uni-prediction인 경우일 수 있다.Referring to FIG. 36, the operation may be performed by dividing the case where predFlagL0 and predFlagL1 are both 1 and not. Also, a case in which both predFlagL0 and predFlagL1 are 1 may be a case of bi-prediction. Also, otherwise, it may be a case of uni-prediction.

Bi-prediction인 경우, MmvdOffset 또는 -MmvdOffset을 mMvdLX에 대입할 수 있다. 그 다음에 MV scaling을 수행할 수 있다. 또한 이때 POC를 참조할 수 있다. 예를 들어 현재 픽쳐(도 36에서 currPic)의 POC, reference picture list 0에 해당하는 POC (도 36에서 RefPicList0[ refIdxL0 ]; refIdxL0는 L0에 대한 reference index), reference picture list 1에 해당하는 POC (도 36에서 RefPicList1[ refIdxL1 ]; refIdxL1는 L1에 대한 reference index)를 참조할 수 있다. 또한 DiffPicOrderCnt(picA, picB)는 picture picA와 picture picB의 POC 차이일 수 있다. 예를 들면 DiffPicOrderCnt( picA, picB ) = PicOrderCnt( picA ) - PicOrderCnt( picB ) 일 수 있다. PicOrderCnt는 POC일 수 있다. 도 36을 참조하면 (8-297), (8-298)에 나타낸 것처럼 currPocDiffL0와 currPocDiffL1을 정의할 수 있다. 만약 -currPocDiffL0 * currPocDiffL1 is greater than 0 경우, mMvdL0와 mMvdL1 중 하나에는 MmvdOffset을 대입하고, 나머지 하나에는 -MmvdOffset을 대입할 수 있다. 예를 들어 (8-299), (8-300), (8-301), (8-302)에 나타낸 것과 같이 대입할 수 있다. 이것은 -currPocDiffL0 * currPocDiffL1 is greater than 0 경우 현재 picture로부터 L0에 해당하는 reference picture와 L1에 해당하는 reference picture가 POC 순서상 반대 방향이므로 MVD가 반대 방향일 것인 것으로 가정하는 것일 수 있다. 즉, symmetric MVD를 가정하는 것일 수 있다. 도 36의 실시예에서는 시그날링되는 MVD인 MmvdOffset이 L0에 해당하는 것으로 기설정된 예를 나타내었다.In the case of Bi-prediction, MmvdOffset or -MmvdOffset can be substituted into mMvdLX. Then you can perform MV scaling. Also, you can refer to the POC at this time. For example, the POC of the current picture (currPic in Fig. 36), a POC corresponding to reference picture list 0 (RefPicList0[refIdxL0] in Fig.36; refIdxL0 is a reference index for L0), a POC corresponding to reference picture list 1 (Fig. In 36, RefPicList1[refIdxL1]; refIdxL1 may refer to a reference index for L1). In addition, DiffPicOrderCnt(picA, picB) may be a difference in POC between picture picA and picture picB. For example, it may be DiffPicOrderCnt(picA, picB) = PicOrderCnt(picA)-PicOrderCnt(picB). PicOrderCnt may be a POC. Referring to FIG. 36, as shown in (8-297) and (8-298), currPocDiffL0 and currPocDiffL1 can be defined. If -currPocDiffL0 * currPocDiffL1 is greater than 0, MmvdOffset may be substituted for one of mMvdL0 and mMvdL1, and -MmvdOffset may be substituted for the other. For example, it can be substituted as shown in (8-299), (8-300), (8-301), and (8-302). If -currPocDiffL0 * currPocDiffL1 is greater than 0, it may be assumed that the reference picture corresponding to L0 and the reference picture corresponding to L1 from the current picture are in opposite directions in the POC order, so MVD will be in the opposite direction. That is, symmetric MVD may be assumed. In the embodiment of FIG. 36, an example in which MmvdOffset, which is a signaled MVD, corresponds to L0 is shown.

만약 -currPocDiffL0 * currPocDiffL1 is greater than 0이지 않은 경우 즉, -currPocDiffL0 * currPocDiffL1 가 0보다 작은 경우(0인 경우는 currPocDiffL0 또는 currPocDiffL1이 0인 경우이므로 current picture가 reference picture인 경우일 수 있다.)에는 mMvdL0와 mMvdL1에 모두 MmvdOffset을 대입할 수 있다. 이것은 L0와 L1에 해당하는 reference picture가 현재 picture로부터 POC 상 같은 방향에 있기 때문일 수 있다.If -currPocDiffL0 * currPocDiffL1 is not greater than 0, that is, if -currPocDiffL0 * currPocDiffL1 is less than 0 (0, it may be the case when the current picture is a reference picture because currPocDiffL0 or currPocDiffL1 is 0). MmvdOffset can be substituted for both and mMvdL1. This may be because the reference pictures corresponding to L0 and L1 are in the same direction on the POC from the current picture.

또한 앞서 설명한 것처럼 mMvdLX에 MmvdOffset을 대입한 후 MV scaling을 수행할 수 있다. 예를 들면 mMvdL0와 mMvdL1 중 하나를 scaling할 수 있다. 예를 들면 기설정된 규칙에 따라 mMvdL0와 mMvdL1 중 하나를 scaling할 수 있다. 예를 들면 Abs( currPocDiffL0 ) 또는 Abs( currPocDiffL1 )에 기초하여 MV scaling할 것을 결정할 수 있다. 예를 들어 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 ) 중 작은 것에 해당하는 mMvdLX를 scaling할 수 있다. 예를 들면 mMvdL1을 scaling할 때 (8-307) 내지 (8-312)에 나타낸 것과 하는 것이 가능하다. 또는 예를 들면 mMvdL0을 scaling할 때 (8-313) 내지 (8-318)에 나타낸 것과 하는 것이 가능하다. 또한 MV scaling에서 도 36의 실시예와 다른 clipping 범위를 사용하는 것이 가능하다. 예를 들어 (8-311), (8-312), (8-317), (8-318) 등에서 clipping을 -2^15, 2^15 - 1 로 하였는데 이 값은 MV가 나타내고자 하는 기설정된 범위에 따라 다른 값일 수 있다. 예를 들어 clipping을 -131072, 131071 로 할 수도 있다. 또한 도 36의 실시예에서 MV scaling은 -currPocDiffL0 * currPocDiffL1 is greater than 0이지 않은 경우에만 수행하는 것도 가능하다. 또다른 실시예로 MV scaling은 -currPocDiffL0 * currPocDiffL1 is greater than 0인 경우와 그렇지 않은 경우 모두에 수행하는 것도 가능하다.Also, as described above, MV scaling can be performed after MmvdOffset is substituted for mMvdLX. For example, you can scale one of mMvdL0 and mMvdL1. For example, one of mMvdL0 and mMvdL1 can be scaled according to a preset rule. For example, it is possible to decide to scale MV based on Abs(currPocDiffL0) or Abs(currPocDiffL1). For example, you can scale mMvdLX, which is the smaller of Abs(currPocDiffL0) and Abs(currPocDiffL1). For example, when scaling mMvdL1, it is possible to do what is shown in (8-307) to (8-312). Or, for example, when scaling mMvdL0, it is possible to do what is shown in (8-313) to (8-318). In addition, it is possible to use a clipping range different from that of the embodiment of FIG. 36 in MV scaling. For example, in (8-311), (8-312), (8-317), (8-318), etc., clipping was set to -2^15, 2^15-1, and these values are the groups that MV wants to represent. It may be a different value depending on the set range. For example, clipping can be set to -131072 and 131071. In addition, in the embodiment of FIG. 36, MV scaling may be performed only when -currPocDiffL0 * currPocDiffL1 is greater than 0. In another embodiment, MV scaling can be performed both when -currPocDiffL0 * currPocDiffL1 is greater than 0 and not.

Uni-prediction인 경우에는 MmvdOffset이 사용하는 reference list에 해당하는 값일 수 있다. 따라서 도 36의 (8-319), (8-320)에 나타낸 것처럼 predFlagLX가 1인 LX에 대해 MmvdOffset이 mMVDLX가 될 수 있다.In the case of Uni-prediction, it may be a value corresponding to the reference list used by MmvdOffset. Therefore, as shown in (8-319) and (8-320) of FIG. 36, MmvdOffset may be mMVDLX for LX in which predFlagLX is 1.

도 36에서 설명한 기호나 약속, 수식, MV scaling 수식 등은 이하의 발명에서도 적용할 수 있다.The symbols, promises, equations, MV scaling equations, and the like described in FIG. 36 can also be applied to the following inventions.

도 37은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면이다.37 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.

도 36에서 설명한 것처럼 시그날링된 값에 기초한 MmvdOffset을 이용하여 mMvdLX를 계산할 수 있다. 도 36과 중복된 설명은 생략하였다. 예를 들어 아래 실시예의 currPocDiffLX, MV scaling 등에 대해 도 36 등의 설명을 참조할 수 있다. 도 36에서 POC 차이에 기초하여 -MmvdOffset을 mMvdLX에 대입하는 경우가 있을 수 있고, 그 후에 MV scaling을 하는 경우가 있을 수 있다. MV scaling은 POC 위치를 고려한 계산 방법일 수 있다. 따라서 도 36의 실시예에서 currPocDiffL0과 currPocDiffL1의 부호가 다른 경우 symmetric MVD 특성을 이용하여 MmvdOffset으로부터 부호를 1번 바꾸어줄 것을 두 번 바꾸는 경우가 발생할 수 있다. 도 37은 이러한 문제를 해결하기 위한 실시예일 수 있다.As described in FIG. 36, mMvdLX can be calculated using MmvdOffset based on the signaled value. The overlapping description of FIG. 36 is omitted. For example, the description of FIG. 36 and the like may be referred to for currPocDiffLX and MV scaling in the following embodiments. In FIG. 36, there may be a case where -MmvdOffset is substituted into mMvdLX based on the difference in POC, and there may be a case of performing MV scaling after that. MV scaling may be a calculation method in consideration of the POC location. Therefore, in the embodiment of FIG. 36, when the codes of currPocDiffL0 and currPocDiffL1 are different, a case of changing the code once from MmvdOffset may be changed twice using the symmetric MVD characteristic. 37 may be an embodiment for solving this problem.

도 37을 참조하면 bi-prediction인 경우 1) currPocDiffL0와 currPocDiffL1가 같은 경우, 2) 그렇지 않고 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 큰 경우, 3) 나머지 경우로 나누어서 mMvdLX derivation 동작을 수행할 수 있다.Referring to FIG. 37, in the case of bi-prediction, 1) when currPocDiffL0 and currPocDiffL1 are the same, 2) otherwise, and when Abs (currPocDiffL0) is greater than Abs (currPocDiffL1), 3) the remaining cases may be divided to perform the mMvdLX derivation operation. .

먼저 currPocDiffL0와 currPocDiffL1가 같은 경우에는 mMvdL0와 mMvdL1이 모두 MmvdOffset으로 설정될 수 있다. 또한 이때 MV scaling 과정을 수행하지 않을 수 있다.First, when currPocDiffL0 and currPocDiffL1 are the same, both mMvdL0 and mMvdL1 may be set to MmvdOffset. Also, at this time, the MV scaling process may not be performed.

또한 2), 3)의 경우에는 mMvdL0와 mMvdL1 중 하나를 기설정된 규칙에 따라 MmvdOffset으로 설정하고, 나머지 하나는 MmvdOffset으로 설정한 mMvdLX를 scaling하여 결정할 수 있다. 예를 들어 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 큰 경우에는 mMvdL0를 MmvdOffset으로 설정하고, mMvdL1은 mMvdL0를 scaling한 값으로 설정할 수 있다. 또한 나머지 경우에는 mMvdL1을 MmvdOffset으로 설정하고, mMvdL0는 mMvdL1를 scaling한 값으로 설정할 수 있다. 이러한 경우 상기 나머지 경우는 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 작은 경우와 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같지만 currPocDiffL0와 currPocDiffL1의 부호가 다른 경우 (즉, currPocDiffL0 = -currPocDiffL1)를 포함할 수 있다.In addition, in cases 2) and 3), one of mMvdL0 and mMvdL1 may be set as MmvdOffset according to a preset rule, and the other may be determined by scaling mMvdLX set as MmvdOffset. For example, when Abs(currPocDiffL0) is greater than Abs(currPocDiffL1), mMvdL0 may be set as MmvdOffset, and mMvdL1 may be set as a value obtained by scaling mMvdL0. In the remaining cases, mMvdL1 may be set to MmvdOffset, and mMvdL0 may be set to a value obtained by scaling mMvdL1. In this case, in the remaining cases, Abs(currPocDiffL0) is less than Abs(currPocDiffL1) and Abs(currPocDiffL0) and Abs(currPocDiffL1) are the same, but currPocDiffL0 and currPocDiffL1 have different signs (that is, currPocDiffL1 = -currPocDiffL1). have.

또다른 실시예로 1) currPocDiffL0와 currPocDiffL1가 같은 경우, 2) 그렇지 않고 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 작은 경우, 3) 나머지 경우로 나누어서 mMvdLX derivation 동작을 수행할 수 있다. 이러한 경우 상기 나머지 경우는 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 큰 경우와 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같지만 currPocDiffL0와 currPocDiffL1의 부호가 다른 경우 (즉, currPocDiffL0 = -currPocDiffL1)를 포함할 수 있다.In another embodiment, 1) when currPocDiffL0 and currPocDiffL1 are the same, 2) otherwise, and when Abs (currPocDiffL0) is smaller than Abs (currPocDiffL1), 3) the remaining cases can be divided into the mMvdLX derivation operation. In this case, in the remaining cases, Abs(currPocDiffL0) is greater than Abs(currPocDiffL1) and Abs(currPocDiffL0) and Abs(currPocDiffL1) are the same, but currPocDiffL0 and currPocDiffL1 have different signs (ie, currPocDiffL1 = -currPocDiffL1). have.

도 38은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면이다.38 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.

도 36 내지 도 37에서 설명한 것처럼 시그날링된 값에 기초한 MmvdOffset을 이용하여 mMvdLX를 계산할 수 있다. 도 36 내지 도 37과 중복된 설명은 생략하였다. 예를 들어 아래 실시예의 currPocDiffLX, MV scaling 등에 대해 도 36 내지 도 37 등의 설명을 참조할 수 있다.As described with reference to FIGS. 36 to 37, mMvdLX may be calculated using MmvdOffset based on the signaled value. The overlapping description of FIGS. 36 to 37 has been omitted. For example, descriptions of FIGS. 36 to 37 may be referred to for currPocDiffLX and MV scaling in the following embodiments.

도 37의 실시예에서는 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같지만 currPocDiffL0와 currPocDiffL1의 부호가 다른 경우 (즉, currPocDiffL0 = -currPocDiffL1) 인 경우에도 MV scaling을 수행하였다. 하지만 이것은 redundant할 수 있다.In the embodiment of FIG. 37, when Abs (currPocDiffL0) and Abs (currPocDiffL1) are the same, but the signs of currPocDiffL0 and currPocDiffL1 are different (ie, currPocDiffL0 = -currPocDiffL1), MV scaling was also performed. But this can be redundant.

따라서 본 발명의 일 실시예를 따르면 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같지만 currPocDiffL0와 currPocDiffL1의 부호가 다른 경우 (즉, currPocDiffL0 = -currPocDiffL1)에는 mMvdL0와 mMvdL1 중 하나에는 MmvdOffset을 대입하고, 나머지 하나에는 -MmvdOffset을 대입하고, mMvdL0와 mMvdL1 모두에 MV scaling을 수행하지 않을 수 있다. 이때 하나와 나머지 하나를 결정하는 것은 기설정된 규칙을 따를 수 있다. 예를 들어 L0를 MmvdOffset을 대입하는 것으로 고정할 수 있다(도 38). 또다른 예로 L0와 L1 중 현재 picture보다 reference picture가 POC 순서상 앞에 있는 것(또는 뒤에 있는 것)으로 고정할 수 있다.Therefore, according to an embodiment of the present invention, when Abs (currPocDiffL0) and Abs (currPocDiffL1) are the same, but the signs of currPocDiffL0 and currPocDiffL1 are different (that is, currPocDiffL0 = -currPocDiffL1), mMvdL0 and mMvdL1 are substituted for one of the remaining ones and MmvdOffset -MmvdOffset may be substituted for, and MV scaling may not be performed for both mMvdL0 and mMvdL1. At this time, determining one and the other may follow a preset rule. For example, L0 can be fixed by substituting MmvdOffset (FIG. 38). As another example, among L0 and L1, the reference picture may be fixed to the one in front of (or behind) the current picture in the POC order.

도 38을 참조하면 1) currPocDiffL0 is equal to currPocDiffL1인 경우, 2) 그렇지 않고 Abs( currPocDiffL0 ) is greater than Abs( currPocDiffL1 )인 경우, 3) 그렇지 않고 Abs( currPocDiffL0 ) is less than Abs( currPocDiffL1 )인 경우, 4) 나머지 경우로 구별하여 mMvdLX derivation을 수행할 수 있다. 즉, 나머지 경우는 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같지만 currPocDiffL0와 currPocDiffL1의 부호가 다른 경우(currPocDiffL0 = -currPocDiffL1)를 나타내게 된다. 예를 들어 1)인 경우 mMvdL0와 mMvdL1를 모두 MmvdOffset로 설정하고 MV scaling을 수행하지 않을 수 있다. 2)인 경우 mMvdL0를 MmvdOffset으로 설정하고, “mMvdL0을 scaling한 값”으로 mMvdL1을 설정할 수 있다. 3)인 경우 mMvdL1를 MmvdOffset으로 설정하고, “mMvdL1을 scaling한 값”으로 mMvdL0를 설정할 수 있다. 4)인 경우 mMvdL0와 mMvdL1 중 하나는 MmvdOffset로 설정하고, 나머지 하나는 -MmvdOffset로 설정할 수 있다. 도 38에서는 mMvdL0를 MmvdOffset으로 설정하고, mMvdL1을 -MmvdOffset으로 설정하였다.Referring to FIG. 38, 1) if currPocDiffL0 is equal to currPocDiffL1, 2) otherwise Abs( currPocDiffL0) is greater than Abs( currPocDiffL1 ), 3) otherwise Abs( currPocDiffL0) is less than Abs( currPocDiffL1) , 4) mMvdLX derivation can be performed by distinguishing the remaining cases. That is, in the remaining cases, Abs(currPocDiffL0) and Abs(currPocDiffL1) are the same, but the signs of currPocDiffL0 and currPocDiffL1 are different (currPocDiffL0 = -currPocDiffL1). For example, in the case of 1), both mMvdL0 and mMvdL1 may be set to MmvdOffset and MV scaling may not be performed. In the case of 2), mMvdL0 can be set as MmvdOffset, and mMvdL1 can be set as “a value obtained by scaling mMvdL0”. In the case of 3), it is possible to set mMvdL1 to MmvdOffset, and to set mMvdL0 to “mMvdL1 scaling value”. In the case of 4), one of mMvdL0 and mMvdL1 may be set as MmvdOffset, and the other may be set as -MmvdOffset. In FIG. 38, mMvdL0 is set to MmvdOffset, and mMvdL1 is set to -MmvdOffset.

도 38의 4가지 경우를 순서를 바꾸어 수행할 수 있다. 예를 들면 1) currPocDiffL0 is equal to currPocDiffL1인 경우, 2) 그렇지 않고 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )가 같은 경우, 3) Abs( currPocDiffL0 ) is greater than Abs( currPocDiffL1 )인 경우, 4) 나머지 경우로 나누어 수행할 수 있다. 이 실시예의 2)는 앞의 도 38 참조 실시예의 4)와 같은 경우가 될 수 있다. 이 실시예의 4)는 앞의 도 38 참조 실시예의 3)과 같은 경우가 될 수 있다.The four cases of FIG. 38 can be performed by changing the order. For example, 1) if currPocDiffL0 is equal to currPocDiffL1, 2) otherwise, if Abs( currPocDiffL0) and Abs( currPocDiffL1) are the same, 3) Abs( currPocDiffL0) is greater than Abs( currPocDiffL1 ), 4) remaining cases It can be performed by dividing it into. 2) of this embodiment may be the same as 4) of the previous reference embodiment of FIG. 38. 4) of this embodiment may be the same as 3) of the previous reference embodiment of FIG. 38.

도 36의 실시예와 도 38의 실시예를 비교하면 예를 들어 다음과 같은 차이점이 존재할 수 있다. 도 36의 실시예에서는 -currPocDiffL0 * currPocDiffL1가 0보다 큰 경우 mMvdL0을 MmvdOffset으로 설정하고, mMvdL1을 -MmvdOffset으로 설정했다. 하지만 도 38의 실시예에서는 currPocDiffL0 = -currPocDiffL1인 경우 mMvdL0을 MmvdOffset으로 설정하고, mMvdL1을 -MmvdOffset으로 설정했다. 따라서 설정 조건이 다르다. 또한 도 36의 실시예에서는 항상 MmvdOffset 또는 -MmvdOffset으로 설정 과정이 포함되지만 도 38의 실시예에서는 MmvdOffset 또는 -MmvdOffset으로 설정하는 과정이 없는 경우가 있을 수 있다. 이 경우 MmvdOffset 또는 -MmvdOffset으로 설정 과정이 없이 MV scaling에 의해 바로 mMvdLX가 설정될 수 있다.When comparing the embodiment of FIG. 36 with the embodiment of FIG. 38, for example, the following differences may exist. In the example of FIG. 36, when -currPocDiffL0 * currPocDiffL1 is greater than 0, mMvdL0 is set to MmvdOffset, and mMvdL1 is set to -MmvdOffset. However, in the example of FIG. 38, when currPocDiffL0 = -currPocDiffL1, mMvdL0 is set to MmvdOffset, and mMvdL1 is set to -MmvdOffset. Therefore, the setting conditions are different. In addition, in the embodiment of FIG. 36, a process of setting MmvdOffset or -MmvdOffset is always included, but in the embodiment of FIG. 38, there may be a case where there is no process of setting MmvdOffset or -MmvdOffset. In this case, the mMvdLX can be set directly by MV scaling without a process of setting MmvdOffset or -MmvdOffset.

도 39는 본 발명의 일 실시예에 따른 motion information derivation을 나타낸 도면이다.39 is a diagram illustrating motion information derivation according to an embodiment of the present invention.

본 발명의 일 실시예에 따르면 bi-prediction이 허용되지 않는 경우가 존재할 수 있다. 예를 들면 block size에 기초해서 bi-prediction이 허용되지 않는 경우가 존재할 수 있다. 예를 들면 threshold보다 작은 block size에 대해 bi-prediction이 허용되지 않을 수 있다. 예를 들면 4x4 block에 대해 bi-prediction이 허용되지 않을 수 있다. 또한 bi-prediction이 허용되지 않는 경우 bi-prediction을 uni-prediction으로 변환할 수 있다. 이것은 memory bandwidth를 줄이기 위함일 수 있다. 예를 들어 bi-prediction은 다수의 reference block을 필요로 하기 때문에 uni-prediction에 비해 memory가 많이 필요할 수 있다.According to an embodiment of the present invention, there may be a case where bi-prediction is not allowed. For example, there may be a case where bi-prediction is not allowed based on the block size. For example, bi-prediction may not be allowed for a block size smaller than the threshold. For example, bi-prediction may not be allowed for a 4x4 block. Also, if bi-prediction is not allowed, bi-prediction can be converted to uni-prediction. This may be to reduce the memory bandwidth. For example, since bi-prediction requires a large number of reference blocks, it may require more memory than uni-prediction.

도 39를 참조하면 predFlagL0와 predFlagL1이 모두 1인 경우는 L0와 L1을 모두 활용한다는 의미이므로 bi-prediction을 의미하는 것일 수 있다. 따라서 bi-prediction인 경우 cbWidth와 cbHeight에 기초해서 bi-prediction을 허용하지 않는 경우가 있을 수 있다. 도 39는 4x4 block에 대해 bi-prediction을 허용하지 않는 예를 나타내고 있다. Bi-prediction이 허용되지 않는 경우 predFlagL0 또는 predFlagL1을 0으로 설정할 수 있다. 또한 0으로 설정하는 predFlagLX에 해당하는 refIdxLX를 -1로 설정하고, gbiIdx(bi-prediction의 weight와 관련된 값)를 0으로 설정할 수 있다. 도 39는 L1을 사용하지 않는 예를 나타내고 있다.Referring to FIG. 39, when both predFlagL0 and predFlagL1 are 1, it means that both L0 and L1 are used, and thus may mean bi-prediction. Therefore, in the case of bi-prediction, there may be a case where bi-prediction is not allowed based on cbWidth and cbHeight. 39 shows an example in which bi-prediction is not allowed for a 4x4 block. If bi-prediction is not allowed, predFlagL0 or predFlagL1 can be set to 0. Also, refIdxLX corresponding to predFlagLX set to 0 may be set to -1, and gbiIdx (a value related to the weight of bi-prediction) may be set to 0. 39 shows an example in which L1 is not used.

설명한 실시예와 같은 bi-prediction 허용하지 않는 것은 merge mode, AMVP(inter mode; MVD 있는 mode) 등에 적용하는 것이 가능하다. 예를 들어 bi-prediction이 허용되지 않는 경우에는 candidate list를 construction한 후 도 39에서 설명한 것과 같은 과정을 거쳐 bi-prediction candidate를 uni-prediction candidate로 변환할 수 있다. 예를 들어 merge mode에 적용하는 경우 merge candidate list를 construction한 후 bi-prediction candidate를 uni-prediction candidate로 변환할 수 있다.Disallowing bi-prediction as in the described embodiment can be applied to merge mode, inter mode (AMVP; mode with MVD), and the like. For example, when bi-prediction is not allowed, after constructing a candidate list, a bi-prediction candidate may be converted into a uni-prediction candidate through the same process as described in FIG. 39. For example, in the case of applying to merge mode, after constructing a merge candidate list, a bi-prediction candidate can be converted into a uni-prediction candidate.

도 40은 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면이다.40 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.

도 37 내지 도 38의 실시예에서 mMvdL0와 mMvdL1 중 하나는 시그날링된 값인 MmvdOffset으로 그대로 설정하지만 나머지 하나는 MV scaling 등 변형한 값으로 설정하였다. 또한 mMvdL0와 mMvdL1 중 하나를 결정할 때는 Abs( currPocDiffL0 ) 또는 Abs( currPocDiffL1 )를 참조하였다. 하지만 도 39에서 설명한 것처럼 bi-prediction이 허용되지 않는 경우가 있을 수 있다. 또한 그때 L0 또는 L1 중 하나는 사용하지 않는 것으로 변환(uni-prediction으로 변환)할 수 있다. 따라서 mMvdLX를 MmvdOffset으로 설정했지만 그 mMvdLX를 사용하지 않게 되는 경우가 생길 수 있다. 이때 mMvdLX가 아닌 mMvdLY는 MV scaling한 것으로 사용하게 될 수 있다. 따라서 MmvdOffset을 직접 더 정확하거나 prediction 성능이 높은 값으로 시그날링할 수 있었으나 이를 활용하지 못하는 경우가 있을 수 있다. 도 40 내지 도 41은 이를 해결하기 위한 방법일 수 있다.In the examples of FIGS. 37 to 38, one of mMvdL0 and mMvdL1 is set as a signaled value, MmvdOffset, but the other is set as a modified value such as MV scaling. In addition, when determining one of mMvdL0 and mMvdL1, Abs (currPocDiffL0) or Abs (currPocDiffL1) was referred to. However, there may be a case where bi-prediction is not allowed as described in FIG. 39. Also at that time, either L0 or L1 can be converted to unused (converted to uni-prediction). Therefore, although mMvdLX is set to MmvdOffset, there may be a case where the mMvdLX is not used. At this time, mMvdLY other than mMvdLX may be used as MV scaling. Therefore, MmvdOffset could be directly signaled with a more accurate or high prediction performance value, but there may be cases where it cannot be utilized. 40 to 41 may be a method for solving this.

예를 들어 bi-prediction이 허용되지 않는 경우 “LX”를 사용하는 uni-prediction으로 변환할 수 있다. 본 발명의 일 실시예를 따르면 bi-prediction이 허용되지 않는 경우 mMvdLX를 MmvdOffset으로 설정할 수 있다. 즉, bi-prediction이 허용되지 않는 경우 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 ) 비교와 상관 없이 mMvdLX를 MmvdOffset으로 설정할 수 있다.For example, if bi-prediction is not allowed, it can be converted to uni-prediction using “LX”. According to an embodiment of the present invention, when bi-prediction is not allowed, mMvdLX may be set to MmvdOffset. That is, when bi-prediction is not allowed, mMvdLX can be set as MmvdOffset regardless of the comparison between Abs (currPocDiffL0) and Abs (currPocDiffL1).

도 39에서 설명한 것처럼 bi-prediction이 허용되지 않는 경우는 block size에 기초할 수 있다.As described in FIG. 39, when bi-prediction is not allowed, it may be based on the block size.

도 40에 나타낸 것은 bi-prediction이 허용되지 않는 경우 “L0”를 사용하는 uni-prediction으로 변환하는 실시예이다. 만약 bi-prediction이 허용되지 않는 경우 mMvdL0를 MmvdOffset으로 설정할 수 있다((8-307), (8-308)). 또한 mMvdL1은 mMvdL0를 MV scaling하여 결정할 수 있다. 도 40은 bi-prediction이 4x4 block에 대해 허용되지 않는 경우를 나타내고 있다. 또한 이것은 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 ) 비교와 상관 없이 bi-prediction이 허용되지 않으면 수행하는 것일 수 있다. 즉, 도 40의 실시예에서 Abs( currPocDiffL0 )가 Abs( currPocDiffL1 )보다 작더라도 bi-prediction이 허용되지 않으면 mMvdL0를 MmvdOffset으로 설정할 수 있다.40 shows an embodiment of converting to uni-prediction using “L0” when bi-prediction is not allowed. If bi-prediction is not allowed, mMvdL0 can be set as MmvdOffset ((8-307), (8-308)). In addition, mMvdL1 can be determined by MV scaling of mMvdL0. 40 shows a case where bi-prediction is not allowed for a 4x4 block. Also, this may be what is done if bi-prediction is not allowed, regardless of the comparison between Abs(currPocDiffL0) and Abs(currPocDiffL1). That is, even if Abs (currPocDiffL0) is smaller than Abs (currPocDiffL1) in the embodiment of FIG. 40, if bi-prediction is not allowed, mMvdL0 may be set as MmvdOffset.

도 40에서 bi-prediction이 허용되지 않을 때 L0 uni-prediction을 사용하는 예를 나타내었는데 만약 L1 uni-prediction을 사용하는 예에서는 bi-prediction이 허용되지 않는 경우에는 (8-311) 내지 (8-318)의 동작을 수행할 수 있다. 이를 위해 도 40의 1) if, 2) Otherwise if, 3) Otherwise 구조에서 2)의 조건이 bi-prediction이 허용되는 경우까지 만족시켜야할 수 있다.40 shows an example of using L0 uni-prediction when bi-prediction is not allowed. If bi-prediction is not allowed in the example of using L1 uni-prediction, (8-311) to (8- Operation 318) may be performed. For this, the condition of 2) in the 1) if, 2) Otherwise if, 3) Otherwise structure of FIG. 40 may have to be satisfied until bi-prediction is allowed.

도 41은 본 발명의 일 실시예에 따른 motion information derivation을 나타낸 도면이다.41 is a diagram illustrating motion information derivation according to an embodiment of the present invention.

도 41의 실시예는 도 39 내지 도 40을 통해 설명한 문제를 해결하기 위한 방법일 수 있다.The embodiment of FIG. 41 may be a method for solving the problem described with reference to FIGS. 39 to 40.

본 발명의 일 실시예를 따르면 bi-prediction이 허용되지 않는 경우 uni-prediction으로 변환할 때 사용할 reference list는 고정적이지 않을 수 있다. 일 실시예를 따르면 POC에 기초하여 사용할 reference list를 결정할 수 있다. 예를 들면 currPocDiffL0 또는 currPocDiffL1에 기초하여 사용할 reference list를 결정할 수 있다. 예를 들면 Abs( currPocDiffL0 ) 또는 Abs( currPocDiffL1 )에 기초하여 사용할 reference list를 결정할 수 있다. 예를 들면 Abs( currPocDiffL0 )와 Abs( currPocDiffL1 )의 크기에 기초하여 사용할 reference list를 결정할 수 있다.According to an embodiment of the present invention, when bi-prediction is not allowed, a reference list to be used when converting to uni-prediction may not be fixed. According to an embodiment, a reference list to be used may be determined based on the POC. For example, the reference list to be used can be determined based on currPocDiffL0 or currPocDiffL1. For example, it is possible to determine a reference list to be used based on Abs(currPocDiffL0) or Abs(currPocDiffL1). For example, it is possible to determine a reference list to be used based on the sizes of Abs (currPocDiffL0) and Abs (currPocDiffL1).

일 실시예로 현재 picture와 가까이 있는 reference picture가 block의 유사성이 클 수 있으므로 가까이 있는 reference picture를 사용할 수 있다. 예를 들면 Abs( currPocDiffL0 ) > Abs( currPocDiffL1 ) 인 경우 (또는 Abs( currPocDiffL0 ) >= Abs( currPocDiffL1 )인 경우) LX를 사용하고, 그렇지 않은 경우 LX가 아닌 LY를 사용할 수 있다. 일 실시예로 상기 LX는 L1이고, 상기 LY는 L0일 수 있다.In an embodiment, a reference picture that is close to the current picture may have a large similarity of blocks, and thus a reference picture that is close to it may be used. For example, if Abs( currPocDiffL0)> Abs( currPocDiffL1) (or Abs( currPocDiffL0) >= Abs( currPocDiffL1 )) LX can be used, otherwise, LY instead of LX can be used. In an embodiment, LX may be L1, and LY may be L0.

도 41을 참조하면 bi-prediction이 허용되지 않는 경우 현재 picture와 멀리 있는 reference list 를 사용하는 것으로 결정할 수 있다. Abs( currPocDiffL0 ) > Abs( currPocDiffL1 ) 인 경우 predFlagL1을 0으로 설정하고, 그렇지 않은 경우 predFlagL0를 0으로 설정할 수 있다. 이러한 경우 도 37 내지 도 38의 mMvdL0와 mMvdL1 중 MmvdOffset을 그대로 사용하는 것이 bi-prediction을 uni-prediction으로 변활할 때 사용하게 되는 reference list에 해당하는 것일 수 있다.Referring to FIG. 41, when bi-prediction is not allowed, it may be determined to use a reference list far from the current picture. If Abs(currPocDiffL0)> Abs(currPocDiffL1), predFlagL1 can be set to 0, otherwise, predFlagL0 can be set to 0. In this case, using MmvdOffset of mMvdL0 and mMvdL1 of FIGS. 37 to 38 as it is may correspond to a reference list used when changing bi-prediction to uni-prediction.

도 42는 본 발명의 일 실시예에 따른 MMVD의 MVD derivation을 나타낸 도면이다.42 is a diagram showing MVD derivation of MMVD according to an embodiment of the present invention.

도 36 내지 도 39에서 설명한 것처럼 mMvdLX를 결정할 때 MV scaling 과정이 수행될 수 있고, bi-prediction이 허용되지 않아서 uni-prediction으로 변환되는 경우가 있을 수 있다. 따라서 나중에 사용하지 않게 될 MV scaling을 수행하는 경우가 발생할 수 있다.As described with reference to FIGS. 36 to 39, when the mMvdLX is determined, the MV scaling process may be performed, and there may be a case where bi-prediction is not allowed and thus converted into uni-prediction. Therefore, there may be a case of performing MV scaling that will not be used later.

예를 들어 bi-prediction이 허용되지 않는 경우 “LX”를 사용하는 uni-prediction으로 변환할 수 있다. 본 발명의 일 실시예를 따르면 mMvdL0 또는 mMVDL1을 derive하는 과정에서 bi-prediction이 허용되는 경우에만 MV scaling하여 “mMVDLX”를 설정하는 과정을 수행할 수 있다.For example, if bi-prediction is not allowed, it can be converted to uni-prediction using “LX”. According to an embodiment of the present invention, the process of setting “mMVDLX” by MV scaling may be performed only when bi-prediction is allowed in the process of deriveing mMvdL0 or mMVDL1.

예를 들어 bi-prediction이 허용되지 않는 경우 “L0”를 사용하는 uni-prediction으로 변환하는 경우, bi-prediction이 허용되는 경우에만 MV scaling하여 mMVDL1을 설정하는 과정을 수행할 수 있다. 또는 예를 들어 bi-prediction이 허용되지 않는 경우 “L0”를 사용하는 uni-prediction으로 변환하는 경우, bi-prediction이 허용되는 경우에만 mMvdL0를 MV scaling하여 mMVDL1을 설정하는 과정을 수행할 수 있다.For example, when bi-prediction is not allowed, when converting to uni-prediction using “L0”, the process of setting mMVDL1 by MV scaling can be performed only when bi-prediction is allowed. Or, for example, when bi-prediction is not allowed, when converting to uni-prediction using “L0”, the process of setting mMVDL1 by MV scaling of mMvdL0 only when bi-prediction is allowed can be performed.

도 42은 bi-prediction이 허용되지 않는 경우 “L0”를 사용하는 uni-prediction으로 변환하는 경우를 나타내고 있다. 이러한 경우 MV scaling하여 mMVDL1을 설정하는 것이 redundant 할 수 있다. 따라서 bi-prediction이 허용되는 경우에만 (8-309), (8-310)과 같은 mMVDL1을 설정하기 위한 MV scaling 과정을 수행할 수 있다. (8-303) 내지 (8-306) 또한 MV scaling을 위한 과정이므로 bi-prediction이 허용되는 경우에만 수행할 수도 있다. 즉 (8-303) 내지 (8-306)를 도 42의 진한 글씨로 표시한 조건 안으로 넣을 수 있다.42 shows a case of converting to uni-prediction using "L0" when bi-prediction is not allowed. In this case, setting mMVDL1 by MV scaling can be redundant. Therefore, only when bi-prediction is allowed, the MV scaling process for setting mMVDL1 such as (8-309) and (8-310) can be performed. (8-303) to (8-306) Also, since it is a process for MV scaling, it may be performed only when bi-prediction is allowed. That is, (8-303) to (8-306) can be put within the conditions indicated in the dark letters of FIG.

도 39에서 설명한 것처럼 bi-prediction이 허용되지 않는 경우는 block size에 기초할 수 있다. 도 42에는 cbWidth 또는 cbHeight가 4가 아닌 조건으로 나타내었으나 가능한 cbWidth 또는 cbHeight가 4 이상인 경우 cbWidth 또는 cbHeight가 4보다 큰 조건으로 나타낼 수도 있다.As described in FIG. 39, when bi-prediction is not allowed, it may be based on the block size. In FIG. 42, a condition in which cbWidth or cbHeight is not 4 is shown, but when the possible cbWidth or cbHeight is 4 or more, cbWidth or cbHeight may be expressed as a condition greater than 4.

도 42와 달리 bi-prediction이 허용되지 않는 경우 “L1”를 사용하는 예에서도 설명한 것과 같은 방법을 적용할 수 있다. 예를 들어 이러한 경우 bi-prediction이 허용되지 않는 경우 mMvdL0를 설정하기 위한 MV scaling, 즉 (8-317), (8-318), (8-311) 내지 (8-314)를 수행하지 않을 수 있다.Unlike FIG. 42, when bi-prediction is not allowed, the same method as described in the example using “L1” can be applied. For example, in this case, if bi-prediction is not allowed, MV scaling to set mMvdL0, that is, (8-317), (8-318), (8-311) to (8-314) may not be performed. have.

도 38, 도 40, 도 41, 도 42 등을 통해 설명한 실시예들을 함께 수행하는 것도 가능하다.It is also possible to perform the embodiments described with reference to FIGS. 38, 40, 41, and 42 together.

이상에서는 본 발명을 구체적인 실시예를 통하여 설명하였으나, 당업자라면 본 발명의 취지 및 범위를 벗어나지 않고 수정, 변경을 할 수 있다. 따라서 본 발명의 상세한 설명 및 실시예로부터 본 발명이 속하는 기술분야에 속한 사람이 용이하게 유추할 수 있는 것은 본 발명의 권리범위에 속하는 것으로 해석된다.In the above, the present invention has been described through specific embodiments, but those skilled in the art can make modifications and changes without departing from the spirit and scope of the present invention. Therefore, what can be easily inferred by a person belonging to the technical field to which the present invention pertains from the detailed description and examples of the present invention is interpreted as belonging to the scope of the present invention.

100 : 인코딩 장치 200 : 디코딩 장치100: encoding device 200: decoding device

Claims (1)

비디오 신호 처리 장치 및 방법.Video signal processing apparatus and method.
KR1020190014057A 2019-02-01 2019-02-01 A method and an apparatus for processing a video signal using merge with motion vector difference KR20200095982A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190014057A KR20200095982A (en) 2019-02-01 2019-02-01 A method and an apparatus for processing a video signal using merge with motion vector difference

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190014057A KR20200095982A (en) 2019-02-01 2019-02-01 A method and an apparatus for processing a video signal using merge with motion vector difference

Publications (1)

Publication Number Publication Date
KR20200095982A true KR20200095982A (en) 2020-08-11

Family

ID=72048320

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190014057A KR20200095982A (en) 2019-02-01 2019-02-01 A method and an apparatus for processing a video signal using merge with motion vector difference

Country Status (1)

Country Link
KR (1) KR20200095982A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220232218A1 (en) * 2019-06-23 2022-07-21 Lg Electronics Inc. Method and device for removing redundant syntax from merge data syntax
WO2023200382A1 (en) * 2022-04-12 2023-10-19 Telefonaktiebolaget Lm Ericsson (Publ) Enhanced multi-hypothesis prediction

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220232218A1 (en) * 2019-06-23 2022-07-21 Lg Electronics Inc. Method and device for removing redundant syntax from merge data syntax
WO2023200382A1 (en) * 2022-04-12 2023-10-19 Telefonaktiebolaget Lm Ericsson (Publ) Enhanced multi-hypothesis prediction

Similar Documents

Publication Publication Date Title
US11470306B2 (en) Method and device for processing video signal using MPM configuration method for multiple reference lines
CN110662057B (en) Video processing method, device and equipment and method for storing bit stream
JP7077310B2 (en) Adaptive motion vector accuracy for video coding
US11849106B2 (en) Video signal processing method and device using motion compensation
KR102004836B1 (en) Method and apparatus for processing a video signal
KR102550530B1 (en) Video signal processing method and apparatus using subblock-based motion compensation
KR20180059444A (en) AMVR-based image coding method and apparatus in video coding system
EP2837191A2 (en) Motion vector rounding
KR20110020215A (en) Video coding method and apparatus by using adaptive motion vector resolution
EP4007282A1 (en) Video signal processing method and device
KR20210149759A (en) Video signal processing method and apparatus using adaptive motion vector resolution
US12003699B2 (en) Video signal processing method and device using current picture reference
KR20200095982A (en) A method and an apparatus for processing a video signal using merge with motion vector difference
US20240137555A1 (en) Block Vector Difference (BVD) Coding
US20240236360A9 (en) Block Vector Difference (BVD) Coding
US20240089458A1 (en) Sign Coding and Decoding Using Prediction
KR20200137326A (en) A method and an apparatus for processing a video signal using current picture referencing
KR20230106103A (en) Method and Apparatus for Video Coding Using Improved AMVP--MERGE Mode
WO2024124229A2 (en) Resolution-based context selection for vector difference coding
KR20230105647A (en) Method and Apparatus for Video Coding Using Improved Merge with Motion Vector Difference