KR20210123950A - Video signal encoding method and apparatus and video decoding method and apparatus - Google Patents

Video signal encoding method and apparatus and video decoding method and apparatus Download PDF

Info

Publication number
KR20210123950A
KR20210123950A KR1020200041847A KR20200041847A KR20210123950A KR 20210123950 A KR20210123950 A KR 20210123950A KR 1020200041847 A KR1020200041847 A KR 1020200041847A KR 20200041847 A KR20200041847 A KR 20200041847A KR 20210123950 A KR20210123950 A KR 20210123950A
Authority
KR
South Korea
Prior art keywords
prediction
block
slice
current block
unit
Prior art date
Application number
KR1020200041847A
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 KR1020200041847A priority Critical patent/KR20210123950A/en
Publication of KR20210123950A publication Critical patent/KR20210123950A/en

Links

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/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/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/174Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a slice, e.g. a line of blocks or a group of blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Abstract

A method and apparatus for encoding and decoding tile and slice information are provided. An image encoding apparatus includes a picture division unit, a prediction unit, a transform unit, a quantization unit, and a rearrangement unit, an entropy encoding unit, an inverse quantization unit, an inverse transform unit, a filter unit, and a memory. An object of the present invention is to improve the coding efficiency of a video signal.

Description

비디오 신호 처리 방법 및 장치 {Video signal encoding method and apparatus and video decoding method and apparatus}Video signal processing method and apparatus {Video signal encoding method and apparatus and video decoding method and apparatus}

본 발명은 비디오 신호 처리 방법 및 장치에 관한 것이다. The present invention relates to a video signal processing method and apparatus.

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

본 발명은 비디오 신호의 코딩 효율을 향상시키고자 함에 있다. An object of the present invention is to improve the coding efficiency of a video signal.

상기 과제를 해결하기 위하여 본 발명은 타일 및 슬라이스 정보 부호화/복호화 방법 및 상기 방법을 수행하기 위한 장치를 제공한다. In order to solve the above problems, the present invention provides a method for encoding/decoding tile and slice information and an apparatus for performing the method.

본 발명에 따른 비디오 신호 처리 방법 및 장치는 타일 및 슬라이스 정보 부호화/복호화 방법을 통해 비디오 신호 코딩 효율을 향상 시킬 수 있다.A video signal processing method and apparatus according to the present invention can improve video signal coding efficiency through a tile and slice information encoding/decoding method.

1One 비디오 부호화 및 복호화 방법 Video encoding and decoding methods

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

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

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

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

Figure pat00001
Figure pat00001

도 1 Figure 1

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

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

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

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

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

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

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

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

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

예측부(120, 125)는 인터 예측을 수행하는 인터 예측부(120)와 인트라 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화기에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(120, 125)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.The prediction units 120 and 125 may include an inter prediction unit 120 performing inter prediction and an intra prediction unit 125 performing intra prediction. Whether to use inter prediction or to perform intra prediction for a prediction unit may be determined, and specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this case, a processing unit in which prediction is performed and a processing unit in which a prediction method and specific content are determined may be different. For example, a prediction method and a prediction mode may be determined in a prediction unit, and prediction may be performed in a transformation unit. A residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130 . In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoder 165 together with a residual value and transmitted to a decoder. When a specific encoding mode is used, it is also possible to encode the original block as it is without generating the prediction block through the prediction units 120 and 125 and transmit it to the decoder.

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

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

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

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

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

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

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

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

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

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

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

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

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

엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. The entropy encoding unit 165 receives the residual value coefficient information and block type information, prediction mode information, division unit information, prediction unit information and transmission unit information, motion of the coding unit from the reordering unit 160 and the prediction units 120 and 125 . Various information such as vector information, reference frame information, interpolation information of a block, and filtering information may be encoded.

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

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

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

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

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

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

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

Figure pat00002
Figure pat00002

도 2 Figure 2

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

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

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

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

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

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

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

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

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

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

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

인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), 모션 벡터 예측 모드(AMVP Mode), 인트라 블록 카피 모드 중 어떠한 방법인지 여부를 판단할 수 있다.In order to perform inter prediction, a method of predicting motion of a prediction unit included in a corresponding coding unit based on a coding unit is a skip mode, a merge mode, a motion vector prediction mode (AMVP mode), and an intra block copy. It is possible to determine whether the method is any of the modes.

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

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

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

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

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

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

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

Figure pat00003
Figure pat00003

도 3Fig. 3

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

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

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

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

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

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

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

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

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

Figure pat00004
Figure pat00004

도 4Fig. 4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Figure pat00005
Figure pat00005

도 5Fig. 5

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

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

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

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

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

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

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

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

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

인터 예측은, 현재 블록의 인터 예측 모드를 결정하는 단계, 결정된 인터 예측 모드에 따라 현재 블록의 움직임 정보를 획득하는 단계 및 획득된 움직임 정보에 기초하여, 현재 블록에 대한 움직임 보상 예측을 수행하는 단계를 포함할 수 있다.Inter prediction includes the steps of determining an inter prediction mode of the current block, obtaining motion information of the current block according to the determined inter prediction mode, and performing motion compensation prediction on the current block based on the obtained motion information may include.

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

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

움직임 벡터는, 이전 픽처에 있는 오브젝트와 현재 픽처에 있는 오브젝트의 위치 차분을 나타낸다. 움직임 벡터의 정밀도를 결정하기 위한 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는, 시퀀스 단위, 슬라이스 단위 또는 블록 단위로 결정될 수 있다. 움직임 벡터 정밀도는 옥토펠, 쿼터펠, 하프펠, 정수펠 또는 4 정수펠로 설정될 수 있다. A motion vector represents a position difference between an object in a previous picture and an object in the current picture. Information for determining the precision of a motion vector may be signaled through a bitstream. The information may be determined in units of sequences, slices, or blocks. The motion vector precision can be set to octopel, quarter pel, half pel, integer pel, or 4 integer pels.

다음으로, 병진 움직임 정보를 이용하는 인터 예측 방법에 대해 상세히 설명하기로 한다. Next, an inter prediction method using translational motion information will be described in detail.

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

Figure pat00006
Figure pat00006

도 6Fig. 6

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

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

머지 후보의 움직임 정보는 후보 블록의 움직임 정보와 동일하게 설정될 수 있다. 일 예로, 후보 블록의 모션 벡터, 참조 픽처 인덱스, 예측 방향 또는 양방향 가중치 인덱스 중 적어도 하나를 머지 후보의 움직임 정보로 설정할 수 있다.The motion information of the merge candidate may be set to be the same as the motion information of the candidate block. As an example, at least one of a motion vector, a reference picture index, a prediction direction, and a bidirectional weight index of the candidate block may be set as the motion information of the merge candidate.

머지 후보를 포함하는 머지 후보 리스트를 생성할 수 있다(S602). 상기 머지 후보는 현재 블록에 인접한 이웃 블록으로부터 유도된 인접 머지 후보 및 비이웃 블록으로부터 유도되는 비인접 머지 후보로 구분될 수 있다.A merge candidate list including merge candidates may be generated ( S602 ). The merge candidate may be divided into a neighboring merge candidate derived from a neighboring block adjacent to the current block and a non-adjacent merge candidate derived from a non-neighboring block.

머지 후보 리스트 내 머지 후보들의 인덱스는 소정 순서에 따라 할당될 수 있다.Indices of merge candidates in the merge candidate list may be allocated according to a predetermined order.

머지 후보에 복수의 머지 후보들이 포함된 경우, 복수의 머지 후보들 중 적어도 하나를 선택할 수 있다(S603).When a plurality of merge candidates are included in the merge candidate, at least one of the plurality of merge candidates may be selected ( S603 ).

머지 후보 리스트에 포함된 머지 후보들의 개수가 문턱값보다 작은 경우, 예측 영역 모션 정보 테이블에 포함된 머지 후보를 머지 후보 리스트에 추가할 수 있다. 여기서, 문턱값은 머지 후보 리스트가 포함할 수 있는 최대 머지 후보의 개수 또는 최대 머지 후보의 개수에서 오프셋을 차감한 값일 수 있다. 오프셋은, 1 또는 2 등의 자연수일 수 있다. 인티 영역 모션 정보 테이블은 현재 블록 이전에 부호화/복호화된 블록을 기초로 유도된 머지 후보를 포함할 수 있다.When the number of merge candidates included in the merge candidate list is smaller than the threshold, the merge candidates included in the prediction region motion information table may be added to the merge candidate list. Here, the threshold value may be a value obtained by subtracting an offset from the maximum number of merge candidates or the maximum number of merge candidates that the merge candidate list may include. The offset may be a natural number such as 1 or 2. The inte-region motion information table may include a merge candidate derived based on a block encoded/decoded before the current block.

예측 영역 모션 정보 테이블은 현재 픽처 내 인터 예측을 기초로 부호화/복호화된 블록으로부터 유도되는 머지 후보를 포함한다. 일 예로, 예측 영역 모션 정보 테이블에 포함된 머지 후보의 움직임 정보는 인터 예측을 기초로 부호화/복호화된 블록의 움직임 정보와 동일하게 설정될 수 있다. 여기서, 움직임 정보는 모션 벡터, 참조 픽처 인덱스, 예측 방향 또는 양방향 가중치 인덱스 중 적어도 하나를 포함할 수 있다.The prediction region motion information table includes merge candidates derived from blocks encoded/decoded based on inter prediction within the current picture. As an example, motion information of a merge candidate included in the prediction region motion information table may be set to be the same as motion information of a block encoded/decoded based on inter prediction. Here, the motion information may include at least one of a motion vector, a reference picture index, a prediction direction, and a bidirectional weight index.

설명의 편의를 위해, 예측 영역 모션 정보 테이블에 포함된 머지 후보를 예측 영역 머지 후보라 호칭하기로 한다.For convenience of description, a merge candidate included in the prediction region motion information table will be referred to as a prediction region merge candidate.

예측 영역 모션 정보 테이블이 포함할 수 있는 머지 후보의 최대 개수는 부호화기 및 복호화기에서 기 정의되어 있을 수 있다. 일 예로, 예측 영역 모션 정보 테이블이 포함할 수 있는 최대 머지 후보의 개수는, 1, 2, 3, 4, 5, 6, 7, 8 또는 그 이상(예컨대, 16)일 수 있다.The maximum number of merge candidates that the prediction region motion information table can include may be predefined in the encoder and the decoder. As an example, the maximum number of merge candidates that the prediction region motion information table may include may be 1, 2, 3, 4, 5, 6, 7, 8 or more (eg, 16).

또는, 예측 영역 모션 정보 테이블이 포함할 수 있는 머지 후보의 최대 개수를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는, 시퀀스, 픽처, 또는 슬라이스 레벨에서 시그날링될 수 있다. 상기 정보는 예측 영역 모션 정보 테이블이 포함할 수 있는 머지 후보의 최대 개수를 나타낼 수 있다. 또는, 상기 정보는 예측 영역 모션 정보 테이블이 포함할 수 있는 머지 후보의 최대 개수와 머지 후보 리스트가 포함할 수 있는 머지 후보의 최대 개수 사이의 차분을 나타낼 수 있다.Alternatively, information indicating the maximum number of merge candidates that the prediction region motion information table may include may be signaled through a bitstream. The information may be signaled at a sequence, picture, or slice level. The information may indicate the maximum number of merge candidates that the prediction region motion information table may include. Alternatively, the information may indicate a difference between the maximum number of merge candidates that the prediction region motion information table may include and the maximum number of merge candidates that the merge candidate list may include.

또는, 픽처의 크기, 슬라이스의 크기 또는 코딩 트리 유닛의 크기에 따라, 예측 영역 모션 정보 테이블의 최대 머지 후보 개수가 결정될 수 있다.Alternatively, the maximum number of merge candidates of the prediction region motion information table may be determined according to the size of the picture, the size of the slice, or the size of the coding tree unit.

Figure pat00007
Figure pat00007

도 7 Fig. 7

도 7은 예측 영역 모션 정보 테이블의 업데이트 양상을 설명하기 위한 도면이다.7 is a diagram for explaining an update aspect of a prediction region motion information table.

현재 블록에 대해, 인터 예측이 수행된 경우, 현재 블록을 기초로 예측 영역 머지 후보를 유도할 수 있다. 예측 영역 머지 후보의 움직임 정보는 현재 블록의 움직임 정보와 동일하게 설정될 수 있다.When inter prediction is performed on the current block, a prediction region merge candidate may be derived based on the current block. The motion information of the prediction region merge candidate may be set to be the same as the motion information of the current block.

예측 영역 모션 정보 테이블이 빈 상태인 경우,현재 블록을 기초로 유도된 예측 영역 머지 후보를 예측 영역 모션 정보 테이블에 추가할 수 있다.When the prediction region motion information table is in an empty state, a prediction region merge candidate derived based on the current block may be added to the prediction region motion information table.

예측 영역 모션 정보 테이블이 이미 예측 영역 머지 후보를 포함하고 있는 경우, 현재 블록의 움직임 정보(또는, 이를 기초로 유도된 예측 영역 머지 후보)에 대한 중복성 검사를 실시할 수 있다. 중복성 검사는 예측 영역 모션 정보 테이블에 기 저장된 예측 영역 머지 후보의 움직임 정보와 현재 블록의 움직임 정보가 동일한지 여부를 결정하기 위한 것이다. 중복성 검사는 예측 영역 모션 정보 테이블에 기 저장된 모든 예측 영역 머지 후보들을 대상으로 수행될 수 있다. 또는, 예측 영역 모션 정보 테이블에 기 저장된 예측 영역 머지 후보들 중 인덱스가 문턱값 이상 또는 문턱값 이하인 예측 영역 머지 후보들을 대상으로 중복성 검사를 수행할 수 있다.When the prediction region motion information table already includes the prediction region merge candidate, the redundancy check may be performed on the motion information of the current block (or the prediction region merge candidate derived based thereon). The redundancy check is for determining whether motion information of a prediction region merge candidate previously stored in the prediction region motion information table and motion information of the current block are the same. The redundancy check may be performed on all prediction region merge candidates previously stored in the prediction region motion information table. Alternatively, the redundancy check may be performed on prediction region merge candidates whose index is greater than or equal to a threshold value or less than or equal to a threshold value among prediction region merge candidates previously stored in the prediction region motion information table.

현재 블록의 움직임 정보와 동일한 움직임 정보를 갖는 인터 예측 머지 후보가 포함되어 있지 않은 경우, 현재 블록을 기초로 유도된 예측 영역 머지 후보를 예측 영역 모션 정보 테이블에 추가할 수 있다. 인터 예측 머지 후보들이 동일한지 여부는, 인터 예측 머지 후보들의 움직임 정보(예컨대, 모션 벡터 및/또는 참조 픽처 인덱스 등)가 동일한지 여부를 기초로 결정될 수 있다. When an inter prediction merge candidate having the same motion information as the motion information of the current block is not included, a prediction region merge candidate derived based on the current block may be added to the prediction region motion information table. Whether the inter prediction merge candidates are the same may be determined based on whether motion information (eg, a motion vector and/or a reference picture index, etc.) of the inter prediction merge candidates is the same.

이때, 예측 영역 모션 정보 테이블에 이미 최대 개수의 예측 영역 머지 후보들이 저장되어 있을 경우, 가장 오래된 예측 영역 머지 후보를 삭제하고, 현재 블록을 기초로 유도된 예측 영역 머지 후보를 예측 영역 모션 정보 테이블에 추가할 수 있다. 여기서, 가장 오래된 예측 영역 머지 후보는 인덱스가 가장 큰 예측 영역 머지 후보 또는 인덱스가 가장 작은 예측 영역 머지 후보일 수 있다.At this time, if the maximum number of prediction region merge candidates is already stored in the prediction region motion information table, the oldest prediction region merge candidate is deleted, and the prediction region merge candidate derived based on the current block is added to the prediction region motion information table. can be added Here, the oldest prediction region merge candidate may be a prediction region merge candidate having the largest index or a prediction region merge candidate having the smallest index.

코딩 블록이 복수의 예측 유닛으로 분할되면, 분할된 예측 유닛 각각에 인트라 예측 또는 인터 예측이 수행될 수 있다. When a coding block is divided into a plurality of prediction units, intra prediction or inter prediction may be performed on each of the divided prediction units.

Figure pat00008
Figure pat00008

도 8Fig. 8

도 8은 대각선을 이용하여 코딩 블록을 복수의 예측 유닛들로 분할하는 예를 나타낸 도면이다. 8 is a diagram illustrating an example of dividing a coding block into a plurality of prediction units using a diagonal line.

도 8의 (a) 및 (b)에 도시된 예에서와 같이, 대각선을 이용하여 코딩 블록을 2개의 삼각 형태 예측 유닛들로 분할할 수 있다. As in the example shown in (a) and (b) of FIG. 8 , a coding block may be divided into two triangular shape prediction units using a diagonal line.

도 8의 (a) 및 (b)에서는 코딩 블록의 두 꼭지점을 잇는 대각선을 이용하여 코딩 블록을 두개의 예측 유닛들로 분할하는 것으로 도시하였다. 다만, 라인의 적어도 한쪽 끝이 코딩 블록의 꼭지점을 지나지 않는 사선을 이용하여, 코딩 블록을 두개의 예측 유닛들로 분할할 수 있다.In (a) and (b) of FIG. 8, it is illustrated that the coding block is divided into two prediction units using a diagonal line connecting two vertices of the coding block. However, the coding block may be divided into two prediction units by using a diagonal line in which at least one end of the line does not pass through the vertex of the coding block.

Figure pat00009
Figure pat00009

도 9Fig. 9

도 9는 코딩 블록을 2개의 예측 유닛들로 분할하는 예를 도시한 도면이다.9 is a diagram illustrating an example of dividing a coding block into two prediction units.

도 9의 (a) 및 (b)에 도시된 예에서와 같이, 양 끝이 각각 코딩 블록의 상단 경계 및 하단 경계에 접하는 사선을 이용하여, 코딩 블록을 두개의 예측 유닛들로 분할할 수 있다. As in the example shown in (a) and (b) of FIG. 9 , the coding block may be divided into two prediction units by using a diagonal line at both ends touching the upper boundary and the lower boundary of the coding block, respectively. .

또는, 도 9의 (c) 및 (d)에 도시된 예에서와 같이, 양 끝이 각각 코딩 블록의 좌측 경계 및 우측 경계에 접하는 사선을 이용하여, 코딩 블록을 두개의 예측 유닛들로 분할할 수 있다.Alternatively, as in the example shown in (c) and (d) of FIG. 9 , the coding block is divided into two prediction units using diagonal lines at both ends touching the left and right boundaries of the coding block, respectively. can

또는, 코딩 블록을 크기가 상이한 2개의 예측 블록으로 분할할 수 있다. 일 예로, 코딩 블록을 분할하는 사선이 하나의 꼭지점을 이루는 두 경계면에 접하도록 설정함으로써, 코딩 블록을 크기가 다른 두개의 예측 유닛들로 분할할 수 있다. Alternatively, the coding block may be divided into two prediction blocks having different sizes. As an example, the coding block may be divided into two prediction units having different sizes by setting the diagonal line dividing the coding block to be in contact with two boundary planes forming one vertex.

Figure pat00010
Figure pat00010

도 10Fig. 10

도 10은 코딩 블록을 크기가 상이한 복수의 예측 블록들로 분할하는 예시들을 나타낸다.10 shows examples of dividing a coding block into a plurality of prediction blocks having different sizes.

도 10의 (a) 및 (b)에 도시된 예에서와 같이, 코딩 블록의 좌상단과 우하단을 잇는 대각선이, 코딩 블록의 좌상단 코너 또는 우하단 코너를 지나는 대신 좌측 경계, 우측 경계, 상단 경계 또는 하단 경계를 지나도록 설정함으로써, 코딩 블록을 상이한 크기를 갖는 두개의 예측 유닛들로 분할할 수 있다.As in the example shown in (a) and (b) of FIG. 10 , the diagonal line connecting the upper left and lower right ends of the coding block does not pass through the upper left corner or the lower right corner of the coding block. Instead of passing through the upper left corner or the lower right corner, the left boundary, the right boundary, the upper boundary Alternatively, by setting it to cross the lower boundary, the coding block may be divided into two prediction units having different sizes.

또는, 도 10의 (c) 및 (d)에 도시된 예에서와 같이, 코딩 블록의 우상단과 좌하단을 잇는 대각선이 코딩 블록의 좌상단 코너 또는 우하단 코너를 지나는 대신, 좌측 경계, 우측 경계, 상단 경계 또는 하단 경계를 지나도록 설정함으로써, 코딩 블록을 상이한 크기를 갖는 두개의 예측 유닛들로 분할할 수 있다.Or, as in the example shown in (c) and (d) of Figure 10, the diagonal line connecting the upper right and lower left of the coding block passes through the upper left corner or the lower right corner of the coding block, instead of the left boundary, the right boundary, By setting it to cross the upper boundary or the lower boundary, it is possible to divide the coding block into two prediction units having different sizes.

도 8 내지 도 10의 예측 방법을 대각 예측 방법이라 정의한다. 대각 예측 방법에서 서로 다른 예측 부호화/복호화 방법을 사용할 수도 있다. 여기서, 예측 부호화/복호화 방법은 인트라 예측 방법, 인터 예측 방법(머지 예측 부호화 방법을 포함), 인트라 블록 카피 부호화 방법등을 나타낸다. The prediction method of FIGS. 8 to 10 is defined as a diagonal prediction method. In the diagonal prediction method, different prediction encoding/decoding methods may be used. Here, the predictive encoding/decoding method indicates an intra prediction method, an inter prediction method (including a merge prediction encoding method), an intra block copy encoding method, and the like.

일 예로, 하나의 예측 블록에서는 인트라 예측을 사용하고, 다른 예측 블록에서는 머지 예측 부호화 방법을 사용할 수도 있으며, 이를 대각 결합 예측 방법이라 정의할 수 있다. As an example, intra prediction may be used in one prediction block and a merge prediction encoding method may be used in another prediction block, which may be defined as a diagonal joint prediction method.

Figure pat00011
Figure pat00011

도 11Fig. 11

코딩 블록의 크기 또는 코딩 블록의 높이 대 너비비(이하, whratio)가 문턱값 이상 또는 이하인 경우에 대각 예측 방법 중 소정의 기 정의된 파티션만 허용하도록 설정할 수 있다. 여기서 whratio는 수학식 1과 같이 정의할 수 있다. When the size of the coding block or the height-to-width ratio (hereinafter, whratio) of the coding block is equal to or greater than a threshold value, it may be set to allow only a predefined partition among the diagonal prediction methods. Here, whratio can be defined as in Equation 1.

일 예로, 코딩 블록의 크기가 Nx4이거나 Nx8인 경우에는 대각 예측 방법에서 도 11의 오른쪽 그림과 같은 파티션만 허용할 수 있고, 코딩 블록의 크기가 4xN, 8xN 인 경우에는 대각 예측 방법에서 도 11의 오른쪽 그림과 같은 파티션만 허용할 수 있다. For example, when the size of the coding block is Nx4 or Nx8, only the partition as shown in the right figure of FIG. 11 can be allowed in the diagonal prediction method, and when the size of the coding block is 4xN and 8xN, the diagonal prediction method of FIG. 11 Only partitions like the picture on the right can be allowed.

또 다른 예로, whratio의 절대값이 N 이상인 경우에, 대각 예측 방법에서 기 정의된 하나의 파티션만 허용하도록 설정할 수도 있다. As another example, when the absolute value of whratio is N or more, it may be set to allow only one predefined partition in the diagonal prediction method.

도 11에 기술한 방법 또는 상기 방법을 thin 대각 예측 방법이라 정의한다. The method described in FIG. 11 or the method is defined as a thin diagonal prediction method.

Thin 대각 예측 방법에서 각 파티션에 서로 다른 예측 부호화/복호화 방법을 적용할 수도 있다. 일 예로, 제 1 파티션 (좌측 또는 상측 파티션)에서는 인트라 예측을 사용하고, 제 2 파티션(우측 또는 하측 파티션)에서는 머지 예측 방법을 사용하거나, 제 1 파티션에서는 머지 예측 방법을 사용하고, 제 2 파티션에서는 인트라 예측 방법을 사용할 수도 있다. In the thin diagonal prediction method, different prediction encoding/decoding methods may be applied to each partition. For example, intra prediction is used in the first partition (left or upper partition), the merge prediction method is used in the second partition (right or lower partition), or the merge prediction method is used in the first partition, and the second partition may use an intra prediction method.

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

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

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

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

Figure pat00012
Figure pat00012

도 12Fig. 12

도 12는 본 발명의 일 실시예에 따른, 인트라 예측 방법의 흐름도이다.12 is a flowchart of an intra prediction method according to an embodiment of the present invention.

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

복수의 참조 샘플 라인들 중 현재 블록의 참조 샘플 라인을 식별하는 인덱스 정보가 비트스트림을 통해 시그날링될 수 있다. 일 예로, 현재 블록의 참조 샘플 라인을 특정하기 위한 인덱스 정보 intra_luma_ref_idx가 비트스트림을 통해 시그날링될 수 있다. 상기 인덱스 정보는 코딩 블록 단위로 시그날링될 수 있다. 복수의 참조 샘플 라인들은, 현재 블록에 상단 및/또는 좌측 1번째 라인, 2번째 라인, 3번째 라인 또는 4번째 라인 중 적어도 하나를 포함할 수 있다. 복수개의 참조 샘플 라인들 중 현재 블록의 상단에 인접하는 행 및 현재 블록의 좌측에 인접하는 열로 구성된 참조 샘플 라인을 인접 참조 샘플 라인이라 호칭하고, 그 이외의 참조 샘플 라인을 비인접 참조 샘플 라인이라 호칭할 수도 있다. Index information for identifying a reference sample line of a current block among a plurality of reference sample lines may be signaled through a bitstream. As an example, index information intra_luma_ref_idx for specifying a reference sample line of the current block may be signaled through a bitstream. The index information may be signaled in units of coding blocks. The plurality of reference sample lines may include at least one of a first line, a second line, a third line, or a fourth line from the top and/or left of the current block. Among the plurality of reference sample lines, a reference sample line composed of a row adjacent to the top of the current block and a column adjacent to the left of the current block is called an adjacent reference sample line, and other reference sample lines are called non-adjacent reference sample lines. may be called

Figure pat00013
Figure pat00013

도 13Fig. 13

도 13은 본 발명의 일 실시예에 따른, 후보 참조 샘플 라인들을 나타낸 도면이다.13 is a diagram illustrating candidate reference sample lines according to an embodiment of the present invention.

복수의 참조 샘플 라인들 중 일부만이 현재 블록의 참조 샘플 라인으로 선택될 수 있다. 일 예로, 복수의 참조 샘플 라인들 중 제3 비인접 참조 샘플 라인을 제외한 잔여 참조 샘플 라인들을 후보 참조 샘플 라인들로 설정할 수 있다. 표 3은 후보 참조 샘플 라인들 각각에 할당되는 인덱스를 나타낸 것이다. Only some of the plurality of reference sample lines may be selected as reference sample lines of the current block. As an example, the remaining reference sample lines excluding the third non-adjacent reference sample line among the plurality of reference sample lines may be set as candidate reference sample lines. Table 3 shows indices allocated to each of the candidate reference sample lines.

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

설명한 것 보다 더 많은 수의 후보 참조 샘플 라인들을 설정하거나, 더 적은 수의 후보 참조 샘플 라인들을 설정할 수도 있다. 또한, 후보 참조 샘플 라인으로 설정되는 비인접 참조 샘플 라인의 개수 또는 위치는 설명한 예에 한정되지 아니한다. 일 예로, 제1 비인접 참조 샘플 라인 및 제3 비인접 참조 샘플 라인을 후보 참조 샘플 라인들로 설정하거나, 제2 비인접 참조 샘플 라인 및 제3 비인접 참조 샘플 라인을 후보 참조 샘플 라인들로 설정할 수도 있다. 또는, 제1 비인접 참조 샘플 라인, 제2 비인접 참조 샘플 라인 및 제3 비인접 참조 샘플 라인을 모두 후보 참조 샘플 라인들로 설정할 수도 있다. A larger number of candidate reference sample lines may be set than described, or a smaller number of candidate reference sample lines may be set. In addition, the number or positions of non-adjacent reference sample lines set as candidate reference sample lines are not limited to the described example. As an example, the first non-adjacent reference sample line and the third non-adjacent reference sample line are set as candidate reference sample lines, or the second non-adjacent reference sample line and the third non-adjacent reference sample line are set as the candidate reference sample lines. You can also set Alternatively, the first non-adjacent reference sample line, the second non-adjacent reference sample line, and the third non-adjacent reference sample line may all be set as candidate reference sample lines.

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

참조 샘플 라인에 포함된 참조 샘플들의 개수는 참조 샘플 라인과 참조 샘플 라인 사이의 거리에 기초하여 결정될 수 있다. 일 예로, 현재 블록과의 거리가 i인 참조 샘플 라인에 포함된 참조 샘플들의 개수가 현재 블록과의 거리가 i-1인 참조 샘플 라인에 포함된 참조 샘플들의 개수보다 더 큰 값을 가질 수 있다. 이에 따라, 비인접 참조 샘플 라인에 포함된 참조 샘플들의 개수는 인접 참조 샘플 라인에 포함된 참조 샘플들의 개수보다 큰 값을 가질 수 있다.The number of reference samples included in the reference sample line may be determined based on a distance between the reference sample line and the reference sample line. For example, the number of reference samples included in a reference sample line having a distance of i from the current block may have a greater value than the number of reference samples included in a reference sample line having a distance of i−1 from the current block. . Accordingly, the number of reference samples included in the non-adjacent reference sample line may have a greater value than the number of reference samples included in the adjacent reference sample line.

현재 블록과의 거리가 i인 비인접 참조 샘플 라인에 포함된 참조 샘플들의 개수와 인접 참조 샘플 라인에 포함된 참조 샘플들의 개수 차분을 참조 샘플 개수 오프셋이라 정의할 수 있다. 이때, 현재 블록의 상단에 위치하는 상단 참조 샘플들의 개수 차분을 offsetX[i]라 정의하고, 현재 블록의 좌측에 위치하는 좌측 참조 샘플들의 개수 차분을 offsetY[i]라 정의할 수 있다. offsetX 및 offsetY는 현재 블록과 비인접 참조 샘플 라인의 거리에 기초하여 결정될 수 있다. 일 예로, offsetX 및 offsetY는 i의 정수배로 설정될 수 있다. 일 예로, offsetX[i] 및 offset[i]는 2i일 수 있다. A difference between the number of reference samples included in a non-adjacent reference sample line having a distance of i from the current block and the number of reference samples included in an adjacent reference sample line may be defined as a reference sample number offset. In this case, a difference in the number of upper reference samples positioned at the top of the current block may be defined as offsetX[i], and a difference in number of left reference samples positioned at the left of the current block may be defined as offsetY[i]. offsetX and offsetY may be determined based on a distance between the current block and a non-adjacent reference sample line. For example, offsetX and offsetY may be set to an integer multiple of i. As an example, offsetX[i] and offset[i] may be 2i.

또는, 현재 블록의 너비 및 높이비에 기초하여 참조 샘플 개수 오프셋을 결정할 수도 있다. 수학식 1은 현재 블록의 너비 및 높이비를 수치화하는 일 예를 나타낸 것이다. Alternatively, the reference sample number offset may be determined based on the width and height ratio of the current block. Equation 1 shows an example of digitizing the width and height ratio of the current block.

Figure pat00014
Figure pat00014

수학식 1에 표현된 것과 다른 방법으로 현재 블록의 너비 및 높이비를 수치화하는 것 역시 가능하다. It is also possible to digitize the width and height ratio of the current block in a different way than that expressed in Equation 1.

현재 블록의 너비 및 높이비를 기초로 offsetX 및 offsetY의 값을 결정할 수 있다. 예를 들어, whRatio의 값이 1보다 큰 경우에는 offsetX의 값을 offsetY의 값보다 크게 설정할 수 있다. 일 예로, offsetX의 값은 1로 설정되고, offsetY의 값은 0으로 설정될 수 있다. 반면, whRatio의 값이 1보다 작은 경우에는 offsetX의 값보다 offsetY의 값을 더 크게 설정할 수 있다. 일 예로, offsetX의 값은 0으로 설정되고, offsetY의 값은 1로 설정될 수 있다. The values of offsetX and offsetY may be determined based on the width and height ratio of the current block. For example, when the value of whRatio is greater than 1, the value of offsetX may be set to be greater than the value of offsetY. For example, the value of offsetX may be set to 1, and the value of offsetY may be set to 0. On the other hand, when the value of whRatio is less than 1, the value of offsetY may be set larger than the value of offsetX. For example, the value of offsetX may be set to 0, and the value of offsetY may be set to 1.

x축 및 y축 좌표가 동일한 좌측 상단 참조 샘플 제외, 현재 블록과의 거리가 i인 비인접 참조 샘플 라인은 (refW + offsetX[i])개의 상단 참조 샘플들과 (refH + offsetY[i])개의 좌측 참조 샘플들로 구성될 수 있다. 여기서, refW 및 refH는 인접 참조 샘플 라인의 길이를 나타내는 것으로, 각각 다음의 수학식 2 및 3과 같이 설정될 수 있다.Except for the top left reference sample with the same x-axis and y-axis coordinates, a non-adjacent reference sample line with a distance of i from the current block is (refW + offsetX[i]) top reference samples and (refH + offsetY[i]) It may be composed of left reference samples. Here, refW and refH represent the length of the adjacent reference sample line, and may be set as in Equations 2 and 3, respectively.

Figure pat00015
Figure pat00015

Figure pat00016
Figure pat00016

수학식 2 및 수학식 3에서, nTbW는 인트라 예측이 수행되는 코딩 블록 또는 변환 블록의 너비를 나타내고, nTbH는 인트라 예측이 수행되는 코딩 블록 또는 변환 블록의 높이를 나타낸다. In Equations 2 and 3, nTbW represents a width of a coding block or transform block on which intra prediction is performed, and nTbH represents a height of a coding block or transform block on which intra prediction is performed.

결과적으로, 현재 블록과의 거리가 i인 참조 샘플 라인은 (refW + refH + offsetX[i] + offsetY[i] + 1)개의 참조 샘플들로 구성될 수 있다. As a result, a reference sample line having a distance of i from the current block may be composed of (refW + refH + offsetX[i] + offsetY[i] + 1) reference samples.

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

Figure pat00017
Figure pat00017

도 14Fig. 14

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

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

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

현재 블록의 참조 샘플 라인이 비인접 참조 샘플 라인인 경우, 비방향성 인트라 예측 모드를 사용하지 않도록 설정할 수 있다. 일 예로, 현재 블록의 참조 샘플 라인이 제1 비인접 참조 샘플 라인, 제2 비인접 참조 샘플 라인 또는 제3 비인접 참조 샘플 라인인 경우, DC 또는 플래너는 현재 블록의 인트라 예측 모드로 설정될 수 있다.When the reference sample line of the current block is a non-adjacent reference sample line, the non-directional intra prediction mode may be set not to be used. For example, when the reference sample line of the current block is the first non-adjacent reference sample line, the second non-adjacent reference sample line, or the third non-adjacent reference sample line, DC or the planner may be set to the intra prediction mode of the current block. have.

또는, 현재 블록의 참조 샘플 라인이 비인접 참조 샘플 라인인 경우, 비방향성 인트라 예측 모드 또는 특정 방향의 인트라 예측 모드 중 적어도 하나를 사용하지 않도록 설정할 수 있다. 비방향성 인트라 예측 모드는 DC 또는 플래너 중 적어도 하나를 포함하고, 특정 방향의 인트라 예측 모드는 수평 방향 인트라 예측 모드(예컨대, 도 14의 (b)에 도시된 INTRA_MODE18), 수직 방향 인트라 예측 모드(예컨대, 도 14의 (b)에 도시된 INTRA_MODE50) 또는 대각 방향 인트라 예측 모드(예컨대, 도 14의 (b)에 도시된 INTRA_MODE2, INTRA_34 또는 INTRA_MODE66) 중 적어도 하나를 포함할 수 있다. Alternatively, when the reference sample line of the current block is a non-adjacent reference sample line, at least one of the non-directional intra prediction mode and the intra prediction mode of a specific direction may be set not to be used. The non-directional intra prediction mode includes at least one of DC or planar, and the intra prediction mode in a specific direction includes a horizontal intra prediction mode (eg, INTRA_MODE18 shown in FIG. 14B), a vertical intra prediction mode (eg, , INTRA_MODE50 shown in FIG. 14B) or a diagonal intra prediction mode (eg, INTRA_MODE2, INTRA_34, or INTRA_MODE66 shown in FIG. 14B).

현재 블록에 대해, 현재 블록의 인트라 예측 모드와 동일한 MPM이 MPM 리스트에 포함되어 있는지 여부를 나타내는 정보가 시그날링될 수 있다. 상기 정보는 1비트의 플래그로 MPM 플래그라 호칭될 수 있다. 상기 MPM 플래그가 현재 블록과 동일한 MPM이 MPM 리스트에 포함되어 있음을 나타내는 경우, 디폴트 모드 또는 MPM(Most Probable Mode) 중 적어도 하나를 기초로 현재 블록의 인트라 예측 모드를 유도할 수 있다.For the current block, information indicating whether the same MPM as the intra prediction mode of the current block is included in the MPM list may be signaled. The information is a 1-bit flag and may be referred to as an MPM flag. When the MPM flag indicates that the same MPM as the current block is included in the MPM list, the intra prediction mode of the current block may be derived based on at least one of a default mode and a Most Probable Mode (MPM).

디폴트 모드는 DC, 플래너, 수직 방향 인트라 예측 모드, 수평 방향 인트라 예측 모드, 대각 방향 인트라 예측 모드 중 적어도 하나를 포함할 수 있다. 현재 블록의 인트라 예측 모드가 디폴트 모드와 동일한지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 상기 정보는 1비트의 플래그일 수 있다. The default mode may include at least one of DC, planar, vertical intra prediction mode, horizontal intra prediction mode, and diagonal intra prediction mode. Information indicating whether the intra prediction mode of the current block is the same as the default mode may be signaled through the bitstream. The information may be a 1-bit flag.

상기 플래그가 현재 블록의 인트라 예측 모드가 디폴트 모드임을 가리키고, 복수개의 인트라 예측 모드들이 디폴트 모드들로 설정된 경우, 디폴트 모드들 중 어느 하나를 지시하는 인덱스 정보가 더 시그날링될 수 있다. 현재 블록의 인트라 예측 모드는 상기 인덱스 정보가 가리키는 디폴트 모드로 설정될 수 있다.When the flag indicates that the intra prediction mode of the current block is the default mode, and a plurality of intra prediction modes are set as default modes, index information indicating any one of the default modes may be further signaled. The intra prediction mode of the current block may be set as a default mode indicated by the index information.

현재 블록의 인트라 예측 모드가 디폴트 모드와 동일하지 않은 경우, MPM 리스트를 이용하여, 현재 블록의 인트라 예측 모드를 유도할 수 있다. When the intra prediction mode of the current block is not the same as the default mode, the intra prediction mode of the current block may be derived using the MPM list.

이하, MPM 유도 방법에 대해 상세히 살펴보기로 한다. Hereinafter, the MPM induction method will be described in detail.

MPM은 현재 블록에 인접하는 이웃 블록의 인트라 예측 모드를 기초로 유도될 수 있다. 여기서, 이웃 블록은, 현재 블록의 좌측에 인접하는 좌측 이웃 블록, 현재 블록의 상단에 이웃하는 상단 이웃 블록, 현재 블록의 좌측 상단 코너에 인접하는 좌상단 이웃 블록, 현재 블록의 우측 상단 코너에 인접하는 우상단 이웃 블록 또는 현재 블록의 좌측 하단 코너에 인접하는 좌하단 이웃 블록 중 적어도 하나를 포함할 수 있다. 현재 블록의 좌측 상단 샘플의 좌표를 (0, 0)이라 할 때, 좌측 이웃 블록은 (-1, 0), (-1, H-1) 또는 (-1, (H-1)/2) 위치의 샘플을 포함할 수 있다. 여기서, H는 현재 블록의 높이를 나타낸다. 상단 이웃 블록은 (0, -1), (W-1, -1) 또는 ((W-1)/2, -1) 위치의 샘플을 포함할 수 있다. 여기서, W는 현재 블록의 너비를 나타낸다. 좌상단 이웃 블록은 (-1, -1) 위치의 샘플을 포함할 수 있다. 우상단 이웃 블록은, (W, -1) 위치의 샘플을 포함할 수 있다. 좌하단 이웃 블록은 (-1, H)위치의 샘플을 포함할 수 있다.The MPM may be derived based on the intra prediction mode of a neighboring block adjacent to the current block. Here, the neighboring block is a left neighboring block adjacent to the left of the current block, an upper neighboring block neighboring to the upper end of the current block, an upper left neighboring block neighboring to the upper left corner of the current block, and an upper right neighboring block adjacent to the upper right corner of the current block It may include at least one of an upper-right neighboring block or a lower-left neighboring block adjacent to a lower-left corner of the current block. When the coordinates of the upper left sample of the current block are (0, 0), the left neighboring block is (-1, 0), (-1, H-1) or (-1, (H-1)/2) A sample of the location may be included. Here, H represents the height of the current block. The top neighboring block may contain samples at positions (0, -1), (W-1, -1) or ((W-1)/2, -1). Here, W represents the width of the current block. The upper-left neighboring block may include a sample at the (-1, -1) position. The upper right neighboring block may include a sample at the (W, -1) position. The lower left neighboring block may include a sample at the (-1, H) position.

현재 블록의 참조 샘플 라인에 기초하여, MPM을 유도하는데 이용되는 이웃 블록의 개수 또는 위치가 상이하게 결정될 수 있다. 일 예로, 인접 참조 샘플 라인이 현재 블록의 참조 샘플 라인으로 결정된 경우, 상단 이웃 블록 및 좌측 이웃 블록이 MPM을 유도하는데 이용될 수 있다. 반면, 비인접 참조 샘플 라인이 현재 블록의 참조 샘플 라인으로 결정된 경우, 상단 이웃 블록 및 좌측 이웃 블록에 더하여, 좌상단 이웃 블록, 우상단 이웃 블록 또는 좌하단 이웃 블록 중 적어도 하나를 더 이용하여 MPM을 유도할 수 있다. Based on the reference sample line of the current block, the number or position of the neighboring blocks used to derive the MPM may be determined differently. As an example, when the neighboring reference sample line is determined as the reference sample line of the current block, the upper neighboring block and the left neighboring block may be used to derive the MPM. On the other hand, when the non-adjacent reference sample line is determined as the reference sample line of the current block, the MPM is derived using at least one of an upper-left neighboring block, an upper-right neighboring block, or a lower-left neighboring block, in addition to the upper neighboring block and the left neighboring block. can do.

현재 블록의 인트라 예측 모드가 디폴트 모드와 동일한지 여부를 나타내는 플래그가 시그날링되는 경우, 디폴트 모드와 동일한 인트라 예측 모드는 MPM으로 설정되지 않도록 설정될 수 있다. 일 예로, 디폴트 모드 플래그가 현재 블록의 인트라 예측 모드가 플래너인지 여부를 지시하는 경우, 플래너에 해당하는 MPM을 제외한 5개의 MPM들을 이용하여, 현재 블록의 인트라 예측 모드를 유도할 수 있다.When a flag indicating whether the intra prediction mode of the current block is the same as the default mode is signaled, the same intra prediction mode as the default mode may be set not to be set as the MPM. As an example, when the default mode flag indicates whether the intra prediction mode of the current block is the planner, the intra prediction mode of the current block may be derived by using 5 MPMs excluding the MPM corresponding to the planner.

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

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

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

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

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

PredModeIntra
IntraPredAng
PredModeIntra
IntraPredAng
1
-
One
-
2
32
2
32
3
26
3
26
4
21
4
21
5
17
5
17
6
13
6
13
7
9
7
9
PredModeIntraIntraPredAngPredModeIntraIntraPredAng 8
5
8
5
9
2
9
2
10
0
10
0
11
-2
11
-2
12
-5
12
-5
13
-9
13
-9
14
-13
14
-13
PredModeIntraIntraPredAngPredModeIntraIntraPredAng 15
-17
15
-17
16
-21
16
-21
17
-26
17
-26
18
-32
18
-32
19
-26
19
-26
20
-21
20
-21
21
-17
21
-17
PredModeIntraIntraPredAngPredModeIntraIntraPredAng 22
-13
22
-13
23
-9
23
-9
24
-5
24
-5
25
-2
25
-2
26
0
26
0
27
2
27
2
28
5
28
5
PredModeIntraIntraPredAngPredModeIntraIntraPredAng 29
9
29
9
30
13
30
13
31
17
31
17
32
21
32
21
33
26
33
26
34
32
34
32

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

Figure pat00018
Figure pat00018

도 15Fig. 15

Figure pat00019
Figure pat00019

도 16Fig. 16

도 15 및 도 16는 참조 샘플들을 일렬로 배열하는 일차원 배열의 예시를 나타낸 도면이다.15 and 16 are diagrams illustrating examples of a one-dimensional array in which reference samples are arranged in a line.

도 15는 참조 샘플들을 수직 방향으로 배열하는 수직 방향 일차원 배열의 예시를 나타낸 것이고, 도 16는 참조 샘플들을 수평 방향으로 배열하는 수평 방향 일차원 배열의 예시를 나타낸 것이다. 35개의 인트라 예측 모드가 정의된 경우를 가정하여, 도 15및 도 16의 실시예를 설명한다. 15 shows an example of a vertical one-dimensional array in which reference samples are arranged in a vertical direction, and FIG. 16 shows an example of a horizontal one-dimensional array in which reference samples are arranged in a horizontal direction. Assuming that 35 intra prediction modes are defined, the embodiments of FIGS. 15 and 16 will be described.

인트라 예측 모드 인덱스가 11 내지 18 중 어느 하나인 경우, 상단 참조 샘플들을 반시계 방향으로 회전한 수평 방향 일차원 배열을 적용하고, 인트라 예측 모드 인덱스가 19 내지 25 중 어느 하나인 경우, 좌측 참조 샘플들을 시계 방향으로 회전한 수직 방향 일차원 배열을 적용할 수 있다. 참조 샘플들을 일렬로 배열함에 있어서, 인트라 예측 모드 각도를 고려할 수 있다. When the intra prediction mode index is any one of 11 to 18, a horizontal one-dimensional array in which the upper reference samples are rotated counterclockwise is applied, and when the intra prediction mode index is any one of 19 to 25, the left reference samples are A vertical one-dimensional array rotated in a clockwise direction can be applied. In arranging the reference samples in a line, the intra prediction mode angle may be considered.

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

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

Figure pat00020
Figure pat00020

Figure pat00021
Figure pat00021

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

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

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

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

Figure pat00022
Figure pat00022

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

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

Figure pat00023
Figure pat00023

복수의 인트라 예측 모드에 기초하여 현재 블록에 대한 인트라 예측을 수행할 수도 있다. 일 예로, 예측 샘플별로 인트라 예측 모드를 유도하고, 각각의 예측 샘플에 할당된 인트라 예측 모드에 기초하여 예측 샘플을 유도할 수 있다. Intra prediction may be performed on the current block based on a plurality of intra prediction modes. As an example, an intra prediction mode may be derived for each prediction sample, and a prediction sample may be derived based on the intra prediction mode allocated to each prediction sample.

Figure pat00024
Figure pat00024

도 17Fig. 17

도 17은 방향성 인트라 예측 모드들이 x축과 평행한 직선과 형성하는 각도를 예시한 도면이다.17 is a diagram illustrating angles formed by directional intra prediction modes with a straight line parallel to the x-axis.

도 17에 나타난 예에서와 같이, 방향성 예측 모드들은 좌측 하단 대각 방향부터 우측 상단 대각 방향 사이에 존재할 수 있다. x축과 방향성 예측 모드가 형성하는 각도로 설명하면, 방향성 예측 모드들은, 45도 (좌측 하단 대각 방향) 부터, -135도 (우측 상단 대각 방향) 사이에 존재할 수 있다.As in the example shown in FIG. 17 , the directional prediction modes may exist between the lower left diagonal direction and the upper right diagonal direction. When described as an angle formed by the x-axis and the directional prediction mode, the directional prediction modes may exist between 45 degrees (lower left diagonal direction) and -135 degrees (upper right diagonal direction).

현재 블록이 비정방 형태인 경우, 현재 블록의 인트라 예측 모드에 따라, 인트라 예측 각도를 따르는 앵귤러 라인 상에 위치하는 참조 샘플들 중 예측 샘플에 보다 가까운 참조 샘플 대신 예측 샘플에 보다 먼 참조 샘플을 이용하여 예측 샘플을 유도하는 경우가 발생할 수 있다. When the current block has a non-square shape, according to the intra prediction mode of the current block, a reference sample farther from the prediction sample is used instead of the reference sample closer to the prediction sample among reference samples located on the angular line along the intra prediction angle Thus, a case of deriving a prediction sample may occur.

Figure pat00025
Figure pat00025

도 18Fig. 18

도 18은 현재 블록이 비정방 형태인 경우, 예측 샘플이 획득되는 양상을 나타낸 도면이다.18 is a diagram illustrating an aspect in which a prediction sample is obtained when a current block has a non-square shape.

일 예로, 도 18의 (a)에 도시된 예에서와 같이, 현재 블록이 너비가 높이보다 큰 비정방형이고, 현재 블록의 인트라 예측 모드가 0도부터 45도 사이의 각도를 갖는 방향성 인트라 예측 모드인 것으로 가정한다. 위 경우, 현재 블록의 우측 열 부근의 예측 샘플 A를 유도할 때, 상기 각도를 따르는 앵귤러 모드 상에 위치하는 참조 샘플들 중 상기 예측 샘플과 가까운 상단 참조 샘플 T 대신 상기 예측 샘플과 먼 좌측 참조 샘플 L을 이용하는 경우가 발생할 수 있다. For example, as in the example shown in (a) of FIG. 18 , the current block has a non-square width greater than the height, and the intra prediction mode of the current block is a directional intra prediction mode having an angle between 0 degrees and 45 degrees. is assumed to be In the above case, when deriving the prediction sample A near the right column of the current block, the left reference sample far from the prediction sample instead of the top reference sample T close to the prediction sample among the reference samples located on the angular mode along the angle L may be used.

다른 예로, 도 18의 (b)에 도시된 예에서와 같이, 현재 블록이 높이가 너비보다 큰 비정방형이고, 현재 블록의 인트라 예측 모드가 -90 도부터 -135도 사이인 방향성 인트라 예측 모드인 것으로 가정한다. 위 경우, 현재 블록의 하단 행 부근의 예측 샘플 A를 유도할 때, 상기 각도를 따르는 앵귤러 모드 상에 위치하는 참조 샘플들 중 상기 예측 샘플과 가까운 좌측 참조 샘플 L 대신 상기 예측 샘플과 먼 상단 참조 샘플 T를 이용하는 경우가 발생할 수 있다. As another example, as in the example shown in (b) of FIG. 18 , the current block is a square with a height greater than the width, and the intra prediction mode of the current block is a directional intra prediction mode between -90 and -135 degrees. assume that In the above case, when deriving the prediction sample A near the bottom row of the current block, the top reference sample far from the prediction sample instead of the left reference sample L close to the prediction sample among the reference samples located on the angular mode along the angle There may be cases where T is used.

Figure pat00026
Figure pat00026

도 19Fig. 19

도 19는 와이드 앵글 인트라 예측 모드들을 나타낸 도면이다. 19 is It is a diagram illustrating wide-angle intra prediction modes.

도 19에 도시된 예에서, 인덱스가 -1 부터 -14인 인트라 예측 모드들 및 인덱스가 67 부터 80 사이인 인트라 예측 모드들이 와이드 앵글 인트라 예측 모드들을 나타낸다.In the example shown in FIG. 19 , intra prediction modes having an index of -1 to -14 and intra prediction modes having an index of 67 to 80 represent wide-angle intra prediction modes.

도 19에서는 각도가 45도 보다 큰 14개의 와이드 앵글 인트라 예측 모드들(-1 부터 -14) 및 각도가 -135도 보다 작은 14개의 와이드 앵글 인트라 예측 모드들(67 부터 80)을 예시하였으나, 이보다 더 많은 수 또는 더 적은 수의 와이드 앵글 인트라 예측 모드들이 정의될 수 있다.19 exemplifies 14 wide-angle intra prediction modes (-1 to -14) with an angle greater than 45 degrees and 14 wide-angle intra prediction modes (67 to 80) with an angle smaller than -135 degrees, but more A greater or lesser number of wide angle intra prediction modes may be defined.

와이드 앵글 인트라 예측 모드가 사용되는 경우, 상단 참조 샘플들의 길이는 2W+1로 설정되고, 좌측 참조 샘플들의 길이는 2H+1로 설정될 수 있다.When the wide-angle intra prediction mode is used, the length of the upper reference samples may be set to 2W+1, and the length of the left reference samples may be set to 2H+1.

와이드 앵글 인트라 예측 모드를 사용함에 따라, 도 18의 (a)에 도시된 샘플 A는 참조 샘플 T를 이용하여 예측되고, 도 18의 (b)에 도시된 샘플 A는 참조 샘플 L을 이용하여 예측될 수 있다. By using the wide-angle intra prediction mode, the sample A shown in FIG. 18A is predicted using the reference sample T, and the sample A shown in FIG. 18B is predicted using the reference sample L can be

기존 인트라 예측 모드들과 N개의 와이드 앵글 인트라 예측 모드들을 더해, 총 67 + N개의 인트라 예측 모드들을 사용할 수 있다. 일 예로, 표 5는 20개의 와이드 앵글 인트라 예측 모드가 정의된 경우, 인트라 예측 모드들의 인트라 방향 파라미터를 나타낸 것이다.By adding the existing intra prediction modes and N wide-angle intra prediction modes, a total of 67 + N intra prediction modes may be used. As an example, Table 5 shows intra direction parameters of intra prediction modes when 20 wide-angle intra prediction modes are defined.

PredModeIntraPredModeIntra -10-10 -9-9 -8-8 -7-7 -6-6 -5-5 -4-4 -3-3 -2-2 intraPredAngleintraPredAngle 114114 9393 7979 6868 6060 5454 4949 4545 3939 PredModeIntraPredModeIntra -1-One 22 33 44 55 66 77 88 99 intraPredAngleintraPredAngle 3535 3232 2929 2626 2323 2121 1919 1717 1515 PredModeIntraPredModeIntra 1010 1111 1212 1313 1414 1515 1616 1717 1818 intraPredAngleintraPredAngle 1313 1111 99 77 55 33 22 1One 00 PredModeIntraPredModeIntra 1919 2020 2121 2222 2323 2424 2525 2626 2727 intraPredAngleintraPredAngle -1-One -2-2 -3-3 -5-5 -7-7 -9-9 -11-11 -13-13 -15-15 PredModeIntraPredModeIntra 2828 2929 3030 3131 3232 3333 3434 3535 3636 intraPredAngleintraPredAngle -17-17 -19-19 -21-21 -23-23 -26-26 -29-29 -32-32 -29-29 -26-26 PredModeIntraPredModeIntra 3737 3838 3939 4040 4141 4242 4343 4444 4545 intraPredAngleintraPredAngle -23-23 -21-21 -19-19 -17-17 -15-15 -13-13 -11-11 -9-9 -7-7 PredModeIntraPredModeIntra 4646 4747 4848 4949 5050 5151 5252 5353 5454 intraPredAngleintraPredAngle -5-5 -3-3 -2-2 -1-One 00 1One 22 33 55 PredModeIntraPredModeIntra 5555 5656 5757 5858 5959 6060 6161 6262 6363 intraPredAngleintraPredAngle 77 99 1111 1313 1515 1717 1919 2121 2323 PredModeIntraPredModeIntra 6464 6565 6666 6767 6868 6969 7070 7171 7272 intraPredAngleintraPredAngle 2626 2929 3232 3535 3939 4545 4949 5454 6060 PredModeIntraPredModeIntra 7373 7474 7575 7676 intraPredAngleintraPredAngle 6868 7979 9393 114114

현재 블록이 비정방형이고, S602 단계에서 획득된 현재 블록의 인트라 예측 모드가 변환 범위에 속하는 경우, 현재 블록의 인트라 예측 모드를 와이드 앵글 인트라 예측 모드로 변환할 수 있다. 상기 변환 범위는 현재 블록의 크기, 형태 또는 비율 중 적어도 하나를 기초로 결정될 수 있다. 여기서, 상기 비율은 현재 블록의 너비 및 높이 사이의 비율을 나타낼 수 있다.현재 블록이 너비가 높이보다 큰 비정방형인 경우, 변환 범위는 우측 상단 대각 방향의 인트라 예측 모드 인덱스(예컨대, 66)부터 (우측 상단 대각 방향인 인트라 예측 모드의 인덱스 - N)로 설정될 수 있다. 여기서, N은 현재 블록의 비율을 기초로 결정될 수 있다. 현재 블록의 인트라 예측 모드가 변환 범위에 속하는 경우, 상기 인트라 예측 모드를 와이드 앵글 인트라 예측 모드로 변환할 수 있다. 상기 변환은 상기 인트라 예측 모드에 기 정의된 값을 차감하는 것일 수 있고, 기 정의된 값은 와이드 앵글 인트라 예측 모드들을 제외한 인트라 예측 모드들의 총 개수 (예컨대, 67)일 수 있다.When the current block is non-square and the intra prediction mode of the current block obtained in step S602 falls within the transform range, the intra prediction mode of the current block may be converted into the wide-angle intra prediction mode. The transformation range may be determined based on at least one of a size, a shape, and a ratio of the current block. Here, the ratio may indicate a ratio between the width and the height of the current block. When the current block has a non-square shape having a width greater than a height, the transformation range starts from the upper right-side diagonal intra prediction mode index (eg, 66). (Index of the intra prediction mode in the upper right diagonal direction - N). Here, N may be determined based on the ratio of the current block. When the intra prediction mode of the current block belongs to a transformation range, the intra prediction mode may be converted into a wide-angle intra prediction mode. The transformation may be to subtract a value predefined for the intra prediction mode, and the predefined value may be the total number of intra prediction modes excluding wide-angle intra prediction modes (eg, 67).

상기 실시예에 의해, 66번부터 53번 사이의 인트라 예측 모드들은, 각각 -1번부터 -14번 사이의 와이드 앵글 인트라 예측 모드들로 변환될 수 있다. According to the above embodiment, the intra prediction modes of Nos. 66 to 53 may be converted into Wide-angle intra prediction modes of Nos. -1 to -14, respectively.

현재 블록이 높이가 너비보다 큰 비정방형인 경우, 변환 범위는 좌측 하단 대각 방향의 인트라 예측 모드 인덱스(예컨대, 2) 부터 (좌측 하단 대각 방향의 인트라 예측 모드의 인덱스 + M)으로 설정될 수 있다. 여기서, M은 현재 블록의 비율을 기초로 결정될 수 있다. 현재 블록의 인트라 예측 모드가 변환 범위에 속하는 경우, 상기 인트라 예측 모드를 와이드 앵글 인트라 예측 모드로 변환할 수 있다. 상기 변환은 상기 인트라 예측 모드에 기 정의된 값을 가산하는 것일 수 있고, 기 정의된 값은 와이드 앵글 인트라 예측 모드들을 제외한 방향성 인트라 예측 모드들의 총 개수(예컨대, 65)일 수 있다.When the current block has a non-square shape whose height is greater than the width, the transform range may be set from the intra prediction mode index (eg, 2) in the lower left diagonal direction (index of the intra prediction mode in the lower left diagonal direction + M). . Here, M may be determined based on the ratio of the current block. When the intra prediction mode of the current block belongs to a transformation range, the intra prediction mode may be converted into a wide-angle intra prediction mode. The transformation may be to add a predefined value to the intra prediction mode, and the predefined value may be the total number of directional intra prediction modes (eg, 65) excluding wide-angle intra prediction modes.

상기 실시예에 의해, 2번부터 15번 사이의 인트라 예측 모드들 각각은 67번부터 80번 사이의 와이드 앵글 인트라 예측 모드들로 변환될 수 있다.According to the above embodiment, each of the intra prediction modes of Nos. 2 to 15 may be converted into Nos. 67 to No. 80 wide-angle intra prediction modes.

이하, 변환 범위에 속하는 인트라 예측 모드들을 와이드 앵글 대체 인트라 예측 모드로 호칭하기로 한다.Hereinafter, intra prediction modes belonging to the transform range will be referred to as wide-angle alternative intra prediction modes.

변환 범위는 현재 블록의 비율에 기초하여 결정될 수 있다. 일 예로, 표 6 및 표 7은 각각 와이드 앵글 인트라 예측 모드 제외 35개의 인트라 예측 모드가 정의된 경우와 67개의 인트라 예측 모드가 정의된 경우, 변환 범위를 나타낸다. The transformation range may be determined based on the ratio of the current block. As an example, Tables 6 and 7 show the transformation ranges when 35 intra prediction modes are defined and 67 intra prediction modes are defined except for the wide-angle intra prediction mode, respectively.

ConditionCondition Replaced Intra Prediction ModesReplaced Intra Prediction Modes W/H = 2W/H = 2 Modes 2, 3, 4Modes 2, 3, 4 W/H > 2W/H > 2 Modes 2, 3, 4, 5, 6Modes 2, 3, 4, 5, 6 W/H = 1W/H = 1 NoneNone H/W = 1/2H/W = 1/2 Modes 32, 33, 34Modes 32, 33, 34 H/W < 1/2H/W < 1/2 Modes 30, 31, 32, 33, 34Modes 30, 31, 32, 33, 34

ConditionCondition Replaced Intra Prediction ModesReplaced Intra Prediction Modes W/H = 2W/H = 2 Modes 2, 3, 4, 5, 6, 7Modes 2, 3, 4, 5, 6, 7 W/H > 2W/H > 2 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 W/H = 1W/H = 1 NoneNone H/W = 1/2H/W = 1/2 Modes 61, 62, 63, 64, 65, 66Modes 61, 62, 63, 64, 65, 66 H/W < 1/2H/W < 1/2 Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66

표 6 및 표 7에 나타난 예에서와 같이, 현재 블록의 비율에 따라, 변환 범위에 포함되는 와이드 앵글 대체 인트라 예측 모드들의 개수가 상이할 수 있다.현재 블록의 비율을 보다 세분화하여, 다음 표 8과 같이 변환 범위를 설정할 수도 있다. As in the examples shown in Tables 6 and 7, the number of wide-angle alternative intra prediction modes included in the transform range may be different according to the ratio of the current block. You can also set the conversion range as

ConditionCondition Replaced Intra Prediction ModesReplaced Intra Prediction Modes W/H = 16W/H = 16 Modes 12, 13, 14, 15Modes 12, 13, 14, 15 W/H = 8W/H = 8 Modes 12, 13Modes 12, 13 W/H = 4W/H = 4 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 H/W = 2H/W = 2 Modes 2, 3, 4, 5, 6, 7Modes 2, 3, 4, 5, 6, 7 H/W = 1H/W = 1 NoneNone W/H = 1/2W/H = 1/2 Modes 61, 62, 63, 64, 65, 66Modes 61, 62, 63, 64, 65, 66 W/H = 1/4W/H = 1/4 Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 W/H = 1/8W/H = 1/8 Modes 55, 56Modes 55, 56 H/W = 1/16H/W = 1/16 Modes 53, 54, 55, 56Modes 53, 54, 55, 56

비인접 참조 샘플 라인이 현재 블록의 참조 샘플 라인으로 결정된 경우, 또는, 복수의 참조 샘플 라인들 중 어느 하나를 선택하는 멀티 라인 인트라 예측 부호화 방법이 사용된 경우에 있어서, 와이드 앵글 인트라 예측 모드가 사용되지 않도록 설정될 수 있다. 즉, 현재 블록이 비정방형이고, 현재 블록의 인트라 예측 모드가 변환 범위에 속하는 경우라 하더라도, 현재 블록의 인트라 예측 모드를 와이드 앵글 인트라 예측 모드로 변환하지 않을 수 있다.도 17은 현재 블록의 참조 샘플 라인에 따라, 와이드 앵글 인트라 예측 모드가 상이한 각도를 갖는 예를 나타낸 것이다.When the non-adjacent reference sample line is determined as the reference sample line of the current block, or when a multi-line intra prediction encoding method that selects any one of a plurality of reference sample lines is used, the wide-angle intra prediction mode is used It can be set not to. That is, even when the current block is non-square and the intra-prediction mode of the current block belongs to the transformation range, the intra-prediction mode of the current block may not be converted to the wide-angle intra-prediction mode. An example in which the wide-angle intra prediction mode has different angles according to sample lines is shown.

인접 참조 샘플 라인이 현재 블록의 참조 샘플 라인으로 결정된 경우, 와이드 앵글 인트라 예측 모드의 최대 각도는 α로 설정될 수 있다. 반면, 비인접 참조 샘플 라인이 현재 블록의 참조 샘플 라인으로 결정된 경우, 와이드 앵글 인트라 예측 모드의 최대 각도는 β로 설정될 수 있다. When the adjacent reference sample line is determined as the reference sample line of the current block, the maximum angle of the wide-angle intra prediction mode may be set to α. On the other hand, when the non-adjacent reference sample line is determined as the reference sample line of the current block, the maximum angle of the wide-angle intra prediction mode may be set to β.

비인접 참조 샘플 라인의 인덱스에 따라, 와이드 앵글 인트라 예측 모드의 각도가 상이할 수 있다. 이때, 현재 블록의 참조 샘플 라인 인덱스가 증가할 수록, 와이드 앵글 인트라 예측 모드의 각도는 증가 또는 감소할 수 있다.Depending on the index of the non-adjacent reference sample line, the angle of the wide-angle intra prediction mode may be different. In this case, as the reference sample line index of the current block increases, the angle of the wide-angle intra prediction mode may increase or decrease.

기존의 인트라 예측 모드들에 추가로 와이드 앵글 인트라 예측 모드들이 사용됨에 따라, 와이드 앵글 인트라 예측 모드들을 부호화하는데 필요한 리소스가 증가하여, 부호화 효율이 낮아질 수 있다. 이에 따라, 와이드 앵글 인트라 예측 모드들을 그대로 부호화하는 대신, 와이드 앵글 인트라 예측 모드들에 대한 대체 인트라 예측 모드들을 부호화하여, 부호화 효율을 향상시킬 수 있다.As wide-angle intra-prediction modes are used in addition to the existing intra-prediction modes, resources required for encoding the wide-angle intra-prediction modes increase, and encoding efficiency may decrease. Accordingly, instead of encoding the wide-angle intra-prediction modes as they are, the encoding efficiency can be improved by encoding alternative intra-prediction modes for the wide-angle intra prediction modes.

일 예로, 현재 블록이 67번의 와이드 앵글 인트라 예측 모드를 이용하여 부호화된 경우, 67번의 와이드 앵글 대체 인트라 예측 모드인 2번을 현재 블록의 인트라 예측 모드로 부호화할 수 있다. 또한, 현재 블록이 -1번의 와이드 앵글 인트라 예측 모드로 부호화된 경우, -1번의 와이드 앵글 대체 인트라 예측 모드인 66번을 현재 블록의 인트라 예측 모드로 부호화할 수 있다.As an example, when the current block is encoded using the wide-angle intra prediction mode of No. 67, No. 2, which is the wide-angle alternative intra prediction mode of No. 67, may be encoded as the intra prediction mode of the current block. In addition, when the current block is encoded with the wide-angle intra prediction mode of -1, the wide-angle alternative intra prediction mode of -1, No. 66, may be encoded as the intra prediction mode of the current block.

복호화기에서는 현재 블록의 인트라 예측 모드를 복호화하고, 복호화된 인트라 예측 모드가 변환 범위에 포함되는지 여부를 판단할 수 있다. 복호화된 인트라 예측 모드가 와이드 앵글 대체 인트라 예측 모드인 경우, 인트라 예측 모드를 와이드 앵글 인트라 예측 모드로 변환할 수 있다. The decoder may decode the intra prediction mode of the current block and determine whether the decoded intra prediction mode is included in a transform range. When the decoded intra prediction mode is the wide-angle replacement intra prediction mode, the intra prediction mode may be converted into the wide-angle intra prediction mode.

또는, 현재 블록이 와이드 앵글 인트라 예측 모드로 부호화된 경우, 와이드 앵글 인트라 예측 모드를 그대로 부호화할 수도 있다. Alternatively, when the current block is encoded in the wide-angle intra prediction mode, the wide-angle intra prediction mode may be encoded as it is.

인트라 예측 모드의 부호화는 상술한 MPM 리스트를 기초로 이루어질 수 있다. 구체적으로, 이웃 블록이 와이드 앵글 인트라 예측 모드로 부호화된 경우, 상기 와이드 앵글 인트라 예측 모드에 대응하는 와이드 앵글 대체 인트라 예측 모드를 기초로, MPM을 설정할 수 있다. Encoding of the intra prediction mode may be performed based on the above-described MPM list. Specifically, when the neighboring block is encoded in the wide-angle intra prediction mode, the MPM may be set based on the wide-angle alternative intra prediction mode corresponding to the wide-angle intra prediction mode.

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

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

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

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

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

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

잔차 영상 중 일부 블록에 대해서는 2차원 영상 변환이 수행되지 않을 수도 있다. 2차원 영상 변환을 수행하지 않는 것을 변환 스킵(Transform Skip)이라 호칭할 수 있다. 변환 스킵이 적용된 경우, 변환이 수행되지 않는 잔차값들을 대상으로 양자화가 적용될 수 있다.2D image transformation may not be performed on some blocks of the residual image. A process in which 2D image transformation is not performed may be referred to as a transform skip. When transform skip is applied, quantization may be applied to residual values to which transform is not performed.

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

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

수평 방향 및 수직 방향에 대해 상이한 변환 코어가 사용될 수도 있다. 수평 방향의 변환 코어 및 수직 방향의 변환 코어의 조합을 나타내는 정보가 비트스트림을 통해 시그날링될 수도 있다.Different transformation cores may be used for horizontal and vertical directions. Information indicating the combination of the horizontal direction conversion core and the vertical direction conversion core may be signaled through the bitstream.

제1 변환 및 제2 변환의 수행 단위가 상이할 수 있다. 일 예로, 8x8 블록에 대해 제1 변환을 수행하고, 변환된 8x8 블록 중 4x4 크기의 서브 블록에 대해 제2 변환을 수행할 수 있다. 이때, 제2 변환이 수행되지 않는 잔여 영역들의 변환 계수를 0으로 설정할 수도 있다. The units of performing the first transformation and the second transformation may be different. As an example, a first transform may be performed on an 8x8 block, and a second transform may be performed on a subblock having a size of 4x4 among the transformed 8x8 blocks. In this case, the transform coefficients of the residual regions in which the second transform is not performed may be set to 0.

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

제2 변환의 수행 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다.Information indicating whether the second transformation is performed may be signaled through a bitstream.

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

인덱스 정보 tu_mts_idx에 의해 특정되는 변환 타입 후보들에 기초하여, 수직 방향에 대한 변환 코어 및 수평 방향에 대한 변환 코어가 결정될 수 있다. 표 11 및 표 12는 tu_mts_idx에 따른 변환 타입 조합들을 나타낸 것이다.Based on the transform type candidates specified by the index information tu_mts_idx, a transform core for a vertical direction and a transform core for a horizontal direction may be determined. Table 11 and Table 12 show transform type combinations according to tu_mts_idx.

tu_mts_idxtu_mts_idx transform typetransform type horizontalhorizontal verticalvertical 00 SKIPSKIP SKIPSKIP 1One DCT-IIDCT-II DCT-IIDCT-II 22 DST-VIIDST-VII DST-VIIDST-VII 33 DCT-VIIIDCT-VIII DST-VIIDST-VII 44 DST-VIIDST-VII DCT-VIIIDCT-VIII 55 DCT-VIIIDCT-VIII DCT-VIIIDCT-VIII

tu_mts_idxtu_mts_idx transform typetransform type horizontalhorizontal verticalvertical 00 DCT-IIDCT-II DCT-IIDCT-II 1One SKIPSKIP SKIPSKIP 22 DST-VIIDST-VII DST-VIIDST-VII 33 DCT-VIIIDCT-VIII DST-VIIDST-VII 44 DST-VIIDST-VII DCT-VIIIDCT-VIII 55 DCT-VIIIDCT-VIII DCT-VIIIDCT-VIII

변환 타입은 DCT2, DST7, DCT8 또는 변환 스킵 중 어느 하나로 결정될 수 있다. 또는, 변환 스킵을 제외하고, 변환 코어들만을 이용하여 변환 타입 조합 후보를 구성할 수도 있다.표 11이 이용되는 경우, tu_mts_idx가 0이면, 수평 방향 및 수직 방향에 변환 스킵이 적용될 수 있다. tu_mts_idx가 1이면, 수평 방향과 수직 방향에 DCT2가 적용될 수 있다. tu_mts_idx가 3이면 수평 방향에 DCT8을 적용하고, 수직 방향에 DCT7을 적용할 수 있다.The transform type may be determined as any one of DCT2, DST7, DCT8, and transform skip. Alternatively, a transform type combination candidate may be constructed using only transform cores, excluding transform skip. When Table 11 is used, if tu_mts_idx is 0, transform skip may be applied in the horizontal direction and the vertical direction. If tu_mts_idx is 1, DCT2 may be applied to the horizontal and vertical directions. If tu_mts_idx is 3, DCT8 may be applied to the horizontal direction and DCT7 may be applied to the vertical direction.

표 12가 이용되는 경우, tu_mts_idx가 0이면, 수평 방향 및 수직 방향에 DCT2가 적용될 수 있다. tu_mts_idx가 1이면, 수평 방향과 수직 방향에 변환 스킵이 적용될 수 있다. tu_mts_idx가 3이면 수평 방향에 DCT8을 적용하고, 수직 방향에 DCT7을 적용할 수 있다.When Table 12 is used, if tu_mts_idx is 0, DCT2 may be applied to the horizontal direction and the vertical direction. When tu_mts_idx is 1, transform skip may be applied in the horizontal direction and the vertical direction. If tu_mts_idx is 3, DCT8 may be applied to the horizontal direction and DCT7 may be applied to the vertical direction.

현재 블록의 크기, 형태 또는 논 제로 계수의 개수 중 적어도 하나에 기초하여 인덱스 정보의 부호화 여부를 결정할 수 있다. 일 예로, 논 제로 계수의 수가 문턱값과 같거나 작은 경우, 인덱스 정보를 시그날링하지 않고, 현재 블록에 디폴트 변환 타입을 적용할 수 있다. 여기서, 디폴트 변환 타입은 DST7 일 수 있다. 또는, 현재 블록의 크기, 형태 또는 인트라 예측 모드에 따라 디폴트 모드가 상이할 수 있다.Whether to encode the index information may be determined based on at least one of the size, shape, and number of non-zero coefficients of the current block. For example, when the number of non-zero coefficients is equal to or smaller than the threshold, the default transform type may be applied to the current block without signaling index information. Here, the default conversion type may be DST7. Alternatively, the default mode may be different according to the size, shape, or intra prediction mode of the current block.

문턱값은 현재 블록의 크기 또는 형태에 기초하여 결정될 수 있다. 일 예로, 현재 블록의 크기가 32x32 보다 작거나 같은 경우에는 문턱값을 2로 설정하고, 현재 블록이 32x32 보다 큰 경우에는(예컨대, 현재 블록이, 32x64 또는 64x32 크기의 코딩 블록인 경우), 문턱값을 4로 설정할 수 있다.The threshold value may be determined based on the size or shape of the current block. As an example, when the size of the current block is less than or equal to 32x32, the threshold is set to 2, and when the current block is larger than 32x32 (eg, when the current block is a coding block having a size of 32x64 or 64x32), the threshold You can set the value to 4.

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

명시적인 변환 타입 결정이 허용되는 경우, 비트스트림으로부터 시그날링되는 인덱스 정보 tu_mts_idx에 기초하여 현재 블록의 변환 타입을 결정할 수 있다. 반면, 명시적인 변환 타입 결정이 허용되지 않는 경우, 현재 블록의 크기, 형태, 서브 블록 단위의 변환이 허용되는지 여부 또는 0이 아닌 변환 계수를 포함하는 서브 블록의 위치 중 적어도 하나를 기초로 변환 타입이 결정될 수 있다. 일 예로, 현재 블록의 수평 방향 변환 타입은 현재 블록의 너비를 기초로 결정되고, 현재 블록의 수직 방향 변환 타입은 현재 블록의 높이를 기초로 결정될 수 있다. 예컨대, 현재 블록의 너비가 4 보다 작거나 16보다 큰 경우, 수평 방향의 변환 타입은 DCT2로 결정될 수 있다. 그렇지 않은 경우, 수평 방향의 변환 타입은 DST7로 결정될 수 있다. 현재 블록의 높이가 4보다 작거나 16보다 큰 경우, 수직 방향의 변환 타입은 DCT2로 결정될 수 있다. 그렇지 않은 경우, 수직 방향의 변환 타입은 DST7로 결정될 수 있다. 여기서, 수평 방향의 변환 타입 및 수직 방향의 변환 타입을 결정하기 위해, 너비 및 높이와 비교되는 문턱값은 현재 블록의 크기, 형태 또는 인트라 예측 모드 중 적어도 하나에 기초하여 결정될 수 있다.When explicit transform type determination is allowed, the transform type of the current block may be determined based on index information tu_mts_idx signaled from the bitstream. On the other hand, when explicit transformation type determination is not allowed, the transformation type is based on at least one of the size and shape of the current block, whether transformation in sub-block units is allowed, or the position of a sub-block including a non-zero transformation coefficient. This can be determined. For example, the horizontal transformation type of the current block may be determined based on the width of the current block, and the vertical transformation type of the current block may be determined based on the height of the current block. For example, when the width of the current block is less than 4 or greater than 16, the horizontal transformation type may be determined to be DCT2. Otherwise, the transform type in the horizontal direction may be determined to be DST7. When the height of the current block is less than 4 or greater than 16, the transformation type in the vertical direction may be determined to be DCT2. Otherwise, the transformation type in the vertical direction may be determined as DST7. Here, in order to determine the transform type in the horizontal direction and the transform type in the vertical direction, a threshold value compared to a width and a height may be determined based on at least one of a size, a shape, and an intra prediction mode of the current block.

또는, 현재 블록이 높이와 너비가 동일한 정방형인 경우, 수평 방향 변환 타입 및 수직 방향 변환 타입을 동일하게 설정하는 한편, 현재 블록이 높이와 너비가 상이한 비정방형인 경우, 수평 방향 변환 타입 및 수직 방향 변환 타입을 상이하게 설정할 수 있다. 일 예로, 현재 블록의 너비가 높이보다 큰 경우에는, 수평 방향의 변환 타입을 DST7로 결정하고, 수직 방향의 변환 타입을 DCT2로 결정할 수 있다. 현재 블록의 높이가 너비보다 큰 경우에는, 수직 방향의 변환 타입을 DST7으로 결정하고, 수평 방향의 변환 타입을 DCT2로 결정할 수 있다. Alternatively, when the current block is a square with the same height and width, the horizontal transformation type and the vertical transformation type are set to be the same, while when the current block is a non-square type with different heights and widths, the horizontal transformation type and the vertical direction The conversion type can be set differently. For example, when the width of the current block is greater than the height, the horizontal transformation type may be determined as DST7, and the vertical transformation type may be determined as DCT2. When the height of the current block is greater than the width, the transformation type in the vertical direction may be determined as DST7 and the transformation type in the horizontal direction may be determined as DCT2.

변환 타입 후보들의 개수 및/또는 종류 또는 변환 타입 조합 후보들의 개수 및/또는 종류는 명시적인 변환 타입 결정이 허용되는지 여부에 따라 상이할 수 있다. 일 예로, 명시적인 변환 타입 결정이 허용되는 경우, DCT2, DST7 및 DCT8가 변환 타입 후보들로서 이용될 수 있다. 이에 따라, 수평 방향 변환 타입 및 수직 방향 변환 타입 각각은 DCT2, DST8 또는 DCT8로 설정될 수 있다. 명시적인 변환 타입 결정이 허용되지 않는 경우, DCT2 및 DST7만 변환 타입 후보로서 이용될 수 있다. 이에 따라, 수평 방향 변환 타입 및 수직 방향 변환 타입 각각은 DCT2 또는 DST7으로 결정될 수 있다.The number and/or type of transform type candidates or the number and/or type of transform type combination candidates may be different depending on whether explicit transform type determination is allowed. As an example, when explicit transform type determination is allowed, DCT2, DST7, and DCT8 may be used as transform type candidates. Accordingly, each of the horizontal direction transformation type and the vertical direction transformation type may be set to DCT2, DST8, or DCT8. When explicit transform type determination is not allowed, only DCT2 and DST7 may be used as transform type candidates. Accordingly, each of the horizontal direction transformation type and the vertical direction transformation type may be determined as DCT2 or DST7.

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

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

블록이 인트라 예측 모드로 부호화 되었는지 여부, 또는 이웃한 블록의 모션 벡터 절대값의 차이가 기 정의된 소정의 문턱값 보다 큰지 여부, 이웃한 블록의 참조 픽쳐가 서로 동일한 지 여부 중 적어도 어느 하나에 기초하여 블록 필터 강도(block strength, 이하 BS) 값을 결정할 수 있다. BS 값이 0이면, 필터링을 수행하지 않음을 나타낸다. Based on at least one of whether the block is encoded in the intra prediction mode, whether the difference between the absolute motion vector values of the neighboring blocks is greater than a predefined threshold, and whether the reference pictures of the neighboring blocks are the same Thus, a block filter strength (hereinafter referred to as BS) value may be determined. If the BS value is 0, it indicates that filtering is not performed.

대각 예측 부호화 방법이 사용되는 경우, BS 값을 1로 설정할 수도 있다. When the diagonal prediction encoding method is used, the BS value may be set to 1.

대각 예측 부호화 방법이 사용되는 경우, 블록 내에서 복수개의 BS 값을 사용하도록 설정할 수도 있다. When the diagonal prediction encoding method is used, it may be set to use a plurality of BS values in a block.

일 예로, 대각 예측 부호화 방법에서 인트라 모드가 사용되는 파티션의 경계에서는 BS 값을 2로 설정하고, 인터 예측 모드가 사용되는 파티션의 경계에서는 BS 값을 0 또는 1로 설정할 수도 있다. For example, in the diagonal prediction encoding method, the BS value may be set to 2 at the boundary of a partition in which the intra mode is used, and the BS value may be set to 0 or 1 in the boundary of the partition in which the inter prediction mode is used.

Figure pat00027
Figure pat00027

도 20Fig. 20

구체적으로 예를 들어, 도 20과 같이 좌삼각 예측 블록은 인터 예측이고, 우삼각 예측 블록은 인트라 예측인 경우에, 우삼각 예측 블록에 속하는 코딩 블록의 상단 경계 및 우측 경계에서는 BS 값을 2로 설정할 수 있고, 좌삼각 예측 블록에 속하는 코딩 블록의 좌측 경계 및 하단 경계에서는 BS 값을 0 또는 1로 설정할 수 있다. Specifically, for example, when the left triangular prediction block is inter prediction and the right triangular prediction block is intra prediction as shown in FIG. 20, the BS value is set to 2 at the upper boundary and the right boundary of the coding block belonging to the right triangular prediction block. may be set, and the BS value may be set to 0 or 1 at the left boundary and the lower boundary of the coding block belonging to the left triangular prediction block.

Thin 대각 예측 부호화 방법이 사용되는 경우, 블록 내에서 복수개의 BS 값을 사용하도록 설정할 수도 있다. 일 예로, thin 대각 예측 부호화 방법에서 인트라 모드가 사용되는 파티션의 경계에서는 BS 값을 2로 설정하고, 인터 예측 모드가 사용되는 파티션의 경계에서는 BS 값을 0 또는 1로 설정할 수도 있다. When the thin diagonal prediction encoding method is used, it may be set to use a plurality of BS values in a block. For example, in the thin diagonal prediction encoding method, the BS value may be set to 2 at the boundary of a partition in which the intra mode is used, and the BS value may be set to 0 or 1 in the boundary of the partition in which the inter prediction mode is used.

복호화 과정 또는 부호화 과정을 중심으로 설명된 실시예들을, 부호화 과정 또는 복호화 과정에 적용하는 것은, 본 발명의 범주에 포함되는 것이다. 소정의 순서로 설명된 실시예들을, 설명된 것과 상이한 순서로 변경하는 것 역시, 본 발명의 범주에 포함되는 것이다.It is included in the scope of the present invention to apply the decoding process or the embodiments described based on the encoding process to the encoding process or the decoding process. It is also within the scope of the present invention to change the embodiments described in a certain order in an order different from that described.

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

22 타일 및 브릭을 이용한 비디오 부호화 방법Video encoding method using tiles and bricks

파노라믹 비디오나 360도 비디오 내지 4K/8K UHD(Ultra High Definition)과 같은 실감 미디어 어플리케이션에서는 고해상도 영상을 사용한다. 고해상도 영상을 실시간 내지 저지연 부호화를 위해서 병렬화가 필요하다. 타일을 이용하여 픽쳐의 일정 영역을 서로 독립적으로 부호화 및/또는 복호화 할 수 있다.High-resolution images are used in immersive media applications such as panoramic video or 360-degree video or 4K/8K Ultra High Definition (UHD). Parallelization is required for real-time or low-delay encoding of high-resolution images. A predetermined region of a picture may be independently encoded and/or decoded using a tile.

타일 내에 있는 블록은 다른 타일에 있는 데이터를 참조하거나, 참조 샘플로 사용하여 영상을 부호화/복호화 하지 않도록 설정할 수 있다. 예를 들어, 다른 타일에 있는 데이터를 인트라 예측에서 참조 샘플로 사용하지 않거나, 다른 타일에 있는 데이터를 움직임 벡터 유도를 위한 후보(예컨대, 머지 후보, AMVP 후보 또는 HVMP 후보)로 사용하지 않거나 또는 다른 타일에 있는 데이터를 심볼의 컨텍스트 계산에 사용하지 않도록 설정할 수 있다. A block in a tile may be set not to encode/decode an image by referencing data in another tile or using it as a reference sample. For example, do not use data in other tiles as reference samples in intra prediction, do not use data in other tiles as candidates (eg, merge candidates, AMVP candidates, or HVMP candidates) for motion vector derivation, or other It is possible to disable the data in the tile from being used in calculating the context of the symbol.

각 타일 단위로 CABAC(Context adaptive Binary Arithmetric Coding) 컨텍스트의 확률 테이블을 초기화 할 수 있다. 타일 바운더리 (이웃한 두 타일의 경계 부분)에서 loop filter를 사용하지 않도록 설정할 수 있다. 또는, 타일 바운더리에서 loop filter 사용 여부를 나타내는 정보가 부호화될 수 있다.The probability table of the CABAC (Context Adaptive Binary Arithmetric Coding) context can be initialized for each tile. It is possible to disable the loop filter at the tile boundary (the part of the boundary between two neighboring tiles). Alternatively, information indicating whether a loop filter is used in a tile boundary may be encoded.

Figure pat00028
Figure pat00028

도 21Fig. 21

픽쳐는 하나 또는 적어도 하나 이상의 슬라이스로 구성될 수 있다. 슬라이스는 raster-scan 슬라이스(raster-scan slice) 또는 같이 사각 형태 슬라이스(rectangular slice)일 수 있다. 래스터 스캔 슬라이스는 래스터 스캔 순서를 따를 때 하나 이상의 연속된 타일(들)의 그룹으로 정의된다. 도 21의 왼쪽 그림은 래스터 스캔 슬라이스를 나타낸 것이다. 래스터 스캔 슬라이스는 비사각형 형태를 띨 수 있다. 사각 형태 슬라이스는 직사각형 형태를 띄는 타일 그룹으로 정의된다.도 19 의 오른쪽 그림은 사각 형태 슬라이스를 나타낸 것이다.A picture may consist of one or at least one or more slices. The slice may be a raster-scan slice or a rectangular slice such as a raster-scan slice. A raster scan slice is defined as a group of one or more contiguous tile(s) when following a raster scan order. The left figure of FIG. 21 shows a raster scan slice. The raster scan slice may have a non-rectangular shape. A rectangular slice is defined as a group of tiles having a rectangular shape. The right figure of FIG. 19 shows a rectangular slice.

슬라이스의 경계는 픽처 바운더리 및/또는 타일 경계와 일치할 수 있다. 일 예로, 슬라이스의 경계가 좌측 바운더리 및 상측 바운더리가 픽쳐 바운더리에 위치하도록 설정하거나, 슬라이스의 경계가 이미 복호화된 타일의 경계에 위치하도록 설정할 수 있다. A boundary of a slice may coincide with a picture boundary and/or a tile boundary. For example, the boundary of the slice may be set such that the left boundary and the upper boundary are located at the picture boundary, or the boundary of the slice may be set so that the boundary of the already decoded tile is located.

슬라이스는 하나 또는 복수개의 타일로 구성될 수 있다. A slice may consist of one or a plurality of tiles.

타일은 직사각형(rectangular) 형태를 가질 수 있다. 또는, 비직사각형 형태의 타일을 허용할 수 있다. 비직사각형 형태의 타일이 존재하는지 여부를 나타내는 정보가 부호화될 수 있다. 타일의 경계는 픽처 바운더리 및/또는 CTU 경계와 일치할 수 있다.The tile may have a rectangular shape. Alternatively, non-rectangular tiles may be accepted. Information indicating whether a non-rectangular tile exists may be encoded. The boundary of the tile may coincide with the picture boundary and/or the CTU boundary.

픽처에 복수의 타일이 존재하는지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다. 픽처에 복수의 타일이 존재하는 경우, 도 22와 같이 좌측 또는 우측으로 인접한 타일들의 높이는 서로 같도록 구성(이하, 가로 방향 타일 세트/tile row)할 수도 있고, 위쪽 또는 아래쪽으로 인접한 타일들의 너비가 같도록 구성(이하, 세로 방향 타일 세트/tile column)할 수도 있다. 이전 타일과 높이가 같은지 여부를 나타내는 정보 또는 이전 타일과 너비가 같은지 여부를 나타내는 정보가 비트스트림을 통해 시그날링될 수 있다.Information indicating whether a plurality of tiles exist in a picture may be signaled through a bitstream. When a plurality of tiles exist in a picture, as shown in FIG. 22, tiles adjacent to the left or right may have the same height (hereinafter referred to as a horizontal tile set/tile row), and the widths of the tiles adjacent to the top or the bottom may be It may be configured to be the same (hereinafter referred to as a vertical tile set/tile column). Information indicating whether the height is the same as the previous tile or information indicating whether the width is the same as the previous tile may be signaled through the bitstream.

또는, 픽쳐 내에서 픽쳐 바운더리에 인접한 타일들 제외한 모든 타일들이 모두 동일한 크기를 갖도록 제한할 수도 있다. Alternatively, all tiles except tiles adjacent to the picture boundary in the picture may be restricted to have the same size.

Figure pat00029
Figure pat00029

도 22Fig. 22

Figure pat00030
Figure pat00030

모든 tile column 또는 일부 tile column에서 tile column의 너비를 시그날링할 수 있다. 표 13과 같이 tile column의 너비를 시그날링하는 tile column의 개수(이하, exp tile column 개수)를 시그날링할 수 있다The width of a tile column can be signaled in all tile columns or some tile columns. As shown in Table 13, the number of tile columns that signal the width of the tile column (hereinafter, the number of exp tile columns) can be signaled.

num_exp_tile_coulmns_minus1+1 은 exp tile column 개수를 나타낸다.num_exp_tile_coulmns_minus1+1 indicates the number of exp tile columns.

즉, exp tile coumn 개수 만큼 tile column의 너비를 나타내는 신택스 tile_column_width_minus1[ i ] 를 시그날링할 수 있다. That is, the syntax tile_column_width_minus1[ i ] indicating the width of the tile column as much as the number of exp tile columns can be signaled.

i 번째 tile column의 너비는 tile_column_width_minus1[ i ] + 1으로 나타낼 수 있으며, 기본 grid는 CTB로 설정할 수 있다. The width of the i-th tile column can be expressed as tile_column_width_minus1[ i ] + 1, and the default grid can be set as CTB.

k 번째 tile column (k> num_exp_tile_columns_minus1)의 너비는 tile_column_width_minus1[ num_exp_tile_columns_minus1 ] + 1 과 remainingWidthInCtbY 중 작은 값으로 설정할 수 있다. The width of the k-th tile column (k> num_exp_tile_columns_minus1) may be set to a smaller value between tile_column_width_minus1[num_exp_tile_columns_minus1] + 1 and remainingWidthInCtbY.

여기서, PicWidthInCtbsY = Ceil(pic_width_in_luma_samples / CtbSizeY)로 정의 할 수 있으며, 픽쳐 내 CTB column의 개수라 정의할 수 있다. Here, it can be defined as PicWidthInCtbsY = Ceil(pic_width_in_luma_samples / CtbSizeY), and can be defined as the number of CTB columns in the picture.

k번째 tile column 이전의 tile column의 너비를 합한 값을 누적 tile column 너비라 정의 한다. The sum of the widths of the tile columns before the k-th tile column is defined as the cumulative tile column width.

remainingWidthInCtbY는 PicWidthInCtbsY에서 누적 tile column 너비를 차분한값을 나타내며, 다음과 같이 유도할 수 있다.remainingWidthInCtbY represents a difference value of the accumulated tile column width in PicWidthInCtbsY, and can be derived as follows.

Figure pat00031
Figure pat00031

모든 tile row 또는 일부 tile row에서 tile row의 높이를 시그날링할 수 있다. 표 1와 같이 tile row의 높이를 시그날링하는 tile row의 개수(이하, exp tile row 개수)를 시그날링할 수 있다The height of the tile row can be signaled in all tile rows or in some tile rows. As shown in Table 1, the number of tile rows that signal the height of the tile row (hereinafter, the number of exp tile rows) can be signaled.

num_exp_tile_rows_minus1+1 은 exp tile row 개수를 나타낸다. num_exp_tile_rows_minus1+1 indicates the number of exp tile rows.

즉, exp tile row 개수 만큼 tile row의 너비를 나타내는 신택스 tile_row_height_minus1[ i ] 를 시그날링할 수 있다. That is, the syntax tile_row_height_minus1[i] indicating the width of the tile row as much as the number of exp tile rows can be signaled.

i 번째 tile row의 너비는 tile_row_height_minus1 [ i ] + 1으로 나타낼 수 있으며, 기본 grid는 CTB로 설정할 수 있다. The width of the i-th tile row can be expressed as tile_row_height_minus1 [i] + 1, and the default grid can be set as CTB.

k 번째 tile row (k> num_exp_tile_rows_minus1)의 높이는 tile_row_height_minus1[ num_exp_tile_rowss_minus1 ] + 1 과 remainingHeightInCtbY 중 작은 값으로 설정할 수 있다. The height of the k-th tile row (k> num_exp_tile_rows_minus1) may be set to a smaller value between tile_row_height_minus1[ num_exp_tile_rowss_minus1 ] + 1 and remainingHeightInCtbY.

여기서, PicHeightInCtbsY = Ceil(pic_height_in_luma_samples / CtbSizeY)로 정의 할 수 있으며, 픽쳐 내 CTB row의 개수라 정의할 수 있다. Here, it can be defined as PicHeightInCtbsY = Ceil(pic_height_in_luma_samples / CtbSizeY), and it can be defined as the number of CTB rows in the picture.

k번째 tile row 이전의 tile row의 너비를 합한 값을 누적 tile row 높이라 정의 한다. The sum of the widths of the tile rows before the k-th tile row is defined as the cumulative tile row height.

remainingHeightInCtbY 는 PicHeightInCtbsY에서 누적 tile row 높이를 차분한값을 나타내며, 다음과 같이 유도할 수 있다. remainingHeightInCtbY represents a difference value of the cumulative tile row height in PicHeightInCtbsY, and can be derived as follows.

Figure pat00032
Figure pat00032

num_exp_tile_columns_minus1 과 num_exp_tile_rows_minus1 값이 0이면, tile_column_width_minus1[ i ] 값이 PicWidthInCtbsY - 1이면, tile_row_height_minus1[ i ] 값은 PicHeightInCtbsY - 1이 되지 않도록 설정할 수 있다. If the num_exp_tile_columns_minus1 and num_exp_tile_rows_minus1 values are 0, if the tile_column_width_minus1[ i ] value is PicWidthInCtbsY - 1, the tile_row_height_minus1[ i ] value can be set so that it does not become PicHeightIn-CtbsY1.

loop_filter_across_tiles_enabled_flag는 해당 PPS를 참조하는 픽쳐의 타일 바운더리에서 in-loop filtering(디블로킹, ALF, SAO 등)을 수행하는지 여부를 나타내는 플래그이다. loop_filter_across_tiles_enabled_flag 값이 1 이면, 해당 PPS를 참조하는 픽쳐의 타일 바운더리에서 in-loop filtering을 수행함을 나타내고, loop_filter_across_tiles_enabled_flag 값이 0 이면 해당 PPS를 참조하는 픽쳐의 타일 바운더리에서 in-loop filtering을 수행하지 않음을 나타낸다. loop_filter_across_tiles_enabled_flag is a flag indicating whether in-loop filtering (deblocking, ALF, SAO, etc.) is performed at a tile boundary of a picture referring to the corresponding PPS. When the loop_filter_across_tiles_enabled_flag value is 1, it indicates that in-loop filtering is performed at the tile boundary of the picture referring to the corresponding PPS. .

loop_filter_across_slices_enabled_flag는 해당 PPS를 참조하는 픽쳐의 슬라이스 바운더리에서 in-loop filtering(디블로킹, ALF, SAO 등)을 수행하는지 여부를 나타내는 플래그이다. loop_filter_across_slices_enabled_flag값이 1 이면, 해당 PPS를 참조하는 픽쳐의 타일 바운더리에서 in-loop filtering을 수행함을 나타내고, loop_filter_across_slices_enabled_flag값이 0 이면 해당 PPS를 참조하는 픽쳐의 슬라이스 바운더리에서 in-loop filtering을 수행하지 않음을 나타낸다. loop_filter_across_slices_enabled_flag is a flag indicating whether in-loop filtering (deblocking, ALF, SAO, etc.) is performed at a slice boundary of a picture referring to the corresponding PPS. If the loop_filter_across_slices_enabled_flag value is 1, it indicates that in-loop filtering is performed at the tile boundary of the picture referring to the corresponding PPS. .

Rectangular slice인 경우에 픽쳐 내 슬라이스의 개수를 나타내는 신택스 num_slices_in_pic_minus1를 시그날링 할 수 있다. In the case of a rectangular slice, a syntax num_slices_in_pic_minus1 indicating the number of slices in a picture may be signaled.

Figure pat00033
Figure pat00033

도 23Fig. 23

슬라이스는 복수개의 타일로 구성될 수 있다. 이 경우 표 13과 같이 i 번째 슬라이스의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[ i ]와 i 번째 슬라이스의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[ i ]를 시그날링할 수 있다. A slice may consist of a plurality of tiles. In this case, as shown in Table 13, the syntax slice_height_in_tiles_minus1[ i ] indicating the height of the i-th slice and the syntax slice_width_in_tiles_minus1[ i ] indicating the width of the i-th slice may be signaled.

slice_height_in_tiles_minus1[ i ]+1은 i번째 슬라이스의 높이(SliceHeight[i])를 나타내며, 슬라이스의 높이를 나타내는 기본 단위는 tile row가 된다. slice_height_in_tiles_minus1[ i ]+1 indicates the height of the i-th slice (SliceHeight[i]), and the basic unit indicating the height of the slice is a tile row.

예를 들어, 도 23의 slice 4(4번째 슬라이스)의 높이는 2가 되며, slice_height_in_tiles_minus1[ 4 ]는 1로 설정할 수 있다. For example, the height of slice 4 (the fourth slice) of FIG. 23 may be 2, and slice_height_in_tiles_minus1[ 4 ] may be set to 1.

slice_width_in_tiles_minus1[ i ]+1은 i번째 슬라이스의 너비를 나타내며, 슬라이스의 너비를 나타내는 기본 단위는 tile column이 된다. slice_width_in_tiles_minus1[ i ]+1 indicates the width of the i-th slice, and the basic unit indicating the width of the slice is the tile column.

slice_width_in_tiles_minus1[ i ] 값이 0이면, 타일은 하나의 슬라이스 또는 복수개의 슬라이스임을 나타낸다. slice_width_in_tiles_minus1[ i ] When the value is 0, it indicates that the tile is one slice or a plurality of slices.

slice_width_in_tiles_minus1[ i ] 값이 0인 경우에, 타일 내 슬라이스의 개수를 나타내는 신택스 num_slices_in_tile_minus1[i]를 시그날링할 수 있다. When the value of slice_width_in_tiles_minus1[i] is 0, a syntax num_slices_in_tile_minus1[i] indicating the number of slices in a tile may be signaled.

타일 내 복수개의 슬라이스를 갖는 경우, 슬라이스의 높이를 나타내는 신택스 slice_height_in_ctu_minus1[i][j]를 시그날링할 수 있다. slice_height_in_ctu_minus1[i][j]+1 은 i번째 타일 내 j번째 슬라이스의 높이를 나타내며, 슬라이스 높이를 나타내는 기본 단위는 CTU row로 설정할 수 있다.In the case of having a plurality of slices in a tile, a syntax slice_height_in_ctu_minus1[i][j] indicating the height of the slice may be signaled. slice_height_in_ctu_minus1[i][j]+1 indicates the height of the j-th slice in the i-th tile, and the basic unit indicating the slice height may be set to a CTU row.

i+1 번째 슬라이스의 타일 인덱스(좌상단 타일 인덱스)와 i 번째 슬라이스의 타일 인덱스(좌상단 타일 인덱스)를 차분한 값(이하, 슬라이스 차분)을 나타내는 신택스 tile_idx_delta[ i ]를 시그날링 할 수 있다. A syntax tile_idx_delta[ i ] indicating a difference between the tile index (upper-left tile index) of the i+1-th slice and the tile index (upper-left tile index) of the i-th slice (hereinafter, slice difference) may be signaled.

Figure pat00034
Figure pat00034

표 14와 같이 slice_width_in_tiles_minus1[i] 와 slice_height_in_tiles_minus1[i] 값이 모두 0인지 또는 적어도 어느 하나가 0이 아닌지를 나타내는 플래그 slice_width_height_present_flag[i]를 시그날링할 수 있다. As shown in Table 14, a flag slice_width_in_tiles_minus1[i] and slice_height_in_tiles_minus1[i] indicating whether both values are 0 or at least one of which is not 0 may be signaled slice_width_height_present_flag[i].

slice_width_height_present_flag[i] 값이 0이면, slice_width_in_tiles_minus1[i] 와 slice_height_in_tiles_minus1[i] 값이 모두 0임을 나타내며, slice_width_in_tiles_minus1[i] 와 slice_height_in_tiles_minus1[i]을 시그날링하지 않음을 나타낸다. If the slice_width_height_present_flag[i] value is 0, it indicates that both slice_width_in_tiles_minus1[i] and slice_height_in_tiles_minus1[i] values are 0, and indicates that slice_width_in_tiles_minus1[i] and slice_height_in_tiles_minus1[i] are not signaled.

slice_width_height_present_flag[i] 값이 1이면, slice_width_in_tiles_minus1[i] 와 slice_height_in_tiles_minus1[i] 값 중 적어도 어느 하나가 0이 아님을 나타낸다.If the value of slice_width_height_present_flag[i] is 1, it indicates that at least one of the values of slice_width_in_tiles_minus1[i] and slice_height_in_tiles_minus1[i] is not 0.

Figure pat00035
Figure pat00035

표 15와 같이 픽쳐 내 rectangular slice의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[i] 및 높이를 나타내는 신택스 slice_height_in_tiles_minus1[i]가 모두 동일한지를 나타내는 신택스 uniform_slice_width_height_flag을 시그날링할 수도 있다. As shown in Table 15, the syntax uniform_slice_width_height_flag indicating whether the syntax slice_width_in_tiles_minus1[i] indicating the width of the rectangular slice in the picture and the syntax slice_height_in_tiles_minus1[i] indicating the height are the same may be signaled.

uniform_slice_width_height_flag 값이 1이면, 슬라이스의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[i] 값이 slice_width_in_tiles_minus1[0] 값과 동일하고, 슬라이스의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[i] 값이 slice_height_in_tiles_minus1[0] 값과 동일하다. If the uniform_slice_width_height_flag value is 1, the value of the syntax slice_width_in_tiles_minus1[i] indicating the width of the slice is the same as the value of slice_width_in_tiles_minus1[0], and the value of the syntax slice_height_in_tiles_minus1[i] indicating the height of the slice is the same as the value of slice_height_in_in_tiles.

uniform_slice_width_height_flag 값이 0이면, 슬라이스의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[i] 값이 slice_width_in_tiles_minus1[0] 값과 다른 슬라이스가 존재하거나, 슬라이스의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[i] 값이 slice_height_in_tiles_minus1[0] 값과 다른 슬라이스가 존재함을 나타낸다. If the uniform_slice_width_height_flag value is 0, there is a slice whose syntax slice_width_in_tiles_minus1[i] value is different from the slice_width_in_tiles_minus1[0] value, or the syntax slice_height_in_tiles_minus1[i] value that is different from the slice height syntax slice_height_in_tiles_minus1[i] indicates the existence of

Figure pat00036
Figure pat00036

i 번째 슬라이스 최우측 tile column(last tile column)에 있으면, 신택스 slice_width_in_tiles_minus1[i]는 시그날링하지 않고, 그 값을 0으로 유도할 수 있다. If it is in the rightmost tile column (last tile column) of the i-th slice, the syntax slice_width_in_tiles_minus1[i] does not signal, and its value can be derived to 0.

표 16과 같이 i번째 슬라이스가 최하측 tile row(last tile row)에 있으면, 신택스 slice_height_in_tiles_minus1[i]는 시그날링하지 않고, 그 값을 0으로 유도할 수 있다. As shown in Table 16, if the i-th slice is in the lowest tile row (last tile row), the syntax slice_height_in_tiles_minus1[i] does not signal, and the value can be derived to 0.

i번째 슬라이스가 Last tile column 와 Last tile row에 동시에 있으면(즉, 픽쳐 내 마지막 tile) 이면, slice_width_in_tiles_minus1[i]와 slice_width_in_tiles_minus1[i]는 시그날링하지 않고, 그 값을 각각 0으로 유도할 수 있다. If the i-th slice is in the Last tile column and the Last tile row at the same time (ie, the last tile in the picture), slice_width_in_tiles_minus1[i] and slice_width_in_tiles_minus1[i] are not signaled, and their values can be derived to 0, respectively.

i번 째 슬라이스의 좌상단 타일 인덱스를 tile column개수로 나누었을 때 나머지 값이 NumTileColumns -1 이면, i 번째 슬라이스가 last tile column에 있다고 판단할 수 있다. If the remaining value is NumTileColumns -1 when the upper-left tile index of the i-th slice is divided by the number of tile columns, it can be determined that the i-th slice is in the last tile column.

i번 째 슬라이스의 좌상단 타일 인덱스를 tile column 개수로 나누었을 때 몫이 NumTileRows -1 이면, i 번째 슬라이스가 last tile row에 있다고 판단할 수 있다. If the quotient is NumTileRows -1 when the upper-left tile index of the i-th slice is divided by the number of tile columns, it can be determined that the i-th slice is in the last tile row.

Figure pat00037
Figure pat00037

Figure pat00038
Figure pat00038

Figure pat00039
Figure pat00039

도 24Fig. 24

픽쳐 내 슬라이스의 개수가 2개 (num_slices_in_pic_minus1 값이 1)인 경우에는 도 24의 왼쪽 그림과 같이 픽쳐를 수평으로 분할하여 2개의 rectangular slice(이하, 수평 이분할 슬라이스)를 구성하거나, 도 24의 왼쪽 그림과 같이 픽쳐를 수직으로 분할하여 2개의 rectangular slice(이하, 수직 이분할 슬라이스)를 구성할 수 있다When the number of slices in the picture is two (num_slices_in_pic_minus1 value is 1), the picture is horizontally divided as shown in the left figure of FIG. As shown in the figure, by dividing the picture vertically, two rectangular slices (hereafter, vertical bisection slices) can be composed.

수평 이분할 슬라이스의 경우, slice_width_in_tiles_minus1[0]과 slice_height_in_tiles_minus1[0]를 이용하여 slice 1(두번째 슬라이스)의 tileIdx를 유도할 수 있기 때문에, tile_idx_delta[i]를 생략할 수 있다. In the case of a horizontal bipartite slice, since the tileIdx of slice 1 (second slice) can be derived using slice_width_in_tiles_minus1[0] and slice_height_in_tiles_minus1[0], tile_idx_delta[i] can be omitted.

수직 이분할 슬라이스의 경우, slice_width_in_tiles_minus1[0]를 이용하여 slice 1(두번째 슬라이스)의 tileIdx를 유도할 수 있기 때문에, tile_idx_delta[i]를 생략할 수 있다.In the case of a vertically bipartite slice, since tileIdx of slice 1 (second slice) can be derived using slice_width_in_tiles_minus1[0], tile_idx_delta[i] can be omitted.

즉, 수평 이분할 슬라이스 및/또는 수직 이분할 슬라이스는 tile_idx_delta[i]를 시그날링하지 않고, tileIdx를 유도할 수 있다. That is, a horizontally divided slice and/or a vertically divided slice may derive tileIdx without signaling tile_idx_delta[i].

표 17과 같이 num_slices_in_pic_minus1 값이 0 또는 1인 경우에는 tile_idx_delta_present_flag값을 시그날링하지 않고, 그 값을 0으로 설정할 수도 있다. As shown in Table 17, when the num_slices_in_pic_minus1 value is 0 or 1, the tile_idx_delta_present_flag value may not be signaled and the value may be set to 0.

Figure pat00040
Figure pat00040

Figure pat00041
Figure pat00041

도 25Fig. 25

픽쳐 내 tile column의 개수(이하, NumTileColumns)가 1인 경우, 슬라이스의 너비를 나타내는 정보 및/또는 슬라이스 높이를 나타내는 정보로부터 tile_idx_delta 또는 tileIdx 값을 유도할 수 있다. When the number of tile columns in a picture (hereinafter, NumTileColumns) is 1, a tile_idx_delta or tileIdx value may be derived from information indicating the width of the slice and/or information indicating the height of the slice.

예를 들어, 도 25와 같이 NumTileColumn값이 1인 경우, i번째 슬라이스의 좌상단 타일의 tileIdx는 다음 식과 같이 유도할 수 있다. For example, when the NumTileColumn value is 1 as shown in FIG. 25 , the tileIdx of the upper left tile of the i-th slice can be derived as follows.

tileIdx += 1+ slice_height_in_tiles_minus1[ i ] tileIdx += 1+ slice_height_in_tiles_minus1[ i ]

일 예로, NumTileColumns가 1인 경우, 신택스 slice_width_in_tiles_minus1 및/또는 slice_height_in_tiles_minus1 값으로 부터 tile_idx_delta 값 또는 tileIdx를 유도할 수 있으며, 표 18과 같이 NumTileColumns 값이 1이면, tile_idx_delt_present_flag 값을 시그날링하지 않을 수 있다. As an example, when NumTileColumns is 1, a tile_idx_delta value or tileIdx can be derived from the syntax slice_width_in_tiles_minus1 and/or slice_height_in_tiles_minus1 value.

Figure pat00042
Figure pat00042

도 26Fig. 26

픽쳐 내 tile row의 개수(이하, NumTileRows)가 1인 경우, 슬라이스의 너비를 나타내는 정보 및/또는 슬라이스 높이를 나타내는 정보로 부터 tile_idx_delta 값 또는 tileIdx을 유도할 수 있다.When the number of tile rows in a picture (hereinafter, NumTileRows) is 1, a tile_idx_delta value or tileIdx may be derived from information indicating the width of a slice and/or information indicating a slice height.

예를 들어, 도 26과 같이 NumTileRows값이 1인 경우, i번째 슬라이스의 좌상단 타일의 tileIdx는 다음 식과 같이 유도할 수 있다. For example, as shown in FIG. 26 , when the NumTileRows value is 1, the tileIdx of the upper left tile of the i-th slice may be derived as follows.

tileIdx += 1+ slice_width_in_tiles_minus1[ i ] tileIdx += 1+ slice_width_in_tiles_minus1[ i ]

일 예로, NumTileRows가 1인 경우, 신택스 slice_width_in_tile_minus1 및/또는 slice_height_in_tiles_minus1 값으로 부터 tile_idx_delta 값 또는 tileIdx를 유도할 수 있으며, 표 18과 같이 NumTileRows 값이 1이면, tile_idx_delt_present_flag 값을 시그날링하지 않을 수 있다. For example, when NumTileRows is 1, a tile_idx_delta value or tileIdx can be derived from the syntax slice_width_in_tile_minus1 and/or slice_height_in_tiles_minus1 value.

위에서 설명한 바와 같이 NumTileColumn 값이 1보다 크거나 NumTileRows 값이 1보다 큰 경우에 tile_idx_delta_present_flag 값을 시그날링할 수도 있다. As described above, when the NumTileColumn value is greater than 1 or the NumTileRows value is greater than 1, the tile_idx_delta_present_flag value may be signaled.

Figure pat00043
Figure pat00043

타일이 하나 이상의 슬라이스로 구성된 경우 (이하, 멀티 슬라이스 타일), 각 슬라이스의 높이를 모두 같도록 설정하거나, 멀티 슬라이스 타일 내 맨 마지막 슬라이스(이하, lastSliceInTile)의 높이만 다르고, 그 외의 슬라이스의 높이는 모두 같도록 설정할 수도 있다. 이 경우, 표 19와 같이 멀티 슬라이스 타일 내 슬라이스의 개수를 나타내는 신택스 num_ slices_in_tile_minus1[ i ] 및 멀티 슬라이스 타일 내 첫번째 슬라이스(이하, firstSliceInTile)의 높이를 나타내는 신택스 slice_height_in_ctus_minus1[ i ]를 시그날링할 수 있다. When a tile consists of one or more slices (hereafter, multi-slice tile), the height of each slice is set to be the same, or only the height of the last slice (hereafter, lastSliceInTile) in the multi-slice tile is different, and all other slice heights are different. You can also set them to be the same. In this case, as shown in Table 19, the syntax num_slices_in_tile_minus1[i] indicating the number of slices in the multi-slice tile and the syntax slice_height_in_ctus_minus1[i] indicating the height of the first slice (hereinafter, firstSliceInTile) in the multi-slice tile may be signaled.

Figure pat00044
Figure pat00044

멀티 슬라이스 타일 내 슬라이스 중 firstSliceInTile 또는 lastSliceInTile이 아닌 경우, middleSliceInTile이라 정의할 수 있다. Among the slices in the multi-slice tile, if it is not firstSliceInTile or lastSliceInTile, it may be defined as middleSliceInTile.

middleSliceInTile의 높이는 firstSliceInTile의 높이로 부터 middleSliceInTile의 높이를 유도할 수도 있다. firstSliceInTile의 높이 및 모든 middleSliceInTile의 높이를 더한 값을 누적 슬라이스 높이라고 정의할 수 있다. The height of middleSliceInTile may be derived from the height of firstSliceInTile. The sum of the height of firstSliceInTile and the height of all middleSliceInTiles can be defined as the cumulative slice height.

lastSliceInTile의 높이는 다음 유도식과 같이 tile row의 높이에서 누적슬라이스 높이를 차분한 값으로 유도할 수 있다. The height of lastSliceInTile can be derived as a differential value from the height of the tile row to the height of the tile row as shown in the following derivation equation.

Figure pat00045
Figure pat00045

Figure pat00046
Figure pat00046

픽쳐 내 타일은 하나의 슬라이스로 구성됨을 나타내는 신택스 single_slice_per_tile_flag을 시그날링할 수도 있다. A tile in a picture may signal a syntax single_slice_per_tile_flag indicating that it is composed of one slice.

single_slice_per_tile_flag 값이 1이면, 픽쳐 내 타일은 하나의 슬라이스로 구성됨을 나타낸다. 즉, 하나의 타일은 하나의 슬라이스로 구성됨을 나타낸다. When the value of single_slice_per_tile_flag is 1, it indicates that the tile in the picture consists of one slice. That is, it indicates that one tile is composed of one slice.

single_slice_per_tile_flag 값이 0이면, 픽쳐 내 타일이 하나의 슬라이스로 구성되지 않음을 나타낸다. 즉, 멀티 슬라이스 타일이거나, 슬라이스가 여러개의 타일로 구성될 수 있음을 나타낸다.When the single_slice_per_tile_flag value is 0, it indicates that the tile in the picture is not composed of one slice. That is, it is a multi-slice tile or indicates that a slice may be composed of several tiles.

single_slice_per_subpic_flag 값이 0인 경우에, 신택스 single_slice_per_tile_flag를 시그날링할 수 있다. When the single_slice_per_subpic_flag value is 0, the syntax single_slice_per_tile_flag may be signaled.

single_slice_per_tile_flag 값이 1인 경우에, 슬라이스 크기 및슬라이스의위치형태를 특정하는 신택스 num_slices_in_pic_minus1, tile_idx_delta_present_flag, slice_width_in_tiles_minus1[ i ], slice_height_in_tiles_minus1[ i ] , num_ slices_in_tile_minus1[ i ], exp_slice_height_in_ctus_minus1[ j ], tile_idx_delta[ i ]를 시그날링하지 않고, 그 값을 유도할 수도 있다. When the single_slice_per_tile_flag value is 1, the syntax num_slices_in_pic_minus1, tile_idx_delta_present_flag, slice_width_in_tiles_minus1 [i] that specifies a location in the form of slice size and the slices, slice_height_in_tiles_minus1 [i], num_ slices_in_tile_minus1 signal a [i], exp_slice_height_in_ctus_minus1 [j], tile_idx_delta [i] It is also possible to derive its value without ringing.

Figure pat00047
Figure pat00047

tile_idx_delta_present_flag 값이 1이고, 픽쳐 내 rectnagular 슬라이스 개수가 2(num_slice_in_pic_minus1 값이 1)인 경우에는 표 21과 같이 i-th rectangular slice의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[ i ] 및/또는 i-th rectangular slice의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[ i ]를 시그날링하지 않을 수 있다. tile_idx_delta[i] 값이 NumTileColumns 보다 작으면, slice_width_in_tiles_minus1[ i ] 값을 tile_idx_delta[i]-1로 설정할 수 있고, slice_height_in_tiles_minus1[ i ] 값을 NumTileRows-1로 설정할 수 있다. If the tile_idx_delta_present_flag value is 1 and the number of rectnagular slices in the picture is 2 (num_slice_in_pic_minus1 value is 1), as shown in Table 21, the syntax indicating the width of the i-th rectangular slice slice_width_in_tiles_minus1[ i ] and/or the height of the i-th rectangular slice The syntax slice_height_in_tiles_minus1[i] indicating the may not be signaled. If the value of tile_idx_delta[i] is smaller than NumTileColumns, the value of slice_width_in_tiles_minus1[ i ] may be set to tile_idx_delta[i]-1, and the value of slice_height_in_tiles_minus1[ i ] may be set to NumTileRows-1.

tile_idx_delta[i] 값이 NumTileColumns 와 같거나 크면, slice_width_in_tiles_in_minus1[i] 값을 NumTileColumn-1로 설정하고, slice_height_in_tiles_minus1[ i ] 값을 tile_idx_delta[i]/NumTileColumn로 설정할 수 있다.If the value of tile_idx_delta[i] is equal to or greater than NumTileColumns, the value of slice_width_in_tiles_in_minus1[i] can be set to NumTileColumn-1, and the value of slice_height_in_tiles_minus1[i] can be set to tile_idx_delta[i]/NumTileColumn.

즉, tile_idx_delta_present_flag 값이 0이거나, num_slices_in_pic_minus1 값이 1이 아닌 경우에, slice_width_in_tiles_minus1[ i ] 및/또는 slice_height_in_tiles_minus1[ i ]를 시그날링할 수 있다. That is, when the tile_idx_delta_present_flag value is 0 or the num_slices_in_pic_minus1 value is not 1, slice_width_in_tiles_minus1[ i ] and/or slice_height_in_tiles_minus1[ i ] may be signaled.

Figure pat00048
Figure pat00048

픽쳐 내 rectnagular 슬라이스 개수가 2이면, 타일이 복수개의 rectnagular 슬라이스로 나뉘어 질수 없다. 이 경우 타일이 복수 개의 rectnagular 슬라이스로 나뉘어 진다면, 타일 보다 작은 하나의 rectnagular 슬라이스와 두 개의 타일에 걸쳐 있는 rectnagular 슬라이스로 구성될 수 밖에 없는데, 이러한 파티셔닝은 허용되지 않는다. If the number of rectnagular slices in the picture is 2, the tile cannot be divided into a plurality of rectnagular slices. In this case, if a tile is divided into a plurality of rectnagular slices, it must consist of one rectnagular slice smaller than the tile and a rectnagular slice that spans two tiles. Such partitioning is not allowed.

픽쳐 내 rectangular 슬라이스의 개수가 2이면서, 픽쳐 내 타일의 개수가 1보다 큰 경우에는 표 22와 같이 타일 내 슬라이스의 높이를 나타내는 신택스 exp_slice_height_in_ctus_minus1[ j ]와 타일 내 슬라이스의 개수를 나타내는 신택스 num_exp_slices_in_tile[ i ]를 시그날링하지 않을 수 있다. When the number of rectangular slices in a picture is 2 and the number of tiles in a picture is greater than 1, as shown in Table 22, the syntax exp_slice_height_in_ctus_minus1[ j ] indicating the height of the slice in the tile and the syntax num_exp_slices_in_tile[ i ] indicating the number of slices in the tile may not be signaled.

Figure pat00049
Figure pat00049

픽쳐 내 타일의 개수(NumTilesInPic)가 2개 이하인 경우, 신택스 tile_idx_delta[i]를 시그날링하지 않고, 그 값을 0 또는 1로 설정할 수 있다. When the number of tiles in a picture (NumTilesInPic) is 2 or less, the syntax tile_idx_delta[i] may not be signaled and its value may be set to 0 or 1.

즉, 표 23과 같이 픽쳐 내 타일의 개수가 2개 이하인 경우, tile_idx_delta_present_flag을 시그날링하지 않고, 그 값을 0으로 설정할 수 있다. That is, as shown in Table 23, when the number of tiles in a picture is two or less, the tile_idx_delta_present_flag may not be signaled and its value may be set to 0.

Figure pat00050
Figure pat00050

타일 내 복수개의 슬라이스가 존재하고, i-th rectangular slice를 포함하는 타일의 tile row 높이가 2인 경우에 신택스 num_exp_slice_in_tile[i]를 시그날링하지 않고, 그 값을 1로 설저할 수 있다. When a plurality of slices exist in a tile and the tile row height of the tile including the i-th rectangular slice is 2, the syntax num_exp_slice_in_tile[i] may not be signaled, and the value may be set to 1.

표 24와 같이 i-th rectangular slice를 포함하는 타일의 tile row 높이를 나타내는 변수 RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] 가 2이상인 경우에만, 신택스 num_exp_slice_in_tile[i]를 시그날링할 수 있다. As shown in Table 24, the syntax num_exp_slice_in_tile[i] can be signaled only when the variable RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] representing the tile row height of the tile including the i-th rectangular slice is 2 or more.

Figure pat00051
Figure pat00051

타일 내 복수개의 슬라이스가 존재하고, i-th rectangular slice를 포함하는 타일의 tile row 높이가 2인 경우에 슬라이스의 높이를 나타내는 신택스 exp_slice_height_in_ctus_minus1[ j ]를 시그날링하지 않고, 그 값을 1로 설정할 수 있다. If a plurality of slices exist in a tile and the tile row height of the tile including the i-th rectangular slice is 2, the syntax exp_slice_height_in_ctus_minus1[ j ] indicating the height of the slice is not signaled, and its value can be set to 1. have.

표 25와 같이 i-th rectangular slice를 포함하는 타일의 tile row 높이를 나타내는 변수 RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] 가 2이상인 경우에만, 신택스 exp_slice_height_in_ctus_minus1[ j ]를 시그날링할 수 있다. As shown in Table 25, the syntax exp_slice_height_in_ctus_minus1[ j ] can be signaled only when the variable RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] representing the tile row height of the tile including the i-th rectangular slice is 2 or more.

신택스 exp_slice_height_in_ctus_minus1[ i ][ j ]는 0과 RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] - 2 사이의 값으로 설정할 수 있다. The syntax exp_slice_height_in_ctus_minus1[ i ][ j ] can be set to a value between 0 and RowHeight[ SliceTopLeftTileIdx[ i ] / NumTileColumns ] - 2.

Figure pat00052
Figure pat00052

표 26과 같이 픽쳐 내 rectangular slice의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[i] 값이 모두 동일한지를 나타내는 신택스 uniform_slice_width _flag을 시그날링할 수도 있다.As shown in Table 26, the syntax uniform_slice_width _flag indicating whether all values of the syntax slice_width_in_tiles_minus1[i] indicating the width of the rectangular slice in the picture are the same may be signaled.

uniform_slice_width_flag 값이 1이면, 슬라이스의 너비를 나타내는 신택스 slice_width_in_tiles_minus1[i] 값이 slice_width_in_tiles_minus1[0] 값과 동일함을 나타낸다. If the uniform_slice_width_flag value is 1, it indicates that the value of the syntax slice_width_in_tiles_minus1[i] indicating the width of the slice is the same as the value of slice_width_in_tiles_minus1[0].

uniform_slice_width_flag 값이 0이면, 슬라이스의 너비를 나타내는 신택스 slice_height_in_tiles_minus1[i] 값 중 slice_height_in_tiles_minus1[0] 값과 다른 경우가 존재할 수도 있음을 나타낸다. When the uniform_slice_width_flag value is 0, it indicates that there may be a case different from the slice_height_in_tiles_minus1[0] value among the syntax slice_height_in_tiles_minus1[i] values indicating the width of the slice.

픽쳐 내 rectangular slice의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[i]가 모두 동일한지를 나타내는 신택스 uniform_slice_ height_flag을 시그날링할 수도 있다. A syntax uniform_slice_height_flag indicating whether the syntax slice_height_in_tiles_minus1[i] indicating the height of the rectangular slice within the picture is the same may be signaled.

uniform_slice_height_flag 값이 1이면, 슬라이스의 높이를 나타내는 신택스 slice_width_in_tiles_minus1[i] 값이 slice_width_in_tiles_minus1[0] 값과 동일함을 나타낸다. If the uniform_slice_height_flag value is 1, it indicates that the value of the syntax slice_width_in_tiles_minus1[i] indicating the height of the slice is the same as the value of slice_width_in_tiles_minus1[0].

uniform_slice_height_flag 값이 0이면, 슬라이스의 높이를 나타내는 신택스 slice_height_in_tiles_minus1[i] 값 중 slice_height_in_tiles_minus1[0] 값과 다른 경우가 존재할 수도 있음을 나타낸다. When the uniform_slice_height_flag value is 0, it indicates that there may be a case different from the slice_height_in_tiles_minus1[0] value among the syntax slice_height_in_tiles_minus1[i] values indicating the height of the slice.

Claims (1)

타일 및 슬라이스 정보 부호화 및 복호화 방법.


A method for encoding and decoding tile and slice information.


KR1020200041847A 2020-04-06 2020-04-06 Video signal encoding method and apparatus and video decoding method and apparatus KR20210123950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200041847A KR20210123950A (en) 2020-04-06 2020-04-06 Video signal encoding method and apparatus and video decoding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200041847A KR20210123950A (en) 2020-04-06 2020-04-06 Video signal encoding method and apparatus and video decoding method and apparatus

Publications (1)

Publication Number Publication Date
KR20210123950A true KR20210123950A (en) 2021-10-14

Family

ID=78151617

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200041847A KR20210123950A (en) 2020-04-06 2020-04-06 Video signal encoding method and apparatus and video decoding method and apparatus

Country Status (1)

Country Link
KR (1) KR20210123950A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023132631A1 (en) * 2022-01-04 2023-07-13 엘지전자 주식회사 Image encoding/decoding method and device, and recording medium storing bitstream

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023132631A1 (en) * 2022-01-04 2023-07-13 엘지전자 주식회사 Image encoding/decoding method and device, and recording medium storing bitstream

Similar Documents

Publication Publication Date Title
KR20200063092A (en) Method for encodign/decodign video signal and apparatus therefor
KR20200041810A (en) Method for encodign/decodign video signal and apparatus therefor
KR20200041801A (en) Video signal encoding/decoding method and apparatus
KR102619997B1 (en) Method for encodign/decodign video signal and apparatus therefor
KR20200034644A (en) Method for encodign/decodign video signal and apparatus therefor
KR20200145742A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200122254A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20210030889A (en) Method for encoding/decoding a video signal and device therefor
KR20200104252A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20210023754A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200078391A (en) Method for encodign/decodign video signal and apparatus therefor
KR20210022510A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20210123950A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210077625A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20210042257A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20200145763A (en) Method for encoding/decoidng video signal and apparatus therefor
KR20210122524A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210121484A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210120389A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210113922A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210108834A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210101829A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210108836A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210114211A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210120652A (en) Video signal encoding method and apparatus and video decoding method and apparatus