KR102502216B1 - Method and apparatus for encoding/decoding an image - Google Patents

Method and apparatus for encoding/decoding an image Download PDF

Info

Publication number
KR102502216B1
KR102502216B1 KR1020220010851A KR20220010851A KR102502216B1 KR 102502216 B1 KR102502216 B1 KR 102502216B1 KR 1020220010851 A KR1020220010851 A KR 1020220010851A KR 20220010851 A KR20220010851 A KR 20220010851A KR 102502216 B1 KR102502216 B1 KR 102502216B1
Authority
KR
South Korea
Prior art keywords
prediction mode
prediction
intra
intra prediction
mode
Prior art date
Application number
KR1020220010851A
Other languages
Korean (ko)
Other versions
KR20220016938A (en
Inventor
문주희
임성원
원동재
Original Assignee
세종대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 세종대학교산학협력단 filed Critical 세종대학교산학협력단
Publication of KR20220016938A publication Critical patent/KR20220016938A/en
Priority to KR1020230020808A priority Critical patent/KR20230025851A/en
Application granted granted Critical
Publication of KR102502216B1 publication Critical patent/KR102502216B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

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

Abstract

본 개시에 따른 영상 부호화/복호화 방법 및 장치는, 비트스트림으로부터 참조 화소 라인 인덱스 정보를 획득하고, 상기 참조 화소 라인 인덱스 정보에 기반하여 복수의 참조 화소 라인들로부터 현재 블록에 대한 참조 화소 라인을 선택하며, 상기 현재 블록의 인트라 예측 모드를 유도하고, 상기 유도된 인트라 예측 모드를 재설정하며, 상기 선택된 참조 화소 라인 및 상기 재설정된 인트라 예측 모드에 기반하여 인트라 예측을 수행함으로써 상기 현재 블록의 예측 블록을 생성할 수 있다.An image encoding/decoding method and apparatus according to the present disclosure obtains reference pixel line index information from a bitstream, and selects a reference pixel line for a current block from a plurality of reference pixel lines based on the reference pixel line index information. The prediction block of the current block is obtained by deriving an intra prediction mode of the current block, resetting the derived intra prediction mode, and performing intra prediction based on the selected reference pixel line and the reset intra prediction mode. can create

Description

영상의 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR ENCODING/DECODING AN IMAGE}Video encoding/decoding method and apparatus {METHOD AND APPARATUS FOR ENCODING/DECODING AN IMAGE}

본 발명은 영상 신호 부호화/복호화 방법 및 장치에 관한 것으로서, 보다 구체적으로는 개선된 화면 내 예측을 이용한 영상 부호화/복호화 방법 및 장치에 관한 것이다.The present invention relates to a video signal encoding/decoding method and apparatus, and more particularly, to a video encoding/decoding method and apparatus using improved intra-prediction.

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(Channel)의 대역폭(Bandwidth)이 발전하는 속도는 급격히 증가하고 있는 멀티미디어 데이터의 양을 따라가기 힘든 상황이다. 이러한 문제를 해결하기 위하여 국제 표준화 기구인 ITU-T의 VCEG(Video Coding Expert Group)과 ISO/IEC의 MPEG(Moving Picture Expert Group)에서는 꾸준히 공동 연구를 통하여 보다 향상된 동영상 압축 표준을 연구하는 중이다.Recently, the demand for multimedia data such as moving pictures is rapidly increasing on the Internet. However, it is difficult to keep up with the rapidly increasing amount of multimedia data at the rate at which the bandwidth of a channel develops. In order to solve this problem, an international standardization organization, ITU-T's Video Coding Expert Group (VCEG) and ISO/IEC's Moving Picture Expert Group (MPEG), are continuously researching a more advanced video compression standard through joint research.

동영상 압축은 크게 화면 내 예측, 화면 간 예측, 변환, 양자화, 엔트로피(Entropy coding)부호화, 인루프 필터(In-loop filter)로 구성된다. 이 중, 화면 내 예측은 현재 블록주변에 존재하는 복원된 화소들을 이용하여 현재 블록을 위한 예측 블록을 생성하는 기술을 말한다. Video compression is largely composed of intra-prediction, inter-prediction, transform, quantization, entropy coding, and in-loop filter. Among them, intra-prediction refers to a technique of generating a prediction block for a current block using reconstructed pixels existing around the current block.

종래의 화면 내 예측은, 정수 위치의 참조 화소들을 이용한 보간 과정을 통해 분수 위치의 화소들을 생성하고, 이렇게 생성된 분수 위치의 화소들을 이용하여 예측 블록을 생성한다. 이 때 어떤 정수 위치의 참조 화소들을 이용하느냐 여부와 어떤 보간 방식을 적용하였는지 여부에 따라 원래 화소값과 그 예측값 간의 오차에 영향을 주게된다.In conventional intra-prediction, pixels at fractional positions are generated through an interpolation process using reference pixels at integer positions, and a prediction block is generated using the pixels at fractional positions thus generated. At this time, an error between an original pixel value and its predicted value is affected depending on which reference pixels of integer positions are used and which interpolation method is applied.

또한, 종래의 화면 내 예측 기술은, 다수의 화면 내 예측 모드들 중 어떠한 화면 내 예측 모드가 입력 영상의 화면 내 예측에 사용되었는지를 영상 복호화 장치에 알리기 위해 예측 모드에 관한 상당한 정보를 부호화해야 한다.In addition, the conventional intra-prediction technique requires encoding considerable information about the prediction mode in order to inform the video decoding apparatus which intra-prediction mode among a plurality of intra-prediction modes is used for intra-prediction of the input video. .

본 발명은 영상을 부호화/복호화함에 있어서, 이미 복원된 화소 영역을 이용하여 부호화 또는 복호화할 영상의 화면 내 예측 모드를 유도함으로써, 화면 내 예측의 효율을 향상시키는 것에 주된 목적이 있다.A main object of the present invention is to improve the efficiency of intra prediction by inducing an intra prediction mode of an image to be encoded or decoded using an already reconstructed pixel region in encoding/decoding an image.

전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화/복호화 방법 및 장치는, 이미 복원된, 적어도 하나의 화소 영역의 참조 화소 영역에 기초하여 상기 복원된 화소 영역의 인트라 예측 모드를 유도하고, 상기 유도된 상기 복원된 화소 영역의 인트라 예측 모드에 기초하여, 상기 현재 블록의 인트라 예측 모드를 유도하고, 상기 유도된 인트라 예측 모드를 이용하여 상기 현재 블록의 인트라 예측 블록을 얻고, 상기 얻은 인트라 예측 블록과 상기 현재 블록의 잔차 블록을 가산하여 상기 현재 블록을 복원할 수 있다.An image encoding/decoding method and apparatus according to an embodiment of the present invention for achieving the above object derives an intra prediction mode of a reconstructed pixel area based on a previously reconstructed reference pixel area of at least one pixel area. and derives an intra-prediction mode of the current block based on the derived intra-prediction mode of the reconstructed pixel region, obtains an intra-prediction block of the current block using the derived intra-prediction mode, and The current block may be reconstructed by adding the intra prediction block and the residual block of the current block.

전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 복호화 방법 및 장치는, 입력 비트스트림으로부터 인트라 예측 모드의 유도 방법을 지시하는 정보를 얻고, 상기 인트라 예측 모드의 유도 방법을 지시하는 정보에 따라, 복원된 화소 영역의 인트라 예측 모드의 유도의 수행 여부가 선택될 수 있다.In order to achieve the above object, a video decoding method and apparatus according to an embodiment of the present invention obtains information indicative of an intra prediction mode derivation method from an input bitstream, and obtains information indicative of an intra prediction mode derivation method from an input bitstream. Accordingly, it may be selected whether to perform the derivation of the intra prediction mode of the reconstructed pixel area.

전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 복호화 방법 및 장치는, 입력 비트스트림에서 상기 가용한 복수의 인트라 예측 모드들의 개수 또는 상기 가용한 복수의 인트라 예측 모드들의 리스트를 특정하는 가용한 인트라 예측 모드 정보를 얻고, 상기 가용한 인트라 예측 모드 정보에 기초하여 상기 현재 블록의 인트라 예측 모드를 유도할 수 있다.In order to achieve the above object, an image decoding method and apparatus according to an embodiment of the present invention specify the number of the plurality of available intra prediction modes or the list of the plurality of available intra prediction modes in an input bitstream. One intra-prediction mode information may be obtained, and an intra-prediction mode of the current block may be derived based on the available intra-prediction mode information.

전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화 방법 및 장치는, 현재 블록의 인트라 예측 모드의 유도 방법을 지시하는 정보를 부호화한 후 비트스트림에 포함시키고, 상기 비트스트림을 입력받은 영상 복호화 장치는, 상기 현재 블록의 인트라 예측 모드의 유도 방법을 지시하는 정보에 따라 상기 복원된 화소 영역의 인트라 예측 모드를 유도하는 단계를 선택적으로 수행할 수 있다.In order to achieve the above object, an image encoding method and apparatus according to an embodiment of the present invention encode information indicating a method for deriving an intra prediction mode of a current block, include it in a bitstream, and receive the bitstream The image decoding apparatus may selectively perform the step of deriving the intra prediction mode of the reconstructed pixel region according to the information indicating the method of deriving the intra prediction mode of the current block.

이러한 본 발명에 따르면, 영상을 부호화 및 복호화하는 데 이용되는 화면 내 예측 기술을 효율적으로 적용함으로서 영상의 압축 효율을 향상시킬 수 있다.According to the present invention, compression efficiency of an image can be improved by efficiently applying an intra-prediction technique used to encode and decode an image.

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 인트라 예측 모드의 일 예를 설명하기 위한 도면이다.
도 3은 평면 모드를 설명하기 위한 도면이다.
도 4는 DC 모드를 설명하기 위한 도면이다.
도 5는 예측 블록을 생성하는 일 예를 설명하기 위한 도면이다.
도 6은 본 발명의 일 실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 7은 본 발명의 제1 실시예에 따른 DIMD를 설명하기 위한 도면이다.
도 8은 본 발명의 제3 실시예에 따른 DIMD를 설명하기 위한 도면이다.
도 9는 본 발명에 따른 DIMD를 설명하기 위한 순서도이다.
도 10은 본 발명에 따른 DIMD를 이용하여 영상을 부호화하는 경우, 화면 내 예측 모드를 부호화하는 방법을 설명하기 위한 순서도이다.
도 11은 본 발명에 따른 DIMD를 이용하여 영상을 복호화하는 경우, 화면 내 예측 모드를 복호화하는 방법을 설명하기 위한 순서도이다.
도 12는 본 발명에 따른 제7 실시예를 설명하기 위한 도면이다.
도 13은 본 발명의 제7 실시예를 적용한 경우, 인트라 예측 모드를 부호화 하는 과정을 나타낸 순서도이다.
도 14는 본 발명의 제7 실시예를 적용한 경우, 인트라 예측 모드를 복호화 하는 과정을 나타낸 순서도이다.
도 15a 및 도 15b는 템플릿 인덱스를 전송하는 DIMD의 변형예를 설명하기 위한 도면이다.
도 16은 템플릿 인덱스가 사용되는 DIMD에 따른 화면 내 예측 모드의 부호화 방법을 설명하는 순서도이다.
도 17은 템플릿 인덱스가 사용되는 DIMD에 따른 화면 내 예측 모드의 부호화 방법을 설명하는 순서도이다.
도 18은 템플릿을 이용하여 유도된 화면 내 예측 모드를 MPM 후보로 설정하는 일 예를 설명하기 위한 도면이다.
도 19는 본 발명의 일 실시예에 따른 MPM 후보 설정을 설명하기 위한 도면이다.
1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.
2 is a diagram for explaining an example of an intra prediction mode.
3 is a diagram for explaining a planar mode.
4 is a diagram for explaining the DC mode.
5 is a diagram for explaining an example of generating a prediction block.
6 is a block diagram illustrating a video decoding apparatus according to an embodiment of the present invention.
7 is a diagram for explaining a DIMD according to a first embodiment of the present invention.
8 is a diagram for explaining a DIMD according to a third embodiment of the present invention.
9 is a flowchart illustrating a DIMD according to the present invention.
10 is a flowchart illustrating a method of encoding an intra-prediction mode when encoding an image using a DIMD according to the present invention.
11 is a flowchart for explaining a method of decoding an intra-prediction mode when decoding an image using a DIMD according to the present invention.
12 is a diagram for explaining a seventh embodiment according to the present invention.
13 is a flowchart illustrating a process of encoding an intra prediction mode when the seventh embodiment of the present invention is applied.
14 is a flowchart illustrating a process of decoding an intra prediction mode when the seventh embodiment of the present invention is applied.
15A and 15B are diagrams for explaining a modified example of a DIMD transmitting a template index.
16 is a flowchart illustrating an encoding method of an intra prediction mode according to a DIMD in which a template index is used.
17 is a flowchart illustrating an encoding method of an intra prediction mode according to a DIMD in which a template index is used.
18 is a diagram for explaining an example of setting an intra prediction mode derived using a template as an MPM candidate.
19 is a diagram for explaining MPM candidate setting according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.Since the present invention can make various changes and have various embodiments, specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, and should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. Like reference numerals have been used for like elements throughout the description of each figure.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. These terms are only used for the purpose of distinguishing one component from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element, without departing from the scope of the present invention. The terms and/or include any combination of a plurality of related recited items or any of a plurality of related recited items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어"있다거나 "직접 접속되어"있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.It is understood that when an element is referred to as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, but other elements may exist in the middle. It should be. On the other hand, when an element is referred to as “directly connected” or “directly connected” to another element, it should be understood that no other element exists in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.Terms used in this application are only used to describe specific embodiments, and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly dictates otherwise. In this application, the terms "include" or "have" are intended to designate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, but one or more other features It should be understood that the presence or addition of numbers, steps, operations, components, parts, or combinations thereof is not precluded.

이하, 첨부한 도면들을 참조하여, 본 발명의 실시예들을 상세하게 설명한다. 이하, 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, with reference to the accompanying drawings, embodiments of the present invention will be described in detail. Hereinafter, the same reference numerals are used for the same components in the drawings, and redundant descriptions of the same components are omitted.

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.

도 1을 참조하면, 영상 부호화 장치(100)는 영상 분할부(101),화면 내 예측부(102), 화면 간 예측부(103), 감산부(104), 변환부(105), 양자화부(106), 엔트로피 부호화부(107), 역양자화부(108), 역변환부(109), 증산부(110), 필터부(111) 및 메모리(112)를 포함할 수 있다.Referring to FIG. 1 , an image encoding apparatus 100 includes an image division unit 101, an intra prediction unit 102, an inter prediction unit 103, a subtraction unit 104, a transform unit 105, and a quantization unit. 106, an entropy encoding unit 107, an inverse quantization unit 108, an inverse transform unit 109, a multiplication unit 110, a filter unit 111, and a memory 112.

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

또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.In addition, some of the components may be optional components for improving performance rather than essential components that perform essential functions in the present invention. The present invention can be implemented by including only components essential to implement the essence of the present invention, excluding 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.

영상 분할부(100)는 입력된 영상을 적어도 하나의 블록으로 분할할 수 있다. 이 때, 입력된 영상은 픽처, 슬라이스, 타일, 세그먼트 등 다양한 형태와 크기를 가질 수 있다. 블록은 부호화 단위(CU), 예측 단위(PU) 또는 변환 단위(TU)를 의미할 수 있다. 상기 분할은 쿼드 트리(Quadtree) 또는 바이너리 트리(Biniary tree) 중 적어도 하나에 기반하여 수행될 수 있다. 쿼드 트리는 상위 블록을 너비와 높이가 상위 블록의 절반인 하위 블록으로 사분할하는 방식이다. 바이너리 트리는 상위 블록을 너비 또는 높이 중 어느 하나가 상위 블록의 절반인 하위 블록으로 이분할하는 방식이다. 전술한 바이너리 트리 기반의 분할을 통해, 블록은 정방형뿐만 아니라 비정방형의 형태를 가질 수 있다.The image segmentation unit 100 may divide an input image into at least one block. In this case, the input image may have various shapes and sizes such as picture, slice, tile, and segment. A block may mean a coding unit (CU), a prediction unit (PU), or a transformation unit (TU). The division may be performed based on at least one of a quadtree or a binary tree. A quad tree is a method in which a parent block is divided into four sub-blocks whose width and height are half of the parent block. The binary tree is a method in which an upper block is divided into lower blocks whose width or height is half of the upper block. Through the binary tree-based partitioning described above, a block may have a non-square shape as well as a square shape.

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

예측부(102, 103)는 인터 예측을 수행하는 화면 간 예측부(103)와 인트라 예측을 수행하는 화면 내 예측부(102)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다.The prediction units 102 and 103 may include an inter prediction unit 103 performing inter prediction and an intra prediction unit 102 performing intra prediction. It is possible to determine whether to use inter prediction or intra prediction for a prediction unit, and determine specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. In this case, a processing unit in which prediction is performed and a processing unit in which a prediction method and specific details are determined may be different. For example, a prediction method and a prediction mode may be determined in a prediction unit, and prediction may be performed in a transformation unit.

생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(105)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(107)에서 부호화되어 복호화기에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(102, 103)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.A residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 105 . In addition, prediction mode information and motion vector information used for prediction may be encoded in the entropy encoding unit 107 together with residual values and transmitted to the decoder. When a specific encoding mode is used, it is also possible to encode an original block as it is and transmit it to a decoder without generating a prediction block through the prediction units 102 and 103.

화면 내 예측부(102)는 현재 블록의 화면 내 예측 모드를 결정하고, 상기 결정된 인트라 예측 모드에 따라, 참조 화소들을 이용하여 하나 또는 복수개의 예측 블록을 생성할 수 있다. 인트라 예측이 수행될 현재 블록의 주변 블록의 예측 모드가 인터 예측인 경우, 인터 예측이 적용된 주변 블록에 포함되는 참조 픽셀을, 인트라 예측이 적용된 주변의 다른 블록 내의 참조 픽셀로 대체될 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를, 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.The intra-prediction unit 102 may determine an intra-prediction mode of the current block and generate one or a plurality of prediction blocks using reference pixels according to the determined intra-prediction mode. When a prediction mode of a neighboring block of a current block to which intra prediction is to be performed is inter prediction, a reference pixel included in a neighboring block to which inter prediction is applied may be replaced with a reference pixel in another neighboring block to which intra prediction is applied. That is, when a reference pixel is unavailable, the unavailable reference pixel information may be replaced with at least one reference pixel among available reference pixels.

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

화면 내 예측부(102)는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 필터로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 적응적으로 결정할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.The intra-prediction unit 102 may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolator, and a DC filter. The AIS filter is a filter that performs filtering on reference pixels of the current block, and can adaptively determine whether to apply the filter according to the prediction mode of the current prediction unit. When the prediction mode of the current block is a mode in which AIS filtering is not performed, AIS filter may not be applied.

화면 내 예측부(102)의 참조 화소 보간부는 예측 단위의 인트라 예측 모드가 참조 화소를 보간한 화소값을 기초로 인트라 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 분수 단위 위치의 참조 화소를 생성할 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.The reference pixel interpolator of the intra prediction unit 102 interpolates the reference pixel when the intra prediction mode of the prediction unit is a prediction unit that performs intra prediction based on the interpolated pixel value of the reference pixel, and interpolates the reference pixel at the position of the fractional unit. can create When the prediction mode of the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. The DC filter may generate a prediction block through filtering when the prediction mode of the current block is the DC mode.

예측부(102, 103)에서 생성된 예측 블록과 예측 블록의 원본 블록 간의 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력되어 변환될 수 있다. A residual block including residual value information that is a difference value between the prediction block generated by the predictors 102 and 103 and the original block of the prediction block may be generated. The generated residual block may be input to the transform unit 130 and transformed.

도 2는 인트라 예측 모드의 일 예를 설명하기 위한 도면이다. 도 2에 도시된 인트라 예측 모드는 총 35가지의 모드를 가지고 있다. 0번 모드는 평면 모드(Planar mode), 1번 모드는 DC 모드, 2 내지 34번 모드는 각도 모드(Angular mode)를 나타낸다. 2 is a diagram for explaining an example of an intra prediction mode. The intra prediction mode shown in FIG. 2 has a total of 35 modes. Mode 0 represents a planar mode, mode 1 represents a DC mode, and modes 2 through 34 represent angular modes.

도 3은 평면 모드를 설명하기 위한 도면이다. 현재 블록 내의 첫 번째 화소 P1의 예측값을 생성하기 위해 Y축으로 같은 위치에 있는 복원된 화소와 현재 블록의 우측 상단에 존재하는 복원된 화소 T를 도시된 바와 같이 선형 보간 하여 생성한다. 마찬가지로 두 번째 화소 P2의 예측값을 생성하기 위해 X축으로 같은 위치에 있는 복원된 화소와 현재 블록의 좌측 하단에 존재하는 복원된 화소 L을 도시된 바와 같이 선형 보간 하여 생성한다. 두 개의 예측 화소 P1과 P2를 평균한 값이 최종적인 예측 화소가 된다. 평면 모드에서는 위와 같은 방식으로 예측 화소들을 유도하여 현재 블록의 예측 블록을 생성한다. 3 is a diagram for explaining a planar mode. To generate the predicted value of the first pixel P1 in the current block, the reconstructed pixel at the same position along the Y-axis and the reconstructed pixel T existing at the upper right of the current block are linearly interpolated as shown. Similarly, in order to generate the predicted value of the second pixel P2, the reconstructed pixel at the same position along the X axis and the reconstructed pixel L existing at the lower left of the current block are generated by linear interpolation as shown. A value obtained by averaging the two predicted pixels P1 and P2 becomes a final predicted pixel. In the planar mode, a prediction block of the current block is generated by inducing prediction pixels in the same manner as above.

도 4는 DC 모드를 설명하기 위한 도면이다. 현재 블록 주변의 복원된 화소들의 평균을 계산한 다음, 그 평균 값을 현재 블록 내의 모든 화소들의 예측값으로 이용한다. 4 is a diagram for explaining the DC mode. After calculating the average of the reconstructed pixels around the current block, the average value is used as a predicted value of all pixels in the current block.

도 5는 도 2의 10번 모드(수평 모드)와 26번 모드(수직 모드)를 이용하여 예측 블록을 생성하는 일 예를 설명하기 위한 도면이다. 10번 모드를 이용하는 경우, 현재 블록의 좌측에 접하는 각 참조화소를 오른쪽 방향으로 복사하여 현재 블록의 예측 블록을 생성한다. 마찬가지로 26번 모드는, 현재 블록의 상측에 접하는 각 참조 화소를 아래쪽 방향으로 복사하여 현재 블록의 예측 블록을 생성한다.FIG. 5 is a diagram for explaining an example of generating a prediction block using the 10th mode (horizontal mode) and the 26th mode (vertical mode) of FIG. 2 . In the case of using mode 10, a prediction block of the current block is generated by copying each reference pixel adjacent to the left side of the current block in the right direction. Similarly, in mode 26, a prediction block of the current block is generated by copying each reference pixel adjacent to the upper side of the current block in a downward direction.

다시 도 1을 참조하면, 화면 간 예측부(103)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 단위를 예측할 수도 있고, 경우에 따라서는 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로 예측 단위를 예측할 수도 있다. 화면 간 예측부(103)는 참조 픽쳐 보간부, 모션 예측부, 움직임 보상부를 포함할 수 있다. Referring back to FIG. 1 , the inter-prediction unit 103 may predict a prediction unit based on information on at least one picture among pictures before or after the current picture, and in some cases, coding within the current picture is completed. A prediction unit may be predicted based on information of a partial region. The inter-prediction unit 103 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

참조 픽쳐 보간부에서는 메모리(112)로부터 참조 픽쳐 정보를 제공받고 참조 픽쳐에서 정수 화소 이하의 화소 정보를 생성할 수 있다. 휘도 화소의 경우, 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 112 and generate pixel information of an integer pixel or less in the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients may be used to generate pixel information of an integer pixel or less in units of 1/4 pixels. In the case of a color difference signal, a DCT-based 4-tap interpolation filter with different filter coefficients may be used to generate pixel information of an integer pixel or less in units of 1/8 pixels.

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

감산부(104)는, 현재 부호화하려는 블록과 화면 내 예측부(102) 혹은 화면 간 예측부(103)에서 생성된 예측 블록을 감산하여 현재 블록의 잔차 블록을 생성한다.The subtraction unit 104 subtracts a block to be currently encoded and a prediction block generated by the intra prediction unit 102 or the inter prediction unit 103 to generate a residual block of the current block.

변환부(105)에서는 잔차 데이터를 포함한 잔차 블록을 DCT, DST, KLT(Karhunen Loeve Transform) 등과 같은 변환 방법을 사용하여 변환시킬 수 있다. 이때 변환 방법은 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드에 기반하여 결정될 수 있다. 예를 들어, 인트라 예측 모드에 따라, 가로 방향으로는 DCT를 사용하고, 세로 방향으로는 DST를 사용할 수도 있다.The transform unit 105 may transform a residual block including residual data using a transform method such as DCT, DST, or Karhunen Loeve Transform (KLT). In this case, a transform method may be determined based on an intra prediction mode of a prediction unit used to generate the residual block. For example, according to the intra prediction mode, DCT may be used in the horizontal direction and DST may be used in the vertical direction.

양자화부(106)는 변환부(105)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(106)에서 산출된 값은 역양자화부(108)와 엔트로피 부호화부(107)에 제공될 수 있다.The quantization unit 106 may quantize the values converted into the frequency domain by the transform unit 105 . A quantization coefficient may change according to a block or an importance of an image. The value calculated by the quantization unit 106 may be provided to the inverse quantization unit 108 and the entropy encoding unit 107 .

상기 변환부(105) 및/또는 양자화부(106)는, 영상 부호화 장치(100)에 선택적으로 포함될 수 있다. 즉, 영상 부호화 장치(100)는, 잔차 블록의 잔차 데이터에 대해 변환 또는 양자화 중 적어도 하나를 수행하거나, 변환 및 양자화를 모두 스킵하여 잔차 블록을 부호화할 수 있다. 영상 부호화 장치(100)에서 변환 또는 양자화 중 어느 하나가 수행되지 않거나, 변환 및 양자화 모두 수행되지 않더라도, 엔트로피 부호화부(107)의 입력으로 들어가는 블록을 통상적으로 변환 블록이라 일컫는다. 엔트로피 부호화부(107)는 입력 데이터를 엔트로피 부호화한다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다.The transform unit 105 and/or the quantization unit 106 may be selectively included in the image encoding apparatus 100 . That is, the image encoding apparatus 100 may encode the residual block by performing at least one of transformation or quantization on the residual data of the residual block, or skipping both transformation and quantization. A block input to the input of the entropy encoding unit 107 is generally referred to as a transform block, even if either transform or quantization is not performed in the image encoding apparatus 100 or both transform and quantization are not performed. The entropy encoding unit 107 entropy encodes the input data. Entropy encoding may use various encoding methods such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).

엔트로피 부호화부(107)는 예측부(102, 103)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. 엔트로피 부호화부(107)에서, 변환 블록의 계수는, 변환 블록 내 부분 블록 단위로, 0이 아닌 계수, 절대값이 1 또는 2보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 부호화될 수 있다. 상기 플래그만으로 부호화되지 않는 계수는, 플래그를 통해 부호화된 계수와 실제 변환 블록의 계수 간의 차이의 절대값을 통해 부호화될 수 있다. 역양자화부(108) 및 역변환부(109)에서는 양자화부(106)에서 양자화된 값들을 역양자화하고 변환부(105)에서 변환된 값들을 역변환한다. 역양자화부(108) 및 역변환부(109)에서 생성된 잔차값(Residual)은 예측부(102, 103)에 포함된 움직임 추정부, 움직임 보상부 및 화면 내 예측부(102)를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다. 증산기(110)는, 예측부(102, 103)에서 생성된 예측 블록과, 역 변환부(109)를 통해 생성된 잔차 블록을 증산하여 복원 블록을 생성한다.The entropy encoding unit 107 receives residual value coefficient information and block type information of a coding unit from the prediction units 102 and 103, prediction mode information, division unit information, prediction unit information and transmission unit information, motion vector information, and reference frame information. , various information such as block interpolation information and filtering information can be encoded. In the entropy encoding unit 107, for the coefficients of the transform block, in units of partial blocks within the transform block, various types of flags indicating coefficients other than 0, coefficients with absolute values greater than 1 or 2, and signs of the coefficients are encoded. It can be. A coefficient that is not coded only with the flag may be coded using an absolute value of a difference between a coefficient coded with the flag and a coefficient of an actual transform block. The inverse quantization unit 108 and the inverse transform unit 109 inversely quantize the values quantized by the quantization unit 106 and inversely transform the values transformed by the transform unit 105 . The residual generated by the inverse quantization unit 108 and the inverse transform unit 109 is predicted through the motion estimation unit, motion compensation unit, and intra prediction unit 102 included in the prediction units 102 and 103. Combined with a prediction unit, a reconstructed block may be generated. The multiplier 110 multiplies the prediction block generated by the prediction units 102 and 103 and the residual block generated through the inverse transform unit 109 to generate a reconstructed block.

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

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

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

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

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

도 6은 본 발명의 일 실시예에 따른 영상 복호화 장치(600)를 나타낸 블록도이다. 6 is a block diagram illustrating an image decoding apparatus 600 according to an embodiment of the present invention.

도 6을 참조하면, 영상 복호화 장치(600)는 엔트로피 복호화부(601), 역양자화부(602), 역변환부(603), 증산부(604), 필터부(605), 메모리(606) 및 예측부(607, 608)를 포함할 수 있다.Referring to FIG. 6 , an image decoding apparatus 600 includes an entropy decoding unit 601, an inverse quantization unit 602, an inverse transform unit 603, a multiplication unit 604, a filter unit 605, a memory 606, and Prediction units 607 and 608 may be included.

영상 부호화 장치(100)에 의해 생성된 영상 비트스트림이 영상 복호화 장치(600)로 입력되는 경우, 입력된 비트스트림은 영상 부호화 장치(100)에서 수행된 과정과 반대의 과정에 따라 복호될 수 있다.When the video bitstream generated by the video encoding apparatus 100 is input to the video decoding apparatus 600, the input bitstream may be decoded according to a process opposite to that performed by the video encoding apparatus 100. .

엔트로피 복호화부(601)는 영상 부호화 장치(100)의 엔트로피 부호화부(107)에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. 엔트로피 복호화부(601)에서, 변환 블록의 계수는, 변환 블록 내 부분 블록 단위로, 0이 아닌 계수, 절대값이 1 또는 2보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 기반으로 복호화될 수 있다. 상기 플래그만으로 표현되지 않는 계수는, 플래그를 통해 표현되는 계수와 시그날링된 계수의 합을 통해 복호화될 수 있다.The entropy decoding unit 601 may perform entropy decoding by a procedure opposite to that of the entropy encoding performed by the entropy encoding unit 107 of the image encoding apparatus 100 . For example, various methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied corresponding to the method performed by the image encoder. In the entropy decoding unit 601, the coefficients of the transform block are based on various types of flags indicating non-zero coefficients, coefficients with an absolute value greater than 1 or 2, and signs of coefficients in units of partial blocks within the transform block. can be decrypted. A coefficient not expressed only by the flag may be decoded through a sum of a coefficient expressed through the flag and a signaled coefficient.

엔트로피 복호화부(601)에서는 부호화기에서 수행된 인트라 예측 및 인터 예측에 관련된 정보를 복호화할 수 있다.역 양자화부(602)는 양자화된 변환 블록에 역 양자화를 수행하여 변환 블록을 생성한다. 도 1의 역 양자화부(108)와 실질적으로 동일하게 동작한다.The entropy decoding unit 601 may decode information related to intra prediction and inter prediction performed by the encoder. The inverse quantization unit 602 generates a transform block by performing inverse quantization on the quantized transform block. It operates substantially the same as the inverse quantization unit 108 of FIG. 1 .

역 변환부(603)은 변환 블록에 역 변환을 수행하여 잔차 블록을 생성한다. 이때, 변환 방법은 예측 방법(인터 또는 인트라 예측), 블록의 크기 및/또는 형태, 인트라 예측 모드 등에 관한 정보를 기반으로 결정될 수 있다. 도 1의 역 변환부(109)와 실질적으로 동일하게 동작한다. The inverse transform unit 603 generates a residual block by performing an inverse transform on the transform block. In this case, the transformation method may be determined based on information about a prediction method (inter or intra prediction), block size and/or shape, intra prediction mode, and the like. It operates substantially the same as the inverse transform unit 109 of FIG. 1 .

증산부(604)는, 화면 내 예측부(607) 혹은 화면 간 예측부(608)에서 생성된 예측 블록과 역 변환부(603)를 통해 생성된 잔차 블록를 증산하여 복원 블록을 생성한다. 도 1의 증산부(110)과 실질적으로 동일하게 동작한다.The multiplication unit 604 multiplies the prediction block generated by the intra prediction unit 607 or the inter prediction unit 608 and the residual block generated by the inverse transform unit 603 to generate a reconstructed block. It operates substantially the same as the evaporation unit 110 of FIG. 1 .

필터부(605)는, 복원된 블록들에 발생하는 여러 종류의 노이즈를 감소시킨다.The filter unit 605 reduces various types of noise generated in restored blocks.

필터부(605)는 디블록킹 필터, 오프셋 보정부, ALF를 포함할 수 있다.The filter unit 605 may include a deblocking filter, an offset correction unit, and an ALF.

영상 부호화 장치(100)로부터 해당 블록 또는 픽쳐에 디블록킹 필터를 적용하였는지 여부에 대한 정보 및 디블록킹 필터를 적용하였을 경우, 강한 필터를 적용하였는지 또는 약한 필터를 적용하였는지에 대한 정보를 제공받을 수 있다. 영상 복호화 장치(600)의 디블록킹 필터에서는 영상 부호화 장치(100)에서 제공된 디블록킹 필터 관련 정보를 제공받고 영상 복호화 장치(600)에서 해당 블록에 대한 디블록킹 필터링을 수행할 수 있다. Information on whether a deblocking filter is applied to a 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 encoding apparatus 100. The deblocking filter of the video decoding apparatus 600 may receive information related to the deblocking filter provided from the video encoding apparatus 100, and the video decoding apparatus 600 may perform deblocking filtering on a corresponding block.

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

ALF는 영상 부호화 장치(100)로부터 제공된 ALF 적용 여부 정보, ALF 계수 정보 등을 기초로 부호화 단위에 적용될 수 있다. 이러한 ALF 정보는 특정한 파라미터 셋에 포함되어 제공될 수 있다. 필터부(605)는 도 1의 필터부(111)와 실질적으로 동일하게 동작한다.ALF may be applied to a coding unit based on ALF application information and ALF coefficient information provided from the video encoding apparatus 100 . Such ALF information may be included in a specific parameter set and provided. The filter unit 605 operates substantially the same as the filter unit 111 of FIG. 1 .

메모리(606)는 증산부(604)에 의해 생성된 복원 블록을 저장한다. 도 1의 메모리(112)와 실질적으로 동일하게 동작한다.The memory 606 stores the reconstruction block generated by the augmentation unit 604. It operates substantially the same as memory 112 of FIG.

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

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

화면 간 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), AMVP 모드(AMVP Mode) 중 어떠한 방법인지 여부를 판단할 수 있다.Whether or not the motion prediction method of the prediction unit included in the coding unit is skip mode, merge mode, or AMVP mode based on the coding unit to perform inter-prediction. can judge

화면 내 예측부(607)는, 현재 부호화하려는 블록 주변에 위치한, 그리고 기 복원된 화소들을 이용하여 예측 블록을 생성한다. The intra-prediction unit 607 generates a prediction block using previously reconstructed pixels located around a block to be currently encoded.

화면 내 예측부(607)는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 필터로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 적응적으로 결정할 수 있다. 영상 부호화 장치(100)에서 제공된 예측 단위의 예측 모드 및 AIS 필터 정보를 이용하여 현재 블록의 참조 화소에 AIS 필터링을 수행할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.The intra-prediction unit 607 may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolator, and a DC filter. The AIS filter is a filter that performs filtering on reference pixels of the current block, and can adaptively determine whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering may be performed on reference pixels of the current block using the prediction mode of the prediction unit and AIS filter information provided by the image encoding apparatus 100 . When the prediction mode of the current block is a mode in which AIS filtering is not performed, AIS filter may not be applied.

화면 내 예측부(607)의 참조 화소 보간부는 예측 단위의 예측 모드가 참조 화소를 보간한 화소값을 기초로 인트라 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 분수 단위 위치의 참조 화소를 생성할 수 있다. 생성된 분수 단위 위치의 참조 화소가 현재 블록 내의 화소의 예측 화소로 이용될 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.The reference pixel interpolator of the intra-prediction unit 607 interpolates the reference pixel to obtain a reference pixel at a fractional unit position when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on a pixel value obtained by interpolating the reference pixel. can create The generated reference pixel at the location of the fractional unit may be used as a prediction pixel of a pixel in the current block. When the prediction mode of the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. The DC filter may generate a prediction block through filtering when the prediction mode of the current block is the DC mode.

화면 내 예측부(607)는 도 1의 화면 내 예측부(102)와 실질적으로 동일하게 동작한다.The intra-prediction unit 607 operates substantially the same as the intra-prediction unit 102 of FIG. 1 .

화면 간 예측부(608)는, 메모리(606)에 저장된 참조 픽처, , 움직임 정보를 이용하여 인터 예측 블록을 생성한다. 화면 간 예측부(608)는 도 1의 화면 간 예측부(103)와 실질적으로 동일하게 동작한다.The inter-prediction unit 608 generates an inter-prediction block using the reference picture , , and motion information stored in the memory 606 . The inter-prediction unit 608 operates substantially the same as the inter-prediction unit 103 of FIG. 1 .

본 발명은, 특히 인트라 예측 모드의 유도에 관한 것으로서, 이하, 본 발명에 따른 화면 내 예측 모드의 유도, 부호화 및 복호화와 관련된 다양한 실시예들과 응용예들을 도면들을 참조하면서 설명한다. 본 발명에 따른 화면 내 예측 모드 유도를 적용하면, 동일한 방법 및/또는 동일한 기준으로 영상 부호화 장치와 영상 복호화 장치가, 화면 내 예측 모드를 유도할 수 있으므로 화면 내 예측 모드 자체를 알리기 위한 정보를 영상 복호화 장치로 전달할 필요가 없다.The present invention, in particular, relates to intra prediction mode derivation, and various embodiments and application examples related to intra prediction mode derivation, encoding, and decoding according to the present invention will be described below with reference to drawings. If the intra-prediction mode derivation according to the present invention is applied, since the video encoding device and the video decoding apparatus can derive the intra-prediction mode using the same method and/or the same criterion, information for notifying the intra-prediction mode itself is transmitted to the video. There is no need to pass it to the decryption device.

<영상 복호화 장치에 의한 화면 내 예측 모드의 유도><Derivation of intra-prediction mode by video decoding device>

본 실시예에서는, 영상 복호화 장치에 의한 화면 내 예측 모드의 유도가 설명된다. 본 발명에 따른 영상 복호화 장치에 의한 화면 내 예측 모드의 유도는 이 후 줄여서 DIMD (Decoder-side Intra Mode Derivation)라 부른다. 그러나 DIMD는 영상 부호화 장치에 의해서도 동일하게 수행될 수 있다. 따라서 DIMD 라는 명칭에도 불구하고, DIMD는 영상 부호화 장치 (100) 및 영상 복호화 장치 (600) 각각에 의해 수행될 수 있다. 특히, DIMD는, 영상 부호화 장치(100)의 화면 내 예측부(102) 및 영상 복호화 장치(600)의 화면 내 예측부(607)에 의해 각각 동일하게 수행될 수 있다.In this embodiment, the derivation of the intra-prediction mode by the video decoding apparatus is explained. Derivation of the intra prediction mode by the video decoding apparatus according to the present invention is hereinafter referred to as DIMD (Decoder-side Intra Mode Derivation) for short. However, DIMD can be equally performed by an image encoding device. Therefore, despite the name of DIMD, DIMD can be performed by each of the video encoding apparatus 100 and the video decoding apparatus 600. In particular, DIMD may be equally performed by the intra-prediction unit 102 of the video encoding apparatus 100 and the intra-prediction unit 607 of the video decoding apparatus 600, respectively.

이하, 도면들을 참조하면서 본 발명에 따른 DIMD에 관한 다양한 실시예들을 설명한다.Hereinafter, various embodiments of the DIMD according to the present invention will be described with reference to the drawings.

(제1 실시예)(First embodiment)

도 7은 본 발명의 제1 실시예에 따른 DIMD를 설명하기 위한 도면이다. 본 발명의 일 실시예에 따르면, 현재 블록 주변에 위치하는, 이미 복원된 화소들을 이용하여 현재 블록의 화면 내 예측 모드를 유도할 수 있다. 7 is a diagram for explaining a DIMD according to a first embodiment of the present invention. According to an embodiment of the present invention, an intra-prediction mode of the current block may be derived using already reconstructed pixels located around the current block.

도 7을 참조하면, 부호화 또는 복호화될 현재 블록(2001)의 크기는 M x N이고, 템플릿 A(2004)의 크기는 P x N, 템플릿 B(2003)의 크기는 M x Q 이라 가정한다. 도 7에 도시된 바와 같이, 참조 화소 영역(2002)는 템플릿 A (2004)의 왼쪽에 위치한 영역과 템플릿 B(2003)의 위쪽에 위치한 영역으로 구성된다.Referring to FIG. 7 , it is assumed that the size of a current block 2001 to be encoded or decoded is M x N, the size of template A 2004 is P x N, and the size of template B 2003 is M x Q. As shown in FIG. 7, the reference pixel area 2002 is composed of an area located on the left side of template A (2004) and an area located above template B (2003).

참조 화소 영역(2002)의 크기를 나타내는 값들 중 R과 S의 값이 각각 1이라 가정하면, 참조 화소 영역(2002)은 2(Q+N) + 2(P+M) + 1 개의 참조 화소들을 포함한다.Assuming that the values of R and S among the values indicating the size of the reference pixel area 2002 are 1, the reference pixel area 2002 has 2(Q+N) + 2(P+M) + 1 reference pixels. include

본 발명의 일 실시예에 따르면, 가용한 화면 내 예측모드들 각각에 따라, 참조 화소 영역(2002) 내의 참조 화소들을 이용하여 템플릿 A (2004)와 템플릿 B(2003)의 예측값들을 산출한다. 이 때 템플릿 A (2004)와 템플릿 B(2003)는 하나의 영역으로 취급된다. 예를 들면, 도 2에 도시된 바와 같은 35가지의 화면 내 예측 모드 각각에 따라, 참조 화소 영역(2002) 내의 참조 화소들을 이용하여 템플릿 A (2004)와 템플릿 B(2003)의 예측값들을 산출한다. 각 화면 내 예측 모드에 따라 예측된 템플릿 A (2004) 및 템플릿 B(2003)와 템플릿 A (2004) 및 템플릿 B(2003)의 복원값들 간의 차이의 합에 해당하는 SAD(Sum of Absolute Difference)를 구한다. 그 후, 가장 적은 SAD(Sum of Absolute Difference)를 가지는 화면 내 예측 모드를 현재 블록(2001)의 화면 내 예측 모드로 선택할 수 있다. According to an embodiment of the present invention, prediction values of template A 2004 and template B 2003 are calculated using reference pixels in a reference pixel area 2002 according to each of available prediction modes in a screen. At this time, template A (2004) and template B (2003) are treated as one area. For example, predictive values of template A (2004) and template B (2003) are calculated using reference pixels in the reference pixel area 2002 according to each of the 35 intra-prediction modes as shown in FIG. 2. . Sum of Absolute Difference (SAD) corresponding to the sum of the differences between template A (2004) and template B (2003) predicted according to the prediction mode within each screen and the restored values of template A (2004) and template B (2003) save After that, the intra prediction mode having the smallest SAD (Sum of Absolute Difference) may be selected as the intra prediction mode of the current block 2001 .

영상 부호화 장치 (100) 또는 복호화 장치 (600)에 의해 이미 복원된 화소들을 이용하여 현재 블록(2001)의 화면 내 예측 모드를 유도하기 때문에 영상 부호화 장치 (100) 및 영상 복호화 장치 (600) 양자 모두 동일한 화면 내 예측모드를 유도할 수 있다. Since the intra-prediction mode of the current block 2001 is derived using pixels already reconstructed by the image encoding apparatus 100 or the decoding apparatus 600, both the image encoding apparatus 100 and the image decoding apparatus 600 A prediction mode within the same screen can be derived.

한편, 휘도 화소들에게 적용되었던된 화면 내 예측 모드가 색차 화소들에서도 동일하게 적용될 수 있다. 화면 내 예측 모드를 부호화 장치 (100)가 복호화 장치 (600)로 전송하지 않기 때문에 오버헤드의 부담이 없다. 따라서 각도 모드들(angular modes) 사이의 1/2위치, 1/3위치, 혹은 1/4위치에 화면 내 예측 모드를 추가하는 것 또한 가능하다. 이때 사용된 화면 내 예측 모드의 개수에 관한 정보가 다양한 방법을 이용하여 복호화 장치(600)로 전송될 수 있다. 일 예로서, 2의 지수승을 이용하여 블록 헤더 또는 블록의 상위 헤더, 예컨대 슬라이스 헤더, 픽처 헤더, 시퀀스 헤더 등을 통해 부호화되어 복호화 장치(600)로 전송될 수 있다. 또는 서로 다른 개수의 인트라 예측 모드들로 구성된 복수의 인트라 예측 모드 리스트들 중 하나를 지시하는 인덱스를 전송하는 방법을 이용하여, 가용한 화면 내 예측 모드의 개수에 관한 정보가 복호화 장치(600)로 전달될 수도 있다.Meanwhile, the intra-prediction mode applied to luminance pixels may be equally applied to chrominance pixels. Since the encoding device 100 does not transmit the intra prediction mode to the decoding device 600, there is no burden of overhead. Therefore, it is also possible to add intra-screen prediction modes to 1/2 positions, 1/3 positions, or 1/4 positions between angular modes. At this time, information about the number of prediction modes in the used screen may be transmitted to the decoding apparatus 600 using various methods. As an example, it may be encoded using a power of 2 through a block header or an upper header of a block, such as a slice header, a picture header, a sequence header, and the like, and transmitted to the decoding apparatus 600. Alternatively, by using a method of transmitting an index indicating one of a plurality of intra prediction mode lists composed of different numbers of intra prediction modes, information on the number of prediction modes available in a picture is transmitted to the decoding apparatus 600. may be conveyed.

또한, 전술한 실시예에서는, 현재 블록(2001)의 인트라 예측 모드를 유도하기 위해 템플릿 A (2004)와 템플릿 B(2003)의 두 개의 템플릿이 이용되었으나 세 개 이상의 템플릿들이 이용될 수도 있다. Also, in the above-described embodiment, two templates, template A 2004 and template B 2003, were used to derive the intra prediction mode of the current block 2001, but three or more templates may be used.

또한, 전술한 실시예에서는, 화면 내 예측 모드 전부를 템플릿 A (2004) 및/또는 템플릿 B(2003)에 적용하여 최종적인 화면 내 예측 모드를 유도하였으나, 전체 모드가 아닌 기 설정된 일부 화면 내 예측 모드 중에서 현재 블록(2001)의 최종적인 화면 내 예측 모드를 유도할 수도 있다.In addition, in the above-described embodiment, all of the intra prediction modes are applied to template A (2004) and/or template B (2003) to derive the final intra prediction mode, but some preset intra prediction modes are not included in all modes. Among the modes, a final intra-prediction mode of the current block 2001 may be derived.

(제2 실시예)(Second embodiment)

전술한 제1 실시예에서는, 두 개의 템플릿 A (2004) 및 템플릿 B(2003)를 하나의 영역으로 간주하여 설명하였다. 그러나, 본 실시예에서는, 두 개의 템플릿 A (2004) 및 템플릿 B(2003)이 별개의 영역으로 취급된다. 구체적으로, 각 템플릿을 이용하여 현재 블록의 예측 모드를 각각 유도한 후 유도된 두 개의 예측 모드들 중에서 하나의 모드를 최종적으로 선택할 수도 있다. In the above-described first embodiment, two templates A (2004) and template B (2003) are regarded as one area and described. However, in this embodiment, the two templates A (2004) and template B (2003) are treated as separate areas. Specifically, after each prediction mode of the current block is derived using each template, one mode may be finally selected from among the two derived prediction modes.

예를 들면, 도 2에 도시된 18번 각도 모드(왼쪽 위 45도 방향 화면 내 예측모드)를 기준으로, 18번 각도 모드의 왼쪽에 존재하는 각도 모드들은 템플릿 A (2004)에만 적용한 후 각각 SAD를 구한다. 모드 별로 산출된 SAD 값들 중 최소 값을 가지는 모드를 템플릿 A (2004)의 화면 내 예측모드로 결정한다. For example, based on the 18th angle mode shown in FIG. 2 (prediction mode in the screen 45 degrees from the top left), the angle modes to the left of the 18th angle mode are applied only to template A (2004) and then each SAD save Among the SAD values calculated for each mode, the mode having the minimum value is determined as the intra-prediction mode of template A (2004).

다음으로, 18번 각도 모드의 오른쪽에 존재하는 각도 모드들은 템플릿 B(2003)에만 적용 한 후 각각 SAD를 구한다. 모드 별로 산출된 SAD 값들 중 최소 값을 가지는 모드를 템플릿 B(2003)의 화면 내 예측모드로 결정한다. 그 후 결정된 템플릿 A(2004)의 화면 내 예측모드와 템플릿 B(2003)의 화면 내 예측모드 중 하나를 최종적으로 현재 블록(2001)의 예측 모드로 선택한다.Next, the angle modes existing on the right of the angle mode 18 are applied only to the template B (2003) and then each SAD is obtained. Among the SAD values calculated for each mode, a mode having the minimum value is determined as an intra-prediction mode of the template B (2003). Thereafter, one of the determined intra prediction mode of template A (2004) and template B (2003) is finally selected as the prediction mode of the current block (2001).

각 템플릿에 DC 모드와 플래너 모드를 각각 적용하여 DC 모드에 대응하는 SAD값과 플래너 모드에 대응하는 SAD 값을 구할 수 있다. 그 후, 전술한 각도 모드들 중 해당 템플릿의 화면 내 예측모드로 선택된 모드에 대응하는 SAD 값, DC 모드에 대응하는 SAD값과 플래너 모드에 대응하는 SAD 값을 상호 비교하여 각 템플릿의 최종적인 화면 내 예측모드를 선택할 수 있다.A SAD value corresponding to the DC mode and a SAD value corresponding to the planar mode may be obtained by applying the DC mode and the planar mode to each template, respectively. Then, among the above-mentioned angle modes, the SAD value corresponding to the mode selected as the prediction mode within the screen of the corresponding template, the SAD value corresponding to the DC mode, and the SAD value corresponding to the planner mode are mutually compared to obtain the final screen of each template. I can choose my prediction mode.

(제3 실시예)(Third Embodiment)

이하, 본 발명에 따른 DIMD의 제3 실시예를 설명한다. Hereinafter, a third embodiment of the DIMD according to the present invention will be described.

본 발명에 따른 제2 실시예는, 현재 블록의 템플릿들 중 일부가 가용하지 않은 경우, 가용한 나머지 템플릿을 이용하여 DIMD를 실행하는 방법에 관한 것이다. A second embodiment according to the present invention relates to a method of executing a DIMD using remaining available templates when some of the templates of a current block are not available.

도 8은 본 발명의 제3 실시예에 따른 DIMD를 설명하기 위한 도면이다. 8 is a diagram for explaining a DIMD according to a third embodiment of the present invention.

도 8에서는, 현재 블록(2101)의 상측의 템플릿은 가용하지 않고 좌측의 템플릿 A(2104)만 가용하다. In Fig. 8, the upper template of the current block 2101 is not available, and only the left template A 2104 is available.

만약 부호화 장치(100)와 복호화 장치(600)가 도 2에 예시된 바와 같이 35개의 화면 내 예측 모드를 사용하기로 하였는데, 2개의 템플릿들 중 어느 하나가 이용 불가능 하다면, 도 8에 도시된 바와 같이 범위를 정하여 하나의 템플릿(2104)에만 35개의 화면 내 예측 모드를 적용할 수 있다. 도 8에서는, 왼쪽 아래 45도 방향을 화면 내 예측 모드 2번으로 설정하고, 수평한 방향을 화면 내 예측 모드 34번으로 설정하고, 예측 모드 2번과 예측 모드 34번 사이에 각도 모드 33개가 존재하도록 설정하였다. If the encoding device 100 and the decoding device 600 decide to use 35 intra-prediction modes as illustrated in FIG. 2, but either one of the two templates is unavailable, as shown in FIG. Similarly, 35 intra-prediction modes can be applied to only one template 2104 by determining a range. In FIG. 8, the lower left 45 degree direction is set as intra-prediction mode 2, the horizontal direction is set as intra-prediction mode 34, and there are 33 angle modes between prediction mode 2 and prediction mode 34. set to do so.

전술한 바와 같이 설정된 33개의 각도 모드들, DC 모드 및 플래너 모드를 가용한 템플릿 A(2104)에 적용하여 DIMD를 수행한 후 현재 블록(2101)의 인트라 예측 모드를 유도할 수 있다. After DIMD is performed by applying the 33 angular modes, the DC mode, and the planner mode set as described above to the available template A 2104, the intra prediction mode of the current block 2101 can be derived.

현재 블록(2101)이 입력 영상의 상측 경계에 해당하여, 템플릿 A(2104)의 좌측의 참조 화소들(2105)들은 가용하지만 템플릿 A(2104)의 상측의 참조 화소들이 존재하지 않는 경우, 적절한 주변 화소들을 이용한 패딩을 통해 상측의 참조 화소들(2102)을 생성할 수 있다. 패딩에 이용되는 주변 화소들은 현재 블록(2101) 및/또는 템플릿 A(2104)의 상측 화소들, 또는 템플릿 A(2104)의 좌측의 참조 화소들(2105)들이 될 수 있다.When the current block 2101 corresponds to the upper boundary of the input image and the reference pixels 2105 on the left side of the template A 2104 are available, but the upper reference pixels on the template A 2104 do not exist, an appropriate periphery The upper reference pixels 2102 may be generated through padding using pixels. The neighboring pixels used for padding may be pixels above the current block 2101 and/or template A 2104 , or reference pixels 2105 on the left side of template A 2104 .

(제4 실시예)(Fourth embodiment)

도 9는 본 발명에 따른 DIMD를 설명하기 위한 순서도이다. 전술한 제1 실시예 내지 제3 실시예와 관련된다. 도 9에 도시된 방법은, 영상 부호화 장치(100)의 화면 내 예측부(102) 및 영상 복호화 장치(600)의 화면 내 예측부(607)에 의해 각각 동일하게 수행될 수 있다.9 is a flowchart illustrating a DIMD according to the present invention. It is related to the above-described first to third embodiments. The method shown in FIG. 9 may be equally performed by the intra-prediction unit 102 of the video encoding apparatus 100 and the intra-prediction unit 607 of the video decoding apparatus 600, respectively.

도 9를 참조하면, 먼저, 이미 복원된, 적어도 하나의 화소 영역의 참조 화소 영역에 기초하여 상기 복원된 화소 영역의 인트라 예측 모드가 유도된다 (S2201). 여기서, 적어도 하나의 화소 영역은 전술한 실시예들에서 템플릿 A (2004, 2104) 및/또는 템플릿 B(2003)이 될 수 있다. 그러나 이들 템플릿에 한정되지 않음은 물론이다. 참조 화소 영역은 전술한 실시예들에서 설명된 참조 화소 영역(2002, 2102, 2105)에 해당될 수 있다. 그러나 이들 참조 화소 영역에 한정되지 않음은 물론이다.Referring to FIG. 9 , first, an intra prediction mode of a reconstructed pixel area is derived based on a previously reconstructed reference pixel area of at least one pixel area (S2201). Here, at least one pixel area may be template A (2004, 2104) and/or template B (2003) in the above-described embodiments. However, it goes without saying that it is not limited to these templates. The reference pixel area may correspond to the reference pixel areas 2002, 2102, and 2105 described in the foregoing embodiments. However, it goes without saying that it is not limited to these reference pixel regions.

다음으로, S2201단계에서 유도된 상기 복원된 화소 영역의 인트라 예측 모드에 기초하여, 상기 현재 블록의 인트라 예측 모드가 유도된다 (S2203). 상기 유도된 인트라 예측 모드를 이용하여 현재 블록의 인트라 예측 블록을 얻은 후 (S2205), 상기 얻은 인트라 예측 블록과 현재 블록의 잔차 블록을 가산함으로써 현재 블록이 복원된다 (S2207).Next, an intra prediction mode of the current block is derived based on the intra prediction mode of the reconstructed pixel area derived in step S2201 (S2203). After obtaining an intra-prediction block of the current block using the derived intra-prediction mode (S2205), the current block is reconstructed by adding the obtained intra-prediction block and the residual block of the current block (S2207).

(제5 실시예)(Fifth embodiment)

도 10은 본 발명에 따른 DIMD를 이용하여 영상을 부호화하는 경우, 화면 내 예측 모드를 부호화하는 방법을 설명하기 위한 순서도이다. 10 is a flowchart illustrating a method of encoding an intra-prediction mode when encoding an image using a DIMD according to the present invention.

먼저, 본 발명에 따른 DIMD의 수행 여부를 알려주는 정보를 부호화 한다(S2501). 이 정보는 화면 내 예측 모드의 유도 방법을 영상 복호화 장치(600)에 알리는 정보이다. 즉, 본 발명에 따른 DIMD를 이용하여 화면 내 예측 모드가 유도되는지 아니면 다른 방법을 이용하여 화면 내 예측 모드가 유도되는지 여부를 시그널링한다. First, information indicating whether DIMD is performed according to the present invention is encoded (S2501). This information informs the video decoding apparatus 600 of a method of deriving an intra-prediction mode. That is, it is signaled whether the intra prediction mode is derived using the DIMD according to the present invention or whether the intra prediction mode is derived using another method.

본 발명에 따른 DIMD가 사용 되었는지 여부를 판단한 후(S2502), 만약 사용 되었다면 본 프로세스는 종료되고, 현재 블록의 인트라 예측 모드는 DIMD에 의해 유도된다.After determining whether the DIMD according to the present invention has been used (S2502), if it has been used, this process ends, and the intra prediction mode of the current block is induced by the DIMD.

그러나, 본 발명에 따른 DIMD가 사용되지 않았다면 MPM(Most Probable Mode) 적용 여부가 부호화된다(S2503). 본 발명에 따른 DIMD를 이용한 화면 내 예측 모드 유도 외의 다른 방법으로서 MPM이 사용될 수 있다. However, if the DIMD according to the present invention is not used, whether MPM (Most Probable Mode) is applied is encoded (S2503). MPM may be used as a method other than deriving intra-prediction mode using DIMD according to the present invention.

현재 블록의 인트라 예측 모드가 MPM 리스트(most probable mode list)에 속하는지 여부를 나타내는 MPM 플래그 및 MPM 인덱스 정보가 추가로 복호화 장치(600)로 전달된다. 상기 MPM 리스트 내에 포함되는 인트라 예측 모드의 개수는 전체 인트라 예측 모드의 개수에 비해 매우 적다. 따라서, 현재 블록의 인트라 예측 모드가 MPM 리스트(most probable mode list)에 속한다면 매우 적은 비트를 이용하여 복호화 장치(600)로 시그널링하는 것이 가능하다. MPM 인덱스 정보는 현재 블록의 인트라 예측 모드가 MPM 리스트(most probable mode list)에 속하는 모드들 중 어떤 모드에 해당하는지 여부를 나타낸다.An MPM flag indicating whether the intra prediction mode of the current block belongs to a most probable mode list (MPM list) and MPM index information are additionally transferred to the decoding apparatus 600 . The number of intra prediction modes included in the MPM list is very small compared to the total number of intra prediction modes. Accordingly, if the intra prediction mode of the current block belongs to the most probable mode list (MPM list), it is possible to signal to the decoding apparatus 600 using very few bits. The MPM index information indicates whether an intra prediction mode of a current block corresponds to which mode among modes belonging to a most probable mode list (MPM list).

상기 MPM 플래그가 1이면, 현재 블록의 인트라 예측 모드가 MPM 리스트에 속하고, 상기 플래그가 0이면, 현재 블록의 인트라 예측 모드가 잔여 모드 그룹(residual mode group)에 속한다. 상기 잔여 모드 그룹은 상기 MPM 리스트에 속하는 인트라 예측 모드들 이외의 모든 인트라 예측 모드들을 포함할 수 있다. S2503 단계에서, MPM(Most Probable Mode) 적용 여부의 부호화는 상기 MPM 플래그를 부호화함으로써 수행된다.If the MPM flag is 1, the intra prediction mode of the current block belongs to the MPM list, and if the flag is 0, the intra prediction mode of the current block belongs to the residual mode group. The residual mode group may include all intra prediction modes other than intra prediction modes belonging to the MPM list. In step S2503, whether or not MPM (Most Probable Mode) is applied is encoded by encoding the MPM flag.

다시 도 10을 참조하면, MPM이 사용되었는지 여부를 확인한 후(S2504), 사용되지 않았다면 MPM 후보를 제외한 나머지 모드를 재 정렬한 후 현재 블록의 인트라 예측 모드를 부호화(S2505)한다. 만약, MPM이 사용되었다면 어떤 인트라 예측 모드 후보가 적용되었는지를 알려주는 MPM 인덱스를 부호화 (S2506)한 후 종료한다.Referring back to FIG. 10 , after checking whether MPM is used (S2504), if it is not used, the remaining modes except for the MPM candidate are rearranged, and then the intra prediction mode of the current block is encoded (S2505). If MPM is used, the process ends after encoding the MPM index indicating which intra prediction mode candidate is applied (S2506).

(제6 실시예)(Example 6)

도 11은 본 발명에 따른 DIMD를 이용하여 영상을 복호화하는 경우, 화면 내 예측 모드를 복호화하는 방법을 설명하기 위한 순서도이다. 11 is a flowchart for explaining a method of decoding an intra prediction mode when decoding an image using a DIMD according to the present invention.

먼저, 본 발명에 따른 DIMD의 수행 여부를 알려주는 정보를 복호화 한다(S2601). 이 정보는, 본 발명에 따른 DIMD를 이용하여 화면 내 예측 모드가 유도되는지 아니면 다른 방법을 이용하여 화면 내 예측 모드가 유도되는지 여부를 지시한다. First, information indicating whether DIMD is performed according to the present invention is decoded (S2601). This information indicates whether the intra-prediction mode is derived using the DIMD according to the present invention or the intra-prediction mode is derived using another method.

본 발명에 따른 DIMD가 사용 되었는지 여부를 판단한 후(S2602), 만약 DIMD가 사용되었다면 본 프로세스는 종료되고, 현재 블록의 인트라 예측 모드는 DIMD에 의해 유도된다.After determining whether the DIMD according to the present invention is used (S2602), if the DIMD is used, this process ends, and the intra prediction mode of the current block is induced by the DIMD.

그러나, 본 발명에 따른 DIMD가 사용되지 않았다면 MPM(Most Probable Mode) 적용 여부가 복호화된다(S2603). S2603 단계에서는, MPM 플래그가 복호될 수 있다.However, if the DIMD according to the present invention is not used, whether MPM (Most Probable Mode) is applied is decoded (S2603). In step S2603, the MPM flag may be decoded.

상기 MPM 플래그가 1이면, 현재 블록의 인트라 예측 모드가 MPM 리스트에 속하고, 상기 플래그가 0이면, 현재 블록의 인트라 예측 모드가 잔여 모드 그룹(residual mode group)에 속한다. 상기 잔여 모드 그룹은 상기 MPM 리스트에 속하는 인트라 예측 모드들 이외의 모든 인트라 예측 모드들을 포함할 수 있다. If the MPM flag is 1, the intra prediction mode of the current block belongs to the MPM list, and if the flag is 0, the intra prediction mode of the current block belongs to the residual mode group. The residual mode group may include all intra prediction modes other than intra prediction modes belonging to the MPM list.

다음으로, MPM이 사용되었는지 여부를 확인한 후(S2604), 사용되지 않았다면 MPM 후보를 제외한 나머지 모드를 재 정렬한 후 현재 블록의 인트라 예측 모드를 복호화(S2505)한다. 만약, MPM이 사용되었다면, 어떤 인트라 예측 모드 후보가 적용되었는지를 알려주는 MPM 인덱스를 복호화 (S2506)한 후 종료한다.Next, after checking whether MPM is used (S2604), if it is not used, the remaining modes except for the MPM candidate are rearranged and the intra prediction mode of the current block is decoded (S2505). If MPM is used, the MPM index indicating which intra prediction mode candidate is applied is decoded (S2506) and then the process ends.

(제7 실시예)(Seventh embodiment)

도 12는 본 발명에 따른 제7 실시예를 설명하기 위한 도면이다. 본 발명의 제7 실시예는, 템플릿에 다수의 참조 화소 라인들을 이용하여 인트라 예측 모드를 유도하는 방법에 관한 것이다.12 is a diagram for explaining a seventh embodiment according to the present invention. A seventh embodiment of the present invention relates to a method of inducing an intra prediction mode by using a plurality of reference pixel lines in a template.

도 12에 도시한 바와 같이, 템플릿의 참조 화소 라인으로서 참조 화소 라인 1과 참조 화소 라인 2의 2개 라인이 이용된다고 가정한다. 템플릿의 길이인 P와 Q는 각각 1이라고 가정하고 설명한다. As shown in FIG. 12, it is assumed that two lines, reference pixel line 1 and reference pixel line 2, are used as reference pixel lines of the template. It is assumed that the lengths of the template, P and Q, are 1, respectively.

왼쪽 위 45도 방향 모드의 오른쪽에 존재하는 각도 모드들을 위측 각도 모드라 정의하고 템플릿 B와 그 위쪽의 참조 화소 라인들을 사용한다. 또한 왼쪽 위 45도 방향 모드를 기준으로 왼쪽에 존재하는 각도 모드들을 좌측 각도 모드라 정의하고 템플릿 A와 그 왼쪽의 참조 화소 라인들을 사용한다. 그 후 화면 내 예측 모드에 따라 도 12에 도시한 바와 같이 참조 화소 라인별로 예측을 수행해본다. 예를 들어 템플릿의 참조 화소라인 2를 이용하여 템플릿의 참조 화소라인 1를 예측하고, 최적의 화면 내 예측 모드 후보 1을 생성한다. 그 후, 템플릿의 참조 화소라인 1를 이용하여 템플릿을 예측하고 최적의 화면 내 예측 모드 후보 2를 생성한다. 만약 화면 내 예측 모드 후보 1과 2가 동일하다면 그 예측 모드를 현재 블록의 화면 내 예측 모드로 선택한다. 만약 다르다면, 전술한, 본 발명의 다양한 실시예들에 따른 DIMD 방법 중 하나를 수행할지 여부를 결정한다. Angular modes existing to the right of the upper left 45-degree direction mode are defined as upper angle modes, and template B and reference pixel lines above it are used. In addition, angular modes existing on the left side of the 45 degree upper left direction mode are defined as left angular modes, and template A and reference pixel lines to the left thereof are used. Then, prediction is performed for each reference pixel line as shown in FIG. 12 according to the intra-prediction mode. For example, the reference pixel line 1 of the template is predicted using the reference pixel line 2 of the template, and an optimal intra-prediction mode candidate 1 is generated. After that, the template is predicted using the reference pixel line 1 of the template, and an optimal intra-prediction mode candidate 2 is generated. If intra prediction mode candidates 1 and 2 are the same, the prediction mode is selected as the intra prediction mode of the current block. If different, it is determined whether to perform one of the aforementioned DIMD methods according to various embodiments of the present invention.

도 13은 본 발명의 제7 실시예를 적용한 경우, 인트라 예측 모드를 부호화 하는 과정을 나타낸 순서도이다. 13 is a flowchart illustrating a process of encoding an intra prediction mode when the seventh embodiment of the present invention is applied.

먼저, 템플릿의 참조 화소 라인을 이용하여 화면 내 예측 모드 후보들을 유도한다(S2801). 그 후, 화면 내 예측 모드 후보들이 동일한지 여부를 판단한 후(S2802), 동일 하다면 그 동일한 모드가 현재 블록의 화면 내 예측 모드로 선택되기 때문에 순서도가 종료된다. 만약, 화면 내 예측 모드 후보들이 동일하지 않다면 본 발명에 따른 DIMD를 수행할지 여부가 부호화된다(S2803). First, intra-prediction mode candidates are derived using the reference pixel line of the template (S2801). Then, after determining whether the intra prediction mode candidates are the same (S2802), if they are the same, the sequence diagram ends because the same mode is selected as the intra prediction mode of the current block. If the intra-prediction mode candidates are not the same, whether to perform DIMD according to the present invention is encoded (S2803).

이 후 단계들인 S2804 S2808은 도 10에 도시된 S2502 내지 S2506과 실질적으로 동일하므로 상세한 설명은 생략한다. Subsequent steps S2804 and S2808 are substantially the same as S2502 to S2506 shown in FIG. 10, so detailed descriptions thereof are omitted.

도 14는 본 발명의 제7 실시예를 적용한 경우, 인트라 예측 모드를 복호화 하는 과정을 나타낸 순서도이다. 도 14에 도시된 각 과정은 영상 복호화 장치(600)에 의해 수행된다는 점 외에는 도 13에 도시된 각 단계들과 실질적으로 동일하므로 상세한 설명은 생략한다.14 is a flowchart illustrating a process of decoding an intra prediction mode when the seventh embodiment of the present invention is applied. Each process shown in FIG. 14 is substantially the same as each process shown in FIG. 13 except that it is performed by the video decoding apparatus 600, and thus detailed descriptions thereof are omitted.

<DIMD의 변형예: 템플릿 인덱스의 전송><DIMD Modification Example: Transfer of Template Index>

전술한 다양한 실시예들에 따른 DIMD를 사용할 경우, 인트라 예측 모드 자체를 시그널링하지는 않는다. 그러나, 본 실시예에서는 복수의 템플릿을 이용하여 각각 후보 인트라 예측 모드를 유도한 후 이 중 어느 모드가 사용되는지를 나타내는 인덱스 정보가 부호화 장치(100)에 의해 복호화 장치(600)로 전송된다. 도 15a 및 도 15b는 템플릿 인덱스를 전송하는 DIMD의 변형예를 설명하기 위한 도면으로서, 본 발명의 DIMD를 이용하여 두 개의 템플릿을 이용하여 각각 인트라 예측 모드 후보를 생성한 후 인덱스를 이용하여 지정하는 방식에 대한 예시이다. 도 15a 또는 도 15b에 도시된 템플릿의 참조 화소 영역의 크기를 나타내는 R과 S는 설명의 편의성을 위해 1이라고 가정하고 설명한다. When using the DIMD according to various embodiments described above, the intra prediction mode itself is not signaled. However, in this embodiment, after each candidate intra prediction mode is derived using a plurality of templates, index information indicating which mode is used is transmitted from the encoding apparatus 100 to the decoding apparatus 600. 15A and 15B are diagrams for explaining a modified example of a DIMD that transmits a template index, wherein an intra prediction mode candidate is generated using two templates using the DIMD of the present invention and designated using an index. This is an example of how It is assumed that R and S representing the size of the reference pixel region of the template shown in FIG. 15A or 15B are 1 for convenience of explanation.

도 15a에서는, 템플릿 A(3102)에 템플릿의 참조 화소 영역(3103)내의 화소들을 이용하여 화면 내 예측 모드 후보 1을 유도한다. 도 15b에서는, 템플릿 B(3104)에 템플릿의 참조 화소 영역(3105)내의 화소들을 이용하여 화면 내 예측 모드 후보 2을 유도한다. 다음으로, 어떤 템플릿에서 유도한 화면 내 예측 모드 후보가 현재 블록(3101)의 화면 내 예측 모드인지를 나타내는 인덱스를 부호화 하여 복호화 장치(600)로 전송된다. In FIG. 15A, the intra prediction mode candidate 1 is derived using the pixels in the reference pixel area 3103 of the template A 3102. In FIG. 15B, the intra prediction mode candidate 2 is derived using the pixels in the reference pixel area 3105 of the template B 3104. Next, an index indicating whether an intra-prediction mode candidate derived from a template is an intra-prediction mode of the current block 3101 is encoded and transmitted to the decoding apparatus 600.

한편, 템플릿을 포함하고 있는 블록이 어떤 화면 내 예측 모드로 부호화 되었는지 여부가 본 실시예에 이용될 수 있다. 예를 들면, 도 15a 및 도 15b에서, 템플릿 A(3102)를 포함하고 있는 블록의 화면 내 예측 모드를 화면 내 예측모드 A라 할 때, 화면 내 예측모드 A와 템플릿의 참조 화소들을 이용하여 템플릿 A(3102)에 적용하여 결정된 화면 내 예측 모드가 동일하면 높거나 낮은 우선순위를 부여할 수 있다. 그 우선순위에 따라 인덱스 설정을 위한 후보들 배치시에 비트를 할당 하는 것 또한 가능하다. 마찬가지로, 템플릿 A (3102)외에 다수의 템플릿이 존재하는 경우 위 조건을 이용하여 비트 할당 시, 우선순위를 설정하는 것 또한 가능하다.Meanwhile, whether a block including a template is coded in which intra-prediction mode can be used in this embodiment. For example, in FIGS. 15A and 15B , when the intra-prediction mode of a block including the template A 3102 is referred to as intra-prediction mode A, a template is used by using the intra-prediction mode A and the reference pixels of the template. If the intra-prediction mode determined by application to A 3102 is the same, a higher or lower priority may be assigned. It is also possible to allocate bits when arranging candidates for index setting according to their priorities. Similarly, when there are multiple templates other than the template A 3102, it is also possible to set priorities when allocating bits using the above condition.

도 16은 템플릿 인덱스가 사용되는 DIMD에 따른 화면 내 예측 모드의 부호화 방법을 설명하는 순서도이다. 16 is a flowchart illustrating an encoding method of an intra prediction mode according to a DIMD in which a template index is used.

먼저, 템플릿 인덱스가 사용되는 DIMD의 수행여부를 알려주는 정보가 부호된다(S3301). 템플릿 인덱스가 사용되는 DIMD가 수행 되었는지 여부를 판단한 후(S3302), 만약 수행되었다면 템플릿 인덱스를 부호화 하고 종료한다(S3307). 만약 템플릿 인덱스가 사용되는 DIMD가 수행되지 않았다면 MPM(Most Probable Mode) 적용 여부를 부호화한다(S3303). MPM이 적용되었는지 여부를 확인한 후(S3304), 적용되지 않았다면 MPM 후보를 제외한 나머지 모드를 재 정렬 후 부호화를 수행하고(S3305) MPM이 적용되었다면 어떤 후보가 적용되었는지를 알려주는 MPM 인덱스를 부호화하고(S3306) 종료한다.First, information indicating whether the DIMD using the template index is performed is coded (S3301). After determining whether the DIMD using the template index has been performed (S3302), if it has been performed, the template index is encoded and terminated (S3307). If the DIMD in which the template index is used is not performed, whether or not MPM (Most Probable Mode) is applied is encoded (S3303). After checking whether MPM is applied (S3304), if it is not applied, encoding is performed after rearranging the remaining modes except for MPM candidates (S3305), and if MPM is applied, encoding the MPM index indicating which candidate is applied ( S3306) ends.

도 17은 템플릿 인덱스가 사용되는 DIMD에 따른 화면 내 예측 모드의 부호화 방법을 설명하는 순서도이다. 도 17에 도시된 각 과정은 영상 복호화 장치(600)에 의해 수행된다는 점 외에는 도 16에 도시된 각 단계들과 실질적으로 동일하므로 상세한 설명은 생략한다.17 is a flowchart illustrating an encoding method of an intra prediction mode according to a DIMD in which a template index is used. Each process shown in FIG. 17 is substantially the same as each step shown in FIG. 16 except that it is performed by the video decoding apparatus 600, and thus detailed descriptions thereof are omitted.

한편, 도 15a 및 도 15b는 주변 2개의 템플릿들을 예시로 들었지만 3개 이상의 템플릿들을 이용하는 것 또한 가능하다.Meanwhile, although FIGS. 15A and 15B show two templates as an example, it is also possible to use three or more templates.

<DIMD의 응용예: MPM 리스트 생성><DIMD application example: MPM list generation>

앞에서는, 본 발명에 따른 DIMD를 사용할 경우, 인트라 예측 모드 자체를 복호화 장치(600)로 시그널링하지 않거나 또는 복수의 템플릿들 중 어떤 템플릿을 이용하여 유도된 인트라 예측 모드 후보가 현재 블록의 인트라 예측 모드로 선택되었는지를 나타내는 템플릿 인덱스 정보가 부호화 장치(100)에 의해 복호화 장치(600)로 전송되었다. In the above, when the DIMD according to the present invention is used, the intra prediction mode itself is not signaled to the decoding apparatus 600 or the intra prediction mode candidate derived using a certain template among a plurality of templates is the intra prediction mode of the current block. Template index information indicating whether is selected is transmitted to the decoding device 600 by the encoding device 100.

이하에서는, DIMD에 따라 유도된 화면 내 예측모드를 사용하여 MPM(Most Probable Mode) 후보를 재정렬하거나 MPM 리스트를 생성하는 실시예를 설명한다. Hereinafter, an embodiment of rearranging MPM (Most Probable Mode) candidates or generating an MPM list using the intra-prediction mode derived according to the DIMD will be described.

화면 내 예측 모드의 예측을 위해 MPM 후보를 생성한 후, 템플릿을 이용하여 유도한 화면 내 예측 모드와 유사한 순으로 MPM 후보를 상위에 배치하는 것 또한 가능하다.After generating MPM candidates for intra prediction mode prediction, it is also possible to place the MPM candidates at the top in a similar order to the intra prediction modes derived using the template.

(제1 실시예)(First embodiment)

도 18은 템플릿을 이용하여 유도된 화면 내 예측 모드를 MPM 후보로 설정하는 일 예를 설명하기 위한 도면이다. 18 is a diagram for explaining an example of setting an intra prediction mode derived using a template as an MPM candidate.

현재 블록(3501) 주변에 복원된 블록 A(3503)와 블록 B(3505)가 존재한다고 가정하고, 블록 A(3503)는 화면 내 예측, 블록 B(3505)는 화면 간 예측이 사용 되었다고 가정한다. 블록 B(3505)는 화면 간 예측이 사용되어 화면 내 예측 모드가 존재하지 않기 때문에, 본 실시예에서는 템플릿을 이용하여 블록 B(3505)의 화면 내 예측 모드를 생성한다. 템플릿을 이용하여 블록 B(3505)의 화면 내 예측 모드를 유도하는 것은 도 15b 및 도 15b와 관련된 앞선 설명들을 참고한다. 한편, 도 15b의 템플릿 B(3104)를 이용하여 템플릿 B(3104)의 화면 내 예측 모드를 유도할 때, 화면 내 예측 모드를 부호화하는 방식, 인트라 예측 모드의 개수와 예측 각도들은 영상 부호화 장치 (100) 또는 영상 복호화 장치(600)에 의해 기 설정된 것들과 동일해야 한다. It is assumed that reconstructed block A 3503 and block B 3505 exist around the current block 3501, block A 3503 uses intra prediction, and block B 3505 uses inter prediction. . Since the block B 3505 uses inter prediction and does not have an intra prediction mode, in this embodiment, the intra prediction mode of the block B 3505 is generated using a template. Deriving the intra-prediction mode of the block B 3505 using the template refers to the previous descriptions related to FIGS. 15B and 15B. Meanwhile, when deriving the intra prediction mode of the template B 3104 using the template B 3104 of FIG. 100) or those previously set by the video decoding apparatus 600.

(제2 실시예)(Second embodiment)

본 실시예에서는 템플릿을 포함하고 있는 블록이 어떤 화면 내 예측 모드로 부호화 되었는지를 이용하여 MPM의 후보를 설정한다. In this embodiment, MPM candidates are set using which intra-prediction mode a block including a template is coded in.

도 19는 본 발명의 일 실시예에 따른 MPM 후보 설정을 설명하기 위한 도면이다. 도 19를 참조하면, 현재 블록(3701)의 왼쪽 블록(3703)의 화면 내 예측 모드를 10번 모드라 가정하고, 왼쪽 블록(3703)의 일부분에 해당하는 템플릿 A(3705)에 템플릿의 참조 화소들(도시되지 않음)을 이용하여 유도한 화면 내 예측 모드가 12번 모드라 가정한다. 마찬가지로 현재 블록(3701)의 위쪽 블록(3707)의 화면 내 예측 모드는 28번이라 가정하고, 위쪽 블록(3707)의 일부분인 템플릿 B(3709)에 템플릿의 참조 화소들(도시되지 않음)을 이용하여 유도한 화면 내 예측 모드가 28번이라 가정한다. 왼쪽 블록(3703)의 경우, 왼쪽 블록(3703) 전체를 고려하면 10번 모드가 부호화에 유리하지만 현재 블록(3701)과 인접한 템플릿 A(3705)에서는 12번 모드가 설정 되었으므로 현재 블록의 예측 모드는 10번 모드보다는 12번 모드가 더 적절하다고 가정할 수 있다. 이러한 경우, MPM의 후보 설정시에 왼쪽 블록(3703)의 화면 내 예측모드보다는 템플릿 A(3705)에서 유도된 화면 내 예측모드를 이용하여 MPM 후보를 생성할 수 있다. 19 is a diagram for explaining MPM candidate setting according to an embodiment of the present invention. Referring to FIG. 19 , assuming that the intra-prediction mode of a left block 3703 of a current block 3701 is mode 10, template A 3705 corresponding to a part of the left block 3703 is a reference pixel of the template. It is assumed that the intra-prediction mode derived using s (not shown) is the 12th mode. Similarly, it is assumed that the intra-prediction mode of the block 3707 above the current block 3701 is 28, and reference pixels (not shown) of the template are used for the template B 3709, which is a part of the block 3707 above the current block 3701. Assume that the intra-prediction mode derived by doing this is number 28. In the case of the left block (3703), considering the entire left block (3703), mode 10 is advantageous for encoding, but mode 12 is set in template A (3705) adjacent to the current block (3701), so the prediction mode of the current block is It can be assumed that mode 12 is more appropriate than mode 10. In this case, when setting the MPM candidate, the MPM candidate can be generated using the intra prediction mode derived from the template A 3705 rather than the intra prediction mode of the left block 3703.

위쪽 블록(3707)의 경우 위쪽 블록(3707)의 화면 내 예측모드와 템플릿 B(3709)를 통해 유도된 화면 내 예측모드가 동일하므로 그 동일한 모드가 MPM 후보로 사용된다. In the case of the upper block 3707, since the intra-prediction mode of the upper block 3707 and the intra-prediction mode derived through the template B 3709 are the same, the same mode is used as the MPM candidate.

다른 대안으로서, 왼쪽 블록(3703)의 화면 내 예측모드, 템플릿A(3705)에서 유도된 화면 내 예측모드, 위쪽 블록(3707)의 화면 내 예측모드, 템플릿B(3709)에서 유도된 화면 내 예측모드의 4가지 모드를 이용하여 MPM의 후보 설정을 하는 것 또한 가능하다. 이때, 템플릿을 이용하여 유도한 화면 내 예측 모드가 현재 블록에 더욱 가깝기 때문에, 템플릿을 이용하여 유도한 화면 내 예측 모드를 MPM 후보 설정시에 높은 우선순위를 부과하여 비트를 적게 할당하는 것 또한 가능하다. Alternatively, the intra-prediction mode of the left block 3703, the intra-prediction mode derived from template A 3705, the intra-prediction mode derived from the upper block 3707, and the intra-prediction derived from template B 3709 It is also possible to set MPM candidates using the four modes. At this time, since the intra-prediction mode derived using the template is closer to the current block, it is also possible to allocate fewer bits by giving the intra-prediction mode derived using the template a higher priority when setting the MPM candidate. do.

본 개시의 예시적인 방법들은 설명의 명확성을 위해서 동작의 시리즈로 표현되어 있지만, 이는 단계가 수행되는 순서를 제한하기 위한 것은 아니며, 필요한 경우에는 각각의 단계가 동시에 또는 상이한 순서로 수행될 수도 있다. 본 개시에 따른 방법을 구현하기 위해서, 예시하는 단계에 추가적으로 다른 단계를 포함하거나, 일부의 단계를 제외하고 나머지 단계를 포함하거나, 또는 일부의 단계를 제외하고 추가적인 다른 단계를 포함할 수도 있다.Exemplary methods of this disclosure are presented as a series of operations for clarity of explanation, but this is not intended to limit the order in which steps are performed, and each step may be performed concurrently or in a different order, if desired. In order to implement the method according to the present disclosure, other steps may be included in addition to the exemplified steps, other steps may be included except for some steps, or additional other steps may be included except for some steps.

본 개시의 다양한 실시 예는 모든 가능한 조합을 나열한 것이 아니고 본 개시의 대표적인 양상을 설명하기 위한 것이며, 다양한 실시 예에서 설명하는 사항들은 독립적으로 적용되거나 또는 둘 이상의 조합으로 적용될 수도 있다.Various embodiments of the present disclosure are intended to explain representative aspects of the present disclosure, rather than listing all possible combinations, and matters described in various embodiments may be applied independently or in combination of two or more.

또한, 본 개시의 다양한 실시 예는 하드웨어, 펌웨어(firmware), 소프트웨어, 또는 그들의 결합 등에 의해 구현될 수 있다. 하드웨어에 의한 구현의 경우, 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 범용 프로세서(general processor), 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다. In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. For hardware implementation, one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), It may be implemented by a processor (general processor), controller, microcontroller, microprocessor, or the like.

본 개시의 범위는 다양한 실시 예의 방법에 따른 동작이 장치 또는 컴퓨터 상에서 실행되도록 하는 소프트웨어 또는 머신-실행가능한 명령들(예를 들어, 운영체제, 애플리케이션, 펌웨어(firmware), 프로그램 등), 및 이러한 소프트웨어 또는 명령 등이 저장되어 장치 또는 컴퓨터 상에서 실행 가능한 비-일시적 컴퓨터-판독가능 매체(non-transitory computer-readable medium)를 포함한다.The scope of the present disclosure is software or machine-executable instructions (eg, operating systems, applications, firmware, programs, etc.) that cause operations according to methods of various embodiments to be executed on a device or computer, and such software or It includes a non-transitory computer-readable medium in which instructions and the like are stored and executable on a device or computer.

Claims (3)

영상 복호화 방법에 있어서,
현재 블록에 대한 인트라 예측 모드를 설정하는 단계;
상기 설정된 인트라 예측 모드를 재설정하는 단계;
상기 재설정된 인트라 예측 모드에 기반하여, 상기 현재 블록의 인트라 예측 모드를 결정하는 단계; 및
상기 결정된 인트라 예측 모드에 기반하여, 상기 현재 블록에 대해 인트라 예측을 수행하는 단계를 포함하고,
상기 인트라 예측 모드의 재설정은 소정의 방향성 모드 범위 내에서 수행되는
영상 복호화 방법.
In the video decoding method,
setting an intra prediction mode for a current block;
resetting the set intra prediction mode;
determining an intra prediction mode of the current block based on the reset intra prediction mode; and
performing intra prediction on the current block based on the determined intra prediction mode;
Resetting the intra prediction mode is performed within a predetermined directional mode range.
Video decoding method.
영상 부호화 방법에 있어서,
현재 블록에 대한 인트라 예측 모드를 설정하는 단계;
상기 설정된 인트라 예측 모드를 재설정하는 단계; 및
상기 재설정된 인트라 예측 모드에 기반하여, 상기 현재 블록의 인트라 예측 모드를 결정하는 단계; 및
상기 결정된 인트라 예측 모드에 기반하여, 상기 현재 블록에 대해 인트라 예측을 수행하는 단계를 포함하고,
상기 인트라 예측 모드의 재설정은 소정의 방향성 모드 범위 내에서 수행되는
영상 부호화 방법.
In the video encoding method,
setting an intra prediction mode for a current block;
resetting the set intra prediction mode; and
determining an intra prediction mode of the current block based on the reset intra prediction mode; and
performing intra prediction on the current block based on the determined intra prediction mode;
Resetting the intra prediction mode is performed within a predetermined directional mode range.
Video encoding method.
영상 부호화 방법에 의해 생성된 비트스트림을 저장한 컴퓨터 판독가능한 기록 매체에 있어서, 상기 영상 부호화 방법은,
현재 블록에 대한 인트라 예측 모드를 설정하는 단계;
상기 설정된 인트라 예측 모드를 재설정하는 단계;
상기 재설정된 인트라 예측 모드에 기반하여, 상기 현재 블록의 인트라 예측 모드를 결정하는 단계; 및
상기 결정된 인트라 예측 모드에 기반하여, 상기 현재 블록에 대해 인트라 예측을 수행하는 단계를 포함하고,
상기 인트라 예측 모드의 재설정은 소정의 방향성 모드 범위 내에서 수행되는
컴퓨터 판독가능한 기록 매체.
A computer-readable recording medium storing a bitstream generated by an image encoding method, the image encoding method comprising:
setting an intra prediction mode for a current block;
resetting the set intra prediction mode;
determining an intra prediction mode of the current block based on the reset intra prediction mode; and
performing intra prediction on the current block based on the determined intra prediction mode;
Resetting the intra prediction mode is performed within a predetermined directional mode range.
A computer-readable recording medium.
KR1020220010851A 2016-10-14 2022-01-25 Method and apparatus for encoding/decoding an image KR102502216B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020230020808A KR20230025851A (en) 2016-10-14 2023-02-16 Method and apparatus for encoding/decoding an image

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
KR20160133755 2016-10-14
KR1020160133755 2016-10-14
KR1020170127940A KR102357283B1 (en) 2016-10-14 2017-09-29 Method and apparatus for encoding/decoding an image

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020170127940A Division KR102357283B1 (en) 2016-10-14 2017-09-29 Method and apparatus for encoding/decoding an image

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020230020808A Division KR20230025851A (en) 2016-10-14 2023-02-16 Method and apparatus for encoding/decoding an image

Publications (2)

Publication Number Publication Date
KR20220016938A KR20220016938A (en) 2022-02-10
KR102502216B1 true KR102502216B1 (en) 2023-02-21

Family

ID=62084995

Family Applications (3)

Application Number Title Priority Date Filing Date
KR1020170127940A KR102357283B1 (en) 2016-10-14 2017-09-29 Method and apparatus for encoding/decoding an image
KR1020220010851A KR102502216B1 (en) 2016-10-14 2022-01-25 Method and apparatus for encoding/decoding an image
KR1020230020808A KR20230025851A (en) 2016-10-14 2023-02-16 Method and apparatus for encoding/decoding an image

Family Applications Before (1)

Application Number Title Priority Date Filing Date
KR1020170127940A KR102357283B1 (en) 2016-10-14 2017-09-29 Method and apparatus for encoding/decoding an image

Family Applications After (1)

Application Number Title Priority Date Filing Date
KR1020230020808A KR20230025851A (en) 2016-10-14 2023-02-16 Method and apparatus for encoding/decoding an image

Country Status (1)

Country Link
KR (3) KR102357283B1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019216712A1 (en) * 2018-05-10 2019-11-14 삼성전자 주식회사 Video encoding method and apparatus, and video decoding method and apparatus
CN112335243A (en) * 2018-06-18 2021-02-05 世宗大学校产学协力团 Image encoding/decoding method and apparatus
WO2020190077A1 (en) * 2019-03-20 2020-09-24 현대자동차주식회사 Intra prediction device and method based on prediction mode estimation
KR20200113173A (en) * 2019-03-20 2020-10-06 현대자동차주식회사 Method and Apparatus for Intra Prediction Based on Deriving Prediction Mode
WO2023068870A1 (en) * 2021-10-21 2023-04-27 엘지전자 주식회사 Method and apparatus for coding intra prediction mode
US20230336718A1 (en) * 2022-04-18 2023-10-19 Comcast Cable Communications, Llc Video Compression Using Template-Based Determination of Intra Prediction Mode
WO2024039155A1 (en) * 2022-08-16 2024-02-22 현대자동차주식회사 Image encoding/decoding method, device, and recording medium for storing bitstream
WO2024107022A1 (en) * 2022-11-18 2024-05-23 엘지전자 주식회사 Image encoding/decoding method and device, and recording medium onto which bitstream is stored

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090097688A (en) * 2008-03-12 2009-09-16 삼성전자주식회사 Method and apparatus of encoding/decoding image based on intra prediction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Y-J Chang et al: "Arbitrary reference tier for intra directional modes", JVET-C0043, 17 May 2016.

Also Published As

Publication number Publication date
KR20230025851A (en) 2023-02-23
KR20220016938A (en) 2022-02-10
KR20180041577A (en) 2018-04-24
KR102357283B1 (en) 2022-01-28

Similar Documents

Publication Publication Date Title
KR102502216B1 (en) Method and apparatus for encoding/decoding an image
JP7442200B2 (en) Image encoding/decoding method and device
US20190364284A1 (en) Image encoding/decoding method and device
US11792426B2 (en) Method and apparatus for encoding/decoding image using a prediction value based on reference pixels
US20210297666A1 (en) Image encoding method/device, image decoding method/device, and recording medium in which bitstream is stored
US11363280B2 (en) Method and apparatus for encoding/decoding image signal
US11856208B1 (en) Method and apparatus for encoding/decoding image signal
US11909970B2 (en) Image encoding method/device, image decoding method/device, and recording medium in which bitstream is stored
US12028532B2 (en) Method and apparatus for encoding/decoding image signals using weight prediction parameters
KR101981687B1 (en) Method and apparatus for coding offset information and decoding using the same
KR20230042236A (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR20170124076A (en) Method and apparatus for encoding and decoding a video signal group
KR20170125724A (en) Method for coding and decoding intra-prediction, and atparatus for the same

Legal Events

Date Code Title Description
A107 Divisional application of patent
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
A107 Divisional application of patent
GRNT Written decision to grant