KR20170124076A - Method and apparatus for encoding and decoding a video signal group - Google Patents

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

Info

Publication number
KR20170124076A
KR20170124076A KR1020170050048A KR20170050048A KR20170124076A KR 20170124076 A KR20170124076 A KR 20170124076A KR 1020170050048 A KR1020170050048 A KR 1020170050048A KR 20170050048 A KR20170050048 A KR 20170050048A KR 20170124076 A KR20170124076 A KR 20170124076A
Authority
KR
South Korea
Prior art keywords
flag
threshold
partial block
value
coefficient
Prior art date
Application number
KR1020170050048A
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 CN202111060058.1A priority Critical patent/CN113810704A/en
Priority to PCT/KR2017/004465 priority patent/WO2017188739A1/en
Priority to CN202111060470.3A priority patent/CN113810713A/en
Priority to CN202111060265.7A priority patent/CN113810710A/en
Priority to CN202111060380.4A priority patent/CN113810712A/en
Priority to CN202111060000.7A priority patent/CN113810703A/en
Priority to CN202111060251.5A priority patent/CN113810708A/en
Priority to US16/097,464 priority patent/US10681353B2/en
Priority to CN202111060153.1A priority patent/CN113810707A/en
Priority to CN201910851178.XA priority patent/CN110572649B/en
Priority to CN202111059976.2A priority patent/CN113810698A/en
Priority to CN202111059988.5A priority patent/CN113810701B/en
Priority to CN202111059986.6A priority patent/CN113810700A/en
Priority to CN202111060256.8A priority patent/CN113810709A/en
Priority to CN202111059977.7A priority patent/CN113810699A/en
Priority to CN202111059916.0A priority patent/CN113810697A/en
Priority to CN202111060116.0A priority patent/CN113810706A/en
Priority to CN202111059997.4A priority patent/CN113810702A/en
Priority to CN201780041200.3A priority patent/CN109479132B/en
Priority to CN202111060300.5A priority patent/CN113810711A/en
Priority to CN202111064728.7A priority patent/CN113810714A/en
Priority to CN202111060060.9A priority patent/CN113810705A/en
Publication of KR20170124076A publication Critical patent/KR20170124076A/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

The present invention relates to a method and a device for encoding and decoding of a video signal group, which improve compression efficiency of an image by efficiently encoding/decoding coefficients in a partial block. The method for encoding an image signal according to the present invention comprises the following steps of: encoding a partial block coefficient flag representing whether a current partial block coefficient is a non-zero coefficient; encoding a first flag representing whether an absolute value of the coefficient is greater than one; encoding a second flag representing whether the absolute value of the coefficient is greater than two; encoding the remaining unencoded coefficient based on the first and second flags in the current partial block; and encoding a code with respect to the coefficient of the current partial block.

Description

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

본 발명은 변환 블록 내 계수들을 부호화/복호화하는 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for encoding / decoding coefficients in a transform block.

최근, 인터넷에서는 동영상과 같은 멀티미디어 데이터의 수요가 급격히 증가하고 있다. 하지만 채널(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.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 현재 부분 블록의 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 부호화하고, 상기 계수의 절대값이 1보다 큰지 여부를 나타내는 제1 플래그를 부호화하며, 상기 계수의 절대값이 2보다 큰지 여부를 나타내는 제2 플래그를 부호화하고, 상기 현재 부분 블록에서, 상기 제1 플래그 또는 제2 플래그를 기반으로 부호화되지 않은 나머지 계수를 부호화하며, 상기 현재 부분 블록의 계수에 대한 부호(sign)를 부호화할 수 있다.A video signal encoding method and apparatus according to the present invention encodes a partial block coefficient flag indicating whether a coefficient of a current partial block is a non-zero coefficient and outputs a first flag indicating whether an absolute value of the coefficient is greater than 1 Encoding the second flag indicating whether the absolute value of the coefficient is greater than 2, encoding the remaining coefficients not encoded based on the first flag or the second flag in the current partial block, The sign for the coefficient of the partial block can be encoded.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 상기 현재 부분 블록의 계수의 절대값 중 최대값을 부호화할 수 있다.The method and apparatus for encoding an image signal according to the present invention can encode a maximum value among the absolute values of the coefficients of the current partial block.

본 발명에 따른 영상 신호 부호화 방법 및 장치는, 상기 현재 부분 블록 내 모든 계수의 절대값이 현재 임계값보다 작은지 여부를 판단하고, 상기 판단 결과에 기초하여, 상기 현재 부분 블록에 관한 제1 임계값 플래그를 부호화할 수 있다.The method and apparatus for encoding an image signal according to the present invention may further include determining whether an absolute value of all coefficients in the current partial block is smaller than a current threshold value, Value flag can be encoded.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 크거나 같은 경우, 상기 제1 임계값 플래그는 거짓으로 부호화되고, 상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 작은 경우, 상기 제1 임계값 플래그는 참으로 부호화될 수 있다.In the method and apparatus for coding an image signal according to the present invention, if the absolute value of all coefficients in the current partial block is greater than or equal to the current threshold, the first threshold flag is coded to be false, If the absolute value of all of the coefficients is less than the current threshold value, the first threshold value flag may be encoded as true.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 제1 임계값 플래그가 거짓으로 부호화된 경우, 상기 현재 임계값은 다음 임계값으로 업데이트될 수 있다.In the video signal encoding method and apparatus according to the present invention, if the first threshold flag is encoded to be false, the current threshold value may be updated to a next threshold value.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 제1 플래그 또는 상기 제2 플래그 중 적어도 하나는, 상기 제1 임계값 플래그의 값에 따라 선택적으로 부호화될 수 있다.In the video signal encoding method and apparatus according to the present invention, at least one of the first flag or the second flag may be selectively encoded according to the value of the first threshold flag.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 현재 임계값은, 소정의 임계값의 범위에 속한 임계값 중 어느 하나일 수 있다.In the video signal encoding method and apparatus according to the present invention, the current threshold value may be any one of threshold values within a predetermined threshold value range.

본 발명에 따른 영상 신호 부호화 방법 및 장치에 있어서, 상기 소정의 임계값은, 양자화 파라미터, 블록의 크기 또는 화소값 범위 중 적어도 하나에 기초하여 결정될 수 있다.In the video signal encoding method and apparatus according to the present invention, the predetermined threshold may be determined based on at least one of a quantization parameter, a block size, and a pixel value range.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 현재 부분 블록의 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 복호화하고, 상기 계수의 절대값이 1보다 큰지 여부를 나타내는 제1 플래그를 복호화하며, 상기 계수의 절대값이 2보다 큰지 여부를 나타내는 제2 플래그를 복호화하고, 상기 현재 부분 블록에서, 상기 제1 플래그 또는 제2 플래그를 기반으로 복호화되지 않은 나머지 계수를 복호화하며, 상기 현재 부분 블록의 계수에 대한 부호(sign)를 복호화할 수 있다.The method and apparatus for decoding a video signal according to the present invention decodes a partial block coefficient flag indicating whether a coefficient of a current partial block is a non-zero coefficient and outputs a first flag indicating whether the absolute value of the coefficient is larger than 1 Decodes a second flag indicating whether the absolute value of the coefficient is greater than 2, decodes a remaining coefficient not decoded on the basis of the first flag or the second flag in the current partial block, The sign for the coefficient of the partial block can be decoded.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 상기 현재 부분 블록의 계수의 절대값 중 최대값을 복호화할 수 있다.The video signal decoding method and apparatus according to the present invention can decode a maximum value among the absolute values of the coefficients of the current partial block.

본 발명에 따른 영상 신호 복호화 방법 및 장치는, 상기 현재 부분 블록에 관한 제1 임계값 플래그를 복호화할 수 있다.The method and apparatus for decoding a video signal according to the present invention can decode a first threshold flag for the current partial block.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 제1 임계값 플래그가 거짓인 경우, 상기 현재 부분 블록 내 모든 계수의 절대값이 현재 임계값보다 크거나 같고, 상기 제1 임계값 플래그가 참인 경우, 상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 작을 수 있다.In the method and apparatus for decoding a video signal according to the present invention, if the first threshold flag is false, the absolute value of all coefficients in the current partial block is greater than or equal to a current threshold value, If true, the absolute value of all coefficients in the current partial block may be less than the current threshold.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 제1 임계값 플래그가 거짓인 경우, 상기 현재 임계값은 다음 임계값으로 업데이트될 수 있다.In the video signal decoding method and apparatus according to the present invention, when the first threshold flag is false, the current threshold value may be updated to a next threshold value.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 제1 플래그 또는 상기 제2 플래그 중 적어도 하나는, 상기 제1 임계값 플래그의 값에 따라 선택적으로 복호화될 수 있다.In the video signal decoding method and apparatus according to the present invention, at least one of the first flag or the second flag may be selectively decoded according to the value of the first threshold flag.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 현재 임계값은, 소정의 임계값의 범위에 속한 임계값 중 어느 하나일 수 있다.In the method and apparatus for decoding a video signal according to the present invention, the current threshold value may be a threshold value within a predetermined threshold value range.

본 발명에 따른 영상 신호 복호화 방법 및 장치에 있어서, 상기 소정의 임계값은, 양자화 파라미터, 블록의 크기 또는 화소값 범위 중 적어도 하나에 기초하여 결정될 수 있다.In the video signal decoding method and apparatus according to the present invention, the predetermined threshold may be determined based on at least one of a quantization parameter, a block size, and a pixel value range.

본 발명에 따르면, 변환 블록의 계수를 효율적으로 부호화/복호화 함으로써, 영상의 압축 효율을 향상시킬 수 있다.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는 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 부호화하는 방법을 도시한 것이다.
도 5는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 부호화하는 방법을 도시한 것이다.
도 6은 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제2 임계값 플래그를 부호화하는 방법을 도시한 것이다.
도 7은 본 발명이 적용되는 일실시예로서, 변환 블록의 계수를 복호화하는 방법을 도시한 것이다.
도 8은 본 발명이 적용되는 일실시예로서, 부분 블록의 계수의 최대값을 복호화하는 방법을 도시한 것이다.
도 9는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 복호화하는 방법을 도시한 것이다.
도 10은 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제2 임계값 플래그를 복호화하는 방법을 도시한 것이다.
도 11은 본 발명이 적용되는 일실시예로서, 현재 부분 블록에 관한 제1/제2 임계값 플래그를 유도하는 방법을 도시한 것이다.
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 maximum value of a coefficient of a partial block according to an embodiment of the present invention.
FIG. 5 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. 6 illustrates a method of encoding a second threshold value flag for a partial block according to an embodiment of the present invention. Referring to FIG.
FIG. 7 illustrates a method of decoding a coefficient of a transform block according to an embodiment of the present invention. Referring to FIG.
FIG. 8 illustrates a method of decoding a maximum value of a coefficient of a partial block according to an embodiment of the present invention.
FIG. 9 illustrates a method of decoding a first threshold flag for a partial block according to an embodiment of the present invention.
FIG. 10 illustrates a method of decoding a second threshold value flag for a partial block according to an embodiment of the present invention.
FIG. 11 illustrates a method of deriving a first / second threshold flag for a current partial block according to an embodiment of the present invention. Referring to FIG.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.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)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화기에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(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. 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 등과 같은 변환 방법을 사용하여 변환시킬 수 있다. 이때 변환 방법은 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드에 기반하여 결정될 수 있다. The transforming unit 130 can transform the residual block including the residual data by using a conversion method such as DCT, DST, 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.

양자화부(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.

재정렬부(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)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. 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.

엔트로피 부호화부(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)과 같은 다양한 방법이 적용될 수 있다. 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.

엔트로피 복호화부(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 parameter set.

메모리(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 플래그의 개수는 입력 영상의 비트 뎁스, 영상 내 임의의 영역에서 원본 화소값의 범위(Dynamic range), 블록 크기/뎁스, 분할 기법(e.g., 쿼드 트리, 바이너리 트리), 변환 기법(e.g., DCT, DST), 변환 스킵 여부, 양자화 파라미터, 예측 모드(e.g., 인트라/인터 모드) 등에 따라 상이할 수 있다. 상기 제1/제2 플래그 외에, 계수의 절대값이 n보다 큰지 여부를 나타내는 제n 플래그가 추가적으로 부호화될 수도 있다. 여기서, n은 2보다 큰 자연수를 의미할 수 있다. 제n 플래그의 개수는 1개, 2개 또는 그 이상일 수 있으며, 전술한 제1/제2 플래그와 동일/유사한 방식으로 결정될 수 있다.The number of at least one of the 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 the bit depth of the input image, the dynamic range of the original pixel value in an arbitrary region of the image, the block size / depth, the segmentation technique (eg, quad tree, (eg, DCT, DST), whether to skip conversion, quantization parameters, prediction mode (eg, intra / inter mode), and so on. 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와 같거나 클 수 있다. 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.

부분 블록의 계수에 대한 부호(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).

한편, 전술한 부분 블록의 계수 부호화는, 부분 블록에 속한 계수 값의 범위를 특정하는 과정을 더 수반할 수 있다. 상기 과정을 통해, 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부도 확인할 수 있다. 상기 과정은, 후술할 (A) 최대값의 부호화, (B) 제1 임계값 플래그의 부호화 또는 (C) 제2 임계값 플래그의 부호화 중 적어도 하나를 통해 구현될 수 있다. 상기 과정은, 전술한 S300 내지 S350 단계 중 어느 하나에 포함되어 구현될 수도 있고, S300 내지 S350 단계 중 적어도 하나와 대체되는 형태로 구현될 수도 있다. 이하, 도 4 내지 도 6을 참조하여, 부분 블록에 속한 계수 값의 범위를 특정하는 과정에 대해서 자세히 살펴 보기로 한다.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 through at least one of the following (A) maximum value encoding, (B) first threshold value flag encoding, or (C) second threshold value flag encoding. 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 to FIG.

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

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

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

도 5는 본 발명이 적용되는 일실시예로서, 부분 블록에 관한 제1 임계값 플래그를 부호화하는 방법을 도시한 것이다.FIG. 5 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/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 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, the threshold value range may be determined as {3}, the first / second threshold value flag encoding process may be omitted, and the coefficients of the partial block may be encoded through the above-described steps S300 to S350.

반면, 상기 QP가 소정의 QP 임계치보다 작은 경우, 변환 블록 내 넌-제로 계수의 분포가 많아질 것으로 예측할 수 있다. 이 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. On the other hand, when the QP is smaller than 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/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the size of the block is smaller than the predetermined threshold size, the range of the threshold value is determined as {3}, the first / second threshold value flag encoding process is omitted, and the above-described steps S300 to S350 are repeated The coefficients of the partial block 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/제2 임계값 플래그 부호화 과정을 생략하고, 전술한 S300 내지 S350 단계를 통해 부분 블록의 계수를 부호화할 수 있다. 반면, 상기 차이가 소정의 임계 차이값보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the difference between the maximum value and the minimum value of the pixel value range is smaller than the predetermined threshold difference value, the range of the threshold value is determined as {3}, or the first / second threshold value flag encoding process is omitted And the coefficient of the partial block can be encoded through steps S300 to S350 described above. 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.

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

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

상기 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 가산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, 상기 제1 임계값 플래그가 "참"으로 부호화될 때까지 반복적으로 수행될 수도 있다. 상기 업데이트된 현재 임계값을 기반으로, 전술한 S500 단계를 수행할 수 있다. 또는, 현재 임계값이 임계값의 최대값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the maximum value of the threshold value or when the number of the threshold values is 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 S500 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 임계값 플래그를 "참"으로 부호화할 수 있다(S530).If the absolute value of all coefficients is smaller than the current threshold value, the first threshold value flag may be encoded as "true" (S530).

전술한 바와 같이, 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 임계값 플래그 부호화 과정은 생략될 수 있으며, 이에 대해서는 도 11을 참조하여 살펴 보기로 한다.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 can be omitted, and this will be described with reference to FIG.

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

본 발명의 제2 임계값 플래그는 부분 블록의 모든 계수가 소정의 임계값보다 작은지 여부를 나타낼 수 있다. 상기 임계값의 개수는 N개(N>=1)일 수 있고, 이 경우 임계값의 범위는 {T0, T1, T2,…,TN-1}과 같이 표현될 수 있다. 여기서, 0번째 임계값인 T0은 최대값을, (N-1)번째 임계값인 TN-1은 최소값을 각각 의미하고, {T0, T1, T2,…,TN-1}는 임계값이 내림차순으로 배열된 것일 수 있다. 상기 임계값의 개수는, 영상 부호화 장치에 기-설정된 것일 수 있다. 영상 부호화 장치는, 부호화 효율을 고려하여 최적의 임계값의 개수를 결정하고, 이를 부호화할 수 있다. The second 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, T 0, which is the 0th threshold value, is the maximum value, and T N-1, which is the (N-1) th threshold value, is the minimum value, and {T 0 , T 1 , T 2 , ... , T N-1 } may be those in which the threshold values are arranged in descending 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.

상기 임계값은, 상기 최대값을 m으로 설정하고, 최소값을 n씩(n>=1) 감소시켜서 획득될 수 있다. 상기 m은, 영상 부호화 장치에 기-설정된 것일 수 있다. 또는, 영상 부호화 장치가 부호화 효율을 고려하여 최적의 최대값 m을 결정하고, 이를 부호화할 수 있다. 상기 임계값은, 영상 부호화 장치에 기-설정된 것일 수 있다. 영상 부호화 장치는, 부호화 효율을 고려하여 최적의 임계값을 결정하고, 이를 부호화할 수 있다.The threshold value may be obtained by setting the maximum value to m and decreasing the minimum value by n (n > = 1). The m may be one set in the image encoding apparatus. Alternatively, the image encoding apparatus can determine the optimal maximum value m in consideration of the coding efficiency and encode it. 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.

상기 임계값의 범위는, 도 5의 실시예에서 살펴본 바와 같이, 양자화 파라미터, 블록의 크기/형태, 또는 화소값의 범위 중 적어도 하나에 기초하여 상이하게 결정될 수 있다.The range of the threshold value may be determined differently based on at least one of a quantization parameter, a size / shape of a block, or a range of a pixel value, as shown in the embodiment of FIG.

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

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

상기 현재 임계값이 임계값의 최소값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 감산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, 상기 제2 임계값 플래그가 "거짓"으로 부호화될 때까지 반복적으로 수행될 수도 있다. 마찬가지로, 상기 업데이트된 현재 임계값을 기반으로, 전술한 S600 단계를 수행할 수 있다. 또는, 현재 임계값이 임계값의 최소값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the minimum value of the threshold value or when the number of the threshold values is 1, the current threshold value may be updated by subtracting a predetermined constant from 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 second threshold flag is encoded as "false ". Similarly, based on the updated current threshold, step S600 described above may be performed. Alternatively, if the current threshold value has reached the minimum value of the threshold value or if the number of threshold values is one, the updating process may be terminated.

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

전술한 바와 같이, i번째 임계값에 대한 제2 임계값 플래그가 "참"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 작음을 나타낼 수 있다. 반면, i번째 임계값에 대한 제2 임계값 플래그가 "거짓"인 경우, 이는 부분 블록 내 모든 계수의 절대값 중 적어도 하나가 i번째 임계값보다 크거나 같음을 나타낼 수 있다. As described above, when the second threshold value flag for the i-th threshold value is "true ", this may indicate that the absolute value of all coefficients in the partial block is smaller than the i-th threshold value. On the other hand, if the second threshold flag for the i-th threshold is "false", this may indicate that at least one of the absolute values of all coefficients in the partial block is greater than or equal to the i-th threshold.

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

예를 들어, 임계값의 범위가 {5, 3}인 경우, 임계값 "5"에 대한 제2 임계값 플래그 또는 임계값 "3"에 대한 제2 임계값 플래그 중 적어도 하나가 부호화될 수 있다. 상기 임계값 "5"에 대한 제2 임계값 플래그가 "거짓"인 경우, 부분 블록 내 모든 계수의 절대값 중 적어도 하나는 5보다 크거나 같을 수 있다. 이 경우, 전술한 S310 내지 S350 단계를 동일하게 수행하여 부분 블록의 계수를 부호화하거나, S300 단계를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 부호화할 수 있다. For example, when the range of the threshold is {5, 3}, at least one of the second threshold flag for the threshold value "5 " or the second threshold flag for the threshold value" 3 & . If the second threshold flag for the threshold "5" is "false ", at least one of the absolute values of all coefficients in the partial block may be greater than or equal to five. In this case, the coefficient of the partial block may be encoded by performing the above-described steps S310 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"에 대한 제2 임계값 플래그가 "참"인 경우, 상기 임계값 "3"에 대한 제2 임계값 플래그가 부호화될 수 있다. 상기 임계값 "3"에 대한 제2 임계값 플래그가 "참"인 경우, 부분 블록 내 계수의 절대값이 0 내지 2 범위에 속할 수 있다. 이 경우, 전술한 S330 또는 S340 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 부호화하거나, S300, S330 또는 S340 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 부호화할 수도 있다.If the second threshold flag for the threshold "5 " is" True ", a second threshold flag for the threshold "3 " When the second threshold value flag for the threshold value "3 " is" true ", the absolute value of the intra-block coefficient 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"에 대한 제2 임계값 플래그가 "거짓"인 경우, 부분 블록 내 모든 계수의 절대값 중 적어도 하나는 3보다 크거나 같을 수 있다. 이 경우, 전술한 S300 내지 S350 단계를 동일하게 수행하여, 부분 블록의 계수를 부호화할 수도 있고, S300 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 부호화할 수도 있다.On the other hand, if the second threshold flag for the threshold "3 " is" false ", at least one of the absolute values of all coefficients in the partial block may be greater than or equal to three. 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.

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

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

영상 복호화 장치에서, 변환 블록의 계수는 소정의 블록 단위(이하, 부분 블록이라 함)로 복호화될 수 있다. 변환 블록은 하나 또는 그 이상의 부분 블록으로 구성될 수 있다. 상기 부분 블록은 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이 아닌 계수(이하, 넌-제로 계수라 함)를 포함한 부분 블록의 위치 정보를 복호화할 수 있다. 상기 위치 정보에 따른 부분 블록부터 순차적으로 복호화를 수행할 수 있다. 이하, 도 3을 참조하여, 부분 블록의 계수를 복호화하는 과정을 살펴 보기로 한다.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 the partial blocks will be described with reference to FIG.

현재 부분 블록에 관한 부분 블록 플래그가 복호화될 수 있다(S700). 상기 부분 블록 플래그는 부분 블록의 단위로 복호화될 수 있다. 상기 부분 블록 플래그는, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는지 여부를 나타낼 수 있다. 예를 들어, 상기 부분 블록 플래그가 제1 값인 경우, 상기 현재 부분 블록은 적어도 하나의 넌-제로 계수가 존재함을 나타내고, 부분 블록 플래그가 제2 값인 경우, 상기 현재 부분 블록의 모든 계수는 0임을 나타낼 수 있다.The partial block flag for the current partial block can be decoded (S700). 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 .

현재 부분 블록에 관한 부분 블록 계수 플래그가 복호화될 수 있다(S710). 상기 부분 블록 계수 플래그는 계수 단위로 복호화될 수 있다. 상기 부분 블록 계수 플래그는, 계수가 넌-제로 계수인지 여부를 나타낼 수 있다. 예를 들어, 상기 부분 블록 계수 플래그가 제1 값인 경우, 상기 계수가 넌-제로 계수임을 나타내고, 상기 부분 블록 계수 플래그가 제2 값인 경우, 상기 계수가 0임을 나타낼 수 있다. 상기 부분 블록 계수 플래그는 상기 부분 블록 플래그에 따라 선택적으로 복호화될 수도 있다. 예를 들어, 현재 부분 블록에 적어도 하나의 넌-제로 계수가 존재하는 경우(즉, 부분 블록 플래그가 제1 값인 경우)에만, 부분 블록의 계수 별로 복호화될 수 있다.The partial block coefficient flag for the current partial block may be decoded (S710). 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 플래그라 함)가 복호화될 수 있다(S720). 상기 제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 (S720). 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 플래그라 함)가 복호화할 수 있다(S730). 상기 제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 (S730). 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 플래그의 개수는 입력 영상의 비트 뎁스, 영상 내 임의의 영역에서 원본 화소값의 범위(Dynamic range), 블록 크기/뎁스, 분할 기법(e.g., 쿼드 트리, 바이너리 트리), 변환 기법(e.g., DCT, DST), 변환 스킵 여부, 양자화 파라미터, 예측 모드(e.g., 인트라/인터 모드) 등에 따라 상이할 수 있다. 상기 제1/제2 플래그 외에, 계수의 절대값이 n보다 큰지 여부를 나타내는 제n 플래그가 추가적으로 복호화될 수도 있다. 여기서, n은 2보다 큰 자연수를 의미할 수 있다. 제n 플래그의 개수는 1개, 2개 또는 그 이상일 수 있으며, 전술한 제1/제2 플래그와 동일/유사한 방식으로 결정될 수 있다.The number of at least one of the 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 the bit depth of the input image, the dynamic range of the original pixel value in an arbitrary region of the image, the block size / depth, the segmentation technique (eg, quad tree, (eg, DCT, DST), whether to skip conversion, quantization parameters, prediction mode (eg, intra / inter mode), and so on. 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 플래그를 기반으로 복호화되지 않은 나머지 계수를 복호화할 수 있다(S740). 여기서, 상기 복호화는 계수값 자체를 복호화하는 과정일 수 있다. 상기 나머지 계수는 2와 같거나 클 수 있다. The remaining coefficients that have not been decoded based on the first / second flags may be decoded in the current partial block (S740). Here, the decoding may be a process of decoding the coefficient value itself. The remaining coefficients may be equal to or greater than two.

부분 블록의 계수에 대한 부호(sign)를 복호화할 수 있다(S750). 상기 부호는, 계수 단위로, 플래그 형태로 복호화될 수 있다. 상기 부호는, 전술한 부분 블록 계수 플래그의 값에 따라 선택적으로 복호화될 수 있다. 예를 들어, 상기 부호는, 상기 계수가 넌-제로 계수인 경우(즉, 상기 부분 블록 계수 플래그가 제1 값인 경우)에만 복호화될 수 있다.A sign for a coefficient of the partial block can be decoded (S750). 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).

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

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

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

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

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

본 발명의 제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/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S700 내지 S750 단계를 통해 부분 블록의 계수를 복호화할 수 있다.For example, if the QP is larger than the predetermined QP threshold, the threshold value range is determined as {3}, or the first / second threshold value flag decoding process is skipped and the steps S700 through S750 The coefficients of the partial block 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/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S700 내지 S750 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 블록의 크기가 소정의 임계크기보다 큰 경우, 임계값의 범위를 {3, 5} 혹은 {5, 3}으로 결정할 수 있다. For example, when the size of the block is smaller than the predetermined threshold size, the threshold value range is determined as {3}, the first / second threshold value flag decoding process is omitted, and the steps S700 to S750 The coefficients of the partial block 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/제2 임계값 플래그 복호화 과정을 생략하고, 전술한 S700 내지 S750 단계를 통해 부분 블록의 계수를 복호화할 수 있다. 반면, 상기 차이가 소정의 임계 차이값보다 큰 경우, 임계값의 범위를 {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 threshold value range is determined as {3}, or the first / second threshold value flag decoding process is omitted , And decodes the coefficients of the partial block through steps S700 to S750 described above. 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.

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

상기 제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)번째 임계값)으로 업데이트되고(S910), 업데이트된 현재 임계값을 기반으로, 전술한 S900 단계를 수행할 수 있다.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 (S910) The above-described step S900 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.

도 9에 도시된 바와 같이, 상기 제1 임계값 플래그가 "참"인 경우, 제1 임계값 플래그에 대한 복호화는 더 이상 수행되지 않을 수 있다.As shown in Fig. 9, when the first threshold flag is "True ", decoding of 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 임계값 플래그에 따라, 전술한 S700 내지 S750 단계 중 적어도 하나가 생략될 수 있다. According to the decoded first threshold value flag, at least one of steps S700 to S750 described above may be omitted.

예를 들어, 임계값의 범위가 {3, 5}인 경우, 임계값 "3"에 대한 제1 임계값 플래그 또는 임계값 "5"에 대한 제1 임계값 플래그 중 적어도 하나가 복호화될 수 있다. 상기 임계값 "3"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값은 0 내지 2 범위에 속할 수 있다. 이 경우, 전술한 S730 또는 S740 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화하거나, S700, S730 또는 S740 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화할 수도 있다. 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 for at least one of the steps S730 and S740 described above, or the remaining steps excluding S700, S730 or S740 are performed to decode the coefficients of the partial block It is possible.

상기 임계값 "3"에 대한 제1 임계값 플래그가 "거짓"인 경우, 상기 임계값 "5"에 대한 제1 임계값 플래그가 복호화될 수 있다. 상기 임계값 "5"에 대한 제1 임계값 플래그가 "거짓"인 경우, 부분 블록 내 계수의 절대값 중 적어도 하나는 5보다 크거나 같을 수 있다. 이 경우, 전술한 S700 내지 S750 단계를 동일하게 수행하여, 부분 블록의 계수를 복호화할 수도 있고, S700 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 복호화할 수도 있다. 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 same steps S700 to S750 as described above, or the coefficients of the partial block may be decoded by performing the remaining steps except step S700.

반면, 상기 임계값 "5"에 대한 제1 임계값 플래그가 "참"인 경우, 부분 블록 내 모든 계수의 절대값이 0 내지 4 범위에 속할 수 있다. 이 경우, 전술한 S700 내지 S750 단계를 동일하게 수행하여, 부분 블록의 계수를 복호화할 수도 있고, S700 단계를 제외한 나머지 단계를 수행하여, 부분 블록의 계수를 복호화할 수도 있다.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 same steps S700 to S750 as described above, or the coefficients of the partial block may be decoded by performing the remaining steps except step S700.

한편, 현재 부분 블록의 제1 임계값 플래그는, 다른 부분 블록의 제1 임계값 플래그를 기반으로 유도될 수 있다. 이 경우, 제1 임계값 플래그 복호화 과정은 생략될 수 있으며, 이에 대해서는 도 11을 참조하여 살펴 보기로 한다.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 may be omitted, and this will be described with reference to FIG.

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

본 발명의 제2 임계값 플래그는 부분 블록의 모든 계수가 소정의 임계값보다 작은지 여부를 나타낼 수 있다. 상기 임계값의 개수는 N개(N>=1)일 수 있고, 이 경우 임계값의 범위는 {T0, T1, T2,…,TN-1}과 같이 표현될 수 있다. 여기서, 0번째 임계값인 T0은 최대값을, (N-1)번째 임계값인 TN-1은 최소값을 각각 의미하고, {T0, T1, T2,…,TN-1}는 임계값이 내림차순으로 배열된 것일 수 있다. 상기 임계값의 개수는, 영상 복호화 장치에 기-설정된 것일 수도 있고, 영상 부부화 장치에서 시그날링되는 임계값의 개수에 관한 정보를 기반으로 결정될 수도 있다.The second 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, T 0, which is the 0th threshold value, is the maximum value, and T N-1, which is the (N-1) th threshold value, is the minimum value, and {T 0 , T 1 , T 2 , ... , T N-1 } may be those in which the threshold values are arranged in descending order. The number of thresholds may be set in the image decoding apparatus or may be determined based on information on the number of threshold values signaled in the image buffering apparatus.

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

상기 임계값의 범위는, 도 9의 실시예에서 살펴본 바와 같이, 양자화 파라미터, 블록의 크기/형태, 또는 화소값의 범위 중 적어도 하나에 기초하여 상이하게 결정될 수 있다.The range of the threshold value may be determined differently based on at least one of a quantization parameter, a size / shape of a block, or a range of a pixel value, as described in the embodiment of FIG.

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

상기 제2 임계값 플래그는, 부분 블록의 모든 계수의 절대값이 현재 임계값보다 작은지 여부를 나타낼 수 있다. 예를 들어, 상기 제2 임계값 플래그가 "거짓"인 경우, 이는 부분 블록의 모든 계수의 절대값이 현재 임계값보다 크거나 같을 수 있다. 반면, 상기 제2 임계값 플래그가 "참"인 경우, 이는 부분 블록의 모든 계수의 절대값이 현재 임계값보다 작을 수 있다.The second threshold value 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 second threshold flag is "false ", it may be that the absolute value of all the coefficients of the partial block is greater than or equal to the current threshold. On the other hand, when the second threshold flag is "true ", the absolute value of all the coefficients of the partial block may be smaller than the current threshold value.

만일, 상기 제2 임계값 플래그가 "참"인 경우, 상기 현재 임계값(i번째 임계값)은 다음 임계값((i+1)번째 임계값)으로 업데이트되고(S1010), 업데이트된 현재 임계값을 기반으로, 전술한 S1000 단계를 수행할 수 있다.If the second threshold flag is "True ", the current threshold value (i-th threshold value) is updated to the next threshold value (i + 1) th threshold value (S1010) The above step S1000 may be performed.

반면, 상기 제2 임계값 플래그가 "거짓"인 경우, 상기 제2 임계값 플래그에 대한 복호화는 더 이상 수행되지 않을 수 있다.On the other hand, if the second threshold flag is "False ", decoding of the second threshold flag may not be performed any more.

상기 현재 임계값이 임계값의 최소값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 현재 임계값에 소정의 상수를 감산하여 현재 임계값을 업데이트할 수도 있다. 상기 소정의 상수는 1보다 크거나 같은 정수일 수 있다. 이때, 상기 업데이트는, "거짓"인 제2 임계값 플래그가 복호화될 때까지 반복적으로 수행될 수도 있다. 또는, 현재 임계값이 임계값의 최소값에 도달한 경우 또는 상기 임계값의 개수가 1개인 경우, 상기 업데이트 과정이 종료될 수도 있다.When the current threshold value reaches the minimum value of the threshold value or when the number of the threshold values is 1, the current threshold value may be updated by subtracting a predetermined constant from 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 a second threshold value flag of "false " is decoded. Alternatively, if the current threshold value has reached the minimum value of the threshold value or if the number of threshold values is one, the updating process may be terminated.

전술한 바와 같이, i번째 임계값에 대한 제2 임계값 플래그가 "참"인 경우, 이는 부분 블록 내 모든 계수의 절대값이 i번째 임계값보다 작음을 나타낼 수 있다. 반면, i번째 임계값에 대한 제2 임계값 플래그가 "거짓"인 경우, 이는 부분 블록 내 모든 계수의 절대값 중 적어도 하나가 i번째 임계값보다 크거나 같음을 나타낼 수 있다.As described above, when the second threshold value flag for the i-th threshold value is "true ", this may indicate that the absolute value of all coefficients in the partial block is smaller than the i-th threshold value. On the other hand, if the second threshold flag for the i-th threshold is "false", this may indicate that at least one of the absolute values of all coefficients in the partial block is greater than or equal to the i-th threshold.

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

예를 들어, 임계값의 범위가 {5, 3}인 경우, 임계값 "5"에 대한 제2 임계값 플래그 또는 임계값 "3"에 대한 제2 임계값 플래그 중 적어도 하나가 복호화될 수 있다. 상기 임계값 "5"에 대한 제2 임계값 플래그가 "거짓"인 경우, 부분 블록 내 모든 계수의 절대값 중 적어도 하나는 5보다 크거나 같을 수 있다. 이 경우, 전술한 S710 내지 S750 단계를 동일하게 수행하여 부분 블록의 계수를 복호화하거나, S700 단계를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화할 수 있다. For example, when the range of the threshold is {5, 3}, at least one of the second threshold flag for the threshold value "5 " or the second threshold flag for the threshold value" 3 & . If the second threshold flag for the threshold "5" is "false ", at least one of the absolute values of all 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 S710 to S750 in the same manner, or the coefficients of the partial block may be decoded by performing the remaining steps except step S700.

상기 임계값 "5"에 대한 제2 임계값 플래그가 "참"인 경우, 상기 임계값 "3"에 대한 제2 임계값 플래그가 복호화될 수 있다. 상기 임계값 "3"에 대한 제2 임계값 플래그가 "참"인 경우, 부분 블록 내 계수의 절대값이 0 내지 2 범위에 속할 수 있다. 이 경우, 전술한 S730 또는 S740 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화하거나, S700, S730 또는 S740 단계 중 적어도 하나를 제외한 나머지 단계를 수행하여 부분 블록의 계수를 복호화할 수도 있다.If the second threshold flag for the threshold "5" is "True ", the second threshold flag for the threshold" 3 " When the second threshold value flag for the threshold value "3 " is" true ", the absolute value of the intra-block coefficient 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 for at least one of the steps S730 and S740 described above, or the remaining steps excluding S700, S730 or S740 are performed to decode the coefficients of the partial block It is possible.

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

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

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

본 실시예에서는, 변환 블록(1100)은 8x8이고, 부분 블록이 4x4이며, 최초 넌-제로 계수를 포함한 블록은 1120이며, 변환 블록의 부분 블록은 스캔 타입에 따라 1140, 1120, 1130, 1110의 순서로 부호화/복호화됨을 가정한다.In this embodiment, the transform block 1100 is 8x8, the partial block is 4x4, the block including the initial non-zero coefficient is 1120, and the partial block of the transform block is 1140, 1120, 1130, 1110 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.

구체적으로, 부호화/복호화 순서상 첫번째인 부분 블록 1140은 최초 넌-제로 계수가 속한 부분 블록 1120의 위치보다 부호화/복호화 순서가 앞서므로, 상기 제1 임계값 플래그가 부호화/복호화되지 않을 수 있다. 부호화/복호화 순서상 두번째인 부분 블록 1120에서는 임계값 "3"에 관한 제1 임계값 플래그가 "참"이므로, 상기 임계값 "3"에 관한 제1 임계값 플래그만이 부호화/복호화될 수 있다. 부호화/복호화 순서상 세번째인 부분 블록 1130에서는, 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이고, 임계값 "5"에 관한 제1 임계값 플래그가 "참"이므로, 상기 임계값 "3"과 "5"에 관한 제1 임계값 플래그가 각각 부호화/복호화될 수 있다. 부호화/복호화 순서상 마지막 부분 블록 1110에서는, 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이고, 임계값 "5"에 관한 제1 임계값 플래그가 "거짓"이다. 이때, 이전 부분 블록 1130에서 임계값 "3"에 관한 제1 임계값 플래그가 "거짓"이므로, 현재 부분 블록 1110은 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 1120 to which the first non-zero coefficient belongs. 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 1120 of the encoding / . In the third partial block 1130 of the encoding / decoding order, since the first threshold flag related to the threshold value "3" is "false" and the first threshold value flag relating to the threshold value "5" is "true" And a first threshold value flag for the values "3" and "5 " can be respectively encoded / decoded. In the last partial block 1110 in the encoding / decoding order, the first threshold flag related to the threshold value "3" is "false" and the first threshold value flag relating 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 1130 is" false ", the current partial block 1110 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 ".

본 실시예에서는, 설명의 편의를 위해 변환 블록(1100)은 8x8이고, 부분 블록이 4x4이며, 임계값의 범위는 {3, 5, 7}이고, 최초 넌-제로 계수를 포함한 블록은 1120이며, 변환 블록의 부분 블록은 스캔 타입에 따라 1140, 1120, 1130, 1110의 순서로 부호화/복호화됨을 가정한다.In this embodiment, for convenience of explanation, the conversion block 1100 is 8x8, the partial block is 4x4, the threshold range is {3, 5, 7}, the block including the initial non-zero coefficient is 1120 , It is assumed that the partial blocks of the transform block are coded / decoded in order of 1140, 1120, 1130, and 1110 according to the scan type.

마찬가지로, 현재 부분 블록에서, 특정 임계값에 관한 제2 임계값 플래그는 이전 부분 블록의 제2 임계값 플래그를 기반으로 유도될 수 있다. 예를 들어, 이전 부분 블록에서 "거짓"인 제1 임계값 플래그를 기반으로, 현재 부분 블록의 제1 임계값 플래그를 "거짓"으로 유도할 수 있다. 여기서, 임계값의 범위로 {7, 5, 3}이 이용됨을 가정한다.Likewise, in the current partial block, a second threshold flag for a certain threshold value may be derived based on a second 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 {7, 5, 3} is used as the range of the threshold value.

구체적으로, 부호화/복호화 순서상 첫번째인 부분 블록 1140은 최초 넌-제로 계수가 속한 부분 블록 1120의 위치보다 부호화/복호화 순서가 앞서므로 제2 임계값 플래그가 부호화/복호화되지 않을 수 있다. 부호화/복호화 순서상 두번째인 부분 블록 1120에서는 임계값 "7"에 관한 제2 임계값 플래그가 "참"이고, 임계값 "5"에 관한 제2 임계값 플래그가 "참"이며, 임계값 "3"에 관한 제2 임계값 플래그가 "참"이므로, 상기 임계값 "7", "5" 및 "3"에 관한 제2 임계값 플래그가 각각 부호화/복호화될 수 있다. 부호화/복호화 순서상 세번째인 부분 블록 1130에서는 임계값 “7”에 관한 제2 임계값 플래그와 임계값 “5”에 관한 제2 임계값 플래그가 각각 “참”이고, 임계값 “3”에 관한 제2 임계값 플래그는 “거짓”이다. 부호화/복호화 순서상 마지막 부분 블록 1110에서는, 임계값 "3"에 관한 제2 임계값 플래그가 "거짓"이다. 이때, 이전 부분 블록 1130에서 임계값 "3"에 관한 제2 임계값 플래그가 "거짓"임을 이용하여, 현재 부분 블록 1110에서는 임계값 “3”에 관한 제2 임계값 플래그를 부호화/복호화하지 않고, “거짓”으로 유도할 수 있다.Specifically, since the encoding / decoding order is earlier than the position of the partial block 1120 to which the first non-zero coefficient belongs, the second threshold flag may not be encoded / decoded. Quot ;, the second threshold flag related to the threshold "7" is " true ", the second threshold flag related to the threshold "5" 7 ", " 5 ", and "3 " can be respectively encoded / decoded because the second threshold value flag for " 3" The second threshold flag related to the threshold value " 7 " and the second threshold value flag relating to the threshold value " 5 " are respectively " true " and " The second threshold value flag is " false ". In the last partial block 1110 in the encoding / decoding order, the second threshold flag for the threshold "3" is "false ". At this time, by using the fact that the second threshold flag related to the threshold value "3" is "false " in the previous partial block 1130, the second threshold flag related to the threshold " 3 " is not encoded / , &Quot; false ".

본 개시의 예시적인 방법들은 설명의 명확성을 위해서 동작의 시리즈로 표현되어 있지만, 이는 단계가 수행되는 순서를 제한하기 위한 것은 아니며, 필요한 경우에는 각각의 단계가 동시에 또는 상이한 순서로 수행될 수도 있다. 본 개시에 따른 방법을 구현하기 위해서, 예시하는 단계에 추가적으로 다른 단계를 포함하거나, 일부의 단계를 제외하고 나머지 단계를 포함하거나, 또는 일부의 단계를 제외하고 추가적인 다른 단계를 포함할 수도 있다.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 (12)

현재 부분 블록의 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 부호화하는 단계;
상기 계수의 절대값이 1보다 큰지 여부를 나타내는 제1 플래그를 부호화하는 단계;
상기 계수의 절대값이 2보다 큰지 여부를 나타내는 제2 플래그를 부호화하는 단계;
상기 현재 부분 블록에서, 상기 제1 플래그 또는 제2 플래그를 기반으로 부호화되지 않은 나머지 계수를 부호화하는 단계; 및
상기 현재 부분 블록의 계수에 대한 부호(sign)를 부호화하는 단계를 포함하는 영상 신호 부호화 방법.
Encoding a partial block coefficient flag indicating whether the coefficient of the current partial block is a non-zero coefficient;
Encoding a first flag indicating whether the absolute value of the coefficient is greater than one;
Encoding a second flag indicating whether the absolute value of the coefficient is greater than 2;
Encoding residual coefficients that are not encoded based on the first flag or the second flag in the current partial block; And
And encoding a sign of a coefficient of the current partial block.
제1항에 있어서,
상기 현재 부분 블록의 계수의 절대값 중 최대값을 부호화하는 단계를 더 포함하는 영상 신호 부호화 방법.
The method according to claim 1,
And encoding a maximum value among the absolute values of the coefficients of the current partial block.
제1항에 있어서,
상기 현재 부분 블록 내 모든 계수의 절대값이 현재 임계값보다 작은지 여부를 판단하는 단계; 및
상기 판단 결과에 기초하여, 상기 현재 부분 블록에 관한 제1 임계값 플래그를 부호화하는 단계를 더 포함하되,
상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 크거나 같은 경우, 상기 제1 임계값 플래그는 거짓으로 부호화되고,
상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 작은 경우, 상기 제1 임계값 플래그는 참으로 부호화되는 영상 신호 부호화 방법.
The method according to claim 1,
Determining whether an absolute value of all coefficients in the current partial block is less than a current threshold value; And
Encoding the first threshold flag for the current partial block based on the determination result,
If the absolute value of all coefficients in the current partial block is greater than or equal to the current threshold value, the first threshold value flag is encoded to be false,
Wherein if the absolute value of all coefficients in the current partial block is smaller than the current threshold, the first threshold flag is encoded as true.
제3항에 있어서,
상기 제1 임계값 플래그가 거짓으로 부호화된 경우, 상기 현재 임계값은 다음 임계값으로 업데이트되는 영상 신호 부호화 방법.
The method of claim 3,
And if the first threshold flag is encoded to be false, the current threshold value is updated to a next threshold value.
제3항에 있어서,
상기 제1 플래그 또는 상기 제2 플래그 중 적어도 하나는, 상기 제1 임계값 플래그의 값에 따라 선택적으로 부호화되는 영상 신호 부호화 방법.
The method of claim 3,
Wherein at least one of the first flag and the second flag is selectively encoded according to the value of the first threshold flag.
제3항에 있어서,
상기 현재 임계값은, 소정의 임계값의 범위에 속한 임계값 중 어느 하나이고,
상기 소정의 임계값은, 양자화 파라미터, 블록의 크기 또는 화소값 범위 중 적어도 하나에 기초하여 결정되는 영상 신호 부호화 방법.
The method of claim 3,
Wherein the current threshold value is one of threshold values belonging to a range of a predetermined threshold value,
Wherein the predetermined threshold value is determined based on at least one of a quantization parameter, a block size, and a pixel value range.
현재 부분 블록의 계수가 넌-제로 계수인지 여부를 나타내는 부분 블록 계수 플래그를 복호화하는 단계;
상기 계수의 절대값이 1보다 큰지 여부를 나타내는 제1 플래그를 복호화하는 단계;
상기 계수의 절대값이 2보다 큰지 여부를 나타내는 제2 플래그를 복호화하는 단계;
상기 현재 부분 블록에서, 상기 제1 플래그 또는 제2 플래그를 기반으로 복호화되지 않은 나머지 계수를 복호화하는 단계; 및
상기 현재 부분 블록의 계수에 대한 부호(sign)를 복호화하는 단계를 포함하는 영상 신호 복호화 방법.
Decoding a partial block coefficient flag indicating whether the coefficient of the current partial block is a non-zero coefficient;
Decoding a first flag indicating whether the absolute value of the coefficient is greater than 1;
Decoding a second flag indicating whether the absolute value of the coefficient is greater than 2;
Decoding the remaining decoded coefficients based on the first flag or the second flag in the current partial block; And
And decoding a sign for a coefficient of the current partial block.
제7항에 있어서,
상기 현재 부분 블록의 계수의 절대값 중 최대값을 복호화하는 단계를 더 포함하는 영상 신호 복호화 방법.
8. The method of claim 7,
And decoding the maximum value among the absolute values of the coefficients of the current partial block.
제7항에 있어서,
상기 현재 부분 블록에 관한 제1 임계값 플래그를 복호화하는 단계를 더 포함하되,
상기 제1 임계값 플래그가 거짓인 경우, 상기 현재 부분 블록 내 모든 계수의 절대값이 현재 임계값보다 크거나 같고,
상기 제1 임계값 플래그가 참인 경우, 상기 현재 부분 블록 내 모든 계수의 절대값이 상기 현재 임계값보다 작은, 영상 신호 복호화 방법.
8. The method of claim 7,
Further comprising decoding a first threshold flag for the current partial block,
If the absolute value of all the coefficients in the current partial block is greater than or equal to the current threshold value,
Wherein if the first threshold flag is true, the absolute value of all coefficients in the current partial block is less than the current threshold.
제9항에 있어서,
상기 제1 임계값 플래그가 거짓인 경우, 상기 현재 임계값은 다음 임계값으로 업데이트되는 영상 신호 복호화 방법.
10. The method of claim 9,
And if the first threshold flag is false, the current threshold value is updated to a next threshold value.
제9항에 있어서,
상기 제1 플래그 또는 상기 제2 플래그 중 적어도 하나는, 상기 제1 임계값 플래그의 값에 따라 선택적으로 복호화되는 영상 신호 복호화 방법.
10. The method of claim 9,
Wherein at least one of the first flag and the second flag is selectively decoded according to the value of the first threshold flag.
제9항에 있어서,
상기 현재 임계값은, 소정의 임계값의 범위에 속한 임계값 중 어느 하나이고,
상기 소정의 임계값은, 양자화 파라미터, 블록의 크기 또는 화소값 범위 중 적어도 하나에 기초하여 결정되는 영상 신호 복호화 방법.
10. The method of claim 9,
Wherein the current threshold value is one of threshold values belonging to a range of a predetermined threshold value,
Wherein the predetermined threshold value is determined based on at least one of a quantization parameter, a block size, and a pixel value range.
KR1020170050048A 2016-04-29 2017-04-18 Method and apparatus for encoding and decoding a video signal group KR20170124076A (en)

Priority Applications (26)

Application Number Priority Date Filing Date Title
CN202111060256.8A CN113810709A (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
CN202111059986.6A CN113810700A (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
CN202111060380.4A CN113810712A (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
CN202111060251.5A CN113810708A (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
CN202111060153.1A CN113810707A (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
CN202111059976.2A CN113810698A (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
CN202111060470.3A CN113810713A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN202111060058.1A CN113810704A (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
CN202111059916.0A CN113810697A (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
CN202111059997.4A CN113810702A (en) 2016-04-29 2017-04-26 Method and apparatus for encoding and decoding image signal
CN201780041200.3A CN109479132B (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
CN202111064728.7A CN113810714A (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
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
KR20160052691 2016-04-29
KR1020160052691 2016-04-29

Publications (1)

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

Family

ID=60385630

Family Applications (1)

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

Country Status (1)

Country Link
KR (1) KR20170124076A (en)

Similar Documents

Publication Publication Date Title
JP6588523B2 (en) Intra-prediction method and encoder and decoder using the same
KR101965388B1 (en) Methods of coding quantization parameter and appratuses using the same
KR101997681B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
US20240015286A1 (en) Image encoding method/device, image decoding method/device and recording medium having bitstream stored thereon
US11792426B2 (en) Method and apparatus for encoding/decoding image using a prediction value based on reference pixels
US20190335173A1 (en) Image encoding method/device, image decoding method/device and recording medium having bitstream stored therein
KR20170124079A (en) Method and apparatus for encoding/decoding a video signal
KR20220016938A (en) Method and apparatus for encoding/decoding an image
KR20220098114A (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR20220019731A (en) A video encoding/decoding method and apparatus
KR20170124080A (en) Method and apparatus for encoding/decoding a video signal
US20240007627A1 (en) Image encoding method/device, image decoding method/device, and recording medium in which bitstream is stored
KR101743665B1 (en) Method and apparatus for processing a video signal based on intra prediction
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR102389267B1 (en) A method and an apparatus for processing a video signal based on reference between components
KR20170124077A (en) Method and apparatus for encoding/decoding a video signal
KR20180089290A (en) Method and apparatus for encoding/decoding an image
KR20200026394A (en) A method and an apparatus for encoding/decoding a intra prediction
KR20170124076A (en) Method and apparatus for encoding and decoding a video signal group
KR102525555B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20180041576A (en) Image encoding method/apparatus, image decoding method/apparatus and and recording medium for storing bitstream
KR101997686B1 (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR20170124078A (en) Method and apparatus for encoding/decoding a video signal
KR20220061085A (en) Method and apparatus for encoding/decoding a video signal
KR20200076807A (en) A method and an apparatus for processing a block divided into sub-block units

Legal Events

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