KR20140057514A - Prediction block generating apparatus - Google Patents

Prediction block generating apparatus Download PDF

Info

Publication number
KR20140057514A
KR20140057514A KR1020140045831A KR20140045831A KR20140057514A KR 20140057514 A KR20140057514 A KR 20140057514A KR 1020140045831 A KR1020140045831 A KR 1020140045831A KR 20140045831 A KR20140045831 A KR 20140045831A KR 20140057514 A KR20140057514 A KR 20140057514A
Authority
KR
South Korea
Prior art keywords
unit
prediction
mode
block
intra
Prior art date
Application number
KR1020140045831A
Other languages
Korean (ko)
Other versions
KR101474984B1 (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
Family has litigation
First worldwide family litigation filed litigation Critical https://patents.darts-ip.com/?family=49216773&utm_source=google_patent&utm_medium=platform_link&utm_campaign=public_patent_search&patent=KR20140057514(A) "Global patent litigation dataset” by Darts-ip is licensed under a Creative Commons Attribution 4.0 International License.
Application filed by 엠앤케이홀딩스 주식회사 filed Critical 엠앤케이홀딩스 주식회사
Publication of KR20140057514A publication Critical patent/KR20140057514A/en
Application granted granted Critical
Publication of KR101474984B1 publication Critical patent/KR101474984B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A prediction block generating apparatus according to the present invention utilizes auxiliary information for generating a prediction block included in a received information container, and effective intra-prediction candidate information of a current prediction unit to determine an intra-prediction mode of a current prediction unit. Then, the apparatus generates reference pixels in locations which are not available in generating an intra-prediction block, by using available reference pixels. Next, the apparatus adaptively filters reference pixels close to the current prediction unit based on the intra-prediction mode of the determined intra-prediction unit and size information of the current prediction unit. Finally, the apparatus utilizes the reference pixels corresponding to the intra-prediction mode of the determined current prediction unit to generate a prediction block of the current prediction unit. Therefore, a prediction block, which is close to an original image, is generated, and an image compression ratio is raised.

Description

예측 블록 생성 장치 {Prediction block generating apparatus}[0001] Prediction block generating apparatus [0002]

본 발명은 동영상 예측 블록을 생성하는 장치에 관한 것으로, 보다 상세하게는 잔차 블록의 부호화량을 감소시킬 수 있는 예측 블록을 생성하는 장치에 관한 것이다.The present invention relates to an apparatus for generating a moving picture prediction block, and more particularly, to an apparatus for generating a prediction block capable of reducing an amount of coding of a residual block.

MPEG-1, MPEG-2, MPEG-4 H.264/MPEG-4, AVC(Advanced Video coding)와 같은 영상 압축 방식에서는 영상을 부호화하기 위해서 하나의 픽처를 매크로 블록으로 나눈다. 그리고, 인터 예측(inter prediction) 또는 인트라 예측(intra prediction)을 이용해 각각의 매크로 블록을 부호화한다.In an image compression method such as MPEG-1, MPEG-2, MPEG-4 H.264 / MPEG-4 and AVC (Advanced Video coding), one picture is divided into macroblocks for coding an image. Then, each macroblock is encoded using inter prediction or intra prediction.

이 중에서 인트라 예측은 현재 픽처(picture)의 블록을 부호화하기 위해서 참조 픽처를 참조하는 것이 아니라, 부호화하려는 현재 블록과 공간적으로 인접한 화소값을 이용하여 부호화를 수행한다. 우선, 인접한 화소값을 이용하여 원본 매크로 블록과 비교하여 왜곡이 적은 인트라 예측 모드를 선택한다. 다음으로, 선택된 인트라 예측 모드 및 인접한 화소값을 이용하여 부호화하려는 현재 블록에 대한 예측값을 계산하고, 예측값과 원본 현재 블록의 화소값의 차이를 구한 후 이를 변환부호화, 양자화, 엔트로피 부호화를 통해 부호화한다. 그리고, 예측 모드도 부호화된다.Among these, intra prediction does not refer to a reference picture to encode a block of a current picture but performs encoding using pixel values spatially adjacent to the current block to be encoded. First, an intra prediction mode having a small distortion is selected by comparing the original macroblock with an adjacent pixel value. Next, prediction values for the current block to be encoded are calculated using the selected intra-prediction mode and adjacent pixel values, and a difference between the predicted value and the pixel value of the original current block is obtained, and then the resultant is encoded through transcoding, quantization, and entropy encoding . The prediction mode is also coded.

여기서, 인트라 예측 모드들은 크게 휘도 성분의 4×4 인트라 예측 모드, 8×8 인트라 예측모드, 16×16 인트라 예측 모드 및 색차 성분의 인트라 예측 모드로 나뉜다. Here, the intra-prediction modes are roughly divided into a 4x4 intra-prediction mode, an 8x8 intra-prediction mode, a 16x16 intra-prediction mode, and a chrominance intra-prediction mode.

종래 기술에 따른 16×16 인트라 예측 모드에는 수직(vertical) 모드, 수평(horizontal) 모드, DC(direct current) 모드, 플레인(plane) 모드의 총 네가지의 모드가 존재한다.In the 16x16 intra prediction mode according to the prior art, there are four modes of a vertical mode, a horizontal mode, a direct current (DC) mode, and a plane mode.

종래 기술에 따른 4×4 인트라 예측 모드에는 수직(vertical) 모드, 수평(horizontal) 모드, DC(direct current) 모드, 대각선 왼쪽(diagonal down-left) 모드, 대각선 오른쪽(diagonal down-right) 모드, 수직 오른쪽(vertical right) 모드, 수직 왼쪽(vertical left) 모드, 수평 위쪽(horizontal-up) 모드 및 수평 아래쪽(horizontal-down) 모드의 총 9개의 모드가 존재한다.The conventional 4x4 intra prediction modes include a vertical mode, a horizontal mode, a DC (direct current) mode, a diagonal down-left mode, a diagonal down-right mode, There are a total of nine modes: vertical right mode, vertical left mode, horizontal-up mode, and horizontal-down mode.

각각의 모드에 인덱싱(indexing)된 예측 모드 번호들은 각각의 모드가 이용되는 빈도수에 따라 결정된 번호이다. 확률적으로 0번 모드인 수직 모드가 대상 블록에 대해 인트라 예측을 수행할 때 가장 많이 쓰이는 모드이며, 8번인 수평 위쪽(horizontal-up) 모드가 가장 적게 쓰이는 모드이다.Prediction mode numbers indexed in each mode are numbers determined according to the frequency with which each mode is used. Vertical mode, which is a probability 0 mode, is the most commonly used mode when intra prediction is performed on a target block. Horizontal (up-8) mode is the least used mode.

H.264 표준안에 따르면 영상을 부호화함에 있어 상기 4×4 인트라 예측 모드 및 16×16 인트라 예측 모드의 총 13가지 모드로 현재 블록을 부호화하고, 그 중 최적의 모드에 따라 현재 블록에 대한 비트스트림을 생성한다.According to the H.264 standard, in coding an image, a current block is coded in 13 modes of the 4 × 4 intra prediction mode and the 16 × 16 intra prediction mode, and a bitstream .

그러나, 현재 블록에 포함된 화소들에 인접한 화소값들 중 일부 또는 전부가 존재하지 않거나, 부호화되지 않은 경우에는 인트라 예측 모드 중 일부 또는 전부를 적용할 수 없는 문제점이 발생한다. 적용 가능한 인트라 모드 중 선택하여 인트라 예측을 수행하면, 현재 블록과 예측블록 사이의 잔차신호(residue)가 크게 되므로 영상 압축의 효율이 떨어진다.However, when some or all of the pixel values adjacent to the pixels included in the current block do not exist or are not coded, some or all of the intra prediction modes can not be applied. If intra prediction is performed by selecting one of the applicable intra modes, the residual signal between the current block and the prediction block becomes large, thus reducing the efficiency of image compression.

본 발명이 이루고자 하는 목적은 원본 영상과 유사한 예측 블록을 생성하는 예측 블록 생성 장치를 제공하는 데 있다.An object of the present invention is to provide a prediction block generating apparatus for generating a prediction block similar to an original image.

본 발명에 따른 예측 블록 생성 장치는 수신된 부가정보 콘테이너에 포함된 예측블록 생성을 위한 부가정보 및 현재 예측 단위의 유효한 인트라 예측 모드 후보자 정보를 이용하여 현재 예측 단위의 인트라 예측 모드를 결정하는 예측모드 복호화부, 인트라 예측 블록을 생성하기 위해 이용 가능하지 않은 위치의 참조 화소들을 이용 가능한 참조 화소들을 이용하여 생성하는 참조 화소 생성부, 상기 결정된 현재 예측 단위의 인트라 예측 모드 또는 현재 예측 단위의 크기 정보에 기초하여 현재 예측 단위에 인접한 참조화소를 적응적으로 필터링하는 참조화소 필터링, 상기 결정된 현재 예측 단위의 인트라 예측 모드에 대응하는 참조화소들을 이용하여 현재 예측 단위의 예측 블록을 생성하는 예측블록 생성부를 포함한다.The apparatus for generating a prediction block according to the present invention includes a prediction mode determining unit for determining an intra prediction mode of a current prediction unit by using additional information for generating a prediction block included in a received additional information container and effective intra prediction mode candidate information of a current prediction unit, A reference pixel generating unit for generating reference pixels at positions that are not available for generating the intra prediction block and the intra prediction block using available reference pixels, And a prediction block generation unit for generating a prediction block of a current prediction unit using reference pixels corresponding to the determined intra prediction mode of the current prediction unit do.

본 발명에 따른 인트라 예측 부호화 및 복호화 방법 및 장치는 원본 영상에 근접한 예측 블록을 생성하기 위해 참조 픽셀을 생성하고, 상기 참조 픽셀을 적응적으로 필터링함으로써, 원본 영상에 가까운 예측 블록을 생성한다. 또한, 예측 블록을 인트라 예측 모드에 따라 적응적으로 필터링함으로써, 잔차 신호를 더욱 줄일 수 있게 되어, 영상 압축률을 높일 수 있다.A method and an apparatus for intraprediction encoding and decoding according to the present invention generate a reference pixel to generate a prediction block close to an original image and adaptively filter the reference pixel to generate a prediction block close to the original image. Further, by adaptively filtering the prediction block according to the intra prediction mode, the residual signal can be further reduced, and the image compression ratio can be increased.

도 1은 본 발명에 따른 동영상 부호화 장치를 나타내는 블록도이다.
도 2는 본 발명에 따른 스캐닝부의 동작 과정을 나타내는 흐름도이다.
도 3은 본 발명에 따른 동영상 복호화 장치를 나타내는 블록도이다.
도 4는 본 발명에 따른 인트라 예측부를 나타내는 블록도이다.
도 5는 본 발명에 따른 인트라 예측에 사용되는 참조 픽셀들의 위치를 나타내는 도면이다.
도 6은 본 발명에 따른 참조픽셀을 생성하는 방법을 나타내는 도면이다.
도 7은 본 발명에 따른 복호화 장치의 인트라 예측부를 나타내는 블록도이다.
1 is a block diagram illustrating a moving picture encoding apparatus according to the present invention.
2 is a flowchart illustrating an operation process of the scanning unit according to the present invention.
3 is a block diagram illustrating a video decoding apparatus according to an embodiment of the present invention.
4 is a block diagram illustrating an intra predictor according to the present invention.
5 is a diagram illustrating positions of reference pixels used in intra prediction according to the present invention.
6 is a diagram illustrating a method of generating a reference pixel according to the present invention.
7 is a block diagram illustrating an intra predictor of the decoding apparatus according to the present invention.

이하, 본 발명의 여러가지 실시예들을 예시적인 도면을 통해 상세히 설명한다. 본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. Hereinafter, various embodiments of the present invention will be described in detail with reference to exemplary drawings. It is to be understood that the invention is not to be limited to the specific embodiments thereof except as defined in the appended claims and all changes, Should be understood to include. Like reference numerals are used for like elements in describing each drawing.

영상 부호화를 위해 각 픽쳐는 복수개의 슬라이스로 이루어지고, 각 슬라이스는 복수개의 부호화 단위로 이루어진다. HD급 이상의 영상에서는 영상이 비교적 평탄해지는 영역이 많으므로, 16x16 크기의 MB보다 큰 단위의 부호화 단위로 부호화를 하는 것이 영상 압축률을 높일 수 있다. For image coding, each picture is composed of a plurality of slices, and each slice is made up of a plurality of coding units. In the HD-level or higher-level video, there are many regions where the image is relatively flat. Therefore, it is possible to increase the image compression rate by encoding in units of units larger than the 16x16 MB.

본 발명에 따른 부호화 단위는 16x16 크기의 MB뿐만 아니라 32x32 크기의 블록, 64x64 크기의 블록일 수 있다. 또한 8x8 크기 또는 더 작은 크기의 블록도 부호화 단위가 될 수 있다. 편의상 가장 큰 부호화 단위를 슈퍼매크로블록(SMB)로 지칭한다. 그리고, 상기 슈퍼매크로블록의 크기는 가장 작은 부호화 단위의 크기를 나타내는 정보 및 깊이 정보로 결정될 수 있다. 상기 깊이 정보는 상기 슈퍼매크로블록과 가장 작은 부호화 단위 사이의 크기 차이값을 나타낸다.The encoding unit according to the present invention may be a 32x32 block, a 64x64 block, as well as a 16x16 MB. A block of 8x8 size or smaller can also be an encoding unit. For convenience, the largest encoding unit is referred to as a super macro block (SMB). The size of the super macro block can be determined as information indicating the size of the smallest encoding unit and depth information. The depth information indicates a size difference value between the super macroblock and the smallest encoding unit.

따라서, 영상 시퀀스의 모든 픽쳐의 부호화에 사용하게 될 부호화 단위들은 SMB 및 이들의 서브블록들일 수 있다. 영상 시퀀스에 사용하게 될 부호화 단위는 디폴트로 지정되거나 시퀀스 헤더에서 지정할 수 있다. Therefore, the coding units to be used for coding all the pictures of the video sequence may be SMBs and their subblocks. The encoding unit to be used for the video sequence can be specified as the default or specified in the sequence header.

SMB(즉, 최대 부호화 단위)는 1개 이상의 부호화 단위로 구성된다. 따라서, SMB는 부호화 단위의 분할 구조와 부호화 단위를 포함하기 위해 재귀적 부호화 트리(Coding tree) 형태를 갖는다. 따라서, SMB를 기준으로 설명하면 다음과 같다. 먼저 SMB가 4개의 하위 부호화 단위로 분할되지 않으면, 상기 부호화 트리는 분할되지 않음을 나타내는 정보와 1개의 부호화 단위로 구성될 수 있다. 그러나, SMB가 4개의 하위 부호화 단위로 분할되면, 상기 부호화 트리는 분할됨을 나타내는 정보와 4개의 하위 부호화 트리로 구성될 수 있다. 마찬가지로, 각각의 하위 부호화 트리는 SMB 단위의 부호화 트리와 동일한 구조를 갖는다. 다만, 최소 부호화 단위 이하로는 분할되지 않는다..The SMB (i.e., the maximum encoding unit) is composed of one or more encoding units. Therefore, the SMB has a recursive coding tree form to include a division structure and an encoding unit of an encoding unit. Therefore, the description based on the SMB is as follows. If the SMB is not divided into four sub-coding units, the coding tree may be composed of information indicating that the SMB is not divided and one coding unit. However, if the SMB is divided into four sub-coding units, the coding tree may be composed of information indicating that the SMB is divided and four sub-coding trees. Similarly, each sub-encoding tree has the same structure as an encoding tree of SMB units. However, it is not divided below the minimum encoding unit.

한편, 부호화 트리 내의 각각의 부호화 단위는 부호화 단위 자체 또는 서브블록 단위로 인트라 예측(Intra Pediction) 또는 인터 예측(Inter Prediction)이 수행된다. 상기 인트라 예측 또는 인터 예측을 수행하는 단위를 예측 단위(Prediction unit)이라 지칭한다. 인트라 예측을 위한 예측 단위는 2Nx2N 또는 NxN일 수 있다. 인터 예측을 위한 예측 단위는 2Nx2N, 2NxN, Nx2N, NxN일수 있다. 여기서 2N은 부호화 단위의 가로 세로 길이를 의미한다 . On the other hand, Intra Pediction or Inter Prediction is performed for each coding unit in the coding tree per coding unit itself or sub-block unit. The unit for performing the intra prediction or the inter prediction is referred to as a prediction unit. The prediction unit for intra prediction may be 2Nx2N or NxN. Prediction units for inter prediction may be 2Nx2N, 2NxN, Nx2N, NxN. Where 2N denotes the length and breadth of the coding unit .

부호화 단위는 부호화 단위 내의 예측 단위의 예측 모드와 예측 단위의 크기 정보(partmode)를 포함해야 한다. 부호화 효율을 높이기 위해 예측 모드 정보 및 예측 단위의 크기 정보를 결합하여 조인트 코딩할 수 있다. 이 경우, 각 부호화 단위마다 조인트 코딩된 예측 타입(pred_type)이 포함된다. The encoding unit should include the prediction mode of the prediction unit in the encoding unit and the size information of the prediction unit (partmode). In order to increase the coding efficiency, the prediction mode information and the size information of the prediction unit may be combined and jointly coded. In this case, a prediction type (pred_type) jointly coded is included for each coding unit.

부호화 단위는 예측 단위마다 부가정보 콘테이너를 포함한다. 부가정보 콘테이너는 상기 예측 단위의 예측 블록을 생성하기 위해 필요한 부가정보를 포함한다. 인트라 예측의 경우, 상기 부가정보는 부호화된 인트라 예측 정보를 포함한다. 인터 예측의 경우, 상기 부가 정보는 부호화된 움직임 정보를 포함한다. 상기 움직임 정보는 움직임 벡터 및 참조 픽쳐 인덱스를 포함한다. The encoding unit includes an additional information container for each prediction unit. The additional information container includes additional information necessary for generating a prediction block of the prediction unit. In case of intra prediction, the side information includes encoded intra prediction information. In the case of inter prediction, the additional information includes coded motion information. The motion information includes a motion vector and a reference picture index.

부호화 단위는 부호화 단위의 잔차신호 콘테이너를 포함한다. 상기 잔차 신호 콘테이너는 1개의 변환 트리, 1개의 휘도 잔차신호 콘테이너 및 2개의 색차 잔차신호 콘테이너를 포함한다. 상기 변환 트리는 트리 구조로 이루어진 잔차신호 콘테이너 내의 변환블록들의 잔차신호 유무를 나타낸다. 잔차 신호 콘테이너는 재귀적 트리 구조로 이루어진다. 즉, 부호화 단위의 잔차 신호 콘테이너를 기준으로 설명하면 다음과 같다. 먼저, 상기 부호화 단위의 잔차 신호 콘테이너가 4개의 하위 잔차 신호 콘테이너로 분할되지 않으면, 상기 잔차신호 콘테이너는 양자화 정보(잔차 양자화 파라미터)와 부호화된 잔차 신호를 포함한다. 상기 잔차 신호 콘테이너가 4개의 하위 잔차 신호 콘테이너로 분할되면, 상기 부호화 단위의 잔차신호 콘테이너는 양자화 정보와 4개의 하위 잔차 신호 콘테이너를 포함한다. 상기 하위 잔차 신호 콘테이너는, 양자화 정보를 포함하지 않는 것을 제외하고는, 상기 부호화 단위 잔차신호 콘테이너와 동일한 구조를 갖는다. The encoding unit includes the residual signaling container of the encoding unit. The residual signal container includes one conversion tree, one luminance residual signal container, and two color difference residual signal containers. The conversion tree indicates the presence or absence of residual signals in the conversion blocks in the residual signal container made of a tree structure. The residual signal container consists of a recursive tree structure. That is, the residual signal container of the coding unit will be described with reference to the following. First, if the residual signal container of the encoding unit is not divided into four lower residual signal containers, the residual signal container includes quantization information (residual quantization parameter) and encoded residual signal. If the residual signal container is divided into four lower residual signal containers, the residual signal container of the encoding unit includes quantization information and four lower residual signal containers. The lower residual signal container has the same structure as the encoding unit residual signal container except that it does not include quantization information.

한편, 앞서 설명한 내용에서는 부호화 단위가 균등 분할된 예측 단위에 대해서만 설명하였다. 그러나, 영상의 특성상 특정 방향 또는 특정 위치로 경계를 가지는 경우에는 앞서 설명한 균등 분할을 이용할 경우, 경계부분에서는 유사한 데이터에 대해서 서로 다른 예측 단위들이 사용되어 잔차신호를 효과적으로 줄이지 못하는 문제점이 있다. On the other hand, only the prediction unit in which the coding units are equally divided has been described. However, when the image has a boundary in a specific direction or a specific position due to the characteristic of the image, when using the above-described uniform division, different prediction units are used for similar data in the boundary portion, so that the residual signal can not be effectively reduced.

따라서, 이러한 경우에는 영상의 경계 부분의 형상에 따라 SMB 또는 MB를 특정방향으로 분할하여 인트라 또는 인터 예측을 하는 것이 잔차 신호 압축에 더욱 효과적이다. Therefore, in such a case, it is more effective to perform intra or inter prediction by dividing the SMB or MB in a specific direction according to the shape of the boundary portion of the image.

가장 간단한 적응적인 모드는 예측 영역의 국부적인 지형의 통계적 의존성을 추출하기 위해 부호화 단위를 직선을 이용하여 2개의 블록으로 분할하는 것이다. 즉, 영상의 경계부분을 직선으로 매칭시켜 분할하는 것이다. 이 경우, 분할 가능한 방향을 소정 개수로 한정하는 것이 바람직하다. 예를 들어, 블록을 분할하는 방법을 수평, 수직, 상향 대각선, 하향 대각선의 4가지 방향으로 한정할 수 있다. 또한, 수평, 수직으로만 한정할 수도 있다. 분할 가능한 수는 3, 5, 7 등이 가능하다. 분할 가능한 수는 블록의 크기에 달리할 수 있다. 예를 들어, 사이즈가 큰 부호화 단위에 대해 상대적으로 분할 가능한 수를 늘릴 수 있다. The simplest adaptive mode is to segment the coding units into two blocks using a straight line to extract the statistical dependence of the local topography of the prediction region. That is, the boundary portion of the image is matched with a straight line and divided. In this case, it is preferable to limit the dividable directions to a predetermined number. For example, the method of dividing a block can be limited to four directions: horizontal, vertical, upward diagonal, and downward diagonal. Also, it may be limited to horizontal and vertical. The divisible number is 3, 5, 7, and so on. The number of divisible numbers can be different from the size of the block. For example, it is possible to increase the number of divisions relative to a large-size encoding unit.

인터 예측의 경우, 하나의 부호화 단위를 보다 적응적으로 예측하기 위해 2개의 예측 블록으로 분할한 경우, 예측 블록 각각에 대하여 움직임 예측 및 움직임 보상을 하여야 한다. 따라서, 각각의 분할된 영역마다 움직임 정보를 구하고, 움직임 정보에 기초하여 얻어진 예측 블록과의 잔차신호를 부호화한다. In the case of inter prediction, when one encoding unit is divided into two prediction blocks in order to more adaptively predict, it is necessary to perform motion prediction and motion compensation on each of the prediction blocks. Therefore, the motion information is obtained for each divided area, and the residual signal with the prediction block obtained based on the motion information is encoded.

하나의 부호화 단위에 대해 분할된 2개의 예측 블록마다의 잔차 신호를 구한 후 2개의 잔차신호를 더하여 하나의 부호화 단위 잔차신호를 형성하여 변환 부호화한다. 이 경우에는 경계면을 중심으로 각각의 분할된 영역의 잔차 신호의 분포가 전체적인 분포가 차이가 있을 확률이 크기 때문에 어느 한 영역의 값을 일정값을 곱하여 하나의 부호화 단위에 대한 잔차신호를 생성할 수 있다. 또한, 2개의 잔차 신호의 경계 부분을 오버랩시켜 경계 부분을 스무딩(smoothing)하여 하나의 잔차 신호를 생성할 수 있다. A residual signal for each of the two prediction blocks divided for one coding unit is obtained, and two residual signals are added to form one coding unit residual signal, and the resultant signal is transcoded. In this case, since the probability that the distribution of the residual signals of the respective divided regions is different from each other is large, the residual signal for one coding unit can be generated by multiplying the value of one region by a constant value have. In addition, one residual signal can be generated by smoothing the boundary portion by overlapping the boundary portions of the two residual signals.

또 다른 방법으로는 블록의 각각의 분할 영역별로 패딩을 통하여 블록을 생성하여 부호화할 수 있다. 즉, 2개의 분할영역 중 현재 분할 영역을 부호화할 때, 블록의 구성하는 다른 분할 영역을 현재 분할 영역의 값으로 패딩하여 하나의 블록으로 구성한 후 2차원 변환 부호화할 수 있다.Alternatively, a block can be generated and padded by padding for each divided area of the block. That is, when coding the current divided region among the two divided regions, the other divided regions constituting the block may be padded with the values of the current divided region into one block, and then two-dimensional transformed coding may be performed.

도 1은 본 발명에 따른 동영상 부호화 장치를 나타내는 블록도이다.1 is a block diagram illustrating a moving picture encoding apparatus according to the present invention.

도 1을 참조하면, 본 발명에 따른 동영상 부호화 장치(100)는 픽쳐 분할부(110), 변환부(120), 양자화부(130), 스캐닝부(131), 엔트로피 부호화부(140), 인트라 예측부(150), 인터 예측부(160), 역양자화부(135), 역변환부(125), 후처리부(170), 픽쳐 저장부(180), 감산부(190) 및 가산부(195)를 포함한다.1, a moving picture encoding apparatus 100 according to the present invention includes a picture dividing unit 110, a transform unit 120, a quantization unit 130, a scanning unit 131, an entropy coding unit 140, An inter prediction unit 160, an inverse quantization unit 135, an inverse transformation unit 125, a post-processing unit 170, a picture storage unit 180, a subtraction unit 190, and an addition unit 195, .

픽쳐 분할부(110)는 입력되는 비디오 신호를 분석하여 픽쳐를 가장 큰 부호화 단위마다 소정 크기의 부호화 단위로 분할하여 예측 모드를 결정하고, 상기 부호화 단위별로 예측 단위의 크기를 결정한다. 그리고, 픽쳐 분할부(110)는 부호화할 예측 단위를 예측 모드에 따라 인트라 예측부(150) 또는 인터 예측부(160)로 보낸다. 또한, 픽쳐 분할부(110)는 부호화할 예측 단위를 감산부(190)로 보낸다.The picture division unit 110 analyzes the input video signal, divides the picture into the coding units of a predetermined size for each largest coding unit, determines a prediction mode, and determines the size of the prediction unit for each coding unit. The picture division unit 110 sends the prediction unit to be encoded to the intra prediction unit 150 or the inter prediction unit 160 according to the prediction mode. Further, the picture division unit 110 sends the prediction unit to be encoded to the subtraction unit 190.

변환부(120)는 입력된 예측 단위의 원본 블록과 인트라 예측부(150) 또는 인터 예측부(160)에서 생성된 예측 블록의 잔차신호인 잔차 블록을 변환한다. 상기 잔차 블록은 부호화 단위로 구성된다. 부호화 단위로 구성된 잔차 블록은 최적의 변환 단위로 분할되어 변환된다. 예측 모드(intra or inter)에 따라 서로 다른 변환 매트릭스가 결정될 수 있다. 또한, 인트라 예측의 잔차 신호는 인트라 예측 모드에 따라 방향성을 가지므로 인트라 예측 모드에 따라 적응적으로 변환 매트릭스가 결정될 수 있다. 변환 단위는 2개(수평, 수직)의 1차원 변환 매트릭스에 의해 변환될 수 있다. 예를 들어, 인터 예측의 경우에는 미리 결정된 1개의 변환 매트릭스가 결정된다. 반면에, 인트라 예측의 경우, 인트라 예측 모드가 수평인 경우에는 잔차 블록이 수직방향으로의 방향성을 가질 확률이 높아지므로, 수직방향으로는 DCT 기반의 정수 매트릭스를 적용하고, 수평방향으로는 DST 기반 또는 KLT 기반의 정수 매트릭스를 적용한다. 인트라 예측 모드가 수직인 경우에는 수직방향으로는 DST 기반 또는 KLT 기반의 정수 매트릭스를, 수평 방향으로는 DCT 기반의 정수 매트릭스를 적용한다. DC 모드의 경우에는 양방향 모두 DCT 기반 정수 매트릭스를 적용한다. 또한, 인트라 예측의 경우, 변환 단위의 크기에 의존하여 변환 매트릭스가 적응적으로 결정될 수도 있다.The transform unit 120 transforms the residual block, which is a residual signal of the prediction block generated by the intra prediction unit 150 or the inter prediction unit 160, with the original block of the inputted prediction unit. The residual block is configured as a coding unit. The residual block composed of coding units is divided into optimal conversion units and converted. Different transformation matrices may be determined depending on the prediction mode (intra or inter). Also, since the residual signal of the intra prediction has directionality according to the intra prediction mode, the transformation matrix can be adaptively determined according to the intra prediction mode. The transformation unit can be transformed by two (horizontal, vertical) one-dimensional transformation matrices. For example, in the case of inter prediction, a predetermined conversion matrix is determined. On the other hand, in case of the intra prediction, when the intra prediction mode is horizontal, the probability that the residual block has the direction in the vertical direction becomes high. Therefore, the DCT-based integer matrix is applied in the vertical direction, Or a KLT-based integer matrix. When the intra prediction mode is vertical, a DST-based or KLT-based integer matrix is applied in the vertical direction and a DCT-based integer matrix is applied in the horizontal direction. In case of DC mode, DCT-based integer matrix is applied in both directions. Further, in the case of intra prediction, the transformation matrix may be adaptively determined depending on the size of the conversion unit.

양자화부(130)는 상기 변환 매트릭스에 의해 변환된 잔차 블록의 계수들을 양자화하기 위한 양자화 스텝 사이즈를 부호화 단위별로 결정한다. 그리고, 결정된 양자화 스텝 사이즈 및 예측 모드에 따라 결정되는 양자화 매트릭스를 이용하여 상기 변환 블록의 계수들을 양자화한다. 양자화부(130)는 현재 부호화 단위의 양자화 스텝 사이즈 예측자로서 현재 부호화 단위에 인접한 부호화 단위의 양자화 스텝 사이즈를 이용한다. 양자화부(130)는 현재 부호화 단위의 좌측 부호화 단위, 상측 부호화 단위, 좌상측 부호화 단위 순서로 검색하여 유효한 부호화 단위의 양자화 스텝 사이즈를 현재 부호화 단위의 양자화 스텝 사이즈 예측자로 결정하고, 차분값을 엔트로피 부호화부(140)로 전송한다.The quantization unit 130 determines a quantization step size for each encoding unit for quantizing the coefficients of the residual block transformed by the transform matrix. And quantizes the coefficients of the transform block using a quantization matrix determined according to the determined quantization step size and the prediction mode. The quantization unit 130 uses the quantization step size of the encoding unit adjacent to the current encoding unit as the quantization step size predictor of the current encoding unit. The quantization unit 130 searches for the quantization step size of the effective encoding unit as the quantization step size predictor of the current encoding unit by searching in the order of the left encoding unit, the upper encoding unit, and the upper left encoding unit of the current encoding unit, To the encoding unit (140).

한편, 슬라이스가 부호화 단위로 분리될 경우에는 현재 부호화 단위의 좌측 부호화 단위, 상측 부호화 단위, 좌상측 부호화 단위 모두가 존재하지 않을 가능성이 있다. 반면에 최대 부호화 단위 내의 부호화 순서 상으로 이전에 존재하는 부호화 단위가 존재할 수 있다. 따라서, 현재 부호화 단위에 인접한 부호화 단위들과 상기 최대 부호화 단위 내에서는 부호화 순서상 바로 이전의 부호화 단위가 후보자가 될 수 있다. 이 경우, 1) 현재 부호화 단위의 좌측 부호화 단위, 2) 현재 부호화 단위의 상측 부호화 단위, 3) 현재 부호화 단위의 좌상측 부호화 단위, 4) 부호화 순서상 바로 이전의 부호화 단위 순서로 우선순위를 둘 수 있다. 상기 순서는 바뀔 수 있고, 상기 좌상측 부호화 단위는 생략될 수도 있다.On the other hand, when the slice is divided into coding units, there is a possibility that the left coding unit, the upper coding unit, and the upper left coding unit of the current coding unit are not present. On the other hand, there may be a coding unit that exists before in the coding order in the maximum coding unit. Therefore, the coding units adjacent to the current coding unit and the coding unit immediately before the coding order in the maximum coding unit can be candidates. In this case, 1) the left encoding unit of the current encoding unit, 2) the upper encoding unit of the current encoding unit, 3) the upper left encoding unit of the current encoding unit, and 4) . The order may be changed, and the upper left side encoding unit may be omitted.

상기 양자화된 변환 블록은 역양자화부(135)와 스캐닝부(131)로 제공된다. The quantized transform block is provided to the inverse quantization unit 135 and the scanning unit 131.

스캐닝부(131)는 양자화된 변환 블록의 계수들을 스캐닝하여 1차원의 양자화 계수들로 변환한다. 양자화 후의 변환 블록의 계수 분포가 인트라 예측 모드에 의존적일 수 있으므로, 스캐닝 방식은 인트라 예측 모드에 따라 결정된다. 또한, 계수 스캐닝 방식은 변환 단위의 크기에 따라 달리 결정될 수도 있다. The scanning unit 131 scans the coefficients of the quantized transform block and converts them into one-dimensional quantization coefficients. Since the coefficient distribution of the transform block after quantization may be dependent on the intra prediction mode, the scanning scheme is determined according to the intra prediction mode. The coefficient scanning method may be determined depending on the size of the conversion unit.

역양자화(135)는 상기 양자화된 양자화 계수를 역양자화한다. 역변환부(125)는 역양자화된 변환 계수를 공간 영역의 잔차 블록으로 복원한다. 가산기는 상기 역변환부에 의해 복원된 잔차블록과 인트라 예측부(150) 또는 인터 예측부(160)로부터의 예측 블록을 합쳐서 복원 블록을 생성한다. The inverse quantization unit 135 dequantizes the quantized quantized coefficients. The inverse transform unit 125 restores the inversely quantized transform coefficients into residual blocks in the spatial domain. The adder combines the residual block reconstructed by the inverse transforming unit and the prediction block from the intra prediction unit 150 or the inter prediction unit 160 to generate a reconstruction block.

후처리부(160)는 복원된 픽쳐에 발생하는 블록킹 효과의 제거하기 위한 디블록킹 필터링 과정, 화소 단위로 원본 영상과의 차이값을 보완하기 위한 적응적 오프셋 적용 과정 및 부호화 단위로 원본 영상과의 차이값을 보완하기 위한 적응적 루프 필터 과정을 수행한다. The post-processing unit 160 performs a deblocking filtering process for eliminating the blocking effect generated in the reconstructed picture, an adaptive offset application process for compensating the difference value with respect to the original image on a pixel-by-pixel basis, And performs an adaptive loop filter process to compensate the value.

디블록킹 필터링 과정은 미리 정해진 크기 이상의 크기를 갖는 예측 단위 및 변환 단위의 경계에 적용하는 것이 바람직하다. 상기 크기는 8x8일 수 있다. 상기 디블록킹 필터링 과정은 필터링할 경계(boundary)를 결정하는 단계, 상기 경계에 적용할 경계 필터링 강도(bounary filtering strength)를 결정하는 단계, 디블록킹 필터의 적용 여부를 결정하는 단계, 상기 디블록킹 필터를 적용할 것으로 결정된 경우, 상기 경계에 적용할 필터를 선택하는 단계를 포함한다. The deblocking filtering process is preferably applied to a boundary of a prediction unit and a conversion unit having a size larger than a predetermined size. The size may be 8x8. The deblocking filtering process may include determining a boundary to be filtered, determining a bounary filtering strength to be applied to the boundary, determining whether to apply a deblocking filter, And selecting a filter to be applied to the boundary if it is determined to apply the boundary.

상기 디블록킹 필터의 적용 여부는 i) 상기 경계 필터링 강도가 0보다 큰지 여부 및 ii) 상기 필터링할 경계에 인접한 2개의 블록(P 블록, Q블록) 경계 부분에서의 화소값들이 변화 정도를 나타내는 값이 양자화 파라미터에 의해 결정되는 제1 기준값보다 작은지 여부에 의해 결정된다. Whether or not the deblocking filter is applied is determined based on i) whether the boundary filtering strength is greater than 0 and ii) whether a pixel value at a boundary between two blocks adjacent to the boundary to be filtered (P block, Q block) Is smaller than a first reference value determined by the quantization parameter.

상기 필터는 적어도 2개 이상인 것이 바람직하다. 블록 경계에 위치한 2개의 화소들간의 차이값의 절대값이 제2 기준값보다 크거나 같은 경우에는 상대적으로 약한 필터링을 수행하는 필터를 선택한다. 상기 제2 기준값은 상기 양자화 파라미터 및 상기 경계 필터링 강도에 의해 결정된다.The filter is preferably at least two or more. If the absolute value of the difference between two pixels located at the block boundary is greater than or equal to the second reference value, a filter that performs relatively weak filtering is selected. And the second reference value is determined by the quantization parameter and the boundary filtering strength.

적응적 루프 필터 과정은 디블록킹 필터링 과정 또는 적응적 오프셋 적용 과정을 거친 복원된 영상과 원본 영상을 비교한 값을 기초로 필터링을 수행할 수 있다. 적응적 루프 필터는 4x4 크기의 블록을 기반으로 하나의 라플라시안 활동값(Laplacian Activity value)을 통해 검출된다. 상기 결정된 ALF는 4x4 크기 또는 8x8 크기의 블록에 포함된 화소 전체에 적용될 수 있다. 적응적 루프 필터의 적용 여부는 부호화 단위별로 결정될 수 있다. 각 부호화 단위에 따라 적용될 루프 필터의 크기 및 계수는 달라질 수 있다. 부호화 단위별로 상기 적응적 루프 필터의 적용 여부를 나타내는 정보, 필터 계수 정보, 필터 형태 정보 등은 각 슬라이스 헤더에 포함되어 복호기로 전송될 수 있다. 색차 신호의 경우에는, 픽쳐 단위로 적응적 루프 필터의 적용 여부를 결정할 수 있다. 루프 필터의 형태도 휘도와 달리 직사각형 형태를 가질 수 있다. The adaptive loop filter process can perform filtering based on a value obtained by comparing a reconstructed image and an original image through a deblocking filtering process or an adaptive offset applying process. The adaptive loop filter is detected through a single Laplacian Activity value based on a 4x4 block. The determined ALF may be applied to all the pixels included in the 4x4 block or the 8x8 block. Whether or not the adaptive loop filter is applied can be determined for each encoding unit. The size and the coefficient of the loop filter to be applied according to each coding unit may be changed. Information indicating whether or not the adaptive loop filter is applied, filter coefficient information, filter type information, and the like can be included in each slice header and transmitted to the decoder in units of coding units. In the case of the color difference signal, it is possible to determine whether or not the adaptive loop filter is applied in units of pictures. The shape of the loop filter may have a rectangular shape unlike the luminance.

픽쳐 저장부(180)는 후처리된 영상 데이터를 후처리부(160)로부터 입력 받아 픽쳐(picture) 단위로 영상을 복원하여 저장한다. 픽쳐는 프레임 단위의 영상이거나 필드 단위의 영상일 수 있다. 픽쳐 저장부(180)는 다수의 픽쳐를 저장할 수 있는 버퍼(도시되지 않음)를 구비한다. The picture storage unit 180 receives the post-processed image data from the post-processing unit 160, and restores and restores the pictures on a picture-by-picture basis. The picture may be a frame-based image or a field-based image. The picture storage unit 180 has a buffer (not shown) capable of storing a plurality of pictures.

인터 예측부(150)는 상기 픽쳐 저장부(180)에 저장된 적어도 하나 이상의 참조 픽쳐를 이용하여 움직임 추정을 수행하고, 참조 픽쳐를 나타내는 참조 픽쳐 인덱스 및 움직임 벡터를 결정한다. 그리고, 결정된 참조 픽쳐 인덱스 및 움직임 벡터에 따라, 픽쳐 저장부(150)에 저장된 다수의 참조 픽쳐들 중 움직임 추정에 이용된 참조 픽쳐로부터, 부호화하고자 하는 예측 단위에 대응하는 예측 블록을 추출하여 출력한다.The inter-prediction unit 150 performs motion estimation using at least one reference picture stored in the picture storage unit 180, and determines a reference picture index and a motion vector indicating a reference picture. Then, based on the determined reference picture index and motion vector, a prediction block corresponding to a prediction unit to be coded is extracted from a plurality of reference pictures stored in the picture storage unit 150 and used for motion estimation .

인트라 예측부(140)는 현재 예측 단위가 포함되는 픽처 내부의 재구성된 화소값을 이용하여 인트라 예측 부호화를 수행한다. 인트라 예측부(140)는 예측 부호화할 현재 예측 단위를 입력 받아 현재 블록의 크기에 따라 미리 설정된 개수의 인트라 예측 모드 중에 하나를 선택하여 인트라 예측을 수행한다. 인트라 예측부는 인트라 예측 블록을 생성하기 위해 참조 화소를 적응적으로 필터링한다. 참조 화소가 이용 가능하지 않은 경우에는 이용 가능한 참조 화소들을 이용하여 참조 화소들을 생성할 수 있다. The intraprediction unit 140 performs intraprediction encoding using the reconstructed pixel values in the picture including the current prediction unit. The intra prediction unit 140 receives the current prediction unit to be predictively encoded and selects one of a predetermined number of intra prediction modes according to the size of the current block to perform intra prediction. The intra prediction unit adaptively filters the reference pixels to generate an intra prediction block. If reference pixels are not available, reference pixels may be generated using available reference pixels.

엔트로피 부호화부(130)는 양자화부(130)에 의해 양자화된 양자화 계수, 인트라 예측부(140)로부터 수신된 인트라 예측 정보, 인터 예측부(150)로부터 수신된 움직임 정보 등를 엔트로피 부호화한다. The entropy encoding unit 130 entropy-codes quantization coefficients quantized by the quantization unit 130, intra prediction information received from the intra prediction unit 140, motion information received from the inter prediction unit 150, and the like.

도 2는 도 1의 스캐닝부(131)의 스캐닝 동작 과정에 나타내는 흐름도이다. Fig. 2 is a flowchart showing a scanning operation process of the scanning unit 131 of Fig.

먼저, 현재 양자화된 계수 블록들을 복수개의 서브셋으로 분할할지 여부를 판단한다(S110). 상기 분할여부의 결정은 현재 변환 단위의 크기에 의존한다. 즉, 변환 단위의 크기가 제1 기준 크기보다 큰 경우 상기 부호화된 양자화 계수들을 복수개의 서브셋으로 분할한다. 상기 제1 기준 크기는 4x4 또는 8x8인 것이 바람직하다. 상기 소정 크기 정보는 픽쳐 헤더 또는 슬라이스 헤더를 통해 복호기로 전송할 수도 있다. First, it is determined whether to divide the quantized coefficient blocks into a plurality of subsets (S110). The determination of whether or not to divide is dependent on the size of the current conversion unit. That is, when the size of the conversion unit is larger than the first reference size, the encoded quantized coefficients are divided into a plurality of subsets. The first reference size is preferably 4x4 or 8x8. The predetermined size information may be transmitted to a decoder through a picture header or a slice header.

상기 양자화된 계수 블록들이 복수개의 서브셋으로 분할되지 않는 것으로 판단되면, 상기 양자화된 계수 블록에 적용될 스캔 패턴을 결정한다(S120). 그리고, 결정된 스캔 패턴에 따라 상기 양자화된 계수 블록의 계수들을 스캔한다(S130). 상기 스캔패턴은 예측 모드 및 인트라 예측 모드에 따라 적응적으로 결정될 수 있다. If it is determined that the quantized coefficient blocks are not divided into a plurality of subsets, a scan pattern to be applied to the quantized coefficient block is determined (S120). Then, the coefficients of the quantized coefficient block are scanned according to the determined scan pattern (S130). The scan pattern may be adaptively determined according to a prediction mode and an intra prediction mode.

인터 예측 모드의 경우에는 미리 정해진 하나의 스캔 패턴(예를 들어, 지그재그 스캔)만을 적용할 수 있다. 또한, 미리 정해진 복수개의 스캔 패턴들 중 어느 하나를 선택하여 스캔하고 스캔 패턴 정보를 복호기로 전송할 수 있다. In the case of the inter prediction mode, only a predetermined scan pattern (for example, a zigzag scan) can be applied. Also, one of a plurality of predetermined scan patterns may be selected and scanned, and the scan pattern information may be transmitted to the decoder.

인트라 예측의 경우에는 인트라 예측 모드에 따라 미리 정해진 스캔패턴을 적용할 수 있다. 예를 들어, 수직 인트라 예측 모드 및 인접한 예측 방향의 소정개수의 인트라 예측 모드들에 대해서는 수평우선스캔을 적용한다. 수평 인트라 예측 모드 및 인접한 예측 방향을 갖는 소정개수의 인트라 예측 모드들에 대해서는 수직스캔을 적용한다. 상기 소정개수는 예측 단위별로 허용되는 인트라 예측 모드 수(또는 방향성 인트라 예측 모드 수) 또는 예측 단위의 크기에 따라 달라진다. 예를 들어, 현재 예측 단위에 허용되는 방향성 인트라 예측 모드의 수가 16인 경우에는 수평 또는 수직 인트라 예측 모드를 기준으로 양쪽으로 각각 2개인 것이 바람직하다. 현재 예측 단위에 허용되는 방향성 인트라 예측 모드의 수가 33인 경우에는 수평 또는 수직 인트라 예측 모드를 기준으로 양쪽으로 각각 4개인 것이 바람직하다. In case of intra prediction, a predetermined scan pattern can be applied according to the intra prediction mode. For example, a horizontal priority scan is applied to a predetermined number of intra prediction modes in the vertical intra prediction mode and adjacent prediction directions. A vertical scan is applied to a predetermined number of intra prediction modes having a horizontal intra prediction mode and an adjacent prediction direction. The predetermined number varies depending on the number of intra prediction modes (or the number of directional intra prediction modes) allowed per prediction unit or the size of the prediction unit. For example, when the number of directional intra-prediction modes allowed for the current prediction unit is 16, it is preferable that the number of directional intra-prediction modes is two for both of the horizontal and vertical intra-prediction modes. When the number of directional intra-prediction modes allowed for the current prediction unit is 33, it is preferable that the number of directional intra-prediction modes is 4 for both of the horizontal and vertical intra-prediction modes.

한편, 비방향성 모드들에 대해서는 지그재그 스캔을 적용한다. 비방향성 모드는 DC 모드 또는 planar 모드일 수 있다. On the other hand, zigzag scan is applied to the non-directional modes. The non-directional mode may be a DC mode or a planar mode.

현재 양자화된 계수 블록들이 복수개의 서브셋으로 분할되는 것으로 판단되면, 상기 변환 양자화된 계수 블록들을 복수개의 서브셋으로 분할한다(S140). 상기 복수개의 서브셋은 하나의 메인 서브셋과 적어도 하나 이상의 잔여 서브셋으로 구성된다. 메인 서브셋은 DC 계수를 포함하는 좌상측에 위치하고, 상기 잔여 서브셋은 메인 서브셋 이외의 영역을 커버한다.If it is determined that the quantized coefficient blocks are divided into a plurality of subsets, the transform quantized coefficient blocks are divided into a plurality of subsets (S140). The plurality of subsets comprises one main subset and at least one or more remaining subsets. The main subset is located on the upper left side including the DC coefficient, and the remaining subset covers an area other than the main subset.

다음으로, 서브셋에 적용될 스캔 패턴을 결정한다(S150). 상기 스캔패턴은 모든 서브셋에 적용된다. 상기 스캔패턴은 예측 모드 및 인트라 예측 모드에 따라 적응적으로 결정될 수 있다. 현재 변환 양자화된 계수 블록의 크기(변환 블록의 크기)가 제2 기준 크기(예를 들어, 8x8)보다 큰 경우에는 지그재그 스캔만을 적용할 수 있다. 따라서, 제1 기준크기가 제2 기준크기보다 작은 경우에만 상기 단계가 수행된다. Next, a scan pattern to be applied to the subset is determined (S150). The scan pattern is applied to all subsets. The scan pattern may be adaptively determined according to a prediction mode and an intra prediction mode. In the case where the size of the current transform quantized coefficient block (the size of the transform block) is larger than the second reference size (for example, 8x8), only the zigzag scan can be applied. Therefore, the above step is performed only when the first reference size is smaller than the second reference size.

인터 예측 모드의 경우, 상기 서브셋 내의 스캔 패턴은 미리 정해진 하나의 스캔 패턴(예를 들어, 지그재그 스캔)일 수 있다. 인트라 예측의 경우에는 S120에서와 동일하다. In the inter prediction mode, the scan pattern in the subset may be a predetermined scan pattern (e.g., a zigzag scan). In the case of intra prediction, it is the same as in S120.

상기 서브셋 내의 양자화 계수들의 스캔순서는 역방향으로 스캔한다. 즉, 스캔 패턴에 따라 상기 서브셋 내의 0이 아닌 마지막 양자화 계수로부터 역방향으로 0이 아닌 양자화 계수들을 스캔하여 엔트로피 부호화할 수 있다. The scan order of the quantization coefficients in the subset scans in the reverse direction. That is, quantization coefficients that are not 0 in the backward direction from the last non-zero quantization coefficient in the subset can be scanned and entropy-encoded according to the scan pattern.

다음으로, 각 서브셋 별로 스캔 패턴에 따라 양자화 계수들을 스캔한다(S160). 상기 서브셋 내의 양자화 계수들의 스캔순서는 역방향으로 스캔한다. 즉, 스캔 패턴에 따라 상기 서브셋 내의 0이 아닌 마지막 양자화 계수로부터 역방향으로 0이 아닌 양자화 계수들을 스캔하여 엔트로피 부호화할 수 있다. Next, the quantization coefficients are scanned according to the scan pattern for each subset (S160). The scan order of the quantization coefficients in the subset scans in the reverse direction. That is, quantization coefficients that are not 0 in the backward direction from the last non-zero quantization coefficient in the subset can be scanned and entropy-encoded according to the scan pattern.

또한, 서브셋 간의 스캔패턴은 지그재그 스캔을 적용한다. 스캔 패턴은 메인 서브셋으로부터 순방향으로 잔여 서브셋들로 스캔하는 것이 바람직하나, 그 역방향도 가능하다. 또한, 서브셋 간의 스캔패턴을 서브셋 내에 적용된 스캔 패턴과 동일하게 적용할 수도 있다.In addition, a scan pattern between subsets applies a zigzag scan. The scan pattern is preferably scanned to the remaining subsets in the forward direction from the main subset, but vice versa. In addition, a scan pattern between subsets may be applied in the same manner as a scan pattern applied in a subset.

한편, 부호기는 상기 변환 단위내의 0이 아닌 마지막 양자화 계수의 위치를 나타낼 수 있는 정보를 복호기로 전송한다. 각 서브셋 내의 0이 아닌 마지막 양자화 계수의 위치를 나타낼 수 있는 정보도 복호기로 전송한다. 상기 정보는 각각의 서브셋 내의 0이 아닌 마지막 양자화 계수의 위치를 나타내는 정보일 수 있다. On the other hand, the encoder transmits to the decoder information indicating the position of the last non-zero quantization coefficient in the conversion unit. Information indicating the position of the last non-zero quantization coefficient in each subset is also transmitted to the decoder. The information may be information indicating the position of the last non-zero quantization coefficient in each subset.

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

도 3를 참조하면, 본 발명에 따른 동영상 복호화 장치는, 엔트로피 복호부(210), 역스캐닝부(220), 역양자화부(230), 역변환부(240), 인트라 예측부(250), 인터 예측부(260), 후처리부(270), 픽쳐 저장부(280), 가산부(290), 및 인트라/인터전환 스위치(295)를 구비한다.3, the moving picture decoding apparatus according to the present invention includes an entropy decoding unit 210, an inverse scanning unit 220, an inverse quantization unit 230, an inverse transform unit 240, an intra prediction unit 250, A post-processing unit 270, a picture storage unit 280, an adding unit 290, and an intra / inter changeover switch 295, as shown in FIG.

엔트로피 복호부(210)는, 수신된 부호화 비트 스트림을 복호하여, 인트라 예측 정보, 인터 예측 정보, 양자화 계수 정보 등으로 분리한다. 엔트로피 복호부(210)는 복호된 인터 예측 정보를 인터 예측부(260)에 공급한다. 엔트로피 복호부(210)는 상기 인트라 예측 정보를 인트라 예측부(250) 및 역변환부(240)로 공급한다. 또한, 상기 엔트로피 복호화(210)는 상기 역양자화 계수 정보를 역스캔부(220)로 공급한다.The entropy decoding unit 210 decodes the received encoded bit stream into intraprediction information, inter prediction information, quantization coefficient information, and the like. The entropy decoding unit 210 supplies the decoded inter prediction information to the inter prediction unit 260. [ The entropy decoding unit 210 supplies the intra prediction information to the intra prediction unit 250 and the inverse transformation unit 240. In addition, the entropy decoding unit 210 supplies the inverse quantization coefficient information to the inverse scanning unit 220.

역스캐닝부(220)는 상기 양자화 계수 정보를 2차원 배열의 역양자화 블록으로 변환한다. 상기 변환을 위해 복수개의 역스캐닝 패턴 중에 하나를 선택한다. 계수 역스캐닝 패턴은 예측모드와 인트라 예측 모드 중 적어도 하나에 기초하여 결정된다. 역스캐닝부(220)의 동작은 상기에서 설명한 스캐닝부(131)의 동작의 역과정과 동일하다. The inverse scanning unit 220 converts the quantized coefficient information into a two-dimensional inverse quantized block. One of a plurality of reverse scanning patterns is selected for the conversion. The coefficient inverse scanning pattern is determined based on at least one of a prediction mode and an intra prediction mode. The operation of the inverse scanning unit 220 is the same as the inverse process of the operation of the scanning unit 131 described above.

역양자화부(230)는 현재 부호화 단위의 양자화 스텝 사이즈 예측자를 결정한다. 상기 예측자의 결정과정은 도 1의 양자화부(130)의 예측자 결정 과정과 동일하므로 생략한다. 역양자화부(230)는 결정된 양자화 스텝 사이즈 예측자와 수신한 잔차 양자화 스텝 사이즈를 더하여 현재 역양자화 블록에 적용된 양자화 스텝 사이즈를 얻는다. 역양자화부(230)는 양자화 스텝 사이즈가 적용된 양자화 매트릭스를 이용하여 역양자화 계수를 복원한다. 복원하고자 하는 현재 블록의 크기에 따라 서로 다른 양자화 매트릭스가 적용되며, 동일 크기의 블록에 대해서도 상기 현재 블록의 예측 모드 및 인트라 예측 모드 중 적어도 하나에 기초하여 양자화 매트릭스가 선택된다. The inverse quantization unit 230 determines the quantization step size predictor of the current encoding unit. The predictor decision process is the same as the predictor decision process of the quantization unit 130 of FIG. The inverse quantization unit 230 adds the determined quantization step size predictor and the received residual quantization step size to obtain the quantization step size applied to the current inverse quantization block. The inverse quantization unit 230 restores the inverse quantization coefficient using the quantization matrix to which the quantization step size is applied. Different quantization matrices are applied according to the size of the current block to be restored and a quantization matrix is selected based on at least one of a prediction mode and an intra prediction mode of the current block with respect to blocks of the same size.

역변환부(240)는 역양자화 블록을 역변환하여 잔차 블록을 복원한다. 그리고, 상기 복원된 양자화 계수를 역변환하여 잔차 블록을 복원한다. 상기 역양자화 블록에 적용할 역변환 매트릭스는 예측 모드(인트라 또는 인터) 및 인트라 예측 모드에 따라 적응적으로 결정될 수 있다. 도 1의 변환부(120)에 적용된 변환 매트릭스의 역변환 매트릭스가 결정되므로 구체적인 기재는 생략한다.The inverse transform unit 240 inversely transforms the inverse quantized block to reconstruct the residual block. Then, the reconstructed quantized coefficient is inversely transformed to reconstruct the residual block. The inverse transform matrix to be applied to the inverse quantization block may be adaptively determined according to a prediction mode (intra or inter) and an intra prediction mode. Since the inverse transformation matrix of the transformation matrix applied to the transformation unit 120 of FIG. 1 is determined, detailed description is omitted.

가산부(290)는 역변환부(240)에 의해 복원된 잔차 블록과 인트라 예측부(250) 또는 인터 예측부(260)에 의해 생성되는 예측 블록을 가산함으로써, 영상 블록을 복원한다. The addition unit 290 reconstructs the image block by adding the residual block reconstructed by the inverse transform unit 240 to the intra prediction unit 250 or the prediction block generated by the inter prediction unit 260. [

인트라 예측부(250)는 엔트로피 복호화부(210)로부터 수신된 인트라 예측 정보에 기초하여 현재 블록의 인트라 예측 모드를 복원한다. 그리고, 복원된 인트라 예측 모드에 따라 예측 블록을 생성한다.The intraprediction unit 250 restores the intra prediction mode of the current block based on the intra prediction information received from the entropy decoding unit 210. A prediction block is generated according to the restored intra prediction mode.

인터 예측부(260)는 엔트로피 복호화부(210)로부터 수신된 인터 예측 정보에 기초하여 참조 픽쳐 인덱스와 움직임 벡터를 복원한다. 그리고, 상기 참조 픽쳐 인덱스와 움직임 벡터를 이용하여 현재 블록에 대한 예측 블록을 생성한다. 소수 정밀도의 움직임 보상이 적용될 경우에는 선택된 보간 필터를 적용하여 예측 블록을 생성한다. The inter-prediction unit 260 reconstructs the reference picture index and the motion vector based on the inter-prediction information received from the entropy decoding unit 210. A prediction block for the current block is generated using the reference picture index and the motion vector. When motion compensation with a decimal precision is applied, a prediction block is generated by applying a selected interpolation filter.

후처리부(270)의 동작은 도 1의 후처리부(160)의 동작과 동일하므로 생략한다.The operation of the post-processing unit 270 is the same as that of the post-processing unit 160 of FIG.

픽쳐 저장부(280)는 후처리부(270)에 의해 후처리된 복호 영상을 픽쳐 단위로 저장한다.
The picture storage unit 280 stores the decoded picture, which is post-processed by the post-processing unit 270, on a picture-by-picture basis.

도 4는 본 발명에 따른 부호화 장치(100)의 인트라 예측부(150)를 나타내는 블록도이다.4 is a block diagram showing an intra predictor 150 of the encoding apparatus 100 according to the present invention.

도 4를 참조하면, 인트라 예측부(150)는 참조화소 생성부(151), 참조화소 필터링부(152), 예측모드 결정부(153), 예측블록 생성부(154), 예측블록 필터링부(155) 및 예측모드 부호화부(156)를 포함한다.4, the intraprediction unit 150 includes a reference pixel generation unit 151, a reference pixel filtering unit 152, a prediction mode determination unit 153, a prediction block generation unit 154, a prediction block filtering unit 155, and a prediction mode encoding unit 156.

참조화소 생성부(151)는 인트라 예측을 위한 참조 화소들의 생성 여부를 판단하고, 생성될 필요성이 있을 경우 참조 화소를 생성한다. The reference pixel generation unit 151 determines whether to generate reference pixels for intraprediction, and generates reference pixels when it is necessary to generate them.

도 5는 현재 예측 단위의 인트라 예측에 사용되는 참조 화소들의 위치를 나타낸 도면이다. 도 5에 도시된 바와 같이, 현재 예측 단위의 상측 참조 화소는 현재 예측 단위의 가로 길이의 2배에 걸쳐 존재하는 화소들(영역 C, D)이고, 좌측 참조 화소들은 현재 예측 단위의 세로길이의 2배에 걸쳐 존재하는 화소들(영역 A, B)이다. 5 is a diagram showing the positions of reference pixels used in intra prediction of a current prediction unit. As shown in FIG. 5, the upper reference pixel of the current prediction unit is pixels (regions C and D) existing twice the width of the current prediction unit, and the left reference pixels are the (Regions A and B) that exist twice as much as the other pixels.

참조 화소 생성부(151)는 상기한 모든 위치의 참조화소들이 이용 가능(available)한지를 판단한다. 참조 화소의 일부가 이용 가능하지 않을 경우에는 이용 가능한 참조 화소들을 이용하여 이용 가능하지 않은 위치의 참조 화소들을 생성한다.The reference pixel generation unit 151 determines whether reference pixels at all the positions are available. When a part of the reference pixels is not available, reference pixels of unusable positions are generated using available reference pixels.

먼저, 부호화할 현재 예측 단위의 상측 또는 좌측 영역 중 어느 한 영역의 참조화소들이 모두 이용 가능하지 않은 경우에 대해 설명한다. First, a description will be given of a case where reference pixels in any one of the upper and left regions of the current prediction unit to be encoded are not available.

예를 들어, 현재 예측 단위가 픽쳐 또는 슬라이스의 상측 경계에 위치하는 경우에는 현재 예측 단위의 상측의 참조화소들(영역 C, D)이 존재하지 않는다. 마찬가지로, 현재 예측 단위가 픽쳐 또는 슬라이스의 좌측 경계에 위치하는 경우에는 좌측의 참조 화소들(영역 A, B)이 존재하지 않는다. 이와 같이 어느 한쪽의 참조화소들이 이용 가능하지 않을 경우, 가장 인접한 이용 가능한 참조 화소를 복사하여 참조 화소를 생성할 수 있다. 전자의 경우, 가장 인접한 이용 가능한 참조 화소는 좌측 가장 위쪽의 참조화소(즉, 영역 A의 가장 위쪽 참조화소)이다. 후자의 경우, 가장 인접한 이용 가능한 참조 화소는 상측 가장 왼쪽의 참조화소(즉, 영역 C의 가장 왼쪽의 참조화소)이다. 상기한 방식의 적용은 default 일 수 있으나, 필요한 경우, 시퀀스 단위, 화면단위 또는 슬라이스 단위마다 적응적으로 적용될 수도 있다. For example, when the current prediction unit is located at the upper boundary of the picture or slice, the upper reference pixels (regions C and D) of the current prediction unit do not exist. Similarly, when the current prediction unit is located at the left boundary of the picture or slice, the left reference pixels (areas A and B) do not exist. When one of the reference pixels is not available, the reference pixel can be generated by copying the nearest available reference pixel. In the former case, the closest usable reference pixel is the uppermost left reference pixel (i.e., the uppermost reference pixel in the area A). In the latter case, the closest usable reference pixel is the upper leftmost reference pixel (i.e., the leftmost reference pixel in the area C). The application of the above method may be default, but may be adaptively applied to the sequence unit, the picture unit, or the slice unit, if necessary.

다음으로, 부호화할 현재 예측 단위의 상측 또는 좌측의 참조 화소들 중 일부분이 이용 가능하지 않은 경우에 대해 설명한다. 이용 가능하지 않은 참조화소를 기준으로 1) 한쪽 방향으로만 이용 가능한 참조 화소들이 존재하는 경우와, 2) 양쪽 모두 이용 가능한 참조 화소들이 존재하는 경우의 2가지가 존재한다.Next, a case where a part of the upper or left reference pixels of the current prediction unit to be encoded is not available will be described. There are two cases: 1) there are reference pixels usable only in one direction, and 2) there are reference pixels available to both.

1)의 경우에 대해 설명한다.1) will be described.

예를 들어, 현재 예측 단위가 픽쳐 또는 슬라이스의 우측 경계, 또는 최대 부호화 단위의 우측 경계에 위치하는 경우에는 영역 D의 참조화소들이 이용 가능하지 않다. 마찬가지로 현재 예측 단위가 픽쳐 또는 슬라이스의 아래측 경계 또는 최대 부호화 단위의 아래측 경계에 위치하는 경우에는 영역 B의 참조화소들이 이용 가능하지 않다. For example, if the current prediction unit is located at the right boundary of the picture or slice, or at the right boundary of the maximum coding unit, the reference pixels of the region D are not available. Similarly, if the current prediction unit is located at the lower boundary of the picture or slice or the lower boundary of the largest coding unit, the reference pixels of the region B are not available.

이 경우에는 가장 가까운 위치에 존재하는 이용 가능한 참조 화소들을 복사하여 참조 화소들을 생성할 수 있다. 또 다른 방법으로 가장 가까운 위치에 존재하는 복수개의 이용 가능한 참조 화소들을 참조 화소들을 생성할 수도 있다.In this case, it is possible to generate reference pixels by copying available reference pixels existing at the closest position. Alternatively, a plurality of available reference pixels existing at the closest position may be used to generate reference pixels.

2)의 경우에 대해 설명한다.  2) will be described.

예를 들어, 현재 예측 단위가 슬라이스의 상측 경계에 위치하고, 상기 현재 예측 단위의 우상측 예측 단위가 이용 가능한 경우, 현재 예측 단위의 영역 C에 대응하는 참조 화소들은 이용 가능하지 않지만, 영역 A 및 영역 D에 위치하는 참조화소들은 이용 가능하다. 이와 같이 양쪽 모두 이용 가능한 참조화소가 존재하는 경우에는, 각 방향으로 가장 가까운 위치에 존재하는 이용 가능한 참조화소 1개씩을 선택하여, 이들(즉, 영역 A의 가장 위쪽 참조화소와 영역 D의 가장 왼쪽 참조화소)을 이용하여 이용 가능하지 않은 위치의 참조화소들을 생성한다. For example, if the current prediction unit is located at the upper boundary of the slice and the upper right prediction unit of the current prediction unit is available, the reference pixels corresponding to the region C of the current prediction unit are not available, Reference pixels located at D are available. In this way, when both available reference pixels are available, one usable reference pixel that is closest to each direction is selected, and these (that is, the uppermost reference pixel of the region A and the leftmost Reference pixels) are used to generate reference pixels at positions that are not available.

상기 2개 참조 화소(각 방향으로 가장 가까운 위치에 존재하는 화소)의 반올림한 평균값을 참조화소값으로 생성할 수도 있다. 그러나, 이용 가능하지 않은 참조화소 영역이 큰 경우에는 이용 가능한 화소와 생성된 화소 사이의 단차가 발생할 가능성이 크므로, 선형 보간 방법을 사용하여 참조 화소를 생성하는 것이 더욱 유용하다. 구체적으로 이용 가능한 2개의 참조 화소들과의 위치를 고려하여 현재 위치의 이용 가능하지 않은 참조 화소를 생성할 수 있다. A rounded average value of the two reference pixels (pixels located closest to each direction) may be generated as a reference pixel value. However, when the usable reference pixel region is large, it is more likely to generate the reference pixel by using the linear interpolation method because there is a high possibility that a step between the available pixel and the generated pixel occurs. A reference pixel which is not available at the current position can be generated in consideration of the position with respect to the two available reference pixels.

다음으로, 부호화할 현재 예측 단위의 상측 및 좌측의 참조 화소들 모두가 이용 가능하지 않는 경우에 대해 설명한다. 예를 들어, 현재 예측 단위가 픽쳐 또는 슬라이스 좌상측 경계에 인접하는 경우에는 이용 가능한 참조화소들이 존재하지 않는다. Next, a case in which both the upper and left reference pixels of the current prediction unit to be encoded are not available will be described. For example, if the current prediction unit is adjacent to the picture or slice upper left boundary, there are no reference pixels available.

이러한 경우에는 현재 예측 단위의 내부에 존재하는 2개 이상의 화소들을 이용하여 일부 또는 전부의 참조화소들을 생성할 수 있다. 상기 참조화소를 생성하기 위해 사용되는 현재 예측 단위의 내부에 존재하는 화소의 수는 2 또는 3일 수 있다.In this case, some or all reference pixels may be generated using two or more pixels existing within the current prediction unit. The number of pixels present in the current prediction unit used to generate the reference pixel may be 2 or 3.

도 6은 본 발명에 따른 참조화소를 생성하는 방식을 나타낸 도면이다.6 is a diagram illustrating a method of generating reference pixels according to the present invention.

도 6을 참조하여, 2개의 화소를 이용할 경우에 대해 먼저 설명한다. 현재 예측 단위의 좌상측 화소(○)과 다른 하나의 화소를 이용하는 경우이다. 다른 하나의 화소는 우상측 화소(□), 좌하측 화소(△), 우하측 화소(▽)일 수 있다. 현재 예측 단위의 좌상측 화소(○)과 우상측 화소(□)을 사용할 경우에는 상기 좌상측 화소와 우상측 화소는 대응하는 상측 위치로 복사하고, 상기 복사된 좌상측 화소와 우상측 화소를 이용하여 그 사이의 영역(영역 C)의 참조 화소들을 생성한다. 상기 생성되는 참조화소들은 상기 2개의 참조화소(복사된 좌상측 화소와 우상측 화소)들의 반올림한 평균값을 또는 선형 보간 방법에 생성된 값일 수 있다. 우상측 화소(□)을 복사하거나 복수개의 상측 생성 참조화소들을 이용하여 영역 D의 참조화소들을 생성한다. 현재 예측 단위의 좌상측 화소(○)과 좌하측 화소(△)을 사용할 경우에도 위와 동일한 방식을 적용한다. 현재 예측 단위의 좌상측 화소(○)과 우하측 화소(▽)을 사용할 경우에는 우하측 화소 화소(▽)을 수평방향 및 수직방향으로 동일한 위치의 참조 화소 위치로 복사한다. 그리고 그 이후의 참조화소 생성방식은 위와 동일한 방식을 적용한다.Referring to Fig. 6, the case of using two pixels will be described first. And a pixel different from the upper left pixel (O) of the current prediction unit is used. The other pixel may be an upper right pixel (?), A lower left pixel (?), And a lower right pixel (?). When the upper left pixel () and the upper right pixel () are used, the upper left pixel and the upper right pixel are copied to the corresponding upper positions, and the copied upper left pixel and upper right pixel To generate reference pixels in the area (area C) therebetween. The generated reference pixels may be a rounded mean value of the two reference pixels (copied upper left pixel and upper right pixel) or a value generated in the linear interpolation method. The upper right pixel (□) is copied or reference pixels of the area D are generated by using a plurality of upper generation reference pixels. The same method as above is also applied when the left upper pixel (O) and the lower left pixel (?) Of the current prediction unit are used. When the upper left side pixel (O) and the lower right side pixel (V) of the current prediction unit are used, the lower right side pixel pixel (V) is copied to the reference pixel position at the same position in the horizontal direction and the vertical direction. The reference pixel generation method thereafter applies the same method as above.

3개의 화소를 이용할 경우에 대해 먼저 설명한다. 현재 예측 단위의 좌상측 화소(○), 우상측 화소(□), 좌하측 화소(△)을 이용할 수 있다. 이 경우, 각각의 화소를 대응하는 참조화소 위치로 복사한 후, 상기 화소들을 이용하여 나머지 참조화소들을 생성한다. 상기 나머지 참조화소들의 생성방식은 위의 2개의 화소를 이용하는 경우와 동일하다. The case of using three pixels will be described first. The left upper pixel (O), the upper right pixel (), and the lower left pixel (DELTA) of the current prediction unit can be used. In this case, after each pixel is copied to the corresponding reference pixel position, the remaining reference pixels are generated using the pixels. The method of generating the remaining reference pixels is the same as the case of using the above two pixels.

한편, 상기와 같은 방식을 이용할 경우, 참조 화소 생성에 이용된 현재 예측 단위의 내부의 화소들은 복호기로 전송되어야 한다. 이 경우, 정보 전송량을 줄이기 위해 좌상측 화소(○) 이외의 값은 좌상측 화소(○)과의 차이값을 전송한다. 또한, 상기 참조화소 생성에 이용된 좌상측 화소값은 양자화된 값일 수 있고, 엔트로피 부호화되어 전송될 수도 있다.On the other hand, when the above method is used, the pixels inside the current prediction unit used for generating the reference pixels must be transmitted to the decoder. In this case, in order to reduce the information transfer amount, values other than the upper left pixel (O) are transmitted with the difference value from the upper left pixel (O). Also, the upper left pixel value used for generating the reference pixel may be a quantized value, and may be entropy encoded and transmitted.

상기한 현재 예측 단위의 내부에 존재하는 2개 이상의 화소들을 이용하여 참조화소들을 생성하는 방법은 슬라이스 타입이 인트라(I)인 경우에 효과적이다.The method of generating reference pixels using two or more pixels existing within the current prediction unit is effective when the slice type is intra (I).

부호화할 현재 예측 단위의 상측 및 좌측의 참조 화소들 모두가 이용 가능하지 않는 경우의 참조화소를 생성하는 또 다른 방법에 대해 설명한다. 이 방식은 슬라이스 타입이 인트라(I)가 아닌 경우에 효과적이다.Another method of generating a reference pixel when both the upper and left reference pixels of the current prediction unit to be encoded are not available will be described. This scheme is effective when the slice type is not intra (I).

먼저, 현재 블록의 이전에 부호화된 참조 픽쳐 내에, 현재 예측 단위의 참조화소들의 위치와 동일한 위치에 화소들이 존재하는지를 판단한다. 존재할 경우, 상기 참조 픽쳐 내의 화소들을 복사하여 현재 예측 단위의 참조화소를 생성한다. First, it is determined whether or not pixels exist in the same position as the reference pixels of the current prediction unit in the previously coded reference picture of the current block. If so, the reference pixels of the current prediction unit are generated by copying the pixels in the reference picture.

존재하지 않을 경우, 이전에 부호화된 참조 픽쳐 내에, 현재 예측 단위의 참조화소들의 위치와 가장 가까운 위치(1화소 떨어져 있는 위치)에 화소들이 존재하는지를 판단하고, 존재하는 경우 이들을 복사하여 현재 예측 단위의 참조화소로 이용한다.If it is not present, it is determined whether or not pixels are present in the previously coded reference picture at a position closest to the position of the reference pixels of the current prediction unit (one pixel apart). If they are present, And is used as a reference pixel.

참조화소 필터링부(152)는 현재 예측 단위의 참조화소들을 적응적으로 필터링한다. 이는 참조화소들 사이의 화소값의 변화량을 스무딩(smoothing)하기 위한 것으로, low-pass filter를 적용한다. Low-pass filter는 3-tap 필터인 [1, 2, 1] 또는 5-tap 필터인 [1, 2, 4, 2, 1]일 수 있다.  The reference pixel filtering unit 152 adaptively filters the reference pixels of the current prediction unit. This is for smoothing the amount of change in pixel values between reference pixels, and applies a low-pass filter. The low-pass filter can be a [1, 2, 1] or a 5-tap filter [1, 2, 4, 2, 1] which is a 3-tap filter.

또한, 현재 예측 단위의 크기에 따라 적응적으로 필터를 적용할 수 있다. 예를 들어, 현재 예측 단위가 소정 크기 이상인 경우에는 필터를 적용하지 않을 수도 있다. 구체적으로 현재 예측 단위의 크기가 64x64인 경우에는 필터를 적용하지 않는다.In addition, it is possible to apply the filter adaptively according to the size of the current prediction unit. For example, if the current prediction unit is larger than a predetermined size, the filter may not be applied. Specifically, when the size of the current prediction unit is 64x64, the filter is not applied.

또한, 상기 low-pass filter는 현재 예측 단위의 크기 및 인트라 예측 모드에 따라 적응적으로 적용될 수 있다. Also, the low-pass filter may be adaptively applied according to a current prediction unit size and an intra prediction mode.

인트라 예측 모드가 수평 또는 수직인 경우에는 예측 블록의 화소를 생성하기 위해 1개의 참조화소를 사용한다. 따라서, 이 경우에는 상기 필터를 적용하지 않는다. 또한, 인트라 예측 모드가 DC인 경우에는 참조화소의 평균값을 이용하므로, 참조화소들 간의 단차에 영향을 받지 않는다. 따라서, DC 모드인 경우에도 필터를 적용하지 않는다. When the intra prediction mode is horizontal or vertical, one reference pixel is used to generate the pixels of the prediction block. Therefore, in this case, the filter is not applied. When the intraprediction mode is DC, since the average value of the reference pixels is used, it is not affected by the step difference between the reference pixels. Therefore, the filter is not applied even in the DC mode.

반면에, 인트라 예측 방향이 수평 또는 수직 방향에 대해 45° 기울어진 모드들에 대해서는 현재 예측 단위의 크기에 관계없이 필터를 적용한다. 이 경우, 미리 정해진 크기보다 작은 예측 단위에 대해서는 제1 필터를, 미리 정해진 크기 이상의 예측 단위에 대해서는 스무딩 효과가 더 큰 제2 필터를 사용할 수 있다. 상기 미리 정해진 크기는 16x16일 수 있다. On the other hand, for modes in which the intra-prediction direction is inclined by 45 占 with respect to the horizontal or vertical direction, the filter is applied irrespective of the size of the current prediction unit. In this case, a first filter may be used for a prediction unit smaller than a predetermined size, and a second filter whose smoothing effect is larger for a prediction unit of a predetermined size or larger may be used. The predetermined size may be 16x16.

한편, 예측 블록의 화소를 생성하기 위해 적어도 2개 이상의 참조 화소들을 사용하는 상기 언급한 모드(6가지) 이외의 모드에서는 현재 예측 단위의 크기 및 인트라 예측 모드에 따라 적응적으로 적용될 수 있다. 다만, 플래너 모드에서는 참조 화소들에 대한 필터링을 수행하지 않는다. On the other hand, in a mode other than the above-mentioned mode (6 kinds) in which at least two reference pixels are used to generate the pixels of the prediction block, it can be adaptively applied according to the current prediction unit size and the intra prediction mode. In the planar mode, however, no filtering is performed on the reference pixels.

또한, 상기 선형결합에 의해 생성된 참조 화소들에 대해서는 필터를 적용하지 않을 수 있다.In addition, a filter may not be applied to the reference pixels generated by the linear combination.

예측블록 생성부(153)는 인트라 예측 모드에 대응하는 예측 블록을 생성한다. 상기 예측 블록은 인트라 예측 모드에 기초하여 참조 화소들 또는 참조화소들의 선형결합을 이용하여 생성한다. 예측 블록을 생성하기 위해 사용되는 상기 참조화소들은 참조화소 필터링부(152)에 의해 필터링된 참조 화소들일 수 있다. The prediction block generation unit 153 generates a prediction block corresponding to the intra prediction mode. The prediction block is generated using a linear combination of reference pixels or reference pixels based on an intra prediction mode. The reference pixels used for generating the prediction block may be reference pixels filtered by the reference pixel filtering unit 152. [

예측블록 필터링부(154)는 예측블록 생성부(153)에 의해 생성된 예측 블록을 사용된 인트라 예측 모드에 따라 적응적으로 필터링한다. 상기 동작은 생성된 예측 블록과 부호화할 현재 예측 단위의 잔차신호를 최소화하기 위한 것이다. 즉, 참조화소들과 인접하는 예측 블록 내의 화소 사이의 차이값은 인트라 예측 모드에 따라 달라질 수 있다. 따라서, 단차를 많이 발생시키는 인트라 예측 모드에 의해 생성된 예측 블록 내의 화소들을 필터링하면 잔차를 줄일 수 있다. The prediction block filtering unit 154 adaptively filters the prediction block generated by the prediction block generating unit 153 according to the used intra prediction mode. The operation is to minimize the residual signal of the generated prediction block and the current prediction unit to be encoded. That is, the difference value between the reference pixels and the pixels in the adjacent prediction block may vary according to the intra prediction mode. Therefore, by filtering the pixels in the prediction block generated by the intra prediction mode generating a large number of steps, the residual can be reduced.

DC 모드의 경우, 예측 블록이 참조화소들의 평균값으로 이루어지기 때문에 참조화소들과 인접하는 예측 블록 내의 화소 사이에는 단차가 발생할 수 있다. 따라서, 참조화소들과 인접하는 예측 블록 내의 상측 라인의 화소들 및 좌측 라인의 화소들은 참조화소들을 이용하여 필터링한다. 구체적으로, 예측 블록 내의 좌상측 코너에 위치하는 화소는 인접하는 참조화소가 2개(상측 참조화소와 좌측 참조화소)이므로, 3-tap 필터를 이용하여 상기 좌상측 코너의 화소를 필터링(또는 스무딩)한다. 그리고, 그 이외의 화소들(즉, 예측 블록 내의 상측 라인의 화소들 및 좌측 라인의 화소들)은 인접하는 참조화소가 1개이므로 2-tap 필터를 이용하여 필터링한다. In the DC mode, since a prediction block is made of the average value of the reference pixels, a step may occur between the reference pixels and the pixels in the adjacent prediction block. Therefore, the pixels of the upper line and the pixels of the left line in the prediction block adjacent to the reference pixels are filtered using the reference pixels. Specifically, since the adjacent reference pixels are two (the upper reference pixel and the left reference pixel) in the upper left corner in the prediction block, the pixels in the upper left corner are filtered (or smoothed) using the 3-tap filter, )do. The other pixels (i.e., the pixels on the upper line in the prediction block and the pixels on the left line) are filtered using a 2-tap filter because there are one adjacent reference pixel.

또한, 모드번호 0, 6 및 상기 모드들 사이의 방향성을 갖는 인트라 예측 모드(모드번호 22, 12, 23, 5, 24, 13, 25)들에 의해 생성된 참조 블록은 현재 예측 유닛의 상측 참조픽셀들만을 이용하여 예측 블록이 생성된다. 따라서, 참조픽셀과 인접하는 생성된 예측블록의 좌측 라인의 픽셀들은 아래쪽으로 갈수록 단차가 커질 수 있다. The reference blocks generated by the mode numbers 0 and 6 and the intra prediction modes (mode numbers 22, 12, 23, 5, 24, 13, and 25) having the direction between the modes are referred to as upper reference A prediction block is generated using only pixels. Therefore, the pixels of the left line of the generated prediction block adjacent to the reference pixel may become larger in the downward direction.

또한, 모드번호 1, 9 및 상기 모드들 사이의 방향성을 갖는 인트라 예측 모드(모드번호 30, 16, 31, 8, 32, 17, 33)들에 의해 생성된 참조 블록은 현재 예측 유닛의 좌측 참조픽셀들만을 이용하여 예측 블록이 생성된다. 따라서, 참조픽셀과 인접하는 생성된 예측블록의 상측 라인의 픽셀들은 오른쪽으로 갈수록 단차가 커질 수 있다.In addition, the reference blocks generated by the mode numbers 1, 9 and the intra prediction modes (mode numbers 30, 16, 31, 8, 32, 17, 33) having the directivity between the above- A prediction block is generated using only pixels. Therefore, the pixels on the upper line of the generated prediction block adjacent to the reference pixel may have a larger step as they go to the right.

따라서, 상기 단차를 보완하기 위해 DC 이외의 방향성 모드에 대해서도 적응적으로 예측 블록의 일부 화소들을 필터링한다. Therefore, in order to compensate the step difference, some pixels of the prediction block are adaptively filtered also in the directional mode other than DC.

모드번호가 6일 경우에는 좌측 참조화소와 인접하는 생성된 예측 블록내의 좌측 라인의 전부 또는 일부화소들을 필터링한다. 상기 좌측 라인의 일부화소들은 좌측라인의 아래쪽의 일부, 예를 들어, N/2개의 화소들일 수 있다. 여기서 N은 현재 예측 단위의 세로 길이(height)를 나타낸다. When the mode number is 6, all or some pixels of the left line in the generated prediction block adjacent to the left reference pixel are filtered. Some pixels of the left line may be a part of the lower side of the left line, for example, N / 2 pixels. Where N is the height of the current prediction unit.

마찬가지로 모드번호가 9인 경우에는 인접하는 생성된 예측 블록내의 상측 라인의 전부 또는 일부화소들을 필터링한다. 상기 상측 라인의 일부화소들은 상측라인의 오른쪽의 일부, 예를 들어, M/2개의 화소들일 수 있다. 여기서 M은 현재 예측 단위의 가로 길이(width)를 나타낸다.Similarly, when the mode number is 9, all or some pixels of the upper line in the adjacent generated prediction block are filtered. Some pixels of the upper line may be a part of the right side of the upper line, for example, M / 2 pixels. Where M represents the width of the current prediction unit.

그리고, 상기 모드번호 0, 6 사이의 방향성을 갖는 모드들 중 모드 번호 6에 가까운 방향성을 갖는 소정 개수의 모드들에 대해서도 모드번호 6와 동일한 방법으로 필터링을 수행할 수 있다. 이 경우 모드 번호 6으로부터 먼 모드일수록 멀어질수록 필터링 해야 할 화소의 수가 같거나 작아질 수 있다. Also, among the modes having the directionality between the mode numbers 0 and 6, the filtering can be performed in the same manner as the mode number 6 for a predetermined number of modes having a direction close to the mode number 6. In this case, the farther from the mode number 6 the farther the mode is, the more or less the number of pixels to be filtered can be.

그리고, 상기 모드번호 1, 9 사이의 방향성을 갖는 모드들에 대해서도 동일한 방법을 적용할 수 있다.The same method can also be applied to modes having directionality between the mode numbers 1 and 9.

한편, 현재 예측 단위의 크기에 따라 적응적으로 적용할 수도 있다. 예를 들면, 인트라 예측 모드별로 소정 크기 이하의 예측 단위에 대해서는 필터를 적용하지 않을 수도 있다.On the other hand, it can be applied adaptively according to the size of the current prediction unit. For example, a filter may not be applied to a prediction unit of a predetermined size or smaller in each intra prediction mode.

예측모드 결정부(153)는 참조 화소들을 이용하여 현재 예측 단위의 인트라 예측 모드를 결정한다. 예측모드 결정부(153)는 각 인트라 예측 모드에 대한 잔차블록의 부호화량이 최소가 되는 모드를 현재 예측 단위의 인트라 예측 모드로 결정할 수 있다. 잔차 블록을 구하기 위해 각 인트라 예측 모드에 따라 예측 블록을 생성한다. 상기 예측 블록은 각 인트라 예측 모드에 따라 참조화소 필터링부에 의해 필터링된 화소를 이용한 예측블록 또는 상기 생선된 예측블록을 소정의 조건에 따라 예측블록 필터링부(155)에서 필터링한 예측블록일 수 있다. The prediction mode determining unit 153 determines the intra prediction mode of the current prediction unit using the reference pixels. The prediction mode determining unit 153 can determine the mode in which the coding amount of the residual block for each intra prediction mode is the minimum to be the intra prediction mode of the current prediction unit. A prediction block is generated according to each intra prediction mode in order to obtain a residual block. The prediction block may be a prediction block using pixels filtered by the reference pixel filtering unit according to each intra prediction mode or a prediction block filtered by the prediction block filtering unit 155 according to a predetermined condition .

예측블록 송신부(157)은 상기 예측모드 결정부(155)에 의해 결정된 인트라 예측 모드에 대응하여 생성된 예측 블록을 감산부(190)로 송신한다. The prediction block transmission unit 157 transmits the prediction block generated corresponding to the intra prediction mode determined by the prediction mode determination unit 155 to the subtraction unit 190.

예측 모드 부호화부(156)는 예측모드 결정부(155)에 의해 결정된 현재 예측 단위의 인트라 예측 모드를 부호화한다. 예측 모드 부호화부(156)는 인트라 예측부(150)에 포함되어 수행될 수도 있고, 엔트로피 부호화부(140)에서 행해질 수도 있다.The prediction mode encoding unit 156 encodes the intra prediction mode of the current prediction unit determined by the prediction mode determination unit 155. [ The prediction mode encoding unit 156 may be included in the intraprediction unit 150 or may be performed in the entropy encoding unit 140.

예측 모드 부호화부(156)는 현재 예측 단위의 상측 인트라 예측모드와, 현재 예측 단위의 좌측 인트라 예측 모드를 이용하여 현재 예측 단위의 인트라 예측 모드를 부호화한다. The prediction mode encoding unit 156 encodes the intra prediction mode of the current prediction unit using the upper intra prediction mode of the current prediction unit and the left intra prediction mode of the current prediction unit.

먼저, 현재 예측 단위의 상측 및 좌측 인트라 예측 모드를 유도한다. 현재 예측 단위의 상측 예측 단위가 복수개 존재하는 경우에는 미리 정해진 방향(예를 들어, 우→좌)으로 스캔하면서 유효한 첫번째 예측 단위의 인트라 예측 모드를 상측 인트라 예측 모드로 설정한다. 현재 예측 단위의 좌측 예측 단위가 복수개 존재하는 경우에도 미리 정해진 방향(예를 들어, 하→상)으로 스캔하면서 유효한 첫번째 예측 단위의 인트라 예측 모드를 좌측 인트라 예측 모드로 설정할 수 있다. 또는 복수개의 유효한 예측 단위들의 모드번호들 중 가장 작은 모드번호를 상측 인트라 예측 모드로 설정할 수도 있다.First, the upper and left intra prediction modes of the current prediction unit are derived. When there are a plurality of upper prediction units of the current prediction unit, the intra prediction mode of the first effective prediction unit is set to the upper intra prediction mode while scanning in a predetermined direction (for example, right to left). Even when a plurality of left prediction units exist in the current prediction unit, the intra prediction mode of the effective first prediction unit can be set to the left intra prediction mode while scanning in a predetermined direction (e.g., lower phase). Or may set the smallest mode number among the mode numbers of the plurality of valid prediction units to the upper intra prediction mode.

상기 상측 인트라 예측 모드 또는 좌측 인트라 예측 모드가 유효하지 않는 경우에는 DC 모드(모드번호 2)를 상기 상측 또는 좌측 인트라 예측모드로 설정할 수 있다. 상기 상측 또는 좌측 인트라 예측 모드가 유효하지 않는 경우는 대응하는 인트라 예측 단위가 존재하지 않는 경우이다. If the upper intra prediction mode or the left intra prediction mode is not valid, the DC mode (mode number 2) may be set to the upper or left intra prediction mode. When the upper or left intra prediction mode is not valid, there is no corresponding intra prediction unit.

다음으로, 상기 상측 또는 좌측 인트라 예측 모드가 번호가 현재 예측 단위에서 허용되는 인트라 예측 모드의 수보다 크거나 같으면 상기 상측 또는 좌측 인트라 예측 모드를 미리 정해진 개수의 인트라 예측 모드들 중 하나로 변환한다. 상기 미리 정해진 개수는 현재 예측 단위의 크기에 달라 달라진다. 예를 들어, 현재 예측 단위의 크기가 4x4이면 9개의 모드들(0~8번 모드) 중 하나로 매핑하고, 현재 예측 단위의 크기가 64x64이면 3개의 모드들(0~2번 모드) 중 하나로 매핑한다. 또한, 현재 예측 단위에서 허용된 인트라 예측 모드들 중 하나로 변환할 수도 있다. If the upper or left intra prediction mode is equal to or greater than the number of intra prediction modes allowed in the current prediction unit, the upper or left intra prediction mode is converted into one of a predetermined number of intra prediction modes. The predetermined number varies with the size of the current prediction unit. For example, if the size of the current prediction unit is 4x4, it is mapped to one of nine modes (modes 0 to 8). If the size of the current prediction unit is 64x64, mapping is performed to one of three modes do. Also, it may be converted into one of the intra prediction modes allowed in the current prediction unit.

다음으로, 현재 예측 단위의 인트라 예측 모드번호가 상기 좌측 및 상측 인트라 예측 모드번호들 중 하나와 동일하면, 동일함을 나타내는 플래그와 상기 상측 및 좌측 인트라 예측 모드들 중 어느 하나를 가리키는 플래그를 전송한다. 이 경우, 상기 좌측 및 상측 인트라 예측 모드가 동일하면, 동일함을 나타내는 플래그만을 전송할 수 있다. 또한, 상기 상측 및 좌측 인트라 예측 모드들 중 어느 하나만이 유효하고 현재 블록의 인트라 예측 모드와 동일한 경우에도 상기 인접 블록의 모드와 동일함을 나타내는 플래그 만을 전송할 수 있다. Next, if the intra prediction mode number of the current prediction unit is the same as one of the left and upper intra prediction mode numbers, a flag indicating the same and a flag indicating one of the upper and left intra prediction modes are transmitted . In this case, if the left and upper intra prediction modes are the same, only a flag indicating the same can be transmitted. If only one of the upper and left intraprediction modes is valid and is identical to the intra prediction mode of the current block, only a flag indicating that the mode is the same as the mode of the adjacent block can be transmitted.

그러나, 현재 예측 단위의 인트라 예측 모드가 상기 좌측 및 상측 인트라 예측 모드들과 다른 모드일 경우에는, 현재 예측 단위의 인트라 예측 모드 번호와 상기 좌측 및 상측 인트라 예측 모드 번호들과 비교한다. 좌측 및 상측 인트라 예측 모드 번호 중 현재 예측 단위의 인트라 예측 모드 번호보다 크지 않는 경우의 수를 계산하고, 현재 예측 단위의 인트라 예측 모드 번호를 상기 경우의 수만큼 감소시킨 값을 전송할 현재 예측 단위의 최종 인트라 예측 모드로 결정한다. 여기서, 좌측 및 상측 인트라 예측 모드 번호가 동일할 경우에는 1개로 취급한다.However, when the intra prediction mode of the current prediction unit is different from the left and upper intra prediction modes, the intra prediction mode number of the current prediction unit and the left and upper intra prediction mode numbers are compared. Prediction mode number of the current prediction unit out of the left and upper intra prediction mode numbers is calculated and a value obtained by decrementing the intra prediction mode number of the current prediction unit by the number of the above case is used to determine the final The intra prediction mode is determined. Here, when the left and upper intra prediction mode numbers are the same, they are treated as one.

상기 상측 및 좌측 인트라 예측 모드가 동일한지 여부에 따라, 상기 결정된 최종 인트라 예측 모드를 엔트로피 부호화하기 위한 테이블이 결정된다. A table for entropy encoding the determined final intra prediction mode is determined according to whether the upper and left intra prediction modes are the same.

도 7은 본 발명에 따른 복호화 장치(200)의 인트라 예측부(250)를 나타내는 블록도이다.7 is a block diagram showing an intra predictor 250 of the decoding apparatus 200 according to the present invention.

본 발명에 따른 인트라 예측부(250)는 예측모드 복호화부(251), 참조화소 생성부(252), 참조화소 필터링부(253), 예측블록 생성부(254), 예측블록 필터링부(255) 및 예측 블록 송신부(256)를 포함한다.The intraprediction unit 250 according to the present invention includes a prediction mode decoding unit 251, a reference pixel generation unit 252, a reference pixel filtering unit 253, a prediction block generation unit 254, a prediction block filtering unit 255, And a prediction block transmitter 256. [

예측모드 복호화부(251)는 다음의 과정을 통해 현재 예측 단위의 인트라 예측 모드를 복원한다. The prediction mode decoding unit 251 restores the intra prediction mode of the current prediction unit through the following process.

수신된 부호화 단위 내의 부가정보 콘테이너에 포함된 예측 블록을 생성하기 위한 부가정보를 수신한다. 상기 부가정보는 예측 가능 플래그와 잔여 예측 모드 정보를 포함한다. 예측 가능 플래그는 현재 예측 단위의 인접 예측 단위의 어느 하나의 인트라 예측 모드와 동일한지 여부를 나타낸다. 잔여 예측 모드 정보는 예측 가능 플래그에 따른 다른 정보를 포함한다. 예측 가능 플래그 값이 1이면, 잔여 예측 모드 정보는 예측 모드 후보자 인덱스를 포함할 수 있다. 상기 예측 모드 후보자 인덱스는 인트라 예측 모드 후보자를 지정하는 정보이다. 예측 가능 플래그 값이 0이면, 잔여 예측 모드 정보는 잔차 인트라 예측 모드번호를 포함한다. And additional information for generating a prediction block included in the additional information container in the received encoding unit. The additional information includes a predictable flag and residual prediction mode information. The predictable flag indicates whether or not it is the same as any one of the intra prediction modes of the adjacent prediction units of the current prediction unit. The remaining prediction mode information includes other information according to the predictable flag. If the predictable flag value is 1, the residual prediction mode information may include the prediction mode candidate index. The prediction mode candidate index is information for designating an intra prediction mode candidate. If the predictable flag value is 0, the residual prediction mode information includes the residual intra prediction mode number.

현재 예측 단위의 인트라 예측 모드 후보자를 유도한다. 상기 인트라 예측 모드 후보자는 인접 예측 단위의 인트라 예측 모드를 유도한다. 여기서는 편의상 현재 예측 단위의 인트라 예측 모드 후보자를 상측 및 좌측 인트라 예측 모드로 한정하여 설명한다. 현재 예측 단위의 상측 또는 좌측 예측 단위가 복수개 존재하는 경우에는 상기한 부호화 장치(100)의 예측모드 부호화부(156)와 동일한 방법으로 현재 예측 단위의 상측 및 좌측 인트라 예측 모드를 유도한다. 그리고, 상기 상측 또는 좌측 인트라 예측 모드가 번호가 현재 예측 단위에서 허용되는 인트라 예측 모드의 수보다 크거나 같으면 예측모드 부호화부(156)와 동일한 방법으로 변환한다. And derives the intra prediction mode candidate of the current prediction unit. The intra prediction mode candidate derives an intra prediction mode of an adjacent prediction unit. For convenience, the intra prediction mode candidate of the current prediction unit is limited to the upper and left intra prediction modes. When there are a plurality of upper or left prediction units of the current prediction unit, the upper and left intra prediction modes of the current prediction unit are derived in the same manner as the prediction mode coding unit 156 of the coding apparatus 100 described above. If the upper or left intra prediction mode is equal to or greater than the number of intra prediction modes allowed in the current prediction unit, the prediction mode encoding unit 156 performs the same conversion.

다음으로, 수신된 예측 가능 플래그가 인접 예측 단위의 인트라 예측 모드와 동일함을 나타내면, 상기 예측 모드 후보자 인덱스가 존재하면, 상기 예측 모드 후보자 인덱스가 나타내는 예측 모드를 현재 예측 단위의 인트라 예측 모드로 결정한다. Next, if it is determined that the received predictive flag is the same as the intra prediction mode of the adjacent prediction unit, if the prediction mode candidate index exists, the prediction mode indicated by the prediction mode candidate index is determined as the intra prediction mode of the current prediction unit do.

수신된 예측 가능 플래그가 인접 예측 단위의 인트라 예측 모드와 동일함을 나타내지만, 상기 예측 모드 후보자 인덱스가 존재하지 않고, 인접 예측 단위의 유효한 인트라 예측 모드가 1개인 경우에는 이를 현재 예측 단위의 인트라 예측 모드로 복원한다. If the prediction mode candidate index does not exist and the effective intra prediction mode of the adjacent prediction unit is 1, it indicates that the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the current prediction unit, Mode.

수신된 예측 가능 플래그가 인접 예측 단위의 인트라 예측 모드와 동일하지 않음을 나타내면, 수신된 잔차 인트라 예측 모드값과 상기 유효한 인트라 예측 모드 후보자들의 인트라 예측 모드 번호를 비교하여 현재 예측 단위의 인트라 예측 모드를 복원한다.Prediction mode of the current prediction unit by comparing the received residual intra-prediction mode value with the intra prediction mode number of the valid intra prediction mode candidates, if the received predictive flag indicates that the intra prediction mode is not the same as the intra prediction mode of the adjacent prediction unit Restore.

참조화소 생성부(252)는 부호화 장치(100)의 참조화소 생성부(151)와 동일한 방법으로 참조화소를 생성한다. 다만, 참조화소 생성부(252)는 예측모드 복호화부(251)에 의해 복원된 인트라 예측 모드에 따라 적응적으로 참조화소를 생성하는 점에서 부호화 장치(100)의 참조화소 생성부(151)와 다르다. 즉, 참조화소 생성부(252)는 복원된 인트라 예측 모드를 이용하여 예측 블록을 생성하는데 사용될 참조 화소들이 유효하지 않은 경우에만 참조화소를 생성한다.The reference pixel generating unit 252 generates reference pixels in the same manner as the reference pixel generating unit 151 of the encoding apparatus 100. The reference pixel generating unit 252 generates a reference pixel adaptively according to the intra prediction mode reconstructed by the prediction mode decoding unit 251, different. That is, the reference pixel generation unit 252 generates a reference pixel only when reference pixels to be used for generating a prediction block using the restored intra prediction mode are not valid.

참조화소 필터링부(253)는 예측모드 복호화부(251)에 의해 복원된 인트라 예측 모드에 및 현재 예측 단위의 크기 정보에 기초하여 참조화소들을 적응적으로 필터링한다. 필터링 조건 및 필터는 부호화 장치(100)의 참조화소 필터링부(152)의 필터링 조건 및 필터와 동일하다. The reference pixel filtering unit 253 adaptively filters the reference pixels based on the intra prediction mode reconstructed by the prediction mode decoding unit 251 and the size information of the current prediction unit. The filtering conditions and the filter are the same as the filtering condition and filter of the reference pixel filtering unit 152 of the encoding apparatus 100.

예측블록 생성부(254)는 예측모드 복호화부(251)에 의해 복원된 인트라 예측 모드에 따라, 참조화소들을 이용하여 예측 블록을 생성한다. ,The prediction block generation unit 254 A prediction block is generated using the reference pixels according to the intra prediction mode restored by the prediction mode decoding unit 251. [ ,

예측블록 필터링부(255)는 예측모드 복호화부(251)에 의해 복원된 인트라 예측 모드에 따라 적응적으로 필터링한다. 상기 동작은 부호화 장치(100)의 예측블록 필터링부(154)와 동일하다. The prediction block filtering unit 255 adaptively filters according to the intra prediction mode restored by the prediction mode decoding unit 251. The operation is the same as that of the prediction block filtering unit 154 of the encoding apparatus 100.

예측 블록 송신부(256)는 상기 예측모드 생성부(254) 또는 상기 예측블록 필터링부(255)로부터 수신된 예측 블록을 가산기(290)로 전송한다. The prediction block transmission unit 256 transmits the prediction block received from the prediction mode generation unit 254 or the prediction block filtering unit 255 to the adder 290.

510: 선택부
520: 예측 수행부
510:
520: prediction performing unit

Claims (10)

동영상 복호화 장치의 예측 블록 생성 장치에 있어서,
수신된 부가정보 콘테이너에 포함된 예측블록 생성을 위한 부가정보 및 현재 예측 단위의 유효한 인트라 예측 모드 후보자 정보를 이용하여 현재 예측 단위의 인트라 예측 모드를 결정하는 예측모드 복호화부;
인트라 예측 블록을 생성하기 위해 이용 가능하지 않은 위치의 참조 화소들을 이용 가능한 참조 화소들을 이용하여 생성하는 참조 화소 생성부;
상기 결정된 현재 예측 단위의 인트라 예측 모드 또는 현재 예측 단위의 크기 정보에 기초하여 현재 예측 단위에 인접한 참조화소를 적응적으로 필터링하는 참조화소 필터링부;
상기 결정된 현재 예측 단위의 인트라 예측 모드에 대응하는 참조화소들을 이용하여 현재 예측 단위의 예측 블록을 생성하는 예측블록 생성부를 포함하는 예측 블록 생성 장치.
An apparatus for generating a prediction block of a moving picture decoding apparatus,
A prediction mode decoding unit for determining an intra prediction mode of a current prediction unit by using additional information for generating a prediction block included in the received additional information container and effective intra prediction mode candidate information of the current prediction unit;
A reference pixel generator for generating reference pixels of a position not available for generating an intra prediction block using available reference pixels;
A reference pixel filtering unit adaptively filtering a reference pixel adjacent to a current prediction unit based on the determined intra prediction mode of the current prediction unit or size information of the current prediction unit;
And a prediction block generator for generating a prediction block of a current prediction unit using reference pixels corresponding to the determined intra prediction mode of the current prediction unit.
제1항에 있어서, 상기 결정된 현재 예측 단위의 인트라 예측 모드에 기초하여 상기 예측블록 생성부에 의해 생성된 예측 블록 내의 일부 화소들을 필터링하는 예측블록 필터링부를 더 포함하고,
상기 예측 블록 내의 일부 화소들의 위치는 상기 인트라 예측 모드에 의해 결정되는 예측 블록 생성 장치.
The apparatus of claim 1, further comprising a prediction block filtering unit for filtering a part of pixels in a prediction block generated by the prediction block generation unit based on the determined intra prediction mode of the current prediction unit,
Wherein a position of some pixels in the prediction block is determined by the intra prediction mode.
제1항에 있어서, 상기 참조 화소 생성부는 한쪽 방향으로만 이용 가능한 화소들이 존재할 경우, 가장 인접한 이용 가능한 화소를 이용하여 이용 가능하지 않은 참조 화소를 생성하는 예측 블록 생성 장치.2. The apparatus of claim 1, wherein the reference pixel generation unit generates a reference pixel that is not usable by using the nearest usable pixel when there are available pixels in only one direction. 제1항에 있어서, 상기 참조 화소 필터링부는 현재 예측 단위의 크기에 따라 적응적으로 필터링을 수행하는 예측 블록 생성 장치.The apparatus of claim 1, wherein the reference pixel filtering unit performs adaptive filtering according to a size of a current prediction unit. 제1항에 있어서, 상기 참조 화소 필터링부는 [1, 2, 1] 필터를 이용하여 참조 화소를 필터링하는 예측 블록 생성 장치.2. The apparatus of claim 1, wherein the reference pixel filtering unit filters the reference pixels using a [1, 2, 1] filter. 제1항에 있어서, 상기 참조 화소 필터링부는 소정 크기 이상의 예측 단위에 대해서는 필터링을 수행하지 않는 예측 블록 생성 장치.2. The apparatus of claim 1, wherein the reference pixel filtering unit does not perform filtering on prediction units of a predetermined size or larger. 제1항에 있어서, 상기 참조 화소 필터링부는 예측 블록내의 각 화소 생성에 사용되는 참조 화소가 1개인 인트라 예측 모드 적용시 참조 화소를 필터링하지 않는 예측 블록 생성 장치.2. The apparatus of claim 1, wherein the reference pixel filtering unit does not filter the reference pixels in intra-prediction mode applying a single reference pixel used for generating each pixel in the prediction block. 제1항에 있어서, 상기 참조 화소 필터링부는 플래너 모드에서는 참조 화소를 필터링하지 않는 예측 블록 생성 장치.The apparatus of claim 1, wherein the reference pixel filtering unit does not filter the reference pixels in the planar mode. 제2항에 있어서, 상기 예측 블록 필터링부는 예측 블록을 좌측 또는 상측의 어느 한쪽의 참조 화소들만을 이용하여 생성하고, 수평 또는 수직 방향에 대해 45° 기울어진 방향성을 갖고 인트라 예측 모드에 의해 생성된 예측 블록 내의 일부 화소를 필터링하는 예측 블록 생성 장치.3. The apparatus of claim 2, wherein the prediction block filtering unit generates the prediction block using only one of the reference pixels on either the left side or the upper side, generates the prediction block having the direction that is inclined by 45 degrees with respect to the horizontal or vertical direction, And for filtering some pixels in the prediction block. 제1항에 있어서, 상기 예측 블록 필터링부는 수평 또는 수직 방향에 대해 45° 기울어진 모드를 갖는 인트라 예측 모드에서는 참조 화소를 필터링하는 예측 블록 생성 장치.2. The apparatus of claim 1, wherein the prediction block filtering unit filters the reference pixels in an intra prediction mode having a mode inclined by 45 占 with respect to the horizontal or vertical direction.
KR1020140045831A 2010-07-31 2014-04-17 Apparatus for encoding residual signals KR101474984B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020100074462 2010-07-31
KR20100074462 2010-07-31

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020130092185A Division KR20130091717A (en) 2010-07-31 2013-08-02 Prediction block generating apparatus

Publications (2)

Publication Number Publication Date
KR20140057514A true KR20140057514A (en) 2014-05-13
KR101474984B1 KR101474984B1 (en) 2014-12-24

Family

ID=49216773

Family Applications (8)

Application Number Title Priority Date Filing Date
KR1020130092185A KR20130091717A (en) 2010-07-31 2013-08-02 Prediction block generating apparatus
KR1020130092186A KR20130098254A (en) 2010-07-31 2013-08-02 Prediction block generating apparatus
KR1020140045827A KR20140057512A (en) 2010-07-31 2014-04-17 Prediction block generating apparatus
KR1020140045831A KR101474984B1 (en) 2010-07-31 2014-04-17 Apparatus for encoding residual signals
KR1020140045829A KR20140057513A (en) 2010-07-31 2014-04-17 Prediction block generating apparatus
KR1020140061212A KR20140071311A (en) 2010-07-31 2014-05-21 Apparatus for encoding a moving picture
KR1020190074905A KR102329705B1 (en) 2010-07-31 2019-06-24 Apparatus for encoding an image
KR1020210158430A KR20210145091A (en) 2010-07-31 2021-11-17 Apparatus for encoding an image

Family Applications Before (3)

Application Number Title Priority Date Filing Date
KR1020130092185A KR20130091717A (en) 2010-07-31 2013-08-02 Prediction block generating apparatus
KR1020130092186A KR20130098254A (en) 2010-07-31 2013-08-02 Prediction block generating apparatus
KR1020140045827A KR20140057512A (en) 2010-07-31 2014-04-17 Prediction block generating apparatus

Family Applications After (4)

Application Number Title Priority Date Filing Date
KR1020140045829A KR20140057513A (en) 2010-07-31 2014-04-17 Prediction block generating apparatus
KR1020140061212A KR20140071311A (en) 2010-07-31 2014-05-21 Apparatus for encoding a moving picture
KR1020190074905A KR102329705B1 (en) 2010-07-31 2019-06-24 Apparatus for encoding an image
KR1020210158430A KR20210145091A (en) 2010-07-31 2021-11-17 Apparatus for encoding an image

Country Status (1)

Country Link
KR (8) KR20130091717A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210024166A (en) * 2018-06-29 2021-03-04 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Intra screen prediction based on expansion
KR102257698B1 (en) 2020-10-28 2021-05-31 이정민 Building cooling and heating system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10979714B2 (en) 2016-09-05 2021-04-13 Lg Electronics, Inc. Image coding/decoding method and apparatus therefor

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007046644A1 (en) * 2005-10-21 2007-04-26 Electronics And Telecommunications Research Institute Apparatus and method for encoding and decoding moving picture using adaptive scanning
JP2009302776A (en) 2008-06-11 2009-12-24 Canon Inc Image encoding device, control method thereof, and computer program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210024166A (en) * 2018-06-29 2021-03-04 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Intra screen prediction based on expansion
US11606554B2 (en) 2018-06-29 2023-03-14 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Extended reference intra-picture prediction
KR102257698B1 (en) 2020-10-28 2021-05-31 이정민 Building cooling and heating system

Also Published As

Publication number Publication date
KR101474984B1 (en) 2014-12-24
KR102329705B1 (en) 2021-11-22
KR20140057513A (en) 2014-05-13
KR20130098254A (en) 2013-09-04
KR20140057512A (en) 2014-05-13
KR20140071311A (en) 2014-06-11
KR20210145091A (en) 2021-12-01
KR20190083318A (en) 2019-07-11
KR20130091717A (en) 2013-08-19

Similar Documents

Publication Publication Date Title
USRE48564E1 (en) Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
KR101373819B1 (en) Metohd of decoding intra prediction mode
KR20140057511A (en) Intra prediction decoding apparatus
KR20210145091A (en) Apparatus for encoding an image
KR20170034799A (en) Apparatus for decoding an image
KR20170034355A (en) Apparatus for decoding an image
KR20170034354A (en) Apparatus for decoding an image

Legal Events

Date Code Title Description
A107 Divisional application of patent
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
J204 Request for invalidation trial [patent]
FPAY Annual fee payment

Payment date: 20170913

Year of fee payment: 4

J301 Trial decision

Free format text: TRIAL NUMBER: 2017100000827; TRIAL DECISION FOR INVALIDATION REQUESTED 20170317

Effective date: 20180629