KR101981687B1 - Method and apparatus for coding offset information and decoding using the same - Google Patents

Method and apparatus for coding offset information and decoding using the same Download PDF

Info

Publication number
KR101981687B1
KR101981687B1 KR1020170054665A KR20170054665A KR101981687B1 KR 101981687 B1 KR101981687 B1 KR 101981687B1 KR 1020170054665 A KR1020170054665 A KR 1020170054665A KR 20170054665 A KR20170054665 A KR 20170054665A KR 101981687 B1 KR101981687 B1 KR 101981687B1
Authority
KR
South Korea
Prior art keywords
offset
unit
information
units
value
Prior art date
Application number
KR1020170054665A
Other languages
Korean (ko)
Other versions
KR20170125725A (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
Application filed by 한국항공대학교산학협력단 filed Critical 한국항공대학교산학협력단
Publication of KR20170125725A publication Critical patent/KR20170125725A/en
Application granted granted Critical
Publication of KR101981687B1 publication Critical patent/KR101981687B1/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/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing

Abstract

본 발명에 따른 영상의 오프셋 정보 부호화 방법은 복수의 오프셋 단위를 확인하는 과정과, 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 확인하는 과정과, 상기 복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 부호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 부호화하는 과정을 포함할 수 있다According to another aspect of the present invention, there is provided a method of encoding an offset information of an image, comprising the steps of: identifying a plurality of offset units; checking offset information of each of the plurality of offset units; encoding the offset information of each of the plurality of offset units And encoding the offset information for some offset units among the plurality of offset units

Description

오프셋 정보 부호화 및 복호화 방법 및 장치{METHOD AND APPARATUS FOR CODING OFFSET INFORMATION AND DECODING USING THE SAME}[0001] METHOD AND APPARATUS FOR CODING OFFSET INFORMATION AND DECODING USING THE SAME [0002]

본 발명은 영상 부호화 및 복호화 방법 및 장치에 관한 것으로, 특히 오프셋 정보 부호화 및 복호화 방법 및 장치에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a video encoding and decoding method and apparatus, and more particularly, to a method and apparatus for encoding and decoding offset information.

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

영상 압축 기술로 현재 픽쳐의 이전 또는 이후 픽쳐로부터 현재 픽쳐에 포함된 화소값을 예측하는 화면 간 예측 기술, 현재 픽쳐 내의 화소 정보를 이용하여 현재 픽쳐에 포함된 화소값을 예측하는 화면 내 예측 기술, 출현 빈도가 높은 값에 짧은 부호를 할당하고 출현 빈도가 낮은 값에 긴 부호를 할당하는 엔트로피 부호화 기술 등 다양한 기술이 존재하고 이러한 영상 압축 기술을 이용해 영상 데이터를 효과적으로 압축하여 전송 또는 저장할 수 있다.An inter picture prediction technique for predicting a pixel value included in a current picture from a previous or a subsequent picture of a current picture by an image compression technique, an intra picture prediction technique for predicting a pixel value included in a current picture using pixel information in the current picture, There are various techniques such as an entropy encoding technique in which a short code is assigned to a value having a high appearance frequency and a long code is assigned to a value having a low appearance frequency. Image data can be effectively compressed and transmitted or stored using such an image compression technique.

한편, 고해상도 영상에 대한 수요가 증가함과 함께, 새로운 영상 서비스로서 입체 영상 컨텐츠에 대한 수요도 함께 증가하고 있다. 고해상도 및 초고해상도의 입체 영상 콘텐츠를 효과적으로 제공하기 위한 비디오 압축 기술에 대하여 논의가 진행되고 있다.On the other hand, demand for high-resolution images is increasing, and demand for stereoscopic image content as a new image service is also increasing. Video compression techniques are being discussed to effectively provide high resolution and ultra-high resolution stereoscopic content.

본 발명은 비디오 신호를 부호화/복호화 과정에서 오프셋 정보의 부호화를 위해 발생되는 비트량을 줄일 수 있는 방법 및 장치를 제공할 수 있다. The present invention can provide a method and apparatus for reducing the amount of bits generated for encoding offset information in a process of encoding / decoding a video signal.

또한, 본 발명은 단순한 처리 및 연산을 사용하여 부호화 비트수를 줄일 수 있는 방법 및 장치를 제공할 수 있다. In addition, the present invention can provide a method and an apparatus that can reduce the number of encoding bits using simple processing and calculation.

또한, 본 발명은 부호화 장치 및 복호화 장치의 하드웨어 환경, 부호화 장치와 복호화 장치 사이의 통신 환경 등을 고려하여 적응적으로 오프셋 정보를 부호화할 수 있는 방법 및 장치를 제공할 수 있다. In addition, the present invention can provide a method and an apparatus capable of adaptively encoding offset information in consideration of a hardware environment of an encoding apparatus and a decoding apparatus, a communication environment between the encoding apparatus and a decoding apparatus, and the like.

본 발명의 일 측면에 따른 영상의 오프셋 정보 부호화 방법은 복수의 오프셋 단위를 확인하는 과정과, 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 확인하는 과정과, 상기 복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 부호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 부호화하는 과정을 포함할 수 있다. According to an aspect of the present invention, there is provided a method of encoding an offset information of an image, comprising: identifying a plurality of offset units; checking offset information of each of the plurality of offset units; And encoding the offset information for some offset units of the plurality of offset units.

본 발명의 다른 측면에 따른 영상 데이터를 부호화하는 장치는 복수의 오프셋 단위를 확인하고, 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 확인하여 제공하는 오프셋 보정부와, 상기 오프셋 보정부로부터 제공받은 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 부호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 부호화하는 오프셋 부호화부를 포함할 수 있다. According to another aspect of the present invention, there is provided an apparatus for encoding image data, the apparatus comprising: an offset correction unit for identifying a plurality of offset units and checking and providing offset information for each of the plurality of offset units; And an offset encoding unit encoding the offset information for each of the plurality of offset units and encoding the offset information for some offset units of the plurality of offset units.

본 발명의 또 다른 측면에 따른 부호화된 영상 데이터를 복호화하는 방법은 복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 복호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 복호화하는 과정과, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 포함되지 않는 잔여 오프셋 단위에 대한 상기 오프셋 정보를 복호화하는 과정과, 상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 제공하는 과정과, 상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 반영하여, 부호화 단위의 픽셀 정보를 복원하는 과정을 포함할 수 있다. According to another aspect of the present invention, there is provided a method of decoding encoded image data, the method including decoding the offset information for each of a plurality of offset units, decoding the offset information for some offset units of the plurality of offset units, Decoding the offset information for a residual offset unit not included in some offset units among the plurality of offset units; providing offset information for the partial offset unit and the residual offset unit; And restoring the pixel information of the encoding unit by reflecting offset information on the unit and the residual offset unit.

본 발명의 또 다른 측면에 따른 부호화된 영상 데이터를 복호화하는 장치는 복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 복호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 복호화하고, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 포함되지 않는 잔여 오프셋 단위에 대한 상기 오프셋 정보를 복호화하여 제공하는 오프셋 정보 복호화부와, 상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 반영하여, 부호화 단위의 픽셀 정보를 복원하는 오프셋 보정부를 포함할 수 있다. According to another aspect of the present invention, there is provided an apparatus for decoding encoded image data, the apparatus comprising: a decoder for decoding the offset information for each of a plurality of offset units, decoding the offset information for some offset units of the plurality of offset units, An offset information decoding unit for decoding the offset information for a residual offset unit not included in some offset units among a plurality of offset units and providing the offset information for the remaining offset units; And an offset correction unit for restoring the pixel information of the pixel.

본 발명에 의하면, 비디오 신호를 부호화/복호화과정에서 오프셋 정보의 부호화를 위해 발생되는 비트수를 줄일 수 있다.According to the present invention, it is possible to reduce the number of bits generated for encoding offset information in a process of encoding / decoding a video signal.

또한, 본 발명에 의하면 단순한 처리 및 연산을 사용하여 부호화 비트수를 줄일 수 있고, 나아가 부호화 장치 및 복호화 장치의 하드웨어 환경, 부호화 장치와 복호화 장치 사이의 통신 환경 등을 고려하여 적응적으로 오프셋 정보를 부호화할 수 있다. Further, according to the present invention, it is possible to reduce the number of encoding bits by using a simple process and an arithmetic operation, and further to adaptively store offset information in consideration of a hardware environment of the encoding apparatus and the decoding apparatus, a communication environment between the encoding apparatus and the decoding apparatus, Can be encoded.

도 1은 본 발명의 일 실시예에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 본 발명의 일 실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 3은 본 발명의 일 실시예에 따른 영상 부호화 장치에 구비된 오프셋 정보 부호화부의 상세 구성을 예시하는 블록도이다.
도 4a는 도 3의 오프셋 정보 부호화부에 의해 처리되는 에지 클래스, 에지 카테고리 등을 예시하는 도면이다.
도 4b는 도 3의 오프셋 정보 부호화부에 의해 처리되는 밴드 카테고리를 예시하는 도면이다.
도 5a는 도 3의 오프셋 정보 부호화부에 의해 처리되는 에지 오프셋 정보를 예시하는 도면이다.
도 5b는 도 3의 오프셋 정보 부호화부에 의해 처리되는 밴드 오프셋 정보를 예시하는 도면이다.
도 6은 본 발명의 일 실시예에 따른 영상 복호화 장치에 구비된 오프셋 정보 복호화부의 상세 구성을 예시하는 블록도이다.
도 7은 본 발명의 일 실시예에 따른 오프셋 정보 부호화 방법의 순서를 예시하는 흐름도이다.
도 8은 본 개시의 일 실시예에 따른 오프셋 정보 복원 방법의 순서를 도시하는 흐름도이다.
1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.
2 is a block diagram illustrating an image decoding apparatus according to an embodiment of the present invention.
3 is a block diagram illustrating a detailed configuration of an offset information encoding unit included in an image encoding apparatus according to an embodiment of the present invention.
FIG. 4A is a diagram illustrating an edge class, an edge category, and the like that are processed by the offset information encoding unit in FIG.
FIG. 4B is a diagram illustrating a band category processed by the offset information encoding unit of FIG. 3; FIG.
FIG. 5A is a diagram illustrating edge offset information processed by the offset information encoding unit of FIG. 3; FIG.
FIG. 5B is a diagram illustrating band offset information processed by the offset information encoding unit of FIG. 3. FIG.
6 is a block diagram illustrating a detailed configuration of an offset information decoding unit included in an image decoding apparatus according to an exemplary embodiment of the present invention.
7 is a flowchart illustrating a procedure of an offset information encoding method according to an embodiment of the present invention.
8 is a flowchart showing a procedure of an offset information restoration method according to an embodiment of the present disclosure.

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

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

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

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

본 개시에서 사용하는 용어에 대한 정의는 다음과 같다.The definitions of the terms used in the present disclosure are as follows.

임시 예측 방향은 전체 예측 방향의 범위를 미리 정해진 규칙에 따라, 미리 정해진 수로 분할한 방향일 수 있다.The temporary prediction direction may be a direction in which the range of the entire prediction direction is divided into a predetermined number according to a predetermined rule.

임시 블록은 각각의 상기 임시 예측 방향에 존재하는 참조 픽셀 정보를 바탕으로 예측한 블록을 포함할 수 있다. The temporary block may include a block predicted based on reference pixel information existing in each temporary prediction direction.

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

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

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

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

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

픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 처리 단위로 분할할 수 있다. 이때, 처리 단위는 예측 단위(Prediction Unit: PU)일 수도 있고, 변환 단위(Transform Unit: TU)일 수도 있으며, 부호화 단위(Coding Unit: CU)일 수도 있다. 픽쳐 분할부(110)에서는 하나의 픽쳐에 대해 복수의 부호화 단위, 예측 단위 및 변환 단위의 조합으로 분할하고 소정의 기준(예를 들어, 비용 함수)으로 하나의 부호화 단위, 예측 단위 및 변환 단위 조합을 선택하여 픽쳐를 부호화 할 수 있다.The picture division unit 110 may divide the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture division unit 110 divides one picture into a plurality of coding units, a prediction unit, and a combination of conversion units, and generates a coding unit, a prediction unit, and a conversion unit combination So that the picture can be encoded.

예를 들어, 하나의 픽쳐는 복수개의 부호화 단위로 분할될 수 있다. 픽쳐에서 부호화 단위를 분할하기 위해서는 쿼드 트리 구조(Quad Tree Structure)와 같은 재귀적인 트리 구조를 사용할 수 있는데 하나의 영상 또는 최대 크기 부호화 단위(largest coding unit)를 루트로 하여 다른 부호화 단위로 분할되는 부호화 유닛은 분할된 부호화 단위의 개수만큼의 자식 노드를 가지고 분할될 수 있다. 일정한 제한에 따라 더 이상 분할되지 않는 부호화 단위는 리프 노드가 된다. 즉, 하나의 코딩 유닛에 대하여 정방형 분할만이 가능하다고 가정하는 경우, 하나의 부호화 단위는 최대 4개의 다른 부호화 단위로 분할될 수 있다.For example, one picture may be divided into a plurality of coding units. In order to divide a coding unit in a picture, a recursive tree structure such as a quad tree structure can be used. In a coding or decoding scheme in which one picture or a largest coding unit is used as a root and divided into other coding units A unit can be divided with as many child nodes as the number of divided coding units. Under certain constraints, an encoding unit that is no longer segmented becomes a leaf node. That is, when it is assumed that only one square division is possible for one coding unit, one coding unit can be divided into a maximum of four different coding units.

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

예측 단위는 하나의 부호화 단위 내에서 동일한 크기의 적어도 하나의 정사각형 또는 직사각형 등의 형태를 가지고 분할된 것일 수도 있고, 하나의 부호화 단위 내에서 분할된 예측 단위 중 어느 하나의 예측 단위가 다른 하나의 예측 단위와 상이한 형태 및/또는 크기를 가지도록 분할된 것일 수도 있다.The prediction unit may be one divided into at least one square or rectangular shape having the same size in one coding unit, and one of the prediction units in one coding unit may be divided into another prediction Or may have a shape and / or size different from the unit.

부호화 단위를 기초로 인트라 예측을 수행하는 예측 단위를 생성시 최소 부호화 단위가 아닌 경우, 복수의 예측 단위 NxN 으로 분할하지 않고 인트라 예측을 수행할 수 있다.If a prediction unit performing intra prediction on the basis of an encoding unit is not the minimum encoding unit at the time of generation, intraprediction can be performed without dividing the prediction unit into a plurality of prediction units NxN.

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

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

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

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

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

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

인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행할 수 있다. 그러나 인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 N x N 분할을 사용하는 인트라 예측을 사용할 수 있다.When intraprediction is performed, when the size of the prediction unit is the same as the size of the conversion unit, intra prediction is performed on the prediction unit based on pixels existing on the left side of the prediction unit, pixels existing on the upper left side, Can be performed. However, when intra prediction is performed, when the size of the prediction unit differs from the size of the conversion unit, intraprediction can be performed using the reference pixel based on the conversion unit. It is also possible to use intra prediction using N x N divisions for only the minimum coding units.

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

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

변환부(130)에서는 원본 블록과 예측부(120, 125)를 통해 생성된 예측 단위의 잔차값(residual)정보를 포함한 잔차 블록을 DCT(Discrete Cosine Transform), DST(Discrete Sine Transform), KLT(Karhunen-Loeve Transform)와 같은 변환 방법을 사용하여 변환시킬 수 있다. 잔차 블록을 변환하기 위해 DCT를 적용할지, DST를 적용할지 또는 KLT를 적용할지는 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드 정보를 기초로 결정할 수 있다. The transforming unit 130 transforms the residual block including the residual information of the prediction unit generated through the original block and the predictors 120 and 125 into a DCT (Discrete Cosine Transform), a DST (Discrete Sine Transform), a KLT Karhunen-Loeve Transform). The decision to apply the DCT, DST, or KLT to transform the residual block may be based on the intra prediction mode information of the prediction unit used to generate the residual block.

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

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

재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 지그-재그 스캔(Zig-Zag Scan)방법을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔 대신 2차원의 블록 형태 계수를 열 방향으로 스캔하는 수직 스캔, 2차원의 블록 형태 계수를 행 방향으로 스캔하는 수평 스캔이 사용될 수도 있다. 즉, 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔, 수직 방향 스캔 및 수평 방향 스캔 중 어떠한 스캔 방법이 사용될지 여부를 결정할 수 있다.The reordering unit 160 may change the two-dimensional block type coefficient to a one-dimensional vector form through a coefficient scanning method. For example, the rearranging unit 160 may scan a DC coefficient to a coefficient in a high frequency region using a Zig-Zag scan method, and change the DC coefficient to a one-dimensional vector form. Instead of the jig-jag scan, a vertical scan may be used to scan two-dimensional block type coefficients in a column direction, and a horizontal scan to scan a two-dimensional block type coefficient in a row direction depending on the size of the conversion unit and the intra prediction mode. That is, it is possible to determine whether any scanning method among the jig-jag scan, the vertical direction scan and the horizontal direction scan is used according to the size of the conversion unit and the intra prediction mode.

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

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

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

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

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

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

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

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

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

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

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

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

엔트로피 복호화부(210)는 영상 부호화기의 엔트로피 부호화부에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. The entropy decoding unit 210 can perform entropy decoding in a procedure opposite to that in which entropy encoding is performed in the entropy encoding unit of the image encoder. For example, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied in accordance with the method performed by the image encoder.

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

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

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

역변환부(225)는 영상 부호화기에서 수행한 양자화 결과에 대해 변환부에서 수행한 변환 즉, DCT, DST, 및 KLT에 대해 역변환 즉, 역 DCT, 역 DST 및 역 KLT를 수행할 수 있다. 역변환은 영상 부호화기에서 결정된 전송 단위를 기초로 수행될 수 있다. 영상 복호화기의 역변환부(225)에서는 예측 방법, 현재 블록의 크기 및 예측 방향 등 복수의 정보에 따라 변환 기법(예를 들어, DCT, DST, KLT)이 선택적으로 수행될 수 있다.The inverse transform unit 225 may perform an inverse DCT, an inverse DST, and an inverse KLT on the DCT, DST, and KLT transformations performed by the transform unit on the quantization result performed by the image encoder. The inverse transform can be performed based on the transmission unit determined by the image encoder. In the inverse transform unit 225 of the image decoder, a transform technique (e.g., DCT, DST, KLT) may be selectively performed according to a plurality of information such as a prediction method, a size of a current block, and a prediction direction.

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

전술한 바와 같이 영상 부호화기에서의 동작과 동일하게 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행하지만, 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 N x N 분할을 사용하는 인트라 예측을 사용할 수도 있다.As described above, when intra prediction is performed in the same manner as in the image encoder, when the size of the prediction unit is the same as the size of the conversion unit, pixels existing on the left side of the prediction unit, pixels existing on the upper left side, However, when the size of the prediction unit differs from the size of the prediction unit in intra prediction, intraprediction is performed using a reference pixel based on the conversion unit . It is also possible to use intra prediction using N x N divisions for only the minimum coding unit.

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

인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), AMVP 모드(AMVP Mode), 인트라 블록 카피 모드 중 어떠한 방법인지 여부를 판단할 수 있다.In order to perform inter prediction, a motion prediction method of a prediction unit included in a corresponding encoding unit on the basis of an encoding unit includes a skip mode, a merge mode, an AMVP mode, and an intra block copy mode It is possible to judge whether or not it is any method.

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

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

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

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

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

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

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

전술한 바와 같이 이하, 본 발명의 실시예에서는 설명의 편의상 코딩 유닛(Coding Unit)을 부호화 단위라는 용어로 사용하지만, 부호화뿐만 아니라 복호화를 수행하는 단위가 될 수도 있다.As described above, in the embodiment of the present invention, a coding unit (coding unit) is used as a coding unit for convenience of explanation, but it may be a unit for performing not only coding but also decoding.

도 3은 본 발명의 일 실시예에 따른 영상 부호화 장치에 구비된 오프셋 처리부(30)의 상세 구성을 예시하는 블록도이다. 3 is a block diagram illustrating a detailed configuration of an offset processing unit 30 included in an image encoding apparatus according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 일 실시예에 따른 영상 부호화 장치에 구비된 오프셋 처리부(30)는 오프셋 보정부(31) 및 오프셋 정보 부호화부(35)를 구비할 수 있다.  Referring to FIG. 3, the offset processing unit 30 included in the image encoding apparatus according to an exemplary embodiment of the present invention may include an offset correction unit 31 and an offset information encoding unit 35.

나아가, 오프셋 보정부(31)는 전술한 영상 부호화 장치(100)의 필터부(150)에 구비될 수 있으며, 오프셋 정보 부호화부(35)는 전술한 영상 부호화 장치(100)의 필터부(150) 또는 엔트로피 부호화부(165)에 구비될 수 있다. The offset correction unit 31 may be included in the filter unit 150 of the image coding apparatus 100. The offset information coding unit 35 may include the filter unit 150 of the image coding apparatus 100, ) Or the entropy encoding unit 165. [

오프셋 보정부(31)는 복원 영상에 대해 픽셀 단위로 원본 영상과의 오프셋을 보정할 수 있다. 상기 복원 영상은, 디블록킹 필터링이 수행된 영상일 수 있다. 특정 픽쳐에 대한 오프셋 보정을 수행하기 위해 영상에 포함된 픽셀을 일정한 수의 영역(예, 부호화 단위)으로 구분한 후 오프셋을 수행할 영역을 결정하고 해당 영역에 오프셋을 적용하는 방법 또는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법을 사용할 수 있다.The offset correcting unit 31 may correct the offset of the reconstructed image with respect to the original image in units of pixels. The reconstructed image may be an image subjected to deblocking filtering. In order to perform offset correction for a specific picture, a method of dividing a pixel included in an image into a predetermined number of regions (for example, encoding units), determining an area to be offset and applying an offset to the corresponding area, A method of applying an offset in consideration of edge information can be used.

구체적으로, 오프셋 보정부(31)는 부호화 단위에 대한 오프셋 타입(예, SAO 타입)을 결정할 수 있다. 오프셋 타입은, 에지 타입 및 밴드 타입을 포함할 수 있다. 이에 따라, 오프셋 보정부(31)는 부호화 단위를 에지 타입에 따라 픽셀들을 분류할지, 아니면 밴드 형태에 따라 픽셀들을 분류하는 것이 적합한지 결정할 수 있다.More specifically, the offset correcting unit 31 can determine an offset type (e.g., SAO type) for the encoding unit. The offset type may include an edge type and a band type. Accordingly, the offset correcting unit 31 can determine whether the encoding unit is suitable to classify the pixels according to the edge type or the pixels according to the band type.

오프셋 타입이 에지 타입으로 결정될 경우, 오프셋 보정부(31)는 부호화 단위의 복원 픽셀들이 이웃 픽셀들과 형성하는 에지의 방향 및 모양 또는 복원 픽셀과 이웃 픽셀 간의 차이/변화량에 따라, 복원 픽셀들과 원본 영상의 픽셀들 사이의 오프셋을 결정할 수 있다.When the offset type is determined to be an edge type, the offset correcting unit 31 corrects the direction of the reconstructed pixels in accordance with the direction and shape of the edge reconstructed by the encoding unit with the neighboring pixels or the difference / The offset between the pixels of the original image can be determined.

오프셋 보정부(31)는, 부호화 단위의 오프셋 타입에 따라 복원 픽셀들마다 오프셋 클래스를 결정할 수 있다. 에지 타입에서, 오프셋 보정부(31)는, 부호화 단위의 복원 픽셀마다 오프셋 클래스를 결정할 수 있다. 에지 타입에서 결정되는 오프셋 클래스는 에지 클래스라 지칭한다. The offset correcting unit 31 can determine the offset class for each of the restored pixels according to the offset type of the encoding unit. In the edge type, the offset correcting unit 31 can determine the offset class for each reconstruction pixel in the encoding unit. The offset class determined in the edge type is referred to as an edge class.

에지 클래스(410, 도 4a 참조)는, 복원 픽셀이 이웃 픽셀들과 형성하는 에지의 방향에 대한 정보를 포함할 수 있으며, 특히, 0°, 90˚, 45°, 또는 135°의 방향을 나타낼 수 있다. 즉, 제1에지 클래스(411)는 0°의 에지 방향을 나타내고, 제2에지 클래스(412)는 90°의 에지 방향을 나타내고, 제3에지 클래스(413)는 135°의 에지 방향을 나타내고, 제4에지 클래스(414)는 45°의 에지 방향을 나타낼 수 있다. 상기 이웃 픽셀은, 복원 픽셀을 기준으로 좌측, 우측, 상단, 하단, 또는 각 코너에 인접한 픽셀 중 적어도 하나를 포함할 수 있다. 상기 이웃 픽셀의 위치는, 에지 클레스에 따른 에지 방향을 고려하여 결정될 수 있다. 상기 이웃 픽셀은, 복원 픽셀을 기준으로 연속한 N개의 픽셀일 수 있다. 여기서, N은 1보다 크거나 같은 정수일 수 있다. 상기 N은 영상 부호화 장치에 기-설정된 것일 수도 있고, 필터 타입, 필터 강도, 부호화 단위의 크기/형태 등을 고려하여 가변적으로 설정될 수도 있다.The edge class 410 (see FIG. 4A) may include information about the direction of the edge that the reconstructed pixel forms with neighboring pixels, and in particular represents a direction of 0 DEG, 90 DEG, 45 DEG, or 135 DEG . That is, the first edge class 411 represents the edge direction of 0 占 the second edge class 412 represents the edge direction of 90 占 the third edge class 413 represents the edge direction of 135 占, The fourth edge class 414 may represent an edge direction of 45 degrees. The neighboring pixels may include at least one of left, right, top, bottom, or pixels adjacent to each corner based on the restored pixel. The position of the neighboring pixel may be determined in consideration of the edge direction according to the edge class. The neighboring pixels may be consecutive N pixels based on the restored pixel. Where N may be an integer greater than or equal to one. The N may be set in the image encoding apparatus or may be variably set in consideration of the filter type, the filter strength, the size / shape of the encoding unit, and the like.

또한, 오프셋 보정부(31)는, 부호화 단위의 복원 픽셀이 이웃 픽셀들과 형성하는 에지 형태에 기초하여, 에지 카테고리(420)를 설정할 수 있다. 예를 들어, 오프셋 보정부(31)는 복원 픽셀이 이웃 픽셀들과 형성하는 에지 형태가 오목 에지(concave)의 국부 최저점(local valley)을 나타낼 경우 제1에지 카테고리(421)로 설정하고, 오목 에지의 곡선 코너(corner)를 나타낼 경우 제2에지 카테고리(422)로 설정하고, 볼록 에지(convex)의 곡선 코너를 나타낼 경우 제3에지 카테고리(423)로 설정하고, 볼록 에지의 국부 최고점(local peak)을 나타낼 경우 제4에지 카테고리(424)로 설정한다.In addition, the offset correcting unit 31 can set the edge category 420 based on the edge type that the reconstruction pixel of the encoding unit forms with neighboring pixels. For example, the offset correction unit 31 sets the first edge category 421 when the edge shape formed by the restoration pixel with neighboring pixels indicates a local valley of concave, Is set to the second edge category 422 when the curve corner of the edge is indicated and to the third edge category 423 when the curve corner of the convex edge is represented and the local peak of the convex edge peak) is set, the fourth edge category 424 is set.

또한, 오프셋 보정부(31)는, 부호화 단위에서 동일한 에지 카테고리에 속하는 복원픽 셀들에 대해, 복원 픽셀과 원본 픽셀들 사이의 차이값을 이용하여 오프셋 값을 결정할 수 있다. 구체적으로, 각 에지 카테고리마다, 복원 픽셀과 원본 픽셀 사이의 차이값의 평균, 즉 복원 픽셀들의 평균오차를, 해당 에지 카테고리의 오프셋 값으로 결정할 수 있다. Also, the offset correcting unit 31 can determine the offset value using the difference value between the restored pixel and the original pixels, for restored pixels that belong to the same edge category in the encoding unit. Specifically, for each edge category, the average of the differences between the restored pixel and the original pixel, that is, the average error of the restored pixels, can be determined as the offset value of the corresponding edge category.

예를 들어, 부호화 단위의 오프셋 타입이 에지 타입이고 에지 형태에 따라 복원 픽셀들이 4개의 카테고리로 분류되는 경우, 오프셋 보정부(31)는 4개의 에지 카테고리에 속하는 복원 픽셀과 원본 픽셀 사이의 평균 오차에 기초하여 산출한 4개의 에지 오프셋 값을 결정할 수 있다.For example, when the offset type of an encoding unit is an edge type and the restored pixels are classified into four categories according to the edge type, the offset correcting unit 31 calculates the average error between the restored pixel belonging to the four edge categories and the original pixel The four edge offset values calculated based on the four edge offset values can be determined.

비록, 본 개시의 일 실시예에서, 오프셋 보정부(31)가, 에지 클래스와 에지 카테고리를 예시하고 있으나, 본 개시가 이를 한정하는 것은 아니며, 에지 클래스는 다양한 각도의 방향을 반영하여 다양한 개수로 설정될 수 있고, 에지 카테고리 역시, 다양한 에지 형태를 반영하여 다양한 개수로 설정될 수 있음은 물론이다.Although the offset corrector 31 exemplifies the edge class and the edge category in the embodiment of the present disclosure, the present disclosure is not limited thereto, and the edge class may include various numbers And the edge category can also be set to various numbers reflecting various edge types.

한편, 오프셋 타입이 밴드 타입으로 결정될 경우, 오프셋 보정부(31)는 부호화 단위의 픽셀값의 총 범위를 고려하여 소정의 밴드를 설정할 수 있다. 즉, 부호화 단위의 픽셀값의 총 범위가 소정 개수의 연속되는 픽셀값 구간들로 분할될 때, 각 픽셀값 구간을 밴드로 설정할 수 있다. 이를 바탕으로, 오프셋 보정부(31)는 픽셀값이 연속적으로 존재하는 구간의 밴드를 확인하고, 밴드의 시작 지점에 대한 정보를 설정할 수 있다. On the other hand, when the offset type is determined to be a band type, the offset correcting unit 31 can set a predetermined band in consideration of the total range of pixel values of the encoding unit. That is, when the total range of pixel values of the encoding unit is divided into a predetermined number of consecutive pixel value intervals, each pixel value interval can be set to a band. On the basis of this, the offset correcting unit 31 can confirm the bands of the interval in which the pixel values continuously exist, and set the information about the start point of the bands.

예를 들어, 픽셀값이 8비트 샘플인 경우, 부호화 단위의 픽셀값의 총범위는 0 내지 255이며, 픽셀값은 총 32개의 밴드(450, 도 4b 참조)로 분할될 수 있다. 이 경우에 총 32개의 밴드(450) 중에서 복원 픽셀들의 픽셀값들이 속하는 소정 개수의 밴드들이 결정될 수 있다. 이에 따라, 오프셋 보정부(31)는 연속하는 소정 개수의 밴드의 시작 위치(좌측 시작 지점)를 밴드 시작 지점(451)으로 설정할 수 있다. 이러한 밴드 시작 지점은 0 내지 31의 밴드 인덱스 값을 사용하여 결정될 수 있다. For example, if the pixel value is an 8-bit sample, the total range of pixel values in the encoding unit is 0 to 255, and the pixel value can be divided into a total of 32 bands 450 (see FIG. 4B). In this case, a predetermined number of bands to which the pixel values of the restored pixels belong may be determined from a total of 32 bands 450. Accordingly, the offset correcting unit 31 can set the starting position (left starting point) of the consecutive predetermined number of bands to the band starting point 451. This band start point can be determined using a band index value of 0 to 31. [

밴드 타입에서, 오프셋 보정부(31)는 부호화 단위의 복원 픽셀의 픽셀값이 속하는 밴드의 위치에 따라 소정 개수의 밴드 카테고리(455)를 설정할 수 있다. 예를 들어, 밴드 시작 지점(451)으로부터 연속하는 m개(예, 4개)의 밴드들의 밴드 인덱스에 따라, 복원 픽셀들이 m개의 밴드 카테고리(455)로 분류될 수 있다. 부호화 단위의 복원 픽셀마다, m개(예, 4개)의 밴드 중에 어느 밴드에 속하느냐에 따라, 오프셋 보정부(31)는 m개(예, 4개)의 밴드 카테고리 중에 어느 밴드 카테고리에 속하는지를 결정할 수 있으며, 이 값을 밴드 카테고리(455)의 값으로 설정할 수 있다.In the band type, the offset correcting unit 31 can set a predetermined number of band categories 455 according to the position of the band to which the pixel value of the reconstruction pixel of the encoding unit belongs. For example, according to the band index of consecutive m (e.g., four) bands from the band start point 451, the restored pixels may be classified into m band categories 455. [ For each restoration pixel of the coding unit, the offset correcting unit 31 determines which band category belongs to m (for example, four) band categories depending on which band among m (for example, four) bands belongs And this value can be set to the value of the band category 455. [

또한, 오프셋 보정부(31)는 밴드 카테고리(455) 단위로 오프셋 값을 설정할 수 있다. 즉, 오프셋 보정부(31)는 각 밴드 카테고리(455)에 속하는 복원 픽셀들과 원본 픽셀들 사이에 대한 평균 오차 값을 해당 밴드 카테고리(455)의 오프셋으로 결정할 수 있다. In addition, the offset correcting unit 31 can set an offset value in units of a band category (455). That is, the offset correcting unit 31 may determine an average error value between the restored pixels belonging to each band category 455 and the original pixels as the offset of the corresponding band category 455.

나아가, 경우에 따라 밴드들은, 픽셀값의 총 범위를 균등한 간격으로 분할하거나, 비 균등한 간격으로 분할할 수도 있다. 따라서, 오프셋 보정부(31)는, 부호화 단위의 픽셀 값들의 공간적 특성에 기초하여, 에지 타입 또는 밴드 타입인지를 나타내는 부호화 단위의 오프셋 타입을 결정할 수 있다.Further, bands may optionally divide the total range of pixel values at evenly spaced intervals or at unequal intervals. Therefore, the offset correcting unit 31 can determine the offset type of the encoding unit indicating whether the edge type or the band type, based on the spatial characteristic of the pixel values of the encoding unit.

비록, 본 개시의 실시예에서, 밴드 시작 지점과 밴드 카테고리를 예시하고 있으나, 본 개시가 이를 한정하는 것은 아니며, 밴드는 부호화 단위의 픽셀값의 총 범위와 비트 값을 반영하여 다양한 개수로 설정될 수 있고, 밴드 카테고리 역시, 다양한 개수로 설정될 수 있음은 물론이다.Although the embodiments of the present disclosure illustrate the band start point and the band category, the present disclosure is not limited thereto, and the band may be set to various numbers reflecting the total range of the pixel values of the encoding unit and the bit values Of course, the band category can also be set to various numbers.

이와 같이, 오프셋 보정부(31)에 의해 카테고리 단위(에지 카테고리, 밴드 카테고리)의 오프셋 값이 결정되면, 결정된 오프셋 값은 오프셋 정보 부호화부(35)에 제공된다. 그리고, 오프셋 정보 부호화부(35)는 오프셋 값에 대한 정보, 즉, 부호화 단위의 오프셋 타입, 오프셋 클래스 또는 오프셋 값 중 적어도 하나를 포함하는 오프셋 파라미터를 부호화하여 출력할 수 있다.Thus, when the offset value of the category unit (edge category, band category) is determined by the offset correcting unit 31, the determined offset value is provided to the offset information encoding unit 35. [ The offset information encoding unit 35 may encode and output an offset parameter including at least one of information on the offset value, that is, an offset type, an offset class, or an offset value of the encoding unit.

구체적으로, 오프셋 보정부(31)는 오프셋 정보 부호화부(35)에 오프셋 타입과 오프셋 값을 제공할 수 있다. 오프셋 타입은, 오프(Off) 타입, 에지(Edge) 타입 또는 밴드(Band) 타입을 포함할 수 있다. 이에 따라, 오프셋 정보 부호화부(35)는, 오프(Off) 타입, 에지(Edge) 타입 또는 밴드(Band) 타입을 식별하는 식별자를 부호화할 수 있다.More specifically, the offset correcting unit 31 can provide the offset type and the offset value to the offset information encoding unit 35. [ The offset type may include an Off type, an Edge type, or a Band type. Accordingly, the offset information encoding unit 35 can encode an identifier that identifies an Off type, an Edge type, or a Band type.

에지(Edge) 타입의 경우, 오프셋 보정부(31)는 에지 클래스, 에지 카테고리, 에지 카테고리 단위의 오프셋 값을 오프셋 정보 부호화부(35)에 제공할 수 있다. 이에 대응하여, 오프셋 정보 부호화부(35)는 에지 클래스와 에지 카테고리를 반영한 오프셋 값을 생성하고, 이를 부호화할 수 있다. 상기 부호화는, 생성된 오프셋 값을 재정렬하는 과정을 더 포함할 수 있다. 상기 재정렬은, 오프셋 값이 소정의 상수인지 여부 또는 오프셋의 크기 중 적어도 하나를 고려하여 수행될 수 있다. 상기 소정의 상수는, 영상 부호화 장치에 기-약속된 고정된 값(예를 들어, "0")일 수 있다. 오프셋 정보 부호화부(35)는 상기 재정렬에 필요한 정보를 부호화하고, 이를 출력할 수 있다.In the case of the edge type, the offset correcting unit 31 can provide the offset information encoding unit 35 with offset values in the edge class, the edge category, and the edge category unit. Correspondingly, the offset information encoding unit 35 can generate an offset value reflecting the edge class and the edge category, and can code the offset value. The encoding may further include rearranging the generated offset values. The rearrangement may be performed considering at least one of whether the offset value is a predetermined constant or the size of the offset. The predetermined constant may be a fixed value (for example, " 0 ") pre-assigned to the image encoding apparatus. The offset information encoding unit 35 encodes the information necessary for the reordering and outputs the encoded information.

예를 들어, 오프셋 보정부(31)가 도 5a에 예시되는 오프셋 값(500)을 제공할 경우, 오프셋 정보 부호화부(35)는 에지 클래스와 에지 카테고리의 순서대로, 각 에지 카테고리(510)의 오프셋 값(520)을 부호화할 수 있다. 이때, 에지 카테고리의 오프셋 값(520)은 다양하게 존재할 수 있고, 에지 카테고리(510)의 오프셋 값(520)이 "0"인 값이 존재할 수 있다. 이에 따라, 오프셋 값(520)이 에지 카테고리의 순서에 따라 정렬될 경우, "0"의 오프셋 값을 갖는 에지 카테고리(521)에 의해 비트열이 크기가 늘어나는 문제가 야기될 수 있다. 이를 고려하여, 오프셋 정보 부호화부(35)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리(531)를 상대적으로 앞으로 정렬하고, "0"의 오프셋 값을 갖는 에지 카테고리(521)를 상대적으로 뒤에 위치하도록 정렬할 수 있다. 그리고, 오프셋 정보 부호화부(35)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리(531)의 오프셋 값을 부호화하고, "0"의 오프셋 값을 갖는 에지 카테고리(521)의 오프셋 값은 비트열에 포함되지 않도록 부호화할 수 있다. For example, when the offset correcting unit 31 provides the offset value 500 illustrated in FIG. 5A, the offset information encoding unit 35 obtains the edge value of each edge category 510 in the order of the edge class and the edge category. The offset value 520 can be encoded. At this time, the offset value 520 of the edge category may exist in various ways, and the offset value 520 of the edge category 510 may be a value of " 0 ". Accordingly, when the offset value 520 is aligned according to the order of the edge categories, the edge category 521 having an offset value of " 0 " may cause the bit string to increase in size. Taking this into consideration, the offset information encoding unit 35 relatively arranges the edge category 531 having the offset value other than " 0 " in the forward direction and the edge category 521 having the offset value of " 0 & . ≪ / RTI > The offset information encoding unit 35 encodes the offset value of the edge category 531 having an offset value other than "0", and the offset value of the edge category 521 having the offset value of "0" It can be encoded so as not to be included.

한편, 밴드 타입의 경우, 오프셋 보정부(31)는 밴드 시작 지점, 밴드 카테고리 단위의 오프셋 값을 오프셋 정보 부호화부(35)에 제공할 수 있다. 이에 대응하여, 오프셋 정보 부호화부(35)는 밴드 시작 지점과 밴드 카테고리를 반영한 오프셋 값을 생성하고, 이를 부호화할 수 있다. 상기 부호화도 오프셋 값을 재배열하는 과정을 더 포함할 수 있으며, 이는 에지 타입에서 살펴본 바와 같다.On the other hand, in the case of the band type, the offset correcting unit 31 can provide the offset information encoding unit 35 with the offset value of the band starting point and the band category unit. In response to this, the offset information encoding unit 35 can generate and encode an offset value reflecting the band start point and the band category. The encoding may further include rearranging the offset value, as described in the edge type.

예를 들어, 오프셋 보정부(31)가 도 5b에 예시되는 오프셋 값(550)을 제공할 경우, 오프셋 정보 부호화부(35)는 밴드 시작 지점과 밴드 카테고리의 순서대로, 각 밴드 카테고리(560)의 오프셋 절대값(561)과, 부호값(562)을 부호화할 수 있다. 이때, 밴드 카테고리의 오프셋 절대값(561)과, 부호값(562)은 다양하게 존재할 수 있고, 밴드 카테고리(560)의 오프셋 절대값(561)이 "0"인 값이 존재할 수 있다. 이에 따라, 오프셋 절대값(561)이 밴드 카테고리의 순서에 따라 정렬될 경우, "0"의 오프셋 값을 갖는 밴드 카테고리(571)에 의해 비트열이 크기가 늘어나는 문제가 야기될 수 있다. 이를 고려하여, 오프셋 정보 부호화부(35)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리(571)를 상대적으로 앞으로 정렬하고, "0"의 오프셋 값을 갖는 밴드 카테고리(572)를 상대적으로 뒤에 위치하도록 정렬할 수 있다. 그리고, 오프셋 정보 부호화부(35)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리(571)의 오프셋 절대값과 부호값을 부호화하고, "0"의 오프셋 값을 갖는 밴드 카테고리(572)의 오프셋 값은 비트열에 포함되지 않도록 부호화할 수 있다. For example, when the offset correcting unit 31 provides the offset value 550 illustrated in FIG. 5B, the offset information encoding unit 35 outputs the offset information 550 shown in FIG. 5B to each band category 560 in the order of the band start point and the band category. The absolute value 561 of the offset and the code value 562 of the frame can be encoded. At this time, the offset absolute value 561 and the sign value 562 of the band category may exist in various ways, and the offset absolute value 561 of the band category 560 may be a value of " 0 ". Accordingly, when the offset absolute value 561 is aligned in the order of the band category, the problem arises that the bit string is increased in size by the band category 571 having an offset value of " 0 ". Taking this into consideration, the offset information encoding section 35 relatively arranges the band category 571 having the offset value other than " 0 " in the forward direction and the band category 572 having the offset value " 0 " . ≪ / RTI > The offset information encoding unit 35 encodes the offset absolute value and the sign value of the band category 571 having an offset value other than " 0 ", and outputs the offset value of the band category 572 having the offset value of & The value can be encoded so that it is not included in the bit stream.

이와 같이, "0"의 오프셋 값을 갖는 카테고리의 오프셋 값은 비트열에 포함시키지 않으므로, "0"의 부호화값을 부호화하는데 소모되는 비트의 수를 절약할 수 있어, 부호화 데이터 효율을 증대시킬 수 있다.As described above, since the offset value of the category having the offset value of " 0 " is not included in the bit string, the number of bits consumed for encoding the encoded value of " 0 " can be saved and the encoded data efficiency can be increased .

나아가, 본 발명의 일 실시예에 따른 오프셋 처리부(30)는 "0"의 오프셋 값을 갖는 에지 카테고리 또는 밴드 카테고리의 수가 극대화될 수 있도록, 에지 카테고리 또는 밴드 카테고리의 종류나 수를 다양하게 변경할 수 있다. Furthermore, the offset processing unit 30 according to the embodiment of the present invention can variously change the number or types of edge categories or band categories so that the number of edge categories or band categories having an offset value of " 0 & have.

예를 들면, 에지 카테고리 또는 밴드 카테고리에 해당하는 픽셀의 수가 충분히 작으면, 해당 픽셀은 오프셋에 대한 이득이 크게 높지 않을 확률이 높다. 즉, 오프셋을 보내는데 필요한 비트량보다 오프셋에 의해 개선되는 화질의 이득이 상대적으로 클 경우에만 의미가 있다. 이를 고려하면, 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 포함된 픽셀의 수가 충분히 작다면, 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 대한 오프셋 값을 0으로 설정하여 부호화할 수 있다. 구체적으로, 오프셋 정보 부호화부(35)는 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 포함된 픽셀의 수를 확인하고, 해당 카테고리에 포함된 픽셀의 수가 미리 정해진 임계값 이하일 경우, 해당 카테고리의 부호화 값을 "0"으로 설정할 수 있다. 이때, 오프셋 정보 부호화부(35)는 고정된 미리 정해진 임계값을 사용하거나, 또는 오프셋 정보의 부호화 비트량과 오프셋에 의한 화질 이득 사이의 관계를 고려하여 최적의 값을 결정하고, 결정된 최적의 값을 부호화할 수도 있다. For example, if the number of pixels corresponding to the edge category or band category is small enough, then the pixel has a high probability that the gain for the offset is not very high. That is, it is meaningful only when the gain of the image quality improved by the offset is relatively larger than the bit amount necessary for transmitting the offset. Taking this into consideration, if the number of pixels included in the corresponding category (edge category or band category) is sufficiently small, the offset value for the corresponding category (edge category or band category) can be set to 0 and encoded. Specifically, the offset information encoding unit 35 confirms the number of pixels included in the category (edge category or band category), and when the number of pixels included in the category is equal to or smaller than a predetermined threshold value, Can be set to " 0 ". At this time, the offset information encoding unit 35 determines an optimum value by using a fixed predetermined threshold value or considering the relationship between the image quality gain by the offset amount of the encoded bit amount of the offset information and the determined optimum value May be encoded.

나아가, 최적의 값은 부호화되지 않을 수 있으며, 영상 복호화부가 상기 최적의 값을 결정하는 방식을 사용하여 유도할 수도 있다. Further, the optimal value may not be encoded, and the image decoding unit may derive the optimal value using a method of determining the optimum value.

도 6은 본 개시의 일 실시예에 따른 영상 복호화 장치에 구비된 오프셋 정보 복원부의 상세 구성을 예시하는 블록도이다. 6 is a block diagram illustrating a detailed configuration of an offset information restoring unit included in an image decoding apparatus according to an embodiment of the present disclosure.

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

구체적으로, 오프셋 정보 복원부(60)는 오프셋 정보 복호화부(61) 및 오프셋 보정부(65)를 포함할 수 있다.More specifically, the offset information reconstructing unit 60 may include an offset information decoding unit 61 and an offset correcting unit 65.

오프셋 정보 복호화부(61)는 부호화된 정보로부터 오프셋 타입(예, SAO 타입)을 확인한다. 즉, 오프셋 정보 복호화부(61)는 오프(Off) 타입, 에지(Edge) 타입 또는 밴드(Band) 타입을 식별하는 식별자를 확인하여 오프셋 타입을 결정할 수 있다. The offset information decoding unit 61 identifies an offset type (e.g., SAO type) from the encoded information. That is, the offset information decoding unit 61 can determine the offset type by checking the identifiers identifying the Off type, Edge type, or Band type.

그리고, 에지 타입의 경우, 오프셋 정보 복호화부(61)는 에지 클래스에 대한 정보와, 에지 카테고리 단위의 오프셋 값을 복원하여 오프셋 보정부(65)에 제공할 수 있다. In the case of the edge type, the offset information decoding unit 61 can restore the information about the edge class and the offset value in units of the edge category and provide it to the offset correction unit 65. [

이때, 에지 카테고리 단위의 오프셋 값은 "0"이 아닌 오프셋 값을 갖는 에지 카테고리의 오프셋 값만 부호화되어 있고, "0"의 오프셋 값을 갖는 에지 카테고리의 오프셋 값은 비트열에 포함되어 있지 않다. 이에 따라, 오프셋 정보 복호화부(61)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리의 오프셋 값을 복원한 후, 비트열에 포함되지 않은 카테고리의 오프셋 값을 "0"으로 설정한다. 그리고, 오프셋 정보 복호화부(61)는 에지 카테고리의 오프셋 값을 재 정렬하여, 에지 카테고리의 순서에 대응되는 오프셋 값을 오프셋 보정부(65)에 제공할 수 있다. 상기 재정렬은, 영상 부호화 장치에서 시그날링되는 재정렬 관련 정보를 기반으로 수행될 수 있다.At this time, the offset value of the edge category unit is encoded only in the offset value of the edge category having an offset value other than " 0 ", and the offset value of the edge category having the offset value of " 0 " Accordingly, the offset information decoding unit 61 restores the offset value of the edge category having the offset value other than " 0 ", and then sets the offset value of the category not included in the bit string to " 0 ". The offset information decoding unit 61 may rearrange the offset values of the edge categories and provide the offset values corresponding to the order of the edge categories to the offset correction unit 65. [ The reordering may be performed based on the reordering related information signaled by the image encoding apparatus.

이에 대응하여, 오프셋 보정부(65)는 에지 클래스와 에지 카테고리의 오프셋 값을 적용하여 대응되는 픽셀의 값을 복원할 수 있다. Corresponding to this, the offset correcting unit 65 can apply the offset value of the edge class and the edge category to recover the value of the corresponding pixel.

한편, 밴드 타입의 경우, 오프셋 정보 복호화부(61)는 밴드 시작 지점, 밴드 카테고리 단위의 오프셋 값을 복호화하여 오프셋 보정부(65)에 제공할 수 있다. On the other hand, in the case of the band type, the offset information decoding unit 61 may decode the offset values of the band starting point and the band category unit and provide them to the offset correcting unit 65.

이때, 밴드 카테고리 단위의 오프셋 값(예, 오프셋 절대값, 부호값 등)은 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리의 오프셋 값만 부호화되어 있고, "0"의 오프셋 값을 갖는 밴드 카테고리의 오프셋 값은 비트열에 포함되어 있지 않다. 이에 따라, 오프셋 정보 복호화부(61)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리의 오프셋 값을 복원한 후, 비트열에 포함되지 않은 카테고리의 오프셋 값을 "0"으로 설정한다. 그리고, 오프셋 정보 복호화부(61)는 밴드 카테고리의 오프셋 값을 재 정렬하여, 밴드 카테고리의 순서에 대응되는 오프셋 값을 오프셋 보정부(65)에 제공할 수 있다. 상기 재정렬은, 영상 부호화 장치에서 시그날링되는 재정렬 관련 정보를 기반으로 수행될 수 있다.At this time, only the offset value of the band category having the offset value other than " 0 " is coded and the offset value of the band category having the offset value of " 0 & The value is not included in the bit string. Accordingly, the offset information decoding unit 61 restores the offset value of the band category having an offset value other than " 0 ", and then sets the offset value of the category not included in the bit string to " 0 ". The offset information decoding unit 61 may rearrange the offset values of the band categories and provide the offset values corresponding to the order of the band categories to the offset correction unit 65. [ The reordering may be performed based on the reordering related information signaled by the image encoding apparatus.

이에 대응하여, 오프셋 보정부(65)는 밴드 시작 지점, 밴드 카테고리의 오프셋 값을 적용하여 대응되는 픽셀의 값을 복원할 수 있다. Corresponding to this, the offset correcting unit 65 may apply the offset value of the band start point and the band category to recover the value of the corresponding pixel.

도 7은 본 발명의 일 실시예에 따른 오프셋 정보 부호화 방법의 순서를 예시하는 흐름도이다. 7 is a flowchart illustrating a procedure of an offset information encoding method according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일 실시예에 따른 오프셋 정보 부호화 방법은 전술한 영상 부호화 장치의 오프셋 처리부(30)에 의해 수행될 수 있다.  Referring to FIG. 7, the offset information encoding method according to an embodiment of the present invention may be performed by the offset processing unit 30 of the image encoding apparatus described above.

우선, 오프셋 처리부(30)는 부호화 단위에 대한 오프셋 타입(예, SAO 타입)을 결정할 수 있다(S701). 오프셋 타입은, 에지 타입 및 밴드 타입을 포함할 수 있다. 이에 따라, 오프셋 처리부(30)는 부호화 단위에 대한 오프셋 부호화를 처리할지 여부, 부호화 단위를 에지 타입에 따라 픽셀들을 분류할지, 또는 밴드 형태에 따라 픽셀들을 분류하는 것이 적합한지 결정할 수 있다.First, the offset processing unit 30 can determine an offset type (e.g., SAO type) for a coding unit (S701). The offset type may include an edge type and a band type. Accordingly, the offset processing unit 30 can determine whether to process the offset encoding for the encoding unit, classify the encoding unit according to the edge type, or classify the pixels according to the band type.

오프셋 부호화를 처리하지 않을 경우(S702-a), 오프셋 처리부(30)는 해당 부호화 단위에 대한 오프셋 부호화를 완료한다.When the offset coding is not performed (S702-a), the offset processing unit 30 completes the offset coding for the coding unit.

오프셋 타입이 에지 타입으로 결정될 경우(S702-b), 오프셋 처리부(30)는 부호화 단위의 복원 픽셀들이 이웃 픽셀들과 형성하는 에지의 방향 및 모양 또는 복원 픽셀과 이웃 픽셀 간의 차이/변화량에 따라, 복원 픽셀들과 원본 영상의 픽셀들 사이의 오프셋을 결정할 수 있다.If the offset type is determined to be an edge type (S702-b), the offset processing unit 30 determines whether the restored pixels of the encoding unit form the direction and shape of the edge formed with the neighboring pixels or the difference / variation between the restored pixel and neighboring pixels, The offset between the restored pixels and the pixels of the original image can be determined.

오프셋 처리부(30)는, 부호화 단위의 오프셋 타입에 따라 복원 픽셀들마다 오프셋 클래스를 결정할 수 있다(S703). 에지 타입에서, 오프셋 처리부(30)는 부호화 단위의 복원 픽셀마다 엣지 클래스를 결정할 수 있다. 여기서, 에지 클래스(410, 도 4a 참조)는, 복원 픽셀이 이웃 픽셀들과 형성하는 에지의 방향에 대한 정보를 포함할 수 있으며, 특히, 0°, 90˚, 45°, 또는 135°의 방향을 나타낼 수 있다. 즉, 제1에지 클래스(411)는 0°의 에지 방향을 나타내고, 제2에지 클래스(412)는 90°의 에지 방향을 나타내고, 제3에지 클래스(413)는 135°의 에지 방향을 나타내고, 제4에지 클래스(414)는 45°의 에지 방향을 나타낼 수 있다. 상기 이웃 픽셀은, 복원 픽셀을 기준으로 좌측, 우측, 상단, 하단, 또는 각 코너에 인접한 픽셀 중 적어도 하나를 포함할 수 있다. 상기 이웃 픽셀의 위치는, 에지 클레스에 따른 에지 방향을 고려하여 결정될 수 있다. 상기 이웃 픽셀은, 복원 픽셀을 기준으로 연속한 N개의 픽셀일 수 있다. 여기서, N은 1보다 크거나 같은 정수일 수 있다. 상기 N은 영상 부호화 장치에 기-설정된 것일 수도 있고, 필터 타입, 필터 강도, 부호화 단위의 크기/형태 등을 고려하여 가변적으로 설정될 수도 있다.The offset processing unit 30 can determine an offset class for each of the restored pixels according to the offset type of the encoding unit (S703). In the edge type, the offset processing unit 30 can determine an edge class for each reconstruction pixel in an encoding unit. Here, the edge class 410 (see FIG. 4A) may include information about the direction of the edge that the reconstructed pixel forms with neighboring pixels, and in particular, the direction of 0 DEG, 90 DEG, 45 DEG, Lt; / RTI > That is, the first edge class 411 represents the edge direction of 0 占 the second edge class 412 represents the edge direction of 90 占 the third edge class 413 represents the edge direction of 135 占, The fourth edge class 414 may represent an edge direction of 45 degrees. The neighboring pixels may include at least one of left, right, top, bottom, or pixels adjacent to each corner based on the restored pixel. The position of the neighboring pixel may be determined in consideration of the edge direction according to the edge class. The neighboring pixels may be consecutive N pixels based on the restored pixel. Where N may be an integer greater than or equal to one. The N may be set in the image encoding apparatus or may be variably set in consideration of the filter type, the filter strength, the size / shape of the encoding unit, and the like.

S704 단계에서, 오프셋 처리부(30)는 부호화 단위의 복원 픽셀이 이웃 픽셀들과 형성하는 에지 형태에 기초하여, 에지 카테고리(420)를 설정할 수 있다. 예를 들어, 오프셋 처리부(30)는 복원 픽셀이 이웃 픽셀들과 형성하는 에지 형태가 오목 에지(concave)의 국부 최저점(local valley)을 나타낼 경우 제1에지 카테고리(421)로 설정하고, 오목 에지의 곡선 코너(corner)를 나타낼 경우 제2에지 카테고리(422)로 설정하고, 볼록 에지(convex)의 곡선 코너를 나타낼 경우 제3에지 카테고리(423)로 설정하고, 볼록 에지의 국부 최고점(local peak)을 나타낼 경우 제4에지 카테고리(424)로 설정한다.In step S704, the offset processing unit 30 can set the edge category 420 based on the edge type that the reconstruction pixel of the encoding unit forms with the neighboring pixels. For example, the offset processing unit 30 sets the first edge category 421 when the edge shape that the reconstruction pixel forms with neighboring pixels indicates a local valley of concave, Is set to the second edge category 422 when the curve corner of the convex edge is indicated and to the third edge category 423 when the curve corner of the convex edge is indicated and the local peak ) Is set to the fourth edge category 424.

S705 단계에서, 오프셋 처리부(30)는 부호화 단위에서 동일한 에지 카테고리에 속하는 복원픽 셀들에 대해, 복원 픽셀과 원본 픽셀들 사이의 차이값을 이용하여 오프셋 값을 결정할 수 있다. 즉, 각 에지 카테고리마다, 복원 픽셀과 원본 픽셀 사이의 차이값의 평균, 즉 복원 픽셀들의 평균오차를, 해당 에지 카테고리의 오프셋 값으로 결정할 수 있다. In step S705, the offset processing unit 30 may determine the offset value using the difference value between the restored pixel and the original pixels, for the restored pixels that belong to the same edge category in the encoding unit. That is, for each edge category, the average of the difference values between the restored pixel and the original pixel, that is, the average error of the restored pixels, can be determined as the offset value of the corresponding edge category.

예를 들어, 부호화 단위의 오프셋 타입이 에지 타입이고 에지 형태에 따라 복원 픽셀들이 4개의 카테고리로 분류되는 경우, 오프셋 보정부(31)는 4개의 에지 카테고리마다 속하는 복원 픽셀과 원본 픽셀 사이의 평균 오차에 기초하여 산출한 4개의 에지 오프셋 값을 결정할 수 있다.For example, when the offset type of an encoding unit is an edge type and the restored pixels are classified into four categories according to the edge type, the offset correcting unit 31 calculates the average error between the restored pixel belonging to each of the four edge categories and the original pixel The four edge offset values calculated based on the four edge offset values can be determined.

다음으로, 오프셋 처리부(30)는 에지 클래스, 에지 카테고리 단위의 오프셋 값을 부호화할 수 있다. 상기 부호화는, 생성된 오프셋 값을 재정렬하는 과정을 더 포함할 수 있다. 상기 재정렬은, 오프셋 값이 소정의 상수인지 여부 또는 오프셋의 크기 중 적어도 하나를 고려하여 수행될 수 있다. 상기 소정의 상수는, 영상 부호화 장치에 기-약속된 고정된 값(예를 들어, "0")일 수 있다. 오프셋 처리부(30)는 상기 재정렬에 필요한 정보를 부호화하고, 이를 출력할 수 있다.Next, the offset processing unit 30 can encode the offset value in units of the edge class and the edge category. The encoding may further include rearranging the generated offset values. The rearrangement may be performed considering at least one of whether the offset value is a predetermined constant or the size of the offset. The predetermined constant may be a fixed value (for example, " 0 ") pre-assigned to the image encoding apparatus. The offset processing unit 30 encodes the information necessary for the reordering and outputs the encoded information.

예를 들어, 오프셋 처리부(30)는 도 5a에 예시되는 오프셋 값(500)을 부호화할 수 있다. 이때, 에지 카테고리의 오프셋 값(520)은 다양하게 존재할 수 있고, 에지 카테고리(510)의 오프셋 값(520)이 "0"인 값이 존재할 수 있다. 이에 따라, 오프셋 값(520)이 에지 카테고리의 순서에 따라 정렬될 경우, "0"의 오프셋 값을 갖는 에지 카테고리(521)에 의해 비트열이 크기가 늘어나는 문제가 야기될 수 있다. 이를 고려하여, 오프셋 처리부(30)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리(531)를 상대적으로 앞으로 정렬하고, "0"의 오프셋 값을 갖는 에지 카테고리(521)를 상대적으로 뒤에 위치하도록 정렬할 수 있다(S705). For example, the offset processing unit 30 may encode the offset value 500 illustrated in FIG. 5A. At this time, the offset value 520 of the edge category may exist in various ways, and the offset value 520 of the edge category 510 may be a value of " 0 ". Accordingly, when the offset value 520 is aligned according to the order of the edge categories, the edge category 521 having an offset value of " 0 " may cause the bit string to increase in size. In consideration of this, the offset processing unit 30 arranges the edge category 531 having the offset value other than " 0 " relatively forward, and the edge category 521 having the offset value of " 0 & (S705).

S706 단계에서, 오프셋 처리부(30)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리(531)의 오프셋 값을 부호화하고, "0"의 오프셋 값을 갖는 에지 카테고리(521)의 오프셋 값은 비트열에 포함되지 않도록 부호화할 수 있다. In step S706, the offset processing unit 30 encodes the offset value of the edge category 531 having an offset value other than "0", and the offset value of the edge category 521 having the offset value of "0" It can be encoded so as not to be included.

한편, 오프셋 타입이 밴드 타입으로 결정될 경우(S702-c), 오프셋 처리부(30)는 부호화 단위의 픽셀값의 총 범위를 고려하여 소정의 밴드를 설정할 수 있다. 즉, 부호화 단위의 픽셀값의 총 범위가 소정 개수의 연속되는 픽셀값 구간들로 분할될 때, 각 픽셀값 구간을 밴드로 설정할 수 있다. 이를 바탕으로, 오프셋 처리부(30)는 픽셀값이 연속적으로 존재하는 구간의 밴드를 확인하고, 밴드의 시작 지점에 대한 정보를 설정할 수 있다(S707). On the other hand, when the offset type is determined to be a band type (S702-c), the offset processing unit 30 can set a predetermined band in consideration of the total range of pixel values in the encoding unit. That is, when the total range of pixel values of the encoding unit is divided into a predetermined number of consecutive pixel value intervals, each pixel value interval can be set to a band. On the basis of this, the offset processing unit 30 can confirm the band of the section in which the pixel values continuously exist, and set information about the starting point of the band (S707).

예를 들어, 픽셀값이 8비트 샘플인 경우, 부호화 단위의 픽셀값의 총범위는 0 내지 255이며, 픽셀값은 총 32개의 밴드(450, 도 4b 참조)로 분할될 수 있다. 이 경우에 총 32개의 밴드(450) 중에서 복원 픽셀들의 픽셀값들이 속하는 소정 개수의 밴드들이 결정될 수 있다. 이에 따라, 오프셋 처리부(30)는 연속하는 소정 개수의 밴드의 시작 위치(좌측 시작 지점)를 밴드 시작 지점(451)으로 설정할 수 있다. 이러한 밴드 시작 지점은 0 내지 31의 밴드 인덱스 값을 사용하여 결정될 수 있다. For example, if the pixel value is an 8-bit sample, the total range of pixel values in the encoding unit is 0 to 255, and the pixel value can be divided into a total of 32 bands 450 (see FIG. 4B). In this case, a predetermined number of bands to which the pixel values of the restored pixels belong may be determined from a total of 32 bands 450. Accordingly, the offset processing section 30 can set the starting position (left starting point) of the continuous predetermined number of bands to the band starting point 451. This band start point can be determined using a band index value of 0 to 31. [

S708 단계에서, 오프셋 처리부(30)는 부호화 단위의 복원 픽셀의 픽셀값이 속하는 밴드의 위치에 따라 소정 개수의 밴드 카테고리(455)를 설정할 수 있다. 예를 들어, 밴드 시작 지점(451)으로부터 연속하는 m개(예, 4개)의 밴드들의 밴드 인덱스에 따라, 복원 픽셀들이 m개의 밴드 카테고리(455)로 분류될 수 있다. 부호화 단위의 복원 픽셀마다, m개(예, 4개)의 밴드 중에 어느 밴드에 속하느냐에 따라, 오프셋 보정부(31)는 m개(예, 4개)의 밴드 카테고리 중에 어느 밴드 카테고리에 속하는지를 결정할 수 있으며, 이 값을 밴드 카테고리(455)의 값으로 설정할 수 있다.In step S708, the offset processing unit 30 may set a predetermined number of band categories 455 according to the positions of the bands to which the pixel values of the reconstruction pixels in the encoding unit belong. For example, according to the band index of consecutive m (e.g., four) bands from the band start point 451, the restored pixels may be classified into m band categories 455. [ For each restoration pixel of the coding unit, the offset correcting unit 31 determines which band category belongs to m (for example, four) band categories depending on which band among m (for example, four) bands belongs And this value can be set to the value of the band category 455. [

S709 단계에서, 오프셋 처리부(30)는 밴드 카테고리(455) 단위로 오프셋 값을 설정할 수 있다. 즉, 오프셋 처리부(30)는 각 밴드 카테고리(455)에 속하는 복원 픽셀들과 원본 픽셀들 사이에 대한 평균 오차 값을 해당 밴드 카테고리(455)의 오프셋으로 결정할 수 있다. In step S709, the offset processing unit 30 can set an offset value in units of a band category (455). That is, the offset processing unit 30 can determine an average error value between the restored pixels belonging to each band category 455 and the original pixels as the offset of the corresponding band category 455.

다음으로, 밴드 시작 지점과 밴드 카테고리를 반영한 오프셋 값을 생성하고, 이를 부호화할 수 있다. 상기 부호화도 오프셋 값을 재배열하는 과정을 더 포함할 수 있으며, 이는 에지 타입에서 살펴본 바와 같다.Next, an offset value reflecting the band start point and the band category can be generated and encoded. The encoding may further include rearranging the offset value, as described in the edge type.

예를 들어, 오프셋 처리부(30)는 밴드 시작 지점과 밴드 카테고리의 순서대로, 각 밴드 카테고리(550)의 오프셋 절대값(561)과, 부호값(562)을 부호화할 수 있다. 이때, 밴드 카테고리의 오프셋 절대값(561)과, 부호값(562)은 다양하게 존재할 수 있고, 밴드 카테고리(550)의 오프셋 절대값(561)이 "0"인 값이 존재할 수 있다. 이에 따라, 오프셋 절대값(561)이 밴드 카테고리의 순서에 따라 정렬될 경우, "0"의 오프셋 값을 갖는 밴드 카테고리(571)에 의해 비트열이 크기가 늘어나는 문제가 야기될 수 있다. 이를 고려하여, 오프셋 처리부(30)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리(571)를 상대적으로 앞으로 정렬하고, "0"의 오프셋 값을 갖는 밴드 카테고리(572)를 상대적으로 뒤에 위치하도록 정렬할 수 있다(S710). For example, the offset processing unit 30 can encode the offset absolute value 561 and the code value 562 of each band category 550 in the order of the band start point and the band category. At this time, the offset absolute value 561 and the sign value 562 of the band category may exist in various ways, and the offset absolute value 561 of the band category 550 may be " 0 ". Accordingly, when the offset absolute value 561 is aligned in the order of the band category, the problem arises that the bit string is increased in size by the band category 571 having an offset value of " 0 ". In consideration of this, the offset processing unit 30 arranges the band category 571 having the offset value other than " 0 " relatively forward and locates the band category 572 having the offset value " 0 & (S710).

S711 단계에서, 오프셋 처리부(30)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리(571)의 오프셋 절대값과 부호값을 부호화하고, "0"의 오프셋 값을 갖는 밴드 카테고리(572)의 오프셋 값은 비트열에 포함되지 않도록 부호화할 수 있다. In step S711, the offset processing unit 30 encodes the offset absolute value and the sign value of the band category 571 having an offset value other than " 0 ", and determines the offset of the band category 572 having the offset value of & The value can be encoded so that it is not included in the bit stream.

이와 같이, "0"의 오프셋 값을 갖는 카테고리의 오프셋 값은 비트열에 포함시키지 않으므로, "0"의 부호화값을 부호화하는데 소모되는 비트의 수를 절약할 수 있어, 부호화 데이터 효율을 증대시킬 수 있다.As described above, since the offset value of the category having the offset value of " 0 " is not included in the bit string, the number of bits consumed for encoding the encoded value of " 0 " can be saved and the encoded data efficiency can be increased .

나아가, 본 발명의 일 실시예에 따른 오프셋 처리부(30)는 "0"의 오프셋 값을 갖는 에지 카테고리 또는 밴드 카테고리의 수가 극대화될 수 있도록, 에지 카테고리 또는 밴드 카테고리의 종류나 수를 다양하게 변경할 수 있다. Furthermore, the offset processing unit 30 according to the embodiment of the present invention can variously change the number or types of edge categories or band categories so that the number of edge categories or band categories having an offset value of " 0 & have.

예를 들면, 에지 카테고리 또는 밴드 카테고리에 해당하는 픽셀의 수가 충분히 작으면, 해당 픽셀은 오프셋에 대한 이득이 크게 높지 않을 확률이 높다. 즉, 오프셋을 보내는데 필요한 비트량보다 오프셋에 의해 개선되는 화질의 이득이 상대적으로 클 경우에만 의미가 있다. 이를 고려하면, 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 포함된 픽셀의 수가 충분히 작다면, 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 대한 오프셋 값을 0으로 설정하여 부호화할 수 있다.For example, if the number of pixels corresponding to the edge category or band category is small enough, then the pixel has a high probability that the gain for the offset is not very high. That is, it is meaningful only when the gain of the image quality improved by the offset is relatively larger than the bit amount necessary for transmitting the offset. Taking this into consideration, if the number of pixels included in the corresponding category (edge category or band category) is sufficiently small, the offset value for the corresponding category (edge category or band category) can be set to 0 and encoded.

구체적으로, S706 단계 또는 S710 단계에서, 오프셋 처리부(30)는 해당 카테고리(에지 카테고리 또는 밴드 카테고리)에 포함된 픽셀의 수를 확인하고, 해당 카테고리에 포함된 픽셀의 수가 미리 정해진 임계값 이하일 경우, 해당 카테고리의 부호화 값을 "0"으로 설정할 수 있다. 이때, 오프셋 처리부(30)는 고정된 미리 정해진 임계값을 사용하거나, 또는 오프셋 정보의 부호화 비트량과 오프셋에 의한 화질 이득 사이의 관계를 고려하여 최적의 값을 결정하고, 결정된 최적의 값을 부호화할 수도 있다. Specifically, in step S706 or S710, the offset processing unit 30 confirms the number of pixels included in the corresponding category (edge category or band category), and when the number of pixels included in the category is equal to or smaller than a predetermined threshold value, The encoded value of the category can be set to " 0 ". At this time, the offset processing unit 30 determines an optimum value by using a fixed predetermined threshold value or considering the relationship between the image quality gain by the offset amount and the encoding bit amount of the offset information, and encodes the determined optimum value You may.

나아가, 오프셋 처리부(30)는 최적의 값을 부호화되지 않을 수 있으며, 영상 복호화부가 상기 최적의 값을 결정하는 방식을 사용하여 유도할 수도 있다. In addition, the offset processing unit 30 may not encode the optimal value and may derive the optimal value using a method of deciding the optimal value.

도 8은 본 개시의 일 실시예에 따른 오프셋 정보 복원 방법의 순서를 도시하는 흐름도이다. 8 is a flowchart showing a procedure of an offset information restoration method according to an embodiment of the present disclosure.

본 발명의 일 실시예에 따른 오프셋 정보 복호화 방법은 전술한 오프셋 정보 복원부(60))에 의해 수행될 수 있다. The offset information decoding method according to an embodiment of the present invention may be performed by the offset information restoration unit 60 described above).

오프셋 정보 복원부(60)는 부호화된 정보로부터 오프셋 타입(예, SAO 타입)을 확인한다(S801). 즉, 오프셋 정보 복원부(60)는 오프(Off) 타입, 에지(Edge) 타입 또는 밴드(Band) 타입을 식별하는 식별자를 확인하여 오프셋 타입을 확인할 수 있다. The offset information reconstruction unit 60 confirms an offset type (e.g., SAO type) from the encoded information (S801). That is, the offset information restoring unit 60 can confirm the offset type by checking the identifier identifying the Off type, Edge type, or Band type.

오프셋 부호화를 처리하지 않을 경우(S802-a), 오프셋 정보 복원부(60)는 해당 부호화 단위에 대한 오프셋 정보의 복호화를 완료한다.If offset coding is not performed (S802-a), the offset information restoring unit 60 completes decoding of the offset information for the coding unit.

에지 타입의 경우(S802-b), 오프셋 정보 복원부(60)는 에지 클래스에 대한 정보와, 에지 카테고리 단위의 오프셋 값을 복원할 수 있다. In the case of the edge type (S802-b), the offset information restoration unit 60 can restore the information about the edge class and the offset value in units of the edge category.

이때, 에지 카테고리 단위의 오프셋 값은 "0"이 아닌 오프셋 값을 갖는 에지 카테고리의 오프셋 값만 부호화되어 있고, "0"의 오프셋 값을 갖는 에지 카테고리의 오프셋 값은 비트열에 포함되어 있지 않다. 이에 따라, 오프셋 정보 복원부(60)는 "0"이 아닌 오프셋 값을 갖는 에지 카테고리의 오프셋 값을 복원한다(S803).At this time, the offset value of the edge category unit is encoded only in the offset value of the edge category having an offset value other than " 0 ", and the offset value of the edge category having the offset value of " 0 " Accordingly, the offset information restoring unit 60 restores the offset value of the edge category having an offset value other than " 0 " (S803).

다음으로, 오프셋 정보 복원부(60)는 비트열에 포함되지 않은 카테고리의 오프셋 값을 "0"으로 설정하고, 에지 카테고리의 오프셋 값을 에지 카테고리의 순서에 맞게 재 정렬한다(S804). 상기 재정렬은, 영상 부호화 장치에서 시그날링되는 재정렬 관련 정보를 기반으로 수행될 수 있다. 이에 따라, 오프셋 정보 복원부(60)는 에지 카테고리의 순서에 맞게 재 정렬된 에지 카테고리의 오프셋 값 확인할 수 있다.Next, the offset information restoration unit 60 sets the offset value of the category not included in the bit string to " 0 ", and rearranges the offset value of the edge category to the order of the edge category (S804). The reordering may be performed based on the reordering related information signaled by the image encoding apparatus. Accordingly, the offset information restoration unit 60 can confirm the offset value of the rearranged edge category in accordance with the order of the edge category.

이후, 오프셋 정보 복원부(60)는 에지 클래스에 대한 정보를 복원할 수 있다(S805). 그리고, 오프셋 정보 복원부(60)는 에지 클래스와 에지 카테고리 별 오프셋 값을 각각의 픽셀에 반영하여 해당 픽셀의 픽셀 값을 복원할 수 있다(S806). Thereafter, the offset information restoration unit 60 can restore the information about the edge class (S805). The offset information restoring unit 60 may restore the pixel value of the corresponding pixel by reflecting the edge class and the offset value of each edge category to each pixel (S806).

한편, 밴드 타입의 경우(S802-c), 오프셋 정보 복원부(60)는 밴드 시작 지점, 밴드 카테고리 단위의 오프셋 값을 복호화 수 있다. On the other hand, in the case of the band type (S802-c), the offset information restoration unit 60 can decode the offset value of the band start point and the band category unit.

밴드 카테고리 단위의 오프셋 값(예, 오프셋 절대값, 부호값 등)은 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리의 오프셋 값만 부호화되어 있고, "0"의 오프셋 값을 갖는 밴드 카테고리의 오프셋 값은 비트열에 포함되어 있지 않다. 이에 따라, 오프셋 정보 복원부(60)는 "0"이 아닌 오프셋 값을 갖는 밴드 카테고리의 오프셋 값을 복원할 수 있다(S808). Only the offset value of the band category having an offset value other than " 0 " is coded and the offset value of the band category having the offset value of " 0 " It is not included in the bit string. Accordingly, the offset information restoration unit 60 can restore the offset value of the band category having an offset value other than " 0 " (S808).

S809 단계에서, 오프셋 정보 복원부(60)는 비트열에 포함되지 않은 카테고리의 오프셋 값을 "0"으로 설정하고, "0"이 아닌 오프셋 값을 갖는 밴드 카테고리의 오프셋 값과, "0"의 오프셋 값을 갖는 밴드 카테고리를, 밴드 카테고리의 순서에 대응되도록 재 정렬한다. 상기 재정렬은, 영상 부호화 장치에서 시그날링되는 재정렬 관련 정보를 기반으로 수행될 수 있다.In step S809, the offset information restoration unit 60 sets the offset value of the category not included in the bit string to " 0 ", and the offset value of the band category having the offset value other than " 0 " The band category value is rearranged to correspond to the order of the band category. The reordering may be performed based on the reordering related information signaled by the image encoding apparatus.

또한, 오프셋 정보 복원부(60)는 부호화된 정보로부터 밴드 시작 지점에 대한 정보를 확인할 수 있다(S810).In addition, the offset information reconstruction unit 60 may check the information on the band starting point from the encoded information (S810).

그리고, 오프셋 정보 복원부(60)는 밴드 시작 지점, 밴드 카테고리의 오프셋 값을 적용하여 대응되는 픽셀의 값을 복원할 수 있다(S811). Then, the offset information restoring unit 60 may restore the value of the corresponding pixel by applying the offset value of the band start point and the band category (S811).

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

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

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

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

Claims (20)

영상 데이터를 부호화하는 방법에 있어서,
복수의 오프셋 단위를 확인하는 과정과,
상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 확인하는 과정과,
상기 복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 부호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 부호화하는 과정을 포함하고,
상기 상기 오프셋 정보를 부호화하는 과정은,
상기 오프셋 정보에 기초하여 상기 복수의 오프셋 단위를 내림차순으로 정렬하는 과정과,
상기 내림차순으로 정렬된 복수의 오프셋 단위 중, "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보만을 부호화하는 과정을 포함하는 것을 특징으로 하는 영상의 오프셋 정보 부호화 방법.
A method of encoding image data,
Identifying a plurality of offset units;
Determining offset information for each of the plurality of offset units;
Encoding the offset information for each of the plurality of offset units and encoding the offset information for some offset units of the plurality of offset units,
Wherein the step of encoding the offset information comprises:
Arranging the plurality of offset units in descending order based on the offset information;
And encoding only offset information in an offset unit having an offset value other than " 0 " out of a plurality of offset units arranged in descending order.
제1항에 있어서,
상기 일부 오프셋 단위는,
"0"이 아닌 오프셋 값을 갖는 오프셋 단위인 것을 특징으로 하는 영상의 오프셋 정보 부호화 방법.
The method according to claim 1,
The partial offset unit includes:
Is an offset unit having an offset value other than " 0 ".
제1항에 있어서,
상기 복수의 오프셋 단위는, 상기 일부 오프셋 단위 및 잔여 오프셋 단위를 포함하되,
상기 잔여 오프셋 단위는 "0"의 오프셋 값을 갖는 오프셋 단위인 것을 특징으로 하는 영상의 오프셋 정보 부호화 방법.
The method according to claim 1,
Wherein the plurality of offset units include the partial offset unit and the residual offset unit,
Wherein the residual offset unit is an offset unit having an offset value of " 0 ".
삭제delete 제1항에 있어서, 상기 오프셋 정보를 부호화하는 과정은,
상기 복수의 오프셋 단위에 포함된 픽셀의 수를 확인하는 과정과,
상기 복수의 오프셋 단위에 포함된 픽셀의 수를 기준으로 내림차순으로 정렬하는 과정과,
상기 복수의 오프셋 단위에 포함된 픽셀의 수가 미리 정해진 임계값을 초과하는 오프셋 단위에 대한 오프셋 정보만을 부호화하는 과정을 포함하는 영상의 오프셋 정보 부호화 방법.
The method of claim 1, wherein the encoding of the offset information comprises:
Determining a number of pixels included in the plurality of offset units;
Aligning the pixels in descending order based on the number of pixels included in the plurality of offset units;
And encoding only the offset information for an offset unit in which the number of pixels included in the plurality of offset units exceeds a predetermined threshold value.
제5항에 있어서, 상기 미리 정해진 임계값은,
영상 부호화의 율-왜곡(rate-distortion)을 고려하여 설정되거나, 또는 미리 정해진 고정값인 것을 특징으로 하는 영상의 오프셋 정보 부호화 방법.
6. The method of claim 5,
Wherein the coding rate is set in consideration of rate-distortion of the image coding or is a predetermined fixed value.
제1항에 있어서, 상기 오프셋 단위는,
에지 카테고리 또는 밴드 카테고리를 포함하는 것을 특징으로 하는 영상의 오프셋 정보 부호화 방법.
The apparatus of claim 1,
Edge category or band category of the image.
영상 데이터를 부호화하는 장치에 있어서,
복수의 오프셋 단위를 확인하고, 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 확인하여 제공하는 오프셋 보정부와,
상기 오프셋 보정부로부터 제공받은 상기 복수의 오프셋 단위 각각에 대한 오프셋 정보를 부호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 부호화하는 오프셋 부호화부를 포함하고,
상기 오프셋 부호화부는,
상기 오프셋 정보에 기초하여 상기 복수의 오프셋 단위를 내림차순으로 정렬하고,
상기 내림차순으로 정렬된 복수의 오프셋 단위 중, "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보만을 부호화하는 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
An apparatus for encoding video data, the apparatus comprising:
An offset correcting unit for identifying a plurality of offset units and confirming and providing offset information for each of the plurality of offset units;
And an offset encoding unit encoding the offset information for each of the plurality of offset units provided from the offset correcting unit and encoding the offset information for some offset units of the plurality of offset units,
Wherein the offset-
Arranging the plurality of offset units in descending order based on the offset information,
Wherein only the offset information of the offset unit having an offset value other than " 0 " out of a plurality of offset units arranged in descending order is encoded.
제8항에 있어서,
상기 일부 오프셋 단위는,
"0"이 아닌 오프셋 값을 갖는 오프셋 단위인 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
9. The method of claim 8,
The partial offset unit includes:
Is an offset unit having an offset value other than " 0 ".
제8항에 있어서,
상기 복수의 오프셋 단위는, 상기 일부 오프셋 단위 및 잔여 오프셋 단위를 포함하되,
상기 잔여 오프셋 단위는 "0"의 오프셋 값을 갖는 오프셋 단위인 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
9. The method of claim 8,
Wherein the plurality of offset units include the partial offset unit and the residual offset unit,
Wherein the residual offset unit is an offset unit having an offset value of " 0 ".
삭제delete 제8항에 있어서,
상기 오프셋 보정부는, 상기 복수의 오프셋 단위에 포함된 픽셀의 수를 확인하고 상기 오프셋 부호화부에 제공하고,
상기 오프셋 부호화부는, 상기 복수의 오프셋 단위에 포함된 픽셀의 수를 기준으로 내림차순으로 정렬하고, 상기 복수의 오프셋 단위에 포함된 픽셀의 수가 미리 정해진 임계값을 초과하는 오프셋 단위에 대한 오프셋 정보만을 부호화하는 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
9. The method of claim 8,
Wherein the offset correcting unit determines the number of pixels included in the plurality of offset units and provides the number of pixels to the offset encoding unit,
Wherein the offset coding unit arranges the pixels in descending order of the number of pixels included in the plurality of offset units and encodes only offset information for offset units in which the number of pixels included in the plurality of offset units exceeds a predetermined threshold value And outputs the offset information.
제12항에 있어서, 상기 미리 정해진 임계값은,
영상 부호화의 율-왜곡(rate-distortion)을 고려하여 설정되거나, 또는 미리 정해진 고정값인 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
13. The method of claim 12,
Wherein the rate information is set in consideration of a rate-distortion of the image encoding, or is a predetermined fixed value.
제8항에 있어서, 상기 오프셋 단위는,
에지 카테고리 또는 밴드 카테고리를 포함하는 것을 특징으로 하는 영상의 오프셋 정보 부호화 장치.
The apparatus of claim 8,
Edge category or a band category.
부호화된 영상 데이터를 복호화하는 방법에 있어서,
복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 복호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 복호화하는 과정과,
상기 복수의 오프셋 단위 중 일부 오프셋 단위에 포함되지 않는 잔여 오프셋 단위에 대한 상기 오프셋 정보를 복호화하는 과정과,
상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 제공하는 과정과,
상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 반영하여, 부호화 단위의 픽셀 정보를 복원하는 과정을 포함하고,
상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 제공하는 과정은,
상기 부호화된 영상 데이터로부터 상기 일부 오프셋 단위에 대응되는 "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보를 확인하는 과정과,
미리 정해진 규칙에 의해 상기 잔여 오프셋 단위에 대응되는 "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보를 확인하는 과정과,
상기 오프셋 정보에 기초하여 상기 복수의 오프셋 단위를 재 정렬하는 과정과,
상기 재 정렬된 복수의 오프셋 단위에 대한 상기 오프셋 정보를 제공하는 과정을 포함하는 것을 특징으로 하는 영상의 오프셋 정보 복호화 방법.
A method for decoding coded image data,
Decoding the offset information for each of a plurality of offset units and decoding the offset information for some offset units of the plurality of offset units;
Decoding the offset information for a residual offset unit not included in some offset units among the plurality of offset units;
Providing offset information for the partial offset unit and the residual offset unit;
And restoring pixel information of an encoding unit by reflecting offset information for the partial offset unit and the residual offset unit,
Wherein the step of providing the offset information for the partial offset unit and the residual offset unit comprises:
Determining offset information in an offset unit having an offset value that is not " 0 " corresponding to the partial offset unit from the encoded image data;
Determining offset information in an offset unit having an offset value that is not " 0 " corresponding to the residual offset unit by a predetermined rule;
Rearranging the plurality of offset units based on the offset information;
And providing the offset information for the reordered plurality of offset units.
삭제delete 제15항에 있어서, 상기 오프셋 단위는,
에지 카테고리 또는 밴드 카테고리를 포함하는 것을 특징으로 하는 영상의 오프셋 정보 복호화 방법.
16. The apparatus of claim 15,
Edge category or band category of the image.
부호화된 영상 데이터를 복호화하는 장치에 있어서,
복수의 오프셋 단위 각각에 대한 상기 오프셋 정보를 복호화하되, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 대한 상기 오프셋 정보를 복호화하고, 상기 복수의 오프셋 단위 중 일부 오프셋 단위에 포함되지 않는 잔여 오프셋 단위에 대한 상기 오프셋 정보를 복호화하여 제공하는 오프셋 정보 복호화부와,
상기 일부 오프셋 단위 및 상기 잔여 오프셋 단위에 대한 오프셋 정보를 반영하여, 부호화 단위의 픽셀 정보를 복원하는 오프셋 보정부를 포함하고,
상기 오프셋 정보 복호화부는
상기 부호화된 영상 데이터로부터 상기 일부 오프셋 단위에 대응되는 "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보를 확인하고,
미리 정해진 규칙에 의해 상기 잔여 오프셋 단위에 대응되는 "0"이 아닌 오프셋 값을 갖는 오프셋 단위의 오프셋 정보를 복원하고,
상기 오프셋 정보에 기초하여 상기 복수의 오프셋 단위를 재 정렬하는 것을 특징으로 하는 영상의 오프셋 정보 복호화 장치.
An apparatus for decoding coded image data, the apparatus comprising:
The method comprising: decoding the offset information for each of a plurality of offset units, decoding the offset information for some offset units of the plurality of offset units, and decoding the offset information for the remaining offset units not included in some offset units An offset information decoding unit decoding the offset information and providing the offset information;
And an offset correction unit for restoring pixel information of a coding unit by reflecting offset information for the partial offset unit and the residual offset unit,
The offset information decoding unit
And an offset information detector for detecting offset information in an offset unit having an offset value other than " 0 " corresponding to the partial offset unit from the encoded image data,
Restores offset information in an offset unit having an offset value that is not " 0 " corresponding to the residual offset unit by a predetermined rule,
And rearranges the plurality of offset units based on the offset information.
삭제delete 제18항에 있어서, 상기 오프셋 단위는,
에지 카테고리 또는 밴드 카테고리를 포함하는 것을 특징으로 하는 영상의 오프셋 정보 복호화 장치.
19. The apparatus of claim 18,
Edge category or a band category.
KR1020170054665A 2016-05-04 2017-04-27 Method and apparatus for coding offset information and decoding using the same KR101981687B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20160055381 2016-05-04
KR1020160055381 2016-05-04

Publications (2)

Publication Number Publication Date
KR20170125725A KR20170125725A (en) 2017-11-15
KR101981687B1 true KR101981687B1 (en) 2019-05-24

Family

ID=60387432

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170054665A KR101981687B1 (en) 2016-05-04 2017-04-27 Method and apparatus for coding offset information and decoding using the same

Country Status (1)

Country Link
KR (1) KR101981687B1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8660174B2 (en) * 2010-06-15 2014-02-25 Mediatek Inc. Apparatus and method of adaptive offset for video coding
KR102006479B1 (en) * 2011-06-24 2019-08-01 엘지전자 주식회사 Image information encoding and decoding method
EP2728865A4 (en) * 2011-06-28 2016-03-16 Samsung Electronics Co Ltd Video encoding method using offset adjustments according to pixel classification and apparatus therefor, video decoding method and apparatus therefor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
변주원 외 2, ‘Sample Adaptive Offset에서 Edge Offest 모드의 효율적인 부호화 방법’, 대한전자공학회, 741-742(2pages), 2013.07.*

Also Published As

Publication number Publication date
KR20170125725A (en) 2017-11-15

Similar Documents

Publication Publication Date Title
US20190313112A1 (en) Method for decoding video signal and apparatus therefor
KR20170116850A (en) Method and apparatus for processing a video signal based on intra prediction
KR102470832B1 (en) Method and apparatus for processing a video signal
KR20170108367A (en) Method and apparatus for processing a video signal based on intra prediction
KR102502216B1 (en) Method and apparatus for encoding/decoding an image
KR20160118945A (en) Method and apparatus for processing a video signal
KR20170007069A (en) A method and an apparatus for correcting distortion of a paranomic video
KR102422485B1 (en) Method and apparatus for processing a video signal
KR20160037111A (en) Method and apparatus for processing a video signal
KR20160088243A (en) Method and apparatus for processing a video signal
KR20160093564A (en) Method and apparatus for processing a video signal
KR20160051343A (en) A method and an apparatus for encoding/decoding a video signal using intra prediction
KR102378803B1 (en) A method of decoding a video signal and an apparatus having the same
KR101802375B1 (en) Methods of derivation of temporal motion vector predictor and appratuses using the same
KR101743665B1 (en) Method and apparatus for processing a video signal based on intra prediction
KR20180096194A (en) Apparatus for coding and decoding a transform coefficient, and coding device and decoding device for the same
KR20200074877A (en) A video encoding/decoding method and apparatus
KR20190140422A (en) A method and an apparatus for encoding/decoding a residual block based on quantization parameter
KR20190140820A (en) A method and an apparatus for processing a video signal based on reference between components
KR101981687B1 (en) Method and apparatus for coding offset information and decoding using the same
KR102009634B1 (en) Method and apparatus for coding image compensation information and decoding using the same
KR102573577B1 (en) A method for processing a video, a method and an apparatus for frame rate conversion
KR20200026394A (en) A method and an apparatus for encoding/decoding a intra prediction
KR20160140409A (en) Method and apparatus for processing a video signal
KR20160122080A (en) Method and apparatus for processing a video signal

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right