KR20220061085A - Method and apparatus for encoding/decoding a video signal - Google Patents

Method and apparatus for encoding/decoding a video signal Download PDF

Info

Publication number
KR20220061085A
KR20220061085A KR1020220055981A KR20220055981A KR20220061085A KR 20220061085 A KR20220061085 A KR 20220061085A KR 1020220055981 A KR1020220055981 A KR 1020220055981A KR 20220055981 A KR20220055981 A KR 20220055981A KR 20220061085 A KR20220061085 A KR 20220061085A
Authority
KR
South Korea
Prior art keywords
block
partial
transform block
size
coefficients
Prior art date
Application number
KR1020220055981A
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
Priority claimed from KR1020170050049A external-priority patent/KR20170124077A/en
Application filed by 세종대학교산학협력단 filed Critical 세종대학교산학협력단
Publication of KR20220061085A publication Critical patent/KR20220061085A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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

Abstract

A video signal encoding method according to the present invention may comprise: encoding a partial block flag indicating whether at least one non-zero coefficient exists in a current partial block; encoding the absolute value of the coefficient of the current partial block; and encoding the sign of the coefficient of the current partial block. The compression efficiency of a video can be improved.

Description

영상 신호 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR ENCODING/DECODING A VIDEO SIGNAL}Video signal encoding/decoding method and apparatus

본 발명은 영상 신호 부호화/복호화 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for encoding/decoding a video signal.

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(Channel)의 대역폭(Bandwidth)이 발전하는 속도는 급격히 증가하고 있는 멀티미디어 데이터의 양을 따라가기 힘든 상황이다.Recently, the demand for multimedia data such as moving pictures is rapidly increasing on the Internet. However, it is difficult to keep up with the rapidly increasing amount of multimedia data at the rate of development of the bandwidth of the channel.

본 발명은 부분 블록 내 계수들을 효율적으로 부호화/복호화 함으로써, 영상의 압축 효율을 향상시키는데 주된 목적이 있다.A main object of the present invention is to improve image compression efficiency by efficiently encoding/decoding coefficients in partial blocks.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타내는 부분 블록 플래그를 부호화하고, 상기 현재 부분 블록의 계수의 절대값을 부호화하며, 상기 현재 부분 블록의 계수의 부호(sign)를 부호화할 수 있다.A video signal encoding method and apparatus according to the present invention comprises encoding a partial block flag indicating whether at least one non-zero coefficient exists in a current partial block, encoding an absolute value of a coefficient of the current partial block, and The sign of the coefficient of the current partial block may be encoded.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 현재 부분 블록은 변환 블록에 포함되며, 상기 변환 블록은 하나 또는 그 이상의 부분 블록으로 구성될 수 있다.In the method and apparatus for encoding an image signal according to the present invention, a current partial block is included in a transform block, and the transform block may include one or more partial blocks.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나를 나타내는 정보를 부호화할 수 있다.In the video signal encoding method and apparatus according to the present invention, information indicating at least one of a size and a shape of the current partial block may be encoded.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부호화된 정보는, 블록의 병합 여부를 나타내는 병합 플래그, 블록의 분할 여부를 나타내는 분할 플래그, 또는 상기 변환 블록의 분할 타입을 특정하는 분할 색인 정보 중 적어도 하나를 포함할 수 있다.In the video signal encoding method and apparatus according to the present invention, the encoded information includes a merge flag indicating whether blocks are merged, a split flag indicating whether blocks are split, or split index information specifying a split type of the transform block. may include at least one of

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 변환 블록의 부호화 순서상 최초 넌-제로 계수의 위치를 기반으로 결정될 수 있다.In the video signal encoding method and apparatus according to the present invention, at least one of the size and shape of the current partial block may be determined based on the position of the first non-zero coefficient in the encoding order of the transform block.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 주파수 도메인의 DC 성분 및/또는 AC 성분의 속성을 고려하여 결정될 수 있다.In the video signal encoding method and apparatus according to the present invention, at least one of a size or a shape of the current partial block may be determined in consideration of properties of a DC component and/or an AC component in a frequency domain.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 양자화 파라미터(QP) 또는 블록 크기 중 적어도 하나에 기초하여 결정될 수 있다.In the method and apparatus for encoding an image signal according to the present invention, at least one of a size and a shape of the current partial block may be determined based on at least one of a quantization parameter (QP) and a block size.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타내는 부분 블록 플래그를 복호화하고, 상기 현재 부분 블록의 계수의 절대값을 복호화하며, 상기 현재 부분 블록의 계수의 부호(sign)를 복호화할 수 있다.A video signal decoding method and apparatus according to the present invention decodes a partial block flag indicating whether at least one non-zero coefficient exists in a current partial block, and decodes an absolute value of the coefficient of the current partial block, The sign of the coefficient of the current partial block may be decoded.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 현재 부분 블록은 변환 블록에 포함되며, 상기 변환 블록은 하나 또는 그 이상의 부분 블록으로 구성될 수 있다.In the method and apparatus for decoding an image signal according to the present invention, a current partial block is included in a transform block, and the transform block may include one or more partial blocks.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 부호화된 정보를 기반으로 결정될 수 있다.In the method and apparatus for decoding an image signal according to the present invention, at least one of a size and a shape of the current partial block may be determined based on encoded information.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부호화된 정보는, 블록의 병합 여부를 나타내는 병합 플래그, 블록의 분할 여부를 나타내는 분할 플래그, 또는 상기 변환 블록의 분할 타입을 특정하는 분할 색인 정보 중 적어도 하나를 포함할 수 있다.In the video signal decoding method and apparatus according to the present invention, the encoded information includes a merge flag indicating whether blocks are merged, a split flag indicating whether blocks are split, or split index information specifying a split type of the transform block. may include at least one of

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 변환 블록의 부호화 순서상 최초 넌-제로 계수의 위치를 기반으로 결정될 수 있다.In the method and apparatus for decoding an image signal according to the present invention, at least one of the size and shape of the current partial block may be determined based on the position of the first non-zero coefficient in the encoding order of the transform block.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 주파수 도메인의 DC 성분 및/또는 AC 성분의 속성을 고려하여 결정될 수 있다.In the method and apparatus for decoding an image signal according to the present invention, at least one of a size or a shape of the current partial block may be determined in consideration of properties of a DC component and/or an AC component in a frequency domain.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 부분 블록의 크기 또는 형태 중 적어도 하나는, 양자화 파라미터(QP) 또는 블록 크기 중 적어도 하나에 기초하여 결정될 수 있다.In the method and apparatus for decoding an image signal according to the present invention, at least one of a size and a shape of the current partial block may be determined based on at least one of a quantization parameter (QP) and a block size.

본 발명에 따르면, 변환 블록의 계수를 효율적으로 부호화/복호화 함으로써, 영상의 압축 효율을 향상시킬 수 있다.According to the present invention, image compression efficiency can be improved by efficiently encoding/decoding coefficients of a transform block.

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 본 발명의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 3은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 부호화하는 방법을 도시한 것이다.
도 4는 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 부호화하는 방법을 도시한 것이다.
도 5는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 부호화하는 방법을 도시한 것이다.
도 6은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 복호화하는 방법을 도시한 것이다.
도 7은 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 복호화하는 방법을 도시한 것이다.
도 8은 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 복호화하는 방법을 도시한 것이다.
도 9는 본 발명이 적용되는 일실시예로서, 현재 부분 블록에 관한 제1/제2 임계값 플래그를 유도하는 방법을 도시한 것이다.
도 10은 본 발명이 적용되는 일실시예로서, 병합 플래그를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.
도 11은 본 발명이 적용되는 일실시예로서, 분할 플래그를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.
도 12는 본 발명이 적용되는 일실시예로서, 분할 색인 정보를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.
도 13은 본 발명이 적용되는 일실시예로서, 넌-제로 계수의 위치를 기반으로 변환 블록을 분할하는 방법을 도시한 것이다.
도 14는 본 발명이 적용되는 일실시예로서, 변환 블록의 일부 영역을 선택적으로 분할하는 방법을 도시한 것이다.
도 15는 본 발명이 적용되는 일실시예로서, 주파수 도메인에서 DC/AC 성분의 속성을 기반으로 변환 블록을 분할하는 방법을 도시한 것이다.
1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.
2 is a block diagram illustrating an image decoding apparatus according to an embodiment of the present invention.
3 illustrates a method of encoding coefficients of a transform block according to an embodiment to which the present invention is applied.
4 illustrates a method of encoding a maximum value of a coefficient of a partial block according to an embodiment to which the present invention is applied.
5 illustrates a method of encoding a first threshold value flag for a partial block according to an embodiment to which the present invention is applied.
6 illustrates a method of decoding coefficients of a transform block according to an embodiment to which the present invention is applied.
7 illustrates a method of decoding a maximum value of a coefficient of a partial block according to an embodiment to which the present invention is applied.
8 is a diagram illustrating a method of decoding a first threshold value flag for a partial block according to an embodiment to which the present invention is applied.
9 is a diagram illustrating a method of deriving a first/second threshold value flag for a current partial block according to an embodiment to which the present invention is applied.
10 illustrates a method of determining the size/shape of a partial block based on a merge flag as an embodiment to which the present invention is applied.
11 illustrates a method of determining the size/shape of a partial block based on a division flag as an embodiment to which the present invention is applied.
12 illustrates a method for determining the size/shape of a partial block based on partition index information as an embodiment to which the present invention is applied.
13 is a diagram illustrating a method of dividing a transform block based on a position of a non-zero coefficient according to an embodiment to which the present invention is applied.
14 illustrates a method of selectively dividing a partial region of a transform block according to an embodiment to which the present invention is applied.
15 is a diagram illustrating a method of dividing a transform block based on a property of a DC/AC component in a frequency domain as an embodiment to which the present invention is applied.

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

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

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

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

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

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

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

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

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

픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 블록으로 분할할 수 있다. 이때, 블록은 부호화 단위(CU), 예측 단위(PU) 또는 변환 단위(TU)를 의미할 수 있다. 상기 분할은 쿼드 트리(Quadtree) 또는 바이너리 트리(Biniary tree) 중 적어도 하나에 기반하여 수행될 수 있다. 쿼드 트리는 상위 블록을 너비와 높이가 상위 블록의 절반인 하위 블록으로 사분할하는 방식이다. 바이너리 트리는 상위 블록을 너비 또는 높이 중 어느 하나가 상위 블록의 절반인 하위 블록으로 이분할하는 방식이다. 전술한 바이너리 트리 기반의 분할을 통해, 블록은 정방형뿐만 아니라 비정방형의 형태를 가질 수 있다.The picture divider 110 may divide the input picture into at least one block. In this case, a block may mean a coding unit (CU), a prediction unit (PU), or a transformation unit (TU). The division may be performed based on at least one of a quadtree and a binary tree. The quad tree divides the upper block into lower blocks whose width and height are half that of the upper block. Binary tree is a method of dividing the upper block into lower blocks whose either width or height is half that of the upper block. Through the binary tree-based partitioning described above, a block may have a non-square shape as well as a square shape.

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

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

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

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

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

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

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

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

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

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

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

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

상기 변환부(130) 및/또는 양자화부(135)는, 영상 부호화 장치(100)에 선택적으로 포함될 수 있다. 즉, 영상 부호화 장치(100)는, 잔차 블록의 잔차 데이터에 대해 변환 또는 양자화 중 적어도 하나를 수행하거나, 변환 및 양자화를 모두 스킵하여 잔차 블록을 부호화할 수 있다. 영상 부호화 장치(100)에서 변환 또는 양자화 중 어느 하나가 수행되지 않거나, 변환 및 양자화 모두 수행되지 않더라도, 엔트로피 부호화부(165)의 입력으로 들어가는 블록을 통상적으로 변환 블록이라 일컫는다.The transform unit 130 and/or the quantizer 135 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 transform or quantization on the residual data of the residual block, or skipping both transform and quantization. Even if either transform or quantization is not performed in the image encoding apparatus 100 or neither transform nor quantization is performed, a block entering the input of the entropy encoder 165 is generally referred to as a transform block.

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

재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 소정의 스캔 타입을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. The rearrangement unit 160 may change the two-dimensional block form coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the reordering unit 160 may scan from DC coefficients to coefficients in a high frequency region using a predetermined scan type, and may change it into a one-dimensional vector form.

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

엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. 엔트로피 부호화부(165)에서, 변환 블록의 계수는, 변환 블록 내 부분 블록 단위로, 0이 아닌 계수, 절대값이 1 또는 2보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 부호화될 수 있다. 상기 플래그만으로 부호화되지 않는 계수는, 플래그를 통해 부호화된 계수와 실제 변환 블록의 계수 간의 차이의 절대값을 통해 부호화될 수 있다. 변환 블록의 계수를 부호화하는 방법은 도 3을 참조하여 자세히 살펴 보도록 한다.The entropy encoder 165 receives the residual value coefficient information, block type information, prediction mode information, division unit information, prediction unit information and transmission unit information, motion of the coding unit from the reordering unit 160 and the prediction units 120 and 125 . Various information such as vector information, reference frame information, interpolation information of a block, and filtering information may be encoded. In the entropy encoding unit 165, coefficients of the transform block are encoded in units of subblocks within the transform block, and various kinds of flags indicating non-zero coefficients, coefficients having an absolute value greater than 1 or 2, and signs of coefficients are encoded. can be Coefficients that are not encoded using only the flag may be encoded using an absolute value of a difference between a coefficient encoded through the flag and a coefficient of an actual transform block. A method of encoding the coefficients of the transform block will be described in detail with reference to FIG. 3 .

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

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

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

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

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

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

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

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

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

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

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

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

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

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

역변환부(225)는 역양자화된 변환 계수를 소정의 변환 방법으로 역변환을 수행할 수 있다. 이때, 변환 방법은 예측 방법(인터/인트라 예측), 블록의 크기/형태, 인트라 예측 모드 등에 관한 정보를 기반으로 결정될 수 있다.The inverse transform unit 225 may perform inverse transform on the inverse quantized transform coefficient using a predetermined transform method. In this case, the transformation method may be determined based on information about a prediction method (inter/intra prediction), a size/shape of a block, an intra prediction mode, and the like.

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

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

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

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

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

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

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

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

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

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

도 3은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 부호화하는 방법을 도시한 것이다.3 illustrates a method of encoding coefficients of a transform block according to an embodiment to which the present invention is applied.

영상 부호화 장치에서, 변환 블록의 계수는 소정의 블록 단위(이하, 부분 블록이라 함)로 부호화될 수 있다. 변환 블록은 하나 또는 그 이상의 부분 블록으로 구성될 수 있다. 상기 부분 블록은 NxM 크기의 블록일 수 있다. 여기서, N과 M은 자연수이며, N과 M은 서로 동일하거나 상이할 수 있다. 즉, 부분 블록은 정방형 또는 비정방형의 블록일 수 있다. 부분 블록의 크기/형태는 영상 부호화 장치에 기-약속된 고정된 것(예를 들어, 4x4)일 수도 있고, 변환 블록의 크기/형태에 따라 가변적으로 결정될 수도 있다. 또는, 영상 부호화 장치는 부호화 효율을 고려하여 최적의 부분 블록의 크기/형태를 결정하고, 이를 부호화할 수도 있다. 상기 부호화된 부분 블록의 크기/형태에 관한 정보는 시퀀스, 픽쳐, 슬라이스 또는 블록 레벨 중 적어도 하나에서 시그날링될 수 있다. In an image encoding apparatus, coefficients of a transform block may be encoded in units of predetermined blocks (hereinafter, referred to as partial blocks). A transform block may consist of one or more partial blocks. The partial block may be a block of size NxM. Here, N and M are natural numbers, and N and M may be the same as or different from each other. That is, the partial block may be a square or non-square block. The size/shape of the partial block may be a fixed one (eg, 4x4) pre-promised to the image encoding apparatus, or may be variably determined according to the size/shape of the transform block. Alternatively, the image encoding apparatus may determine an optimal size/shape of a partial block in consideration of encoding efficiency and encode it. Information on the size/shape of the encoded partial block may be signaled at at least one of a sequence, a picture, a slice, and a block level.

영상 부호화 장치에서, 변환 블록에 속한 부분 블록을 부호화하는 순서는, 소정의 스캔 타입(이하, 제1 스캔 타입이라 함)에 따라 결정될 수 있다. 또한, 부분 블록에 속한 계수를 부호화하는 순서는 소정의 스캔 타입(이하, 제2 스캔 타입이라 함)에 따라 결정될 수 있다. 상기 제1 스캔 타입과 제2 스캔 타입은 동일할 수도 있고, 상이할 수도 있다. 상기 제1/제2 스캔 타입으로, 대각선 스캔, 수직 스캔, 수평 스캔 등이 이용될 수 있다. 다만, 이에 한정되지 아니하며, 소정의 각도를 가진 하나 또는 그 이상의 스캔 타입이 더 추가될 수도 있다. 상기 제1/제2 스캔 타입은 코딩 블록 관련 정보(예를 들어, 최대/최소 크기, 분할 기법 등), 변환 블록의 크기/형태, 부분 블록의 크기/형태, 예측 모드, 인트라 예측 관련 정보(예를 들어, 인트라 예측 모드의 값, 방향성, 각도 등) 또는 인터 예측 관련 정보 중 적어도 하나에 기초하여 결정될 수 있다.In the image encoding apparatus, an order of encoding partial blocks belonging to a transform block may be determined according to a predetermined scan type (hereinafter, referred to as a first scan type). Also, the order of encoding coefficients belonging to partial blocks may be determined according to a predetermined scan type (hereinafter, referred to as a second scan type). The first scan type and the second scan type may be the same or different. As the first/second scan type, a diagonal scan, a vertical scan, a horizontal scan, etc. may be used. However, the present invention is not limited thereto, and one or more scan types having a predetermined angle may be further added. The first/second scan type includes coding block related information (eg, maximum/minimum size, partitioning technique, etc.), size/shape of transform block, size/shape of partial block, prediction mode, intra prediction related information ( For example, it may be determined based on at least one of an intra prediction mode value, directionality, angle, etc.) or inter prediction related information.

영상 부호화 장치는, 변환 블록 내에서, 전술한 부호화 순서상 최초 0이 아닌 계수(이하, 넌-제로 계수라 함)의 위치 정보를 부호화할 수 있다. 상기 최초 0이 아닌 계수를 포함한 부분 블록부터 순차적으로 부호화가 수행될 수 있다. 이하, 도 3을 참조하여, 부분 블록의 계수를 부호화하는 과정을 살펴 보기로 한다.The image encoding apparatus may encode position information of the first non-zero coefficient (hereinafter, referred to as a non-zero coefficient) in the above-described encoding order in the transform block. Encoding may be sequentially performed from the partial block including the first non-zero coefficient. Hereinafter, a process of encoding coefficients of partial blocks will be described with reference to FIG. 3 .

현재 부분 블록에 관한 부분 블록 플래그가 부호화될 수 있다(S300). 상기 부분 블록 플래그는 부분 블록의 단위로 부호화될 수 있다. 상기 부분 블록 플래그는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타낼 수 있다. 예를 들어, 상기 부분 블록 플래그가 제1 값인 경우, 상기 현재 부분 블록은 적어도 하나의 넌-제로 계수가 존재함을 나타내고, 부분 블록 플래그가 제2 값인 경우, 상기 현재 부분 블록의 모든 계수는 0임을 나타낼 수 있다. A partial block flag related to the current partial block may be encoded ( S300 ). The partial block flag may be encoded in units of partial blocks. The partial block flag may indicate whether at least one non-zero coefficient exists in the current partial block. For example, when the partial block flag is a first value, the current partial block indicates that at least one non-zero coefficient exists, and when the partial block flag is a second value, all coefficients of the current partial block are 0 can indicate that

현재 부분 블록에 관한 부분 블록 계수 플래그가 부호화될 수 있다(S310). 상기 부분 블록 계수 플래그는 계수 단위로 부호화될 수 있다. 상기 부분 블록 계수 플래그는, 계수가 넌-제로 계수인지 여부를 나타낼 수 있다. 예를 들어, 상기 계수가 넌-제로 계수인 경우, 상기 부분 블록 계수 플래그는 제1 값으로 부호화되고, 상기 계수가 0인 경우, 상기 부분 블록 계수 플래그는 제2 값으로 부호화될 수 있다. 상기 부분 블록 계수 플래그는 상기 부분 블록 플래그에 따라 선택적으로 부호화될 수도 있다. 예를 들어, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는 경우(즉, 부분 블록 플래그가 제1 값인 경우)에만, 부분 블록의 계수 별로 부호화될 수 있다.A partial block coefficient flag related to the current partial block may be encoded ( S310 ). The partial block coefficient flag may be coded in units of coefficients. The partial block coefficient flag may indicate whether a coefficient is a non-zero coefficient. For example, when the coefficient is a non-zero coefficient, the partial block coefficient flag may be encoded as a first value, and when the coefficient is 0, the partial block coefficient flag may be encoded as a second value. The partial block coefficient flag may be selectively coded according to the partial block flag. For example, only when at least one non-zero coefficient exists in the current partial block (ie, when the partial block flag is the first value), encoding may be performed for each coefficient of the partial block.

계수의 절대값이 1보다 큰지 여부를 나타내는 플래그(이하, 제1 플래그라 함)를 부호화할 수 있다(S320). 상기 제1 플래그는, 상기 부분 블록 계수 플래그의 값에 따라 선택적으로 부호화될 수 있다. 예를 들어, 상기 계수가 넌-제로 계수인 경우(즉, 부분 블록 계수 플래그가 제1 값인 경우), 상기 계수의 절대값이 1보다 큰지 여부를 확인하여, 상기 제1 플래그를 부호화할 수 있다. 상기 계수의 절대값이 1보다 큰 경우, 상기 제1 플래그는 제1 값으로 부호화되고, 계수의 절대값이 1보다 크지 않은 경우, 상기 제1 플래그는 제2 값으로 부호화될 수 있다.A flag (hereinafter, referred to as a first flag) indicating whether the absolute value of the coefficient is greater than 1 may be encoded (S320). The first flag may be selectively coded according to a value of the partial block coefficient flag. For example, when the coefficient is a non-zero coefficient (that is, when the partial block coefficient flag is a first value), it is possible to determine whether the absolute value of the coefficient is greater than 1 to encode the first flag. . When the absolute value of the coefficient is greater than 1, the first flag may be encoded as a first value, and when the absolute value of the coefficient is not greater than 1, the first flag may be encoded as a second value.

계수의 절대값이 2보다 큰지 여부를 나타내는 플래그(이하, 제2 플래그라 함)를 부호화할 수 있다(S330). 상기 제2 플래그는, 상기 제1 플래그의 값에 따라 선택적으로 부호화될 수 있다. 예를 들어, 상기 계수가 1보다 큰 경우(즉, 제1 플래그가 제1 값인 경우), 상기 계수의 절대값이 2보다 큰지 여부를 확인하여, 상기 제2 플래그를 부호화할 수 있다. 상기 계수의 절대값이 2보다 큰 경우, 상기 제2 플래그는 제1 값으로 부호화되고, 계수의 절대값이 2보다 크지 않은 경우, 상기 제2 플래그는 제2 값으로 부호화될 수 있다.A flag (hereinafter, referred to as a second flag) indicating whether the absolute value of the coefficient is greater than 2 may be encoded ( S330 ). The second flag may be selectively encoded according to a value of the first flag. For example, when the coefficient is greater than 1 (ie, when the first flag is the first value), it is checked whether the absolute value of the coefficient is greater than 2, and the second flag may be encoded. When the absolute value of the coefficient is greater than 2, the second flag may be encoded as a first value, and when the absolute value of the coefficient is not greater than 2, the second flag may be encoded as a second value.

전술한 제1 플래그 또는 제2 플래그 중 적어도 하나의 개수는, 최소 1개에서 최대 (N*M)개일 수 있다. 또는, 제1 플래그 또는 제2 플래그 중 적어도 하나는 영상 부호화 장치에 기-약속된 고정된 개수(예를 들어, 1개, 2개 또는 그 이상)일 수 있다. 제1/제2 플래그의 개수는 입력 영상의 비트 뎁스, 영상 내 임의의 영역에서 원본 화소값의 범위(Dynamic range), 블록 크기/뎁스, 분할 기법(e.g., 쿼드 트리, 바이너리 트리), 변환 기법(e.g., DCT, DST), 변환 스킵 여부, 양자화 파라미터, 예측 모드(e.g., 인트라/인터 모드) 등에 따라 상이할 수 있다. 상기 제1/제2 플래그 외에, 계수의 절대값이 n보다 큰지 여부를 나타내는 제n 플래그가 추가적으로 부호화될 수도 있다. 여기서, n은 2보다 큰 자연수를 의미할 수 있다. 제n 플래그의 개수는 1개, 2개 또는 그 이상일 수 있으며, 전술한 제1/제2 플래그와 동일/유사한 방식으로 결정될 수 있다.The number of at least one of the aforementioned first flag or second flag may be a minimum of 1 and a maximum of (N*M). Alternatively, at least one of the first flag and the second flag may be a fixed number (eg, one, two, or more) pre-promised to the video encoding apparatus. The number of first/second flags is determined by the bit depth of the input image, the range of original pixel values in an arbitrary region within the image (dynamic range), the block size/depth, the segmentation technique (e.g., quad tree, binary tree), and the conversion technique. (e.g., DCT, DST), whether transform is skipped, a quantization parameter, and a prediction mode (e.g., intra/inter mode) may be different. In addition to the first/second flag, an nth flag indicating whether the absolute value of the coefficient is greater than n may be additionally encoded. Here, n may mean a natural number greater than 2. The number of n-th flags may be one, two, or more, and may be determined in the same/similar manner to the above-described first/second flags.

상기 현재 부분 블록 내에, 상기 제1/제2 플래그를 기반으로 부호화되지 않은 나머지 계수를 부호화할 수 있다(S340). 여기서, 상기 부호화는 계수값 자체를 부호화하는 과정일 수 있다. 상기 나머지 계수는 2와 같거나 클 수 있다. 상기 나머지 계수는, 상기 나머지 계수에 대한 부분 블록 계수 플래그, 제1 플래그 또는 제2 플래그 중 적어도 하나를 기반으로 부호화될 수 있다. 예를 들어, 상기 나머지 계수는, 상기 나머지 계수의 절대값에서 (부분 블록 계수 플래그+제1 플래그+제2 플래그)를 뺀 값으로 부호화될 수 있다.In the current partial block, the remaining coefficients that are not coded based on the first/second flag may be coded ( S340 ). Here, the encoding may be a process of encoding the coefficient value itself. The remaining coefficient may be greater than or equal to two. The residual coefficient may be encoded based on at least one of a partial block coefficient flag, a first flag, and a second flag for the residual coefficient. For example, the residual coefficient may be coded as a value obtained by subtracting (partial block coefficient flag + first flag + second flag) from an absolute value of the residual coefficient.

부분 블록의 계수에 대한 부호(sign)를 부호화할 수 있다(S350). 상기 부호는, 계수 단위로, 플래그 형태로 부호화될 수 있다. 상기 부호는, 전술한 부분 블록 계수 플래그의 값에 따라 선택적으로 부호화될 수 있다. 예를 들어, 상기 부호는, 상기 계수가 넌-제로 계수인 경우(즉, 상기 부분 블록 계수 플래그가 제1 값인 경우)에만 부호화될 수 있다.Signs for coefficients of partial blocks may be encoded ( S350 ). The code may be encoded in the form of a flag in units of coefficients. The code may be selectively encoded according to the value of the partial block coefficient flag described above. For example, the code may be coded only when the coefficient is a non-zero coefficient (ie, when the partial block coefficient flag is a first value).

전술한 바와 같이, 상기 부분 블록의 계수의 절대값 각각은, 부분 블록 계수 플래그 부호화, 제1 플래그 부호화, 제2 플래그 부호화, 또는 나머지 계수 부호화 중 적어도 하나를 통해 부호화될 수 있다.As described above, each absolute value of the coefficients of the partial blocks may be encoded through at least one of partial block coefficient flag encoding, first flag encoding, second flag encoding, and remaining coefficient encoding.

한편, 전술한 부분 블록의 계수 부호화는, 부분 블록에 속한 계수 값의 범위를 특정하는 과정을 더 수반할 수 있다. 상기 과정을 통해, 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부도 확인할 수 있다. 상기 과정은, 후술할 (A) 최대값의 부호화, (B) 제1 임계값 플래그의 부호화 또는 (C) 제2 임계값 플래그의 부호화 중 적어도 하나를 통해 구현될 수 있다. 상기 과정은, 전술한 S300 내지 S350 단계 중 어느 하나에 포함되어 구현될 수도 있고, S300 내지 S350 단계 중 적어도 하나와 대체되는 형태로 구현될 수도 있다. 이하, 도 4 내지 도 5를 참조하여, 부분 블록에 속한 계수 값의 범위를 특정하는 과정에 대해서 자세히 살펴 보기로 한다.Meanwhile, the above-described coefficient encoding of the partial block may further involve a process of specifying a range of coefficient values belonging to the partial block. Through the above process, it may also be checked whether at least one non-zero coefficient exists in the partial block. The above process may be implemented through at least one of (A) encoding a maximum value, (B) encoding a first threshold value flag, and (C) encoding a second threshold value flag, which will be described later. The process may be implemented by being included in any one of steps S300 to S350 described above, or may be implemented in a form replaced with at least one of steps S300 to S350. Hereinafter, a process of specifying a range of coefficient values belonging to a partial block will be described in detail with reference to FIGS. 4 to 5 .

도 4는 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 부호화하는 방법을 도시한 것이다.4 is a diagram illustrating a method of encoding a maximum value of a coefficient of a partial block according to an embodiment to which the present invention is applied.

도 4를 참조하면, 현재 부분 블록의 계수의 절대값 중 최대값을 부호화할 수 있다(S400). 상기 최대값을 통해, 현재 부분 블록에 속한 계수 값의 범위가 유추될 수 있다. 예를 들어, 상기 최대값이 m인 경우, 현재 부분 블록의 계수는 0 내지 m 범위에 속할 수 있다. 상기 최대값은, 전술한 부분 블록 플래그의 값에 따라 선택적으로 부호화될 수 있다. 예를 들어, 현재 부분 블록이 적어도 하나의 넌-제로 계수를 포함하는 경우(즉, 부분 블록 플래그가 제1 값인 경우)에만 부호화될 수 있다. 현재 부분 블록의 계수가 모두 0인 경우(즉, 부분 블록 플래그가 제2 값인 경우), 상기 최대값은 0으로 유도될 수 있다.Referring to FIG. 4 , the maximum value among absolute values of the coefficients of the current partial block may be encoded ( S400 ). From the maximum value, a range of coefficient values belonging to the current partial block may be inferred. For example, when the maximum value is m, the coefficient of the current partial block may be in the range of 0 to m. The maximum value may be selectively coded according to the value of the aforementioned partial block flag. For example, the encoding may be performed only when the current partial block includes at least one non-zero coefficient (ie, when the partial block flag is the first value). When all coefficients of the current partial block are 0 (ie, the partial block flag is the second value), the maximum value may be derived to 0.

또한, 상기 최대값을 통해, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 포함되는지 여부를 판단할 수도 있다. 예를 들어, 상기 최대값이 0보다 큰 경우, 상기 현재 부분 블록은 적어도 하나의 넌-제로 계수를 포함하고, 상기 최대값이 0인 경우, 상기 현재 부분 블록의 모든 계수는 0일 수 있다. 따라서, 상기 최대값 부호화는, S300의 부분 블록 플래그의 부호화와 대체되어 수행될 수도 있다.Also, based on the maximum value, it may be determined whether at least one non-zero coefficient is included in the current partial block. For example, when the maximum value is greater than 0, the current partial block includes at least one non-zero coefficient, and when the maximum value is 0, all coefficients of the current partial block may be 0. Accordingly, the encoding of the maximum value may be performed in place of encoding of the partial block flag of S300.

도 5는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 부호화하는 방법을 도시한 것이다.5 illustrates a method of encoding a first threshold value flag for a partial block according to an embodiment to which the present invention is applied.

본 발명의 제1 임계값 플래그는 부분 블록의 모든 계수가 소정의 임계값보다 작은지 여부를 나타낼 수 있다. 상기 임계값의 개수는 N개(N>=1)일 수 있고, 이 경우 임계값의 범위는 {T0, T1, T2,…,TN-1}과 같이 표현될 수 있다. 여기서, 0번째 임계값인 T0은 최소값을, (N-1)번째 임계값인 TN-1은 최대값을 각각 의미하고, {T0, T1, T2,…,TN-1}는 임계값이 오름차순으로 배열된 것일 수 있다. 상기 임계값의 개수는, 영상 부호화 장치에 기-설정된 것일 수 있다. 영상 부호화 장치는, 부호화 효율을 고려하여 최적의 임계값의 개수를 결정하고, 이를 부호화할 수 있다.The first threshold value flag of the present invention may indicate whether all coefficients of a partial block are less than a predetermined threshold value. The number of the threshold values may be N (N>=1), and in this case, the range of the threshold values is {T 0 , T 1 , T 2 , . . . ,T N-1 }. Here, the 0th threshold value T 0 is the minimum value, and the (N-1)th threshold value T N-1 is the maximum value, respectively, {T 0 , T 1 , T 2 , ... ,T N-1 } may be in which the threshold values are arranged in ascending order. The number of the threshold values may be preset in the image encoding apparatus. The image encoding apparatus may determine the number of optimal threshold values in consideration of encoding efficiency and encode them.

상기 임계값은, 상기 최소값을 1로 설정하고, 최소값을 n씩(n>=1) 증가시켜서 획득될 수 있다. 상기 임계값은, 영상 부호화 장치에 기-설정된 것일 수 있다. 영상 부호화 장치는, 부호화 효율을 고려하여 최적의 임계값을 결정하고, 이를 부호화할 수 있다.The threshold value may be obtained by setting the minimum value to 1 and increasing the minimum value by n (n>=1). The threshold value may be pre-set in the image encoding apparatus. The image encoding apparatus may determine an optimal threshold value in consideration of encoding efficiency, and may encode it.

상기 임계값의 범위는, 양자화 파라미터(QP)에 따라 상이하게 결정될 수 있다. 상기 QP는, 시퀀스, 픽쳐, 슬라이스, 또는 변환 블록 중 적어도 하나의 레벨에서 설정된 것일 수 있다. The range of the threshold value may be determined differently according to the quantization parameter QP. The QP may be set in at least one level of a sequence, a picture, a slice, and a transform block.

예를 들어, 상기 QP가 소정의 QP 임계치보다 큰 경우, 변환 블록 내 제로 계수의 분포가 많아질 것으로 예측할 수 있다. 이 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다.For example, when the QP is greater than a predetermined QP threshold, it may be predicted that the distribution of zero coefficients in the transform block will increase. In this case, the range of the threshold value may be determined as {3}, or the first/second threshold value flag encoding process may be omitted, and the coefficients of the partial blocks may be encoded through the above-described steps S300 to S350.

반면, 상기 QP가 소정의 QP 임계치보다 작은 경우, 변환 블록 내 넌-제로 계수의 분포가 많아질 것으로 예측할 수 있다. 이 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. On the other hand, when the QP is smaller than a predetermined QP threshold, it can be predicted that the distribution of non-zero coefficients in the transform block increases. In this case, the range of the threshold value may be determined as {3, 5} or {5, 3}.

즉, QP가 작은 경우의 임계값 범위는, QP가 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 QP 임계치의 개수는, 1개, 2개 또는 그 이상일 수 있다. QP 임계치는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 QP 임계치는, 영상 부호화 장치에서 이용 가능한 QP의 범위 중 중앙값에 해당할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 QP 임계치를 결정하고, 이를 부호화할 수도 있다. That is, the threshold value range when the QP is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the QP is large. The number of the QP thresholds may be one, two, or more. The QP threshold may be pre-set in the video encoding apparatus. For example, the QP threshold may correspond to a median value of a range of QPs available in the video encoding apparatus. Alternatively, the image encoding apparatus may determine an optimal QP threshold in consideration of encoding efficiency and encode it.

또는, 임계값의 범위는, 블록의 크기/형태에 따라 상이하게 결정될 수 있다. 여기서, 블록은 코딩 블록, 예측 블록, 변환 블록, 또는 부분 블록을 의미할 수 있다. 상기 크기는, 블록의 너비, 높이, 너비와 높이의 합, 또는 계수 개수 중 적어도 하나로 표현될 수 있다.Alternatively, the range of the threshold value may be determined differently according to the size/type of the block. Here, the block may mean a coding block, a prediction block, a transform block, or a partial block. The size may be expressed by at least one of a block width, a height, a sum of the width and height, or a number of coefficients.

예를 들어, 블록의 크기가 소정의 임계크기보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, if the size of the block is smaller than the predetermined threshold size, the threshold range is determined as {3}, or the first/second threshold value flag encoding process is omitted, and steps S300 to S350 described above are performed. Through this, the coefficients of the partial blocks can be coded. On the other hand, when the size of the block is larger than the predetermined threshold size, the range of the threshold value may be determined as {3, 5} or {5, 3}.

즉, 블록의 크기가 작은 경우의 임계값 범위는, 블록의 크기가 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 임계크기의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계크기는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 임계크기는 axb로 표현되며, 여기서 a와 b는 2, 4, 8, 16, 32, 64 또는 그 이상이고, a와 b는 동일하거나 상이할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 임계크기를 결정하고, 이를 부호화할 수도 있다.That is, the threshold value range when the block size is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the block size is large. The number of the threshold sizes may be one, two, or more. The threshold size may be preset in the image encoding apparatus. For example, the threshold size is expressed by axb, where a and b are 2, 4, 8, 16, 32, 64 or more, and a and b may be the same or different. Alternatively, the image encoding apparatus may determine an optimal threshold size in consideration of encoding efficiency and encode it.

또는, 상기 임계값의 범위는, 화소값 범위에 따라 상이하게 결정될 수 있다. 상기 화소값 범위는, 소정의 영역에 속하는 화소의 최대값 및/또는 최소값으로 표현될 수 있다. 이때, 소정의 영역은, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나를 의미할 수 있다. Alternatively, the range of the threshold value may be determined differently according to a range of pixel values. The pixel value range may be expressed as a maximum value and/or a minimum value of pixels belonging to a predetermined region. In this case, the predetermined region may mean at least one of a sequence, a picture, a slice, and a block.

예를 들어, 화소값 범위의 최대값과 최소값 간의 차이가, 소정의 임계 차이값보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다. 반면, 상기 차이가 소정의 임계 차이값보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the difference between the maximum value and the minimum value of the pixel value range is smaller than a predetermined threshold difference value, the threshold value range is determined as {3}, or the first/second threshold value flag encoding process is omitted And, it is possible to encode the coefficients of the partial blocks through the above-described steps S300 to S350. On the other hand, when the difference is greater than a predetermined threshold difference value, the range of the threshold value may be determined as {3, 5} or {5, 3}.

즉, 상기 차이가 작은 경우의 임계값 범위는, 상기 차이 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 임계 차이값의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계 차이값은 영상 부호화 장치에 기-설정된 것일 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 임계 차이값을 결정하고, 이를 부호화할 수도 있다.That is, the threshold value range when the difference is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the difference is large. The number of the threshold difference values may be one, two, or more. The threshold difference value may be preset in the image encoding apparatus. Alternatively, the image encoding apparatus may determine an optimal threshold difference value in consideration of encoding efficiency and encode it.

도 5를 참조하면, 현재 부분 블록 내 모든 계수의 절대값이 현재 임계값보다 작은지 여부를 판단할 수 있다(S500).Referring to FIG. 5 , it may be determined whether absolute values of all coefficients in the current partial block are smaller than a current threshold value ( S500 ).

만일, 모든 계수의 절대값이 현재 임계값보다 작지 않은 경우, 제1 임계값 플래그를 "거짓"으로 부호화할 수 있다(S510). 이 경우, 상기 현재 임계값(i번째 임계값)은 다음 임계값((i+1)번째 임계값)으로 업데이트되고(S520), 업데이트된 현재 임계값을 기반으로, 전술한 S500 단계를 수행할 수 있다. 또는, 모든 계수의 절대값이 현재 임계값보다 작지 않은 경우, S510 단계의 제1 임계값 플래그 부호화 과정을 생략하고, 상기 현재 임계값을 다음 임계값으로 업데이트할 수도 있다.If the absolute values of all coefficients are not smaller than the current threshold value, the first threshold value flag may be encoded as “false” (S510). In this case, the current threshold value (i-th threshold value) is updated to the next threshold value ((i+1)-th threshold value) (S520), and based on the updated current threshold value, the above-described step S500 is performed. can Alternatively, when the absolute values of all coefficients are not smaller than the current threshold value, the first threshold value flag encoding process in step S510 may be omitted and the current threshold value may be updated to the next threshold value.

상기 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 가산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, 상기 제1 임계값 플래그가 "참"으로 부호화될 때까지 반복적으로 수행될 수도 있다. 상기 업데이트된 현재 임계값을 기반으로, 전술한 S500 단계를 수행할 수 있다. 또는, 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is one, the current threshold value may be updated by adding a predetermined constant to the current threshold value. The predetermined constant may be an integer greater than or equal to 1. In this case, the update may be repeatedly performed until the first threshold value flag is encoded as “true”. Based on the updated current threshold value, the above-described step S500 may be performed. Alternatively, when the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is one, the update process may be terminated.

만일, 모든 계수의 절대값이 현재 임계값보다 작은 경우, 상기 제1 임계값 플래그를 "참"으로 부호화할 수 있다(S530).If the absolute values of all coefficients are smaller than the current threshold value, the first threshold value flag may be coded as “true” (S530).

전술한 바와 같이, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 작음을 나타낼 수 있다. 반면, i번째 임계값에 대한 제1 임계값 플래그가 "거짓"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 크거나 같음을 나타낼 수 있다. 상기 "참"인 제1 임계값 플래그를 기반으로, 부분 블록에 속한 계수 값의 범위를 특정할 수 있다. 즉, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록에 속한 계수는 0 내지 (i번째 임계값-1) 범위에 속할 수 있다.As described above, when the first threshold value flag for the i-th threshold is “true”, this may indicate that the absolute values of all coefficients in the partial block are less than the i-th threshold. On the other hand, when the first threshold value flag for the i-th threshold value is “false”, this may indicate that the absolute values of all coefficients in the partial block are greater than or equal to the i-th threshold value. Based on the "true" first threshold value flag, a range of coefficient values belonging to a partial block may be specified. That is, when the first threshold value flag for the i-th threshold value is “true”, coefficients belonging to the partial block may be in the range of 0 to (i-th threshold value-1).

상기 부호화된 제1 임계값 플래그에 따라, 전술한 S300 내지 S350 단계 중 적어도 하나가 생략될 수 있다. According to the encoded first threshold value flag, at least one of the above-described steps S300 to S350 may be omitted.

예를 들어, 임계값의 범위가 {3, 5}인 경우, 임계값 "3"에 대한 제1 임계값 플래그 또는 임계값 "5"에 대한 제1 임계값 플래그 중 적어도 하나가 부호화될 수 있다. 상기 임계값 "3"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값은 0 내지 2 범위에 속할 수 있다. 이 경우, 전술한 S330 또는 S340 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 부호화하거나, S300, S330 또는 S340 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 부호화할 수도 있다. For example, when the range of the threshold value is {3, 5}, at least one of the first threshold value flag for the threshold value “3” or the first threshold value flag for the threshold value “5” may be encoded. . When the first threshold value flag for the threshold value “3” is “true”, the absolute values of all coefficients in the partial block may be in the range of 0 to 2. In this case, the coefficients of the partial blocks are encoded by performing the remaining steps except for at least one of the above-described steps S330 and S340, or the coefficients of the partial blocks are encoded by performing the remaining steps except for at least one of the steps S300, S330, and S340. may be

상기 임계값 "3"에 대한 제1 임계값 플래그가 "거짓"인 경우, 상기 임계값 "5"에 대한 제1 임계값 플래그가 부호화될 수 있다. 상기 임계값 "5"에 대한 제1 임계값 플래그가 "거짓"인 경우, 부분 블록 내 계수의 절대값 중 적어도 하나는 5보다 크거나 같을 수 있다. 이 경우, 전술한 S300 내지 S350 단계를 동일하게 수행하여, 부분 블록의 계수를 부호화할 수도 있고, S300 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 부호화할 수도 있다. When the first threshold value flag for the threshold value “3” is “false”, the first threshold value flag for the threshold value “5” may be encoded. When the first threshold flag for the threshold value “5” is “false”, at least one of absolute values of coefficients in the partial block may be greater than or equal to 5. In this case, the coefficients of the partial blocks may be encoded by performing the same steps S300 to S350 as described above, or the remaining steps except for the step S300 may be performed to encode the coefficients of the partial blocks.

반면, 상기 임계값 "5"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값이 0 내지 4 범위에 속할 수 있다. 이 경우, 전술한 S300 내지 S350 단계를 동일하게 수행하여, 부분 블록의 계수를 부호화할 수도 있고, S300 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 부호화할 수도 있다.On the other hand, when the first threshold value flag for the threshold value “5” is “true”, absolute values of all coefficients in the partial block may be in the range of 0 to 4. In this case, the coefficients of the partial blocks may be encoded by performing the same steps S300 to S350 as described above, or the remaining steps except for the step S300 may be performed to encode the coefficients of the partial blocks.

한편, 현재 부분 블록의 제1 임계값 플래그는, 다른 부분 블록의 제1 임계값 플래그를 기반으로 유도될 수 있다. 이 경우, 제1 임계값 플래그 부호화 과정은 생략될 수 있으며, 이에 대해서는 도 11을 참조하여 살펴 보기로 한다.Meanwhile, the first threshold value flag of the current partial block may be derived based on the first threshold value flag of another partial block. In this case, the first threshold flag encoding process may be omitted, which will be described with reference to FIG. 11 .

도 6은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 복호화하는 방법을 도시한 것이다.6 illustrates a method of decoding coefficients of a transform block according to an embodiment to which the present invention is applied.

영상 복호화 장치에서, 변환 블록의 계수는 소정의 블록 단위(이하, 부분 블록이라 함)로 복호화될 수 있다. 변환 블록은 하나 또는 그 이상의 부분 블록으로 구성될 수 있다. 상기 부분 블록은 NxM 크기의 블록일 수 있다. 여기서, N과 M은 자연수이며, N과 M은 서로 동일하거나 상이할 수 있다. 즉, 부분 블록은 정방형 또는 비정방형의 블록일 수 있다. 부분 블록의 크기/형태는 영상 복호화 장치에 기-약속된 고정된 것(예를 들어, 4x4)일 수도 있고, 변환 블록의 크기/형태에 따라 가변적으로 결정될 수도 있고, 시그날링되는 부분 블록의 크기/형태에 관한 정보를 기반으로 가변적으로 결정될 수도 있다. 상기 부분 블록의 크기/형태에 관한 정보는 시퀀스, 픽쳐, 슬라이스 또는 블록 레벨 중 적어도 하나에서 시그날링될 수 있다. In the image decoding apparatus, coefficients of the transform block may be decoded in units of predetermined blocks (hereinafter, referred to as partial blocks). A transform block may consist of one or more partial blocks. The partial block may be a block of size NxM. Here, N and M are natural numbers, and N and M may be the same as or different from each other. That is, the partial block may be a square or non-square block. The size/shape of the partial block may be a fixed one (eg, 4x4) pre-promised to the image decoding apparatus, may be variably determined according to the size/shape of the transform block, and the size of the signaled partial block / It may be variably determined based on information about the shape. Information on the size/shape of the partial block may be signaled at at least one of a sequence, a picture, a slice, and a block level.

영상 복호화 장치에서, 변환 블록에 속한 부분 블록을 복호화하는 순서는, 소정의 스캔 타입(이하, 제1 스캔 타입이라 함)에 따라 결정될 수 있다. 또한, 부분 블록에 속한 계수를 복호화하는 순서는 소정의 스캔 타입(이하, 제2 스캔 타입이라 함)에 따라 결정될 수 있다. 상기 제1 스캔 타입과 제2 스캔 타입은 동일할 수도 있고, 상이할 수도 있다. 상기 제1/제2 스캔 타입으로, 대각선 스캔, 수직 스캔, 수평 스캔 등이 이용될 수 있다. 다만, 이에 한정되지 아니하며, 소정의 각도를 가진 하나 또는 그 이상의 스캔 타입이 더 추가될 수도 있다. 상기 제1/제2 스캔 타입은 코딩 블록 관련 정보(예를 들어, 최대/최소 크기, 분할 기법 등), 변환 블록의 크기/형태, 부분 블록의 크기/형태, 예측 모드, 인트라 예측 관련 정보(예를 들어, 인트라 예측 모드의 값, 방향성, 각도 등) 또는 인터 예측 관련 정보 중 적어도 하나에 기초하여 결정될 수 있다.In the image decoding apparatus, an order of decoding the partial blocks included in the transform block may be determined according to a predetermined scan type (hereinafter, referred to as a first scan type). Also, the decoding order of coefficients belonging to partial blocks may be determined according to a predetermined scan type (hereinafter, referred to as a second scan type). The first scan type and the second scan type may be the same or different. As the first/second scan type, a diagonal scan, a vertical scan, a horizontal scan, etc. may be used. However, the present invention is not limited thereto, and one or more scan types having a predetermined angle may be further added. The first/second scan type includes coding block related information (eg, maximum/minimum size, partitioning technique, etc.), size/shape of transform block, size/shape of partial block, prediction mode, intra prediction related information ( For example, it may be determined based on at least one of an intra prediction mode value, directionality, angle, etc.) or inter prediction related information.

영상 복호화 장치는, 변환 블록 내에서, 전술한 복호화 순서상 최초 0이 아닌 계수(이하, 넌-제로 계수라 함)를 포함한 부분 블록의 위치 정보를 복호화할 수 있다. 상기 위치 정보에 따른 부분 블록부터 순차적으로 복호화를 수행할 수 있다. 이하, 도 6을 참조하여, 부분 블록의 계수를 복호화하는 과정을 살펴 보기로 한다.The image decoding apparatus may decode position information of a partial block including a first non-zero coefficient (hereinafter, referred to as a non-zero coefficient) in the above-described decoding order in the transform block. Decoding may be sequentially performed from the partial blocks according to the location information. Hereinafter, a process of decoding the coefficients of a partial block will be described with reference to FIG. 6 .

현재 부분 블록에 관한 부분 블록 플래그가 복호화될 수 있다(S600). 상기 부분 블록 플래그는 부분 블록의 단위로 복호화될 수 있다. 상기 부분 블록 플래그는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타낼 수 있다. 예를 들어, 상기 부분 블록 플래그가 제1 값인 경우, 상기 현재 부분 블록은 적어도 하나의 넌-제로 계수가 존재함을 나타내고, 부분 블록 플래그가 제2 값인 경우, 상기 현재 부분 블록의 모든 계수는 0임을 나타낼 수 있다.A partial block flag related to the current partial block may be decoded (S600). The partial block flag may be decoded in units of partial blocks. The partial block flag may indicate whether at least one non-zero coefficient exists in the current partial block. For example, when the partial block flag is a first value, the current partial block indicates that at least one non-zero coefficient exists, and when the partial block flag is a second value, all coefficients of the current partial block are 0 can indicate that

현재 부분 블록에 관한 부분 블록 계수 플래그가 복호화될 수 있다(S610). 상기 부분 블록 계수 플래그는 계수 단위로 복호화될 수 있다. 상기 부분 블록 계수 플래그는, 계수가 넌-제로 계수인지 여부를 나타낼 수 있다. 예를 들어, 상기 부분 블록 계수 플래그가 제1 값인 경우, 상기 계수가 넌-제로 계수임을 나타내고, 상기 부분 블록 계수 플래그가 제2 값인 경우, 상기 계수가 0임을 나타낼 수 있다. 상기 부분 블록 계수 플래그는 상기 부분 블록 플래그에 따라 선택적으로 복호화될 수도 있다. 예를 들어, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는 경우(즉, 부분 블록 플래그가 제1 값인 경우)에만, 부분 블록의 계수 별로 복호화될 수 있다.A partial block coefficient flag for the current partial block may be decoded (S610). The partial block coefficient flag may be decoded in units of coefficients. The partial block coefficient flag may indicate whether a coefficient is a non-zero coefficient. For example, when the partial block coefficient flag has a first value, it may indicate that the coefficient is a non-zero coefficient, and when the partial block coefficient flag has a second value, it may indicate that the coefficient is 0. The partial block coefficient flag may be selectively decoded according to the partial block flag. For example, only when at least one non-zero coefficient exists in the current partial block (ie, when the partial block flag is the first value), decoding may be performed for each coefficient of the partial block.

계수의 절대값이 1보다 큰지 여부를 나타내는 플래그(이하, 제1 플래그라 함)가 복호화될 수 있다(S620). 상기 제1 플래그는, 상기 부분 블록 계수 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 상기 계수가 넌-제로 계수인 경우(즉, 부분 블록 계수 플래그가 제1 값인 경우), 상기 제1 플래그를 복호화하여, 상기 계수의 절대값이 1보다 큰지 여부를 확인할 수 있다. 상기 제1 플래그가 제1 값인 경우, 상기 계수의 절대값이 1보다 크고, 상기 제1 플래그가 제2 값인 경우, 상기 계수의 절대값이 1일 수 있다.A flag (hereinafter, referred to as a first flag) indicating whether the absolute value of the coefficient is greater than 1 may be decoded (S620). The first flag may be selectively decoded according to a value of the partial block coefficient flag. For example, when the coefficient is a non-zero coefficient (ie, when the partial block coefficient flag has a first value), it is possible to determine whether the absolute value of the coefficient is greater than 1 by decoding the first flag. When the first flag is the first value, the absolute value of the coefficient is greater than 1, and when the first flag is the second value, the absolute value of the coefficient is 1.

상기 계수의 절대값이 2보다 큰지 여부를 나타내는 플래그(이하, 제2 플래그라 함)가 복호화할 수 있다(S630). 상기 제2 플래그는, 상기 제1 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 상기 계수가 1보다 큰 경우(즉, 제1 플래그가 제1 값인 경우), 상기 제2 플래그를 복호화하여, 상기 계수의 절대값이 2보다 큰지 여부를 확인할 수 있다. 상기 제2 플래그가 제1 값인 경우, 상기 계수의 절대값이 2보다 크고, 상기 제2 플래그가 제2 값인 경우, 상기 계수의 절대값이 2일 수 있다.A flag (hereinafter, referred to as a second flag) indicating whether the absolute value of the coefficient is greater than 2 may be decoded (S630). The second flag may be selectively decoded according to a value of the first flag. For example, when the coefficient is greater than 1 (ie, when the first flag is the first value), it is possible to determine whether the absolute value of the coefficient is greater than 2 by decoding the second flag. When the second flag is the first value, the absolute value of the coefficient is greater than 2, and when the second flag is the second value, the absolute value of the coefficient is 2.

전술한 제1 플래그 또는 제2 플래그 중 적어도 하나의 개수는, 최소 1개에서 최대 (N*M)개일 수 있다. 또는, 제1 플래그 또는 제2 플래그 중 적어도 하나는 영상 복호화 장치에 기-약속된 고정된 개수(예를 들어, 1개, 2개 또는 그 이상)일 수 있다. 제1/제2 플래그의 개수는 블록 크기/뎁스, 분할 기법(e.g., 쿼드 트리, 바이너리 트리), 변환 기법(e.g., DCT, DST), 변환 스킵 여부, 양자화 파라미터, 예측 모드(e.g., 인트라/인터 모드) 등에 따라 상이할 수 있다. 상기 제1/제2 플래그 외에, 계수의 절대값이 n보다 큰지 여부를 나타내는 제n 플래그가 추가적으로 복호화될 수도 있다. 여기서, n은 2보다 큰 자연수를 의미할 수 있다. 제n 플래그의 개수는 1개, 2개 또는 그 이상일 수 있으며, 전술한 제1/제2 플래그와 동일/유사한 방식으로 결정될 수 있다.The number of at least one of the aforementioned first flag or second flag may be a minimum of 1 and a maximum of (N*M). Alternatively, at least one of the first flag and the second flag may be a fixed number (eg, one, two, or more) that is pre-promised to the image decoding apparatus. The number of the first/second flags is a block size/depth, a partitioning technique (e.g., quad tree, binary tree), a transform technique (e.g., DCT, DST), whether to skip transform, a quantization parameter, and a prediction mode (e.g., intra/ inter mode) and the like. In addition to the first/second flag, an n-th flag indicating whether the absolute value of the coefficient is greater than n may be further decoded. Here, n may mean a natural number greater than 2. The number of n-th flags may be one, two, or more, and may be determined in the same/similar manner to the above-described first/second flags.

상기 현재 부분 블록 내에, 상기 제1/제2 플래그를 기반으로 복호화되지 않은 나머지 계수를 복호화할 수 있다(S640). 여기서, 상기 복호화는 계수값 자체를 복호화하는 과정일 수 있다. 상기 나머지 계수는 2와 같거나 클 수 있다. 상기 나머지 계수는, 상기 나머지 계수에 대한 부분 블록 계수 플래그, 제1 플래그 또는 제2 플래그 중 적어도 하나를 기반으로 복호화될 수 있다. 예를 들어, 상기 나머지 계수는, (부분 블록 계수 플래그+제1 플래그+제2 플래그+시그날링된 계수)로 유도될 수 있다.In the current partial block, the remaining coefficients that have not been decoded based on the first/second flag may be decoded (S640). Here, the decoding may be a process of decoding the coefficient value itself. The remaining coefficient may be greater than or equal to two. The residual coefficient may be decoded based on at least one of a partial block coefficient flag, a first flag, and a second flag for the residual coefficient. For example, the remaining coefficients may be derived as (partial block coefficient flag + first flag + second flag + signaled coefficient).

부분 블록의 계수에 대한 부호(sign)를 복호화할 수 있다(S650). 상기 부호는, 계수 단위로, 플래그 형태로 복호화될 수 있다. 상기 부호는, 전술한 부분 블록 계수 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 상기 부호는, 상기 계수가 넌-제로 계수인 경우(즉, 상기 부분 블록 계수 플래그가 제1 값인 경우)에만 복호화될 수 있다.Signs of coefficients of partial blocks may be decoded (S650). The code may be decoded in the form of a flag, in units of coefficients. The code may be selectively decoded according to the value of the aforementioned partial block coefficient flag. For example, the code may be decoded only when the coefficient is a non-zero coefficient (ie, when the partial block coefficient flag is a first value).

한편, 전술한 부분 블록의 계수 복호화는, 부분 블록에 속한 계수 값의 범위를 특정하는 과정을 더 수반할 수 있다. 상기 과정을 통해, 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부도 확인할 수 있다. 상기 과정은, 후술할 (A) 최대값의 복호화, (B) 제1 임계값 플래그의 복호화 또는 (C) 제2 임계값 플래그의 복호화 중 적어도 하나를 통해 수행될 수 있다. 상기 과정은, 전술한 S600 내지 S650 단계 중 어느 하나에 포함되어 수행될 수도 있고, S600 내지 S650 단계 중 적어도 하나와 대체되는 형태로 수행될 수도 있다. 이하, 도 7 내지 도 8을 참조하여, 부분 블록에 속한 계수 값의 범위를 특정하는 과정에 대해서 자세히 살펴 보기로 한다.Meanwhile, the above-described coefficient decoding of the partial block may further involve a process of specifying a range of coefficient values belonging to the partial block. Through the above process, it may also be checked whether at least one non-zero coefficient exists in the partial block. The process may be performed through at least one of (A) decoding of the maximum value, (B) decoding of the first threshold value flag, and (C) decoding of the second threshold value flag, which will be described later. The process may be performed by being included in any one of steps S600 to S650 described above, or may be performed in a form substituted for at least one of steps S600 to S650. Hereinafter, a process of specifying a range of coefficient values belonging to a partial block will be described in detail with reference to FIGS. 7 to 8 .

도 7은 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 복호화하는 방법을 도시한 것이다.7 illustrates a method of decoding a maximum value of a coefficient of a partial block according to an embodiment to which the present invention is applied.

도 7을 참조하면, 현재 부분 블록의 계수의 절대값 중 최대값을 나타내는 정보를 복호화할 수 있다(S700). 상기 정보에 따른 최대값을 통해, 현재 부분 블록에 속한 계수 값의 범위가 유추될 수 있다. 예를 들어, 상기 최대값이 m인 경우, 현재 부분 블록의 계수는 0 내지 m 범위에 속할 수 있다. 상기 최대값을 나타내는 정보는, 전술한 부분 블록 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 현재 부분 블록이 적어도 하나의 넌-제로 계수를 포함하는 경우(즉, 부분 블록 플래그가 제1 값인 경우)에만 복호화될 수 있다. 현재 부분 블록의 계수가 모두 0인 경우(즉, 부분 블록 플래그가 제2 값인 경우), 상기 최대값을 나타내는 정보는 0으로 유도될 수 있다.Referring to FIG. 7 , information indicating a maximum value among absolute values of coefficients of the current partial block may be decoded ( S700 ). A range of coefficient values belonging to the current partial block may be inferred through the maximum value according to the information. For example, when the maximum value is m, the coefficient of the current partial block may be in the range of 0 to m. The information indicating the maximum value may be selectively decoded according to the value of the aforementioned partial block flag. For example, decoding may be performed only when the current partial block includes at least one non-zero coefficient (ie, when the partial block flag is the first value). When all coefficients of the current partial block are 0 (ie, the partial block flag is the second value), the information indicating the maximum value may be derived as 0.

또한, 상기 정보에 따른 최대값을 통해, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 포함되는지 여부를 결정할 수도 있다. 예를 들어, 상기 최대값이 0보다 큰 경우, 상기 현재 부분 블록은 적어도 하나의 넌-제로 계수를 포함하고, 상기 최대값이 0인 경우, 상기 현재 부분 블록의 모든 계수는 0일 수 있다. 따라서, 상기 최대값 복호화는, S600의 부분 블록 플래그의 복호화와 대체되어 수행될 수도 있다.In addition, it may be determined whether at least one non-zero coefficient is included in the current partial block through the maximum value according to the information. For example, when the maximum value is greater than 0, the current partial block includes at least one non-zero coefficient, and when the maximum value is 0, all coefficients of the current partial block may be 0. Accordingly, the decoding of the maximum value may be performed in place of the decoding of the partial block flag of S600.

도 8은 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 복호화하는 방법을 도시한 것이다.8 is a diagram illustrating a method of decoding a first threshold value flag for a partial block according to an embodiment to which the present invention is applied.

본 발명의 제1 임계값 플래그는 부분 블록의 모든 계수가 소정의 임계값보다 작은지 여부를 나타낼 수 있다. 상기 임계값의 개수는 N개(N>=1)일 수 있고, 이 경우 임계값의 범위는 {T0, T1, T2,…,TN-1}과 같이 표현될 수 있다. 여기서, 0번째 임계값인 T0은 최소값을, (N-1)번째 임계값인 TN-1은 최대값을 각각 의미하고, {T0, T1, T2,…,TN-1}는 임계값이 오름차순으로 배열된 것일 수 있다. 상기 임계값의 개수는, 영상 복호화 장치에 기-설정된 것일 수도 있고, 시그날링되는 임계값의 개수에 관한 정보를 기반으로 결정될 수도 있다.The first threshold value flag of the present invention may indicate whether all coefficients of a partial block are less than a predetermined threshold value. The number of the threshold values may be N (N>=1), and in this case, the range of the threshold values is {T 0 , T 1 , T 2 , . . . ,T N-1 }. Here, the 0th threshold value T 0 is the minimum value, and the (N-1)th threshold value T N-1 is the maximum value, respectively, {T 0 , T 1 , T 2 , ... ,T N-1 } may be in which the threshold values are arranged in ascending order. The number of thresholds may be preset in the image decoding apparatus, or may be determined based on information about the number of signaled thresholds.

상기 임계값은, 상기 최소값을 1로 설정하고, 최소값을 n씩(n>=1) 증가시켜서 획득될 수 있다. 상기 임계값은, 영상 복호화 장치에 기-설정된 것일 수도 있고, 시그날링되는 임계값에 관한 정보를 기반으로 결정될 수도 있다.The threshold value may be obtained by setting the minimum value to 1 and increasing the minimum value by n (n>=1). The threshold value may be pre-set in the image decoding apparatus, or may be determined based on information about a signaled threshold value.

상기 임계값의 범위는, 양자화 파라미터(QP)에 따라 상이하게 결정될 수 있다. 상기 QP는, 시퀀스, 픽쳐, 슬라이스, 또는 변환 블록 중 적어도 하나의 레벨에서 설정된 것일 수 있다. The range of the threshold value may be determined differently according to the quantization parameter QP. The QP may be set in at least one level of a sequence, a picture, a slice, and a transform block.

예를 들어, 상기 QP가 소정의 QP 임계치보다 큰 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S600 내지 S650 단계를 통해 부분 블록의 계수를 복호화할 수 있다.For example, when the QP is greater than a predetermined QP threshold, the threshold range is determined as {3}, or the first/second threshold flag decoding process is omitted, and the above-described steps S600 to S650 are performed. Coefficients of partial blocks may be decoded.

반면, 상기 QP가 소정의 QP 임계치보다 작은 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. On the other hand, when the QP is smaller than a predetermined QP threshold, the range of the threshold may be determined to be {3, 5} or {5, 3}.

즉, QP가 작은 경우의 임계값 범위는, QP가 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 QP 임계치의 개수는, 1개, 2개 또는 그 이상일 수 있다. QP 임계치는, 영상 복호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 QP 임계치는, 영상 복호화 장치에서 이용 가능한 QP의 범위 중 중앙값에 해당할 수 있다. 또는, 상기 QP 임계치는, 영상 부호화 장치에서 시그날링되는 QP 임계치에 관한 정보를 기반으로 결정될 수도 있다.That is, the threshold value range when the QP is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the QP is large. The number of the QP thresholds may be one, two, or more. The QP threshold may be pre-set in the image decoding apparatus. For example, the QP threshold may correspond to a median value of a range of QPs available in the image decoding apparatus. Alternatively, the QP threshold may be determined based on information about the QP threshold signaled by the image encoding apparatus.

또는, 임계값의 범위는, 블록의 크기/형태에 따라 상이하게 결정될 수 있다. 여기서, 블록은 코딩 블록, 예측 블록, 변환 블록, 또는 부분 블록을 의미할 수 있다. 상기 크기는, 블록의 너비, 높이, 너비와 높이의 합, 또는 계수 개수 중 적어도 하나로 표현될 수 있다.Alternatively, the range of the threshold value may be determined differently according to the size/type of the block. Here, the block may mean a coding block, a prediction block, a transform block, or a partial block. The size may be expressed by at least one of a block width, a height, a sum of the width and height, or a number of coefficients.

예를 들어, 블록의 크기가 소정의 임계크기보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S600 내지 S650 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, if the size of the block is smaller than the predetermined threshold size, the threshold range is determined as {3}, or the first/second threshold flag decoding process is omitted, and steps S600 to S650 described above are performed. It is possible to decode the coefficients of the partial blocks through On the other hand, when the size of the block is larger than the predetermined threshold size, the range of the threshold value may be determined as {3, 5} or {5, 3}.

즉, 블록의 크기가 작은 경우의 임계값 범위는, 블록의 크기가 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 임계크기의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계크기는, 영상 복호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 임계크기는 axb로 표현되며, 여기서 a와 b는 2, 4, 8, 16, 32, 64 또는 그 이상이고, a와 b는 동일하거나 상이할 수 있다. 또는, 상기 임계크기는, 영상 부호화 장치에서 시그날링되는 임계크기에 관한 정보를 기반으로 결정될 수 있다.That is, the threshold value range when the block size is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the block size is large. The number of the threshold sizes may be one, two, or more. The threshold size may be preset in the image decoding apparatus. For example, the threshold size is expressed by axb, where a and b are 2, 4, 8, 16, 32, 64 or more, and a and b may be the same or different. Alternatively, the threshold size may be determined based on information about the threshold size signaled by the image encoding apparatus.

또는, 상기 임계값의 범위는, 화소값 범위에 따라 상이하게 결정될 수 있다. 상기 화소값 범위는, 소정의 영역에 속하는 화소의 최대값 및/또는 최소값으로 표현될 수 있다. 이때, 소정의 영역은, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나를 의미할 수 있다. Alternatively, the range of the threshold value may be determined differently according to a range of pixel values. The pixel value range may be expressed as a maximum value and/or a minimum value of pixels belonging to a predetermined region. In this case, the predetermined region may mean at least one of a sequence, a picture, a slice, and a block.

예를 들어, 화소값 범위의 최대값과 최소값 간의 차이가, 소정의 임계 차이값보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S600 내지 S650 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 상기 차이가 소정의 임계 차이값보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the difference between the maximum value and the minimum value of the pixel value range is smaller than a predetermined threshold difference value, the threshold value range is determined as {3} or the first/second threshold value flag decoding process is omitted And, the coefficients of the partial blocks may be decoded through the above-described steps S600 to S650. On the other hand, when the difference is greater than a predetermined threshold difference value, the range of the threshold value may be determined as {3, 5} or {5, 3}.

즉, 상기 차이가 작은 경우의 임계값 범위는, 상기 차이 큰 경우의 임계값 범위와 상이한 임계값의 개수 및/또는 크기(예를 들어, 최대값)를 가질 수 있다. 상기 임계 차이값의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계 차이값은 영상 복호화 장치에 기-설정된 것일 수도 있고, 영상 부호화 장치에서 시그날링되는 임계 차이값에 관한 정보를 기반으로 결정될 수도 있다.That is, the threshold value range when the difference is small may have a different number and/or size (eg, maximum value) of threshold values from the threshold value range when the difference is large. The number of the threshold difference values may be one, two, or more. The threshold difference value may be preset in the image decoding apparatus, or may be determined based on information about the threshold difference value signaled by the image encoding apparatus.

도 8을 참조하면, 현재 임계값에 관한 제1 임계값 플래그를 복호화할 수 있다(S800).Referring to FIG. 8 , the first threshold value flag related to the current threshold value may be decoded ( S800 ).

상기 제1 임계값 플래그는, 부분 블록의 모든 계수의 절대값이 현재 임계값보다 작은지 여부를 나타낼 수 있다. 예를 들어, 상기 제1 임계값 플래그가 "거짓"인 경우, 이는 부분 블록의 모든 계수의 절대값이 현재 임계값보다 크거나 같을 수 있다. 반면, 상기 제1 임계값 플래그가 "참"인 경우, 이는 부분 블록의 모든 계수의 절대값이 현재 임계값보다 작을 수 있다.The first threshold value flag may indicate whether absolute values of all coefficients of a partial block are smaller than a current threshold value. For example, when the first threshold value flag is “false”, it may be that absolute values of all coefficients of the partial block are greater than or equal to the current threshold value. On the other hand, when the first threshold value flag is “true”, it may be that the absolute values of all coefficients of the partial block are smaller than the current threshold value.

만일, 상기 제1 임계값 플래그가 "거짓"인 경우, 상기 현재 임계값(i번째 임계값)은 다음 임계값((i+1)번째 임계값)으로 업데이트되고(S810), 업데이트된 현재 임계값을 기반으로, 전술한 S800 단계를 수행할 수 있다.If the first threshold value flag is “false”, the current threshold value (i-th threshold value) is updated to the next threshold value ((i+1)-th threshold value) (S810), and the updated current threshold value Based on the value, the above-described step S800 may be performed.

상기 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 가산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, "참"인 제1 임계값 플래그가 복호화될 때까지 반복적으로 수행될 수도 있다. 또는, 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is one, the current threshold value may be updated by adding a predetermined constant to the current threshold value. The predetermined constant may be an integer greater than or equal to 1. In this case, the update may be repeatedly performed until the first threshold value flag that is “true” is decoded. Alternatively, when the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is one, the update process may be terminated.

도 8에 도시된 바와 같이, 상기 제1 임계값 플래그가 "참"인 경우, 제1 임계값 플래그에 대한 복호화는 더 이상 수행되지 않을 수 있다.As shown in FIG. 8 , when the first threshold value flag is “true”, decoding of the first threshold value flag may not be performed any more.

전술한 바와 같이, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 작음을 나타낼 수 있다. 반면, i번째 임계값에 대한 제1 임계값 플래그가 "거짓"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 크거나 같음을 나타낼 수 있다. 상기 "참"인 제1 임계값 플래그를 기반으로, 부분 블록에 속한 계수 값의 범위를 특정할 수 있다. 즉, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록에 속한 계수는 0 내지 (i번째 임계값-1) 범위에 속할 수 있다.As described above, when the first threshold value flag for the i-th threshold is “true”, this may indicate that the absolute values of all coefficients in the partial block are less than the i-th threshold. On the other hand, when the first threshold value flag for the i-th threshold value is “false”, this may indicate that the absolute values of all coefficients in the partial block are greater than or equal to the i-th threshold value. Based on the "true" first threshold value flag, a range of coefficient values belonging to a partial block may be specified. That is, when the first threshold value flag for the i-th threshold value is “true”, coefficients belonging to the partial block may be in the range of 0 to (i-th threshold value-1).

상기 복호화된 제1 임계값 플래그에 따라, 전술한 S600 내지 S650 단계 중 적어도 하나가 생략될 수 있다. According to the decoded first threshold value flag, at least one of the above-described steps S600 to S650 may be omitted.

예를 들어, 임계값의 범위가 {3, 5}인 경우, 임계값 "3"에 대한 제1 임계값 플래그 또는 임계값 "5"에 대한 제1 임계값 플래그 중 적어도 하나가 복호화될 수 있다. 상기 임계값 "3"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값은 0 내지 2 범위에 속할 수 있다. 이 경우, 전술한 S630 또는 S640 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화하거나, S600, S630 또는 S640 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화할 수도 있다. For example, when the range of the threshold value is {3, 5}, at least one of the first threshold value flag for the threshold value “3” or the first threshold value flag for the threshold value “5” may be decoded . When the first threshold value flag for the threshold value “3” is “true”, the absolute values of all coefficients in the partial block may be in the range of 0 to 2. In this case, the coefficients of the partial blocks are decoded by performing the remaining steps except for at least one of the aforementioned steps S630 and S640, or the coefficients of the partial blocks are decoded by performing the remaining steps except for at least one of the steps S600, S630, and S640. may be

상기 임계값 "3"에 대한 제1 임계값 플래그가 "거짓"인 경우, 상기 임계값 "5"에 대한 제1 임계값 플래그가 복호화될 수 있다. 상기 임계값 "5"에 대한 제1 임계값 플래그가 "거짓"인 경우, 부분 블록 내 계수의 절대값 중 적어도 하나는 5보다 크거나 같을 수 있다. 이 경우, 전술한 S600 내지 S650 단계를 동일하게 수행하여, 부분 블록의 계수를 복호화할 수도 있고, S600 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 복호화할 수도 있다. When the first threshold value flag for the threshold value “3” is “false”, the first threshold value flag for the threshold value “5” may be decoded. When the first threshold flag for the threshold value “5” is “false”, at least one of absolute values of coefficients in the partial block may be greater than or equal to 5. In this case, the coefficients of the partial blocks may be decoded by performing the same steps S600 to S650 as described above, or the remaining steps except for the step S600 may be performed to decode the coefficients of the partial blocks.

반면, 상기 임계값 "5"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값이 0 내지 4 범위에 속할 수 있다. 이 경우, 전술한 S600 내지 S650 단계를 동일하게 수행하여, 부분 블록의 계수를 복호화할 수도 있고, S600 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 복호화할 수도 있다.On the other hand, when the first threshold value flag for the threshold value “5” is “true”, absolute values of all coefficients in the partial block may be in the range of 0 to 4. In this case, the coefficients of the partial blocks may be decoded by performing the same steps S600 to S650 as described above, or the remaining steps except for the step S600 may be performed to decode the coefficients of the partial blocks.

한편, 현재 부분 블록의 제1 임계값 플래그는, 다른 부분 블록의 제1 임계값 플래그를 기반으로 유도될 수 있다. 이 경우, 제1 임계값 플래그 복호화 과정은 생략될 수 있으며, 이에 대해서는 도 9를 참조하여 살펴 보기로 한다.Meanwhile, the first threshold value flag of the current partial block may be derived based on the first threshold value flag of another partial block. In this case, the first threshold flag decoding process may be omitted, which will be described with reference to FIG. 9 .

도 9는 본 발명이 적용되는 일실시예로서, 현재 부분 블록에 관한 제1/제2 임계값 플래그를 유도하는 방법을 도시한 것이다.9 is a diagram illustrating a method of deriving a first/second threshold value flag for a current partial block according to an embodiment to which the present invention is applied.

본 실시예에서는, 변환 블록(900)은 8x8이고, 부분 블록이 4x4이며, 최초 넌-제로 계수를 포함한 블록은 920이며, 변환 블록의 부분 블록은 스캔 타입에 따라 940, 920, 930, 910의 순서로 부호화/복호화됨을 가정한다.In this embodiment, the transform block 900 is 8x8, the partial block is 4x4, the block including the first non-zero coefficient is 920, and the partial block of the transform block is 940, 920, 930, 910 according to the scan type. It is assumed that encoding/decoding is performed in order.

현재 부분 블록에서, 특정 임계값에 관한 제1 임계값 플래그는 이전 부분 블록의 제1 임계값 플래그를 기반으로 유도될 수 있다. 예를 들어, 이전 부분 블록에서 "거짓"인 제1 임계값 플래그를 기반으로, 현재 부분 블록의 제1 임계값 플래그를 "거짓"으로 유도할 수 있다. 여기서, 임계값의 범위로 {3, 5, 7}이 이용됨을 가정한다.In the current partial block, a first threshold value flag related to a specific threshold value may be derived based on the first threshold value flag of the previous partial block. For example, based on the first threshold value flag that is “false” in the previous partial block, the first threshold value flag of the current partial block may be derived as “false”. Here, it is assumed that {3, 5, 7} is used as the range of the threshold value.

구체적으로, 부호화/복호화 순서상 첫번째인 부분 블록 940은 최초 넌-제로 계수가 속한 부분 블록 920의 위치보다 부호화/복호화 순서가 앞서므로, 상기 제1 임계값 플래그가 부호화/복호화되지 않을 수 있다. 부호화/복호화 순서상 두번째인 부분 블록 920에서는 임계값 "3"에 관한 제1 임계값 플래그가 "참"이므로, 상기 임계값 "3"에 관한 제1 임계값 플래그만이 부호화/복호화될 수 있다. 부호화/복호화 순서상 세번째인 부분 블록 930에서는, 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이고, 임계값 "5"에 관한 제1 임계값 플래그가 "참"이므로, 상기 임계값 "3"과 "5"에 관한 제1 임계값 플래그가 각각 부호화/복호화될 수 있다. 부호화/복호화 순서상 마지막 부분 블록 910에서는, 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이고, 임계값 "5"에 관한 제1 임계값 플래그가 "거짓"이다. 이때, 이전 부분 블록 930에서 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이므로, 현재 부분 블록 910은 3 이상인 계수의 절대값이 적어도 하나가 존재할 것으로 예측하고, 임계값 "3"에 관한 제1 임계값 플래그를 "거짓"으로 유도할 수 있다.In detail, since the encoding/decoding order of the first partial block 940 in the encoding/decoding order precedes the position of the partial block 920 to which the first non-zero coefficient belongs, the first threshold value flag may not be encoded/decoded. In the second partial block 920 in the encoding/decoding order, since the first threshold value flag for the threshold value “3” is “true”, only the first threshold value flag for the threshold value “3” can be encoded/decoded. . In the third partial block 930 in the encoding/decoding order, since the first threshold value flag for the threshold value “3” is “false” and the first threshold value flag for the threshold value “5” is “true”, the threshold The first threshold value flags for values “3” and “5” may be encoded/decoded, respectively. In the last partial block 910 in the encoding/decoding order, the first threshold value flag for the threshold value “3” is “false”, and the first threshold value flag for the threshold value “5” is “false”. At this time, since the first threshold value flag for the threshold value “3” in the previous partial block 930 is “false”, the current partial block 910 predicts that at least one absolute value of a coefficient equal to or greater than 3 exists, and the threshold value “3” The first threshold flag for ? may be derived as “false”.

현재 부분 블록에서, 특정 임계값에 관한 제1 임계값 플래그는 이전 부분 블록의 제1 임계값 플래그를 기반으로 유도될 수 있다. 예를 들어, 이전 부분 블록에서 "거짓"인 제1 임계값 플래그를 기반으로, 현재 부분 블록의 제1 임계값 플래그를 "거짓"으로 유도할 수 있다.In the current partial block, a first threshold value flag related to a specific threshold value may be derived based on the first threshold value flag of the previous partial block. For example, based on the first threshold value flag that is “false” in the previous partial block, the first threshold value flag of the current partial block may be derived as “false”.

이하, 도 10 내지 도 15를 참조하여, 변환 블록의 부분 블록을 결정하는 방법에 대해서 자세히 살펴 보도록 한다.Hereinafter, a method of determining a partial block of a transform block will be described in detail with reference to FIGS. 10 to 15 .

영상 부호화 장치는, 변환 블록을 구성하는, 소정의 크기/형태를 가진 부분 블록을 결정하고, 부분 블록의 크기/형태에 관한 정보를 부호화할 수 있다. 영상 복호화 장치는, 상기 부호화된 정보를 기반으로, 부분 블록의 크기/형태를 결정할 수 있다(제1 방법). 또는, 영상 부호화/복호화 장치에 기-약속된 규칙을 통해, 부분 블록의 크기/형태를 결정할 수도 있다(제2 방법). 상기 제1 방법과 제2 방법 중 어떤 방법을 통해 부분 블록의 크기/형태를 결정하는지를 알려주는 정보가 비디오, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나의 계층에서 시그날링될 수 있다. 상기 블록은 코딩 블록, 예측 블록 또는 변환 블록을 의미할 수 있다.The image encoding apparatus may determine a partial block having a predetermined size/shape constituting the transform block, and may encode information about the size/shape of the partial block. The image decoding apparatus may determine the size/shape of the partial block based on the encoded information (first method). Alternatively, the size/shape of a partial block may be determined through a rule pre-promised to the image encoding/decoding apparatus (second method). Information indicating which method of the first method and the second method determines the size/shape of a partial block may be signaled in at least one layer of a video, a sequence, a picture, a slice, or a block. The block may mean a coding block, a prediction block, or a transform block.

변환 블록 내 부분 블록의 크기는 변환 블록의 크기와 같거나 작을 수 있다. 변환 블록/부분 블록의 형태는 정방형 또는 비정방형일 수 있다. 변환 블록의 형태는 부분 블록의 형태와 동일하거나 상이할 수 있다. The size of the partial block in the transform block may be equal to or smaller than the size of the transform block. The shape of the transform block/partial block may be square or non-square. The shape of the transform block may be the same as or different from that of the partial block.

변환 블록의 형태에 관한 정보가 부호화될 수 있다. 이때, 상기 정보는, 변환 블록의 형태로 정방형만을 사용할 것인지, 비정방형만을 사용할 것인지, 또는 정방형과 비정방형 모두 사용할 것인지에 대한 정보 중 적어도 하나를 포함할 수 있다. 상기 정보는, 비디오, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나의 계층에서 시그날링될 수 있다. 상기 블록은 코딩 블록, 예측 블록 또는 변환 블록을 의미할 수 있다. 변환 블록의 크기에 관한 정보가 부호화될 수 있다. 이때, 상기 정보는, 최소 크기, 최대 크기, 분할 깊이(depth) 또는 분할 깊이에 관한 최대/최소값 중 적어도 하나를 포함할 수 있다. 상기 정보는, 비디오, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나의 계층에서 시그날링될 수 있다.Information about the shape of the transform block may be encoded. In this case, the information may include at least one of information on whether to use only a square, a non-square, or both a square and a non-square in the form of a transform block. The information may be signaled in at least one layer of a video, a sequence, a picture, a slice, or a block. The block may mean a coding block, a prediction block, or a transform block. Information about the size of the transform block may be encoded. In this case, the information may include at least one of a minimum size, a maximum size, a division depth, and a maximum/minimum value regarding the division depth. The information may be signaled in at least one layer of a video, a sequence, a picture, a slice, or a block.

부분 블록의 형태에 관한 정보가 부호화될 수 있다. 이때, 상기 정보는, 부분 블록의 형태로 정방형만을 사용할 것인지, 비정방형만을 사용할 것인지, 또는 정방형과 비정방형 모두 사용할 것인지에 대한 정보 중 적어도 하나를 포함할 수 있다. 상기 정보는, 비디오, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나의 계층에서 시그날링될 수 있다. 상기 블록은 코딩 블록, 예측 블록 또는 변환 블록을 의미할 수 있다. 부분 블록의 크기에 관한 정보가 부호화될 수 있다. 이때, 상기 정보는, 최소 크기, 최대 크기, 분할 깊이(depth) 또는 분할 깊이에 관한 최대/최소값 중 적어도 하나를 포함할 수 있다. 상기 정보는, 비디오, 시퀀스, 픽쳐, 슬라이스, 또는 블록 중 적어도 하나의 계층에서 시그날링될 수 있다.Information about the shape of the partial block may be encoded. In this case, the information may include at least one of information on whether to use only a square, a non-square, or both a square and a non-square in the form of a partial block. The information may be signaled in at least one layer of a video, a sequence, a picture, a slice, or a block. The block may mean a coding block, a prediction block, or a transform block. Information about the size of a partial block may be encoded. In this case, the information may include at least one of a minimum size, a maximum size, a division depth, and a maximum/minimum value regarding the division depth. The information may be signaled in at least one layer of a video, a sequence, a picture, a slice, or a block.

도 10은 본 발명이 적용되는 일실시예로서, 병합 플래그를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.10 illustrates a method of determining the size/shape of a partial block based on a merge flag as an embodiment to which the present invention is applied.

영상 부호화 장치는, 최소 크기의 부분 블록일 때부터 최대 크기의 부분 블록일 때까지, RDO를 통해서 부분 블록이 어떤 병합 형태일 때가 가장 최적인지를 확인할 수 있다.From a partial block of the minimum size to a partial block of the maximum size, the image encoding apparatus may determine which type of merge is the most optimal through RDO.

도 10를 참조하면, 복수의 부분 블록(1-16)으로 구성된 변환 블록(1001)에 대한 RD-비용값을 계산할 수 있다. 상기 부분 블록은 영상 부호화 장치에 기-약속된 최소 크기의 부분 블록일 수 있다. 변환 블록(1002)은, 변환 블록(1001)의 4개의 부분 블록(13-16)이 하나의 부분 블록으로 병합된 경우이며, 상기 변환 블록(1002)에 대한 RD-비용값을 계산할 수 있다. 변환 블록(1003)은, 상기 변환 블록(1001)의 4개의 부분 블록(9-12)이 하나의 부분 블록으로 병합된 경우이며, 상기 변환 블록(1003)에 대한 RD-비용값을 계산할 수 있다. 변환 블록(1004)은, 상기 변환 블록(1001)의 4개의 부분 블록(5-8)이 하나의 부분 블록으로 병합된 경우이며, 상기 변환 블록(1004)에 대한 RD-비용값을 계산할 수 있다.Referring to FIG. 10 , an RD-cost value for the transformation block 1001 including the plurality of partial blocks 1-16 may be calculated. The partial block may be a partial block having a pre-promised minimum size to the image encoding apparatus. The transform block 1002 is a case in which four partial blocks 13 - 16 of the transform block 1001 are merged into one partial block, and an RD-cost value for the transform block 1002 can be calculated. The transformation block 1003 is a case in which four partial blocks 9-12 of the transformation block 1001 are merged into one partial block, and an RD-cost value for the transformation block 1003 can be calculated. . The transform block 1004 is a case in which four partial blocks 5-8 of the transform block 1001 are merged into one partial block, and an RD-cost value for the transform block 1004 can be calculated. .

영상 부호화 장치는, 쿼드 트리 방식으로, 변환 블록 내 부분 블록을 최대 크기의 부분 블록까지 병합해가면서 RD-비용값을 계산할 수 있다. 상기 RD-비용값을 기반으로 최적의 병합을 결정하고, 최적의 병합을 나타내는 병합 플래그를 부호화할 수 있다. 영상 복호화 장치는, 부호화된 병합 플래그를 기반으로, 변환 블록 내 부분 블록의 크기/형태를 결정할 수 있다. The image encoding apparatus may calculate the RD-cost value while merging the partial blocks in the transform block up to the partial blocks of the maximum size using a quad tree method. An optimal merging may be determined based on the RD-cost value, and a merging flag indicating the optimal merging may be encoded. The image decoding apparatus may determine the size/shape of a partial block in the transform block based on the encoded merge flag.

예를 들어, 변환 블록(1004)이 상기 최적의 병합이며, 부분 블록의 최소 크기가 변환 블록(1004)의 부분 블록 "1"의 크기와 동일하고, 부분 블록의 최대 크기가 상기 변환 블록(1004)의 부분 블록 "5"와 동일한 것으로 가정한다. 이 경우, 영상 부호화 장치는, 변환 블록(1001)이 최적의 병합이 아님을 나타내는 병합 플래그("거짓")를 부호화할 수 있다. 그리고, 변환 블록(1004)의 4개의 부분 블록(10-13)이 병합되지 않은 상태가 최적임을 나타내는 병합 플래그("거짓")를 부호화하고, 변환 블록(1004)의 4개의 부분 블록(6-9)이 병합되지 않은 상태가 최적임을 나타내는 병합 플래그("거짓")를 부호화할 수 있다. 그리고, 변환 블록(1001)에서의 4개의 부분 블록(6-9)이 하나의 부분 블록으로 병합된 상태가 최적임을 나타내는 병합 플래그("참")을 부호화하고, 변환 블록(1004)의 4개의 부분 블록(1-4)이 병합되지 않은 상태가 최적임을 나타내는 병합 플래그("거짓")를 부호화할 수 있다. 즉, 영상 부호화 장치는 상기 부호화를 통해 비트스트림 "00010"을 생성할 수 있고, 영상 복호화 장치는 상기 비트스트림을 복호화하여 변환 블록(1004)의 병합 형태를 결정할 수 있다.For example, the transform block 1004 is the optimal merging, the minimum size of the partial block is equal to the size of the partial block "1" of the transform block 1004, and the maximum size of the partial block is the transform block 1004 ) is assumed to be the same as the partial block "5". In this case, the image encoding apparatus may encode a merge flag (“false”) indicating that the transform block 1001 is not an optimal merge. Then, the four partial blocks 10-13 of the transform block 1004 encode a merge flag (“false”) indicating that the unmerged state is optimal, and the four partial blocks 6 - 6 of the transform block 1004 are encoded. 9) may encode a merge flag (“false”) indicating that the unmerged state is optimal. Then, a merge flag (“True”) indicating that the state in which the four partial blocks 6-9 in the transform block 1001 are merged into one partial block is optimal is encoded, and the four partial blocks 6-9 of the transform block 1004 are encoded. A merge flag (“false”) indicating that the partial blocks 1 - 4 are not merged is optimal. That is, the image encoding apparatus may generate the bitstream "00010" through the encoding, and the image decoding apparatus may decode the bitstream to determine the merge type of the transform block 1004 .

도 10은 부분 블록의 병합 순서를 한정한 것은 아니며, 다른 순서로 병합하는 것도 가능하다. 전술한 병합은, 영상 부호화/복호화 장치에 기-약속된 블록 크기/형태의 범위 내에서 수행될 수 있다. 상기 병합된 부분 블록의 형태는, 정방형 또는 비정방형일 수 있다. 상기 병합된 부분 블록의 형태는, 부분 블록의 부호화 순서 또는 스캔 순서에 기초하여 결정될 수 있다.10 does not limit the merging order of partial blocks, and merging in another order is also possible. The above-described merging may be performed within a range of a block size/shape pre-promised to the image encoding/decoding apparatus. The shape of the merged partial block may be a square or a non-square shape. The shape of the merged partial block may be determined based on an encoding order or a scanning order of the partial blocks.

예를 들어, 변환 블록 내 부분 블록의 부호화 순서가 대각 방향일 경우, 정방형의 병합이 이용될 수 있다. 또는, 변환 블록 내 부분 블록의 부호화 순서가 세로 방향인 경우, 세로가 긴 비정방형의 병합이 이용될 수 있다. 또는, 변환 블록 내 부분 블록의 부호화 순서가 가로 방향인 경우, 가로가 긴 비정방형의 병합이 이용될 수 있다.For example, when the encoding order of the partial blocks in the transform block is in the diagonal direction, square merging may be used. Alternatively, when the encoding order of partial blocks in the transform block is in the vertical direction, vertical non-square merging may be used. Alternatively, when the encoding order of the partial blocks in the transform block is in the horizontal direction, a long horizontal non-square merge may be used.

도 11은 본 발명이 적용되는 일실시예로서, 분할 플래그를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.11 illustrates a method of determining the size/shape of a partial block based on a division flag as an embodiment to which the present invention is applied.

영상 부호화 장치는, 최대 크기의 부분 블록일 때부터 최소 크기의 부분 블록일 때까지, RDO를 통해서 변환 블록이 어떤 분할 형태일 때가 가장 최적인지를 확인할 수 있다.The apparatus for encoding an image may determine what type of split the transform block is most optimal through RDO from a partial block of the maximum size to a partial block of the minimum size.

도 11을 참조하면, 하나의 부분 블록(1)으로 구성된 변환 블록(1101)에 대한 RD-비용값을 계산할 수 있다. 상기 부분 블록(1)은 영상 부호화 장치에 기-약속된 최대 크기의 부분 블록일 수 있다. 변환 블록(1002)은, 최대 크기의 부분 블록이 4개의 부분 블록(1-4)로 분할된 경우이며, 상기 변환 블록(1002)에 대한 RD-비용값을 계산할 수 있다. 변환 블록(1103)은, 상기 변환 블록(1102)의 부분 블록 "1"이 4개의 부분 블록(1-4)으로 분할된 경우이며, 상기 변환 블록(1103)에 대한 RD-비용값을 계산할 수 있다. 변환 블록(1104)은, 상기 변환 블록(1103)의 부분 블록 "1"이 다시 4개의 부분 블록(1-4)으로 분할된 경우이며, 상기 변환 블록(1104)에 대한 RD-비용값을 계산할 수 있다.Referring to FIG. 11 , an RD-cost value for the transform block 1101 including one partial block 1 may be calculated. The partial block 1 may be a partial block of a maximum size pre-promised to the image encoding apparatus. The transform block 1002 is a case in which a partial block of the maximum size is divided into four partial blocks 1-4, and an RD-cost value for the transform block 1002 may be calculated. The transformation block 1103 is a case in which the partial block “1” of the transformation block 1102 is divided into four partial blocks 1-4, and an RD-cost value for the transformation block 1103 can be calculated. there is. The transformation block 1104 is a case where the partial block “1” of the transformation block 1103 is again divided into four partial blocks 1-4, and the RD-cost value for the transformation block 1104 is calculated. can

영상 부호화 장치는, 쿼드 트리 방식으로, 변환 블록 내 부분 블록을 최소 크기의 부분 블록까지 분할해가면서 RD-비용값을 계산할 수 있다. 상기 RD-비용값을 기반으로 최적의 분할을 결정하고, 최적의 분할을 나타내는 분할 플래그를 부호화할 수 있다. 영상 복호화 장치는, 부호화된 분할 플래그를 기반으로, 변환 블록 내 부분 블록의 크기/형태를 결정할 수 있다.The image encoding apparatus may calculate the RD-cost value while dividing the partial blocks in the transform block up to the partial blocks of the minimum size using a quad tree method. An optimal partition may be determined based on the RD-cost value, and a partition flag indicating the optimal partition may be encoded. The image decoding apparatus may determine the size/shape of a partial block in the transform block based on the coded split flag.

예를 들어, 변환 블록(1103)이 최적의 분할이며, 부분 블록의 최소 크기가 변환 블록(1103)의 부분 블록 "1"의 크기와 동일하고, 부분 블록의 최대 크기가 상기 변환 블록(1103)과 동일한 것으로 가정한다. 이 경우, 영상 부호화 장치는, 변환 블록(1101)이 최적의 분할이 아님을 나타내는 분할 플래그("참")를 부호화할 수 있다. 그리고, 변환 블록(1102)에서, 부분 블록 '1'이 4개의 부분 블록으로 분할하는 것이 최적임을 나타내는 분할 플래그("참")을 부호화할 수 있다. 상기 변환 블록(1102)에서, 나머지 부분 블록(2-4)이 4개의 부분 블록으로 분할되지 않는 것이 최적임을 나타내는 분할 플래그("거짓")을 부호화할 수 있다. 즉, 영상 부호화 장치는 상기 부호화를 통해 비트스트림은 "11000"을 생성할 수 있고, 영상 복호화 장치는 상기 비트스트림을 복호화하여 변환 블록(1103)의 분할 형태를 결정할 수 있다.For example, the transform block 1103 is an optimal partition, the minimum size of the partial block is equal to the size of the partial block "1" of the transform block 1103, and the maximum size of the partial block is the transform block 1103 is assumed to be the same as In this case, the image encoding apparatus may encode a split flag (“true”) indicating that the transform block 1101 is not optimal split. Then, in the transform block 1102 , a split flag (“true”) indicating that the partial block '1' is optimal to be divided into 4 partial blocks may be encoded. In the transform block 1102, a split flag (“false”) indicating that it is optimal not to split the remaining subblocks 2-4 into 4 subblocks may be encoded. That is, the image encoding apparatus may generate "11000" of the bitstream through the encoding, and the image decoding apparatus may decode the bitstream to determine the division type of the transform block 1103 .

도 11은 부분 블록의 분할 순서를 한정한 것은 아니며, 다른 순서로 분할하는 것도 가능하다. 전술한 분할은, 영상 부호화/복호화 장치에 기-약속된 블록 크기/형태의 범위 내에서 수행될 수 있다. 상기 분할된 부분 블록의 형태는, 정방형 또는 비정방형일 수 있다. 상기 분할된 부분 블록의 형태는, 부분 블록의 부호화 순서 또는 스캔 순서에 기초하여 결정될 수 있다.11 does not limit the division order of the partial blocks, and it is possible to divide the partial blocks in another order. The above-described division may be performed within a range of a block size/shape pre-promised to the image encoding/decoding apparatus. The shape of the divided partial blocks may be a square or a non-square shape. The shape of the divided partial block may be determined based on an encoding order or a scan order of the partial block.

예를 들어, 변환 블록 내 부분 블록의 부호화 순서가 대각 방향일 경우, 정방형의 분할이 이용될 수 있다. 또는, 변환 블록 내 부분 블록의 부호화 순서가 세로 방향인 경우, 세로가 긴 비정방형의 분할이 이용될 수 있다. 또는, 변환 블록 내 부분 블록의 부호화 순서가 가로 방향인 경우, 가로가 긴 비정방형의 분할이 이용될 수 있다.For example, when the encoding order of the partial blocks in the transform block is in the diagonal direction, square division may be used. Alternatively, when the encoding order of the partial blocks in the transform block is in the vertical direction, vertical non-square division may be used. Alternatively, when the encoding order of the partial blocks in the transform block is in the horizontal direction, a horizontally long non-square division may be used.

도 12는 본 발명이 적용되는 일실시예로서, 분할 색인 정보를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.12 illustrates a method for determining the size/shape of a partial block based on partition index information as an embodiment to which the present invention is applied.

영상 부호화 장치는, 변환 블록의 부분 블록이 모두 최대 크기의 부분 블록일 때부터 모두 최소 크기의 부분 블록일 때까지, RDO를 통해서 부분 블록이 어떤 분할 형태일 때가 가장 최적인지를 확인할 수 있다.The apparatus for encoding an image may determine the most optimal splitting form of the partial blocks through RDO from when all partial blocks of the transform block are partial blocks of the maximum size to all partial blocks of the minimum size.

도 12를 참조하면, 변환 블록(1201)은 하나의 부분 블록(1)으로 구성된 경우이며, 이 경우의 RD-비용값을 계산할 수 있다. 상기 부분 블록(1)은 영상 부호화 장치에 기-약속된 최대 크기의 부분 블록일 수 있다. 변환 블록(1202)는 상기 변환 블록(1201)이 4개의 부분 블록(1-4)으로 분할된 경우이며, 이 경우의 RD-비용값을 계산할 수 있다. 변환 블록(1203)은, 상기 변환 블록(1202)의 각 부분 블록이 다시 4개의 부분 블록으로 분할된 경우이며, 이 경우의 RD-비용값을 계산할 수 있다.Referring to FIG. 12 , the transformation block 1201 is configured with one partial block 1, and in this case, the RD-cost value can be calculated. The partial block 1 may be a partial block of a maximum size pre-promised to the image encoding apparatus. The transform block 1202 is a case in which the transform block 1201 is divided into four partial blocks 1-4, and in this case, an RD-cost value can be calculated. The transform block 1203 is a case in which each partial block of the transform block 1202 is again divided into four partial blocks, and in this case, the RD-cost value can be calculated.

전술한 바와 같이, 최대 크기 내지 최소 크기의 부분 블록 범위 내에서, 변환 블록을 동일한 크기의 부분 블록으로 분할해가면서 RD-비용값을 계산할 수 있다. 상기 RD-비용값을 기반으로 최적의 분할을 결정하고, 최적의 분할을 나타내는 분할 색인 정보를 부호화할 수 있다. 영상 복호화 장치는, 상기 부호화된 분할 색인 정보를 기반으로, 변환 블록 내 부분 블록의 크기/형태를 결정할 수 있다.As described above, the RD-cost value may be calculated while dividing the transform block into partial blocks of the same size within the range of the partial blocks of the maximum size and the minimum size. An optimal partition may be determined based on the RD-cost value, and partition index information indicating the optimal partition may be encoded. The image decoding apparatus may determine the size/shape of a partial block in the transform block based on the encoded segmentation index information.

예를 들어, 영상 부호화 장치는, 변환 블록(1201)이 최적인 분할인 경우에는 분할 색인 정보로 "0"을, 변환 블록(1202)이 최적의 분할인 경우에는 분할 색인 정보로 "1"을, 변환 블록(1203)이 최적의 분할인 경우에는 분할 색인 정보로 "2"를 각각 부호화할 수 있다. 영상 복호화 장치는, 상기 부호화된 분할 색인 정보를 기반으로 변환 블록 내 부분 블록의 크기/형태를 결정할 수 있다.For example, the image encoding apparatus sets “0” as the split index information when the transform block 1201 is the optimal split, and “1” as the split index information when the transform block 1202 is the optimal split. , when the transform block 1203 is an optimal partition, "2" may be encoded as partition index information, respectively. The image decoding apparatus may determine the size/shape of a partial block in the transform block based on the encoded segmentation index information.

도 13은 본 발명이 적용되는 일실시예로서, 넌-제로 계수의 위치를 기반으로 변환 블록을 분할하는 방법을 도시한 것이다.13 is a diagram illustrating a method of dividing a transform block based on a position of a non-zero coefficient according to an embodiment to which the present invention is applied.

변환 블록에서, 부호화/복호화 순서상 최초 넌-제로 계수의 위치를 기반으로, 부분 블록의 크기/형태가 결정될 수 있다. In the transform block, the size/shape of the partial block may be determined based on the position of the first non-zero coefficient in the encoding/decoding order.

부분 블록의 크기/형태는, 상기 최초 넌-제로 계수의 위치를 포함한 블록(이하, 제1 기준 블록이라 함)의 크기/형태로 결정될 수 있다. 상기 제1 기준 블록은, 상기 최초 넌-제로 계수의 위치와 상기 변환 블록의 우하단 계수의 위치를 포함한 블록 중 최소 크기일 수 있다. 이때, 상기 제1 기준 블록은, 영상 부호화/복호화 장치에 기-약속된 부분 블록의 최소 크기와 최대 크기의 범위에 속할 수 있다. 상기 변환 블록은 상기 결정된 부분 블록의 크기/형태로 분할될 수 있다.The size/shape of the partial block may be determined by the size/shape of the block including the location of the first non-zero coefficient (hereinafter, referred to as a first reference block). The first reference block may have a minimum size among blocks including the position of the first non-zero coefficient and the position of the lower-right coefficient of the transform block. In this case, the first reference block may belong to a range of a minimum size and a maximum size of a partial block pre-promised to the image encoding/decoding apparatus. The transform block may be divided according to the determined size/shape of the partial block.

예를 들어, 변환 블록(1301)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (12,12)인 경우, 해당 계수 (12,12)를 포함하는 부분 블록의 크기를 4x4로 결정할 수 있고, 도 13에 도시된 바와 같이 변환 블록(1301)은 4x4 크기의 16개 부분 블록으로 분할될 수 있다. 또는, 변환 블록(1302)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (8,8)인 경우, 해당 계수 (8,8)을 포함하는 부분 블록의 크기를 8x8로 결정할 수 있고, 도 13에 도시된 바와 같이 변환 블록(1302)은 8x8 크기의 4개 부분 블록으로 분할될 수 있다. 또는, 변환 블록(1303)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (8,0)인 경우, 해당 계수 (8,0)를 포함하는 부분 블록의 크기를 8x16로 결정할 수 있고, 이 경우 변환 블록(1303)은 8x16 크기의 2개 부분 블록으로 분할될 수 있다.For example, if the transform block 1301 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (12,12) based on (0,0) at the upper left of the transform block, the coefficient (12) , 12) may be determined to have a size of 4x4, and as shown in FIG. 13 , the transform block 1301 may be divided into 16 partial blocks having a size of 4x4. Alternatively, if the transform block 1302 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (8,8) with respect to the upper left end (0,0) of the transform block, the corresponding coefficient (8,8) ) may be determined to be 8x8, and the transform block 1302 may be divided into 4 subblocks having a size of 8x8 as shown in FIG. 13 . Alternatively, if the transform block 1303 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (8,0) with respect to the upper left end (0,0) of the transform block, the coefficient (8,0) ) may be determined to be 8×16, and in this case, the transform block 1303 may be divided into two partial blocks having a size of 8×16.

또는, 상기 부분 블록의 크기/형태는, 상기 최초 넌-제로 계수의 위치를 포함하지 않는 블록(이하, 제2 기준 블록)의 크기/형태로 결정될 수 있다. 상기 제2 기준 블록은, 상기 최초 넌-제로 계수의 위치를 포함하지 않고, 상기 변환 블록의 우하단 계수의 위치를 포함한 블록 중 최대 크기일 수 있다. 이때, 상기 제2 기준 블록은, 영상 부호화/복호화 장치에 기-약속된 부분 블록의 최소 크기와 최대 크기의 범위에 속할 수 있다. 상기 변환 블록은 상기 결정된 부분 블록의 크기/형태로 분할될 수 있다.Alternatively, the size/shape of the partial block may be determined as the size/shape of a block that does not include the location of the first non-zero coefficient (hereinafter, a second reference block). The second reference block may have a maximum size among blocks that do not include the position of the first non-zero coefficient and include the position of the lower-right coefficient of the transform block. In this case, the second reference block may belong to a range of a minimum size and a maximum size of a partial block pre-promised to the image encoding/decoding apparatus. The transform block may be divided according to the determined size/shape of the partial block.

예를 들어, 변환 블록(1301)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (12,11)인 경우, 해당 계수 (12,11)를 포함하지 않는 부분 블록의 크기를 4x4로 결정할 수 있고, 이 경우 변환 블록(1301)은 4x4 크기의 16개 부분 블록으로 분할될 수 있다. 또는, 변환 블록(1302)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (7,13)인 경우, 해당 계수 (7,13)을 포함하지 않는 부분 블록의 크기를 8x8로 결정할 수 있고, 이 경우 변환 블록(1302)은 8x8 크기의 4개 부분 블록으로 분할될 수 있다. 또는, 변환 블록(1303)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (6,14)인 경우, 해당 계수 (6,14)를 포함하는 부분 블록의 크기를 8x16으로 결정할 수 있고, 이 경우 변환 블록(1303)은 8x16 크기의 2개 부분 블록으로 분할될 수 있다.For example, if the transform block 1301 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (12,11) with respect to the upper-left (0,0) of the transform block, the corresponding coefficient (12) , 11) may be determined to have a size of 4x4, and in this case, the transform block 1301 may be divided into 16 partial blocks having a size of 4x4. Alternatively, if the transform block 1302 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (7,13) with respect to the upper left end (0,0) of the transform block, the corresponding coefficient (7,13) ) may be determined to be 8x8, and in this case, the transform block 1302 may be divided into 4 partial blocks having a size of 8x8. Alternatively, if the transform block 1303 is 16x16, and the position of the first non-zero coefficient in the encoding/decoding order is (6,14) with respect to the upper left end (0,0) of the transform block, the corresponding coefficient (6,14) ) may be determined to be 8×16, and in this case, the transform block 1303 may be divided into two partial blocks having a size of 8×16.

도 14는 본 발명이 적용되는 일실시예로서, 변환 블록의 일부 영역을 선택적으로 분할하는 방법을 도시한 것이다.14 illustrates a method of selectively dividing a partial region of a transform block according to an embodiment to which the present invention is applied.

변환 블록 내에서 일부 영역을 제외한 나머지 영역을 소정의 크기/형태를 가진 부분 블록으로 분할할 수도 있다. 여기서, 일부 영역은 상기 최초 넌-제로 계수의 위치 (a,b)를 기반으로 특정될 수 있다. 예를 들어, 상기 일부 영역은, 상기 a보다 큰 x-좌표를 가진 영역 또는 상기 b보다 큰 y-좌표를 가진 영역 중 적어도 하나를 포함할 수 있다. 여기서, 부분 블록의 크기/형태는 전술한 적어도 하나의 실시예와 동일/유사한 방식으로 결정될 수 있는바, 자세한 설명은 생략하기로 한다.A region other than a partial region in the transform block may be divided into partial blocks having a predetermined size/shape. Here, the partial region may be specified based on the position (a, b) of the first non-zero coefficient. For example, the partial region may include at least one of a region having an x-coordinate greater than a and a region having a y-coordinate greater than b. Here, the size/shape of the partial block may be determined in the same/similar manner to the at least one embodiment described above, and thus a detailed description thereof will be omitted.

예를 들어, 변환 블록(1401)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (11,11)인 경우, (11,11)의 x-좌표보다 우측에 있는 영역 및 (11,11)의 y-좌표보다 하단에 있는 영역은 부분 블록 설정 범위에서 제외하고, 부호화/복호화하지 않을 수 있다. 이때, 상기 변환 블록(1401)의 나머지 영역은 6x6 크기의 4개 부분 블록으로 분할될 수 있다.For example, when the transform block 1401 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (11,11) with respect to the upper left end (0,0) of the transform block, (11,11) ) and a region below the y-coordinate of (11,11) are excluded from the partial block setting range and may not be encoded/decoded. In this case, the remaining region of the transform block 1401 may be divided into 4 partial blocks having a size of 6x6.

또는, 변환 블록 내에서 일부 영역을 제외한 나머지 영역을 소정의 크기/형태를 가진 부분 블록으로 분할할 수도 있다. 여기서, 일부 영역은 상기 최초 넌-제로 계수의 위치 (a,b)와 변환 블록의 최대 좌표값 (c,d)를 기반으로 특정될 수 있다. 상기 최대 좌표값 (c,d)는 변환 블록의 우하단 계수의 위치일 수 있다. 예를 들어, 최초 넌-제로 계수의 위치 (a,b)와 변환 블록의 최대 좌표값 (c,d) 간의 차이값인 "(c-a)"와 "(d-b)"를 각각 산출할 수 있다. 변환 블록의 우하단 계수의 위치를 기준으로, 상기 차이값 중 최소값만큼 쉬프트한 위치 (e,f)를 결정할 수 있다. 이때, 상기 일부 영역은, 상기 e보다 큰 x-좌표를 가진 영역 또는 상기 f보다 큰 y-좌표를 가진 영역 중 적어도 하나를 포함할 수 있다. 여기서, 부분 블록의 크기/형태는 전술한 적어도 하나의 실시예와 동일/유사한 방식으로 결정될 수 있는바, 자세한 설명은 생략하기로 한다.Alternatively, the remaining region except for a partial region in the transform block may be divided into partial blocks having a predetermined size/shape. Here, the partial region may be specified based on the position (a,b) of the first non-zero coefficient and the maximum coordinate value (c,d) of the transform block. The maximum coordinate value (c, d) may be the position of the lower right coefficient of the transform block. For example, "(c-a)" and "(d-b)", which are differences between the position (a,b) of the first non-zero coefficient and the maximum coordinate value (c,d) of the transform block, may be calculated, respectively. Based on the position of the lower-right coefficient of the transform block, the position (e,f) shifted by the minimum value among the difference values may be determined. In this case, the partial region may include at least one of a region having an x-coordinate greater than e and a region having a y-coordinate greater than f. Here, the size/shape of the partial block may be determined in the same/similar manner to the at least one embodiment described above, and thus a detailed description thereof will be omitted.

예를 들어, 변환 블록(1401)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (11,8)인 경우, 해당 계수의 x-좌표 "11"과 변환 블록의 최대 x-좌표 "15" 간의 차이값인 "4", 그리고 해당 계수의 y-좌표 "8"과 변환 블록의 최대 y-좌표 "15" 간의 차이값인 "7"을 산출할 수 있다. 변환 블록의 우하단 계수의 위치를 기준으로, 상기 차이값 중 최소값인 "4"만큼 쉬프트한 위치는 (11,11)로 결정될 수 있다. 이 경우, (11,11)의 x-좌표보다 우측에 있는 영역 및 (11,11)의 y-좌표보다 하단에 있는 영역은 부분 블록 설정 범위에서 제외하고, 부호화/복호화하지 않을 수 있다. 이때, 상기 변환 블록(1401)의 나머지 영역은 6x6 크기의 4개 부분 블록으로 분할될 수 있다.For example, if the transform block 1401 is 16x16 and the position of the first non-zero coefficient in the encoding/decoding order is (11,8) with respect to the upper left end (0,0) of the transform block, the x of the corresponding coefficient - "4", which is the difference value between the coordinate "11" and the maximum x-coordinate "15" of the transform block, and " 7" can be obtained. Based on the position of the lower right coefficient of the transform block, a position shifted by "4", which is the minimum value among the difference values, may be determined as (11, 11). In this case, the region to the right of the x-coordinate of (11,11) and the region below the y-coordinate of (11,11) are excluded from the partial block setting range, and encoding/decoding may not be performed. In this case, the remaining region of the transform block 1401 may be divided into 4 partial blocks having a size of 6x6.

또는, 변환 블록은 소정의 경계선을 기준으로 복수의 영역으로 구획될 수 있다. 상기 경계선은 1개, 2개 또는 그 이상일 수 있다. 상기 경계선은 소정의 각도의 기울기를 가지며, 상기 각도는 0도 내지 90도 범위 내에 속할 수 있다. 상기 경계선은, 변환 블록 내 계수의 부호화/복호화 순서상 최초 넌-제로 계수의 위치를 포함할 수 있다. 구체적으로, 상기 경계선을 기준으로, 상기 변환 블록은 제1 영역과 제2 영역으로 구획될 수 있다. 이때, 제1 영역은 소정의 크기/형태를 가진 부분 블록으로 분할되고, 제2 영역은 소정의 크기/형태를 가진 부분 블록으로 분할되지 않을 수 있다. 즉, 상기 제1 영역에 속한 계수는, 소정의 크기/형태를 가진 부분 블록을 기반으로 부호화/복호화되고, 상기 제2 영역에 속한 계수에 대한 부호화/복호화는 스킵될 수 있다. 상기 제1 영역은, 상기 경계선을 기준으로 상단, 좌측, 또는 좌상단에 위치한 영역을 의미할 수 있다. 이때, 상기 제1 영역은 상기 경계선을 포함하는 부분 블록의 영역을 더 포함할 수도 있다. 상기 제2 영역은 상기 경계선을 기준으로 하단, 우측, 또는 우하단에 위치한 영역을 의미할 수 있다.Alternatively, the transform block may be divided into a plurality of regions based on a predetermined boundary line. The boundary line may be one, two or more. The boundary line has a slope of a predetermined angle, and the angle may be within a range of 0 degrees to 90 degrees. The boundary line may include the position of the first non-zero coefficient in the encoding/decoding order of the coefficients in the transform block. Specifically, based on the boundary line, the transformation block may be divided into a first region and a second region. In this case, the first area may be divided into partial blocks having a predetermined size/shape, and the second area may not be divided into partial blocks having a predetermined size/shape. That is, the coefficients belonging to the first region may be encoded/decoded based on partial blocks having a predetermined size/shape, and encoding/decoding of the coefficients belonging to the second region may be skipped. The first area may refer to an area located at the upper end, the left side, or the upper left end with respect to the boundary line. In this case, the first area may further include an area of the partial block including the boundary line. The second area may refer to an area located at the lower end, the right side, or the lower right end with respect to the boundary line.

예를 들어, 변환 블록(1402)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (10,6)이며, 변환 블록(1402)의 모든 부분 블록이 4x4 단위로 기 분할된 경우를 가정한다. 이 경우, (10,6)을 기준으로 우상단 45도 방향의 마지막 화소 위치는 (15,1)이고, 좌하단 45도 방향의 마지막 화소 위치는 (1,15)이다. 상기 2개의 화소 위치를 이은 경계선을 기준으로, 좌상단에 위치한 영역의 부분 블록(1-10)은 부호화/복호화되는 부분 블록으로 결정되고, 우하단에 위치한 영역의 부분 블록은 부호화/복호화되지 않는 부분 블록으로 결정될 수 있다. 이때, 좌상단에 위치한 영역의 부분 블록의 형태는 사각형 및/또는 삼각형으로 결정될 수도 있다.For example, the transform block 1402 is 16x16, the position of the first non-zero coefficient in the encoding/decoding order is (10,6) based on (0,0) at the upper left of the transform block, and the transform block 1402 It is assumed that all subblocks of are pre-divided into 4x4 units. In this case, based on (10,6), the position of the last pixel in the upper right 45 degree direction is (15,1), and the last pixel position in the lower left 45 degree direction is (1,15). Based on the boundary line connecting the two pixel positions, the partial blocks 1-10 of the region located at the upper left are determined to be encoded/decoded partial blocks, and the partial blocks of the region located at the lower right are the portions that are not encoded/decoded. Blocks can be determined. In this case, the shape of the partial block of the region located at the upper left may be determined to be a rectangle and/or a triangle.

예를 들어, 변환 블록(1403)은 16x16이고, 부호화/복호화 순서상 최초 넌-제로 계수의 위치가 변환 블록의 좌상단 (0,0)을 기준으로 (8,7)이며, 변환 블록(1403)의 모든 부분 블록이 4x4 단위로 기 분할된 경우를 가정한다. 이 경우, (8,7)을 기준으로 우상단 45도 방향의 마지막 화소 위치는 (15,0)이고, 좌하단 45도 방향의 마지막 화소 위치는 (0,15)이다. 상기 2개의 화소 위치를 이은 경계선을 기준으로, 좌상단에 위치한 영역의 부분 블록(1-10)은 부호화/복호화되는 부분 블록으로 결정되고, 우하단에 위치한 영역의 부분 블록은 부호화/복호화되지 않는 부분 블록으로 결정될 수 있다. 이때, 상기 경계선을 포함하는 부분 블록의 경우, 상기 경계선을 기준으로 좌상단 영역에 있는 계수만 부분 블록에 포함시키고, 우하단 영역에 있는 계수는 부분 블록에서 제외시킬 수 있다. 상기 좌상단에 위치한 영역의 부분 블록의 형태는 사각형(부분 블록 1-5, 8) 및/또는 삼각형(부분 블록 6, 7, 9, 10)으로 결정될 수도 있다.For example, the transform block 1403 is 16x16, the position of the first non-zero coefficient in the encoding/decoding order is (8,7) based on (0,0) at the upper left of the transform block, and the transform block 1403 It is assumed that all subblocks of are pre-divided into 4x4 units. In this case, the position of the last pixel in the 45 degree direction from the upper right corner is (15, 0), and the last pixel position in the lower left 45 degree direction is (0,15) based on (8,7). Based on the boundary line connecting the two pixel positions, the partial blocks 1-10 of the region located at the upper left are determined to be encoded/decoded partial blocks, and the partial blocks of the region located at the lower right are the portions that are not encoded/decoded. Blocks can be determined. In this case, in the case of a partial block including the boundary line, only coefficients in the upper left region with respect to the boundary line may be included in the partial block, and coefficients in the lower right region may be excluded from the partial block. The shape of the partial block of the region located at the upper left may be determined to be a rectangle (part blocks 1-5 and 8) and/or a triangle (part blocks 6, 7, 9, and 10).

도 15는 본 발명이 적용되는 일실시예로서, 주파수 도메인에서 DC/AC 성분의 속성을 기반으로 변환 블록을 분할하는 방법을 도시한 것이다.15 is a diagram illustrating a method of dividing a transform block based on a property of a DC/AC component in a frequency domain as an embodiment to which the present invention is applied.

주파수 도메인에서, 변환 블록을 구성하는 DC/AC 성분의 속성을 고려하여, 변환 블록의 분할 형태를 결정할 수 있다. 상기 속성은, 성분 위치, 분포도, 밀집도 또는 강약 등을 의미할 수 있고, 상기 속성은 변환 블록의 변환 방법(예를 들어, DCT, DST 등)에 종속적으로 결정될 수 있다.In the frequency domain, the division form of the transform block may be determined by considering the properties of DC/AC components constituting the transform block. The attribute may mean a component position, distribution, density, or strength, and the attribute may be determined dependently on a transformation method (eg, DCT, DST, etc.) of a transformation block.

변환 블록 내에서, AC 성분이 가장 약하게 집중되는 영역은 나머지 영역보다 큰 크기의 부분 블록으로 분할될 수 있다. 예를 들어, 16x16 크기의 변환 블록(1501)에서, AC 성분은 주로 부분 블록 "5" 내지 "13"에 위치할 수 있다. 이때, AC 성분이 가장 약하게 집중되는 영역인 부분 블록 13에만 8x8 크기의 부분 블록을 할당하고, 나머지 영역에는 4x4 크기의 부분 블록을 할당할 수 있다.In the transform block, the region where the AC component is the weakest concentration may be divided into partial blocks having a size larger than that of the remaining regions. For example, in the 16×16 transform block 1501 , the AC component may be mainly located in partial blocks “5” to “13”. In this case, an 8x8 partial block may be allocated only to partial block 13, which is an area in which the AC component is weakly concentrated, and a 4x4 partial block may be allocated to the remaining area.

또는, 변환 블록 내에서, AC 성분이 가장 약하게 집중되는 영역은 나머지 영역보다 작은 크기의 부분 블록으로 분할될 수도 있다. 예를 들어, 16x16 크기의 변환 블록(1502)에서, AC 성분은 주로 부분 블록 "2" 내지 "7"에 위치할 수 있다. 이때, AC 성분이 가장 약한 영역인 부분 블록 "4" 내지 "7"에만 4x4 크기의 부분 블록을 할당하고, 나머지 영역에는 8x8 크기의 부분 블록을 할당할 수 있다.Alternatively, in the transform block, the region where the AC component is the weakest concentration may be divided into partial blocks having a size smaller than that of the remaining regions. For example, in the transform block 1502 having a size of 16x16, the AC component may be mainly located in partial blocks “2” to “7”. In this case, a partial block having a size of 4x4 may be allocated only to partial blocks "4" to "7", which are regions in which the AC component is the weakest, and a partial block having a size of 8x8 may be allocated to the remaining regions.

또는, 변환 블록 내에서, DC 성분이 가장 강하게 집중되는 영역은 나머지 영역보다 작은 크기의 부분 블록으로 분할될 수도 있다. 예를 들어, 16x16 크기의 변환 블록(1503)에서, DC 성분은 주로 부분 블록 "1" 내지 "4"에 위치할 수 있다. 이때, DC 성분이 가장 강한 영역인 부분 블록 "1" 내지 "4"에만 4x4 크기의 부분 블록을 할당하고, 나머지 영역에는 8x8 크기의 부분 블록을 할당할 수 있다.Alternatively, within the transform block, a region in which the DC component is most strongly concentrated may be divided into partial blocks having a size smaller than that of the remaining regions. For example, in the 16×16 transform block 1503 , the DC component may be mainly located in partial blocks “1” to “4”. In this case, a partial block having a size of 4x4 may be allocated only to partial blocks “1” to “4”, which are regions having the strongest DC component, and a partial block having a size of 8x8 may be allocated to the remaining regions.

또는, 변환 블록 내에서, DC 성분이 가장 강하게 집중되는 영역은 나머지 영역보다 큰 크기의 부분 블록으로 분할될 수도 있다. 예를 들어, 16x16 크기의 변환 블록(1504)에서, DC 성분은 주로 부분 블록 "1"영역에 위치할 수 있다. 이때, DC 성분이 가장 강한 영역인 부분 블록 "1"에만 8x8 크기의 부분 블록을 할당하고, 나머지 영역에는 4x4 크기의 부분 블록을 할당할 수 있다.Alternatively, within the transform block, a region in which the DC component is most strongly concentrated may be divided into partial blocks having a size larger than that of the remaining regions. For example, in the transform block 1504 having a size of 16x16, the DC component may be mainly located in the partial block “1” region. In this case, a partial block having a size of 8x8 may be allocated only to partial block "1", which is a region having the strongest DC component, and a partial block having a size of 4x4 may be allocated to the remaining regions.

전술한 실시예에서는, 4등분된 변환 블록을 기준으로, 변환 블록 내 DC/AC 성분의 영역을 가정하였다. 다만, 이에 한정되지 아니하며, N(N≥1)등분 또는 2의 N승 등분된 변환 블록의 경우에도 동일/유사하게 적용될 수 있다.In the above-described embodiment, the region of the DC/AC component in the transform block is assumed based on the quadrant transform block. However, the present invention is not limited thereto, and the same/similar application may be applied to the case of a transform block divided into N (N ≥ 1) equal parts or 2 to the N power.

변환 블록의 양자화 파라미터(QP)에 따라서, 변환 블록 내 부분 블록 전부 또는 일부가 선택적으로 부호화/복호화될 수도 있다. 예를 들어, 상기 변환 블록의 QP가 소정의 QP 임계치보다 큰 경우, 변환 블록 내에서 일부 영역만을 부호화/복호화할 수 있다. 반면, 상기 변환 블록의 QP가 소정의 QP 임계치보다 작은 경우, 변환 블록 내 모든 부분 블록을 부호화/복호화할 수 있다.According to a quantization parameter (QP) of the transform block, all or a part of partial blocks in the transform block may be selectively encoded/decoded. For example, when the QP of the transform block is greater than a predetermined QP threshold, encoding/decoding may be performed of only a partial region within the transform block. On the other hand, when the QP of the transform block is less than a predetermined QP threshold, all partial blocks in the transform block may be encoded/decoded.

여기서, 일부 영역은, 소정의 수직 라인 또는 수평 라인 중 적어도 하나에 의해서 특정될 수 있다. 상기 수직 라인은 변환 블록의 좌측 경계에서 왼쪽으로 a만큼 떨어진 지점에 위치하고, 상기 수평 라인은 변환 블록의 상단 경계에서 아래쪽으로 b만큼 떨어진 지점에 위치할 수 있다. 상기 a와 b는 자연수이며, 서로 동일하거나 상이할 수 있다. 상기 일부 영역은, 상기 수직 라인을 기준으로 왼쪽 및/또는 상기 수평 라인을 기준으로 위쪽에 위치한 영역일 수 있다. 상기 수직/수평 라인의 위치는 영상 부호화/복호화 장치에 기-약속된 것일 수도 있고, 변환 블록의 크기/형태를 고려하여 가변적으로 결정될 수도 있다. 또는, 영상 부호화 장치는 상기 일부 영역을 특정하는 정보(예를 들어, 상기 수직/수평 라인의 위치를 특정하는 정보)를 부호화하여 시그날링하고, 영상 복호화 장치는 상기 시그날링된 정보를 기반으로 일부 영역을 특정할 수도 있다. 상기 특정된 일부 영역의 경계는, 변환 블록 내 부분 블록의 경계에 접할 수도 있고, 접하지 않을 수도 있다. Here, the partial region may be specified by at least one of a predetermined vertical line or a horizontal line. The vertical line may be located at a point a distance to the left from the left boundary of the transform block, and the horizontal line may be located at a point b below the upper boundary of the transform block. A and b are natural numbers, and may be the same as or different from each other. The partial region may be a region located to the left with respect to the vertical line and/or to an upper side with respect to the horizontal line. The positions of the vertical/horizontal lines may be pre-promised to the image encoding/decoding apparatus, or may be variably determined in consideration of the size/shape of the transform block. Alternatively, the image encoding apparatus encodes and signals information specifying the partial region (for example, information specifying the position of the vertical/horizontal line), and the image decoding apparatus performs a partial signal based on the signaled information. You can also specify an area. The boundary of the specified partial region may or may not be in contact with the boundary of the partial block within the transform block.

예를 들어, 상기 일부 영역은, DC 성분이 집중된 영역의 부분 블록 1개 또는 인접 부분 블록을 포함한 N개(N≥1)의 부분 블록일 수 있다. 또는, 상기 일부 영역은, 변환 블록의 상단 경계의 1/n 지점을 지나가는 수직 라인 및/또는 변환 블록의 좌측 경계의 1/m 지점을 지나가는 수평 라인에 의해서 특정될 수 있다. 상기 n과 m은 자연수이며, 서로 동일하거나 상이할 수 있다. For example, the partial region may be one partial block of the region in which the DC component is concentrated or N number of partial blocks (N≥1) including adjacent partial blocks. Alternatively, the partial region may be specified by a vertical line passing through a point 1/n of an upper boundary of the transform block and/or a horizontal line passing through a point 1/m of a left boundary of the transform block. n and m are natural numbers, and may be the same as or different from each other.

상기 QP 임계치의 개수는, 1개, 2개 또는 그 이상일 수 있다. QP 임계치는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 QP 임계치는, 영상 부호화/복호화 장치에서 이용 가능한 QP의 범위 중 중앙값에 해당할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 QP 임계치를 결정하고, 이를 부호화할 수도 있다.The number of the QP thresholds may be one, two, or more. The QP threshold may be pre-set in the video encoding apparatus. For example, the QP threshold may correspond to a median value of a range of QPs usable in an image encoding/decoding apparatus. Alternatively, the image encoding apparatus may determine an optimal QP threshold in consideration of encoding efficiency and encode it.

또는, 변환 블록의 크기에 따라서, 상기 변환 블록 내 부분 블록 전부 또는 일부가 선택적으로 부호화/복호화될 수 있다. 예를 들어, 변환 블록의 크기가 소정의 임계크기보다 크거나 같은 경우, 변환 블록 내에서 일부 영역 만을 부호화/복호화할 수 있다. 반면, 상기 변환 블록의 크기가 소정의 임계크기보다 작은 경우, 변환 블록 내 모든 부분 블록을 부호화/복호화할 수 있다.Alternatively, all or part of the partial blocks in the transform block may be selectively encoded/decoded according to the size of the transform block. For example, when the size of the transform block is greater than or equal to a predetermined threshold size, encoding/decoding may be performed only in a partial region within the transform block. On the other hand, when the size of the transform block is smaller than a predetermined threshold size, all partial blocks in the transform block may be encoded/decoded.

여기서, 일부 영역은, 소정의 수직 라인 또는 수평 라인 중 적어도 하나에 의해서 특정될 수 있다. 상기 수직 라인은 변환 블록의 좌측 경계에서 왼쪽으로 a만큼 떨어진 지점에 위치하고, 상기 수평 라인은 변환 블록의 상단 경계에서 아래쪽으로 b만큼 떨어진 지점에 위치할 수 있다. 상기 a와 b는 자연수이며, 서로 동일하거나 상이할 수 있다. 상기 일부 영역은, 상기 수직 라인을 기준으로 왼쪽 및/또는 상기 수평 라인을 기준으로 위쪽에 위치한 영역일 수 있다. 상기 수직/수평 라인의 위치는 영상 부호화/복호화 장치에 기-약속된 것일 수도 있고, 변환 블록의 크기/형태를 고려하여 가변적으로 결정될 수도 있다. 또는, 영상 부호화 장치는 상기 일부 영역을 특정하는 정보(예를 들어, 상기 수직/수평 라인의 위치를 특정하는 정보)를 부호화하여 시그날링하고, 영상 복호화 장치는 상기 시그날링된 정보를 기반으로 일부 영역을 특정할 수도 있다. 상기 특정된 일부 영역의 경계는, 변환 블록 내 부분 블록의 경계에 접할 수도 있고, 접하지 않을 수도 있다. Here, the partial region may be specified by at least one of a predetermined vertical line or a horizontal line. The vertical line may be located at a point a distance to the left from the left boundary of the transform block, and the horizontal line may be located at a point b below the upper boundary of the transform block. A and b are natural numbers, and may be the same as or different from each other. The partial region may be a region located to the left with respect to the vertical line and/or to an upper side with respect to the horizontal line. The positions of the vertical/horizontal lines may be pre-promised to the image encoding/decoding apparatus, or may be variably determined in consideration of the size/shape of the transform block. Alternatively, the image encoding apparatus encodes and signals information specifying the partial region (for example, information specifying the position of the vertical/horizontal line), and the image decoding apparatus performs a partial signal based on the signaled information. You can also specify an area. The boundary of the specified partial region may or may not be in contact with the boundary of the partial block within the transform block.

예를 들어, 상기 일부 영역은, DC 성분이 집중된 영역의 부분 블록 1개 또는 인접 부분 블록을 포함한 N개(N≥1)의 부분 블록일 수 있다. 또는, 상기 일부 영역은, 변환 블록의 상단 경계의 1/n 지점을 지나가는 수직 라인 및/또는 변환 블록의 좌측 경계의 1/m 지점을 지나가는 수평 라인에 의해서 특정될 수 있다. 상기 n과 m은 자연수이며, 서로 동일하거나 상이할 수 있다.For example, the partial region may be one partial block of the region in which the DC component is concentrated or N number of partial blocks (N≥1) including adjacent partial blocks. Alternatively, the partial region may be specified by a vertical line passing through a point 1/n of an upper boundary of the transform block and/or a horizontal line passing through a point 1/m of a left boundary of the transform block. n and m are natural numbers, and may be the same as or different from each other.

상기 임계크기의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계크기는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 임계크기는 cxd로 표현되며, 여기서 c와 d는 2, 4, 8, 16, 32, 64 또는 그 이상이고, c와 d는 동일하거나 상이할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 임계크기를 결정하고, 이를 부호화할 수도 있다.The number of the threshold sizes may be one, two, or more. The threshold size may be preset in the image encoding apparatus. For example, the threshold size is expressed as cxd, where c and d are 2, 4, 8, 16, 32, 64 or more, and c and d may be the same or different. Alternatively, the image encoding apparatus may determine an optimal threshold size in consideration of encoding efficiency and encode it.

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

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

또한, 본 개시의 다양한 실시 예는 하드웨어, 펌웨어(firmware), 소프트웨어, 또는 그들의 결합 등에 의해 구현될 수 있다. 하드웨어에 의한 구현의 경우, 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 범용 프로세서(general processor), 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다. In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. For 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), general purpose It may be implemented by a processor (general processor), a controller, a microcontroller, a microprocessor, and the like.

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

Claims (4)

비트스트림으로부터 변환 블록의 계수를 복호화하는 단계; 및
상기 복호화된 계수를 이용하여 상기 변환 블록을 복원하는 단계를 포함하되,
상기 변환 블록의 계수에 대한 복호화는, 상기 변환 블록의 크기를 기-정의된 임계크기와 비교한 결과에 따라, 상기 변환 블록 내 전부 또는 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 크거나 같은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록 내 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 작은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록의 전체 영역에 대해서 수행되고,
상기 일부 영역은, 상기 비트스트림으로부터 획득한 정보에 기초하여, 소정의 수직 라인 또는 수평 라인에 의해서 특정되고, 여기서, 상기 정보는, 상기 수직 라인의 위치를 특정하는 정보 또는 상기 수평 라인의 위치를 특정하는 정보를 포함함,
상기 수직 라인은, 상기 변환 블록의 좌측 경계에서 오른쪽으로 a만큼 떨어진 지점에 위치하고, 상기 수평 라인은, 상기 변환 블록의 상단 경계에서 아래쪽으로 b만큼 떨어진 지점에 위치하고,
상기 일부 영역은, 상기 수직 라인을 기준으로 왼쪽에 위치한 영역 또는 상기 수평 라인을 기준으로 위쪽에 위치한 영역이고,
상기 일부 영역은 복수의 부분 블록으로 분할되며,
상기 일부 영역의 계수는 상기 부분 블록의 단위로 복호화되는, 영상 신호 복호화 방법.
decoding coefficients of a transform block from the bitstream; and
Reconstructing the transform block using the decoded coefficients,
Decoding of the coefficients of the transform block is performed only on all or some regions within the transform block according to a result of comparing the size of the transform block with a pre-defined threshold size,
When the size of the transform block is greater than or equal to the threshold size, decoding of the coefficients of the transform block is performed only on a partial region within the transform block,
When the size of the transform block is smaller than the threshold size, decoding of the coefficients of the transform block is performed on the entire area of the transform block,
The partial region is specified by a predetermined vertical line or horizontal line based on information obtained from the bitstream, wherein the information includes information specifying the position of the vertical line or the position of the horizontal line. contains information specifying;
The vertical line is located at a point a distance to the right from the left boundary of the transformation block, and the horizontal line is located at a point that is separated by b from the upper boundary of the transformation block downward,
The partial area is an area located on the left with respect to the vertical line or an area located above with respect to the horizontal line,
The partial area is divided into a plurality of partial blocks,
and the coefficients of the partial region are decoded in units of the partial blocks.
제1항에 있어서,
상기 임계크기는, 영상 복호화 장치에 기-설정된 NxM 크기이며,
N과 M은 각각 8, 16 또는 그 이상의 정수인, 영상 신호 복호화 방법.
The method of claim 1,
The threshold size is an NxM size preset in the image decoding apparatus,
Wherein N and M are integers of 8, 16 or more, respectively, video signal decoding method.
현재 부호화 블록의 원본 블록과 예측 블록 간의 차이인 잔차 데이터를 포함하는 변환 블록을 생성하는 단계; 및
상기 변환 블록의 계수를 부호화하는 단계를 포함하되,
상기 변환 블록의 계수에 대한 부호화는, 상기 변환 블록의 크기를 기-정의된 임계크기와 비교한 결과에 따라, 상기 변환 블록 내 전부 또는 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 크거나 같은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록 내 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 작은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록의 전체 영역에 대해서 수행되고,
상기 일부 영역은, 소정의 수직 라인 또는 수평 라인에 의해서 특정되고,
상기 수직 라인은, 상기 변환 블록의 좌측 경계에서 오른쪽으로 a만큼 떨어진 지점에 위치하고, 상기 수평 라인은, 상기 변환 블록의 상단 경계에서 아래쪽으로 b만큼 떨어진 지점에 위치하고,
상기 일부 영역은, 상기 수직 라인을 기준으로 왼쪽에 위치한 영역 또는 상기 수평 라인을 기준으로 위쪽에 위치한 영역이고,
상기 일부 영역을 특정하는 정보는 부호화되고,
상기 정보는, 상기 수직 라인의 위치를 특정하는 정보 또는 상기 수평 라인의 위치를 특정하는 정보를 포함하고,
상기 일부 영역은 복수의 부분 블록으로 분할되며,
상기 일부 영역의 계수는 상기 부분 블록의 단위로 부호화되는, 영상 신호 부호화 방법.
generating a transform block including residual data that is a difference between an original block and a prediction block of a current coding block; and
encoding the coefficients of the transform block;
Coding of the coefficients of the transform block is performed only on all or some regions within the transform block according to a result of comparing the size of the transform block with a pre-defined threshold size,
When the size of the transform block is greater than or equal to the threshold size, decoding of the coefficients of the transform block is performed only on a partial region within the transform block,
When the size of the transform block is smaller than the threshold size, decoding of the coefficients of the transform block is performed on the entire area of the transform block,
The partial region is specified by a predetermined vertical line or horizontal line,
The vertical line is located at a point a distance to the right from the left boundary of the transformation block, and the horizontal line is located at a point that is separated by b from the upper boundary of the transformation block downward,
The partial area is an area located on the left with respect to the vertical line or an area located above with respect to the horizontal line,
Information specifying the partial region is encoded,
The information includes information specifying the position of the vertical line or information specifying the position of the horizontal line,
The partial area is divided into a plurality of partial blocks,
and the coefficients of the partial region are encoded in units of the partial blocks.
비트스트림을 저장하는 컴퓨터로 판독가능한 기록 매체에 있어서,
상기 비트스트림은, 부호화된 변환 블록의 계수를 포함하고,
상기 부호화된 변환 블록의 계수의 복호화는, 상기 변환 블록의 크기를 기-정의된 임계크기와 비교한 결과에 따라, 상기 변환 블록 내 전부 또는 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 크거나 같은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록 내 일부 영역에 대해서만 수행되고,
상기 변환 블록의 크기가 상기 임계크기보다 작은 경우, 상기 변환 블록의 계수에 대한 복호화는 상기 변환 블록의 전체 영역에 대해서 수행되고,
상기 일부 영역은, 상기 비트스트림으로부터 획득한 정보에 기초하여, 소정의 수직 라인 또는 수평 라인에 의해서 특정되고, 여기서, 상기 정보는, 상기 수직 라인의 위치를 특정하는 정보 또는 상기 수평 라인의 위치를 특정하는 정보를 포함함,
상기 수직 라인은, 상기 변환 블록의 좌측 경계에서 오른쪽으로 a만큼 떨어진 지점에 위치하고, 상기 수평 라인은, 상기 변환 블록의 상단 경계에서 아래쪽으로 b만큼 떨어진 지점에 위치하고,
상기 일부 영역은, 상기 수직 라인을 기준으로 왼쪽에 위치한 영역 또는 상기 수평 라인을 기준으로 위쪽에 위치한 영역이고,
상기 일부 영역은 복수의 부분 블록으로 분할되고,
상기 일부 영역의 계수는 상기 부분 블록의 단위로 복호화되는, 컴퓨터로 판독가능한 기록 매체.
A computer-readable recording medium storing a bitstream, comprising:
The bitstream includes coefficients of a coded transform block,
Decoding of the coefficients of the coded transform block is performed only on all or some regions within the transform block according to a result of comparing the size of the transform block with a pre-defined threshold size,
When the size of the transform block is greater than or equal to the threshold size, decoding of the coefficients of the transform block is performed only on a partial region within the transform block,
When the size of the transform block is smaller than the threshold size, decoding of the coefficients of the transform block is performed on the entire area of the transform block,
The partial region is specified by a predetermined vertical line or horizontal line based on information obtained from the bitstream, wherein the information includes information specifying the position of the vertical line or the position of the horizontal line. contains information specifying;
The vertical line is located at a point a distance to the right from the left boundary of the transformation block, and the horizontal line is located at a point that is separated by b from the upper boundary of the transformation block downward,
The partial area is an area located on the left with respect to the vertical line or an area located above with respect to the horizontal line,
The partial area is divided into a plurality of partial blocks,
and the coefficients of the partial area are decoded in units of the partial blocks.
KR1020220055981A 2016-04-29 2022-05-06 Method and apparatus for encoding/decoding a video signal KR20220061085A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
KR20160052692 2016-04-29
KR1020160052692 2016-04-29
KR1020170050049A KR20170124077A (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020170050049A Division KR20170124077A (en) 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal

Publications (1)

Publication Number Publication Date
KR20220061085A true KR20220061085A (en) 2022-05-12

Family

ID=81590442

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220055981A KR20220061085A (en) 2016-04-29 2022-05-06 Method and apparatus for encoding/decoding a video signal

Country Status (1)

Country Link
KR (1) KR20220061085A (en)

Similar Documents

Publication Publication Date Title
KR102365964B1 (en) Video signal processing method and apparatus
KR102383104B1 (en) Method and apparatus for processing a video signal
CN109328461B (en) Video signal encoding/decoding method and apparatus
KR102030384B1 (en) A method and an apparatus for encoding/decoding residual coefficient
US11665337B2 (en) Method and apparatus for encoding/decoding an image signal
JP2020022171A (en) Intra-prediction method and encoder and decoder using the same
KR102061201B1 (en) Methods of transformation based on block information and appratuses using the same
KR101997681B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20220054723A (en) Image encoding/decoding method and apparatus
US20190158846A1 (en) Method and apparatus for encoding/decoding image signal
KR102416804B1 (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR20210008105A (en) Video encoding/decoding method and apparatus
KR102435493B1 (en) Method and apparatus for encoding/decoding a video signal
CN112425161A (en) Video coding method and device based on intra-frame prediction
KR20170124079A (en) Method and apparatus for encoding/decoding a video signal
KR20190140423A (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR20220098114A (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR20220019731A (en) A video encoding/decoding method and apparatus
CN116916000A (en) Video signal encoding/decoding method and apparatus
KR20180032775A (en) Method and apparatus for processing a video signal based on adaptive block patitioning
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR102389267B1 (en) A method and an apparatus for processing a video signal based on reference between components
KR20170124077A (en) Method and apparatus for encoding/decoding a video signal
KR20180089290A (en) Method and apparatus for encoding/decoding an image
KR20220061085A (en) Method and apparatus for encoding/decoding a video signal

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
AMND Amendment
X701 Decision to grant (after re-examination)
E902 Notification of reason for refusal