KR20190140422A - A method and an apparatus for encoding/decoding a residual block based on quantization parameter - Google Patents

A method and an apparatus for encoding/decoding a residual block based on quantization parameter Download PDF

Info

Publication number
KR20190140422A
KR20190140422A KR1020190079267A KR20190079267A KR20190140422A KR 20190140422 A KR20190140422 A KR 20190140422A KR 1020190079267 A KR1020190079267 A KR 1020190079267A KR 20190079267 A KR20190079267 A KR 20190079267A KR 20190140422 A KR20190140422 A KR 20190140422A
Authority
KR
South Korea
Prior art keywords
block
quantization parameter
residual
prediction
information
Prior art date
Application number
KR1020190079267A
Other languages
Korean (ko)
Other versions
KR102390733B1 (en
Inventor
심동규
박시내
Original Assignee
광운대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020180066705A external-priority patent/KR101997681B1/en
Application filed by 광운대학교 산학협력단 filed Critical 광운대학교 산학협력단
Priority to KR1020190079267A priority Critical patent/KR102390733B1/en
Publication of KR20190140422A publication Critical patent/KR20190140422A/en
Priority to KR1020220049380A priority patent/KR102525555B1/en
Application granted granted Critical
Publication of KR102390733B1 publication Critical patent/KR102390733B1/en
Priority to KR1020230052027A priority patent/KR20230058356A/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/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/117Filters, e.g. for pre-processing or post-processing
    • 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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Abstract

The present invention relates to a method for encoding/decoding a residual block based on a quantization parameter and an apparatus thereof. The method for encoding/decoding a residual coefficient based on a quantization parameter comprises the following steps of: deriving a residual coefficient of a residual block from a btstream; calculating a quantization parameter for the residual block; using the quantization parameter to perform inverse quantization on the residual coefficient; and performing inverse transform on the inverse quantized residual coefficient to restore a residual sample of the residual block. Therefore, the efficiency of encoding/decoding the residual block can be increased.

Description

양자화 파라미터 기반의 잔차 블록 부호화/복호화 방법 및 장치{A METHOD AND AN APPARATUS FOR ENCODING/DECODING A RESIDUAL BLOCK BASED ON QUANTIZATION PARAMETER}Residual block coding / decoding method based on quantization parameter {A METHOD AND AN APPARATUS FOR ENCODING / DECODING A RESIDUAL BLOCK BASED ON QUANTIZATION PARAMETER}

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

고해상도, 고품질의 영상에 대한 수요가 다양한 응용 분야에서 증가하고 있다. 영상 데이터가 고해상도, 고품질이 될수록 기존의 영상 데이터에 비해 상대적으로 데이터량이 증가하기 때문에 기존의 유무선 광대역 회선과 같은 매체를 이용하여 영상 데이터를 전송하거나 기존의 저장 매체를 이용해 저장하는 경우, 전송 비용과 저장 비용이 증가하게 된다. 영상 데이터가 고해상도, 고품질화 됨에 따라 발생하는 이러한 문제들을 해결하기 위해서는 고효율의 영상 압축 기술들이 활용될 수 있다.The demand for high resolution, high quality images is increasing in various applications. As the video data becomes higher resolution and higher quality, the amount of data increases relative to the existing video data. Therefore, when the video data is transmitted or stored using a medium such as a conventional wired / wireless broadband line, The storage cost will increase. High efficiency image compression techniques can be used to solve these problems caused by high resolution and high quality image data.

본 발명은 잔차 블록의 부호화/복호화 효율을 향상시키고자 한다. The present invention seeks to improve the encoding / decoding efficiency of the residual block.

본 발명은, 적응적인 블록 분할을 통해서 부호화/복호화 효율을 향상시키고자 한다.The present invention aims to improve encoding / decoding efficiency through adaptive block division.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치는, 비트스트림으로부터 잔차 블록의 잔차 계수를 유도하고, 상기 잔차 블록에 대한 양자화 파라미터를 산출하며, 상기 산출된 양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 역양자화를 수행하고, 상기 역양자화된 잔차 계수에 역변환을 수행하여, 상기 잔차 블록의 잔차 샘플을 복원할 수 있다.A video encoding / decoding method and apparatus according to the present invention derives a residual coefficient of a residual block from a bitstream, calculates a quantization parameter for the residual block, and uses the calculated quantization parameter for the residual coefficient. Inverse quantization may be performed, and an inverse transform may be performed on the inverse quantized residual coefficient to restore a residual sample of the residual block.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 양자화 파라미터는, 양자화 파라미터 예측값 또는 양자화 파라미터 차분값 중 적어도 하나에 기초하여 유도될 수 있다.In the video encoding / decoding method and apparatus according to the present invention, the quantization parameter may be derived based on at least one of a quantization parameter prediction value or a quantization parameter difference value.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 양자화 파라미터 예측값은, 하나 또는 그 이상의 주변 블록의 양자화 파라미터에 기초하여 유도될 수 있다.In the video encoding / decoding method and apparatus according to the present invention, the quantization parameter prediction value may be derived based on quantization parameters of one or more neighboring blocks.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 주변 블록은 상기 잔차 블록에 공간적 및/또는 시간적으로 인접한 블록일 수 있다.In the video encoding / decoding method and apparatus according to the present invention, the neighboring block may be a block spatially and / or temporally adjacent to the residual block.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 양자화 파라미터 차분값은, 상기 양자화 파라미터 차분값의 시그날링이 허용되는 블록의 크기에 기초하여 결정될 수 있다.In the video encoding / decoding method and apparatus according to the present invention, the quantization parameter difference value may be determined based on a size of a block that allows signaling of the quantization parameter difference value.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치는, 소정의 양자화 파라미터 오프셋에 기반하여, 상기 유도된 양자화 파라미터를 보정할 수 있다.The video encoding / decoding method and apparatus according to the present invention may correct the derived quantization parameter based on a predetermined quantization parameter offset.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 잔차 블록은 쿼드 트리, 바이너리 트리 또는 트리플 트리 중 적어도 하나에 기초하여 가변적인 크기/형태로 분할된 것일 수 있다.In the video encoding / decoding method and apparatus according to the present invention, the residual block may be divided into variable sizes / forms based on at least one of a quad tree, a binary tree, or a triple tree.

본 발명에 따르면, 소정의 양자화 파라미터 예측값, 양자화 파라미터 차분값 또는 양자화 파라미터 오프셋 중 적어도 하나를 기반으로 잔차 블록의 부호화/복호화 효율을 향상시킬 수 있다.According to the present invention, the encoding / decoding efficiency of the residual block can be improved based on at least one of a predetermined quantization parameter prediction value, a quantization parameter difference value, or a quantization parameter offset.

또한, 본 발명에 따르면, 트리 구조의 블록 분할을 통해 부호화/복호화 효율을 향상시킬 수 있다.In addition, according to the present invention, encoding / decoding efficiency can be improved through block division of a tree structure.

도 1은 본 발명의 일실시예로서, 부호화 장치의 개략적인 블록도를 도시한 것이다.
도 2는 본 발명의 일실시예로서, 복호화 장치의 개략적인 블록도를 도시한것이다.
도 3은 본 발명이 적용되는 일실시예로서, 블록 분할 타입을 도시한 것이다.
도 4는 본 발명이 적용되는 일실시예로서, 트리 구조 기반의 블록 분할 방법을 도시한 것이다.
도 5는 본 발명이 적용되는 일실시예로서, 잔차 샘플을 복원하는 방법을 도시한 것이다.
도 6은 본 발명이 적용되는 일실시예로서, 양자화 파라미터 예측값(QPpred)을 유도하는 방법을 도시한 것이다.
도 7은 본 발명이 적용되는 일실시예로서, 블록 T의 색차 성분에 관한 양자화 파라미터 예측값을 유도하는 방법을 도시한 것이다.
도 8은 본 발명이 적용되는 일실시예로서, 양자화 파라미터 차분값(deltaQP)의 시그날링 단위에 기반한 양자화 파라미터 유도 방법을 도시한 것이다.
도 9는 본 발명이 적용되는 일실시예로서, 잔차 계수의 역변환 과정을 도시한 것이다.
1 is a schematic block diagram of an encoding apparatus according to an embodiment of the present invention.
2 is a schematic block diagram of a decoding apparatus according to an embodiment of the present invention.
3 illustrates a block division type according to an embodiment to which the present invention is applied.
4 illustrates a tree structure based block partitioning method according to an embodiment to which the present invention is applied.
FIG. 5 illustrates a method for restoring a residual sample as an embodiment to which the present invention is applied.
6 illustrates a method of deriving a quantization parameter prediction value QPpred according to an embodiment to which the present invention is applied.
FIG. 7 illustrates a method of deriving a quantization parameter prediction value about a color difference component of a block T according to an embodiment to which the present invention is applied.
8 illustrates a method of deriving a quantization parameter based on a signaling unit of a quantization parameter difference value (deltaQP) according to an embodiment to which the present invention is applied.
9 illustrates an inverse transformation process of a residual coefficient as an embodiment to which the present invention is applied.

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

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. 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 the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes a combination of a plurality of related items or any item of a plurality of related items.

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

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

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

도 1은 본 발명의 일실시예로서, 부호화 장치의 개략적인 블록도를 도시한 것이다.1 is a schematic block diagram of an encoding apparatus according to an embodiment of the present invention.

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

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

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

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

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

예측부(120, 125)는 인터 예측을 수행하는 인터 예측부(120)와 인트라 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화 장치에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(120, 125)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.The predictors 120 and 125 may include an inter predictor 120 that performs inter prediction and an intra predictor 125 that performs intra prediction. Whether to use inter prediction or intra prediction on the prediction unit may be determined, and specific information (eg, an intra prediction mode, a motion vector, a reference picture, etc.) according to each prediction method may be determined. In this case, the processing unit in which the prediction is performed may differ from the processing unit in which the prediction method and the details are determined. For example, the method of prediction and the prediction mode may be determined in the prediction unit, and the prediction may be performed in the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transformer 130. In addition, prediction mode information and motion vector information used for prediction may be encoded by the entropy encoder 165 together with the residual value and transmitted to the decoding apparatus. When a specific encoding mode is used, the original block may be encoded as it is and transmitted to the decoder without generating the prediction block through the prediction units 120 and 125.

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

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

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

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

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

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

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

변환부(130)에서는 잔차 데이터를 포함한 잔차 블록을 DCT, DST 등과 같은 변환 타입을 사용하여 변환시킬 수 있다. 이때, 변환 방법은 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드에 기반하여 결정될 수 있다. The transformer 130 may convert the residual block including the residual data using a transform type such as DCT, DST, or the like. In this case, the transformation method may 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 by the transformer 130 into the frequency domain. The quantization coefficient may change depending on the block or the importance of the image. The value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the reordering unit 160.

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

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

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

엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. The entropy encoder 165 receives residual value coefficient information, block type information, prediction mode information, partition unit information, prediction unit information, transmission unit information, and motion of the coding unit from the reordering unit 160 and the prediction units 120 and 125. Various information such as vector information, reference frame information, interpolation information of a block, and filtering information can be encoded.

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

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

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

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

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

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

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

도 2는 본 발명의 일실시예로서, 복호화 장치의 개략적인 블록도를 도시한것이다.2 is a schematic block diagram of a decoding apparatus according to an embodiment of the present invention.

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

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

엔트로피 복호화부(210)는 입력 비트스트림에 대해 엔트로피 복호화를 수행할 수 있다. 예를 들어, 엔트로피 복호화를 위해, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. The entropy decoder 210 may perform entropy decoding on the input bitstream. For example, for entropy decoding, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied.

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

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

역양자화부(220)는 양자화 파라미터와 재정렬된 블록의 계수값을 기초로 역양자화를 수행할 수 있다. The inverse quantization unit 220 may perform inverse quantization based on quantization parameters and coefficient values of the rearranged block.

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

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

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

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

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

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

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

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

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

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

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

도 3은 본 발명이 적용되는 일실시예로서, 블록 분할 타입을 도시한 것이다.3 illustrates a block division type according to an embodiment to which the present invention is applied.

하나의 블록(이하, 제1 블록이라 함)은 수직 라인 또는 수평 라인 중 적어도 하나에 의해서 복수의 서브 블록(이하, 제2 블록이라 함)으로 분할될 수 있다. 상기 수직 라인과 수평 라인은 1개, 2개 또는 그 이상일 수 있다. 여기서, 제1 블록은 영상 부호화/복호화의 기본 단위인 코딩 블록(CU), 예측 부호화/복호화의 기본 단위인 예측 블록(PU), 또는 변환 부호화/복호화의 기본 단위인 변환 블록(TU)일 수 있다. 상기 제1 블록은 정방형 블록일 수도 있고, 비정방형 블록일 수도 있다.One block (hereinafter, referred to as a first block) may be divided into a plurality of sub blocks (hereinafter, referred to as a second block) by at least one of a vertical line and a horizontal line. The vertical line and the horizontal line may be one, two or more. Here, the first block may be a coding block (CU) that is a basic unit of image encoding / decoding, a prediction block (PU) that is a basic unit of prediction encoding / decoding, or a transform block (TU) that is a basic unit of transform encoding / decoding. have. The first block may be a square block or a non-square block.

상기 제1 블록의 분할은, 쿼드 트리(quad tree), 바이너리 트리(binary tree), 트리플 트리(triple tree) 등에 기초하여 수행될 수 있으며, 이하 도 3을 참조하여 자세히 살펴 보기로 한다.The division of the first block may be performed based on a quad tree, a binary tree, a triple tree, and the like, and will be described in detail with reference to FIG. 3.

도 3(a)는 쿼드 트리 분할(QT)을 도시한 것이다. QT는, 제1 블록을 4개의 제2 블록으로 사분할하는 분할 타입이다. 예를 들어, 2Nx2N의 제1 블록이 QT로 분할되는 경우, 제1 블록은 NxN 크기를 가진 4개의 제2 블록으로 사분할될 수 있다. QT는 정방형 블록에만 적용되도록 제한될 수 있으나, 비정방형 블록에 적용하는 것도 가능하다.3 (a) illustrates quad tree division (QT). QT is a division type that divides the first block into four second blocks. For example, when the first block of 2N × 2N is divided into QTs, the first block may be divided into four second blocks having an N × N size. The QT may be limited to be applied only to square blocks, but may also be applied to non-square blocks.

도 3(b)는 수평 바이너리 트리(이하, Horizontal BT라 함) 분할을 도시한 것이다. Horizontal BT는, 1개의 수평 라인에 의해서 제1 블록이 2개의 제2 블록으로 이분할되는 분할 타입이다. 상기 이분할은 대칭 혹은 비대칭으로 수행될 수 있다. 예를 들어, 2Nx2N의 제1 블록이 Horizontal BT로 분할되는 경우, 제1 블록은 높이의 비율이 (a:b)인 2개의 제2 블록으로 분할될 수 있다. 여기서, a와 b는 동일한 값일 수도 있고, a는 b보다 크거나 작을 수도 있다.FIG. 3B illustrates partitioning of a horizontal binary tree (hereinafter referred to as Horizontal BT). Horizontal BT is a division type in which the first block is divided into two second blocks by one horizontal line. The dividing may be performed symmetrically or asymmetrically. For example, when the first block of 2N × 2N is divided into Horizontal BT, the first block may be divided into two second blocks having a height ratio of (a: b). Here, a and b may be the same value, and a may be larger or smaller than b.

도 3(c)는 수직 바이너리 트리(이하, Vertical BT라 함) 분할을 도시한 것이다. Vertical BT는, 1개의 수직 라인에 의해서 제1 블록이 2개의 제2 블록으로 이분할되는 분할 타입이다. 상기 이분할은 대칭 혹은 비대칭으로 수행될 수 있다. 예를 들어, 2Nx2N의 제1 블록이 Vertical BT로 분할되는 경우, 제1 블록은 너비의 비율이 (a:b)인 2개의 제2 블록으로 분할될 수 있다. 여기서, a와 b는 동일한 값일 수도 있고, a는 b보다 크거나 작을 수도 있다.3 (c) illustrates splitting of a vertical binary tree (hereinafter referred to as vertical BT). Vertical BT is a division type in which the first block is divided into two second blocks by one vertical line. The dividing may be performed symmetrically or asymmetrically. For example, when the first block of 2N × 2N is divided into Vertical BTs, the first block may be divided into two second blocks having a width ratio of (a: b). Here, a and b may be the same value, and a may be larger or smaller than b.

도 3(d)는 수평 트리플 트리(이하, Horizontal TT라 함) 분할을 도시한 것이다. Horizontal TT는, 2개의 수평 라인에 의해서 제1 블록이 3개의 제2 블록으로 삼분할되는 분할 타입이다. 예를 들어, 2Nx2N의 제1 블록이 Horizontal TT로 분할되는 경우, 제1 블록은 높이의 비율이 (a:b:c)인 3개의 제2 블록으로 분할될 수 있다. 여기서, a, b, c는 동일한 값일 수 있다. 또는, a와 c는 동일하고, b는 a보다 크거나 작을 수 있다.3 (d) illustrates the division of a horizontal triple tree (hereinafter referred to as a horizontal TT). Horizontal TT is a division type in which the first block is divided into three second blocks by two horizontal lines. For example, when the first block of 2N × 2N is divided into Horizontal TT, the first block may be divided into three second blocks having a height ratio of (a: b: c). Here, a, b, and c may be the same value. Alternatively, a and c may be the same and b may be larger or smaller than a.

도 3(e)는 수직 트리플 트리(이하, Vertical TT라 함) 분할을 도시한 것이다. Vertical TT는, 2개의 수직 라인에 의해서 제1 블록이 3개의 제2 블록으로 삼분할되는 분할 타입이다. 예를 들어, 2Nx2N의 제1 블록이 Vertical TT로 분할되는 경우, 제1 블록은 너비의 비율이 (a:b:c)인 3개의 제2 블록으로 분할될 수 있다. 여기서, a, b, c는 동일한 값일 수도 있고, 서로 다른 값일 수도 있다. 또는, a와 c는 동일하고, b는 a보다 크거나 작을 수 있다. 또는, a와 b는 동일하고, c는 a보다 크거나 작을 수 있다. 또는, b와 c는 동일하고, a는 b보다 크거나 작을 수 있다.3 (e) illustrates splitting of a vertical triple tree (hereinafter referred to as vertical TT). Vertical TT is a split type in which the first block is divided into three second blocks by two vertical lines. For example, when the first block of 2N × 2N is divided into Vertical TT, the first block may be divided into three second blocks having a width ratio of (a: b: c). Here, a, b, and c may be the same value, or may be different values. Alternatively, a and c may be the same and b may be larger or smaller than a. Alternatively, a and b may be the same and c may be larger or smaller than a. Alternatively, b and c are the same, and a may be greater or less than b.

전술한 분할은, 부호화 장치로부터 시그날링되는 분할 정보에 기초하여 수행될 수 있다. 상기 분할 정보는, 분할 타입 정보, 분할 방향 정보 또는 분할 비율 정보 중 적어도 하나를 포함할 수 있다. The above-described partitioning may be performed based on the partitioning information signaled from the encoding apparatus. The split information may include at least one of split type information, split direction information, or split ratio information.

상기 분할 타입 정보는, 부호화/복호화 장치에 기-정의된 분할 타입 중 어느 하나를 특정할 수 있다. 상기 기-정의된 분할 타입은, QT, Horizontal BT, Vertical BT, Horizontal TT, Vertical TT 또는 비분할 모드(No split) 중 적어도 하나를 포함할 수 있다. 또는, 상기 분할 타입 정보는, QT, BT 또는 TT가 적용되는지 여부에 관한 정보를 의미할 수도 있으며, 이는 플래그 혹은 인덱스의 형태로 부호화될 수 있다. 상기 분할 방향 정보는, BT 또는 TT의 경우, 수평 방향으로 분할되는지 아니면 수직 방향으로 분할되는지를 나타낼 수 있다. 상기 분할 비율 정보는, BT 또는 TT의 경우, 제2 블록의 너비 및/또는 높이의 비율을 나타낼 수 있다. The partition type information may specify any one of the partition types that are pre-defined in the encoding / decoding device. The pre-defined split type may include at least one of QT, Horizontal BT, Vertical BT, Horizontal TT, Vertical TT, or No split mode. Alternatively, the partition type information may mean information on whether QT, BT or TT is applied, which may be encoded in the form of a flag or an index. In the case of BT or TT, the split direction information may indicate whether the split direction information is split in the horizontal direction or in the vertical direction. The split ratio information may indicate a ratio of a width and / or a height of a second block in case of BT or TT.

도 4는 본 발명이 적용되는 일실시예로서, 트리 구조 기반의 블록 분할 방법을 도시한 것이다.FIG. 4 illustrates a tree structure based block partitioning method according to an embodiment to which the present invention is applied.

도 4에 도시된 블록(400)은 8Nx8N 크기이고, 분할 뎁스가 k인 정방형 블록(이하, 제1 블록이라 함)이라 가정한다. 제1 블록의 분할 정보가 QT 분할을 지시하는 경우, 제1 블록은 4개의 서브 블록(이하, 제2 블록이라 함)으로 사분할될 수 있다. 상기 제2 블록은 4Nx4N 크기이고, (k+1)의 분할 뎁스를 가질 수 있다.It is assumed that the block 400 illustrated in FIG. 4 is a square block (hereinafter, referred to as a first block) having a size of 8N × 8N and having a division depth of k. When the partition information of the first block indicates the QT division, the first block may be divided into four sub blocks (hereinafter, referred to as a second block). The second block may be 4N × 4N in size and have a split depth of (k + 1).

상기 4개의 제2 블록은, QT, BT, TT 또는 비분할 모드 중 어느 하나에 기초하여 다시 분할될 수 있다. 예를 들어, 제2 블록의 분할 정보가 수평 방향으로의 바이너리 트리(Horizontal BT)를 나타내는 경우, 상기 제2 블록은 도 4의 제2 블록(410)과 같이 2개의 서브 블록(이하, 제3 블록이라 함)으로 이분할될 수 있다. 이때, 상기 제3 블록은, 4Nx2N 크기이고, (k+2)의 분할 뎁스를 가질 수 있다.The four second blocks may be divided again based on any one of QT, BT, TT, or non-divided mode. For example, when the partition information of the second block indicates a binary tree (Horizontal BT) in the horizontal direction, the second block may be divided into two sub-blocks (hereinafter, referred to as a third block) as shown in the second block 410 of FIG. Can be divided into blocks). In this case, the third block may have a size of 4N × 2N and have a division depth of (k + 2).

상기 제3 블록도 QT, BT, TT 또는 비분할 모드 중 어느 하나에 기초하여 다시 분할될 수 있다. 예를 들어, 상기 제3 블록의 분할 정보가 수직 방향으로의 바이너리 트리(Vertical BT)를 나타내는 경우, 상기 제3 블록은 도 4에 도시된 바와 같이 2개의 서브 블록(411, 412)으로 이분할될 수 있다. 이때, 상기 서브 블록(411, 412)은, 2Nx2N 크기이고, (k+3)의 분할 뎁스를 가질 수 있다. 또는, 상기 제3 블록의 분할 정보가 수평 방향으로의 바이너리 트리(Horizontal BT)를 나타내는 경우, 상기 제3 블록은 도 4에 도시된 바와 같이 2개의 서브 블록(413, 414)으로 이분할될 수 있다. 이때, 상기 서브 블록(413, 414)은, 4NxN 크기이고, (k+3)의 분할 뎁스를 가질 수 있다.The third block may also be divided again based on any one of QT, BT, TT, or non-divided mode. For example, when the partition information of the third block indicates a vertical BT in the vertical direction, the third block is divided into two sub-blocks 411 and 412 as shown in FIG. 4. Can be. In this case, the sub blocks 411 and 412 may have a size of 2N × 2N and have a split depth of (k + 3). Alternatively, when the partition information of the third block indicates a binary tree (Horizontal BT) in the horizontal direction, the third block may be divided into two sub blocks 413 and 414 as shown in FIG. 4. have. In this case, the sub blocks 413 and 414 may have a size of 4N × N and have a division depth of (k + 3).

상기 분할은, 주변 블록과 독립적 혹은 병렬적으로 수행될 수도 있고, 소정의 우선순위에 따라 순차적으로 수행될 수도 있다. The division may be performed independently or in parallel with neighboring blocks, or may be performed sequentially according to a predetermined priority.

분할 대상인 현재 블록의 분할 정보는, 현재 블록의 상위 블록의 분할 정보 또는 주변 블록의 분할 정보 중 적어도 하나에 기초하여 종속적으로 결정될 수도 있다. 예를 들어, 상기 제2 블록이 Horizontal BT로 분할되고, 상단의 제3 블록이 Vertical BT로 분할된 경우, 하단의 제3 블록은 Vertical BT로 분할될 필요가 없다. 하단의 제3 블록이 Vertical BT로 분할될 경우, 이는 제2 블록이 QT로 분할되는 것과 동일한 결과가 나오기 때문이다. 따라서, 하단의 제3 블록의 분할 정보(특히, 분할 방향 정보)는 부호화가 생략될 수 있고, 복호화 장치는 하단의 제3 블록이 수평 방향으로 분할되도록 설정할 수 있다.The split information of the current block to be split may be determined based on at least one of split information of the upper block of the current block or split information of the neighboring block. For example, when the second block is divided into Horizontal BT and the upper third block is divided into Vertical BT, the lower third block need not be divided into Vertical BT. When the third block at the bottom is divided into Vertical BT, this is because the same result as the second block is divided into QT. Accordingly, encoding may be omitted in the split information (particularly, split direction information) of the lower third block, and the decoding apparatus may set the lower third block to be split in the horizontal direction.

상기 상위 블록은 상기 현재 블록의 분할 뎁스보다 작은 분할 뎁스를 가진 블록을 의미할 수 있다. 예를 들어, 현재 블록의 분할 뎁스가 (k+2)인 경우, 상위 블록의 분할 뎁스는 (k+1)일 수 있다. 상기 주변 블록은, 현재 블록의 상단 혹은 좌측에 인접한 블록일 수 있다. 상기 주변 블록은, 현재 블록과 동일한 분할 뎁스를 가진 블록일 수 있다.The upper block may mean a block having a division depth smaller than the division depth of the current block. For example, when the split depth of the current block is (k + 2), the split depth of the higher block may be (k + 1). The neighboring block may be a block adjacent to the top or left side of the current block. The neighboring block may be a block having the same division depth as the current block.

전술한 분할은, 부호화/복호화의 최소 단위까지 반복적으로 수행될 수 있다. 최소 단위로 분할된 경우, 해당 블록에 대한 분할 정보는 부호화 장치로부터 더 이상 시그날링되지 아니한다. 상기 최소 단위에 대한 정보는, 최소 단위의 크기 또는 형태 중 적어도 하나를 포함할 수 있다. 상기 최소 단위의 크기는, 블록의 너비, 높이, 너비와 높이 중 최소값 혹은 최대값, 너비와 높이의 합, 픽셀 개수, 분할 뎁스 등으로 표현될 수 있다. 상기 최소 단위에 대한 정보는, 비디오 시퀀스, 픽쳐, 슬라이스 또는 블록 단위 중 적어도 하나에서 시그날링될 수 있다. 또는, 상기 최소 단위에 대한 정보는 부호화/복호화 장치에 기-약속된 값일 수도 있다. 상기 최소 단위에 대한 정보는, CU, PU, TU에 대해서 각각 시그날링될 수 있다. 하나의 최소 단위에 대한 정보가 CU, PU, TU에 동일하게 적용될 수도 있다.The above-described division may be repeatedly performed up to the minimum unit of encoding / decoding. In the case of splitting to a minimum unit, splitting information for the corresponding block is no longer signaled from the encoding apparatus. The information on the minimum unit may include at least one of the size or shape of the minimum unit. The size of the minimum unit may be expressed as the width, height, minimum or maximum of the width and height, the sum of the width and height, the number of pixels, the division depth, and the like. The information on the minimum unit may be signaled in at least one of a video sequence, a picture, a slice, or a block unit. Alternatively, the information on the minimum unit may be a value pre-committed to the encoding / decoding apparatus. The information on the minimum unit may be signaled for each of CU, PU, and TU. Information on one minimum unit may be equally applied to a CU, a PU, and a TU.

도 5는 본 발명이 적용되는 일실시예로서, 잔차 샘플을 복원하는 방법을 도시한 것이다.FIG. 5 illustrates a method for restoring a residual sample as an embodiment to which the present invention is applied.

도 5를 참조하면, 비트스트림으로부터 잔차 블록의 잔차 계수를 유도할 수 있다(S500).Referring to FIG. 5, a residual coefficient of a residual block may be derived from a bitstream (S500).

상기 유도는, 넌-제로 잔차 계수의 존부에 관한 정보, 부호화된 잔차 계수의 절대값(abs) 또는 부호(sign) 중 적어도 하나를 복호화하여 수행될 수 있다.The derivation may be performed by decoding at least one of information about the existence of non-zero residual coefficients, an absolute value (abs) or a sign of the encoded residual coefficients.

상기 유도는, 잔차 블록 내 고주파 영역의 잔차 계수를 0으로 설정하는 과정을 더 포함할 수도 있다. 상기 고주파 영역은, 잔차 블록의 좌측에서부터 n개의 열(column) 또는 상단에서부터 m개의 행(row) 중 적어도 하나를 제외한 영역으로 정의될 수 있다. 상기 n, m은 부호화/복호화 장치에 기-약속된 값일 수도 있고, 잔차 블록의 크기/형태에 따라 가변적으로 결정될 수도 있다. 예를 들어, 잔차 블록이 64x32인 경우, 잔차 블록의 좌측에서부터 32개의 열(여기서, n=32, m=0)을 제외한 영역을 고주파 영역으로 정의할 수 있다. 잔차 블록이 32x64인 경우, 잔차 블록의 상단에서부터 32개의 행(여기서, n=0, m=32)을 제외한 영역을 고주파 영역으로 정의할 수 있다. 또는, 상기 n, m은, 고주파 영역을 특정하기 위해 부호화된 정보에 기초하여 유도될 수도 있다. The derivation may further include setting a residual coefficient of the high frequency region in the residual block to zero. The high frequency region may be defined as an area excluding at least one of n columns or m rows from the top of the residual block. The n and m may be values pre-committed to the encoding / decoding apparatus, or may be variably determined according to the size / shape of the residual block. For example, when the residual block is 64x32, an area excluding 32 columns (here, n = 32, m = 0) from the left side of the residual block may be defined as a high frequency area. When the residual block is 32x64, an area except for 32 rows (where n = 0 and m = 32) from the top of the residual block may be defined as a high frequency area. Alternatively, n and m may be derived based on coded information for specifying a high frequency region.

또한, 상기 잔차 계수를 0으로 설정하는 과정은, 잔차 블록의 크기 또는 형태 중 적어도 하나를 고려하여 선택적으로 수행될 수 있다. 예를 들어, 상기 과정은, 잔차 블록의 크기가 소정의 문턱값보다 크거나 같은 경우에 한하여 적용될 수 있다. 상기 잔차 블록의 크기는 잔차 블록의 너비 또는 높이 중 적어도 하나로 표현될 수 있다. 상기 문턱값은, 잔차 계수를 0으로 설정하는 것이 허용되는 최소 크기를 의미할 수 있다. 상기 문턱값은, 부호화/복호화 장치에 기-약속된 값일 수도 있고, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 문턱값은 32, 64, 128, 256 또는 그 이상일 수 있다. In addition, the step of setting the residual coefficient to 0 may be selectively performed in consideration of at least one of the size or shape of the residual block. For example, the above process may be applied only when the size of the residual block is greater than or equal to a predetermined threshold. The size of the residual block may be expressed by at least one of the width or height of the residual block. The threshold may mean a minimum size that is allowed to set the residual coefficient to zero. The threshold value may be a value pre-committed to the encoding / decoding apparatus, or may be encoded and signaled by the encoding apparatus. The threshold may be 32, 64, 128, 256 or more.

상기 잔차 계수를 0으로 설정하는 과정은 플래그 정보에 기초하여 선택적으로 수행될 수도 있다. 상기 플래그 정보는, 잔차 블록 내 고주파 영역의 잔차 계수를 0으로 설정하는지 여부를 나타낼 수 있다. 상기 플래그 정보는, 잔차 블록의 크기/형태에 기초하여 복호화 장치에서 유도될 수도 있고, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 다만, 상기 과정은, 잔차 블록이 변환 스킵 모드로 부호화되지 않은 경우에 한하여 수행되도록 제한될 수도 있다. 따라서, 부호화 장치는, 잔차 블록이 변환 스킵 모드로 부호화되는 경우, 잔차 계수를 0으로 설정하기 위해 필요한 정보를 부호화하지 않을 수 있다.The step of setting the residual coefficient to 0 may be selectively performed based on flag information. The flag information may indicate whether the residual coefficient of the high frequency region in the residual block is set to zero. The flag information may be derived from the decoding apparatus based on the size / shape of the residual block, or may be encoded and signaled by the encoding apparatus. However, the above process may be limited to be performed only when the residual block is not encoded in the transform skip mode. Therefore, when the residual block is encoded in the transform skip mode, the encoding apparatus may not encode information necessary for setting the residual coefficient to zero.

도 5를 참조하면, 상기 잔차 블록에 대한 양자화 파라미터를 산출할 수 있다(S510).Referring to FIG. 5, a quantization parameter for the residual block may be calculated (S510).

양자화 파라미터는 양자화 파라미터 예측값(QPpred) 또는 양자화 파라미터 차분값(deltaQP) 중 적어도 하나를 이용하여 유도될 수 있다. 다시 말해, 양자화 파라미터는, 양자화 파라미터 예측값(QPpred)으로 설정될 수도 있고, 양자화 파라미터 예측값(QPpred)에 양자화 파라미터 차분값(deltaQP)을 가산하여 유도될 수도 있다. The quantization parameter may be derived using at least one of a quantization parameter prediction value QPpred or a quantization parameter difference value deltaQP. In other words, the quantization parameter may be set to the quantization parameter prediction value QPpred or derived by adding the quantization parameter difference value deltaQP to the quantization parameter prediction value QPpred.

일예로, 머지 모드(merge mode), 스킵 모드(skip mode), 비-변환 모드(no-transform mode), PCM 모드, 넌-제로 계수가 존재하지 않는 경우(즉, coded block flag=0) 등과 같이 해당 블록에 대해 역양자화가 불필요한 경우, 양자화 파라미터 차분값(deltaQP)가 부호화되지 않을 수 있다. 이 경우, 양자화 파라미터 예측값(QPpred)이 양자화 파라미터로 설정될 수 있다.For example, merge mode, skip mode, no-transform mode, PCM mode, non-zero coefficients are not present (i.e. coded block flag = 0), and the like. Likewise, when inverse quantization is unnecessary for the block, the quantization parameter difference value deltaQP may not be encoded. In this case, the quantization parameter prediction value QPpred may be set as the quantization parameter.

상기 양자화 파라미터 예측값(QPpred)을 유도하는 방법에 대해서는 도 6 및 도 7을 참조하여 살펴 보기로 한다. 한편, 상기 양자화 파라미터 차분값(deltaQP)는 소정의 단위로 시그날링될 수 있으며, 양자화 파라미터 차분값(deltaQP)의 시그날링 단위에 기반한 양자화 파라미터 유도 방법에 대해서는 도 8을 참조하여 살펴 보도록 한다.A method of deriving the quantization parameter prediction value QPpred will be described with reference to FIGS. 6 and 7. Meanwhile, the quantization parameter difference value deltaQP may be signaled in a predetermined unit, and a quantization parameter derivation method based on the signaling unit of the quantization parameter difference value deltaQP will be described with reference to FIG. 8.

상기 양자화 파라미터의 산출은, 소정의 양자화 파라미터 오프셋(QPoffset)에 기반하여, 앞서 유도된 양자화 파라미터를 보정하는 과정을 더 포함할 수도 있다. The calculation of the quantization parameter may further include correcting the previously derived quantization parameter based on a predetermined quantization parameter offset (QPoffset).

상기 양자화 파라미터 오프셋(QPoffset)은, 부호화/복호화 장치에 기-약속된 고정된 값일 수도 있고, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 상기 양자화 파라미터 오프셋(QPoffset)은, 비디오 시퀀스, 픽쳐, 슬라이스, 타일 또는 블록 단위 중 적어도 하나의 레벨에서 시그날링될 수 있다. 상기 양자화 파라미터 오프셋이 시그날링되는 단위는, 양자화 파라미터 차분값이 시그날링되는 단위보다 클 수 있다. 상기 상기 양자화 파라미터 오프셋(QPoffset)의 값 및 개수는 블록 크기/형태, 분할 횟수, 예측 모드, 인트라 예측 모드, 성분 타입(e.g., 휘도, 색차) 등에 따라 적응적으로 결정될 수 있다.The quantization parameter offset QPoffset may be a fixed value pre-committed to the encoding / decoding apparatus, or may be encoded and signaled by the encoding apparatus. The quantization parameter offset QPoffset may be signaled at at least one level of a video sequence, a picture, a slice, a tile, or a block unit. The unit in which the quantization parameter offset is signaled may be larger than the unit in which the quantization parameter difference value is signaled. The value and number of the quantization parameter offsets QPoffset may be adaptively determined according to the block size / shape, the number of divisions, the prediction mode, the intra prediction mode, the component type (e.g., luminance, color difference), and the like.

상기 양자화 파라미터 오프셋의 개수는, 1개, 2개, 3개 또는 그 이상일 수 있다. 예를 들어, 양자화 파라미터 오프셋은, 픽쳐 레벨, 슬라이스 레벨 또는 블록 레벨 중 적어도 하나에서 정의될 수 있다. 상기 양자화 파라미터 오프셋은, 인트라 모드와 인터 모드 각각에 대해서 정의될 수도 있고, 휘도 성분과 색차 성분 각각에 대해서 정의될 수도 있다. 또는, 인트라 예측 모드 중 LM 모드를 위한 별도의 오프셋이 정의될 수도 있다. 여기서, LM 모드는, 색차 블록이 휘도 블록의 예측/복원 샘플을 이용하여 예측되는 모드를 의미할 수 있다.The number of quantization parameter offsets may be one, two, three, or more. For example, the quantization parameter offset may be defined at at least one of a picture level, slice level, or block level. The quantization parameter offset may be defined for each of the intra mode and the inter mode, and may be defined for each of the luminance component and the chrominance component. Alternatively, a separate offset for the LM mode among the intra prediction modes may be defined. Here, the LM mode may mean a mode in which the color difference block is predicted using the prediction / reconstruction samples of the luminance block.

도 5를 참조하면, 산출된 양자화 파라미터를 이용하여 상기 잔차 계수에 대해 역양자화를 수행할 수 있다(S520).Referring to FIG. 5, inverse quantization may be performed on the residual coefficient using the calculated quantization parameter (S520).

구체적으로, 상기 역양자화는, 상기 양자화 파라미터 또는 소정의 레벨 스케일값(level scale value) 중 적어도 하나에 기초하여 수행될 수 있다. 상기 레벨 스케일값은, 부호화/복호화 장치에 기-약속된 값일 수도 있고, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 레벨 스케일값은, 1차원 배열의 k개 정수값으로 구성될 수 있다. 예를 들어, 상기 레벨 스케일값은 {40, 45, 51, 57, 64, 72}로 정의될 수 있다. 다만, 이는 레벨 스케일값의 개수 및 정수값을 한정하는 것은 아니다. 즉, 레벨 스케일값은 다른 값으로 정의될 수 있고, 레벨 스케일값의 개수는 4개, 5개, 7개, 8개 또는 그 이상으로 정의될 수도 있다.Specifically, the inverse quantization may be performed based on at least one of the quantization parameter or a predetermined level scale value. The level scale value may be a value pre-committed to the encoding / decoding apparatus, or may be encoded and signaled by the encoding apparatus. The level scale value may be composed of k integer values in a one-dimensional array. For example, the level scale value may be defined as {40, 45, 51, 57, 64, 72}. However, this does not limit the number of level scale values and integer values. That is, the level scale values may be defined as other values, and the number of level scale values may be defined as four, five, seven, eight, or more.

한편, 상기 역양자화의 결과값에 소정의 양자화 가중치(m)가 더 적용될 수도 있으며, 이러한 과정을 스케일링(Scaling)이라 부르기로 한다.Meanwhile, a predetermined quantization weight m may be further applied to the result of inverse quantization, and this process will be referred to as scaling.

상기 양자화 가중치는, 부호화/복호화 장치에 기-약속된 고정된 값으로 유도될 수 있다(A 방법). 이때, 양자화 가중치는, 잔차 블록 내 잔차 계수의 위치에 관계없이 하나의 동일한 값일 수 있다. 또는, 상기 양자화 가중치는, 부호화/복호화 장치에 기-정의된 테이블 정보에 기초하여 유도될 수 있다(B 방법). 상기 테이블 정보는, 잔차 계수의 위치, 블록 크기, 성분 타입 또는 예측 모드 중 적어도 하나에 따른 양자화 가중치를 정의할 수 있다. 또는, 부호화 장치는 잔차 계수의 위치 별로 상기 양자화 가중치를 결정하고, 이를 부호화할 수 있다. 복호화 장치는, 상기 부호화된 양자화 가중치에 관한 정보를 복호화하여, 상기 양자화 가중치를 유도할 수 있다(C 방법). 이때, 부호화 장치는, 이전 위치의 양자화 가중치와 현재 위치의 양자화 가중치 간의 차이만을 부호화할 수 있다. 복호화 장치는, 복호화된 이전 위치의 양자화 가중치와 상기 부호화된 정보를 이용하여, 현재 위치의 양자화 가중치를 유도할 수 있다.The quantization weight may be derived as a fixed value pre-committed to the encoding / decoding apparatus (method A). In this case, the quantization weight may be one same value regardless of the position of the residual coefficient in the residual block. Alternatively, the quantization weight may be derived based on table information pre-defined in the encoding / decoding apparatus (B method). The table information may define a quantization weight according to at least one of a position of a residual coefficient, a block size, a component type, or a prediction mode. Alternatively, the encoding apparatus may determine the quantization weight for each position of the residual coefficient and encode the same. The decoding apparatus may decode the information about the encoded quantization weight to derive the quantization weight (C method). In this case, the encoding apparatus may encode only a difference between the quantization weight of the previous position and the quantization weight of the current position. The decoding apparatus may derive the quantization weight of the current position by using the decoded quantization weight of the previous position and the encoded information.

상기 잔차 블록의 양자화 가중치는, 전술한 A 방법 내지 C 방법 중 어느 하나를 선택하여 유도될 수 있다. 상기 선택은, 잔차 블록의 크기/형태, 분할 타입, 예측 모드, 성분 타입, 변환 타입 또는 소정의 플래그 정보 중 적어도 하나에 기초하여 수행될 수 있다. 상기 플래그 정보는, 양자화 가중치 적용 여부에 관한 플래그, 변환 스킵 여부에 관한 플래그 등을 포함할 수 있다.The quantization weight of the residual block may be derived by selecting any one of methods A to C described above. The selection may be performed based on at least one of the size / shape of the residual block, partition type, prediction mode, component type, transform type, or predetermined flag information. The flag information may include a flag indicating whether quantization weight is applied, a flag indicating whether to skip transform, and the like.

전술한 A 방법 내지 C 방법에 있어서, 상기 스케일링 리스트의 양자화 가중치는, 휘도 블록과 색차 블록 각각에 대해서 결정될 수 있다. 예를 들어, 휘도 블록과 색차 블록 각각에 대한 스케일링 리스트가 시그날링될 수 있다. 또는, 색차 블록의 스케일링 리스트는, 상기 휘도 블록의 스케일링 리스트를 참조하여 결정될 수도 있다.In the above-described method A to C, the quantization weight of the scaling list may be determined for each of the luminance block and the chrominance block. For example, scaling lists for each of the luminance block and the chrominance block may be signaled. Alternatively, the scaling list of the chrominance block may be determined with reference to the scaling list of the luminance block.

도 5를 참조하면, 역양자화된 잔차 계수에 역변환을 수행하여 잔차 샘플을 복원할 수 있다(S530).Referring to FIG. 5, a residual sample may be restored by performing inverse transform on an inverse quantized residual coefficient (S530).

상기 역변환은 소정의 변환 타입을 기반으로 수행되며, 상기 잔차 블록의 변환 타입은 변환 후보 세트에 기초하여 결정될 수 있다. 상기 변환 후보 세트는, n개의 변환 타입을 포함할 수 있다. 예를 들어, 상기 변환 후보 세트는, DCT-II, DCT-V, DCT-VIII, DST-I 또는 DST-VII 중 적어도 하나를 포함할 수 있다.The inverse transform is performed based on a predetermined transform type, and the transform type of the residual block may be determined based on a transform candidate set. The transform candidate set may include n transform types. For example, the transform candidate set may include at least one of DCT-II, DCT-V, DCT-VIII, DST-I, or DST-VII.

부호화/복호화 장치에서, m개의 변환 후보 세트가 정의될 수 있다. 상기 m은 1, 2, 3 또는 그 이상일 수 있다. 상기 m개의 변환 후보 세트 중 어느 하나(이하, 제1 변환 후보 세트라 함)에 속한 변환 타입의 개수 및/또는 종류는 다른 하나(이하, 제2 변환 후보 세트라 함)와 상이할 수 있다. 예를 들어, 제1 변환 후보 세트는 p개의 변환 타입으로 구성되고, 제2 변환 후보 세트는 p보다 작은 q개의 변환 타입으로 구성될 수 있다. 또는, 제1 및 제2 변환 후보 세트가 동일한 개수의 변환 타입으로 구성된 경우라도, 제1 변환 후보 세트에 속한 적어도 하나의 변환 타입은, 제2 변환 후보 세트에 속한 변환 타입과 상이할 수 있다.In the encoding / decoding apparatus, m transform candidate sets may be defined. M may be 1, 2, 3 or more. The number and / or types of transform types belonging to any one of the m transform candidate sets (hereinafter, referred to as a first transform candidate set) may be different from the other (hereinafter, referred to as a second transform candidate set). For example, the first transform candidate set may consist of p transform types, and the second transform candidate set may consist of q transform types smaller than p. Alternatively, even when the first and second transform candidate sets are configured with the same number of transform types, at least one transform type belonging to the first transform candidate set may be different from the transform type belonging to the second transform candidate set.

상기 m개의 변환 후보 세트 중 어느 하나가 선택적으로 이용될 수 있다. Any one of the m transform candidate sets may be selectively used.

상기 변환 후보 세트의 선택은, 잔차 블록의 크기에 기초하여 수행될 수 있다. 예를 들어, 잔차 블록의 크기가 문턱값보다 작거나 같은 경우, p개의 변환 타입으로 구성된 제1 변환 후보 세트가 선택되고, 그렇지 않은 경우, q개의 변환 타입으로 구성된 제2 변환 후보 세트가 선택될 수 있다. 상기 문턱값은, 32, 64, 128, 256 또는 그 이상일 수 있고, 상기 p는 q보다 큰 값일 수 있다. The selection of the transform candidate set may be performed based on the size of the residual block. For example, if the size of the residual block is less than or equal to the threshold, a first transform candidate set consisting of p transform types is selected, otherwise a second transform candidate set composed of q transform types is selected. Can be. The threshold may be 32, 64, 128, 256 or more, and p may be greater than q.

또는, 상기 변환 후보 세트의 선택은, 부호화 장치로부터 시그날링되는 정보에 기초하여 수행될 수 있다. 상기 정보는, m개의 변환 후보 세트 중 어느 하나를 특정할 수 있다. 상기 정보는 픽쳐, 슬라이스 또는 블록 중 적어도 하나의 레벨에서 시그날링될 수 있다. Alternatively, the selection of the transform candidate set may be performed based on information signaled from the encoding apparatus. The information may specify any one of m transform candidate sets. The information may be signaled at at least one level of a picture, slice, or block.

상기 선택된 변환 후보 타입이 복수의 변환 타입을 포함한 경우, 부호화 장치는 복수의 변환 타입 중 어느 하나를 특정하는 정보를 부호화할 수 있다. 복호화 장치는, 상기 부호화된 정보를 복호화하여 상기 잔차 블록의 변환 타입을 결정할 수 있다. If the selected transform candidate type includes a plurality of transform types, the encoding apparatus may encode information specifying any one of the plurality of transform types. The decoding apparatus may determine the transform type of the residual block by decoding the encoded information.

한편, 상기 역변환은, 소정의 플래그에 기초하여 선택적으로 수행될 수도 있다. 여기서, 플래그는 잔차 블록에 대해 역변환이 스킵되는지 여부를 나타낼 수 있다. 예를 들어, 상기 플래그가 1인 경우, 잔차 블록에 대해 역변환이 수행되지 아니하고, 상기 플래그가 0인 경우, 상기 잔차 블록에 대해 역변환이 수행될 수 있다. 따라서, 상기 잔차 블록의 변환 타입은, 상기 플래그가 0인 경우에 한하여 유도될 수 있다. 또는, 상기 역변환은, 잔차 블록의 속성에 기초하여 선택적으로 수행될 수 있다. 복호화 장치는, 잔차 블록의 속성에 기반하여, 역변환이 스킵되는지 여부를 결정할 수도 있다. 상기 속성은, 잔차 블록의 크기/형태, 분할 타입, 예측 모드, 성분 타입, 기타 잔차 계수 관련 부호화 파라미터 등을 의미할 수 있다. Meanwhile, the inverse transformation may be selectively performed based on a predetermined flag. Here, the flag may indicate whether an inverse transform is skipped with respect to the residual block. For example, when the flag is 1, inverse transform may not be performed on the residual block, and when the flag is 0, inverse transform may be performed on the residual block. Therefore, the transform type of the residual block may be derived only when the flag is zero. Alternatively, the inverse transform may be selectively performed based on the property of the residual block. The decoding apparatus may determine whether the inverse transform is skipped based on the attribute of the residual block. The attribute may mean a size / shape of a residual block, a partition type, a prediction mode, a component type, other residual coefficient related encoding parameters, and the like.

상기 역변환(이하, 제1 역변환) 외에 추가적인 역변환(이하, 제2 역변환이라 함)이 더 수행될 수도 있으며, 이는 도 9를 참조하여 살펴 보기로 한다.In addition to the inverse transform (hereinafter, referred to as a first inverse transform), an additional inverse transform (hereinafter, referred to as a second inverse transform) may be further performed, which will be described with reference to FIG. 9.

도 6은 본 발명이 적용되는 일실시예로서, 양자화 파라미터 예측값(QPpred)을 유도하는 방법을 도시한 것이다.6 illustrates a method of deriving a quantization parameter prediction value QPpred according to an embodiment to which the present invention is applied.

도 6을 참조하면, 블록 T에 대한 양자화 파라미터 예측값(QPpred)은, 주변 블록의 양자화 파라미터에 기초하여 유도될 수 있다. 상기 블록 T는 NxM 크기의 블록이고, 정방형 또는 비정방형일 수 있다. Referring to FIG. 6, the quantization parameter prediction value QPpred for the block T may be derived based on the quantization parameter of the neighboring block. The block T is an NxM size block and may be square or non-square.

상기 주변 블록은, 상기 블록 T에 공간적/시간적으로 인접한 블록으로서, 블록 T 이전에 기-복호화된 블록을 의미할 수 있다. 예를 들어, 상기 주변 블록은, 블록 T의 좌측 블록, 상단 블록, 좌상단 블록, 우상단 블록 또는 좌하단 블록 중 적어도 하나를 포함할 수 있다. 또는, 상기 주변 블록은, 상기 블록 T에 시간적으로 대응하는 콜 블록(collocated block)을 더 포함할 수도 있다. 상기 콜 블록은, 상기 블록 T와 다른 픽쳐에 속하는 블록으로서, 상기 블록 T의 좌상단 코너 샘플, 우하단 코너 샘플 또는 중앙 샘플 중 적어도 하나의 위치를 포함하는 블록으로 정의될 수 있다.The neighboring block may be a block spatially / temporally adjacent to the block T and may mean a block pre-decoded before the block T. For example, the peripheral block may include at least one of a left block, an upper block, an upper left block, an upper right block, or a lower left block of the block T. Alternatively, the neighboring block may further include a collocated block corresponding to the block T in time. The call block is a block belonging to a picture different from the block T, and may be defined as a block including at least one position of an upper left corner sample, a lower right corner sample, or a center sample of the block T.

상기 주변 블록의 위치는, 부호화/복호화 장치에 기-약속된 위치일 수 있다. 예를 들어, 상기 기-약속된 위치는, 좌측 블록 및 상단 블록일 수도 있고, 좌측 블록, 상단 블록 및 좌상단 블록일 수도 있다. 다만, 이에 한정되지 아니하며, 좌하단 블록, 우상단 블록 등을 더 포함할 수도 있다. 상기 주변 블록의 위치는, 블록 T 또는 주변 블록 중 적어도 하나의 속성(e.g., 크기, 형태, 분할 뎁스, 분할 타입, 성분 타입 등)에 기초하여 가변적으로 결정될 수도 있다. 예를 들어, 상기 주변 블록은, 블록 T에 인접한 블록 중 가장 면적이 큰 블록으로 결정될 수도 있고, 상호 인접한 경계의 길이가 가장 긴 블록으로 결정될 수도 있다. 이는 블록 T의 상단 블록과 좌측 블록에 대해서 각각 수행될 수 있다.The position of the neighboring block may be a position pre-committed to the encoding / decoding apparatus. For example, the pre-committed position may be a left block and an upper block, or may be a left block, an upper block and an upper left block. However, the present invention is not limited thereto and may further include a lower left block and a right upper block. The location of the neighboring block may be variably determined based on an attribute (e.g., size, shape, division depth, division type, component type, etc.) of the block T or the neighboring block. For example, the neighboring block may be determined as the block having the largest area among the blocks adjacent to the block T, or may be determined to be the block having the longest boundary length. This may be performed for the upper block and the left block of the block T, respectively.

또는, 상기 주변 블록의 위치를 특정하는 정보가 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 정보는, 플래그, 인덱스 등의 형태로 부호화될 수 있다. 예를 들어, 상기 정보가 인덱스 0인 경우, 블록 T의 양자화 파라미터 예측값(QPpred)은 좌측 블록의 양자화 파라미터를 이용하여 유도될 수 있다. 상기 정보가 인덱스 1인 경우, 블록 T의 양자화 파라미터 예측값(QPpred)은 상단 블록의 양자화 파라미터를 이용하여 유도될 수 있다.Alternatively, information specifying the position of the neighboring block may be encoded and signaled by an encoding apparatus. The information may be encoded in the form of a flag, an index, or the like. For example, when the information is index 0, the quantization parameter prediction value QPpred of the block T may be derived using the quantization parameter of the left block. When the information is index 1, the quantization parameter prediction value QPpred of the block T may be derived using the quantization parameter of the upper block.

상기 주변 블록의 개수는 n개이며, 여기서 n은 1, 2, 3, 4 또는 그 이상의 자연수일 수 있다. 상기 개수는, 부호화/복호화 장치에서 기-약속된 고정된 값일 수 있다. 또는, 상기 개수는, 블록 T 또는 주변 블록 중 적어도 하나의 속성(e.g., 크기, 형태, 분할 뎁스, 분할 타입, 성분 타입 등)에 기초하여 가변적으로 결정될 수도 있다. 또는, 상기 블록 T의 양자화 파라미터 예측값(QPpred)을 유도하기 위해 이용되는 주변 블록의 최대 개수 정보가, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 즉, 블록 T는 상기 최대 개수 정보에 따른 개수 범위 내의 주변 블록을 이용할 수 있다. 상기 최대 개수 정보는, 비디오 시퀀스, 픽쳐, 기타 조각 영역(e.g., 슬라이스, 타일, Coding Tree Block row, 블록) 중 적어도 하나의 레벨에서 시그날링될 수 있다.The number of neighboring blocks is n, where n may be 1, 2, 3, 4 or more natural numbers. The number may be a fixed value pre-committed by the encoding / decoding apparatus. Alternatively, the number may be variably determined based on at least one attribute (e.g., size, shape, split depth, split type, component type, etc.) of the block T or neighboring blocks. Alternatively, the maximum number information of neighboring blocks used to derive the quantization parameter prediction value QPpred of the block T may be encoded and signaled by the encoding apparatus. That is, the block T may use neighboring blocks within the number range according to the maximum number information. The maximum number information may be signaled at at least one level of a video sequence, a picture, and other fragment regions (e.g. slice, tile, Coding Tree Block row, block).

전술한 바와 같이, 블록 T의 양자화 파라미터 예측값(QPpred)은 하나 또는 그 이상의 주변 블록을 이용하여 유도될 수 있다. As described above, the quantization parameter prediction value QPpred of the block T may be derived using one or more neighboring blocks.

복수의 주변 블록이 이용되는 경우, 블록 T의 양자화 파라미터 예측값(QPpred)은, 복수의 주변 블록의 양자화 파라미터의 중간값, 평균값, 최소값, 최대값 또는 최빈값 등의 연산 과정을 통해서 유도될 수 있다. When a plurality of neighboring blocks are used, the quantization parameter predicted value QPpred of the block T may be derived through a calculation process such as an intermediate value, an average value, a minimum value, a maximum value, or a mode value of the quantization parameters of the plurality of neighboring blocks.

또는, 블록 T의 양자화 파라미터 예측값(QPpred)은, 상단 블록의 QP와 좌측 블록의 QP의 합에서 좌상단 블록의 QP를 뺌으로써 유도될 수도 있다. 이때, 상단 블록 또는 좌측 블록이 복수개인 경우, 상기 상단 블록 또는 좌측 블록의 QP는 중간값, 평균값, 최소값, 최대값 또는 최빈값 등의 연산 과정을 통해서 결정될 수 있다.Alternatively, the quantization parameter prediction value QPpred of the block T may be derived by subtracting the QP of the upper left block from the sum of the QP of the upper block and the QP of the left block. In this case, when there are a plurality of upper blocks or left blocks, the QP of the upper block or the left block may be determined through a calculation process such as an intermediate value, an average value, a minimum value, a maximum value, or a mode value.

상기 주변 블록 중 비가용 블록이 존재하는 경우, 상기 블록 T의 양자화 파라미터 예측값은, 가용인 주변 블록만을 이용하여 유도될 수 있다. 또는, 상기 주변 블록이 비가용인 경우, 상기 주변 블록의 양자화 파라미터는 소정의 조각 영역에서 정의된 양자화 파라미터에 기초하여 유도될 수 있다. 상기 조각 영역은, 슬라이스, 타일, Coding Tree Block row, 블록 등을 의미할 수 있다. 상기 조각 영역은, 블록 T 이전에 부호화/복호화된 영역을 의미할 수도 있고, 현재 부호화/복호화 대상인 블록 T가 속한 영역을 의미할 수도 있다. 상기 비가용이라 함은, 상기 주변 블록이 물리적으로 존재하지 않는 경우일 수도 있고, 부호화/복호화 장치의 규칙에 의해 참조가 불가능한 경우를 의미할 수도 있다. 예를 들어, 블록 T와 주변 블록이 서로 다른 병렬 처리 영역(e.g., 슬라이스, 타일 등)에 속하는 경우, 블록 T는 상기 주변 블록을 참조하는 것이 허용되지 않을 수 있다.When there is an unavailable block among the neighboring blocks, the quantization parameter predicted value of the block T may be derived using only available neighboring blocks. Alternatively, when the neighboring block is not available, the quantization parameter of the neighboring block may be derived based on the quantization parameter defined in the predetermined fragment area. The fragment area may mean a slice, a tile, a Coding Tree Block row, a block, or the like. The fragment region may mean a region coded / decoded before the block T or a region to which a block T which is currently encoded / decoded belongs belongs. The unavailability may refer to a case in which the neighboring block does not exist physically or may be a case in which reference is impossible due to a rule of an encoding / decoding apparatus. For example, if the block T and the neighboring block belong to different parallel processing regions (e.g. slice, tile, etc.), the block T may not be allowed to refer to the neighboring block.

도 7은 본 발명이 적용되는 일실시예로서, 블록 T의 색차 성분에 관한 양자화 파라미터 예측값을 유도하는 방법을 도시한 것이다.FIG. 7 illustrates a method of deriving a quantization parameter prediction value about a color difference component of a block T according to an embodiment to which the present invention is applied.

이하, 블록 T의 휘도 성분과 색차 성분을 각각 휘도 블록과 색차 블록이라 부르기로 한다.Hereinafter, the luminance component and the chrominance component of the block T will be referred to as the luminance block and the chrominance block, respectively.

4:2:0 칼라 포맷인 경우, 색차 블록(Tc)은 휘도 블록(TY)에 대응될 수 있다. 색차 블록의 양자화 파라미터 예측값은, 대응하는 휘도 블록의 양자화 파라미터를 이용하여 유도될 수 있다. In the 4: 2: 0 color format, the chrominance block Tc may correspond to the luminance block TY. The quantization parameter prediction value of the chrominance block may be derived using the quantization parameter of the corresponding luminance block.

다만, 도 7에 도시된 바와 같이, 휘도 블록과 색차 블록 간의 분할 구조가 상이할 수 있다. 이 경우, 색차 블록에 대응하는 휘도 블록이 복수개일 수 있다. 색차 블록의 양자화 파라미터 예측값은, 복수의 휘도 블록 중 어느 하나의 양자화 파라미터를 이용하여 유도될 수 있다. 이때, 색차 블록의 중앙 샘플의 위치 또는 좌상단 샘플의 위치에 대응하는 휘도 블록이 이용될 수 있다. 색차 블록과 겹치는 면적이 가장 큰 휘도 블록이 이용될 수도 있다. 또는, 색차 블록의 양자화 파라미터 예측값은, 복수의 휘도 블록의 양자화 파라미터의 평균값, 중간값, 최소값, 최대값, 최빈값 등의 연산을 통해 유도될 수 있다. However, as shown in FIG. 7, the division structure between the luminance block and the chrominance block may be different. In this case, there may be a plurality of luminance blocks corresponding to the color difference blocks. The quantization parameter predicted value of the chrominance block may be derived using any one of the plurality of luminance blocks. In this case, a luminance block corresponding to the position of the center sample of the chrominance block or the position of the upper left sample may be used. The luminance block with the largest area overlapping with the chrominance block may be used. Alternatively, the quantization parameter prediction value of the chrominance block may be derived through calculation of an average value, a median value, a minimum value, a maximum value, and a mode value of the quantization parameters of the plurality of luminance blocks.

색차 블록의 양자화 파라미터 예측값은, 주변 블록의 양자화 파라미터를 이용하여 유도될 수도 있으며, 이는 도 6에서 자세히 살펴 보았는바, 여기서 자세한 설명은 생략하기로 한다.The quantization parameter prediction value of the chrominance block may be derived using the quantization parameter of the neighboring block, which has been described in detail with reference to FIG. 6, and a detailed description thereof will be omitted.

전술한 바와 같이, 색차 블록의 양자화 파라미터 예측값은, 대응하는 휘도 블록의 양자화 파라미터를 이용하는 방법(제1 방법)과 색차 블록의 주변 블록의 양자화 파라미터를 이용하는 방법(제2 방법)을 모두 이용하여 유도될 수 있다. 또는, 색차 블록의 양자화 파라미터 예측값은, 제1 방법 또는 제2 방법 중 어느 하나를 선택하여 유도될 수도 있다. As described above, the quantization parameter predicted value of the chrominance block is derived using both the method of using the quantization parameter of the corresponding luminance block (first method) and the method of using the quantization parameter of the neighboring block of the chrominance block (second method). Can be. Alternatively, the quantization parameter prediction value of the chrominance block may be derived by selecting either the first method or the second method.

상기 선택은, 휘도 블록과 색차 블록의 분할 구조 동일 여부, 블록 T의 예측 모드, 인트라 예측 모드, 칼라 포맷 또는 크기/형태 등을 고려하여 수행될 수 있다. 예를 들어, 블록 T가 인터 모드로 부호화되고, 색차 블록의 분할 구조가 휘도 블록의 분할 구조와 동일한 경우, 상기 색차 블록의 양자화 파라미터는 상기 제1 방법을 이용하여 예측될 수 있다. 또는, 색차 블록의 분할 구조가 휘도 블록의 분할 구조와 동일한 경우에는 상기 제1 방법이 이용되고, 그렇지 않은 경우에는 상기 제2 방법이 이용될 수 있다. 또는, 블록 T의 인트라 예측 모드가 LM 모드인 경우, 색차 블록의 양자화 파라미터는 상기 제1 방법을 이용하여 예측될 수 있다. The selection may be performed in consideration of whether the luminance block and the chrominance block have the same division structure, the prediction mode of the block T, the intra prediction mode, the color format, or the size / shape. For example, when the block T is encoded in the inter mode, and the division structure of the chrominance block is the same as the division structure of the luminance block, the quantization parameter of the chrominance block may be predicted using the first method. Alternatively, when the division structure of the chrominance block is the same as the division structure of the luminance block, the first method may be used, otherwise the second method may be used. Alternatively, when the intra prediction mode of the block T is the LM mode, the quantization parameter of the chrominance block may be predicted using the first method.

또는, 상기 선택은, 제1 방법 또는 제2 방법 중 어느 하나를 특정하는 정보에 기초하여 수행될 수도 있다. 상기 정보는, 부호화 장치에서 부호화되어 시그날링될 수 있다. 상기 정보는, 비디오 시퀀스, 픽쳐, 기타 조각 영역(e.g., 슬라이스, 타일, Coding Tree Block row, 블록) 중 적어도 하나의 레벨에서 시그날링될 수 있다.Alternatively, the selection may be performed based on information specifying either the first method or the second method. The information may be encoded and signaled by the encoding apparatus. The information may be signaled at at least one level of a video sequence, a picture, and other fragment regions (e.g. slice, tile, Coding Tree Block row, block).

상기 색차 블록의 양자화 파라미터는, 상기 유도된 색차 블록의 양자화 파라미터 예측값과 동일하게 유도될 수도 있고, 소정의 양자화 파라미터 차분값이 가산되어 유도될 수도 있다. 또한, 상기 유도된 양자화 파라미터는 소정의 양자화 파라미터 오프셋을 이용하여 보정될 수 있으며, 이는 도 5에서 살펴본 바와 같다.The quantization parameter of the chrominance block may be derived in the same manner as the quantization parameter predicted value of the derived chrominance block, or may be derived by adding a predetermined quantization parameter difference value. In addition, the derived quantization parameter may be corrected using a predetermined quantization parameter offset, as shown in FIG. 5.

일예로, LM 모드로 부호화된 색차 블록의 경우, 양자화 파라미터 예측값이 양자화 파라미터로 설정될 수 있다. 이 경우, 양자화 파라미터 차분값이 시그날링되지 않거나, 시그날링된 양자화 파라미터 차분값을 가산하는 과정이 생략될 수 있다. 또는, LM 모드로 부호화된 색차 블록의 경우, 양자화 파라미터는 1개, 2개 또는 그 이상의 양자화 파라미터 오프셋을 이용하여 보정될 수 있다.For example, in the case of a color difference block encoded in the LM mode, the quantization parameter prediction value may be set as the quantization parameter. In this case, the quantization parameter difference value may not be signaled, or the process of adding the signaled quantization parameter difference value may be omitted. Alternatively, in the case of the color difference block encoded in the LM mode, the quantization parameter may be corrected using one, two or more quantization parameter offsets.

도 8은 본 발명이 적용되는 일실시예로서, 양자화 파라미터 차분값(deltaQP)의 시그날링 단위에 기반한 양자화 파라미터 유도 방법을 도시한 것이다.FIG. 8 illustrates a method of deriving a quantization parameter based on a signaling unit of a quantization parameter difference value deltaQP according to an embodiment to which the present invention is applied.

부호화 장치는, deltaQP을 부호화하는 블록의 단위를 결정하고, 상기 블록의 크기를 나타내는 정보를 부호화할 수 있다. 여기서, 크기는, 블록의 너비 또는 높이 중 적어도 하나, 너비와 높이의 곱, 너비와 높이의 합, 너비와 높이 중 최소값/최대값 등으로 표현될 수 있다. 복호화 장치는, 상기 시그날링되는 정보를 복호화하여, deltaQP의 시그날링이 허용되는 블록의 최소 크기를 알 수 있다. 상기 정보는, 비디오 시퀀스, 픽쳐, 슬라이스 또는 타일 중 적어도 하나의 레벨에서 시그날링될 수 있다. 또는, 상기 최소 크기는, 변환 블록의 최소 크기로 유도될 수도 있고, 부호화/복호화 장치에 기-약속된 고정된 크기로 정의될 수도 있다. 예를 들어, 상기 최소 크기는, 4x4, 8x4, 4x8, 8x8 등으로 정의될 수 있다. 상기 블록의 크기를 나타내느 정보는, 휘도 성분과 색차 성분에 대해서 각각 시그날링될 수 있다. 또는, 색차 블록에 대한 최소 크기는, 휘도 블록에 대한 최소 크기에 기초하여 유도될 수도 있다. 예를 들어, 4:2:0 칼라 포맷의 경우, 색차 블록의 최소 크기는, 휘도 블록의 최소 크기의 절반으로 결정될 수 있다. 인터 모드의 경우, 색차 블록의 분할 구조는 휘도 블록의 분할 구조와 상이할 수 있으며, 색차 블록의 최소 크기는 휘도 블록의 절반으로 결정될 수 있다.The encoding apparatus may determine a unit of a block for encoding deltaQP and encode information indicating the size of the block. Here, the size may be expressed by at least one of the width or height of the block, the product of the width and height, the sum of the width and height, the minimum value / maximum value of the width and height, and the like. The decoding apparatus may determine the minimum size of a block that allows signaling of deltaQP by decoding the signaled information. The information may be signaled at at least one level of a video sequence, picture, slice or tile. Alternatively, the minimum size may be derived as the minimum size of the transform block or may be defined as a fixed size pre-committed to the encoding / decoding apparatus. For example, the minimum size may be defined as 4x4, 8x4, 4x8, 8x8, and the like. Information indicating the size of the block may be signaled for the luminance component and the chrominance component, respectively. Alternatively, the minimum size for the chrominance block may be derived based on the minimum size for the luminance block. For example, in the case of the 4: 2: 0 color format, the minimum size of the chrominance block may be determined to be half of the minimum size of the luminance block. In the inter mode, the division structure of the chrominance block may be different from that of the luminance block, and the minimum size of the chrominance block may be determined to be half of the luminance block.

도 8을 참조하면, 현재 블록의 양자화 파라미터는, 현재 블록의 크기와 상기 최소 크기 간의 비교 결과에 기초하여 유도될 수 있다. 여기서, 현재 블록은 QT, BT, TT 등의 블록 분할 타입에 의해서 더 이상 분할되지 않는 블록을 의미할 수 있다.Referring to FIG. 8, the quantization parameter of the current block may be derived based on a comparison result between the size of the current block and the minimum size. Here, the current block may mean a block that is no longer divided by a block division type such as QT, BT, or TT.

도 8(a)는 현재 블록의 크기가 2Mx2N이고, 최소 크기가 MxN인 경우를 도시한 것이다. 도 8(a)와 같이, 상기 현재 블록의 크기가 상기 최소 크기보다 큰 경우, 현재 블록의 양자화 파라미터는, QPpred과 시그날링된 deltaQP을 이용하여 유도될 수 있다. FIG. 8 (a) shows the case where the size of the current block is 2Mx2N and the minimum size is MxN. As shown in FIG. 8A, when the size of the current block is larger than the minimum size, the quantization parameter of the current block may be derived using deltaQP signaled with QPpred.

상기 QPpred은 전술한 제1 방법 또는 제2 방법 중 적어도 하나에 기초하여 유도될 수 있다. 상기 deltaQP은, 블록 a에서 시그날링될 수 있고, 나머지 블록 b, c, d는 블록 a에서 시그날링된 deltaQP을 공유할 수 있다. 이 경우, 현재 블록은 하나의 양자화 파라미터를 가진다. 또는, 상기 deltaQP은, 최소 크기인 블록 a-d에 대해서 각각 시그날링될 수 있다. 이 경우, 현재 블록에 속한 블록 a-d에 대해서 각각 양자화 파라미터가 유도될 수 있고, 블록 a-d는 서로 상이한 양자화 파라미터를 가질 수 있다.The QPpred may be derived based on at least one of the first method or the second method described above. The deltaQP may be signaled in block a, and the remaining blocks b, c and d may share the deltaQP signaled in block a. In this case, the current block has one quantization parameter. Alternatively, the deltaQPs may be signaled for blocks a-d having a minimum size, respectively. In this case, quantization parameters may be derived for blocks a-d belonging to the current block, and blocks a-d may have different quantization parameters.

한편, 상기 현재 블록의 크기와 상기 최소 크기가 동일한 경우, 상기 QPpred과 시그날링된 deltaQP을 이용하여 유도될 수 있음은 물론이다. On the other hand, if the size of the current block and the minimum size is the same, it can of course be derived using the deltaQP signaled with the QPpred.

도 8(b)는 최소 크기가 MxN이고, 현재 블록(a-d)이 최소 크기보다 작은 경우를 도시한 것이다. 도 8(b)와 같이, 상기 현재 블록의 크기가 상기 최소 크기보다 작은 경우, 상기 현재 블록의 양자화 파라미터는, QPpred과 시그날링된 deltaQP을 이용하여 유도될 수 있다. FIG. 8B illustrates a case where the minimum size is MxN and the current blocks a-d are smaller than the minimum size. As shown in FIG. 8B, when the size of the current block is smaller than the minimum size, the quantization parameter of the current block may be derived using deltaQP signaled with QPpred.

상기 QPpred은, 현재 블록을 기준으로, 전술한 제1 방법 또는 제2 방법 중 적어도 하나에 기초하여 유도될 수 있다. 예를 들어, 블록 a-d에 대해서 각각 QPpred이 유도될 수 있다. 또는, 블록 a에 대해서 QPpred이 유도되고, 나머지 블록 b-d는 블록 a에서 유도된 QPpred을 공유할 수 있다. 또는, 상기 QPpred은, 상기 현재 블록의 상위 블록을 기준으로, 전술한 제1 방법 또는 제2 방법 중 적어도 하나에 기초하여 유도될 수도 있다. 여기서, 상위 블록은, 현재 블록을 포함하는 블록으로서, 현재 블록보다 작은 분할 뎁스를 가진 블록일 수 있다. 예를 들어, 현재 블록의 분할 뎁스가 k인 경우, 상위 블록의 분할 뎁스는 (k-1), (k-2) 등일 수 있다. 상기 상위 블록은, 상기 QPpred을 공유하는 블록의 단위로 정의될 수도 있다. 상기 상위 블록은, 상기 최소 크기와 동일한 크기(MxN)로 설정될 수 있다. 또는, 부호화 장치는 상기 QPpred을 공유하는 블록의 단위를 결정하고, 상기 블록의 단위를 특정하는 정보를 부호화할 수도 있다. 복호화 장치는, 상기 부호화된 정보를 기반으로, 상기 상위 블록의 위치, 크기, 형태 등을 특정할 수 있다.The QPpred may be derived based on at least one of the above-described first or second method based on the current block. For example, QPpred may be derived for blocks a-d, respectively. Alternatively, QPpred may be derived for block a, and the remaining blocks b-d may share QPpred derived in block a. Alternatively, the QPpred may be derived based on at least one of the first method or the second method described above, based on an upper block of the current block. Here, the upper block is a block including the current block, and may be a block having a partition depth smaller than that of the current block. For example, when the division depth of the current block is k, the division depth of the higher block may be (k-1), (k-2), or the like. The upper block may be defined in units of blocks that share the QPpred. The upper block may be set to the same size (MxN) as the minimum size. Alternatively, the encoding apparatus may determine a unit of a block sharing the QPpred, and may encode information specifying the unit of the block. The decoding apparatus may specify the position, size, shape, etc. of the upper block based on the encoded information.

상기 deltaQP은, 현재 블록의 상위 블록에서 시그날링된 것일 수 있다. 여기서, 상위 블록은, 현재 블록을 포함하는 블록으로서, 현재 블록보다 작은 분할 뎁스를 가진 블록을 의미할 수 있다. 즉, 현재 블록의 분할 뎁스가 k인 경우, 상위 블록의 분할 뎁스는 (k-1), (k-2) 등일 수 있다. 여기서, 상기 상위 블록은 도 8(b)에 도시된 MxN이라 가정한다. 따라서, 블록 a-d에 대해서 동일한 하나의 양자화 파라미터가 유도될 수도 있고, 블록 a-d 각각에 대해서 서로 상이한 양자화 파라미터가 유도될 수도 있다. 또는, 도 8(b)와 같이, 상기 현재 블록의 크기가 상기 최소 크기보다 작은 경우, 상기 현재 블록의 양자화 파라미터는 QPpred을 이용하여 유도될 수 있다. 이때, deltaQP에 대한 복호화가 생략될 수 있다. 상기 QPpred은, 전술한 바와 같이, 현재 블록 또는 상위 블록을 기준으로, 제1 방법 또는 제2 방법 중 적어도 하나에 기초하여 유도될 수 있으며, 자세한 설명은 생략하기로 한다. 마찬가지로, MxN 블록에 속한 블록 a-d에 대해서 하나의 동일한 양자화 파라미터가 유도될 수도 있고, 블록 a-d 각각에 대해서 서로 상이한 양자화 파라미터가 유도될 수도 있다.The deltaQP may be signaled in an upper block of the current block. Here, the upper block is a block including the current block, and may mean a block having a partition depth smaller than that of the current block. That is, when the division depth of the current block is k, the division depth of the higher block may be (k-1), (k-2), or the like. Here, it is assumed that the upper block is MxN shown in FIG. 8 (b). Thus, the same one quantization parameter may be derived for block a-d, and different quantization parameters may be derived for each of block a-d. Alternatively, as illustrated in FIG. 8B, when the size of the current block is smaller than the minimum size, the quantization parameter of the current block may be derived using QPpred. In this case, decoding of deltaQP may be omitted. As described above, the QPpred may be derived based on at least one of the first method and the second method based on the current block or the higher block, and a detailed description thereof will be omitted. Similarly, one same quantization parameter may be derived for block a-d belonging to the M × N block, and different quantization parameters may be derived for each block a-d.

한편, 특정 블록이 픽쳐, 슬라이스 또는 타일의 경계에 인접한 블록의 경우, 해당 블록은 상기 최소 크기를 만족하지 않을 수 있다. 이 경우, 해당 블록의 양자화 파라미터는 Qppred만을 이용하여 유도되며, deltaQP에 대한 복호화가 생략될 수 있다.Meanwhile, when a specific block is a block adjacent to a boundary of a picture, a slice, or a tile, the block may not satisfy the minimum size. In this case, the quantization parameter of the corresponding block is derived using only Qppred, and decoding for deltaQP may be omitted.

도 9는 본 발명이 적용되는 일실시예로서, 잔차 계수의 역변환 과정을 도시한 것이다.9 illustrates an inverse transformation process of a residual coefficient as an embodiment to which the present invention is applied.

도 9를 참조하면, 잔차 블록의 잔차 샘플은, 잔차 계수에 제1 역변환 또는 제2 역변환 중 적어도 하나를 수행하여 복원될 수 있다. Referring to FIG. 9, a residual sample of a residual block may be restored by performing at least one of a first inverse transform or a second inverse transform on a residual coefficient.

상기 제2 역변환은, 잔차 블록의 전체 영역에 적용될 수도 있고, 잔차 블록 내 일부 영역에만 적용될 수도 있다. 상기 일부 영역은, 상기 잔차 블록 내 저주파 영역을 의미할 수 있다. 상기 제2 역변환이 적용되는 영역은, 잔차 블록의 크기/형태 또는 제2 역변환의 변환 행렬의 크기/형태 중 적어도 하나를 고려하여 가변적으로 결정될 수 있다.The second inverse transform may be applied to the entire area of the residual block or may be applied to only a partial area of the residual block. The partial region may mean a low frequency region within the residual block. The region to which the second inverse transform is applied may be variably determined in consideration of at least one of the size / shape of the residual block or the size / shape of the transform matrix of the second inverse transform.

예를 들어, 잔차 블록의 너비 또는 높이 중 어느 하나가 8과 같거나 큰 경우, 8x8의 변환 행렬을 가진 제2 역변환이 적용될 수 있다. 잔차 블록의 크기가 8x8인 경우, 상기 잔차 블록 전체 영역에 상기 제2 역변환이 적용되며, 잔차 블록의 크기가 16x16인 경우, 상기 잔차 블록의 일부 영역에만 상기 제2 역변환이 적용될 수 있다. 상기 일부 영역은, 잔차 블록의 좌상단에 위치한 8x8 영역, 잔차 블록의 상단에 위치한 16x8 영역, 잔차 블록의 좌측에 위치한 8x16 영역, 또는 잔차 블록의 우하단에 위치한 8x8 영역을 제외한 영역을 의미할 수 있다.For example, if either the width or height of the residual block is equal to or greater than 8, a second inverse transform with an 8x8 transformation matrix may be applied. When the size of the residual block is 8x8, the second inverse transform is applied to the entire area of the residual block, and when the size of the residual block is 16x16, the second inverse transform may be applied only to a part of the residual block. The partial region may refer to an area other than an 8x8 region located at the top left of the residual block, a 16x8 region located at the top of the residual block, an 8x16 region located at the left side of the residual block, or an 8x8 region located at the bottom right of the residual block. .

또는, 잔차 블록의 너비 또는 높이 중 어느 하나가 4인 경우, 4x4의 변환 행렬을 가진 제2 역변환이 적용될 수 있다. 잔차 블록의 크기가 4x8 또는 8x4인 경우, 상기 잔차 블록의 일부 영역(e.g., 잔차 블록의 좌상단에 위치한 4x4 영역)에만 상기 제2 역변환이 적용될 수도 있고, 상기 잔차 블록에 속한 2개의 4x4 영역에 상기 제2 역변환이 각각 적용될 수도 있다.Alternatively, when either the width or height of the residual block is 4, a second inverse transform with a 4x4 transformation matrix may be applied. When the size of the residual block is 4x8 or 8x4, the second inverse transform may be applied only to a portion of the residual block (eg, the 4x4 region located at the upper left of the residual block), and the second inverse transform may be applied to two 4x4 regions belonging to the residual block. The second inverse transform may be applied respectively.

상기 제2 역변환의 변환 행렬의 크기는, 4x4, 8x8, 16x16, 32x32 또는 그 이상일 수 있다. 상기 변환 행렬의 형태는 정방형에 한하지 않으며, 비정방형으로 구현될 수도 있다. 다만, 변환의 복잡도를 줄이기 위해, 제2 역변환에 허용되는 변환 행렬의 크기는 NxM 이하로 제한될 수 있다. 상기 N과 M은 각각 4, 8 또는 16일 수 있으며, N과 M은 서로 동일하거나 상이할 수 있다.The size of the transform matrix of the second inverse transform may be 4x4, 8x8, 16x16, 32x32 or more. The form of the transformation matrix is not limited to a square, and may be implemented as a non-square. However, in order to reduce the complexity of the transformation, the size of the transformation matrix allowed for the second inverse transformation may be limited to NxM or less. N and M may be 4, 8, or 16, respectively, and N and M may be the same or different from each other.

상기 제2 역변환 과정에서, 잔차 블록의 변환 타입은, 도 5에서 설명한 변환 타입 유도 방법을 통해 결정될 수 있다. 또는, 상기 제2 역변환에서의 변환 타입은, 부호화/복호화 장치에 기-약속된 것일 수 있다. 예를 들어, 상기 제2 역변환에서의 변환 타입으로, 전술한 5개의 변환 타입 중 어느 하나가 고정적으로 이용될 수 있다.In the second inverse transform process, the transform type of the residual block may be determined through the transform type derivation method described with reference to FIG. 5. Alternatively, the transform type in the second inverse transform may be pre-committed to the encoding / decoding apparatus. For example, as the transform type in the second inverse transform, any one of the five transform types described above may be fixedly used.

상기 제2 역변환은, 잔차 블록에 제1 역변환이 스킵되는지 여부를 나타내는 플래그(이하, 제1 플래그라 함)에 기초하여 선택적으로 수행될 수 있다. 즉, 상기 제1 플래그에 따라, 잔차 블록에 제1 역변환이 스킵되는 경우, 상기 제2 역변환의 수행도 스킵될 수 있다. The second inverse transform may be selectively performed based on a flag (hereinafter, referred to as a first flag) indicating whether the first inverse transform is skipped in the residual block. That is, according to the first flag, when the first inverse transform is skipped in the residual block, the performance of the second inverse transform may also be skipped.

또는, 제2 역변환이 스킵되는지 여부를 나타내는 플래그(이하, 제2 플래그라 함)가 별도로 시그날링될 수도 있다. 상기 제2 플래그가 1인 경우, 제2 역변환이 수행되지 아니하고, 상기 플래그가 0인 경우, 제2 역변환이 수행될 수 있다. 상기 제1 플래그와 제2 플래그는 서로 독립적으로 부호화되어 시그날링될 수 있다. 또는, 상기 제1 플래그와 제2 플래그 중 어느 하나는 다른 하나에 종속적으로 시그날링될 수 있다. 예를 들어, 상기 제1 플래그와 제2 플래그 중 어느 하나가 1인 경우에만, 다른 하나가 시그날링될 수 있다. 반대로, 상기 제1 플래그와 제2 플래그 중 어느 하나가 0인 경우에만, 다른 하나가 시그날링될 수도 있다.Alternatively, a flag indicating whether the second inverse transform is skipped (hereinafter, referred to as a second flag) may be separately signaled. When the second flag is 1, the second inverse transform is not performed. When the flag is 0, the second inverse transform may be performed. The first flag and the second flag may be encoded and signaled independently of each other. Alternatively, one of the first flag and the second flag may be signaled depending on the other. For example, only when one of the first flag and the second flag is 1, the other may be signaled. On the contrary, only when one of the first flag and the second flag is 0, the other may be signaled.

상기 제2 역변환은, 잔차 블록에 속한 넌-제로 잔차 계수의 개수가 n개보다 적은 경우에는 적용되지 않을 수 있다. 여기서, n은 부호화/복호화 장치에 기-약속된 값일 수 있다. 예를 들어, n은 1, 2, 3 또는 8이하의 자연수일 수 있다. 또는, n은 잔차 블록의 크기에 기초하여 가변적으로 결정될 수도 있다. The second inverse transform may not be applied when the number of non-zero residual coefficients belonging to the residual block is less than n. Here, n may be a value pre-committed to the encoding / decoding device. For example, n can be a natural number of 1, 2, 3 or 8 or less. Alternatively, n may be variably determined based on the size of the residual block.

한편, 도 9는 제1 역변환 이전에 제2 역변환을 수행하는 것을 도시하고 있으나, 이는 역변환의 수행 순서를 한정한 것은 아니다. 즉, 제2 역변환은 제1 역변환 이전에 수행될 수도 있고, 제1 역변환 이후에 수행될 수도 있다. 제2 역변환이 제1 역변환 이전에 수행되는 경우, 도 5에서 살펴본 스케일링은, 역양자화와 제2 역변환 사이에서 수행될 수도 있고, 제1 역변환과 제2 역변환 사이에서 수행될 수도 있다. 반대로, 제2 역변환이 제1 역변환 이후에 수행되는 경우, 도 5에서 살펴본 스케일링은, 역양자화와 제1 역변환 사이에서 수행될 수도 있고, 제1 역변환과 제2 역변환 사이에서 수행될 수도 있다.Meanwhile, although FIG. 9 illustrates performing the second inverse transform before the first inverse transform, this does not limit the order of performing the inverse transform. That is, the second inverse transform may be performed before the first inverse transform or may be performed after the first inverse transform. When the second inverse transform is performed before the first inverse transform, the scaling illustrated in FIG. 5 may be performed between the inverse quantization and the second inverse transform, or may be performed between the first inverse transform and the second inverse transform. Conversely, when the second inverse transform is performed after the first inverse transform, the scaling described with reference to FIG. 5 may be performed between the inverse quantization and the first inverse transform, or may be performed between the first inverse transform and the second inverse transform.

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

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

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

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

Claims (12)

비트스트림으로부터 잔차 블록의 잔차 계수를 유도하는 단계;
상기 잔차 블록에 대한 양자화 파라미터를 산출하는 단계;
상기 산출된 양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 역양자화를 수행하는 단계; 및
상기 역양자화된 잔차 계수에 역변환을 수행하여, 상기 잔차 블록의 잔차 샘플을 복원하는 단계를 포함하는 비디오 복호화 방법.
Deriving a residual coefficient of the residual block from the bitstream;
Calculating a quantization parameter for the residual block;
Performing inverse quantization on the residual coefficient using the calculated quantization parameter; And
Reconstructing residual samples of the residual block by performing inverse transform on the inverse quantized residual coefficients.
제1항에 있어서,
상기 양자화 파라미터는, 양자화 파라미터 예측값 또는 양자화 파라미터 차분값 중 적어도 하나에 기초하여 유도되는 비디오 복호화 방법.
The method of claim 1,
And the quantization parameter is derived based on at least one of a quantization parameter prediction value or a quantization parameter difference value.
제2항에 있어서,
상기 양자화 파라미터 예측값은, 하나 또는 그 이상의 주변 블록의 양자화 파라미터에 기초하여 유도되고, 상기 주변 블록은 상기 잔차 블록에 공간적 또는 시간적으로 인접한 블록인 비디오 복호화 방법.
The method of claim 2,
Wherein the quantization parameter prediction value is derived based on a quantization parameter of one or more neighboring blocks, wherein the neighboring block is a block spatially or temporally adjacent to the residual block.
제2항에 있어서,
상기 양자화 파라미터 차분값은, 상기 양자화 파라미터 차분값의 시그날링이 허용되는 블록의 크기에 기초하여 결정되는 비디오 복호화 방법.
The method of claim 2,
The quantization parameter difference value is determined based on a size of a block that is allowed to signal the quantization parameter difference value.
제2항에 있어서,
상기 산출하는 단계는, 소정의 양자화 파라미터 오프셋에 기반하여, 상기 유도된 양자화 파라미터를 보정하는 단계를 더 포함하는 비디오 복호화 방법.
The method of claim 2,
The calculating may further include correcting the derived quantization parameter based on a predetermined quantization parameter offset.
제1항에 있어서,
상기 잔차 블록은 쿼드 트리, 바이너리 트리 또는 트리플 트리 중 적어도 하나에 기초하여 가변적인 크기/형태로 분할된 것인 비디오 복호화 방법.
The method of claim 1,
And the residual block is divided into variable sizes / shapes based on at least one of quad tree, binary tree, or triple tree.
비트스트림으로부터 잔차 블록의 잔차 계수를 유도하는 엔트로피 복호화부;
상기 잔차 블록에 대한 양자화 파라미터를 산출하고, 상기 산출된 양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 역양자화를 수행하는 역양자화부; 및
상기 역양자화된 잔차 계수에 역변환을 수행하여, 상기 잔차 블록의 잔차 샘플을 복원하는 역변환부를 포함하는 비디오 복호화 장치.
An entropy decoder for deriving a residual coefficient of the residual block from the bitstream;
An inverse quantization unit configured to calculate a quantization parameter for the residual block and perform inverse quantization on the residual coefficient using the calculated quantization parameter; And
And an inverse transform unit for performing inverse transform on the inverse quantized residual coefficients to reconstruct residual samples of the residual block.
제7항에 있어서,
상기 역양자화부는, 양자화 파라미터 예측값 또는 양자화 파라미터 차분값 중 적어도 하나에 기초하여 상기 양자화 파라미터를 유도하는 비디오 복호화 장치.
The method of claim 7, wherein
And the inverse quantization unit derives the quantization parameter based on at least one of a quantization parameter prediction value or a quantization parameter difference value.
제8항에 있어서,
상기 역양자화부는, 하나 또는 그 이상의 주변 블록의 양자화 파라미터에 기초하여 상기 양자화 파라미터 예측값을 유도하되,
상기 주변 블록은 상기 잔차 블록에 공간적 또는 시간적으로 인접한 블록인 비디오 복호화 장치.
The method of claim 8,
The dequantization unit derives the quantization parameter prediction value based on the quantization parameter of one or more neighboring blocks,
And the neighboring block is a block spatially or temporally adjacent to the residual block.
제8항에 있어서,
상기 역양자화부는, 상기 양자화 파라미터 차분값의 시그날링이 허용되는 블록의 크기에 기초하여, 상기 양자화 파라미터 차분값을 결정하는 비디오 복호화 장치.
The method of claim 8,
And the inverse quantization unit determines the quantization parameter difference value based on a size of a block that allows signaling of the quantization parameter difference value.
제8항에 있어서,
상기 역양자화부는, 소정의 양자화 파라미터 오프셋에 기반하여, 상기 유도된 양자화 파라미터를 보정하는 비디오 복호화 장치.
The method of claim 8,
And the inverse quantization unit corrects the derived quantization parameter based on a predetermined quantization parameter offset.
제7항에 있어서,
상기 잔차 블록은 쿼드 트리, 바이너리 트리 또는 트리플 트리 중 적어도 하나에 기초하여 가변적인 크기/형태로 분할된 것인 비디오 복호화 장치.
The method of claim 7, wherein
And the residual block is divided into variable sizes / shapes based on at least one of a quad tree, a binary tree, or a triple tree.
KR1020190079267A 2018-06-11 2019-07-02 A method and an apparatus for encoding/decoding a residual block based on quantization parameter KR102390733B1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020190079267A KR102390733B1 (en) 2018-06-11 2019-07-02 A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR1020220049380A KR102525555B1 (en) 2019-07-02 2022-04-21 A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR1020230052027A KR20230058356A (en) 2019-07-02 2023-04-20 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180066705A KR101997681B1 (en) 2018-06-11 2018-06-11 A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR1020190079267A KR102390733B1 (en) 2018-06-11 2019-07-02 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020180066705A Division KR101997681B1 (en) 2018-06-11 2018-06-11 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020220049380A Division KR102525555B1 (en) 2019-07-02 2022-04-21 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Publications (2)

Publication Number Publication Date
KR20190140422A true KR20190140422A (en) 2019-12-19
KR102390733B1 KR102390733B1 (en) 2022-04-25

Family

ID=81452096

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190079267A KR102390733B1 (en) 2018-06-11 2019-07-02 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Country Status (1)

Country Link
KR (1) KR102390733B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021141451A1 (en) * 2020-01-10 2021-07-15 삼성전자 주식회사 Video decoding method and apparatus for obtaining quantization parameter, and video encoding method and apparatus for transmitting quantization parameter
WO2022031003A1 (en) * 2020-08-04 2022-02-10 현대자동차주식회사 Method for predicting quantization parameter used in image encoding/decoding device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170023893A (en) * 2017-02-07 2017-03-06 인텔렉추얼디스커버리 주식회사 Apparatus and Method of Adaptive Quantization Parameter Encoding and Decoder based on Quad Tree Structure
KR20170106592A (en) * 2016-03-11 2017-09-21 광운대학교 산학협력단 Method and apparatus for video coding using variable size unit of quantized coefficient group
KR20180001485A (en) * 2016-06-24 2018-01-04 한국전자통신연구원 Method and apparatus for encoding and decoding a video image based on transform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170106592A (en) * 2016-03-11 2017-09-21 광운대학교 산학협력단 Method and apparatus for video coding using variable size unit of quantized coefficient group
KR20180001485A (en) * 2016-06-24 2018-01-04 한국전자통신연구원 Method and apparatus for encoding and decoding a video image based on transform
KR20170023893A (en) * 2017-02-07 2017-03-06 인텔렉추얼디스커버리 주식회사 Apparatus and Method of Adaptive Quantization Parameter Encoding and Decoder based on Quad Tree Structure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
H. 265: High efficiency video coding. Recommendation ITU-T H.265, 2013.04.* *
Tzu-Der Chuang, et al. AhG Quantization: Sub-LCU Delta QP. JCTVC-E051. 2011.03.11. *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021141451A1 (en) * 2020-01-10 2021-07-15 삼성전자 주식회사 Video decoding method and apparatus for obtaining quantization parameter, and video encoding method and apparatus for transmitting quantization parameter
WO2022031003A1 (en) * 2020-08-04 2022-02-10 현대자동차주식회사 Method for predicting quantization parameter used in image encoding/decoding device

Also Published As

Publication number Publication date
KR102390733B1 (en) 2022-04-25

Similar Documents

Publication Publication Date Title
KR102030384B1 (en) A method and an apparatus for encoding/decoding residual coefficient
KR101997681B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20170108367A (en) Method and apparatus for processing a video signal based on intra prediction
KR20190140423A (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR20200128175A (en) Method and apparatus of encoding/decoding an image using intra prediction
KR20210008105A (en) Video encoding/decoding method and apparatus
KR20230129360A (en) A video encoding/decoding method and apparatus
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20180032775A (en) Method and apparatus for processing a video signal based on adaptive block patitioning
US11350093B2 (en) Residual coefficient encoding/decoding method and device
KR102389267B1 (en) A method and an apparatus for processing a video signal based on reference between components
KR102525555B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR102390731B1 (en) A method and an apparatus for encoding/decoding residual coefficient
KR20200026394A (en) A method and an apparatus for encoding/decoding a intra prediction
KR102512179B1 (en) A method and an apparatus for encoding/decoding residual coefficient
KR101997686B1 (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR20160037110A (en) Method and apparatus for processing a video signal
KR20220051156A (en) A method and an apparatus for processing a video signal based on reference between components
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
KR20200076809A (en) A method and an apparatus for processing a video signal devided into independent encoding units
KR20180000886A (en) Method and apparatus for processing a video signal

Legal Events

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