KR102329705B1 - Apparatus for encoding an image - Google Patents

Apparatus for encoding an image Download PDF

Info

Publication number
KR102329705B1
KR102329705B1 KR1020190074905A KR20190074905A KR102329705B1 KR 102329705 B1 KR102329705 B1 KR 102329705B1 KR 1020190074905 A KR1020190074905 A KR 1020190074905A KR 20190074905 A KR20190074905 A KR 20190074905A KR 102329705 B1 KR102329705 B1 KR 102329705B1
Authority
KR
South Korea
Prior art keywords
unit
intra prediction
block
prediction
prediction mode
Prior art date
Application number
KR1020190074905A
Other languages
Korean (ko)
Other versions
KR20190083318A (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=KR102329705(B1) "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 KR20190083318A publication Critical patent/KR20190083318A/en
Priority to KR1020210158430A priority Critical patent/KR20210145091A/en
Application granted granted Critical
Publication of KR102329705B1 publication Critical patent/KR102329705B1/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

본 발명에 따른 인트라 예측에서의 잔차 신호를 부호화하는 장치는 변환 단위의 크기에 따라 결정되는 변환 매트릭스를 이용하여 잔차 신호를 변환하여 변환 블록을 생성하는 변환부, 양자화 스텝 사이즈를 이용하여 변환 블록을 양자화하여 양자화 블록을 생성하는 양자화부, 양자화 블록의 계수들을 스캔하여 1차원의 양자화 계수정보를 생성하는 스캐닝부, 현재 블록의 크기에 따라 사전에 설정된 개수의 인트라 예측 모드 중에서 선택된 인트라 예측 모드에 대응하는 예측 블록을 생성하는 인트라 예측부, 및 1차원의 양자화 계수정보들을 엔트로피 부호화하는 엔트로피 부호화부를 구비하고, 스캐닝부는 변환 단위가 제1 기준크기보다 작거나 같으면, 양자화 블록의 계수들을 인트라 예측 모드에 따라 결정되는 스캔 패턴을 이용하여 스캔하고, 스캐닝부는 변환 단위가 제1 기준크기보다 크고 제2 기준크기보다 크지 않으면, 양자화 블록의 계수들을 복수개의 서브셋으로 분할하고, 인트라 예측 모드에 따라 결정되는 스캔 패턴을 이용하여 복수개의 서브셋들을 스캔한다. 따라서, 원본 영상에 근접한 예측 블록을 생성할 수 있어, 영상 압축률을 높일 수 있다.An apparatus for encoding a residual signal in intra prediction according to the present invention includes a transform unit that transforms a residual signal using a transform matrix determined according to the size of a transform unit to generate a transform block, and a transform block using a quantization step size Corresponds to an intra prediction mode selected from a quantization unit generating a quantized block by quantization, a scanning unit generating one-dimensional quantization coefficient information by scanning the coefficients of the quantization block, and a preset number of intra prediction modes according to the size of the current block an intra prediction unit generating a prediction block that A scan is performed using a scan pattern determined according to A plurality of subsets are scanned using a pattern. Accordingly, it is possible to generate a prediction block close to the original image, thereby increasing the image compression rate.

Figure R1020190074905
Figure R1020190074905

Description

영상 부호화 장치{Apparatus for encoding an image}Image encoding apparatus {Apparatus for encoding an image}

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

MPEG-1, MPEG-2, MPEG-4 H.264/MPEG-4, AVC(Advanced Video coding)와 같은 영상 압축 방식에서는 영상을 부호화하기 위해서 하나의 픽처를 매크로 블록으로 나눈다. 그리고, 인터 예측(inter prediction) 또는 인트라 예측(intra prediction)을 이용해 각각의 매크로 블록을 부호화한다.In video compression methods such as MPEG-1, MPEG-2, MPEG-4 H.264/MPEG-4, and Advanced Video Coding (AVC), one picture is divided into macroblocks in order to encode 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 with less distortion is selected by comparing a prediction block generated using pixel values of adjacent pixels with an original macroblock. Next, the prediction value of the current block to be encoded is calculated using the selected intra prediction mode and adjacent pixel values, the difference between the predicted value and the pixel value of the original current block is obtained, and then this is encoded through transform encoding, quantization, and entropy encoding. . And the prediction mode is also encoded.

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

종래 기술에 따른 16×16 인트라 예측 모드에는 수직(vertical) 모드, 수평(horizontal) 모드, DC(direct current) 모드, 플레인(plane) 모드의 총 네가지의 모드가 존재한다.In the 16×16 intra prediction mode according to the prior art, there are a total of four modes: 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 4×4 intra prediction mode according to the prior art includes a vertical mode, a horizontal mode, a direct current (DC) mode, a diagonal down-left mode, a diagonal down-right mode, There are a total of nine modes: a vertical right mode, a vertical left mode, a horizontal-up mode, and a horizontal-down mode.

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

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

그러나, 현재 블록에 포함된 화소들에 인접한 화소값들 중 일부 또는 전부가 존재하지 않거나, 부호화되지 않은 경우에는 인트라 예측 모드 중 일부 또는 전부를 적용할 수 없는 문제점이 발생한다. 또한 적용 가능한 인트라 모드 중 선택하여 인트라 예측을 수행하면, 예측 블록과 원본 블록 사이의 차이(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 encoded, some or all of the intra prediction modes cannot be applied. In addition, if intra prediction is performed by selecting one of the applicable intra modes, the residual between the prediction block and the original block is large, so that the efficiency of image compression is reduced.

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

본 발명에 따른 인트라 예측에서의 잔차 신호를 부호화하는 장치는, 변환 단위의 크기에 따라 결정되는 변환 매트릭스를 이용하여 상기 잔차 신호를 변환하여 변환 블록을 생성하는 변환부; 양자화 스텝 사이즈를 이용하여 상기 변환 블록을 양자화하여 양자화 블록을 생성하는 양자화부; 상기 양자화 블록의 계수들을 스캔하여 1차원의 양자화 계수정보를 생성하는 스캐닝부; 사전에 설정된 복수 개의 인트라 예측 모드 중에서 선택된 인트라 예측 모드에 대응하는 예측 블록을 생성하는 인트라 예측부; 및 상기 1차원의 양자화 계수정보들을 엔트로피 부호화하는 엔트로피 부호화부;를 구비하고, 상기 스캐닝부는 상기 변환 단위가 제1 기준크기보다 작거나 같으면, 상기 양자화 블록의 계수들을 상기 선택된 인트라 예측 모드에 따라 결정되는 스캔 패턴을 이용하여 스캔하고, 상기 스캐닝부는 상기 변환 단위가 상기 제1 기준크기보다 크고 제2 기준크기보다 크지 않으면, 상기 양자화 블록의 계수들을 복수 개의 서브셋으로 분할하고, 상기 선택된 인트라 예측 모드에 따라 결정되는 스캔 패턴을 이용하여 상기 복수 개의 서브셋들을 스캔한다.An apparatus for encoding a residual signal in intra prediction according to the present invention includes: a transform unit configured to transform the residual signal using a transform matrix determined according to a size of a transform unit to generate a transform block; a quantization unit that quantizes the transform block using a quantization step size to generate a quantized block; a scanning unit that scans the coefficients of the quantization block to generate one-dimensional quantization coefficient information; an intra prediction unit generating a prediction block corresponding to an intra prediction mode selected from among a plurality of preset intra prediction modes; and an entropy encoding unit entropy encoding the one-dimensional quantization coefficient information, wherein the scanning unit determines the coefficients of the quantization block according to the selected intra prediction mode when the transform unit is smaller than or equal to a first reference size. scan pattern using the selected scan pattern, and the scanning unit divides the coefficients of the quantization block into a plurality of subsets if the transform unit is greater than the first reference size and not greater than the second reference size, and is applied to the selected intra prediction mode. The plurality of subsets are scanned using a scan pattern determined according to the plurality of subsets.

바람직하게는, 상기 양자화 스텝 사이즈는 코딩 유닛마다 결정된다.Advantageously, said quantization step size is determined per coding unit.

바람직하게는, 상기 좌측 코딩 유닛의 양자화 스텝 사이즈 및 상기 상측 코딩 유닛의 양자화 스텝 상이즈가 모두 유효하지 않으면, 상기 양자화 스텝 사이즈는 이전 코딩 유닛의 양자화 스텝 사이즈로 설정된다.Preferably, if the quantization step size of the left coding unit and the quantization step size of the upper coding unit are both invalid, the quantization step size is set to the quantization step size of the previous coding unit.

바람직하게는, 상기 제1 기준크기는 4x4이고, 상기 제2 기준크기는 8x8이다.Preferably, the first reference size is 4x4, and the second reference size is 8x8.

바람직하게는, 상기 선택된 인트라 예측모드가 수직 모드 또는 상기 수직 모드에 인접한 미리 정해진 개수의 인트라 예측 모드들 중 하나이면, 상기 스캔 패턴은 수평 스캔이다.Preferably, if the selected intra prediction mode is one of a vertical mode or a predetermined number of intra prediction modes adjacent to the vertical mode, the scan pattern is a horizontal scan.

바람직하게는, 상기 선택된 인트라 예측모드가 비방향성 모드이면, 상기 스캔 패턴은 미리 정해진 스캔 패턴이다.Preferably, if the selected intra prediction mode is a non-directional mode, the scan pattern is a predetermined scan pattern.

바람직하게는, 상기 복수 개의 서브셋들은 역방향으로 스캔된다.Advantageously, said plurality of subsets are scanned in a reverse direction.

바람직하게는, 상기 복수 개의 서브셋들에 적용되는 스캔 패턴과 각 서브셋 내의 계수들에 적용되는 스캔 패턴은 동일하다.Preferably, the scan pattern applied to the plurality of subsets and the scan pattern applied to the coefficients in each subset are the same.

바람직하게는, 상기 인트라 예측부는 상기 선택된 인트라 예측 모드에 따라 예측 블록을 적응적으로 필터링하며, 상기 선택된 인트라 예측 모드가 DC 모드이면 상기 예측 블록에 인접한 참조화소들을 이용하여 상기 예측 블록 내의 상측 및 좌측 라인의 화소들을 필터링한다.Preferably, the intra prediction unit adaptively filters a prediction block according to the selected intra prediction mode, and if the selected intra prediction mode is a DC mode, upper and left sides of the prediction block using reference pixels adjacent to the prediction block Filter the pixels in the line.

본 발명에 따른 인트라 예측에서의 잔차 신호를 부호화하는 장치는 원본 영상에 근접한 예측 블록을 생성하기 위해 참조 픽셀을 생성하고, 상기 참조 픽셀을 적응적으로 필터링함으로써, 원본 영상에 가까운 예측 블록을 생성한다. 또한, 예측 블록을 인트라 예측 모드에 따라 적응적으로 필터링함으로써, 잔차 신호를 더욱 줄일 수 있게 되어, 영상 압축률을 높일 수 있다.An apparatus for encoding a residual signal in intra prediction according to the present invention generates a prediction block close to the original image by generating a reference pixel to generate a prediction block close to the original image, and adaptively filtering the reference pixel. . In addition, by adaptively filtering the prediction block according to the intra prediction mode, it is possible to further reduce the residual signal, thereby increasing the image compression rate.

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

이하, 본 발명의 여러가지 실시예들을 예시적인 도면을 통해 상세히 설명한다. 본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. Hereinafter, various embodiments of the present invention will be described in detail with reference to exemplary drawings. The present invention is not intended to limit the present invention to a specific embodiment, as various changes can be made and various embodiments can be made, and all changes, equivalents or substitutes included in the spirit and scope of the present invention are included. should be understood as including In describing each figure, like reference numerals have been used for like elements.

영상 부호화를 위해 각 픽쳐는 복수개의 슬라이스로 이루어지고, 각 슬라이스는 복수 개의 부호화 유닛으로 이루어진다. HD급 이상의 영상에서는 영상이 비교적 평탄해지는 영역이 많으므로, 다양한 크기의 부호화 유닛으로 부호화를 하는 것이 영상 압축률을 높일 수 있다. For video encoding, each picture consists of a plurality of slices, and each slice consists of a plurality of coding units. Since there are many regions in which the image is relatively flat in an image of HD level or higher, encoding using coding units of various sizes may increase the image compression rate.

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

따라서, 영상 시퀀스의 모든 픽쳐의 부호화에 사용하게 될 부호화 유닛들의 크기는 SMB 및 이들의 서브블록들의 크기일 수 있다. 영상 시퀀스에 사용하게 될 부호화 유닛의 크기는 디폴트로 지정되거나 시퀀스 헤더에서 지정할 수 있다. Accordingly, the size of coding units to be used for encoding all pictures of the image sequence may be the size of the SMB and its subblocks. The size of a coding unit to be used for an image sequence may be designated as a default or may be designated in a sequence header.

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

한편, 부호화 트리 내의 각각의 부호화 유닛은 부호화 유닛 자체 또는 서브 파티션 단위로 인트라 예측(Intra Pediction) 또는 인터 예측(Inter Prediction)이 수행된다. 상기 인트라 예측 또는 인터 예측을 수행하는 단위를 예측 유닛(Prediction unit)이라 지칭한다. 인트라 예측을 위한 예측 유닛은는 2Nx2N 또는 NxN일 수 있다. 인터 예측을 위한 예측 유닛은 2Nx2N, 2NxN, Nx2N, NxN일수 있다. 여기서 2N은 부호화 유닛의 가로 세로 길이를 의미한다 . Meanwhile, in each coding unit in the coding tree, intra prediction or inter prediction is performed in units of the coding unit itself or sub-partitions. A unit for performing the intra prediction or inter prediction is referred to as a prediction unit. A prediction unit for intra prediction may be 2Nx2N or NxN. A prediction unit for inter prediction may be 2Nx2N, 2NxN, Nx2N, or NxN. Here, 2N means the horizontal and vertical length of the coding unit .

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

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

부호화 유닛은 부호화 유닛의 부호화된 잔차신호를 담기 위한 잔차 신호 콘테이너를 포함한다. 잔차 신호 콘테이너는 1개의 변환 트리, 1개의 휘도 잔차신호 콘테이너 및 2개의 색차 잔차신호 콘테이너를 포함한다. 변환 트리는 부호화 유닛에 포함된 잔차 신호에 대한 변환 유닛들의 분할 구조를 나타낸다. 또한 변환 트리는 각각의 변환 유닛의 잔차 신호가 0인지 여부를 나타낸다. 잔차 신호 콘테이너는 재귀적 코딩 트리 구조로 이루어진다. 즉, 부호화 유닛의 잔차 신호 콘테이너를 기준으로 설명하면 다음과 같다. 먼저, 코딩 유닛이 4개의 하위 코딩 유닛으로 분할되지 않으면, 잔차신호 콘테이너는 양자화 정보(잔차 양자화 파라미터)와 부호화된 잔차 신호를 포함한다. 코딩 유닛이 4개의 하위 코딩 유닛으로 분할되면, 잔차신호 콘테이너는 양자화 정보와 4개의 하위 잔차 신호 콘테이너를 포함한다. 각각의 하위 잔차 신호 콘테이너는, 양자화 정보를 포함하지 않는 것을 제외하고는, 부호화 유닛의 잔차신호 콘테이너와 동일한 구조를 갖는다.The encoding unit includes a residual signal container for containing the encoded residual signal of the encoding unit. The residual signal container includes one transform tree, one luminance residual signal container and two chrominance residual signal containers. The transform tree represents a split structure of transform units with respect to the residual signal included in the coding unit. The transform tree also indicates whether the residual signal of each transform unit is zero. The residual signal container consists of a recursive coding tree structure. That is, a description will be made based on the residual signal container of the coding unit as follows. First, if the coding unit is not divided into four lower coding units, the residual signal container includes quantization information (residual quantization parameter) and the coded residual signal. If the coding unit is divided into four lower coding units, the residual signal container includes quantization information and four lower residual signal containers. Each lower residual signal container has the same structure as the residual signal container of the coding unit, except that quantization information is not included.

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

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

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

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

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

또 다른 방법으로는 블록의 각각의 분할 영역별로 패딩을 통하여 블록을 생성하여 부호화할 수 있다. 즉, 2개의 분할영역 중 현재 분할 영역을 부호화할 때, 블록의 구성하는 다른 분할 영역을 현재 분할 영역의 값으로 패딩하여 하나의 블록으로 구성한 후 2차원 변환 부호화할 수 있다.As another method, a block may be generated and encoded through padding for each divided region of the block. That is, when encoding the current partition among the two partitions, another partition constituting the block may be padded with the values of the current partition to form one block, and then 2D transform encoding may be performed.

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

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

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

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

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

한편, 슬라이스가 부호화 단위로 분리될 경우에는 현재 부호화 단위의 좌측 부호화 단위, 상측 부호화 단위, 좌상측 부호화 단위 모두가 존재하지 않을 가능성이 있다. 반면에 최대 부호화 단위 내의 부호화 순서 상으로 이전에 존재하는 부호화 단위가 존재할 수 있다. 따라서, 현재 부호화 단위에 인접한 부호화 단위들과 상기 최대 부호화 단위 내에서는 부호화 순서상 바로 이전의 부호화 단위가 후보자가 될 수 있다. 이 경우, 1) 현재 부호화 단위의 좌측 부호화 단위, 2) 현재 부호화 단위의 상측 부호화 단위, 3) 현재 부호화 단위의 좌상측 부호화 단위, 4) 부호화 순서상 바로 이전의 부호화 단위 순서로 우선순위를 둘 수 있다. 상기 순서는 바뀔 수 있고, 상기 좌상측 부호화 단위는 생략될 수도 있다.Meanwhile, when a slice is divided into coding units, there is a possibility that all of the left coding unit, the upper coding unit, and the upper left coding unit of the current coding unit do not exist. On the other hand, a previously existing coding unit in a coding order within the largest coding unit may exist. Accordingly, within the coding units adjacent to the current coding unit and the largest coding unit, the coding unit immediately preceding in the coding order may be a candidate. In this case, in order of 1) the left coding unit of the current coding unit, 2) the upper coding unit of the current coding unit, 3) the upper left coding unit of the current coding unit, and 4) the coding unit immediately preceding in the coding order, can The order may be changed, and the upper left coding 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 transforms them into one-dimensional quantized coefficients. Since the coefficient distribution of the transform block after quantization may depend on the intra prediction mode, the scanning method is determined according to the intra prediction mode. Also, the coefficient scanning method may be determined differently according to the size of the transform unit.

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

후처리부(160)는 복원된 픽쳐에 발생하는 블록킹 효과의 제거하기 위한 디블록킹 필터링 과정, 화소 단위로 원본 영상과의 차이값을 보완하기 위한 적응적 오프셋 적용 과정 및 부호화 단위로 원본 영상과의 차이값을 보완하기 위한 적응적 루프 필터 과정을 수행한다. The post-processing unit 160 performs a deblocking filtering process to remove a blocking effect occurring in the reconstructed picture, an adaptive offset application process to compensate for a difference value from the original image in units of pixels, and a difference from the original image in units of coding. An adaptive loop filter process is performed to complement the values.

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

상기 디블록킹 필터의 적용 여부는 i) 상기 경계 필터링 강도가 0보다 큰지 여부 및 ii) 상기 필터링할 경계에 인접한 2개의 블록(P 블록, Q블록) 경계 부분에서의 화소값들이 변화 정도를 나타내는 값이 양자화 파라미터에 의해 결정되는 제1 기준값보다 작은지 여부에 의해 결정된다. Whether the deblocking filter is applied is determined by i) whether the boundary filtering intensity is greater than 0, and ii) a value indicating the degree of change in pixel values at the boundary of two blocks (P block, Q block) adjacent to the boundary to be filtered. It is determined by whether it 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. When the absolute value of the difference value 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. 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 may perform filtering based on a value obtained by comparing the original image with the reconstructed image that has undergone the deblocking filtering process or the adaptive offset application process. The adaptive loop filter is detected through one Laplacian activity value based on a block of 4x4 size. The determined ALF may be applied to all pixels included in a block having a size of 4x4 or 8x8. Whether to apply the adaptive loop filter may be determined for each coding unit. The size and coefficient of the loop filter to be applied may vary according to each coding unit. Information indicating whether the adaptive loop filter is applied to each coding unit, filter coefficient information, filter form information, etc. may be included in each slice header and transmitted to the decoder. In the case of a color difference signal, it may be determined whether the adaptive loop filter is applied in units of pictures. The shape of the loop filter may also 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, restores the image in units of pictures, and stores it. A picture may be an image in units of frames or images in units of fields. The picture storage unit 180 includes 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 or more reference pictures stored in the picture storage unit 180 , and determines a reference picture index and a motion vector indicating the reference picture. Then, according to the determined reference picture index and motion vector, from a reference picture used for motion estimation among a plurality of reference pictures stored in the picture storage unit 150, a prediction block corresponding to a prediction unit to be encoded is extracted and output. .

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

엔트로피 부호화부(130)는 양자화부(130)에 의해 양자화된 양자화 계수, 인트라 예측부(140)로부터 수신된 인트라 예측 정보, 인터 예측부(150)로부터 수신된 움직임 정보 등를 엔트로피 부호화한다. The entropy encoding unit 130 entropy-encodes the quantized 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 illustrating a scanning operation process of the scanning unit 131 of FIG. 1 .

먼저, 현재 양자화된 계수 블록들을 복수개의 서브셋으로 분할할지 여부를 판단한다(S110). 상기 분할여부의 결정은 현재 변환 단위의 크기에 의존한다. 즉, 변환 단위의 크기가 제1 기준 크기보다 큰 경우 상기 부호화된 양자화 계수들을 복수개의 서브셋으로 분할한다. 상기 제1 기준 크기는 4x4 또는 8x8인 것이 바람직하다. 상기 소정 크기 정보는 픽쳐 헤더 또는 슬라이스 헤더를 통해 복호기로 전송할 수도 있다. First, it is determined whether to divide the currently quantized coefficient blocks into a plurality of subsets (S110). The determination of whether to divide depends on the size of the current transformation unit. That is, when the size of the transform unit is greater than the first reference size, the coded quantization coefficients are divided into a plurality of subsets. Preferably, the first reference size is 4x4 or 8x8. The predetermined size information may be transmitted to the 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 blocks 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 one predetermined scan pattern (eg, zigzag scan) may be applied. Also, it is possible to select and scan any one of a plurality of predetermined scan patterns and transmit scan pattern information to the decoder.

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

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

현재 양자화된 계수 블록들이 복수개의 서브셋으로 분할되는 것으로 판단되면, 상기 변환 양자화된 계수 블록들을 복수개의 서브셋으로 분할한다(S140). 상기 복수개의 서브셋은 하나의 메인 서브셋과 적어도 하나 이상의 잔여 서브셋으로 구성된다. 메인 서브셋은 DC 계수를 포함하는 좌상측에 위치하고, 상기 잔여 서브셋은 메인 서브셋 이외의 영역을 커버한다.If it is determined that the currently 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 includes one main subset and at least one remaining subset. The main subset is located on the upper left side including the DC coefficient, and the remaining subset covers a region 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. When the size of the current transform quantized coefficient block (size of the transform block) is larger than the second reference size (eg, 8x8), only the zigzag scan may be applied. Accordingly, 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 one predetermined scan pattern (eg, 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 is reversed. That is, entropy encoding may be performed by scanning non-zero quantization coefficients in the reverse direction from the last non-zero quantization coefficient in the subset according to a 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 is reversed. That is, entropy encoding may be performed by scanning non-zero quantization coefficients in the reverse direction from the last non-zero quantization coefficient in the subset according to a scan pattern.

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

한편, 부호기는 상기 변환 단위내의 0이 아닌 마지막 양자화 계수의 위치를 나타낼 수 있는 정보를 복호기로 전송한다. 각 서브셋 내의 0이 아닌 마지막 양자화 계수의 위치를 나타낼 수 있는 정보도 복호기로 전송한다. 상기 정보는 각각의 서브셋 내의 0이 아닌 마지막 양자화 계수의 위치를 나타내는 정보일 수 있다. Meanwhile, the encoder transmits information indicating the position of the last non-zero quantization coefficient in the transform unit to the decoder. Information capable of 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 video decoding apparatus according to an embodiment of the present invention.

도 3를 참조하면, 본 발명에 따른 동영상 복호화 장치는, 엔트로피 복호부(210), 역스캐닝부(220), 역양자화부(230), 역변환부(240), 인트라 예측부(250), 인터 예측부(260), 후처리부(270), 픽쳐 저장부(280), 가산부(290), 및 인트라/인터전환 스위치(295)를 구비한다.Referring to FIG. 3 , the video 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 , and an inter It includes a prediction unit 260 , a post-processing unit 270 , a picture storage unit 280 , an adder 290 , and an intra/inter switching switch 295 .

엔트로피 복호부(210)는, 수신된 부호화 비트 스트림을 복호하여, 인트라 예측 정보, 인터 예측 정보, 양자화 계수 정보 등으로 분리한다. 엔트로피 복호부(210)는 복호된 인터 예측 정보를 인터 예측부(260)에 공급한다. 엔트로피 복호부(210)는 상기 인트라 예측 정보를 인트라 예측부(250) 및 역변환부(240)로 공급한다. 또한, 상기 엔트로피 복호화(210)는 상기 역양자화 계수 정보를 역스캔부(220)로 공급한다.The entropy decoding unit 210 decodes the received encoded bit stream, and separates it into intra prediction 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 transform unit 240 . Also, the entropy decoding 210 supplies the inverse quantization coefficient information to the inverse scan unit 220 .

역스캐닝부(220)는 상기 역양자화 계수 정보를 2차원 배열의 역양자화 블록으로 변환한다. 상기 변환을 위해 복수개의 역스캐닝 패턴 중에 하나를 선택한다. 계수 역스캐닝 패턴은 예측모드와 인트라 예측 모드 중 적어도 하나에 기초하여 결정된다. 역스캐닝부(220)의 동작은 상기에서 설명한 스캐닝부(131)의 동작의 역과정과 동일하다. The inverse scanning unit 220 converts the inverse quantization coefficient information into a two-dimensional array of inverse quantization blocks. For the transformation, one of a plurality of inverse scanning patterns is selected. 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 reverse scanning unit 220 is the same as the reverse process of the operation of the scanning unit 131 described above.

역양자화부(230)는 현재 부호화 단위의 양자화 스텝 사이즈 예측자를 결정한다. 상기 예측자의 결정과정은 도 1의 양자화부(130)의 예측자 결정 과정과 동일하므로 생략한다. 역양자화부(230)는 결정된 양자화 스텝 사이즈 예측자와 수신한 잔차 양자화 스텝 사이즈를 더하여 현재 역양자화 블록에 적용된 양자화 스텝 사이즈를 얻는다. 역양자화부(230)는 양자화 스텝 사이즈가 적용된 양자화 매트릭스를 이용하여 역양자화 계수를 복원한다. 복원하고자 하는 현재 블록의 크기에 따라 서로 다른 양자화 매트릭스가 적용되며, 동일 크기의 블록에 대해서도 상기 현재 블록의 예측 모드 및 인트라 예측 모드 중 적어도 하나에 기초하여 양자화 매트릭스가 선택된다. The inverse quantizer 230 determines a quantization step size predictor of the current coding unit. The process of determining the predictor is the same as the process of determining the predictor of the quantization unit 130 of FIG. 1 , and thus is omitted. The inverse quantization unit 230 adds the determined quantization step size predictor and the received residual quantization step size to obtain a quantization step size applied to the current inverse quantization block. The inverse quantization unit 230 restores the inverse quantization coefficients 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 reconstructed, and a quantization matrix is selected based on at least one of a prediction mode and an intra prediction mode of the current block even for a block of the same size.

역변환부(240)는 역양자화 블록을 역변환하여 잔차 블록을 복원한다. 그리고, 상기 복원된 양자화 계수를 역변환하여 잔차 블록을 복원한다. 상기 역양자화 블록에 적용할 역변환 매트릭스는 예측 모드(인트라 또는 인터) 및 인트라 예측 모드에 따라 적응적으로 결정될 수 있다. 도 1의 변환부(120)에 적용된 변환 매트릭스의 역변환 매트릭스가 결정되므로 구체적인 기재는 생략한다.The inverse transform unit 240 inverse transforms the inverse quantized block to reconstruct the residual block. Then, the residual block is reconstructed by inverse transforming the reconstructed quantization coefficient. An 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 transform matrix of the transform matrix applied to the transform unit 120 of FIG. 1 is determined, a detailed description thereof will be omitted.

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

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

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

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

픽쳐 저장부(280)는 후처리부(270)에 의해 후처리된 복호 영상을 픽쳐 단위로 저장한다.The picture storage unit 280 stores the decoded image post-processed by the post-processing unit 270 in units of pictures.

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

도 4를 참조하면, 인트라 예측부(150)는 참조화소 생성부(151), 참조화소 필터링부(152), 예측모드 결정부(153), 예측블록 생성부(154), 예측블록 필터링부(155) 및 예측모드 부호화부(156)를 포함한다.Referring to FIG. 4 , the intra prediction 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 , and a prediction block filtering unit ( 155) and a prediction mode encoder 156.

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

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

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

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

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

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

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

예를 들어, 현재 예측 단위가 픽쳐 또는 슬라이스의 우측 경계, 또는 최대 부호화 단위의 우측 경계에 위치하는 경우에는 영역 D의 참조화소들이 이용 가능하지 않다. 마찬가지로 현재 예측 단위가 픽쳐 또는 슬라이스의 아래측 경계 또는 최대 부호화 단위의 아래측 경계에 위치하는 경우에는 영역 B의 참조화소들이 이용 가능하지 않다. For example, when the current prediction unit is located at a right boundary of a picture or a slice or a right boundary of a maximum coding unit, reference pixels of the region D are not available. Similarly, when 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, reference pixels can be created by copying the available reference pixels that exist in the nearest position. As another method, reference pixels may be generated by using a plurality of available reference pixels present at the closest positions.

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

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

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

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

이러한 경우에는 현재 예측 단위의 내부에 존재하는 2개 이상의 화소들을 이용하여 일부 또는 전부의 참조화소들을 생성할 수 있다. 상기 참조화소를 생성하기 위해 사용되는 현재 예측 단위의 내부에 존재하는 화소의 수는 2 또는 3일 수 있다.In this case, some or all of the reference pixels may be generated using two or more pixels existing inside 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 a reference pixel according to the present invention.

도 6을 참조하여, 2개의 화소를 이용할 경우에 대해 먼저 설명한다. 현재 예측 단위의 좌상측 화소(○)과 다른 하나의 화소를 이용하는 경우이다. 다른 하나의 화소는 우상측 화소(□), 좌하측 화소(△), 우하측 화소(▽)일 수 있다. 현재 예측 단위의 좌상측 화소(○)과 우상측 화소(□)을 사용할 경우에는 상기 좌상측 화소와 우상측 화소는 대응하는 상측 위치로 복사하고, 상기 복사된 좌상측 화소와 우상측 화소를 이용하여 그 사이의 영역(영역 C)의 참조 화소들을 생성한다. 상기 생성되는 참조화소들은 상기 2개의 참조화소(복사된 좌상측 화소와 우상측 화소)들의 반올림한 평균값을 또는 선형 보간 방법에 생성된 값일 수 있다. 우상측 화소(□)을 복사하거나 복수개의 상측 생성 참조화소들을 이용하여 영역 D의 참조화소들을 생성한다. 현재 예측 단위의 좌상측 화소(○)과 좌하측 화소(△)을 사용할 경우에도 위와 동일한 방식을 적용한다. 현재 예측 단위의 좌상측 화소(○)과 우하측 화소(▽)을 사용할 경우에는 우하측 화소 화소(▽)을 수평방향 및 수직방향으로 동일한 위치의 참조 화소 위치로 복사한다. 그리고 그 이후의 참조화소 생성방식은 위와 동일한 방식을 적용한다.A case in which two pixels are used will be first described with reference to FIG. 6 . This is a case of using a pixel different from the upper-left pixel (○) of the current prediction unit. The other pixel may be a right pixel (□), a lower left pixel (Δ), and a lower right pixel (▽). When the upper-left pixel (○) and the right-right pixel (□) of the current prediction unit are used, the upper-left pixel and the upper-right pixel are copied to the corresponding upper position, and the copied upper-left pixel and the right-right pixel are used. Thus, reference pixels in the region (region C) between them are generated. The generated reference pixels may be a rounded average value of the two reference pixels (the copied upper-left pixel and the right-right pixel) or a value generated by a linear interpolation method. Reference pixels of the region D are generated by copying the right pixel (□) or using a plurality of upper generated reference pixels. In the case of using the upper-left pixel (○) and the lower-left pixel (Δ) of the current prediction unit, the same method as above is applied. When the upper left pixel (○) and the lower right pixel (▽) of the current prediction unit are used, the lower right pixel pixel (▽) is copied to the reference pixel position at the same position in the horizontal and vertical directions. After that, the same method as above is applied to the reference pixel generation method.

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

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

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

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

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

존재하지 않을 경우, 이전에 부호화된 참조 픽쳐 내에, 현재 예측 단위의 참조화소들의 위치와 가장 가까운 위치(1화소 떨어져 있는 위치)에 화소들이 존재하는지를 판단하고, 존재하는 경우 이들을 복사하여 현재 예측 단위의 참조화소로 이용한다.If it does not exist, it is determined whether pixels are present in the previously encoded reference picture at the position closest to the position of the reference pixels of the current prediction unit (a position one pixel apart), and if present, they are copied to determine the size of the current prediction unit. 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 reference pixels of the current prediction unit. This is for smoothing the amount of change in pixel values between reference pixels, and a low-pass filter is applied. The low-pass filter may be a 3-tap filter [1, 2, 1] or a 5-tap filter [1, 2, 4, 2, 1].

또한, 현재 예측 단위의 크기에 따라 적응적으로 필터를 적용할 수 있다. 예를 들어, 현재 예측 단위가 소정 크기 이상인 경우에는 필터를 적용하지 않을 수도 있다. 구체적으로 현재 예측 단위의 크기가 64x64인 경우에는 필터를 적용하지 않는다.Also, the filter may be adaptively applied according to the size of the current prediction unit. For example, when the current prediction unit has a predetermined size or larger, 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 the size of the current prediction unit and the intra prediction mode.

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

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

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

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

예측블록 생성부(153)는 인트라 예측 모드에 대응하는 예측 블록을 생성한다. 상기 예측 블록은 인트라 예측 모드에 기초하여 참조 화소들 또는 참조화소들의 선형결합을 이용하여 생성한다. 예측 블록을 생성하기 위해 사용되는 상기 참조화소들은 참조화소 필터링부(152)에 의해 필터링된 참조 화소들일 수 있다. The prediction block generator 153 generates a prediction block corresponding to the intra prediction mode. The prediction block is generated using reference pixels or a linear combination of reference pixels based on an intra prediction mode. The reference pixels used to generate 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 generation unit 153 according to the used intra prediction mode. The operation is to minimize the residual signal between the generated prediction block and the current prediction unit to be encoded. That is, a difference value between reference pixels and pixels in an adjacent prediction block may vary according to the intra prediction mode. Accordingly, the residual can be reduced by filtering pixels in the prediction block generated by the intra prediction mode that generates a large number of steps.

DC 모드의 경우, 예측 블록이 참조화소들의 평균값으로 이루어지기 때문에 참조화소들과 인접하는 예측 블록 내의 화소 사이에는 단차가 발생할 수 있다. 따라서, 참조화소들과 인접하는 예측 블록 내의 상측 라인의 화소들 및 좌측 라인의 화소들은 참조화소들을 이용하여 필터링한다. 구체적으로, 예측 블록 내의 좌상측 코너에 위치하는 화소는 인접하는 참조화소가 2개(상측 참조화소와 좌측 참조화소)이므로, 3-tap 필터를 이용하여 상기 좌상측 코너의 화소를 필터링(또는 스무딩)한다. 그리고, 그 이외의 화소들(즉, 예측 블록 내의 상측 라인의 화소들 및 좌측 라인의 화소들)은 인접하는 참조화소가 1개이므로 2-tap 필터를 이용하여 필터링한다. 단차를 보완하기 위해 DC 이외의 방향성 모드에 대해서도 적응적으로 예측 블록의 일부 화소들을 필터링한다. 한편, 현재 예측 단위의 크기에 따라 적응적으로 적용할 수도 있다. 예를 들면, 인트라 예측 모드별로 소정 크기 이하의 예측 단위에 대해서는 필터를 적용하지 않을 수도 있다.In the DC mode, since the prediction block is made of an average value of reference pixels, a step may occur between reference pixels and pixels in an adjacent prediction block. Accordingly, pixels on the upper line and pixels on the left line in the prediction block adjacent to the reference pixels are filtered using the reference pixels. Specifically, since the pixel located in the upper-left corner in the prediction block has two adjacent reference pixels (the upper reference pixel and the left reference pixel), the pixel in the upper-left corner is filtered (or smoothed) using a 3-tap filter. )do. And, since the pixels other than those (ie, pixels on the upper line and pixels on the left line in the prediction block) have only one reference pixel, they are filtered using a 2-tap filter. In order to compensate for the step difference, some pixels of the prediction block are adaptively filtered even for a directional mode other than DC. Meanwhile, it may be adaptively applied 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 less for each intra prediction mode.

예측모드 결정부(153)는 참조 화소들을 이용하여 현재 예측 단위의 인트라 예측 모드를 결정한다. 예측모드 결정부(153)는 각 인트라 예측 모드에 대한 잔차블록의 부호화량이 최소가 되는 모드를 현재 예측 단위의 인트라 예측 모드로 결정할 수 있다. 잔차 블록을 구하기 위해 각 인트라 예측 모드에 따라 예측 블록을 생성한다. 상기 예측 블록은 각 인트라 예측 모드에 따라 참조화소 필터링부에 의해 필터링된 화소를 이용한 예측블록 또는 상기 생선된 예측블록을 소정의 조건에 따라 예측블록 필터링부(155)에서 필터링한 예측블록일 수 있다. The prediction mode determiner 153 determines the intra prediction mode of the current prediction unit by using the reference pixels. The prediction mode determiner 153 may determine a mode in which the encoding amount of the residual block for each intra prediction mode is minimized as the intra prediction mode of the current prediction unit. To obtain a residual block, a prediction block is generated according to each intra prediction mode. 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 obtained by filtering the generated prediction block by the prediction block filtering unit 155 according to a predetermined condition. .

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

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

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

먼저, 현재 예측 단위의 상측 및 좌측 인트라 예측 모드를 유도한다. 현재 예측 단위의 상측 예측 단위가 복수개 존재하는 경우에는 미리 정해진 방향(예를 들어, 우→좌)으로 스캔하면서 유효한 첫번째 예측 단위의 인트라 예측 모드를 상측 인트라 예측 모드로 설정한다. 현재 예측 단위의 좌측 예측 단위가 복수개 존재하는 경우에도 미리 정해진 방향(예를 들어, 하→상)으로 스캔하면서 유효한 첫번째 예측 단위의 인트라 예측 모드를 좌측 인트라 예측 모드로 설정할 수 있다. 또는 복수개의 유효한 예측 단위들의 모드번호들 중 가장 작은 모드번호를 상측 인트라 예측 모드로 설정할 수도 있다.First, 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 as the upper intra prediction mode while scanning in a predetermined direction (eg, right to left). Even when there are a plurality of left prediction units of the current prediction unit, the intra prediction mode of the first effective prediction unit may be set as the left intra prediction mode while scanning in a predetermined direction (eg, from bottom to top). Alternatively, the smallest mode number among the mode numbers of the plurality of valid prediction units may be set as the upper intra prediction mode.

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

다음으로, 상기 상측 또는 좌측 인트라 예측 모드가 번호가 현재 예측 단위에서 허용되는 인트라 예측 모드의 수보다 크거나 같으면 상기 상측 또는 좌측 인트라 예측 모드를 미리 정해진 개수의 인트라 예측 모드들 중 하나로 변환한다. 상기 미리 정해진 개수는 현재 예측 단위의 크기에 달라 달라진다. 예를 들어, 현재 예측 단위의 크기가 4x4이면 9개의 모드들(0~8번 모드) 중 하나로 매핑하고, 현재 예측 단위의 크기가 64x64이면 3개의 모드들(0~2번 모드) 중 하나로 매핑한다. 또한, 현재 예측 단위에서 허용된 인트라 예측 모드들 중 하나로 변환할 수도 있다. Next, if the number of the upper or left intra prediction mode is greater than or equal to 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 depending on 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), and if the size of the current prediction unit is 64x64, it is mapped to one of three modes (modes 0 to 2). do. Also, it may be converted into one of 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 sameness and a flag indicating any 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 may be transmitted. In addition, even if only one of the upper and left intra prediction modes is valid and is the same as the intra prediction mode of the current block, only a flag indicating the same as the mode of the adjacent block may 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 is compared with the left and upper intra prediction mode numbers. The number of cases not greater than the intra prediction mode number of the current prediction unit among the left and upper intra prediction mode numbers is calculated, and the value obtained by reducing the intra prediction mode number of the current prediction unit by the number of cases is the last of the current prediction unit to be transmitted. Determined in intra prediction mode. Here, when the left and upper intra prediction mode numbers are the same, it is 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 illustrating the intra prediction unit 250 of the decoding apparatus 200 according to the present invention.

본 발명에 따른 인트라 예측부(250)는 예측모드 복호화부(251), 참조화소 생성부(252), 참조화소 필터링부(253), 예측블록 생성부(254), 예측블록 필터링부(255) 및 예측 블록 송신부(256)를 포함한다.The intra prediction 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 , and a prediction block filtering unit 255 . and a prediction block transmitter 256 .

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

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

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

다음으로, 수신된 예측 가능 플래그가 인접 예측 단위의 인트라 예측 모드와 동일함을 나타내면, 상기 예측 모드 후보자 인덱스가 존재하면, 상기 예측 모드 후보자 인덱스가 나타내는 예측 모드를 현재 예측 단위의 인트라 예측 모드로 결정한다. Next, if the received predictable flag indicates 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 received predictable flag indicates the same as the intra prediction mode of the neighboring prediction unit, but the prediction mode candidate index does not exist and there is one valid intra prediction mode of the neighboring prediction unit, this is the intra prediction of the current prediction unit. restore mode.

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

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

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

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

예측블록 필터링부(255)는 예측모드 복호화부(251)에 의해 복원된 인트라 예측 모드에 따라 적응적으로 필터링한다. 상기 동작은 부호화 장치(100)의 예측블록 필터링부(154)와 동일하다. The prediction block filtering unit 255 adaptively filters according to the intra prediction mode reconstructed 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 transmitter 256 transmits the prediction block received from the prediction mode generator 254 or the prediction block filtering unit 255 to the adder 290 .

Claims (2)

변환 단위의 크기에 따라 결정되는 변환 매트릭스를 이용하여 상기 잔차 신호를 변환하여 변환 블록을 생성하는 변환부;
양자화 스텝 사이즈를 이용하여 상기 변환 블록을 양자화하여 양자화 블록을 생성하는 양자화부;
상기 양자화 블록의 계수들을 스캔하여 1차원의 양자화 계수정보를 생성하는 스캐닝부;
복수 개의 인트라 예측 모드 중에서 선택된 인트라 예측 모드에 대응하는 예측 블록을 생성하는 인트라 예측부; 및
상기 1차원의 양자화 계수정보들을 엔트로피 부호화하는 엔트로피 부호화부;를 포함하고,
상기 인트라 예측부는 예측 단위의 크기에 따라 적응적으로 참조화소를 필터링하되, 상기 예측 단위의 크기가 사전에 설정된 크기보다 크면 상기 예측 블록의 인트라 예측 모드와 관계없이 참조화소에 필터를 적용하지 않는 것을 특징으로 하는 영상 부호화 장치.
a transform unit that transforms the residual signal using a transform matrix determined according to a size of a transform unit to generate a transform block;
a quantization unit that quantizes the transform block using a quantization step size to generate a quantized block;
a scanning unit that scans the coefficients of the quantization block to generate one-dimensional quantization coefficient information;
an intra prediction unit generating a prediction block corresponding to an intra prediction mode selected from among a plurality of intra prediction modes; and
and an entropy encoding unit for entropy encoding the one-dimensional quantization coefficient information.
The intra prediction unit adaptively filters the reference pixel according to the size of the prediction unit, but if the size of the prediction unit is larger than the preset size, the filter is not applied to the reference pixel regardless of the intra prediction mode of the prediction block A video encoding apparatus characterized in that.
제 1항에 있어서,
상기 사전에 설정된 크기는 64×64인 것을 특징으로 하는 영상 부호화 장치.
The method of claim 1,
The video encoding apparatus, characterized in that the preset size is 64×64.
KR1020190074905A 2010-07-31 2019-06-24 Apparatus for encoding an image KR102329705B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210158430A KR20210145091A (en) 2010-07-31 2021-11-17 Apparatus for encoding an image

Applications Claiming Priority (3)

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

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

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020210158430A Division KR20210145091A (en) 2010-07-31 2021-11-17 Apparatus for encoding an image

Publications (2)

Publication Number Publication Date
KR20190083318A KR20190083318A (en) 2019-07-11
KR102329705B1 true KR102329705B1 (en) 2021-11-22

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 (6)

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

Family Applications After (1)

Application Number Title Priority Date Filing Date
KR1020210158430A KR20210145091A (en) 2010-07-31 2021-11-17 Apparatus for encoding an image

Country Status (1)

Country Link
KR (8) KR20130091717A (en)

Families Citing this family (3)

* 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
KR20230107907A (en) * 2018-06-29 2023-07-18 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Extended reference intra-picture prediction
KR102257698B1 (en) 2020-10-28 2021-05-31 이정민 Building cooling and heating system

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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
J. Sole, et. al., "Unified scans for the significance map and coefficient level coding in high coding efficienty", JCTVC-E335, 23, March, 2011.*
T. Wiegand, "WD3: Working Draft 3 of High Efficiency Video Coding", JCTVC-E603, 23 March, 2011..*

Also Published As

Publication number Publication date
KR101474984B1 (en) 2014-12-24
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
KR20140057514A (en) 2014-05-13
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
KR102322188B1 (en) Apparatus for decoding a moving picture
KR20210145091A (en) Apparatus for encoding an image
KR20170034799A (en) Apparatus for decoding an image
KR20170034354A (en) Apparatus for decoding an image
KR20170034355A (en) Apparatus for decoding an image

Legal Events

Date Code Title Description
A107 Divisional application of patent
A201 Request for examination
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
X091 Application refused [patent]
AMND Amendment
X701 Decision to grant (after re-examination)
A107 Divisional application of patent
GRNT Written decision to grant