KR102525555B1 - 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
KR102525555B1
KR102525555B1 KR1020220049380A KR20220049380A KR102525555B1 KR 102525555 B1 KR102525555 B1 KR 102525555B1 KR 1020220049380 A KR1020220049380 A KR 1020220049380A KR 20220049380 A KR20220049380 A KR 20220049380A KR 102525555 B1 KR102525555 B1 KR 102525555B1
Authority
KR
South Korea
Prior art keywords
block
transform
current block
candidate set
residual
Prior art date
Application number
KR1020220049380A
Other languages
Korean (ko)
Other versions
KR20220054771A (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 KR1020190079267A external-priority patent/KR102390733B1/en
Application filed by 한화비전 주식회사 filed Critical 한화비전 주식회사
Priority to KR1020220049380A priority Critical patent/KR102525555B1/en
Publication of KR20220054771A publication Critical patent/KR20220054771A/en
Priority to KR1020230052027A priority patent/KR20230058356A/en
Application granted granted Critical
Publication of KR102525555B1 publication Critical patent/KR102525555B1/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/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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • 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/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/18Methods 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 a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • 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

본 발명에 따른 부호화/복호화 장치는, 비트스트림으로부터 잔차 블록의 잔차 계수를 유도하고, 잔차 블록에 대한 양자화 파라미터를 산출하며, 양자화 파라미터를 이용하여, 잔차 계수에 대해 역양자화를 수행하고, 역양자화된 잔차 계수에 역변환을 수행하여, 잔차 블록의 잔차 샘플을 복원할 수 있다.An encoding/decoding 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, performs inverse quantization on the residual coefficient using the quantization parameter, and performs inverse quantization on the residual coefficient. Residual samples of the residual block may be reconstructed by performing inverse transformation on the residual coefficients.

Description

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

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

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

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

본 발명은, 적응적인 블록 분할을 통해서 부호화/복호화 효율을 향상시키고자 한다.The present invention seeks 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. A residual sample of the residual block may be reconstructed by performing inverse quantization and performing inverse transformation on the inverse quantized residual coefficient.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 양자화 파라미터는, 양자화 파라미터 예측값 또는 양자화 파라미터 차분값 중 적어도 하나에 기초하여 유도될 수 있다.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 and a quantization parameter difference value.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치에 있어서, 상기 양자화 파라미터 예측값은, 하나 또는 그 이상의 주변 블록의 양자화 파라미터에 기초하여 유도될 수 있다.In the video encoding/decoding method and apparatus according to the present invention, the predicted value of the quantization parameter may be derived based on one or more quantization parameters of 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 the size of a block for which signaling of the quantization parameter difference value is permitted.

본 발명에 따른 비디오 부호화/복호화 방법 및 장치는, 소정의 양자화 파라미터 오프셋에 기반하여, 상기 유도된 양자화 파라미터를 보정할 수 있다.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 a variable size/shape based on at least one of a quad tree, a binary tree, and a triple tree.

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

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

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

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

제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. These terms are only used for the purpose of distinguishing one component from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element, without departing from the scope of the present invention. The terms and/or include any combination of a plurality of related recited items or any of a plurality of related recited items.

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

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

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

도 1은 본 발명의 일실시예로서, 부호화 장치의 개략적인 블록도를 도시한 것이다.1 is a schematic block diagram of an encoding device 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 includes a picture division unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, and an entropy encoding unit 165. ), an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.

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

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

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

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

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

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

참조 픽쳐 보간부에서는 메모리(155)로부터 참조 픽쳐 정보를 제공받고 참조 픽쳐에서 정수 화소 이하의 화소 정보를 생성할 수 있다. 휘도 화소의 경우, 1/4 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 8탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다. 색차 신호의 경우 1/8 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 4탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다.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 with different filter coefficients may be used to generate pixel information of an integer pixel or less in units of 1/4 pixels. In the case of a color difference signal, a DCT-based 4-tap interpolation filter with 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 the motion vector, various methods such as Full search-based Block Matching Algorithm (FBMA), Three Step Search (TSS), and New Three-Step Search Algorithm (NTS) may be used. The motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on interpolated pixels. The motion prediction unit may predict the current prediction unit by using a different motion prediction method. Various methods such as a skip method, a merge method, and an advanced motion vector prediction (AMVP) method may be used as motion prediction methods.

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

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

인트라 예측 방법은 예측 모드에 따라 참조 화소에 AIS(Adaptive Intra Smoothing) 필터를 적용한 후 예측 블록을 생성할 수 있다. 참조 화소에 적용되는 AIS 필터의 종류는 상이할 수 있다. 인트라 예측 방법을 수행하기 위해 현재 예측 단위의 인트라 예측 모드는 현재 예측 단위의 주변에 존재하는 예측 단위의 인트라 예측 모드로부터 예측할 수 있다. 주변 예측 단위로부터 예측된 모드 정보를 이용하여 현재 예측 단위의 예측 모드를 예측하는 경우, 현재 예측 단위와 주변 예측 단위의 인트라 예측 모드가 동일하면 소정의 플래그 정보를 이용하여 현재 예측 단위와 주변 예측 단위의 예측 모드가 동일하다는 정보를 전송할 수 있고, 만약 현재 예측 단위와 주변 예측 단위의 예측 모드가 상이하면 엔트로피 부호화를 수행하여 현재 블록의 예측 모드 정보를 부호화할 수 있다.In the intra prediction method, a prediction block may be generated 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 modes of prediction units existing around the current prediction unit. When predicting the prediction mode of the current prediction unit 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 are identical, the current prediction unit and the neighboring prediction unit use predetermined flag information It is possible to transmit information that the prediction modes of are the same, and 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)로 입력될 수 있다. In addition, a residual block may be generated that includes residual information that is a difference between a prediction unit performed prediction based on the prediction unit generated by the prediction units 120 and 125 and an original block of the prediction unit. The generated residual block may be input to the transform unit 130 .

변환부(130)에서는 잔차 데이터를 포함한 잔차 블록을 DCT, DST 등과 같은 변환 타입을 사용하여 변환시킬 수 있다. 이때, 변환 방법은 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드에 기반하여 결정될 수 있다. The transform unit 130 may transform a residual block including residual data using a transform type such as DCT or DST. In this case, a transform method may be determined based on an intra prediction mode of a prediction unit used to generate the residual block.

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

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

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

엔트로피 부호화부(165)는 재정렬부(160)에 의해 산출된 값들을 기초로 엔트로피 부호화를 수행할 수 있다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다.The entropy encoding unit 165 may perform entropy encoding based on the values calculated by the reordering unit 160 . 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 encoding unit 165 receives residual value coefficient information and block type information of a coding unit from the reordering unit 160 and the prediction units 120 and 125, prediction mode information, division unit information, prediction unit information and transmission unit information, motion Various information such as vector information, reference frame information, block interpolation information, and filtering information can be encoded.

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

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

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

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

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

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 predetermined groups, filtering may be performed differentially for each group by determining one filter to be applied to the corresponding group. Information related to whether or not to apply ALF may be transmitted for each coding unit (CU) of a luminance signal, and the shape and filter coefficients of an ALF filter to be applied may vary according to each block. In addition, the ALF filter of the same form (fixed form) may be applied regardless of the characteristics of the block to be applied.

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

도 2는 본 발명의 일실시예로서, 복호화 장치의 개략적인 블록도를 도시한것이다.2 is a schematic block diagram of a decoding device 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 rearrangement unit 215, an inverse quantization unit 220, an inverse transform unit 225, prediction units 230 and 235, and a filter unit 240. ), a memory 245 may be included.

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

엔트로피 복호화부(210)는 입력 비트스트림에 대해 엔트로피 복호화를 수행할 수 있다. 예를 들어, 엔트로피 복호화를 위해, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. The entropy decoding unit 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 decoding unit 210 may decode information related to intra prediction and inter prediction performed by the encoding device.

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

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

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

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

예측부(230, 235)는 예측 단위 판별부, 인터 예측부 및 인트라 예측부를 포함할 수 있다. 예측 단위 판별부는 엔트로피 복호화부(210)에서 입력되는 예측 단위 정보, 인트라 예측 방법의 예측 모드 정보, 인터 예측 방법의 모션 예측 관련 정보 등 다양한 정보를 입력 받고, 현재 부호화 단위(CU)에서 예측 단위를 구분하고, 예측 단위가 인터 예측을 수행하는지 아니면 인트라 예측을 수행하는지 여부를 판별할 수 있다. 인터 예측부(230)는 부호화 장치에서 제공된 현재 예측 단위의 인터 예측에 필요한 정보를 이용하여, 현재 예측 단위가 포함된 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐에 포함된 정보를 기초로 현재 예측 단위에 대한 인터 예측을 수행할 수 있다. 또는, 현재 예측 단위가 포함된 현재 픽쳐 내에서 기-복원된 일부 영역의 정보를 기초로 인터 예측을 수행할 수도 있다.The prediction units 230 and 235 may include a prediction unit determining unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit receives various information such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, and selects a prediction unit from the current coding unit (CU). and it is possible to determine whether the prediction unit performs inter prediction or intra prediction. The inter-prediction unit 230 uses information necessary for inter-prediction of the current prediction unit provided from the encoding device, and based on information included in at least one picture among pictures before or after 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 a pre-reconstructed partial region in the current picture including the current prediction unit.

인터 예측을 수행하기 위해 부호화 단위를 기준으로, 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), AMVP 모드(AMVP Mode) 중 어떠한 방법인지 여부를 판단할 수 있다.Whether or not 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 judge

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

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

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

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

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

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

도 3은 본 발명이 적용되는 일실시예로서, 블록 분할 타입을 도시한 것이다.3 illustrates block partition types as 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 or a horizontal line. The number of vertical and horizontal lines may be one, two or more. Here, the first block may be a coding block (CU), which is a basic unit of image encoding/decoding, a prediction block (PU), which is a basic unit of prediction encoding/decoding, or a transform block (TU), which is a basic unit of transform encoding/decoding. there is. 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, or the like, and will be described in detail with reference to FIG. 3 below.

도 3(a)는 쿼드 트리 분할(QT)을 도시한 것이다. QT는, 제1 블록을 4개의 제2 블록으로 사분할하는 분할 타입이다. 예를 들어, 2Nx2N의 제1 블록이 QT로 분할되는 경우, 제1 블록은 NxN 크기를 가진 4개의 제2 블록으로 사분할될 수 있다. QT는 정방형 블록에만 적용되도록 제한될 수 있으나, 비정방형 블록에 적용하는 것도 가능하다.Figure 3(a) shows quad tree partitioning (QT). QT is a division type in which a first block is divided into four second blocks. For example, when a first block of 2Nx2N is divided into QT, the first block may be divided into four second blocks having a size of NxN. QT can be restricted to apply only to square blocks, but it can 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보다 크거나 작을 수도 있다.3(b) illustrates horizontal binary tree (hereinafter referred to as Horizontal BT) partitioning. Horizontal BT is a division type in which a first block is divided into two second blocks by one horizontal line. The bipartitioning may be performed symmetrically or asymmetrically. For example, when a 2Nx2N first block is divided into Horizontal BTs, the first block may be divided into two second blocks having a height ratio of (a:b). Here, a and b may have 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 vertical binary tree (hereinafter referred to as Vertical BT) partitioning. Vertical BT is a division type in which a first block is divided into two second blocks by one vertical line. The bipartitioning may be performed symmetrically or asymmetrically. For example, when a 2Nx2N first block 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 have 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 horizontal triple tree (hereinafter referred to as Horizontal TT) splitting. Horizontal TT is a division type in which a first block is divided into three second blocks by two horizontal lines. For example, when a 2Nx2N first block is divided into Horizontal TTs, the first block may be divided into three second blocks having a height ratio of (a:b:c). Here, a, b, and c may have 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 vertical triple tree (hereinafter, referred to as Vertical TT) partitioning. Vertical TT is a division type in which a first block is divided into three second blocks by two vertical lines. For example, when a 2Nx2N first block is divided into vertical TTs, the first block may be divided into three second blocks having a width ratio of (a:b:c). Here, a, b, and c may have the same value or 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 larger or smaller than b.

전술한 분할은, 부호화 장치로부터 시그날링되는 분할 정보에 기초하여 수행될 수 있다. 상기 분할 정보는, 분할 타입 정보, 분할 방향 정보 또는 분할 비율 정보 중 적어도 하나를 포함할 수 있다. The aforementioned division may be performed based on division information signaled from an encoding device. The splitting information may include at least one of splitting type information, splitting direction information, and splitting 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 one of partition types 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, and no split mode. Alternatively, the partition type information may mean information on whether QT, BT, or TT is applied, and may be coded in the form of a flag or index. In the case of BT or TT, the division direction information may indicate whether division is performed in a horizontal direction or a vertical direction. In the case of BT or TT, the division ratio information may indicate the ratio of the width and/or height of the second block.

도 4는 본 발명이 적용되는 일실시예로서, 트리 구조 기반의 블록 분할 방법을 도시한 것이다.4 illustrates a block partitioning method based on a tree structure as 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 shown in FIG. 4 is a square block (hereinafter, referred to as a first block) having a size of 8Nx8N and a division depth of k. When the division information of the first block indicates QT division, the first block may be divided into four sub-blocks (hereinafter, referred to as second blocks). The second block may have a size of 4Nx4N and 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 further divided based on any one of QT, BT, TT or non-split mode. For example, when the division information of the second block indicates a binary tree (Horizontal BT) in the horizontal direction, the second block is divided into two sub-blocks (hereinafter referred to as the third block 410 of FIG. 4). block) can be divided into two parts. In this case, the third block may have a size of 4Nx2N and a split 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 partitioned again based on any one of QT, BT, TT or non-division mode. For example, when the partition information of the third block indicates a vertical binary tree (Vertical BT), the third block is divided into two sub-blocks 411 and 412 as shown in FIG. It can be. In this case, the sub-blocks 411 and 412 may have a size of 2Nx2N and have a split depth of (k+3). Alternatively, when the division information of the third block indicates a horizontal binary tree (Horizontal BT), the third block may be divided into two sub-blocks 413 and 414 as shown in FIG. there is. In this case, the sub-blocks 413 and 414 may have a size of 4NxN and a split 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 블록이 수평 방향으로 분할되도록 설정할 수 있다.Partition information of the current block to be split may be dependently determined based on at least one of partition information of an upper block of the current block and partition information of neighboring blocks. For example, when the second block is divided into Horizontal BTs and the upper third block is divided into Vertical BTs, the lower third block does not need to be divided into Vertical BTs. This is because when the third block at the bottom is divided into Vertical BT, the same result as when the second block is divided into QT is obtained. Accordingly, encoding of division information (particularly, division direction information) of the lower third block may be omitted, and the decoding apparatus may set the lower third block to be horizontally divided.

상기 상위 블록은 상기 현재 블록의 분할 뎁스보다 작은 분할 뎁스를 가진 블록을 의미할 수 있다. 예를 들어, 현재 블록의 분할 뎁스가 (k+2)인 경우, 상위 블록의 분할 뎁스는 (k+1)일 수 있다. 상기 주변 블록은, 현재 블록의 상단 혹은 좌측에 인접한 블록일 수 있다. 상기 주변 블록은, 현재 블록과 동일한 분할 뎁스를 가진 블록일 수 있다.The upper block may mean a block having a split depth smaller than the split depth of the current block. For example, when the division depth of the current block is (k+2), the division depth of the upper 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 split depth as the current block.

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

도 5는 본 발명이 적용되는 일실시예로서, 잔차 샘플을 복원하는 방법을 도시한 것이다.5 illustrates a method of 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 whether a non-zero residual coefficient exists, an absolute value (abs), or a sign of the encoded residual coefficient.

상기 유도는, 잔차 블록 내 고주파 영역의 잔차 계수를 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 a high-frequency region in the residual block to 0. The high-frequency region may be defined as a region excluding at least one of n columns from the left side of the residual block or m rows from the top side of the residual block. The n and m may be pre-promised values in 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, a region excluding 32 columns from the left side of the residual block (here, n = 32 and m = 0) may be defined as a high frequency region. When the residual block is 32x64, an area excluding 32 rows (here, n=0, 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 information encoded to specify a high frequency region.

또한, 상기 잔차 계수를 0으로 설정하는 과정은, 잔차 블록의 크기 또는 형태 중 적어도 하나를 고려하여 선택적으로 수행될 수 있다. 예를 들어, 상기 과정은, 잔차 블록의 크기가 소정의 문턱값보다 크거나 같은 경우에 한하여 적용될 수 있다. 상기 잔차 블록의 크기는 잔차 블록의 너비 또는 높이 중 적어도 하나로 표현될 수 있다. 상기 문턱값은, 잔차 계수를 0으로 설정하는 것이 허용되는 최소 크기를 의미할 수 있다. 상기 문턱값은, 부호화/복호화 장치에 기-약속된 값일 수도 있고, 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 문턱값은 32, 64, 128, 256 또는 그 이상일 수 있다. Also, the process 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 value. The size of the residual block may be expressed as at least one of a width or a height of the residual block. The threshold value may mean a minimum size allowed to set the residual coefficient to 0. The threshold value may be a pre-promised value in the encoding/decoding device, or may be encoded and signaled in the encoding device. The threshold may be 32, 64, 128, 256 or more.

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

도 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) and a quantization parameter difference value (deltaQP). In other words, the quantization parameter may be set as the quantization parameter predicted value QPred, or may be derived by adding the quantization parameter difference value deltaQP to the quantized parameter predicted value QPred.

일예로, 머지 모드(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, when non-zero coefficients do not exist (ie, coded block flag = 0), etc. Likewise, when inverse quantization is unnecessary for a corresponding 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 a process of 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-promised to the encoding/decoding device, or may be coded and signaled by the encoding device. The quantization parameter offset (QPoffset) may be signaled at a level of at least one of a video sequence, picture, slice, tile, or block unit. A unit in which the quantization parameter offset is signaled may be larger than a 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 block size/shape, number of divisions, prediction mode, intra prediction mode, component type (e.g., luminance, color difference), and the like.

상기 양자화 파라미터 오프셋의 개수는, 1개, 2개, 3개 또는 그 이상일 수 있다. 예를 들어, 양자화 파라미터 오프셋은, 픽쳐 레벨, 슬라이스 레벨 또는 블록 레벨 중 적어도 하나에서 정의될 수 있다. 상기 양자화 파라미터 오프셋은, 인트라 모드와 인터 모드 각각에 대해서 정의될 수도 있고, 휘도 성분과 색차 성분 각각에 대해서 정의될 수도 있다. 또는, 인트라 예측 모드 중 LM 모드를 위한 별도의 오프셋이 정의될 수도 있다. 여기서, LM 모드는, 색차 블록이 휘도 블록의 예측/복원 샘플을 이용하여 예측되는 모드를 의미할 수 있다.The number of quantization parameter offsets may be 1, 2, 3 or more. For example, the quantization parameter offset may be defined at least one of a picture level, a slice level, or a block level. The quantization parameter offset may be defined for each of an intra mode and an inter mode, and may be defined for each of a luminance component and a chrominance component. Alternatively, a separate offset for LM mode among intra prediction modes may be defined. Here, the LM mode may mean a mode in which a chrominance block is predicted using prediction/reconstruction samples of a 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 and a predetermined level scale value. The level scale value may be a pre-promised value in the encoding/decoding device, or may be encoded and signaled in the encoding device. The level scale value may be composed of k integer values of 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 value may be defined as another value, and the number of level scale values may be defined as 4, 5, 7, 8 or more.

한편, 상기 역양자화의 결과값에 소정의 양자화 가중치(m)가 더 적용될 수도 있으며, 이러한 과정을 스케일링(Scaling)이라 부르기로 한다.Meanwhile, a predetermined quantization weight (m) may be further applied to the resultant value of the 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-promised to the encoding/decoding device (Method A). In this case, the quantization weight may be the 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 device (method B). 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 it. The decoding apparatus may derive the quantization weights by decoding the encoded information about the quantization weights (Method C). In this case, the encoding apparatus may encode only the 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 a size/shape of a residual block, a division type, a prediction mode, a component type, a transform type, or predetermined flag information. The flag information may include a flag on whether to apply a quantization weight, a flag on whether to skip transform, and the like.

전술한 A 방법 내지 C 방법에 있어서, 상기 스케일링 리스트의 양자화 가중치는, 휘도 블록과 색차 블록 각각에 대해서 결정될 수 있다. 예를 들어, 휘도 블록과 색차 블록 각각에 대한 스케일링 리스트가 시그날링될 수 있다. 또는, 색차 블록의 스케일링 리스트는, 상기 휘도 블록의 스케일링 리스트를 참조하여 결정될 수도 있다.In the above methods 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, a scaling list for each of the luminance block and the chrominance block may be signaled. Alternatively, the scaling list of the chrominance block may be determined by referring to the scaling list of the luminance block.

도 5를 참조하면, 역양자화된 잔차 계수에 역변환을 수행하여 잔차 샘플을 복원할 수 있다(S530).Referring to FIG. 5 , a residual sample may be reconstructed by performing an inverse transform on the 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 transformation candidate set may include n transformation types. For example, the transformation candidate set may include at least one of DCT-II, DCT-V, DCT-VIII, DST-I, and 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 transformation candidate sets may be defined. The m may be 1, 2, 3 or more. The number and/or type of transform types included in any one of the m transform candidate sets (hereinafter referred to as a first transform candidate set) may be different from that of the other one (hereinafter referred to as a second transform candidate set). For example, the first transformation candidate set may include p transformation types, and the second transformation candidate set may include q transformation types smaller than p. Alternatively, even when the first and second transform candidate sets include the same number of transform types, at least one transform type belonging to the first transform candidate set may be different from a transform type belonging to the second transform candidate set.

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

상기 변환 후보 세트의 선택은, 잔차 블록의 크기에 기초하여 수행될 수 있다. 예를 들어, 잔차 블록의 크기가 문턱값보다 작거나 같은 경우, p개의 변환 타입으로 구성된 제1 변환 후보 세트가 선택되고, 그렇지 않은 경우, q개의 변환 타입으로 구성된 제2 변환 후보 세트가 선택될 수 있다. 상기 문턱값은, 32, 64, 128, 256 또는 그 이상일 수 있고, 상기 p는 q보다 큰 값일 수 있다. 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 smaller than or equal to the threshold, a first transformation candidate set consisting of p transformation types is selected; otherwise, a second transformation candidate set consisting of q transformation types is selected. can The threshold value may be 32, 64, 128, 256 or more, and p may be a value greater than q.

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

상기 선택된 변환 후보 타입이 복수의 변환 타입을 포함한 경우, 부호화 장치는 복수의 변환 타입 중 어느 하나를 특정하는 정보를 부호화할 수 있다. 복호화 장치는, 상기 부호화된 정보를 복호화하여 상기 잔차 블록의 변환 타입을 결정할 수 있다. When the selected transform candidate type includes a plurality of transform types, the encoding device may encode information specifying 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 transform may be selectively performed based on a predetermined flag. Here, the flag may indicate whether inverse transform is skipped for the residual block. For example, when the flag is 1, inverse transformation may not be performed on the residual block, and when the flag is 0, inverse transformation may be performed on the residual block. Therefore, the transform type of the residual block can be derived only when the flag is 0. Alternatively, the inverse transform may be selectively performed based on attributes 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 division type, a prediction mode, a component type, and other encoding parameters related to residual coefficients.

상기 역변환(이하, 제1 역변환) 외에 추가적인 역변환(이하, 제2 역변환이라 함)이 더 수행될 수도 있으며, 이는 도 9를 참조하여 살펴 보기로 한다.In addition to the inverse transform (hereinafter referred to as first inverse transform), an additional inverse transform (hereinafter referred to as 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 as an embodiment to which the present invention is applied.

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

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

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

또는, 상기 주변 블록의 위치를 특정하는 정보가 부호화 장치에서 부호화되어 시그날링될 수도 있다. 상기 정보는, 플래그, 인덱스 등의 형태로 부호화될 수 있다. 예를 들어, 상기 정보가 인덱스 0인 경우, 블록 T의 양자화 파라미터 예측값(QPpred)은 좌측 블록의 양자화 파라미터를 이용하여 유도될 수 있다. 상기 정보가 인덱스 1인 경우, 블록 T의 양자화 파라미터 예측값(QPpred)은 상단 블록의 양자화 파라미터를 이용하여 유도될 수 있다.Alternatively, information specifying the location of the neighboring block may be encoded in an encoding device and signaled. The information may be encoded in the form of a flag or index. For example, when the information is index 0, the quantization parameter prediction value QPred of block T may be derived using the quantization parameter of the left block. When the information is index 1, the quantization parameter prediction value QPred of block T can 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 a natural number of 1, 2, 3, 4 or more. The number may be a fixed value pre-promised in 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 block T or neighboring blocks. Alternatively, information on the maximum number of neighboring blocks used to derive the quantization parameter prediction value (QPpred) of the block T may be coded in an encoding device and signaled. 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 among video sequences, pictures, and other fragment areas (e.g., slices, tiles, coding tree block rows, blocks).

전술한 바와 같이, 블록 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 predicted quantization parameter QPpred of the block T may be derived through an operation process such as a median value, an average value, a minimum value, a maximum value, or a mode value of 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 the upper block or the left block is plural, the QP of the upper block or the left block may be determined through an operation process such as a median 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는 상기 주변 블록을 참조하는 것이 허용되지 않을 수 있다.If there is an unavailable block among the neighboring blocks, the prediction value of the quantization parameter of the block T may be derived using only the available neighboring blocks. Alternatively, when the neighboring block is unavailable, the quantization parameter of the neighboring block may be derived based on a quantization parameter defined in a predetermined fragment area. The fragment area may mean a slice, a tile, a Coding Tree Block row, a block, and the like. The fragment area may refer to an area encoded/decoded prior to block T, or may refer to an area to which block T, a current encoding/decoding target, belongs. The unavailability may mean a case in which the neighboring block does not physically exist or a case in which reference is impossible due to rules of an encoding/decoding device. For example, if block T and neighboring blocks belong to different parallel processing regions (eg, slices, tiles, etc.), block T may not be allowed to refer to the neighboring blocks.

도 7은 본 발명이 적용되는 일실시예로서, 블록 T의 색차 성분에 관한 양자화 파라미터 예측값을 유도하는 방법을 도시한 것이다.FIG. 7 illustrates a method of deriving a predicted value of a quantization parameter for a color difference component of a block T as 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 a luminance block and a chrominance block, respectively.

4:2:0 칼라 포맷인 경우, 색차 블록(Tc)은 휘도 블록(TY)에 대응될 수 있다. 색차 블록의 양자화 파라미터 예측값은, 대응하는 휘도 블록의 양자화 파라미터를 이용하여 유도될 수 있다. In the case of the 4:2:0 color format, the chrominance block Tc may correspond to the luminance block TY. The predicted value of the quantization parameter 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 predicted value of the quantization parameter of the chrominance block may be derived using a quantization parameter of any one of a plurality of luminance blocks. In this case, a luminance block corresponding to the position of the center sample or the position of the upper left sample of the color difference block may be used. A luminance block having the largest overlapping area with the chrominance block may be used. Alternatively, the predicted value of the quantization parameter of the chrominance block may be derived by calculating an average value, a median value, a minimum value, a maximum value, and a mode of quantization parameters of a plurality of luminance blocks.

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

전술한 바와 같이, 색차 블록의 양자화 파라미터 예측값은, 대응하는 휘도 블록의 양자화 파라미터를 이용하는 방법(제1 방법)과 색차 블록의 주변 블록의 양자화 파라미터를 이용하는 방법(제2 방법)을 모두 이용하여 유도될 수 있다. 또는, 색차 블록의 양자화 파라미터 예측값은, 제1 방법 또는 제2 방법 중 어느 하나를 선택하여 유도될 수도 있다. As described above, the predicted value of the quantization parameter of the chrominance block is derived using both a method using the quantization parameters of the corresponding luminance block (first method) and a method using quantization parameters of neighboring blocks of the chrominance block (second method). It can be. Alternatively, the predicted value of the quantization parameter of the color difference 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 division structures of the luminance block and the chrominance block are the same, the prediction mode of the block T, intra prediction mode, color format or size/shape, and the like. For example, when block T is encoded in the inter mode and the division structure of the chrominance block is the same as that of the luminance block, the quantization parameter of the chrominance block may be predicted using the first method. Alternatively, the first method may be used when the division structure of the chrominance block is the same as the division structure of the luminance block, and the second method may be used otherwise. 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 in an encoding device. The information may be signaled at at least one level among video sequences, pictures, and other fragment areas (e.g., slices, tiles, Coding Tree Block rows, blocks).

상기 색차 블록의 양자화 파라미터는, 상기 유도된 색차 블록의 양자화 파라미터 예측값과 동일하게 유도될 수도 있고, 소정의 양자화 파라미터 차분값이 가산되어 유도될 수도 있다. 또한, 상기 유도된 양자화 파라미터는 소정의 양자화 파라미터 오프셋을 이용하여 보정될 수 있으며, 이는 도 5에서 살펴본 바와 같다.The quantization parameter of the chrominance block may be derived identically to the quantization parameter predicted value of the derived chrominance block, or may be derived by adding a predetermined quantization parameter difference value. Also, 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 chrominance block encoded in the LM mode, a predicted value of a quantization parameter may be set as a 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 a chrominance block encoded in the LM mode, the quantization parameter may be corrected using one, two or more quantization parameter offsets.

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

부호화 장치는, deltaQP을 부호화하는 블록의 단위를 결정하고, 상기 블록의 크기를 나타내는 정보를 부호화할 수 있다. 여기서, 크기는, 블록의 너비 또는 높이 중 적어도 하나, 너비와 높이의 곱, 너비와 높이의 합, 너비와 높이 중 최소값/최대값 등으로 표현될 수 있다. 복호화 장치는, 상기 시그날링되는 정보를 복호화하여, deltaQP의 시그날링이 허용되는 블록의 최소 크기를 알 수 있다. 상기 정보는, 비디오 시퀀스, 픽쳐, 슬라이스 또는 타일 중 적어도 하나의 레벨에서 시그날링될 수 있다. 또는, 상기 최소 크기는, 변환 블록의 최소 크기로 유도될 수도 있고, 부호화/복호화 장치에 기-약속된 고정된 크기로 정의될 수도 있다. 예를 들어, 상기 최소 크기는, 4x4, 8x4, 4x8, 8x8 등으로 정의될 수 있다. 상기 블록의 크기를 나타내느 정보는, 휘도 성분과 색차 성분에 대해서 각각 시그날링될 수 있다. 또는, 색차 블록에 대한 최소 크기는, 휘도 블록에 대한 최소 크기에 기초하여 유도될 수도 있다. 예를 들어, 4:2:0 칼라 포맷의 경우, 색차 블록의 최소 크기는, 휘도 블록의 최소 크기의 절반으로 결정될 수 있다. 인터 모드의 경우, 색차 블록의 분할 구조는 휘도 블록의 분할 구조와 상이할 수 있으며, 색차 블록의 최소 크기는 휘도 블록의 절반으로 결정될 수 있다.The encoding device may determine a block unit for encoding deltaQP and encode information indicating the size of the block. Here, the size may be expressed as at least one of the width or height of the block, the product of the width and the height, the sum of the width and the height, and the minimum/maximum value of the width and height. The decoding apparatus may decode the signaled information and know the minimum size of a block in which deltaQP signaling is allowed. The information may be signaled at a level of at least one of a video sequence, picture, slice, or tile. Alternatively, the minimum size may be derived from the minimum size of a transform block or may be defined as a fixed size pre-promised to the encoding/decoding device. 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 a luminance component and a chrominance component, respectively. Alternatively, the minimum size of the chrominance block may be derived based on the minimum size of the luminance block. For example, in the case of a 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 case of 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을 이용하여 유도될 수 있다. 8(a) shows a case where the size of the current block is 2Mx2N and the minimum size is MxN. As shown in FIG. 8(a), when the size of the current block is greater than the minimum size, the quantization parameter of the current block can be derived using QPpred and the signaled deltaQP.

상기 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 and 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 deltaQP may be signaled for each block a-d having a minimum size. In this case, quantization parameters may be derived for blocks a through d belonging to the current block, and blocks a through d may have different quantization parameters.

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

도 8(b)는 최소 크기가 MxN이고, 현재 블록(a-d)이 최소 크기보다 작은 경우를 도시한 것이다. 도 8(b)와 같이, 상기 현재 블록의 크기가 상기 최소 크기보다 작은 경우, 상기 현재 블록의 양자화 파라미터는, QPpred과 시그날링된 deltaQP을 이용하여 유도될 수 있다. 8(b) shows a case where the minimum size is MxN and the current blocks (a-d) are smaller than the minimum size. As shown in FIG. 8(b), 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 and a signaled deltaQP.

상기 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 the current block, based on at least one of the first method and the second method described above. For example, QPpred may be derived for each block a-d. Alternatively, QPpred is derived for block a, and the remaining blocks b-d may share QPpred derived from block a. Alternatively, the QPred may be derived based on at least one of the above-described first method or second method based on an upper block of the current block. Here, the upper block may be a block including the current block and having a split depth smaller than that of the current block. For example, when the split depth of the current block is k, the split depth of the upper block may be (k-1), (k-2), and the like. The upper block may be defined in units of blocks sharing the QPpred. The upper block may be set to the same size (MxN) as the minimum size. Alternatively, the encoding device may determine a block unit sharing the QPpred and encode information specifying the block unit. The decoding apparatus may specify the location, 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 from 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 split depth smaller than that of the current block. That is, when the split depth of the current block is k, the split depth of the upper block may be (k-1), (k-2), and the like. Here, it is assumed that the upper block is MxN shown in FIG. 8(b). Accordingly, the same quantization parameter may be derived for blocks a through d, and different quantization parameters may be derived for each block a through d. Alternatively, as shown in FIG. 8(b), 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. At this time, decoding for 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 upper block, and a detailed description thereof will be omitted. Similarly, one same quantization parameter may be derived for blocks a-d belonging to an MxN 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, slice, or tile, the corresponding block may not satisfy the minimum size. In this case, the quantization parameter of the corresponding block is derived using only Qppred, and decoding of deltaQP can be omitted.

도 9는 본 발명이 적용되는 일실시예로서, 잔차 계수의 역변환 과정을 도시한 것이다.9 illustrates an inverse transform process of residual coefficients 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 reconstructed by performing at least one of a first inverse transform and a second inverse transform on a residual coefficient.

상기 제2 역변환은, 잔차 블록의 전체 영역에 적용될 수도 있고, 잔차 블록 내 일부 영역에만 적용될 수도 있다. 상기 일부 영역은, 상기 잔차 블록 내 저주파 영역을 의미할 수 있다. 상기 제2 역변환이 적용되는 영역은, 잔차 블록의 크기/형태 또는 제2 역변환의 변환 행렬의 크기/형태 중 적어도 하나를 고려하여 가변적으로 결정될 수 있다.The second inverse transform may be applied to the entire region of the residual block or only to a partial region within the residual block. The partial region may refer to 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 and 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, when either the width or the height of the residual block is equal to or greater than 8, a second inverse transform having 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 region of the residual block, and when the size of the residual block is 16x16, the second inverse transform may be applied only to a partial region of the residual block. The partial region may refer to an 8x8 region located at the upper left of the residual block, a 16x8 region located at the upper end of the residual block, an 8x16 region located to the left of the residual block, or an region excluding the 8x8 region located at the lower right corner of the residual block. .

또는, 잔차 블록의 너비 또는 높이 중 어느 하나가 4인 경우, 4x4의 변환 행렬을 가진 제2 역변환이 적용될 수 있다. 잔차 블록의 크기가 4x8 또는 8x4인 경우, 상기 잔차 블록의 일부 영역(e.g., 잔차 블록의 좌상단에 위치한 4x4 영역)에만 상기 제2 역변환이 적용될 수도 있고, 상기 잔차 블록에 속한 2개의 4x4 영역에 상기 제2 역변환이 각각 적용될 수도 있다.Alternatively, when any one of the width or height of the residual block is 4, a second inverse transform having 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 partial region of the residual block (e.g., a 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. A 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 transformation matrix of the second inverse transform may be 4x4, 8x8, 16x16, 32x32 or larger. The shape of the transformation matrix is not limited to a square shape, and may be implemented in a non-square shape. However, in order to reduce the complexity of 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 as 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 in FIG. 5 . Alternatively, the transform type in the second inverse transform may be pre-promised to the encoding/decoding device. For example, as a transform type in the second inverse transform, one of the above-described five transform types 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, when the first inverse transform is skipped for the residual block according to the first flag, 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, and when the flag is 0, the second inverse transform may be performed. The first flag and the second flag may be independently encoded and signaled. Alternatively, one of the first flag and the second flag may be signaled dependently on the other flag. For example, only when one of the first flag and the second flag is 1, the other flag may be signaled. Conversely, only when one of the first flag and the second flag is 0, the other flag 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-promised to the encoding/decoding device. For example, n may be 1, 2, 3, or a natural number equal to or less than 8. 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, FIG. 9 shows that the second inverse transform is performed before the first inverse transform, but 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 after the first inverse transform. When the second inverse transform is performed before the first inverse transform, the scaling described in FIG. 5 may be performed between 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 in FIG. 5 may be performed between inverse quantization and the first inverse transform, or may be performed between the first inverse transform and the second inverse transform.

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

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

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

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

Claims (13)

비트스트림으로부터 현재 블록의 잔차 계수를 복호화하는 단계;
양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 역양자화를 수행하는 단계;
상기 역양자화된 잔차 계수에 대해 역변환을 수행하여, 상기 현재 블록의 잔차 샘플을 복원하는 단계를 포함하되,
상기 역변환은, 상기 현재 블록의 변환 후보 세트에 기초하여 수행되고,
상기 현재 블록의 변환 후보 세트는, 제1 변환 후보 세트 및 제2 변환 후보 세트를 포함하는 복수의 변환 후보 세트들 중에서 결정된 하나의 변환 후보 세트이고,
상기 복수의 변환 후보 세트들 각각은, 상기 현재 블록의 역변환에 이용 가능한 적어도 하나의 변환 타입을 포함하되,
상기 현재 블록의 변환 후보 세트는, 상기 현재 블록의 크기에 기초하여 상기 복수의 변환 후보 세트들 중 어느 하나로 결정되고,
상기 제1 변환 후보 세트에 포함된 변환 타입의 개수는, 상기 제2 변환 후보 세트에 포함된 변환 타입의 개수와 상이한, 비디오 복호화 방법.
decoding a residual coefficient of a current block from a bitstream;
performing inverse quantization on the residual coefficient using a quantization parameter;
Reconstructing a residual sample of the current block by performing an inverse transform on the inverse quantized residual coefficient;
The inverse transform is performed based on a transform candidate set of the current block,
The transform candidate set of the current block is one transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set,
Each of the plurality of transform candidate sets includes at least one transform type usable for inverse transform of the current block,
The transform candidate set of the current block is determined as one of the plurality of transform candidate sets based on the size of the current block;
The number of transform types included in the first transform candidate set is different from the number of transform types included in the second transform candidate set.
삭제delete 제1항에 있어서,
상기 현재 블록의 크기가 임계값보다 작거나 같은 경우, 상기 현재 블록의 변환 후보 세트는, 상기 복수의 변환 후보 세트들 중 상기 제1 변환 후보 세트로 결정되고,
상기 현재 블록의 크기가 상기 임계값보다 큰 경우, 상기 현재 블록의 변환 후보 세트는, 상기 복수의 변환 후보 세트들 중 상기 제2 변환 후보 세트로 결정되는, 비디오 복호화 방법.
According to claim 1,
When the size of the current block is smaller than or equal to the threshold, a transform candidate set of the current block is determined as the first transform candidate set among the plurality of transform candidate sets;
When the size of the current block is greater than the threshold, the transform candidate set of the current block is determined as the second transform candidate set among the plurality of transform candidate sets.
제3항에 있어서,
상기 임계값은, 32, 64 또는 128 중 어느 하나인, 비디오 복호화 방법.
According to claim 3,
The threshold value is any one of 32, 64 or 128, video decoding method.
삭제delete 제1항에 있어서,
상기 제1 변환 후보 세트는 DCT-8 및 DST-7를 포함하고,
상기 제2 변환 후보 세트는 DCT-2, DCT-8, 및 DST-7을 포함하는, 비디오 복호화 방법.
According to claim 1,
The first conversion candidate set includes DCT-8 and DST-7,
The second transform candidate set includes DCT-2, DCT-8, and DST-7.
삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 현재 블록의 잔차 샘플에 대해 변환을 수행하여, 상기 현재 블록의 잔차 계수를 획득하는 단계;
양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 양자화를 수행하는 단계;
상기 현재 블록의 양자화된 잔차 계수를 부호화하는 단계를 포함하되,
상기 변환은, 상기 현재 블록의 변환 후보 세트에 기초하여 수행되고,
상기 현재 블록의 변환 후보 세트는, 제1 변환 후보 세트 및 제2 변환 후보 세트를 포함하는 복수의 변환 후보 세트들 중에서 결정된 하나의 변환 후보 세트이고,
상기 복수의 변환 후보 세트들 각각은, 상기 현재 블록의 변환에 이용 가능한 적어도 하나의 변환 타입을 포함하되,
상기 현재 블록의 변환 후보 세트는, 상기 현재 블록의 크기에 기초하여 상기 복수의 변환 후보 세트들 중 어느 하나로 결정되고,
상기 제1 변환 후보 세트에 포함된 변환 타입의 개수는, 상기 제2 변환 후보 세트에 포함된 변환 타입의 개수와 상이한, 비디오 부호화 방법.
obtaining residual coefficients of the current block by performing transformation on residual samples of the current block;
performing quantization on the residual coefficient using a quantization parameter;
Encoding the quantized residual coefficient of the current block,
The transformation is performed based on a transformation candidate set of the current block,
The transform candidate set of the current block is one transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set,
Each of the plurality of transform candidate sets includes at least one transform type usable for transforming the current block,
The transform candidate set of the current block is determined as one of the plurality of transform candidate sets based on the size of the current block;
The number of transform types included in the first transform candidate set is different from the number of transform types included in the second transform candidate set.
부호화 방법에 의해 생성된 비트스트림을 저장하는 컴퓨터로 판독가능한 기록 매체에 있어서,
상기 부호화 방법은,
현재 블록의 잔차 샘플에 대해 변환을 수행하여, 상기 현재 블록의 잔차 계수를 획득하는 단계;
양자화 파라미터를 이용하여, 상기 잔차 계수에 대해 양자화를 수행하는 단계;
상기 현재 블록의 양자화된 잔차 계수를 부호화하는 단계를 포함하되,
상기 변환은, 상기 현재 블록의 변환 후보 세트에 기초하여 수행되고,
상기 현재 블록의 변환 후보 세트는, 제1 변환 후보 세트 및 제2 변환 후보 세트를 포함하는 복수의 변환 후보 세트들 중에서 결정된 하나의 변환 후보 세트이고,
상기 복수의 변환 후보 세트들 각각은, 상기 현재 블록의 변환에 이용 가능한 적어도 하나의 변환 타입을 포함하되,
상기 현재 블록의 변환 후보 세트는, 상기 현재 블록의 크기에 기초하여 상기 복수의 변환 후보 세트들 중 어느 하나로 결정되고,
상기 제1 변환 후보 세트에 포함된 변환 타입의 개수는, 상기 제2 변환 후보 세트에 포함된 변환 타입의 개수와 상이한, 컴퓨터로 판독가능한 기록 매체.
A computer-readable recording medium storing a bitstream generated by an encoding method,
The encoding method,
obtaining residual coefficients of the current block by performing transformation on residual samples of the current block;
performing quantization on the residual coefficient using a quantization parameter;
Encoding the quantized residual coefficient of the current block,
The transformation is performed based on a transformation candidate set of the current block,
The transform candidate set of the current block is one transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set,
Each of the plurality of transform candidate sets includes at least one transform type usable for transforming the current block,
The transform candidate set of the current block is determined as one of the plurality of transform candidate sets based on the size of the current block;
The number of transformation types included in the first transformation candidate set is different from the number of transformation types included in the second transformation candidate set.
KR1020220049380A 2019-07-02 2022-04-21 A method and an apparatus for encoding/decoding a residual block based on quantization parameter KR102525555B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
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
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

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020190079267A Division KR102390733B1 (en) 2018-06-11 2019-07-02 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
KR1020230052027A Division KR20230058356A (en) 2019-07-02 2023-04-20 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Publications (2)

Publication Number Publication Date
KR20220054771A KR20220054771A (en) 2022-05-03
KR102525555B1 true KR102525555B1 (en) 2023-04-25

Family

ID=81591267

Family Applications (2)

Application Number Title Priority Date Filing Date
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

Family Applications After (1)

Application Number Title Priority Date Filing Date
KR1020230052027A KR20230058356A (en) 2019-07-02 2023-04-20 A method and an apparatus for encoding/decoding a residual block based on quantization parameter

Country Status (1)

Country Link
KR (2) KR102525555B1 (en)

Family Cites Families (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
KR101801255B1 (en) * 2017-02-07 2017-11-27 인텔렉추얼디스커버리 주식회사 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.

Also Published As

Publication number Publication date
KR20230058356A (en) 2023-05-03
KR20220054771A (en) 2022-05-03

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
KR101956756B1 (en) A method and an apparatus for processing a video signal based on reference between components
KR20170108367A (en) Method and apparatus for processing a video signal based on intra prediction
US20240064321A1 (en) Image encoding/decoding method and apparatus using inter prediction
KR20190140423A (en) A method and an apparatus for encoding/decoding a residual block using scaling
KR102378803B1 (en) A method of decoding a video signal and an apparatus having the same
KR20220019731A (en) A video encoding/decoding method and apparatus
KR20180032775A (en) Method and apparatus for processing a video signal based on adaptive block patitioning
KR102390733B1 (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
US20210235086A1 (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
KR102512179B1 (en) A method and an apparatus for encoding/decoding residual coefficient
KR102390731B1 (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
KR102660273B1 (en) A method and an apparatus for processing a video signal based on reference between components
KR20220051156A (en) A method and an apparatus for processing a video signal based on reference between components
KR20210124069A (en) Method and apparatus for encoding and decoding image
KR20240054951A (en) A method and an apparatus for processing a video signal based on reference between components
KR20220040451A (en) A method of decoding a video signal and an apparatus having the same
KR20210078773A (en) Video signal encoding method and apparatus and video decoding method and apparatus
KR20210078768A (en) Video signal encoding method and apparatus and video decoding method and apparatus
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
E701 Decision to grant or registration of patent right
GRNT Written decision to grant