KR20170124078A - 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
KR20170124078A
KR20170124078A KR1020170050050A KR20170050050A KR20170124078A KR 20170124078 A KR20170124078 A KR 20170124078A KR 1020170050050 A KR1020170050050 A KR 1020170050050A KR 20170050050 A KR20170050050 A KR 20170050050A KR 20170124078 A KR20170124078 A KR 20170124078A
Authority
KR
South Korea
Prior art keywords
coefficient
partial block
block
flag
current
Prior art date
Application number
KR1020170050050A
Other languages
Korean (ko)
Inventor
문주희
원동재
임성원
Original Assignee
세종대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 세종대학교산학협력단 filed Critical 세종대학교산학협력단
Priority to CN202111060116.0A priority Critical patent/CN113810706A/en
Priority to CN202111060251.5A priority patent/CN113810708A/en
Priority to CN202111060300.5A priority patent/CN113810711A/en
Priority to CN202111060265.7A priority patent/CN113810710A/en
Priority to CN202111060470.3A priority patent/CN113810713A/en
Priority to CN202111059977.7A priority patent/CN113810699A/en
Priority to CN202111059986.6A priority patent/CN113810700A/en
Priority to PCT/KR2017/004465 priority patent/WO2017188739A1/en
Priority to CN202111060380.4A priority patent/CN113810712A/en
Priority to CN202111059916.0A priority patent/CN113810697A/en
Priority to CN202111059988.5A priority patent/CN113810701B/en
Priority to CN201910851178.XA priority patent/CN110572649B/en
Priority to CN201780041200.3A priority patent/CN109479132B/en
Priority to CN202111060058.1A priority patent/CN113810704A/en
Priority to CN202111060153.1A priority patent/CN113810707A/en
Priority to CN202111064728.7A priority patent/CN113810714A/en
Priority to CN202111060256.8A priority patent/CN113810709A/en
Priority to CN202111060000.7A priority patent/CN113810703A/en
Priority to CN202111059997.4A priority patent/CN113810702A/en
Priority to US16/097,464 priority patent/US10681353B2/en
Priority to CN202111059976.2A priority patent/CN113810698A/en
Priority to CN202111060060.9A priority patent/CN113810705A/en
Publication of KR20170124078A publication Critical patent/KR20170124078A/en
Priority to US16/860,112 priority patent/US11140396B2/en
Priority to US17/017,770 priority patent/US11122273B2/en
Priority to US17/017,808 priority patent/US11140397B2/en
Priority to US17/381,326 priority patent/US20210352296A1/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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Abstract

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

Description

영상 신호 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR ENCODING/DECODING A VIDEO SIGNAL}TECHNICAL FIELD [0001] The present invention relates to a video signal encoding / decoding method and apparatus,

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

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(Channel)의 대역폭(Bandwidth)이 발전하는 속도는 급격히 증가하고 있는 멀티미디어 데이터의 양을 따라가기 힘든 상황이다.In recent years, demand for multimedia data such as video has been rapidly increasing on the Internet. However, the rate at which the bandwidth of a channel develops is hard to follow the amount of multimedia data that is rapidly increasing.

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

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

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그는 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여 부호화될 수 있다.In the video signal encoding method and apparatus according to the present invention, the partial block coefficient flag may be encoded based on the number of non-zero coefficients in the previous partial block.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그를 부호화하는 단계는, 상기 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함할 수 있다.In the method and apparatus for encoding an image signal according to the present invention, the step of encoding the partial block coefficient flag may further include changing probability information of the partial block coefficient flag based on the number of non-zero coefficients in the previous partial block Step < / RTI >

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그는, 상기 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수에 기초하여 부호화될 수 있다.In the video signal encoding method and apparatus according to the present invention, the partial block coefficient flag may be encoded based on the number of non-zero coefficients up to the previous coefficient in the current partial block.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그를 부호화하는 단계는, 상기 이전 계수까지의 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함할 수 있다.In the method and apparatus for encoding a video signal according to the present invention, the step of encoding the partial block coefficient flag may include the step of changing the probability information of the partial block coefficient flag based on the number of non-zero coefficients up to the previous coefficient Step < / RTI >

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타내는 부분 블록 플래그를 복호화하고, 상기 현재 부분 블록의 현재 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 복호화하며, 상기 현재 부분 블록의 현재 계수의 절대값을 복호화하고, 상기 현재 부분 블록의 현재 계수의 부호(sign)를 복호화할 수 있다.The method and apparatus for decoding a video signal 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 determines whether the current coefficient of the current partial block is a non-zero coefficient , Decodes the absolute value of the current coefficient of the current partial block, and decodes the sign of the current coefficient of the current partial block.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그는 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여 복호화될 수 있다.In the video signal decoding method and apparatus according to the present invention, the partial block coefficient flag may be decoded based on the number of non-zero coefficients in the previous partial block.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그를 복호화하는 단계는, 상기 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함할 수 있다.In the method and apparatus for decoding a video signal according to the present invention, the step of decoding the partial block coefficient flag may further include changing probability information of the partial block coefficient flag based on the number of non-zero coefficients in the previous partial block Step < / RTI >

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그는, 상기 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수에 기초하여 복호화될 수 있다.In the video signal decoding method and apparatus according to the present invention, the partial block coefficient flag can be decoded based on the number of non-zero coefficients up to the previous coefficient in the current partial block.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 부분 블록 계수 플래그를 복호화하는 단계는, 상기 이전 계수까지의 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함할 수 있다.In the method and apparatus for decoding a video signal according to the present invention, the step of decoding the partial block coefficient flag may further include changing probability information of the partial block coefficient flag based on the number of non-zero coefficients up to the previous coefficient Step < / RTI >

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

도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 본 발명의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 3은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 부호화하는 방법을 도시한 것이다.
도 4는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 부호화하는 방법을 도시한 것이다.
도 5는 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 복호화하는 방법을 도시한 것이다.
도 6은 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 복호화하는 방법을 도시한 것이다.
도 7은 본 발명이 적용되는 일실시예로서, 현재 부분 블록에 관한 제1 임계값 플래그를 유도하는 방법을 도시한 것이다.
도 8은 본 발명이 적용되는 일실시예로서, 분할 색인 정보를 기반으로 부분 블록의 크기/형태를 결정하는 방법을 도시한 것이다.
도 9는 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그를 부호화하는 방법을 도시한 것이다.
도 10은 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.
도 11은 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그를 부호화하는 방법을 도시한 것이다.
도 12는 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.
도 13은 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.
도 14는 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.
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.
FIG. 3 illustrates a method of encoding a coefficient of a transform block according to an embodiment to which the present invention is applied.
FIG. 4 illustrates a method of encoding a first threshold flag for a partial block according to an embodiment of the present invention. Referring to FIG.
FIG. 5 illustrates a method of decoding a coefficient of a transform block according to an embodiment to which the present invention is applied.
FIG. 6 illustrates a method of decoding a first threshold flag for a partial block according to an embodiment of the present invention. Referring to FIG.
FIG. 7 illustrates a method of deriving a first threshold flag for a current partial block according to an embodiment of the present invention. Referring to FIG.
FIG. 8 illustrates a method of determining the size / shape of a partial block based on partitioned index information according to an embodiment of the present invention. Referring to FIG.
9 is a diagram illustrating a method of encoding a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment of the present invention.
10 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment of the present invention.
11 is a diagram illustrating a method of encoding a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.
FIG. 12 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.
FIG. 13 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment to which the present invention is applied.
FIG. 14 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

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

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

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

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same constituent elements in the drawings, and redundant explanations for the same constituent elements will be 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)를 포함할 수 있다.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 reordering unit 160, an entropy encoding unit An inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155. [

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

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

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

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

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

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

인터 예측부(120)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 단위를 예측할 수도 있고, 경우에 따라서는 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로 예측 단위를 예측할 수도 있다. 인터 예측부(120)는 참조 픽쳐 보간부, 모션 예측부, 움직임 보상부를 포함할 수 있다. The inter-prediction unit 120 may predict a prediction unit based on information of at least one of a previous picture or a following picture of the current picture, and may predict a prediction unit based on information of a partially- Unit may be predicted. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

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

모션 예측부는 참조 픽쳐 보간부에 의해 보간된 참조 픽쳐를 기초로 모션 예측을 수행할 수 있다. 모션 벡터를 산출하기 위한 방법으로 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 interpolating unit. Various methods such as Full Search-based Block Matching Algorithm (FBMA), Three Step Search (TSS), and New Three-Step Search Algorithm (NTS) can be used as methods for calculating motion vectors. 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 can predict the current prediction unit by making the motion prediction method different. Various methods such as a skip method, a merge method, and an AMVP (Advanced Motion Vector Prediction) method can be used as the motion prediction method.

인트라 예측부(125)는 현재 픽쳐 내의 화소 정보인 현재 블록 주변의 참조 픽셀 정보를 기초로 예측 단위를 생성할 수 있다. 현재 예측 단위의 주변 블록이 인터 예측을 수행한 블록이어서, 참조 픽셀이 인터 예측을 수행한 픽셀일 경우, 인터 예측을 수행한 블록에 포함되는 참조 픽셀을 주변의 인트라 예측을 수행한 블록의 참조 픽셀 정보로 대체하여 사용할 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.The intra prediction unit 125 can generate a prediction unit based on reference pixel information around the current block which is pixel information in the current picture. In the case where the neighboring block of the current prediction unit is the block in which the inter prediction is performed so that the reference pixel is the pixel performing the inter prediction, the reference pixel included in the block in which the inter prediction is performed is referred to as the reference pixel Information. That is, when the reference pixel is not available, the reference pixel information that is not available may be replaced by 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 direction information is not used in prediction. The mode for predicting the luminance information may be different from the mode for predicting the chrominance information and the intra prediction mode information or predicted luminance signal information used for predicting the luminance information may be utilized to predict the chrominance information.

인트라 예측 방법은 예측 모드에 따라 참조 화소에 AIS(Adaptive Intra Smoothing) 필터를 적용한 후 예측 블록을 생성할 수 있다. 참조 화소에 적용되는 AIS 필터의 종류는 상이할 수 있다. 인트라 예측 방법을 수행하기 위해 현재 예측 단위의 인트라 예측 모드는 현재 예측 단위의 주변에 존재하는 예측 단위의 인트라 예측 모드로부터 예측할 수 있다. 주변 예측 단위로부터 예측된 모드 정보를 이용하여 현재 예측 단위의 예측 모드를 예측하는 경우, 현재 예측 단위와 주변 예측 단위의 인트라 예측 모드가 동일하면 소정의 플래그 정보를 이용하여 현재 예측 단위와 주변 예측 단위의 예측 모드가 동일하다는 정보를 전송할 수 있고, 만약 현재 예측 단위와 주변 예측 단위의 예측 모드가 상이하면 엔트로피 부호화를 수행하여 현재 블록의 예측 모드 정보를 부호화할 수 있다.The intra prediction method can generate a prediction block after applying an AIS (Adaptive Intra Smoothing) filter to the reference pixel according to the prediction mode. The type of the 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 can be predicted from the intra prediction mode of the prediction unit existing around the current prediction unit. In the case where the prediction mode of the current prediction unit is predicted using the mode information predicted from the peripheral prediction unit, if the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the current prediction unit, The prediction mode information of the current block can be encoded by performing entropy encoding if the prediction mode of the current prediction unit is different from the prediction mode of the neighbor prediction unit.

또한, 예측부(120, 125)에서 생성된 예측 단위를 기초로 예측을 수행한 예측 단위와 예측 단위의 원본 블록과 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력될 수 있다. In addition, a residual block including a prediction unit that has been predicted based on the prediction unit generated by the prediction units 120 and 125 and a residual value that is a difference value from the original block of the prediction unit 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 transforming unit 130 may transform the residual block including residual data using a transform method such as DCT, DST, Karhunen Loeve Transform (KLT), or the like. At this time, the conversion method can be determined based on the intra prediction mode of the prediction unit used to generate the residual block. For example, depending on the intra prediction mode, DCT may be used in the horizontal direction, and DST may be used in the vertical direction.

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

상기 변환부(130) 및/또는 양자화부(135)는, 영상 부호화 장치(100)에 선택적으로 포함될 수 있다. 즉, 영상 부호화 장치(100)는, 잔차 블록의 잔차 데이터에 대해 변환 또는 양자화 중 적어도 하나를 수행하거나, 변환 및 양자화를 모두 스킵하여 잔차 블록을 부호화할 수 있다. 영상 부호화 장치(100)에서 변환 또는 양자화 중 어느 하나가 수행되지 않거나, 변환 및 양자화 모두 수행되지 않더라도, 엔트로피 부호화부(165)의 입력으로 들어가는 블록을 통상적으로 변환 블록이라 일컫는다.The transforming unit 130 and / or the quantizing unit 135 may be selectively included in the image encoding apparatus 100. That is, the image encoding apparatus 100 can perform at least one of conversion or quantization on the residual data of the residual block, or may skip both the conversion and the quantization, thereby encoding the residual block. A block entering the input of the entropy encoding unit 165 is generally referred to as a transform block even though either transformation or quantization is not performed in the image coding apparatus 100 or both transformation and quantization are not performed.

재정렬부(160)는 양자화된 잔차값에 대해 계수값의 재정렬을 수행할 수 있다.The reordering unit 160 can reorder the coefficient values with respect to the quantized residual values.

재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 소정의 스캔 타입을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. The reordering unit 160 may change the two-dimensional block type coefficient to a one-dimensional vector form through a coefficient scanning method. For example, the reordering unit 160 may scan a DC coefficient to a coefficient in the high frequency region using a predetermined scan type, and 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 encoding unit 165 receives the residual value count information of the encoding unit, the block type information, the prediction mode information, the division unit information, the prediction unit information and the transmission unit information, and the motion information of the motion unit from the reordering unit 160 and the prediction units 120 and 125 Vector information, reference frame information, interpolation information of a block, filtering information, and the like. In the entropy encoding unit 165, the coefficient of the transform block is encoded in units of partial blocks in the transform block by encoding a non-zero coefficient, a coefficient having an absolute value of 1 or larger than 2, . The coefficient that is not encoded with only the flag can be encoded through the absolute value of the difference between the coefficient encoded through the flag and the coefficient of the actual conversion block. A method of encoding the coefficients of the transform block will be described in detail with reference to FIG.

엔트로피 부호화부(165)에서는 재정렬부(160)에서 입력된 부호화 단위의 계수값을 엔트로피 부호화할 수 있다.The entropy encoding unit 165 can entropy-encode the coefficient value of the encoding unit input by the reordering unit 160. [

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

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

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

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

ALF(Adaptive Loop Filtering)는 필터링한 복원 영상과 원래의 영상을 비교한 값을 기초로 수행될 수 있다. 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행할 수 있다. ALF를 적용할지 여부에 관련된 정보는 휘도 신호는 부호화 단위(Coding Unit, CU) 별로 전송될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수는 달라질 수 있다. 또한, 적용 대상 블록의 특성에 상관없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다. Adaptive Loop Filtering (ALF) can be performed based on a comparison between 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 group may be determined and different filtering may be performed for each group. The information related to whether to apply the ALF may be transmitted for each coding unit (CU), and the shape and the filter coefficient of the ALF filter to be applied may be changed according to each block. Also, an ALF filter of the same type (fixed form) may be applied irrespective of the characteristics of the application target block.

메모리(155)는 필터부(150)를 통해 산출된 복원 블록 또는 픽쳐를 저장할 수 있고, 저장된 복원 블록 또는 픽쳐는 인터 예측을 수행 시 예측부(120, 125)에 제공될 수 있다.The memory 155 may store the reconstructed block or picture calculated through the filter unit 150 and the reconstructed block or picture stored therein may be provided to the predictor 120 or 125 when the 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)가 포함될 수 있다.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, 240, and a memory 245 may be included.

영상 부호화기에서 영상 비트스트림이 입력된 경우, 입력된 비트스트림은 영상 부호화기와 반대의 절차로 복호화될 수 있다.When an image bitstream is input in the image encoder, the input bitstream may be decoded in 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보다 큰 계수, 그리고 계수의 부호 등을 나타내는 여러 종류의 플래그를 기반으로 복호화될 수 있다. 상기 플래그만으로 표현되지 않는 계수는, 플래그를 통해 표현되는 계수와 시그날링된 계수의 합을 통해 복호화될 수 있다. 변환 블록의 계수를 복호화하는 방법은 도 5를 참조하여 자세히 살펴 보도록 한다.The entropy decoding unit 210 can perform entropy decoding in a procedure opposite to that in which entropy encoding is performed in 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 in accordance with the method performed by the image encoder. In the entropy decoding unit 210, the coefficient of the transform block is based on a plurality of types of flags indicating a non-zero coefficient, a coefficient having an absolute value of 1 or greater than 2, Lt; / RTI > A coefficient not represented by only the flag can be decoded through a sum of a coefficient represented by a flag and a signaled coefficient. A method of decoding the coefficients of the transform block will be described in detail with reference to FIG.

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

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

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

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

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

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

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

인트라 예측부(235)는 현재 픽쳐 내의 화소 정보를 기초로 예측 블록을 생성할 수 있다. 예측 단위가 인트라 예측을 수행한 예측 단위인 경우, 영상 부호화기에서 제공된 예측 단위의 인트라 예측 모드 정보를 기초로 인트라 예측을 수행할 수 있다. 인트라 예측부(235)에는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 부분으로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 결정하여 적용할 수 있다. 영상 부호화기에서 제공된 예측 단위의 예측 모드 및 AIS 필터 정보를 이용하여 현재 블록의 참조 화소에 AIS 필터링을 수행할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.The intra prediction unit 235 can generate a prediction block based on the pixel information in the current picture. If the prediction unit is a prediction unit that performs intra prediction, the intra prediction can be performed based on the intra prediction mode information of the prediction unit provided by the image encoder. The intraprediction unit 235 may include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolator, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block and can determine whether to apply the filter according to the prediction mode of the current prediction unit. The AIS filtering can be performed on the reference pixel of the current block using the prediction mode of the prediction unit provided in the image encoder and the AIS filter information. 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 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.The reference pixel interpolator may interpolate the reference pixels to generate reference pixels in units of pixels less than or equal to an integer value when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on pixel values obtained by interpolating reference pixels. The reference pixel may not be interpolated in the prediction mode in which the prediction mode of the current prediction unit generates the prediction block without interpolating the reference pixel. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is the DC mode.

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

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

ALF는 부호화기로부터 제공된 ALF 적용 여부 정보, ALF 계수 정보 등을 기초로 부호화 단위에 적용될 수 있다. 이러한 ALF 정보는 특정한 파라미터 셋에 포함되어 제공될 수 있다.The ALF can be applied to an encoding unit on the basis of ALF application information and ALF coefficient information provided from an encoder. Such ALF information may be provided in a specific set of parameters.

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

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

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

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

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

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

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

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

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

전술한 제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 first flag or the second flag may be at least one to at most (N * M). Alternatively, at least one of the first flag or the second flag may be a fixed number (e.g., one, two, or more) predefined in the image encoding apparatus. The number of the first and second flags may be determined based on a block size / depth, a segmentation technique (eg, a quad tree, a binary tree), a conversion technique (eg, DCT, DST), a conversion skip condition, a quantization parameter, Inter mode) and the like. In addition to the first / second flags, an n-th 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 the n-th flags may be one, two, or more, and may be determined in the same / similar manner as the first / second flags described above.

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

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

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

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

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

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

상기 임계값은, 상기 최소값을 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 set in the image encoding apparatus. The image encoding apparatus can determine the optimum threshold value in consideration of the encoding efficiency and encode the optimal 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 at a level of at least one of a sequence, a picture, a slice, and a transform block.

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

반면, 상기 QP가 소정의 QP 임계치보다 작은 경우, 변환 블록 내 넌-제로 계수의 분포가 많아질 것으로 예측할 수 있다. 이 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. On the other hand, when the QP is smaller than the predetermined QP threshold, it can be predicted that the distribution of the non-zero coefficients in the transform block becomes large. In this case, the range of the threshold can 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 can have the number and / or size (for example, maximum value) of the threshold values different 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 set in the image encoding apparatus. For example, the QP threshold may correspond to a median of a range of QPs available in the image encoding apparatus. Alternatively, the image encoding apparatus may determine an optimum QP threshold considering encoding efficiency, and encode the optimal QP threshold.

또는, 임계값의 범위는, 블록의 크기/형태에 따라 상이하게 결정될 수 있다. 여기서, 블록은 코딩 블록, 예측 블록, 변환 블록, 또는 부분 블록을 의미할 수 있다. 상기 크기는, 블록의 너비, 높이, 너비와 높이의 합, 또는 계수 개수 중 적어도 하나로 표현될 수 있다.Alternatively, the range of the threshold value may be determined differently depending on the size / shape of the block. Here, a 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 the width, height, sum of width and height, or number of coefficients.

예를 들어, 블록의 크기가 소정의 임계크기보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the size of the block is smaller than a predetermined threshold size, the threshold value range is determined as {3}, or the first threshold value flag encoding process is skipped, Can be encoded. On the other hand, when the size of the block is larger than the predetermined threshold size, the range of the threshold can be determined to be {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 the number and / or size (for example, maximum value) of the threshold values different from the threshold value range when the block size is large. The number of critical dimensions may be one, two, or more. The threshold size may be set in the image encoding apparatus. For example, the critical dimension is represented 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 the optimal threshold size in consideration of the encoding efficiency and encode the optimal threshold size.

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

예를 들어, 화소값 범위의 최대값과 최소값 간의 차이가, 소정의 임계 차이값보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1 임계값 플래그 부호화 과정을 생략하고, 전술한 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 the predetermined threshold difference value, the range of the threshold value is determined as {3}, or the first threshold value flag encoding process is omitted, The coefficient of the partial block can be encoded through steps S300 to S350. On the other hand, when the difference is larger than the predetermined threshold difference value, the range of the threshold value can be determined to be {3, 5} or {5, 3}.

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

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

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

상기 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 가산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, 상기 제1 임계값 플래그가 "참"으로 부호화될 때까지 반복적으로 수행될 수도 있다. 상기 업데이트된 현재 임계값을 기반으로, 전술한 S400 단계를 수행할 수 있다. 또는, 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is 1, 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 one. At this time, the update may be repeatedly performed until the first threshold value flag is encoded as "true ". Based on the updated current threshold value, step S400 may be performed. Alternatively, if the current threshold has reached the maximum value of the threshold, or if the number of thresholds is one, the updating process may end.

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

전술한 바와 같이, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 작음을 나타낼 수 있다. 반면, i번째 임계값에 대한 제1 임계값 플래그가 "거짓"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 크거나 같음을 나타낼 수 있다. 상기 "참"인 제1 임계값 플래그를 기반으로, 부분 블록에 속한 계수 값의 범위를 특정할 수 있다. 즉, i번째 임계값에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록에 속한 계수는 0 내지 (i번째 임계값-1) 범위에 속할 수 있다.As described above, when the first threshold flag for the i-th threshold is "true", this may indicate that the absolute value of all coefficients in the partial block is smaller than the i-th threshold. On the other hand, if the first threshold flag for the i-th threshold is "false", this may indicate that the absolute value of all coefficients in the partial block is greater than or equal to the i-th threshold. Based on the first threshold flag that is "true ", a range of the coefficient value belonging to the partial block can be specified. That is, when the first threshold value flag for the i-th threshold value is "true ", the coefficient belonging to the partial block may fall within 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 steps S300 to S350 described above 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 is {3, 5}, at least one of the first threshold flag for the threshold value "3 " or the first threshold flag for the threshold value" 5 & . When the first threshold value flag for the threshold value "3 " is" true ", the absolute value of all the coefficients in the partial block may fall within the range of 0 to 2. In this case, the coefficient of the partial block is encoded by performing the remaining steps except at least one of the steps of S330 or S340 described above, or the coefficients of the partial block are encoded by performing the remaining steps except S300, S330, or S340 It is possible.

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

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

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

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

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

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

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

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

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

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

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

전술한 제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 first flag or the second flag may be at least one to at most (N * M). Alternatively, at least one of the first flag or the second flag may be a fixed number (e.g., one, two, or more) predefined in the image decoding apparatus. The number of the first and second flags may be determined based on a block size / depth, a segmentation technique (eg, a quad tree, a binary tree), a conversion technique (eg, DCT, DST), a conversion skip condition, a quantization parameter, Inter mode) and the like. In addition to the first / second flags, an n-th flag indicating whether the absolute value of the coefficient is greater than n may be additionally decoded. Here, n may mean a natural number greater than 2. The number of the n-th flags may be one, two, or more, and may be determined in the same / similar manner as the first / second flags described above.

상기 현재 부분 블록 내에, 상기 제1/제2 플래그를 기반으로 복호화되지 않은 나머지 계수를 복호화할 수 있다(S540). 여기서, 상기 복호화는 계수값 자체를 복호화하는 과정일 수 있다. 상기 나머지 계수는 2와 같거나 클 수 있다. 상기 나머지 계수는, 상기 나머지 계수에 대한 부분 블록 계수 플래그, 제1 플래그 또는 제2 플래그 중 적어도 하나를 기반으로 복호화될 수 있다. 예를 들어, 상기 나머지 계수는, (부분 블록 계수 플래그+제1 플래그+제2 플래그+시그날링된 계수)로 유도될 수 있다.In step S540, the decoded residual coefficients may be decoded based on the first / second flags in the current partial block. Here, the decoding may be a process of decoding the coefficient value itself. The remaining coefficients may be equal to or greater than two. The residual coefficient may be decoded based on at least one of a partial block coefficient flag, a first flag or 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)를 복호화할 수 있다(S550). 상기 부호는, 계수 단위로, 플래그 형태로 복호화될 수 있다. 상기 부호는, 전술한 부분 블록 계수 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 상기 부호는, 상기 계수가 넌-제로 계수인 경우(즉, 상기 부분 블록 계수 플래그가 제1 값인 경우)에만 복호화될 수 있다.A sign for the coefficient of the partial block can be decoded (S550). The code can be decoded in the form of a flag in units of coefficients. The code can be selectively decoded according to the value of the partial block coefficient flag described above. For example, the code may be decoded only when the coefficient is a non-zero coefficient (i.e., the partial block coefficient flag is a first value).

한편, 전술한 부분 블록의 계수 복호화는, 부분 블록에 속한 계수 값의 범위를 특정하는 과정을 더 수반할 수 있다. 상기 과정을 통해, 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부도 확인할 수 있다. 상기 과정은, 후술할 제1 임계값 플래그의 복호화를 통해 수행될 수 있다. 상기 과정은, 전술한 S500 내지 S550 단계 중 어느 하나에 포함되어 수행될 수도 있고, S500 내지 S550 단계 중 적어도 하나와 대체되는 형태로 수행될 수도 있다. 이하, 도 6을 참조하여, 부분 블록에 속한 계수 값의 범위를 특정하는 과정에 대해서 자세히 살펴 보기로 한다.On the other hand, the coefficient decoding of the partial block described above may further involve a process of specifying a range of the coefficient values belonging to the partial block. Through the above process, it can also be confirmed whether or not at least one non-zero coefficient exists in the partial block. The above process can be performed by decoding the first threshold value flag to be described later. The above process may be performed in any one of steps S500 to S550, or may be performed in a form that is substituted for at least one of steps S500 to S550. Hereinafter, the process of specifying the range of the coefficient values belonging to the partial block will be described in detail with reference to FIG.

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

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

예를 들어, 상기 QP가 소정의 QP 임계치보다 큰 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1 임계값 플래그 복호화 과정을 생략하고, 전술한 S500 내지 S550 단계를 통해 부분 블록의 계수를 복호화할 수 있다.For example, if the QP is larger than a predetermined QP threshold, the threshold value range is determined as {3}, or the first threshold value flag decoding process is skipped, The coefficient can be decoded.

반면, 상기 QP가 소정의 QP 임계치보다 작은 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. On the other hand, when the QP is smaller than the predetermined QP threshold, the range of the threshold can be determined as {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 can have the number and / or size (for example, maximum value) of the threshold values different 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 set in the video decoding apparatus. For example, the QP threshold may correspond to a median of a range of QP available in the video 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 depending on the size / shape of the block. Here, a 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 the width, height, sum of width and height, or number of coefficients.

예를 들어, 블록의 크기가 소정의 임계크기보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1 임계값 플래그 복호화 과정을 생략하고, 전술한 S500 내지 S550 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, if the block size is smaller than the predetermined threshold size, the threshold value range is determined as {3}, or the first threshold value flag decoding process is skipped, Can be decoded. On the other hand, when the size of the block is larger than the predetermined threshold size, the range of the threshold can be determined to be {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 the number and / or size (for example, maximum value) of the threshold values different from the threshold value range when the block size is large. The number of critical dimensions may be one, two, or more. The threshold size may be set in the image decoding apparatus. For example, the critical dimension is represented 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 a critical size signaled by the image encoding apparatus.

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

예를 들어, 화소값 범위의 최대값과 최소값 간의 차이가, 소정의 임계 차이값보다 작은 경우, 임계값의 범위를 {3}으로 결정하거나, 상기 제1 임계값 플래그 복호화 과정을 생략하고, 전술한 S500 내지 S550 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 상기 차이가 소정의 임계 차이값보다 큰 경우, 임계값의 범위를 {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 the predetermined threshold difference value, the range of the threshold value is determined as {3}, or the first threshold value flag decoding process is omitted, The coefficients of the partial block may be decoded through steps S500 to S550. On the other hand, when the difference is larger than the predetermined threshold difference value, the range of the threshold value can be determined to be {3, 5} or {5, 3}.

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

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

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

만일, 상기 제1 임계값 플래그가 "거짓"인 경우, 상기 현재 임계값(i번째 임계값)은 다음 임계값((i+1)번째 임계값)으로 업데이트되고(S610), 업데이트된 현재 임계값을 기반으로, 전술한 S600 단계를 수행할 수 있다.If the first threshold flag is "False ", the current threshold value (i-th threshold value) is updated to the next threshold value (i + 1) th threshold value (S610) The above-described step S600 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 1, 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 one. At this time, the update may be repeatedly performed until the first threshold flag "true" is decoded. Alternatively, if the current threshold has reached the maximum value of the threshold, or if the number of thresholds is one, the updating process may end.

도 6에 도시된 바와 같이, 상기 제1 임계값 플래그가 "참"인 경우, 제1 임계값 플래그에 대한 복호화는 더 이상 수행되지 않을 수 있다.As shown in FIG. 6, when the first threshold flag is "TRUE ", decryption for the first threshold 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 flag for the i-th threshold is "true", this may indicate that the absolute value of all coefficients in the partial block is smaller than the i-th threshold. On the other hand, if the first threshold flag for the i-th threshold is "false", this may indicate that the absolute value of all coefficients in the partial block is greater than or equal to the i-th threshold. Based on the first threshold flag that is "true ", a range of the coefficient value belonging to the partial block can be specified. That is, when the first threshold value flag for the i-th threshold value is "true ", the coefficient belonging to the partial block may fall within the range of 0 to (i-th threshold value -1).

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

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

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

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

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

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

본 실시예에서는, 변환 블록(700)은 8x8이고, 부분 블록이 4x4이며, 최초 넌-제로 계수를 포함한 블록은 720이며, 변환 블록의 부분 블록은 스캔 타입에 따라 740, 720, 730, 710의 순서로 부호화/복호화됨을 가정한다.In this embodiment, the transform block 700 is 8x8, the partial block is 4x4, the block including the initial non-zero coefficient is 720, and the partial block of the transform block is 740, 720, 730, 710 Are encoded / decoded in this order.

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

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

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

이하, 변환 블록의 부분 블록을 결정하는 방법에 대해서 자세히 살펴 보도록 한다.Hereinafter, a method for determining a partial block of a transform block will be described in detail.

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

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

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

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

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

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

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

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

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

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

예를 들어, 상기 일부 영역은, DC 성분이 집중된 영역의 부분 블록 1개 또는 인접 부분 블록을 포함한 N개(N≥1)의 부분 블록일 수 있다. 또는, 상기 일부 영역은, 변환 블록의 상단 경계의 1/n 지점을 지나가는 수직 라인 및/또는 변환 블록의 좌측 경계의 1/m 지점을 지나가는 수평 라인에 의해서 특정될 수 있다. 상기 n과 m은 자연수이며, 서로 동일하거나 상이할 수 있다.For example, the partial area may be N partial blocks (N > / = 1) including one partial block or adjacent partial blocks in the area where DC components are concentrated. Alternatively, the partial area may be specified by a vertical line passing a 1 / n point of the upper boundary of the conversion block and / or a horizontal line passing 1 / m point of the left boundary of the conversion block. And n and m are natural numbers and may be the same 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 set in the image encoding apparatus. For example, the QP threshold may correspond to a median of a range of QPs available in the image encoding / decoding apparatus. Alternatively, the image encoding apparatus may determine an optimum QP threshold considering encoding efficiency, and encode the optimal QP threshold.

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

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

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

상기 임계크기의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계크기는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 임계크기는 cxd로 표현되며, 여기서 c와 d는 2, 4, 8, 16, 32, 64 또는 그 이상이고, c와 d는 동일하거나 상이할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 임계크기를 결정하고, 이를 부호화할 수도 있다.The number of critical dimensions may be one, two, or more. The threshold size may be set 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 the optimal threshold size in consideration of the encoding efficiency and encode the optimal threshold size.

이하, 도 9 내지 도 14를 참조하여, 전술한 부분 블록 계수 플래그를 효율적으로 부호화/복호화하는 방법에 대해서 살펴보도록 한다.Hereinafter, a method for efficiently encoding / decoding the partial block coefficient flag will be described with reference to FIG. 9 through FIG.

주파수 도메인에서, 변환 블록 내 DC 성분 영역은 부분 블록 계수 플래그가 "1"로 결정될 확률이 높고, 반대로 AC 성분 영역은 부분 블록 계수 플래그가 "0"으로 결정될 확률이 높다. 이러한 통계적 특성을 고려하여, 부분 블록 계수 플래그를 부호화할 수 있다.In the frequency domain, the DC component region in the transform block has a high probability that the partial block coefficient flag is determined to be "1 ", and conversely, the AC component region has a high probability that the partial block coefficient flag is determined to be" 0 ". In consideration of such statistical characteristics, the partial block coefficient flag can be encoded.

도 9는 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그를 부호화하는 방법을 도시한 것이다.9 is a diagram illustrating a method of encoding a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment of the present invention.

먼저, 현재 부분 블록의 계수에 대해서 부분 블록 계수 플래그를 부호화할 수 있다. 즉, 상기 계수가 넌-제로 계수인 경우, 상기 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화하고, 상기 계수가 0인 경우, 상기 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화할 수 있다. 상기 부분 블록 계수 플래그는 현재 부분 블록에 속한 계수 별로 부호화되며, 전술한 과정을 통해 현재 부분 블록에 속한 넌-제로 계수의 개수를 결정할 수 있다. 상기 현재 부분 블록 내 넌-제로 계수의 개수를 기반으로 다음 부분 블록의 부분 블록 계수 플래그를 부호화할 수 있다.First, the partial block coefficient flag can be encoded for the coefficient of the current partial block. That is, when the coefficient is a non-zero coefficient, the partial block coefficient flag is encoded with a first value (e.g., "1"), and when the coefficient is 0, (For example, "0"). The partial block coefficient flag is encoded for each coefficient belonging to the current partial block, and the number of non-zero coefficients belonging to the current partial block can be determined through the above-described process. The partial block coefficient flag of the next partial block may be encoded based on the number of non-zero coefficients in the current partial block.

도 9를 참조하면, 상기 현재 부분 블록 내 넌-제로 계수의 개수와 소정의 임계치(이하, NZ 개수라 함)를 비교할 수 있다(S900). 여기서, NZ 개수는 영상 부호화 장치에 기-약속된 고정된 개수일 수도 있고, 변환 블록 및/또는 부분 블록의 크기에 기초하여 가변적으로 결정될 수도 있다. 예를 들어, 부분 블록이 NxN인 경우, 상기 부분 블록은 (N*N)개의 계수를 포함하며, 이때 상기 NZ 개수는 (N*N)/2의 값으로 결정될 수 있다.Referring to FIG. 9, the number of non-zero coefficients in the current partial block may be compared with a predetermined threshold value (hereinafter referred to as NZ number) (S900). Here, the number of NZs may be a fixed number pre-assigned to the image encoding apparatus and may be variably determined based on the size of the transform block and / or the partial block. For example, if the partial block is NxN, then the partial block includes (N * N) coefficients, where the number of NZs can be determined to be (N * N) / 2.

상기 S900 단계의 비교 결과에 기초하여, 다음 부분 블록의 계수에 대한 부분 블록 계수 플래그를 부호화할 수 있다(S910). 여기서, 다음 부분 블록은, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 현재 부분 블록 다음에 부호화되는 부분 블록을 의미할 수 있다. Based on the comparison result of step S900, the partial block coefficient flag for the coefficient of the next partial block can be encoded (S910). Here, the next partial block may be a partial block to be coded next to the current partial block according to the coding order (or the order according to the scan type).

예를 들어, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 큰 경우, 상기 다음 부분 블록의 부분 블록 계수 플래그는 상기 현재 부분 블록의 부분 블록 계수 플래그와는 다른 의미로 부호화될 수 있다. 즉, 다음 부분 블록에서, 계수가 넌-제로 계수인 경우, 상기 계수의 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화하고, 상기 계수가 0인 경우, 상기 계수의 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화할 수 있다.For example, if the number of non-zero coefficients in the current partial block is greater than the number of NZ, the partial block coefficient flag of the next partial block may be encoded in a different meaning from the partial block coefficient flag of the current partial block . That is, in the next partial block, if the coefficient is a non-zero coefficient, the partial block coefficient flag of the coefficient is encoded into a second value (e.g., "0"), and when the coefficient is 0, The partial block coefficient flag can be encoded into the first value (e.g., "1").

반면, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 다음 부분 블록의 부분 블록 계수 플래그는 상기 현재 부분 블록의 부분 블록 계수 플래그와 동일한 의미로 부호화될 수 있다. 즉, 다음 부분 블록에서, 계수가 넌-제로 계수인 경우, 상기 계수의 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화하고, 상기 계수가 0인 경우, 상기 계수의 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화할 수 있다.On the other hand, when the number of non-zero coefficients in the current partial block is smaller than the number of NZ, the partial block coefficient flag of the next partial block can be encoded in the same meaning as the partial block coefficient flag of the current partial block. That is, in the next partial block, if the coefficient is a non-zero coefficient, the partial block coefficient flag of the coefficient is encoded into a first value (for example, "1"), and when the coefficient is 0, The partial block coefficient flag can be encoded into a second value (e.g., "0").

전술한 부호화 방식은, 변환 블록 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 부분 블록이 변환 블록 내에서 마지막 부호화 순서를 가진 부분 블록에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 부분 블록과 상기 다음 부분 블록이 상이한 변환 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다. The encoding method described above can be performed on a conversion block basis. For example, the coding scheme may be limited to be performed only until the next partial block reaches a partial block having the last coding order in the transform block. However, the present invention is not limited to this, and the same partial block and the next partial block belong to different conversion blocks.

상기 부분 블록 계수 플래그가 전술한 방식으로 부호화되는 경우, 영상 복호화 장치는, 현재 부분 블록에 대한 부호화된 부분 블록 계수 플래그 또는 이전 부분 블록 내 넌-제로 계수의 개수 중 적어도 하나를 기반으로, 현재 부분 블록의 계수가 넌-제로 계수인지 여부를 결정할 수 있다. When the partial block coefficient flag is coded in the above-described manner, the video decoding apparatus calculates, based on at least one of the number of the encoded partial block coefficient flag for the current partial block or the number of the non-zero coefficients in the previous partial block, It is possible to determine whether the coefficient of the block is a non-zero coefficient.

예를 들어, 현재 부분 블록의 계수에 대한 부분 블록 계수 플래그가 제1 값인 경우, 상기 계수는 넌-제로 계수로 결정되고, 상기 부분 블록 계수 플래그가 제2 값인 경우, 상기 계수는 0으로 결정될 수 있다. For example, when the partial block coefficient flag for the coefficient of the current partial block is the first value, the coefficient is determined as a non-zero coefficient, and when the partial block coefficient flag is the second value, the coefficient may be determined as zero have.

이때, 이전 부분 블록 내 넌-제로 계수의 개수를 더 고려하여, 상기 계수가 넌-제로 계수인지 여부를 최종 결정할 수도 있다. 만일, 이전 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 큰 경우, 제1 값인 부분 블록 계수 플래그를 가진 계수는 0으로 결정되고, 제2 값인 부분 블록 계수 플래그를 가진 계수는 넌-제로 계수로 결정될 수 있다. 반면, 이전 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 작은 경우에는 넌-제로 계수인지에 대한 최초 결정이 그대로 유지될 수 있다.At this time, considering the number of non-zero coefficients in the previous partial block, it may be finally determined whether or not the coefficient is a non-zero coefficient. If the number of non-zero coefficients in the previous partial block is larger than the number of NZ, a coefficient having a partial block coefficient flag as a first value is determined as 0, a coefficient having a partial block coefficient flag as a second value is determined as a non-zero coefficient . ≪ / RTI > On the other hand, if the number of non-zero coefficients in the previous partial block is smaller than the number of NZ, the initial determination of whether it is a non-zero coefficient can be maintained.

또한, 상기 현재 부분 블록이 참조하는 이전 부분 블록은, 상기 현재 부분 블록과 동일한 변환 블록에 속하는 것으로 제한될 수 있다. 다만, 이에 한정되지 아니하며, 현재 부분 블록은 다른 변환 블록에 속한 부분 블록을 참조하여, 부분 블록 계수 플래그를 복호화할 수도 있다.Also, the previous partial block referred to by the current partial block may be restricted to belong to the same transform block as the current partial block. However, the present invention is not limited to this, and the current partial block may refer to the partial block belonging to another transform block and decode the partial block coefficient flag.

도 10은 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.10 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment of the present invention.

영상 부호화 장치는, 현재 부분 블록의 계수가 넌-제로 계수인지 여부에 따라 소정의 값으로 부분 블록 계수 플래그를 부호화할 수 있다. 즉, 상기 계수가 넌-제로 계수인 경우, 상기 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화하고, 상기 계수가 0인 경우, 상기 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화할 수 있다. 또한, 상기 현재 부분 블록 내 넌-제로 계수의 개수를 기반으로, 다음 부분 블록의 부분 블록 계수 플래그의 확률 정보를 변경할 수도 있다. 이하, 설명의 편의를 위해, 부분 블록 계수 플래그는 CABAC 정규 코딩 방법에 기반하여 부호화/복호화됨을 가정한다.The image encoding apparatus can encode the partial block coefficient flag to a predetermined value according to whether the coefficient of the current partial block is a non-zero coefficient. That is, when the coefficient is a non-zero coefficient, the partial block coefficient flag is encoded with a first value (e.g., "1"), and when the coefficient is 0, (For example, "0"). Further, based on the number of non-zero coefficients in the current partial block, the probability information of the partial block coefficient flag of the next partial block may be changed. Hereinafter, for convenience of explanation, it is assumed that the partial block coefficient flag is encoded / decoded based on the CABAC regular coding method.

도 10을 참조하면, 상기 현재 부분 블록 내 넌-제로 계수의 개수와 소정의 임계치(이하, NZ 개수라 함)를 비교할 수 있다(S1000). 여기서, NZ 개수는 도 9의 실시예에서 살펴본 바와 같으며, 자세한 설명은 생략하기로 한다.Referring to FIG. 10, the number of non-zero coefficients in the current partial block may be compared with a predetermined threshold value (hereinafter referred to as NZ number) (S1000). Here, the number of NZ is as shown in the embodiment of FIG. 9, and a detailed description thereof will be omitted.

상기 S1000 단계의 비교 결과에 기초하여, 다음 부분 블록의 계수에 대한 부분 블록 계수 플래그의 확률 정보를 변경할 수 있다(S1010). 여기서, 다음 부분 블록은, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 현재 부분 블록 다음에 부호화되는 부분 블록을 의미할 수 있다. 상기 확률 정보는, 영상 부호화/복호화 장치에 기-설정된 확률 테이블, 영상 부호화/복호화 장치에서 유도되는 확률값, 확률을 산출하기 위한 변수 등을 의미할 수 있다.Based on the comparison result in step S1000, the probability information of the partial block coefficient flag for the coefficient of the next partial block can be changed (S1010). Here, the next partial block may be a partial block to be coded next to the current partial block according to the coding order (or the order according to the scan type). The probability information may be a probability table preliminarily set in the image encoding / decoding device, a probability value derived from the image encoding / decoding device, a variable for calculating probability, and the like.

예를 들어, 상기 다음 부분 블록의 부분 블록 계수 플래그 부호화시, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 큰 경우, 상기 다음 부분 블록의 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꿀 수 있다. 반면, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꾸지 않을 수 있다.For example, in the partial block coefficient flag encoding of the next partial block, if the number of non-zero coefficients in the current partial block is larger than the number of NZ, "0" is generated for the partial block coefficient flag of the next partial block The probability information and the probability information of occurrence of "1 " can be exchanged with each other. On the other hand, when the number of non-zero coefficients in the current partial block is smaller than the number of NZ, the probability information for generating "0" and the probability information for generating "1 "

전술한 부호화 방식은, 변환 블록 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 부분 블록이 변환 블록 내에서 마지막 부호화 순서를 가진 부분 블록에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 부분 블록과 상기 다음 부분 블록이 상이한 변환 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다.The encoding method described above can be performed on a conversion block basis. For example, the coding scheme may be limited to be performed only until the next partial block reaches a partial block having the last coding order in the transform block. However, the present invention is not limited to this, and the same partial block and the next partial block belong to different conversion blocks.

상기 부분 블록 계수 플래그가 전술한 방식으로 부호화되는 경우, 영상 복호화 장치는, 이전 부분 블록 내 넌-제로 계수의 개수를 기반으로, 현재 부분 블록의 부분 블록 계수 플래그를 복호화할 수 있다.When the partial block coefficient flag is coded in the above-described manner, the video decoding apparatus can decode the partial block coefficient flag of the current partial block based on the number of non-zero coefficients in the previous partial block.

구체적으로, 이전 부분 블록 내 넌-제로 계수의 개수와 NZ 개수의 비교 결과에 기초하여 현재 부분 블록의 부분 블록 계수 플래그에 관한 확률 정보를 변경하고, 변경된 확률 정보를 기반으로 부분 블록 계수 플래그를 복호화할 수 있다.Specifically, the probability information on the partial block coefficient flag of the current partial block is changed based on the comparison result of the number of NZ coefficients and the number of non-zero coefficients in the previous partial block, and the partial block coefficient flag is decoded can do.

예를 들어, 이전 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 큰 경우, 상기 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꿀 수 있다. 반면, 이전 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꾸지 않을 수 있다.For example, when the number of non-zero coefficients in the previous partial block is larger than the number of NZ, the probability information for generating "0" and the probability information for generating "1 " On the other hand, when the number of non-zero coefficients in the previous partial block is smaller than the number of NZ, the probability information for generating "0" and the probability information for generating "1 "

또한, 상기 현재 부분 블록이 참조하는 이전 부분 블록은, 상기 현재 부분 블록과 동일한 변환 블록에 속하는 것으로 제한될 수 있다. 다만, 이에 한정되지 아니하며, 현재 부분 블록은 다른 변환 블록에 속한 부분 블록을 참조하여, 부분 블록 계수 플래그를 복호화할 수도 있다.Also, the previous partial block referred to by the current partial block may be restricted to belong to the same transform block as the current partial block. However, the present invention is not limited to this, and the current partial block may refer to the partial block belonging to another transform block and decode the partial block coefficient flag.

도 11은 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그를 부호화하는 방법을 도시한 것이다.11 is a diagram illustrating a method of encoding a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.

도 11을 참조하면, 현재 부분 블록 내에서 현재 계수까지의 넌-제로 계수의 개수와 NZ 개수를 비교할 수 있다(S1100). 상기 현재 계수까지의 넌-제로 계수의 개수는, 계수의 부호화 순서(또는 스캔 타입에 따른 순서)에 따라 산출될 수 있다. 상기 NZ 개수는 도 9의 실시예에서 살펴본 바와 같으며, 자세한 설명은 생략하기로 한다.Referring to FIG. 11, the number of non-zero coefficients up to the current coefficient in the current partial block can be compared with the number of NZs (S1100). The number of non-zero coefficients up to the current coefficient can be calculated according to the encoding order of the coefficients (or the order according to the scan type). The number of NZs is as shown in the embodiment of FIG. 9, and a detailed description thereof will be omitted.

상기 S1100 단계의 비교 결과에 기초하여, 다음 계수에 대한 부분 블록 계수 플래그를 부호화할 수 있다(S1110). 여기서, 다음 계수는, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 상기 현재 계수 다음에 부호화되는 계수를 의미할 수 있다.Based on the comparison result of step S1100, the partial block coefficient flag for the next coefficient can be encoded (S1110). Here, the next coefficient may mean a coefficient to be encoded next to the current coefficient according to the encoding order (or the order according to the scan type).

예를 들어, 상기 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 크거나 같은 경우, 상기 다음 계수의 부분 블록 계수 플래그는 상기 현재 계수의 부분 블록 계수 플래그와는 다른 의미로 부호화될 수 있다. 즉, 상기 다음 계수가 넌-제로 계수인 경우, 상기 다음 계수의 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화하고, 상기 다음 계수가 0인 경우, 상기 다음 계수의 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화할 수 있다.For example, when the number of non-zero coefficients up to the current coefficient is greater than or equal to the number of NZs, the partial block coefficient flag of the next coefficient may be encoded in a different meaning from the partial block coefficient flag of the current coefficient . That is, if the next coefficient is a non-zero coefficient, the partial block coefficient flag of the next coefficient is encoded to a second value (e.g., "0"), and if the next coefficient is 0, The partial block coefficient flag can be encoded into the first value (e.g., "1").

반면, 상기 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 다음 계수의 부분 블록 계수 플래그는 상기 현재 계수의 부분 블록 계수 플래그와 동일한 의미로 부호화될 수 있다. 즉, 다음 계수가 넌-제로 계수인 경우, 상기 다음 계수의 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화하고, 상기 다음 계수가 0인 경우, 상기 다음 계수의 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화할 수 있다.On the other hand, when the number of non-zero coefficients up to the current coefficient is smaller than the number of NZ, the partial block coefficient flag of the next coefficient can be encoded in the same meaning as the partial block coefficient flag of the current coefficient. That is, if the next coefficient is a non-zero coefficient, the partial block coefficient flag of the next coefficient is encoded with a first value (for example, "1"), and when the next coefficient is 0, The block coefficient flag can be encoded to a second value (e.g., "0").

전술한 부호화 방식은, 변환 블록 또는 부분 블록의 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 계수가 변환 블록 또는 부분 블록 내에서 마지막 부호화 순서를 가진 계수에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 계수와 상기 다음 계수가 상이한 변환 블록 또는 상이한 부분 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다.The encoding method described above can be performed in units of a conversion block or a partial block. For example, the coding scheme may be constrained to be performed only until the next coefficient reaches a coefficient having the last coding order in the transform block or partial block. However, the present invention is not limited to this, and the same coefficient may be performed in the same or similar manner even when the current coefficient and the next coefficient belong to different conversion blocks or different partial blocks.

상기 부분 블록 계수 플래그가 전술한 방식으로 부호화되는 경우, 영상 복호화 장치는, 현재 계수에 대한 부호화된 부분 블록 계수 플래그 또는 이전 계수까지의 넌-제로 계수의 개수 중 적어도 하나를 기반으로, 현재 계수가 넌-제로 계수인지 여부를 결정할 수 있다.When the partial block coefficient flag is coded in the above-described manner, the video decoding apparatus calculates a partial block coefficient flag based on at least one of the encoded partial block coefficient flag for the current coefficient or the number of non-zero coefficients up to the previous coefficient, You can decide whether you are a nonzero coefficient.

예를 들어, 현재 계수에 대한 부분 블록 계수 플래그가 제1 값인 경우, 상기 현재 계수는 넌-제로 계수로 결정되고, 상기 부분 블록 계수 플래그가 제2 값인 경우, 상기 현재 계수는 0으로 결정될 수 있다.For example, if the partial block coefficient flag for the current coefficient is a first value, the current coefficient is determined as a non-zero coefficient, and if the partial block coefficient flag is a second value, the current coefficient may be determined as zero .

이때, 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수를 더 고려하여, 상기 현재 계수가 넌-제로 계수인지 여부를 최종 결정할 수도 있다. 만일, 이전 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 크거나 같은 경우, 제1 값인 부분 블록 계수 플래그를 가진 현재 계수는 0으로 결정되고, 제2 값인 부분 블록 계수 플래그를 가진 현재 계수는 넌-제로 계수로 결정될 수 있다. 반면, 이전 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 작은 경우에는 넌-제로 계수인지에 대한 최초 결정이 그대로 유지될 수 있다.At this time, considering the number of non-zero coefficients up to the previous coefficient in the current partial block, it may be finally determined whether the current coefficient is a non-zero coefficient. If the number of non-zero coefficients up to the previous coefficient is greater than or equal to the number of NZs, the current coefficient having the partial block coefficient flag as the first value is determined as 0, and the current coefficient having the partial block coefficient flag as the second value The non-zero coefficient can be determined. On the other hand, if the number of non-zero coefficients up to the previous coefficient is less than the number of NZ, then the initial determination of whether it is a non-zero coefficient can be maintained.

또한, 상기 현재 계수가 참조하는 이전 계수는, 상기 현재 계수와 동일한 부분 블록에 속하는 것으로 제한될 수 있다. 다만, 이에 한정되지 아니하며, 현재 계수는 다른 부분 블록 또는 다른 변환 블록에 속한 계수를 참조하는 것도 가능하다.Also, the previous coefficient referenced by the current coefficient may be limited to belonging to the same partial block as the current coefficient. However, the present invention is not limited to this, and it is also possible to refer to a coefficient belonging to another partial block or another transform block.

도 12는 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.FIG. 12 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.

영상 부호화 장치는, 현재 부분 블록의 계수가 넌-제로 계수인지 여부에 따라 소정의 값으로 부분 블록 계수 플래그를 부호화할 수 있다. 즉, 상기 계수가 넌-제로 계수인 경우, 상기 부분 블록 계수 플래그를 제1 값(예를 들어, "1")으로 부호화하고, 상기 계수가 0인 경우, 상기 부분 블록 계수 플래그를 제2 값(예를 들어, "0")으로 부호화할 수 있다. 이때, 상기 현재 부분 블록 내에서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로, 다음 계수의 부분 블록 계수 플래그의 확률 정보를 변경할 수도 있다. 이하, 설명의 편의를 위해, 부분 블록 계수 플래그는 CABAC 정규 코딩 방법에 기반하여 부호화/복호화됨을 가정한다.The image encoding apparatus can encode the partial block coefficient flag to a predetermined value according to whether the coefficient of the current partial block is a non-zero coefficient. That is, when the coefficient is a non-zero coefficient, the partial block coefficient flag is encoded with a first value (e.g., "1"), and when the coefficient is 0, (For example, "0"). At this time, within the current partial block, the probability information of the partial block coefficient flag of the next coefficient may be changed based on the number of non-zero coefficients up to the current coefficient. Hereinafter, for convenience of explanation, it is assumed that the partial block coefficient flag is encoded / decoded based on the CABAC regular coding method.

도 12를 참조하면, 상기 현재 부분 블록 내에서 현재 계수까지의 넌-제로 계수의 개수와 NZ 개수를 비교할 수 있다(S1200). 상기 현재 계수까지의 넌-제로 계수의 개수는, 계수의 부호화 순서(또는 스캔 타입에 따른 순서)에 따라 산출될 수 있다. 상기 NZ 개수는 도 9의 실시예에서 살펴본 바와 같으며, 자세한 설명은 생략하기로 한다.Referring to FIG. 12, the number of non-zero coefficients up to the current coefficient in the current partial block may be compared with the number of NZs (S1200). The number of non-zero coefficients up to the current coefficient can be calculated according to the encoding order of the coefficients (or the order according to the scan type). The number of NZs is as shown in the embodiment of FIG. 9, and a detailed description thereof will be omitted.

상기 S1200 단계의 비교 결과에 기초하여, 다음 계수에 대한 부분 블록 계수 플래그의 확률 정보를 변경할 수 있다(S1210). 여기서, 다음 계수는, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 상기 현재 계수 다음에 부호화되는 계수를 의미할 수 있다. 상기 확률 정보는, 영상 부호화/복호화 장치에 기-설정된 확률 테이블, 영상 부호화/복호화 장치에서 유도되는 확률값, 확률을 산출하기 위한 변수 등을 의미할 수 있다.Based on the comparison result of step S1200, the probability information of the partial block coefficient flag for the next coefficient can be changed (S1210). Here, the next coefficient may mean a coefficient to be encoded next to the current coefficient according to the encoding order (or the order according to the scan type). The probability information may be a probability table preliminarily set in the image encoding / decoding device, a probability value derived from the image encoding / decoding device, a variable for calculating probability, and the like.

예를 들어, 상기 다음 계수의 부분 블록 계수 플래그 부호화시, 상기 현재 부분 블록 내에서 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 크거나 같은 경우, 상기 다음 계수의 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꿀 수 있다. 반면, 상기 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 다음 계수의 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꾸지 않을 수 있다.For example, when coding the partial block coefficient flag of the next coefficient, if the number of non-zero coefficients from the current partial block to the current coefficient is greater than or equal to the number of NZs, Quot; 0 "and the probability information of occurrence of" 1 " can be exchanged with each other. On the other hand, when the number of non-zero coefficients up to the current coefficient is smaller than the number of NZ, the probability information for generating "0" for the partial block coefficient flag of the next coefficient and the probability information for generating & have.

전술한 부호화 방식은, 부분 블록 또는 변환 블록의 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 계수가 부분 블록 또는 변환 블록 내에서 마지막 부호화 순서를 가진 계수에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 계수와 상기 다음 계수가 상이한 부분 블록 또는 상이한 변환 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다.The encoding method described above can be performed in units of a partial block or a transform block. For example, the coding scheme may be constrained to be performed only until the next coefficient reaches a coefficient with the last coding order in the partial block or transform block. However, the present invention is not limited to this, and the same coefficient can be performed in the same or similar manner even when the current coefficient and the next coefficient belong to a partial block or a different transform block which are different from each other.

상기 부분 블록 계수 플래그가 전술한 방식으로 부호화되는 경우, 영상 복호화 장치는, 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수를 기반으로, 현재 부분 블록의 부분 블록 계수 플래그를 복호화할 수 있다.When the partial block coefficient flag is coded in the above-described manner, the video decoding apparatus can decode the partial block coefficient flag of the current partial block based on the number of non-zero coefficients up to the previous coefficient in the current partial block have.

구체적으로, 상기 이전 계수까지의 넌-제로 계수의 개수와 NZ 개수의 비교 결과에 기초하여, 현재 계수의 부분 블록 계수 플래그에 관한 확률 정보를 변경하고, 변경된 확률 정보를 기반으로 부분 블록 계수 플래그를 복호화할 수 있다.Specifically, based on the comparison result of the number of non-zero coefficients up to the previous coefficient and the number of NZ, the probability information on the partial block coefficient flag of the current coefficient is changed, and the partial block coefficient flag It can be decoded.

예를 들어, 상기 이전 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 크거나 같은 경우, 상기 현재 계수의 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꿀 수 있다. 반면, 상기 이전 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 현재 계수의 부분 블록 계수 플래그에 대해서 "0"이 발생할 확률 정보와 "1"이 발생할 확률 정보를 서로 바꾸지 않을 수 있다.For example, if the number of non-zero coefficients up to the previous coefficient is greater than or equal to the number of NZ, the probability information that "0" occurs with respect to the partial block coefficient flag of the current coefficient and the probability information that & You can change each other. On the other hand, when the number of non-zero coefficients up to the previous coefficient is smaller than the number of NZ, the probability information for generating "0" for the partial block coefficient flag of the current coefficient and the probability information for generating & have.

또한, 상기 현재 계수가 참조하는 이전 계수는, 상기 현재 계수와 동일한 부분 블록에 속하는 것으로 제한될 수 있다. 다만, 이에 한정되지 아니하며, 현재 계수는 다른 부분 블록 또는 다른 변환 블록에 속한 계수를 참조하는 것도 가능하다.Also, the previous coefficient referenced by the current coefficient may be limited to belonging to the same partial block as the current coefficient. However, the present invention is not limited to this, and it is also possible to refer to a coefficient belonging to another partial block or another transform block.

전술한 부분 블록 계수 플래그 부호화/복호화 방법은, 변환 블록에 관한 양자화 파라미터(QP)에 따라서 선택적으로 이용될 수도 있다. The partial block coefficient flag encoding / decoding method described above may be selectively used according to the quantization parameter QP related to the conversion block.

예를 들어, 상기 변환 블록의 QP가 소정의 QP 임계치보다 큰 경우, 전술한 부호화/복호화 방법은 이용되지 않도록 제한될 수 있다. 반면, 상기 변환 블록의 QP가 소정의 QP 임계치보다 작은 경우, 전술한 부호화/복호화 방법 중 적어도 하나를 이용하여 부분 블록 계수 플래그를 부호화/복호화할 수 있다.For example, when the QP of the transform block is larger than a predetermined QP threshold, the above-described encoding / decoding method can be restricted not to be used. On the other hand, when the QP of the transform block is smaller than the predetermined QP threshold, the partial block coefficient flag can be encoded / decoded using at least one of the above-described encoding / decoding methods.

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

또는, 전술한 부분 블록 계수 플래그 부호화/복호화 방법은, 변환 블록(또는 부분 블록)의 크기에 따라서 선택적으로 이용될 수도 있다.Alternatively, the partial block coefficient flag encoding / decoding method described above may be selectively used depending on the size of the conversion block (or partial block).

예를 들어, 변환 블록의 크기가 소정의 임계크기보다 크거나 같은 경우, 전술한 부호화/복호화 방법 중 적어도 하나를 이용하여 부분 블록 계수 플래그를 부호화/복호화할 수 있다. 반면, 상기 변환 블록의 크기가 소정의 임계크기보다 작은 경우, 전술한 부호화/복호화 방법은 이용되지 않도록 제한될 수 있다.For example, when the size of the transform block is equal to or greater than a predetermined threshold size, the partial block coefficient flag can be encoded / decoded using at least one of the encoding / decoding methods described above. On the other hand, when the size of the transform block is smaller than a predetermined threshold size, the above-described encoding / decoding method can be restricted so as not to be used.

상기 임계크기의 개수는, 1개, 2개 또는 그 이상일 수 있다. 상기 임계크기는, 영상 부호화 장치에 기-설정된 것일 수 있다. 예를 들어, 상기 임계크기는 axb로 표현되며, 여기서 a와 b는 2, 4, 8, 16, 32, 64 또는 그 이상이고, a와 b는 동일하거나 상이할 수 있다. 또는, 영상 부호화 장치에서 부호화 효율을 고려하여 최적의 임계크기를 결정하고, 이를 부호화할 수도 있다.The number of critical dimensions may be one, two, or more. The threshold size may be set in the image encoding apparatus. For example, the critical dimension is represented 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 the optimal threshold size in consideration of the encoding efficiency and encode the optimal threshold size.

도 13은 본 발명이 적용되는 일실시예로서, 부분 블록 내 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.FIG. 13 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients in a partial block according to an embodiment to which the present invention is applied.

도 13을 참조하면, 현재 부분 블록 내 넌-제로 계수의 개수와 NZ 개수를 비교할 수 있다(S1300). 여기서, NZ 개수는 도 9의 실시예에서 살펴본 바와 같으며, 자세한 설명은 생략하기로 한다.Referring to FIG. 13, the number of non-zero coefficients in the current partial block and the number of NZ can be compared (S1300). Here, the number of NZ is as shown in the embodiment of FIG. 9, and a detailed description thereof will be omitted.

상기 S1300 단계의 비교 결과에 기초하여, 다음 부분 블록에 대한 부분 블록 계수 플래그의 확률 정보를 변경할 수 있다(S1310). 여기서, 다음 부분 블록은, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 상기 현재 부분 블록 다음에 부호화되는 부분 블록을 의미할 수 있다. 상기 확률 정보는, 영상 부호화/복호화 장치에 기-설정된 확률 테이블, 영상 부호화/복호화 장치에서 유도되는 확률값, 확률을 산출하기 위한 변수 등을 의미할 수 있다.Based on the comparison result of step S1300, the probability information of the partial block coefficient flag for the next partial block can be changed (S1310). Here, the next partial block may mean a partial block to be encoded next to the current partial block according to the coding order (or the order according to the scan type). The probability information may be a probability table preliminarily set in the image encoding / decoding device, a probability value derived from the image encoding / decoding device, a variable for calculating probability, and the like.

예를 들어, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 큰 경우, 상기 다음 부분 블록의 부분 블록 계수 플래그의 확률 정보는 변경될 수 있다. 상기 변경은, 상기 부분 블록 계수 플래그가 "참"일 확률이 높은 다른 확률 정보를 적용함을 의미할 수 있다.For example, if the number of non-zero coefficients in the current partial block is greater than the number of NZ, the probability information of the partial block coefficient flag of the next partial block may be changed. The change may mean applying different probability information with a high probability that the partial block coefficient flag is "true ".

반면, 상기 현재 부분 블록 내 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 다음 부분 블록의 부분 블록 계수 플래그의 확률 정보는 변경되지 않을 수 있다. 즉, 상기 다음 부분 블록의 부분 블록 계수 플래그는, 상기 현재 부분 블록의 부분 블록 계수 플래그에 관한 확률 정보를 그대로 이용할 수 있다.On the other hand, if the number of non-zero coefficients in the current partial block is smaller than the number of NZ, the probability information of the partial block coefficient flag of the next partial block may not be changed. That is, the partial block coefficient flag of the next partial block can use the probability information about the partial block coefficient flag of the current partial block as it is.

전술한 부호화 방식은, 변환 블록 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 부분 블록이 변환 블록 내에서 마지막 부호화 순서를 가진 부분 블록에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 부분 블록과 상기 다음 부분 블록이 상이한 변환 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다.The encoding method described above can be performed on a conversion block basis. For example, the coding scheme may be limited to be performed only until the next partial block reaches a partial block having the last coding order in the transform block. However, the present invention is not limited to this, and the same partial block and the next partial block belong to different conversion blocks.

영상 복호화 장치는, 전술한 부호화 방식과 동일/유사한 방식으로 부분 블록의 부분 블록 계수 플래그를 복호화할 수 있다.The image decoding apparatus can decode the partial block coefficient flag of the partial block in the same or similar manner as the above-described encoding method.

도 14는 본 발명이 적용되는 일실시예로서, 현재 계수까지의 넌-제로 계수의 개수를 기반으로 부분 블록 계수 플래그의 확률 정보를 변경하는 방법을 도시한 것이다.FIG. 14 illustrates a method of changing probability information of a partial block coefficient flag based on the number of non-zero coefficients up to a current coefficient, according to an embodiment of the present invention.

도 14를 참조하면, 현재 부분 블록 내에서 현재 계수까지의 넌-제로 계수의 개수와 NZ 개수를 비교할 수 있다(S1400). 상기 현재 계수까지의 넌-제로 계수의 개수는, 계수의 부호화 순서(또는 스캔 타입에 따른 순서)에 따라 산출될 수 있다. 상기 NZ 개수는 도 9의 실시예에서 살펴본 바와 같으며, 자세한 설명은 생략하기로 한다.Referring to FIG. 14, the number of non-zero coefficients up to the current coefficient in the current partial block can be compared with the NZ number (S1400). The number of non-zero coefficients up to the current coefficient can be calculated according to the encoding order of the coefficients (or the order according to the scan type). The number of NZs is as shown in the embodiment of FIG. 9, and a detailed description thereof will be omitted.

상기 S1400 단계의 비교 결과에 기초하여, 다음 계수에 대한 부분 블록 계수 플래그의 확률 정보를 변경할 수 있다(S1410). 여기서, 다음 계수는, 부호화 순서(또는, 스캔 타입에 따른 순서)에 따라 상기 현재 계수 다음에 부호화되는 계수를 의미할 수 있다. 상기 확률 정보는, 영상 부호화/복호화 장치에 기-설정된 확률 테이블, 영상 부호화/복호화 장치에서 유도되는 확률값, 확률을 산출하기 위한 변수 등을 의미할 수 있다.Based on the comparison result of step S1400, the probability information of the partial block coefficient flag for the next coefficient can be changed (S1410). Here, the next coefficient may mean a coefficient to be encoded next to the current coefficient according to the encoding order (or the order according to the scan type). The probability information may be a probability table preliminarily set in the image encoding / decoding device, a probability value derived from the image encoding / decoding device, a variable for calculating probability, and the like.

예를 들어, 상기 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 크거나 같은 경우, 상기 다음 계수의 부분 블록 계수 플래그의 확률 정보는 변경될 수 있다. 상기 변경은, 상기 부분 블록 계수 플래그가 "참"일 확률이 높은 다른 확률 정보를 적용함을 의미할 수 있다.For example, if the number of non-zero coefficients up to the current coefficient is greater than or equal to the number of NZs, the probability information of the partial block coefficient flag of the next coefficient may be changed. The change may mean applying different probability information with a high probability that the partial block coefficient flag is "true ".

반면, 상기 현재 계수까지의 넌-제로 계수의 개수가 NZ 개수보다 작은 경우, 상기 다음 계수의 부분 블록 계수 플래그의 확률 정보는 변경되지 않을 수 있다. 즉, 상기 다음 계수의 부분 블록 계수 플래그는, 상기 현재 계수의 부분 블록 계수 플래그에 관한 확률 정보를 그대로 이용할 수 있다.On the other hand, if the number of non-zero coefficients up to the current coefficient is smaller than the number of NZ, the probability information of the partial block coefficient flag of the next coefficient may not be changed. That is, the partial block coefficient flag of the next coefficient can use the probability information about the partial block coefficient flag of the current coefficient as it is.

전술한 부호화 방식은, 변환 블록 또는 부분 블록의 단위로 수행될 수 있다. 예를 들어, 상기 부호화 방식은, 상기 다음 계수가 변환 블록 또는 부분 블록 내에서 마지막 부호화 순서를 가진 계수에 도달할 때까지만 수행되도록 제한될 수도 있다. 다만, 이에 한정되지 아니하며, 상기 현재 계수과 상기 다음 계수가 상이한 변환 블록 또는 상이한 부분 블록에 속하는 경우에도 동일/유사하게 수행될 수 있다.The encoding method described above can be performed in units of a conversion block or a partial block. For example, the coding scheme may be constrained to be performed only until the next coefficient reaches a coefficient having the last coding order in the transform block or partial block. However, the present invention is not limited to this, and the same coefficient may be performed in the same or similar manner when the current coefficient and the next coefficient belong to different conversion blocks or different partial blocks.

영상 복호화 장치는, 전술한 부호화 방식과 동일/유사한 방식으로, 부분 블록 계수 플래그의 확률 정보를 변경할 수 있다.The video decoding apparatus can change the probability information of the partial block coefficient flag in the same or similar manner as the above encoding method.

또한, 전술한 확률 정보의 변경은, 변환 블록의 주파수 성분을 고려하여 수행될 수도 있다. 도 7을 참조하면, AC 성분 영역(예를 들어, 부분 블록 920, 930, 940)은 "거짓"인 부분 블록 계수 플래그의 확률이 더 높은 확률 정보를 이용하고, DC 성분 영역(예를 들어, 부분 블록 910)은 "참"인 부분 블록 계수 플래그의 확률이 더 높은 확률 정보를 이용할 수 있다. Also, the above-described change of the probability information may be performed in consideration of the frequency component of the transform block. 7, the AC component regions (e.g., partial blocks 920, 930, 940) use probability information with a higher probability of a partial block coefficient flag that is "false " Partial block 910) may use probability information with a higher probability of a partial block coefficient flag that is "true ".

본 개시의 예시적인 방법들은 설명의 명확성을 위해서 동작의 시리즈로 표현되어 있지만, 이는 단계가 수행되는 순서를 제한하기 위한 것은 아니며, 필요한 경우에는 각각의 단계가 동시에 또는 상이한 순서로 수행될 수도 있다. 본 개시에 따른 방법을 구현하기 위해서, 예시하는 단계에 추가적으로 다른 단계를 포함하거나, 일부의 단계를 제외하고 나머지 단계를 포함하거나, 또는 일부의 단계를 제외하고 추가적인 다른 단계를 포함할 수도 있다.Although the exemplary methods of this disclosure are represented by a series of acts for clarity of explanation, they are 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, the illustrative steps may additionally include other steps, include the remaining steps except for some steps, or may include additional steps other than some steps.

본 개시의 다양한 실시 예는 모든 가능한 조합을 나열한 것이 아니고 본 개시의 대표적인 양상을 설명하기 위한 것이며, 다양한 실시 예에서 설명하는 사항들은 독립적으로 적용되거나 또는 둘 이상의 조합으로 적용될 수도 있다.The various embodiments of the disclosure are not intended to be all-inclusive and are intended to illustrate representative aspects of the disclosure, and the features described in the various embodiments may be applied independently or in a 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. In the case of hardware implementation, one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays A general processor, a controller, a microcontroller, a microprocessor, and the like.

본 개시의 범위는 다양한 실시 예의 방법에 따른 동작이 장치 또는 컴퓨터 상에서 실행되도록 하는 소프트웨어 또는 머신-실행가능한 명령들(예를 들어, 운영체제, 애플리케이션, 펌웨어(firmware), 프로그램 등), 및 이러한 소프트웨어 또는 명령 등이 저장되어 장치 또는 컴퓨터 상에서 실행 가능한 비-일시적 컴퓨터-판독가능 매체(non-transitory computer-readable medium)를 포함한다.The scope of the present disclosure is to be accorded the broadest interpretation as understanding of the principles of the invention, as well as software or machine-executable instructions (e.g., operating system, applications, firmware, Instructions, and the like are stored and are non-transitory computer-readable medium executable on the device or computer.

Claims (10)

현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타내는 부분 블록 플래그를 부호화하는 단계;
상기 현재 부분 블록의 현재 계수가 상기 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 부호화하는 단계;
상기 현재 부분 블록의 현재 계수의 절대값을 부호화하는 단계; 및
상기 현재 부분 블록의 현재 계수의 부호(sign)를 부호화하는 단계를 포함하는 영상 신호 부호화 방법.
Encoding a partial block flag indicating whether there is at least one non-zero coefficient in the current partial block;
Encoding a partial block coefficient flag indicating whether the current coefficient of the current partial block is the non-zero coefficient;
Encoding an absolute value of a current coefficient of the current partial block; And
And encoding a sign of a current coefficient of the current partial block.
제1항에 있어서,
상기 부분 블록 계수 플래그는 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여 부호화되는 영상 신호 부호화 방법.
The method according to claim 1,
Wherein the partial block coefficient flag is encoded based on a number of non-zero coefficients in a previous partial block.
제2항에 있어서, 상기 부분 블록 계수 플래그를 부호화하는 단계는,
상기 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함하는 영상 신호 부호화 방법.
3. The method of claim 2, wherein encoding the partial block coefficient flag comprises:
Modifying the probability information of the partial block coefficient flag based on the number of non-zero coefficients in the previous partial block.
제1항에 있어서,
상기 부분 블록 계수 플래그는, 상기 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수에 기초하여 부호화되는 영상 신호 부호화 방법.
The method according to claim 1,
Wherein the partial block coefficient flag is encoded based on the number of non-zero coefficients up to a previous coefficient in the current partial block.
제4항에 있어서, 상기 부분 블록 계수 플래그를 부호화하는 단계는,
상기 이전 계수까지의 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함하는 영상 신호 부호화 방법.
5. The method of claim 4, wherein encoding the partial block coefficient flag comprises:
And changing the probability information of the partial block coefficient flag based on the number of non-zero coefficients up to the previous coefficient.
현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타내는 부분 블록 플래그를 복호화하는 단계;
상기 현재 부분 블록의 현재 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 복호화하는 단계;
상기 현재 부분 블록의 현재 계수의 절대값을 복호화하는 단계; 및
상기 현재 부분 블록의 현재 계수의 부호(sign)를 복호화하는 단계를 포함하는 영상 신호 복호화 방법.
Decoding a partial block flag indicating whether there is at least one non-zero coefficient in the current partial block;
Decoding a partial block coefficient flag indicating whether the current coefficient of the current partial block is a non-zero coefficient;
Decoding an absolute value of a current coefficient of the current partial block; And
And decoding a sign of a current coefficient of the current partial block.
제6항에 있어서,
상기 부분 블록 계수 플래그는 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여 복호화되는 영상 신호 복호화 방법.
The method according to claim 6,
Wherein the partial block coefficient flag is decoded based on the number of non-zero coefficients in the previous partial block.
제7항에 있어서, 상기 부분 블록 계수 플래그를 복호화하는 단계는,
상기 이전 부분 블록 내 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함하는 영상 신호 복호화 방법.
8. The method of claim 7, wherein decoding the partial block coefficient flag comprises:
And modifying the probability information of the partial block coefficient flag based on the number of non-zero coefficients in the previous partial block.
제6항에 있어서,
상기 부분 블록 계수 플래그는, 상기 현재 부분 블록 내에서 이전 계수까지의 넌-제로 계수의 개수에 기초하여 복호화되는 영상 신호 복호화 방법.
The method according to claim 6,
Wherein the partial block coefficient flag is decoded based on the number of non-zero coefficients up to a previous coefficient in the current partial block.
제9항에 있어서, 상기 부분 블록 계수 플래그를 복호화하는 단계는,
상기 이전 계수까지의 넌-제로 계수의 개수에 기초하여, 상기 부분 블록 계수 플래그의 확률 정보를 변경하는 단계를 포함하는 영상 신호 복호화 방법.
10. The method of claim 9, wherein decoding the partial block coefficient flag comprises:
And changing the probability information of the partial block coefficient flag based on the number of non-zero coefficients up to the previous coefficient.
KR1020170050050A 2016-04-29 2017-04-18 Method and apparatus for encoding/decoding a video signal KR20170124078A (en)

Priority Applications (26)

Application Number Priority Date Filing Date Title
CN202111060058.1A CN113810704A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
US16/097,464 US10681353B2 (en) 2016-04-29 2017-04-26 Method and apparatus for encoding/decoding image signal
CN201780041200.3A CN109479132B (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060265.7A CN113810710A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060470.3A CN113810713A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059977.7A CN113810699A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059986.6A CN113810700A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
PCT/KR2017/004465 WO2017188739A1 (en) 2016-04-29 2017-04-26 Method and device for encoding and decoding image signal
CN202111060380.4A CN113810712A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059916.0A CN113810697A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059988.5A CN113810701B (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN201910851178.XA CN110572649B (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060300.5A CN113810711A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060116.0A CN113810706A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060060.9A CN113810705A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111064728.7A CN113810714A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060256.8A CN113810709A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060000.7A CN113810703A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059997.4A CN113810702A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060251.5A CN113810708A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111059976.2A CN113810698A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060153.1A CN113810707A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
US16/860,112 US11140396B2 (en) 2016-04-29 2020-04-28 Method and device for encoding and decoding image signal
US17/017,770 US11122273B2 (en) 2016-04-29 2020-09-11 Method and device for encoding and decoding image signal
US17/017,808 US11140397B2 (en) 2016-04-29 2020-09-11 Method and device for encoding and decoding image signal
US17/381,326 US20210352296A1 (en) 2016-04-29 2021-07-21 Method and device for encoding and decoding image signal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20160052694 2016-04-29
KR1020160052694 2016-04-29

Publications (1)

Publication Number Publication Date
KR20170124078A true KR20170124078A (en) 2017-11-09

Family

ID=60385506

Family Applications (1)

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

Country Status (1)

Country Link
KR (1) KR20170124078A (en)

Similar Documents

Publication Publication Date Title
KR102383105B1 (en) Method and apparatus for processing a video signal
US11140396B2 (en) Method and device for encoding and decoding image signal
KR102383106B1 (en) Method and apparatus for processing a video signal
KR101997681B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR101965388B1 (en) Methods of coding quantization parameter and appratuses using the same
US10979709B2 (en) Image encoding method/device, image decoding method/device and recording medium having bitstream stored therein
US20210297666A1 (en) Image encoding method/device, image decoding method/device, and recording medium in which bitstream is stored
US11792426B2 (en) Method and apparatus for encoding/decoding image using a prediction value based on reference pixels
KR20130020562A (en) Methods of intra prediction on sdip and apparatuses for using the same
US20220345703A1 (en) Image encoding method/device, image decoding method/device and recording medium having bitstream stored therein
KR20220016938A (en) Method and apparatus for encoding/decoding an image
KR20170124079A (en) Method and apparatus for encoding/decoding a video signal
CN112425161A (en) Video coding method and device based on intra-frame prediction
KR102435493B1 (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
US11909970B2 (en) Image encoding method/device, image decoding method/device, and recording medium in which bitstream is stored
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20170124077A (en) Method and apparatus for encoding/decoding a video signal
KR20180089290A (en) Method and apparatus for encoding/decoding an image
KR20170124078A (en) Method and apparatus for encoding/decoding a video signal
KR102525555B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR101997686B1 (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR20170124076A (en) Method and apparatus for encoding and decoding a video signal group
KR20220061085A (en) Method and apparatus for encoding/decoding a video signal
KR102390731B1 (en) A method and an apparatus for encoding/decoding residual coefficient

Legal Events

Date Code Title Description
AMND Amendment
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
AMND Amendment
X601 Decision of rejection after re-examination