KR20200085236A - Efficient prediction and transform encoding/decoding method and apparatus - Google Patents

Efficient prediction and transform encoding/decoding method and apparatus Download PDF

Info

Publication number
KR20200085236A
KR20200085236A KR1020200001231A KR20200001231A KR20200085236A KR 20200085236 A KR20200085236 A KR 20200085236A KR 1020200001231 A KR1020200001231 A KR 1020200001231A KR 20200001231 A KR20200001231 A KR 20200001231A KR 20200085236 A KR20200085236 A KR 20200085236A
Authority
KR
South Korea
Prior art keywords
information
block
prediction
coefficient
current
Prior art date
Application number
KR1020200001231A
Other languages
Korean (ko)
Inventor
문주희
하재민
원동재
Original Assignee
세종대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 세종대학교산학협력단 filed Critical 세종대학교산학협력단
Priority to US17/420,784 priority Critical patent/US20220116588A1/en
Priority to PCT/KR2020/000211 priority patent/WO2020141962A1/en
Publication of KR20200085236A publication Critical patent/KR20200085236A/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/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/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/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/547Motion estimation performed in a transform domain

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 device according to the present invention determine a prediction block of a current block belonging to a current picture by using a pre-restored area in the current picture and restore the transform block of the current block, and the current block can be restored based on the prediction block and the transform block.

Description

효율적인 예측 및 변환 부호화/복호화 방법 및 장치{EFFICIENT PREDICTION AND TRANSFORM ENCODING/DECODING METHOD AND APPARATUS}Efficient prediction and transform encoding/decoding method and apparatus{EFFICIENT PREDICTION AND TRANSFORM ENCODING/DECODING METHOD AND APPARATUS}

본 발명은 영상 부호화/복호화 방법 및 장치에 관한 것으로, 보다 상세하게는 현재 픽쳐 내 복원 정보를 이용하여 현재 블록을 보다 효율적으로 예측하고, 그에 따른 변환 계수를 부호화/복호화하는 방법 및 장치에 관한 것이다.The present invention relates to an image encoding/decoding method and apparatus, and more particularly, to a method and apparatus for more efficiently predicting a current block using reconstruction information in a current picture, and encoding/decoding a transform coefficient accordingly. .

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(Channel)의 대역폭(Bandwidth)이 발전하는 속도는 급격히 증가하고 있는 멀티미디어 데이터의 양을 따라가기 힘든 상황이다. 이에 따라, 국제 표준화 기구인 ITU-T의 VCEG(Video Coding Expert Group)과 ISO/IEC의 MPEG(Moving Picture Expert Group)은 2014년 2월, 동영상 압축 표준인 HEVC(High Efficiency Video Coding) 버전1을 제정하였다.Recently, the demand for multimedia data such as video has been rapidly increasing on the Internet. However, the speed at which the bandwidth of the channel develops is difficult to keep up with the rapidly increasing amount of multimedia data. Accordingly, the International Standardization Organization's Video Coding Expert Group (VCEG) of the ITU-T and the Moving Picture Expert Group (MPEG) of the ISO/IEC announced the High Efficiency Video Coding (HEVC) version 1, the video compression standard, in February 2014. Instituted.

HEVC에서는 화면 내 예측(또는 인트라 예측), 화면 간 예측(또는 인터 예측), 변환, 양자화, 엔트로피 부호화 및 인-루프 필터 등의 기술을 정의하고 있다.HEVC defines techniques such as intra-picture prediction (or intra prediction), inter-picture prediction (or inter prediction), transformation, quantization, entropy encoding, and in-loop filters.

본 발명은 현재 픽쳐 내 복원 정보를 이용하여 현재 블록을 보다 효율적으로 예측하는 방법 및 장치를 제공하고자 한다.The present invention is to provide a method and apparatus for more efficiently predicting a current block using reconstruction information in a current picture.

본 발명은 현재 블록의 변환 계수를 부호화/복호화하는 방법 및 장치를 제공하고자 한다.The present invention is to provide a method and apparatus for encoding/decoding a transform coefficient of a current block.

본 발명에 따른 영상 부호화/복호화 방법 및 장치는, 현재 픽쳐 내 기-복원된 영역을 이용하여, 상기 현재 픽쳐에 속한 현재 블록의 예측 블록을 결정하고, 상기 현재 블록의 변환 블록을 부호화/복호화하며, 상기 예측 블록과 상기 변환 블록을 기반으로, 상기 현재 블록을 복원할 수 있다.The video encoding/decoding method and apparatus according to the present invention uses a pre-restored region in a current picture to determine a prediction block of a current block belonging to the current picture, and encode/decode a transform block of the current block, , The current block may be reconstructed based on the prediction block and the transform block.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 예측 블록을 결정하는 단계는, 상기 현재 블록의 움직임 정보를 유도하기 위한 후보를 결정하는 단계, 상기 후보를 기반으로 상기 현재 블록의 후보 리스트를 구성하는 단계 및 상기 후보 리스트로부터 상기 현재 블록의 움직임 정보를 결정하는 단계를 포함할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the determining of the prediction block may include determining a candidate for deriving motion information of the current block, and a candidate list of the current block based on the candidate And determining motion information of the current block from the candidate list.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 후보는 상기 현재 블록에 공간적으로 인접한 주변 블록의 움직임 정보를 의미할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the candidate may refer to motion information of neighboring blocks spatially adjacent to the current block.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 예측 블록은 상기 현재 블록과 동일한 코딩 트리 유닛(CTU) 또는 CTU 행 내에 속하도록 제한될 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the prediction block may be limited to belong to the same coding tree unit (CTU) or CTU row as the current block.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 주변 블록의 움직임 정보는, 상기 현재 블록의 크기가 소정의 문턱크기보다 큰지 여부에 기초하여 상기 후보 리스트에 선택적으로 추가될 수 있다.In the image encoding/decoding method and apparatus according to the present invention, motion information of the neighboring block may be selectively added to the candidate list based on whether the size of the current block is greater than a predetermined threshold size.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 후보 리스트는, 부호화/복호화 장치의 버퍼에 저장된 움직임 정보를 더 포함할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the candidate list may further include motion information stored in a buffer of the encoding/decoding apparatus.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 현재 블록은 복수의 서브 블록으로 구분되고, 상기 변환 블록을 부호화/복호화하는 단계는, 상기 현재 블록의 서브 블록에 대한 서브 블록 정보를 부호화/복호화하는 단계 및 상기 서브 블록 정보에 따라, 상기 서브 블록 내에 적어도 하나의 0이 아닌 계수가 존재하는 경우, 상기 서브 블록 내 현재 계수에 대해 0 초과 계수 정보, 1 초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나를 부호화/복호화하는 단계를 포함할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the current block is divided into a plurality of sub-blocks, and encoding/decoding the transform block encodes sub-block information for the sub-block of the current block. According to the step of /decoding and the sub-block information, if there is at least one non-zero coefficient in the sub-block, 0 or more coefficient information, 1 or more coefficient information, Parity information or 3 for the current coefficient in the sub-block And encoding/decoding at least one of the excess coefficient information.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 서브 블록에 대한 개수 정보가 부호화/복호화되고, 상기 개수 정보는 상기 서브 블록에 대해 허용되는 계수 정보의 최대 개수를 의미할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the number information for the sub-block is encoded/decoded, and the number information may mean the maximum number of coefficient information allowed for the sub-block.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 계수 정보는 상기 0 초과 계수 정보, 상기 1 초과 계수 정보, 상기 Parity 정보 또는 상기 3 초과 계수 정보 중 적어도 하나를 포함할 수 있다.In the image encoding/decoding method and apparatus according to the present invention, the coefficient information may include at least one of the 0 excess coefficient information, the 1 excess coefficient information, the parity information, or the 3 excess coefficient information.

본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 개수 정보는 상기 0 초과 계수 정보, 상기 1초과 계수 정보, 상기 Parity 정보 또는 상기 3 초과 계수 정보 중 적어도 하나가 각각 부호화/복호화될 때마다 1씩 증가/감소될 수 있다.In the video encoding/decoding method and apparatus according to the present invention, the number information is each time at least one of the zero excess coefficient information, the one excess coefficient information, the parity information, or the three excess coefficient information is respectively encoded/decoded. It can be increased/decreased by 1.

본 발명에서는 블록의 움직임 정보를 이전 복원 픽쳐가 아닌 현재 픽쳐 내에서도 탐색함으로써 예측 신호의 정확도를 높일 수 있고, 그에 따른 변환 계수를 보다 효율적으로 전송하는 영상 부호화/복호화 방법 및 장치를 제공할 수 있다.In the present invention, it is possible to improve the accuracy of a prediction signal by searching for motion information of a block within a current picture rather than a previous reconstructed picture, and to provide an image encoding/decoding method and apparatus for more efficiently transmitting transform coefficients accordingly.

도 1은 영상 부호화 장치를 나타낸 블록도이다.
도 2는 영상 부호화 장치의 화면 내 예측부를 나타낸 블록도이다.
도 3은 영상 부호화 장치의 화면 간 예측부를 나타낸 블록도이다.
도 4는 예측 모드 정보를 부호화 하는 방법이다.
도 5는 영상 복호화 장치(200)를 나타낸 블록도이다.
도 6은 영상 복호화 장치의 화면 내 예측부를 도시한다.
도 7은 영상 복호화 장치의 화면 간 예측부를 도시한다.
도 8은 예측 모드 정보를 복호화 하는 방법이다.
도 9는 변환 블록의 부호화 방법을 나타낸 흐름도이다.
도 10은 변환 블록의 복호화 방법을 나타낸 흐름도이다.
도 11은 문맥 적응적 이진화 산술 부호화 방법을 나타내는 흐름도이다.
도 12는 문맥 적응적 이진화 산술 복호화 방법을 나타내는 흐름도이다.
도 13은 주변 계수들의 정보에 따라 확률 정보를 다르게 적용한 일 예를 나타내는 도면이다.
도 14는 주변 계수들의 정보에 따라 확률 정보를 다르게 적용한 일 예를 나타내는 도면이다.
도 15는 본 발명의 일 실시예에 따라 영상 부호화 장치를 나타낸 블록도이다.
도 16은 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 17은 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 18은 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 19는 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 20는 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 21은 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 22는 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 23는 본 발명의 일 실시예에 따라 화면 내 블록 카피 예측을 이용한 예측 블록 생성 방법을 도시한다.
도 24는 본 발명의 일 실시예에 따라 영상 부호화 장치의 화면 내 블록 카피 예측부를 나타낸 블록도이다.
도 25는 현재 블록 주변에 인접한 공간적 후보의 위치를 나타낸다.
도 26은 본 발명의 일 실시예에 따라 예측 모드 정보를 부호화 하는 방법이다.
도 27는 본 발명의 일 실시예에 따라 영상 복호화 장치의 화면 내 블록 카피 예측부를 나타낸 블록도이다.
도 28은 본 발명의 일 실시예에 따라 영상 복호화 장치의 화면 내 블록 카피 예측부를 나타낸 블록도이다.
도 29는 본 발명의 일 실시예에 따라 예측 모드 정보를 복호화 하는 방법이다.
도 30은 본 발명의 일 실시예에 따라 양자화된 변환 계수 부호화 방법을 나타낸 흐름도이다.
도 31은 본 발명의 일 실시예에 따라 양자화된 변환 계수 복호화 방법을 나타낸 흐름도이다.
1 is a block diagram showing an image encoding apparatus.
2 is a block diagram showing an intra prediction unit of the video encoding apparatus.
3 is a block diagram illustrating an inter-screen prediction unit of the video encoding apparatus.
4 is a method of encoding prediction mode information.
5 is a block diagram showing the image decoding apparatus 200.
6 shows an in-screen prediction unit of the video decoding apparatus.
7 shows an inter-screen prediction unit of the video decoding apparatus.
8 is a method of decoding prediction mode information.
9 is a flowchart illustrating a method of encoding a transform block.
10 is a flowchart illustrating a method of decoding a transform block.
11 is a flowchart illustrating a context adaptive binary arithmetic coding method.
12 is a flowchart illustrating a context-adaptive binary arithmetic decoding method.
13 is a diagram illustrating an example in which probability information is differently applied according to information of neighboring coefficients.
14 is a diagram illustrating an example in which probability information is differently applied according to information of neighboring coefficients.
15 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.
16 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
17 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
18 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
19 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
20 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
21 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
22 illustrates a method of generating a prediction block using block copy prediction in a screen according to an embodiment of the present invention.
23 illustrates a method of generating a prediction block using intra-screen block copy prediction according to an embodiment of the present invention.
24 is a block diagram illustrating an in-screen block copy prediction unit of an image encoding apparatus according to an embodiment of the present invention.
25 shows the positions of spatial candidates adjacent to the current block.
26 is a method of encoding prediction mode information according to an embodiment of the present invention.
27 is a block diagram illustrating an in-screen block copy prediction unit of an image decoding apparatus according to an embodiment of the present invention.
28 is a block diagram illustrating an in-screen block copy prediction unit of an image decoding apparatus according to an embodiment of the present invention.
29 is a method of decoding prediction mode information according to an embodiment of the present invention.
30 is a flowchart illustrating a method of encoding quantized transform coefficients according to an embodiment of the present invention.
31 is a flowchart illustrating a method of decoding a quantized transform coefficient according to an embodiment of the present invention.

본 명세서에 첨부된 도면을 참조하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 실시예를 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.DETAILED DESCRIPTION Embodiments of the present invention will be described in detail so that those skilled in the art to which the present invention pertains may easily practice the present invention with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. In addition, in order to clearly describe the present invention in the drawings, parts irrelevant to the description are omitted, and like reference numerals are assigned to similar parts throughout the specification.

본 명세서 전체에서, 어떤 부분이 다른 부분과 '연결'되어 있다고 할 때, 이는 직접적으로 연결되어 있는 경우뿐 아니라, 그 중간에 다른 소자를 사이에 두고 전기적으로 연결되어 있는 경우도 포함한다.Throughout this specification, when a part is said to be'connected' to another part, this includes not only the case of being directly connected, but also the case of being electrically connected with another element in between.

또한, 본 명세서 전체에서 어떤 부분이 어떤 구성요소를 '포함'한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다.In addition, when it is said that a part "includes" a certain component in the whole specification, it means that other components may be further included rather than excluding other components unless otherwise specified.

또한, 제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.Further, terms such as first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from other components.

또한, 본 명세서에서 설명되는 장치 및 방법에 관한 실시예에 있어서, 장치의 구성 일부 또는 방법의 단계 일부는 생략될 수 있다. 또한 장치의 구성 일부 또는 방법의 단계 일부의 순서가 변경될 수 있다. 또한 장치의 구성 일부 또는 방법의 단계 일부에 다른 구성 또는 다른 단계가 삽입될 수 있다.In addition, in the embodiments of the apparatus and method described herein, a part of the configuration of the apparatus or a part of the method may be omitted. Also, the order of some of the components of the device or some of the steps of the method may be changed. In addition, other configurations or other steps may be inserted in some of the configuration of the device or in some of the steps of the method.

또한, 본 발명의 제1 실시예의 일부 구성 또는 일부 단계는 본 발명의 제2 실시예에 부가되거나, 제2 실시예의 일부 구성 또는 일부 단계를 대체할 수 있다.Further, some of the components or steps of the first embodiment of the present invention may be added to the second embodiment of the present invention, or may replace some components or steps of the second embodiment.

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

본 명세서에서, 블록은 단위, 영역, 유닛, 파티션 등으로 다양하게 표현될 수 있고, 샘플은 화소, 펠(pel), 픽셀 등으로 다양하게 표현될 수 있다.In the present specification, blocks may be variously expressed in units, regions, units, partitions, and the like, and samples may be variously expressed in pixels, pels, pixels, and the like.

이하, 첨부한 도면들을 참조하여, 본 발명의 실시예를 보다 상세하게 설명하고자 한다. 본 발명을 설명함에 있어 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the present invention, redundant description of the same components will be omitted.

도 1은 영상 부호화 장치를 나타낸 블록도이다. 도 1을 참조하면, 영상 부호화 장치(100)는 블록 분할부(S101), 화면 내 예측부(S102), 화면 간 예측부(S103), 감산부(S104), 변환부(S105), 양자화부(S106), 엔트로피 부호화부(S107), 역양자화부(S108), 역변환부(S109), 증산부(S110), 필터부(S111) 및 메모리(S112)를 포함할 수 있다. 1 is a block diagram showing an image encoding apparatus. Referring to FIG. 1, the image encoding apparatus 100 includes a block division unit S101, an intra prediction unit S102, an inter prediction unit S103, a subtraction unit S104, a transformation unit S105, and a quantization unit. (S106), an entropy encoding unit (S107), an inverse quantization unit (S108), an inverse transformation unit (S109), a multiplication unit (S110), a filter unit (S111), and a memory (S112).

각 장치에서 최적의 정보를 선택하기 위해 RD-Cost(RateDistortion-Cost)를 비교한다. RD-Cost란 원본 블록과 복원된 블록간의 왜곡 정보와 예측 모드 전송시에 발생하는 비트량을 이용하여 계산된 비용값을 의미한다. 이때 비용값을 계산하기 위해 SAD(Sum of Absolute Difference), SATD(Sum of Absolute Transformed Difference), SSE(Sum of Square for Error) 등을 이용할 수도 있다.RD-Cost (RateDistortion-Cost) is compared to select the optimal information from each device. RD-Cost means a cost value calculated by using distortion information between an original block and a reconstructed block and a bit amount generated during prediction mode transmission. In this case, SAD (Sum of Absolute Difference), SATD (Sum of Absolute Transformed Difference), and SSE (Sum of Square for Error) may be used to calculate the cost value.

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

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

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

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

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

화면 내 예측부(102)는 현재 픽쳐 내의 화소 정보인 현재 블록 주변의 참조 픽셀 정보를 기초로 예측 블록을 생성할 수 있다. 화면 내 예측이 수행될 현재 블록의 주변 블록의 예측 모드가 화면 간 예측 예측인 경우, 화면 간 예측 예측이 적용된 주변 블록에 포함되는 참조 픽셀을, 화면 내 예측이 적용된 주변의 다른 블록 내의 참조 픽셀로 대체될 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를, 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.The intra prediction unit 102 may generate a prediction block based on reference pixel information around a current block, which is pixel information in a current picture. When the prediction mode of the neighboring block of the current block to which the intra prediction is to be performed is inter prediction prediction, the reference pixel included in the neighboring block to which the inter prediction prediction is applied is referred to as a reference pixel in another block around the intra prediction is applied. Can be replaced. That is, when the reference pixel is not available, the available reference pixel information may be replaced with at least one reference pixel among the available reference pixels.

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

화면 내 예측부(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 interpolation unit, and a DC filter. The AIS filter is a filter that performs filtering on the reference pixel 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 that does not perform AIS filtering, the AIS filter may not be applied.

화면 내 예측부(102)의 참조 화소 보간부는 예측 단위의 화면 내 예측 예측 모드가 참조 화소를 보간한 화소값을 기초로 화면 내 예측 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 분수 단위 위치의 참조 화소를 생성할 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.The reference pixel interpolation unit of the intra-screen prediction unit 102 is a fractional unit by interpolating the reference pixels when the intra-prediction prediction mode of the prediction unit is a prediction unit that performs intra-prediction prediction based on pixel values interpolated with reference pixels. A reference pixel at a position can be generated. If the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating a reference pixel, the reference pixel 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.

화면 간 예측부(103)은, 메모리(112)에 저장된 기 복원된 참조영상과 움직임 정보를 이용하여 예측 블록을 생성한다. 움직임 정보는 예컨대 움직임 벡터, 참조픽처 인덱스, 리스트 1 예측 플래그, 리스트 0 예측 플래그 등을 포함할 수 있다. The inter-screen prediction unit 103 generates a prediction block using the pre-restored reference image and motion information stored in the memory 112. The motion information may include, for example, a motion vector, a reference picture index, a list 1 prediction flag, a list 0 prediction flag, and the like.

화면 간 예측부(103)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 블록을 유도할 수 있다. 또한, 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로, 현재 블록의 예측 블록을 유도할 수도 있다. 본 발명의 일 실시예에 따른 화면 간 예측부(103)는 참조 픽쳐 보간부, 움직임 예측부, 움직임 보상부를 포함할 수 있다. The inter-screen prediction unit 103 may derive a prediction block based on information of at least one of a previous picture or a subsequent picture of the current picture. In addition, a prediction block of a current block may be derived based on information of some regions in which encoding in a current picture is completed. The inter-screen prediction unit 103 according to an embodiment of the present invention 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 (DCT-based interpolation filter) having different filter coefficients may be used to generate pixel information of integer pixels or less in units of 1/4 pixels. For the color difference signal, a DCT-based interpolation filter (DCT-based interpolation filter) having 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 prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. 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) can be used. The motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on the interpolated pixels. The motion prediction unit may predict a prediction block of a current block by differently using a motion prediction method. As a motion prediction method, various methods such as a skip method, a merge method, and an advanced motion vector prediction (AMVP) method may be used.

감산부(S104)는, 현재 부호화하려는 블록과 화면 내 예측부(S102) 혹은 화면 간 예측부(S103)에서 생성된 예측 블록을 감산하여 현재 블록의 잔차 블록을 생성한다. 생성된 잔차 블록은 변환부(S103)로 입력되어 변환될 수 있다. The subtraction unit S104 subtracts the prediction block generated by the current encoding block and the intra prediction unit S102 or the inter prediction unit S103 to generate a residual block of the current block. The generated residual block may be input to the conversion unit S103 and converted.

변환부(S105)에서는 잔차 데이터를 포함한 잔차 블록을 DCT, DST, KLT(Karhunen Loeve Transform) 등과 같은 변환 방법을 사용하여 변환시킬 수 있다. 이때 변환 방법은 잔차 블록을 생성하기 위해 사용된 예측 단위의 화면 내 예측 모드에 기반하여 결정될 수 있다. 예를 들어, 화면 내 예측 모드에 따라, 가로 방향으로는 DCT를 사용하고, 세로 방향으로는 DST를 사용할 수도 있다.The transform unit S105 may transform the residual block including the residual data using a transform method such as DCT, DST, or Karhunen Loeve Transform (KLT). At this time, the transform method may be determined based on the intra prediction mode of the 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.

양자화부(S106)는 변환부(S105)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(S106)에서 산출된 값은 역양자화부(S108)와 엔트로피 부호화부(S107)에 제공될 수 있다.The quantization unit S106 may quantize the values converted from the conversion unit S105 into the frequency domain. The quantization coefficient may vary depending on the block or the importance of the image. The value calculated by the quantization unit S106 may be provided to the inverse quantization unit S108 and the entropy encoding unit S107.

상기 변환부(S105) 및/또는 양자화부(S106)는, 영상 부호화 장치(100)에 선택적으로 포함될 수 있다. 즉, 영상 부호화 장치(100)는, 잔차 블록의 잔차 데이터에 대해 변환 또는 양자화 중 적어도 하나를 수행하거나, 변환 및 양자화를 모두 스킵하여 잔차 블록을 부호화할 수 있다. 영상 부호화 장치(S100)에서 변환 또는 양자화 중 어느 하나가 수행되지 않거나, 변환 및 양자화 모두 수행되지 않더라도, 엔트로피 부호화부(S107)의 입력으로 들어가는 블록을 통상적으로 변환 블록이라 일컫는다. 엔트로피 부호화부(S107)는 입력 데이터를 엔트로피 부호화한다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다.The transformation unit S105 and/or the quantization unit S106 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. Even if neither the transformation nor the quantization is performed in the image encoding apparatus S100, or both the transformation and quantization are performed, the block entering the input of the entropy encoding unit S107 is generally referred to as a transformation block. The entropy encoding unit S107 entropy-encodes the input data. Entropy encoding may use various encoding methods, such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding).

엔트로피 부호화부(S107)는 변환 블록의 계수 정보, 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보, 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. 변환 블록의 계수들은, 변환 블록 내 서브 블록 단위로, 부호화될 수 있다. The entropy encoding unit S107 includes a variety of transform block coefficient information, block type information, prediction mode information, split unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information. Information can be encoded. Coefficients of the transform block may be coded in units of sub-blocks in the transform block.

변환 블록의 계수의 부호화를 위하여, 역스캔 순서로 최초의 0이 아닌 계수의 위치를 알리는 신택스 요소(syntax element)인 Last_sig, 서브블록 내에 0이 아닌 계수가 적어도 하나 이상 있는지를 알리는 플래그인 Coded_sub_blk_flag, 0이 아닌 계수인지를 알리는 플래그인 Sig_coeff_flag, 계수의 절대값이 1 보다 큰지를 알리는 플래그인 Abs_greater1_flag, 계수의 절대값이 2 보다 큰지를 알리는 플래그인 Abs_greater2_flag, 계수의 부호를 나타내는 플래그인 Sign_flag 등의 다양한 신택스 요소들이 부호화될 수 있다. 상기 신택스 요소들만으로 부호화되지 않는 계수의 잔여값은 신택스 요소 remaining_coeff를 통해 부호화될 수 있다. For encoding of the coefficients of the transform block, Last_sig, which is a syntax element indicating the position of the first non-zero coefficient in reverse scan order, and Coded_sub_blk_flag, which is a flag indicating whether there is at least one non-zero coefficient in the subblock, Sig_coeff_flag, a flag indicating whether the coefficient is non-zero, Abs_greater1_flag, a flag indicating whether the absolute value of the coefficient is greater than 1, Abs_greater2_flag, a flag indicating whether the absolute value of the coefficient is greater than 2, and Sign_flag, a flag indicating the sign of the coefficient, etc. Syntax elements can be coded. The residual value of the coefficient that is not encoded by the syntax elements alone may be encoded through the syntax element remaining_coeff.

역양자화부(S108) 및 역변환부(S109)에서는 양자화부(S106)에서 양자화된 값들을 역양자화하고 변환부(S105)에서 변환된 값들을 역변환한다. 역양자화부(S108) 및 역변환부(S109)에서 생성된 잔차값(Residual)은 예측부(S102, 103)에 포함된 움직임 추정부, 움직임 보상부 및 화면 내 예측부(S102)를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다. 증산기(S110)는, 예측부(S102, S103)에서 생성된 예측 블록과, 역 변환부(S109)를 통해 생성된 잔차 블록을 증산하여 복원 블록을 생성한다.The inverse quantization unit S108 and the inverse transformation unit S109 inverse quantize the values quantized by the quantization unit S106 and inversely transform the values converted by the transformation unit S105. The residual values generated by the inverse quantization unit S108 and the inverse transformation unit S109 are predicted by the motion estimation unit included in the prediction units S102 and 103, the motion compensation unit, and the intra prediction unit S102. It can be combined with the prediction unit to generate a reconstructed block. The estimator S110 generates a reconstructed block by incrementing the prediction block generated by the prediction units S102 and S103 and the residual block generated by the inverse transform unit S109.

필터부(S111)는 디블록킹 필터, 오프셋 보정부, ALF(Adaptive Loop Filter)중 적어도 하나를 포함할 수 있다.The filter unit S111 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 boundary between blocks in the reconstructed picture. In order to determine whether to perform deblocking, it may be determined whether to apply a deblocking filter to the current block based on pixels included in a few 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 performing vertical filtering and horizontal filtering, horizontal filtering and vertical filtering may be processed in parallel.

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

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

메모리(S112)는 필터부(S111)를 통해 산출된 복원 블록 또는 픽쳐를 저장할 수 있고, 저장된 복원 블록 또는 픽쳐는 화면 간 예측을 수행할 때 예측부(S102, S103)에 제공될 수 있다.The memory S112 may store the reconstructed block or picture calculated through the filter unit S111, and the stored reconstructed block or picture may be provided to the predictors S102 and S103 when performing inter-frame prediction.

도 2는 영상 부호화 장치의 화면 내 예측부를 나타낸 블록도이다.2 is a block diagram showing an intra prediction unit of the video encoding apparatus.

현재 블록의 예측 모드가 화면 내 예측이 선택된 후, 참조 화소 생성부(S201)에서 현재 블록 주변에 참조 화소 유도 및 참조 화소 필터링을 한다. 참조 화소는 현재 블록 주변에 복원 화소를 이용하여 결정한다. 현재 블록 주변에 일부 복원된 화소를 이용할 수 없거나 복원된 화소가 없는 경우, 이용 가능한 참조 화소를 이용할 수 없는 영역에 패딩하거나 화소가 가질 수 있는 값의 범위 중 중간 값을 가지고 패딩을 할 수 있다. 참조 화소를 모두 유도한 후, AIS(Adaptive Intra Smoothing) 필터를 이용하여 필터링을 한다.After intra prediction is selected for the prediction mode of the current block, the reference pixel generation unit S201 performs reference pixel derivation and reference pixel filtering around the current block. The reference pixel is determined using a reconstructed pixel around the current block. If some reconstructed pixels are not available around the current block or there are no reconstructed pixels, padding may be performed in an area where the available reference pixels are not available, or padding may be performed with an intermediate value among a range of values the pixels may have. After deriving all the reference pixels, filtering is performed using an adaptive intra smoothing (AIS) filter.

최적 화면 내 예측 모드 결정부에서는 M가지의 화면 내 예측 모드 중 하나의 예측 모드를 결정하는 장치이다(S202). 여기서 M은 화면 내 예측 모드 총 개수를 나타낸다. 화면 내 예측 모드는 방향성 예측 모드와 비방향성 예측 모드에 따라 필터링 된 참조 화소를 이용하여 생성한 예측 블록을 생성한다. 화면 내 예측 모드 별로 RD-Cost를 비교하여 비용값이 가장 낮은 하나의 화면 내 예측 모드를 선택한다. The optimum intra prediction mode determination unit is an apparatus for determining one prediction mode among the M intra prediction modes (S202). Here, M represents the total number of prediction modes in the screen. The intra prediction mode generates a prediction block generated using a reference pixel filtered according to a directional prediction mode and a non-directional prediction mode. RD-Cost is compared for each prediction mode within the screen to select one prediction mode with the lowest cost value.

도 3는 영상 부호화 장치의 화면 간 예측부를 자세하게 나타낸 블록도이다.3 is a block diagram showing in detail a prediction unit between screens of an image encoding apparatus.

화면 간 예측부는 움직임 정보를 유도하는 방법에 따라 Merge 후보 탐색부(S302)와 AMVP 후보 탐색부(S304)로 나눌 수 있다. Merge 후보 탐색부(S302)는 현재 블록 주변에 복원된 블록 중 화면 간 예측이 사용된 참조 블록을 Merge 후보로 설정한다. Merge 후보는 부호화/복호화 장치에서 동일한 방법으로 유도하고, 동일한 개수를 사용하며 Merge 후보 개수는 부호화 장치에서 복호화 장치로 전송을 한다. 이때, 현재 블록 주변에 복원된 참조 블록으로 Megre 후보를 약속된 개수만큼 설정하지 못한 경우, 현재 픽쳐가 아닌 다른 픽쳐에서 현재 블록과 동일한 위치에 존재하는 블록의 움직임 정보를 가져온다. 혹은 현재 픽쳐를 기준으로 과거 방향, 미래방향 움직임 정보들을 조합해서 후보로 채우거나 다른 참조 픽쳐의 동일한 위치의 블록을 움직임 정보라고 설정하여 Merge 후보를 설정한다. The inter-screen prediction unit may be divided into a Merge candidate search unit (S302) and an AMVP candidate search unit (S304) according to a method for deriving motion information. The Merge candidate search unit S302 sets a reference block in which inter-frame prediction is used among blocks reconstructed around the current block as a Merge candidate. The Merge candidate is derived in the same way from the encoding/decoding device, the same number is used, and the number of Merge candidates is transmitted from the encoding device to the decoding device. At this time, if the set number of Megre candidates is not set as a reference block restored around the current block, motion information of a block existing in the same position as the current block is obtained from a picture other than the current picture. Alternatively, a candidate for merge is set by combining past and future motion information based on the current picture as a candidate, or by setting a block at the same location of another reference picture as motion information.

AMVP 후보 탐색부(S304)는 현재 블록의 움직임 정보를 움직임 추정부(S305)에서 결정한다. 움직임 추정부(S305)는 복원된 픽쳐들 중 현재 블록과 가장 유사한 예측 블록을 찾는다. The AMVP candidate search unit S304 determines motion information of the current block in the motion estimation unit S305. The motion estimation unit S305 finds a prediction block most similar to the current block among the reconstructed pictures.

화면 간 예측부에서는 Merge 후보 탐색부와 AMVP 후보 탐색부 중 하나를 이용하여 현재 블록의 움직임 정보를 결정한 후, 움직임 보상(S306)을 통해 예측 블록이 생성된다.The inter-screen prediction unit determines motion information of the current block using one of the Merge candidate search unit and the AMVP candidate search unit, and then generates a prediction block through motion compensation (S306).

도 4는 예측 모드 정보를 부호화 하는 방법이다. 4 is a method of encoding prediction mode information.

Skip 모드 동작 정보 부호화(S401)는 현재 블록의 예측 모드 정보를 화면 간 예측의 Merge 정보를 이용하고, 복호화 장치에서 예측 블록을 복원 블록으로 사용하는 여부를 알려주는 정보이다.Skip mode operation information encoding (S401) is information that indicates whether prediction mode information of a current block is used as Merge information of inter-picture prediction, and whether a prediction block is used as a reconstruction block in a decoding device.

Skip 모드가 동작을 한다면 결정된 Merge 후보 색인 부호화(S403)를 하고, 동작을 안한다면 예측 모드 부호화(S404)를 한다.If the Skip mode operates, the determined Merge candidate index encoding (S403) is performed, and if it is not operated, the prediction mode encoding (S404) is performed.

예측 모드 부호화(S404)는 현재 블록의 예측 모드가 화면 간 예측과 화면 내 예측인지를 부호화 한다. 화면 간 예측 모드가 선택된 경우, Merge모드 동작 정보를 부호화 한다(S406). Merge 모드가 동작을 한다면(S407) Merge 후보 색인 부호화(S403)를 한다. Merge 모드가 동작을 안한다면 예측 방향 부호화를 한다(S408). 예측 방향 부호화(S408)는 이용하는 참조 픽쳐의 방향이 현재 픽쳐를 기준으로 과거 방향에 있는지, 미래 방향에 있는지 혹은 양방향 둘다 이용하는지 여부를 알려준다. 예측 방향이 과거 혹은 양방향인 경우(S409), 과거방향 참조 픽쳐 색인 정보 부호화(S410), 과거 방향 MVD정보 부호화(S411), 과거 방향 MVP 정보를 부호화(S412)하고, 예측 방향이 미래 혹은 양방향인 경우(S413), 미래 방향 참조 픽쳐 색인 정보 부호화(S414), 미래 방향 MVD정보 부호화(S415), 미래 방향 MVP 정보를 부호화(S416) 하여 현재 블록의 화면 간 예측 움직임 정보를 알려줄 수 있다. 화면 간 예측 과정에서 부호화 되는 정보들은 화면 간 예측부 모드 정보 부호화로 지칭한다(40).Prediction mode encoding (S404) encodes whether the prediction mode of the current block is inter prediction or intra prediction. If the inter prediction mode is selected, Merge mode operation information is encoded (S406). If the Merge mode operates (S407), Merge candidate index encoding (S403) is performed. If the Merge mode does not operate, prediction direction encoding is performed (S408). The prediction direction encoding (S408) indicates whether the direction of the reference picture to be used is in the past direction, the future direction, or both directions based on the current picture. If the prediction direction is the past or bidirectional (S409), the past direction reference picture index information encoding (S410), the past direction MVD information encoding (S411), the past direction MVP information is encoded (S412), and the prediction direction is the future or bidirectional. In case (S413), the future direction reference picture index information encoding (S414), the future direction MVD information encoding (S415), and the future direction MVP information is encoded (S416), and prediction motion information between screens of the current block may be reported. The information encoded in the inter prediction process is referred to as inter prediction mode information encoding (40).

예측 모드가 화면 내 예측 모드인 경우, MPM 동작 정보를 부호화(S417)한다. MPM 동작 정보 부호화는 현재 블록 주변에 복원된 블록 중 현재 블록과 동일한 예측 모드 정보를 가지고 있는 경우 현재 블록의 예측 모드 정보를 부호화 하지 않고, 복원된 블록과 동일한 예측 모드 정보를 사용하라고 알려주는 정보이다. MPM 동작을 하는 경우(S418), MPM 색인 부호화(S419)를 하여 어느 복원된 블록의 예측 모드를 현재 블록의 예측 모드로 사용하는지 알려주고, MPM 동작을 하지 않는 경우(S418), 잔여 예측 모드 부호화를 한다(S420). 잔여 예측 모드 부호화는 MPM후보로 선택된 예측 모드를 뺀 나머지 예측 모드들 중 현재 블록의 예측 모드로 사용되는 예측 모드 색인을 부호화 한다. 화면 내 예측 과정에서 부호화 되는 정보들은 화면 내 예측부 모드 정보 부호화로 지칭한다(41).If the prediction mode is an intra prediction mode, MPM operation information is encoded (S417). MPM motion information encoding is information that informs us to use the same prediction mode information as the reconstructed block without encoding the prediction mode information of the current block when the current block has the same prediction mode information as the current block among the restored blocks around the current block. . When the MPM operation is performed (S418), the MPM index encoding (S419) is performed to inform which reconstructed block prediction mode is used as the prediction mode of the current block, and when the MPM operation is not performed (S418), the residual prediction mode encoding is performed. (S420). Residual prediction mode encoding encodes a prediction mode index used as a prediction mode of the current block among the remaining prediction modes, excluding the prediction mode selected as the MPM candidate. Information encoded in the intra prediction process is referred to as intra prediction mode information encoding (41).

다음으로, 본 발명의 영상 복호화 장치를 도면을 참조하여 설명한다. 도 5는 본 발명의 영상 복호화 장치(200)를 나타낸 블록도이다. Next, the video decoding apparatus of the present invention will be described with reference to the drawings. 5 is a block diagram showing an image decoding apparatus 200 of the present invention.

도 5를 참조하면, 영상 복호화 장치(500)는 엔트로피 복호화부(501), 역양자화부(502), 역변환부(503), 증산부(504), 필터부(505), 메모리(506) 및 예측부(507, 508)를 포함할 수 있다.Referring to FIG. 5, the image decoding apparatus 500 includes an entropy decoding unit 501, an inverse quantization unit 502, an inverse transform unit 503, an increase unit 504, a filter unit 505, a memory 506, and Prediction units 507 and 508 may be included.

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

엔트로피 복호화부(501)는 영상 부호화 장치(100)의 엔트로피 부호화부(507)에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. 엔트로피 복호화부(201)는, 전술한 바와 같은 신택스 요소들, 즉 Last_sig, Coded_sub_blk_flag, Sig_coeff_flag, Abs_greater1_flag, Abs_greater2_flag, Sign_flag 및 remaining_coeff를 복호화할 수 있다. 또한, 엔트로피 복호화부(501)는 영상 부호화 장치(100)에서 수행된 화면 내 예측 예측 및 화면 간 예측 예측에 관련된 정보를 복호화 할 수 있다.The entropy decoding unit 501 may perform entropy decoding in a procedure opposite to that performed by the entropy encoding in the entropy encoding unit 507 of the image encoding apparatus 100. For example, various methods such as Exponential Golomb (CAVLC), Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied to the method performed in the image encoder. The entropy decoding unit 201 may decode syntax elements as described above, that is, Last_sig, Coded_sub_blk_flag, Sig_coeff_flag, Abs_greater1_flag, Abs_greater2_flag, Sign_flag, and remaining_coeff. Also, the entropy decoding unit 501 may decode information related to intra prediction prediction and inter prediction prediction performed by the image encoding apparatus 100.

역 양자화부(502)는 양자화된 변환 블록에 역 양자화를 수행하여 변환 블록을 생성한다. 도 1의 역 양자화부(108)와 실질적으로 동일하게 동작한다.The inverse quantization unit 502 performs inverse quantization on the quantized transform block to generate a transform block. It operates substantially the same as the inverse quantization unit 108 of FIG. 1.

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

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

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

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

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

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

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

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

도 6과 도 7은 영상 복호화 장치의 화면 내 예측부, 화면 간 예측부를 도시한다.6 and 7 show an intra-prediction unit and an inter-prediction unit of the video decoding apparatus.

화면 내 예측부(600)는 도 2의 최적의 예측 모드를 결정하는 과정만 빠져 있고, 최적이라고 판단된 예측 모드를 받아서 예측 블록을 생성하는 과정은 영상 부호화 장치의 화면 내 예측부와 실질적으로 동일하게 동작한다.The intra prediction unit 600 is omitted from the process of determining the optimal prediction mode of FIG. 2, and the process of generating the prediction block by receiving the prediction mode determined to be optimal is substantially the same as the intra prediction unit of the video encoding apparatus. It works.

화면 간 예측부(700)는 도 3의 최적의 예측 모드를 결정하는 과정만 빠져 있고, 최적이라고 판단된 예측 모드를 받아서 예측 블록을 생성하는 과정은 영상 부호화 장치의 화면 간 예측부와 실질적으로 동일하게 동작한다.The inter-screen prediction unit 700 is missing only the process of determining the optimal prediction mode of FIG. 3, and the process of generating the prediction block by receiving the prediction mode determined as optimal is substantially the same as the inter-screen prediction unit of the image encoding apparatus. It works.

도 8은 예측 모드 정보를 복호화 하는 방법이다. 도 4의 예측 모드 정보를 부호화 하는 방법과 실질적으로 동일하게 동작한다.8 is a method of decoding prediction mode information. The method operates substantially the same as the method of encoding the prediction mode information of FIG. 4.

도 9는 변환 블록의 부호화 방법을 나타낸 흐름도이다. 도 9의 변환 블록의 부호화 방법은, 영상 부호화 장치(100)의 엔트로피 부호화부(107)에 의해 수행될 수 있다.9 is a flowchart illustrating a method of encoding a transform block. The encoding method of the transform block of FIG. 9 may be performed by the entropy encoding unit 107 of the image encoding apparatus 100.

먼저 역 스캔 순서에 따라서 변환 계수들을 스캔할 때 최초의 0이 아닌 계수를 기준 계수로 정하고, 그 위치 정보 Last_sig를 부호화 한다(S901). First, when scanning transform coefficients according to an inverse scan order, the first non-zero coefficient is determined as a reference coefficient, and the position information Last_sig is encoded (S901).

기준 계수가 포함된 서브 블록을 선택하고(S902) 해당 서브 블록 내 변환 계수 정보를 부호화 한다. 기준 계수가 포함된 서브 블록이 아닌 경우, 변환 블록 내 계수를 부호화 하기 전에 서브 블록 정보를 부호화 한다(S903). 서브 블록 정보인 Coded_sub_blk_flag 는 현재 서브 블록 내에 0이 아닌 계수가 적어도 하나 이상 있는지를 알리는 플래그이다. 그 후, 0이 아닌 계수 정보를 부호화 한다(S904). 여기서 0이 아닌 계수 정보인 Sig_coeff_flag 는 서브 블록안에 존재하는 각 계수의 값이 0인지 아닌지를 나타낸다.A sub-block including a reference coefficient is selected (S902), and transform coefficient information in the corresponding sub-block is encoded. If the sub-block including the reference coefficient is not, the sub-block information is encoded before encoding the coefficient in the transform block (S903). The sub-block information Coded_sub_blk_flag is a flag indicating whether there is at least one non-zero coefficient in the current sub-block. Thereafter, non-zero coefficient information is encoded (S904). Here, the non-zero coefficient information Sig_coeff_flag indicates whether the value of each coefficient existing in the sub-block is 0 or not.

그리고, N 초과 계수 정보를 부호화 한다(S905). 여기서, N 초과 계수 정보는 서브 블록 안에 존재하는 모든 계수에 대해 각 계수의 절대값이 1부터 N까지 값을 각각 초과하는지를 나타낸다. N은 부호화 및 복호화 시 임의의 기 설정된 값을 사용하지만 N의 값을 부호화 하여 부호화 및 복호화 시에 동일한 값을 사용하게 할 수 있다. N초과 계수 정보의 개수는 임의의 기 설정된 값을 사용할 수도 있고, 기준 계수의 위치에 따라 다르게 사용할 수도 있다. N 초과 계수 정보는, 서브 블록 내의 계수 전부 또는 일부에 대해서 부호화되며, 각 계수의 스캔 순서에 따라 순차적으로 부호화될 수 있다. Then, the N excess coefficient information is encoded (S905). Here, the N excess coefficient information indicates whether an absolute value of each coefficient exceeds a value from 1 to N for all coefficients present in the sub-block. N uses an arbitrary predetermined value for encoding and decoding, but it is possible to encode the value of N to use the same value for encoding and decoding. The number of N excess coefficient information may use any preset value or may be differently used depending on the position of the reference coefficient. The N excess coefficient information is encoded for all or part of the coefficients in the sub-block, and may be sequentially encoded according to the scan order of each coefficient.

예를 들어 N이 3으로 설정된 경우, 서브 블록 안의 모든 0이 아니라고 판단된 계수(넌-제로 계수, non-zero coefficient)에 대해 각 계수의 절대값이 1보다 큰 값인지 여부를 부호화 한다. 이를 위해 계수의 절대값이 1 보다 큰지를 알리는 플래그인 Abs_greater1_flag 가 이용된다. 그 후, 1보다 큰 값으로 판단이 된 계수에 대해서만 2보다 큰 값인지 여부를 부호화 한다. 이를 위해 계수의 절대값이 2 보다 큰지를 알리는 플래그인 Abs_greater2_flag가 사용된다. 마지막으로 2 보다 큰 값으로 판단이 된 계수에 대해서만 3보다 큰 값인지 여부를 부호화 한다. 이를 위해서는 계수의 절대값이 3 보다 큰지를 알리는 플래그인 Abs_greater3_flag가 사용될 수 있다.For example, when N is set to 3, it is coded whether or not the absolute value of each coefficient is greater than 1 for all non-zero coefficients (non-zero coefficients) in the sub-block. For this, the flag Abs_greater1_flag, which indicates whether the absolute value of the coefficient is greater than 1, is used. After that, it is coded whether or not the coefficient determined as a value greater than 1 is greater than 2 only. For this, the flag Abs_greater2_flag, which indicates whether the absolute value of the coefficient is greater than 2, is used. Finally, it is coded whether or not the coefficient is determined to be greater than 2 only if it is greater than 3. For this, the flag Abs_greater3_flag, which indicates whether the absolute value of the coefficient is greater than 3, may be used.

또는, 서브 블록 안의 넌-제로 계수에 대해 각 계수의 절대값이 1보다 큰 값인지 여부를 부호화 한다. 이를 위해 계수의 절대값이 1 보다 큰지를 알리는 플래그인 Abs_greater1_flag 가 이용된다. 그 후, 1보다 큰 값으로 판단이 된 계수에 대해서만 해당 계수가 짝수인지 여부를 부호화할 수 있다. 이를 위해 이를 위해 계수가 짝수인지 아니면 홀수인지를 나타내는 Parity 정보가 사용될 수 있다. 나아가, 해당 계수의 절대값이 3보다 큰지 여부를 부호화할 수 있다. 이를 위해 계수의 절대값이 3보다 큰지를 알리는 플래그인 Abs_greater3_flag가 사용될 수 있다.Or, for a non-zero coefficient in a sub-block, whether or not the absolute value of each coefficient is greater than 1 is coded. For this, the flag Abs_greater1_flag, which indicates whether the absolute value of the coefficient is greater than 1, is used. Thereafter, only the coefficient determined to be a value greater than 1 can be coded to determine whether the coefficient is an even number. For this, parity information indicating whether the coefficient is even or odd may be used. Furthermore, it is possible to code whether the absolute value of the coefficient is greater than 3. For this, the flag Abs_greater3_flag indicating whether the absolute value of the coefficient is greater than 3 may be used.

전술한 바와 같이, N 초과 계수 정보는, Abs_greaterN_flag 또는 짝수인지를 나타내는 플래그 중 적어도 하나를 포함할 수 있다. 여기서, N은 1, 2, 3일 수 있으나, 이에 한정되지 아니한다. N은 4, 5, 6, 7, 8, 9 등과 같이 3보다 큰 자연수일 수 있다. As described above, the N excess coefficient information may include at least one of Abs_greaterN_flag or a flag indicating whether it is even. Here, N may be 1, 2, 3, but is not limited thereto. N may be a natural number greater than 3, such as 4, 5, 6, 7, 8, 9, and the like.

그 후, 0이 아니라고 판단된 각 계수에 대해 음수인지 양수인지 나타내는 부호 정보가 부호화 된다(S906). 부호 정보는 Sign_flag가 사용될 수 있다. Then, code information indicating whether it is negative or positive is coded for each coefficient determined to be non-zero (S906). Sign_flag can be used for sign information.

그리고 절대값이 N보다 크다고 판단된 계수에 대해서만 N을 뺀 나머지 값을 잔차 계수 정보로 정의하고 이 계수의 잔여값 정보 remaining_coeff가 부호화 된다(S907). 이때, 각 계수에 대한 정보 부호화를 계수 마다 S904, S905, S906, S907과정을 수행한 후에 다음 계수로 넘어가는 방법으로 할 수 있다. 혹은 서브 블록 내 계수에 대한 정보를 각 단계 별로 한번에 부호화 할 수 있다. 예를 들어, 서브 블록 내 계수가 16개 존재하는 경우, 각 16개의 계수에 대한 S904를 먼저 부호화 하고, S904에서 계수의 절대값이 0이 아니라고 판단 된 계수에 대해서만 S905 과정을 전부 수행하고, S906과정을 수행할 수 있다. 그후, S905 과정에서 현재 계수의 절대값을 표현 불가능한 경우, S907과정을 수행할 수 있다. 넌-제로 계수의 절대값은 Sig_coeff_flag, 하나 이상의 Abs_greaterN_flag, Parity 정보 또는 잔여값 정보 중 적어도 하나를 복호화하여 유도될 수 있다. Then, only the coefficient determined to have an absolute value greater than N, the remaining value minus N is defined as residual coefficient information, and the residual value information remaining_coeff of this coefficient is encoded (S907). At this time, information encoding for each coefficient may be performed as a method of passing to the next coefficient after performing steps S904, S905, S906, and S907 for each coefficient. Alternatively, information on coefficients in a sub-block may be coded for each step at a time. For example, if there are 16 coefficients in a sub-block, S904 for each of the 16 coefficients is first coded, and all S905 processes are performed only for coefficients in S904 where the absolute value of the coefficient is determined to be non-zero. You can carry out the process. Thereafter, if it is impossible to express the absolute value of the current coefficient in step S905, step S907 may be performed. The absolute value of the non-zero coefficient may be derived by decoding at least one of Sig_coeff_flag, one or more Abs_greaterN_flag, Parity information, or residual value information.

현재 서브 블록에 대한 계수 정보를 모두 부호화 한 후, 다음 서브 블록이 존재하는지 확인한다(S909). 다음 서브 블록이 존재한다면 다음 서브 블록으로 이동하고(S910) 서브 블록 정보를 부호화 한다(S903). 해당 서브 블록 정보 Coded_sub_blk_flag를 확인하고(S908) Coded_sub_blk_flag의 값이 참인 것으로 확인되면 0이 아닌 계수 정보인 Sig_coeff_flag 를 부호화 한다. 만약 해당 서브 블록 정보 Coded_sub_blk_flag의 값이 거짓이라면 해당 서브 블록에 부호화 할 계수가 존재하지 않는다는 뜻이기 때문에 다음 서브 블록의 존재 여부를 확인한다. 혹은, 다음 서브 블록으로 이동한 후, 해당 서브 블록이 가장 저주파 쪽에 위치한 서브 블록일 경우, 0이 아닌 계수가 존재할 것이라는 가정하에 서브 블록 정보의 부호화 및 복호화 없이 참인 것으로 부호화 및 복호화 시에 동일하게 설정하는 것 또한 가능하다.After encoding coefficient information for the current sub-block, it is checked whether the next sub-block exists (S909). If the next sub-block exists, it moves to the next sub-block (S910) and encodes the sub-block information (S903). The corresponding sub-block information Coded_sub_blk_flag is checked (S908), and when it is determined that the value of Coded_sub_blk_flag is true, Sig_coeff_flag, which is non-zero coefficient information, is encoded. If the value of the corresponding sub-block information Coded_sub_blk_flag is false, it means that there is no coefficient to be encoded in the corresponding sub-block, so check whether the next sub-block exists. Alternatively, after moving to the next sub-block, if the corresponding sub-block is a sub-block located at the lowest frequency side, it is set to the same at the time of encoding and decoding as being true without encoding and decoding of sub-block information on the assumption that there will be a non-zero coefficient. It is also possible to do.

도 9에서는 설명의 편의성을 위해 부호 정보 부호화(S906)를 S905 다음 과정으로 설명하였으나 S904와 S905 사이에 존재하거나 S907 이후에 S906과정을 수행할 수도 있다.In FIG. 9, for convenience of description, code information encoding (S906) is described as a process following S905, but may exist between S904 and S905 or may perform S906 after S907.

도 10은 변환 블록의 복호화 방법을 나타낸 흐름도이다. 도 10의 변환 블록 복호화 방법은 도 9의 변환 블록 부호화 방법에 대응된다. 도 10의 변환 블록의 복호화 방법은 도 5의 영상 복호화 장치(500)의 엔트로피 복호화부(501)에 의해 수행될 수 있다.10 is a flowchart illustrating a method of decoding a transform block. The transform block decoding method of FIG. 10 corresponds to the transform block coding method of FIG. 9. The decoding method of the transform block of FIG. 10 may be performed by the entropy decoding unit 501 of the image decoding apparatus 500 of FIG. 5.

부호화 되는 정보들은 이진화 과정을 통해 문맥 적응적 이진화 산술 과정이 수행된다. 문맥 적응적 이진화 산술 과정이란 블록 내의 부호화 된 정보를 심볼화하고 상황에 따라 확률 정보를 이용하여 심볼의 발생 확률을 다르게 적용하고 부호화 하는 과정을 말한다. 본 예시에서는 설명의 편의성을 위해 심볼을 0과 1만을 사용하였지만, 심볼의 개수는 N개(N은 2이상의 자연수)가 사용될 수 있다. For the encoded information, a context-adaptive binarization arithmetic process is performed through a binarization process. The context-adaptive binarization arithmetic process refers to a process of symbolizing coded information in a block and applying and encoding the probability of occurrence of symbols differently using probability information according to circumstances. In this example, for convenience of explanation, only symbols 0 and 1 are used, but the number of symbols may be N (N is a natural number of 2 or more).

확률 정보란 이진화 된 정보에서 0과 1의 발생 확률을 말한다. 두 정보의 발생 확률을 이전 복원된 정보에 따라서 동일하게 할 수도 있고, 다르게 할 수도 있다. 정보에 따라 M개의 확률 정보를 가질 수도 있다. 이때 M개의 확률 정보는 확률 테이블로 만들어질 수도 있다.Probability information refers to the probability of occurrence of 0 and 1 in binarized information. The probability of occurrence of the two information may be the same or different depending on the previously restored information. It is also possible to have M probability information according to the information. At this time, the M probability information may be made into a probability table.

도 11은 문맥 적응적 이진화 산술 부호화 방법을 나타내는 흐름도이다. 먼저, 확률 초기화가 수행된다(S1101). 확률 초기화란 이진화 된 정보들을 확률 정보에 설정되어 있는 확률로 확률 구간을 나누는 과정이다. 단, 어떤 확률 정보를 사용할 것인지는 부호화 장치 또는 복호화 장치에서 임의로 기 설정된 규칙에 의해 동일한 조건을 사용할 수도 있고, 별도로 확률 정보가 부호화 될 수도 있다. 초기 확률 구간은 기 설정된 규칙에 의해 부호화/복호화 과정에서 동일하게 결정될 수도 있다. 혹은 초기 확률 구간을 새로 부호화 하여 사용 할 수도 있다. 혹은 확률 초기화를 안하고 이전에 사용한 코딩 파라미터의 확률 구간과 확률 정보를 가져올 수도 있다.11 is a flowchart illustrating a context adaptive binary arithmetic coding method. First, probability initialization is performed (S1101). Probability initialization is a process of dividing the binarized intervals into the probability set in the probability information. However, what kind of probability information to use may use the same condition according to a predetermined rule arbitrarily in the encoding device or the decoding device, or the probability information may be separately coded. The initial probability interval may be determined in the same manner in the encoding/decoding process according to a preset rule. Alternatively, the initial probability interval may be newly encoded and used. Alternatively, probability intervals and probability information of previously used coding parameters may be obtained without probability initialization.

부호화할 현재 코딩 파라미터의 이진 정보가 결정되면 (S1102), 현재 코딩 파라미터의 이진화 된 정보는 도 13의 단계 S1102의 이전 단계까지의 확률 구간 상태와, 동일 코딩 파라미터의 이전 확률 정보를 이용하여 부호화된다(S1103). 그리고, 이후에 부호화될 이진 정보들을 위해 확률 정보와 확률 구간이 업데이트(S1104)될 수 있다. 그리고, 다음 부호화될 코딩 파라미터 정보가 존재하는 경우(S1105), 다음 코딩 파라미터 정보로 이동하여(S1106), 전술한 과정을 반복한다. 만약 다음 부호화될 코딩 파라미터 정보가 존재하지 않는다면 본 흐름도는 종료된다.When the binary information of the current coding parameter to be encoded is determined (S1102), the binarized information of the current coding parameter is encoded using the probability interval state up to the previous step of step S1102 in FIG. 13 and the previous probability information of the same coding parameter. (S1103). Then, probability information and probability intervals may be updated (S1104) for binary information to be encoded later. Then, when the coding parameter information to be encoded next exists (S1105), the next coding parameter information is shifted (S1106), and the above-described process is repeated. If the coding parameter information to be encoded next does not exist, this flow chart ends.

도 12는 문맥 적응적 이진화 산술 복호화 방법을 나타내는 흐름도이다. 부호화 장치와 달리, 복호화 장치에서는 확률 정보 및 구간을 이용하여 코딩 파라미터의 이진 정보를 복호화(S1202)한 후, 현재 코딩 파라미터의 정보를 결정(S1203)한다. 이 외 도 12의 복호화 방법은 도 11의 부호화 방법에 대응되므로 상세한 설명은 생략한다.12 is a flowchart illustrating a context-adaptive binary arithmetic decoding method. Unlike the encoding device, the decoding device decodes the binary information of the coding parameter using the probability information and the interval (S1202), and then determines the information of the current coding parameter (S1203). In addition, since the decoding method of FIG. 12 corresponds to the encoding method of FIG. 11, a detailed description is omitted.

상기 설명한 도 11 및 12의 단계 S1103과 S1202에서, 각 코딩 파라미터 별로 주변에 이미 복원된 정보(또는 코딩 파라미터)들을 이용하여 기 설정된 M개의 확률 정보들 중, 최적 확률 정보를 선택적으로 사용하여 부호화 또는 복호화가 진행될 수 있다. In steps S1103 and S1202 of Figs. 11 and 12 described above, coding is performed by selectively using optimal probability information among M probability information preset using information (or coding parameters) already restored around each coding parameter. Decryption may proceed.

예를 들어, 코딩 파라미터의 확률 정보는 변환 블록의 크기에 따라 정보가 발생할 확률이 높은 확률 정보를 사용할 수도 있다. For example, probability information of a coding parameter may use probability information having a high probability of generating information according to the size of a transform block.

또는, 현재 부호화 또는 복호화 할 계수의 주변 계수들의 정보에 따라 확률 정보를 다르게 적용할 수 있고, 이전의 부호화 또는 복호화된 정보의 확률 정보를 이용하여 현재 부호화 또는 복호화 하는 정보의 확률 정보를 선택할 수도 있다. Alternatively, probability information may be differently applied according to information of neighbor coefficients of a coefficient to be encoded or decoded, and probability information of information to be currently encoded or decoded may be selected using probability information of previously encoded or decoded information. .

도 13, 14는 주변 계수들의 정보에 따라 확률 정보를 다르게 적용한 일 예를 나타내는 도면이다. 13 and 14 are diagrams showing an example in which probability information is differently applied according to information of neighboring coefficients.

도 13은 현재 계수의 Sig_coeff_flag 정보값을 부호화 또는 복호화에 사용되는 확률 정보 테이블의 예시이다. 현재 부호화 또는 복호화 할 계수와 인접한 계수들 중 현재 계수의 Sig_coeff_flag 정보값과 동일한 정보값을 갖는 계수의 수가 1개인 경우, 현재 계수에는 인덱스 8이 할당된다. 이 때 현재 계수의 Sig_coeff_flag 이진정보인 심볼 1의 확률은 61% 이고 심볼 0의 확률은 39%가 된다. 만약, 현재 계수의 Sig_coeff_flag 정보값과 동일한 정보값을 갖는 주변 계수의 수가 2개인 경우 현재 계수에는 인덱스 5가 할당되고, 이 때의 현재 계수의 Sig_coeff_flag 이진정보인 심볼 1의 확률은 71% 이고 심볼 0의 확률은 29%이다. 만약 현재 계수의 Sig_coeff_flag 정보값과 동일한 정보값을 갖는 주변 계수의 수가 3개인 경우 현재 계수에는 인덱스 2가 할당되고 현재 계수의 Sig_coeff_flag 이진정보인 심볼 1의 확률은 87%, 심볼 0의 확률은 13%이 된다. 13 is an example of a probability information table used for encoding or decoding the Sig_coeff_flag information value of the current coefficient. If the number of coefficients having the same information value as the Sig_coeff_flag information value of the current coefficient among coefficients adjacent to the current encoding or decoding coefficient is 1, index 8 is assigned to the current coefficient. At this time, the probability of symbol 1, which is the Sig_coeff_flag binary information of the current coefficient, is 61%, and the probability of symbol 0 is 39%. If the number of neighbor coefficients having the same information value as the Sig_coeff_flag information value of the current coefficient is two, index 5 is allocated to the current coefficient, and the probability of symbol 1, which is the Sig_coeff_flag binary information of the current coefficient at this time, is 71% and symbol 0 The probability of is 29%. If the number of neighbor coefficients having the same information value as the Sig_coeff_flag information value of the current coefficient is 3, index 2 is allocated to the current coefficient, and the probability of symbol 1, which is the Sig_coeff_flag binary information of the current coefficient, is 87%, and the probability of symbol 0 is 13%. It becomes.

도 13에 도시된 확률 정보 테이블을 이용하여 현재 계수가 부호화 또는 복호화된 후 도 14와 같이 확률 정보는 업데이트될 수 있다.After the current coefficients are encoded or decoded using the probability information table shown in FIG. 13, probability information may be updated as shown in FIG.

한편, 0이 아닌 계수 정보 Sig_coeff_flag의 경우, 저주파 영역에 가까울수록, 0이 아닌 계수 정보 Sig_coeff_flag의 발생 확률이 높은 확률 정보가 사용될 수 있다. On the other hand, in the case of the non-zero coefficient information Sig_coeff_flag, the closer to the low-frequency region, probability information having a higher probability of occurrence of the non-zero coefficient information Sig_coeff_flag may be used.

그리고, N 초과 계수 정보의 확률 정보는 직전에 부호화/복호화한 N 초과 계수 정보의 확률 정보를 이용하여 현재의 N 초과 계수 정보의 확률 정보를 설정하거나, 서브 블록 단위로 처음 부호화/복호화 하는 N 초과 계수 정보의 확률 정보를 그대로 사용할 수도 있다. 상술한 바와 같이, N 초과 계수 정보는 Abs_greater1_flag, Abs_greater2_flag, Abs_greater3_flag, ??, 또는 Abs_greaterN_flag 중 적어도 하나를 포함할 수 있다Then, the probability information of the N excess coefficient information is set to the probability information of the current N excess coefficient information by using the probability information of the previously encoded/decoded N excess coefficient information, or the N excess that is initially encoded/decoded in units of sub-blocks Probability information of coefficient information may be used as it is. As described above, the N excess coefficient information may include at least one of Abs_greater1_flag, Abs_greater2_flag, Abs_greater3_flag, ??, or Abs_greaterN_flag.

그리고, 서브 블록 정보 Coded_sub_blk_flag는 주변의 부호화/복호화 된 M개의 서브 블록의 확률 정보를 이용하거나 직전에 부호화/복호화 된 서브 블록의 확률 정보를 이용할 수도 있다.In addition, the sub-block information Coded_sub_blk_flag may use probability information of neighboring coded/decoded M sub-blocks, or may use probability information of the immediately coded/decoded sub-block.

도 15는 도 1의 영상 부호화 장치(100)에 화면 내 블록 카피 예측부를 추가한 도면이다. 화면 내 블록 카피 예측부는 현재 부호화 하려는 블록의 예측 블록을 현재 픽쳐 내 복원된 영역을 이용하여 생성할 수 있다.FIG. 15 is a diagram in which an in-screen block copy prediction unit is added to the image encoding apparatus 100 of FIG. 1. The block copy prediction unit in the screen may generate a prediction block of a block to be currently encoded using a reconstructed region in a current picture.

도 16부터 도 21은 화면 내 블록 카피 예측부에서 예측 블록을 생성한 예시이다. 도면에서 CB는 현재 블록, PB는 예측 블록을 나타낸다. 16 to 21 are examples in which a prediction block is generated by an in-screen block copy prediction unit. In the figure, CB indicates a current block and PB indicates a prediction block.

움직임 탐색 범위는 복원된 영역 내에서 제한될 수 있다. 예를 들어, 도 16과 같이 현재 픽쳐 내 복원된 영역으로만 움직임 탐색 범위를 제한할 수 있고, 도 17과 같이 예측 블록 내 일부라도 복원된 영역에 속한다면 움직임 탐색 범위로 설정할 수 있다. 혹은 도 18의 예시와 같이 현재 블록과 예측 블록이 일부 겹치는 경우도 움직임 탐색 범위로 설정할 수 있다. 해당 일부 겹치는 영역에 대해서는 인접한 복원 화소를 이용하여 패딩할 수도 있지만, 복원 화소를 이용하여 겹치는 영역을 예측할 수도 있다. The motion search range may be limited within the reconstructed area. For example, as shown in FIG. 16, the motion search range may be limited to only the reconstructed area in the current picture, and as shown in FIG. 17, if any part of the prediction block belongs to the reconstructed area, the motion search range may be set. Alternatively, as in the example of FIG. 18, a case in which the current block and the prediction block partially overlap may be set as a motion search range. The overlapping region may be padded using adjacent reconstructed pixels, but the overlapped regions may be predicted using the reconstructed pixels.

도 19부터 21까지는 예측 블록과 현재 블록이 겹치는 경우 예측 블록 생성 방법을 나타낸 예시이다. A는 현재 블록과 예측 블록이 겹치는 영역을 의미하고, B는 A를 예측하기 위해 사용하는 주변의 인접한 복원 화소들이다. 예측 블록이 현재 블록의 좌상단, 상단, 우상단, 좌측 등 어느 방향에 존재하느냐에 따라 이용될 수 있는 복원 화소가 달라질 수 있다. 이때 M(M은 1 이상의 정수)개의 화면 내 예측 모드를 이용하여 A영역을 예측할 수 있다. M은 현재 블록에서 이용될 수 있는 화면 내 예측의 예측 모드 개수이다. 도 22는 도 19에서 A영역 화소 예측을 위해 사용될 수 있는 복원 화소 라인과 화면 내 예측 모드의 이용 가능한 M개의 모드 중 좌상단 방향 모드를 이용하여 A영역 화소 예측을 나타낸 예시 도면이다. 19 to 21 are examples illustrating a method of generating a prediction block when the prediction block and the current block overlap. A is a region in which the current block and the prediction block overlap, and B is adjacent reconstructed pixels used to predict A. The reconstructed pixels that can be used may vary depending on which direction the prediction block is in, for example, the upper left, upper, upper right, or left of the current block. At this time, region A may be predicted using M (M is an integer of 1 or more) intra prediction modes. M is the number of prediction modes of intra prediction that can be used in the current block. FIG. 22 is an exemplary diagram illustrating A region pixel prediction using a left top direction mode among M available modes of a reconstructed pixel line and an intra prediction mode in FIG. 19 that can be used for A region pixel prediction.

현재 블록의 움직임 벡터는 도 23의 도면처럼 현재 픽쳐 내 복원 영역에서 현재 블록의 예측 블록을 가리키는 것이 아닌 현재 블록의 참조 화소 라인을 유도하기 위한 복원 화소 라인을 가리키는 것으로 이용할 수도 있다. 현재 블록과 인접하지 않은 복원된 영역의 참조 화소 라인을 이용하여 M개의 예측 모드로 화면 내 예측을 수행하고, 최적의 예측 블록을 생성한 예측 모드를 선택할 수 있다. 이때, W(W는 1개 이상의 정수)개 참조 화소 라인 중 최적의 참조 화소 라인과 예측 모드를 이용하여 예측 블록을 생성할 수 있고, W개 참조 화소 라인에 대하여 각각 다른 예측 모드 혹은 같은 예측 모드를 이용하여 예측 블록들을 생성 후, 생성된 예측 블록들을 가중합하여 최적의 예측 블록을 생성할 수도 있다. The motion vector of the current block may be used to indicate the reconstructed pixel line for deriving the reference pixel line of the current block, rather than the predicted block of the current block in the reconstructed region in the current picture as shown in FIG. 23. In-frame prediction may be performed using M prediction modes using a reference pixel line of a reconstructed region that is not adjacent to the current block, and a prediction mode generating an optimal prediction block may be selected. In this case, a prediction block may be generated by using an optimal reference pixel line and a prediction mode among W (W is an integer of 1 or more) reference pixels, and different prediction modes or the same prediction mode for each of the W reference pixel lines After generating the prediction blocks by using, weighted sum of the generated prediction blocks, an optimal prediction block may be generated.

혹은 화면 내 블록 카피 예측과 화면 내 예측을 이용하여 예측 블록들을 각각 생성 후, 생성된 예측 블록들을 가중합하여 최적의 예측 블록을 생성할 수 있고, 화면 내 블록 카피 예측과 화면 간 예측을 이용하여 예측 블록들을 각각 생성 후, 생성된 예측 블록들을 가중합하여 최적의 예측 블록을 생성할 수도 있다.Alternatively, the prediction blocks may be generated using the block copy prediction and the intra-prediction, respectively, and then weighted sum of the generated prediction blocks to generate an optimal prediction block, and prediction using the inter-block prediction and intra-frame prediction After generating each block, an optimal prediction block may be generated by weighting the generated prediction blocks.

또한, 참조 화소 라인은 상단의 복원된 화소 혹은 좌측의 복원된 화소만을 이용할 수도 있다. 이때, 예측 블록과 현재 블록이 겹치는 경우, 예측 블록 생성시 이용하는 참조 화소 라인을 이용하여 예측 블록을 생성할 수 있다.Also, the reference pixel line may use only the reconstructed pixel at the top or the reconstructed pixel at the left. At this time, when the prediction block and the current block overlap, a prediction block may be generated using a reference pixel line used when generating the prediction block.

도 16부터 도 22까지의 도면에서는 움직임 탐색 범위를 현재 픽쳐로 예시를 들었으나 현재 블록이 속한 CTU 또는 CTU 행 내로 제한하거나 이웃한 CTU까지로 제한할 수도 있다. 예를 들어, 현재 블록(CB)의 움직임 벡터에 의해 지시된 예측 블록(PB)은 현재 블록과 동일한 CTU 또는 CTU 행 내에 속하도록 제한될 수 있다.In the drawings of FIGS. 16 to 22, the motion search range is exemplified as the current picture, but may be limited to the CTU or CTU row to which the current block belongs, or to a neighboring CTU. For example, the prediction block PB indicated by the motion vector of the current block CB may be restricted to belong to the same CTU or CTU row as the current block.

도 24는 영상 부호화 장치의 화면 내 블록 카피 예측부를 자세하게 나타낸 블록도이고, 화면 내 블록 카피 예측(S2401)은 CPR_Merge 후보 탐색부(S2402)와 CPR_AMVP 후보 탐색부(S2404)로 나눌 수 있다. CPR_Merge 후보 탐색부(S2402)는 복원 블록들을 CPR_Merge 후보로 사용할 수 있다. 상기 복원 블록은, 화면 간 예측을 통해 부호화/복호화된 블록일 수도 있고, 주변 블록 중 화면 내 블록 카피(IBC) 모드로 부호화/복호화된 블록으로 제한될 수도 있다. CPR_Merge 후보의 최대 개수는 부호화/복호화 장치에서 동일하게 사용하거나 상위 헤더에서 전송할 수 있다. 여기서, 최대 개수는 2개, 3개, 4개, 5개 또는 그 이상일 수 있다. 상위 헤더란 비디오 파라미터단, 시퀀스 파라미터단, 픽쳐 파라미터단, 슬라이스단 등 픽쳐 및 블록 정보를 포함하는 상위 헤더 정보를 의미한다. CPR_Merge 후보 유도 방법은 도 24를 이용하여 설명한다. 24 is a detailed block diagram of an intra-screen block copy prediction unit of the video encoding apparatus, and the intra-block copy prediction (S2401) may be divided into a CPR_Merge candidate search unit (S2402) and a CPR_AMVP candidate search unit (S2404). The CPR_Merge candidate search unit S2402 may use the reconstructed blocks as a CPR_Merge candidate. The reconstructed block may be a block that is encoded/decoded through inter-frame prediction, or may be limited to a block that is encoded/decoded in an intra-block copy (IBC) mode among neighboring blocks. The maximum number of CPR_Merge candidates can be used in the same manner in the encoding/decoding device or transmitted in the upper header. Here, the maximum number may be 2, 3, 4, 5 or more. The upper header means upper header information including picture and block information such as a video parameter stage, a sequence parameter stage, a picture parameter stage, and a slice stage. The CPR_Merge candidate derivation method will be described with reference to FIG. 24.

도 25는 현재 블록에 인접한 공간적 후보를 나타낸다. AL, A, AR, L, BL은 현재 블록과 같은 픽쳐이면서 CPR_Merge 후보로 이용될 수 있는 복원 블록의 위치이다. 예를 들어, AL, A, AR, L, BL 위치의 복원 블록에서 화면 간 예측 또는 화면 내 블록 카피 예측이 사용된 경우, 이는 CPR_Merge 후보로 사용될 수 있다. 복원 블록은 L, A, AR, BL, AL 순서 혹은 이외에 다양한 우선 순위에 의해서 고려되는 순서가 결정될 수 있다. 공간적으로 인접한 복원 블록은, 현재 블록의 크기가 소정의 문턱크기보다 큰 경우에 한하여 CPR_Merge 후보로 사용될 수 있다. 현재 블록의 크기는, 블록의 너비, 높이, 너비와 높이의 합, 너비와 높이의 곱, 너비와 높이 중 최소값/최대값 등으로 표현될 수 있다. 예를 들어, 현재 블록의 너비와 높이의 곱이 16보다 큰 경우, 상기 복원 블록은 CPR_Merge 후보로 사용되고, 그렇지 않은 경우, 상기 복원 블록은 CPR_Merge 후보로 사용되지 않을 수 있다 25 shows spatial candidates adjacent to the current block. AL, A, AR, L, BL are the same picture as the current block and are the positions of the reconstructed blocks that can be used as CPR_Merge candidates. For example, when inter-frame prediction or intra-screen block copy prediction is used in the reconstructed blocks of the AL, A, AR, L, BL positions, it can be used as a CPR_Merge candidate. In the reconstruction block, L, A, AR, BL, AL order, or other order considered by various priorities may be determined. The spatially adjacent reconstructed block may be used as a CPR_Merge candidate only when the size of the current block is larger than a predetermined threshold size. The size of the current block can be expressed as the width of the block, the height, the sum of the width and height, the product of the width and height, and the minimum/maximum value of the width and height. For example, if the product of the width and height of the current block is greater than 16, the reconstructed block is used as a CPR_Merge candidate, otherwise, the reconstructed block may not be used as a CPR_Merge candidate.

만약, CPR_Merge 후보 리스트에 최대 후보 개수가 채워지지 않을 경우, H 버퍼에 저장된 움직임정보가 CPR_Merge 후보 리스트에 추가될 수도 있다. H 버퍼는 현재 블록 이전에 부호화/복호화가 완료된 블록의 움직임정보를 저장할 수 있다. 또는, CPR_Merge 후보 리스트에 최대 후보 개수가 채워지지 않을 경우, 이전에 복원된 픽쳐에서 현재 블록과 동일한 위치에 존재하는 복원 블록이 화면 내 블록 카피 예측 기술이 사용된 경우, 해당 복원 블록의 움직임 정보를 CPR_Merge 후보로 추가될 수 있다. If the maximum number of candidates is not filled in the CPR_Merge candidate list, motion information stored in the H buffer may be added to the CPR_Merge candidate list. The H buffer may store motion information of a block that has been encoded/decoded before the current block. Alternatively, if the maximum number of candidates is not filled in the CPR_Merge candidate list, when the block copy prediction technique in the reconstructed block existing in the same position as the current block in the previously reconstructed picture is used, the motion information of the reconstructed block is displayed. Can be added as a CPR_Merge candidate.

혹은 현재까지 추가된 CPR_MVP 후보의 개수가 최대 후보 개수보다 적은 경우, 디폴트 벡터 후보가 추가될 수 있다. 디폴트 벡터란, 부호화/복호화 장치에서 동일하게 정해놓은 벡터를 의미할 수 있다. 예를 들어, 디폴트 벡터가 (0, 0), (-10, 0), (0, -10), (-15, 0), (0, -15)이고, CPR_Merge 후보가 2개 부족한 경우, 앞에서부터 차례대로 디폴트 벡터 2개가 CPR_Merge 후보 리스트에 추가될 수 있다. 이후, CPR_Merge 후보 리스트에 각 움직임정보들의 RD-cost를 계산하고 RD-cost가 가장 최적인 움직임정보를 결정한다(S2403). Or, if the number of CPR_MVP candidates added to date is less than the maximum number of candidates, a default vector candidate may be added. The default vector may mean a vector determined in the same manner by the encoding/decoding device. For example, if the default vectors are (0, 0), (-10, 0), (0, -10), (-15, 0), (0, -15), and two CPR_Merge candidates are insufficient, Two default vectors can be added to the CPR_Merge candidate list in order from the front. Thereafter, the RD-cost of each motion information is calculated in the CPR_Merge candidate list, and the most suitable motion information is determined in the RD-cost (S2403).

CPR_AMVP 후보 탐색부(S2404)는 움직임 탐색 범위 내에서 예측 블록을 생성한 후, 주변 블록의 움직임 정보를 이용하여 CPR_MVP 후보 또는 CPR_MVD 정보 중 적어도 하나를 구할 수 있다. CPR_MVP 후보의 최대 개수는 부호화/복호화 장치에서 동일하게 사용하거나 상위 헤더에서 전송할 수 있다. 여기서, 최대 개수는 2개, 3개, 4개, 5개 또는 그 이상일 수 있다. CPR_MVP 정보의 개수는 부호화/복호화 장치에서 동일하게 사용하거나 상위 헤더에서 전송할 수 있다. CPR_MVP 후보를 유도하는 방법은 도 24를 이용하여 설명한다. AL, A, AR, L, BL은 현재 블록과 같은 픽쳐에 속하면서 CPR_MVP 후보로 이용될 수 있는 복원 블록의 위치이다. AL, A, AR, L, BL 위치의 복원 블록에서 화면 간 예측 또는 화면 내 블록 카피 예측이 사용된 경우 CPR_MVP 후보로 사용될 수 있다. 복원 블록은 L, A, AR, BL, AL 순서 혹은 이외에 다양한 우선 순위에 의해서 고려되는 순서가 결정될 수 있다. 공간적으로 인접한 복원 블록은, 현재 블록의 크기가 소정의 문턱크기보다 큰 경우에 한하여 CPR_MVP 후보로 사용될 수 있다. 현재 블록의 크기는, 블록의 너비, 높이, 너비와 높이의 합, 너비와 높이의 곱, 너비와 높이 중 최소값/최대값 등으로 표현될 수 있다. 예를 들어, 현재 블록의 너비와 높이의 곱이 16보다 큰 경우, 상기 복원 블록은 CPR_MVP 후보로 사용되고, 그렇지 않은 경우, 상기 복원 블록은 CPR_MVP 후보로 사용되지 않을 수 있다.The CPR_AMVP candidate search unit S2404 may generate a prediction block within a motion search range, and then obtain at least one of a CPR_MVP candidate or CPR_MVD information using motion information of a neighboring block. The maximum number of CPR_MVP candidates may be used in the same manner in the encoding/decoding device or transmitted in an upper header. Here, the maximum number may be 2, 3, 4, 5 or more. The number of CPR_MVP information can be used in the same manner in the encoding/decoding device or transmitted in the upper header. The method of deriving the CPR_MVP candidate will be described with reference to FIG. 24. AL, A, AR, L, BL belong to the same picture as the current block and are the positions of the reconstructed blocks that can be used as CPR_MVP candidates. When inter-frame prediction or intra-block copy prediction is used in the reconstructed blocks of the AL, A, AR, L, and BL positions, it may be used as a CPR_MVP candidate. In the reconstruction block, L, A, AR, BL, AL order, or other order considered by various priorities may be determined. The spatially adjacent reconstructed block may be used as a CPR_MVP candidate only when the size of the current block is larger than a predetermined threshold size. The size of the current block can be expressed as the width of the block, the height, the sum of the width and height, the product of the width and height, and the minimum/maximum value of the width and height. For example, if the product of the width and height of the current block is greater than 16, the reconstructed block is used as a CPR_MVP candidate, otherwise, the reconstructed block may not be used as a CPR_MVP candidate.

만약, CPR_MVP 후보 리스트에 최대 후보 개수가 채워지지 않을 경우, H 버퍼에 저장된 움직임정보가 CPR_MVP 후보 리스트에 추가될 수도 있다. H 버퍼는 현재 블록 이전에 부호화/복호화가 완료된 블록의 움직임정보를 저장할 수 있다. 또는, CPR_MVP 후보 리스트에 최대 후보 개수가 채워지지 않을 경우, 이전에 복원된 픽쳐에서 현재 블록과 동일한 위치에 존재하는 복원 블록이 화면 내 블록 카피 예측 기술이 사용된 경우, 해당 복원 블록의 움직임 정보가 CPR_MVP 후보로 추가될 수 있다. If the maximum number of candidates is not filled in the CPR_MVP candidate list, motion information stored in the H buffer may be added to the CPR_MVP candidate list. The H buffer may store motion information of a block that has been encoded/decoded before the current block. Or, if the maximum number of candidates is not filled in the CPR_MVP candidate list, when the block copy prediction technique in the reconstructed block existing in the same position as the current block in the previously reconstructed picture is used, motion information of the reconstructed block is used. It can be added as a CPR_MVP candidate.

현재까지 추가된 CPR_MVP 후보의 개수가 최대 후보 개수보다 적은 경우, 디폴트 벡터가 CPR_MVP 후보 리스트에 추가될 수 있다. CPR_MVD 정보는 현재 블록의 움직임 정보와 CPR_MVP 후보에 저장된 움직임 정보의 차분값을 CPR_MVD 정보가 될 수 있다. 예를 들어, 현재 블록의 움직임 벡터는 (-14, -14)이고, CPR_MVP 후보의 움직임 벡터는 (-13, -13)인 경우, CPR_MVD 정보는 ((-14) - (-13), (-14) - (-13)) 차분값인 (1, 1)이 될 수 있다. 혹은 움직임 탐색 범위가 현재 블록과 예측 블록이 중첩될 수 없는 경우, 현재 블록의 크기에 따라 움직임 벡터를 다음 수학식1, 2로 나타낼 수 있다.If the number of CPR_MVP candidates added up to now is less than the maximum number of candidates, a default vector may be added to the CPR_MVP candidate list. The CPR_MVD information may be CPR_MVD information, which is a difference between a motion information of a current block and motion information stored in a CPR_MVP candidate. For example, if the motion vector of the current block is (-14, -14) and the motion vector of the CPR_MVP candidate is (-13, -13), the CPR_MVD information is ((-14)-(-13), ( -14)-(-13)) It can be the difference value (1, 1). Alternatively, when the motion search range cannot overlap the current block and the prediction block, the motion vector may be expressed by Equations 1 and 2 according to the size of the current block.

Figure pat00001
Figure pat00001

Figure pat00002
Figure pat00002

수학식 1, 2에서 Curr_MV.x와 Curr_MV.y는 현재 블록 움직임 벡터의 x, y 성분이다. Curr_blk_width와 Curr_blk_height은 현재 블록의 가로, 세로 크기일 수도 있고, 가로 크기의 1/2, 세로 크기의 1/2일 수도 있는 등 다양한 값으로 결정될 수 있다. MV는 최종적으로 유도된 현재 블록의 움직임 벡터이다. 예를 들어, 현재 블록의 움직임 벡터는 (-14, -14)이고, 현재 블록의 크기는 (4, 4)인 경우, 움직임 벡터를 (-10, -10)으로 설정할 수 있다. 현재 블록의 움직임 벡터에서 현재 블록의 가로, 세로 길이의 절반만을 빼 준 것을 현재 블록의 움직임 벡터로 결정할 수도 있다. 이후, CPR_MVP 후보 리스트에 각 움직임정보들의 RD-cost를 계산하고 RD-cost가 가장 최적인 움직임정보를 결정한다(S2405).In Equations 1 and 2, Curr_MV.x and Curr_MV.y are the x and y components of the current block motion vector. Curr_blk_width and Curr_blk_height may be determined by various values, such as horizontal or vertical size of the current block, 1/2 of horizontal size, or 1/2 of vertical size. MV is a motion vector of the current block finally derived. For example, if the motion vector of the current block is (-14, -14) and the size of the current block is (4, 4), the motion vector may be set to (-10, -10). The motion vector of the current block may be determined by subtracting only half the length and width of the current block from the motion vector of the current block. Thereafter, the RD-cost of each motion information is calculated in the CPR_MVP candidate list, and the most suitable motion information for the RD-cost is determined (S2405).

화면 내 블록 카피 예측부에서는 CPR_Merge 후보 탐색부와 CPR_AMVP 후보 탐색부 중 하나를 이용하여 현재 블록의 움직임 정보를 결정한 후, 움직임 보상(S2406)을 통해 예측 블록이 생성된다.In the block copy prediction unit in the screen, motion information of the current block is determined using one of the CPR_Merge candidate search unit and the CPR_AMVP candidate search unit, and then a prediction block is generated through motion compensation (S2406).

도 26은 예측 모드 정보를 부호화 하는 방법이다.26 is a method of encoding prediction mode information.

Skip 모드 동작 정보 부호화(S2601)는 부호화 장치에서 예측 블록을 복원 블록으로 사용하는지에 대한 여부를 알려주는 정보이다.Skip mode operation information encoding (S2601) is information that indicates whether a prediction block is used as a reconstruction block in an encoding device.

예측 모드 부호화(S2602)는 현재 블록의 예측 모드가 화면 간 예측, 화면 내 예측, 화면 내 블록 카피 예측인지를 부호화할 수 있다. 화면 간 예측으로 부호화된 경우(S2603), 화면 간 예측부 모드 정보를 부호화(S2604) 할 수 있다. 화면 간 예측부 모드 정보 부호화(S2604)는 도 4의 화면 간 예측부 모드 정보 부호화(40)와 동일한 역할을 수행할 수 있다. 예측 모드가 화면 내 예측으로 부호화된 경우(S2605), 화면 내 예측부 모드 정보를 부호화(S2606) 할 수 있다. 화면 내 예측부 모드 정보 부호화는 도 4의 화면 내 예측부 모드 정보 부호화(41)와 동일한 역할을 수행할 수 있다. 화면 내 블록 카피 예측 모드가 선택된 경우, CPR_Merge모드 동작 정보를 부호화할 수 있다(S2607). CPR_Merge 모드가 동작을 한다면(S2608) CPR_Merge 후보 색인 부호화(S2609)를 할 수 있다. CPR_Merge 모드가 동작을 안한다면 CPR_MVD 정보 부호화(S2610), CPR_MVP 후보를 부호화(S2611) 할 수 있다. 만약, CPR_MVP 후보와 CPR_MVD 정보를 이용하여 현재 블록과 예측 블록이 겹친다고 판단된다면 추가적으로 겹치는 영역에 대한 예측 모드를 부호화 할 수 있다. 또한, 도 23의 예시에 의해 화면 내 예측이 수행되는 경우, CPR_Merge 후보 부호화(S2609), CPR_MVP 후보 부호화(S2611) 이후, 화면 내 예측 모드 정보 부호화(S2606)가 수행될 수 있다. The prediction mode encoding (S2602) may encode whether the prediction mode of the current block is inter prediction, intra prediction, or intra block prediction. When it is encoded by inter-screen prediction (S2603), inter-screen prediction unit mode information may be encoded (S2604). The inter-prediction mode information encoding (S2604) may perform the same function as the inter-prediction mode information encoding 40 of FIG. 4. When the prediction mode is encoded by intra-prediction (S2605), intra-prediction mode information may be encoded (S2606). The intra prediction mode information encoding may perform the same function as the intra prediction mode information encoding 41 of FIG. 4. When an intra-block prediction mode is selected, CPR_Merge mode operation information may be encoded (S2607). If the CPR_Merge mode operates (S2608), CPR_Merge candidate index encoding (S2609) may be performed. If the CPR_Merge mode does not operate, CPR_MVD information encoding (S2610) and CPR_MVP candidates may be encoded (S2611). If it is determined that the current block and the prediction block overlap using the CPR_MVP candidate and the CPR_MVD information, the prediction mode for the overlapping region may be additionally encoded. In addition, when intra prediction is performed by the example of FIG. 23, after CPR_Merge candidate encoding (S2609) and CPR_MVP candidate encoding (S2611), intra prediction mode information encoding (S2606) may be performed.

이때, 상위 헤더 설정에 의해 현재 픽쳐에서 이용할 수 있는 이전에 복원된 픽쳐가 존재하지 않는 경우, 예측 모드 부호화(S2602)시 화면 간 예측부 모드 정보는 생략될 수 있다.In this case, if there is no previously reconstructed picture that can be used in the current picture by setting the upper header, inter-prediction mode information may be omitted during prediction mode encoding (S2602 ).

도 4를 이용하여 예측 모드 정보 부호화를 할 수도 있다.Prediction mode information encoding may be performed using FIG. 4.

화면 내 블록 카피 예측부 모드 정보를 화면 간 예측부 모드 정보로 나타낼 수 있다. 화면 간 예측 정보에 설정된 참조 픽쳐 색인 정보에 현재 픽쳐 정보를 추가하여 나타낼 수 있다. 예를 들어, 참조 픽쳐 색인이 0번부터 4번까지 존재 하는 경우, 0번부터 3번은 이전에 복원된 픽쳐를 의미하고, 4번은 현재 픽쳐를 의미할 수 있다. Merge 후보 색인 부호화(S403)시 과거 방향 정보를 이용하면서 과거 방향 참조 픽쳐 색인 정보가 현재 픽쳐인 경우, 화면 내 블록 카피 예측 기술이 수행될 수 있고, 나머지 경우, 화면 간 예측 기술이 수행될 수 있다. 또한, AMVP 모드 정보 부호화시, 예측 방향 정보는 과거 방향이 부호화(S408) 되고, 과거 방향 참조 픽쳐 색인 정보가 현재 픽쳐로 부호화(S410) 되는 경우, 과거 방향 MVD정보(S411)와 과거 방향 MVP 후보(S412)는 화면 내 블록 카피 예측을 위한 정보이고, 나머지 경우, 화면 간 예측 기술 정보일 수도 있다. 이때, 상위 헤더 설정에 의해 현재 픽쳐에서 이용할 수 있는 이전에 복원된 픽쳐가 존재하지 않는 경우, 예측 방향 부호화(S408), 과거 방향 참조 픽쳐 색인 정보 부호화(S410), 미래 방향 참조 픽쳐 색인 정보 부호화(S414), 미래 방향 MVD 정보 부호화(S415), 미래 방향 MVP 정보 부호화(S416) 과정을 생략할 수 있고, 예측 모드 부호화 단계에서 화면 간 예측이 부호화 된다면 이는 화면 간 예측이 아닌 화면 내 블록 카피 예측을 의미할 수 있다.In-screen block copy prediction unit mode information may be represented as inter-screen prediction unit mode information. The current picture information may be displayed by adding the reference picture index information set in the inter-screen prediction information. For example, when the reference picture index exists from 0 to 4, 0 to 3 may mean a previously reconstructed picture, and 4 may refer to a current picture. In the case of Merge candidate index encoding (S403), when the past direction reference picture index information is the current picture while using the past direction information, an intra-screen block copy prediction technique may be performed, and in other cases, an inter-screen prediction technique may be performed. . In the case of AMVP mode information encoding, when the past direction is encoded (S408) and the past direction reference picture index information is encoded as the current picture (S410), the past direction MVD information (S411) and the past direction MVP candidate are predicted. (S412) is information for predicting block copy in the screen, and in other cases, it may be inter-screen prediction technology information. At this time, if there is no previously reconstructed picture available in the current picture by setting the upper header, prediction direction encoding (S408), past direction reference picture index information encoding (S410), and future direction reference picture index information encoding ( S414), future direction MVD information encoding (S415) and future direction MVP information encoding (S416) can be omitted, and if inter prediction is coded in the prediction mode encoding step, this is not inter prediction but is not inter prediction. Can mean

도 27은 도 5의 영상 복호화 장치(500)에 화면 내 블록 카피 예측부(S2609)를 추가한 도면이다.FIG. 27 is a diagram in which an in-screen block copy prediction unit S2609 is added to the image decoding apparatus 500 of FIG. 5.

도 28은 영상 복호화 장치의 화면 내 블록 카피 예측부를 도시한다.28 illustrates an in-block block copy prediction unit of an image decoding apparatus.

화면 내 블록 카피 예측부(2800)는 도 24의 최적의 예측 모드를 결정하는 과정만 빠져 있고, 최적이라고 판단된 예측 모드를 받아서 예측 블록을 생성하는 과정은 영상 부호화 장치의 화면 내 블록 카피 예측부(2400)와 실질적으로 동일하게 동작한다. The in-screen block copy prediction unit 2800 is missing the process of determining the optimal prediction mode of FIG. 24, and the process of generating the prediction block by receiving the prediction mode determined as optimal is the in-screen block copy prediction unit of the image encoding apparatus. It operates substantially the same as 2400.

도 29는 예측 모드 정보를 복호화 하는 방법이다.29 is a method of decoding prediction mode information.

Skip 모드 동작 정보 복호화(S2901)는 복호화 장치에서 예측 블록을 복원 블록으로 사용하는지에 대한 여부를 알려주는 정보이다.Skip mode operation information decoding (S2901) is information that indicates whether the decoding device uses a prediction block as a reconstruction block.

예측 모드 복호화(S2902)는 현재 블록의 예측 모드가 화면 간 예측, 화면 내 예측, 화면 내 블록 카피 예측인지를 복호화할 수 있다. 화면 간 예측으로 복호화된 경우(S2903), 화면 간 예측부 모드 정보를 복호화(S2904) 할 수 있다. 화면 간 예측부 모드 정보 복호화(S2904)는 도 8의 화면 간 예측부 모드 정보 복호화(80)와 동일한 역할을 수행할 수 있다. 예측 모드가 화면 내 예측으로 복호화된 경우(S2905), 화면 내 예측부 모드 정보를 복호화(S2906) 할 수 있다. 화면 내 예측부 모드 정보 복호화는 도 8의 화면 내 예측부 모드 정보 복호화(81)와 동일한 역할을 수행할 수 있다. 화면 내 블록 카피 예측 모드가 선택된 경우, CPR_Merge모드 동작 정보를 복호화할 수 있다(S2907). CPR_Merge 모드가 동작을 한다면(S2908) CPR_Merge 후보 색인 복호화(S2909)를 할 수 있다. CPR_Merge 모드가 동작을 안한다면 CPR_MVD 정보 복호화(S2910), CPR_MVP 후보를 복호화(S2911) 할 수 있다. 만약, CPR_MVP 후보와 CPR_MVD 정보를 이용하여 현재 블록과 예측 블록이 겹친다고 판단된다면 추가적으로 겹치는 영역에 대한 예측 모드를 복호화 할 수 있다. 또한, 도 23의 예시에 의해 화면 내 예측이 수행되는 경우, CPR_Merge 후보 복호화(S2909), CPR_MVP 후보 복호화(S2911) 이후, 화면 내 예측 모드 정보 복호화(S2906)가 수행될 수 있다. The prediction mode decoding (S2902) may decode whether the prediction mode of the current block is inter-screen prediction, intra-screen prediction, or intra-block copy prediction. When decoded by inter-screen prediction (S2903), inter-screen prediction unit mode information may be decoded (S2904). The inter-prediction mode information decoding (S2904) may perform the same function as the inter-prediction mode information decoding 80 of FIG. 8. When the prediction mode is decoded by intra-prediction (S2905), the intra-prediction mode information may be decoded (S2906). Decoding the intra prediction unit mode information may perform the same role as the intra prediction unit information decoding 81 of FIG. 8. When the block copy prediction mode in the screen is selected, CPR_Merge mode operation information may be decoded (S2907). If the CPR_Merge mode operates (S2908), CPR_Merge candidate index decoding (S2909) may be performed. If the CPR_Merge mode does not operate, CPR_MVD information decoding (S2910) and CPR_MVP candidates may be decoded (S2911). If it is determined that the current block and the prediction block overlap using the CPR_MVP candidate and the CPR_MVD information, the prediction mode for the overlapping region may be additionally decoded. In addition, when intra-prediction is performed by the example of FIG. 23, after CPR_Merge candidate decoding (S2909) and CPR_MVP candidate decoding (S2911), intra-screen prediction mode information decoding (S2906) may be performed.

이때, 상위 헤더 설정에 의해 현재 픽쳐에서 이용할 수 있는 이전에 복원된 픽쳐가 존재하지 않는 경우, 예측 모드 복호화(S2902)시 화면 간 예측부 모드 정보는 생략될 수 있다.In this case, if there is no previously reconstructed picture that can be used in the current picture by setting the upper header, inter-prediction mode information may be omitted during prediction mode decoding (S2902 ).

도 8을 이용하여 예측 모드 정보 복호화를 할 수도 있다.The prediction mode information may be decoded using FIG. 8.

화면 내 블록 카피 예측부 모드 정보를 화면 간 예측부 모드 정보로 나타낼 수 있다. 화면 간 예측 정보에 설정된 참조 픽쳐 색인 정보에 현재 픽쳐 정보를 추가하여 나타낼 수 있다. 예를 들어, 참조 픽쳐 색인이 0번부터 4번까지 존재 하는 경우, 0번부터 3번은 이전에 복원된 픽쳐를 의미하고, 4번은 현재 픽쳐를 의미할 수 있다. Merge 후보 색인 복호화(S803)시 과거 방향 정보를 이용하면서 과거 방향 참조 픽쳐 색인 정보가 현재 픽쳐인 경우, 화면 내 블록 카피 예측 기술이 수행될 수 있고, 나머지 경우, 화면 간 예측 기술이 수행될 수 있다. 또한, AMVP 모드 정보 복호화시, 예측 방향 정보는 과거 방향이 복호화(S808) 되고, 과거 방향 참조 픽쳐 색인 정보가 현재 픽쳐로 복호화(S810) 되는 경우, 과거 방향 MVD정보(S811)와 과거 방향 MVP 후보(S812)는 화면 내 블록 카피 예측을 위한 정보이고, 나머지 경우, 화면 간 예측 기술 정보일 수도 있다. 이때, 상위 헤더 설정에 의해 현재 픽쳐에서 이용할 수 있는 이전에 복원된 참조 픽쳐가 존재하지 않는 경우, 예측 방향 복호화(S808), 과거 방향 참조 픽쳐 색인 정보 복호화(S810), 미래 방향 참조 픽쳐 색인 정보 복호화(S814), 미래 방향 MVD 정보 복호화(S815), 미래 방향 MVP 정보 복호화(S816) 과정을 생략할 수 있고, 예측 모드 복호화 단계에서 화면 간 예측이 복호화 된다면 이는 화면 간 예측이 아닌 화면 내 블록 카피 예측을 의미할 수 있다.In-screen block copy prediction unit mode information may be represented as inter-screen prediction unit mode information. The current picture information may be displayed by adding the reference picture index information set in the inter-screen prediction information. For example, when the reference picture index exists from 0 to 4, 0 to 3 may mean a previously reconstructed picture, and 4 may refer to a current picture. In the case of decoding the Merge candidate index (S803), if the past direction reference picture index information is the current picture while using the past direction information, an intra-screen block copy prediction technique may be performed, and in other cases, an inter-screen prediction technique may be performed. . In the case of decoding AMVP mode information, when the past direction is decoded (S808) and the past direction reference picture index information is decoded (S810) as the current picture, the past direction MVD information (S811) and the past direction MVP candidate are decoded. (S812) is information for predicting block copy in the screen, and in other cases, it may be inter-screen prediction technology information. At this time, if there is no previously restored reference picture available in the current picture by setting the upper header, prediction direction decoding (S808), past direction reference picture index information decoding (S810), and future direction reference picture index information decoding (S814), the future direction MVD information decoding (S815), the future direction MVP information decoding (S816) process can be omitted, and if the inter-screen prediction is decoded in the prediction mode decoding step, this is not inter-screen prediction, rather than intra-screen copy copy prediction Can mean

도 30은 양자화된 변환 계수(이하, '변환 계수'라 칭함)의 부호화 방법을 나타낸 흐름도이다. 영상 부호화 장치(100, 1500)의 엔트로피 부호화부(107, 1507)에 의해 수행될 수 있다.30 is a flowchart illustrating a method of encoding quantized transform coefficients (hereinafter, referred to as'transform coefficients'). It may be performed by the entropy encoding units 107 and 1507 of the image encoding apparatuses 100 and 1500.

먼저 역 스캔 순서에 따라서 변환 계수들을 스캔할 때 최초의 0이 아닌 계수를 기준 계수로 정하고, 그 위치 정보(Last_sig)를 부호화 할 수 있다(S3001). First, when scanning transform coefficients according to an inverse scan order, the first non-zero coefficient may be determined as a reference coefficient, and the position information (Last_sig) may be encoded (S3001).

기준 계수가 포함된 서브 블록을 선택하고(S3002) 해당 서브 블록 내 변환 계수 정보를 부호화 할 수 있다. 기준 계수가 포함된 서브 블록이 아닌 경우, 변환 블록 내 계수를 부호화 하기 전에 서브 블록 정보를 부호화 할 수 있다(S3003). 서브 블록 정보인 Coded_sub_blk_flag 는 현재 서브 블록 내에 0이 아닌 변환 계수가 적어도 하나 이상 있는지를 알려주는 플래그이다. 서브 블록 내 계수 정보를 부호화 하기 전에 제1 부호화된 정보 개수와 제2 부호화된 정보 개수를 0으로 초기화 할 수 있다. 제1 부호화된 정보는 0초과 계수 정보(S3006), 1초과 계수 정보(S3006), Parity 정보(S3007)가 부호화된 개수이다. 제2 부호화된 정보는 3초과 계수 정보(S3010)가 부호화된 개수이다. 제1 단계 계수 정보 부호화란 0초과 계수 정보, 1 초과 계수 정보, Parity 정보 부호화하는 단계를 의미한다(S3006, S3007, S3008). 제2 단계 계수 정보 부호화는 3 초과 계수 정보를 부호화 하는 단계이다(S3010).The sub-block including the reference coefficient may be selected (S3002), and transform coefficient information in the corresponding sub-block may be encoded. If the sub-block including the reference coefficient is not, the sub-block information may be encoded before encoding the coefficient in the transform block (S3003). The sub-block information Coded_sub_blk_flag is a flag indicating whether there is at least one non-zero transform coefficient in the current sub-block. Before encoding coefficient information in a sub-block, the number of first coded information and the number of second coded information may be initialized to zero. The first coded information is the number of 0-coefficient information (S3006), 1-coefficient coefficient information (S3006), and parity information (S3007). The second coded information is the number of coded coefficients (S3010) exceeding three. The first step coefficient information encoding refers to a step of encoding the zero excess coefficient information, one greater coefficient information, and parity information (S3006, S3007, S3008). Coding of the second step coefficient information is a step of encoding three or more coefficient information (S3010).

그 후, 역 스캔 순으로 현재 부호화될 변환 계수를 선택할 수 있다(S3004). PosL은 제1 단계 계수 정보 부호화 과정에 의해 현재 서브 블록 내 역 스캔 순서상 부호화 되지 않은 변환 계수의 첫번째 위치를 의미한다. 서브 블록 내 가장 먼저 부호화 할 변환 계수를 선택한 후, 현재 변환 계수의 절대값이 0초과인지를 나타내는 0 초과 계수 정보(S3006)를 부호화할 수 있다. 현재 변환 계수가 0이 아니라고 판단되면 현재 변환 계수가 절대값 1을 초과 하는지를 나타내는 1 초과 계수 정보를 부호화(S3007)할 수 있다. 그후, 1 초과 계수 정보로 인해 현재 변환 계수의 절대값이 1보다 크다고 판단되면 Parity 정보를 부호화(S3008)하여 현재 변환 계수의 Parity를 알려준다. 예를 들어, Parity 정보는 현재 변환 계수의 절대값이 짝수인지 아니면 홀수인지를 나타낼 수 있다.Thereafter, the transform coefficients to be currently encoded may be selected in an inverse scan order (S3004). PosL means the first position of the transform coefficient that is not encoded in the inverse scan order in the current sub-block by the first step coefficient information encoding process. After selecting a transform coefficient to be encoded first in a sub-block, it is possible to encode the zero-over-coefficient information (S3006) indicating whether the absolute value of the current transform coefficient exceeds 0. When it is determined that the current transform coefficient is not 0, information on the coefficient of excess 1 indicating whether the current transform coefficient exceeds the absolute value 1 may be encoded (S3007 ). Thereafter, if it is determined that the absolute value of the current transform coefficient is greater than 1 due to the coefficient information exceeding 1, the parity information is encoded (S3008) to inform the parity of the current transform coefficient. For example, parity information may indicate whether the absolute value of the current transform coefficient is even or odd.

이때 0 초과 계수 정보, 1초과 계수 정보, Parity 정보가 부호화 된다면 제1 부호화된 정보 개수를 증가시킨다(S3006, S3007, S3008). 예를 들어, 0 초과 계수 정보, 1초과 계수 정보 또는 Parity 정보 중 적어도 하나가 부호화되면, 제1 부호화된 정보 개수가 1만큼 증가될 수 있다. 또는, 0 초과 계수 정보, 1초과 계수 정보 또는 Parity 정보 중 적어도 하나가 각각 부호화될 때마다 제1 부호화된 정보 개수가 1씩 증가될 수 있다. At this time, the number of the first coded information is increased if the information of the 0 excess coefficient, the information of the 1 excess coefficient, and the parity information are encoded (S3006, S3007, S3008). For example, when at least one of the coefficient information exceeding 0, the coefficient exceeding 1, or the parity information is encoded, the number of the first encoded information may be increased by 1. Alternatively, the number of first coded information may be increased by 1 whenever at least one of the coefficient information exceeding 0, the coefficient exceeding 1, or the parity information is respectively coded.

다시 말해, 제1 부호화된 정보 개수는, 하나의 블록에 대해서 허용되는 계수 정보의 최대 개수를 의미할 수 있다. 여기서, 블록은 변환 블록을 의미하거나, 변환 블록의 서브 블록을 의미할 수 있다. 또한, 상기 계수 정보는, 0 초과 계수 정보, 1초과 계수 정보, 또는 Parity 정보 중 적어도 하나를 포함할 수 있다. 제1 부호화된 정보 개수는, 비디오 시퀀스, 픽쳐, 슬라이스, 코딩 트리 블록(CTU), 코딩 블록(CU), 변환 블록(TU) 또는 변환 블록의 서브 블록의 단위로 정의될 수 있다. 즉, 해당 단위에 속한 모든 변환 블록 또는 서브 블록에 대해서 동일한 제1 부호화된 정보 개수가 결정/설정될 수 있다.In other words, the number of first coded information may mean the maximum number of coefficient information allowed for one block. Here, the block may mean a transform block or a sub-block of the transform block. In addition, the coefficient information may include at least one of coefficient information exceeding 0, coefficient information exceeding 1, or parity information. The number of first coded information may be defined in units of a video sequence, picture, slice, coding tree block (CTU), coding block (CU), transform block (TU), or subblock of the transform block. That is, the same number of first coded information may be determined/set for all transform blocks or sub-blocks belonging to the corresponding unit.

그 후, PosL 값을 1 감소하여 부호화할 변환 계수를 다음 계수로 바꿔준다. 이때, 제1 부호화된 정보 개수가 제1 임계값을 넘어가거나 현재 서브 블록 내 제1 단계 계수 정보 부호화가 완료 되었다면, 3초과 계수 정보 부호화 단계로 넘어갈 수 있다. 그렇지 않은 경우, 다음 계수 정보를 부호화할 수 있다. 제1 임계값은 서브 블록 단위로 부호화할 수 있는 0 초과 계수 정보, 1 초과 계수 정보, Parity 정보 중 적어도 하나의 최대 개수이다(S3006, S3007, S3008). After that, the PosL value is decreased by 1 to change the transform coefficient to be encoded into the next coefficient. At this time, if the number of the first coded information exceeds the first threshold value, or if the first step coefficient information encoding in the current sub-block is completed, it may be skipped to the step 3 coefficient information encoding. Otherwise, the next coefficient information can be encoded. The first threshold is a maximum number of at least one of 0 excess coefficient information, 1 excess coefficient information, and parity information that can be coded in units of sub-blocks (S3006, S3007, and S3008).

역 스캔 순으로 Parity 정보가 부호화된 변환 계수에 대해서만 3초과 계수 정보를 부호화 할 수 있다(S3010). 3 초과 계수 정보를 부호화 하는 경우, 제2 부호화된 정보 개수를 증가시킬 수 있다. 제2 부호화된 정보 개수가 제2 임계값을 넘어가거나 현재 서브 블록의 제2 단계의 계수 정보 부호화가 완료 되는 경우, 다음 단계로 넘어갈 수 있다(S3011). 제2 임계값은 서브 블록 단위로 부호화할 수 있는 3 초과 계수 정보의 최대 개수이다. Only the transform coefficients in which the parity information is coded in the reverse scan order can be encoded with over 3 coefficient information (S3010). When the excess coefficient information is encoded, the number of second coded information may be increased. When the number of the second coded information exceeds the second threshold value or when the coefficient information encoding of the second step of the current sub-block is completed, the next step may be passed (S3011). The second threshold value is a maximum number of 3 or more coefficient information that can be coded in units of sub-blocks.

또는, 제1 부호화된 정보는 소정의 단위로 부호화할 수 있는 계수 정보의 최대 개수를 의미할 수 있다. 계수 정보는, 0초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3초과 계수 정보 중 적어도 하나를 포함할 수 있다. 이 경우, 제1 단계 계수 정보 부호화 단계에 3 초과 계수 정보를 부호화하는 단계가 포함될 수도 있다. Alternatively, the first coded information may mean the maximum number of coefficient information that can be coded in a predetermined unit. The count information may include at least one of 0 count coefficient information, 1 time count information, Parity information, or 3 time count information. In this case, the step of encoding the coefficient information exceeding 3 may be included in the step of encoding the coefficient information.

구체적으로, 현재 변환 계수의 절대값이 0초과인지를 나타내는 0 초과 계수 정보를 부호화할 수 있다. 현재 변환 계수가 0이 아니라고 판단되면, 현재 변환 계수가 절대값 1을 초과 하는지를 나타내는 1 초과 계수 정보를 부호화할 수 있다. 그후, 1 초과 계수 정보로 인해 현재 변환 계수의 절대값이 1보다 크다고 판단되면, Parity 정보를 부호화하고, 3 초과 계수 정보를 부호화할 수 있다.Specifically, it is possible to encode the information of the excess zero coefficient indicating whether the absolute value of the current transform coefficient exceeds zero. If it is determined that the current transform coefficient is not 0, it is possible to encode over 1 coefficient information indicating whether the current transform coefficient exceeds the absolute value 1. Thereafter, if it is determined that the absolute value of the current transform coefficient is greater than 1 due to the information on the coefficient exceeding 1, parity information may be encoded and information on coefficient 3 exceeding may be encoded.

이때 0 초과 계수 정보, 1초과 계수 정보, Parity 정보, 3 초과 계수 정보가 부호화되면, 제1 부호화된 정보 개수를 증가시킨다. 예를 들어, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나가 부호화되면, 제1 부호화된 정보 개수가 1만큼 증가될 수 있다. 또는, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나가 각각 부호화될 때마다 제1 부호화된 정보 개수가 1씩 증가될 수 있다. At this time, if the 0 excess coefficient information, the 1 excess coefficient information, the parity information, and the 3 excess coefficient information are encoded, the number of first coded information is increased. For example, if at least one of the 0 excess coefficient information, the 1 excess coefficient information, the parity information, or the 3 excess coefficient information is encoded, the number of first coded information may be increased by 1. Alternatively, the number of first coded information may be increased by 1 whenever at least one of the 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information is respectively coded.

다시 말해, 제1 부호화된 정보 개수는, 하나의 블록에 대해서 허용되는 계수 정보의 최대 개수를 의미할 수 있다. 여기서, 블록은 변환 블록을 의미하거나, 변환 블록의 서브 블록을 의미할 수 있다. 또한, 상기 계수 정보는, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나를 포함할 수 있다. 제1 부호화된 정보 개수는, 비디오 시퀀스, 픽쳐, 슬라이스, 코딩 트리 블록(CTU), 코딩 블록(CU), 변환 블록(TU) 또는 변환 블록의 서브 블록의 단위로 정의될 수 있다. 즉, 해당 단위에 속한 모든 변환 블록 또는 서브 블록에 대해서 동일한 제1 부호화된 정보 개수가 결정/설정될 수 있다. In other words, the number of first coded information may mean the maximum number of coefficient information allowed for one block. Here, the block may mean a transform block or a sub-block of the transform block. In addition, the coefficient information may include at least one of 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information. The number of first coded information may be defined in units of a video sequence, picture, slice, coding tree block (CTU), coding block (CU), transform block (TU), or subblock of the transform block. That is, the same number of first coded information may be determined/set for all transform blocks or sub-blocks belonging to the corresponding unit.

PosC는 현재 부호화할 변환 계수의 위치를 의미한다. PosL이 PosC보다 작은 경우(S3012), 제1 단계 계수 정보가 부호화 되었다는 것을 알 수 있다. N초과 계수 정보를 부호화 한 후, 현재 변환 계수의 Parity 정보로 알 수 있는 현재 변환 계수 최소 절대값을 현재 계수 값에서 뺀 후, 차분 계수의 절대값을 부호화할 수 있다(S3013). 여기서 N은 3이상의 수를 나타내고, 부호화/복호화 장치에서 동일한 값을 사용하거나 상위 헤더에서 전송할 수 있다. N값이 5인 경우, 현재 계수의 절대값이 4이상이라고 판단된 계수에 대하여 4 초과 계수 정보를 부호화 할 수 있다. 4초과 계수 정보에 의해 현재 계수의 절대값이 5이상이라고 판단되면 5초과 계수 정보 부호화를 할 수 있다. 만약, N초과 계수 정보까지 부호화하여 현재 변환 계수의 값을 완전히 부호화 하였다면 차분 계수의 절대값 부호화 단계는 생략할 수 있다(S3013). PosL이 PosC보다 큰 경우, 현재 변환 계수 자체의 절대값을 부호화 할 수 있다(S3014). 그 후, 현재 변환 계수의 사인(sign) 정보를 알려주는 사인 정보 부호화를 할 수 있다(S3015). 현재 변환 계수에 대한 모든 정보가 부호화 되었다면 PosC 값을 1 감소하여 서브 블록 내 다음 변환 계수를 현재 변환 계수로 선택할 수 있고(S3017), 현재 변환 계수가 서브 블록 내 마지막 변환 계수인 경우, 제1 임계값, 제2 임계값을 업데이트 할 수 있다(S3018). PosC means the position of a transform coefficient to be currently coded. When PosL is smaller than PosC (S3012), it can be seen that the first step coefficient information is encoded. After encoding the N excess coefficient information, the minimum absolute value of the current transform coefficient, which can be known as the parity information of the current transform coefficient, is subtracted from the current coefficient value, and then the absolute value of the difference coefficient can be encoded (S3013). Here, N represents a number of 3 or more, and the same value can be used in the encoding/decoding device or transmitted in an upper header. When the N value is 5, information on coefficients exceeding 4 may be encoded for coefficients determined that the absolute value of the current coefficient is 4 or more. If it is determined that the absolute value of the current coefficient is 5 or more based on the 4 excess coefficient information, the 5 excess coefficient information may be encoded. If the value of the current transform coefficient is completely encoded by encoding the N excess coefficient information, the step of encoding the absolute value of the difference coefficient may be omitted (S3013). When PosL is larger than PosC, the absolute value of the current transform coefficient itself may be encoded (S3014). Subsequently, sine information encoding indicating the sign information of the current transform coefficient may be performed (S3015). If all the information about the current transform coefficients is encoded, the next transform coefficient in the sub-block can be selected as the current transform coefficient by reducing the PosC value by 1 (S3017), and if the current transform coefficient is the last transform coefficient in the sub-block, the first threshold The value and the second threshold may be updated (S3018).

제1, 제2 임계값은 현재 서브 블록에서 현재 계수 자체의 절대값이 부호화된 변환 계수의 개수가 C(C는 0이상의 정수)개 이상인 경우에 해당 임계값들을 조절할 수 있다. 예를 들어, 제1 임계값이 13이고 제1 부호화된 정보 개수가 15개이고, 제2 임계값이 2이고 제2 부호화된 정보 개수가 2개인 경우는 제1, 제2 부호화된 정보가 제1, 제2 임계값에 다다른 경우이므로 제1, 제2 임계값을 증가시키는 방향으로 업데이트를 할 수 있다. 또한 예를 들어, 제1 임계값이 13이고 제1 부호화된 정보 개수가 15개이고, 제2 임계값이 2이고 제2 부호화된 정보 개수가 1개인 경우는 제1 부호화된 정보는 제1 임계값을 넘었지만 제2 부호화된 정보는 제2 임계값이 다다르지 못했으므로, 제1 임계값은 증가시키고, 제2 임계값은 감소시키는 방향으로 업데이트를 할 수도 있다. 혹은 제1, 제2 부호화된 정보가 제1, 제2 임계값에 모두 다다르지 못한 경우는 제1, 제2 임계값을 감소시키는 방향으로 업데이트를 할 수도 있다. 혹은 제1, 제2 임계값을 유지시키는 방향으로도 업데이트를 할 수도 있다. The first and second threshold values may be adjusted when the number of transform coefficients in which the absolute values of the current coefficients themselves are encoded in the current sub-block is C (C is an integer of 0 or more). For example, if the first threshold value is 13, the first coded information number is 15, the second threshold value is 2, and the second coded information number is 2, the first and second coded information are first. In this case, since the second threshold value is reached, the first and second threshold values can be updated. In addition, for example, if the first threshold is 13, the first coded information number is 15, the second threshold value is 2, and the second coded information number is 1, the first coded information is the first threshold value. However, since the second threshold has not reached the second coded information, the first threshold value may be increased and the second threshold value may be updated in a direction of decreasing. Alternatively, if the first and second coded information do not reach both the first and second threshold values, the first and second threshold values may be updated to decrease the first and second threshold values. Alternatively, updates may also be performed in a direction to maintain the first and second threshold values.

현재 서브 블록이 마지막 서브 블록이 아닌 경우(S3019), 다음 서브 블록으로 이동하고(S3020), 마지막 서브 블록인 경우(S3019), 변환 블록 부호화를 종료할 수 있다.If the current sub-block is not the last sub-block (S3019), it moves to the next sub-block (S3020), and if it is the last sub-block (S3019), encoding of the transform block may be ended.

도 31은 양자화된 변환 계수의 복호화 방법을 나타낸 흐름도이다. 영상 복호화 장치(500, 2600)의 엔트로피 복호화부(501, 2601)에 의해 수행될 수 있다.31 is a flowchart illustrating a method of decoding a quantized transform coefficient. It may be performed by the entropy decoding units 501 and 2601 of the image decoding devices 500 and 2600.

먼저 Last_sig를 복호화 하여 역 스캔 순서에 따라서 변환 계수들을 스캔할 때 최초의 0이 아닌 계수를 기준 계수로 정할 수 있다(S3101). First, when decoding transform coefficients according to an inverse scan order by decoding Last_sig, the first non-zero coefficient may be determined as a reference coefficient (S3101).

기준 계수가 포함된 서브 블록을 선택하고(S3102) 해당 서브 블록 내 변환 계수 정보를 복호화 할 수 있다. 기준 계수가 포함된 서브 블록이 아닌 경우, 변환 블록 내 계수를 복호화 하기 전에 서브 블록 정보를 복호화 할 수 있다(S3103). 서브 블록 정보인 Coded_sub_blk_flag 는 현재 서브 블록 내에 0이 아닌 계수가 적어도 하나 이상 있는지를 알리는 플래그이다. 서브 블록 내 계수 정보를 복호화 하기 전에 제1 복호화된 정보 개수와 제2 복호화된 정보 개수를 0으로 초기화 할 수 있다. 제1 복호화된 정보는 0초과 계수 정보(S3106), 1초과 계수 정보(S3106), Parity 정보(S3107)가 복호화된 개수이다. 제2 복호화된 정보는 3초과 계수 정보(S3110)가 복호화된 개수이다.The sub-block including the reference coefficient may be selected (S3102), and transform coefficient information in the corresponding sub-block may be decoded. If the sub-block including the reference coefficient is not, the sub-block information may be decoded before decoding the coefficient in the transform block (S3103). The sub-block information Coded_sub_blk_flag is a flag indicating whether there is at least one non-zero coefficient in the current sub-block. Before decoding the coefficient information in the sub-block, the number of first decoded information and the number of second decoded information may be initialized to zero. The first decoded information is the number of the 0-coefficient information (S3106), the 1-coefficient coefficient information (S3106), and the parity information (S3107). The second decoded information is the number of 3 over-coefficient information S3110 decoded.

그 후, 역 스캔 순으로 현재 복호화될 변환 계수를 선택할 수 있다(S3104). PosL은 제1 단계 계수 정보 복호화 과정에 의해 현재 서브 블록 내 역 스캔 순서상 복호화 되지 않은 변환 계수의 첫번째 위치를 의미한다. 서브 블록 내 가장 먼저 복호화 할 변환 계수를 선택한 후, 현재 변환 계수의 절대값이 0초과인지를 나타내는 0 초과 계수 정보(S3106)를 복호화할 수 있다. 현재 변환 계수가 0이 아니라고 판단되면 현재 변환 계수가 절대값 1을 초과 하는지를 나타내는 1 초과 계수 정보를 복호화(S3107)할 수 있다. 그후, 1 초과 계수 정보로 인해 현재 변환 계수의 절대값이 1보다 크다고 판단되면 Parity 정보를 복호화(S3108)하여 현재 변환 계수의 Parity를 알 수 있다. 이때 0 초과 계수 정보, 1초과 계수 정보, Parity 정보가 복호화 된다면 제1 복호화된 정보 개수를 감소시킨다(S3106, S3107, S3108). 예를 들어, 0 초과 계수 정보, 1초과 계수 정보 또는 Parity 정보 중 적어도 하나가 복호화되면, 제1 복호화된 정보 개수가 1만큼 감소될 수 있다. 또는, 0 초과 계수 정보, 1초과 계수 정보 또는 Parity 정보 중 적어도 하나가 각각 복호화될 때마다 제1 복호화된 정보 개수가 1씩 감소될 수 있다. 즉, 제1 복호화된 정보 개수는, 하나의 블록에 대해서 전송되는 계수 정보의 최대 개수를 의미할 수 있다. 여기서, 블록은 변환 블록을 의미하거나, 변환 블록의 서브 블록을 의미할 수 있다. 또한, 상기 계수 정보는, 0 초과 계수 정보, 1초과 계수 정보 또는 Parity 정보 중 적어도 하나를 포함할 수 있다. 제1 복호화된 정보 개수는, 비디오 시퀀스, 픽쳐, 슬라이스, 코딩 트리 블록(CTU), 코딩 블록(CU), 변환 블록(TU) 또는 변환 블록의 서브 블록의 단위로 정의될 수 있다. 즉, 해당 단위에 속한 모든 변환 블록 또는 서브 블록에 대해서 동일한 제1 복호화된 정보 개수가 설정될 수 있다.Thereafter, the transform coefficients to be currently decoded can be selected in an inverse scan order (S3104). PosL means the first position of the transform coefficient that is not decoded in the inverse scan order in the current sub-block by the first step coefficient information decoding process. After selecting a transform coefficient to be decoded first in a sub-block, it is possible to decode the zero-over-coefficient information (S3106) indicating whether the absolute value of the current transform coefficient exceeds 0. If it is determined that the current transform coefficient is not 0, it is possible to decode the excess 1 coefficient information indicating whether the current transform coefficient exceeds the absolute value 1 (S3107). Thereafter, when it is determined that the absolute value of the current transform coefficient is greater than 1 due to the coefficient information exceeding 1, the parity information may be decoded (S3108) to know the parity of the current transform coefficient. At this time, if the zero exceeded coefficient information, the first excess coefficient information, and the parity information are decoded, the number of the first decoded information is reduced (S3106, S3107, S3108). For example, if at least one of the coefficient information exceeding 0, information exceeding 1, or parity information is decoded, the number of first decoded information may be reduced by 1. Alternatively, the number of the first decoded information may be reduced by 1 whenever at least one of the over 0 coefficient information, the over 1 coefficient information, or the parity information is respectively decoded. That is, the number of first decoded information may mean the maximum number of coefficient information transmitted for one block. Here, the block may mean a transform block or a sub-block of the transform block. In addition, the coefficient information may include at least one of 0 or more coefficient information, 1 or more coefficient information, or parity information. The number of first decoded information may be defined in units of a video sequence, picture, slice, coding tree block (CTU), coding block (CU), transform block (TU), or sub block of the transform block. That is, the same number of first decoded information may be set for all transform blocks or sub-blocks belonging to the corresponding unit.

그 후, PosL 값을 1 감소하여 복호화할 계수를 다음 변환 계수로 바꿔준다. 이때, 제1 복호화된 정보 개수가 제1 임계값을 넘어가거나 현재 서브 블록 내 제1 단계 계수 정보 복호화가 완료 되었다면, 3초과 계수 정보 복호화 단계로 넘어갈 수 있다. 그렇지 않은 경우, 다음 변환 계수 정보를 복호화할 수 있다. 제1 임계값은 서브 블록 단위로 복호화할 수 있는 0 초과 계수 정보, 1 초과 계수 정보, Parity 정보의 최대 개수이다(S3106, S3107, S3108). 제1 단계 계수 정보란 0초과 계수 정보, 1 초과 계수 정보, Parity 정보 복호화 하는 단계를 의미한다(S3106, S3107, S3108).Thereafter, the PosL value is decreased by 1 to convert the coefficient to be decoded into the next transform coefficient. At this time, if the number of the first decoded information exceeds the first threshold value or decoding of the first step coefficient information in the current sub-block is completed, it may be skipped to a step of decoding the third-order coefficient information. Otherwise, the next transform coefficient information can be decoded. The first threshold value is the maximum number of 0 excess coefficient information, 1 excess coefficient information, and parity information that can be decoded in units of sub-blocks (S3106, S3107, S3108). The first step coefficient information refers to a step of decoding the 0 excess coefficient information, the 1 excess coefficient information, and the parity information (S3106, S3107, S3108).

역 스캔 순으로 Parity 정보가 복호화된 변환 계수에 대해서만 3초과 계수 정보를 복호화 할 수 있다(S3110). 3 초과 계수 정보를 복호화 하는 경우, 제2 복호화된 정보 개수를 증가시킬 수 있다. 제2 복호화된 정보 개수가 제2 임계값을 넘어가거나 현재 서브 블록의 제2 단계의 계수 정보 복호화가 완료 되는 경우, 다음 단계로 넘어갈 수 있다(S3111). 제2 임계값은 서브 블록 단위로 복호화할 수 있는 3 초과 계수 정보의 최대 개수이다. 제2 단계 계수 정보 복호화는 3 초과 계수 정보를 복호화 하는 단계이다(S3110). Only the transform coefficients in which the parity information is decoded in the inverse scan order can decode the over 3 coefficient information (S3110). When decoding the excess coefficient information, the number of second decoded information may be increased. When the number of the second decoded information exceeds the second threshold or decoding of the coefficient information in the second step of the current sub-block is completed, the next step may be passed (S3111). The second threshold is the maximum number of over 3 coefficient information that can be decoded in sub-block units. The second step of decoding the coefficient information is a step of decoding the coefficient information exceeding 3 (S3110).

또는, 제1 복호화된 정보는 소정의 단위로 전송 가능한 계수 정보의 최대 개수를 의미할 수 있다. 여기서, 계수 정보는 0초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3초과 계수 정보 중 적어도 하나를 포함할 수 있다. 이 경우, 제1 단계 계수 정보 복호화 단계에 3 초과 계수 정보를 복호화하는 단계가 포함될 수도 있다. Alternatively, the first decoded information may mean the maximum number of coefficient information that can be transmitted in a predetermined unit. Here, the coefficient information may include at least one of 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information. In this case, the step of decoding the coefficient information exceeding 3 may be included in the step of decoding the coefficient information.

구체적으로, 현재 변환 계수의 절대값이 0초과인지를 나타내는 0 초과 계수 정보를 복호화할 수 있다. 현재 변환 계수가 0이 아니라고 판단되면, 현재 변환 계수가 절대값 1을 초과하는지를 나타내는 1 초과 계수 정보를 복호화할 수 있다. 그 후, 1 초과 계수 정보에 의해 현재 변환 계수의 절대값이 1보다 크다고 판단되면, Parity 정보 및 3 초과 계수 정보를 복호화할 수 있다.Specifically, it is possible to decode the zero-over coefficient information indicating whether the absolute value of the current transform coefficient is greater than zero. If it is determined that the current transform coefficient is not 0, it is possible to decode the coefficient information exceeding 1 indicating whether the current transform coefficient exceeds the absolute value 1. Thereafter, when it is determined that the absolute value of the current transform coefficient is greater than 1 by the excess coefficient information, the parity information and the excess coefficient information 3 can be decoded.

이때, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보, 3 초과 계수 정보가 복호화되면, 제1 복호화된 정보 개수를 감소시킨다. 예를 들어, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나가 복호화되면, 제1 복호화된 정보 개수가 1만큼 감소될 수 있다. 또는, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나가 각각 복호화될 때마다 제1 복호화된 정보 개수가 1씩 감소될 수 있다. At this time, if the zero excess coefficient information, the one excess coefficient information, the parity information, and the three excess coefficient information are decoded, the number of first decoded information is reduced. For example, if at least one of the 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information is decoded, the number of first decoded information may be reduced by 1. Alternatively, the number of the first decoded information may be decreased by 1 whenever at least one of the 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information is respectively decoded.

다시 말해, 제1 복호화된 정보 개수는, 하나의 블록에 대해서 허용되는 계수 정보의 최대 개수를 의미할 수 있다. 여기서, 블록은 변환 블록을 의미하거나, 변환 블록의 서브 블록을 의미할 수 있다. 또한, 상기 계수 정보는, 0 초과 계수 정보, 1초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나를 포함할 수 있다. 제1 복호화된 정보 개수는, 비디오 시퀀스, 픽쳐, 슬라이스, 코딩 트리 블록(CTU), 코딩 블록(CU), 변환 블록(TU) 또는 변환 블록의 서브 블록의 단위로 정의될 수 있다. 즉, 해당 단위에 속한 모든 변환 블록 또는 서브 블록에 대해서 동일한 제1 복호화된 정보 개수가 설정될 수 있다.In other words, the number of first decoded information may mean the maximum number of coefficient information allowed for one block. Here, the block may mean a transform block or a sub-block of the transform block. In addition, the coefficient information may include at least one of 0 excess coefficient information, 1 excess coefficient information, Parity information, or 3 excess coefficient information. The number of first decoded information may be defined in units of a video sequence, picture, slice, coding tree block (CTU), coding block (CU), transform block (TU), or sub block of the transform block. That is, the same number of first decoded information may be set for all transform blocks or sub-blocks belonging to the corresponding unit.

PosC는 현재 복호화할 변환 계수의 위치를 의미한다. PosL이 PosC보다 작은 경우(S3112), 제1 단계 계수 정보 복호화에서 현재 변환 계수에 대한 정보가 복호화 되었다는 것을 알 수 있다. N초과 계수 정보를 복호화 한 후, 현재 변환 계수의 Parity 정보로 알 수 있는 현재 계수 최소 절대값을 현재 계수 값에서 뺀 후, 차분 계수의 절대값을 복호화할 수 있다(S3113). N초과 계수 정보까지 복호화하여 현재 계수의 값을 완전히 복호화 하였다면 차분 계수의 절대값 복호화 단계는 생략할 수 있다(S3113). PosL이 PosC보다 큰 경우, 현재 변환 계수 정보를 한번에 복호화 하는 절대값 복호화를 할 수 있다(S3114). 그 후, 현재 변환 계수의 사인 정보를 알려주는 사인 정보 복호화를 할 수 있다(S3115). 현재 변환 계수에 대한 모든 정보가 복호화 되었다면 PosC 값을 1 감소하여 서브 블록 내 다음 계수를 현재 계수로 선택할 수 있고(S3117), 현재 변환 계수가 서브 블록 내 마지막 계수 인 경우, 제1 임계값, 제2 임계값을 업데이트 할 수 있다(S3118). PosC means the position of the transform coefficient to be currently decoded. When PosL is smaller than PosC (S3112), it can be seen that information on the current transform coefficient is decoded in the first step coefficient information decoding. After decoding the N excess coefficient information, the minimum absolute value of the current coefficient, which can be known as the parity information of the current transform coefficient, is subtracted from the current coefficient value, and then the absolute value of the difference coefficient can be decoded (S3113). If the value of the current coefficient is completely decoded by decoding the N excess coefficient information, the step of decoding the absolute value of the difference coefficient may be omitted (S3113). When PosL is larger than PosC, absolute value decoding capable of decoding the current transform coefficient information at once may be performed (S3114). Thereafter, sine information decoding indicating the sine information of the current transform coefficient may be decoded (S3115). If all information about the current transform coefficient is decoded, the next coefficient in the sub-block can be selected as the current coefficient by reducing the PosC value by 1 (S3117), and if the current transform coefficient is the last coefficient in the sub-block, the first threshold value, the first 2 The threshold may be updated (S3118).

제1, 제2 임계값은 현재 서브 블록에서 현재 계수 자체의 절대값이 복호화된 변환 계수의 개수가 C(C는 0이상의 정수)개 이상인 경우에 해당 임계값들을 조절할 수 있다. 예를 들어, 제1 임계값이 13이고 제1 복호화된 정보 개수가 15개이고, 제2 임계값이 2이고 제2 복호화된 정보 개수가 2개인 경우는 제1, 제2 복호화된 정보가 제1, 제2 임계값에 다다른 경우이므로 제1, 제2 임계값을 증가시키는 방향으로 업데이트를 할 수 있다. 또한 예를 들어, 제1 임계값이 13이고 제1 복호화된 정보 개수가 15개이고, 제2 임계값이 2이고 제2 복호화된 정보 개수가 1개인 경우는 제1 복호화된 정보는 제1 임계값을 넘었지만 제2 복호화된 정보는 제2 임계값이 다다르지 못했으므로, 제1 임계값은 증가시키고, 제2 임계값은 감소시키는 방향으로 업데이트를 할 수도 있다. 혹은 제1, 제2 복호화된 정보가 제1, 제2 임계값에 모두 다다르지 못한 경우는 제1, 제2 임계값을 감소시키는 방향으로 업데이트를 할 수도 있다. 혹은 제1, 제2 임계값을 유지시키는 방향으로도 업데이트를 할 수도 있다. The first and second threshold values may be adjusted when the number of transform coefficients in which the absolute value of the current coefficient itself is decoded in the current sub-block is C (C is an integer of 0 or more) or more. For example, when the first threshold value is 13, the first decrypted information number is 15, the second threshold value is 2, and the second decrypted information number is 2, the first and second decrypted information are first. In this case, since the second threshold value is reached, the first and second threshold values can be updated. Also, for example, if the first threshold is 13, the first decrypted information number is 15, the second threshold value is 2, and the second decrypted information number is 1, the first decrypted information is the first threshold value. However, since the second threshold value has not reached the second decrypted information, the first threshold value may be increased and the second threshold value may be updated in a direction of decreasing. Alternatively, when the first and second decoded information do not reach both the first and second threshold values, the first and second threshold values may be updated to decrease the first and second threshold values. Alternatively, updates may also be performed in a direction to maintain the first and second threshold values.

현재 서브 블록이 마지막 서브 블록이 아닌 경우(S3119), 다음 서브 블록으로 이동하고(S3120), 마지막 서브 블록인 경우(S3119), 변환 블록 복호화를 종료할 수 있다.If the current sub-block is not the last sub-block (S3119), it moves to the next sub-block (S3120), and if it is the last sub-block (S3119), decoding of the transform block may be ended.

본 개시의 다양한 실시 예는 모든 가능한 조합을 나열한 것이 아니고 본 개시의 대표적인 양상을 설명하기 위한 것이며, 다양한 실시 예에서 설명하는 사항들은 독립적으로 적용되거나 또는 둘 이상의 조합으로 적용될 수도 있다.Various embodiments of the present disclosure are not intended to list all possible combinations, but are intended to describe representative aspects of the present disclosure, and the items 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 implementation by hardware, 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), Universal It can be implemented by a processor (general processor), a controller, a microcontroller, a microprocessor.

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

Claims (6)

현재 픽쳐 내 기-복원된 영역을 이용하여, 상기 현재 픽쳐에 속한 현재 블록의 예측 블록을 결정하는 단계;
상기 현재 블록의 변환 블록을 복원하는 단계; 및
상기 예측 블록과 상기 변환 블록을 기반으로, 상기 현재 블록을 복원하는 단계를 포함하되,
상기 예측 블록을 결정하는 단계는,
상기 현재 블록의 움직임 정보를 유도하기 위한 후보를 결정하는 단계; 상기 후보는, 상기 현재 블록에 공간적으로 인접한 주변 블록의 움직임 정보를 의미함,
상기 후보를 기반으로 상기 현재 블록의 후보 리스트를 구성하는 단계; 및
상기 후보 리스트로부터 상기 현재 블록의 움직임 정보를 결정하는 단계를 포함하는, 영상 복호화 방법.
Determining a prediction block of a current block belonging to the current picture, using a pre-restored area in the current picture;
Restoring a transform block of the current block; And
And restoring the current block based on the prediction block and the transform block.
Determining the prediction block,
Determining a candidate for deriving motion information of the current block; The candidate refers to motion information of neighboring blocks spatially adjacent to the current block,
Constructing a candidate list of the current block based on the candidate; And
And determining motion information of the current block from the candidate list.
제1항에 있어서,
상기 예측 블록은, 상기 현재 블록과 동일한 코딩 트리 유닛(CTU) 또는 CTU 행 내에 속하도록 제한되는, 영상 복호화 방법.
According to claim 1,
The prediction block is limited to belong to the same coding tree unit (CTU) or CTU row as the current block.
제1항에 있어서,
상기 주변 블록의 움직임 정보는, 상기 현재 블록의 크기가 소정의 문턱크기보다 큰지 여부에 기초하여 상기 후보 리스트에 선택적으로 추가되는, 영상 복호화 방법.
According to claim 1,
The motion information of the neighboring block is selectively added to the candidate list based on whether the size of the current block is greater than a predetermined threshold size.
제1항에 있어서,
상기 후보 리스트는, 복호화 장치의 버퍼에 저장된 움직임 정보를 더 포함하는, 영상 복호화 방법.
According to claim 1,
The candidate list further includes motion information stored in a buffer of the decoding apparatus.
제1항에 있어서,
상기 현재 블록은 복수의 서브 블록으로 구분되고,
상기 변환 블록을 복원하는 단계는,
상기 현재 블록의 서브 블록에 대한 서브 블록 정보를 복호화하는 단계; 상기 서브 블록 정보는, 상기 서브 블록 내에 적어도 하나의 0이 아닌 계수가 존재하는지 여부를 나타냄, 및
상기 서브 블록 정보에 따라, 상기 서브 블록 내에 적어도 하나의 0이 아닌 계수가 존재하는 경우, 상기 서브 블록 내 현재 계수에 대해 0 초과 계수 정보, 1 초과 계수 정보, Parity 정보 또는 3 초과 계수 정보 중 적어도 하나를 복호화하는 단계를 포함하는, 영상 복호화 방법.
According to claim 1,
The current block is divided into a plurality of sub-blocks,
Restoring the transform block,
Decoding sub-block information for a sub-block of the current block; The sub-block information indicates whether there is at least one non-zero coefficient in the sub-block, and
According to the sub-block information, if there is at least one non-zero coefficient in the sub-block, at least one of the over-count coefficient information, the over-count coefficient information, the parity information, or the over-count coefficient information for the current coefficient in the sub-block. And decoding one.
제5항에 있어서,
상기 서브 블록에 대한 개수 정보가 복호화되고,
상기 개수 정보는, 상기 서브 블록에 대해 전송되는 계수 정보의 최대 개수를 의미하며,
상기 계수 정보는 상기 0 초과 계수 정보, 상기 1 초과 계수 정보, 상기 Parity 정보 또는 상기 3 초과 계수 정보 중 적어도 하나를 포함하고,
상기 개수 정보는 상기 0 초과 계수 정보, 상기 1초과 계수 정보, 상기 Parity 정보 또는 상기 3 초과 계수 정보 중 적어도 하나가 각각 복호화될 때마다 1씩 증가되는, 영상 복호화 방법.
The method of claim 5,
The number information for the sub-block is decoded,
The number information means the maximum number of coefficient information transmitted for the sub-block,
The coefficient information includes at least one of the zero excess coefficient information, the one excess coefficient information, the parity information, or the three excess coefficient information,
The number information is incremented by 1 each time at least one of the 0 excess coefficient information, the 1 excess coefficient information, the parity information, or the 3 excess coefficient information is respectively decoded.
KR1020200001231A 2019-01-04 2020-01-06 Efficient prediction and transform encoding/decoding method and apparatus KR20200085236A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US17/420,784 US20220116588A1 (en) 2019-01-04 2020-01-06 Method and apparatus for image encoding/decoding
PCT/KR2020/000211 WO2020141962A1 (en) 2019-01-04 2020-01-06 Method and apparatus for image encoding/decoding

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020190001416 2019-01-04
KR20190001416 2019-01-04

Publications (1)

Publication Number Publication Date
KR20200085236A true KR20200085236A (en) 2020-07-14

Family

ID=71526546

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200001231A KR20200085236A (en) 2019-01-04 2020-01-06 Efficient prediction and transform encoding/decoding method and apparatus

Country Status (1)

Country Link
KR (1) KR20200085236A (en)

Similar Documents

Publication Publication Date Title
US11107253B2 (en) Image processing method, and image decoding and encoding method using same
US20200351501A1 (en) Method and apparatus for processing video signal
US20190289301A1 (en) Image processing method, and image encoding and decoding method using same
JP2024050883A (en) Image encoding/decoding method and apparatus
JP7391958B2 (en) Video signal encoding/decoding method and equipment used in the method
JP7430721B2 (en) Video signal encoding/decoding method and apparatus for said method
KR102435500B1 (en) A method of decoding a video signal and an apparatus having the same
KR102502216B1 (en) Method and apparatus for encoding/decoding an image
CN116866571A (en) Video signal processing method and device
KR20230110701A (en) Method and apparatus for encoding/decoding a video signal
US11736712B2 (en) Method and apparatus for encoding or decoding video signal
KR20230113243A (en) Method and apparatus for encoding/decoding a video signal
KR20230054805A (en) A method of decoding a video signal and an apparatus having the same
KR20190115426A (en) Method and apparatus for encoding/decoding an image
KR102279101B1 (en) Method for encoding and decoding images, device for encoding and decoding images and corresponding computer programs
US20220224932A1 (en) Image encoding/decoding method and device, and recording medium storing bitstream
KR102435502B1 (en) Method and apparatus for encoding or decoding video signal
KR20150048637A (en) Method and apparatus for inter color component prediction
KR102447951B1 (en) A method of decoding a video signal and an apparatus having the same
KR20200085236A (en) Efficient prediction and transform encoding/decoding method and apparatus
KR102511611B1 (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR102557740B1 (en) Method and apparatus for encoding/decoding a video signal
KR102557797B1 (en) Method and apparatus for encoding/decoding a video signal
KR102523384B1 (en) A method of decoding a video signal and an apparatus having the same
KR20210033834A (en) Transform Coefficient Coding and Decoding Method and Device according to Block Division Tree Structure