KR20200137326A - A method and an apparatus for processing a video signal using current picture referencing - Google Patents

A method and an apparatus for processing a video signal using current picture referencing Download PDF

Info

Publication number
KR20200137326A
KR20200137326A KR1020190063478A KR20190063478A KR20200137326A KR 20200137326 A KR20200137326 A KR 20200137326A KR 1020190063478 A KR1020190063478 A KR 1020190063478A KR 20190063478 A KR20190063478 A KR 20190063478A KR 20200137326 A KR20200137326 A KR 20200137326A
Authority
KR
South Korea
Prior art keywords
mode
flag
ibc
pred
block
Prior art date
Application number
KR1020190063478A
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 KR1020190063478A priority Critical patent/KR20200137326A/en
Publication of KR20200137326A publication Critical patent/KR20200137326A/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/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • 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
    • 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

Abstract

The present invention relates to a method and device for processing a video signal and, more specifically, to a method and device for processing a video signal to encode or decode a video signal. According to one embodiment of the present invention, a method for decoding an image includes the step of performing intra prediction or out-of-screen prediction.

Description

현재 픽쳐 참조를 이용한 비디오 신호 처리 방법 및 장치{A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL USING CURRENT PICTURE REFERENCING}Video signal processing method and apparatus using current picture reference {A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL USING CURRENT PICTURE REFERENCING}

본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.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 format suitable for a storage medium. Targets for compression encoding include audio, video, and text, and in particular, a technique for performing compression encoding on an image is referred to as video compression. Compression coding of a video signal is performed by removing redundant information in consideration of spatial correlation, temporal correlation, and probabilistic correlation. However, due to the recent development of various media and data transmission media, a more efficient method and apparatus for processing a video signal is required.

본 발명은 비디오 신호의 코딩 효율을 높이기 위한 목적을 가지고 있다.The present invention has an object 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 predicting in-screen or out-of-screen.

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

도 1은 본 발명의 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다.
도 2는 본 발명의 실시예에 따른 비디오 신호 디코딩 장치의 개략적인 블록도이다.
도 3은 픽쳐 내에서 코딩 트리 유닛이 코딩 유닛들로 분할되는 실시예를 도시한다.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다.
도 5는 인트라 예측 모드에서 현재 블록의 예측을 위해 사용되는 참조 샘플들의 일 실시예를 도시한다.
도 6은 인트라 예측에 사용되는 예측 모드들의 일 실시예를 도시한다.
도 7은 본 발명의 일 실시예에 따른 inter prediction을 나타낸 도면이다.
도 8은 본 발명의 일 실시예에 따른 모션 벡터 시그날링 방법을 나타낸 도면이다.
도 9는 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.
도 10은 본 발명의 일 실시예에 따른 adaptive motion vector resolution 시그날링을 나타낸 도면이다.
도 11은 본 발명의 일 실시예에 따른 inter prediction 관련 syntax를 나타낸 도면이다.
도 12는 본 발명의 일 실시예에 따른 spatial neighboring 위치를 나타낸 도면이다.
도 13은 본 발명의 일 실시예에 따른 current picture referencing을 나타낸 도면이다.
도 14는 본 발명의 일 실시예에 따른 spatial neighboring candidate 참조 방법을 나타낸 도면이다.
도 15는 본 발명의 일 실시예에 따른 block 위치와 motion candidate list 구성을 나타낸 도면이다.
도 16은 본 발명의 일 실시예에 따른 block 위치와 motion candidate list 구성을 나타낸 도면이다.
도 17은 본 발명의 일 실시예에 따른 spatial neighboring candidate 사용을 나타낸 도면이다.
도 18은 본 발명의 일 실시예에 따른 motion vector를 나타낸 도면이다.
도 19는 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.
도 20은 본 발명의 일 실시예에 따른 motion vector를 나타낸 도면이다.
도 21은 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.
도 22는 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.
도 23은 본 발명의 일 실시예에 따른 block과 크기를 나타낸 도면이다.
도 24는 본 발명의 일 실시예에 따른 merge candidate list 구성을 나타낸 도면이다.
도 25는 본 발명의 일 실시예에 따른 block 위치와 syntax를 나타낸 도면이다.
도 26은 본 발명의 일 실시예에 따른 HMVP의 history를 저장하는 공간을 reset하는 것을 나타낸 도면이다.
도 27는 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.
도 28은 본 발명의 일 실시예에 따른 prediction mode 시그날링을 나타낸 도면이다.
도 29는 본 발명의 일 실시예에 따른 prediction mode 시그날링을 나타낸 도면이다.
도 30은 본 발명의 일 실시예에 따른 prediction mode 시그날링을 나타낸 도면이다.
도 31은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.
도 32는 본 발명의 일 실시예에 따른 prediction mode 시그날링을 나타낸 도면이다.
도 33은 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.
도 34는 본 발명의 일 실시예에 따른 coding unit syntax를 나타낸 도면이다.
도 35는 본 발명의 일 실시예에 따른 chroma 성분의 intra prediction mode derivation을 나타낸 도면이다.
도 36은 본 발명의 일 실시예에 따른 chroma 성분의 intra prediction mode derivation을 나타낸 도면이다.
도 37은 본 발명의 일 실시예를 따른 coding unit syntax를 나타낸 도면이다.
도 38은 본 발명의 일 실시예에 따른 syntax structure를 나타낸 도면이다.
도 39는 본 발명의 일 실시예에 따른 시그날링 값 infer 방법을 나타낸 도면이다.
도 40은 본 발명의 일 실시예에 따른 시그날링 값 infer 방법을 나타낸 도면이다.
도 41은 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.
도 42는 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.
도 43은 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.
도 44는 본 발명의 일 실시예에 따른 coding unit syntax 구조를 나타낸 도면이다.
도 45는 본 발명의 일 실시예에 따른 skip mode, prediction mode 시그날링을 나타낸 도면이다.
도 46은 본 발명의 일 실시예에 따른 coding unit syntax 구조를 나타낸 도면이다.
도 47은 본 발명의 일 실시예에 따른 coding unit syntax 구조를 나타낸 도면이다.
도 48은 본 발명의 일 실시예에 따른 coding unit syntax 구조를 나타낸 도면이다.
1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention.
2 is a schematic block diagram of a video signal decoding apparatus according to an embodiment of the present invention.
3 shows an embodiment in which a coding tree unit is divided into coding units within a picture.
4 shows an embodiment of a method for signaling division of a quad tree and a multi-type tree.
5 illustrates an embodiment of reference samples used for prediction of a current block in an intra prediction mode.
6 shows an embodiment of prediction modes used for intra prediction.
7 is a diagram showing inter prediction according to an embodiment of the present invention.
8 is a diagram illustrating a motion vector signaling method according to an embodiment of the present invention.
9 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.
10 is a diagram showing adaptive motion vector resolution signaling according to an embodiment of the present invention.
11 is a diagram showing syntax related to inter prediction according to an embodiment of the present invention.
12 is a diagram showing a spatial neighboring location according to an embodiment of the present invention.
13 is a diagram showing current picture referencing according to an embodiment of the present invention.
14 is a diagram illustrating a method for referencing a spatial neighboring candidate according to an embodiment of the present invention.
15 is a diagram showing a block position and a motion candidate list configuration according to an embodiment of the present invention.
16 is a diagram showing a block position and a motion candidate list configuration according to an embodiment of the present invention.
17 is a diagram showing the use of a spatial neighboring candidate according to an embodiment of the present invention.
18 is a diagram showing a motion vector according to an embodiment of the present invention.
19 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.
20 is a diagram showing a motion vector according to an embodiment of the present invention.
21 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.
22 is a diagram showing a motion vector difference syntax according to an embodiment of the present invention.
23 is a diagram showing a block and a size according to an embodiment of the present invention.
24 is a diagram showing the configuration of a merge candidate list according to an embodiment of the present invention.
25 is a diagram showing a block location and syntax according to an embodiment of the present invention.
26 is a view showing resetting a space for storing HMVP history according to an embodiment of the present invention.
27 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
28 is a diagram illustrating prediction mode signaling according to an embodiment of the present invention.
29 is a diagram illustrating prediction mode signaling according to an embodiment of the present invention.
30 is a diagram illustrating prediction mode signaling according to an embodiment of the present invention.
31 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
32 is a diagram illustrating prediction mode signaling according to an embodiment of the present invention.
33 is a diagram illustrating a coding unit syntax according to an embodiment of the present invention.
34 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
35 is a diagram illustrating intra prediction mode derivation of a chroma component according to an embodiment of the present invention.
36 is a diagram illustrating intra prediction mode derivation of a chroma component according to an embodiment of the present invention.
37 is a diagram showing a coding unit syntax according to an embodiment of the present invention.
38 is a diagram showing a syntax structure according to an embodiment of the present invention.
39 is a diagram illustrating a signaling value infer method according to an embodiment of the present invention.
40 is a diagram illustrating a signaling value infer method according to an embodiment of the present invention.
41 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.
42 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.
43 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.
44 is a diagram showing a coding unit syntax structure according to an embodiment of the present invention.
45 is a diagram illustrating skip mode and prediction mode signaling according to an embodiment of the present invention.
46 is a diagram showing a coding unit syntax structure according to an embodiment of the present invention.
47 is a diagram showing a coding unit syntax structure according to an embodiment of the present invention.
48 is a diagram showing a coding unit syntax structure 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 considering the functions of the present invention, 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 should be noted that the 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) 등을 모두 포함하는 용어로서, 경우에 따라 의미는 달리 해석될 수 있으므로 본 발명은 이에 한정되지 아니한다. '유닛'은 영상 처리의 기본 단위 또는 픽쳐의 특정 위치를 지칭하는 의미로 사용되며, 루마(luma) 성분과 크로마(chroma) 성분을 모두 포함하는 이미지 영역을 가리킨다. 또한, ‘블록’은 루마 성분 및 크로마 성분들(즉, Cb 및 Cr) 중 특정 성분을 포함하는 이미지 영역을 가리킨다. 다만, 실시예에 따라서 ‘유닛’, '블록', '파티션' 및 '영역' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 유닛은 코딩 유닛, 예측 유닛, 변환 유닛을 모두 포함하는 개념으로 사용될 수 있다. 픽쳐는 필드 혹은 프레임을 가리키며, 실시예에 따라 상기 용어들은 서로 혼용하여 사용될 수 있다.In the present specification, some terms may be interpreted as follows. Coding can be interpreted as encoding or decoding in some cases. In this specification, an apparatus for generating a video signal bitstream by performing encoding (encoding) of a video signal is referred to as an encoding apparatus or an encoder, and an apparatus for restoring a video signal by performing decoding (decoding) of a video signal bitstream is decoding It is referred to as a device or decoder. In addition, in this specification, a video signal processing apparatus is used as a term for a concept including both an encoder and a decoder. Information is a term that includes all values, parameters, coefficients, elements, etc., and the meaning may be interpreted differently in some cases, so the present invention is not limited thereto. The'unit' is used to refer to a basic unit of image processing or a specific position of a picture, and refers to an image area including both a luma component and a chroma component. In addition, the'block' refers to an image region including a specific component among the luma component and the chroma components (ie, Cb and Cr). However, depending on the embodiment, terms such as'unit','block','partition', and'area' may be used interchangeably. In addition, in this specification, the unit may be used as a concept including all of a coding unit, a prediction unit, and a transform unit. A picture refers to a field or a frame, and the terms may be used interchangeably according to embodiments.

도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 인코딩 장치(100)는 변환부(110), 양자화부(115), 역양자화부(120), 역변환부(125), 필터링부(130), 예측부(150) 및 엔트로피 코딩부(160)를 포함한다.1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention. Referring to FIG. 1, the encoding apparatus 100 of the present invention includes 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)는 입력 받은 비디오 신호와 예측부(150)에서 생성된 예측 신호의 차이인 레지듀얼 신호를 변환하여 변환 계수 값을 획득한다. 예를 들어, 이산 코사인 변환(Discrete Cosine Transform, DCT), 이산 사인 변환(Discrete Sine Transform, DST) 또는 웨이블릿 변환(Wavelet Transform) 등이 사용될 수 있다. 이산 코사인 변환 및 이산 사인 변환은 입력된 픽쳐 신호를 블록 형태로 나누어 변환을 수행하게 된다. 변환에 있어서 변환 영역 내의 값들의 분포와 특성에 따라서 코딩 효율이 달라질 수 있다. 양자화부(115)는 변환부(110)에서 출력된 변환 계수 값을 양자화한다. The transform unit 110 converts a residual signal that is a difference between an input video signal and a prediction signal generated by the prediction unit 150 to obtain a transform coefficient value. For example, Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), or Wavelet Transform may be used. Discrete cosine transform and discrete sine transform are transformed by dividing the input picture signal into a block form. In transformation, coding efficiency may vary depending on the distribution and characteristics of values in the transformation region. The quantization unit 115 quantizes a transform coefficient value output from the transform unit 110.

코딩 효율을 높이기 위하여 픽쳐 신호를 그대로 코딩하는 것이 아니라, 예측부(150)를 통해 이미 코딩된 영역을 이용하여 픽쳐를 예측하고, 예측된 픽쳐에 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 더하여 복원 픽쳐를 획득하는 방법이 사용된다. 인코더와 디코더에서 미스매치가 발생되지 않도록 하기 위해, 인코더에서 예측을 수행할 때에는 디코더에서도 사용 가능한 정보를 사용해야 한다. 이를 위해, 인코더에서는 부호화한 현재 블록을 다시 복원하는 과정을 수행한다. 역양자화부(120)에서는 변환 계수 값을 역양자화하고, 역변환부(125)에서는 역양자화된 변환 계수값을 이용하여 레지듀얼 값을 복원한다. 한편, 필터링부(130)는 복원된 픽쳐의 품질 개선 및 부호화 효율 향상을 위한 필터링 연산을 수행한다. 예를 들어, 디블록킹 필터, 샘플 적응적 오프셋(Sample Adaptive Offset, SAO) 및 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, DPB, 156)에 저장된다.In order to improve coding efficiency, the picture signal is not coded as it is, but a reconstructed picture by predicting a picture using a region already coded through the prediction unit 150 and adding a residual value between the original picture and the predicted picture to the predicted picture. The method of obtaining is used. In order to prevent mismatches from occurring in the encoder and decoder, information available in the decoder must be used when performing prediction in the encoder. To this end, the encoder performs a process of reconstructing the encoded current block. The inverse quantization unit 120 inverse quantizes the transform coefficient value, and the inverse transform unit 125 restores the residual value by using the inverse quantization transform coefficient value. Meanwhile, the filtering unit 130 performs a filtering operation to improve the quality and encoding efficiency of the reconstructed picture. For example, a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter may be included. The filtered picture is output or stored in a decoded picture buffer (DPB) 156 to be used as a reference picture.

예측부(150)는 인트라 예측부(152)와 인터 예측부(154)를 포함한다. 인트라 예측부(152)는 현재 픽쳐 내에서 인트라(intra) 예측을 수행하며, 인터 예측부(154)는 복호 픽쳐 버퍼(156)에 저장된 참조 픽쳐를 이용하여 현재 픽쳐를 예측하는 인터(inter) 예측을 수행한다. 인트라 예측부(152)는 현재 픽쳐 내의 복원된 샘플들로부터 인트라 예측을 수행하여, 인트라 부호화 정보를 엔트로피 코딩부(160)에 전달한다. 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스 중 적어도 하나를 포함할 수 있다. 인터 예측부(154)는 모션 추정부(154a) 및 모션 보상부(154b)를 포함하여 구성될 수 있다. 모션 추정부(154a)는 복원된 참조 픽쳐의 특정 영역을 참조하여 현재 영역의 모션 벡터값을 획득한다. 모션 추정부(154a)는 참조 영역에 대한 모션 정보(참조 픽쳐 인덱스, 모션 벡터 정보 등)를 엔트로피 코딩부(160)로 전달한다. 모션 보상부(154b)는 모션 추정부(154a)에서 전달된 모션 벡터값을 이용하여 모션 보상을 수행한다. 인터 예측부(154)는 참조 영역에 대한 모션 정보를 포함하는 인터 부호화 정보를 엔트로피 코딩부(160)에 전달한다.The prediction unit 150 includes an intra prediction unit 152 and an inter prediction unit 154. 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. Perform. The intra prediction unit 152 performs intra prediction from reconstructed samples in the current picture, and transmits intra encoding information to the entropy coding unit 160. The intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The inter prediction unit 154 may 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 a specific region of the reconstructed reference picture. The motion estimation unit 154a transfers motion information (reference picture index, motion vector information, etc.) for the reference region to the entropy coding unit 160. The motion compensation unit 154b performs motion compensation using the motion vector value transmitted from the motion estimation unit 154a. The inter prediction unit 154 transmits inter encoding information including motion information on the reference region to the entropy coding unit 160.

위와 같은 픽쳐 예측이 수행될 경우, 변환부(110)는 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 변환하여 변환 계수 값을 획득한다. 이때, 변환은 픽쳐 내에서 특정 블록 단위로 수행될 수 있으며, 특정 블록의 크기는 기 설정된 범위 내에서 가변할 수 있다. 양자화부(115)는 변환부(110)에서 생성된 변환 계수 값을 양자화하여 엔트로피 코딩부(160)로 전달한다.When the above picture prediction is performed, the transform unit 110 obtains a transform coefficient value by transforming a residual value between the original picture and the predicted picture. In this case, the transformation may be performed in units of a specific block within the picture, and the size of the specific block may vary within a preset range. The quantization unit 115 quantizes the transform coefficient values generated by the transform unit 110 and transmits the quantization to the entropy coding unit 160.

엔트로피 코딩부(160)는 양자화된 변환 계수, 인트라 부호화 정보, 및 인터 부호화 정보 등을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성한다. 엔트로피 코딩부(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, intra-encoding information, and inter-encoding information to generate a video signal bitstream. In the entropy coding unit 160, a variable length coding (VLC) method and an arithmetic coding method may be used. 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 expressed as short codewords, and infrequently occurring symbols are expressed as long codewords. 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 one prime number, and arithmetic coding can obtain an optimal prime 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 유닛을 복호화해야 한다. 한편, 비디오 신호 비트스트림의 복호화를 위해 필요한 정보들은 픽쳐 파라미터 세트(Picture Parameter Set, PPS), 시퀀스 파라미터 세트(Sequence Parameter Set, SPS), 비디오 파라미터 세트(Video Parameter Set, VPS) 등과 같은 상위 레벨 세트의 RBSP(Raw Byte Sequence Payload)를 통해 전송될 수 있다.The generated bitstream is encapsulated in a basic unit of a Network Abstraction Layer (NAL) unit. The NAL unit includes a coded 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. Meanwhile, information necessary for decoding a video signal bitstream is a high-level set such as a picture parameter set (PPS), a sequence parameter set (SPS), and a video parameter set (VPS). It may be transmitted through RBSP (Raw Byte Sequence Payload).

한편, 도 1의 블록도는 본 발명의 일 실시예에 따른 인코딩 장치(100)를 나타낸 것으로서, 분리하여 표시된 블록들은 인코딩 장치(100)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 인코딩 장치(100)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 인코딩 장치(100)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.Meanwhile, the block diagram of FIG. 1 shows the encoding apparatus 100 according to an embodiment of the present invention, and separately displayed blocks are shown by logically distinguishing elements of the encoding apparatus 100. Accordingly, the elements of the encoding apparatus 100 described above may be mounted as one chip or as a plurality of chips according to the design of the device. According to an embodiment, the operation of each element of the encoding apparatus 100 described above may be performed by a processor (not shown).

도 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 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)는 역양자화된 변환 계수를 이용하여 레지듀얼 값을 복원한다. 비디오 신호 처리 장치(200)는 역변환부(225)에서 획득된 레지듀얼 값을 예측부(250)에서 획득된 예측값과 합산하여 원래의 화소값을 복원한다.The entropy decoding unit 210 entropy-decodes the video signal bitstream and extracts transform coefficients, intra-encoding information, and inter-encoding information for each region. The inverse quantization unit 220 inverse quantizes the entropy-decoded transform coefficient, and the inverse transform unit 225 restores a residual value by using the inverse quantization transform coefficient. The video signal processing apparatus 200 restores the original pixel value by summing the residual value obtained by the inverse transform unit 225 with the predicted value obtained by the prediction unit 250.

한편, 필터링부(230)는 픽쳐에 대한 필터링을 수행하여 화질을 향상시킨다. 여기에는 블록 왜곡 현상을 감소시키기 위한 디블록킹 필터 및/또는 픽쳐 전체의 왜곡 제거를 위한 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 다음 픽쳐에 대한 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(DPB, 256)에 저장된다.Meanwhile, the filtering unit 230 improves image quality by filtering 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 the decoded picture buffer (DPB) 256 to be used as a reference picture for the next picture.

예측부(250)는 인트라 예측부(252) 및 인터 예측부(254)를 포함한다. 예측부(250)는 전술한 엔트로피 디코딩부(210)를 통해 복호화된 부호화 타입, 각 영역에 대한 변환 계수, 인트라/인터 부호화 정보 등을 활용하여 예측 픽쳐를 생성한다. 복호화가 수행되는 현재 블록을 복원하기 위해서, 현재 블록이 포함된 현재 픽쳐 또는 다른 픽쳐들의 복호화된 영역이 이용될 수 있다. 복원에 현재 픽쳐만을 이용하는, 즉 인트라 예측만을 수행하는 픽쳐(또는, 타일/슬라이스)를 인트라 픽쳐 또는 I 픽쳐(또는, 타일/슬라이스), 인트라 예측과 인터 예측을 모두 수행할 수 있는 픽쳐(또는, 타일/슬라이스)를 인터 픽쳐(또는, 타일/슬라이스)라고 한다. 인터 픽쳐(또는, 타일/슬라이스) 중 각 블록의 샘플값들을 예측하기 위하여 최대 하나의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 예측 픽쳐(predictive picture) 또는 P 픽쳐(또는, 타일/슬라이스)라고 하며, 최대 두 개의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 쌍예측 픽쳐(Bi-predictive picture) 또는 B 픽쳐(또는, 타일/슬라이스) 라고 한다. 다시 말해서, P 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 하나의 모션 정보 세트를 이용하고, B 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 두 개의 모션 정보 세트를 이용한다. 여기서, 모션 정보 세트는 하나 이상의 모션 벡터와 하나의 참조 픽쳐 인덱스를 포함한다.The prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254. The prediction unit 250 generates a prediction picture by using an encoding type decoded by the entropy decoding unit 210 described above, a transform coefficient for each region, and intra/inter encoding information. In order to restore a current block on which decoding is performed, a current picture including the current block or a decoded area of other pictures may be used. An intra picture or an I picture (or tile/slice) using only the current picture for restoration, that is, performing only intra prediction (or tile/slice), a picture capable of performing both intra prediction and inter prediction (or, Tile/slice) is called an inter picture (or tile/slice). In order to predict the sample values of each block among inter-pictures (or tiles/slices), a picture (or tile/slice) using at most one motion vector and a reference picture index is a predictive picture or a P picture (or , Tile/slice), and a picture (or tile/slice) using up to two motion vectors and a reference picture index is referred to as a bi-predictive picture or a B picture (or tile/slice). In other words, a P picture (or tile/slice) uses at most one set of motion information to predict each block, and a B picture (or tile/slice) uses at most two motion information to predict each block. Use a set. Here, the motion information set includes one or more motion vectors and one reference picture index.

인트라 예측부(252)는 인트라 부호화 정보 및 현재 픽쳐 내의 복원된 샘플들을 이용하여 예측 블록을 생성한다. 전술한 바와 같이, 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스 중 적어도 하나를 포함할 수 있다. 인트라 예측부(252)는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 픽셀들을 참조 픽셀들로 이용하여 현재 블록의 픽셀값들을 예측한다. 일 실시예에 따르면, 참조 픽셀들은 현재 블록의 좌측 경계에 인접한 픽셀들 및/또는 상측 경계에 인접한 픽셀들일 수 있다. 다른 실시예에 따르면, 참조 픽셀들은 현재 블록의 주변 블록의 픽셀들 중 현재 블록의 좌측 경계로부터 기 설정된 거리 이내에 인접한 픽셀들 및/또는 현재 블록의 상측 경계로부터 기 설정된 거리 이내에 인접한 픽셀들일 수 있다. 이때, 현재 블록의 주변 블록은 현재 블록에 인접한 좌측(L) 블록, 상측(A) 블록, 하좌측(Below Left, BL) 블록, 상우측(Above Right, AR) 블록 또는 상좌측(Above Left, AL) 블록 중 적어도 하나를 포함할 수 있다.The intra prediction unit 252 generates a prediction block using intra-encoding information and reconstructed samples in the current picture. As described above, the intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The intra prediction unit 252 predicts pixel values of the current block by using reconstructed pixels located on the left and/or above of the current block as reference pixels. According to an embodiment, the reference pixels may be pixels adjacent to the left boundary of the current block and/or pixels adjacent to the upper boundary. According to another embodiment, the reference pixels may be adjacent pixels within a preset distance from the left boundary of the current block among pixels of the neighboring block of the current block and/or pixels adjacent within a preset distance from the upper boundary of the current block. At this time, the neighboring block of the current block is a left (L) block, an upper (A) block, a lower left (BL) block, an upper right (AR) block, or an upper left (Above Left) block. AL) may include at least one of the blocks.

인터 예측부(254)는 복호 픽쳐 버퍼(256)에 저장된 참조 픽쳐 및 인터 부호화 정보를 이용하여 예측 블록을 생성한다. 인터 부호화 정보는 참조 블록에 대한 현재 블록의 모션 정보(참조 픽쳐 인덱스, 모션 벡터 정보 등)을 포함할 수 있다. 인터 예측에는 L0 예측, L1 예측 및 쌍예측(Bi-prediction)이 있을 수 있다. L0 예측은 L0 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측이고, L1 예측은 L1 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측을 의미한다. 이를 위해서는 1세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 필요할 수 있다. 쌍예측 방식에서는 최대 2개의 참조 영역을 이용할 수 있는데, 이 2개의 참조 영역은 동일한 참조 픽쳐에 존재할 수도 있고, 서로 다른 픽쳐에 각각 존재할 수도 있다. 즉, 쌍예측 방식에서는 최대 2세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 이용될 수 있는데, 2개의 모션 벡터가 동일한 참조 픽쳐 인덱스에 대응될 수도 있고 서로 다른 참조 픽쳐 인덱스에 대응될 수도 있다. 이때, 참조 픽쳐들은 시간적으로 현재 픽쳐 이전이나 이후 모두에 표시(또는 출력)될 수 있다.The inter prediction unit 254 generates a prediction block using a reference picture and inter encoding information stored in the decoded picture buffer 256. The inter encoding information may include motion information (reference picture index, motion vector information, etc.) of the current block for the reference block. 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 picture list. For this, a 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 the two motion vectors may correspond to the same reference picture index or to different reference picture indexes. May correspond. In this case, the reference pictures may be displayed (or output) temporally before or after the current picture.

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

상기 인트라 예측부(252) 또는 인터 예측부(254)로부터 출력된 예측값, 및 역변환부(225)로부터 출력된 레지듀얼 값이 더해져서 복원된 비디오 픽쳐가 생성된다. 즉, 비디오 신호 디코딩 장치(200)는 예측부(250)에서 생성된 예측 블록과 역변환부(225)로부터 획득된 레지듀얼을 이용하여 현재 블록을 복원한다.A reconstructed video picture is generated by adding a prediction value output from the intra prediction unit 252 or the inter prediction unit 254 and a residual value output from the inverse transform unit 225. That is, the video signal decoding apparatus 200 reconstructs the current block by using the prediction block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225.

한편, 도 2의 블록도는 본 발명의 일 실시예에 따른 디코딩 장치(200)를 나타낸 것으로서, 분리하여 표시된 블록들은 디코딩 장치(200)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 디코딩 장치(200)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 디코딩 장치(200)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.Meanwhile, the block diagram of FIG. 2 shows the decoding apparatus 200 according to an embodiment of the present invention, and separately displayed blocks are shown by logically distinguishing elements of the decoding apparatus 200. Therefore, the elements of the decoding apparatus 200 described above may be mounted as one chip or as a plurality of chips according to the design of the device. According to an embodiment, the operation of each element of the decoding apparatus 200 described above may be performed by a processor (not shown).

도 3은 픽쳐 내에서 코딩 트리 유닛(Coding Tree Unit, CTU)이 코딩 유닛들(Coding Units, CUs)로 분할되는 실시예를 도시한다. 비디오 신호의 코딩 과정에서, 픽쳐는 코딩 트리 유닛(CTU)들의 시퀀스로 분할될 수 있다. 코딩 트리 유닛은 루마(luma) 샘플들의 NXN 블록과, 이에 대응하는 크로마(chroma) 샘플들의 2개의 블록들로 구성된다. 코딩 트리 유닛은 복수의 코딩 유닛들로 분할될 수 있다. 코딩 유닛은 상기에서 설명한 비디오 신호의 처리 과정, 즉 인트라/인터 예측, 변환, 양자화 및/또는 엔트로피 코딩 등의 과정에서 픽쳐를 처리하기 위한 기본 단위를 가리킨다. 하나의 픽쳐 내에서 코딩 유닛의 크기 및 모양은 일정하지 않을 수 있다. 코딩 유닛은 정사각형 혹은 직사각형의 모양을 가질 수 있다. 직사각형 코딩 유닛(혹은, 직사각형 블록)은 수직 코딩 유닛(혹은, 수직 블록)과 수평 코딩 유닛(혹은, 수평 블록)을 포함한다. 본 명세서에서, 수직 블록은 높이가 너비보다 큰 블록이며, 수평 블록은 너비가 높이보다 큰 블록이다. 또한, 본 명세서에서 정사각형이 아닌(non-square) 블록은 직사각형 블록을 가리킬 수 있지만, 본 발명은 이에 한정되지 않는다.3 shows an embodiment in which a coding tree unit (CTU) is divided into coding units (CUs) in a picture. In the process of coding a video signal, a picture may be divided into a sequence of coding tree units (CTUs). The coding tree unit is composed of an NXN block of luma samples and two blocks of chroma samples corresponding thereto. The coding tree unit may be divided into a plurality of coding units. The coding unit refers to a basic unit for processing a picture in the above-described video signal processing, that is, intra/inter prediction, transformation, quantization, and/or entropy coding. The size and shape of a coding unit in one picture may not be constant. The coding unit may have a square or rectangular shape. The rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block). In this specification, a vertical block is a block having a height greater than a width, and a horizontal block is a block having a width greater than the height. In addition, in the present specification, a non-square block may refer to a rectangular block, but the present invention is not limited thereto.

도 3을 참조하면, 코딩 트리 유닛은 먼저 쿼드 트리(Quad Tree, QT) 구조로 분할된다. 즉, 쿼드 트리 구조에서 2NX2N 크기를 가지는 하나의 노드는 NXN 크기를 가지는 네 개의 노드들로 분할될 수 있다. 본 명세서에서 쿼드 트리는 4진(quaternary) 트리로도 지칭될 수 있다. 쿼드 트리 분할은 재귀적으로 수행될 수 있으며, 모든 노드들이 동일한 깊이로 분할될 필요는 없다.Referring to FIG. 3, a coding tree unit is first divided into a quad tree (QT) structure. That is, in a quad tree structure, one node having a size of 2NX2N may be divided into four nodes having a size of NXN. In this specification, the quad tree may also be referred to as a quaternary tree. Quad-tree partitioning can be performed recursively, and not all nodes need to be partitioned to the same depth.

한편, 전술한 쿼드 트리의 리프 노드(leaf node)는 멀티-타입 트리(Multi-Type Tree, MTT) 구조로 더욱 분할될 수 있다. 본 발명의 실시예에 따르면, 멀티 타입 트리 구조에서는 하나의 노드가 수평 혹은 수직 분할의 2진(binary, 바이너리) 혹은 3진(ternary, 터너리) 트리 구조로 분할될 수 있다. 즉, 멀티-타입 트리 구조에는 수직 바이너리 분할, 수평 바이너리 분할, 수직 터너리 분할 및 수평 터너리 분할의 4가지 분할 구조가 존재한다. 본 발명의 실시예에 따르면, 상기 각 트리 구조에서 노드의 너비 및 높이는 모두 2의 거듭제곱 값을 가질 수 있다. 예를 들어, 바이너리 트리(Binary Tree, BT) 구조에서, 2NX2N 크기의 노드는 수직 바이너리 분할에 의해 2개의 NX2N 노드들로 분할되고, 수평 바이너리 분할에 의해 2개의 2NXN 노드들로 분할될 수 있다. 또한, 터너리 트리(Ternary Tree, TT) 구조에서, 2NX2N 크기의 노드는 수직 터너리 분할에 의해 (N/2)X2N, NX2N 및 (N/2)X2N의 노드들로 분할되고, 수평 바이너리 분할에 의해 2NX(N/2), 2NXN 및 2NX(N/2)의 노드들로 분할될 수 있다. 이러한 멀티-타입 트리 분할은 재귀적으로 수행될 수 있다.Meanwhile, the leaf node of the quad tree described above may be further divided into a multi-type tree (MTT) structure. According to an embodiment of the present invention, in a multi-type tree structure, one node may be divided into a horizontal or vertically divided binary (binary) or ternary (ternary) tree structure. That is, in the multi-type tree structure, there are four division structures: vertical binary division, horizontal binary division, vertical ternary division, and horizontal ternary division. According to an embodiment of the present invention, both widths and heights of nodes in each tree structure may have a power of 2. For example, in a binary tree (Binary Tree, BT) structure, a node having a size of 2NX2N may be divided into two NX2N nodes by vertical binary division, and divided into two 2NXN nodes by horizontal binary division. In addition, in a ternary tree (TT) structure, a node of 2NX2N size is divided into nodes of (N/2)X2N, NX2N and (N/2)X2N by vertical ternary division, and horizontal binary division It can be divided into 2NX(N/2), 2NXN, and 2NX(N/2) nodes by. This multi-type tree division can be performed recursively.

멀티-타입 트리의 리프 노드는 코딩 유닛이 될 수 있다. 코딩 유닛이 최대 변환 길이에 비해 너무 크지 않으면, 해당 코딩 유닛은 더 이상의 분할 없이 예측 및 변환의 단위로 사용된다. 한편, 전술한 쿼드 트리 및 멀티-타입 트리에서 다음의 파라메터들 중 적어도 하나가 사전에 정의되거나 PPS, SPS, VPS 등과 같은 상위 레벨 세트의 RBSP를 통해 전송될 수 있다. 1) CTU 크기: 쿼드 트리의 루트 노드(root node) 크기, 2) 최소 QT 크기(MinQtSize): 허용된 최소 QT 리프 노드 크기, 3) 최대 BT 크기(MaxBtSize): 허용된 최대 BT 루트 노드 크기, 4) 최대 TT 크기(MaxTtSize): 허용된 최대 TT 루트 노드 크기, 5) 최대 MTT 깊이(MaxMttDepth): QT의 리프 노드로부터의 MTT 분할의 최대 허용 깊이, 6) 최소 BT 크기(MinBtSize): 허용된 최소 BT 리프 노드 크기, 7) 최소 TT 크기(MinTtSize): 허용된 최소 TT 리프 노드 크기.Leaf nodes of a multi-type tree can be coding units. If the coding unit is not too large for the maximum transform length, the coding unit is used as a unit of prediction and transform without further division. Meanwhile, in the above-described quad tree and multi-type tree, at least one of the following parameters may be defined in advance or transmitted through RBSP of a higher level set such as PPS, SPS, and VPS. 1) CTU size: the size of the root node of the quad tree, 2) the minimum QT size (MinQtSize): the minimum QT leaf node size allowed, 3) the maximum BT size (MaxBtSize): the maximum BT root node size allowed, 4) Maximum TT size (MaxTtSize): Maximum allowed TT root node size, 5) Maximum MTT depth (MaxMttDepth): Maximum allowable depth of MTT split from leaf node of QT, 6) Minimum BT size (MinBtSize): Allowed Minimum BT leaf node size, 7) Minimum TT size (MinTtSize): Minimum allowed TT leaf node size.

도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다. 전술한 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하기 위해 기 설정된 플래그들이 사용될 수 있다. 도 4를 참조하면, 쿼드 트리 노드의 분할 여부를 지시하는 플래그 ‘qt_split_flag’, 멀티-타입 트리 노드의 분할 여부를 지시하는 플래그 ‘mtt_split_flag’, 멀티-타입 트리 노드의 분할 방향을 지시하는 플래그 ‘mtt_split_vertical_flag’ 또는 멀티-타입 트리 노드의 분할 모양을 지시하는 플래그 ‘mtt_split_binary_flag’ 중 적어도 하나가 사용될 수 있다.4 shows an embodiment of a method for signaling division of a quad tree and a multi-type tree. Pre-set flags may be used to signal the division of the quad tree and multi-type tree described above. 4, a flag'qt_split_flag' indicating whether to divide a quad tree node, a flag'mtt_split_flag' indicating whether to divide a multi-type tree node, and a flag'mtt_split_vertical_flag' indicating a splitting direction of a multi-type tree node. 'Or at least one of a flag'mtt_split_binary_flag' indicating the split shape of the multi-type tree node may be used.

본 발명의 실시예에 따르면, 코딩 트리 유닛은 쿼드 트리의 루트 노드이며, 쿼드 트리 구조로 우선 분할될 수 있다. 쿼드 트리 구조에서는 각각의 노드 ‘QT_node’ 별로 ‘qt_split_flag’가 시그널링된다. ‘qt_split_flag’의 값이 1일 경우 해당 노드는 4개의 정사각형 노드들로 분할되며, ‘qt_split_flag’의 값이 0일 경우 해당 노드는 쿼드 트리의 리프 노드 ‘QT_leaf_node’가 된다.According to an embodiment of the present invention, the coding tree unit is a root node of a quad tree, and may be divided first into a quad tree structure. In the quad tree structure, a'qt_split_flag' is signaled for each node'QT_node'. If the value of'qt_split_flag' is 1, the node is divided into 4 square nodes, and if the value of'qt_split_flag' is 0, the node becomes'QT_leaf_node' of the quad tree leaf node.

각각의 쿼드 트리 리프 노드 ‘QT_leaf_node’는 멀티-타입 트리 구조로 더 분할될 수 있다. 멀티-타입 트리 구조에서는 각각의 노드 ‘MTT_node’ 별로 ‘mtt_split_flag’가 시그널링된다. ‘mtt_split_flag’의 값이 1일 경우 해당 노드는 복수의 직사각형 노드들로 분할되며, ‘mtt_split_flag’의 값이 0일 경우 해당 노드는 멀티-타입 트리의 리프 노드 ‘MTT_leaf_node’가 된다. 멀티-타입 트리 노드 ‘MTT_node’가 복수의 직사각형 노드들로 분할될 경우(즉, ‘mtt_split_flag’의 값이 1일 경우), 노드 ‘MTT_node’를 위한 ‘mtt_split_vertical_flag’ 및 ‘mtt_split_binary_flag’가 추가로 시그널링될 수 있다. ‘mtt_split_vertical_flag’의 값이 1일 경우 노드 ‘MTT_node’의 수직 분할이 지시되며, ‘mtt_split_vertical_flag’의 값이 0일 경우 노드 ‘MTT_node’의 수평 분할이 지시된다. 또한, ‘mtt_split_binary_flag’의 값이 1일 경우 노드 ‘MTT_node’는 2개의 직사각형 노드들로 분할되며, ‘mtt_split_binary_flag’의 값이 0일 경우 노드 ‘MTT_node’는 3개의 직사각형 노드들로 분할된다.Each quad tree leaf node'QT_leaf_node' may be further divided into a multi-type tree structure. In the multi-type tree structure,'mtt_split_flag' is signaled for each node'MTT_node'. When the value of'mtt_split_flag' is 1, the node is divided into a plurality of rectangular nodes. When the value of'mtt_split_flag' is 0, the node becomes'MTT_leaf_node' of the multi-type tree. When the multi-type tree node'MTT_node' is divided into a plurality of rectangular nodes (i.e., when the value of'mtt_split_flag' is 1),'mtt_split_vertical_flag' and'mtt_split_binary_flag' for node'MTT_node' will be additionally signaled. I can. When the value of'mtt_split_vertical_flag' is 1, vertical division of the node'MTT_node' is indicated, and when the value of'mtt_split_vertical_flag' is 0, horizontal division of the node'MTT_node' is indicated. In addition, when the value of'mtt_split_binary_flag' is 1, the node'MTT_node' is divided into two rectangular nodes, and when the value of'mtt_split_binary_flag' is 0, the node'MTT_node' is divided into 3 rectangular nodes.

도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다. 전술한 바와 같이, 인트라 예측부는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 픽셀들을 참조 픽셀들로 이용하여 현재 블록의 픽셀값들을 예측한다.5 and 6 more specifically illustrate an intra prediction method according to an embodiment of the present invention. As described above, the intra prediction unit predicts pixel values of the current block by using reconstructed pixels located on the left and/or above of the current block as reference pixels.

먼저, 도 5는 인트라 예측 모드에서 현재 블록의 예측을 위해 사용되는 참조 샘플들의 일 실시예를 도시한다. 일 실시예에 따르면, 참조 픽셀들은 현재 블록의 좌측 경계에 인접한 픽셀들 및/또는 상측 경계에 인접한 픽셀들일 수 있다. 도 5에 도시된 바와 같이, 현재 블록의 크기가 WXH이고 현재 블록에 인접한 단일 참조 라인(line)의 픽셀들이 인트라 예측에 사용될 경우, 현재 블록의 좌측 및/또는 상측에 위치한 최대 2W+2H+1개의 인접 픽셀들을 사용하여 참조 픽셀들이 설정될 수 있다. 한편, 본 발명의 추가적인 실시예에 따르면, 현재 블록의 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 수 있다. 다중 참조 라인은 현재 블록으로부터 기 설정된 범위 이내에 위치한 n개의 라인들로 구성될 수 있다. 일 실시예에 따르면, 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 경우, 참조 픽셀들로 설정될 라인들을 지시하는 별도의 인덱스 정보가 시그널링될 수 있다. 참조 픽셀로 사용될 적어도 일부의 인접 픽셀이 아직 복원되지 않은 경우, 인트라 예측부는 기 설정된 규칙에 따른 참조 샘플 패딩 과정을 수행하여 참조 픽셀을 획득할 수 있다. 또한, 인트라 예측부는 인트라 예측의 오차를 줄이기 위해 참조 샘플 필터링 과정을 수행할 수 있다. 즉, 인접 픽셀들 및/또는 참조 샘플 패딩 과정에 의해 획득된 픽셀들에 필터링을 수행하여 참조 픽셀들이 획득할 수 있다. 인트라 예측부는 이와 같이 획득된 참조 픽셀들을 이용하여 현재 블록의 픽셀들을 예측한다.First, FIG. 5 shows an embodiment of reference samples used for prediction of a current block in an intra prediction mode. According to an embodiment, the reference pixels may be pixels adjacent to the left boundary of the current block and/or pixels adjacent to the upper boundary. As shown in FIG. 5, when the size of the current block is WXH and pixels of a single reference line adjacent to the current block are used for intra prediction, a maximum of 2W+2H+1 located on the left and/or upper side of the current block Reference pixels can be set using n adjacent pixels. Meanwhile, according to an additional embodiment of the present invention, pixels of multiple reference lines may be used for intra prediction of a current block. The multiple reference line may consist of n lines located within a preset range from the current block. According to an embodiment, when pixels of multiple reference lines are used for intra prediction, separate index information indicating lines to be set as reference pixels may be signaled. When at least some adjacent pixels to be used as reference pixels have not yet been reconstructed, the intra prediction unit 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 block by using the obtained reference pixels.

다음으로, 도 6은 인트라 예측에 사용되는 예측 모드들의 일 실시예를 도시한다. 인트라 예측을 위해, 인트라 예측 방향을 지시하는 인트라 예측 모드 정보가 시그널링될 수 있다. 인트라 예측 모드 정보는 인트라 예측 모드 세트를 구성하는 복수의 인트라 예측 모드들 중 어느 하나를 지시한다. 현재 블록이 인트라 예측 블록일 경우, 디코더는 비트스트림으로부터 현재 블록의 인트라 예측 모드 정보를 수신한다. 디코더의 인트라 예측부는 추출된 인트라 예측 모드 정보에 기초하여 현재 블록에 대한 인트라 예측을 수행한다.Next, FIG. 6 shows an embodiment of prediction modes used for intra prediction. For intra prediction, intra prediction mode information indicating an intra prediction direction may be signaled. The intra prediction mode information indicates any one of a plurality of intra prediction modes constituting the intra prediction mode set. When the current block is an intra prediction block, the decoder receives intra prediction mode information of the current block from the bitstream. The intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.

본 발명의 실시예에 따르면, 인트라 예측 모드 세트는 인트라 예측에 사용되는 모든 인트라 예측 모드들(예, 총 67개의 인트라 예측 모드들)을 포함할 수 있다. 더욱 구체적으로, 인트라 예측 모드 세트는 평면 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향 모드들)을 포함할 수 있다. 각각의 인트라 예측 모드는 기 설정된 인덱스(즉, 인트라 예측 모드 인덱스)를 통해 지시될 수 있다. 예를 들어, 도 6에 도시된 바와 같이 인트라 예측 모드 인덱스 0은 평면 모드를 지시하고, 인트라 예측 모드 인덱스 1은 DC 모드를 지시한다. 또한, 인트라 예측 모드 인덱스 2 내지 66은 서로 다른 각도 모드들을 각각 지시할 수 있다. 각도 모드들은 기 설정된 각도 범위 이내의 서로 다른 각도들을 각각 지시한다. 예를 들어, 각도 모드는 시계 방향으로 45도에서 -135도 사이의 각도 범위(즉, 제1 각도 범위) 이내의 각도를 지시할 수 있다. 상기 각도 모드는 12시 방향을 기준으로 정의될 수 있다. 이때, 인트라 예측 모드 인덱스 2는 수평 대각(Horizontal Diagonal, HDIA) 모드를 지시하고, 인트라 예측 모드 인덱스 18은 수평(Horizontal, HOR) 모드를 지시하고, 인트라 예측 모드 인덱스 34는 대각(Diagonal, DIA) 모드를 지시하고, 인트라 예측 모드 인덱스 50은 수직(Vertical, VER) 모드를 지시하며, 인트라 예측 모드 인덱스 66은 수직 대각(Vertical Diagonal, VDIA) 모드를 지시한다.According to an embodiment of the present invention, the intra prediction mode set may include all intra prediction modes (eg, a total of 67 intra prediction modes) used for intra prediction. More specifically, the intra prediction mode set may include a planar mode, a DC mode, and a plurality (eg, 65) angular modes (ie, directional modes). Each intra prediction mode may be indicated through a preset index (ie, an intra prediction mode index). For example, as shown in FIG. 6, intra prediction mode index 0 indicates a planar mode, and intra prediction mode index 1 indicates a DC mode. In addition, intra prediction mode indexes 2 to 66 may indicate different angular modes, respectively. The angle modes indicate different angles within a preset angle range, respectively. For example, the angle mode may indicate an angle within an angle range between 45 degrees and -135 degrees in a clockwise direction (ie, a first angle range). The angular mode may be defined based on the 12 o'clock direction. At this time, intra prediction mode index 2 indicates a horizontal diagonal (HDIA) mode, intra prediction mode index 18 indicates a horizontal (HOR) mode, and intra prediction mode index 34 indicates a diagonal (Diagonal, DIA) mode. A mode is indicated, an intra prediction mode index 50 indicates a vertical (VER) mode, and an intra prediction mode index 66 indicates a vertical diagonal (VDIA) mode.

한편, 기 설정된 각도 범위는 현재 블록의 모양에 따라 서로 다르게 설정될 수 있다. 예를 들어, 현재 블록이 직사각형 블록일 경우 시계 방향으로 45도를 초과하거나 -135도 미만 각도를 지시하는 광각 모드가 추가적으로 사용될 수 있다. 현재 블록이 수평 블록일 경우, 각도 모드는 시계 방향으로 (45+offset1)도에서 (-135+offset1)도 사이의 각도 범위(즉, 제2 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 67 내지 76이 추가적으로 사용될 수 있다. 또한, 현재 블록이 수직 블록일 경우, 각도 모드는 시계 방향으로 (45-offset2)도에서 (-135-offset2)도 사이의 각도 범위(즉, 제3 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 -10 내지 -1이 추가적으로 사용될 수 있다. 본 발명의 실시예에 따르면, offset1 및 offset2의 값은 직사각형 블록의 너비와 높이 간의 비율에 따라 서로 다르게 결정될 수 있다. 또한, offset1 및 offset2는 양수일 수 있다.Meanwhile, the preset angle range may be set differently according to the shape of the current block. For example, when the current block is a rectangular block, a wide-angle mode indicating an angle exceeding 45 degrees or less than -135 degrees clockwise may be additionally used. When the current block is a horizontal block, the angle mode may indicate an angle within an angle range (that is, a second angle range) between (45+offset1) degrees and (-135+offset1) degrees in a clockwise direction. In this case, angle modes 67 to 76 outside the first angle range may be additionally used. In addition, when the current block is a vertical block, the angle mode may indicate an angle within an angle range (ie, a third angle range) between (45-offset2) degrees and (-135-offset2) degrees in a clockwise direction. . In this case, angle modes -10 to -1 outside the first angle range may be additionally used. According to an embodiment of the present invention, values of offset1 and offset2 may be determined differently according to a ratio between the width and height of the rectangular block. Also, offset1 and offset2 may be positive numbers.

본 발명의 추가적인 실시예에 따르면, 인트라 예측 모드 세트를 구성하는 복수의 각도 모드들은 기본 각도 모드와 확장 각도 모드를 포함할 수 있다. 이때, 확장 각도 모드는 기본 각도 모드에 기초하여 결정될 수 있다.According to a further embodiment of the present invention, a plurality of angular modes constituting the intra prediction mode set may include a basic angular mode and an extended angular mode. In this case, the extended angle mode may be determined based on the basic angle mode.

일 실시예에 따르면, 기본 각도 모드는 기존 HEVC(High Efficiency Video Coding) 표준의 인트라 예측에서 사용되는 각도에 대응하는 모드이고, 확장 각도 모드는 차세대 비디오 코덱 표준의 인트라 예측에서 새롭게 추가되는 각도에 대응하는 모드일 수 있다. 더욱 구체적으로, 기본 각도 모드는 인트라 예측 모드 {2, 4, 6, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {3, 5, 7, …, 65} 중 어느 하나에 대응하는 각도 모드일 수 있다. 즉, 확장 각도 모드는 제1 각도 범위 내에서 기본 각도 모드들 사이의 각도 모드일 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다.According to an embodiment, the basic angle mode is a mode corresponding to an angle used in intra prediction of an existing HEVC (High Efficiency Video Coding) standard, and the extended angle mode corresponds to an angle newly added in intra prediction of the next generation video codec standard. It can be a mode to do. More specifically, the basic angular mode is an intra prediction mode {2, 4, 6, ... , 66}, and the extended angle mode is an intra prediction mode {3, 5, 7, ... , 65} may be an angle mode corresponding to any one of. That is, the extended angle mode may be an angle mode between basic angle modes within the first angle range. Accordingly, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.

다른 실시예에 따르면, 기본 각도 모드는 기 설정된 제1 각도 범위 이내의 각도에 대응하는 모드이고, 확장 각도 모드는 상기 제1 각도 범위를 벗어나는 광각 모드일 수 있다. 즉, 기본 각도 모드는 인트라 예측 모드 {2, 3, 4, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {-10, -9, …, -1} 및 {67, 68, …, 76} 중 어느 하나에 대응하는 각도 모드일 수 있다. 확장 각도 모드가 지시하는 각도는 대응하는 기본 각도 모드가 지시하는 각도의 반대편 각도로 결정될 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다. 한편, 확장 각도 모드들의 개수는 이에 한정되지 않으며, 현재 블록의 크기 및/또는 모양에 따라 추가적인 확장 각도들이 정의될 수 있다. 예를 들어, 확장 각도 모드는 인트라 예측 모드 {-14, -13, …, -1} 및 {67, 68, …, 80} 중 어느 하나에 대응하는 각도 모드로 정의될 수도 있다. 한편, 인트라 예측 모드 세트에 포함되는 인트라 예측 모드들의 총 개수는 전술한 기본 각도 모드와 확장 각도 모드의 구성에 따라 가변할 수 있다.According to another embodiment, the basic angle mode is a mode corresponding to an angle within a preset first angle range, and the extended angle mode may be a wide angle mode outside the first angle range. That is, the basic angular mode is the intra prediction mode {2, 3, 4,… , 66}, and the extended angle mode is an intra prediction mode {-10, -9, ... , -1} and {67, 68,… , 76} may be an angular mode corresponding to any one of. The angle indicated by the extended angle mode may be determined as an angle opposite to the angle indicated by the corresponding basic angle mode. Accordingly, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode. Meanwhile, the number of expansion angle modes is not limited thereto, and additional expansion angles may be defined according to the size and/or shape of the current block. For example, the extended angle mode is the intra prediction mode {-14, -13,… , -1} and {67, 68,… , 80} may be defined as an angle mode corresponding to any one of. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set may vary according to the configuration of the above-described basic angle mode and extended angle mode.

상기 실시예들에서, 확장 각도 모드들 간의 간격은 대응하는 기본 각도 모드들 간의 간격에 기초하여 설정될 수 있다. 예를 들어, 확장 각도 모드들 {3, 5, 7, …, 65} 간의 간격은 대응하는 기본 각도 모드들 {2, 4, 6, …, 66} 간의 간격에 기초하여 결정될 수 있다. 또한, 확장 각도 모드들 {-10, -9, …, -1} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {56, 57, …, 65} 간의 간격에 기초하여 결정되고, 확장 각도 모드들 {67, 68, …, 76} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {3, 4, …, 12} 간의 간격에 기초하여 결정될 수 있다. 확장 각도 모드들 간의 각도 간격은 대응하는 기본 각도 모드들 간의 각도 간격과 동일하도록 설정될 수 있다. 또한, 인트라 예측 모드 세트에서 확장 각도 모드들의 개수는 기본 각도 모드들의 개수 이하로 설정될 수 있다.In the above embodiments, the spacing between the extended angle modes may be set based on the spacing between the corresponding basic angle modes. For example, extended angle modes {3, 5, 7,… , 65} the spacing between the corresponding basic angular modes {2, 4, 6,… , 66} can be determined based on the interval. Also, the extended angle modes {-10, -9,… , -1} the spacing between the corresponding opposite basic angular modes {56, 57,… , 65}, determined based on the spacing between the extended angle modes {67, 68, ... , 76} the spacing between the corresponding opposite basic angular modes {3, 4,… , 12} may be determined based on the interval. The angular interval between the extended angular modes may be set to be the same as the angular interval between the corresponding basic angular modes. In addition, the number of extended angle modes in the intra prediction mode set may be set to be less than or equal to the number of basic angle modes.

본 발명의 실시예에 따르면, 확장 각도 모드는 기본 각도 모드를 기초로 시그널링될 수 있다. 예를 들어, 광각 모드(즉, 확장 각도 모드)는 제1 각도 범위 이내의 적어도 하나의 각도 모드(즉, 기본 각도 모드)를 대체할 수 있다. 대체되는 기본 각도 모드는 광각 모드의 반대편에 대응하는 각도 모드일 수 있다. 즉, 대체되는 기본 각도 모드는 광각 모드가 지시하는 각도의 반대 방향의 각도에 대응하거나 또는 상기 반대 방향의 각도로부터 기 설정된 오프셋 인덱스만큼 차이 나는 각도에 대응하는 각도 모드이다. 본 발명의 실시예에 따르면, 기 설정된 오프셋 인덱스는 1이다. 대체되는 기본 각도 모드에 대응하는 인트라 예측 모드 인덱스는 광각 모드에 다시 매핑되어 해당 광각 모드를 시그널링할 수 있다. 예를 들어, 광각 모드 {-10, -9, …, -1}은 인트라 예측 모드 인덱스 {57, 58, …, 66}에 의해 각각 시그널링될 수 있고, 광각 모드 {67, 68, …, 76}은 인트라 예측 모드 인덱스 {2, 3, …, 11}에 의해 각각 시그널링될 수 있다. 이와 같이 기본 각도 모드를 위한 인트라 예측 모드 인덱스가 확장 각도 모드를 시그널링하도록 함으로, 각 블록의 인트라 예측에 사용되는 각도 모드들의 구성이 서로 다르더라도 동일한 세트의 인트라 예측 모드 인덱스들이 인트라 예측 모드의 시그널링에 사용될 수 있다. 따라서, 인트라 예측 모드 구성의 변화에 따른 시그널링 오버헤드가 최소화할 수 있다.According to an embodiment of the present invention, the extended angle mode may be signaled based on the basic angle mode. For example, the wide-angle mode (ie, the extended angle mode) may replace at least one angle mode (ie, the basic angle mode) within the first angle range. The replaced default angle mode may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the replaced basic angle mode is an angle mode that corresponds to an angle in a direction opposite to the angle indicated by the wide-angle mode or to an angle that differs by a preset offset index from the angle in the opposite direction. According to an embodiment of the present invention, the preset offset index is 1. The intra prediction mode index corresponding to the replaced basic angular mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode. For example, wide-angle mode {-10, -9,… , -1} is the intra prediction mode index {57, 58, ... , 66}, each can be signaled by the wide-angle mode {67, 68, ... , 76} is an intra prediction mode index {2, 3, ... , 11}, respectively. In this way, the intra prediction mode index for the basic angular mode signals the extended angular mode, so that even if the configuration of the angular modes used for intra prediction of each block is different, the intra prediction mode indexes of the same set are Can be used. Accordingly, signaling overhead due to changes in the intra prediction mode configuration can be minimized.

한편, 확장 각도 모드의 사용 여부는 현재 블록의 모양 및 크기 중 적어도 하나에 기초하여 결정될 수 있다. 일 실시예에 따르면, 현재 블록의 크기가 기 설정된 크기보다 클 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 그렇지 않을 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다. 다른 실시예에 따르면, 현재 블록이 정사각형이 아닌 블록인 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 현재 블록이 정사각형 블록인 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다.Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. According to an embodiment, when the size of the current block is larger than a preset size, the extended angle mode is used for intra prediction of the current block, otherwise, only the basic angle mode may be used for intra prediction of the current block. According to another embodiment, when the current block is a non-square block, the extended angle mode is used for intra prediction of the current block, and when the current block is a square block, only the basic angle mode may be used for intra prediction of the current block.

인트라 예측부는 현재 블록의 인트라 예측 모드 정보에 기초하여, 현재 블록의 인트라 예측에 사용될 참조 픽셀들 및/또는 보간된 참조 픽셀들을 결정한다. 인트라 예측 모드 인덱스가 특정 각도 모드를 지시할 경우, 현재 블록의 현재 픽셀로부터 상기 특정 각도에 대응하는 참조 픽셀 또는 보간된 참조 픽셀이 현재 픽셀의 예측에 사용된다. 따라서, 인트라 예측 모드에 따라 서로 다른 세트의 참조 픽셀들 및/또는 보간된 참조 픽셀들이 인트라 예측에 사용될 수 있다. 참조 픽셀들 및 인트라 예측 모드 정보를 이용하여 현재 블록의 인트라 예측이 수행되고 나면, 디코더는 역변환부로부터 획득된 현재 블록의 잔차 신호를 현재 블록의 인트라 예측값과 더하여 현재 블록의 픽셀 값들을 복원한다.The intra prediction unit determines reference pixels and/or interpolated reference pixels to be used for intra prediction of the current block, based on the intra prediction mode information of the current block. When the intra prediction mode index indicates a specific angular mode, a reference pixel corresponding to the specific angle from the current pixel of the current block or an interpolated reference pixel 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 block is performed using reference pixels and intra prediction mode information, the decoder restores pixel values of the current block by adding the residual signal of the current block obtained from the inverse transform unit with the intra prediction value of the current block.

도 7은 본 발명의 일 실시예에 따른 inter prediction을 나타낸 도면이다.7 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.

도 7을 참조하면 왼쪽에 Reference picture(참조 픽쳐)가 있고, 오른쪽에 Current picture(현재 픽쳐)가 있는데, current picture 또는 current picture의 일부를 reference picture 또는 reference picture의 일부와의 유사성을 이용해서 예측할 수 있다. 도 7의 current picture 안에 실선으로 나타낸 사각형이 현재 인코딩, 디코딩하는 블락이라고 했을 때 reference picture의 점선으로 나타낸 사각형으로부터 현재 블락을 예측할 수 있다. 이때 현재 블락이 참조해야할 블락(참조 블락)을 지시하는 정보가 존재할 수 있고, 이는 직접 시그날링 될 수도 있고, 시그날링 오버헤드를 줄이기 위해 어떠한 약속에 의해 만들어낼 수 있을 수도 있다. 상기 현재 블락이 참조해야할 블락을 지시하는 정보는 모션 벡터(motion vector)을 포함할 수 있다. 이는 현재 블락과 참조 블락 간의 픽쳐 내에서의 상대적인 위치를 나타내는 벡터일 수 있다. 도 7을 참조하면 reference picture의 점선으로 나타낸 부분이 존재하는데 현재 블락이 어떻게 이동하면 reference picture의 참조해야할 블락으로 이동할 수 있는지 나타내는 벡터가 모션 벡터일 수 있다. 즉, 현재 블락을 모션 벡터에 따라 움직이면 나오는 블락은 도 7의 current picture에 점선으로 나타낸 부분일 수 있고, 이 점선으로 나타낸 부분은 picture 안에서의 위치가 reference picture의 참조 블락 위치와 같을 수 있다.Referring to FIG. 7, 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. 7 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 directly signaled or may be generated by a certain promise to reduce signaling overhead. The information indicating the 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. 7, 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. 7, 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.

도 8은 본 발명의 일 실시예에 따른 모션 벡터 시그날링 방법을 나타낸 도면이다.8 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) may 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 about 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 on 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 MVP determined among the generated MVP candidates to the decoder, and the decoder can find out the MVP and MV determined based on the 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 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 a reference picture corresponding to an MVP candidate does not correspond to information indicating a 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.

도 9는 본 발명의 일 실시예에 따른 motion vector difference syntax를 나타낸 도면이다.9 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는 값이 직접 코딩될 수도 있지만 도 9와 같이 absolute value가 N보다 큰지 여부를 나타내는 flag를 포함하여 코딩될 수 있다. 만약 absolute value가 N보다 큰 경우 (absolute value - N)의 값이 함께 시그날링 될 수 있다. 도 9의 예에서는 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. Also, 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. 9. If the absolute value is greater than N, the value of (absolute value-N) can be signaled together. In the example of FIG. 9, 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 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.

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

또한 도 9에서 cpIdx는 control point index를 나타낼 수 있다. Control point index는 affine motion prediction에서의 control motion vector index에 해당하는 index일 수 있다. 또한 affine motion prediction이 아닌 prediction 방법에서는 cpIdx를 예를 들어 0과 같은 기설정된 값으로 사용할 수 있다.In addition, cpIdx in FIG. 9 may indicate a control point index. The control point index may be an index corresponding to the control motion vector index in affine motion prediction. Also, in a prediction method other than affine motion prediction, cpIdx can be used as a preset value such as 0, for example.

도 10은 본 발명의 일 실시예에 따른 adaptive motion vector resolution 시그날링을 나타낸 도면이다.10 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 1/4, you code 64 (1/4 * 64 = 16), 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 inaccurate value other than the motion vector or the motion vector difference with the best prediction performance may be transmitted through rounding. 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을 적용할 수 있다.In addition, it is possible to set the resolution differently in units such as block, CU, or slice. 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, signaling overhead is reduced when signaling with the index corresponding to the smallest value (the value in front of it).

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

도 10은 3가지 resolution에 대한 시그날링을 나타내고 있다. 이러한 경우 3가지 시그날링은 0, 10, 11일 수 있고, 3가지 시그날링 각각이 resolution 1, resolution 2, resolution 3에 해당할 수 있다. resolution 1을 시그날링 하는 데에는 1비트가 필요하고 나머지 resolution을 시그날링 하는 데에 2비트가 필요하므로 resolution 1을 시그날링 할 때 시그날링 오버헤드가 적다. 도 10의 예에서는 resolution 1, resolution 2, resolution 3이 각각 1/4, 1, 4 pel이다.10 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. 10, 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.

도 11은 본 발명의 일 실시예에 따른 inter prediction 관련 syntax를 나타낸 도면이다.11 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에 따라 결정될 수 있다. 도 11을 참조하면 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. 11, 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에 따라 결정될 수 있다. 도 11을 참조하면 merge_flag 값에 따라 merge mode 사용 여부가 결정될 수 있다. 또한 skip mode를 사용하지 않는 경우에 merge mode를 사용하는 것이 가능하다.According to an embodiment, the motion vector difference may not be used in the merge mode. The 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. 11, 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에 의해 결정될 수 있다. 도 11에서는 다른 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. FIG. 11 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.

도 11을 참조하면 skip mode 또는 merge mode로 결정된 후에 subblock merge candidate를 사용할 지, merge candidate를 사용할 지 결정할 수 있다. 예를 들면 특정 조건을 만족하는 경우에 subblock merge candidate를 사용하는지 여부를 나타내는 merge_subblock_flag를 parsing할 수 있다. 또한 상기 특정 조건은 block size와 관련된 조건일 수 있다. 예를 들면 width, height, area 등에 관한 조건일 수 있고, 이것들을 조합하여 사용할 수도 있다. 도 11을 참조하면 예를 들어 현재 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. 11, 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. In addition, 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. 11, 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.

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

도 12는 본 발명의 일 실시예에 따른 spatial neighboring 위치를 나타낸 도면이다.12 is a diagram showing a spatial neighboring location according to an embodiment of the present invention.

앞서 설명한 것처럼 prediction 수행 시 현재 block 주변 위치를 참조할 수 있다. 이것은 현재 block 주변 위치에 해당하는 motion information을 참조하는 것일 수 있다. 예를 들어 merge mode 또는 AMVP mode 등을 사용할 때 현재 block 주변 위치에 해당하는 motion information에 기초하여 MVP 또는 MV를 설정하는 것이 가능하다. 상기 주변 위치는 기설정되어 있을 수 있다. 또한 상기 주변 위치가 다수 있을 때 그것들을 참조하는 순서가 기설정되어 있을 수 있다. 또한 주변 위치는 spatial neighbor와 temporal neighbor를 포함할 수 있다.As described above, when performing prediction, a location around the current block can be referenced. This may refer to motion information corresponding to a position around the current block. For example, when using the merge mode or AMVP mode, it is possible to set the MVP or the MV based on motion information corresponding to the position around the current block. The surrounding location may be preset. In addition, when there are a plurality of the surrounding locations, an order of referencing them may be preset. Also, the surrounding location may include a spatial neighbor and a temporal neighbor.

도 12를 참조하면 A0, A1, B0, B1, B2에 해당하는 위치가 기설정되어 있을 수 있다. 또한 여기서의 위치는 luma location을 뜻할 수 있다. 현재 block의 top-left 위치를 (xCb, yCb)라고 할 때 A0, A1, B0, B1, B2는 각각 (xCb - 1, yCb + cbHeight), (xCb - 1, yCb + cbHeight - 1), (xCb + cbWidth, yCb - 1), (xCb + cbWidth - 1, yCb - 1), , (xCb - 1, yCb - 1) 일 수 있다. 이때 cbWidth, cbHeight는 각각 현재 block의 width와 height일 수 있다.Referring to FIG. 12, positions corresponding to A0, A1, B0, B1, and B2 may be preset. Also, the location here can mean luma location. When the top-left position of the current block is (xCb, yCb), A0, A1, B0, B1, B2 are (xCb-1, yCb + cbHeight), (xCb-1, yCb + cbHeight-1), ( xCb + cbWidth, yCb-1), (xCb + cbWidth-1, yCb-1),, (xCb-1, yCb-1). At this time, cbWidth and cbHeight may be the width and height of the current block, respectively.

본 발명의 일 실시예를 따르면 merge mode에서 A1, B1, B0, A0, B2의 순서대로 spatial neighbor를 참조할 수 있다. 또한 spatial neighbor 위치에 해당하는 spatial candidate를 candidate list에 추가할 수 있다. 또한 spatial candidate 외에 temporal candidate를 추가할 수 있고 이것은 spatial candidate보다 뒤에 있을 수 있다. 또한 temporal candidate에 해당하는 motion vector를 collocated motion vector라고 부를 수 있다.According to an embodiment of the present invention, a spatial neighbor may be referred to in the order of A1, B1, B0, A0, and B2 in merge mode. Also, a spatial candidate corresponding to a spatial neighbor location can be added to the candidate list. In addition, a temporal candidate can be added in addition to the spatial candidate, and this can be behind the spatial candidate. Also, a motion vector corresponding to a temporal candidate can be called a collocated motion vector.

또한 candidate list가 채워지지 않은 경우 zero motion vector를 candidate list에 추가할 수 있다. Zero motion vector는 motion vector가 현재 block 위치를 가리키는 motion vector 일 수 있다.Also, if the candidate list is not filled, a zero motion vector can be added to the candidate list. The zero motion vector may be a motion vector in which the motion vector points to the current block position.

또한 merge candidate list에 history-based motion vector prediction candidate, pairwise average candidate 등이 포함될 수 있다. 이것은 candidate list에서 spatial candidate보다 뒤에 위치하는 것이 가능하다. 상기 history-based motion vector prediction candidate는 저장해놓은 motion information일 수 있다. 또한 저장해놓은 motion information은 현재 block 이전에 디코딩된(인코딩된) block에 해당하는 motion information일 수 있다. 또한 pairwise average candidate는 candidate list에 이미 추가된 candidate들에 기초해서 생성하는 candidate 일 수 있다. 예를 들어 pairwise average candidate는 candidate list에 이미 추가된 candidate들의 평균일 수 있다.Also, a history-based motion vector prediction candidate and a pairwise average candidate may be included in the merge candidate list. It is possible to place it behind the spatial candidate in the candidate list. The history-based motion vector prediction candidate may be stored motion information. In addition, the stored motion information may be motion information corresponding to a block decoded (encoded) before the current block. In addition, the pairwise average candidate may be a candidate generated based on candidates already added to the candidate list. For example, the pairwise average candidate may be an average of candidates already added to the candidate list.

위에서 설명한 현재 block 주변 위치를 참조하여 candidate list에 추가하는 과정에 motion vector scaling 과정이 포함될 수 있다. Motion vector scaling은 참조한 motion information의 reference picture의 picture order count(POC), 현재 block을 포함하는 picture의 POC, 현재 block의 reference picture의 POC, 참조한 motion information 등에 기반하여 이루어질 수 있다.The motion vector scaling process may be included in the process of adding to the candidate list by referring to locations around the current block described above. Motion vector scaling may be performed based on a picture order count (POC) of a reference picture of referenced motion information, a POC of a picture including a current block, a POC of a reference picture of a current block, and referenced motion information.

본 발명의 일 실시예를 따르면 기설정된 spatial neighbor 위치들 중에서 그룹을 설정할 수 있다. 또한 상기 그룹 중에서 기설정된 개수의 motion information을 참조하는 것이 가능하다. 예를 들어 그룹 1 중에서 기설정된 개수의 motion information을 참조하고, 그룹 2 중에서 기설정된 개수의 motion information을 참조할 수 있다. 예를 들어 상기 기설정된 개수는 1일 수 있다. 또한 그룹 내에서의 참조 순서가 기설정되어 있을 수 있다. 또한 그룹 간의 candidate 추가 순서가 기설정되어 있을 수 있다.According to an embodiment of the present invention, a group may be set among preset spatial neighbor locations. In addition, it is possible to refer to a preset number of motion information among the groups. For example, a preset number of motion information among group 1 may be referred to, and a preset number of motion information may be referred to among group 2. For example, the preset number may be 1. Also, a reference order within a group may be preset. Also, the order of adding candidates between groups may be preset.

도 12를 참조하면 그룹 1이 A0, A1이고, 그룹 2가 B0, B1, B2인 것이 가능하다. 또한 그룹 1에서 사용 가능한 motion information으로부터 candidate를 만들고, 그룹 2에서 사용 가능한 motion information으로부터 candidate를 만들 수 있다. 또한 그룹 1으로부터의 candidate를 candidate list에 추가하고 그룹 2로부터의 candidate를 candidate list에 순서대로 추가할 수 있다. 예를 들면 AMVP mode에서 candidate list를 설명한 것과 같이 만들 수 있다.Referring to FIG. 12, it is possible that group 1 is A0 and A1, and group 2 is B0, B1, and B2. Also, a candidate can be created from motion information available in group 1, and a candidate can be created from motion information available in group 2. Also, candidates from group 1 can be added to the candidate list, and candidates from group 2 can be added to the candidate list in order. For example, it can be made as described in the candidate list in AMVP mode.

또한 candidate list가 채워지지 않은 경우 scaled candidate, temporal candidate, zero motion vector 등을 추가하는 것이 가능하다.In addition, when the candidate list is not filled, it is possible to add a scaled candidate, a temporal candidate, and a zero motion vector.

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

앞서 설명한 것처럼 현재 block을 prediction할 때 reference picture 내의 block을 참조할 수 있다. 본 발명의 일 실시예를 따르면 상기 reference picture가 현재 block을 포함하는 picture, 즉 현재 picture인 것이 가능하다. 따라서 현재 block을 예측할 때에 현재 picture의 block을 참조하는 것이 가능하다. 이러한 기술을 current picture referencing(CPR)이라고 부를 수 있다.As described above, when predicting the current block, the block in the reference picture can be referenced. According to an embodiment of the present invention, it is possible that the reference picture is a picture including a current block, that is, a current picture. Therefore, when predicting the current block, it is possible to refer to the block of the current picture. This technique can be called current picture referencing (CPR).

일 실시예를 따르면 CPR을 사용하는 경우 현재 picture가 유일한 reference picture인 것이 가능하다. 이러한 경우 reference picture를 나타내는 시그날링을 생략하고 infer하는 것이 가능하다.According to an embodiment, when CPR is used, it is possible that the current picture is the only reference picture. In this case, it is possible to omit the signaling indicating the reference picture and infer.

일 실시예를 따르면 CPR을 사용하는 경우에 현재 block이 참조할 reference block을 지시하는 motion vector가 존재할 수 있다. 일 실시예를 따르면 CPR을 사용하는 경우에 reference block의 위치가 제한되어 있을 수 있다. 예를 들면 reference block의 위치가 현재 block 위치를 기준으로 제한되어 있을 수 있다. 예를 들어 현재 block을 포함하는 CTU 안쪽으로 reference block 위치가 제한되어 있을 수 있다. 또는 현재 block을 포함하는 CTU를 일부라도 포함하는 위치로 reference block 위치가 제한되어 있을 수 있다. Reference block 위치를 제한하는 것은 memory 부담을 줄이기 위한 것일 수 있다.According to an embodiment, when CPR is used, a motion vector indicating a reference block to be referred to by the current block may exist. According to an embodiment, when CPR is used, the position of the reference block may be limited. For example, the position of the reference block may be limited based on the current block position. For example, the position of the reference block may be limited inside the CTU containing the current block. Alternatively, the position of the reference block may be limited to a position that includes at least part of the CTU including the current block. Limiting the reference block location may be to reduce the memory burden.

본 발명의 일 실시예를 따르면 현재 block이 CPR을 사용하는지 나타내는 시그날링이 존재할 수 있다. 일 실시예로 이러한 시그날링은 현재 block을 포함하는 더 큰 단위에서의 시그날링인 것이 가능하다. 예를 들어 slice 또는 tile level에서의 시그날링이 가능하다. 일 실시예로 예를 들어 현재 block이 참조하는 reference picture가 현재 picture인 경우 CPR을 사용하는 것이 가능하다. 또는 현재 picture가 유일한 reference picture인 경우 CPR을 사용하는 것이 가능하다. 또한 추가적으로 현재 block이 intra prediction을 사용하지 않는 block인 경우에 CPR을 사용하는 것이 가능하다. 즉, 예를 들어 현재 block에 해당하는 reference picture가 현재 picture인 경우 intra prediction을 사용하지 않으면 CPR을 사용하는 것이 가능하다. 일 실시예로 현재 picture가 유일한 reference picture인 것을 CurrPicIsOnlyRef 라는 변수로 나타내는 것이 가능하다. 또는 CPR을 사용한다는 것은 reference picture가 현재 picture인 것일 수 있다. 또는 CPR을 사용한다는 것은 reference picture가 현재 picture이고, intra prediction을 사용하지 않는 것일 수 있다.According to an embodiment of the present invention, signaling indicating whether the current block uses CPR may exist. In an embodiment, such signaling may be signaling in a larger unit including the current block. For example, signaling at the slice or tile level is possible. In an embodiment, for example, when the reference picture referenced by the current block is the current picture, it is possible to use CPR. Alternatively, when the current picture is the only reference picture, it is possible to use CPR. In addition, it is possible to use CPR when the current block is a block that does not use intra prediction. That is, for example, when the reference picture corresponding to the current block is the current picture, it is possible to use CPR if intra prediction is not used. In an embodiment, it is possible to indicate that the current picture is the only reference picture with a variable called CurrPicIsOnlyRef. Alternatively, when CPR is used, the reference picture may be the current picture. Alternatively, the use of CPR may indicate that the reference picture is the current picture, and intra prediction is not used.

본 발명의 일 실시예를 따르면 CPR을 사용할 때 앞서 설명한 merge mode, AMVP mode 등을 사용하여 motion information을 나타내는 것이 가능하다.According to an embodiment of the present invention, when using CPR, it is possible to represent motion information using the merge mode, AMVP mode, and the like described above.

또한 CPR을 사용하는 경우 현재 slice 또는 tile이 P slice 또는 P tile로 설정되는 것이 가능하다. 또한 CPR을 사용하는 경우 dual tree를 사용한다는 것을 나타내는 flag가 dual tree를 사용한다는 것을 나타내는 값으로 설정될 수 있다. Dual tree는 luma에 해당하는 tree와 chroma에 해당하는 tree가 다를 수 있는 것을 의미할 수 있다.Also, when using CPR, it is possible to set the current slice or tile as P slice or P tile. Also, when CPR is used, the flag indicating that the dual tree is used can be set to a value indicating that the dual tree is used. The dual tree may mean that the tree corresponding to luma and the tree corresponding to chroma may be different.

도 13을 참조하면 current picture 내에 실선으로 나타낸 현재 block이 있을 수 있다. 또한 점선으로 나타낸 reference block이 current picture 내에 존재할 수 있다. 이때 상기 reference block 위치를 지시하는 motion information이 존재할 수 있다. 도 13을 참조하면 화살표로 나타낸 것이 reference block 위치를 지시하는 motion information일 수 있다.Referring to FIG. 13, there may be a current block indicated by a solid line in a current picture. Also, a reference block indicated by a dotted line may exist in the current picture. At this time, motion information indicating the position of the reference block may exist. Referring to FIG. 13, what is indicated by an arrow may be motion information indicating a reference block position.

또한 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 candidate list 구성이 달라질 수 있다. 예를 들어 CPR을 사용하는 경우 temporal candidate를 candidate list에 포함하지 않을 수 있다.In addition, according to an embodiment of the present invention, when CPR is used, a candidate list configuration may be different. For example, when CPR is used, temporal candidates may not be included in the candidate list.

또한 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 주변에서 참조한 motion information을 scaling하지 않을 수 있다.In addition, according to an embodiment of the present invention, when CPR is used, motion information referred to in the vicinity may not be scaled.

도 14는 본 발명의 일 실시예에 따른 spatial neighboring candidate 참조 방법을 나타낸 도면이다.14 is a diagram illustrating a method for referencing a spatial neighboring candidate according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 현재 block이 CPR을 사용하는 경우 candidate list 구성 방법이 CPR을 사용하지 않는 경우와 다를 수 있다. 예를 들어 현재 block이 CPR을 사용하는 경우 spatial neighboring candidate 추가 방법이 CPR을 사용하지 않는 경우와 다를 수 있다. 예를 들어 현재 block이 CPR을 사용하는 경우 CPR의 reference block이 위치할 수 있는 범위를 넘어서는 위치의 motion information을 참조하지 않을 수 있다. 또는 현재 block이 CPR을 사용하는 경우 CPR의 reference block이 위치할 수 있는 범위를 기초로 하는 범위를 넘어서는 위치의 motion information을 참조하지 않을 수 있다. 상기 CPR의 reference block이 위치할 수 있는 범위는 현재 block이 속한 CTU 범위일 수 있다. 따라서 본 발명의 일 실시예를 따르면 현재 CTU를 넘어서는 위치로부터 motion information을 참조하지 않을 수 있다. 예를 들면 현재 block이 reference block이 위치할 수 있는 범위 boundary와 접하여 있는 경우 기설정된 spatial neighbor 위치가 reference block이 위치할 수 있는 범위를 벗어날 수 있다. 특히 도 12의 기설정된 spatial neighbor 위치를 참조하면 현재 block이 reference block이 위치할 수 범위의 top boundary 또는 left boundary에 접하여 있는 경우 다수의 기설정된 spatial neighbor 위치가 reference block이 위치할 수 있는 범위를 벗어날 수 있다.According to an embodiment of the present invention, when a current block uses CPR, a method of constructing a candidate list may be different from a case where CPR is not used. For example, when the current block uses CPR, the method of adding a spatial neighboring candidate may be different from the case where CPR is not used. For example, if the current block uses CPR, it may not refer to motion information of a position beyond the range in which the reference block of CPR can be located. Alternatively, when the current block uses CPR, motion information of a position beyond the range based on the range in which the reference block of CPR can be located may not be referred. The range in which the reference block of the CPR can be located may be a CTU range to which the current block belongs. Therefore, according to an embodiment of the present invention, motion information may not be referenced from a position beyond the current CTU. For example, if the current block is in contact with a boundary boundary in which a reference block can be located, a preset spatial neighbor position may be outside the range in which a reference block can be located. In particular, referring to the preset spatial neighbor location of FIG. 12, when the current block is in contact with the top boundary or the left boundary within the range in which the reference block can be located, a number of preset spatial neighbor locations are outside the range in which the reference block can be located. I can.

도 14를 참조하면 CTU 안쪽으로 reference block 위치가 제한될 수 있다. 일 실시예를 따르면 reference block이 위치할 수 있는 범위를 벗어나는 위치로부터의 motion information을 참조하지 않을 수 있다. 예를 들어 현재 block이 reference block이 가질 수 있는 범위의 boundary에 위치한 경우 기설정된 spatial neighbor 위치가 reference block이 위치할 수 있는 범위를 벗어나는 일이 발생할 수 있다. 도 14에서 current block 주변에 기설정된 spatial neighbor를 작은 점선 사각형으로 표시하였다. 이때 CTU를 벗어나는 위치는 사용 가능하지 않은 것으로 판단할 수 있다.Referring to FIG. 14, a position of a reference block inside the CTU may be limited. According to an embodiment, motion information from a position outside the range in which the reference block can be located may not be referred. For example, when the current block is located in a boundary within a range that a reference block can have, a preset spatial neighbor location may be out of a range where the reference block can be located. In FIG. 14, a predetermined spatial neighbor around the current block is indicated by a small dotted rectangle. At this time, it may be determined that the location outside the CTU is not usable.

이것은 reference block이 위치할 수 있는 범위를 넘어서는 위치를 참조하면 그 위치의 motion information은 현재 block의 reference block이나 참조한 위치의 reference block이 제한된 범위를 넘게 하지 않기 위해서는 가질 수 있는 motion information의 범위가 좁기 때문이다. 예를 들어 도 14의 경우에서 not available이라고 표시한 부분의 reference block도 그것이 속한 CTU를 넘기 않아야 한다. 또한 not available이라고 표시한 부분의 motion information이 가리키는 위치가 현재 block의 reference block이 위치할 수 있는 범위를 벗어나지 않기 위해서는 도 14의 경우 참조하는 부분의 motion information의 y 성분이 0이어야 한다. 현재 block이 left boundary에 접한 경우에는 boundary를 벗어나는 참조하는 부분의 motion information의 x 성분이 0이어야 한다. 또한 x 성분 또는 y 성분이 0이고 나머지 성분은 0이 아닌 상황에서도 기설정된 코딩 순서 상 한 성분의 부호가 어느 하나(예를 들면 minus)인 것만이 유효하거나 그 부호가 아닌 다른 부호일 때 MVD를 크게 만들 확률이 높을 수 있다.This is because the range of motion information that can be possessed is narrow so that the reference block of the current block or the reference block of the referenced position does not exceed the limited range when a reference block refers to a position beyond the range. to be. For example, in the case of FIG. 14, the reference block of the part marked as not available should not exceed the CTU to which it belongs. In addition, in order that the position indicated by the motion information of the part marked as not available does not exceed the range in which the reference block of the current block can be located, the y component of the motion information of the referenced part should be 0. If the current block is in contact with the left boundary, the x component of motion information of the referenced part outside the boundary must be 0. In addition, even in a situation where the x component or y component is 0 and the remaining components are not 0, only the sign of one component (e.g. minus) in the preset coding order is valid, or when the sign is other than the code, MVD is calculated. It can be more likely to make it bigger.

Reference block이 현재 CTU 안쪽으로 제한되는 경우로 추가 설명하면, CTU 안쪽만 reference block으로 사용하기 때문에 MV 간의 연관성이 별로 없을 수 있다. 또한 만약 merge mode와 같이 MVD 보정이 불가한 경우, CTU 밖의 MV가 x, y 성분 모두 있는 경우에 현재 block이나 주변 block의 reference block은 CTU 범위를 넘게 된다. 예를 들어 현재 block이 CTU 위 경계에 있는 경우 위쪽 block MV의 y 성분이 있는 경우 현재 block이나 주변 block이 CTU 범위를 넘게 된다.If the reference block is further described as being limited to the inside of the current CTU, since only the inside of the CTU is used as a reference block, there may be little correlation between the MVs. Also, if MVD correction is not possible, such as in merge mode, when MVs outside the CTU have both x and y components, the current block or the reference block of the neighboring block exceeds the CTU range. For example, if the current block is on the upper boundary of the CTU, if there is a y component of the upper block MV, the current block or neighboring blocks exceed the CTU range.

Slice 전체가 CPR이 되므로 주변 block도 intra 또는 CPR을 사용했을 수 있다.Since the entire slice becomes CPR, the surrounding block may also have used intra or CPR.

만약 tile 경계에 있는 경우(혹은 CPR아닌 slice 있는 경우) 주변이 CPR 아닌 inter일 수도 있는데 그 경우에는 주변 MV는 먼 곳을 가리켜서 CTU 벗어날 수 있다. 또 이 주변 MV는 다른 picture를 가리키므로 연관성이 적을 것이다.If there is a tile boundary (or there is a slice other than CPR), the surrounding may be inter, not CPR. In that case, the surrounding MV may point to a distant place and deviate from the CTU. Also, since the surrounding MV points to different pictures, there will be little correlation.

따라서 본 발명의 일 실시예를 따르면 CPR을 사용하는 현재 block이 참조하는 spatial neighbor 위치가 CPR을 사용한 경우에만 motion information을 참조하는 것이 가능하다. 또는 CPR을 사용하는 현재 block이 참조하는 spatial neighbor 위치가 CPR을 사용하지 않은 경우 그로부터 motion information을 참조하지 않는 것이 가능하다.Therefore, according to an embodiment of the present invention, it is possible to refer to motion information only when a spatial neighbor location referred to by a current block using CPR uses CPR. Alternatively, if the spatial neighbor location referenced by the current block using CPR does not use CPR, it is possible not to refer to motion information therefrom.

또다른 실시예를 따르면 spatial neighbor 위치의 motion information을 현재 block에 해당하는 reference block이 가질 수 있는 범위로 clipping하여 참조할 수 있다.According to another embodiment, motion information of a spatial neighbor location may be referenced by clipping into a range that a reference block corresponding to a current block may have.

도 14의 실시예와 같이 가능한 spatial neighbor 위치를 줄이는 경우 전체 candidate 개수를 줄이는 것이 가능하다. 이러한 경우 candidate index 시그날링을 줄이는 것이 가능하다. 예를 들어 기설정된 위치의 spatial neighboring candidate와 zero motion vector가 candidate list에 추가될 수 있거나 i) 기설정된 위치의 spatial neighboring candidate, ii) 제한된 개수의 HMVP candidate 또는 pairwise average candidate, iii) zero motion vector가 candidate list에 추가될 수 있는 경우에 가능한 spatial neighbor 위치가 줄어들면 가능한 candidate 개수가 줄 수 있다. 그러한 경우 candidate index의 max 값을 줄여서 index를 binarization 했을 때 bit 수를 줄일 수 있다.As in the embodiment of FIG. 14, when reducing possible spatial neighbor locations, it is possible to reduce the total number of candidates. In this case, it is possible to reduce candidate index signaling. For example, a spatial neighboring candidate and a zero motion vector of a preset location can be added to the candidate list, or i) a spatial neighboring candidate of a preset location, ii) a limited number of HMVP candidates or pairwise average candidates, iii) a zero motion vector. In the case that it can be added to the candidate list, if possible spatial neighbor locations are reduced, the number of possible candidates can be reduced. In such a case, the number of bits can be reduced when the index is binarized by reducing the max value of the candidate index.

또는 도 14의 실시예와 같이 가능한 spatial neighbor 위치를 줄이는 경우 spatial neighboring candidate 이후에 추가될 수 있는 candidate가 candidate list에서 더 앞에 추가될 수 있게 함으로써 상기 spatial neighboring candidate 이후에 추가될 수 있는 candidate를 사용할 때 candidate index에 해당하는 bit 수를 줄일 수 있다.Or, when reducing the possible spatial neighbor location as in the embodiment of FIG. 14, when using a candidate that can be added after the spatial neighboring candidate by allowing a candidate that can be added after the spatial neighboring candidate to be added earlier in the candidate list. The number of bits corresponding to the candidate index can be reduced.

도 15는 본 발명의 일 실시예에 따른 block 위치와 motion candidate list 구성을 나타낸 도면이다.15 is a diagram showing a block position and a motion candidate list configuration according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 기설정된 위치에서 motion information을 참조하는 것으로 가능한 candidate 개수가 적을 수 있다. 예를 들면 도 14에서 설명한 상황에 따르면 가능한 spatial neighbor 위치가 줄어들 수 있다. 예를 들어 현재 block이 reference block이 가질 수 있는 범위의 top boundary 또는 left boundary에 접하여 존재하는 경우 가능한 candidate 개수가 적을 수 있다. 이러한 경우 디코더 및 인코더에서 해당 spatial neighbor를 참조하여 사용 가능한지 여부를 파악하지 않더라도(예를 들어 해당 spatial neighbor 위치가 intra prediction을 사용했는지 inter prediction을 사용했는지 파악하지 않더라도) 해당 spatial neighbor에 해당하는 candidate는 없다고 판단할 수 있다. 또한 이러한 경우 candidate list에서 zero MV가 들어가는 위치를 앞으로 당길 수 있다.According to an embodiment of the present invention, the number of possible candidates may be small by referring to motion information at a preset location. For example, according to the situation described in FIG. 14, possible spatial neighbor locations may be reduced. For example, if the current block exists in contact with the top boundary or the left boundary of the range that the reference block can have, the number of possible candidates may be small. In this case, even if the decoder and encoder do not refer to the corresponding spatial neighbor to determine whether it is available (for example, whether the corresponding spatial neighbor location uses intra prediction or inter prediction), the candidate corresponding to the corresponding spatial neighbor is It can be determined that there is no. Also, in this case, the position where the zero MV enters in the candidate list can be pulled forward.

따라서 본 발명의 일 실시예를 따르면 candidate index를 통해 그것이 zero MV를 가리키는지 판단할 수 있는 경우가 있을 수 있다. 예를 들어 spatial neighbor 위치 중 일부가 현재 block 위치 및 neighbor로 참조할 수 있는 범위에 따라 제외되는 경우, 나머지로 가능한 모든 candidate 개수 이상의 index이면 zero motion vector일 수 있다. 예를 들어 spatial neighboring candidate 다음에 zero motion vector가 추가되는 경우에 가능한 spatial neighboring candidate 개수 이상의 index이면 zero motion vector라고 판단할 수 있다. 예를 들어 spatial neighbor 위치 중 일부가 현재 block 위치 및 neighbor로 참조할 수 있는 범위에 따라 제외되는 경우 남은 spatial neighbor 위치가 M개 일 때 0부터 시작하는 index 값이 M이면 spatial neighboring candidate 다음으로 추가되는 candidate임을 판단할 수 있고, spatial neighboring candidate 다음으로 zero MV가 오는 경우 zero MV임을 판단할 수 있다.Therefore, according to an embodiment of the present invention, there may be a case where it is possible to determine whether it indicates a zero MV through a candidate index. For example, when some of the spatial neighbor locations are excluded according to the current block location and a range that can be referred to as neighbors, an index that is greater than or equal to all possible candidates may be a zero motion vector. For example, when a zero motion vector is added after the spatial neighboring candidate, it may be determined as a zero motion vector if the index is greater than the number of possible spatial neighboring candidates. For example, if some of the spatial neighbor locations are excluded according to the current block location and the range that can be referred to as a neighbor, if the remaining spatial neighbor locations are M and the index value starting from 0 is M, then the spatial neighboring candidate is added. It can be determined that it is a candidate, and when a zero MV comes after the spatial neighboring candidate, it can be determined that it is a zero MV.

예를 들어 도 15에서 A라고 표시한 block의 경우와 같이 현재 block이 reference block이 위치할 수 있는 범위의 left boundary에 접한 경우가 있을 수 있다. 이러한 경우 도 14에서 설명한 것과 같이 reference block이 위치할 수 있는 범위를 벗어나는 곳의 motion information을 참조하지 않으면 현재 block의 above 위치가 사용 불가하게 된다. 따라서 above 위치를 제외한 위치만 사용 가능하다. 또는 이러한 경우 도 14에서 설명한 것과 같이 reference block이 위치할 수 있는 범위를 벗어나는 곳의 motion information을 참조하지 않으면 도 12에서 설명한 A0, A1, B2 위치가 사용 불가하게 된다. 따라서 B0와 B1만 사용 가능하다. 일 실시예로 merge mode인 경우 B0, B1을 모두 사용 가능한 것이 가능하고, AMVP mode인 경우 B0, B1 중 하나만 사용 가능한 것이 가능하다. 따라서 merge mode인 경우 0부터 index가 2이면 spatial neighboring candidate 다음으로 오는 candidate임을 판단할 수 있다. 또한 AMVP mode인 경우 0부터 index가 1이면 spatial neighboring candidate 다음으로 오는 candidate임을 판단할 수 있다. 즉 spatial neighboring candidate 다음으로 zero MV가 오는 경우에 index에 의해 zero MV임을 판단할 수 있다.For example, as in the case of the block marked A in FIG. 15, there may be a case in which the current block contacts the left boundary of the range in which the reference block can be located. In this case, as described with reference to FIG. 14, if motion information outside the range in which the reference block can be located is not referenced, the above position of the current block is unavailable. Therefore, only positions other than the above position can be used. Alternatively, in this case, as described in FIG. 14, if motion information outside the range in which the reference block can be located is not referred to, the positions A0, A1, and B2 described in FIG. 12 are not available. Therefore, only B0 and B1 can be used. In an embodiment, in the merge mode, both B0 and B1 may be used, and in the AMVP mode, only one of B0 and B1 may be used. Therefore, in the case of merge mode, if the index is 2 from 0, it can be determined that the candidate is the next candidate after the spatial neighboring candidate. In addition, in the case of AMVP mode, if the index is 1 from 0, it can be determined that it is a candidate that comes after the spatial neighboring candidate. That is, when zero MV comes next to the spatial neighboring candidate, it can be determined that it is zero MV by index.

또한 도 15에서 B라고 표시한 block의 경우와 같이 현재 block이 reference block이 위치할 수 있는 범위의 top boundary에 접한 경우가 있을 수 있다. 이러한 경우 도 14에서 설명한 것과 같이 reference block이 위치할 수 있는 범위를 벗어나는 곳의 motion information을 참조하지 않으면 현재 block의 left 위치가 사용 불가하게 된다. 따라서 현재 block의 left 위치를 제외한 위치만 사용 가능하다. 또는 이러한 경우 도 14에서 설명한 것과 같이 reference block이 위치할 수 있는 범위를 벗어나는 곳의 motion information을 참조하지 않으면 도 12에서 설명한 B0, B1, B2 위치가 사용 불가하게 된다. 따라서 A0와 A1만 사용 가능하다. 일 실시예로 merge mode인 경우 A0, A1을 모두 사용 가능한 것이 가능하고, AMVP mode인 경우 A0, A1 중 하나만 사용 가능한 것이 가능하다. 따라서 merge mode인 경우 0부터 index가 2이면 spatial neighboring candidate 다음으로 오는 candidate임을 판단할 수 있다. 또한 AMVP mode인 경우 0부터 index가 1이면 spatial neighboring candidate 다음으로 오는 candidate임을 판단할 수 있다. 즉 spatial neighboring candidate 다음으로 zero MV가 오는 경우에 index에 의해 zero MV임을 판단할 수 있다.In addition, there may be a case in which the current block touches the top boundary of the range in which the reference block can be located, as in the case of the block marked B in FIG. 15. In this case, as described with reference to FIG. 14, if motion information outside the range in which the reference block can be located is not referenced, the left position of the current block is unavailable. Therefore, only the positions other than the left position of the current block can be used. Alternatively, in this case, as described with reference to FIG. 14, the positions B0, B1, and B2 described in FIG. 12 cannot be used unless motion information outside the range in which the reference block can be located is referred. Therefore, only A0 and A1 can be used. In an embodiment, in the merge mode, both A0 and A1 can be used, and in the AMVP mode, only one of A0 and A1 can be used. Therefore, in the case of merge mode, if the index is 2 from 0, it can be determined that the candidate is the next candidate after the spatial neighboring candidate. In addition, in the case of AMVP mode, if the index is 1 from 0, it can be determined that it is a candidate that comes after the spatial neighboring candidate. That is, when zero MV comes next to the spatial neighboring candidate, it can be determined that it is zero MV by index.

도 15를 참조하면 현재 CTU 범위로 reference block 위치가 제한되고 현재 CTU를 벗어나는 위치의 motion information을 참조하지 않는 경우의 AMVP candidate list 구성을 나타내고 있다. 현재 block이 도 15의 A 또는 B와 같이 CTU left boundary 또는 top boundary에 접해있는 경우 spatial neighboring candidate 개수가 maximum 1개 가능하고 나머지 candidate는 zero MV로 채울 수 있다. 따라서 candidate index가 1인 경우에는 MVP가 zero MV라고 판단할 수 있다.Referring to FIG. 15, the configuration of an AMVP candidate list when a reference block location is limited to a current CTU range and motion information of a location outside the current CTU is not referenced. When the current block is in contact with the CTU left boundary or top boundary as shown in A or B of FIG. 15, the maximum number of spatial neighboring candidates is possible and the remaining candidates can be filled with zero MV. Therefore, when the candidate index is 1, it can be determined that the MVP is zero MV.

본 발명의 일 실시예를 따르면 candidate index를 통해 zero MV를 가리키는 것을 판단하면 도 18 내지 도 22에서 설명할 실시예 등을 수행하는 것이 가능하다. 예를 들면 MVD coding에 변화를 줄 수 있다. 예를 들면 특정 경우에 MVD component의 부호를 시그날링 전송 및 syntax parsing 없이 결정하는 것이 가능하다.According to an embodiment of the present invention, if it is determined that the zero MV is indicated through the candidate index, the embodiments described in FIGS. 18 to 22 may be performed. For example, MVD coding can be changed. For example, in a specific case, it is possible to determine the code of the MVD component without signaling transmission and syntax parsing.

도 16은 본 발명의 일 실시예에 따른 block 위치와 motion candidate list 구성을 나타낸 도면이다.16 is a diagram showing a block position and a motion candidate list configuration according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 picture를 벗어나는 위치의 motion information을 참조할 수 없을 수 있다. 이것은 CPR을 사용하는 경우와 CPR을 사용하지 않는 경우를 모두 포함할 수 있다.According to an embodiment of the present invention, it may not be possible to refer to motion information of a position out of a picture. This can include both the case of using CPR and the case of not using CPR.

본 발명의 일 실시예에 따르면 CPR에서 reference block이 가질 수 있는 위치는 picture 안쪽일 수 있다. 또는 본 발명의 일 실시예에 따르면 CPR에서 reference block이 가질 수 있는 위치는 picture 안쪽을 포함하는 영역일 수 있다.According to an embodiment of the present invention, a position that a reference block may have in CPR may be inside a picture. Alternatively, according to an embodiment of the present invention, a location that a reference block may have in CPR may be an area including an inside of a picture.

도 16을 참조하면 현재 block이 picture boundary에 접한 경우 spatial neighbor 위치가 제한될 수 있다. Picture를 벗어나는 위치의 motion information을 참조할 수 없기 때문일 수 있다. 예를 들어 현재 block이 picture의 left boundary에 접한 경우(도 16에서 A로 표시한 block의 경우) 현재 block의 left 위치를 참조할 수 없다. 또한 현재 block이 picture의 top boundary에 접한 경우(도 16에서 B로 표시한 block의 경우) 현재 block의 above 위치를 참조할 수 없다.Referring to FIG. 16, when a current block contacts a picture boundary, a spatial neighbor location may be limited. This may be because motion information of a location outside the picture cannot be referenced. For example, when the current block touches the left boundary of the picture (in the case of the block indicated by A in FIG. 16), the left position of the current block cannot be referenced. In addition, when the current block touches the top boundary of the picture (in the case of the block indicated by B in FIG. 16), the above position of the current block cannot be referenced.

따라서 이러한 경우 binarization의 maximum value를 줄이거나 zero MV임을 판단하는 것이 가능하다.Therefore, in this case, it is possible to reduce the maximum value of binarization or determine that it is zero MV.

앞서 설명한 것처럼 만약 CPR을 사용하는 경우 temporal candidate, scaled candidate 등을 사용하지 않을 수 있다.As described above, if CPR is used, temporal candidate, scaled candidate, etc. may not be used.

먼저 CPR을 사용하고 AMVP mode를 사용하는 경우에 대해 보면 본 실시예와 같이 현재 block이 picture boundary에 인접한 경우 가능한 spatial neighbor 위치가 제한될 수 있다. 특히 left boundary 또는 top boundary에 인접한 경우 각각 현재 block의 left 위치들과 현재 block의 above 위치들의 motion information을 참조할 수 없게 된다. 따라서 AMVP candidate list 구성할 때 사용 가능한 spatial candidate는 maximum 1개가 될 수 있다. 만약 candidate index(maximum candidate 개수가 2인 경우 flag일 수도 있다.)가 나타내는 값이 1인 경우(candidate index가 0부터 시작하는 경우) 그 candidate index에 해당하는 motion vector는 zero motion vector인 것으로 판단할 수 있다.First, referring to the case of using CPR and using the AMVP mode, possible spatial neighbor locations may be limited when the current block is adjacent to the picture boundary as in the present embodiment. In particular, when adjacent to the left boundary or the top boundary, motion information of the left positions of the current block and the above positions of the current block cannot be referenced. Therefore, when constructing the AMVP candidate list, the available spatial candidate can be maximum 1. If the value indicated by the candidate index (may be a flag when the maximum number of candidates is 2) is 1 (when the candidate index starts from 0), the motion vector corresponding to the candidate index is determined to be a zero motion vector. I can.

Merge mode를 사용하는 경우에 대해 보면 본 실시예와 같이 현재 block이 picture boundary에 인접한 경우 가능한 spatial neighbor 위치가 제한될 수 있다. 특히 left boundary 또는 top boundary에 인접한 경우 각각 현재 block의 left 위치들과 현재 block의 above 위치들의 motion information을 참조할 수 없게 된다. 따라서 도 12의 실시예를 따른다면 참조 가능한 위치는 maximum 2개일 수 있다. 따라서 merge candidate index가 참조 가능한 maximum 개수 이상인 경우에 해당하는 motion vector는 spatial neighboring candidate로부터 온 것이 아니라고 판단할 수 있다.In the case of using the merge mode, when the current block is adjacent to the picture boundary as in the present embodiment, possible spatial neighbor locations may be limited. In particular, when adjacent to the left boundary or the top boundary, motion information of the left positions of the current block and the above positions of the current block cannot be referenced. Therefore, according to the embodiment of FIG. 12, the maximum number of positions that can be referred to may be two. Therefore, it can be determined that the motion vector corresponding to the case where the merge candidate index is greater than or equal to the referenceable maximum number is not from the spatial neighboring candidate.

만약 CPR을 사용하는 merge mode에서 spatial neighboring candidate와 zero MV만을 사용하는 경우에는 위와 같은 경우 zero MV인 것을 candidate index를 통해서 판단할 수 있다. 그러나 CPR merge mode에서 zero MV는 의미가 없을 수 있으므로 (가능한 spatial neighboring candidate 개수 - 1)로 variable length인 candidate index의 maximum value를 설정할 수 있다. 이렇게 되면 어떤 index 값의 bit 수를 줄일 수 있다.If only the spatial neighboring candidate and zero MV are used in the merge mode using CPR, in the above case, the zero MV can be determined through the candidate index. However, in CPR merge mode, since zero MV may not be meaningful, the maximum value of the candidate index, which is a variable length, can be set with (the number of possible spatial neighboring candidates-1). In this way, the number of bits of a certain index value can be reduced.

다른 실시예로 CPR을 사용하는 merge mode에서 spatial neighboring candidate, HMVP candidate, pairwise average candidate 등을 candidate list에 포함할 수 있다. 이때 만약 위에서 설명한 실시예와 같이 spatial neighboring candidate의 가능한 최대 개수가 제한된다면 가능한 pairwise average candidate 개수도 줄어들 수 있다. Spatial neighboring candidate의 조합이 줄어들 수 있기 때문이다. 만약 도 12 및 도 16과 같은 실시예에서 가능한 spatial neighboring candidate 위치가 2개가 된다면 가능한 pairwise average candidate 개수는 1개가 될 수 있다. 또한 HMVP에서 history를 저장하는 공간이 reset되는 기설정된 부분이 있을 수 있다. 예를 들면 CTU row마다 HMVP에서 history를 저장하는 공간이 reset될 수 있다. 이것은 parallel processing을 용이하게 하기 위함일 수 있다. Encoder 및 decoder는 동일한 history를 유지할 수 있어야하기 때문이다. 따라서 HMVP에서 history를 저장하는 공간이 reset되는 기설정된 부분에서는 HMVP candidate를 candidate list에 추가할 수 없게 된다. 만약 CPR을 사용하고 spatial neighbor 위치가 제한되는 경우에 HMVP에서 history를 저장하는 공간이 reset되면 가능한 최대 candidate 개수가 더 줄어들 수 있다. 예를 들어 picture의 left boundary에서 spatial neighbor 위치가 최대 2개로 제한될 수 있고, CTU row의 시작 부분에서 HMVP에서 history를 저장하는 공간이 reset될 수 있다. 이 경우 candidate list에 최대 2개의 spatial neighboring candidates가 포함될 수 있고, HMVP candidate는 포함될 수 있다. 만약 pairwise average candidate를 추가할 수 있는 경우라도 pairwise average를 만들 때 1개의 조합 밖에 나오지 않는다. 따라서 pairwise average candidate를 추가할 수 있는 경우 candidate가 최대 3개와 zero motion vector일 수 있다. 만약 pairwise average candidate를 추가할 수 없는 실시예에서는 candidate가 최대 2개와 zero motion vector일 수 있다. 이에 따라 candidate index의 maximum value를 기존보다 줄일 수 있고, index의 bit 수를 줄이는 것이 가능하다.In another embodiment, in a merge mode using CPR, spatial neighboring candidate, HMVP candidate, pairwise average candidate, etc. may be included in the candidate list. In this case, if the maximum possible number of spatial neighboring candidates is limited as in the above-described embodiment, the number of possible pairwise average candidates may also be reduced. This is because the combination of spatial neighboring candidates can be reduced. If there are two possible spatial neighboring candidate positions in the embodiment as shown in FIGS. 12 and 16, the number of possible pairwise average candidates may be one. In addition, there may be a preset part where the space for storing history in HMVP is reset. For example, the space for storing history in HMVP can be reset for each CTU row. This may be to facilitate parallel processing. This is because the encoder and decoder must be able to maintain the same history. Therefore, the HMVP candidate cannot be added to the candidate list in the preset part where the space for storing history in HMVP is reset. If CPR is used and the spatial neighbor location is limited, if the space for storing history in HMVP is reset, the maximum number of possible candidates may be further reduced. For example, spatial neighbor positions in the left boundary of a picture may be limited to a maximum of two, and a space storing history in HMVP may be reset at the beginning of a CTU row. In this case, up to two spatial neighboring candidates may be included in the candidate list, and HMVP candidates may be included. Even if a pairwise average candidate can be added, only one combination appears when creating a pairwise average. Therefore, when pairwise average candidates can be added, there can be a maximum of 3 candidates and a zero motion vector. If the pairwise average candidate cannot be added, there may be a maximum of two candidates and a zero motion vector. Accordingly, it is possible to reduce the maximum value of the candidate index than before and to reduce the number of bits of the index.

또다른 실시예로 CPR을 사용하는 경우 pairwise average candidate를 사용하지 않는 것이 가능하다. CPR을 사용하는 경우에는 CPR을 사용하지 않는 경우에 비해 유용한 motion vector가 제한적일 수 있기 때문이다.In another embodiment, when CPR is used, it is possible not to use a pairwise average candidate. This is because, when CPR is used, a useful motion vector may be limited compared to when CPR is not used.

또다른 실시예로 현재 block이 picture의 left boundary에 인접한 경우 HMVP candidate를 사용하지 않을 수 있다. 또는 현재 block이 HMVP의 history가 reset되는 boundary에 인접한 경우(예를 들어 reset되는 위치와 현재 block left-top의 x 좌표가 동일한 경우) HMVP candidate를 사용하지 않을 수 있다. 만약 CTU row의 시작에서 HMVP의 history를 저장하는 공간이 reset 되는 경우 picture 가장 왼쪽의 CTU를 코딩할 때는 history에 motion information이 다양하지 않을 수 있다. 따라서 picture left boundary에 인접한 block의 경우에 motion vector의 x 성분은 0이나 plus여야 한다. 또한 이 시점에서 history에 저장된 motion vector 방향은 제한적이어서 left boundary에 인접한 block이 활용하기 어려울 수 있다. 따라서 현재 block이 picture left boundary에 인접한 경우 HMVP candidate를 사용하지 않을 수 있다. 이 경우 위의 실시예와 조합하면 picture의 left boundary에 인접한 block의 경우 merge candidate list에 최대 2개의 spatial neighboring candidate와 최대 1개의 pairwise average candidate 및 zero MV를 추가하는 것이 가능하다. 따라서 zero MV를 추가할 수 있는 경우 index의 최대값을 3(index가 0부터 시작하는 경우), zero MV를 추가할 수 없는 경우 index의 최대값을 2(index가 0부터 시작하는 경우)로 binarization할 수 있다.In another embodiment, when the current block is adjacent to the left boundary of the picture, the HMVP candidate may not be used. Alternatively, when the current block is adjacent to the boundary where the HMVP history is reset (for example, when the reset position and the x coordinate of the current block left-top are the same), the HMVP candidate may not be used. If the space for storing HMVP history is reset at the beginning of the CTU row, motion information may not vary in history when coding the CTU at the far left of the picture. Therefore, in the case of a block adjacent to the picture left boundary, the x component of the motion vector must be 0 or plus. Also, at this point, the direction of the motion vector stored in the history is limited, so it may be difficult to utilize the block adjacent to the left boundary. Therefore, when the current block is adjacent to the picture left boundary, the HMVP candidate may not be used. In this case, when combined with the above embodiment, it is possible to add up to two spatial neighboring candidates, up to one pairwise average candidate, and zero MV to the merge candidate list for blocks adjacent to the left boundary of the picture. Therefore, if zero MV can be added, the maximum value of the index is 3 (when the index starts from 0), and if zero MV cannot be added, the maximum value of the index is binarized to 2 (when the index starts from 0). can do.

본 발명의 일 실시예를 따르면 현재 block이 picture의 left, right, top, bottom boundary에 인접하다는 것을 현재 block의 좌표, 현재 block의 width, 현재 block의 height, 현재 picture의 width, 현재 picture의 height 등에 기초하여 판단 가능하다. 현재 block의 top-left 좌표를 (x0, y0)라고 할 수 있다. 현재 block의 width, height를 각각 cbWidth, cbHeight라고 할 수 있다. 현재 picture의 width, height를 각각 picWidth, picHeight라고 할 수 있다. 만약 (x0 == 0)이 true인 경우 picture left boundary에 인접한 것일 수 있다. 만약 ((x0 + cbWidth) == picWidth)가 true인 경우 picture right boundary에 인접한 것일 수 있다. 만약 (y0 == 0)이 true인 경우 picture top boundary에 인접한 것일 수 있다. 만약 ((y0 + cbHeight) == picHeight)가 true인 경우 picture bottom boundary에 인접한 것일 수 있다.According to an embodiment of the present invention, it is determined that the current block is adjacent to the left, right, top, and bottom boundary of the picture, such as coordinates of the current block, width of the current block, height of the current block, width of the current picture, height of the current picture, etc. It can be judged on the basis of. The top-left coordinates of the current block can be called (x0, y0). The width and height of the current block can be called cbWidth and cbHeight, respectively. The width and height of the current picture can be called picWidth and picHeight, respectively. If (x0 == 0) is true, it may be adjacent to the picture left boundary. If ((x0 + cbWidth) == picWidth) is true, it may be adjacent to the picture right boundary. If (y0 == 0) is true, it may be adjacent to the picture top boundary. If ((y0 + cbHeight) == picHeight) is true, it may be adjacent to the picture bottom boundary.

CPR을 사용하는 경우로 설명하였으나 CPR을 사용하지 않더라도 temporal motion vector를 사용할 수 없는 경우 또는 주변 block의 reference picture와 현재 block의 reference picture가 일치하는 경우 위와 같은 동작을 수행하는 것이 가능하다.Although described as the case of using CPR, it is possible to perform the above operation when the temporal motion vector cannot be used even if CPR is not used, or when the reference picture of the neighboring block and the reference picture of the current block match.

도 17은 본 발명의 일 실시예에 따른 spatial neighboring candidate 사용을 나타낸 도면이다.17 is a diagram showing the use of a spatial neighboring candidate according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 spatial neighbor 위치를 사용할 수 없는 경우가 있을 수 있다. 만약 기설정된 위치가 intra prediction을 한 경우에 해당 위치로부터 motion information을 참조할 수 없을 수 있다. 따라서 본 발명의 일 실시예를 따르면 기설정된 spatial neighbor 위치들이 intra prediction을 사용했는지 여부에 따라 가능한 spatial neighboring candidate 개수를 줄일 수 있다. 또는 기설정된 spatial neighbor 위치들이 참조할 수 있는 inter prediction을 사용했는지 여부에 따라 가능한 spatial neighboring candidate 개수를 줄일 수 있다. 예를 들어 기설정된 spatial neighbor 위치들이 CPR을 사용하는 inter prediction을 사용했는지 여부에 따라 가능한 spatial neighboring candidate 개수를 줄일 수 있다.According to an embodiment of the present invention, there may be a case where a spatial neighbor location cannot be used. If a preset location performs intra prediction, motion information may not be referenced from the location. Accordingly, according to an embodiment of the present invention, the number of possible spatial neighboring candidates can be reduced according to whether or not predetermined spatial neighboring positions have used intra prediction. Alternatively, the number of possible spatial neighboring candidates may be reduced according to whether inter prediction that preset spatial neighbor locations can refer to is used. For example, the number of possible spatial neighboring candidates can be reduced depending on whether pre-set spatial neighboring locations have used inter prediction using CPR.

예를 들어 AMVP mode인 경우 spatial neighbor 위치 중 left 위치들이 모두 intra prediction 했거나 above 위치들이 모두 intra prediction 한 경우(picture를 벗어나는 부분이나 decoding되지 않은 위치는 제외하고 생각 할 수 있다.)가 있을 수 있다. 또는 AMVP mode인 경우 spatial neighbor 위치 중 left 위치들이 모두 참조할 수 있는 inter prediction을 하지 않았거나 above 위치들이 모두 참조할 수 있는 inter prediction 하지 않은 경우(picture를 벗어나는 부분이나 decoding되지 않은 위치는 제외하고 생각 할 수 있다.)가 있을 수 있다. 즉, left 위치 모두 혹은 above 위치 모두가 motion information 참조가 불가한 경우가 있을 수 있다. 이러한 경우 left 위치 혹은 above 위치 중 하나만 참조 가능한 경우 가능한 spatial neighboring candidate 개수는 1개이고, index가 1인 경우 zero MV인 것을 판단 할 수 있다. 또는 left 위치와 above 위치 모두 참조 불가한 경우(예를 들어 도 17에 나타낸 것처럼 기설정된 위치가 모두 intra prediction을 수행한 경우) 가능한 spatial neighboring candidate 개수는 0개이고, index가 0인 경우 zero MV인 것을 판단 할 수 있다. 혹은 left 위치와 above 위치 모두 참조 불가한 경우(예를 들어 도 17에 나타낸 것처럼 기설정된 위치가 모두 intra prediction을 수행한 경우) 가능한 spatial neighboring candidate 개수는 0개이고, index 전송 및 parsing을 생략할 수 있다. 그리고 index를 0, zero MV로 infer할 수 있다.For example, in the AMVP mode, there may be cases in which all left positions among spatial neighboring positions are intra-predicted, or all above positions are intra-predicted (except for parts outside the picture or undecoded positions). Or, in the case of AMVP mode, if inter prediction that all left positions among spatial neighbors can refer to, or not inter prediction that all of the above positions can refer to (except for parts outside the picture or not decoded) There may be.) That is, there may be a case where motion information cannot be referenced in all of the left positions or all of the above positions. In this case, when only one of the left position or the above position can be referenced, the number of possible spatial neighboring candidates is 1, and when the index is 1, it can be determined that it is zero MV. Alternatively, when both the left and above positions cannot be referenced (for example, when all preset positions are performed intra prediction as shown in FIG. 17), the number of possible spatial neighboring candidates is 0, and when the index is 0, it is determined that it is zero MV. I can judge. Alternatively, when neither the left position nor the above position is referenced (for example, when all preset positions are performed intra prediction as shown in FIG. 17), the number of possible spatial neighboring candidates is 0, and index transmission and parsing may be omitted. . And you can infer the index to 0, zero MV.

또다른 예로 기설정된 spatial neighbor 위치 중 motion information을 참조할 수 없는 경우에는 syntax parsing 단계에서 그 위치를 제외키시고, maximum candidate 개수에 변화를 주는 것이 가능하다. Motion information을 참조할 수 없는 경우는 해당 위치가 intra prediction을 사용한 경우를 포함할 수 있다. 또는 motion information을 참조할 수 없는 경우는 해당 위치가 picture를 벗어나거나 코딩 순서 상 decoding되지 않은 경우를 포함할 수 있다.As another example, when motion information among preset spatial neighbor locations cannot be referenced, it is possible to exclude the location in the syntax parsing step and change the number of maximum candidates. The case where motion information cannot be referred may include a case in which the corresponding position uses intra prediction. Alternatively, the case where motion information cannot be referenced may include a case where a corresponding position deviates from a picture or is not decoded due to coding order.

만약 merge mode에서 기설정된 위치에서 모두 motion information을 참조할 수 없는 경우를 가정하면 candidate list에 spatial neighboring candidate를 추가할 수 없을 수 있다. 따라서 HMVP candidate, pairwise average candidate 등을 candidate로 사용하는 것이 가능할 수 있다. 이때 현재 block이 앞 도면에서 설명한 HMVP의 history를 저장하는 공간을 reset하는 위치에 있다면 HMVP candidate 또한 추가할 수 없을 수 있다. 또한 pairwise average candidate가 HMVP candidate보다 앞에 오거나 HMVP candidate를 추가할 수 없는 경우에는 pairwise average candidate 또한 나올 수 없을 수 있다. 따라서 zero MV만 가능한 candidate로서 남을 수 있다. 그러나 CPR에서 zero MV가 의미 없을 수 있다. 이러한 경우에 merge mode임을 나타내는 시그날링을 생략(전송 및 parsing 생략)할 수 있다. 그리고 merge mode를 사용하지 않는 것으로 infer할 수 있다. 예를 들면 merge mode임을 나타내는 시그날링은 merge_flag일 수 있다. 따라서 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 현재 block 주변의 기설정된 spatial neighbor 위치들이 모두 사용 불가하고(해당 위치가 picture를 벗어난 경우, 해당 위치가 intra prediction을 한 경우, 해당 위치가 CPR을 사용하지 않은 경우 등을 포함할 수 있다.), 현재 block이 HMVP의 history를 저장하는 공간이 reset되는 위치인 경우에 merge mode임을 나타내는 시그날링을 생략하고 merge mode를 사용하지 않는 것으로 infer할 수 있다. HMVP의 history를 저장하는 공간이 reset되는 위치는 CTU row가 시작되는 위치 혹은 HMVP candidate를 사용하지 않기로 기설정된 위치 등일 수 있다.If it is assumed that motion information cannot be referenced at all preset positions in merge mode, a spatial neighboring candidate may not be added to the candidate list. Therefore, it may be possible to use HMVP candidate, pairwise average candidate, etc. as candidates. At this time, if the current block is in a position to reset the space for storing the history of HMVP described in the previous figure, the HMVP candidate may not be added as well. In addition, if the pairwise average candidate precedes the HMVP candidate or if the HMVP candidate cannot be added, the pairwise average candidate may also not appear. Therefore, only zero MV can remain as a possible candidate. However, zero MV may be meaningless in CPR. In this case, signaling indicating merge mode may be omitted (transmission and parsing omitted). And you can infer by not using the merge mode. For example, the signaling indicating the merge mode may be merge_flag. Accordingly, according to an embodiment of the present invention, when CPR is used, all preset spatial neighbor locations around the current block are not available (if the location is out of the picture, the location is intra prediction, the location is CPR). If the current block is a location where the HMVP history storage space is reset, the signaling indicating merge mode can be omitted and inferred to not using the merge mode. have. The location where the space for storing HMVP history is reset may be a location where the CTU row starts or a location previously set not to use the HMVP candidate.

또다른 예로 기설정된 spatial neighbor 위치 중 1개를 제외하고 motion information을 참조할 수 없는 경우가 있을 수 있다. Motion information을 참조할 수 없는 경우는 해당 위치가 picture를 벗어난 경우, 해당 위치가 intra prediction을 한 경우, 해당 위치가 CPR을 사용하지 않은 경우 등을 포함할 수 있다. 이 경우에도 앞 실시예와 같이 spatial neighboring candidate 1개 외에 다른 candidate가 추가되지 않으면 pairwise average candidate를 만들 수 없을 수 있다. 또한 HMVP의 history를 저장하는 곳이 reset되는 부분이어서 HMVP candidate를 포함할 수 없을 수 있다. 따라서 이러한 위치에서 candidate index의 maximum value를 기존과 다르게 하여 binarization할 수 있다. 예를 들어 기설정된 spatial neighbor 위치 중 1개를 제외하고 나머지 위치에서는 모두 motion information을 참조할 수 없고, HMVP의 history를 저장하는 공간을 reset하는 부분에서는 spatial neighboring candidate가 최대 1개, HMVP candidate가 최대 0개, pairwise average candidate가 최대 0개 만들어질 수 있다. 따라서 zero MV를 candidate에 추가할 수 있는 실시예에서는 1 bit의 flag로 candidate index 시그날링이 가능하다. 하지만 이 경우 candidate index를 전송하고 parsing하는 것을 생락하고 0으로 infer하는 것이 가능하다. CPR에서 zero MV가 의미가 없을 수 있기 때문이다. 또한 zero MV를 candidate에 추가할 수 없는 실시예에서는 가능한 candidate 1개 뿐일 수 있고, 이 경우 candidate index를 전송하고 parsing하는 것을 생락하고 0으로 infer하는 것이 가능하다.As another example, there may be a case where motion information cannot be referenced except for one of the preset spatial neighbor locations. The case where motion information cannot be referred may include a case where a corresponding position deviates from a picture, a case where the corresponding position performs intra prediction, a case where the corresponding position does not use CPR, and the like. Even in this case, as in the previous embodiment, if other candidates other than one spatial neighboring candidate are not added, it may not be possible to create a pairwise average candidate. Also, the HMVP candidate may not be included because the location where the HMVP history is stored is reset. Therefore, binarization can be performed by changing the maximum value of the candidate index at this location. For example, motion information cannot be referenced in all other locations except for one of the preset spatial neighbor locations, and in the part that resets the space for storing HMVP history, there is a maximum of 1 spatial neighboring candidate and the maximum number of HMVP candidates. 0, pairwise average candidates can be made up to 0. Therefore, in an embodiment in which zero MV can be added to the candidate, candidate index signaling is possible with a flag of 1 bit. However, in this case, it is possible to skip transmitting and parsing the candidate index and infer to 0. This is because zero MV may be meaningless in CPR. In addition, in an embodiment in which zero MV cannot be added to a candidate, there may be only one possible candidate, and in this case, it is possible to skip transmitting and parsing the candidate index and infer to 0.

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

본 발명의 일 실시예에 따르면 코딩 순서에 따라 motion vector가 가질 수 있는 값이 제한될 수 있다. 또한 이것은 CPR을 사용하는 경우일 수 있다. 예를 들어 코딩 순서에 따라 motion vector가 오른쪽 아래 방향을 가리키지 않을 수 있다. 현재 block을 기준으로 오른쪽이나 아래에 있는 block은 block 코딩 순서를 따르면 decoding이 되지 않았기 때문이다. 따라서 본 발명의 일 실시예를 따르면 CPR을 사용할 때 motion vector의 x성분이 0이상이고, 동시에 y성분이 0이상이지 않을 수 있다. 즉 CPR을 사용할 때 motion vector는 (x성분 >=0 && y성분 >= 0) 이지 않을 수 있다.According to an embodiment of the present invention, a value that a motion vector can have may be limited according to a coding order. Also, this may be the case using CPR. For example, the motion vector may not point in the lower right direction depending on the coding order. This is because the block on the right or below the current block is not decoded according to the block coding order. Therefore, according to an embodiment of the present invention, when using CPR, the x component of the motion vector may be 0 or more and the y component may not be 0 or more. That is, when using CPR, the motion vector may not be (x component >= 0 && y component >= 0).

또한 도 14 내지 도 17에서 설명한 실시예들을 따르면 MVP가 zero MV인 경우가 있을 수 있다. 특히 MVP가 zero MV인 것은 syntax parsing 단계에서 알 수 있는 경우가 있다. 이러한 경우에는 motion vector difference(MVD)가 오른쪽 아래 방향을 가리키지 않을 수 있다. 즉 MVD는 (x성분 >=0 && y성분 >= 0) 이지 않을 수 있다. 또다른 실시예로 MV는 (x성분 > -(현재 block width) && y성분 > (-현재 block height)) 이지 않을 수 있다. 즉, zero MV를 MVP로 사용하는 경우에 MVD는 (x성분 > -(현재 block width) && y성분 > (-현재 block height)) 이지 않을 수 있다. 따라서 본 발명의 일 실시예를 따르면 MV 또는 MVD의 x성분 값에 따라 y성분 값의 범위를 한정할 수 있는 경우가 있을 수 있다.In addition, according to the embodiments described with reference to FIGS. 14 to 17, there may be a case where the MVP is zero MV. Particularly, the fact that MVP is zero MV can be known at the syntax parsing step. In this case, the motion vector difference (MVD) may not point in the lower right direction. That is, the MVD may not be (x component >= 0 && y component >= 0). In another embodiment, the MV may not be (x component> -(current block width) && y component> (-current block height)). That is, when zero MV is used as MVP, the MVD may not be (x component> -(current block width) && y component> (-current block height)). Accordingly, according to an embodiment of the present invention, there may be a case in which the range of the y component value can be limited according to the x component value of the MV or MVD.

일 실시예를 따르면 MVD의 성분을 나누어서 코딩할 수 있다. 예를 들면 도 9에서 설명한 것과 같이 MVD를 코딩할 수 있다. 예를 들면 성분1과 성분2를 나누어서 코딩할 수 있다. 또한 예를 들면 성분1, 성분2의 순서대로 코딩할 수 있다. 일 실시예로 성분1과 성분2는 각각 x-component, y-component일 수 있다. 아래 실시예들은 MVP가 zero MV인 경우일 수 있다.According to an embodiment, the components of the MVD may be divided and coded. For example, the MVD can be coded as described in FIG. 9. For example, component 1 and component 2 can be divided and coded. In addition, for example, component 1 and component 2 can be coded in order. In an embodiment, component 1 and component 2 may be x-component and y-component, respectively. The following embodiments may be a case where the MVP is zero MV.

본 발명의 일 실시예를 따르면 성분1이 0보다 크면 성분2는 0보다 작을 수 있다. 더 구체적으로 성분1이 0보다 크면 성분2의 절대값은 minimum block size 이상일 수 있다. 또한 성분1이 0보다 크면 성분2의 절대값은 현재 block height 이상일 수 있다.According to an embodiment of the present invention, if component 1 is greater than 0, component 2 may be less than 0. More specifically, if component 1 is greater than 0, the absolute value of component 2 may be greater than or equal to the minimum block size. Also, if component 1 is greater than 0, the absolute value of component 2 may be higher than the current block height.

본 발명의 일 실시예를 따르면 성분1이 0이면 성분2는 0이 아닐 수 있다. 또한 성분1이 0이면 성분2는 0보다 작을 수 있다. 더 구체적으로 성분1이 0이면 성분2의 절대값은 minimum block size 이상일 수 있다. 또한 성분1이 0이면 성분2의 절대값은 현재 block height 이상일 수 있다.According to an embodiment of the present invention, if component 1 is 0, component 2 may not be 0. Also, if component 1 is 0, component 2 may be smaller than 0. More specifically, if component 1 is 0, the absolute value of component 2 may be greater than or equal to the minimum block size. Also, if component 1 is 0, the absolute value of component 2 may be higher than the current block height.

본 발명의 일 실시예를 따르면 성분1이 0보다 작고 절대값이 minimum block size보다 작을 때 성분2는 0이 아닐 수 있다. 또한 이 경우 성분2는 0보다 작을 수 있다. 더 구체적으로 이 경우 성분2의 절대값은 minimum block size 이상일 수 있다. 또한 이 경우 성분2의 절대값은 현재 block height 이상일 수 있다.According to an embodiment of the present invention, when component 1 is less than 0 and an absolute value is less than minimum block size, component 2 may not be 0. Also, in this case, component 2 may be less than 0. More specifically, in this case, the absolute value of component 2 may be greater than or equal to the minimum block size. Also, in this case, the absolute value of component 2 may be greater than or equal to the current block height.

본 발명의 일 실시예를 따르면 성분1이 0보다 작고 절대값이 현재 block width보다 작을 때 성분2는 0이 아닐 수 있다. 또한 이 경우 성분2는 0보다 작을 수 있다. 더 구체적으로 이 경우 성분2의 절대값은 minimum block size 이상일 수 있다. 또한 이 경우 성분2의 절대값은 현재 block height 이상일 수 있다.According to an embodiment of the present invention, when component 1 is less than 0 and the absolute value is less than the current block width, component 2 may not be 0. Also, in this case, component 2 may be less than 0. More specifically, in this case, the absolute value of component 2 may be greater than or equal to the minimum block size. Also, in this case, the absolute value of component 2 may be greater than or equal to the current block height.

도 18을 참조하면 현재 block에서 MV의 x-component 값이 도면에 나타낸 것과 같을 수 있다. 그 경우 CPR의 reference block은 도 18에서 음영으로 표시한 영역에 들어오도록 할 수 있다. 따라서 y-component가 가질 수 있는 값의 범위를 한정할 수 있다. 즉, x-component 값에 따라 y-component의 값을 한정하는 것이 가능하다.Referring to FIG. 18, the x-component value of MV in the current block may be the same as that shown in the drawing. In that case, the reference block of CPR may be made to enter the area indicated by the shade in FIG. 18. Therefore, the range of values that the y-component can have can be limited. That is, it is possible to limit the value of the y-component according to the value of the x-component.

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

도 9에서 설명한 것처럼 MVD를 x-component, y-component로 나누어서 코딩할 수 있다 .도 19를 참조하면 [ 0 ], [ 1 ]에 해당하는 값은 각각 x-component, y-component일 수 있다. 또한 abs_mvd_greater0_flag는 해당 component의 절대값이 0보다 큰지 아닌지를 나타내는 flag일 수 있다. 또한 abs_mvd_greater1_flag는 해당 component의 절대값이 1보다 큰지 아닌지를 나타내는 flag일 수 있다. 또한 abs_mvd_minus2는 해당 component의 절대값에서 2를 뺀 값일 수 있다. 또한 mvd_sign_flag는 해당 component의 sign을 나타내는 flag일 수 있다. 또한 mvd_sign_flag 0 값이 plus, 1 값이 minus를 지시할 수 있다.As described in FIG. 9, the MVD may be divided into x-component and y-component and coded. Referring to FIG. 19, values corresponding to [0] and [1] may be x-component and y-component, respectively. Also, abs_mvd_greater0_flag may be a flag indicating whether the absolute value of the corresponding component is greater than 0. Also, abs_mvd_greater1_flag may be a flag indicating whether the absolute value of the corresponding component is greater than 1 or not. Also, abs_mvd_minus2 may be a value obtained by subtracting 2 from the absolute value of the corresponding component. Also, mvd_sign_flag may be a flag indicating a sign of a corresponding component. In addition, a value of mvd_sign_flag 0 may indicate plus and a value of 1 may indicate minus.

도 18에서 설명한 실시예들을 도 19의 MVD coding syntax에 반영할 수 있다.The embodiments described in FIG. 18 may be reflected in the MVD coding syntax of FIG. 19.

도 19에서 “zeroMVP” 조건은 MVP가 zero MV인 경우를 나타낼 수 있고, CPR을 사용하는 경우를 나타낼 수 있다. 즉, MVP가 zero MV이고, CPR을 사용하는 경우에 zeroMVP가 true일 수 있다. MVP가 zero MV인 조건은 도 14 내지 도 17에서 설명한 실시예를 따를 수 있다. 앞 실시예들을 따르면 MVP가 zero MV인 것은 현재 block의 위치 또는 candidate index에 기초할 수 있다.In FIG. 19, the “zeroMVP” condition may indicate a case where MVP is zero MV and may indicate a case of using CPR. That is, when MVP is zero MV and CPR is used, zeroMVP may be true. The condition in which the MVP is zero MV may follow the embodiments described in FIGS. 14 to 17. According to the previous embodiments, that the MVP is zero MV may be based on the location of the current block or the candidate index.

본 발명의 일 실시예를 따르면 zeroMVP인 경우 x-component가 0이면 y-component는 0이 아닐 수 있다. 따라서 이 경우에 abs_mvd_greater0_flag[ 1 ]를 parsing하지 않을 수 있다. 또한 이 경우 abs_mvd_greater0_flag[ 1 ]를 0이 아닌 것을 나타내는 값으로 infer할 수 있다. 또한 이 경우 abs_mvd_greater0_flag[ 1 ]를 1로 infer할 수 있다.According to an embodiment of the present invention, in the case of zeroMVP, if x-component is 0, y-component may not be 0. Therefore, in this case, abs_mvd_greater0_flag[ 1] may not be parsed. Also, in this case, abs_mvd_greater0_flag[1] can be inferred to a value indicating non-zero. Also, in this case, abs_mvd_greater0_flag[ 1] can be inferred to 1.

본 발명의 일 실시예를 따르면 zeroMVP인 경우 x-component가 0이면 y-component의 절대값은 1보다 클 수 있다. 이것은 현재 block height가 1보다 크기 때문일 수 있다. 따라서 이 경우 abs_mvd_greater1_flag[ 1 ]를 parsing하지 않을 수 있다. 또한 이 경우 abs_mvd_greater1_flag[ 1 ]를 절대값이 1보다 큰 것을 나타내는 값으로 infer할 수 있다. 또한 이 경우 abs_mvd_greater1_flag[ 1 ]를 1로 infer할 수 있다. CPR이 있기 전 기존 MVD coding에서는 abs_mvd_greater1_flag가 존재하지 않을 때 0으로 infer 했기 때문에 본 실시예와 결합하면 abs_mvd_greater1_flag 가 존재하지 않을 때 infer 하는 값이 조건에 따라 나뉠 수 있다. 예를 들어 abs_mvd_greater1_flag[compIdx]가 존재하지 않을 때 abs_mvd_greater0_flag[compIdx]이 0이면 0으로 infer하고, abs_mvd_greater1_flag[compIdx]가 1이면 1로 infer할 수 있다. 또는 예를 들어 abs_mvd_greater1_flag[compIdx]가 존재하지 않을 때 abs_mvd_greater0_flag[compIdx]이 0이면 0으로 infer할 수 있다. 또는 abs_mvd_greater1_flag[compIdx]가 존재하지 않을 때 zeroMVP이고 abs_mvd_greater0_flag[!compIdx]가 0이면 1로 infer할 수 있다According to an embodiment of the present invention, in the case of zeroMVP, if the x-component is 0, the absolute value of the y-component may be greater than 1. This may be because the current block height is greater than 1. Therefore, in this case, abs_mvd_greater1_flag[ 1] may not be parsed. Also, in this case, abs_mvd_greater1_flag[ 1] may be inferred to a value indicating that the absolute value is greater than 1. Also, in this case, abs_mvd_greater1_flag[ 1] can be inferred to 1. In the existing MVD coding before CPR, since abs_mvd_greater1_flag inferred to 0 when abs_mvd_greater1_flag does not exist, when combined with this embodiment, the infering value when abs_mvd_greater1_flag does not exist can be divided according to conditions. For example, when abs_mvd_greater1_flag[compIdx] does not exist, if abs_mvd_greater0_flag[compIdx] is 0, it can infer to 0, and if abs_mvd_greater1_flag[compIdx] is 1, it can infer to 1. Or, for example, when abs_mvd_greater1_flag[compIdx] does not exist, if abs_mvd_greater0_flag[compIdx] is 0, it may be inferred to 0. Or, if abs_mvd_greater1_flag[compIdx] does not exist and abs_mvd_greater0_flag[!compIdx] is 0, it can be inferred to 1.

본 발명의 일 실시예를 따르면 zeroMVP인 경우 x-component가 양수이거나 0이면 y-component는 음수일 수 있다. 따라서 이 경우 y-component의 mvd_sign_flag를 parsing하지 않을 수 있다. 또한 이 경우 mvd_sign_flag를 음수를 지시하는 값으로 infer할 수 있다. 이 경우 mvd_sign_flag를 1로 infer 할 수 있다. 따라서 zeroMVP이고 mvd_sign_flag[0]이 0인 경우 mvd_sign_flag[1]을 parsing하지 않고, 1로 infer 할 수 있다. 또한 zeroMVP이고 abs_mvd_greater0_flag[0]이 0인 경우 mvd_sign_flag[1]을 parsing하지 않고, 1로 infer 할 수 있다.According to an embodiment of the present invention, in the case of zeroMVP, if x-component is positive or 0, y-component may be negative. Therefore, in this case, the mvd_sign_flag of the y-component may not be parsed. Also, in this case, mvd_sign_flag may be inferred to a value indicating a negative number. In this case, mvd_sign_flag can be inferred to 1. Therefore, if it is zeroMVP and mvd_sign_flag[0] is 0, mvd_sign_flag[1] can be inferred to 1 without parsing. In addition, if it is zeroMVP and abs_mvd_greater0_flag[0] is 0, mvd_sign_flag[1] can be inferred to 1 without parsing.

또한 CPR이 있기 전 기존에 mvd_sign_flag가 존재하지 않는 경우 0으로 infer했을 수 있다. 그러나 기존에 mvd_sign_flag가 존재하지 않는 경우는(도 9의 실시예 참조) 해당 component 절대값이 0인 경우 밖에 없었을 수 있다. 따라서 본 발명의 실시예와 결합하여 mvd_sign_flag가 존재하지 않는 경우 1로 infer하는 것으로 통일할 수 있다. 또다른 실시예로는 조건에 따라 mvd_sign_flag infer하는 값을 달리할 수 있다. 예를 들어 zeroMVP && (mvd_sign_flag[0] == 0 || abs_mvd_greater0_flag[ 0 ] == 0) 인 경우 1로 infer 하고, 그렇지 않은 경우 0으로 infer할 수 있다.Also, if mvd_sign_flag does not exist before CPR, it may have inferred to 0. However, when mvd_sign_flag does not exist in the past (refer to the embodiment of FIG. 9), there may be only a case where the absolute value of the corresponding component is 0. Therefore, in combination with the embodiment of the present invention, if mvd_sign_flag does not exist, it can be unified by infering to 1. In another embodiment, the value of mvd_sign_flag infer may be different according to conditions. For example, in case of zeroMVP && (mvd_sign_flag[0] == 0 || abs_mvd_greater0_flag[ 0] == 0), it can infer to 1, otherwise it can infer to 0.

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

본 발명의 일 실시예에 따르면 reference block가 위치할 수 있는 범위에 따라 motion vector가 가질 수 있는 값이 제한될 수 있다. 또한 이것은 CPR을 사용하는 경우일 수 있다. 예를 들어 reference block이 위치할 수 있는 범위를 벗어나지 않도록 motion vector가 설정될 수 있다.According to an embodiment of the present invention, a value that a motion vector can have may be limited according to a range in which a reference block can be located. Also, this may be the case using CPR. For example, a motion vector may be set so as not to deviate from a range in which a reference block can be located.

예를 들어 현재 block이 reference block이 위치할 수 있는 범위의 boundary에 인접한 경우 motion vector는 인접한 boundary의 반대 방향일 수 있다. 즉, 현재 block이 reference block이 위치할 수 있는 범위의 left boundary 또는 right boundary에 인접한 경우, x-component는 각각 0 이상, 0 이하일 수 있다. 또한 현재 block이 reference block이 위치할 수 있는 범위의 top boundary 또는 bottom boundary에 인접한 경우, y-component는 각각 0 이상, 0 이하일 수 있다. 또한 일 실시예로 reference block이 위치할 수 있는 범위는 현재 block이 속한 CTU 범위일 수 있다.For example, when the current block is adjacent to a boundary within a range in which the reference block can be located, the motion vector may be in the opposite direction of the adjacent boundary. That is, when the current block is adjacent to the left boundary or the right boundary of the range in which the reference block can be located, the x-component may be 0 or more and 0 or less, respectively. In addition, when the current block is adjacent to the top boundary or the bottom boundary within the range where the reference block can be located, the y-component may be 0 or more and 0 or less, respectively. In addition, according to an embodiment, the range in which the reference block can be located may be the CTU range to which the current block belongs.

또한 도 14 내지 도 17에서 설명한 실시예들을 따르면 MVP가 zero MV인 경우가 있을 수 있다. 특히 MVP가 zero MV인 것은 syntax parsing 단계에서 알 수 있는 경우가 있다. 이러한 경우 motion vector에 관한 위의 설명이 MVD에 적용될 수 있다.In addition, according to the embodiments described with reference to FIGS. 14 to 17, there may be a case where the MVP is zero MV. Particularly, the fact that MVP is zero MV can be known at the syntax parsing step. In this case, the above description of the motion vector can be applied to MVD.

도 20을 참조하면 CPR의 reference block이 가질 수 있는 위치가 현재 block이 속한 CTU 내로 한정될 수 있다. 이 경우 현재 block이 A에 표시한 위치와 같이 left boundary에 인접한 경우, motion vector의 x-component는 0 이상일 수 있다. 또한 현재 block이 B에 표시한 위치와 같이 top boundary에 인접한 경우, motion vector의 y-component는 0 이상일 수 있다.Referring to FIG. 20, a position that a reference block of CPR may have may be limited within a CTU to which a current block belongs. In this case, when the current block is adjacent to the left boundary as indicated by A, the x-component of the motion vector may be 0 or more. In addition, when the current block is adjacent to the top boundary such as the position indicated by B, the y-component of the motion vector may be 0 or more.

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

도 9에서 설명한 것처럼 MVD를 x-component, y-component로 나누어서 코딩할 수 있다 .도 21을 참조하면 [ 0 ], [ 1 ]에 해당하는 값은 각각 x-component, y-component일 수 있다. 또한 abs_mvd_greater0_flag는 해당 component의 절대값이 0보다 큰지 아닌지를 나타내는 flag일 수 있다. 또한 abs_mvd_greater1_flag는 해당 component의 절대값이 1보다 큰지 아닌지를 나타내는 flag일 수 있다. 또한 abs_mvd_minus2는 해당 component의 절대값에서 2를 뺀 값일 수 있다. 또한 mvd_sign_flag는 해당 component의 sign을 나타내는 flag일 수 있다. 또한 mvd_sign_flag 0 값이 plus, 1 값이 minus를 지시할 수 있다.As described in FIG. 9, the MVD may be divided into x-component and y-component and coded. Referring to FIG. 21, values corresponding to [0] and [1] may be x-component and y-component, respectively. Also, abs_mvd_greater0_flag may be a flag indicating whether the absolute value of the corresponding component is greater than 0. Also, abs_mvd_greater1_flag may be a flag indicating whether the absolute value of the corresponding component is greater than 1 or not. Also, abs_mvd_minus2 may be a value obtained by subtracting 2 from the absolute value of the corresponding component. Also, mvd_sign_flag may be a flag indicating a sign of a corresponding component. In addition, a value of mvd_sign_flag 0 may indicate plus and a value of 1 may indicate minus.

도 20에서 설명한 실시예들을 도 21의 MVD coding syntax에 반영할 수 있다.The embodiments described in FIG. 20 may be applied to the MVD coding syntax of FIG. 21.

도 21에서 “zeroMVP” 조건은 MVP가 zero MV인 경우를 나타낼 수 있고, CPR을 사용하는 경우를 나타낼 수 있다. 즉, MVP가 zero MV이고, CPR을 사용하는 경우에 zeroMVP가 true일 수 있다. MVP가 zero MV인 조건은 도 14 내지 도 17에서 설명한 실시예를 따를 수 있다. 앞 실시예들을 따르면 MVP가 zero MV인 것은 현재 block의 위치 또는 candidate index에 기초할 수 있다.In FIG. 21, the “zeroMVP” condition may indicate a case in which MVP is zero MV, and may indicate a case in which CPR is used. That is, when MVP is zero MV and CPR is used, zeroMVP may be true. The condition in which the MVP is zero MV may follow the embodiments described in FIGS. 14 to 17. According to the previous embodiments, that the MVP is zero MV may be based on the location of the current block or the candidate index.

도 21을 참조하면 left, right, top, bottom boundary에 인접한 것을 나타내는 조건을 각각 left_boundary, right_boundary, top_boundary, bottom_boundary로 나타내었다. 또한 boundary에 인접한 것은 현재 block의 좌표, 현재 block의 width, 현재 block의 height, reference block의 위치로 가능한 범위의 width, reference block의 위치로 가능한 범위의 height 등에 기초하여 판단할 수 있다. 예를 들어 현재 block의 top-left 좌표를 (x0, y0)로 나타낼 수 있다. 또한 현재 block의 width 및 height를 각각 cbWidth, cbHeight로 나타낼 수 있다. 또한 reference block의 위치로 가능한 범위의 width 및 height를 각각 rWidth, rHeight로 나타낼 수 있다. 예를 들어 (x0 % rWidth == 0)이 true면 left boundary에 인접한 것일 수 있다. ((x0 + cbWidth) % rWidth == 0)이 true이면 right boundary에 인접한 것일 수 있다. (y0 % rHeight == 0)이 true면 top boundary에 인접한 것일 수 있다. ((y0 + cbHeight) % rHeight == 0)이 true이면 bottom boundary에 인접한 것일 수 있다. 또한 일 실시예를 따르면 rWidth, rHeight는 CTU(CTB) width, height일 수 있다.Referring to FIG. 21, conditions indicating neighboring left, right, top, and bottom boundaries are represented as left_boundary, right_boundary, top_boundary, and bottom_boundary, respectively. Also, what is adjacent to the boundary can be determined based on the coordinates of the current block, the width of the current block, the height of the current block, the width of the range possible as the position of the reference block, and the height of the range possible as the position of the reference block. For example, the top-left coordinates of the current block can be expressed as (x0, y0). In addition, the width and height of the current block can be expressed as cbWidth and cbHeight, respectively. In addition, the width and height of the range possible as the location of the reference block can be expressed as rWidth and rHeight, respectively. For example, if (x0% rWidth == 0) is true, it may be adjacent to the left boundary. If ((x0 + cbWidth)% rWidth == 0) is true, it may be adjacent to the right boundary. If (y0% rHeight == 0) is true, it may be adjacent to the top boundary. If ((y0 + cbHeight)% rHeight == 0) is true, it may be adjacent to the bottom boundary. In addition, according to an embodiment, rWidth and rHeight may be CTU(CTB) width and height.

도 20에서 설명한 것처럼 zeroMVP이고 boundary에 인접한 경우 MVD의 sign이 결정될 수 있는 경우가 있다. 예를 들어 zeroMVP이고 left_boundary인 경우 mvd_sign_flag[0]을 parsing하지 않을 수 있고, plus를 나타내는 값(예를 들면 0)으로 infer할 수 있다.As described in FIG. 20, there is a case where the sign of the MVD can be determined when it is zeroMVP and is adjacent to the boundary. For example, in the case of zeroMVP and left_boundary, mvd_sign_flag[0] may not be parsed, and may be inferred to a value indicating plus (eg 0).

또한 zeroMVP이고 right_boundary인 경우 mvd_sign_flag[0]을 parsing하지 않을 수 있고, minus를 나타내는 값(예를 들면 1)으로 infer할 수 있다.In addition, in the case of zeroMVP and right_boundary, mvd_sign_flag[0] may not be parsed, and may be inferred to a value indicating minus (eg 1).

또한 zeroMVP이고 top_boundary인 경우 mvd_sign_flag[1]을 parsing하지 않을 수 있고, plus를 나타내는 값(예를 들면 0)으로 infer할 수 있다.In addition, in the case of zeroMVP and top_boundary, mvd_sign_flag[1] may not be parsed, and may be inferred to a value indicating plus (eg, 0).

또한 zeroMVP이고 bottom_boundary인 경우 mvd_sign_flag[1]을 parsing하지 않을 수 있고, minus를 나타내는 값(예를 들면 1)으로 infer할 수 있다.In addition, in the case of zeroMVP and bottom_boundary, mvd_sign_flag[1] may not be parsed and may be inferred to a value representing minus (eg 1).

또한 도 9, 도 19, 도 21에서는 abs_mvd_greater0_flag, abs_mvd_greater1_flag, abs_mvd_minus2, mvd_sign_flag 순서대로 코딩하는데 이 순서가 달라짐에 따라 다른 실시예를 수행하는 것도 가능하다. 현재 block 위치, zeroMVP 여부, reference block이 위치할 수 있는 범위, 이미 알고 있는 다른 syntax 값 등에 기초하여 어떤 syntax를 parsing하지 않고 infer할 수 있다.In addition, in FIGS. 9, 19, and 21, abs_mvd_greater0_flag, abs_mvd_greater1_flag, abs_mvd_minus2, mvd_sign_flag are coded in this order. As the order is changed, other embodiments may be performed. It is possible to infer any syntax without parsing based on the current block position, whether zeroMVP, the range in which the reference block can be located, and other syntax values that are already known.

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

도 22를 참조하면 도 18 내지 도 21에서 설명한 실시예들을 결합하여 수행할 수 있다. 이에 따라 mvd_coding에 필요한 bit 수를 줄일 수 있다.Referring to FIG. 22, the embodiments described in FIGS. 18 to 21 may be combined. Accordingly, the number of bits required for mvd_coding can be reduced.

또한 본 발명의 일 실시예를 따르면 zeroMVP인 경우 어떤 component의 MVD의 절대값이 결정되고 나면 MVD 값이 가능한 범위를 넘는 reference block을 나타내지 않도록 MVD의 sign을 parsing 없이 결정하는 것이 가능하다. 예를 들어 도 9, 도 19, 도 21의 실시예와 같이 MVD의 sign을 결정하기 전에 절대값을 결정할 수 있는 경우가 있다. 만약 어떤 component의 |MVD|가 가능한 범위를 넘어서는 경우 sign을 minus로 결정할 수 있다. 또한 만약 어떤 component의 -|MVD|가 가능한 범위를 넘어서는 경우 sign을 plus로 결정할 수 있다.In addition, according to an embodiment of the present invention, in the case of zeroMVP, after the absolute value of the MVD of a component is determined, it is possible to determine the sign of the MVD without parsing so that the MVD value does not indicate a reference block exceeding the possible range. For example, as in the embodiments of FIGS. 9, 19, and 21, the absolute value may be determined before determining the sign of the MVD. If |MVD| of a component exceeds the possible range, the sign can be determined as minus. Also, if -|MVD| of a component exceeds the possible range, the sign can be determined as plus.

도 23은 본 발명의 일 실시예에 따른 block과 크기를 나타낸 도면이다.23 is a diagram showing a block and a size according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 현재 block의 width 또는 height가 maximum width 또는 maximum height인 경우가 있을 수 있다. 이러한 경우 기설정된 spatial neighbor 위치에서 motion information를 참조할 수 없을 수 있다. 이것은 코딩 순서에 따른 것일 수 있다. 예를 들어 현재 block의 width가 maximum width인 경우 현재 block의 right 위치로부터는 motion information을 참조할 수 없을 수 있다. 도 12의 실시예와 같은 경우 B0로부터 motion information을 참조할 수 없을 수 있다. 또다른 예로 현재 block의 height가 maximum height인 경우 현재 block의 bottom 위치로부터는 motion information을 참조할 수 없ㅇ르 수 있다. 도 12의 실시예와 같은 경우 A0로부터 motion information을 참조할 수 없을 수 있다.According to an embodiment of the present invention, there may be a case where the width or height of the current block is the maximum width or the maximum height. In this case, motion information may not be referenced at a preset spatial neighbor location. This may be according to the coding order. For example, if the width of the current block is the maximum width, motion information may not be referenced from the right position of the current block. In the case of the embodiment of FIG. 12, motion information may not be referenced from B0. As another example, when the height of the current block is the maximum height, motion information may not be referenced from the bottom position of the current block. In the case of the embodiment of FIG. 12, it may not be possible to refer to motion information from A0.

만약 도 23의 실시예를 도 14의 실시예와 결합하면 motion information을 참조할 수 있는 spatial neighbor 위치를 1개로 줄일 수 있다. 예를 들어 left boundary에 인접하고 maximum width인 경우 도 12의 A0, A1, B0, B2로부터 motion information을 참조할 수 없을 수 있다. 또한 top boundary에 인접하고 maximum height인 경우 A0, B0, B1, B2로부터 motion information을 참조할 수 없을 수 있다. 따라서 이와 같은 경우 가능한 spatial neighbor 위치가 줄어들게 되므로 앞선 실시예들과 같이 zero MV를 판단하거나 candidate index parsing을 생략하거나 candidate index의 maximum value를 작게 binarization하는 등의 실시예를 수행하는 것이 가능하다.If the embodiment of FIG. 23 is combined with the embodiment of FIG. 14, the number of spatial neighbor locations that can refer to motion information can be reduced to one. For example, when it is adjacent to the left boundary and has a maximum width, motion information may not be referenced from A0, A1, B0, and B2 of FIG. 12. Also, if it is adjacent to the top boundary and has a maximum height, motion information from A0, B0, B1, and B2 may not be referenced. Therefore, in this case, possible spatial neighbor locations are reduced, and thus it is possible to perform embodiments such as determining zero MV, omitting candidate index parsing, or binarizing the maximum value of the candidate index, as in the previous embodiments.

도 24는 본 발명의 일 실시예에 따른 merge candidate list 구성을 나타낸 도면이다.24 is a diagram showing the configuration of a merge candidate list according to an embodiment of the present invention.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 merge candidate list 구성 방법은 CPR을 사용하지 않는 경우와 다를 수 있다. 예를 들어 CPR을 사용하지 않는 경우 merge candidate list에 추가될 수 있는 candidate 중 일부가 CPR을 사용하는 경우에는 merge candidate list에 추가될 수 없을 수 있다.According to an embodiment of the present invention, when CPR is used, a method of configuring a merge candidate list may be different from that of not using CPR. For example, if CPR is not used and some of the candidates that can be added to the merge candidate list use CPR, they may not be added to the merge candidate list.

일 실시예로 CPR을 사용하는 경우에 zero MV를 사용하지 않을 수 있다. 현재 picture 내에서 zero MV가 나타내는 reference block은 현재 block이 될 수 있기 때문이다.In an embodiment, when CPR is used, zero MV may not be used. This is because the reference block indicated by the zero MV in the current picture can be the current block.

일 실시예로 CPR을 사용하는 경우에 temporal MV(collocated MV)를 사용하지 않을 수 있다. CPR을 사용하는 경우 현재 picture가 아닌 picture을 참조할 수 없을 수 있기 때문이다.In an embodiment, when CPR is used, temporal MV (collocated MV) may not be used. This is because when using CPR, a picture other than the current picture may not be referenced.

일 실시예로 CPR을 사용하는 경우에 HMVP candidate 또는 pairwise average candidate를 사용하지 않을 수 있다. 이 경우 앞선 도면들의 실시예에서 설명한 것과 같이 index 시그날링에 변화를 주는 것이 가능하다.In an embodiment, when CPR is used, the HMVP candidate or the pairwise average candidate may not be used. In this case, it is possible to change the index signaling as described in the embodiments of the preceding drawings.

일 실시예로 CPR을 사용하는 경우에 HMVP candidate 또는 pairwise average candidate을 기초로 한 candidate를 사용하는 것이 가능하다.As an embodiment, when using CPR, it is possible to use a candidate based on an HMVP candidate or a pairwise average candidate.

일 실시예로 CPR을 사용하는 경우 subblock merge mode를 사용하지 않을 수 있다. Subblock merge mode는 앞서 설명한 것과 같을 수 있다. 이에 따라 CPR을 사용하는 경우 subblock merge mode를 나타내는 flag를 parsing하지 않고 infer하는 것이 가능하다.In an embodiment, when CPR is used, the subblock merge mode may not be used. Subblock merge mode may be the same as described above. Accordingly, in the case of using CPR, it is possible to infer the flag indicating the subblock merge mode without parsing.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 기설정된 spatial neighbor 위치의 집합이 CPR을 사용하지 않는 경우의 기설정된 spatial neighbor 위치의 집합과 다를 수 있다. 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 도 12의 기설정된 위치에서 B0와 B1 중 하나를 사용하지 않을 수 있다. 예를 들면 CPR을 사용하는 경우 B0 위치로부터 motion information을 참조하지 않을 수 있다. 또는 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 도 12의 기설정된 위치에서 A0와 A1 중 하나를 사용하지 않을 수 있다. 예를 들면 CPR을 사용하는 경우 A0 위치로부터 motion information을 참조하지 않을 수 있다. 이것은 CPR을 사용하는 경우의 motion information은 상대적으로 복잡하고 다양한 것을 요구하지 않을 수 있기 때문이다. 또는 CPR을 사용하는 경우 가까운 위치로부터의 motion information이 유사할 수 있기 때문이다.According to an embodiment of the present invention, when CPR is used, a preset set of spatial neighbor locations may be different from a preset set of spatial neighbor locations when CPR is not used. According to an embodiment of the present invention, when CPR is used, one of B0 and B1 may not be used at a preset position of FIG. 12. For example, when using CPR, motion information may not be referenced from the B0 position. Alternatively, according to an embodiment of the present invention, when CPR is used, one of A0 and A1 may not be used at a preset position of FIG. 12. For example, when using CPR, motion information may not be referenced from the A0 position. This is because motion information in the case of using CPR is relatively complex and may not require various things. Or, when CPR is used, motion information from a nearby location may be similar.

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

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우 AMVP mode에서 zero MV를 MVP로 사용하지 않을 수 있다. 이 경우 도 15의 실시예와 결합하면 현재 block 위치에 따라 candidate list에 spatial candidate 1개만 추가되는 경우가 있을 수 있다. 또한 zero MV를 MVP로 사용하지 않으면 MVP candidate list에는 1개의 candidate만 존재할 수 있다. 이러한 경우 candidate index를 parsing하지 않는 것이 가능하다. 또한 이러한 경우 candidate index를 0으로 infer할 수 있다.According to an embodiment of the present invention, when CPR is used, zero MV may not be used as MVP in AMVP mode. In this case, when combined with the embodiment of FIG. 15, there may be a case where only one spatial candidate is added to the candidate list according to the current block position. Also, if zero MV is not used as an MVP, only one candidate can exist in the MVP candidate list. In this case, it is possible not to pars the candidate index. Also, in this case, the candidate index can be inferred to 0.

도 25를 참조하면 (a)에 현재 block이 reference block이 가질 수 있는 범위의 left boundary 또는 top boundary에 인접한 경우를 나타내었다. 이러한 경우 상기 reference block이 가질 수 있는 범위를 벗어나는 위치로부터의 motion information을 참조하지 않을 수 있다. 이러한 경우 AMVP mode를 사용할 때 zero MV를 MVP로 사용하지 않는 경우 MVP candidate로 가능한 것은 최대 1개가 될 수 있다. 따라서 도 25 (b)와 같이 그러한 경우 candidate index를 나타내는 mvp_l0_flag 및 mvp_l1_flag를 parsing하지 않을 수 있다. 이때 0으로 infer할 수 있다. CPR을 사용하는 경우를 CurrPicIsOnlyRef로 나타내었다. 또한 l0와 l1은 각각 reference list 0, 1을 나타낼 수 있다. 또한 CPR을 사용하는 경우 현재 picture가 유일한 reference picture일 수 있으므로 reference list 1개에 대해서만 MV가 존재할 수 있다. 이때 MV 관련 syntax도 reference list 1개에 대해서만 parsing할 수 있다.Referring to FIG. 25, (a) shows a case in which the current block is adjacent to the left boundary or the top boundary of the range that the reference block can have. In this case, motion information from a position outside the range that the reference block can have may not be referenced. In this case, when using the AMVP mode, when zero MV is not used as an MVP, the maximum number of possible MVP candidates can be one. Therefore, in such a case as shown in FIG. 25(b), mvp_l0_flag and mvp_l1_flag indicating the candidate index may not be parsed. At this time, you can infer to 0. The case of using CPR is indicated by CurrPicIsOnlyRef. Also, l0 and l1 may represent reference lists 0 and 1, respectively. In addition, when CPR is used, since the current picture may be the only reference picture, MV may exist for only one reference list. At this time, MV-related syntax can also be parsed for only one reference list.

도 26은 본 발명의 일 실시예에 따른 HMVP의 history를 저장하는 공간을 reset하는 것을 나타낸 도면이다.26 is a view showing resetting a space for storing HMVP history according to an embodiment of the present invention.

앞서 설명한 것처럼 기설정된 위치에서 HMVP의 history를 저장하는 공간을 reset할 수 있다. 상기 HMVP의 history를 저장하는 공간을 HMVP table이라고 부를 수 있다.As described above, the space for storing HMVP history at a preset location can be reset. The space for storing the history of the HMVP may be called an HMVP table.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우와 사용하지 않는 경우에 상기 기설정된 위치가 다를 수 있다. 예를 들어 CPR을 사용하지 않는 경우에 CTU row의 시작에서 HMVP table을 reset할 수 있다. 또한 예를 들어 CPR을 사용하는 경우에 reference block이 존재할 수 있는 범위의 시작에서 HMVP table을 reset할 수 있다. 또는 예를 들어 CPR을 사용하는 경우에 각 CTU의 시작에서 HMVP table을 reset할 수 있다. 또는 CPR을 사용하는 경우에는 CPR을 사용하지 않는 경우보다 HMVP table을 reset하는 기설정된 위치가 더 많이(자주) 존재할 수 있다.According to an embodiment of the present invention, the preset position may be different when CPR is used and when CPR is not used. For example, if CPR is not used, the HMVP table can be reset at the beginning of the CTU row. In addition, for example, when using CPR, the HMVP table can be reset at the beginning of the range in which the reference block can exist. Alternatively, for example, when using CPR, the HMVP table can be reset at the beginning of each CTU. Alternatively, when CPR is used, there may be more (often) preset locations for resetting the HMVP table than when CPR is not used.

CPR을 사용하는 경우 현재 block으로부터 멀리 떨어진 위치에 해당하는 motion information은 현재와 연관성이 적을 수 있기 때문이다. 또한 CPR을 사용하는 경우 HMVP table reset을 더 빈도 높게 함으로써 parallel processing을 더 용이하게 할 수 있다.This is because when CPR is used, motion information corresponding to a position far from the current block may have little correlation with the present. In addition, when CPR is used, parallel processing can be made easier by performing HMVP table reset more frequently.

도 26을 참조하면 도면의 각 작은 사각형은 reference block이 존재할 수 있는 범위 혹은 CTU 범위를 나타낼 수 있다. 또한 X로 표시한 부분이 HMVP table이 reset되는 부분일 수 있다. 도 26 위쪽에 표시한 CPR을 사용하지 않는 경우에는 CTU row의 시작에서 HMVP table을 reset할 수 있다. 도 26 아래쪽에 표시한 CPR을 사용하는 경우에는 CTU의 시작에서 HMVP table을 reset할 수 있다.Referring to FIG. 26, each small square in the drawing may indicate a range in which a reference block may exist or a CTU range. In addition, a portion marked with an X may be a portion in which the HMVP table is reset. If the CPR shown in the upper part of FIG. 26 is not used, the HMVP table can be reset at the beginning of the CTU row. When the CPR shown in the lower part of FIG. 26 is used, the HMVP table can be reset at the beginning of the CTU.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우의 MVD coding 방법은 CPR을 사용하지 않는 경우의 MVD coding 방법과 다를 수 있다. 예를 들어 CPR을 사용하지 않는 경우에 도 9와 같은 coding 방법을 사용할 수 있다. 이것은 CPR을 사용하는 경우에는 코딩 순서에 따라 가능한 MV의 범위가 CPR을 사용하지 않는 경우와는 다를 수 있기 때문이다.According to an embodiment of the present invention, the MVD coding method in the case of using CPR may be different from the MVD coding method in the case of not using CPR. For example, when CPR is not used, a coding method as shown in FIG. 9 can be used. This is because in the case of using CPR, the range of possible MVs according to the coding order may be different from that in the case of not using CPR.

일 실시예로 CPR을 사용하는 경우에는 x-component와 y-component를 분리하여 코딩하는 방식을 사용하지 않을 수 있다. 예를 들면 vector의 절대값과 방향을 기초로 한 코딩 방식을 사용할 수 있다.In the case of using CPR as an embodiment, a method of separately coding an x-component and a y-component may not be used. For example, a coding scheme based on the absolute value and direction of a vector can be used.

일 실시예로 CPR을 사용하는 경우에는 MVP가 zero MV일 때 MV가 나타내는 기준점이 기존(현재 block top-left로부터의 vector)과 다를 수 있다.In the case of using CPR as an embodiment, the reference point indicated by the MV when the MVP is zero MV may be different from the existing (a vector from the current block top-left).

일 실시예로 CPR을 사용하는 경우에는 도 9, 도 19, 도 21에서 설명한 것과는 다른 syntax를 사용할 수 있다. 예를 들면 절대값이 어떤 값보다 큰지 나타내는 flag에서 어떤 값이 CPR을 사용하는 경우에는 사용하지 않는 경우와 다를 수 있다. 이에 따라 절대값에서 어떤 값을 뺀 값의 시그날링을 할 수 있다. 예를 들어 앞선 실시예들에서 절대값이 1보다 큰지 나타내는 flag가 있었다. 예를 들어 CPR을 사용하는 경우에는 절대값이 최소 block size보다 큰지 나타내는 flag가 있을 수 있다. 또는 CPR을 사용하는 경우에는 현재 block의 width 또는 height보다 큰지 나타내는 flag를 사용할 수 있다. 예를 들어 CPR을 사용하는 경우에는 x-component에 대해서는 절대값이 현재 block width보다 큰지 나타내는 flag를, y-component에 대해서는 절대값이 현재 block height보다 큰지 나타내는 flag를 사용할 수 있다.In the case of using CPR as an embodiment, a syntax different from that described in FIGS. 9, 19, and 21 may be used. For example, in a flag indicating whether the absolute value is greater than what value, a case in which CPR is used may differ from the case in which CPR is not used. Accordingly, signaling of a value obtained by subtracting a certain value from the absolute value can be performed. For example, there was a flag indicating whether the absolute value was greater than 1 in the previous embodiments. For example, when CPR is used, there may be a flag indicating whether the absolute value is greater than the minimum block size. Alternatively, when using CPR, a flag indicating whether the width or height of the current block is larger can be used. For example, when CPR is used, a flag indicating whether the absolute value is greater than the current block width for x-component, and a flag indicating whether the absolute value is greater than the current block height for y-component can be used.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우에는 shared merge list를 사용하지 않을 수 있다. Shared merge list는 다수의 block(예를 들면 coding unit)이 같은 merge list를 사용하는 기술일 수 있다. 이는 parallel processing을 용이하게 하기 위해서 shared merge list를 사용할 수 있다. 그러나 CPR을 사용하는 경우에는 현재 picture를 reference block으로 사용하기 때문에 현재 picture의 해당 부분이 reconstruction 되어 있어야 하고 parallel processing을 용이하게 하는 것이 큰 의미가 없을 수 있다. 또한 CPR을 사용하는 경우에는 shared merge list를 사용하면 정확도가 낮아지거나 사용할 수 있는 candidate 수가 너무 적어질 수 있다.According to an embodiment of the present invention, when CPR is used, a shared merge list may not be used. The shared merge list may be a technique in which a plurality of blocks (eg, coding units) use the same merge list. This can use a shared merge list to facilitate parallel processing. However, in the case of using CPR, since the current picture is used as a reference block, the corresponding part of the current picture must be reconstruction, and it may not be of great significance to facilitate parallel processing. Also, in the case of using CPR, if the shared merge list is used, accuracy may decrease or the number of available candidates may be too small.

또다른 실시예를 따르면 CPR을 사용하는 경우에는 shared merge list에서 동일한 merge list를 사용하는 block들을 묶는 기준이 CPR을 사용하지 않을 때와 다를 수 있다.According to another embodiment, when CPR is used, a criterion for grouping blocks using the same merge list in a shared merge list may be different from that when CPR is not used.

본 발명의 일 실시예를 따르면 CPR을 사용하는 경우에는 CPR을 사용하지 않는 경우에 사용하는 방법 중 일부를 사용하지 않을 수 있다. 또는 본 발명의 일 실시예를 따르면 CPR을 사용하는 경우에는 CPR을 사용하지 않는 경우에 사용하는 방법 중 일부를 다르게 사용할 수 있다. 상기 CPR을 사용하지 않는 경우에 사용하는 방법은 prediction mode 등을 포함할 수 있다.According to an embodiment of the present invention, when CPR is used, some of the methods used when CPR is not used may not be used. Alternatively, according to an embodiment of the present invention, when CPR is used, some of the methods used when CPR is not used may be used differently. When the CPR is not used, the method used may include a prediction mode.

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

앞서 설명한 CPR은 IBC (intra block copy)라고 불릴 수도 있다.The CPR described above may also be called IBC (intra block copy).

본 발명의 일 실시예를 따르면 IBC는 독립적인 prediction mode로서 존재할 수 있다. 즉, 앞서 설명한 intra prediction, inter prediction은 각각 MODE_INTRA, MODE_INTER일 수 있는데, MODE_INTRA 및 MODE_INTER와 다른 MODE_IBC가 존재할 수 있다. 또한 앞선 도면들에 나타낸 것처럼 MODE_INTRA, MODE_INTER, MODE_IBC는 CuPredMode 값에 의해 나타내어질 수 있다.According to an embodiment of the present invention, IBC may exist as an independent prediction mode. That is, the aforementioned intra prediction and inter prediction may be MODE_INTRA and MODE_INTER, respectively, and MODE_IBC different from MODE_INTRA and MODE_INTER may exist. Also, as shown in the preceding figures, MODE_INTRA, MODE_INTER, and MODE_IBC may be represented by CuPredMode values.

또한 tile group은 CU, CTU, PU 등보다 상위의 단위일 수 있다. 또한 tile group은 parallel processing 가능한 단위일 수 있다.In addition, the tile group may be a unit higher than the CU, CTU, or PU. Also, the tile group may be a unit capable of parallel processing.

B (bi-predictive) tile group은 intra prediction 또는 inter prediction, IBC 등을 사용할 수 있을 수 있다. 또한 B tile group은 block에서 motion vector와 reference index를 각각 2개까지 사용하는 것이 가능하다. 또는 B tile group은 block에서 motion vector와 reference index를 각각 1개를 넘게 사용하는 것이 가능하다.The B (bi-predictive) tile group may use intra prediction, inter prediction, IBC, or the like. Also, in the B tile group, it is possible to use up to two motion vectors and two reference indices each in the block. Alternatively, in the B tile group, it is possible to use more than one motion vector and one reference index each in the block.

또한 intra prediction은 IBC 기법을 포함하는 개념일 수 있다. Intra prediction은 현재 picture만을 refer하는 prediction 방법일 수 있다. 또한 inter prediction은 현재 picture가 아닌 picture를 reference picture로 refer할 수 있는 방법일 수 있다.Also, intra prediction may be a concept including an IBC technique. Intra prediction may be a prediction method that refers only to the current picture. In addition, inter prediction may be a method of referencing a picture other than the current picture as a reference picture.

P (predictive) tile group은 intra prediction 또는 inter prediction, IBC 등을 사용할 수 있을 수 있다. 또한 P tile group은 block에서 motion vector와 reference index를 각각 1개까지 사용하는 것이 가능하다. 또는 B tile group은 block에서 motion vector와 reference index를 각각 2개 넘게 사용하지 않는 것이 가능하다.The P (predictive) tile group may use intra prediction, inter prediction, IBC, or the like. In addition, it is possible to use up to one motion vector and one reference index in the block for the P tile group. Alternatively, in the B tile group, it is possible not to use more than two motion vectors and reference indexes respectively in the block.

I (intra) tile group은 intra prediction, IBC를 사용하는 것일 수 있다. 또한 I tile group은 현재 picture가 아닌 picture를 reference picture로 refer하지 않을 수 있다.The I (intra) tile group may use intra prediction or IBC. Also, the I tile group may not refer to a picture other than the current picture as a reference picture.

본 발명의 일 실시예를 따르면 ( tile_group_type != I | | sps_ibc_enabled_flag ) 인 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing할 가능성이 있는 것이 가능하다. 즉, ( tile_group_type != I | | sps_ibc_enabled_flag )이지 않은 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag 모두를 parsing하지 않는 것이 가능하다.According to an embodiment of the present invention, in the case of (tile_group_type! = I | | sps_ibc_enabled_flag ), it is possible that there is a possibility of parsing cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag. That is, if (tile_group_type != I | | sps_ibc_enabled_flag) is not, it is possible not to pars all of cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag.

또한 sps_ibc_enabled_flag는 IBC가 사용되는지를 나타내는 상위 레벨의 시그날링일 수 있다. 또한 sps_ibc_enabled_flag가 0로 설정된 경우에는 IBC를 사용하지 않고, 1로 설정된 경우에는 IBC를 사용할 수 있는 것이 가능하다.Also, sps_ibc_enabled_flag may be a high-level signaling indicating whether IBC is used. In addition, when sps_ibc_enabled_flag is set to 0, IBC is not used, and when it is set to 1, IBC can be used.

또한 cu_skip_flag 값에 기초하여 skip mode가 사용되는지를 결정할 수 있다. 만약 cu_skip_flag가 1인 경우 skip mode가 사용되는 것일 수 있다.In addition, it may be determined whether the skip mode is used based on the cu_skip_flag value. If cu_skip_flag is 1, skip mode may be used.

또한 pred_mode_flag 또는 pred_mode_ibc_flag에 기초하여 prediction mode가 결정되는 것이 가능하다. 즉, pred_mode_flag 또는 pred_mode_ibc_flag에 기초하여 현재 mode가 MODE_INTRA인지 MODE_INTER인지 MODE_IBC인지 결정되는 것이 가능하다. 또는 pred_mode_flag 또는 pred_mode_ibc_flag에 기초하여 CuPredMode 값이 결정되는 것이 가능하다.In addition, it is possible to determine the prediction mode based on pred_mode_flag or pred_mode_ibc_flag. That is, it is possible to determine whether the current mode is MODE_INTRA, MODE_INTER, or MODE_IBC based on pred_mode_flag or pred_mode_ibc_flag. Alternatively, the CuPredMode value may be determined based on pred_mode_flag or pred_mode_ibc_flag.

또한 tile_group_type은 tile group의 종류를 나타낼 수 있다. Tile group의 종류는 앞서 설명한 것처럼 I tile group, P tile group, B tile group을 포함할 수 있다. 또한 tile_group_type 값이 I, P, B인 것은 각각 I tile group, P tile group, B tile group을 나타낼 수 있다.In addition, tile_group_type may indicate the type of tile group. As described above, the tile group type may include an I tile group, a P tile group, and a B tile group. In addition, if the tile_group_type value is I, P, and B, it may represent an I tile group, a P tile group, and a B tile group, respectively.

본 발명의 일 실시예를 따르면 ( cu_skip_flag[ x0 ][ y0 ] = = 0 && tile_group_type != I)) 인 경우 pred_mode_flag를 parsing하는 것이 가능하다. 또한 cu_skip_flag가 1인 경우 pred_mode_flag를 parsing하지 않을 수 있다. 또한 tile_group_type이 I인 경우 pred_mode_flag를 parsing하지 않을 수 있다.According to an embodiment of the present invention, in the case of (cu_skip_flag[ x0 ][ y0] = = 0 && tile_group_type != I)), it is possible to pars the pred_mode_flag. Also, when cu_skip_flag is 1, pred_mode_flag may not be parsed. In addition, when tile_group_type is I, pred_mode_flag may not be parsed.

본 발명의 일 실시예를 따르면 ( ( tile_group_type = = I && cu_skip_flag[ x0 ][ y0 ] = =0 ) || ( tile_group_type != I && (cu_skip_flag[ x0 ][ y0 ] | | CuPredMode[ x0 ][ y0 ] != MODE_INTRA ) ) && sps_ibc_enabled_flag && blockSizeCondition ) 인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다. 예를 들어 ( tile_group_type = = I && cu_skip_flag[ x0 ][ y0 ] == 0 )인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다. 또는 ( tile_group_type != I && (cu_skip_flag[ x0 ][ y0 ] | | CuPredMode[ x0 ][ y0 ] != MODE_INTRA ) )인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다. 또는 ( tile_group_type = = I && cu_skip_flag[ x0 ][ y0 ] == 0 )도 아니고, ( tile_group_type != I && (cu_skip_flag[ x0 ][ y0 ] | | CuPredMode[ x0 ][ y0 ] != MODE_INTRA ) )도 아닌 경우 pred_mode_ibc_flag를 parsing하지 않는 것이 가능하다. 또한 sps_ibc_enabled_flag가 1인 경우 pred_mode_ibc_flag를 parsing할 수 있고, sps_ibc_enabled_flag가 0인 경우 pred_mode_ibc_flag를 parsing하지 않는 것이 가능하다. 또한 pred_mode_ibc_flag를 parsing할 수 있는 block size에 기초한 condition이 있을 수 있다. 도 27을 참조하면 block size condition을 cbWidth와 cbHeight가 모두 32보다 작은 경우로 나타내었다.According to an embodiment of the present invention ((tile_group_type = = I && cu_skip_flag[ x0 ][ y0] = = 0) || (tile_group_type! = I && (cu_skip_flag[ x0 ][ y0] | | CuPredMode[ x0 ][ y0 ] != MODE_INTRA)) In case of && sps_ibc_enabled_flag && blockSizeCondition ), it is possible to pars pred_mode_ibc_flag. For example, in the case of (tile_group_type = = I && cu_skip_flag[ x0 ][ y0] == 0 ), it is possible to pars pred_mode_ibc_flag. Or, in the case of (tile_group_type != I && (cu_skip_flag[ x0 ][ y0] | | CuPredMode[ x0 ][ y0] != MODE_INTRA) ), it is possible to pars pred_mode_ibc_flag. Or (tile_group_type = = I && cu_skip_flag[ x0 ][ y0] == 0 ), nor (tile_group_type != I && (cu_skip_flag[ x0 ][ y0] | | CuPredMode[ x0 ][ y0] != MODE_INTRA)) If not, it is possible not to pars the pred_mode_ibc_flag. In addition, when sps_ibc_enabled_flag is 1, pred_mode_ibc_flag can be parsed, and when sps_ibc_enabled_flag is 0, it is possible not to pars pred_mode_ibc_flag. In addition, there may be a condition based on a block size capable of parsing pred_mode_ibc_flag. Referring to FIG. 27, the block size condition is shown as a case where both cbWidth and cbHeight are less than 32.

또한 도 27을 참조하면 CuPredMode가 MODE_INTRA인 경우에 intra prediction 관련 syntax element를 parsing하는 것이 가능하다. 또한 CuPredMode가 MODE_INTRA인 경우에 motion vector 관련 syntax element를 parsing하지 않는 것이 가능하다.Also, referring to FIG. 27, when CuPredMode is MODE_INTRA, it is possible to pars an intra prediction related syntax element. Also, when CuPredMode is MODE_INTRA, it is possible not to pars the syntax element related to the motion vector.

또한 CuPredMode가 MODE_INTRA이지 않은 경우에 inter prediction 관련 syntax element를 parsing 할 수 있다. 또한 CuPredMode가 MODE_INTRA이지 않은 경우에 IBC 관련 syntax element를 parsing 할 수 있다. IBC 관련 syntax element는 motion vector 관련 syntax element를 포함할 수 있다. 즉, CuPredMode가 MODE_IBC인 경우 IBC 관련 syntax element를 parsing 할 수 있다. IBC 관련 syntax element는 merge mode 관련 syntax element, AMVP 관련 syntax element를 포함하는 것이 가능하다. 또한 IBC는 MODE_INTER인 경우보다 prediction mode가 제한적일 수 있고, parsing하는 syntax element도 더 적을 수 있다. 예를 들어 MODE_IBC인 경우에는 reference list L0에 대한 syntax element만 parsing하는 것이 가능하다. 또다른 예로 MODE_IBC인 경우에는 merge_data에서 mode 사용 여부를 나타내는 flag 중 일부를 parsing하지 않을 수 있다. 또한 CuPredMode가 MODE_INTRA이지 않은 경우에 inter prediction 관련 syntax element를 parsing하고, IBC 관련 syntax element를 parsing하는 것은 chroma component에 대한 syntax를 parsing하지 않는 경우일 수 있다. 또는 CuPredMode가 MODE_INTRA이지 않은 경우에 inter prediction 관련 syntax element를 parsing하고, IBC 관련 syntax element를 parsing하는 것은 treeType이 DUAL_TREE_CHROMA가 아닌 경우일 수 있다.In addition, when CuPredMode is not MODE_INTRA, syntax elements related to inter prediction can be parsed. Also, when CuPredMode is not MODE_INTRA, IBC related syntax elements can be parsed. The syntax element related to IBC may include a syntax element related to a motion vector. That is, when CuPredMode is MODE_IBC, IBC-related syntax elements can be parsed. IBC-related syntax elements may include merge mode-related syntax elements and AMVP-related syntax elements. In addition, the prediction mode for IBC may be more limited than in the case of MODE_INTER, and there may be fewer syntax elements for parsing. For example, in the case of MODE_IBC, it is possible to pars only the syntax element for the reference list L0. As another example, in the case of MODE_IBC, some of the flags indicating whether to use the mode in merge_data may not be parsed. In addition, when CuPredMode is not MODE_INTRA, parsing an inter prediction-related syntax element and parsing an IBC-related syntax element may be a case in which syntax for a chroma component is not parsed. Alternatively, when CuPredMode is not MODE_INTRA, parsing an inter prediction related syntax element and parsing an IBC related syntax element may be performed when the treeType is not DUAL_TREE_CHROMA.

일 실시예로 treeType에 의해 어떤 성분에 대한 syntax를 parsing하는지, 어떤 성분에 대한 processing을 하는 것인지 등을 판단하는 것이 가능하다. 만약 treeType이 SINGLE_TREE인 경우 luma 성분과 chroma 성분이 syntax element 값을 공유할 수 있다. 또한 만약 treeType이 SINGLE_TREE인 경우에는 luma block과 chroma block이 같은 방법으로 partitioning 될 수 있다. 만약 treeType이 DUAL_TREE인 경우에는 luma block과 chroma block이 다른 방법으로 partitioning 되는 것이 가능하다. 또한 treeType이 DUAL_TREE인 것은 DUAL_TREE_LUMA, DUAL_TREE_CHROMA를 포함할 수 있다. treeType이 DUAL_TREE_LUMA인지 DUAL_TREE_CHROMA인지에 따라 luma component에 대한 처리를 하는 것인지 chroma component에 대한 처리를 하는 것인지 판단 가능하다.In one embodiment, it is possible to determine which component syntax is parsed, which component is processed, and the like by treeType. If the treeType is SINGLE_TREE, the luma component and the chroma component can share the syntax element value. Also, if treeType is SINGLE_TREE, luma block and chroma block can be partitioned in the same way. If the treeType is DUAL_TREE, it is possible to partition the luma block and chroma block in different ways. In addition, the treeType of DUAL_TREE may include DUAL_TREE_LUMA and DUAL_TREE_CHROMA. Depending on whether the treeType is DUAL_TREE_LUMA or DUAL_TREE_CHROMA, it is possible to determine whether to process a luma component or a chroma component.

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

본 발명의 일 실시예에 따르면 pred_mode_flag에 기초하여 prediction mode가 나타내어질 수 있다. 또한 pred_mode_flag에 기초하여 CuPredMode가 결정되는 것이 가능하다. 또한 pred_mode_flag에 기초하여 inter prediction인지, intra prediction인지 나타내는 것이 가능하다.According to an embodiment of the present invention, a prediction mode may be indicated based on pred_mode_flag. Also, it is possible to determine CuPredMode based on pred_mode_flag. In addition, it is possible to indicate whether it is inter prediction or intra prediction based on pred_mode_flag.

본 발명의 일 실시예에 따르면 pred_mode_flag가 0이면 CuPredMode는 MODE_INTER로 설정될 수 있다. 또한 pred_mode_flag가 1이면 CuPredMode가 MODE_INTRA로 설정될 수 있다. 일 실시예를 따르면 pred_mode_flag는 현재 CU가 inter prediction mode인지 intra prediction mode인지 나타내는 것이 가능하다.According to an embodiment of the present invention, if pred_mode_flag is 0, CuPredMode may be set to MODE_INTER. Also, if pred_mode_flag is 1, CuPredMode may be set to MODE_INTRA. According to an embodiment, pred_mode_flag may indicate whether the current CU is in an inter prediction mode or an intra prediction mode.

만약 pred_mode_flag가 존재하지 않는 경우 pred_mode_flag 또는 CuPredMode를 infer하는 것이 가능하다. 만약 pred_mode_flag가 존재하지 않는 경우 pred_mode_flag 또는 CuPredMode를 어떤 tile group인지에 기초하여 infer하는 것이 가능하다. 예를 들어 I tile group인 경우 CuPredMode를 MODE_INTRA로 infer하는 것이 가능하다. 또한 P tile group 또는 B tile group인 경우 CuPredMode를 MODE_INTER로 infer하는 것이 가능하다.If pred_mode_flag does not exist, it is possible to infer pred_mode_flag or CuPredMode. If pred_mode_flag does not exist, it is possible to infer pred_mode_flag or CuPredMode based on which tile group it is. For example, in the case of I tile group, it is possible to infer CuPredMode to MODE_INTRA. In addition, in the case of a P tile group or a B tile group, it is possible to infer CuPredMode to MODE_INTER.

본 발명의 일 실시예에 따르면 pred_mode_ibc_flag에 기초하여 prediction mode가 나타내어질 수 있다. 또한 pred_mode_ibc_flag에 기초하여 CuPredMode가 결정되는 것이 가능하다. 또한 pred_mode_ibc_flag에 기초하여 IBC mode인지 나타내는 것이 가능하다.According to an embodiment of the present invention, a prediction mode may be indicated based on pred_mode_ibc_flag. In addition, it is possible to determine CuPredMode based on pred_mode_ibc_flag. In addition, it is possible to indicate whether the IBC mode is based on pred_mode_ibc_flag.

본 발명의 일 실시예에 따르면 pred_mode_ibc_flag가 0인 경우, CuPredMode는 MODE_INTER로 설정될 수 있다. 또한 pred_mode_ibc_flag가 1인 경우, CuPredMode는 MODE_IBC로 설정될 수 있다. 또는 pred_mode_ibc_flag가 0인 경우, CuPredMode는 MODE_IBC가 아닌 값으로 설정될 수 있다.According to an embodiment of the present invention, when pred_mode_ibc_flag is 0, CuPredMode may be set to MODE_INTER. Also, when pred_mode_ibc_flag is 1, CuPredMode may be set to MODE_IBC. Alternatively, when pred_mode_ibc_flag is 0, CuPredMode may be set to a value other than MODE_IBC.

만약 pred_mode_ibc_flag가 존재하지 않는 경우 pred_mode_ibc_flag 또는 CuPredMode를 infer하는 것이 가능하다. 만약 pred_mode_ibc_flag가 존재하지 않는 경우 pred_mode_ibc_flag 또는 CuPredMode를 어떤 tile group인지에 기초하여 infer하는 것이 가능하다. 예를 들어 I tile group인 경우 CuPredMode를 MODE_INTRA로 infer하는 것이 가능하다. 또한 P tile group 또는 B tile group인 경우 CuPredMode를 MODE_INTER로 infer하는 것이 가능하다.If pred_mode_ibc_flag does not exist, it is possible to infer pred_mode_ibc_flag or CuPredMode. If pred_mode_ibc_flag does not exist, it is possible to infer pred_mode_ibc_flag or CuPredMode based on which tile group it is. For example, in the case of I tile group, it is possible to infer CuPredMode to MODE_INTRA. In addition, in the case of a P tile group or a B tile group, it is possible to infer CuPredMode to MODE_INTER.

본 발명에서 tile group이라고 사용한 것은 tile group 이외에 slice 또는 다른 parallel processing 가능한 단위로 대체 가능하다.In the present invention, what is used as a tile group can be replaced with a unit capable of slice or other parallel processing other than the tile group.

본 발명의 일 실시예를 따르면 IBC를 사용하는 경우에 skip mode를 사용하는 것이 가능하다. 예를 들면 I tile group에 대하여 IBC를 사용하는 경우에 skip mode를 사용하는 것이 가능하다. 예를 들면 I tile group에 대하여 IBC를 사용하는 CU에 대하여 skip mode를 사용하는 것이 가능하다. 그러나 도 27 내지 도 28에서 설명한 syntax 및 시그날링 방법에서 이를 지원하지 못 할 수 있다. 예를 들어 I tile group에서 IBC mode이고 skip mode인 경우를 가정할 수 있다. 그러한 경우 sps_ibc_enabled_flag는 1일 수 있다. 또한 cu_skip_flag를 parsing할 수 있다. 이때 cu_skip_flag의 값은 1(skip mode를 사용하는 것을 나타내는 값)일 수 있다. 또한 cu_skip_flag가 1이거나 I tile group애 대하여 pred_mode_flag를 parsing하지 않을 수 있다. 그러한 경우 CuPredMode를 I tile group에 대하여 MODE_INTRA로 infer하는 것이 가능하다. 또한 I tile group이고 cu_skip_flag가 1인 경우 pred_mode_ibc_flag를 parsing하지 않을 수 있다. 그러한 경우 CuPredMode를 I tile group에 대하여 MODE_INTRA로 infer하는 것이 가능하다. 따라서 IBC를 사용함에도 불구하고 CuPredMode를 MODE_IBC로 나타낼 수 없는 상황이 발생할 수 있다.According to an embodiment of the present invention, it is possible to use the skip mode when using IBC. For example, in the case of using IBC for the I tile group, it is possible to use the skip mode. For example, it is possible to use the skip mode for CUs that use IBC for the I tile group. However, the syntax and signaling methods described in FIGS. 27 to 28 may not support this. For example, in the I tile group, it can be assumed that the IBC mode is in the skip mode. In that case, sps_ibc_enabled_flag may be 1. Also, cu_skip_flag can be parsed. In this case, the value of cu_skip_flag may be 1 (a value indicating the use of the skip mode). In addition, cu_skip_flag may be 1 or pred_mode_flag may not be parsed for I tile group. In that case, it is possible to infer CuPredMode to MODE_INTRA for the I tile group. In addition, if it is an I tile group and cu_skip_flag is 1, pred_mode_ibc_flag may not be parsed. In that case, it is possible to infer CuPredMode to MODE_INTRA for the I tile group. Therefore, even though IBC is used, a situation in which CuPredMode cannot be expressed as MODE_IBC may occur.

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

도 29의 pred_mode_flag 및 pred_mode_ibc_flag에 대한 설명은 도 27 내지 도 28을 참조할 수 있다. 도 29의 실시예는 도 28에서 설명한 문제를 해결하기 위한 것일 수 있다.For a description of pred_mode_flag and pred_mode_ibc_flag of FIG. 29, reference may be made to FIGS. 27 to 28. The embodiment of FIG. 29 may be for solving the problem described in FIG. 28.

본 발명의 일 실시예에 따르면 cu_skip_flag에 기초하여 CuPredMode가 infer되는 것이 가능하다. 또한 어떤 tile group인지에 기초하여 CuPredMode가 infer되는 것이 가능하다. 예를 들어 I tile group인 경우 cu_skip_flag에 기초하여 CuPredMode를 infer하는 것이 가능하다. 예를 들어 I tile group이고 cu_skip_flag가 0인 경우, CuPredMode를 MODE_INTRA로 infer하는 것이 가능하다. 또한 I tile group이고 cu_skip_flag가 1인 경우, CuPredMode를 MODE_IBC로 infer하는 것이 가능하다. 또한 cu_skip_flag가 0과 1인 것은 각각 skip mode를 사용하지 않는 것과 사용하는 것을 나타낼 수 있다. 또한 상기 실시예들은 pred_mode_flag 또는 pred_mode_ibc_flag가 존재하지 않는 경우에 수행하는 것일 수 있다.According to an embodiment of the present invention, it is possible for CuPredMode to be inferred based on cu_skip_flag. Also, it is possible to infer CuPredMode based on which tile group it is. For example, in the case of an I tile group, it is possible to infer CuPredMode based on cu_skip_flag. For example, if it is an I tile group and cu_skip_flag is 0, it is possible to infer CuPredMode to MODE_INTRA. In addition, when it is an I tile group and cu_skip_flag is 1, it is possible to infer CuPredMode to MODE_IBC. Also, when cu_skip_flag is 0 and 1, it may indicate that the skip mode is not used and that the skip mode is used, respectively. Also, the above embodiments may be performed when pred_mode_flag or pred_mode_ibc_flag does not exist.

또한 이때 cu_skip_flag에 기초하여 CuPredMode를 다른 값으로 설정하는 과정 없이 설정하는 것이 가능하다. 또한 이때 cu_skip_flag에 기초하여 CuPredMode를 다른 값으로 설정하는 과정 없이 MODE_IBC 또는 MODE_INTRA로 설정하는 것이 가능하다. 예를 들어 I tile group이고 cu_skip_flag가 1인 경우 CuPredMode를 바로 MODE_IBC로 설정하는 것이 가능하다. 또한 I tile group이고 cu_skip_flag가 0인 경우 CuPredMode를 바로 MODE_INTRA로 설정하는 것이 가능하다. 마찬가지로 상기 실시예들은 pred_mode_flag 또는 pred_mode_ibc_flag가 존재하지 않는 경우에 수행하는 것일 수 있다.In addition, at this time, it is possible to set the CuPredMode based on cu_skip_flag without a process of setting it to another value. In addition, at this time, it is possible to set to MODE_IBC or MODE_INTRA without the process of setting CuPredMode to another value based on cu_skip_flag. For example, if it is an I tile group and cu_skip_flag is 1, it is possible to set CuPredMode to MODE_IBC immediately. Also, if it is an I tile group and cu_skip_flag is 0, it is possible to set CuPredMode to MODE_INTRA immediately. Similarly, the above embodiments may be performed when pred_mode_flag or pred_mode_ibc_flag does not exist.

또한 tile group의 종류 및 cu_skip_flag에 기초하여 설정하는 CuPredMode infer 값이 있을 수 있고, tile group의 종류에 기초하고 cu_skip_flag에 기초하지 않고 설정하는 CuPredMode infer 값이 있을 수 있다. 예를 들어 tile group의 종류 및 cu_skip_flag에 기초하여 CuPredMode를 MODE_INTRA 및 MODE_IBC로 infer 할 수 있다. 또한 tile group의 종류에 기초하여 CuPredMode를 MODE_INTER로 infer 할 수 있다.In addition, there may be a CuPredMode infer value set based on the type of tile group and cu_skip_flag, and there may be a CuPredMode infer value set based on the type of tile group and not based on cu_skip_flag. For example, CuPredMode may be inferred to MODE_INTRA and MODE_IBC based on the type of tile group and cu_skip_flag. Also, based on the type of tile group, CuPredMode may be inferred to MODE_INTER.

IBC가 아닌 기존 intra prediction은 skip mode를 사용하지 않을 수 있다. 따라서 skip mode를 사용한다고 시그날링된 경우 IBC 또는 inter prediction인 것으로 판단할 수 있다. 또한 skip mode를 사용한다고 시그날링되고 intra prediction (IBC 포함)만 사용하는 tile group의 경우에는 IBC인 것으로 판단할 수 있다.Existing intra prediction other than IBC may not use the skip mode. Therefore, when it is signaled that the skip mode is used, it can be determined to be IBC or inter prediction. In addition, in the case of a tile group that is signaled to use skip mode and uses only intra prediction (including IBC), it can be determined to be IBC.

도 29를 참조하면 pred_mode_flag가 존재하지 않는 경우 CuPredMode를 infer할 수 있다. 만약 I tile group이고 cu_skip_flag가 0인 경우 MODE_INTRA로 infer할 수 있다. 만약 I tile group이고 cu_skip_flag가 1인 경우 MODE_IBC로 infer할 수 있다. 만약 P tile group이거나 B tile group인 경우 MODE_INTER로 infer할 수 있다.Referring to FIG. 29, when pred_mode_flag does not exist, CuPredMode may be inferred. If it is an I tile group and cu_skip_flag is 0, it can infer to MODE_INTRA. If it is an I tile group and cu_skip_flag is 1, it can infer to MODE_IBC. If it is a P tile group or B tile group, it can be inferred with MODE_INTER.

또한 도 29를 참조하면 pred_mode_ibc_flag가 존재하지 않는 경우 CuPredMode를 infer할 수 있다. 만약 I tile group이고 cu_skip_flag가 0인 경우 MODE_INTRA로 infer할 수 있다. 만약 I tile group이고 cu_skip_flag가 1인 경우 MODE_IBC로 infer할 수 있다. 만약 P tile group이거나 B tile group인 경우 MODE_INTER로 infer할 수 있다.Also, referring to FIG. 29, when pred_mode_ibc_flag does not exist, CuPredMode may be inferred. If it is an I tile group and cu_skip_flag is 0, it can infer to MODE_INTRA. If it is an I tile group and cu_skip_flag is 1, it can infer to MODE_IBC. If it is a P tile group or B tile group, it can be inferred with MODE_INTER.

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

도 30의 pred_mode_flag 및 pred_mode_ibc_flag에 대한 설명은 도 27 내지 도 28을 참조할 수 있다. 도 30의 실시예는 도 28에서 설명한 문제를 해결하기 위한 것일 수 있다.For a description of pred_mode_flag and pred_mode_ibc_flag of FIG. 30, refer to FIGS. 27 to 28. The embodiment of FIG. 30 may be for solving the problem described in FIG. 28.

일 실시예로 sps_ibc_enabled_flag에 기초하여 CuPredMode 또는 pred_mode_flag 또는 pred_mode_ibc_flag를 infer하는 방법이 달라지는 것이 가능하다. In an embodiment, a method of inferring CuPredMode or pred_mode_flag or pred_mode_ibc_flag may be different based on sps_ibc_enabled_flag.

일 실시예로 sps_ibc_enabled_flag가 1인 경우에 도 29에서 설명한 infer 방법을 사용하는 것이 가능하다. 또한 sps_ibc_enabled_flag가 0인 경우에 도 28에서 설명한 infer 방법을 사용하는 것이 가능하다.In an embodiment, when sps_ibc_enabled_flag is 1, it is possible to use the infer method described in FIG. 29. In addition, when sps_ibc_enabled_flag is 0, it is possible to use the infer method described in FIG. 28.

도 30을 참조하면 CuPredMode 값을 infer하는 경우가 있을 수 있다. 예를 들어 pred_mode_flag 또는 pred_mode_ibc_flag가 존재하지 않는 경우 CuPredMode 값을 infer하는 것이 가능하다. 본 발명의 일 실시예를 따르면 sps_ibc_enabled_flag가 1인 경우, I tile group인 경우 cu_skip_flag 값에 기초하여 CuPredMode를 infer 할 수 있다. 예를 들어 sps_ibc_enabled_flag가 1인 경우, I tile group이고 cu_skip_flag 값이 0인 경우 CuPredMode를 MODE_INTRA로 설정할 수 있다. 또한 sps_ibc_enabled_flag가 1인 경우, I tile group이고 cu_skip_flag 값이 1인 경우 CuPredMode를 MODE_IBC로 설정할 수 있다. 또한 sps_ibc_enabled_flag가 1인 경우, P tile group이거나 B tile group인 경우 CuPredMode를 MODE_INTER로 설정할 수 있다. 또한 sps_ibc_enabled_flag가 0인 경우, I tile group인 경우 CuPredMode를 MODE_INTRA로 설정할 수 있다. 또한 sps_ibc_enabled_flag가 0인 경우, P tile group이거나 B tile group인 경우 CuPredMode를 MODE_INTER로 설정할 수 있다.Referring to FIG. 30, there may be a case in which a CuPredMode value is inferred. For example, when pred_mode_flag or pred_mode_ibc_flag does not exist, it is possible to infer the CuPredMode value. According to an embodiment of the present invention, when sps_ibc_enabled_flag is 1 or I tile group, CuPredMode may be inferred based on a cu_skip_flag value. For example, when sps_ibc_enabled_flag is 1, if it is an I tile group and cu_skip_flag is 0, CuPredMode may be set to MODE_INTRA. In addition, when sps_ibc_enabled_flag is 1, when it is an I tile group and cu_skip_flag is 1, CuPredMode may be set to MODE_IBC. In addition, when sps_ibc_enabled_flag is 1, CuPredMode may be set to MODE_INTER when it is a P tile group or a B tile group. In addition, when sps_ibc_enabled_flag is 0, and when it is an I tile group, CuPredMode may be set to MODE_INTRA. In addition, when sps_ibc_enabled_flag is 0, CuPredMode may be set to MODE_INTER when it is a P tile group or a B tile group.

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

본 발명의 일 실시예를 따르면 I tile group인 경우 pred_mode_ibc_flag를 parsing할 수 있다. 이러한 경우 도 28에서 설명한 문제를 해결할 수 있다. 또한 I tile group이고, sps_ibc_enabled_flag가 1인 경우 pred_mode_ibc_flag를 parsing할 수 있다. 즉, I tile group에서 IBC mode를 사용하고 skip mode를 사용하는 경우에도 pred_mode_ibc_flag를 설정하여 MODE_IBC를 나타낼 수 있다.According to an embodiment of the present invention, in the case of an I tile group, pred_mode_ibc_flag may be parsed. In this case, the problem described in FIG. 28 can be solved. Also, if it is an I tile group and sps_ibc_enabled_flag is 1, pred_mode_ibc_flag may be parsed. That is, even when IBC mode is used in the I tile group and skip mode is used, pred_mode_ibc_flag may be set to indicate MODE_IBC.

도 31을 참조하면 (tile_group_type == I)인 경우, sps_ibc_enabled_flag가 1이고, block size와 관련된 조건을 만족키시면 pred_mode_ibc_flag를 parsing하고 있다.Referring to FIG. 31, when (tile_group_type == I), sps_ibc_enabled_flag is 1, and when a condition related to block size is satisfied, pred_mode_ibc_flag is parsed.

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

본 발명의 일 실시예에 따르면 pred_mode_flag가 존재하지 않는 경우 pred_mode_flag를 infer할 수 있다. 일 실시예로 tile group의 종류에 기초하여 pred_mode_flag를 infer할 수 있다. 예를 들어 I tile group인 경우 pred_mode_flag 값을 1로 infer할 수 있다. 또한 P tile group인 경우 pred_mode_flag 값을 0으로 infer할 수 있다. 또한 B tile group인 경우 pred_mode_flag 값을 0으로 infer할 수 있다.According to an embodiment of the present invention, when pred_mode_flag does not exist, pred_mode_flag may be inferred. In an embodiment, pred_mode_flag may be inferred based on the type of tile group. For example, in the case of an I tile group, the pred_mode_flag value may be inferred to 1. In addition, in the case of the P tile group, the pred_mode_flag value may be inferred to 0. Also, in the case of the B tile group, the pred_mode_flag value may be inferred to 0.

또한 pred_mode_flag에 기초하여 CuPredMode를 MODE_INTER 또는 MODE_INTRA로 설정할 수 있다. 예를 들어 pred_mode_flag가 0인 경우 CuPredMode를 MODE_INTER로 설정할 수 있다. 또한 pred_mode_flag가 1인 경우 CuPredMode를 MODE_INTRA로 설정할 수 있다.Also, CuPredMode may be set to MODE_INTER or MODE_INTRA based on pred_mode_flag. For example, when pred_mode_flag is 0, CuPredMode may be set to MODE_INTER. In addition, when pred_mode_flag is 1, CuPredMode may be set to MODE_INTRA.

본 발명의 일 실시예를 따르면 pred_mode_flag 또는 pred_mode_ibc_flag에 기초하여 CuPredMode를 설정하는 것이 가능하다. 예를 들어 pred_mode_ibc_flag가 0인 경우 pred_mode_flag에도 기초하여 CuPredMode를 설정하는 것이 가능하다. 예를 들어 pred_mode_ibc_flag가 0인 경우 pred_mode_flag에도 기초하여 CuPredMode를 MODE_INTER 또는 MODE_INTRA로 설정하는 것이 가능하다. 또는 pred_mode_ibc_flag가 0인 경우 pred_mode_flag에도 기초하여 CuPredMode를 MODE_IBC가 아닌 값으로 설정하는 것이 가능하다. 도 32를 참조하면 pred_mode_ibc_flag가 0이고, pred_mode_flag가 0인 경우 CuPredMode를 MODE_INTER로 설정할 수 있다. 또한 pred_mode_ibc_flag가 0이고, pred_mode_flag가 1인 경우 CuPredMode를 MODE_INTRA로 설정할 수 있다.According to an embodiment of the present invention, it is possible to set CuPredMode based on pred_mode_flag or pred_mode_ibc_flag. For example, when pred_mode_ibc_flag is 0, it is possible to set CuPredMode based on pred_mode_flag as well. For example, when pred_mode_ibc_flag is 0, it is possible to set CuPredMode to MODE_INTER or MODE_INTRA based on pred_mode_flag as well. Alternatively, when pred_mode_ibc_flag is 0, it is possible to set CuPredMode to a value other than MODE_IBC based on pred_mode_flag as well. Referring to FIG. 32, when pred_mode_ibc_flag is 0 and pred_mode_flag is 0, CuPredMode may be set to MODE_INTER. In addition, when pred_mode_ibc_flag is 0 and pred_mode_flag is 1, CuPredMode may be set to MODE_INTRA.

본 발명의 일 실시예를 따르면 pred_mode_ibc_flag에만 기초하여 CuPredMode를 설정하는 경우가 있을 수 있다. 예를 들어 pred_mode_ibc_flag가 1인 경우 다른 flag 없이 CuPredMode를 설정할 수 있다. 예를 들어 pred_mode_ibc_flag가 1인 경우 CuPredMode를 MODE_IBC로 설정할 수 있다.According to an embodiment of the present invention, there may be a case where CuPredMode is set based only on pred_mode_ibc_flag. For example, when pred_mode_ibc_flag is 1, CuPredMode can be set without other flags. For example, when pred_mode_ibc_flag is 1, CuPredMode may be set to MODE_IBC.

본 발명의 일 실시예를 따르면 pred_mode_ibc_flag가 존재하지 않는 경우 pred_mode_ibc_flag를 infer할 수 있다. 예를 들면 tile group의 종류에 기초하여 pred_mode_ibc_flag 값을 infer할 수 있다. 또한 tile group의 종류 및 IBC mode 사용 가능 조건에 기초하여 pred_mode_ibc_flag 값을 infer할 수 있다. 더 구체적으로 I tile group인 경우 IBC mode 사용 가능 조건에 기초하여 pred_mode_ibc_flag 값을 infer할 수 있다. 예를 들어 I tile group이고 IBC 사용 가능 조건을 만족시키는 경우 pred_mode_ibc_flag 값을 1로 infer할 수 있다. 1로 infer하는 경우 CuPredMode는 MODE_IBC 값으로 설정될 수 있다. 또한 I tile group이고 IBC 사용 가능 조건을 만족시키지 않는 경우 pred_mode_ibc_flag 값을 0으로 infer할 수 있다. 또는 I tile group이고 IBC 사용 가능 조건 중 적어도 하나를 만족시키지 않는 경우 pred_mode_ibc_flag 값을 0으로 infer할 수 있다. 0으로 infer하는 경우 CuPredMode는 MODE_IBC가 아닌 값으로 설정될 수 있다. IBC mode 사용 가능 조건은 sps_ibc_enabled_flag 값을 포함할 수 있다. 또한 IBC mode 사용 가능 조건은 block size와 관련된 조건을 포함할 수 있다. 도 32를 참조하면 I tile group이고 sps_ibc_enabled_flag가 1인 경우 pred_mode_ibc_flag 값을 1로 infer하는 것이 가능하다. 이때 IBC mode 사용 가능 조건이 추가되어 그 조건까지 만족시키는 경우 pred_mode_ibc_flag 값을 1로 infer하는 것이 가능하다. 도 32에서 추가적인 IBC mode 사용 조건을 block size condition이라고 나타내었다. According to an embodiment of the present invention, when pred_mode_ibc_flag does not exist, pred_mode_ibc_flag may be inferred. For example, the pred_mode_ibc_flag value may be inferred based on the type of the tile group. In addition, the pred_mode_ibc_flag value may be inferred based on the type of tile group and the condition of using the IBC mode. More specifically, in the case of the I tile group, the pred_mode_ibc_flag value may be inferred based on the IBC mode availability condition. For example, if it is an I tile group and satisfies the condition for enabling IBC use, the value of pred_mode_ibc_flag may be inferred to 1. When inferred to 1, CuPredMode may be set to a MODE_IBC value. In addition, if it is an I tile group and does not satisfy the conditions for enabling IBC use, the pred_mode_ibc_flag value may be inferred to 0. Alternatively, if it is an I tile group and does not satisfy at least one of the conditions for using IBC, the pred_mode_ibc_flag value may be inferred to 0. When inferred to 0, CuPredMode may be set to a value other than MODE_IBC. The IBC mode enablement condition may include a value of sps_ibc_enabled_flag. In addition, the conditions for enabling IBC mode may include conditions related to block size. Referring to FIG. 32, when I tile group and sps_ibc_enabled_flag is 1, it is possible to infer a value of pred_mode_ibc_flag to 1. At this time, when the IBC mode enablement condition is added and the condition is satisfied, it is possible to infer the pred_mode_ibc_flag value to 1. In Figure 32, the additional IBC mode usage condition is shown as a block size condition.

또한 I tile group이고(도 32에서 조건 1)), sps_ibc_enabled_flag가 0인 경우(도 32에서 조건 2a)) pred_mode_ibc_flag 값을 0으로 infer할 수 있다. 또한 I tile group이고(도 32에서 조건 1)), 다른 IBC mode 사용 조건을 만족시키지 않는 경우(도 32에서 조건 2b)) pred_mode_ibc_flag 값을 0으로 infer할 수 있다.Also, if it is an I tile group (condition 1 in FIG. 32) and sps_ibc_enabled_flag is 0 (condition 2a in FIG. 32)), the pred_mode_ibc_flag value may be inferred to 0. In addition, if it is an I tile group (condition 1 in FIG. 32) and does not satisfy other IBC mode usage conditions (condition 2b in FIG. 32)), the pred_mode_ibc_flag value may be inferred to 0.

또다른 실시예로 P 또는 B tile group인 경우 pred_mode_ibc_flag 값을 0으로 infer할 수 있다. 또한 P 또는 B tile group인 경우 tile group의 종류 외의 다른 조건 없이 pred_mode_ibc_flag 값을 기설정된 값으로 infer할 수 있다.In another embodiment, in the case of a P or B tile group, a value of pred_mode_ibc_flag may be inferred to 0. In addition, in the case of a P or B tile group, the pred_mode_ibc_flag value may be inferred to a preset value without conditions other than the type of the tile group.

본 발명 다수의 실시예들에서 infer라고 표시한 것은 설정, derivation 등과 같은 의미일 수 있다.In a number of embodiments of the present invention, infer may mean setting, derivation, or the like.

본 발명의 일 실시예를 따르면 treeType은 다음과 같이 derive 될 수 있다.According to an embodiment of the present invention, treeType may be derived as follows.

만약 tile_group_type이 I이고 qtbtt_dual_tree_intra_flag가 1인 경우, treeType은 DUAL_TREE_LUMA로 설정될 수 있다. 또는 tile_group_type이 I이고 qtbtt_dual_tree_intra_flag가 1이고 luma component를 처리하는 경우, treeType은 DUAL_TREE_LUMA로 설정될 수 있다.If tile_group_type is I and qtbtt_dual_tree_intra_flag is 1, treeType may be set to DUAL_TREE_LUMA. Alternatively, when tile_group_type is I, qtbtt_dual_tree_intra_flag is 1, and luma component is processed, treeType may be set to DUAL_TREE_LUMA.

만약 tile_group_type이 I이고 qtbtt_dual_tree_intra_flag가 1인 경우, treeType은 DUAL_TREE_CHROMA로 설정될 수 있다. 또는 tile_group_type이 I이고 qtbtt_dual_tree_intra_flag가 1이고 chroma component를 처리하는 경우, treeType은 DUAL_TREE_CHROMA로 설정될 수 있다.If tile_group_type is I and qtbtt_dual_tree_intra_flag is 1, treeType may be set to DUAL_TREE_CHROMA. Alternatively, when tile_group_type is I and qtbtt_dual_tree_intra_flag is 1 and the chroma component is processed, the treeType may be set to DUAL_TREE_CHROMA.

만약 tile_group_type이 I가 아니거나 qtbtt_dual_tree_intra_flag가 0인 경우, treeType은 SINGLE_TREE로 설정될 수 있다.If tile_group_type is not I or qtbtt_dual_tree_intra_flag is 0, treeType may be set to SINGLE_TREE.

일 실시예를 따르면 qtbtt_dual_tree_intra_flag는 dual tree가 허용되는지 여부를 나타내는 시그날링일 수 있다. Dual tree가 허용된다는 것은 luma와 chroma 성분에 대한 separate coding quad tree syntax structure가 존재하는 것일 수 있다. 더 구체적으로 qtbtt_dual_tree_intra_flag는 현재 picture가 유일한 reference picture인 경우 dual tree가 허용되는지 여부를 나타내는 시그날링일 수 있다. According to an embodiment, qtbtt_dual_tree_intra_flag may be a signaling indicating whether a dual tree is allowed. Allowing the dual tree may mean that there is a separate coding quad tree syntax structure for luma and chroma components. More specifically, qtbtt_dual_tree_intra_flag may be signaling indicating whether a dual tree is allowed when the current picture is the only reference picture.

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

본 발명의 일 실시예를 따르면 chroma 성분의 경우 IBC mode를 사용하지 않을 수 있다. 더 구체적으로 DUAL_TREE_CHROMA인 경우 IBC mode를 사용하지 않을 수 있다.According to an embodiment of the present invention, the IBC mode may not be used for the chroma component. More specifically, in the case of DUAL_TREE_CHROMA, the IBC mode may not be used.

도 33을 참조하면 treeType이 DUAL_TREE_CHROMA가 아닌 경우 pred_mode_ibc_flag를 parsing할 수 있다. 또한 treeType이 DUAL_TREE_CHROMA인 경우 pred_mode_ibc_flag를 parsing하지 않을 수 있다. 일 실시예를 따르면 treeType이 DUAL_TREE_CHROMA인 경우 CuPredMode를 MODE_INTRA로 infer할 수 있다.Referring to FIG. 33, when treeType is not DUAL_TREE_CHROMA, pred_mode_ibc_flag may be parsed. In addition, when the treeType is DUAL_TREE_CHROMA, pred_mode_ibc_flag may not be parsed. According to an embodiment, when the treeType is DUAL_TREE_CHROMA, CuPredMode may be inferred to MODE_INTRA.

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

도 34의 coding unit syntax는 intra prediction과 관련된 syntax를 나타낸 것일 수 있다. 본 발명의 일 실시예를 따르면 intra_chroma_pred_mode 시그날링이 존재할 수 있다. 또한 intra_chroma_pred_mode에 기초하셔 chroma 성분의 intra prediction mode를 결정할 수 있다.The coding unit syntax of FIG. 34 may indicate syntax related to intra prediction. According to an embodiment of the present invention, intra_chroma_pred_mode signaling may exist. In addition, the intra prediction mode of the chroma component may be determined based on the intra_chroma_pred_mode.

도 34를 참조하면 treeType이 SINGLE_TREE이거나 DUAL_TREE_CHROMA인 경우 intra_chroma_pred_mode를 parsing하는 것이 가능하다. 또한 treeType이 DUAL_TREE_LUMA인 경우 intra_chroma_pred_mode를 parsing하지 않는 것이 가능하다.Referring to FIG. 34, when the treeType is SINGLE_TREE or DUAL_TREE_CHROMA, it is possible to pars intra_chroma_pred_mode. Also, when the treeType is DUAL_TREE_LUMA, it is possible not to pars the intra_chroma_pred_mode.

도 35는 본 발명의 일 실시예에 따른 chroma 성분의 intra prediction mode derivation을 나타낸 도면이다.35 is a diagram illustrating intra prediction mode derivation of a chroma component according to an embodiment of the present invention.

도 35를 참조하면 IntraPredModeC는 chroma 성분에 대한 intra prediction mode일 수 있다. 또한 xCb, yCb는 chroma coding block의 top-left sample을 luma location을 기준으로 나타낸 것일 수 있다. 또한 IntraPredModeY는 luma 성분에 대한 intra prediction mode일 수 있다.Referring to FIG. 35, IntraPredModeC may be an intra prediction mode for a chroma component. In addition, xCb and yCb may represent a top-left sample of a chroma coding block based on a luma location. In addition, IntraPredModeY may be an intra prediction mode for a luma component.

본 발명의 일 실시예를 따르면 IntraPredModeC는 IntraPredModeY에 기초하여 결정될 수 있다. 또한 IntraPredModeC는 IntraPredModeY 및 intra_chroma_pred_mode에 기초하여 결정될 수 있다. 이때 IntraPredModeY는 현재 chroma block에 해당하는 luma block에 해당하는 mode일 수 있다. 일 실시예를 따르면 어떤 위치에 대한 IntraPredModeC에 해당하는 IntraPredModeY를 사용하는 위치가 기설정되어있을 수 있다. 일 실시예를 따르면 기설정된 위치는 현재 chroma block의 가운데에 해당하는 luma block 위치일 수 있다. 예를 들어 (xCb, yCb)위치의 IntraPredModeC를 derivation 할 때 (xCb + cbWidth/2, yCb + cbHeight/2) 위치의 IntraPredModeY를 참조할 수 있다. 또는 (xCb, yCb)위치의 IntraPredModeC를 derivation 할 때 기설정된 위치는 xCb 또는 yCb를 기초로 한 위치일 수 있다.According to an embodiment of the present invention, IntraPredModeC may be determined based on IntraPredModeY. In addition, IntraPredModeC may be determined based on IntraPredModeY and intra_chroma_pred_mode. In this case, IntraPredModeY may be a mode corresponding to a luma block corresponding to a current chroma block. According to an embodiment, a location using IntraPredModeY corresponding to IntraPredModeC for a certain location may be preset. According to an embodiment, the preset position may be a luma block position corresponding to the center of the current chroma block. For example, when derivation of IntraPredModeC at position (xCb, yCb), IntraPredModeY at position (xCb + cbWidth/2, yCb + cbHeight/2) can be referenced. Alternatively, when derivation of IntraPredModeC at the (xCb, yCb) position, the preset position may be a position based on xCb or yCb.

어떤 IntraPredModeY 값에 대한 IntraPredModeC 값은 도 35의 Table 8-2 또는 Table 8-3을 참조할 수 있다. Table 8-2는 CCLM을 사용할 수 없는 경우(또는 sps_cclm_enalbed_flag가 0인 경우), Table 8-3은 CCLM을 사용할 수 있는 경우(또는 sps_cclm_enalbed_flag가 1인 경우)에 해당할 수 있다. IntraPredModeY가 어떤 값일 때 도 35에서 그 값에 해당하는 column을 참조할 수 있고, 그 column에서 intra_chroma_pred_mode에 해당하는 값이 IntraPredModeC가 될 수 있다. 예를 들어 IntraPredModeY가 1이고, intra_chroma_pred_mode가 1인 경우 IntraPredModeC는 50일 수 있다.The IntraPredModeC value for a certain IntraPredModeY value may refer to Table 8-2 or Table 8-3 of FIG. 35. Table 8-2 may correspond to a case where CCLM cannot be used (or sps_cclm_enalbed_flag is 0), and Table 8-3 may correspond to a case where CCLM is available (or sps_cclm_enalbed_flag is 1). When IntraPredModeY is a value, a column corresponding to the value may be referred to in FIG. 35, and a value corresponding to intra_chroma_pred_mode in the column may be IntraPredModeC. For example, when IntraPredModeY is 1 and intra_chroma_pred_mode is 1, IntraPredModeC may be 50.

일 실시예를 따르면 sps_cclm_enalbed_flag는 CCLM이 적용될 수 있는지를 나타내는 상위 레벨의 시그날링일 수 있다. 예를 들어 sps_cclm_enalbed_flag가 1인 경우 CCLM이 적용될 수 있는 것일 수 있다. 또한 sps_cclm_enalbed_flag가 0인 경우 CCLM이 적용될 수 없는 것일 수 있다.According to an embodiment, sps_cclm_enalbed_flag may be a higher level signaling indicating whether CCLM can be applied. For example, when sps_cclm_enalbed_flag is 1, CCLM may be applied. In addition, when sps_cclm_enalbed_flag is 0, CCLM may not be applied.

도 35의 IntraPredModeC 값이 81 또는 82 또는 83인 것은 CCLM mode에 해당할 수 있다. 또한 도 35의 sps_cclm_enabled_flag가 0일 때 IntraPredModeC 값이 4인 것은 DM mode에 해당할 수 있다. 또한 도 35의 sps_cclm_enabled_flag가 1일 때 IntraPredModeC 값이 7인 것은 DM mode에 해당할 수 있다.If the IntraPredModeC value of FIG. 35 is 81, 82, or 83, it may correspond to the CCLM mode. In addition, when sps_cclm_enabled_flag of FIG. 35 is 0, an IntraPredModeC value of 4 may correspond to a DM mode. In addition, when sps_cclm_enabled_flag of FIG. 35 is 1, an IntraPredModeC value of 7 may correspond to a DM mode.

또한 intra_chroma_pred_mode를 시그날링하는 bin string 정의가 존재할 수 있다. 예를 들어 DM mode를 가장 적은 비트수의 intra_chroma_pred_mode를 이용해서 나타낼 수 있다. 예를 들어 DM mode를 1-bit의 intra_chroma_pred_mode를 이용해서 나타낼 수 있다.Also, there may be a bin string definition signaling intra_chroma_pred_mode. For example, the DM mode can be expressed by using the intra_chroma_pred_mode with the smallest number of bits. For example, the DM mode can be expressed using 1-bit intra_chroma_pred_mode.

일 실시예를 따르면 sps_cclm_enalbed_flag가 0인 경우, intra_chroma_pred_mode 값 4, 0, 1, 2, 3을 나타내는 비트수를 점점 증가하거나 같을 수 있다. 일 실시예를 따르면 sps_cclm_enalbed_flag가 0인 경우, intra_chroma_pred_mode 값 4, 0, 1, 2, 3을 나타내는 bin string은 각각 0, 100, 101, 110, 111 일 수 있다.According to an embodiment, when sps_cclm_enalbed_flag is 0, the number of bits representing intra_chroma_pred_mode values 4, 0, 1, 2, and 3 may increase or be the same. According to an embodiment, when sps_cclm_enalbed_flag is 0, bin strings representing intra_chroma_pred_mode values 4, 0, 1, 2, and 3 may be 0, 100, 101, 110, 111, respectively.

일 실시예를 따르면 sps_cclm_enalbed_flag가 1인 경우, intra_chroma_pred_mode 값 7, 4, 5, 6, 0, 1, 2, 3을 나타내는 비트수를 점점 증가하거나 같을 수 있다. 일 실시예를 따르면 sps_cclm_enalbed_flag가 1인 경우, intra_chroma_pred_mode 값 7, 4, 5, 6, 0, 1, 2, 3을 나타내는 bin string은 각각 0, 10, 1110, 1111, 11000, 11001, 11010, 11011일 수 있다.According to an embodiment, when sps_cclm_enalbed_flag is 1, the number of bits representing intra_chroma_pred_mode values 7, 4, 5, 6, 0, 1, 2, 3 may be gradually increased or equal. According to an embodiment, when sps_cclm_enalbed_flag is 1, bin strings representing intra_chroma_pred_mode values 7, 4, 5, 6, 0, 1, 2, 3 are 0, 10, 1110, 1111, 11000, 11001, 11010, 11011, respectively. I can.

그러나 설명한 실시예들을 따르면 chroma block에 대한 intra prediction이 용이하지 않은 경우가 발생할 수 있다. 특히 chroma block에 대한 intra prediction mode derivation이 용이하지 않은 경우가 발생할 수 있다. 앞서 설명한 것처럼 chroma block이 intra prediction인 경우 intra prediction mode를 결정하기 위해 해당 luma block에 대한 intra prediction mode를 참조하여야 할 수 있다. 그러나 만약 해당 luma 위치가 intra prediction을 하지 않은 경우, 또는 MODE_INTRA가 아닌 경우가 발생할 수 있다. 예를 들어 해당 luma 위치가 MODE_IBC인 경우 해당하는 luma intra prediction mode가 존재하지 않을 수 있다. 일 실시예를 따르면 SINGLE_TREE인 경우에는 해당하는 luma block과 chroma block이 같은 prediction mode를 사용하는 것이 가능하다. 또한 DUAL_TREE인 경우에는 해당하는 luma block과 chroma block이 다른 prediction mode를 사용하는 것이 가능하다. 또한 I tile group인 경우에 DUAL_TREE를 사용하는 것이 가능하다. 또한 I tile group인 경우에 MODE_INTRA 또는 MODE_IBC를 사용하는 것이 가능하다. 따라서 같은 위치에서 DUAL_TREE_LUMA는 MODE_IBC를 사용하고 DUAL_TREE_CHROMA는 MODE_INTRA를 사용하는 경우가 발생할 수 있다.However, according to the described embodiments, a case in which intra prediction of a chroma block is not easy may occur. In particular, there may be cases where intra prediction mode derivation for a chroma block is not easy. As described above, when the chroma block is intra prediction, it may be necessary to refer to the intra prediction mode for the corresponding luma block in order to determine the intra prediction mode. However, if the corresponding luma location does not perform intra prediction, or if it is not MODE_INTRA, it may occur. For example, when the corresponding luma location is MODE_IBC, the corresponding luma intra prediction mode may not exist. According to an embodiment, in the case of SINGLE_TREE, it is possible for a corresponding luma block and a chroma block to use the same prediction mode. In addition, in the case of DUAL_TREE, it is possible to use different prediction modes for the corresponding luma block and chroma block. Also, it is possible to use DUAL_TREE in the case of I tile group. In addition, it is possible to use MODE_INTRA or MODE_IBC in the case of I tile group. Therefore, it may happen that DUAL_TREE_LUMA uses MODE_IBC and DUAL_TREE_CHROMA uses MODE_INTRA at the same location.

도 36은 본 발명의 일 실시예에 따른 chroma 성분의 intra prediction mode derivation을 나타낸 도면이다.36 is a diagram illustrating intra prediction mode derivation of a chroma component according to an embodiment of the present invention.

도 36의 실시예는 도 35에서 설명한 문제를 해결하기 위한 방법일 수 있다.The embodiment of FIG. 36 may be a method for solving the problem described in FIG. 35.

본 발명의 일 실시예를 따르면 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 기설정된 mode(또는 값)로 설정할 수 있다. 따라서 chroma block에 해당하는 luma 위치가 intra prediction을 사용하지 않은 경우 또는 IBC mode를 사용한 경우에도 IntraPredModeC를 derive하는 것이 가능하다.According to an embodiment of the present invention, if IntraPredModeY does not exist, IntraPredModeY may be set to a preset mode (or value). Therefore, it is possible to derive IntraPredModeC even when the luma position corresponding to the chroma block does not use intra prediction or when the IBC mode is used.

더 구체적으로 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 planar mode(value 0)로 설정하는 것이 가능하다. 이러한 경우 도 35에서 설명한 시그날링 방법에서 planar mode를 적은 비트수를 이용해서 시그날링하는 것이 가능하다.More specifically, when IntraPredModeY does not exist, it is possible to set IntraPredModeY to planar mode (value 0). In this case, in the signaling method described with reference to FIG. 35, it is possible to signal the planar mode using a small number of bits.

또는 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 DC mode(value 1)로 설정하는 것이 가능하다. 이러한 경우 도 35에서 설명한 시그날링 방법에서 DC mode를 적은 비트수를 이용해서 시그날링하는 것이 가능하다.Alternatively, if IntraPredModeY does not exist, it is possible to set IntraPredModeY to DC mode (value 1). In this case, in the signaling method described with reference to FIG. 35, it is possible to signal the DC mode using a small number of bits.

또는 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 vertical mode(value 50)로 설정하는 것이 가능하다. 이러한 경우 도 35에서 설명한 시그날링 방법에서 vertical mode를 적은 비트수를 이용해서 시그날링하는 것이 가능하다.Alternatively, when IntraPredModeY does not exist, it is possible to set IntraPredModeY to vertical mode (value 50). In this case, it is possible to signal using a small number of bits in the vertical mode in the signaling method described in FIG. 35.

또는 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 horizontal mode(value 18)로 설정하는 것이 가능하다. 이러한 경우 도 35에서 설명한 시그날링 방법에서 horizontal mode를 적은 비트수를 이용해서 시그날링하는 것이 가능하다.Alternatively, when IntraPredModeY does not exist, it is possible to set IntraPredModeY to horizontal mode (value 18). In this case, in the signaling method described with reference to FIG. 35, it is possible to signal the horizontal mode using a small number of bits.

또다른 실시예로 IntraPredModeY가 존재하지 않는 경우 intra_chroma_pred_mode 값들에 해당하는 IntraPredModeC 값은 도 35에 나타내지 않은 값으로 정해질 수 있다. 즉, 도 35에서 IntraPredModeY 값이 존재하지 않는 경우의 column이 따로 존재할 수 있다. 예를 들면 intra_chroma_pred_mode 4, 0, 1, 2, 3에 해당하는 IntraPredModeC는 각각 0, 1, 50, 18일 수 있다. 또는 intra_chroma_pred_mode 4, 0, 1, 2, 3에 해당하는 IntraPredModeC는 각각 0, 50, 18, 1일 수 있다. 이것은 sps_cclm_enabled_flag가 0인 경우와 1인 경우 모두에 적용하는 것이 가능하다.In another embodiment, when IntraPredModeY does not exist, IntraPredModeC values corresponding to intra_chroma_pred_mode values may be set to values not shown in FIG. 35. That is, in FIG. 35, a column may exist separately when the IntraPredModeY value does not exist. For example, IntraPredModeC corresponding to intra_chroma_pred_mode 4, 0, 1, 2, and 3 may be 0, 1, 50, and 18, respectively. Alternatively, IntraPredModeC corresponding to intra_chroma_pred_mode 4, 0, 1, 2, and 3 may be 0, 50, 18, and 1, respectively. This can be applied to both the case where sps_cclm_enabled_flag is 0 and 1.

또다른 실시예로 IntraPredModeY가 존재하지 않는 경우 IntraPredModeC를 기설정된 값으로 설정하는 것이 가능하다. 예를 들면 IntraPredModeY가 존재하지 않는 경우 intra_chroma_pred_mode에 상관없이 IntraPredModeC를 기설정된 값으로 설정하는 것이 가능하다. 또한 IntraPredModeY가 존재하지 않는 경우 intra_chroma_pred_mode 값을 항상 0으로 시그날링하는 것이 가능하다. 예를 들면 IntraPredModeY가 존재하지 않는 경우 IntraPredModeC를 planar mode로 설정하는 것이 가능하다. 또는 IntraPredModeY가 존재하지 않는 경우 IntraPredModeC를 CCLM으로 설정하는 것이 가능하다. 또는 IntraPredModeY가 존재하지 않는 경우 IntraPredModeC를 DM mode로 설정하는 것이 가능하다. 또한 IntraPredModeY가 존재하지 않는 경우 도 34에서 설명한 intra_chroma_pred_mode를 parsing하지 않는 것이 가능하다.In another embodiment, when IntraPredModeY does not exist, it is possible to set IntraPredModeC to a preset value. For example, when IntraPredModeY does not exist, it is possible to set IntraPredModeC to a preset value regardless of intra_chroma_pred_mode. In addition, when IntraPredModeY does not exist, it is possible to signal the intra_chroma_pred_mode value to 0 at all times. For example, if IntraPredModeY does not exist, it is possible to set IntraPredModeC to planar mode. Alternatively, if IntraPredModeY does not exist, it is possible to set IntraPredModeC to CCLM. Alternatively, if IntraPredModeY does not exist, it is possible to set IntraPredModeC to DM mode. In addition, when IntraPredModeY does not exist, it is possible not to pars the intra_chroma_pred_mode described in FIG. 34.

또다른 실시예로 IntraPredModeY가 존재하지 않는 경우 IntraPredModeY를 참조하는 위치를 변경하는 것이 가능하다.In another embodiment, when IntraPredModeY does not exist, it is possible to change a position referring to IntraPredModeY.

위 실시예들에서 IntraPredModeY가 존재하지 않는 경우는 chroma intra prediction mode를 derivation할 때 참조하는 해당 luma 위치 MODE_INTRA가 아닌 경우를 의미하는 것도 가능하다. 또는 (xCb, yCb) 위치의 chroma intra prediction mode를 derivation할 때 luma 성분에 해당하는 CuPredMode[ xCb + cbWidth/2][ yCb + cbHeight/2]가 MODE_INTRA가 아닌 경우, 또는 MODE_IBC인 경우를 의미하는 것이 가능하다.In the above embodiments, when IntraPredModeY does not exist, it may mean that it is not the corresponding luma position MODE_INTRA referred to when derivation of the chroma intra prediction mode. Or, when derivation of the chroma intra prediction mode at the (xCb, yCb) position, it means that CuPredMode[ xCb + cbWidth/2][ yCb + cbHeight/2] corresponding to the luma component is not MODE_INTRA or is MODE_IBC. It is possible.

또는 (xCb, yCb) 위치의 chroma intra prediction mode를 derivation할 때 luma 성분에 해당하는 IntraPredModeY[ xCb + cbWidth/2][ yCb + cbHeight/2]가 존재하지 않는 경우를 의미하는 것이 가능하다.Alternatively, it is possible to mean that IntraPredModeY[xCb + cbWidth/2][ yCb + cbHeight/2] corresponding to the luma component does not exist when derivation of the chroma intra prediction mode at the (xCb, yCb) position.

도 36을 참조하면 IntraPredModeC[ xCb ][ yCb ]를 derive할 때 IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ]가 존재하지 않으면 IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ]를 기설정된 값으로 설정할 수 있다. 그리고 IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ] 및 도 35에서 설명한 Table을 참조하여 IntraPredModeC를 derive할 수 있다.Referring to FIG. 36, when IntraPredModeC[xCb][yCb] is derived, if IntraPredModeY[xCb + cbWidth/2][yCb + cbHeight/2] does not exist, IntraPredModeY[xCb + cbWidth/2][ yCb + cbHeight/2] Can be set to a preset value. In addition, IntraPredModeC may be derived with reference to IntraPredModeY[xCb + cbWidth/2][yCb + cbHeight/2] and the table described in FIG. 35.

또한 IntraPredModeC[ xCb ][ yCb ]를 derive할 때 IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ]가 존재하는 경우, IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ] 및 도 35에서 설명한 Table을 참조하여 IntraPredModeC를 derive할 수 있다.Also, when IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2] exists when derive IntraPredModeC[ xCb ][ yCb ], IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2] and Fig. 35 IntraPredModeC can be derived by referring to the table described above.

본 발명의 일 실시예를 따르면 chroma block을 prediction할 때 해당 luma block이 IBC mode를 사용한 경우 prediction mode가 제한될 수 있다. 더 구체적으로 chroma block을 intra prediction할 때 해당 luma block이 IBC mode를 사용한 경우 intra prediction mode가 제한될 수 있다. 예를 들어 이러한 경우 DM mode를 사용하지 않는 것이 가능하다. 해당하는 luma block과 chroma block가 다른 mode를 사용한 경우 둘 간의 유사성이 떨어질 수 있기 때문이다.According to an embodiment of the present invention, when a corresponding luma block uses an IBC mode when predicting a chroma block, the prediction mode may be limited. More specifically, when intra prediction of a chroma block, the intra prediction mode may be limited when the corresponding luma block uses the IBC mode. In this case, for example, it is possible not to use the DM mode. This is because if the corresponding luma block and chroma block use different modes, the similarity between the two may be inferior.

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

본 발명의 일 실시예를 따르면 chroma block에 대한 motion information이 luma block에 대한 motion information과 따로 존재할 수 있다. 예를 들어 chroma block이 IBC mode를 사용하는 경우 chroma block에 대한 motion information이 luma block에 대한 motion information과 따로 존재할 수 있다.According to an embodiment of the present invention, motion information for a chroma block may exist separately from motion information for a luma block. For example, when the chroma block uses the IBC mode, motion information for the chroma block may exist separately from motion information for the luma block.

도 37을 참조하면 treeType이 DUAL_TREE_CHROMA인 경우 motion information 관련 syntax element를 parsing하는 것이 가능하다. 예를 들어 treeType이 DUAL_TREE_CHROMA이고 CuPredMode가 MODE_IBC인 경우 motion information 관련 syntax element를 parsing하는 것이 가능하다. 상기 motion information 관련 syntax element는 merge_flag, merge_data 안의 syntax element, mvp_l0_flag, amvr_4pel_flag 등을 포함할 수 있다.Referring to FIG. 37, when the treeType is DUAL_TREE_CHROMA, it is possible to pars the syntax element related to motion information. For example, when treeType is DUAL_TREE_CHROMA and CuPredMode is MODE_IBC, it is possible to pars the syntax element related to motion information. The motion information related syntax element may include a merge_flag, a syntax element in merge_data, mvp_l0_flag, amvr_4pel_flag, and the like.

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

본 발명의 일 실시예를 따르면 block size에 기반하여 prediction mode가 제한될 수 있다. 즉, block size에 기반하여 CuPredMode가 제한적일 수 있다. 예를 들면 inter prediction이 제한될 수 있다. 이것은 memory bandwidth 또는 computational complexity를 낮추기 위한 것일 수 있다. 예를 들면 작은 size의 block에서 prediction mode가 제한될 수 있다. 예를 들어 threshold 이하의 size의 block에서 prediction mode가 제한될 수 있다. 예를 들어 threshold는 4x4 size일 수 있다. 즉, 구체적인 실시예에서 4x4 이하 크기의 block에서 inter prediction이 사용되지 않을 수 있다.According to an embodiment of the present invention, a prediction mode may be limited based on a block size. That is, CuPredMode may be limited based on the block size. For example, inter prediction may be limited. This could be to lower the memory bandwidth or computational complexity. For example, the prediction mode may be limited in blocks of small size. For example, the prediction mode may be limited in blocks of sizes less than the threshold. For example, the threshold may be 4x4 size. That is, in a specific embodiment, inter prediction may not be used in a block having a size of 4x4 or less.

또다른 실시예로 설명한 제한되는 prediction mode는 bi-prediction하는 inter prediction일 수 있다. 예를 들어 threshold 이하의 block size에서 bi-prediction이 사용되지 않을 수 있다. 이때 threshold는 4x8 또는 8x4 이하를 나타낼 수 있다. 예를 들어 threshold는 (width + height)가 12일 수 있다. 만약 bi-prediction이 제한되는 경우 bi-prediction을 uni-prediction으로 전환하는 과정이 존재하는 것이 가능하다. 또는 bi-prediction이 제한되는 경우 prediction 방향 또는 어떤 reference list를 쓰는지 나타내는 값이 제한적일 수 있다.The limited prediction mode described as another embodiment may be bi-prediction inter prediction. For example, bi-prediction may not be used in a block size below a threshold. In this case, the threshold may represent 4x8 or 8x4 or less. For example, the threshold (width + height) may be 12. If bi-prediction is restricted, it is possible that a process of converting bi-prediction to uni-prediction exists. Alternatively, when bi-prediction is limited, a value indicating a prediction direction or a reference list to be used may be limited.

설명한 것처럼 prediction mode가 제한될 수 있고, 이에 따라 효율적인 시그날링을 위해 앞선 도면들에서 설명한 것과 다른 syntax structure를 사용할 수 있다.As described above, the prediction mode may be limited, and accordingly, a syntax structure different from that described in the preceding drawings may be used for efficient signaling.

본 발명의 일 실시예를 따르면 MODE_INTRA인 경우에는 skip mode를 사용하지 않을 수 있다. 따라서 MODE_INTRA인 경우에 cu_skip_flag가 0일 수 있다. 따라서 만약 cu_skip_flag가 1인 경우에 MODE_INTRA가 아닌 것으로 판단할 수 있다.According to an embodiment of the present invention, in the case of MODE_INTRA, the skip mode may not be used. Therefore, in the case of MODE_INTRA, cu_skip_flag may be 0. Therefore, if cu_skip_flag is 1, it can be determined that it is not MODE_INTRA.

도 38을 참조하면 tile group type이 I가 아니거나 sps_ibc_enabled_flag가 1인 경우에 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하는 것이 가능하다. 또한 이때 추가적인 conditions를 고려하여 parsing할 수 있다. 즉, tile group type이 I이고 sps_ibc_enabled_flag가 0인 경우에는 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하지 않을 수 있다. 일 실시예를 따르면 CuPredMode는 MODE_INTRA, MODE_INTER, MODE_IBC 중 하나의 값일 수 있다. 만약 tile group type이 I인 경우 가능한 CuPredMode 값은 MODE_INTRA 또는 MODE_IBC일 수 있다. 그러나 MODE_IBC가 제한된 경우, 예를 들면 sps_ibc_enalbed_flag가 0인 경우에 가능한 CuPredMode 값은 MODE_INTRA 뿐일 수 있다. 따라서 tile group type이 I이고 sps_ibc_enabled_flag가 0인 경우에는 pred_mode_flag, pred_mode_ibc_flag를 parsing하지 안ㅇㅎ고 CuPredMode를 MODE_INTRA로 판단할 수 있다. 또한 앞서 설명한 것처럼 cu_skip_flag를 0으로 판단할 수 있다.Referring to FIG. 38, when the tile group type is not I or sps_ibc_enabled_flag is 1, it is possible to pars cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag. Also, at this time, parsing can be performed by considering additional conditions. That is, when the tile group type is I and sps_ibc_enabled_flag is 0, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be parsed. According to an embodiment, CuPredMode may be one of MODE_INTRA, MODE_INTER, and MODE_IBC. If the tile group type is I, a possible CuPredMode value may be MODE_INTRA or MODE_IBC. However, when MODE_IBC is limited, for example, when sps_ibc_enalbed_flag is 0, the only possible CuPredMode value may be MODE_INTRA. Therefore, when the tile group type is I and sps_ibc_enabled_flag is 0, pred_mode_flag and pred_mode_ibc_flag are not parsed, and CuPredMode can be determined as MODE_INTRA. Also, as described above, cu_skip_flag may be determined as 0.

본 발명의 일 실시예를 따르면 block size에 기초하여 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing할 수 있다.According to an embodiment of the present invention, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may be parsed based on the block size.

예를 들어 inter prediction이 제한되는 block size이고, IBC 사용이 불가한 경우 cu_skip_flag를 parsing하지 않을 수 있다. 즉, inter prediction를 사용할 수 있는 block size이거나 IBC 사용이 가능한 경우 cu_skip_flag를 parsing하는 것이 가능하다. 만약 inter prediction이 제한되는 block size이고, IBC 사용이 불가한 경우에는 CuPredMode를 MODE_INTRA로 판단할 수 있다. 이러한 경우 cu_skip_flag 값을 0으로 판단, infer할 수 있다. 일 실시예로 inter prediction이 제한되는 block size는 4x4 block 일 수 있다. 또한 IBC 사용이 불가한 경우는 sps_ibc_enabled_flag가 0인 경우일 수 있다.For example, if inter prediction is a block size for which inter prediction is limited, and if IBC cannot be used, cu_skip_flag may not be parsed. In other words, it is possible to pars the cu_skip_flag when the block size that can use inter prediction or when the IBC can be used. If the inter prediction is a limited block size and IBC cannot be used, CuPredMode may be determined as MODE_INTRA. In this case, the cu_skip_flag value may be determined as 0 and inferred. In an embodiment, the block size for which inter prediction is limited may be a 4x4 block. In addition, when the IBC is not available, sps_ibc_enabled_flag may be 0.

본 발명의 일 실시예를 따르면 inter prediction이 제한되는 block size이면 pred_mode_flag를 parsing하지 않을 수 있다. 본 발명의 일 실시예를 따르면 pred_mode_flag 값에 기초하여 CuPredMode가 MODE_INTRA인지 MODE_INTER인지 결정하는 것이 가능하다. 만약 inter prediction이 제한되는 block size이면 pred_mode_flag를 CuPredMode가 MODE_INTRA를 나타내는 값인 것으로 판단할 수 있다. 또한 CuPredMode는 pred_mode_ibc_flag에 기초해서 변경될 수 있다. 즉, CuPredMode는 pred_mode_flag 및 pred_mode_ibc_flag에 기초하여 결정될 수 있고, pred_mode_flag에만 기초하여 결정한 CuPredMode를 pred_mode_ibc_flag에 기초하여 변경할 수 있다. 일 실시예를 따르면 pred_mode_ibc_flag 값에 따라 CuPredMode가 MODE_IBC인지, pred_mode_flag에만 기초하여 결정한 값인지 결정할 수 있다.According to an embodiment of the present invention, if the inter prediction is a limited block size, pred_mode_flag may not be parsed. According to an embodiment of the present invention, it is possible to determine whether CuPredMode is MODE_INTRA or MODE_INTER based on the value of pred_mode_flag. If the inter prediction is a limited block size, it may be determined that pred_mode_flag is a value in which CuPredMode represents MODE_INTRA. Also, CuPredMode may be changed based on pred_mode_ibc_flag. That is, CuPredMode may be determined based on pred_mode_flag and pred_mode_ibc_flag, and CuPredMode determined based only on pred_mode_flag may be changed based on pred_mode_ibc_flag. According to an embodiment, it may be determined whether CuPredMode is MODE_IBC or a value determined based only on pred_mode_flag according to the pred_mode_ibc_flag value.

만약 inter prediction이 제한되지 않는 block size이면 pred_mode_flag를 parsing하는 것이 가능하다. 이때 추가적인 조건을 고려할 수 있다. 예를 들어 cu_skip_flag 또는 tile group type에 기초하여 pred_mode_flag parsing 여부를 결정할 수 있다. 설명한 것처럼 pred_mode_flag는 CuPredMode가 MODE_INTRA인지 MODE_INTER인지 결정하는 값일 수 있는데 cu_skip_flag 또는 tile group type에 기초하여 CuPredMode가 제한되는 경우가 발생할 수 있기 때문이다. 예를 들어 tile group type이 I인 경우 CuPredMode가 MODE_INTRA 값만 가능할 수 있다. 또한 tile group type이 I가 아닌 경우, 즉 tile group type이 P or B인 경우 CuPredMode가 MODE_INTRA와 MODE_INTER 모두 가능할 수 있다. 그러나 만약 tile group type이 I가 아닌 경우 cu_skip_flag가 1인 경우 CuPredMode가 MODE_INTER 값만 가능할 수 있다. 따라서 본 발명의 일 실시예를 따르면 cu_skip_flag가 1이거나 tile group type이 I인 경우에는 pred_mode_flag를 parsing하지 않을 수 있다. 따라서 본 발명의 일 실시예를 따르면 tile group type이 I인 경우에는 pred_mode_flag 또는 CuPredMode를 MODE_INTRA를 나타내는 값으로 infer할 수 있다. 또한 tile group type이 P or B인 경우에는 pred_mode_flag 또는 CuPredMode를 MODE_INTER를 나타내는 값으로 infer할 수 있다.If the inter prediction is an unrestricted block size, it is possible to pars the pred_mode_flag. At this time, additional conditions can be considered. For example, whether to parsing pred_mode_flag may be determined based on cu_skip_flag or tile group type. As described, pred_mode_flag may be a value that determines whether CuPredMode is MODE_INTRA or MODE_INTER, because CuPredMode may be restricted based on cu_skip_flag or tile group type. For example, when the tile group type is I, only the value of MODE_INTRA for CuPredMode may be possible. In addition, when the tile group type is not I, that is, when the tile group type is P or B, CuPredMode may be both MODE_INTRA and MODE_INTER. However, if the tile group type is not I, and cu_skip_flag is 1, only the value of MODE_INTER for CuPredMode may be possible. Therefore, according to an embodiment of the present invention, when cu_skip_flag is 1 or tile group type is I, pred_mode_flag may not be parsed. Accordingly, according to an embodiment of the present invention, when the tile group type is I, pred_mode_flag or CuPredMode may be inferred to a value indicating MODE_INTRA. In addition, when the tile group type is P or B, pred_mode_flag or CuPredMode may be inferred to a value indicating MODE_INTER.

일 실시예로 inter prediction이 제한되는 block size는 4x4 block 일 수 있다. 또는 inter prediction이 제한되는 block size는 4x4 이하의 block 일 수 있다.In an embodiment, the block size for which inter prediction is limited may be a 4x4 block. Alternatively, the block size for which inter prediction is limited may be a block of 4x4 or less.

또한 inter prediction이 제한되는 block size에 기초하여 pred_mode_ibc_flag를 parsing할 수 있다. 또한 cu_skip_flag에 기초하여 pred_mode_ibc_flag를 parsing할 수 있다. 일 실시예를 따르면 inter prediction이 제한되는 block size이고, cu_skip_flag가 1인 경우 pred_mode_ibc_flag를 parsing하지 않을 수 있다. 앞서 설명한 것처럼 inter prediction이 제한되는 block size에서는 CuPredMode가 MODE_INTER가 아닐 수 있다. 또한 cu_skip_flag가 1인 경우 CuPredMode가 MODE_IBC가 아닐 수 있다. 따라서 inter prediction이 제한되는 block size이고, cu_skip_flag가 1인 경우 pred_mode_ibc_flag 또는 CuPredMode를 MODE_IBC로 판단, infer할 수 있다. 또한 이것은 MODE_IBC로 설정하는 것이 가능한 경우일 수 있다. 예를 들어 sps_ibc_enabled_flag가 1인 경우 MODE_IBC로 설정하는 것이 가능한 것일 수 있다. 따라서 inter prediction이 제한되는 block size이고, cu_skip_flag가 1인 경우 pred_mode_ibc_flag 또는 CuPredMode를 sps_ibc_enabled_flag에 따라 판단, infer할 수 있다. 더 구체적으로 inter prediction이 제한되는 block size이고, cu_skip_flag가 1인 경우 pred_mode_ibc_flag를 sps_ibc_enabled_flag로 infer할 수 있다. 또한 inter prediction이 제한되지 않는 block size이거나 cu_skip_flag가 0인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다.In addition, pred_mode_ibc_flag may be parsed based on the block size in which inter prediction is limited. In addition, pred_mode_ibc_flag may be parsed based on cu_skip_flag. According to an embodiment, when the inter prediction is a block size that is limited and cu_skip_flag is 1, pred_mode_ibc_flag may not be parsed. As described above, in a block size where inter prediction is limited, CuPredMode may not be MODE_INTER. In addition, when cu_skip_flag is 1, CuPredMode may not be MODE_IBC. Therefore, if the inter prediction is a block size that is limited, and cu_skip_flag is 1, pred_mode_ibc_flag or CuPredMode may be determined as MODE_IBC and inferred. Also, this may be a case where setting with MODE_IBC is possible. For example, when sps_ibc_enabled_flag is 1, it may be possible to set it to MODE_IBC. Therefore, when the inter prediction is a block size that is limited, and cu_skip_flag is 1, pred_mode_ibc_flag or CuPredMode may be determined and inferred according to sps_ibc_enabled_flag. More specifically, when the inter prediction is a block size limited, and cu_skip_flag is 1, pred_mode_ibc_flag may be inferred to sps_ibc_enabled_flag. In addition, it is possible to pars pred_mode_ibc_flag when inter prediction is an unrestricted block size or cu_skip_flag is 0.

또한 tile group type이 I이고 cu_skip_flag가 1인 경우 pred_mode_ibc_flag를 parsing하지 않는 것이 가능하다. 또한 이때 pred_mode_ibc_flag 또는 CuPredMode를 MODE_IBC를 나타내는 값으로 판단, infer하는 것이 가능하다. I tile group에서 가능한 CuPredMode 값은 MODE_INTRA, MODE_IBC인데, MODE_INTRA일 때는 skip mode를 사용하지 않기 때문일 수 있다. 따라서 tile group type이 I이고 cu_skip_flag가 0인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다. Also, when the tile group type is I and cu_skip_flag is 1, it is possible not to pars the pred_mode_ibc_flag. In addition, at this time, it is possible to determine and infer pred_mode_ibc_flag or CuPredMode as a value indicating MODE_IBC. The possible CuPredMode values in the I tile group are MODE_INTRA and MODE_IBC, but it may be because skip mode is not used when it is MODE_INTRA. Therefore, when the tile group type is I and cu_skip_flag is 0, it is possible to pars the pred_mode_ibc_flag.

또한 tile group type이 I가 아닌 경우, CuPredMode가 MODE_INTRA이고, inter prediction이 제한되는 block size가 아닌 경우 pred_mode_ibc_flag를 parsing하지 않을 수 있다. 이러한 경우 pred_mode_ibc_flag 없이 prediction mode를 결정할 수 있기 때문일 수 있다. 또한 tile group type이 I가 아닌 경우, CuPredMode가 MODE_INTRA가 아니거나 inter prediction이 제한되는 block size인 경우 pred_mode_ibc_flag를 parsing할 수 있다. 또한 이때 추가적인 조건을 고려하여 pred_mode_ibc_flag를 parsing할 수 있다. 예를 들어 tile group type이 I가 아닌 경우, CuPredMode가 MODE_INTRA인 경우 inter prediction이 제한되는 block인 경우 pred_mode_ibc_flag를 parsing하는 것이 가능하다. Inter prediction이 제한되더라도 최종적인 prediction mode는 MODE_INTRA 또는 MODE_IBC로 결정될 수 있기 때문이다. 이때 추가적으로 cu_skip_flag가 0인 경우에 pred_mode_ibc_flag를 parsing하는 것이 가능하다.In addition, when the tile group type is not I, the CuPredMode is MODE_INTRA, and the pred_mode_ibc_flag may not be parsed when the inter prediction is not a limited block size. In this case, it may be because the prediction mode can be determined without pred_mode_ibc_flag. In addition, when the tile group type is not I, when CuPredMode is not MODE_INTRA or is a block size in which inter prediction is limited, pred_mode_ibc_flag may be parsed. Also, in this case, pred_mode_ibc_flag may be parsed in consideration of additional conditions. For example, when the tile group type is not I, when the CuPredMode is MODE_INTRA, the pred_mode_ibc_flag can be parsed when the inter prediction is a block. This is because even if the inter prediction is limited, the final prediction mode can be determined as MODE_INTRA or MODE_IBC. In this case, it is possible to additionally pars pred_mode_ibc_flag when cu_skip_flag is 0.

일 실시예로 inter prediction이 제한되는 block size는 4x4 block 일 수 있다. 또는 inter prediction이 제한되는 block size는 4x4 이하의 block 일 수 있다.In an embodiment, the block size for which inter prediction is limited may be a 4x4 block. Alternatively, the block size for which inter prediction is limited may be a block of 4x4 or less.

도 39는 본 발명의 일 실시예에 따른 시그날링 값 infer 방법을 나타낸 도면이다.39 is a diagram illustrating a signaling value infer method according to an embodiment of the present invention.

도 39를 참조하면 도 38에서 설명한 것과 같이 pred_mode_flag 또는 pred_mode_ibc_flag를 infer할 수 있다. 또는 도 38에서 설명한 것과 같이 CuPredMode를 결정할 수 있다. 또한 도 39의 pred_mode_flag, pred_mode_ibc_flag는 각각 도 38의 pred_mode_flag, pred_mode_ibc_flag와 같은 시그날링일 수 있다.Referring to FIG. 39, as described in FIG. 38, pred_mode_flag or pred_mode_ibc_flag may be inferred. Alternatively, as described with reference to FIG. 38, CuPredMode may be determined. In addition, pred_mode_flag and pred_mode_ibc_flag of FIG. 39 may be the same signaling as pred_mode_flag and pred_mode_ibc_flag of FIG. 38, respectively.

본 발명의 일 실시예를 따르면 pred_mode_flag 값에 기초하여 CuPredMode를 MODE_INTER 또는 MODE_INTRA로 결정할 수 있다. 이 값을 MODE_TEMP라고 하면, pred_mode_ibc_flag 값에 기초하여 CuPredMode를 MODE_TEMP 또는 MODE_IBC로 결정할 수 있다.According to an embodiment of the present invention, CuPredMode may be determined as MODE_INTER or MODE_INTRA based on a value of pred_mode_flag. If this value is called MODE_TEMP, CuPredMode may be determined as MODE_TEMP or MODE_IBC based on the value of pred_mode_ibc_flag.

도 38에서 설명한 것처럼 inter prediction이 제한되는 block size인 경우에 pred_mode_flag를 MODE_INTRA를 나타내는 값으로 infer할 수 있다. 즉, inter prediction이 제한되는 block size인 경우에 pred_mode_flag를 1로 infer할 수 있다. 도 39를 참조하면 block size가 4x4인 경우에 pred_mode_flag 값을 1로 infer할 수 있다.As described in FIG. 38, in the case of a block size in which inter prediction is limited, pred_mode_flag may be inferred to a value indicating MODE_INTRA. That is, when the inter prediction is a limited block size, pred_mode_flag may be inferred to 1. Referring to FIG. 39, when the block size is 4x4, a value of pred_mode_flag may be inferred to 1.

또한 도 38에서 설명한 것처럼 inter prediction이 제한되는 block size이고, skip mode인 경우에 pred_mode_ibc_flag를 MODE_IBC를 나타내는 값으로 infer할 수 있다. 이것은 MODE_IBC를 사용하는 것이 가능한 경우일 수 있다. 예를 들어 MODE_IBC를 사용하는 것이 가능한 것은 sps_ibc_enabled_flag가 1인 경우일 수 있다. 예를 들어 inter prediction이 제한되는 block size이고, skip mode인 경우에 pred_mode_ibc_flag를 sps_ibc_enabled_flag 값으로 infer할 수 있다. 도 39를 참조하면 block size가 4x4이고, skip mode인 경우에 pred_mode_ibc_flag를 sps_ibc_enabled_flag 값으로 infer할 수 있다.In addition, as described with reference to FIG. 38, in the case of a block size in which inter prediction is limited, and in skip mode, pred_mode_ibc_flag may be inferred to a value indicating MODE_IBC. This may be the case where it is possible to use MODE_IBC. For example, it is possible to use MODE_IBC when sps_ibc_enabled_flag is 1. For example, in the case of a block size in which inter prediction is limited, and in skip mode, pred_mode_ibc_flag may be inferred as sps_ibc_enabled_flag value. Referring to FIG. 39, when the block size is 4x4 and in skip mode, pred_mode_ibc_flag may be inferred as sps_ibc_enabled_flag value.

도 40은 본 발명의 일 실시예에 따른 시그날링 값 infer 방법을 나타낸 도면이다.40 is a diagram illustrating a signaling value infer method according to an embodiment of the present invention.

도 38 내지 도 39에서 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag, CuPredMode를 parsing하거나 infer하거나 결정하는 방법을 설명하였다. 그러나 도 39에서 나타낸 infer 방법에서 conflict가 있는 경우가 발생할 수 있다.In FIGS. 38 to 39, a method of parsing, infering, or determining cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag, and CuPredMode has been described. However, there may be a conflict in the infer method shown in FIG. 39.

예를 들어 inter prediction이 제한되는 block size이고, tile group type이 P or B인 경우에 pred_mode_flag 값을 infer하기 어려울 수 있다. 도 39에서 pred_mode_flag 값을 두 가지 값 중 하나로 infer할 수 있는데 두 경우를 모두 만족할 수 있다.For example, when inter prediction is a limited block size and a tile group type is P or B, it may be difficult to infer a value of pred_mode_flag. In FIG. 39, the pred_mode_flag value may be inferred to one of two values, and both cases may be satisfied.

또한 inter prediction이 제한되는 block size이고, skip mode이고, tile group type이 P or B인 경우에 pred_mode_ibc_flag 값을 infer하기 어려울 수 있다. 도 39에서 pred_mode_ibc_flag 값을 두 가지 값 중 하나로 infer할 수 있는데 두 경우를 모두 만족할 수 있다.In addition, it may be difficult to infer a pred_mode_ibc_flag value when inter prediction is a limited block size, skip mode, and tile group type P or B. In FIG. 39, the pred_mode_ibc_flag value may be inferred to one of two values, and both cases may be satisfied.

도 40은 이 문제를 해결하기 위한 실시예일 수 있다.40 may be an embodiment for solving this problem.

Tile group type이 P or B인 경우 가능한 prediction mode는 MODE_INTRA, MODE_INTER, MODE_IBC인 것이 가능하다. 만약 이때 inter prediction이 제한되는 block size인 경우에 MODE_INTRA, MODE_INTER, MODE_IBC 중 MODE_INTER를 이용할 수 없을 수 있다. 따라서 본 발명의 일 실시예를 따르면 이 경우에 pred_mode_flag를 MODE_INTRA를 나타내는 값으로 infer하는 것이 가능하다. MODE_IBC 결정은 pred_mode_ibc_flag를 통해서 하는 것이 가능하기 때문이다. 따라서 다음과 같이 정리할 수 있다.When the tile group type is P or B, possible prediction modes are MODE_INTRA, MODE_INTER, and MODE_IBC. In this case, if the inter prediction is a limited block size, MODE_INTER among MODE_INTRA, MODE_INTER, and MODE_IBC may not be used. Therefore, according to an embodiment of the present invention, in this case, it is possible to infer pred_mode_flag to a value indicating MODE_INTRA. This is because it is possible to determine MODE_IBC through pred_mode_ibc_flag. Therefore, it can be summarized as follows.

만약 tile group type이 I 이거나 inter prediction이 제한되는 block size인 경우에 pred_mode_flag를 MODE_INTRA를 나타내는 값으로 infer할 수 있다. 또한 1) tile group type이 P or B이고, 2) inter prediction이 제한되는 block size가 아닌 경우에 pred_mode_flag를 MODE_INTER를 나타내는 값으로 infer할 수 있다.If the tile group type is I or the block size for which inter prediction is limited, pred_mode_flag may be inferred to a value indicating MODE_INTRA. In addition, when 1) tile group type is P or B, and 2) inter prediction is not a limited block size, pred_mode_flag may be inferred to a value indicating MODE_INTER.

Tile group type이 P or B인 경우 가능한 prediction mode는 MODE_INTRA, MODE_INTER, MODE_IBC인 것이 가능하다. 만약 이때 inter prediction이 제한되는 block size인 경우에 MODE_INTRA, MODE_INTER, MODE_IBC 중 MODE_INTER를 이용할 수 없을 수 있다. 또한 skip mode인 경우에 MODE_INTRA, MODE_INTER, MODE_IBC 중 MODE_INTRA를 이용할 수 없을 수 있다. 따라서 tile group type이 P or B이고, inter prediction이 제한되는 block size이고, skip mode인 경우에 MODE_IBC만을 사용할 수 있을 수 있다. 따라서 이 경우에 pred_mode_ibc_flag를 1로 infer하는 것이 가능하다. 따라서 다음과 같이 정리할 수 있다.When the tile group type is P or B, possible prediction modes are MODE_INTRA, MODE_INTER, and MODE_IBC. In this case, if the inter prediction is a limited block size, MODE_INTER among MODE_INTRA, MODE_INTER, and MODE_IBC may not be used. Also, in the case of skip mode, MODE_INTRA among MODE_INTRA, MODE_INTER, and MODE_IBC may not be used. Therefore, when the tile group type is P or B, the block size in which inter prediction is limited, and in the skip mode, only MODE_IBC can be used. Therefore, in this case, it is possible to infer pred_mode_ibc_flag to 1. Therefore, it can be summarized as follows.

만약 1) tile group type이 I이거나 2) inter prediction이 제한되는 block size이고 skip mode인 경우에 pred_mode_ibc_flag를 MODE_IBC를 나타내는 값, 예를 들면 1로 infer할 수 있다. 또한 i) tile group type이 P or B이고 ii) inter prediction이 제한되는 block size가 아니거나 skip mode가 아닌 경우에 pred_mode_ibc_flag를 MODE_IBC를 나타내지 않는 값, 예를 들면 0으로 infer할 수 있다.If 1) tile group type is I or 2) inter prediction is limited block size and is in skip mode, pred_mode_ibc_flag may be inferred to a value indicating MODE_IBC, for example, 1. In addition, when i) tile group type is P or B and ii) inter prediction is not restricted block size or is not in skip mode, pred_mode_ibc_flag may be inferred to a value that does not indicate MODE_IBC, for example, 0.

일 실시예로 inter prediction이 제한되는 block size는 4x4 block 일 수 있다. 또는 inter prediction이 제한되는 block size는 4x4 이하의 block 일 수 있다.In an embodiment, the block size for which inter prediction is limited may be a 4x4 block. Alternatively, the block size for which inter prediction is limited may be a block of 4x4 or less.

도 40은 설명한 pred_mode_flag, pred_mode_ibc_flag infer 방법을 inter prediction이 제한되는 block size가 4x4인 경우의 예로 나타내고 있다.FIG. 40 shows an example of the pred_mode_flag and pred_mode_ibc_flag infer methods described in the case where the block size in which inter prediction is limited is 4x4.

또한 설명한 발명들에서 tile group type은 slice type일 수 있다.In addition, in the described inventions, the tile group type may be a slice type.

또한 skip mode인지 여부는 cu_skip_flag를 통해 결정될 수 있다.Also, whether the skip mode is performed may be determined through cu_skip_flag.

도 41은 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.41 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.

도 38에서 설명한 것처럼 block size에 기초하여 bi-prediction이 사용되지 않을 수 있다. 따라서 본 발명의 일 실시예에 따라서 어떤 block size에서는 가능한 inter prediction이 L0 uni-prediction, L1 uni-prediction, bi-prediction일 수 있고, 어떤 block size에서는 가능한 inter prediction이 L0 uni-prediction, L1 uni-prediction일 수 있다. 또한 어떤 inter prediction인지 inter_pred_idc를 통해 나타내는 것이 가능하다. 또한 L0 uni-prediction은 reference list 0만을 사용하는 inter prediction일 수 있다. 또한 L1 uni-prediction은 reference list 1만을 사용하는 inter prediction일 수 있다. 또한 bi-prediction은 reference list 0과 reference list 1을 모두 사용하는 inter prediction일 수 있다. 또한 어떤 inter prediction인지는 CU 별로 결정되는 것이 가능하다. 또한 L0 uni-prediction, L1 uni-prediction, bi-prediction을 나타내는 inter_pred_idc 값은 각각 PRED_L0, PRED_L1, PRED_BI일 수 있다. 또한 L0 uni-prediction, L1 uni-prediction, bi-prediction을 나타내는 inter_pred_idc 값은 각각 0, 1, 2일 수 있다.As described in FIG. 38, bi-prediction may not be used based on the block size. Therefore, according to an embodiment of the present invention, possible inter prediction in a certain block size may be L0 uni-prediction, L1 uni-prediction, and bi-prediction, and in certain block sizes, possible inter prediction is L0 uni-prediction, L1 uni- It can be prediction. In addition, it is possible to indicate which inter prediction is through inter_pred_idc. Also, the L0 uni-prediction may be an inter prediction using only reference list 0. Also, the L1 uni-prediction may be an inter prediction using only reference list 1. Also, the bi-prediction may be an inter prediction using both reference list 0 and reference list 1. Also, it is possible to determine which inter prediction is for each CU. In addition, inter_pred_idc values representing L0 uni-prediction, L1 uni-prediction, and bi-prediction may be PRED_L0, PRED_L1, and PRED_BI, respectively. In addition, inter_pred_idc values representing L0 uni-prediction, L1 uni-prediction, and bi-prediction may be 0, 1, and 2, respectively.

본 발명의 일 실시예를 따르면 bi-prediction이 사용되지 않는 block size의 경우에는 bi-prediction에 해당하는 inter_pred_idc 값이 존재하지 않을 수 있다.According to an embodiment of the present invention, in the case of a block size in which bi-prediction is not used, an inter_pred_idc value corresponding to bi-prediction may not exist.

또한 inter_pred_idc를 나타내기 위한 binarization 방법이 존재할 수 있다. 또한 이 방법은 bi-prediction이 허용되는 block과 허용되지 않는 block에서 다를 수 있다. 또한 이것은 inter_pred_idc를 parsing하는 경우에 사용하는 bin string일 수 있다. 만약 bi-prediction이 허용되는 경우에 inter_pred_idc로 L0 uni-prediction 또는 L1 uni-prediction 또는 bi-prediction에 해당하는 값들이 가능할 수 있다. 이를 나타내기 위해 inter_pred_idc를 variable length binarization 방법으로 나타낼 수 있다. 예를 들어 L0 uni-prediction, L1 uni-prediction, bi-prediction에 해당하는 값을 각각 00, 01, 1로 나타낼 수 있다. 또는 L0 uni-prediction, L1 uni-prediction, bi-prediction에 해당하는 값을 각각 10, 11, 0으로 나타낼 수 있다. 또한 만약 bi-prediction이 허용되지 않는 경우에 inter_pred_idc로 L0 uni-prediction 또는 L1 uni-prediction에 해당하는 값들이 가능할 수 있다. 따라서 inter_pred_idc를 1-bit로 나타낼 수 있다. 예를 들어 L0 uni-prediction, L1 uni-prediction에 해당하는 값을 각각 0, 1로 나타낼 수 있다. 또는 L0 uni-prediction, L1 uni-prediction에 해당하는 값을 각각 1, 0로 나타낼 수 있다.In addition, there may be a binarization method to indicate inter_pred_idc. In addition, this method may be different for blocks in which bi-prediction is allowed and blocks that are not allowed. Also, this may be a bin string used when parsing inter_pred_idc. If bi-prediction is allowed, values corresponding to L0 uni-prediction or L1 uni-prediction or bi-prediction may be possible as inter_pred_idc. To indicate this, inter_pred_idc can be expressed in a variable length binarization method. For example, values corresponding to L0 uni-prediction, L1 uni-prediction, and bi-prediction may be represented as 00, 01, and 1, respectively. Alternatively, values corresponding to L0 uni-prediction, L1 uni-prediction, and bi-prediction may be represented as 10, 11, and 0, respectively. In addition, if bi-prediction is not allowed, values corresponding to L0 uni-prediction or L1 uni-prediction may be possible as inter_pred_idc. Therefore, inter_pred_idc can be expressed as 1-bit. For example, values corresponding to L0 uni-prediction and L1 uni-prediction may be represented as 0 and 1, respectively. Alternatively, values corresponding to L0 uni-prediction and L1 uni-prediction may be represented as 1 and 0, respectively.

일 실시예를 따르면 bi-prediction이 사용되지 않는 block size는 threshold 이하의 block size일 수 있다. 예를 들어 threshold는 4x8 block 또는 8x4 block일 수 있다. 만약 4x4 inter prediction이 허용되지 않는 경우 bi-prediction이 사용되지 않는 block size는 4x8 or 8x4 block 일 수 있다. 또한 4x4 block은 (width + height == 8)인 것으로 나타낼 수 있다. 또한 4x8 or 8x4 block은 (width + height == 12)인 것으로 나타낼 수 있다.According to an embodiment, a block size in which bi-prediction is not used may be a block size below a threshold. For example, the threshold may be a 4x8 block or an 8x4 block. If 4x4 inter prediction is not allowed, the block size for which bi-prediction is not used may be a 4x8 or 8x4 block. Also, a 4x4 block can be expressed as (width + height == 8). Also, a 4x8 or 8x4 block can be expressed as (width + height == 12).

도 41을 참조하면 4x8 or 8x4 block인 경우에 inter_pred_idc는 PRED_L0, PRED_L1에 해당하는 값만 존재할 수 있다. 또한 이 경우에 inter_pred_idc를 0 또는 1로 나타낼 수 있다.Referring to FIG. 41, in the case of a 4x8 or 8x4 block, only values corresponding to PRED_L0 and PRED_L1 may exist for inter_pred_idc. Also, in this case, inter_pred_idc may be represented as 0 or 1.

도 42는 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.42 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.

도 41에서 설명한 것처럼 inter_pred_idc가 나타낼 수 있는 값의 set 및 그 시그날링 방법이 다수 존재할 수 있다. 예를 들어 어떤 block에서는 inter_pred_idc가 나타낼 수 있는 값의 종류가 3가지 있고, 이때 1 내지 2 bit를 사용해서 시그날링할 수 있다. 또한 어떤 block에서는 inter_pred_idc가 나타낼 수 있는 값의 종류가 2가지 있고, b-bit를 사용해서 시그날링할 수 있다. 또한 이때 inter_pred_idc가 나타낼 수 있는 값의 종류와 시그날링은 block size에 기초하여 달라지는 것이 가능하다. 예를 들어 bi-prediction이 허용되는 block size인지 아닌지에 따라 inter_pred_idc가 나타낼 수 있는 값의 종류와 시그날링이 달라지는 것이 가능하다.As described in FIG. 41, there may be a number of sets of values that can be represented by inter_pred_idc and signaling methods thereof. For example, in some blocks, there are three types of values that can be represented by inter_pred_idc, and in this case, signaling can be performed using 1 to 2 bits. In addition, in some blocks, there are two types of values that can be represented by inter_pred_idc, and signaling can be performed using b-bits. In addition, at this time, the types and signaling of values that can be represented by inter_pred_idc may be changed based on the block size. For example, depending on whether or not bi-prediction is an allowable block size, it is possible that the types and signaling of values that can be represented by inter_pred_idc are different.

그러나 도 41에서 설명한 방법에서 어떤 block size의 경우에 inter_pred_idc가 나타낼 수 있는 값의 종류와 시그날링에 ambiguity가 있는 경우가 있을 수 있다. 예를 들어 block size가 4x8 or 8x4인 경우 (width + height) !=8 조건과 ((width+height == 8) || (width+height == 12)) 조건을 모두 만족시킬 수 있다. 따라서 encoder, decoder 간의 시그날링 및 비트스트림이 불일치하는 경우가 발생할 수 있다.However, in the method described with reference to FIG. 41, there may be a case where there is an ambiguity in signaling and types of values that can be represented by inter_pred_idc in a certain block size. For example, if the block size is 4x8 or 8x4, both conditions (width + height) !=8 and ((width+height == 8) || (width+height == 12)) can be satisfied. Therefore, a case in which signaling and bitstreams between encoders and decoders are inconsistent may occur.

도 42의 실시예는 이 문제를 해결하기 위한 방법일 수 있다. 본 발명의 일 실시예를 따르면 condition1을 만족시키는 경우와 !condition1을 만족시키는 경우에 inter_pred_idc가 나타낼 수 있는 값의 종류와 시그날링 방법이 다를 수 있다. 예를 들면 condition1은 bi-prediction이 허용되지 않는 block size 조건일 수 있다. 예를 들면 condition1은 4x8 or 8x4 block인 조건일 수 있다. 만약 bi-prediction이 허용되지 않는 경우에 inter_pred_idc를 2 bit를 사용해서 시그날링하는 경우가 발생하면 시그날링이 효율적이지 않은 것일 수 있다. Bi-prediction이 허용되지 않는 경우에 inter_pred_idc 값으로 PRED_BI를 나타내지 않을 것이기 때문이다. 일 실시예로 bi-prediction이 허용되지 않는 block size 조건은 4x8 or 8x4 이하의 block size일 수 있다. 따라서 bi-prediction이 허용되지 않는 block size는 4x8 또는 8x4 또는 4x4일 수 있다.The embodiment of FIG. 42 may be a method for solving this problem. According to an embodiment of the present invention, when condition1 is satisfied and when !condition1 is satisfied, a type of a value that can be indicated by inter_pred_idc and a signaling method may be different. For example, condition1 may be a block size condition in which bi-prediction is not allowed. For example, condition1 may be a 4x8 or 8x4 block condition. If bi-prediction is not allowed and inter_pred_idc is signaled using 2 bits, signaling may not be efficient. This is because PRED_BI will not be indicated as an inter_pred_idc value when bi-prediction is not allowed. In an embodiment, a block size condition in which bi-prediction is not allowed may be a block size of 4x8 or 8x4 or less. Therefore, the block size for which bi-prediction is not allowed may be 4x8 or 8x4 or 4x4.

도 42를 참조하면 width + height가 8 또는 12인 경우 inter_pred_idc로 가능한 값은 PRED_L0, PRED_L1일 수 있다. 또한 이때 1-bit를 통해 inter_pred_idc를 나타낼 수 있다. 시그날링은 0 또는 1일 수 있다. 또한 width + height가 8이 아니고 12가 아닌 경우 inter_pred_idc로 가능한 값은 PRED_L0, PRED_L1, PRED_BI일 수 있다. 또한 이때 1- or 2-bit를 통해 inter_pred_idc를 나타낼 수 있다. 시그날링은 00, 01, 1일 수 있다.Referring to FIG. 42, when width + height is 8 or 12, possible values for inter_pred_idc may be PRED_L0 and PRED_L1. Also, at this time, inter_pred_idc may be indicated through 1-bit. Signaling can be 0 or 1. In addition, when width + height is not 8 and not 12, possible values for inter_pred_idc may be PRED_L0, PRED_L1, and PRED_BI. Also, at this time, inter_pred_idc may be indicated through 1- or 2-bit. The signaling may be 00, 01, or 1.

도 43은 본 발명의 일 실시예에 따른 inter_pred_idc 값과 binarization을 나타낸 도면이다.43 is a diagram illustrating an inter_pred_idc value and binarization according to an embodiment of the present invention.

도 43은 도 41 내지 도 42에서 설명한 문제를 해결하기 위한 실시예일 수 있다. 또한 도 43은 도 42의 실시예에서 효율성을 높인 방법일 수 있다. 앞서 설명한 것처럼 inter prediction이 허용되지 않는 block size가 존재할 수 있다. 도 42의 실시예에서 inter prediction이 허용되지 않는 block size를 고려하지 않으면 불필요한 condition check가 필요할 수 있다. 예를 들어 inter prediction이 허용되지 않는 경우에 inter_pred_idc 값은 의미가 없을 수 있다. 그런데 inter_pred_idc 시그날링에서 inter prediction이 허용되지 않는 경우의 조건을 체크한다면 이것은 의미가 없을 수 있다. 따라서 본 발명의 일 실시예에 따르면 inter prediction이 허용되지 않는 경우의 조건 체크 없이 bi-prediction이 허용되지 않는 경우의 조건 체크를 하여 inter_pred_idc 시그날링 및 값의 set를 결정할 수 있다. 예를 들어 inter prediction이 허용되지 않는 경우는 4x4 block size일 수 있고, bi-prediciton이 허용되지 않는 경우는 4x8 or 8x4 block size일 수 있다.43 may be an embodiment for solving the problem described in FIGS. 41 to 42. Also, FIG. 43 may be a method of increasing efficiency in the embodiment of FIG. 42. As described above, there may be a block size in which inter prediction is not allowed. In the embodiment of FIG. 42, if the block size in which inter prediction is not allowed is not considered, unnecessary condition check may be required. For example, when inter prediction is not allowed, the inter_pred_idc value may have no meaning. However, this may be meaningless if the condition in the case where inter prediction is not allowed in inter_pred_idc signaling is checked. Accordingly, according to an embodiment of the present invention, inter_pred_idc signaling and a set of values may be determined by performing a condition check in a case in which bi-prediction is not allowed without a condition check in a case in which inter prediction is not allowed. For example, when inter prediction is not allowed, it may be a 4x4 block size, and when bi-prediciton is not allowed, it may be a 4x8 or 8x4 block size.

도 43을 참조하면 width + height가 12인 경우 inter_pred_idc로 가능한 값은 PRED_L0, PRED_L1일 수 있다. 또한 이때 1-bit를 통해 inter_pred_idc를 나타낼 수 있다. 시그날링은 0 또는 1일 수 있다. 또한 width + height가 12가 아닌 경우 inter_pred_idc로 가능한 값은 PRED_L0, PRED_L1, PRED_BI일 수 있다. 또한 이때 1- or 2-bit를 통해 inter_pred_idc를 나타낼 수 있다. 시그날링은 00, 01, 1일 수 있다.Referring to FIG. 43, when width + height is 12, possible values for inter_pred_idc may be PRED_L0 and PRED_L1. Also, at this time, inter_pred_idc may be indicated through 1-bit. Signaling can be 0 or 1. In addition, when width + height is not 12, possible values for inter_pred_idc may be PRED_L0, PRED_L1, and PRED_BI. Also, at this time, inter_pred_idc may be indicated through 1- or 2-bit. The signaling may be 00, 01, or 1.

따라서 사실상 도 43의 실시예에서 4x4 block의 경우에는 inter_pred_idc 값의 set와 시그날링은 도 43의 2개 column 중 왼쪽(전체에서 3번째 column)에 해당하게 되고 이는 도 42의 실시예에서와 다를 수 있다.Therefore, in fact, in the case of a 4x4 block in the embodiment of FIG. 43, the inter_pred_idc value set and signaling correspond to the left of the two columns of FIG. 43 (the third column in all), which may be different from the embodiment of FIG. have.

본 발명의 일 실시예를 따르면 treeType이 DUAL_TREE_CHROMA인 경우 cu_skip_flag를 parsing하는 것이 가능할 수 있다. treeType이 DUAL_TREE_CHROMA인 것은 luma block와 chroma block의 partitioning이 다를 수 있고, chroma에 해당하는 것을 processing하는 것을 나타낼 수 있다. 또한 treeType이 DUAL_TREE_CHROMA인 경우 MODE_IBC를 사용하는 것이 가능할 때 cu_skip_flag를 parsing하는 것이 가능할 수 있다. MODE_IBC를 사용하는 것이 가능할 때는 sps_ibc_enabled_flag가 1인 경우일 수 있다. 이것은 chroma block의 prediction mode가 MODE_IBC인 경우 skip mode를 사용할 수 있게 하기 위함일 수 있다.According to an embodiment of the present invention, when the treeType is DUAL_TREE_CHROMA, it may be possible to pars the cu_skip_flag. When the treeType is DUAL_TREE_CHROMA, it may indicate that partitioning of a luma block and a chroma block may be different, and processing corresponding to chroma. In addition, when the treeType is DUAL_TREE_CHROMA, it may be possible to pars cu_skip_flag when it is possible to use MODE_IBC. When it is possible to use MODE_IBC, it may be a case where sps_ibc_enabled_flag is 1. This may be to enable the use of skip mode when the prediction mode of the chroma block is MODE_IBC.

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

도 44에서 나타내고 있는 syntax element들은 앞선 도면들에서 설명한 syntax element들일 수 있고, 중복된 설명을 생략했을 수 있다. 또한 본 발명은 도 27에서 설명한 부분을 포함할 수 있다.The syntax elements shown in FIG. 44 may be syntax elements described in the previous drawings, and redundant descriptions may be omitted. In addition, the present invention may include the parts described in FIG. 27.

앞서 설명한 것처럼 다수의 prediction mode가 존재할 수 있다. 예를 들면 상기 다수의 prediction mode는 MODE_INTRA, MODE_IBC, MODE_INTER를 포함할 수 있다. 도 44를 참조하면 prediction mode는 CuPredMode에 의해 나타내어질 수 있다. 또한 현재 picture만을 참조하는 prediction mode로 MODE_INTRA, MODE_IBC가 있을 수 있다. 또한 MODE_IBC는 block vector 또는 motion vector 또는 motion information 등을 사용하여 prediction에 참조할 block을 지시할 수 있다. 또한 MODE_INTER는 다른 picture를 참조하는 것이 가능하다. 또한 slice의 type, tile group의 type 등에 따라 사용하는 prediction mode가 제한적일 수 있다. 예를 들어 slice의 type, tile group의 type은 slice_type, tile_group_type 등에 의해 나타내어질 수 있다. 이하 설명에서 slice_type이라고 쓴 것은 tile_group_type에 대해서도 적용될 수 있다. 또한 slice_type이 X인 것은 X slice인 것일 수 있다. 또한 tile_group_type이 X인 것은 X tile group인 것일 수 있다. 또한 I slice는 MODE_INTRA 또는 MODE_IBC를 사용할 수 있을 수 있다, I slice는 MODE_INTER를 사용할 수 없을 수 있다. As described above, there may be multiple prediction modes. For example, the plurality of prediction modes may include MODE_INTRA, MODE_IBC, and MODE_INTER. Referring to FIG. 44, the prediction mode may be represented by CuPredMode. Also, there may be MODE_INTRA and MODE_IBC as prediction modes that refer only to the current picture. In addition, MODE_IBC may indicate a block to be referred to for prediction by using a block vector or motion vector or motion information. Also, MODE_INTER can refer to another picture. Also, the prediction mode used may be limited depending on the type of slice and tile group. For example, the type of slice and the type of tile group may be represented by slice_type, tile_group_type, and the like. In the following description, what is written as slice_type can also be applied to tile_group_type. In addition, if slice_type is X, it may be X slice. In addition, when the tile_group_type is X, it may be an X tile group. Also, I slice may use MODE_INTRA or MODE_IBC, and I slice may not use MODE_INTER.

본 발명의 일 실시예를 따르면 MODE_INTRA인 경우에는 skip mode를 사용하지 않을 수 있다. 즉, MODE_INTRA인 경우에는 cu_skip_flag 값이 항상 같은 값일 수 있다. 예를 들면 MODE_INTRA인 경우에는 cu_skip_flag 값이 항상 0일 수 있다. 또한 반대로 skip mode를 사용한다고 지시한 경우에 MODE_INTRA가 아닐 수 있다. 즉, cu_skip_flag 값에 기초하여 prediction mode를 결정할 수 있고, 예를 들면 cu_skip_flag 값에 기초하여 prediction mode가 (MODE_INTRA, MODE_INTER, or MODE_IBC)인지 (MODE_INTER, or MODE_IBC)인지 결정할 수 있다.According to an embodiment of the present invention, in the case of MODE_INTRA, the skip mode may not be used. That is, in the case of MODE_INTRA, the cu_skip_flag value may always be the same value. For example, in the case of MODE_INTRA, the cu_skip_flag value may always be 0. On the contrary, it may not be MODE_INTRA when it is indicated to use skip mode. That is, the prediction mode may be determined based on the cu_skip_flag value, and for example, it may be determined whether the prediction mode is (MODE_INTRA, MODE_INTER, or MODE_IBC) or (MODE_INTER, or MODE_IBC) based on the cu_skip_flag value.

본 발명의 일 실시예를 따르면 prediction mode는 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag에 기초하여 결정될 수 있다. 예를 들어 pred_mode_ibc_flag는 MODE_IBC인지 아닌지를 나타내는 시그날링일 수 있다. 예를 들어 만약 pred_mode_ibc_flag 값이 1인 경우 CuPredMode는 MODE_IBC일 수 있고, pred_mode_ibc_flag 값이 0인 경우 CuPredMode는 MODE_INTRA 또는 MODE_INTER일 수 있다. 이에 대하여 도 45에서 더 설명한다. According to an embodiment of the present invention, the prediction mode may be determined based on cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag. For example, pred_mode_ibc_flag may be a signaling indicating whether or not it is MODE_IBC. For example, if the pred_mode_ibc_flag value is 1, CuPredMode may be MODE_IBC, and if the pred_mode_ibc_flag value is 0, CuPredMode may be MODE_INTRA or MODE_INTER. This will be further described in FIG. 45.

본 발명의 일 실시예를 따르면 block size에 기초하여 prediction mode가 제한적일 수 있다. 일 실시예로 block size에 기초하여 MODE_INTER를 사용하지 않을 수 있다. 예를 들면 앞서 설명한 것처럼 작은 block size에 대해 MODE_INTER를 사용하지 않을 수 있다. 예를 들면 block size가 4x4인 경우 MODE_INTER를 사용하지 않을 수 있다. 따라서 이러한 size의 block에 대해 MODE_INTRA 또는 MODE_IBC 만을 사용할 수 있다. 이에 따라 앞서 설명한 것처럼 MODE_INTER를 사용할 수 없는 block size이고 MODE_IBC를 사용할 수 없는 경우, cu_skip_flag를 parsing하지 않고, 그 값을 skip mode를 사용하지 않는다는 것을 나타내는 값, 예를 들면 0으로 infer 할 수 있다. MODE_IBC를 사용할 수 없는 경우는 상위 레벨 시그날링으로 IBC를 사용할 수 없음을 나타낸 경우를 포함할 수 있다. 도 44를 참조하면 IBC를 사용할 수 있는지 없는지를 나타내는 상위 레벨 시그날링은 sps_ibc_enabled_flag일 수 있고, IBC를 사용할 수 없는 경우 sps_ibc_enabled_flag 값이 0일 수 있다. 또한 MODE_INTER를 사용할 수 없는 block size인 경우, pred_mode_flag를 parsing하지 않고, 그 값을 MODE_INTRA를 나타내는 값, 예를 들면 1로 infer 할 수 있다. 또한 MODE_INTER를 사용할 수 없는 block size인 경우, skip mode를 사용하는 경우 pred_mode_ibc_flag를 parsing하지 않고, 그 값을 MODE_IBC를 사용하는 것을 나타내는 값, 예를 들면 1로 infer 할 수 있다.According to an embodiment of the present invention, a prediction mode may be limited based on a block size. In an embodiment, MODE_INTER may not be used based on the block size. For example, as described above, MODE_INTER may not be used for a small block size. For example, if the block size is 4x4, MODE_INTER may not be used. Therefore, only MODE_INTRA or MODE_IBC can be used for a block of this size. Accordingly, as described above, if MODE_INTER is a block size that cannot be used and MODE_IBC cannot be used, cu_skip_flag is not parsed, and the value may be inferred to a value indicating that skip mode is not used, for example, 0. The case where MODE_IBC cannot be used may include a case indicating that the IBC cannot be used by higher level signaling. Referring to FIG. 44, high-level signaling indicating whether or not IBC can be used may be sps_ibc_enabled_flag, and when IBC is not available, a value of sps_ibc_enabled_flag may be 0. In addition, in the case of a block size in which MODE_INTER cannot be used, pred_mode_flag is not parsed, and the value can be inferred to a value indicating MODE_INTRA, for example, 1. In addition, in the case of a block size in which MODE_INTER cannot be used, the pred_mode_ibc_flag is not parsed when the skip mode is used, and the value can be inferred to a value indicating the use of MODE_IBC, for example 1.

또다른 실시예로 block size에 기초하여 MODE_IBC를 사용하지 않을 수 있다. MODE_IBC를 사용하지 않는다는 것은 MODE_IBC를 사용하는지 나타내는 시그날링(예를 들면 pred_mode_ibc_flag)이 MODE_IBC를 사용하지 않는다는 것을 나타내는 기설정된 값(예를 들면 0)인 것을 의미할 수 있다. 또한 MODE_IBC를 사용하지 않는다는 것은 MODE_IBC를 사용하는지 나타내는 시그날링을 parsing하지 않는다는 것을 의미할 수 있다. 예를 들면 큰 block size에 대해 MODE_IBC를 사용하지 않을 수 있다. 예를 들면 width, height가 모두 128 이상인 block에 대해 MODE_IBC를 사용하지 않을 수 있다. 또는 width, height가 모두 128인 block에 대해 MODE_IBC를 사용하지 않을 수 있고, 또한 width 또는 height가 128보다 큰 것이 불가할 수 있다. 따라서 도 44를 참조하면 width 또는 height가 128이 아닌 경우 pred_mode_ibc_flag를 parsing할 수 있다. 또한 width와 height가 모두 128인 경우 pred_mode_ibc_flag를 parsing하지 않을 수 있다. 또한 width와 height가 모두 128인 경우 pred_mode_ibc_flag를 0으로 infer 할 수 있다.In another embodiment, MODE_IBC may not be used based on the block size. Not using MODE_IBC may mean that a signaling indicating whether MODE_IBC is used (eg, pred_mode_ibc_flag) is a preset value (eg, 0) indicating that MODE_IBC is not used. Also, not using MODE_IBC may mean that signaling indicating whether MODE_IBC is used is not parsed. For example, MODE_IBC may not be used for a large block size. For example, MODE_IBC may not be used for blocks with both width and height of 128 or more. Alternatively, for a block with both width and height 128, MODE_IBC may not be used, and it may not be possible to have a width or height greater than 128. Therefore, referring to FIG. 44, when width or height is not 128, pred_mode_ibc_flag can be parsed. Also, when both width and height are 128, pred_mode_ibc_flag may not be parsed. In addition, if both width and height are 128, pred_mode_ibc_flag can be inferred to 0.

Block의 width, height는 각각 cbWidth, cbHeight일 수 있고, 이것은 coding unit이나 prediction unit인 block에 대해서일 수 있다.The width and height of a block can be cbWidth and cbHeight, respectively, and this can be for a block that is a coding unit or a prediction unit.

도 44를 참조하면 block size가 128x128인 경우 혹은 128x128 이상인 경우에 cu_skip_flag를 parsing할 수 있다. 그러나 block size에 기초하여 prediction mode가 제한적일 경우 더 효율적인 시그날링을 하는 것이 가능하다. 이에 대하여 도 46 이하에서 더 설명한다.Referring to FIG. 44, cu_skip_flag may be parsed when the block size is 128x128 or 128x128 or more. However, if the prediction mode is limited based on the block size, it is possible to perform more efficient signaling. This will be further described below in FIG. 46.

도 44를 참조하면 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag에 기초하여 prediction mode를 결정하는 것이 가능하다. 또한 결정한 prediction mode에 기초하여 prediction을 수행할 수 있다. 즉 결정한 prediction mode에 기초하여 prediction signal을 생성할 수 있고, 결정한 prediction mode에 기초하여 block을 복원할 수 있다.Referring to FIG. 44, it is possible to determine a prediction mode based on cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag. Also, prediction may be performed based on the determined prediction mode. That is, a prediction signal may be generated based on the determined prediction mode, and a block may be reconstructed based on the determined prediction mode.

도 44를 참조하면 pcm_flag, pcm_alignment_zero_bit, intra_mip_flag, intra_mip_mpm_flag, intra_mip_mpm_idx, intra_mip_mpm_remainder, intra_luma_ref_idx, intra_subpartitions_mode_flag, intra_subpartitions_split_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, intra_chroma_pred_mode 등은 intra prediction과 관련한 syntax element일 수 있다. 또한 상기 intra prediction과 관련한 syntax element는 MODE_INTRA와 관련된 syntax element 일 수 있다. 또한 상기 intra prediction과 관련한 syntax element에 기초하여 prediction을 수행하는 것이 가능하다.Referring to Figure 44, etc. pcm_flag, pcm_alignment_zero_bit, intra_mip_flag, intra_mip_mpm_flag, intra_mip_mpm_idx, intra_mip_mpm_remainder, intra_luma_ref_idx, intra_subpartitions_mode_flag, intra_subpartitions_split_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, intra_chroma_pred_mode may be a syntax element related to the intra prediction. In addition, the syntax element related to the intra prediction may be a syntax element related to MODE_INTRA. In addition, it is possible to perform prediction based on a syntax element related to the intra prediction.

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

도 44에서 설명한 것처럼 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag와 prediction mode 간의 관계가 존재할 수 있다. 또한 이것은 block size와도 연관있을 수 있다.As described with reference to FIG. 44, there may be a relationship between cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag, and prediction mode. It can also be related to block size.

도 45를 참조하면 cu_skip_flag에 기초해서 이후의 syntax element parsing 여부가 결정될 수 있다. 예를 들어 cu_skip_flag가 1인 경우 P slice 또는 B slice에 대해서는 pred_mode_ibc_flag와 merge_data syntax structure 이외의 syntax element가 coding unit에서 cu_skip_flag parsing 이후 parsing되지 않는 것일 수 있다. 또한 cu_skip_flag가 1인 경우 I slice에 대해서는 merge_idx 이회의 syntax element가 coding unit에서 cu_skip_flag parsing 이후 parsing되지 않는 것일 수 있다. 또한 cu_skip_flag가 0인 경우 coding unit 이 skip되지 않는 것일 수 있다. 만약 cu_skip_flag가 존재하지 않는 경우 그 값을 0으로 infer할 수 있다.Referring to FIG. 45, whether to pars a syntax element afterwards may be determined based on cu_skip_flag. For example, when cu_skip_flag is 1, syntax elements other than pred_mode_ibc_flag and merge_data syntax structure for P slice or B slice may not be parsed after cu_skip_flag parsing in the coding unit. In addition, when cu_skip_flag is 1, syntax elements of merge_idx two times for I slice may not be parsed after cu_skip_flag parsing in the coding unit. In addition, when cu_skip_flag is 0, the coding unit may not be skipped. If cu_skip_flag does not exist, the value can be inferred to 0.

도 45를 참조하면 pred_mode_flag에 기초해서 CuPredMode가 결정되는 것이 가능하다. 일 실시예를 따르면 pred_mode_flag가 0인 것은 inter prediction mode를 사용하는 것을 의미할 수 있고, CuPredMode가 MODE_INTER로 설정될 수 있다. 또한 pred_mode_flag가 1인 것은 intra prediction mode를 사용하는 것을 의미할 수 있고, CuPredMode가 MODE_INTRA로 설정될 수 있다. 또한 pred_mode_ibc_flag에 기초해서 CuPredMode가 설명한 MODE_INTER, MODE_INTRA 외의 다른 값으로 설정될 수 있다.Referring to FIG. 45, it is possible to determine CuPredMode based on pred_mode_flag. According to an embodiment, when pred_mode_flag is 0, it may mean that an inter prediction mode is used, and CuPredMode may be set to MODE_INTER. In addition, when pred_mode_flag is 1, it may mean that the intra prediction mode is used, and CuPredMode may be set to MODE_INTRA. Also, based on pred_mode_ibc_flag, CuPredMode may be set to a value other than MODE_INTER and MODE_INTRA described.

본 발명의 일 실시예를 따르면 pred_mode_flag가 존재하지 않는 경우, width와 height가 모두 4일 때 pred_mode_flag 값을 1로 infer할 수 있다. 또한 pred_mode_flag가 존재하지 않는 경우, width 또는 height가 4가 아닌 경우 pred_mode_flag 값을 I slice에서는 1로 infer하고, P or B slice에서는 0으로 infer할 수 있다.According to an embodiment of the present invention, when pred_mode_flag does not exist, when both width and height are 4, the value of pred_mode_flag may be inferred to 1. In addition, when pred_mode_flag does not exist, when the width or height is not 4, the value of pred_mode_flag may be inferred to 1 for I slice and 0 for P or B slice.

도 45를 참조하면 pred_mode_ibc_flag는 IBC prediction mode를 사용하는지 여부를 나타낼 수 있다. 예를 들어 pred_mode_ibc_flag가 1인 경우 IBC prediction mode를 사용하고, pred_mode_ibc_flag가 0인 경우 IBC prediction mode를 사용하지 않는 것일 수 있다. 또한 pred_mode_ibc_flag가 1인 경우 CuPredMode를 MODE_IBC로 설정할 수 있다.Referring to FIG. 45, pred_mode_ibc_flag may indicate whether the IBC prediction mode is used. For example, when pred_mode_ibc_flag is 1, the IBC prediction mode may be used, and when pred_mode_ibc_flag is 0, the IBC prediction mode may not be used. Also, when pred_mode_ibc_flag is 1, CuPredMode may be set to MODE_IBC.

만약 pred_mode_ibc_flag가 존재하지 않는 경우 다음과 같이 그 값을 infer할 수 있다. 1) 만약 cu_skip_flag가 1이고, width와 height가 모두 4인 경우 pred_mode_ibc_flag를 1로 infer할 수 있고, 2) 그렇지 않고 width와 height가 모두 128인 경우 pred_mode_ibc_flag를 0으로 infer할 수 있고, 3) 그렇지 않은 경우 I slice에서는 pred_mode_ibc_flag를 sps_ibc_enabled_flag 값으로 infer하고, P or B slice에서는 pred_mode_ibc_flag를 0으로 infer할 수 있다.If pred_mode_ibc_flag does not exist, the value can be inferred as follows. 1) If cu_skip_flag is 1 and both width and height are 4, you can infer pred_mode_ibc_flag to 1, 2) otherwise, if both width and height are 128, you can infer pred_mode_ibc_flag to 0, and 3) not In case I slice, pred_mode_ibc_flag may be inferred as sps_ibc_enabled_flag value, and in P or B slice, pred_mode_ibc_flag may be inferred as 0.

도 44에서 설명한 것처럼 도 45의 발명에서 width와 height가 모두 4인 경우는 MODE_INTER가 사용되지 않는 경우, width와 height가 모두 128인 경우는 MODE_IBC가 사용되지 않는 경우의 구체적인 실시예일 수 있다.As described with reference to FIG. 44, when both width and height are 4 in the invention of FIG. 45, when MODE_INTER is not used, when both width and height are 128, it may be a specific embodiment when MODE_IBC is not used.

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

도 44에서 설명한 것처럼 block size에 기초하여 prediction mode를 제한할 수 있고, 이에 따라 더욱 효율적인 시그날링을 하는 것이 가능하다.As described with reference to FIG. 44, the prediction mode may be limited based on the block size, and thus more efficient signaling may be performed.

본 발명의 일 실시예를 따르면 slice type과 block size에 기초하여 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag parsing 여부를 결정할 수 있다. 이것은 slice type 또는 block size에 기초하여 prediction mode가 제한적일 수 있기 때문이다. 예를 들면 I slice인 경우 block size에 기초하여 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag parsing 여부를 결정할 수 있다. 예를 들면 I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하지 않을 수 있다. 또한 I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우 CuPredMode를 MODE_INTRA로 결정, 설정할 수 있다. 일 실시예로 MODE_IBC를 사용할 수 없는 block size는 width와 height가 모두 128인 경우일 수 있다. 또다른 실시예로 MODE_IBC를 사용할 수 없는 block size는 width와 height가 모두 128 이상인 경우일 수 있다. 또한 I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우 cu_skip_flag를 0으로 infer할 수 있고, pred_mode_flag를 1로 infer할 수 있고, pred_mode_ibc_flag를 0으로 infer할 수 있다.According to an embodiment of the present invention, whether to parsing cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may be determined based on a slice type and a block size. This is because prediction mode may be limited based on slice type or block size. For example, in the case of I slice, whether to parsing cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may be determined based on the block size. For example, in the case of I slice and a block size in which MODE_IBC cannot be used, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be parsed. Also, if it is I slice and is a block size that cannot use MODE_IBC, CuPredMode can be determined and set as MODE_INTRA. In an embodiment, a block size in which MODE_IBC cannot be used may be a case where both width and height are 128. In another embodiment, a block size in which MODE_IBC cannot be used may be when both width and height are 128 or more. In addition, if it is I slice and is a block size that cannot use MODE_IBC, cu_skip_flag can be inferred to 0, pred_mode_flag can be inferred to 1, and pred_mode_ibc_flag can be infered to 0.

도 46을 참조하면 slice_type이 I이고, cbWidth가 128 이고, cbHeight가 128인 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하지 않을 수 있다. 이때 slice_type이 I이고, cbWidth가 128 이고, cbHeight가 128인 것을 확인한 뒤에 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing할 지 여부를 판단하는 조건 연산이 필요하지 않을 수 있다. 이 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag parsing을 추가 연산 없이 skip할 수 있다. 즉 slice_type이 I이고, cbWidth가 128 이고, cbHeight가 128인 경우, 도 46에 표시한 Condition 1, Condition 2, Condition 3 체크가 필요하지 않으므로 연산량을 줄일 수 있다. 또한 이 경우 cu_skip_flag를 0으로 infer할 수 있고, pred_mode_flag를 1로 infer할 수 있고, pred_mode_ibc_flag를 0으로 infer할 수 있다. 또한 이 경우 CuPredMode를 MODE_INTRA로 결정, 설정할 수 있다. 또한 slice_type이 I가 아니거나 cbWidth가 128이 아니거나 cbHeight가 128이 아닌 경우, cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하는 것이 가능할 수 있고, 도 46의 Condition 1, Condition 2, Condition 3 확인이 필요할 수 있다.Referring to FIG. 46, when slice_type is I, cbWidth is 128, and cbHeight is 128, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be parsed. At this time, after confirming that slice_type is I, cbWidth is 128, and cbHeight is 128, a conditional operation to determine whether to parsing cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be required. In this case, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag parsing can be skipped without additional operations. That is, when slice_type is I, cbWidth is 128, and cbHeight is 128, the amount of computation can be reduced because the Condition 1, Condition 2, and Condition 3 checks shown in FIG. 46 are not required. Also, in this case, cu_skip_flag may be inferred to 0, pred_mode_flag may be inferred to 1, and pred_mode_ibc_flag may be inferred to 0. Also, in this case, CuPredMode may be determined and set as MODE_INTRA. In addition, when slice_type is not I, cbWidth is not 128, or cbHeight is not 128, it may be possible to parsing cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag, and Condition 1, Condition 2, and Condition 3 of FIG. 46 may be required.

또다른 실시예로 slice_type이 I이고, cbWidth가 128 이상이고, cbHeight가 128 이상인 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하지 않을 수 있다. 이때 slice_type이 I이고, cbWidth가 128 이상이고, cbHeight가 128 이상인 것을 확인한 뒤에 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing할 지 여부를 판단하는 조건 연산이 필요하지 않을 수 있다. 이 경우 cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag parsing을 추가 연산 없이 skip할 수 있다. 즉 이러한 경우, 도 46에 표시한 Condition 1, Condition 2, Condition 3 체크가 필요하지 않으므로 연산량을 줄일 수 있다. 또한 이 경우 cu_skip_flag를 0으로 infer할 수 있고, pred_mode_flag를 1로 infer할 수 있고, pred_mode_ibc_flag를 0으로 infer할 수 있다. 또한 이 경우 CuPredMode를 MODE_INTRA로 결정, 설정할 수 있다. 또한 slice_type이 I가 아니거나 cbWidth가 128보다 작거나 cbHeight가 128보다 작은 경우, cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag를 parsing하는 것이 가능할 수 있고, 도 46의 Condition 1, Condition 2, Condition 3 확인이 필요할 수 있다.In another embodiment, when slice_type is I, cbWidth is 128 or more, and cbHeight is 128 or more, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be parsed. At this time, after confirming that slice_type is I, cbWidth is 128 or more, and cbHeight is 128 or more, a conditional operation that determines whether to parsing cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag may not be required. In this case, cu_skip_flag, pred_mode_flag, and pred_mode_ibc_flag parsing can be skipped without additional operations. That is, in this case, since it is not necessary to check Condition 1, Condition 2, and Condition 3 shown in FIG. 46, the amount of computation can be reduced. Also, in this case, cu_skip_flag may be inferred to 0, pred_mode_flag may be inferred to 1, and pred_mode_ibc_flag may be inferred to 0. Also, in this case, CuPredMode may be determined and set as MODE_INTRA. In addition, when slice_type is not I, cbWidth is less than 128, or cbHeight is less than 128, it may be possible to parsing cu_skip_flag, pred_mode_flag, pred_mode_ibc_flag, and Condition 1, Condition 2, and Condition 3 of FIG. 46 may be required.

Condition 1, Condition 2, Condition 3은 도 46에 나타낸 것처럼 treeType, cbWidth, cbHeight, sps_ibc_enabled_flag, cu_skip_flag, CuPredMode 중 적어도 하나에 기반한 조건일 수 있다.Condition 1, Condition 2, and Condition 3 may be conditions based on at least one of treeType, cbWidth, cbHeight, sps_ibc_enabled_flag, cu_skip_flag, and CuPredMode, as shown in FIG. 46.

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

도 44에서 설명한 것처럼 block size에 기초하여 prediction mode를 제한할 수 있고, 이에 따라 더욱 효율적인 시그날링을 하는 것이 가능하다.As described with reference to FIG. 44, the prediction mode may be limited based on the block size, and thus more efficient signaling may be performed.

앞서 설명한 것처럼 slice type과 block size에 기초하여 cu_skip_flag parsing 여부를 결정할 수 있다. 이것은 slice type 또는 block size에 기초하여 prediction mode가 제한적일 수 있기 때문이다. 예를 들어 I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우 cu_skip_flag를 parsing하지 않을 수 있다. 또한 이 경우 cu_skip_flag 값을 0으로 infer할 수 있다. 또한 I slice가 아니거나, MODE_IBC를 사용할 수 있는 block size인 경우 cu_skip_flag를 parsing하는 것이 가능하다. 더 구체적으로 MODE_IBC를 사용할 수 없는 block size는 width와 height가 모두 128인 경우일 수 있다. 또다른 예로 MODE_IBC를 사용할 수 없는 block size는 width와 height가 모두 128 이상인 경우일 수 있다.As described above, it is possible to determine whether to pars the cu_skip_flag based on the slice type and block size. This is because prediction mode may be limited based on slice type or block size. For example, in the case of I slice and a block size in which MODE_IBC cannot be used, cu_skip_flag may not be parsed. Also, in this case, the cu_skip_flag value can be inferred to 0. In addition, it is possible to pars cu_skip_flag if it is not I slice or if it is a block size that can use MODE_IBC. More specifically, the block size for which MODE_IBC cannot be used may be a case where both width and height are 128. As another example, the block size for which MODE_IBC cannot be used may be when both width and height are 128 or more.

도 47을 참조하면 slice_type이 I이고, cbWidth가 128이고, cbHeight가 128인 경우, Condition 1을 만족시키지 않게 되고, cu_skip_flag를 parsing하지 않을 수 있다. 이때 cu_skip_flag를 0으로 infer할 수 있다.Referring to FIG. 47, when slice_type is I, cbWidth is 128, and cbHeight is 128, Condition 1 is not satisfied, and cu_skip_flag may not be parsed. At this time, cu_skip_flag may be inferred to 0.

도 46과 달리 도 47의 실시예에서는 I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우에도 pred_mode_flag, pred_mode_ibc_flag parsing 여부를 확인할 수 있다. 즉, I slice이고, MODE_IBC를 사용할 수 없는 block size인 경우에도 도 47의 Condition 2, Condition 3를 확인할 수 있다. 따라서 도 47의 실시예는 도 46의 실시예에 비해 더 많은 연산이 포함될 수 있다.Unlike FIG. 46, in the embodiment of FIG. 47, even in the case of I slice and a block size in which MODE_IBC cannot be used, whether to parsing pred_mode_flag and pred_mode_ibc_flag can be checked. That is, even if it is I slice and is a block size in which MODE_IBC cannot be used, Condition 2 and Condition 3 of FIG. 47 can be checked. Accordingly, the embodiment of FIG. 47 may include more operations than the embodiment of FIG. 46.

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

도 48의 실시예는 도 46의 실시예를 기반으로 조건을 간단히 한 것이다.The embodiment of FIG. 48 is a simplified condition based on the embodiment of FIG. 46.

도 48을 참조하면 pred_mode_ibc_flag를 parsing할지 여부를 판단할 때 slice_type을 기초로 block size 조건을 확인할지 여부가 다를 수 있다. 즉, 도 48의 Condition 3에서 slice_type을 기초로 block size 조건을 확인할지 여부가 다를 수 있다. 예를 들어 I slice인 경우에 pred_mode_ibc_flag를 parsing할지 여부를 판단할 때 block size를 참조하지 않을 수 있다. 예를 들면 I slice인 경우에 pred_mode_ibc_flag를 parsing할지 여부를 판단할 때 cu_skip_flag, sps_ibc_enabled_flag만을 참조할 수 있다. 예를 들어 I slice인 경우, width 또는 height가 128인지 아닌지 확인하는 절차 없이 pred_mode_ibc_flag를 parsing 여부를 확인할 수 있다. 또다른 실시예로 I slice인 경우, width 또는 height가 128보다 작은지, width와 height 모두가 128 이상인지 확인하는 절차 없이 pred_mode_ibc_flag를 parsing 여부를 확인할 수 있다.Referring to FIG. 48, when determining whether to pars pred_mode_ibc_flag, whether to check the block size condition based on slice_type may be different. That is, whether to check the block size condition based on slice_type in Condition 3 of FIG. 48 may be different. For example, in the case of I slice, the block size may not be referred to when determining whether to pars the pred_mode_ibc_flag. For example, in the case of I slice, only cu_skip_flag and sps_ibc_enabled_flag can be referenced when determining whether to pars pred_mode_ibc_flag. For example, in the case of I slice, it is possible to check whether the pred_mode_ibc_flag is parsed without checking whether the width or height is 128 or not. As another embodiment, in the case of I slice, it is possible to check whether the pred_mode_ibc_flag is parsed without a procedure of checking whether the width or height is less than 128 or whether both the width and height are 128 or more.

도 46의 실시예에서는 I slice인 경우에 pred_mode_ibc_flag를 parsing할지 여부를 판단할 때 width, height를 참조하고 있다. 도 46의 실시예에서는 I slice인 경우에 pred_mode_ibc_flag를 parsing할지 여부를 판단할 때 width 또는 height가 128이 아닌 경우에 pred_mode_ibc_flag를 parsing할 수 있다. 그러나 도 48의 실시예에서는 I slice인 경우에 block size와 상관 없이 pred_mode_ibc_flag를 parsing할 수 있다.In the embodiment of FIG. 46, when determining whether to pars pred_mode_ibc_flag in the case of I slice, width and height are referred to. In the embodiment of FIG. 46, when determining whether to pars pred_mode_ibc_flag in the case of I slice, when the width or height is not 128, the pred_mode_ibc_flag may be parsed. However, in the embodiment of FIG. 48, in the case of I slice, pred_mode_ibc_flag may be parsed regardless of the block size.

또한 도 48의 실시예에서 I slice가 아닌 경우(예를 들면 P or B slice인 경우) block size를 참조하여 pred_mode_ibc_flag를 parsing할지 여부가 결정될 수 있다. 예를 들면 I slice가 아니고, CuPredMode가 MODE_INTRA가 아닌 경우 block size를 참조하여 pred_mode_ibc_flag를 parsing할지 여부가 결정될 수 있다. 예를 들면 I slice가 아니고, CuPredMode가 MODE_INTER인 경우 block size를 참조하여 pred_mode_ibc_flag를 parsing할지 여부가 결정될 수 있다. 예를 들면 block size를 참조할 때 width 또는 height가 128인지 아닌지 확인할 수 있다. 또다른 예로 block size를 참조할 때 width 또는 height가 128보다 작은지, width와 height 모두가 128 이상인지 확인할 수 있다. 또한 I slice가 아닌 경우 width와 height가 모두 4이고, cu_skip_flag가 0인 경우에는 추가적인 block size 확인(예를 들면 width 또는 height가 128인지 아닌지 여부)이 필요하지 않을 수 있다.In addition, in the embodiment of FIG. 48, if it is not an I slice (for example, a P or B slice), it may be determined whether to pars the pred_mode_ibc_flag with reference to the block size. For example, when it is not I slice and CuPredMode is not MODE_INTRA, it may be determined whether to pars pred_mode_ibc_flag with reference to block size. For example, if it is not I slice and CuPredMode is MODE_INTER, it may be determined whether to pars pred_mode_ibc_flag with reference to block size. For example, when referring to the block size, you can check whether the width or height is 128. As another example, when referring to the block size, you can check whether the width or height is less than 128, and whether both width and height are 128 or more. In addition, if it is not I slice, both width and height are 4, and if cu_skip_flag is 0, additional block size check (for example, whether width or height is 128) may not be necessary.

따라서 도 48의 실시예는 도 46의 실시예에 비해 더 적은 연산량을 사용하는 것이 가능하다.Accordingly, the embodiment of FIG. 48 can use a smaller amount of computation than the embodiment of FIG. 46.

상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.The embodiments of the present invention described above can be implemented through various means. For example, embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.

하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.In the case of hardware implementation, the method according to embodiments of the present invention includes one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), and Programmable Logic Devices (PLDs). , Field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and the like.

펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 프로세서의 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 프로세서와 데이터를 주고 받을 수 있다.In the case of implementation by firmware or software, the method according to the embodiments of the present invention may be implemented in the form of a module, procedure, or function that performs the functions or operations described above. The software code can be stored in a memory and driven by a processor. The memory may be located inside or outside the processor, and data may be exchanged with the processor through various known means.

전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아는 것으로 해석해야 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다.The above description of the present invention is for illustrative purposes only, and those of ordinary skill in the art to which the present invention pertains will be able to understand that it can be easily modified into other specific forms without changing the technical spirit or essential features of the present invention. will be. Therefore, it should be construed that the embodiments described above are illustrative in all respects and are not limiting. For example, each component described as a single type may be implemented in a distributed manner, and similarly, components described as being distributed may also be implemented in a combined form.

본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.The scope of the present invention is indicated by the claims to be described later rather than the detailed description, and all changes or modified forms derived from the meaning and scope of the claims and their equivalent concepts should be interpreted as being included in the scope of the present invention. do.

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

Claims (1)

비디오 신호 처리 장치 및 방법.Video signal processing apparatus and method.
KR1020190063478A 2019-05-29 2019-05-29 A method and an apparatus for processing a video signal using current picture referencing KR20200137326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190063478A KR20200137326A (en) 2019-05-29 2019-05-29 A method and an apparatus for processing a video signal using current picture referencing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190063478A KR20200137326A (en) 2019-05-29 2019-05-29 A method and an apparatus for processing a video signal using current picture referencing

Publications (1)

Publication Number Publication Date
KR20200137326A true KR20200137326A (en) 2020-12-09

Family

ID=73787222

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190063478A KR20200137326A (en) 2019-05-29 2019-05-29 A method and an apparatus for processing a video signal using current picture referencing

Country Status (1)

Country Link
KR (1) KR20200137326A (en)

Similar Documents

Publication Publication Date Title
US11470306B2 (en) Method and device for processing video signal using MPM configuration method for multiple reference lines
EP4002848A1 (en) Video signal processing method and device
US20240048692A1 (en) Video signal processing method and device using motion compensation
US9325991B2 (en) Motion vector rounding
JP2023162362A (en) Video signal processing method and apparatus using multi-assumption prediction
PH12016500079B1 (en) Palette prediction in palette-based video coding
KR102550530B1 (en) Video signal processing method and apparatus using subblock-based motion compensation
KR102625145B1 (en) Video signal processing method and apparatus for signaling prediction mode
EP3985970A1 (en) Video signal processing method and device using block dpcm prediction method
EP4007282A1 (en) Video signal processing method and device
KR20220032566A (en) Video signal processing method and apparatus
US20210297662A1 (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
KR20200137326A (en) A method and an apparatus for processing a video signal using current picture referencing
KR20210033858A (en) Derivation and mapping method of secondary transform kernel according to intra prediction in video codec
JP2024060107A (en) Method and apparatus for processing video signals using current picture references
KR20240026180A (en) Video signal processing method using intra prediction and device therefor
KR20240052025A (en) Video signal processing method using LIC (LOCAL ILLUMINATION COMPENSATION) mode and device therefor
KR20200054052A (en) A method and an apparatus for processing a video signal using intra block copy
KR20200096385A (en) A method and an apparatus for processing a video signal using intra mode unification between coding block and transform block