KR20220002207A - Method and apparatus for prediction of residual signal - Google Patents

Method and apparatus for prediction of residual signal Download PDF

Info

Publication number
KR20220002207A
KR20220002207A KR1020210188136A KR20210188136A KR20220002207A KR 20220002207 A KR20220002207 A KR 20220002207A KR 1020210188136 A KR1020210188136 A KR 1020210188136A KR 20210188136 A KR20210188136 A KR 20210188136A KR 20220002207 A KR20220002207 A KR 20220002207A
Authority
KR
South Korea
Prior art keywords
block
prediction
residual signal
current block
intra
Prior art date
Application number
KR1020210188136A
Other languages
Korean (ko)
Other versions
KR102448084B1 (en
Inventor
전동산
강정원
고현석
이진호
임성창
김휘용
최진수
Original Assignee
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원 filed Critical 한국전자통신연구원
Priority to KR1020210188136A priority Critical patent/KR102448084B1/en
Publication of KR20220002207A publication Critical patent/KR20220002207A/en
Priority to KR1020220120195A priority patent/KR102558803B1/en
Application granted granted Critical
Publication of KR102448084B1 publication Critical patent/KR102448084B1/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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • 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/46Embedding additional information in the video signal during the compression process

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Disclosed are a method and device for performing prediction on a residual signal. An encoding method and an encoding device generate a predicted residual signal by performing additional prediction using a residual signal of a neighboring block on a residual signal of a current block. A decoding method and a decoding device use a residual signal of an already reconstructed neighboring block in generating a reconstructed block of the current block. In encoding and decoding, before generation of a prediction block, a value of a prediction sample used to generate a prediction block may be updated. Efficiency of encoding may be improved through prediction of a residual signal and updating of a prediction sample.

Description

잔차 신호에 대한 예측 방법 및 장치{METHOD AND APPARATUS FOR PREDICTION OF RESIDUAL SIGNAL}Prediction method and apparatus for residual signal

아래의 실시예들은 영상의 복호화 방법, 복호화 장치, 부호화 방법 및 부호화 장치에 관한 것으로서, 보다 상세하게는 잔차 신호를 예측하는 방법 및 장치에 관한 것이다.The following embodiments relate to an image decoding method, a decoding apparatus, an encoding method, and an encoding apparatus, and more particularly, to a method and an apparatus for predicting a residual signal.

정보 통신 산업의 지속적인 발달을 통해 HD(High Definition) 해상도를 가지는 방송 서비스가 세계적으로 확산되었다. 이러한 확산을 통해, 많은 사용자들이 고해상도이며 고화질인 영상(image)에 익숙해지게 되었다.With the continuous development of the information and communication industry, a broadcasting service having a high definition (HD) resolution has spread worldwide. Through this proliferation, many users have become accustomed to high-resolution and high-definition images.

높은 화질에 사용자들의 대한 수요를 만족시키기 위하여, 많은 기관들이 차세대 영상 기기에 대한 개발에 박차를 가하고 있다. 에이치디티브이(High Definition TV; HDTV) 및 풀에이티디(Full HD; FHD) TV뿐만 아니라, FHD TV에 비해 4배 이상의 해상도를 갖는 울트라에이치디(Ultra High Definition; UHD) TV에 대한 사용자들의 관심이 증대하였고, 이러한 관심의 증대에 따라, 더 높은 해상도 및 화질을 갖는 영상에 대한 영상 부호화(encoding)/복호화(decoding) 기술이 요구된다.In order to satisfy the demand of users for high picture quality, many organizations are spurring the development of next-generation imaging devices. High definition TV (HDTV) and Full HD (FHD) TVs, as well as Ultra High Definition (UHD) TVs having a resolution four times higher than that of FHD TVs Interest has increased, and with this increase in interest, image encoding/decoding technology for an image having higher resolution and image quality is required.

영상 부호화(encoding)/복호화(decoding) 장치 및 방법은 고해상도 및 고화질의 영상에 대한 부호화/복호화를 수행하기 위해, 인터(inter) 예측(prediction) 기술, 인트라(intra) 예측 기술 및 엔트로피 부호화 기술 등을 사용할 수 있다. 인터 예측 기술은 시간적으로(temporally) 이전의 픽처 및/또는 시간적으로 이후의 픽처를 이용하여 현재 픽처에 포함된 픽셀의 값을 예측하는 기술일 수 있다. 인트라 예측 기술은 현재 픽처 내의 픽셀의 정보를 이용하여 현재 픽처에 포함된 픽셀의 값을 예측하는 기술일 수 있다. 엔트로피 부호화 기술은 출현 빈도가 높은 심볼에는 짧은 코드(code)를 할당하고, 출현 빈도가 낮은 심볼에는 긴 코드를 할당하는 기술일 수 있다.An apparatus and method for encoding/decoding an image include an inter prediction technology, an intra prediction technology, an entropy encoding technology, etc. to perform encoding/decoding on a high-resolution and high-definition image. can be used The inter prediction technique may be a technique of predicting a value of a pixel included in a current picture using a temporally previous picture and/or a temporally later picture. The intra prediction technique may be a technique of predicting a value of a pixel included in the current picture by using information on the pixel in the current picture. The entropy encoding technique may be a technique of allocating a short code to a symbol having a high frequency of occurrence and a technique of assigning a long code to a symbol having a low frequency of occurrence.

영상의 부호화 및 복호화에 있어서, 예측은 원본 신호와 유사한 예측 신호를 생성하는 것을 의미할 수 있다. 예측은 크게 공간적(spatial) 복원(reconstructed) 영상을 참조하는 예측, 시간적(temporal) 복원 영상을 참조하는 예측 및 그 밖의 심볼에 대한 예측으로 분류될 수 있다.In encoding and decoding of an image, prediction may mean generating a prediction signal similar to an original signal. Prediction may be largely classified into prediction referring to a spatially reconstructed image, prediction referring to a temporally reconstructed image, and prediction of other symbols.

인트라 예측은 공간적 참조만을 허용하는 예측 기술일 수 있다. 현재 블록은 현재 부호화의 대상인 블록일 수 있다. 인트라 예측은 현재 블록의 주변에 이미 복원된 참조 샘플들을 참조함으로써 현재 블록을 예측하는 방법일 수 있다.Intra prediction may be a prediction technique that allows only spatial reference. The current block may be a block to be currently encoded. Intra prediction may be a method of predicting the current block by referring to reference samples already reconstructed around the current block.

인트라 예측에 있어서, 주변의 참조 샘플은 원 영상에서의 밝기 값이 아닌 예측 및 복원된 밝기 값일 수 있으며, 후처리(post-processing) 필터링(filtering)이 적용되기 이전의 값일 수 있다. 참조 샘플은 이전에 부호화되고, 복원되었기 때문에, 부호화기(encoder) 및 복호화기(decoder)에서 현재 블록의 예측을 위해 사용할 수 있다.In intra prediction, a neighboring reference sample may be a predicted and reconstructed brightness value rather than a brightness value in the original image, and may be a value before post-processing filtering is applied. Since the reference sample has been previously encoded and reconstructed, it can be used for prediction of the current block by an encoder and a decoder.

그러나, 개념적으로, 인트라 예측은 주변의 참조 신호에 대해 연속성(continuity)을 가진 평탄한(flat) 영역과 일정한 방향성(directionality)을 가진 영역에서만 효과적일 수 있다. 이러한 영상 내 특성이 없는 영역에 대해서는, 인트라 예측의 부호화 효율(efficiency)의 효율은 인터 예측의 부호화 효율에 비해 상당히 떨어질 수 있다. 특히, 영상 부호화 시, 첫 번째 픽처는 인트라 예측으로만 부호화가 되어야 할 수 있고, 임의 접근(random access)과 에러 강인성(error robustness)을 위해 인트라 예측으로만 픽처가 부호화되어야 할 수 있다. 따라서, 인트라 예측의 부호화의 효율을 향상시킬 수 있는 방법이 요구된다.However, conceptually, intra prediction may be effective only in a flat region having continuity with respect to a neighboring reference signal and a region having constant directionality. For a region having no such characteristics in an image, the efficiency of intra prediction encoding efficiency may be significantly lower than that of inter prediction encoding efficiency. In particular, when encoding an image, the first picture may have to be encoded only by intra prediction, and the picture may need to be encoded only by intra prediction for random access and error robustness. Accordingly, there is a need for a method capable of improving the encoding efficiency of intra prediction.

일 실시예는 인트라 부호화의 효율을 향상시키기 위해, 인트라 예측에 사용되는 참조 샘플을 부호화의 대상인 현재 블록에 가능한 가깝도록 갱신하는 방법 및 장치를 제공할 수 있다.An embodiment may provide a method and apparatus for updating a reference sample used for intra prediction to be as close as possible to a current block to be encoded in order to improve intra-encoding efficiency.

일 실시예는 이미 부호화 또는 복호화가 완료된 주변 블록의 잔차 신호를 사용하여 현재 블록의 잔차 신호를 예측하는 방법 및 장치를 제공할 수 있다.An embodiment may provide a method and apparatus for predicting a residual signal of a current block using a residual signal of a neighboring block that has already been encoded or decoded.

일 측에 있어서, 영상의 부호화 방법에 있어서, 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 상기 현재 블록의 제1 잔차 신호를 생성하는 단계; 및 상기 현재 블록의 제1 잔차 신호를 사용하여 상기 현재 블록의 부호화를 수행하는 단계를 포함하는 영상의 부호화 방법이 제공된다.In one aspect, an image encoding method comprising: generating a first residual signal of a current block based on a residual signal of a first neighboring block of the current block; and performing encoding of the current block using a first residual signal of the current block.

상기 영상의 부호화 방법은, 상기 현재 블록의 제2 잔차 신호를 생성하는 단계를 더 포함할 수 있다.The video encoding method may further include generating a second residual signal of the current block.

상기 제2 잔차 신호는 상기 현재 블록 및 상기 현재 블록의 예측 블록 간의 차이일 수 있다.The second residual signal may be a difference between the current block and a prediction block of the current block.

상기 제1 잔차 신호는 상기 제2 잔차 신호 및 상기 주변 블록의 잔차 신호에 기반하여 생성될 수 있다.The first residual signal may be generated based on the second residual signal and a residual signal of the neighboring block.

상기 제1 잔차 신호는 상기 제2 잔차 신호 및 상기 제1 주변 블록의 잔차 신호 간의 차이에 기반하여 생성될 수 있다.The first residual signal may be generated based on a difference between the second residual signal and a residual signal of the first neighboring block.

상기 제1 잔차 신호는 상기 제2 잔차 신호 및 상기 제1 주변 블록의 잔차 신호의 차이일 수 있다.The first residual signal may be a difference between the second residual signal and a residual signal of the first neighboring block.

상기 영상의 부호화 방법은, 잔차 신호 예측의 수행의 여부를 결정하는 단계를 더 포함할 수 있다.The video encoding method may further include determining whether to perform residual signal prediction.

상기 생성하는 단계는 상기 잔차 신호 예측이 수행되는 것으로 결정된 경우 수행될 수 있다.The generating may be performed when it is determined that the residual signal prediction is to be performed.

상기 영상의 부호화 방법은, 상기 잔차 신호 예측의 수행의 여부를 나타내는 정보를 부호화하는 단계를 더 포함할 수 있다.The video encoding method may further include encoding information indicating whether the residual signal prediction is performed.

상기 부호화 방법은, 상기 제1 주변 블록의 식별자를 부호화하는 단계를 더 포함할 수 있다.The encoding method may further include encoding the identifier of the first neighboring block.

다른 일 측에 있어서, 영상의 복호화 방법에 있어서, 현재 블록의 예측 블록을 생성하는 단계; 및 상기 예측 블록, 상기 현재 블록의 잔차 신호 및 상기 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 상기 현재 블록의 복원 블록을 생성하는 단계를 포함하는 영상의 복호화 방법이 제공된다.In another aspect, there is provided a method of decoding an image, the method comprising: generating a prediction block of a current block; and generating a reconstructed block of the current block based on the prediction block, a residual signal of the current block, and a residual signal of a first neighboring block of the current block.

상기 복원 블록은 상기 현재 블록의 잔차 신호 및 상기 제1 주변 블록의 잔차 신호의 합에 기반하여 생성될 수 있다.The reconstruction block may be generated based on a sum of the residual signal of the current block and the residual signal of the first neighboring block.

상기 복원 블록은 상기 현재 블록의 예측 블록, 상기 현재 블록의 잔차 신호 및 상기 제1 주변 블록의 잔차 신호의 합일 수 있다.The reconstruction block may be a sum of a prediction block of the current block, a residual signal of the current block, and a residual signal of the first neighboring block.

상기 영상의 복호화 방법은, 상기 현재 블록의 잔차 신호를 생성하는 단계를 더 포함할 수 있다.The image decoding method may further include generating a residual signal of the current block.

상기 영상의 복호화 방법은, 상기 제1 주변 블록을 식별하는 단계를 더 포함할 수 있다.The method of decoding the image may further include identifying the first neighboring block.

상기 제1 주변 블록은 상기 제1 주변 블록의 식별자에 의해 식별될 수 있다.The first neighboring block may be identified by the identifier of the first neighboring block.

상기 제1 주변 블록의 식별자가 존재하지 않는 경우, 기정의된 방식에 따라서 선택된 블록이 상기 제1 주변 블록으로 식별될 수 있다.When the identifier of the first neighboring block does not exist, the selected block may be identified as the first neighboring block according to a predefined method.

상기 영상의 복호화 방법은, 상기 예측 블록을 생성하기 위해 사용되는 참조 샘플의 값을 갱신하는 단계를 더 포함할 수 있다.The image decoding method may further include updating a value of a reference sample used to generate the prediction block.

또 다른 일 측에 있어서, 영상의 복호화 방법에 있어서, 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정하는 단계; 및 상기 참조 샘플을 사용하여 상기 현재 블록의 예측 블록을 생성하는 단계를 포함하는 영상의 복호화 방법이 제공된다.In still another aspect, there is provided a method of decoding an image, the method comprising: determining a value of a reference sample based on a neighboring block of a current block; and generating a prediction block of the current block by using the reference sample.

상기 참조 샘플의 값은 상기 주변 블록의 경사 패턴에 기반하여 결정될 수 있다.The value of the reference sample may be determined based on the gradient pattern of the neighboring block.

상기 경사 패턴이 대칭인 경우, 상기 참조 샘플의 값은 상기 경사 패턴의 대칭을 이루는 2개의 라인들의 경사도 값에 기반하여 결정될 수 있다.When the gradient pattern is symmetrical, the value of the reference sample may be determined based on gradient values of two lines that form symmetry of the gradient pattern.

상기 참조 샘플의 값은 상기 주변 블록의 하나의 행에 속하는 복수의 참조 샘플들 중 인접한 2개의 참조 샘플들 간의 경사도 값에 기반하여 결정될 수 있다.The value of the reference sample may be determined based on a gradient value between two adjacent reference samples among a plurality of reference samples belonging to one row of the neighboring block.

상기 결정하는 단계에서, 상기 참조 샘플의 값은 갱신 전의 값으로부터 상기 갱신 후의 값으로 변경될 수 있다.In the determining, the value of the reference sample may be changed from a value before the update to a value after the update.

상기 갱신 전의 값은 상기 참조 샘플을 포함하는 블록이 예측 및 복원됨에 따라 생성된 값일 수 있다.The value before the update may be a value generated as the block including the reference sample is predicted and reconstructed.

상기 현재 블록에 대한 인트라 예측 모드가 수평 예측 모드인 경우, 상기 참조 샘플은 상기 현재 블록의 좌측에 인접한 샘플이고, 상기 주변 블록은 상기 현재 블록의 상단 인접 블록 및 상기 현재 블록의 좌측 상단 인접 블록을 합한 블록일 수 있다.When the intra prediction mode for the current block is a horizontal prediction mode, the reference sample is a sample adjacent to the left of the current block, and the adjacent block is an upper-left adjacent block of the current block and an upper-left adjacent block of the current block. It may be a combined block.

또 다른 일 측에 있어서, 영상의 부호화 방법에 있어서, 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정하는 단계; 및 상기 참조 샘플을 사용하여 상기 현재 블록의 예측 블록을 생성하는 단계를 포함하는 영상의 부호화 방법이 제공된다.In still another aspect, there is provided a method for encoding an image, the method comprising: determining a value of a reference sample based on blocks adjacent to a current block; and generating a prediction block of the current block by using the reference sample.

인트라 부호화의 효율을 향상시키기 위해, 인트라 예측에 사용되는 참조 샘플을 부호화의 대상인 현재 블록에 가능한 가깝도록 갱신하는 방법 및 장치가 제공된다.In order to improve the efficiency of intra encoding, a method and apparatus for updating a reference sample used for intra prediction to be as close as possible to a current block to be encoded are provided.

이미 부호화 또는 복호화가 완료된 주변 블록의 잔차 신호를 사용하여 현재 블록의 잔차 신호를 예측하는 방법 및 장치가 제공된다.A method and apparatus for predicting a residual signal of a current block by using a residual signal of an already encoded or decoded neighboring block are provided.

도 1은 본 발명이 적용되는 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 2는 본 발명이 적용되는 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 3은 영상을 부호화 및 복호화할 때의 영상의 분할 구조를 개략적으로 나타내는 도면이다.
도 4a 내지 도 7h는 코딩 유닛(CU)이 포함할 수 있는 예측 유닛(PU)의 형태를 도시한 도면이다.
도 5는 코딩 유닛(CU)에 포함될 수 있는 변환 유닛(TU)의 형태를 도시한 도면이다.
도 6은 인트라 예측 과정의 실시예를 설명하기 위한 도면이다.
도 7은 인터 예측 과정의 실시예를 설명하기 위한 도면이다.
도 8은 일 실시예에 따른 부호화 장치의 구조도이다.
도 9a 및 도 9b는 일 실시예에 따른 부호화 방법의 흐름도이다.
도 10a는 일 실시예에 따른 부호화 방법의 흐름도이다.
도 10b는 일 실시예에 따른 참조 샘플의 갱신 방법의 흐름도이다.
도 10c는 일 실시예에 따른 잔차 신호의 예측 방법의 흐름도이다.
도 10d는 일 실시예에 따른 현재 블록의 부호화 방법의 흐름도이다.
도 11은 일 예에 따른 현재 블록 및 참조 샘플을 도시한다.
도 12는 일 예에 따른 주변 블록의 수평 방향의 경사도를 반영하여 참조 샘플을 갱신하는 방법을 나타낸다.
도 13은 일 예에 따른 경사 패턴을 구하는 방법을 설명한다.
도 14는 일 예에 따른 주변 블록의 수직 방향의 경사도를 반영하여 참조 샘플을 갱신하는 방법을 나타낸다.
도 15a는 일 예에 따른 33개의 각 모드들을 갖는 인트라 예측을 나타낸다.
도 15b는 일 예에 따른 65개의 각 모드들을 갖는 인트라 예측을 나타낸다.
도 16은 일 예에 따른 영상의 영역을 도시한다.
도 17은 일 예에 따른 주변 블록의 잔차 신호의 계산 방법을 설명한다.
도 18은 일 예에 따른 현재 블록의 잔차 신호의 계산 방법을 설명한다.
도 19는 일 예에 따른 잔차 신호 예측 방법을 설명한다.
도 20a는 일 예에 따른 디폴트 잔차 신호를 예시한다.
도 20b는 일 예에 따른 디폴트 잔차 신호에 대한 이산 여현 변환의 결과를 도시한다.
도 21a는 일 예에 따른 제안된 잔차 신호를 예시한다.
도 21b는 일 예에 따른 제안된 잔차 신호에 대한 이산 여현 변환의 결과를 도시한다.
도 22는 일 예에 따른 주변 블록의 위치를 설명한다.
도 23은 일 실시예에 따른 복호화 장치의 구조도이다.
도 24a 및 도 24b는 일 실시예에 따른 복호화 방법의 흐름도이다.
도 25a는 일 실시예에 따른 잔차 신호 생성 방법의 흐름도이다.
도 25b는 일 실시예에 따른 잔치 신호를 사용하는 현재 블록의 복호화 방법의 흐름도이다.
도 25c는 일 실시예에 따른 예측 블록 생성 방법의 흐름도이다.
도 25d는 일 실시예에 따른 복원 블록 생성 방법의 흐름도이다.
도 26은 일 실시예에 따른 부호화 장치를 구현하는 전자 장치의 구조도이다.
도 27은 일 실시예에 따른 복호화 장치를 구현하는 전자 장치의 구조도이다.
1 is a block diagram illustrating a configuration of an encoding apparatus to which the present invention is applied according to an embodiment.
2 is a block diagram illustrating a configuration of a decoding apparatus to which the present invention is applied according to an embodiment.
3 is a diagram schematically illustrating a structure of an image segmentation when an image is encoded and decoded.
4A to 7H are diagrams illustrating a form of a prediction unit (PU) that a coding unit (CU) may include.
5 is a diagram illustrating a form of a transform unit (TU) that may be included in a coding unit (CU).
6 is a diagram for explaining an embodiment of an intra prediction process.
7 is a diagram for explaining an embodiment of an inter prediction process.
8 is a structural diagram of an encoding apparatus according to an embodiment.
9A and 9B are flowcharts of an encoding method according to an embodiment.
10A is a flowchart of an encoding method according to an embodiment.
10B is a flowchart of a method for updating a reference sample according to an embodiment.
10C is a flowchart of a method for predicting a residual signal according to an embodiment.
10D is a flowchart of a method for encoding a current block according to an embodiment.
11 illustrates a current block and a reference sample according to an example.
12 illustrates a method of updating a reference sample by reflecting a horizontal gradient of a neighboring block according to an example.
13 illustrates a method of obtaining a gradient pattern according to an example.
14 illustrates a method of updating a reference sample by reflecting a vertical gradient of a neighboring block according to an example.
15A shows intra prediction with 33 respective modes according to an example.
15B shows intra prediction with 65 respective modes according to an example.
16 illustrates a region of an image according to an example.
17 illustrates a method of calculating a residual signal of a neighboring block according to an example.
18 illustrates a method of calculating a residual signal of a current block according to an example.
19 illustrates a residual signal prediction method according to an example.
20A illustrates a default residual signal according to an example.
20B illustrates a result of a discrete cosine transform on a default residual signal according to an example.
21A illustrates a proposed residual signal according to an example.
21B shows the result of discrete cosine transform on the proposed residual signal according to an example.
22 illustrates a location of a neighboring block according to an example.
23 is a structural diagram of a decoding apparatus according to an embodiment.
24A and 24B are flowcharts of a decoding method according to an embodiment.
25A is a flowchart of a method for generating a residual signal according to an embodiment.
25B is a flowchart of a method of decoding a current block using a feast signal according to an embodiment.
25C is a flowchart of a method for generating a prediction block according to an embodiment.
25D is a flowchart of a method for generating a reconstructed block according to an embodiment.
26 is a structural diagram of an electronic device implementing an encoding device according to an embodiment.
27 is a structural diagram of an electronic device implementing a decoding device according to an embodiment.

후술하는 예시적 실시예들에 대한 상세한 설명은, 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이들 실시예는 당업자가 실시예를 실시할 수 있기에 충분하도록 상세히 설명된다. 다양한 실시예들은 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 여기에 기재되어 있는 특정 형상, 구조 및 특성은 일 실시예에 관련하여 본 발명의 정신 및 범위를 벗어나지 않으면서 다른 실시예로 구현될 수 있다. 또한, 각각의 개시된 실시예 내의 개별 구성요소의 위치 또는 배치는 실시예의 정신 및 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 취하려는 것이 아니며, 예시적 실시예들의 범위는, 적절하게 설명된다면, 그 청구항들이 주장하는 것과 균등한 모든 범위와 더불어 첨부된 청구항에 의해서만 한정된다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [0010] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [0010] Reference is made to the accompanying drawings, which illustrate specific embodiments by way of example. These embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that various embodiments are different, but need not be mutually exclusive. For example, certain shapes, structures, and characteristics described herein with respect to one embodiment may be implemented in other embodiments without departing from the spirit and scope of the invention. In addition, it should be understood that the location or arrangement of individual components within each disclosed embodiment may be changed without departing from the spirit and scope of the embodiment. Accordingly, the detailed description set forth below is not intended to be taken in a limiting sense, and the scope of exemplary embodiments, if properly described, is limited only by the appended claims, along with all scope equivalents to those as claimed.

도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 기능을 지칭한다. 도면에서의 요소들의 형상 및 크기 등은 보다 명확한 설명을 위해 과장될 수 있다.Like reference numerals in the drawings refer to the same or similar functions throughout the various aspects. The shapes and sizes of elements in the drawings may be exaggerated for clearer description.

어떤 구성요소(component)가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 상기의 2개의 구성요소들이 서로 간에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 상기의 2개의 구성요소들의 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 또한, 예시적 실시예들에서 특정 구성을 "포함"한다고 기술하는 내용은 상기의 특정 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 예시적 실시예들의 실시 또는 예시적 실시예들의 기술적 사상의 범위에 포함될 수 있음을 의미한다.When a component is referred to as being “connected” or “connected” to another component, the two components may be directly connected or connected to each other, but in the above 2 It should be understood that other components may exist in the middle of the components. In addition, the description of "including" a specific configuration in the exemplary embodiments does not exclude components other than the above specific configuration, and additional configuration is the implementation of the exemplary embodiments or the technical spirit of the exemplary embodiments. It means that it can be included in the scope.

제1 및 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기의 구성요소들은 상기의 용어들에 의해 한정되어서는 안 된다. 상기의 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하여 지칭하기 위해서 사용된다. 예를 들어, 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.Terms such as first and second may be used to describe various components, but the above components should not be limited by the above terms. The above terms are used to distinguish one component from another component. For example, without departing from the scope of rights, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.

또한 실시예들에 나타나는 구성요소들은 서로 다른 특징적인 기능들을 나타내기 위해 독립적으로 도시되는 것으로, 각 구성요소가 분리된 하드웨어나 하나의 소프트웨어 구성 단위로만 이루어짐을 의미하지 않는다. 즉, 각 구성요소는 설명의 편의상 각각의 구성요소로 나열된 것이다. 예를 들면, 구성요소들 중 적어도 두 개의 구성요소들이 하나의 구성요소로 합쳐질 수 있다. 또한, 하나의 구성요소가 복수의 구성요소들로 나뉠 수 있다. 이러한 각 구성요소의 통합된 실시예 및 분리된 실시예 또한 본질에서 벗어나지 않는 한 권리범위에 포함된다.In addition, the components shown in the embodiments are shown independently to represent different characteristic functions, and it does not mean that each component is made of separate hardware or only one software component unit. That is, each component is listed as each component for convenience of description. For example, at least two components among the components may be combined into one component. Also, one component may be divided into a plurality of components. Integrated embodiments and separate embodiments of each of these components are also included in the scope of rights without departing from the essence.

또한, 일부의 구성요소는 본질적인 기능을 수행하는 필수적인 구성요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성요소일 수 있다. 실시예들은 실시예의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 예를 들면, 단지 성능 향상을 위해 사용되는 구성요소와 같은, 선택적 구성요소가 제외된 구조 또한 권리 범위에 포함된다.In addition, some of the components are not essential components to perform essential functions, but may be optional components only to improve performance. Embodiments may be implemented including only components essential for implementing the essence of the embodiment, and for example, structures in which optional components are excluded, such as components used only for performance improvement, are also included in the scope of rights.

이하에서는, 기술분야에서 통상의 지식을 가진 자가 실시예들을 용이하게 실시할 수 있도록 하기 위하여, 첨부된 도면을 참조하여 실시예들을 상세히 설명하기로 한다. 실시예들을 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings in order to enable those of ordinary skill in the art to easily implement the embodiments. In describing the embodiments, if it is determined that a detailed description of a related known configuration or function may obscure the gist of the present specification, the detailed description thereof will be omitted.

이하에서, 영상은 동영상(video)을 구성하는 하나의 픽처를 의미할 수 있으며, 동영상 자체를 나타낼 수도 있다. 예를 들면, "영상의 부호화 및/또는 복호화"는 "비디오의 부호화 및/또는 복호화"를 의미할 수 있으며, "비디오를 구성하는 영상들 중 하나의 영상의 부호화 및/또는 복호화"를 의미할 수도 있다.Hereinafter, an image may mean one picture constituting a video, or may indicate a video itself. For example, "encoding and/or decoding of an image" may mean "encoding and/or decoding of a video", and may mean "encoding and/or decoding of one image among images constituting a video". may be

우선, 실시예들에서 사용되는 용어를 설명한다.First, terms used in the embodiments will be described.

유닛(unit): 영상의 부호화 및 복호화에 있어서, 유닛은 하나의 영상의 분할에 의해 생성된 영역일 수 있다. 하나의 영상은 복수의 유닛들로 분할될 수 있다. 영상의 부호화 및 복호화에 있어서, 유닛 별로 기정의된 처리가 수행될 수 있다. 기능에 따라서, 블록, 매크로(macro) 블록, 코딩 유닛(Coding Unit; CU), 예측 유닛(Prediction Unit; PU) 및 변환 유닛(transform Unit; TU) 등의 유닛이 사용된다. 하나의 유닛은 유닛에 비해 더 작은 크기를 갖는 하위 유닛으로 더 분할될 수 있다.Unit: In encoding and decoding of an image, a unit may be an area generated by segmentation of one image. One image may be divided into a plurality of units. In encoding and decoding of an image, a predefined process may be performed for each unit. Depending on the function, units such as a block, a macro block, a coding unit (CU), a prediction unit (PU), and a transform unit (TU) are used. One unit may be further divided into sub-units having a smaller size compared to the unit.

- 블록 분할 정보는 유닛의 깊이(depth)에 관한 정보를 포함할 수 있다. 깊이 정보는 유닛이 분할되는 회수 및/또는 정도를 나타낼 수 있다.- The block division information may include information about the depth of the unit. The depth information may indicate the number and/or degree to which a unit is divided.

- 하나의 유닛은 트리 구조(tree structure)에 기반하여 깊이 정보(depth)를 가지면서 계층적으로 복수의 하위 유닛들로 분할될 수 있다. 말하자면, 유닛 및 상기의 유닛의 분할에 의해 생성된 하위 유닛은 노드 및 상기의 노드의 자식 노드에 각각 대응할 수 있다. 각각의 분할된 하위 유닛은 깊이 정보를 가질 수 있다. 유닛의 깊이 정보는 유닛이 분할된 회수 및/또는 정도를 나타내므로, 하위 유닛의 분할 정보는 하위 유닛의 크기에 관한 정보를 포함할 수도 있다.- One unit may be hierarchically divided into a plurality of sub-units while having depth information based on a tree structure. In other words, a unit and a sub-unit generated by division of the unit may correspond to a node and a child node of the node, respectively. Each divided sub-unit may have depth information. Since the depth information of the unit indicates the number and/or degree of division of the unit, the division information of the sub-unit may include information about the size of the sub-unit.

- 트리 구조에서, 가장 상위 노드는 분할되지 않은 최초의 유닛에 대응할 수 있다. 가장 상위 노드는 루트 노드(root node)로 칭해질 수 있다. 또한, 가장 상위 노드는 최소의 깊이 값을 가질 수 있다. 이 때, 가장 상위 노드는 레벨 0의 깊이를 가질 수 있다. - In the tree structure, the highest node may correspond to the first undivided unit. The uppermost node may be referred to as a root node. Also, the highest node may have a minimum depth value. In this case, the highest node may have a depth of level 0.

- 레벨 1의 깊이를 갖는 노드는 최초의 유닛이 한 번 분할됨에 따라 생성된 유닛을 나타낼 수 있다. 레벨 2의 깊이를 갖는 노드는 최초의 유닛이 두 번 분할됨에 따라 생성된 유닛을 나타낼 수 있다.- A node with a depth of level 1 may represent a unit created as the original unit is split once. A node with a depth of level 2 may represent a unit generated as the original unit is split twice.

- 레벨 3의 깊이를 갖는 리프 노드(leaf node)는 최초 유닛이 3번 분할됨에 따라 생성된 유닛을 나타낼 수 있다. 리프 노드는 가장 하위의 노드일 수 있으며, 최대의 깊이 값을 가질 수 있다.- A leaf node having a depth of level 3 may indicate a unit generated as the initial unit is divided three times. A leaf node may be the lowest node and may have a maximum depth value.

- 블록(Block): 블록은 샘플의 MxN 배열일 수 있다. M 및 N은 각각 양의 정수일 수 있다. 블록은 흔히 2차원의 샘플의 배열을 의미할 수 있다. 샘플은 픽셀 또는 픽셀 값일 수 있다.- Block: A block may be an MxN array of samples. M and N may each be a positive integer. A block can often mean an array of two-dimensional samples. A sample may be a pixel or a pixel value.

변환 유닛(Transform Unit): 변환 유닛은 변환, 역변환, 양자화, 역양자화, 변환 계수 부호화, 및 변환 계수 복호화 등과 같은 잔차 신호(residual signal) 부호화 및/또는 잔여 신호 복호화에 있어서의 기본 유닛일 수 있다. 하나의 변환 유닛은 더 작은 크기를 갖는 다수의 변환 유닛들 분할될 수 있다. Transform Unit: A transform unit may be a basic unit in residual signal encoding and/or residual signal decoding such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding, and transform coefficient decoding. . One transform unit may be divided into multiple transform units having a smaller size.

파라미터 세트(Parameter Set): 파라미터 세트는 비트스트림 내의 구조(structure) 중 헤더(header) 정보에 해당할 수 있다. 예를 들면, 파라미터 세트는 시퀀스 파라미터 세트(sequence parameter set), 픽쳐 파라미터 세트(picture parameter set) 및 적응 파라미터 세트(adaptation parameter set) 등을 포함할 수 있다.Parameter Set: A parameter set may correspond to header information among structures in a bitstream. For example, the parameter set may include a sequence parameter set, a picture parameter set, an adaptation parameter set, and the like.

율-왜곡 최적화(rate-distortion optimization): 부호화 장치는 코딩 유닛의 크기, 예측 모드, 예측 유닛의 크기, 움직임 정보 및, 변환 유닛의 크기 등의 조합을 이용해서 높은 부호화 효율을 제공하기 위해 율-왜곡 최적화를 사용할 수 있다.Rate-distortion optimization: The encoding apparatus uses a combination of a size of a coding unit, a prediction mode, a size of a prediction unit, motion information, and a size of a transform unit to provide high encoding efficiency. Distortion optimization can be used.

- 율-왜곡 최적화 방식은 상기의 조합들 중에서 최적의 조합을 선택하기 위해 각 조합의 율-왜곡 비용(rate-distortion cost)을 계산할 수 있다. 율-왜곡 비용은 아래의 수학식 1을 이용하여 계산될 수 있다. 일반적으로 상기 율-왜곡 비용이 최소가 되는 조합이 율-왜곡 최적화 방식에 있어서의 최적의 조합으로 선택될 수 있다.- The rate-distortion optimization method may calculate a rate-distortion cost of each combination in order to select an optimal combination from among the above combinations. The rate-distortion cost can be calculated using Equation 1 below. In general, the combination in which the rate-distortion cost is minimized may be selected as the optimal combination in the rate-distortion optimization method.

Figure pat00001
Figure pat00001

D는 왜곡을 나타낼 수 있다. D는 변환 블록 내에서 원래의 변환 계수들 및 복원된 변환 계수들 간의 차이 값들의 제곱들의 평균(mean square error)일 수 있다.D may represent distortion. D may be a mean square error of squares of difference values between original transform coefficients and reconstructed transform coefficients in a transform block.

R은 율을 나타낼 수 있다. R은 관련된 문맥 정보를 이용한 비트 율을 나타낼 수 있다.R may represent a rate. R may represent a bit rate using related context information.

λ는 라그랑지안 승수(Lagrangian multiplier)를 나타낼 수 있다. R은 예측 모드, 움직임 정보 및 부호화 블록 플래그(coded block flag) 등과 같은 부호화 파라미터 정보뿐만 아니라, 변환 계수의 부호화에 의해 발생하는 비트도 포함할 수 있다.λ may represent a Lagrangian multiplier. R may include not only encoding parameter information such as prediction mode, motion information, and a coded block flag, but also bits generated by encoding a transform coefficient.

부호화 장치는 정확한 D 및 R을 계산하기 위해 인터 예측 및/또는 인트라 예측, 변환, 양자화, 엔트로피 부호화, 역양자화, 역변환 등의 과정을 수행하는데, 이러한 과정은 부호화 장치에서의 복잡도를 크게 증가시킬 수 있다.The encoding apparatus performs processes such as inter prediction and/or intra prediction, transformation, quantization, entropy encoding, inverse quantization, and inverse transformation to calculate accurate D and R. These processes may significantly increase the complexity of the encoding apparatus. have.

도 1은 본 발명이 적용되는 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.1 is a block diagram illustrating a configuration of an encoding apparatus to which the present invention is applied according to an embodiment.

부호화 장치(100)는 비디오 부호화 장치 또는 영상 부호화 장치일 수 있다. 비디오는 하나 이상의 영상들을 포함할 수 있다. 부호화 장치(100)는 비디오의 하나 이상의 영상들을 시간에 따라 순차적으로 부호화할 수 있다.The encoding apparatus 100 may be a video encoding apparatus or an image encoding apparatus. A video may include one or more images. The encoding apparatus 100 may sequentially encode one or more images of a video according to time.

도 1을 참조하면, 부호화 장치(100)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)를 포함할 수 있다.Referring to FIG. 1 , the encoding apparatus 100 includes a motion prediction unit 111 , a motion compensation unit 112 , an intra prediction unit 120 , a switch 115 , a subtractor 125 , a transform unit 130 , and a quantization unit. It may include a unit 140 , an entropy encoder 150 , an inverse quantizer 160 , an inverse transform unit 170 , an adder 175 , a filter unit 180 , and a reference picture buffer 190 .

부호화 장치(100)는 입력 영상에 대해 인트라 모드 및/또는 인터 모드로 부호화를 수행할 수 있다. 또한, 부호화 장치(100)는 입력 장치에 대한 부호화를 통해 비트스트림을 생성할 수 있고, 생성된 비트스트림을 출력할 수 있다. 인트라 모드가 사용되는 경우 스위치(115)는 인트라로 전환될 수 있고, 인터 모드가 사용되는 경우 스위치(115)는 인터로 전환될 수 있다.The encoding apparatus 100 may encode an input image in an intra mode and/or an inter mode. Also, the encoding apparatus 100 may generate a bitstream through encoding for an input device, and may output the generated bitstream. When the intra mode is used, the switch 115 may be switched to the intra mode, and when the inter mode is used, the switch 115 may be switched to the inter mode.

부호화 장치(100)는 입력 영상의 입력 블록에 대한 예측 블록을 생성할 수 있다. 또한, 부호화 장치(100)는 예측 블록이 생성된 후, 입력 블록 및 예측 블록의 차분(residual)을 부호화할 수 있다. 입력 영상은 현재 부호화의 대상인 현재 영상으로 칭해질 수 있다. 입력 블록은 현재 부호화의 대상인 현재 블록으로 칭해질 수 있다.The encoding apparatus 100 may generate a prediction block for the input block of the input image. Also, after the prediction block is generated, the encoding apparatus 100 may encode a residual between the input block and the prediction block. The input image may be referred to as a current image that is a current encoding target. The input block may be referred to as a current block that is a current encoding target.

예측 모드가 인트라 모드인 경우, 인트라 예측부(120)는 현재 블록의 주변의 이미 부호화된 블록의 픽셀 값을 참조 화소로서 이용할 수 있다. 인트라 예측부(120)는 참조 화소를 이용하여 공간적 예측을 수행할 수 있고, 공간적 예측을 통해 입력 블록에 대한 예측 샘플들을 생성할 수 있다.When the prediction mode is the intra mode, the intra prediction unit 120 may use a pixel value of an already-encoded block adjacent to the current block as a reference pixel. The intra prediction unit 120 may perform spatial prediction using a reference pixel, and may generate prediction samples for an input block through spatial prediction.

예측 모드가 인터 모드인 경우, 움직임 예측부(111)는, 움직임 예측 과정에서 참조 영상으로부터 입력 블록과 가장 매치가 잘 되는 영역을 검색할 수 있고, 검색된 영역을 이용하여 움직임 벡터를 도출할 수 있다. 참조 영상은 참조 픽처 버퍼(190)에 저장될 수 있으며, 참조 영상에 대한 부호화 및/또는 복호화가 처리될 때 참조 픽처 버퍼(190)에 저장될 수 있다.When the prediction mode is the inter mode, the motion prediction unit 111 may search for a region that best matches the input block from the reference image in the motion prediction process, and may derive a motion vector using the searched region. . The reference picture may be stored in the reference picture buffer 190 , and may be stored in the reference picture buffer 190 when encoding and/or decoding of the reference picture is processed.

움직임 보상부(112)는 움직임 벡터를 이용하는 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. 여기엣서, 움직임 벡터는 인터 예측에 사용되는 2차원 벡터일 수 있다. 또한 움직임 벡터는 현재 영상 및 참조 영상 간의 오프셋(offset)을 나타낼 수 있다.The motion compensator 112 may generate a prediction block by performing motion compensation using a motion vector. Here, the motion vector may be a two-dimensional vector used for inter prediction. Also, the motion vector may indicate an offset between the current image and the reference image.

감산기(125)는 입력 블록 및 예측 블록의 차분을 사용하여 잔차 블록(residual block)을 생성할 수 있다. 잔차 블록은 잔차 신호로 칭해질 수도 있다.The subtractor 125 may generate a residual block by using the difference between the input block and the prediction block. The residual block may be referred to as a residual signal.

변환부(130)는 잔차 블록에 대해 변환(transform)을 수행하여 변환 계수를 생성할 수 있고, 변환 계수(transform coefficient)를 출력할 수 있다. 여기서, 변환 계수는 잔차 블록에 대한 변환을 수행함으로써 생성된 계수 값일 수 있다. 변환 생략(transform skip) 모드가 적용되는 경우, 변환부(130)는 잔차 블록에 대한 변환을 생략할 수도 있다.The transform unit 130 may perform transform on the residual block to generate a transform coefficient, and may output a transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing transform on the residual block. When a transform skip mode is applied, the transform unit 130 may skip transform on the residual block.

변환 계수에 양자화를 적용함으로써 양자화된 변환 계수 레벨(transform coefficient level)이 생성될 수 있다. 이하, 실시예들에서는 양자화된 변환 계수 레벨도 변환 계수로 칭해질 수 있다.A quantized transform coefficient level may be generated by applying quantization to the transform coefficient. Hereinafter, in embodiments, a quantized transform coefficient level may also be referred to as a transform coefficient.

양자화부(140)는 변환 계수를 양자화 파라미터에 따라 양자화함으로써 양자화된 변환 계수 레벨(quantized transform coefficient level)을 생성할 수 있고, 양자화된 변환 계수 레벨을 출력할 수 있다. 이때, 양자화부(140)에서는 양자화 행렬을 사용하여 변환 계수를 양자화할 수 있다.The quantization unit 140 may generate a quantized transform coefficient level by quantizing the transform coefficient according to the quantization parameter, and may output the quantized transform coefficient level. In this case, the quantization unit 140 may quantize the transform coefficients using a quantization matrix.

엔트로피 부호화부(150)는, 양자화부(140)에서 산출된 값들 또는 부호화 과정에서 산출된 부호화 파라미터 값들 등에 대하여 확률 분포에 따른 엔트로피 부호화를 수행함으로써 비트스트림(bitstream)을 생성할 수 있고, 비트스트림을 출력할 수 있다.The entropy encoding unit 150 may generate a bitstream by performing entropy encoding according to a probability distribution on the values calculated by the quantization unit 140 or encoding parameter values calculated in the encoding process, etc. can be printed out.

엔트로피 부호화부(150)는 영상의 픽셀의 정보 외에 영상의 복호화를 위한 정보에 대한 엔트로피 부호화를 수행할 수 있다. 예를 들면, 영상의 복호화를 위한 정보는 신택스 엘리먼트(syntax element) 등을 포함할 수 있다. The entropy encoding unit 150 may perform entropy encoding on information for decoding an image in addition to information on pixels of the image. For example, information for decoding an image may include a syntax element or the like.

부호화 파라미터는 부호화 및/또는 복호화를 위해 요구되는 정보일 수 있다. 부호화 파라미터는 부호화 장치에서 부호화되어 복호화 장치로 전달되는 정보를 포함할 수 있고, 부호화 혹은 복호화 과정에서 유추될 수 있는 정보를 포함할 수 있다. 예를 들면, 복호화 장치로 전달되는 정보로서, 신택스 엘리먼트가 있다.The encoding parameter may be information required for encoding and/or decoding. The encoding parameter may include information encoded by the encoding apparatus and transmitted to the decoding apparatus, and may include information that can be inferred during encoding or decoding. For example, as information transmitted to the decoding apparatus, there is a syntax element.

예를 들면, 부호화 파라미터는 예측 모드, 움직임 벡터, 참조 픽처 색인(index), 부호화 블록 패턴(pattern), 잔차 신호 유무, 변환 계수, 양자화된 변환 계수, 양자화 파라미터, 블록 크기, 블록 분할(partition) 정보 등의 값 또는 통계를 포함할 수 있다. 예측 모드는 인트라 예측 모드 또는 인터 예측 모드를 가리킬 수 있다.For example, the coding parameter includes a prediction mode, a motion vector, a reference picture index, a coding block pattern, presence or absence of a residual signal, a transform coefficient, a quantized transform coefficient, a quantization parameter, a block size, and a block partition. It may include values or statistics such as information. The prediction mode may indicate an intra prediction mode or an inter prediction mode.

잔차 신호는 원 신호 및 예측 신호 간의 차이(difference)를 의미할 수 있다. 또는, 잔차 신호는 원신호 및 예측 신호 간의 차이를 변환(transform)함으로써 생성된 신호일 수 있다. 또는, 잔차 신호는 원 신호 및 예측 신호 간의 차이를 변환 및 양자화함으로써 생성된 신호일 수 있다. 잔차 블록은 블록 단위의 잔차 신호일 수 있다.The residual signal may mean a difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming a difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing a difference between the original signal and the predicted signal. The residual block may be a residual signal in units of blocks.

엔트로피 부호화가 적용되는 경우, 높은 발생 확률을 갖는 심볼에 적은 수의 비트가 할당될 수 있고, 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당될 수 있다. 이러한 할당을 통해 심볼이 표현됨에 따라, 부호화의 대상인 심볼들에 대한 비트열(bitstring)의 크기가 감소될 수 있다. 따라서, 엔트로피 부호화를 통해서 영상 부호화의 압축 성능이 향상될 수 있다. When entropy encoding is applied, a small number of bits may be allocated to a symbol having a high probability of occurrence, and a large number of bits may be allocated to a symbol having a low probability of occurrence. As a symbol is expressed through this allocation, the size of a bitstring for symbols to be encoded may be reduced. Accordingly, compression performance of image encoding may be improved through entropy encoding.

또한, 엔트로피 부호화를 위해 지수 골롬(exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding) 및 CABAC(Context-Adaptive Binary Arithmetic Coding) 등과 같은 부호화 방법이 사용될 수 있다. 예를 들면, 엔트로피 부호화부(150)는 가변 길이 부호화(Variable Lenghth Coding/Code; VLC) 테이블을 이용하여 엔트로피 부호화를 수행할 수 있다. 예를 들면, 엔트로피 부호화부(150)는 대상 심볼에 대한 이진화(binarization) 방법을 도출할 수 있다. 또한, 엔트로프 부호화부(150)는 대상 심볼/빈(bin)의 확률 모델(probability model)을 도출할 수 있다. 엔트로피 부호화부(150)는 도출된 이진화 방법 또는 확률 모델을 사용하여 엔트로피 부호화를 수행할 수도 있다.In addition, encoding methods such as exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be used for entropy encoding. For example, the entropy encoding unit 150 may perform entropy encoding using a Variable Length Coding/Code (VLC) table. For example, the entropy encoder 150 may derive a binarization method for a target symbol. Also, the entropy encoder 150 may derive a probability model of a target symbol/bin. The entropy encoding unit 150 may perform entropy encoding using the derived binarization method or a probability model.

부호화 장치(100)가 인터 예측을 통한 부호화를 수행할 경우, 부호화된 현재 영상은 이후에 처리되는 다른 영상(들)에 대하여 참조 영상으로서 사용될 수 있다. 따라서, 부호화 장치(100)는 부호화된 현재 영상을 다시 복호화할 수 있고, 복호화된 영상을 참조 영상으로 저장할 수 있다. 복호화를 위해 부호화된 현재 영상에 대한 역양자화 및 역변환이 처리될 수 있다.When the encoding apparatus 100 performs encoding through inter prediction, the encoded current image may be used as a reference image for other image(s) to be processed later. Accordingly, the encoding apparatus 100 may decode the encoded current image again and store the decoded image as a reference image. Inverse quantization and inverse transformation of the encoded current image for decoding may be processed.

양자화된 계수는 역양자화부(160)에서 역양자화될(inversely quantized) 수 있고. 역변환부(170)에서 역변환될(inversely transformed) 수 있다. 역양자화 및 역변환된 계수는 가산기(175)를 통해 예측 블록과 합해질 수 있다, 역양자화 및 역변환된 계수 및 예측 블록을 합함으로써 복원(reconstructed) 블록이 생성될 수 있다.The quantized coefficient may be inversely quantized in the inverse quantization unit 160 . It may be inversely transformed by the inverse transform unit 170 . The inverse quantized and inverse transformed coefficients may be summed with the prediction block through the adder 175. A reconstructed block may be generated by summing the inverse quantized and inverse transformed coefficients and the prediction block.

복원 블록은 필터부(180)를 거칠 수 있다. 필터부(180)는 디블록킹 필터(deblocking filter), 에스에이오(Sample Adaptive Offset; SAO), 에이엘어프(Adaptive Loop Filter; ALF) 중 적어도 하나 이상을 복원 블록 또는 복원 픽처에 적용할 수 있다. 필터부(180)는 적응적(adaptive) 인루프(in-loop) 필터로 칭해질 수도 있다.The reconstruction block may go through the filter unit 180 . The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to a reconstructed block or a reconstructed picture. The filter unit 180 may be referred to as an adaptive in-loop filter.

디블록킹 필터는 블록들 간의 경계에 생긴 블록 왜곡을 제거할 수 있다. SAO는 코딩 에러를 보상하기 위해 픽셀 값에 적정 오프셋(offset) 값을 더할 수 있다. ALF는 복원 영상 및 원래의 영상을 비교한 값에 기반하여 필터링을 수행할 수 있다. 필터부(180)를 거친 복원 블록은 참조 픽처 버퍼(190)에 저장될 수 있다.The deblocking filter may remove block distortion generated at the boundary between blocks. The SAO may add an appropriate offset value to the pixel value to compensate for the coding error. The ALF may perform filtering based on a comparison value between the reconstructed image and the original image. The reconstructed block that has passed through the filter unit 180 may be stored in the reference picture buffer 190 .

도 2는 본 발명이 적용되는 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.2 is a block diagram illustrating a configuration of a decoding apparatus to which the present invention is applied according to an embodiment.

복호화 장치(200)는 비디오 복호화 장치 또는 영상 복호화 장치일 수 있다.The decoding apparatus 200 may be a video decoding apparatus or an image decoding apparatus.

도 2를 참조하면, 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽처 버퍼(270)를 포함할 수 있다.Referring to FIG. 2 , the decoding apparatus 200 includes an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensator 250 , and an adder 255 . , a filter unit 260 and a reference picture buffer 270 may be included.

복호화 장치(200)는 부호화 장치(100)에서 출력된 비트스트림을 수신할 수 있다. 복호화 장치(200)는 비트스트림에 대하여 인트라 모드 또는 인터 모드로 복호화를 수행할 수 있다. 또한, 복호화 장치(200)는 복호화를 통해 복원 영상을 생성할 수 있고, 복원 영상을 출력할 수 있다.The decoding apparatus 200 may receive the bitstream output from the encoding apparatus 100 . The decoding apparatus 200 may decode the bitstream in an intra mode or an inter mode. Also, the decoding apparatus 200 may generate a reconstructed image through decoding and may output the reconstructed image.

복호화에 사용되는 예측 모드가 인트라 모드인 경우 스위치가 인트라로 전환될 수 있다. 복호화에 사용되는 예측 모드가 인터 모드인 경우 스위치가 인터로 전환될 수 있다.When the prediction mode used for decoding is the intra mode, the switch may be switched to the intra mode. When the prediction mode used for decoding is the inter mode, the switch may be switched to the inter mode.

복호화 장치(200)는 입력된 비트스트림으로부터 복원된 잔차 블록(reconstructed residual block)을 획득할 수 있고, 예측 블록을 생성할 수 있다. 복원된 잔차 블록 및 예측 블록이 획득되면, 복호화 장치(200)는 복원된 잔차 블록과 및 예측 블록을 더함으로써 복원 블록을 생성할 수 있다.The decoding apparatus 200 may obtain a reconstructed residual block from the input bitstream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding apparatus 200 may generate a reconstructed block by adding the reconstructed residual block and the prediction block.

엔트로피 복호화부(210)는 비트스트림에 대한 확률 분포에 따른 엔트로피 복호화를 수행함으로써 심볼들을 생성할 수 있다. 생성된 심볼들은 양자화된 계수(quantized coefficient) 형태의 심볼을 포함할 수 있다. 여기에서, 엔트로피 복호화 방법은 상술된 엔트로피 부호화 방법과 유사할 수 있다. 예를 들면, 엔트로피 복호화 방법은 상술된 엔트로피 부호화 방법의 역과정일 수 있다.The entropy decoding unit 210 may generate symbols by performing entropy decoding according to a probability distribution on the bitstream. The generated symbols may include symbols in the form of quantized coefficients. Here, the entropy decoding method may be similar to the entropy encoding method described above. For example, the entropy decoding method may be a reverse process of the entropy encoding method described above.

양자화된 계수는 역양자화부(220)에서 역양자화될 수 있고, 역변환부(230)에서 역변환될 수 있다. 양자화된 계수가 역양자화 및 역변환 된 결과로서, 복원된 잔차 블록이 생성될 수 있다. 이때, 역양자화부(220)는 양자화된 계수에 양자화 행렬을 적용할 수 있다.The quantized coefficient may be inverse quantized by the inverse quantization unit 220 and inversely transformed by the inverse transform unit 230 . As a result of inverse quantization and inverse transformation of the quantized coefficient, a reconstructed residual block may be generated. In this case, the inverse quantizer 220 may apply a quantization matrix to the quantized coefficients.

인트라 모드가 사용되는 경우, 인트라 예측부(240)는 현재 블록 주변의 이미 부호화된 블록의 픽셀 값을 이용하는 공간적 예측을 수행함으로써 예측 블록을 생성할 수 있다. 인터 모드가 사용되는 경우, 움직임 보상부(250)는 움직임 벡터 및 참조 픽처 버퍼(270)에 저장되어 있는 참조 영상을 이용하는 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of an already encoded block around the current block. When the inter mode is used, the motion compensator 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

복원된 잔차 블록 및 예측 블록은 가산기(255)를 통해 더해질 수 있다. 복원된 잔차 블록 및 예측 블록이 더해짐에 따라 생성된 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO 및 ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽처에 적용할 수 있다. 필터부(260)는 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽처 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The reconstructed residual block and the prediction block may be added through an adder 255 . A block generated by adding the reconstructed residual block and the prediction block may pass through the filter unit 260 . The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to a reconstructed block or a reconstructed picture. The filter unit 260 may output a restored image. The reconstructed image may be stored in the reference picture buffer 270 and used for inter prediction.

도 3은 영상을 부호화 및 복호화할 때의 영상의 분할 구조를 개략적으로 나타내는 도면이다.3 is a diagram schematically illustrating a structure of an image segmentation when an image is encoded and decoded.

영상을 효율적으로 분할하기 위해, 부호화 및 복호화에 있어서, 코딩 유닛(Coding Unit; CU)이 사용될 수 있다. 유닛은 1) 구문 요소(syntax element) 및 2) 영상 샘플들을 포함하는 블록을 합쳐서 지칭하는 용어일 수 있다. 예를 들면, "유닛의 분할"은 "유닛에 해당하는 블록의 분할"을 의미할 수 있다.In order to efficiently segment an image, a coding unit (CU) may be used in encoding and decoding. A unit may be a term that collectively refers to a block including 1) a syntax element and 2) image samples. For example, "division of a unit" may mean "division of a block corresponding to a unit".

도 3을 참조하면, 영상(300)은 최대 코딩 유닛(Largest Coding Unit; LCU) 단위로 순차적으로 분할되고, LCU 단위로 분할 구조가 결정된다. 여기서, LCU는 코딩 트리 유닛(Coding Tree Unit; CTU)과 동일한 의미로 사용될 수 있다.Referring to FIG. 3 , an image 300 is sequentially divided in units of a Largest Coding Unit (LCU), and a division structure is determined in units of LCUs. Here, LCU may be used in the same meaning as a Coding Tree Unit (CTU).

분할 구조는 LCU(310) 내에서의 코딩 유닛(Coding Unit; CU)의 분포를 의미할 수 있다. CU는 영상을 효율적으로 부호화하기 위한 유닛일 수 있다. 이러한 분포는 하나의 CU를 4개의 CU들로 분할할지 여부에 따라 결정할 수 있다. 분할에 의해 생성된 CU의 가로 크기 및 세로 크기는 각각 분할 전의 CU의 가로 크기의 절반 및 세로 크기의 절반일 수 있다. 분할된 CU는 동일한 방식으로 가로 크기 및 세로 크기가 절반으로 감소된 4개의 CU로 재귀적으로 분할될 수 있다.The partition structure may mean a distribution of coding units (CUs) within the LCU 310 . A CU may be a unit for efficiently encoding an image. This distribution may be determined according to whether one CU is divided into four CUs. The horizontal size and vertical size of the CU generated by division may be half of the horizontal size and half of the vertical size of the CU before division, respectively. The divided CU may be recursively divided into four CUs whose horizontal size and vertical size are reduced by half in the same manner.

이때, CU의 분할은 기정의된 깊이까지 재귀적으로 이루어질 수 있다. 깊이 정보는 CU의 크기를 나타내는 정보일 수 있다. 깊이 정보는 각 CU마다 저장될 수 있다. 예컨대, LCU의 깊이는 0일 수 있고, 최소 코딩 유닛(Smallest Coding Unit; SCU)의 깊이는 기정의된 최대 깊이일 수 있다. 여기서, LCU는 상술된 것과 같이 최대의 코딩 유닛 크기를 가지는 코딩 유닛일 수 있고, SCU는 최소의 코딩 유닛 크기를 가지는 코딩 유닛일 수 있다. In this case, the division of the CU may be performed recursively to a predefined depth. The depth information may be information indicating the size of a CU. Depth information may be stored for each CU. For example, the depth of the LCU may be 0, and the depth of a Smallest Coding Unit (SCU) may be a predefined maximum depth. Here, the LCU may be a coding unit having the largest coding unit size as described above, and the SCU may be a coding unit having the smallest coding unit size.

LCU(310)로부터 분할이 시작되고, 분할에 의해 CU의 가로 크기 및 세로 크기가 절반으로 줄어들 때마다 CU의 깊이는 1씩 증가한다. 각각의 깊이 별로, 분할되지 않는 CU는 2Nx2N 크기를 가질 수 있다. 분할되는 CU의 경우, 2Nx2N 크기의 CU가 NxN 크기를 가지는 4개의 CU들로 분할될 수 있다. N의 크기는 깊이가 1씩 증가할 때마다 절반으로 감소한다. The division starts from the LCU 310, and the depth of the CU increases by 1 whenever the horizontal size and the vertical size of the CU are halved by the division. For each depth, an undivided CU may have a size of 2Nx2N. In the case of a divided CU, a CU having a size of 2Nx2N may be divided into four CUs having a size of NxN. The size of N is halved for each increase in depth by 1.

도 3을 참조하면, 깊이가 0인 LCU는 64x64 화소들일 수 있다. 0은 최소 깊이일 수 있다. 깊이가 3인 SCU는 8x8 화소들일 수 있다. 3은 최대 깊이일 수 있다. 이때, LCU인 64x64 화소들의 CU는 깊이 0으로 표현될 수 있다. 32x32 화소들의 CU는 깊이 1로 표현될 수 있다. 16x16 화소들의 CU는 깊이 2로 표현될 수 있다. SCU인 8x8 화소들의 CU는 깊이 3으로 표현될 수 있다. Referring to FIG. 3 , an LCU having a depth of 0 may be 64x64 pixels. 0 may be the minimum depth. An SCU of depth 3 may be 8x8 pixels. 3 may be the maximum depth. In this case, a CU of 64x64 pixels, which is an LCU, may be expressed as depth 0. A CU of 32x32 pixels may be expressed as depth 1. A CU of 16x16 pixels may be expressed as depth 2. A CU of 8x8 pixels, which is an SCU, may be expressed as depth 3 .

또한, CU가 분할되는지 여부에 대한 정보는 CU의 분할 정보를 통해 표현될 수 있다. 분할 정보는 1비트의 정보일 수 있다. SCU를 제외한 모든 CU는 분할 정보를 포함할 수 있다. 예를 들면, 분할 정보의 값이 0이면, CU가 분할되지 않을 수 있고, 분할 정보의 값이 1이면, CU가 분할될 수 있다.Also, information on whether a CU is split may be expressed through split information of the CU. The division information may be 1-bit information. All CUs except for the SCU may include partition information. For example, if the value of the partitioning information is 0, the CU may not be partitioned, and if the value of the partitioning information is 1, the CU may be partitioned.

도 4a 내지 도 4h는 코딩 유닛(CU)이 포함할 수 있는 예측 유닛(PU)의 형태를 도시한 도면이다.4A to 4H are diagrams illustrating a form of a prediction unit (PU) that a coding unit (CU) may include.

LCU로부터 분할된 CU 중 더 이상 분할되지 않는 CU는 하나 이상의 예측 유닛(Prediction Unit; PU)들로 나뉘어질 수 있다. 이러한 처리 또한, 분할로 칭해질 수 있다.A CU that is no longer split among CUs split from an LCU may be divided into one or more prediction units (PUs). This process may also be referred to as segmentation.

PU는 예측에 대한 기본 단위일 수 있다. PU는 스킵(skip) 모드, 인터 모드 및 인트라 모드 중 어느 하나로 부호화 및 복호화될 수 있다. PU는 모드에 따라서 다양한 형태로 분할될 수 있다.A PU may be a basic unit for prediction. The PU may be encoded and decoded in any one of a skip mode, an inter mode, and an intra mode. A PU may be divided into various forms according to modes.

도 4a에서 도시된 것과 같이, 스킵 모드에서는, CU 내에 분할이 존재하지 않을 수 있다. 스킵 모드에서는 분할 없이 CU와 동일한 크기를 갖는 2Nx2N 모드(410)가 지원될 수 있다.As shown in FIG. 4A , in the skip mode, there may not be a partition in the CU. In the skip mode, a 2Nx2N mode 410 having the same size as a CU without division may be supported.

인터 모드에서는, CU 내에서 8가지로 분할된 형태들이 지원될 수 있다. 예를 들면, 인터 모드에서는 2Nx2N 모드(410), 2NxN 모드(415), Nx2N 모드(420), NxN 모드(425), 2NxnU 모드(430), 2NxnD 모드(435), nLx2N 모드(440) 및 nRx2N 모드(445)가 지원될 수 있다.In the inter mode, 8 types of divided types within a CU may be supported. For example, in the inter mode, 2Nx2N mode 410, 2NxN mode 415, Nx2N mode 420, NxN mode 425, 2NxnU mode 430, 2NxnD mode 435, nLx2N mode 440, and nRx2N mode Mode 445 may be supported.

인트라 모드에서는, 2Nx2N 모드(410) 및 NxN 모드(425)가 지원될 수 있다. In the intra mode, the 2Nx2N mode 410 and the NxN mode 425 may be supported.

도 5는 코딩 유닛(CU)에 포함될 수 있는 변환 유닛(TU)의 형태를 도시한 도면이다.5 is a diagram illustrating a form of a transform unit (TU) that may be included in a coding unit (CU).

변환 유닛(Transform Unit; TU)은 CU 내에서 변환, 양자화, 역변환 및 역양자화의 과정을 위해 사용되는 기본 단위일 수 있다. TU는 정사각형 형태 또는 직사각형 형태를 가질 수 있다.A transform unit (TU) may be a basic unit used for processes of transform, quantization, inverse transform, and inverse quantization within a CU. A TU may have a square shape or a rectangular shape.

LCU로부터 분할된 CU 중, 더 이상 CU들로 분할되지 않는 CU는 하나 이상의 TU들로 분할될 수 있다. 이때, TU의 분할 구조는 쿼드트리(quad-tree) 구조일 수 있다. 예컨대, 도 5에서 도시된 것과 같이, 하나의 CU(510)가 쿼드트리 구조에 따라서 한 번 혹은 그 이상 분할될 수 있다. 분할을 통해, 하나의 CU(510)는 다양한 크기의 TU들로 구성될 수 있다.Among CUs split from an LCU, a CU that is no longer split into CUs may be split into one or more TUs. In this case, the partition structure of the TU may be a quad-tree structure. For example, as shown in FIG. 5 , one CU 510 may be divided one or more times according to the quadtree structure. Through division, one CU 510 may be configured with TUs of various sizes.

도 6은 인트라 예측 과정의 실시예를 설명하기 위한 도면이다.6 is a diagram for explaining an embodiment of an intra prediction process.

인트라 예측 모드의 개수는 예측 유닛의 크기에 관계없이 35개로 고정될 수 있다.The number of intra prediction modes may be fixed to 35 regardless of the size of the prediction unit.

예측 모드는 도 6에서 도시된 것과 같이 2개의 비방향성 모드들 및 33개의 방향성 모드들을 포함할 수 있다. 2개의 비방향성 모드들은 디씨(DC) 모드 및 플레너(Planar) 모드를 포함할 수 있다.The prediction mode may include two non-directional modes and 33 directional modes as shown in FIG. 6 . The two non-directional modes may include a DC mode and a planar mode.

예측 모드의 개수는 색 성분(color component)의 타입에 따라 상이할 수 있다. 예를 들면, 색 성분이 휘도(luma) 신호인지 아니면 색차(chroma) 신호인지에 따라 예측 모드의 개수가 다를 수 있다.The number of prediction modes may be different depending on the type of color component. For example, the number of prediction modes may be different depending on whether the color component is a luma signal or a chroma signal.

PU는 NxN의 크기 또는 2Nx2N의 크기를 갖는, 정사각형 형태를 가질 수 있다. NxN의 크기는 4x4, 8x8, 16x16, 32x32 및 64x64 등을 포함할 수 있다. PU의 단위는 CU, PU 및 TU 중 적어도 하나의 크기일 수 있다.The PU may have a square shape, having a size of NxN or a size of 2Nx2N. The size of NxN may include 4x4, 8x8, 16x16, 32x32 and 64x64. The unit of PU may be the size of at least one of a CU, a PU, and a TU.

인트라 부호화 및/또는 복호화는 주변의 복원된 유닛에 포함되는 샘플 값 또는 부호화 파라미터를 이용하여 수행될 수 있다.Intra encoding and/or decoding may be performed using sample values or encoding parameters included in neighboring reconstructed units.

도 7은 인터 예측 과정의 실시예를 설명하기 위한 도면이다.7 is a diagram for explaining an embodiment of an inter prediction process.

도 7에 도시된 사각형은 영상(또는, 픽처)를 나타낼 수 있다. 또한, 도 7에서 화살표는 예측 방향을 나타낼 수 있다. 즉, 영상은 예측 방향에 따라 부호화 및/또는 복호화될 수 있다.The rectangle shown in FIG. 7 may represent an image (or a picture). Also, an arrow in FIG. 7 may indicate a prediction direction. That is, the image may be encoded and/or decoded according to the prediction direction.

각 영상(또는, 픽처)는 부호화 타입에 따라 I 픽처(Intra Picture), P 픽처(Uni-prediction Picture), B 픽처(Bi-prediction Picture)로 분류될 수 있다. 각 픽처는 각 픽처의 부호화 타입에 따라 부호화될 수 있다.Each image (or picture) may be classified into an I picture (intra picture), a P picture (uni-prediction picture), and a B picture (bi-prediction picture) according to an encoding type. Each picture may be encoded according to the encoding type of each picture.

부호화의 대상인 영상이 I 픽처인 경우, 영상은 인터 예측 없이 영상 자체에 대해 부호화될 수 있다. 부호화의 대상인 영상이 P 픽처인 경우, 영상은 순방향으로만 참조 영상을 이용하는 인터 예측을 통해 부호화될 수 있다. 부호화의 대상인 영상이 B 픽처인 경우, 순방향 및 역방향의 양측으로 참조 픽처들을 이용하는 인터 예측을 통해 부호화될 수 있으며, 순방향 및 역방향 중 일 방향으로 참조 픽처를 이용하는 인터 예측을 통해 부호화될 수 있다.When an image to be encoded is an I picture, the image may be encoded with respect to the image itself without inter prediction. When an image to be encoded is a P picture, the image may be encoded through inter prediction using a reference image only in the forward direction. When an image to be encoded is a B picture, it may be encoded through inter prediction using reference pictures in both forward and backward directions, and may be encoded through inter prediction using reference pictures in one of the forward and backward directions.

참조 영상을 이용하여 부호화 및/또는 복호화되는 P 픽처 및 B 픽처의 영상은 인터 예측이 사용되는 영상으로 간주될 수 있다.Images of P-pictures and B-pictures that are encoded and/or decoded using a reference image may be regarded as images for which inter prediction is used.

아래에서, 실시예에 따른 인터 예측에 대해 구체적으로 설명된다.Hereinafter, inter prediction according to an embodiment will be described in detail.

인터 예측은 참조 픽처 및 움직임 정보를 이용하여 수행될 수 있다. 또한, 인터 예측은 상술된 스킵 모드를 이용할 수도 있다.Inter prediction may be performed using a reference picture and motion information. In addition, inter prediction may use the skip mode described above.

참조 픽처(reference picture)는 현재 픽처의 이전 픽처 또는 현재 픽처의 이후 픽처 중 적어도 하나일 수 있다. 이때, 인터 예측은 참조 픽처에 기반하여 현재 픽처의 블록에 대한 예측을 수행할 수 있다. 여기에서, 참조 픽처는 블록의 예측에 이용되는 영상을 의미할 수 있다.The reference picture may be at least one of a previous picture of the current picture or a subsequent picture of the current picture. In this case, the inter prediction may perform prediction on the block of the current picture based on the reference picture. Here, the reference picture may mean an image used for prediction of a block.

이때, 참조 픽처 내의 영역은 참조 픽처를 지시하는 참조 픽처 인덱스(refIdx) 및 후술될 움직임 벡터(motion vector) 등을 이용함으로써 특정될 수 있다.In this case, the region in the reference picture may be specified by using a reference picture index (refIdx) indicating the reference picture and a motion vector to be described later.

인터 예측은 참조 픽처 및 참조 픽처 내에서 현재 블록에 대응하는 참조 블록을 선택할 수 있고, 선택된 참조 블록을 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록은 현재 픽처의 블록들 중 현재 부호화 또는 복호화의 대상인 블록일 수 있다.Inter prediction may select a reference picture and a reference block corresponding to the current block within the reference picture, and may generate a prediction block for the current block using the selected reference block. The current block may be a block to be currently encoded or decoded among blocks of the current picture.

움직임 정보는 부호화 장치(100) 및 복호화 장치(200)의 각각에 의해 인터 예측 중 도출될 수 있다. 또한, 도출된 움직임 정보는 인터 예측을 수행하는데 사용될 수 있다.Motion information may be derived during inter prediction by each of the encoding apparatus 100 and the decoding apparatus 200 . In addition, the derived motion information may be used to perform inter prediction.

이때, 부호화 장치(100) 및 복호화 장치(200)는 복원된 주변 블록(neighboring block)의 움직임 정보 및/또는 콜 블록(collocated block; col block)의 움직임 정보를 이용함으로써 부호화 및/또는 복호화 효율을 향상시킬 수 있다. 콜 블록은 이미 복원된 콜 픽처(collocated picture; col picture) 내의 현재 블록에 대응하는 블록일 수 있다. 복원된 주변 블록은 현재 픽처 내의 블록이면서, 이미 부호화 및/또는 복호화를 통해 복원된 블록일 수 있다. 또한, 복원 블록은 현재 블록에 인접한 이웃 블록 및/또는 현재 블록의 외부 코너에 위치한 블록일 수 있다. 여기에서, 현재 블록의 외부 코너에 위치한 블록이란, 현재 블록에 가로로 인접한 이웃 블록에 세로로 인접한 블록 또는 현재 블록에 세로로 인접한 이웃 블록에 가로로 인접한 블록일 수 있다.In this case, the encoding apparatus 100 and the decoding apparatus 200 increase encoding and/or decoding efficiency by using motion information of a reconstructed neighboring block and/or motion information of a collocated block. can be improved The collocated block may be a block corresponding to the current block in an already reconstructed collocated picture (col picture). The reconstructed neighboring block may be a block in the current picture and already reconstructed through encoding and/or decoding. Also, the reconstructed block may be a neighboring block adjacent to the current block and/or a block located at an outer corner of the current block. Here, the block located at the outer corner of the current block may be a block vertically adjacent to a neighboring block horizontally adjacent to the current block or a block horizontally adjacent to a neighboring block vertically adjacent to the current block.

부호화 장치(100) 및 복호화 장치(200)의 각각은 콜 픽처 내에서 공간적으로 현재 블록에 대응하는 위치에 존재하는 블록을 결정할 수 있고, 결정된 블록을 기준으로 기정의된 상대적인 위치를 결정할 수 있다. 기정의된 상대적인 위치는 공간적으로 현재 블록에 대응하는 위치에 존재하는 블록의 내부 및/또는 외부의 위치일 수 있다. 또한, 부호화 장치(100) 및 복호화 장치(200)의 각각은 결정된 기정의된 상대적인 위치에 기반하여 콜 블록을 도출할 수 있다. 여기서, 콜 픽처는 참조 픽처 리스트에 포함된 적어도 하나의 참조 픽처 중에서 하나의 픽처일 수 있다.Each of the encoding apparatus 100 and the decoding apparatus 200 may determine a block existing at a position spatially corresponding to the current block in the collocated picture, and may determine a predefined relative position based on the determined block. The predefined relative position may be a position inside and/or outside a block that exists spatially at a position corresponding to the current block. Also, each of the encoding apparatus 100 and the decoding apparatus 200 may derive a collocated block based on the determined and predefined relative positions. Here, the collocated picture may be one picture from among at least one reference picture included in the reference picture list.

움직임 정보의 도출 방식은 현재 블록의 예측 모드에 따라 변할 수 있다. 예를 들면, 인터 예측을 위해 적용되는 예측 모드로서, 향상된 움직임 벡터 예측자(Advanced Motion Vector Predictor; AMVP) 및 머지(merge) 등이 있을 수 있다.A method of deriving motion information may change according to a prediction mode of the current block. For example, as a prediction mode applied for inter prediction, there may be an advanced motion vector predictor (AMVP) and a merge.

예를 들면, 예측 모드로서, AMVP가 적용되는 경우, 부호화 장치(100) 및 복호화 장치(200)의 각각은 복원된 주변 블록의 움직임 벡터 및/또는 콜 블록의 움직임 벡터를 이용하여 예측 움직임 벡터 후보 리스트를 생성할 수 있다. 복원된 주변 블록의 움직임 벡터 및/또는 콜 블록의 움직임 벡터는 예측 움직임 벡터 후보로 사용될 수 있다.For example, when AMVP is applied as a prediction mode, each of the encoding apparatus 100 and the decoding apparatus 200 uses a motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block as a prediction motion vector candidate. You can create a list. A motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block may be used as a prediction motion vector candidate.

부호화 장치(100)에 의해 생성된 비트스트림은 예측 움직임 벡터 인덱스를 포함할 수 있다. 예측 움직임 벡터 인덱스는 예측 움직임 벡터 후보 리스트에 포함된 예측 움직임 벡터 후보 중에서 선택된 최적의 예측 움직임 벡터를 지시할 수 있다. 비트스트림을 통해 예측 움직임 벡터 인덱스는 부호화 장치(100)로부터 복호화 장치(200)로 전송될 수 있다.The bitstream generated by the encoding apparatus 100 may include a prediction motion vector index. The prediction motion vector index may indicate an optimal prediction motion vector selected from prediction motion vector candidates included in the prediction motion vector candidate list. The prediction motion vector index may be transmitted from the encoding apparatus 100 to the decoding apparatus 200 through the bitstream.

복호화 장치(200)는 예측 움직임 벡터 인덱스를 이용하여 예측 움직임 벡터 후보 리스트에 포함된 예측 움직임 벡터 후보 중에서 현재 블록의 예측 움직임 벡터를 선택할 수 있다.The decoding apparatus 200 may select the prediction motion vector of the current block from among the prediction motion vector candidates included in the prediction motion vector candidate list by using the prediction motion vector index.

부호화 장치(100)는 현재 블록의 움직임 벡터 및 예측 움직임 벡터 간의 움직임 벡터 차분(MVD: Motion Vector Difference)을 계산할 수 있고, MVD를 부호화할 수 있다. 비트스트림은 부호화된 MVD를 포함할 수 있다. MVD는 비트스트림을 통해 부호화 장치(100)로부터 복호화 장치(200)로 전송될 수 있다. 이 때, 복호화 장치(200)는 수신된 MVD를 복호화할 수 있다. 복호화 장치(200)는 복호화된 MVD 및 예측 움직임 벡터의 합을 통해 현재 블록의 움직임 벡터를 도출할 수 있다.The encoding apparatus 100 may calculate a motion vector difference (MVD) between the motion vector of the current block and the predicted motion vector, and may encode the MVD. The bitstream may include an encoded MVD. The MVD may be transmitted from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. In this case, the decoding apparatus 200 may decode the received MVD. The decoding apparatus 200 may derive the motion vector of the current block through the sum of the decoded MVD and the predicted motion vector.

비트스트림은 참조 픽처를 지시하는 참조 픽처 인덱스 등을 포함할 수 있다. 참조 픽처 인덱스는 비트스트림을 통해 부호화 장치(100)로부터 복호화 장치(200)로 전송될 수 있다. 복호화 장치(200)는 주변 블록의 움직임 정보들을 이용하여 현재 블록의 움직임 벡터를 예측할 수 있고, 예측된 움직임 벡터 및 움직임 벡터 차분을 이용하여 현재 블록의 움직임 벡터를 유도할 수 있다. 복호화 장치(200)는 유도된 움직임 벡터와 참조 픽처 인덱스 정보에 기반하여 현재 블록에 대한 예측 블록을 생성할 수 있다.The bitstream may include a reference picture index indicating a reference picture, and the like. The reference picture index may be transmitted from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. The decoding apparatus 200 may predict the motion vector of the current block using motion information of the neighboring block, and may derive the motion vector of the current block using the predicted motion vector and the motion vector difference. The decoding apparatus 200 may generate a prediction block for the current block based on the derived motion vector and reference picture index information.

움직임 정보의 도출 방식의 다른 예로, 머지(merge)가 있다. 머지란 복수의 블록들에 대한 움직임의 병합을 의미할 수 있다. 머지는 하나의 블록의 움직임 정보를 다른 블록에도 함께 적용시키는 것을 의미할 수 있다. 머지가 적용되는 경우, 부호화 장치(100) 및 복호화 장치(200)의 각각은 복원된 주변 블록의 움직임 정보 및/또는 콜 블록의 움직임 정보를 이용하여 머지 후보 목록(merge candidate list)를 생성할 수 있다. 움직임 정보는 1) 움직임 벡터, 2) 참조 영상에 대한 인덱스, 및 3) 예측 방향 중 적어도 하나를 포함할 수 있다. 예측 방향은 단방향 또는 양방향일 수 있다.Another example of a method of deriving motion information is a merge. Merge may refer to merging of motions for a plurality of blocks. Merge may mean applying motion information of one block to another block as well. When merge is applied, each of the encoding apparatus 100 and the decoding apparatus 200 may generate a merge candidate list using motion information of a reconstructed neighboring block and/or motion information of a collocated block. have. The motion information may include at least one of 1) a motion vector, 2) an index to a reference image, and 3) a prediction direction. The prediction direction may be unidirectional or bidirectional.

이때, 머지는 CU 단위 또는 PU 단위로 적용될 수 있다. CU 단위 또는 PU 단위로 머지가 수행되는 경우, 부호화 장치(100)는 비트스트림을 통해 기정의된 정보를 복호화 장치(200)로 전송할 수 있다. 비트스트림은 기정의된 정보를 포함할 수 있다. 기정의된 정보는, 1) 블록 파티션(partition)별로 머지를 수행할지 여부를 나타내는 정보, 2) 현재 블록에 인접한 주변 블록들 중 어떤 블록과 머지를 할 것인가에 대한 정보를 포함할 수 있다. 예를 들면, 현재 블록의 주변 블록들은 현재 블록의 좌측 인접 블록, 현재 블록의 상단 인접 블록 및 현재 블록의 시간적(temporal) 인접 블록 등을 포함할 수 있다.In this case, the merge may be applied in units of CUs or units of PUs. When the merge is performed in units of CUs or PUs, the encoding apparatus 100 may transmit predefined information to the decoding apparatus 200 through a bitstream. The bitstream may include predefined information. The predefined information may include 1) information indicating whether to perform a merge for each block partition, and 2) information on which block to be merged with among neighboring blocks adjacent to the current block. For example, the neighboring blocks of the current block may include a left neighboring block of the current block, an upper neighboring block of the current block, and a temporal neighboring block of the current block.

머지 후보 목록은 움직임 정보들이 저장된 목록을 나타낼 수 있다. 또한, 머지 후보 목록은 머지가 수행되기 전에 생성될 수 있다. 머지 후보 목록에 저장되는 움직임 정보는, 1) 현재 블록에 인접한 주변 블록의 움직임 정보 또는 2) 참조 영상 에서 현재 블록에 대응되는(collocated) 블록의 움직임 정보일 수 있다. 또한, 머지 후보 목록에 저장된 움직임 정보는 이미 머지 후보 목록에 존재하는 움직임 정보들의 조합에 의해 생성된 새로운 움직임 정보일 수 있다.The merge candidate list may indicate a list in which motion information is stored. Also, the merge candidate list may be generated before merging is performed. The motion information stored in the merge candidate list may be 1) motion information of a neighboring block adjacent to the current block or 2) motion information of a block collocated to the current block in a reference image. Also, the motion information stored in the merge candidate list may be new motion information generated by a combination of motion information already existing in the merge candidate list.

스킵 모드는 주변 블록의 정보를 그대로 현재 블록에 적용하는 모드일 수 있다. 스킵 모드는 인터 예측에 이용되는 모드 중 하나일 수 있다. 스킵 모드가 사용되는 경우, 부호화 장치(100)는 어떤 블록의 움직임 정보를 현재 블록의 움직임 정보로서 이용할 것인지에 대한 정보만을 비트스트림을 통해 복호화 장치(200)에 전송할 수 있다. 부호화 장치(100)는 다른 정보는 복호화 장치(200)에 전송하지 않을 수 있다. 예를 들면, 다른 정보는 신택스(syntax) 정보일 수 있다. 신택스 정보는 움직임 벡터 차분 정보를 포함할 수 있다.The skip mode may be a mode in which information of a neighboring block is applied to the current block as it is. The skip mode may be one of modes used for inter prediction. When the skip mode is used, the encoding apparatus 100 may transmit only information about which block of motion information to use as the motion information of the current block to the decoding apparatus 200 through the bitstream. The encoding apparatus 100 may not transmit other information to the decoding apparatus 200 . For example, the other information may be syntax information. The syntax information may include motion vector difference information.

아래의 실시예들에서는 잔차 신호 예측이 설명된다. 일반적으로, 고효율 비디오 코딩(High Efficiency Video Coding; HEVC) 및 향상된 비디오 코딩(Advanced Video Coding; AVC) 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서는, 현재 블록을 부호화 및/또는 복호화하기 위해 현재 블록의 잔차 신호가 생성된다. 잔차 신호가 생성되면, 현재 블록의 주변 블록의 잔차 신호를 사용하는 잔차 신호 예측을 통해 한 번 더 예측된 잔차 신호가 생성될 수 있다.Residual signal prediction is described in the embodiments below. In general, in existing video encoding and/or decoding technologies such as High Efficiency Video Coding (HEVC) and Advanced Video Coding (AVC), in order to encode and/or decode a current block, the current block A residual signal of When the residual signal is generated, the residual signal predicted once more may be generated through residual signal prediction using the residual signal of a block adjacent to the current block.

잔차 신호 예측은, 현재 블록의 잔차 신호를 주변 블록의 잔차 신호에 대하여 예측하는 것일 수 있다. 또는, 잔차 신호 예측은, 현재 블록의 잔차 신호 및 주변 블록의 잔차 신호 간의 차이를 현재 블록의 새로운 잔차 신호로서 사용하는 것일 수 있다.The residual signal prediction may be to predict a residual signal of a current block with respect to a residual signal of a neighboring block. Alternatively, the residual signal prediction may be to use a difference between the residual signal of the current block and the residual signal of a neighboring block as a new residual signal of the current block.

잔차 신호 예측을 통해 획득된 잔차 신호는 기존의 인트라 예측 방법을 사용하여 획득된 잔차 신호에 비해 부호화 효율의 측면에서 이점을 가질 수 있다. 예를 들면, 잔차 신호 예측을 사용하여 획득된 잔차 신호를 사용함으로써 잔차 신호에 대한 비트 발생량을 감소시킬 수 있다.A residual signal obtained through residual signal prediction may have an advantage in terms of encoding efficiency compared to a residual signal obtained using a conventional intra prediction method. For example, the amount of bit generation for the residual signal can be reduced by using a residual signal obtained using residual signal prediction.

아래의 실시예들에서는, 잔차 신호 예측을 사용하여 획득된 잔차 신호가 제1 잔차 신호로, 기존의 인트라 예측 방법을 사용하여 획득된 잔차 신호가 제2 잔차 신호로 칭해질 수 있다.In the following embodiments, a residual signal obtained using residual signal prediction may be referred to as a first residual signal, and a residual signal obtained using a conventional intra prediction method may be referred to as a second residual signal.

또한, 아래의 실시예들에서는 참조 샘플의 갱신이 설명된다. 참조 샘플은 예측 블록을 생성하기 위해 사용된다. 따라서, 참조 샘플이 부호화 또는 복호화의 대상인 현재 블록의 예상되는 특징과 유사한 특징을 갖는다면, 부호화의 효율 또는 복호화의 효율이 향상될 수 있다. 아래에서는, 예측 블록의 생성 전에 기정의된 조건에 따라서 참조 샘플을 갱신하는 실시예들이 설명된다.In addition, the updating of the reference sample is described in the embodiments below. A reference sample is used to generate a predictive block. Accordingly, if the reference sample has characteristics similar to the expected characteristics of the current block to be encoded or decoded, the efficiency of encoding or decoding may be improved. Hereinafter, embodiments of updating a reference sample according to a predefined condition before generation of a prediction block are described.

도 8은 일 실시예에 따른 부호화 장치의 구조도이다.8 is a structural diagram of an encoding apparatus according to an embodiment.

부호화 장치(800)는 전술된 부호화 장치(100)에 대응할 수 있다. 부호화 장치(800)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)를 포함할 수 있고, 인트라 잔차 예측부(810)를 더 포함할 수 있다.The encoding apparatus 800 may correspond to the above-described encoding apparatus 100 . The encoding apparatus 800 includes a motion prediction unit 111 , a motion compensation unit 112 , an intra prediction unit 120 , a switch 115 , a subtractor 125 , a transform unit 130 , a quantization unit 140 , and entropy. It may include an encoder 150 , an inverse quantizer 160 , an inverse transform unit 170 , an adder 175 , a filter unit 180 , and a reference picture buffer 190 , and an intra residual predictor 810 . may include more.

움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)는 도 1을 참조하여 전술된 것과 같은 기능 및/또는 동작을 수행할 수 있다. 중복되는 설명은 생략한다.Motion prediction unit 111, motion compensation unit 112, intra prediction unit 120, switch 115, subtractor 125, transform unit 130, quantization unit 140, entropy encoding unit 150, The inverse quantizer 160, the inverse transform unit 170, the adder 175, the filter unit 180, and the reference picture buffer 190 may perform the same functions and/or operations as described above with reference to FIG. 1 . . A duplicate description will be omitted.

또한, 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)는 인트라 잔차 예측부(810)와 관련된 기능 및/또는 동작을 수행할 수 있다. 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180), 참조 픽처 버퍼(190) 및 인트라 잔차 예측부(810)의 기능 및/또는 동작에 대해서 아래에서 상세하게 설명된다.In addition, the motion predictor 111 , the motion compensator 112 , the intra predictor 120 , the switch 115 , the subtractor 125 , the transform unit 130 , the quantizer 140 , and the entropy encoder 150 . ), the inverse quantizer 160 , the inverse transform unit 170 , the adder 175 , the filter unit 180 , and the reference picture buffer 190 perform functions and/or operations related to the intra residual prediction unit 810 . can Motion compensator 112, intra prediction unit 120, switch 115, subtractor 125, transform unit 130, quantization unit 140, entropy encoding unit 150, inverse quantization unit 160, The functions and/or operations of the inverse transform unit 170 , the adder 175 , the filter unit 180 , the reference picture buffer 190 , and the intra residual prediction unit 810 will be described in detail below.

인트라 잔차 예측부(810)는 인트라 예측부(120)와 구분되지 않을 수 있다. 인트라 예측부(120) 및 인트라 잔차 예측부(810)는 인트라 예측부(120)로 통합될 수 있다. 실시예들에서, 인트라 잔차 예측부(810)에 의해 수행되는 것으로 설명된 기능 및/또는 동작은 인트라 예측부(120)에 의해 수행될 수 있다.The intra residual predictor 810 may not be distinguished from the intra predictor 120 . The intra prediction unit 120 and the intra residual prediction unit 810 may be integrated into the intra prediction unit 120 . In embodiments, functions and/or operations described as being performed by the intra residual predictor 810 may be performed by the intra predictor 120 .

또한, 일 실시예에 따른 부호화 장치(800)에 대응하는 복호화 장치(2300)에 대해서 아래에서 도 23을 참조하여 상세하게 설명된다.Also, the decoding apparatus 2300 corresponding to the encoding apparatus 800 according to an embodiment will be described in detail below with reference to FIG. 23 .

도 9a 및 도 9b는 일 실시예에 따른 부호화 방법의 흐름도이다.9A and 9B are flowcharts of an encoding method according to an embodiment.

이하에서, 현재 블록은 현재 부호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block to be currently encoded or may be a block in the current image.

우선, 도 9a를 참조하면, 단계(910)가 수행될 수 있다.First, referring to FIG. 9A , step 910 may be performed.

단계(910)의 수행의 이전에, 참조 샘플이 생성될 수 있다. 일 예에 따른 참조 샘플의 생성에 대해서 아래에서 도 11을 참조하여 상세하게 설명된다.Prior to performing step 910, a reference sample may be generated. Generation of a reference sample according to an example will be described in detail below with reference to FIG. 11 .

참조 샘플의 생성에 있어서, 고효율 비디오 코딩 및 향상된 비디오 코딩 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 참조 샘플 생성 방법이 사용될 수 있다.In generating the reference sample, a reference sample generating method of an existing image encoding and/or decoding technique, such as high-efficiency video coding and enhanced video coding, may be used.

단계(910)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성(refine)하는 것일 수 있다.In operation 910 , the intra predictor 120 may determine whether to update the reference sample. Here, the updating of the reference sample may be refining the sample value of the reference sample used for generation of the prediction block before generation of the prediction block of the current block.

참조 샘플의 갱신을 수행하기로 결정된 경우, 단계(915)가 수행될 수 있다. 참조 샘플 갱신을 수행하지 않기로 결정된 경우, 단계(920) 및 단계(970)가 수행될 수 있다.If it is determined to perform an update of the reference sample, step 915 may be performed. If it is determined not to perform the reference sample update, steps 920 and 970 may be performed.

단계(915)에서, 인트라 예측부(120)는 참조 샘플의 값을 갱신할 수 있으며, 갱신을 통해 현재 블록의 예측 블록을 생성하기 위해 사용되는 참조 샘플의 값을 결정할 수 있다.In operation 915 , the intra prediction unit 120 may update the value of the reference sample, and through the update, determine the value of the reference sample used to generate the prediction block of the current block.

인트라 예측부(120)는 주변 샘플의 방향성 패턴에 따라 참조 샘플의 값을 갱신할 수 있다.The intra prediction unit 120 may update the value of the reference sample according to the directional pattern of the surrounding sample.

일 예에 따른 참조 샘플의 갱신에 대해서 아래에서 도 12, 13 및 도 14를 참조하여 상세하게 설명된다.The update of the reference sample according to an example will be described in detail below with reference to FIGS. 12, 13 and 14 .

단계(915)가 실행된 후, 단계(920) 및 단계(970)가 수행될 수 있다.After step 915 is executed, steps 920 and 970 may be performed.

단계(920)에서, 인트라 예측부(120)는 인트라 예측을 수행할 수 있다. 인트라 예측부(120)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In operation 920, the intra prediction unit 120 may perform intra prediction. The intra prediction unit 120 may generate a prediction block of the current block. The intra prediction unit 120 may generate the prediction block of the current block by using the reference sample according to the intra prediction mode for the current block.

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a method of generating a prediction block of an existing image encoding and/or decoding technology such as HEVC and AVC may be used.

단계(920)가 수행된 후, 단계(930)가 수행될 수 있다.After step 920 is performed, step 930 may be performed.

단계(930)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 결정할 수 있다.In operation 930 , the intra residual predictor 810 may determine whether to perform residual signal prediction.

잔차 신호 예측을 수행하기로 결정된 경우, 단계(935), 단계(940) 및 단계(980)가 수행될 수 있다.If it is determined to perform residual signal prediction, steps 935 , 940 , and 980 may be performed.

잔차 신호 예측을 수행하지 않기로 결정된 경우, 단계(960) 및 단계(980)이 수행될 수 있다.If it is determined not to perform residual signal prediction, steps 960 and 980 may be performed.

단계(935)에서, 인트라 잔차 예측부(810)는 현재 블록의 하나 이상의 주변 블록들 중 제1 주변 블록을 결정할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있다. 일 예에 따른 주변 블록의 결정에 대하여 아래에서 도 20을 참조하여 상세하게 설명된다.In operation 935 , the intra residual predictor 810 may determine a first neighboring block from among one or more neighboring blocks of the current block. The first neighboring block may be a block used for residual signal prediction. Determination of a neighboring block according to an example will be described in detail below with reference to FIG. 20 .

단계(935)가 수행된 후, 단계(950) 및 단계(985)가 수행될 수 있다.After step 935 is performed, steps 950 and 985 may be performed.

단계(940)에서, 인트라 예측부(120)는 인트라 예측을 사용하여 현재 블록의 제2 잔차 신호를 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드 및 참조 샘플에 기반하여 현재 블록의 제2 잔차 신호를 생성할 수 있다.In operation 940 , the intra prediction unit 120 may generate a second residual signal of the current block using intra prediction. The intra prediction unit 120 may generate a second residual signal of the current block based on the intra prediction mode and the reference sample for the current block.

제2 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호에 대응할 수 있다. 예를 들면, 제2 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The second residual signal may correspond to a residual signal of a current block in existing image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the second residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

일 예에 따른 제2 잔차 신호의 생성에 대하여 아래에서 도 16, 도 17 및 도 18을 참조하여 상세하게 설명된다.Generation of the second residual signal according to an example will be described in detail below with reference to FIGS. 16 , 17 , and 18 .

단계(940)가 수행된 후, 단계(950)가 수행될 수 있다.After step 940 is performed, step 950 may be performed.

잔차 신호 예측이 수행되기로 결정됨에 따라 단계(935) 및 단계(940)가 수행되면, 다음으로 단계(950)가 수행될 수 있다.If steps 935 and 940 are performed as it is determined that residual signal prediction is to be performed, then step 950 may be performed.

단계(950)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측에 따른 현재 블록의 제1 잔차 신호를 생성할 수 있다.In operation 950 , the intra residual predictor 810 may generate a first residual signal of the current block according to residual signal prediction.

인트라 잔차 예측부(810)는 잔차 신호 예측을 위해, 제1 주변 블록의 잔차 신호를 사용할 수 있다.The intra residual predictor 810 may use the residual signal of the first neighboring block to predict the residual signal.

인트라 잔차 예측부(810)는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호에 기반하여 현재 블록의 제1 잔차 신호를 생성할 수 있다.The intra residual predictor 810 may generate a first residual signal of the current block based on the second residual signal of the current block and the residual signal of the first neighboring block.

제1 잔차 신호는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호 간의 차이일 수 있다. 또는, 제1 잔차 신호는 현재 블록의 제2 잔차 신호로부터 제1 주변 블록의 잔차 신호를 뺀 결과일 수 있다. 인트라 잔차 예측부(810)는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호 간의 차이를 제1 잔차 신호로서 생성할 수 있다.The first residual signal may be a difference between the second residual signal of the current block and the residual signal of the first neighboring block. Alternatively, the first residual signal may be a result of subtracting the residual signal of the first neighboring block from the second residual signal of the current block. The intra residual predictor 810 may generate a difference between the second residual signal of the current block and the residual signal of the first neighboring block as the first residual signal.

제1 잔차 신호는 잔차 신호 예측에 의해 생성된 현재 블록의 잔차 신호일 수 있다. 또는, 제1 잔차 신호는 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 생성된 현재 블록의 잔차 신호일 수 있다.The first residual signal may be a residual signal of a current block generated by residual signal prediction. Alternatively, the first residual signal may be a residual signal of a current block generated based on a residual signal of a first neighboring block of the current block.

단계(940)에서 생성된 제2 잔차 신호에 대해 잔차 신호 예측을 적용함으로써 현재 블록에 대해서 더 효율적인 부호화가 가능해질 수 있다.By applying residual signal prediction to the second residual signal generated in operation 940 , more efficient encoding may be possible with respect to the current block.

일 예에 따른 제1 잔차 신호의 생성에 대하여 아래에서 도 19를 참조하여 상세하게 설명된다.Generation of the first residual signal according to an example will be described in detail below with reference to FIG. 19 .

잔차 신호 예측이 수행되지 않기로 결정되면, 단계(960)에서, 인트라 예측부(120) 또는 인트라 잔차 예측부(810)는 현재 블록의 제3 잔차 신호를 생성할 수 있다.If it is determined that the residual signal prediction is not to be performed, in operation 960 , the intra predictor 120 or the intra residual predictor 810 may generate a third residual signal of the current block.

제3 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호일 수 있다. 예를 들면, 제3 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The third residual signal may be a residual signal of a current block in conventional image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

또한, 제3 잔차 신호는 단계(940)에서의 제2 잔차 신호와 동일한 신호일 수 있다. 말하자면, 단계(940) 및 단계(960)은 동일한 방식으로 현재 블록의 잔차 신호를 생성할 수 있다.Also, the third residual signal may be the same signal as the second residual signal in step 940 . In other words, steps 940 and 960 may generate the residual signal of the current block in the same manner.

단계(970)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 부호화할 수 있다.In operation 970 , the intra prediction unit 120 may encode information indicating whether the update of the reference sample is performed.

기존의 인트라 예측과 달리, 참조 샘플의 갱신이 수행되는 경우, 인트라 예측부(120)는 참조 샘플의 갱신의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.Unlike the existing intra prediction, when the reference sample is updated, the intra prediction unit 120 provides the information so that the decoding apparatus 2300, which will be described later with reference to FIG. 23, knows whether or not the reference sample is updated. can be coded. For example, if the update of the reference sample is used, the value of the information may be set to '1', and if the update of the reference sample is not used, the value of the information may be set to '0'.

예를 들면, 인트라 예측부(120)는 플래그를 사용하여 참조 샘플의 갱신의 여부를 나타낼 수 있고, 플래그를 통해 참조 샘플의 갱신의 여부가 표시될 수 있다.For example, the intra predictor 120 may indicate whether the reference sample is updated using a flag, and whether the reference sample is updated may be indicated through the flag.

단계(980)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보를 부호화할 수 있다.In operation 980 , the intra residual predictor 810 may encode information indicating whether residual signal prediction is performed.

잔차 신호 예측이 수행되는 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.When the residual signal prediction is performed, the intra residual predictor 810 may encode the information so that the decoding apparatus 2300, which will be described later with reference to FIG. 23, knows whether the residual signal is predicted. For example, if the update of the reference sample is used, the value of the information may be set to '1', and if the update of the reference sample is not used, the value of the information may be set to '0'.

예를 들면, 인트라 예측부(120)는 "intra_residual_prediciton_flag" 플래그를 사용하여 참조 샘플의 갱신의 여부를 나타낼 수 있고, 플래그를 통해 참조 샘플의 갱신의 여부가 표시될 수 있다.For example, the intra prediction unit 120 may indicate whether the reference sample is updated by using the "intra_residual_prediciton_flag" flag, and whether the reference sample is updated may be indicated through the flag.

단계(985)에서, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자를 부호화할 수 있다.In operation 985 , the intra residual predictor 810 may encode the identifier of the first neighboring block.

제1 주변 블록의 식별자는 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록이 식별되는 것을 가능하게 하는 정보일 수 있다.The identifier of the first neighboring block may be information that enables the neighboring block used for prediction of the residual signal of the current block to be identified.

예를 들면, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록을 나타낼 수 있다. 또는, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록의 위치를 나타내는 위치 정보일 수 있다. 상기의 위치는 현재 블록에 대한 선택된 주변 블록의 상대적인 위치를 나타낼 수 있다. 상기의 위치는 현재 블록에 대하여 선택된 주변 블록이 인접한 방향을 나타낼 수 있다.For example, the identifier of the first neighboring block may indicate a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. Alternatively, the identifier of the first neighboring block may be position information indicating a position of a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. The position may indicate a relative position of the selected neighboring block with respect to the current block. The position may indicate a direction in which a neighboring block selected with respect to the current block is adjacent.

제1 주변 블록의 식별자는 부호화 장치(800) 및 복호화 장치(2300)의 양자에 있어서 동일한 블록을 가리키도록 구성되어야 할 수 있다. 예를 들면, 제1 주변 블록의 식별자와 관련하여 블록의 크기 N 및 주변 블록의 위치가 부호화 장치(800) 및 복호화 장치(2300)에서 공통되어야 할 수 있다. 부호화 장치(800) 및 복호화 장치(2300)가 제1 주변 블록의 식별자와 관련하여 공통된 구성을 공유하게 하기 위해, 제1 주변 블록의 식별자는 "(이웃-잔차_인덱스) 절삭형 단항((neighboring-residual_idx) Truncated unary)" 방식으로 부호화될 수 있다.The identifier of the first neighboring block may be configured to indicate the same block in both the encoding apparatus 800 and the decoding apparatus 2300 . For example, in relation to the identifier of the first neighboring block, the size N of the block and the position of the neighboring block may have to be common to the encoding apparatus 800 and the decoding apparatus 2300 . In order for the encoding apparatus 800 and the decoding apparatus 2300 to share a common configuration with respect to the identifier of the first neighboring block, the identifier of the first neighboring block is "(neighboring-residual_index) truncation unary ((neighboring) -residual_idx) Truncated unary)" may be encoded.

전차 신호 예측이 수행되는 경우, 단계(950), 단계(970), 단계(980) 및 단계(985)가 수행된 후 단계(990)가 수행될 수 있다. 또한, 잔차 신호 예측이 수행되지 않는 경우, 단계(960), 단계(970), 단계(980) 및 단계(985)가 수행된 후 단계(990)가 수행될 수 있다.If the streetcar signal prediction is performed, step 990 may be performed after steps 950 , 970 , 980 , and 985 are performed. Also, if residual signal prediction is not performed, step 990 may be performed after step 960 , step 970 , step 980 , and step 985 are performed.

다음으로, 도 9b를 참조한다.Next, reference is made to FIG. 9B.

단계(990)에서, 부호화 장치(800)는 현재 블록의 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다. 단계(990)는 변환부(130), 양자화부(140) 및 엔트로피 부호화부(150) 중 적어도 하나에 의해 수행될 수 있다.In operation 990 , the encoding apparatus 800 may encode the current block using the residual signal of the current block. Operation 990 may be performed by at least one of the transform unit 130 , the quantizer 140 , and the entropy encoder 150 .

단계(990)에서 현재 블록의 부호화를 위해 사용되는 잔차 신호는 2개의 잔차 신호들 중 하나일 수 있다.In operation 990 , the residual signal used for encoding of the current block may be one of two residual signals.

단계(930)에서 잔차 신호 예측을 수행하기로 결정된 경우, 단계(950)에서 생성된 현재 블록의 제1 잔차 신호가 단계(990)에서 사용되는 잔차 신호일 수 있다. 말하자면, 잔차 신호 예측에 의해 생성된 잔차 신호가 현재 블록의 부호화를 위해 사용될 수 있고, 부호화 장치(800)는 현재 블록의 제1 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다.When it is determined to perform residual signal prediction in operation 930 , the first residual signal of the current block generated in operation 950 may be the residual signal used in operation 990 . That is, the residual signal generated by the residual signal prediction may be used for encoding the current block, and the encoding apparatus 800 may perform encoding of the current block using the first residual signal of the current block.

단계(930)에서 잔차 신호 예측이 수행하지 않기로 결정된 경우, 단계(960)에서 생성된 현재 블록의 제3 잔차 신호가 단계(990)에서 사용되는 잔차 신호일 수 있다.When it is determined not to perform residual signal prediction in operation 930 , the third residual signal of the current block generated in operation 960 may be the residual signal used in operation 990 .

단계(990)은 단계(991), 단계(992) 및 단계(993)을 포함할 수 있다.Step 990 may include steps 991 , 992 , and 993 .

단계(991)에서, 변환부(130)는 잔차 신호에 대한 변환을 수행하여 변환 계수를 생성할 수 있다.In operation 991 , the transform unit 130 may perform transform on the residual signal to generate transform coefficients.

단계(992)에서, 양자화부(140)는 변환 계수를 사용하여 양자화된 변환 계수 레벨을 생성할 수 있다.In operation 992, the quantization unit 140 may generate a quantized transform coefficient level by using the transform coefficient.

단계(993)에서, 엔트로피 부호화부(150)는 변환 계수 레벨에 대한 엔트로피 부호화를 수행할 수 있다.In operation 993, the entropy encoding unit 150 may perform entropy encoding on the transform coefficient level.

전술된 정보의 부호화에 관계된 단계들 중, 단계(970), 단계(980) 및 단계(985)는 전술된 것과는 상이한 주체 및 상이한 순서에 의해 수행될 수 있다. 예를 들면, 단계(993)는 단계(970), 단계(980) 및 단계(985)를 포함할 수 있다. 또한, 엔트로부 부호화부(150)는 참조 샘플의 갱신의 수행의 여부를 나타내는 정보, 잔차 신호 예측의 수행의 여부를 나타내는 정보 및 제1 주변 블록의 식별자 중 적어도 하나를 부호화할 수 있다.Among the steps related to the above-described encoding of information, steps 970, 980, and 985 may be performed by a different subject and in a different order than those described above. For example, step 993 may include steps 970 , 980 , and 985 . Also, the entropy encoder 150 may encode at least one of information indicating whether the reference sample is updated, information indicating whether residual signal prediction is performed, and the identifier of the first neighboring block.

도 10a는 일 실시예에 따른 부호화 방법의 흐름도이다.10A is a flowchart of an encoding method according to an embodiment.

도 10b는 일 실시예에 따른 참조 샘플의 갱신 방법의 흐름도이다.10B is a flowchart of a method for updating a reference sample according to an embodiment.

도 10c는 일 실시예에 따른 잔차 신호의 예측 방법의 흐름도이다.10C is a flowchart of a method for predicting a residual signal according to an embodiment.

도 10d는 일 실시예에 따른 현재 블록의 부호화 방법의 흐름도이다.10D is a flowchart of a method for encoding a current block according to an embodiment.

도 9를 참조해서 전술된 실시예에 비해, 도 10a, 도 10b 및 도 10c를 참조하여 설명되는 실시예에서는, 참조 샘플의 갱신 및 잔차 신호의 예측이 분리되어 수행될 수 있다.Compared to the embodiment described above with reference to FIG. 9 , in the embodiment described with reference to FIGS. 10A, 10B and 10C , the update of the reference sample and the prediction of the residual signal may be performed separately.

이하에서, 현재 블록은 현재 부호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block to be currently encoded or may be a block in the current image.

우선, 도 10a를 참조한다.First, refer to FIG. 10A.

단계(1010)에서, 인트라 예측부(120)는 현재 블록의 참조 샘플을 생성할 수 있다. 인트라 예측부(120)는 인트라 예측을 위한 현재 블록의 주변의 참조 샘플을 생성할 수 있다. 일 예에 따른 참조 샘플의 생성에 대해서 아래에서 도 11을 참조하여 상세하게 설명된다.In operation 1010, the intra prediction unit 120 may generate a reference sample of the current block. The intra prediction unit 120 may generate a reference sample around the current block for intra prediction. Generation of a reference sample according to an example will be described in detail below with reference to FIG. 11 .

참조 샘플의 생성에 있어서, 고효율 비디오 코딩 및 향상된 비디오 코딩 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 참조 샘플 생성 방법이 사용될 수 있다.In generating the reference sample, a reference sample generating method of an existing image encoding and/or decoding technique, such as high-efficiency video coding and enhanced video coding, may be used.

부호화 장치(800)는 참조 샘플의 갱신의 기능을 선택적으로 제공할 수 있다. 참조 샘플의 갱신의 기능이 사용되는 경우, 단계(1010)의 다음으로 단계(1020)가 수행될 수 있다. 참조 샘플의 갱신의 기능이 사용되지 않는 경우, 단계(1010)의 다음으로 단계(1030)가 수행될 수 있다. 말하자면, 실시예에서 참조 샘플의 갱신의 기능은 선택적으로 결합될 수 있다.The encoding apparatus 800 may selectively provide a function of updating a reference sample. If the function of updating the reference sample is used, step 1020 may be performed following step 1010 . If the function of updating the reference sample is not used, step 1030 may be performed following step 1010 . That is to say, the function of updating the reference sample in the embodiment can be selectively combined.

단계(1020)에서, 인트라 예측부(120)는 참조 샘플의 갱신에 관련된 기능을 제공할 수 있다.In operation 1020 , the intra prediction unit 120 may provide a function related to the update of the reference sample.

다음으로, 도 10b를 참조한다.Next, reference is made to FIG. 10B.

도 10b를 참조하면, 단계(1020)는 단계(1021), 단계(1022) 및 단계(1023)을 포함할 수 있다.Referring to FIG. 10B , step 1020 may include steps 1021 , 1022 , and 1023 .

단계(1021)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성하는 것일 수 있다.In operation 1021 , the intra prediction unit 120 may determine whether to update the reference sample. Here, the updating of the reference sample may be reconstructing the sample value of the reference sample used for generation of the prediction block before generation of the prediction block of the current block.

참조 샘플의 갱신을 수행하기로 결정된 경우, 단계(1022)가 수행될 수 있다. 참조 샘플 갱신을 수행하지 않기로 결정된 경우, 단계(1023)가 수행될 수 있다.If it is determined to perform an update of the reference sample, step 1022 may be performed. If it is determined not to perform the reference sample update, step 1023 may be performed.

단계(1022)에서, 인트라 예측부(120)는 참조 샘플의 값을 갱신할 수 있으며, 갱신을 통해 현재 블록의 예측 블록을 생성하기 위해 사용되는 참조 샘플의 값을 결정할 수 있다.In operation 1022, the intra prediction unit 120 may update the value of the reference sample, and through the update, determine the value of the reference sample used to generate the prediction block of the current block.

인트라 예측부(120)는 주변 샘플의 방향성 패턴에 따라 참조 샘플의 값을 갱신할 수 있다.The intra prediction unit 120 may update the value of the reference sample according to the directional pattern of the surrounding sample.

일 예에 따른 참조 샘플의 갱신에 대해서 아래에서 도 12, 13 및 도 14를 참조하여 상세하게 설명된다.The update of the reference sample according to an example will be described in detail below with reference to FIGS. 12, 13 and 14 .

단계(1022)가 수행된 후, 단계(1023)가 수행될 수 있다.After step 1022 is performed, step 1023 may be performed.

단계(1023)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 부호화할 수 있다.In operation 1023 , the intra predictor 120 may encode information indicating whether the update of the reference sample is performed.

기존의 인트라 예측과 달리, 참조 샘플의 갱신이 수행되는 경우, 인트라 예측부(120)는 참조 샘플의 갱신의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.Unlike the existing intra prediction, when the reference sample is updated, the intra prediction unit 120 provides the information so that the decoding apparatus 2300, which will be described later with reference to FIG. 23, knows whether or not the reference sample is updated. can be coded. For example, if the update of the reference sample is used, the value of the information may be set to '1', and if the update of the reference sample is not used, the value of the information may be set to '0'.

예를 들면, 인트라 예측부(120)는 플래그를 사용하여 참조 샘플의 갱신의 여부를 나타낼 수 있고, 플래그를 통해 참조 샘플의 갱신의 여부가 표시될 수 있다.For example, the intra predictor 120 may indicate whether the reference sample is updated using a flag, and whether the reference sample is updated may be indicated through the flag.

단계(1010) 또는 단계(1020)가 수행되면, 단계(1030)가 수행될 수 있다.If step 1010 or step 1020 is performed, step 1030 may be performed.

다시 도 10a를 참조한다.Reference is again made to FIG. 10A .

단계(1030)에서, 인트라 예측부(120)는 인트라 예측을 수행할 수 있다. 인트라 예측부(120)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In operation 1030 , the intra prediction unit 120 may perform intra prediction. The intra prediction unit 120 may generate a prediction block of the current block. The intra prediction unit 120 may generate a prediction block of the current block by using a reference sample according to an intra prediction mode for the current block.

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a method of generating a prediction block of an existing image encoding and/or decoding technology such as HEVC and AVC may be used.

부호화 장치(800)는 잔치 신호의 예측의 기능을 선택적으로 제공할 수 있다. 잔치 신호의 예측의 기능이 사용되는 경우, 단계(1030)의 다음으로 단계(1040)가 수행될 수 있다. 잔치 신호의 예측의 기능이 사용되지 않는 경우, 단계(1030)의 다음으로 단계(1050)가 수행될 수 있다. 말하자면, 실시예에서 잔치 신호의 예측의 기능은 선택적으로 결합될 수 있다.The encoding apparatus 800 may selectively provide a function of prediction of the residual signal. If the function of prediction of the residual signal is used, step 1040 may be performed following step 1030 . If the function of prediction of the residual signal is not used, step 1050 may be performed following step 1030 . That is to say, the function of prediction of the feast signal in an embodiment can be selectively combined.

인트라 잔차 예측부(810)는 인트라 예측을 통해 현재 블록의 잔차 신호가 획득되면, 주변 블록의 잔차 신호를 사용하여 현재 블록의 잔차 신호에 대한 예측을 수행할 수 있다. 일단 잔차 신호가 생성된 후, 잔차 신호에 대한 갱신이 이루어지기 때문에, 잔차 신호에 대한 "예측"은 잔차 신호에 대한 "재예측"으로 간주될 수도 있다.When the residual signal of the current block is obtained through intra prediction, the intra residual predictor 810 may perform prediction on the residual signal of the current block using the residual signal of the neighboring block. Since updates are made to the residual signal once it is generated, a "prediction" for the residual signal may be considered a "reprediction" for the residual signal.

단계(1040)에서, 인트라 잔차 예측부(810)는 잔치 신호의 예측에 관련된 기능을 제공할 수 있다.In operation 1040 , the intra residual predictor 810 may provide a function related to prediction of the residual signal.

도 10c를 참조하면, 단계(1040)는 단계(1041), 단계(1042), 단계(1046) 및 단계(1047)을 포함할 수 있다.Referring to FIG. 10C , step 1040 may include steps 1041 , 1042 , 1046 , and 1047 .

단계(1041)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 결정할 수 있다.In operation 1041 , the intra residual predictor 810 may determine whether to perform residual signal prediction.

잔차 신호 예측을 수행하기로 결정된 경우, 단계(1042)가 수행될 수 있다.If it is determined to perform residual signal prediction, step 1042 may be performed.

잔차 신호 예측을 수행하지 않기로 결정된 경우, 단계(1046)가 수행될 수 있다.If it is determined not to perform residual signal prediction, step 1046 may be performed.

단계(1042)에서, 인트라 잔차 예측부(810)는 잔차 신호의 예측을 수행할 수 있다.In operation 1042 , the intra residual predictor 810 may predict the residual signal.

단계(1042)는 단계(1043), 단계(1044) 및 단계(1045)를 포함할 수 있다.Step 1042 may include step 1043 , step 1044 , and step 1045 .

단계(1042)에서, 단계(1043) 및 단계(1044)가 수행될 수 있다. 단계(1043) 및 단계(1044)는 기정의된 순서로 수행될 수 있다. 예를 들면, 단계(1043)가 단계(1044)의 이전에 수행될 수 있다. 또는, 단계(1044)가 단계(1043)의 이전에 수행될 수 있다.In step 1042, steps 1043 and 1044 may be performed. Steps 1043 and 1044 may be performed in a predefined order. For example, step 1043 may be performed prior to step 1044 . Alternatively, step 1044 may be performed prior to step 1043 .

단계(1043)에서, 인트라 잔차 예측부(810)는 현재 블록의 하나 이상의 주변 블록들 중 제1 주변 블록을 결정할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있다. 일 예에 따른 주변 블록의 결정에 대하여 아래에서 도 22을 참조하여 상세하게 설명된다.In operation 1043 , the intra residual predictor 810 may determine a first neighboring block from among one or more neighboring blocks of the current block. The first neighboring block may be a block used for residual signal prediction. Determination of a neighboring block according to an example will be described in detail below with reference to FIG. 22 .

단계(1044)에서, 인트라 예측부(120)는 인트라 예측을 사용하여 현재 블록의 제2 잔차 신호를 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드 및 참조 샘플에 기반하여 현재 블록의 제2 잔차 신호를 생성할 수 있다.In operation 1044 , the intra prediction unit 120 may generate a second residual signal of the current block by using the intra prediction. The intra prediction unit 120 may generate a second residual signal of the current block based on the intra prediction mode and the reference sample for the current block.

제2 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호에 대응할 수 있다. 예를 들면, 제2 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The second residual signal may correspond to a residual signal of a current block in existing image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the second residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

일 예에 따른 제2 잔차 신호의 생성에 대하여 아래에서 도 16, 도 17 및 도 18을 참조하여 상세하게 설명된다.Generation of the second residual signal according to an example will be described in detail below with reference to FIGS. 16 , 17 , and 18 .

잔차 신호 예측이 수행되기로 결정됨에 따라 단계(1043) 및 단계(1044)가 수행되면, 다음으로 단계(1045)가 수행될 수 있다.If steps 1043 and 1044 are performed as it is determined that residual signal prediction is to be performed, then step 1045 may be performed.

단계(1045)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측에 따른 현재 블록의 제1 잔차 신호를 생성할 수 있다.In operation 1045 , the intra residual predictor 810 may generate a first residual signal of the current block according to residual signal prediction.

인트라 잔차 예측부(810)는 잔차 신호 예측을 위해, 제1 주변 블록의 잔차 신호를 사용할 수 있다.The intra residual predictor 810 may use the residual signal of the first neighboring block to predict the residual signal.

인트라 잔차 예측부(810)는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호에 기반하여 현재 블록의 제1 잔차 신호를 생성할 수 있다.The intra residual predictor 810 may generate a first residual signal of the current block based on the second residual signal of the current block and the residual signal of the first neighboring block.

제1 잔차 신호는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호 간의 차이일 수 있다. 또는, 제1 잔차 신호는 현재 블록의 제2 잔차 신호로부터 제1 주변 블록의 잔차 신호를 뺀 결과일 수 있다. 인트라 잔차 예측부(810)는 현재 블록의 제2 잔차 신호 및 제1 주변 블록의 잔차 신호 간의 차이를 제1 잔차 신호로서 생성할 수 있다.The first residual signal may be a difference between the second residual signal of the current block and the residual signal of the first neighboring block. Alternatively, the first residual signal may be a result of subtracting the residual signal of the first neighboring block from the second residual signal of the current block. The intra residual predictor 810 may generate a difference between the second residual signal of the current block and the residual signal of the first neighboring block as the first residual signal.

제1 잔차 신호는 잔차 신호 예측에 의해 생성된 현재 블록의 잔차 신호일 수 있다. 또는, 제1 잔차 신호는 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 생성된 현재 블록의 잔차 신호일 수 있다.The first residual signal may be a residual signal of a current block generated by residual signal prediction. Alternatively, the first residual signal may be a residual signal of a current block generated based on a residual signal of a first neighboring block of the current block.

단계(1044)에서 생성된 제2 잔차 신호에 대해 잔차 신호 예측을 적용함으로써 현재 블록에 대해서 더 효율적인 부호화가 가능해질 수 있다.By applying residual signal prediction to the second residual signal generated in operation 1044 , more efficient encoding may be possible with respect to the current block.

일 예에 따른 제1 잔차 신호의 생성에 대하여 아래에서 도 19를 참조하여 상세하게 설명된다.Generation of the first residual signal according to an example will be described in detail below with reference to FIG. 19 .

잔차 신호 예측이 수행되지 않기로 결정되면, 단계(1046)에서, 인트라 예측부(120) 또는 인트라 잔차 예측부(810)는 현재 블록의 제3 잔차 신호를 생성할 수 있다.If it is determined that the residual signal prediction is not to be performed, in operation 1046 , the intra predictor 120 or the intra residual predictor 810 may generate a third residual signal of the current block.

제3 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호일 수 있다. 예를 들면, 제3 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The third residual signal may be a residual signal of a current block in conventional image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

또한, 제3 잔차 신호는 단계(1044)에서의 제2 잔차 신호와 동일한 신호일 수 있다. 말하자면, 단계(1044) 및 단계(1046)은 동일한 방식으로 현재 블록의 잔차 신호를 생성할 수 있다.Also, the third residual signal may be the same signal as the second residual signal in step 1044 . In other words, steps 1044 and 1046 may generate the residual signal of the current block in the same way.

단계(1042) 또는 단계(1046)이 수행되면, 다음으로 단계(1047)가 수행될 수 있다.Once step 1042 or step 1046 is performed, step 1047 may then be performed.

단계(1047)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측에 관련된 정보의 부호화를 수행할 수 있다.In operation 1047 , the intra residual prediction unit 810 may perform encoding of information related to prediction of a residual signal.

잔차 신호 예측이 수행되는 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 여부를 도 21을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.When the residual signal prediction is performed, the intra residual predictor 810 may encode the above information so that the decoding apparatus 2300, which will be described later with reference to FIG. 21 , knows whether the residual signal is predicted. For example, if the update of the reference sample is used, the value of the information may be set to '1', and if the update of the reference sample is not used, the value of the information may be set to '0'.

예를 들면, 인트라 예측부(120)는 "intra_residual_prediciton_flag" 플래그를 사용하여 참조 샘플의 갱신의 여부를 나타낼 수 있고, 플래그를 통해 참조 샘플의 갱신의 여부가 표시될 수 있다.For example, the intra prediction unit 120 may indicate whether the reference sample is updated by using the "intra_residual_prediciton_flag" flag, and whether the reference sample is updated may be indicated through the flag.

다음으로, 도 10c를 참조한다.Next, reference is made to FIG. 10C.

단계(1047)는 단계(1048) 및 단계(1049)를 포함할 수 있다.Step 1047 may include steps 1048 and 1049 .

단계(1048)에서, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자를 부호화할 수 있다.In operation 1048 , the intra residual predictor 810 may encode the identifier of the first neighboring block.

제1 주변 블록의 식별자는 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록이 식별되는 것을 가능하게 하는 정보일 수 있다.The identifier of the first neighboring block may be information that enables the neighboring block used for prediction of the residual signal of the current block to be identified.

예를 들면, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록을 나타낼 수 있다. 또는, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록의 위치를 나타내는 위치 정보일 수 있다. 상기의 위치는 현재 블록에 대한 선택된 주변 블록의 상대적인 위치를 나타낼 수 있다. 상기의 위치는 현재 블록에 대하여 선택된 주변 블록이 인접한 방향을 나타낼 수 있다.For example, the identifier of the first neighboring block may indicate a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. Alternatively, the identifier of the first neighboring block may be position information indicating a position of a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. The position may indicate a relative position of the selected neighboring block with respect to the current block. The position may indicate a direction in which a neighboring block selected with respect to the current block is adjacent.

제1 주변 블록의 식별자는 부호화 장치(800) 및 복호화 장치(2300)의 양자에 있어서 동일한 블록을 가리키도록 구성되어야 할 수 있다. 예를 들면, 제1 주변 블록의 식별자와 관련하여 블록의 크기 N 및 주변 블록의 위치가 부호화 장치(800) 및 복호화 장치(2300)에서 공통되어야 할 수 있다. 부호화 장치(800) 및 복호화 장치(2300)가 제1 주변 블록의 식별자와 관련하여 공통된 구성을 공유하게 하기 위해, 제1 주변 블록의 식별자는 "(이웃-잔차_인덱스) 절삭형 단항((neighboring-residual_idx) Truncated unary)" 방식으로 부호화될 수 있다.The identifier of the first neighboring block may be configured to indicate the same block in both the encoding apparatus 800 and the decoding apparatus 2300 . For example, in relation to the identifier of the first neighboring block, the size N of the block and the position of the neighboring block may have to be common to the encoding apparatus 800 and the decoding apparatus 2300 . In order for the encoding apparatus 800 and the decoding apparatus 2300 to share a common configuration with respect to the identifier of the first neighboring block, the identifier of the first neighboring block is "(neighboring-residual_index) truncation unary ((neighboring) -residual_idx) Truncated unary)" may be encoded.

단계(1048)는 생략될 수 있다. 예를 들면, 단계(1041)에서, 잔차 신호 예측이 수행되지 않기로 결정되면, 단계(1048)는 생략될 수 있다.Step 1048 may be omitted. For example, if at step 1041 it is determined that residual signal prediction is not to be performed, then step 1048 may be omitted.

단계(1049)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보를 부호화할 수 있다.In operation 1049 , the intra residual predictor 810 may encode information indicating whether residual signal prediction is performed.

단계(1047)에서, 단계(1048) 및 단계(1049)가 수행될 수 있다. 단계(1048) 및 단계(1049)는 기정의된 순서로 수행될 수 있다. 예를 들면, 단계(1048)가 단계(1049)의 이전에 수행될 수 있다. 또는, 단계(1049)가 단계(1048)의 이전에 수행될 수 있다.In step 1047, steps 1048 and 1049 may be performed. Steps 1048 and 1049 may be performed in a predefined order. For example, step 1048 may be performed prior to step 1049 . Alternatively, step 1049 may be performed prior to step 1048 .

단계(1030) 또는 단계(1040)가 수행되면, 다음으로 단계(1050)가 수행될 수 있다.After step 1030 or step 1040 is performed, step 1050 may be performed next.

단계(1050)에서, 부호화 장치(800)는 현재 블록의 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다. 단계(1050)는 변환부(130), 양자화부(140) 및 엔트로피 부호화부(150) 중 적어도 하나에 의해 수행될 수 있다.In operation 1050, the encoding apparatus 800 may encode the current block using the residual signal of the current block. Step 1050 may be performed by at least one of the transform unit 130 , the quantizer 140 , and the entropy encoder 150 .

단계(1050)에서 현재 블록의 부호화를 위해 사용되는 잔차 신호는 2개의 잔차 신호들 중 하나일 수 있다.The residual signal used for encoding of the current block in operation 1050 may be one of two residual signals.

단계(1041)에서 잔차 신호 예측을 수행하기로 결정된 경우, 단계(950)에서 생성된 현재 블록의 제1 잔차 신호가 단계(1050)에서 사용되는 잔차 신호일 수 있다. 말하자면, 잔차 신호 예측에 의해 생성된 잔차 신호가 현재 블록의 부호화를 위해 사용될 수 있고, 부호화 장치(800)는 현재 블록의 제1 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다.When it is determined to perform residual signal prediction in operation 1041 , the first residual signal of the current block generated in operation 950 may be the residual signal used in operation 1050 . That is, the residual signal generated by the residual signal prediction may be used for encoding the current block, and the encoding apparatus 800 may perform encoding of the current block using the first residual signal of the current block.

단계(1050)에서 잔차 신호 예측이 수행하지 않기로 결정된 경우, 단계(1046)에서 생성된 현재 블록의 제3 잔차 신호가 단계(1050)에서 사용되는 잔차 신호일 수 있다.When it is determined not to perform residual signal prediction in operation 1050 , the third residual signal of the current block generated in operation 1046 may be the residual signal used in operation 1050 .

다음으로, 도 10d를 참조한다.Next, reference is made to FIG. 10D.

단계(1050)은 단계(1051), 단계(1052) 및 단계(1053)을 포함할 수 있다.Step 1050 may include step 1051 , step 1052 , and step 1053 .

단계(1051)에서, 변환부(130)는 잔차 신호에 대한 변환을 수행하여 변환 계수를 생성할 수 있다.In operation 1051 , the transform unit 130 may perform transform on the residual signal to generate transform coefficients.

단계(1052)에서, 양자화부(140)는 변환 계수를 사용하여 양자화된 변환 계수 레벨을 생성할 수 있다.In operation 1052 , the quantization unit 140 may generate a quantized transform coefficient level by using the transform coefficient.

단계(1053)에서, 엔트로피 부호화부(150)는 변환 계수 레벨에 대한 엔트로피 부호화를 수행할 수 있다.In operation 1053 , the entropy encoding unit 150 may perform entropy encoding on the transform coefficient level.

전술된 정보의 부호화에 관계된 단계들 중, 단계(1023), 단계(1048) 및 단계(1049)는 전술된 것과는 상이한 주체 및 상이한 순서에 의해 수행될 수 있다. 예를 들면, 단계(1053)는 단계(1023), 단계(1048) 및 단계(1049)를 포함할 수 있다. 또한, 엔트로부 부호화부(150)는 참조 샘플의 갱신의 수행의 여부를 나타내는 정보, 잔차 신호 예측의 수행의 여부를 나타내는 정보 및 제1 주변 블록의 식별자 중 적어도 하나를 부호화할 수 있다.Among the steps related to the above-described encoding of information, steps 1023, 1048, and 1049 may be performed by a different subject and in a different order than those described above. For example, step 1053 may include step 1023 , step 1048 , and step 1049 . Also, the entropy encoder 150 may encode at least one of information indicating whether the reference sample is updated, information indicating whether residual signal prediction is performed, and the identifier of the first neighboring block.

제안된 부호화 방법들Proposed encoding methods

도 10을 참조하여 전술된 실시예에서, 부호화 방법은 2가지의 방법들로 분류될 수 있다. 각 방법은 아래와 같다.In the embodiment described above with reference to FIG. 10, the encoding method may be classified into two methods. Each method is as follows.

- 제1 방법 : 첫 번째 방법은, 기존의 방법으로 인트라 예측의 참조 샘플을 생성하고, 주변 샘플의 방향성 패턴에 따라서 기존 방법으로 생성된 참조 샘플의 샘플 값에 대한 재구성을 다시 수행하는 방법일 수 있다. 여기에서, 기존의 방법이란, 도 1을 참조하여 전술된 인트라 예측부(120)에 의해 수행되는, 인트라 예측을 위한 참조 샘플을 생성하는 방법을 의미할 수 있다.- First method: The first method may be a method of generating a reference sample of intra prediction by the conventional method, and reconstructing the sample value of the reference sample generated by the existing method according to the directional pattern of the surrounding sample. have. Here, the conventional method may refer to a method of generating a reference sample for intra prediction performed by the intra prediction unit 120 described above with reference to FIG. 1 .

- 제2 방법 : 두 번째 방법은, 기존의 인트라 예측을 통해 획득된 잔차 신호에 대하여 주변 블록의 잔차 신호를 사용하는 재예측을 수행함으로써 잔차 신호의 에너지를 감소시는 방법일 수 있다. 말하자면, 두 번- 방법에서는, 잔차 신호 레벨에서의 재예측이 수행될 수 있다. 여기에서, 기존의 방법이란, 도 1을 참조하여 전술된 인트라 예측부(120)에 의해 수행되는, 참조 샘플에 대한 공간적 예측을 통해 현재 블록의 예측 신호를 생성하는 과정 및 예측 신호롤 사용하여 현재 블록의 잔차 신호를 획득하는 과정을 포함할 수 있다.- Second method: The second method may be a method of reducing the energy of the residual signal by performing re-prediction using the residual signal of the neighboring block on the residual signal obtained through the existing intra prediction. That is to say, in the double-method, re-prediction at the residual signal level can be performed. Here, the conventional method is a process of generating a prediction signal of a current block through spatial prediction of a reference sample, performed by the intra prediction unit 120 described above with reference to FIG. 1 , and a current using the prediction signal. It may include a process of obtaining a residual signal of the block.

실시예의 분류Classification of Examples

도 10a, 도 10b, 도 10c 및 도 10d을 참조하여 전술된 실시예는 3개의 실시예들로 분류될 수 있다. 각 실시예는 아래와 같다.The embodiment described above with reference to FIGS. 10A, 10B, 10C and 10D may be classified into three embodiments. Each example is as follows.

- 제1 실시예 : 제1 실시예는 도 10a에서 내부가 채워진 화살표로 표시되었다. 제1 실시예는 단계(1010), 단계(1020), 단계(1030) 및 단계(1050)를 포함할 수 있다. 제1 실시예는 참조 샘플의 갱신을 수행하지만, 잔차 신호의 예측은 수행하지 않을 수 있다.- Example 1 : Example 1 is indicated by a filled arrow in FIG. 10A . The first embodiment may include steps 1010 , 1020 , 1030 , and 1050 . The first embodiment may update a reference sample, but may not perform prediction of a residual signal.

- 제2 실시예 : 제2 실시예는 도 10a에서 내부가 비워진 화살표로 표시되었다. 제2 실시예는 단계(1010), 단계(1020), 단계(1030), 단계(1040) 및 단계(1050)를 포함할 수 있다. 제2 실시예는 참조 샘플의 갱신 및 잔차 신호의 예측을 수행할 수 있다.- Second embodiment: The second embodiment is indicated by an arrow with an empty inside in FIG. 10A. The second embodiment may include steps 1010 , 1020 , 1030 , 1040 , and 1050 . The second embodiment may perform updating of a reference sample and prediction of a residual signal.

- 제3 실시예 : 제3 실시예는 도 10a에서 내부에 사선이 그려진 화살표로 표시되었다. 제3 실시예는 단계(1010), 단계(1030), 단계(1040) 및 단계(1050)를 포함할 수 있다. 제3 실시예는 참조 샘플의 갱신은 수행하지 않지만, 잔차 신호의 예측은 수행할 수 있다.- Third Embodiment: The third embodiment is indicated by an arrow with an oblique line drawn therein in FIG. 10A . A third embodiment may include steps 1010 , 1030 , 1040 , and 1050 . The third embodiment does not update the reference sample, but predicts the residual signal.

부호화 장치(800)는 제1 실시예, 제2 실시예 및 제3 실시예 중 하나의 실시예를 사용하여 현재 블록의 부호화를 수행할 수 있다. 또는, 부호화 장치(800)는 3개의 실시예들 모두에 대한 율-왜곡 최적화를 수행할 수 있고, 3개의 실시예들 중 최소의 율-왜곡 값을 도출시키는 방법을 선택할 수 있다. 예를 들면, 부호화 장치(800)는 최소의 율-왜곡 값을 도출시키도록 단계(1020) 및 단계(1040)의 각각을 선택적으로 사용할 수 있다.The encoding apparatus 800 may encode the current block using one of the first, second, and third embodiments. Alternatively, the encoding apparatus 800 may perform rate-distortion optimization for all three embodiments, and may select a method for deriving a minimum rate-distortion value among the three embodiments. For example, the encoding apparatus 800 may selectively use each of steps 1020 and 1040 to derive a minimum rate-distortion value.

참조 샘플의 갱신의 단위Unit of update of reference sample

단계(910)에서, 인트라 예측부(120)는 기정의된 단위 별로 참조 샘플의 갱신의 수행 여부를 결정할 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.In operation 910 , the intra predictor 120 may determine whether to update the reference sample for each predefined unit. The predefined unit may be at least one of 1) an entire image sequence (ie, video), 2) one image (ie, picture), 3) a slice, and 4) a coding unit.

기정의된 단위에 대해서, 참조 샘플의 갱신의 수행 여부를 나타내기 위해 참조 샘플 갱신 정보가 사용될 수 있다. 참조 샘플 갱신 정보는 기정의된 단위에 대하여 참조 샘플의 갱신이 수행되었는지 여부를 나타내는 정보일 수 있다. 예를 들면, 참조 샘플 갱신 정보의 값이 제1 값인 것은, 현재 블록의 부호화에 있어서 참조 샘플의 갱신이 수행되었다는 것을 나타낼 수 있다. 참조 샘플 갱신 정보의 값이 제2 값인 것은, 현재 블록의 부호화에 있어서 참조 샘플의 갱신이 수행되지 않았다는 것을 나타낼 수 있다.For a predefined unit, reference sample update information may be used to indicate whether the reference sample is updated. The reference sample update information may be information indicating whether the reference sample is updated with respect to a predefined unit. For example, that the value of the reference sample update information is the first value may indicate that the reference sample is updated in encoding of the current block. When the value of the reference sample update information is the second value, it may indicate that the reference sample is not updated in the encoding of the current block.

부호화 장치(800)는 부호화된 잔차 신호 예측 정보를 비트스트림에 포함시킬 수 있다. 복호화 장치(2300)는 잔차 신호 예측 정보를 사용하여 현재 블록에 대한 잔차 신호 예측의 수행의 여부를 판단할 수 있다.The encoding apparatus 800 may include the encoded residual signal prediction information in the bitstream. The decoding apparatus 2300 may determine whether residual signal prediction is performed on the current block by using the residual signal prediction information.

아래에서는, 기정의된 단위들 각각에 대한 참조 샘플의 갱신에 대해 설명된다.In the following, the update of the reference sample for each of the predefined units is described.

1) 영상 시퀀스 전체: 참조 샘플의 갱신의 수행 여부는 영상 시퀀스 전체에 대하여 결정될 수 있다. 이러한 경우, 시퀀스 파라미터 세트(sequence parameter set)는 참조 샘플 갱신 정보를 포함할 수 있다. 시퀀스 파라미터 세트의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(120)는 영상 시퀀스 전체에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.1) Entire image sequence: Whether to update the reference sample may be determined for the entire image sequence. In this case, the sequence parameter set may include reference sample update information. When the reference sample update information of the sequence parameter set indicates that the reference sample is to be updated, the intra prediction unit 120 may perform intra prediction using the reference sample to which the gradient according to the directionality is applied with respect to the entire image sequence.

2) 하나의 영상: 참조 샘플의 갱신의 수행 여부는 영상 별로 결정될 수 있다. 이러한 경우, 픽처 파라미터 세트(picture parameter set)는 참조 샘플 갱신 정보를 포함할 수 있다. 픽처 파라미터 세트의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(120)는 픽처 파라미터 세트에 대응하는 영상의 전체에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다. 또는, 인트라 예측부(120)는 슬라이스 헤더에서 명시된 픽처 파라미터 세트 식별자(identifier; ID)를 사용하여 참조 샘플의 갱신이 수행되는지 여부를 식별할 수 있다.2) One image: Whether to update the reference sample may be determined for each image. In this case, the picture parameter set may include reference sample update information. When the reference sample update information of the picture parameter set indicates that the reference sample is to be updated, the intra prediction unit 120 performs intra prediction using the reference sample to which the gradient according to the directionality is applied to the entire image corresponding to the picture parameter set. can be done Alternatively, the intra prediction unit 120 may identify whether the update of the reference sample is performed using a picture parameter set identifier (ID) specified in the slice header.

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 참조 샘플의 갱신의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트(segment) 헤더는 참조 샘플 갱신 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(120)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.3) Slice: One image may be divided into a plurality of slice segments or a plurality of tiles within one slice segment. Whether to update the reference sample may be determined for each slice. In this case, the slice segment header may include reference sample update information. If the reference sample update information of the slice segment header indicates that the reference sample is to be updated, the intra prediction unit 120 performs intra prediction using the reference sample to which the gradient according to the directionality is applied on the slice corresponding to the slice segment header. can

4) 코딩 유닛: 참조 샘플의 갱신의 수행 여부는 코딩 유닛 별로 결정될 수 있다. 이러한 경우, 코딩 유닛에 대하여 참조 샘플 갱신 정보가 존재할 수 있다. 코딩 유닛에 대한 참조 샘플 갱신 정보가 코딩 유닛의 갱신이 수행됨을 나타내면, 인트라 예측부(120)는 참조 샘플 갱신 정보에 대응하는 코딩 유닛에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.4) Coding unit: Whether to update the reference sample may be determined for each coding unit. In this case, reference sample update information may be present for the coding unit. When the reference sample update information for the coding unit indicates that the coding unit is updated, the intra prediction unit 120 performs intra prediction using the reference sample to which the gradient according to the directionality is applied with respect to the coding unit corresponding to the reference sample update information. can be done

전술된 것과 같이, 참조 샘플 갱신 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the reference sample update information may be coded in a sequence parameter set, a picture parameter set, or a slice segment header. Also, update information may be coded for a coding unit.

잔차 신호 예측의 단위Unit of Residual Signal Prediction

단계(930)에서 결정되는 잔차 신호 예측의 수행 여부는 기정의된 단위에 대하여 결정될 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.Whether to perform the residual signal prediction determined in operation 930 may be determined for a predefined unit. The predefined unit may be at least one of 1) an entire image sequence (ie, video), 2) one image (ie, picture), 3) a slice, and 4) a coding unit.

잔차 신호 예측 정보는 기정의된 단위에 대하여 잔차 신호 예측이 수행되었는지 여부를 나타내는 정보일 수 있다. 예를 들면, 잔차 신호 예측 정보의 값이 제1 값인 것은, 현재 블록의 부호화에 있어서 잔차 신호 예측이 수행되었다는 것을 나타낼 수 있다. 잔차 신호 예측 정보의 값이 제2 값인 것은, 현재 블록의 부호화에 있어서 잔차 신호 예측이 수행되지 않았다는 것을 나타낼 수 있다.The residual signal prediction information may be information indicating whether residual signal prediction is performed with respect to a predefined unit. For example, when the value of the residual signal prediction information is the first value, it may indicate that the residual signal prediction is performed in the encoding of the current block. The second value of the residual signal prediction information may indicate that residual signal prediction is not performed in encoding of the current block.

부호화 장치(800)는 부호화된 잔차 신호 예측 정보를 비트스트림에 포함시킬 수 있다. 복호화 장치(2300)는 잔차 신호 예측 정보를 사용하여 현재 블록에 대한 잔차 신호 예측의 수행의 여부를 판단할 수 있다.The encoding apparatus 800 may include the encoded residual signal prediction information in the bitstream. The decoding apparatus 2300 may determine whether residual signal prediction is performed on the current block by using the residual signal prediction information.

아래에서는, 기정의된 단위들 각각에 대한 잔차 신호 예측에 대해 설명된다.In the following, the residual signal prediction for each of the predefined units is described.

1) 영상 시퀀스 전체: 잔차 신호 예측의 수행 여부는 영상 시퀀스 전체에 대하여 결정될 수 있다. 이러한 경우, 시퀀스 파라미터 세트는 잔차 신호 예측 정보를 포함할 수 있다. 시퀀스 파라미터 세트의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(810)는 영상 시퀀스 전체에 대해서 잔차 신호 예측을 수행할 수 있다.1) Entire image sequence: Whether to perform residual signal prediction may be determined for the entire image sequence. In this case, the sequence parameter set may include residual signal prediction information. When the residual signal prediction information of the sequence parameter set indicates that residual signal prediction is performed, the intra residual predictor 810 may perform residual signal prediction on the entire image sequence.

2) 하나의 영상: 잔차 신호 예측의 수행 여부는 영상 별로 결정될 수 있다. 이러한 경우, 픽처 파라미터 세트(picture parameter set)는 잔차 신호 예측 정보를 포함할 수 있다. 픽처 파라미터 세트의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(810)는 픽처 파라미터 세트에 대응하는 영상의 전체에 대해서 잔차 신호 예측을 수행할 수 있다.2) One image: Whether to perform residual signal prediction may be determined for each image. In this case, the picture parameter set may include residual signal prediction information. When the residual signal prediction information of the picture parameter set indicates that residual signal prediction is performed, the intra residual prediction unit 810 may perform residual signal prediction on the entire image corresponding to the picture parameter set.

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 잔차 신호 예측의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(810)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 잔차 신호 예측을 수행할 수 있다.3) Slice: One image may be divided into a plurality of slice segments or a plurality of tiles within one slice segment. Whether to perform residual signal prediction may be determined for each slice. In this case, the slice segment header may include residual signal prediction information. When the residual signal prediction information of the slice segment header indicates that residual signal prediction is performed, the intra residual predictor 810 may perform residual signal prediction on a slice corresponding to the slice segment header.

4) 코딩 유닛: 잔차 신호 예측의 수행 여부는 코딩 유닛 별로 결정될 수 있다. 이러한 경우, 코딩 유닛에 대하여 잔차 신호 예측 정보가 존재할 수 있다. 코딩 유닛에 대한 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(810)는 잔차 신호 예측 정보에 대응하는 코딩 유닛에 대해서 잔차 신호 예측을 수행할 수 있다.4) Coding unit: Whether to perform residual signal prediction may be determined for each coding unit. In this case, residual signal prediction information may be present for the coding unit. When the residual signal prediction information for the coding unit indicates that residual signal prediction is performed, the intra residual prediction unit 810 may perform residual signal prediction on the coding unit corresponding to the residual signal prediction information.

전술된 것과 같이, 잔차 신호 예측 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the residual signal prediction information may be coded within a sequence parameter set, a picture parameter set, or a slice segment header. Also, update information may be coded for a coding unit.

도 11은 일 예에 따른 현재 블록 및 참조 샘플을 도시한다.11 illustrates a current block and a reference sample according to an example.

아래에서 설명될 참조 샘플에 대한 처리는 참조 샘플의 갱신 이전에 참조 샘플의 값을 결정하기 위해 사용될 수 있으며, 인트라 예측부(120)에 의해 도 9a를 참조하여 전술된 단계(910)의 이전에 수행될 수 있다. 또한, 아래에서 설명될 참조 샘플에 대한 처리는 도 10a를 참조하여 전술된 단계(1010)에 대응할 수 있다.The processing on the reference sample, which will be described below, may be used to determine the value of the reference sample before the update of the reference sample, and is performed by the intra prediction unit 120 before the step 910 described above with reference to FIG. 9A . can be performed. In addition, processing on a reference sample, which will be described below, may correspond to step 1010 described above with reference to FIG. 10A .

도 11에서는, 현재 블록(1100), 상단 인접 라인(1110), 좌측 인접 라인(1120) 및 좌측 상단 샘플(1130)이 도시되었다.In FIG. 11 , the current block 1100 , the top adjacent line 1110 , the left adjacent line 1120 , and the top left sample 1130 are shown.

현재 블록(1100)의 참조 샘플은 상단 인접 라인(1110), 좌측 인접 라인(1120) 및 좌측 상단 샘플(1130)을 포함할 수 있다. 또는, 현재 블록(1100)의 참조 샘플은 상단 인접 라인(1110), 좌측 인접 라인(1120) 및 좌측 상단 샘플(1130)의 샘플들 중 적어도 일부일 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드에 따라서 상단 인접 라인(1110), 좌측 인접 라인(1120) 및 좌측 상단 샘플(1130)의 픽셀들 중 적어도 일부를 참조 샘플로서 선택할 수 있다.The reference sample of the current block 1100 may include an upper adjacent line 1110 , a left adjacent line 1120 , and an upper left sample 1130 . Alternatively, the reference sample of the current block 1100 may be at least some of samples of the top adjacent line 1110 , the left adjacent line 1120 , and the left top sample 1130 . The intra prediction unit 120 may select at least some of pixels of the upper adjacent line 1110 , the left adjacent line 1120 , and the upper left sample 1130 as reference samples according to the intra prediction mode for the current block.

상단 인접 라인(1110)은 현재 블록(1100)의 상단에 인접한 수평 라인일 수 있다. 좌측 인접 라인(1120)은 현재 블록(1100)의 좌측에 인접한 수직 라인일 수 있다. 좌측 상단 샘플(1130)은 현재 블록(1100)의 좌측 상단에 인접한 샘플일 수 있다.The top adjacent line 1110 may be a horizontal line adjacent to the top of the current block 1100 . The left adjacent line 1120 may be a vertical line adjacent to the left of the current block 1100 . The upper left sample 1130 may be a sample adjacent to the upper left of the current block 1100 .

상단 인접 라인(1110)의 최좌측 샘플의 x 좌표는 현재 블록(1100)의 최좌측 픽셀(들)의 x 좌표와 동일할 수 있다. 현재 블록(1100)의 크기가 NxN일 때, 상단 인접 라인(1110)의 길이는 2N일 수 있다. 여기에서, N은 1 이상의 정수일 수 있다. 상단 인접 라인(1110)은 2Nx1의 픽셀들일 수 있다.The x-coordinate of the leftmost sample of the upper adjacent line 1110 may be the same as the x-coordinate of the leftmost pixel(s) of the current block 1100 . When the size of the current block 1100 is NxN, the length of the upper adjacent line 1110 may be 2N. Here, N may be an integer of 1 or more. The top adjacent line 1110 may be 2Nx1 pixels.

좌측 인접 라인(1120)의 최상단 샘플의 y 좌표는 현재 블록(1100)의 최상단 픽셀(들)의 y 좌표와 동일할 수 있다. 현재 블록(1100)의 크기가 NxN일 때, 좌측 인접 라인(1120)의 길이는 2N일 수 있다. 좌측 인접 라인(1120)은 1x2N의 픽셀들일 수 있다.The y-coordinate of the uppermost sample of the left adjacent line 1120 may be the same as the y-coordinate of the uppermost pixel(s) of the current block 1100 . When the size of the current block 1100 is NxN, the length of the left adjacent line 1120 may be 2N. The left adjacent line 1120 may be 1x2N pixels.

좌측 상단 샘플(1130)의 x 좌표는 현재 블록(1100)의 최좌측 픽셀(들)의 x 좌표에서 1을 뺀 값일 수 있다. 좌측 상단 샘플(1130)의 y 좌표는 현재 블록(1100)의 최상단 픽셀(들)의 y 좌표에서 1을 뺀 값일 수 있다.The x-coordinate of the upper-left sample 1130 may be a value obtained by subtracting 1 from the x-coordinate of the leftmost pixel(s) of the current block 1100 . The y-coordinate of the upper-left sample 1130 may be a value obtained by subtracting 1 from the y-coordinate of the uppermost pixel(s) of the current block 1100 .

전술된 참조 샘플은 현재 블록에 대한 인트라 예측에서 사용될 수 있다.The aforementioned reference sample may be used in intra prediction for the current block.

인트라 예측을 위해 사용되는 참조 샘플은 원 영상의 픽셀(들)의 밝기 값이 아닌, 예측 및 복원에 의해 복원된 밝기 값을 가질 수 있다. 예를 들면, 현재 블록(1100)의 부호화의 이전에 현재 블록(1100)의 주변 블록(들)이 부호화될 수 있으며, 부호화 과정에서의 예측 및 복원을 통해 주변 블록의 픽셀의 밝기 값이 복원될 수 있다. 참조 샘플은 이러한 주변 블록들의 픽셀들 중 일부일 수 있다. 또한, 참조 샘플의 밝기 값은 후처리 필터링이 적용되기 이전의 값일 수 있다.A reference sample used for intra prediction may have a brightness value reconstructed by prediction and reconstruction, not a brightness value of the pixel(s) of the original image. For example, before encoding of the current block 1100, the neighboring block(s) of the current block 1100 may be encoded, and the brightness value of the pixel of the neighboring block may be restored through prediction and restoration in the encoding process. can The reference sample may be some of the pixels of these neighboring blocks. Also, the brightness value of the reference sample may be a value before post-processing filtering is applied.

현재 블록(1100)의 주변에 가용한 참조 샘플이 존재하지 않는 경우, 인트라 예측부(120)는 주변의 사용 가능한 샘플(즉, 픽셀) 중 현재 블록(1100)에 가장 가까운 샘플들을 사용하는 참조 샘플 패딩(padding)을 수행할 수 있다. 참조 샘플 패딩에 의해 참조 샘플의 밝기 값이 생성될 수 있다.When there is no reference sample available in the vicinity of the current block 1100 , the intra prediction unit 120 uses samples closest to the current block 1100 among available samples (ie, pixels) in the vicinity of the reference sample. Padding may be performed. A brightness value of a reference sample may be generated by reference sample padding.

인트라 예측부(120)는 현재 블록(1100)의 크기 및 인트라 예측 모드 등에 따라서, 양자화 에러에 의한 예측 오차를 감소시키기 위한 참조 샘플 필터링을 수행할 수 있다.The intra prediction unit 120 may perform reference sample filtering to reduce a prediction error due to a quantization error according to the size of the current block 1100 and the intra prediction mode.

도 12는 일 예에 따른 주변 블록의 수평 방향의 경사도를 반영하여 참조 샘플을 갱신하는 방법을 나타낸다.12 illustrates a method of updating a reference sample by reflecting a horizontal gradient of a neighboring block according to an example.

도 12에서 원은 샘플(또는, 픽셀)을 나타낼 수 있다. 점선의 사각형은 블록을 나타낼 수 있다. A circle in FIG. 12 may represent a sample (or pixel). A dotted rectangle may represent a block.

도 12에서는, 현재 블록(1210), 참조 샘플 블록(1220), 참조 샘플들(1221) 및 주변 블록(1230)이 도시되었다.In FIG. 12 , a current block 1210 , a reference sample block 1220 , reference samples 1221 , and a neighboring block 1230 are illustrated.

현재 블록은 4x4의 크기를 갖는 블록으로 도시되었다. 블록의 크기는 블록의 폭(width) 및 높이(height)를 의미할 수 있다.The current block is shown as a block having a size of 4x4. The size of the block may mean the width and height of the block.

참조 샘플 블록(1220)은 현재 블록(1210)을 위해 사용되는 참조 샘플들(1221)을 포함하는 블록일 수 있다. 참조 샘플 블록(1220)은 현재 블록(1210)에 인접하고 현재 블록(1210)의 크기와 동일한 크기를 갖는 블록일 수 있다.The reference sample block 1220 may be a block including reference samples 1221 used for the current block 1210 . The reference sample block 1220 may be a block adjacent to the current block 1210 and having the same size as the size of the current block 1210 .

참조 샘플들(1221)은, 참조 샘플의 갱신을 통해, I', J', K' 및 L'의 값을 각각 갖는 것으로 도시되었다. 도시된 참조 샘플들은 인트라 예측 모드에 따라서 현재 블록의 주변의 샘플들 중 참조 샘플을 생성하는 방법에 따라 구성된 샘플들일 수 있다.Reference samples 1221 are shown to have values of I', J', K', and L', respectively, through updating of the reference sample. The illustrated reference samples may be samples constructed according to a method of generating a reference sample among samples surrounding the current block according to the intra prediction mode.

도 12에서는 현재 블록(1210)에 대한 인트라 예측 모드가 수평 예측 모드(horizontal prediction mode)일 때, 인트라 예측부(120)에 의해 생성된 참조 샘플들이 도시되었다.In FIG. 12 , reference samples generated by the intra prediction unit 120 are illustrated when the intra prediction mode for the current block 1210 is a horizontal prediction mode.

주변 블록(1230) 내의 점선은 주변 블록(1230) 내의 샘플들의 수평 라인을 나타낼 수 있다. 주변 블록(1230) 내의 굵은 실선은 수평 라인에 포함되는 샘플들의 경사도를 나타낼 수 있다. ∇dx는 경사도 값을 나타낼 수 있다.A dotted line in the neighboring block 1230 may indicate a horizontal line of samples in the neighboring block 1230 . A thick solid line in the peripheral block 1230 may indicate the inclination of samples included in the horizontal line. ∇ dx may represent a gradient value.

도 12에서는, 샘플들의 수평 라인에서, 좌측에서 우측으로 샘플 값이 일정하게 증가한 뒤 일정하게 감소하는 예가 도시되었다.In FIG. 12 , an example in which a sample value constantly increases and then decreases constantly from left to right in a horizontal line of samples is illustrated.

주변 블록(1230)은 현재 블록(1210)에 대한 부호화 및/또는 복호화 이전에 이미 복원이 완료된 블록일 수 있다.The neighboring block 1230 may be a block that has already been reconstructed prior to encoding and/or decoding of the current block 1210 .

참조 샘플의 갱신을 위해 사용되는 주변 블록은 현재 블록의 인트라 잔차 예측을 위해 사용되는 주변 블록과는 상이할 수 있다. 도 9a 및 도 10c을 참조하여 전술된 것과 같이, 현재 블록의 인트라 잔차 예측을 위해 사용되는 주변 블록은 제1 주변 블록으로 칭해질 수 있다. 또한, 참조 샘플의 갱신을 위해 사용되는 주변 블록은 제2 블록으로 칭해질 수 있다. 제1 주변 블록 및 제2 주변 블록은 서로 동일할 수 있으며, 서로 상이할 수도 있다. 또한, 제1 주변 블록이 제2 주변 블록을 포함하거나, 제2 주변 블록이 제1 주변 블록을 포함할 수도 있다.A neighboring block used for updating a reference sample may be different from a neighboring block used for intra-residual prediction of the current block. As described above with reference to FIGS. 9A and 10C , a neighboring block used for intra-residual prediction of a current block may be referred to as a first neighboring block. Also, a neighboring block used for updating the reference sample may be referred to as a second block. The first neighboring block and the second neighboring block may be the same as or different from each other. Also, the first neighboring block may include the second neighboring block, or the second neighboring block may include the first neighboring block.

예를 들면, 인트라 예측 모드가 수평 예측 모드인 경우, 참조 샘플은 현재 블록(1210)의 좌측에 인접한 샘플일 수 있다. 또는, 참조 샘플은 현재 블록(1210)의 좌측에 인접한 수직 라인의 샘플일 수 있다. 참조 샘플 블록(1220)은 현재 블록(1210)의 좌측에 인접한 블록일 수 있다. 또한, 주변 블록(1230)은 현재 블록(1210)의 상단 인접 블록 및 현재 블록(1210)의 좌측 상단 인접 블록을 합한 블록일 수 있다. 현재 블록(1210)의 상단 인접 블록은 현재 블록(1210)의 상단에 인접한 블록일 수 있다. 현재 블록(1210)의 좌측 상단 인접 블록은 현재 블록(1210)의 좌측 상단에 인접한 블록일 수 있다. 상단 인접 블록 및 좌측 상단 인접 블록은 서로 인접할 수 있다.For example, when the intra prediction mode is the horizontal prediction mode, the reference sample may be a sample adjacent to the left side of the current block 1210 . Alternatively, the reference sample may be a sample of a vertical line adjacent to the left of the current block 1210 . The reference sample block 1220 may be a block adjacent to the left side of the current block 1210 . Also, the neighboring block 1230 may be a block obtained by adding an upper adjacent block of the current block 1210 and an upper left adjacent block of the current block 1210 . The block adjacent to the top of the current block 1210 may be a block adjacent to the top of the current block 1210 . The upper left adjacent block of the current block 1210 may be a block adjacent to the upper left of the current block 1210 . The top adjacent block and the top left adjacent block may be adjacent to each other.

현재 블록(1210)의 크기가 NxN일 때, 상단 인접 블록의 크기 및 좌측 상단 인접 블록의 크기는 각각 NxN일 수 있고, 주변 블록(1230)의 크기는 2NxN일 수 있다. 도 12에서는, 주변 블록의 크기가 8x4인 것으로 도시되었다.When the size of the current block 1210 is NxN, the size of the upper neighboring block and the size of the upper left neighboring block may be NxN, respectively, and the size of the neighboring block 1230 may be 2NxN. In FIG. 12, it is shown that the size of the neighboring block is 8x4.

또한, 현재 블록의(1210)의 크기가 NxN일 때, 상단 인접 블록의 크기 및 좌측 상단 인접 블록의 크기는 각각 aNxbN일 수 있고, 주변 블록(1230)의 크기는 2aNxbN일 수 있다. 여기에서, a 및 b는 각각 실수일 수 있다.Also, when the size of the current block 1210 is NxN, the size of the upper adjacent block and the size of the upper left adjacent block may be aNxbN, respectively, and the size of the neighboring block 1230 may be 2aNxbN. Here, a and b may each be a real number.

또한, 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1230)은 각각 기정의된 크기 또는 기정의된 방식에 의해 결정된 크기를 가질 수 있다.Also, the upper adjacent block, the upper left adjacent block, and the adjacent block 1230 may each have a predefined size or a size determined by a predefined method.

부호화 장치(800)의 인트라 예측부(120) 및 후술될 복호화 장치(2300)의 인트라 예측부(240)는 동일한 크기의 상단 인접 블록들, 좌측 상단 인접 블록들 및 주변 블록들을 사용할 수 있다. 부호화 장치(800)는 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1230)의 각각의 크기를 설정할 수 있다. 상단 인접 블록의 크기, 좌측 상단 인접 블록의 크기 및 주변 블록(1230)의 크기는 복호화 장치(2300)에서도 동일하게 사용되어야 할 수 있다. 설정된 크기는 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.The intra prediction unit 120 of the encoding apparatus 800 and the intra prediction unit 240 of the decoding apparatus 2300 to be described later may use upper adjacent blocks of the same size, upper left adjacent blocks, and adjacent blocks. The encoding apparatus 800 may set the respective sizes of the upper adjacent block, the upper left adjacent block, and the adjacent block 1230 . The size of the upper adjacent block, the size of the upper left adjacent block, and the size of the adjacent block 1230 may be equally used in the decoding apparatus 2300 . The set size may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a bitstream.

참조 샘플의 갱신은 인트라 예측을 위한 현재 블록의 주변의 참조 샘플의 복원으로 간주될 수 있다.The update of the reference sample may be regarded as reconstruction of the reference sample in the vicinity of the current block for intra prediction.

제2 주변 블록에 대해 인트라 예측이 수행된 경우, 현재 블록 또한 공간적 상관도에 따라 제2 주변 블록의 텍스쳐와 유사한 방향성을 가진 텍스쳐로 구성될 수 있다. 이러한 방향성을 반영하기 위해, 인트라 예측부(120)는 현재 블록에 대한 인트라 예측을 수행하기 전에 인트라 예측을 위해 요구되는 참조 샘플의 값을 갱신할 수 있다.When intra prediction is performed on the second neighboring block, the current block may also be configured with a texture having a direction similar to that of the texture of the second neighboring block according to spatial correlation. To reflect this direction, the intra prediction unit 120 may update a value of a reference sample required for intra prediction before performing intra prediction on the current block.

인트라 예측부(120)는 제2 주변 블록의 방향성에 따른 경사 패턴(directional gradient pattern)을 이용함으로써 참조 샘플을 현재 블록의 샘플과 유사하게 되도록 재구성할 수 있다.The intra prediction unit 120 may reconstruct the reference sample to be similar to the sample of the current block by using a directional gradient pattern of the second neighboring block.

도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서, 인트라 예측부(120)는 제2 주변 블록의 경사 패턴을 검출할 수 있고, 경사도를 계산할 수 있다. 일 예에 따른 경사 패턴 검출 방법이 아래에서 도 13을 참조하여 상세하게 설명된다.In step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B , the intra prediction unit 120 may detect a gradient pattern of the second neighboring block and calculate a gradient . A method of detecting a gradient pattern according to an example will be described in detail below with reference to FIG. 13 .

도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서, 인트라 예측부(120)는 제2 주변 블록의 행들의 경사 패턴들을 검출할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 행들의 경사 패턴들이 동일한지 여부를 검사할 수 있다. 제2 주변 블록의 행들의 경사 패턴들이 동일한 경우, 인트라 예측부(120)는 제2 주변 블록의 경사도를 계산할 수 있다. 여기에서, 제2 주변 블록의 경사도는 제2 주변 블록의 하나의 선택된 행의 경사도일 수 있다. 예를 들면, 제2 주변 블록의 경사도는 제2 주변 블록의 행들 중 현재 블록(1210)에 인접한 행의 경사도일 수 있다. 인트라 예측부(120)는 제2 주변 블록의 행들 중 현재 블록(1210)에 인접한 행의 경사도를 제2 주변 블록의 최종적인 경사도로서 결정할 수 있다.In step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B , the intra prediction unit 120 may detect gradient patterns of rows of the second neighboring block. The intra predictor 120 may check whether gradient patterns of rows of the second neighboring block are the same. When the gradient patterns of the rows of the second neighboring block are the same, the intra predictor 120 may calculate the gradient of the second neighboring block. Here, the gradient of the second neighboring block may be the gradient of one selected row of the second neighboring block. For example, the gradient of the second neighboring block may be the gradient of a row adjacent to the current block 1210 among the rows of the second neighboring block. The intra predictor 120 may determine a gradient of a row adjacent to the current block 1210 among rows of the second neighboring block as a final gradient of the second neighboring block.

또한, 단계(915) 및 단계(1022)에서, 인트라 예측부(120)는 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정 또는 갱신할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 경사 패턴에 기반하여 참조 샘플의 값을 결정 또는 갱신할 수 있다.Also, in steps 915 and 1022 , the intra prediction unit 120 may determine or update a value of a reference sample based on a neighboring block of the current block. The intra prediction unit 120 may determine or update the value of the reference sample based on the gradient pattern of the second neighboring block.

인트라 예측부(120)에 의해 참조 샘플의 값은 갱신 전의 값으로부터 갱신 후의 값으로 변경될 수 있고, 참조 샘플의 갱신 전의 값은 참조 샘플을 포함하는 참조 샘플 블록(1220)이 예측 및 복원됨에 따라 생성된 값일 수 있다. 말하자면, 참조 샘플 블록(1220)이 예측 및 복원되면서, 참조 샘플의 값이 결정될 수 있고, 결정된 값이 참조 샘플의 갱신에 있어서 갱신 전의 값으로 사용될 수 있다. 참조 샘플의 예측 및 복원에 있어서는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 및 복원 방법이 사용될 수 있다.The value of the reference sample may be changed from the value before update to the value after update by the intra predictor 120 , and the value before update of the reference sample is changed as the reference sample block 1220 including the reference sample is predicted and reconstructed. It can be a generated value. That is, while the reference sample block 1220 is predicted and reconstructed, a value of the reference sample may be determined, and the determined value may be used as a value before the update in updating the reference sample. In prediction and reconstruction of the reference sample, prediction and reconstruction methods of existing image encoding and/or decoding techniques such as HEVC and AVC may be used.

경사도 ∇dx가 계산되면, 인트라 예측부(120)는 기정의된 방식으로 참조 샘플의 값을 결정 또는 갱신할 수 있다.When the gradient ∇ dx is calculated, the intra predictor 120 may determine or update the value of the reference sample in a predefined manner.

예를 들면, 인트라 예측 모드가 수평 예측 모드인 경우, 인트라 예측부(120)는 아래의 수학식 2와 같은 방식으로 참조 샘플의 값을 결정 또는 갱신할 수 있다.For example, when the intra prediction mode is the horizontal prediction mode, the intra prediction unit 120 may determine or update the value of the reference sample in the same manner as in Equation 2 below.

Figure pat00002
Figure pat00002

f는 함수를 나타낼 수 있다. w는 가중치를 나타낼 수 있다. I는 참조 샘플들(1221) 중 최상단의 샘플의 갱신 전 값일 수 있다. I'는 최상단의 샘플의 갱신 후 값일 수 있다. J, K, L 또한 대응하는 참조 샘플의 갱신 전 값일 수 있다. J', K', L'은 대응하는 참조 샘플의 갱신 후 값일 수 있다. f can represent a function. w may represent a weight. I may be a value before the update of the uppermost sample among the reference samples 1221 . I ' may be a value after the update of the uppermost sample. J , K , L may also be the values before update of the corresponding reference sample. J ', K ', L ' may be values after update of the corresponding reference sample.

수학식 2에서 설명된 것과 같이, 인트라 예측부(120)는 기존의 참조 샘플들 I, J, KL에 대하여, 경사도에 따른 차감을 반영함으로써 재구성된 참조 샘플들 I', J', K' 및 L'을 생성할 수 있다. 또한, 인트라 예측부(120)는 참조 샘플의 값을 갱신함에 있어서 가중치 팩터(weighting factor) w를 고려할 수 있다. 인트라 예측부(120)는 경사도 ∇dx 에 기반하여 결정된 값 및 기정의된 가중치 팩터 w의 곱을 참조 샘플의 갱신 전의 값으로부터 뺌으로써 참조 샘플의 값을 갱신할 수 있다. 갱신을 통해 참조 샘플의 값은 w*f(∇dx)만큼 감소할 수 있다.As described in Equation 2, the intra prediction unit 120 reconstructs reference samples I ', J ', K by reflecting the subtraction according to the gradient with respect to the existing reference samples I , J , K and L . ' and L ' can be created. Also, the intra predictor 120 may consider a weighting factor w when updating the value of the reference sample. The intra prediction unit 120 may update the value of the reference sample by subtracting a product of a value determined based on the gradient ∇ dx and a predefined weight factor w from a value before the update of the reference sample. Through the update, the value of the reference sample may decrease by w * f (∇ dx ).

참조 샘플은 복수일 수 있다. 가중치 팩터 w는 복수의 참조 샘플들에게 동일할 수 있다. 또는, 가중치 팩터 w는 복수의 참조 샘플들의 각각에 대해 서로 상이할 수 있다. 예를 들면, 가중치 펙터 w는 복수의 참조 샘플들의 각 참조 샘플에 대하여, 각 참조 샘플의 위치 별로 상이할 수 있다. 참조 샘플의 위치는 현재 블록(1210)에 대한 상대적인 위치일 수 있다.The reference sample may be plural. The weight factor w may be the same for a plurality of reference samples. Alternatively, the weight factor w may be different from each other for each of the plurality of reference samples. For example, the weight factor w may be different for each reference sample of the plurality of reference samples for each location of each reference sample. The position of the reference sample may be a position relative to the current block 1210 .

인트라 예측부(120)는 전술된 참조 샘플의 갱신 방법 및 기존의 방법을 결합할 수 있다. 예를 들면, 인트라 예측부(120)는 도 10a를 참조하여 전술된 참조 샘플의 갱신을 수행하는 경우, 단계(1010)에서는 참조 픽셀의 패딩을 수행하지 않을 수 있다. 또한, 인트라 예측부(120)는 도 10a를 참조하여 전술된 참조 샘플의 갱신을 수행하는 경우, 단계(1010)에서는 저주파 필터(low pass filter)를 사용하는 스무딩(smoothing)을 수행하지 않을 수 있다.The intra prediction unit 120 may combine the above-described method of updating the reference sample and the existing method. For example, when the intra prediction unit 120 updates the reference sample described above with reference to FIG. 10A , padding of the reference pixel may not be performed in operation 1010 . In addition, when the intra prediction unit 120 updates the reference sample described above with reference to FIG. 10A , smoothing using a low pass filter may not be performed in step 1010 . .

도 13는 일 예에 따른 경사 패턴을 구하는 방법을 설명한다.13 illustrates a method of obtaining a gradient pattern according to an example.

도 12를 참조하여 전술된 것처럼, 제2 주변 블록은 현재 블록의 위치를 기준으로 선택될 수 있다. 예를 들면, 인트라 예측부(120)는 현재 블록의 위치를 기준으로 복원된 블록들 중 인트라 예측 모드에 따라서 기정의된 위치의 블록을 제2 주변 블록으로서 선택할 수 있다. 또한, 인트라 예측부(120)는 선택된 제2 주변 블록의 경사 패턴을 분석할 수 있다.As described above with reference to FIG. 12 , the second neighboring block may be selected based on the position of the current block. For example, the intra prediction unit 120 may select a block at a predefined position according to the intra prediction mode from among blocks reconstructed based on the position of the current block as the second neighboring block. Also, the intra prediction unit 120 may analyze the gradient pattern of the selected second neighboring block.

도 12를 참조하여 전술된 것처럼, 제2 주변 블록의 크기는 현재 블록의 크기에 기반하여 결정될 수 있다. 예를 들면, 현재 블록의 크기가 NxN이면, 제2 주변 블록의 크기는 2N*N일 수 있다. 부호화 장치(800)는 제2 주변 블록의 크기를 설정할 수 있다. 설정된 크기는 복호화 장치(2300)에서도 동일하게 사용되어야 할 수 있다. 설정된 크기는 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.As described above with reference to FIG. 12 , the size of the second neighboring block may be determined based on the size of the current block. For example, if the size of the current block is NxN, the size of the second neighboring block may be 2N*N. The encoding apparatus 800 may set the size of the second neighboring block. The set size may be equally used in the decoding apparatus 2300 . The set size may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a bitstream.

도 13에서는 제2 주변 블록의 하나의 라인이 도시되었다. 라인은 주변 블록의 행(row) 또는 열(column)일 수 있다. 도 12에서는, 제2 주변 블록의 크기가 8x4인 것으로 도시되었고, 도 13에서는, 제2 주변 블록의 하나의 라인이 8x1인 것으로 도시되었다.In FIG. 13 , one line of the second peripheral block is illustrated. A line may be a row or a column of a neighboring block. In FIG. 12 , the size of the second neighboring block is shown to be 8x4, and in FIG. 13 , one line of the second neighboring block is shown to be 8x1.

인트라 예측부(120)는 라인 별로 하나 이상의 샘플 경사도를 계산할 수 있다. 하나 이상의 샘플 경사도의 각 샘플 경사도는 라인의 서로 인접하는 2개의 샘플들 간의 경사도일 수 있다. 하나의 라인이 다수의 샘플들을 포함할 수 있기 때문에, 인트라 예측부(120)는 라인에 대하여 복수의 샘플 경사도들을 획득할 수 있다. 하나 이상의 샘플 경사도들의 일 예로서, 도 13에서는, ∇dx1, ∇dx2, ∇dx3, ∇dx4, ∇dx5, ∇dx6 및 ∇dx7이 도시되었다. 예를 들면, ∇dx1은 라인의 첫 번째의 샘플 및 두 번째의 샘플 간의 경사도일 수 있다.The intra prediction unit 120 may calculate one or more sample gradients for each line. Each sample slope of the one or more sample slopes may be a slope between two adjacent samples of the line. Since one line may include a plurality of samples, the intra prediction unit 120 may obtain a plurality of sample gradients with respect to the line. As an example of one or more sample gradients, dx 1, dx 2, dx 3, dx 4, dx 5, dx 6 and dx 7 are shown in FIG. 13 . For example, dx 1 may be the gradient between the first sample and the second sample of the line.

인트라 예측부(120)는 제2 주변 블록의 각 라인에 대하여, 각 라인의 하나 이상의 샘플 경사도를 계산할 수 있다.The intra prediction unit 120 may calculate, for each line of the second neighboring block, one or more sample gradients of each line.

인트라 예측부(120)는 하나 이상의 샘플 경사도들에 기반하여 라인 경사도를 계산할 수 있다. 예를 들면, 라인 경사도는 1) 하나 이상의 샘플 경사도들의 중간 값, 2) 하나 이상의 샘플 경사도들의 평균 값 또는 3) 하나 이상의 샘플 경사도들의 기정의된 대표 값일 수 있다.The intra predictor 120 may calculate a line gradient based on one or more sample gradients. For example, the line gradient may be 1) a median value of one or more sample gradients, 2) an average value of one or more sample gradients, or 3) a predefined representative value of one or more sample gradients.

기정의된 대표 값은 항상 양의 값을 가질 수 있다.The predefined representative value may always have a positive value.

하나 이상의 샘플 경사도들의 중간 값을 라인 경사도로 사용할 경우, 아래의 수학식 3이 사용될 수 있다.When an intermediate value of one or more sample gradients is used as a line gradient, Equation 3 below may be used.

Figure pat00003
Figure pat00003

dx는 라인 경사도를 나타낼 수 있다.dx may represent a line gradient.

인트라 예측부(120)는 라인 경사도를 계산함에 있어서 하나 이상의 샘플 경사도들에 대하여 샘플 경사도 별로 가중치를 적용할 수 있다.In calculating the line gradient, the intra predictor 120 may apply a weight to each of the sample gradients with respect to one or more sample gradients.

전술된 방식을 통해, 인트라 예측부(120)는 제2 주변 블록의 하나 이상의 라인들의 하나 이상의 라인 경사도들을 계산할 수 있다.Through the above-described method, the intra prediction unit 120 may calculate one or more line inclinations of one or more lines of the second neighboring block.

라인 경사도가 계산되면, 인트라 예측부(120)는 하나 이상의 라인 경사도들에 기반하여 제2 주변 블록의 경사도를 계산할 수 있다. 예를 들면, 제2 주변 블록의 경사도는 1) 하나 이상의 라인 경사도들의 중간 값, 2) 하나 이상의 라인 경사도들의 평균 값 또는 3) 하나 이상의 라인 경사도들의 기정의된 대표 값일 수 있다. 또는, 인트라 예측부(120)는 제2 주변 블록의 경사도를 계산함에 있어서, 하나 이상의 라인 경사도들에 대하여 라인 경사도 별로 가중치를 적용할 수 있다.When the line gradient is calculated, the intra predictor 120 may calculate the gradient of the second neighboring block based on one or more line gradients. For example, the gradient of the second neighboring block may be 1) a median value of one or more line gradients, 2) an average value of one or more line gradients, or 3) a predefined representative value of one or more line gradients. Alternatively, when calculating the gradient of the second neighboring block, the intra predictor 120 may apply a weight to each of the line gradients with respect to one or more line gradients.

계산된 제2 주변 블록의 경사도는 참조 샘플의 갱신을 위한 최종적인 경사도로서 사용될 수 있다.The calculated gradient of the second neighboring block may be used as a final gradient for updating the reference sample.

예를 들면, 도 13에서 도시된 것과 같이, 라인의 샘플 경사도들이 증가하다가 감소하는 경우, 도 12의 현재 블록(1210) 참조 샘플들(1221)로서 이미 생성된 I, J, K 및 L의 각각으로부터 라인의 라인 경사도를 뺌으로써 갱신된 참조 샘플들 I', J', K' 및 L'을 획득할 수 있다.For example, as shown in FIG. 13 , when the sample slopes of the line increase and then decrease, each of I, J, K and L already generated as reference samples 1221 in the current block 1210 of FIG. 12 , respectively. The updated reference samples I', J', K' and L' can be obtained by subtracting the line slope of the line from

샘플 경사도, 라인 경사도 및 제2 주변 블록의 경사도에 대해 전술된 것과 같이, 인트라 예측부(120)는 제2 주변 블록의 하나의 행에 속하는 복수의 참조 샘플들 중 인접한 2개의 참조 샘플들 간의 경사도 값에 기반하여 참조 샘플의 값을 결정할 수 있다.As described above with respect to the sample gradient, the line gradient, and the gradient of the second neighboring block, the intra prediction unit 120 determines the gradient between two adjacent reference samples among a plurality of reference samples belonging to one row of the second neighboring block. A value of the reference sample may be determined based on the value.

또는, 인트라 예측부(120)는 하나의 라인의 라인 경사도를 상기의 라인에 대응하는 참조 샘플의 경사도로서 사용할 수 있다. 예를 들면, 상대적인 위치가 동일한 라인 및 참조 샘플은 서로 대응할 수 있다. 예를 들면, 인트라 예측부(120)는 하나 이상의 라인들 중 최상단의 라인의 라인 경사도를 하나 이상의 참조 샘플들 중 최상단의 참조 샘플의 갱신을 위해 사용할 수 있다. 또는, 인트라 예측부(120)는 하나 이상의 라인들 중 현재 블록(1210)에 인접한 라인의 라인 경사도를 참조 샘플의 갱신을 위해 사용할 수 있다.Alternatively, the intra prediction unit 120 may use a line gradient of one line as a gradient of a reference sample corresponding to the line. For example, a line and a reference sample having the same relative position may correspond to each other. For example, the intra predictor 120 may use the line gradient of the topmost line among the one or more lines to update the topmost reference sample among the one or more reference samples. Alternatively, the intra prediction unit 120 may use a line gradient of a line adjacent to the current block 1210 among one or more lines to update the reference sample.

인트라 예측부(120)는 제2 주변 블록의 경사도를 계산함에 있어서 제2 주변 블록의 전체의 라인들 중 일부의 라인(들) 만을 선택할 수 있다. 인트라 예측부(120)는 선택된 일부의 라인(들)의 라인 경사도(들)을 사용하여 제2 주변 블록의 경사도를 계산할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 전체의 라인들 중 기정의된 위치(들)의 라인(들) 또는 기정의된 개수의 라인(들)을 선택할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 전체의 라인들 중 일부의 라인(들) 만을 선택하는 방식을 설정할 수 있다. 설정된 방식은 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.In calculating the gradient of the second neighboring block, the intra prediction unit 120 may select only some line(s) from among all the lines of the second neighboring block. The intra prediction unit 120 may calculate the slope of the second neighboring block by using the line slope(s) of the selected partial line(s). The intra prediction unit 120 may select a line(s) at a predefined location(s) or a predefined number of line(s) among all lines of the second neighboring block. The intra prediction unit 120 may set a method of selecting only some line(s) among all lines of the second neighboring block. The set method may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a bitstream.

인트라 예측부(120)는 라인의 라인 경사도를 계산함에 있어서 라인의 전체의 샘플들 중 일부의 샘플들 만을 선택할 수 있다. 말하자면, 각 라인의 하나 이상의 샘플 경사도가 반드시 각 라인의 전체의 샘플들에 대해서 계산될 필요는 없다. 인트라 예측부(120)는 도 12의 중간의 점선을 기준으로 좌우 대칭되는 영역들의 각각에 대해 라인 경사도를 계산할 수 있다. 예를 들면, 인트라 예측부(120)는 각 라인의 좌측의 절반의 샘플들에 대하여 각 라인의 하나 이상의 샘플 경사도를 계산할 수 있고, 계산된 하나 이상의 샘플 경사도들에 기반하여 라인 경사도를 계산할 수 있다. 또한, 인트라 예측부(120)는 각 라인의 우측의 절반의 샘플들에 대하여 각 라인의 하나 이상의 샘플 경사도를 계산할 수 있고, 계산된 하나 이상의 샘플 경사도들에 기반하여 라인 경사도를 계산할 수 있다.The intra prediction unit 120 may select only some samples from among all samples of the line in calculating the line inclination of the line. In other words, the slope of more than one sample of each line need not necessarily be calculated for all samples of each line. The intra prediction unit 120 may calculate a line inclination for each of the regions symmetrical to the left and right with respect to the dotted line in the middle of FIG. 12 . For example, the intra prediction unit 120 may calculate one or more sample gradients of each line with respect to samples of the left half of each line, and may calculate a line gradient based on the calculated one or more sample gradients. . Also, the intra prediction unit 120 may calculate one or more sample gradients of each line with respect to samples of the right half of each line, and may calculate a line gradient based on the calculated one or more sample gradients.

인트라 예측부(120)는 각 라인의 샘플들 중 기정의된 방식에 따라 선택된 샘플들에 대하여 각 라인의 하나 이상의 샘플 경사도를 계산할 수 있고, 계산된 하나 이상의 샘플 경사도들에 기반하여 라인 경사도를 계산할 수 있다. 라인 경사도의 계산에 있어서, 라인의 크기(또는, 샘플들의 개수)는 제2 주변 블록의 폭 2N 보다 더 클 수도 있고, 더 작을 수도 있다. 인트라 예측부(120)는 선택된 일부의 샘플들 간의 샘플 경사도(들)을 사용하여 라인의 라인 경사도를 계산할 수 있다. 인트라 예측부(120)는 라인의 전체의 샘플들 중 기정의된 위치들의 샘플들 또는 또는 기정의된 개수의 샘플들을 선택할 수 있다. 인트라 예측부(120)는 라인의 전체의 샘플들 중 일부의 샘플들 만을 선택하는 방식을 설정할 수 있다. 설정된 방식은 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.The intra prediction unit 120 may calculate one or more sample gradients of each line with respect to samples selected according to a predefined method among samples of each line, and calculate a line gradient based on the calculated one or more sample gradients. can In the calculation of the line gradient, the size (or the number of samples) of the line may be larger or smaller than the width 2N of the second neighboring block. The intra predictor 120 may calculate a line gradient of a line using sample gradient(s) between selected partial samples. The intra prediction unit 120 may select samples at predefined positions or a predefined number of samples from among all samples of the line. The intra prediction unit 120 may set a method of selecting only some samples among all samples of the line. The set method may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a bitstream.

인트라 예측부(120)는 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)을 선택할 수 있다. 인트라 예측부(120)는 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 참조 샘플(들)의 개수를 선택할 수 있다. 예를 들면, 인트라 예측부(120)는 도 12의 참조 샘플들(1221) 중에서 일부만을 갱신할 수 있다.The intra prediction unit 120 may select some reference sample(s) to which an update is to be applied from among all reference samples of the current block. The intra prediction unit 120 may select the number of reference sample(s) to which an update is to be applied from among all reference samples of the current block. For example, the intra prediction unit 120 may update only some of the reference samples 1221 of FIG. 12 .

인트라 예측부(120)는 현재 블록의 특성에 따라 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)을 선택할 수 있다. 또한, 인트라 예측부(120)는 현재 블록의 특성에 따라 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)의 개수를 결정할 수 있다.The intra prediction unit 120 may select some reference sample(s) to which an update is to be applied from among all reference samples of the current block according to the characteristics of the current block. Also, the intra prediction unit 120 may determine the number of partial reference sample(s) to which update is to be applied among all reference samples of the current block according to the characteristics of the current block.

예를 들면, 현재 블록의 특성은 현재 블록의 크기일 수 있다. 인트라 예측부(120)는 현재 블록의 크기에 따라 서로 상이한 방식들을 사용하여 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)을 선택할 수 있다.For example, the characteristic of the current block may be the size of the current block. The intra prediction unit 120 may select some reference sample(s) to which an update is to be applied from among all reference samples of the current block using different methods according to the size of the current block.

예를 들면, 현재 블록의 크기가 16x16 및 32x32 등과 같이 상대적으로 큰 경우를 고려하면, 현재 블록의 크기가 커질수록 현재 블록의 참조 샘플들의 개수도 많아질 수 있다. 참조 샘플들의 개수가 많아지면, 방향성에 따른 경사 패턴에 대한 상관도가 상대적으로 감소할 수 있다. 이러한 경우, 부호화 장치(800)는 경사도에 기반하여 갱신할 참조 샘플의 개수를 결정할 수 있다.For example, considering a case in which the size of the current block is relatively large, such as 16x16 and 32x32, the number of reference samples of the current block may increase as the size of the current block increases. As the number of reference samples increases, the correlation with respect to the gradient pattern according to the direction may be relatively decreased. In this case, the encoding apparatus 800 may determine the number of reference samples to be updated based on the gradient.

참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)을 선택하는 방식 및 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)의 개수는 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.A method of selecting some reference sample(s) to which an update is to be applied among reference samples and the number of some reference sample(s) to which an update is to be applied among reference samples are determined from the encoding apparatus 800 through the bitstream. may be transmitted to 2300 .

도 14는 일 예에 따른 주변 블록의 수직 방향의 경사도를 반영하여 참조 샘플을 갱신하는 방법을 나타낸다.14 illustrates a method of updating a reference sample by reflecting a vertical gradient of a neighboring block according to an example.

도 14에서 원은 샘플(또는, 픽셀)을 나타낼 수 있다. 점선의 사각형은 블록을 나타낼 수 있다. 14 , a circle may represent a sample (or pixel). A dotted rectangle may represent a block.

도 14에서는, 현재 블록(1410), 참조 샘플 블록(1420), 참조 샘플들(1421) 및 주변 블록(1430)이 도시되었다.In FIG. 14 , a current block 1410 , a reference sample block 1420 , reference samples 1421 , and a neighboring block 1430 are illustrated.

현재 블록은 4x4의 크기를 갖는 블록으로 도시되었다. 블록의 크기는 블록의 폭(width) 및 높이(height)를 의미할 수 있다.The current block is shown as a block having a size of 4x4. The size of the block may mean the width and height of the block.

참조 샘플 블록(1420)은 현재 블록(1410)을 위해 사용되는 참조 샘플들(1421)을 포함하는 블록일 수 있다. 참조 샘플 블록(1420)은 현재 블록(1410)에 인접하고 현재 블록(1410)의 크기와 동일한 크기를 갖는 블록일 수 있다.The reference sample block 1420 may be a block including reference samples 1421 used for the current block 1410 . The reference sample block 1420 may be a block adjacent to the current block 1410 and having the same size as the size of the current block 1410 .

참조 샘플들(1421)은, 참조 샘플의 갱신을 통해, A', B', C' 및 D'의 값을 각각 갖는 것으로 도시되었다. 도시된 참조 샘플들은 인트라 예측 모드에 따라서 현재 블록의 주변의 샘플들 중 참조 샘플을 생성하는 방법에 따라 구성된 샘플들일 수 있다.Reference samples 1421 are shown to have values of A', B', C', and D', respectively, through updating of the reference sample. The illustrated reference samples may be samples constructed according to a method of generating a reference sample among samples surrounding the current block according to the intra prediction mode.

도 14에서는 현재 블록(1410)에 대한 인트라 예측 모드가 수직 예측 모드(vertical prediction mode)일 때, 인트라 예측부(120)에 의해 생성된 참조 샘플들이 도시되었다.In FIG. 14 , reference samples generated by the intra prediction unit 120 are illustrated when the intra prediction mode for the current block 1410 is a vertical prediction mode.

주변 블록(1430) 내의 점선은 주변 블록(1430) 내의 픽셀들의 수직 라인을 나타낼 수 있다. 주변 블록(1430) 내의 굵은 실선은 수직 라인에 포함되는 샘플들의 경사도를 나타낼 수 있다. ∇dx는 경사도 값을 나타낼 수 있다.A dotted line in the peripheral block 1430 may indicate a vertical line of pixels in the peripheral block 1430 . A thick solid line in the peripheral block 1430 may indicate the inclination of samples included in the vertical line. ∇ dx may represent a gradient value.

도 14에서는, 샘플들의 수직 라인에서, 위에서 아래로 샘플 값이 일정하게 증가한 뒤 일정하게 감소하는 예가 도시되었다.In FIG. 14 , in a vertical line of samples, an example in which a sample value is constantly increased from top to bottom and then decreased constantly is shown.

주변 블록(1430)은 현재 블록(1410)에 대한 부호화 및/또는 복호화 이전에 이미 복원이 완료된 블록일 수 있다.The neighboring block 1430 may be a block that has already been reconstructed prior to encoding and/or decoding of the current block 1410 .

참조 샘플의 갱신을 위해 사용되는 주변 블록은 현재 블록의 인트라 잔차 예측을 위해 사용되는 주변 블록과는 상이할 수 있다. 도 9a을 참조하여 전술된 것과 같이, 현재 블록의 인트라 잔차 예측을 위해 사용되는 주변 블록은 제1 주변 블록으로 칭해질 수 있다. 또한, 참조 샘플의 갱신을 위해 사용되는 주변 블록은 제2 블록으로 칭해질 수 있다. 제1 주변 블록 및 제2 주변 블록은 서로 동일할 수 있으며, 서로 상이할 수도 있다. 또한, 제1 주변 블록이 제2 주변 블록을 포함하거나, 제2 주변 블록이 제1 주변 블록을 포함할 수도 있다.A neighboring block used for updating a reference sample may be different from a neighboring block used for intra-residual prediction of the current block. As described above with reference to FIG. 9A , a neighboring block used for intra-residual prediction of the current block may be referred to as a first neighboring block. Also, a neighboring block used for updating the reference sample may be referred to as a second block. The first neighboring block and the second neighboring block may be the same as or different from each other. Also, the first neighboring block may include the second neighboring block, or the second neighboring block may include the first neighboring block.

예를 들면, 인트라 예측 모드가 수직 예측 모드인 경우, 참조 샘플은 현재 블록(1410)의 상단에 인접한 샘플일 수 있다. 또는, 참조 샘플은 현재 블록(1410)의 상단에 인접한 수평 라인의 샘플일 수 있다. 참조 픽셀 블록(1420)은 현재 블록(1410)의 상단에 인접한 블록일 수 있다. 또한, 주변 블록(1330)은 현재 블록(1410)의 죄측 블록 및 현재 블록(1410)의 좌측 상단 인접 블록을 합한 블록일 수 있다. 현재 블록(1410)의 좌측 인접 블록은 현재 블록(1410)의 좌측에 인접한 블록일 수 있다. 현재 블록(1410)의 좌측 상단 인접 블록은 현재 블록(1410)의 좌측 상단에 인접한 블록일 수 있다. 좌측 인접 블록 및 좌측 상단 인접 블록은 서로 인접할 수 있다.For example, when the intra prediction mode is the vertical prediction mode, the reference sample may be a sample adjacent to the top of the current block 1410 . Alternatively, the reference sample may be a sample of a horizontal line adjacent to the top of the current block 1410 . The reference pixel block 1420 may be a block adjacent to the top of the current block 1410 . Also, the neighboring block 1330 may be a block obtained by adding a left block of the current block 1410 and an upper left neighboring block of the current block 1410 . The left adjacent block of the current block 1410 may be a block adjacent to the left of the current block 1410 . The upper left adjacent block of the current block 1410 may be a block adjacent to the upper left of the current block 1410 . The left adjacent block and the upper left adjacent block may be adjacent to each other.

현재 블록(1410)의 크기가 NxN일 때, 좌측 인접 블록의 크기 및 좌측 상단 인접 블록의 크기는 각각 NxN일 수 있고, 주변 블록(1430)의 크기는 Nx2N일 수 있다. 도 11에서는, 주변 블록의 크기가 8x4인 것으로 도시되었다.When the size of the current block 1410 is NxN, the size of the left neighboring block and the size of the upper left neighboring block may each be NxN, and the size of the neighboring block 1430 may be Nx2N. In FIG. 11, it is shown that the size of the neighboring block is 8x4.

또한, 현재 블록의(1410)의 크기가 NxN일 때, 상단 인접 블록의 크기 및 좌측 상단 인접 블록의 크기는 각각 aNxbN일 수 있고, 주변 블록(1430)의 크기는 aNx2bN일 수 있다. 여기에서, a 및 b는 각각 실수일 수 있다.Also, when the size of the current block 1410 is NxN, the size of the upper adjacent block and the size of the upper left adjacent block may be aNxbN, respectively, and the size of the neighboring block 1430 may be aNx2bN. Here, a and b may each be a real number.

또한, 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1430)은 각각 기정의된 크기 또는 기정의된 방식에 의해 결정된 크기를 가질 수 있다.Also, the upper adjacent block, the upper left adjacent block, and the adjacent block 1430 may each have a predefined size or a size determined by a predefined method.

부호화 장치(800)의 인트라 예측부(120) 및 후술될 복호화 장치(2300)의 인트라 예측부(240)는 동일한 크기의 상단 인접 블록들, 좌측 상단 인접 블록들 및 주변 블록들을 사용할 수 있다. 부호화 장치(800)는 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1430)의 각각의 크기를 설정할 수 있다. 상단 인접 블록의 크기, 좌측 상단 인접 블록의 크기 및 주변 블록(1430)의 크기는 복호화 장치(2300)에서도 동일하게 사용되어야 할 수 있다. 설정된 크기는 비트스트림을 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다.The intra prediction unit 120 of the encoding apparatus 800 and the intra prediction unit 240 of the decoding apparatus 2300 to be described later may use upper adjacent blocks of the same size, upper left adjacent blocks, and adjacent blocks. The encoding apparatus 800 may set the respective sizes of the upper adjacent block, the upper left adjacent block, and the adjacent block 1430 . The size of the upper adjacent block, the size of the upper left adjacent block, and the size of the adjacent block 1430 may be equally used in the decoding apparatus 2300 . The set size may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a bitstream.

참조 샘플의 갱신은 인트라 예측을 위한 현재 블록의 주변의 참조 샘플의 복원으로 간주될 수 있다.The update of the reference sample may be regarded as reconstruction of the reference sample in the vicinity of the current block for intra prediction.

제2 주변 블록에 대해 인트라 예측이 수행된 경우, 현재 블록 또한 공간적 상관도에 따라 제2 주변 블록의 텍스쳐와 유사한 방향성을 가진 텍스쳐로 구성될 수 있다. 이러한 방향성을 반영하기 위해, 인트라 예측부(120)는 현재 블록에 대한 인트라 예측을 수행하기 전에 인트라 예측을 위해 요구되는 참조 샘플의 값을 갱신할 수 있다.When intra prediction is performed on the second neighboring block, the current block may also be configured with a texture having a direction similar to that of the texture of the second neighboring block according to spatial correlation. To reflect this direction, the intra prediction unit 120 may update a value of a reference sample required for intra prediction before performing intra prediction on the current block.

인트라 예측부(120)는 제2 주변 블록의 방향성에 따른 경사 패턴을 이용함으로써 참조 샘플을 현재 블록의 샘플과 유사하게 되도록 갱신할 수 있다.The intra prediction unit 120 may update the reference sample to be similar to the sample of the current block by using the gradient pattern according to the directionality of the second neighboring block.

도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서, 인트라 예측부(120)는 제2 주변 블록의 경사 패턴을 검출할 수 있고, 경사도를 계산할 수 있다.In step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B , the intra prediction unit 120 may detect a gradient pattern of the second neighboring block and calculate a gradient .

도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서, 인트라 예측부(120)는 제2 주변 블록의 열들의 경사 패턴들을 검출할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 열들의 경사 패턴들이 동일한지 여부를 검사할 수 있다. 제2 주변 블록의 열들의 경사 패턴들이 동일한 경우, 인트라 예측부(120)는 제2 주변 블록의 경사도를 계산할 수 있다. 여기에서, 제2 주변 블록의 경사도는 제2 주변 블록의 하나의 선택된 열의 경사도일 수 있다. 예를 들면, 제2 주변 블록의 경사도는 제2 주변 블록의 열들 중 현재 블록(1410)에 인접한 열의 경사도일 수 있다. 인트라 예측부(120)는 제2 주변 블록의 열들 중 현재 블록(1410)에 인접한 열의 경사도를 제2 주변 블록의 최종적인 경사도로서 결정할 수 있다.In step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B , the intra prediction unit 120 may detect gradient patterns of columns of the second neighboring block. The intra predictor 120 may check whether gradient patterns of columns of the second neighboring block are the same. When the gradient patterns of columns of the second neighboring block are the same, the intra predictor 120 may calculate the gradient of the second neighboring block. Here, the gradient of the second neighboring block may be the gradient of one selected column of the second neighboring block. For example, the gradient of the second neighboring block may be the gradient of a column adjacent to the current block 1410 among columns of the second neighboring block. The intra prediction unit 120 may determine a gradient of a column adjacent to the current block 1410 among columns of the second neighboring block as the final gradient of the second neighboring block.

또한, 단계(915) 및 단계(1022)에서, 인트라 예측부(120)는 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정 또는 갱신할 수 있다. 인트라 예측부(120)는 제2 주변 블록의 경사 패턴에 기반하여 참조 샘플의 값을 결정 또는 갱신할 수 있다.Also, in steps 915 and 1022 , the intra prediction unit 120 may determine or update a value of a reference sample based on a neighboring block of the current block. The intra prediction unit 120 may determine or update the value of the reference sample based on the gradient pattern of the second neighboring block.

인트라 예측부(120)에 의해 참조 샘플의 값은 갱신 전의 값으로부터 갱신 후의 값으로 변경될 수 있고, 참조 샘플의 갱신 전의 값은 참조 샘플을 포함하는 참조 샘플 블록(1420)이 예측 및 복원됨에 따라 생성된 값일 수 있다. 말하자면, 참조 샘플 블록(1420)이 예측 및 복원되면서, 참조 샘플의 값이 결정될 수 있고, 결정된 값이 참조 샘플의 갱신에 있어서 갱신 전의 값으로 사용될 수 있다. 참조 샘플의 예측 및 복원에 있어서는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 및 복원 방법이 사용될 수 있다.The value of the reference sample may be changed from the value before update to the value after update by the intra predictor 120 , and the value before update of the reference sample is changed as the reference sample block 1420 including the reference sample is predicted and reconstructed. It can be a generated value. That is, while the reference sample block 1420 is predicted and reconstructed, a value of the reference sample may be determined, and the determined value may be used as a value before the update in updating the reference sample. In prediction and reconstruction of the reference sample, prediction and reconstruction methods of existing image encoding and/or decoding techniques such as HEVC and AVC may be used.

경사도 ∇dx가 계산되면, 인트라 예측부(120)는 기정의된 방식으로 참조 샘플의 값을 결정 또는 갱신할 수 있다.When the gradient ∇ dx is calculated, the intra predictor 120 may determine or update the value of the reference sample in a predefined manner.

예를 들면, 인트라 예측 모드가 수직 예측 모드인 경우, 인트라 예측부(120)는 아래의 수학식 3와 같은 방식으로 참조 샘플의 값을 결정 또는 갱신할 수 있다.For example, when the intra prediction mode is the vertical prediction mode, the intra prediction unit 120 may determine or update the value of the reference sample in the same manner as in Equation 3 below.

Figure pat00004
Figure pat00004

f는 함수를 나타낼 수 있다. w는 가중치를 나타낼 수 있다. A는 참조 샘플들(1421) 중 최상단의 샘플의 갱신 전 값일 수 있다. A'는 최상단의 샘플의 갱신 후 값일 수 있다. B, C, D 또한 대응하는 참조 샘플의 갱신 전 값일 수 있다. B', C', D'은 대응하는 참조 샘플의 갱신 후 값일 수 있다. f can represent a function. w may represent a weight. A may be a value before the update of the uppermost sample among the reference samples 1421 . A ' may be a value after the update of the uppermost sample. B , C , and D may also be values before updating of the corresponding reference sample. B ', C ', D ' may be values after updating of the corresponding reference sample.

수학식 4에서 설명된 것과 같이, 인트라 예측부(120)는 기존의 참조 샘플들 A, B, CD에 대하여, 경사도에 따른 차감을 반영함으로써 재구성된 참조 샘플들 A', B', C' 및 D'를 생성할 수 있다. 또한, 인트라 예측부(120)는 참조 샘플의 값을 갱신함에 있어서 가중치 팩터(weighting factor) w를 고려할 수 있다. 인트라 예측부(120)는 경사도 ∇dx 에 기반하여 결정된 값 및 기정의된 가중치 팩터 w의 곱을 참조 샘플의 갱신 전의 값에 더함으로써 참조 샘플의 값을 갱신할 수 있다. 갱신을 통해 참조 샘플의 값은 w*f(∇dx)만큼 증가할 수 있다.As described in Equation 4, the intra prediction unit 120 reconstructs the reference samples A ', B ', C by reflecting the subtraction according to the gradient with respect to the existing reference samples A , B , C and D . ' and D ' can be created. Also, the intra predictor 120 may consider a weighting factor w when updating the value of the reference sample. The intra predictor 120 may update the value of the reference sample by adding a product of a value determined based on the gradient ∇ dx and a predefined weight factor w to the value before the update of the reference sample. Through the update, the value of the reference sample may increase by w * f (∇ dx ).

참조 샘플은 복수일 수 있다. 가중치 팩터 w는 복수의 참조 샘플들에게 동일할 수 있다. 또는, 가중치 팩터 w는 복수의 참조 샘플들의 각각에 대해 서로 상이할 수 있다. 예를 들면, 가중치 펙터 w는 복수의 참조 샘플들의 각 참조 샘플에 대하여, 각 참조 샘플의 위치 별로 상이할 수 있다. 참조 샘플의 위치는 현재 블록(1410)에 대한 상대적인 위치일 수 있다.The reference sample may be plural. The weight factor w may be the same for a plurality of reference samples. Alternatively, the weight factor w may be different from each other for each of the plurality of reference samples. For example, the weight factor w may be different for each reference sample of the plurality of reference samples for each location of each reference sample. The position of the reference sample may be a position relative to the current block 1410 .

인트라 예측부(120)는 전술된 참조 샘플의 갱신 방법 및 기존의 방법을 결합할 수 있다. 예를 들면, 인트라 예측부(120)는 도 10a를 참조하여 전술된 참조 샘플의 갱신을 수행하는 경우, 단계(1010)에서는 참조 픽셀의 패딩을 수행하지 않을 수 있다. 또한, 인트라 예측부(120)는 도 10a를 참조하여 전술된 참조 샘플의 갱신을 수행하는 경우, 단계(1010)에서는 저주파 필터를 사용하는 스무딩을 수행하지 않을 수 있다.The intra prediction unit 120 may combine the above-described method of updating the reference sample and the existing method. For example, when the intra prediction unit 120 updates the reference sample described above with reference to FIG. 10A , padding of the reference pixel may not be performed in operation 1010 . Also, when the intra prediction unit 120 updates the reference sample described above with reference to FIG. 10A , in operation 1010 , smoothing using the low frequency filter may not be performed.

경사 패턴의 타입들Types of gradient patterns

도 12 내지 도 14를 참조하여 전술된 방향성에 대한 경사 패턴은 기정의된 타입들로 분류될 수 있다. 예를 들면, 경사 패턴은 1) 증가(increase), 2) 감소(decrease), 3) 증가 및 포화(saturation), 4) 감소 및 포화, 5) 포화 및 증가, 6) 포화 및 감소, 7) 증가 및 감소의 대칭 및 8) 감소 및 증가의 대칭 중 적어도 일부를 포함할 수 있다. 아래에서, 전술된 타입들에 대해 설명한다.The gradient patterns for the directionality described above with reference to FIGS. 12 to 14 may be classified into predefined types. For example, a gradient pattern can be 1) increase, 2) decrease, 3) increase and saturation, 4) decrease and saturate, 5) saturate and increase, 6) saturate and decrease, 7) at least some of the symmetry of increase and decrease and 8) the symmetry of decrease and increase. In the following, the above-mentioned types will be described.

1) "증가"는 방향에 따라 샘플들의 값이 증가하는 경사 패턴을 나타낸다. 방향은 좌측으로부터 우측으로의 방향일 수 있다. 또는, 방향은 상단으로부터 하단으로의 방향일 수 있다.1) "Increase" indicates a gradient pattern in which the values of the samples increase according to the direction. The direction may be from left to right. Alternatively, the direction may be a direction from the top to the bottom.

2) "감소"는 방향에 따라 샘플들의 값이 감소하는 경사 패턴을 나타낼 수 있다.2) “Decrease” may indicate a gradient pattern in which values of samples decrease according to a direction.

3) "증가 및 포화"는 방향에 따라 앞 부분에서는 샘플들의 값이 증가하고, 뒷 부분에서는 샘플들의 값이 일정하게 유지되는 경사 패턴을 나타낼 수 있다.3) "Increase and saturate" may indicate a gradient pattern in which values of samples increase in the front part and the values of samples are kept constant in the rear part according to the direction.

4) "감소 및 포화"는 방향에 따라 앞 부분에서는 샘플들의 값이 감소하고, 뒷 부분에서는 샘플들의 값이 일정하게 유지되는 경사 패턴을 나타낼 수 있다.4) “Reduction and saturation” may indicate a gradient pattern in which values of samples are decreased in the front part and values of samples are kept constant in the rear part according to the direction.

5) "포화 및 증가"는 방향에 따라 앞 부분에서는 샘플들의 값이 일정하게 유지되고, 뒷 부분에서는 샘플들의 값이 증가하는 경사 패턴을 나타낼 수 있다. 5) "Saturation and increase" may indicate a gradient pattern in which values of samples are kept constant in the front part and the values of samples increase in the rear part according to the direction.

6) "포화 및 감소"는 방향에 따라 앞 부분에서는 샘플들의 값이 일정하게 유지되고, 뒷 부분에서는 샘플들의 값이 감소하는 경사 패턴을 나타낼 수 있다.6) “Saturation and decrease” may indicate a gradient pattern in which values of samples are kept constant in the front part and the values of samples decrease in the rear part according to directions.

7) "증가 및 감소의 대칭"은 방향에 따라 앞 부분에서는 샘플들의 값이 증가하고, 뒷 부분에서는 샘플들의 값이 감소하는, 좌우 대칭인 경사 패턴을 나타낼 수 있다.7) “Symmetry of increase and decrease” may indicate a left-right symmetrical gradient pattern in which values of samples increase in the front part and decrease in values in the rear part according to the direction.

8) "감소 및 증가의 대칭"은 방향에 따라 앞 부분에서는 샘플들의 값이 감소하고, 뒷 부분에서는 샘플들의 값이 증가하는, 좌우 대칭인 경사 패턴을 나타낼 수 있다.8) "Symmetry of decrease and increase" may indicate a left-right symmetrical gradient pattern in which values of samples decrease in the front part and increase in values in the rear part according to the direction.

전술된 "증가"는 일정한(constant) 증가일 수도 있고, 일정하지 않은 증가일 수도 있다. 또한, 전술된 "감소"는 일정한 감소일 수도 있고, 일정하지 않은 감소일 수도 있다.The above-mentioned "increase" may be a constant increase or a non-constant increase. Also, the above-mentioned “reduction” may be a constant decrease or a non-constant decrease.

인트라 예측부(120)는 현재 블록의 제2 주변 블록의 경사 패턴의 타입에 따라 참조 샘플의 값을 결정할 수 있다. 예를 들면, 경사 패턴이 "증가", "감소", "증가 및 포화", "감소 및 포화", "포화 및 증가" 및 "포화 및 감소" 중 하나인 경우, 인트라 예측부(120)는 "증가"의 라인의 경사도 값 또는 "감소"의 라인의 경사도 값에 기반하여 참조 샘플의 값을 결정할 수 있다.The intra prediction unit 120 may determine the value of the reference sample according to the type of the gradient pattern of the second neighboring block of the current block. For example, when the gradient pattern is one of “increase”, “decrease”, “increase and saturate”, “decrease and saturate”, “saturate and increase”, and “saturate and decrease”, the intra prediction unit 120 may The value of the reference sample may be determined based on the slope value of the line of “increase” or the slope value of the line of “decrease”.

경사 패턴이 "대칭"인 경우, 인트라 예측부(120)는 경사 패턴의 대칭을 이루는 2개의 라인들의 경사도 값에 기반하여 참조 샘플의 값을 결정할 수 있다. 예를 들면, 도 11을 참조하여 전술된 것처럼, 경사 패턴의 타입이 증가 후 감소하는 대칭인 경우, 수학식 2의 갱신이 적용될 수 있다. 예를 들면, 인트라 예측부(120)는 경사도 ∇dx 에 기반하여 결정된 값 및 기정의된 가중치 w의 곱을 참조 샘플의 갱신 전의 값으로부터 뺌으로써 참조 샘플의 값을 갱신할 수 있다. 갱신을 통해 참조 샘플의 값은 w*f(∇dx)만큼 감소할 수 있다. 예를 들면, 도 13을 참조하여 전술된 것처럼, 경사 패턴의 타입이 감소 후 증가하는 대칭인 경우, 수학식 3의 갱신이 적용될 수 있다. 예를 들면, 인트라 예측부(120)는 경사도 ∇dx 에 기반하여 결정된 값 및 기정의된 가중치 w의 곱을 참조 샘플의 갱신 전의 값에 더함으로써 참조 샘플의 값을 갱신할 수 있다. 갱신을 통해 참조 샘플의 값은 w*f(∇dx)만큼 증가할 수 있다.When the gradient pattern is “symmetric”, the intra predictor 120 may determine a value of the reference sample based on gradient values of two lines that form symmetry of the gradient pattern. For example, as described above with reference to FIG. 11 , when the type of the gradient pattern is symmetric which increases and then decreases, the update of Equation 2 may be applied. For example, the intra predictor 120 may update the value of the reference sample by subtracting a product of a value determined based on the gradient ∇ dx and a predefined weight w from a value before the update of the reference sample. Through the update, the value of the reference sample may decrease by w * f (∇ dx ). For example, as described above with reference to FIG. 13 , when the type of the gradient pattern is symmetric increasing after decreasing, the update of Equation 3 may be applied. For example, the intra prediction unit 120 may update the value of the reference sample by adding a product of a value determined based on the gradient ∇ dx and a predefined weight w to the value before the update of the reference sample. Through the update, the value of the reference sample may increase by w * f (∇ dx ).

경사 패턴을 검출하기 위한 부호화 파라미터의 사용Use of encoding parameters to detect gradient patterns

전술된 실시예 외에도, 인트라 예측부(120)는 부호화 파라미터를 사용하여 경사 패턴을 검출할 수 있다. 예를 들면, 부호화 파라미터는, 1) 인트라 예측에 관련하여 기정의된 신택스(syntax), 2) 부호화 변수, 3) 현재의 부호화 유닛, 4) 예측 유닛, 5) 변환 유닛의 크기 및 6) 부호화 유닛의 분할의 여부 등을 포함할 수 있다. 예를 들면, 인트라 예측부(120)는 부호화 파라미터를 사용하여 주변 블록에 관련된 값을 결정할 수 있다. 주변 블록은 도 12를 참조하여 전술된 주변 블록(1230) 또는 도 14를 참조하여 전술된 주변 블록(1430)일 수 있다. 주변 블록에 관련된 값은 주변 블록의 크기를 포함할 수 있다. 인트라 예측부(120)는 부호화 파라미터를 사용하여 주변 블록의 경사도를 결정할 수 있다. 인트라 예측부(120)는 부호화 파라미터를 사용하여 갱신이 적용되는 참조 샘플의 범위를 결정할 수 있다. 또한, 인트라 예측부(120)는 부호화 파라미터를 사용하여 가중치 팩터를 결정할 수 있다.In addition to the above-described embodiments, the intra prediction unit 120 may detect a gradient pattern using an encoding parameter. For example, the encoding parameters include: 1) a syntax predefined in relation to intra prediction, 2) an encoding variable, 3) a current encoding unit, 4) a prediction unit, 5) a size of a transform unit, and 6) an encoding Whether or not the unit is divided may be included. For example, the intra predictor 120 may determine a value related to a neighboring block by using the encoding parameter. The neighboring block may be the neighboring block 1230 described above with reference to FIG. 12 or the neighboring block 1430 described above with reference to FIG. 14 . The value related to the neighboring block may include the size of the neighboring block. The intra predictor 120 may determine the gradient of the neighboring block by using the encoding parameter. The intra predictor 120 may determine the range of the reference sample to which the update is applied by using the encoding parameter. Also, the intra predictor 120 may determine the weight factor using the encoding parameter.

경사도의 용도의 확장Expansion of use of slope

인트라 예측부(120)는 주변 블록의 경사도를, 참조 샘플이 아닌, 예측 블록의 픽셀 값에 적용할 수 있다. 인트라 예측부(120)는 참조 샘플의 값을 고정시킬 수 있고, 주변 블록의 경사도를 사용하여 예측 블록의 픽셀 값을 갱신할 수 있다. 예측 블록의 픽셀 값을 직접적으로 갱신함에 따라, 참조 샘플의 값을 갱신하였을 때와 동일한 효과가 획득될 수 있다.The intra prediction unit 120 may apply the gradient of the neighboring block to the pixel value of the prediction block, not the reference sample. The intra prediction unit 120 may fix the value of the reference sample and update the pixel value of the prediction block by using the gradient of the neighboring block. By directly updating the pixel value of the prediction block, the same effect as when the value of the reference sample is updated can be obtained.

전술된 실시예에서, 주변 블록의 경사도에 따라 참조 샘플에 이루어지는 갱신은 예측 블록에게도 동일하게 적용될 수 있다. 예를 들면, 한 행의 참조 샘플들에 이루어지는 갱신은 예측 블록의 복수의 행들의 각 행에 대해서 동일하게 적용될 수 있다. 또는, 예를 들면, 한 열의 참조 샘플들에 이루어지는 갱신은 예측 블록의 복수의 열들의 각 열에 대해서 동일하게 적용될 수 있다. 인트라 예측부(120) 예측 블록의 갱신에 대해서도, 참조 샘플의 갱신에 대해서 사용된 것과 같은 방식으로, 부호화 파라미터는 사용할 수 있다. 말하자면, 인트라 예측부(120)는 부호화 파라미터에 기반하여 예측 블록의 픽셀 값을 갱신할 수 있다.In the above-described embodiment, the update performed on the reference sample according to the gradient of the neighboring block may be equally applied to the prediction block. For example, the update performed on the reference samples of one row may be equally applied to each row of a plurality of rows of the prediction block. Alternatively, for example, an update performed on reference samples in one column may be equally applied to each column of a plurality of columns of the prediction block. The encoding parameters can be used for the update of the prediction block of the intra prediction unit 120 in the same manner as that used for the update of the reference sample. That is, the intra prediction unit 120 may update the pixel value of the prediction block based on the encoding parameter.

도 15a는 일 예에 따른 33개의 각 모드들을 갖는 인트라 예측을 나타낸다.15A shows intra prediction with 33 respective modes according to an example.

도 15b는 일 예에 따른 65개의 각 모드들을 갖는 인트라 예측을 나타낸다.15B shows intra prediction with 65 respective modes according to an example.

도 9a를 참조하여 전술된 단계(920) 및 도 10a를 참조하여 전술된 단계(1030)에서, 인트라 예측부(120)는 현재 블록에 대한 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있다. 현재 블록에 대한 인트라 예측을 수행함에 있어서, 인트라 예측부(120)는 갱신된(또는, 재구성된) 참조 샘플(들)을 사용할 수 있다. 인트라 예측부(120))는 갱신된(또는, 재구성된) 참조 샘플(들)을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In step 920 described above with reference to FIG. 9A and step 1030 described above with reference to FIG. 10A, the intra prediction unit 120 performs intra prediction on the current block to generate a prediction block of the current block. have. In performing intra prediction on the current block, the intra prediction unit 120 may use updated (or reconstructed) reference sample(s). The intra prediction unit 120 may generate a prediction block of the current block by using the updated (or reconstructed) reference sample(s).

인트라 예측부(120)는 전술된 참조 샘플의 갱신을 통해 현재 블록에 대한 주변의 참조 샘플(들)을 구성할 수 있다. 인트라 예측부(120)는 하나 이상의 인트라 모드들에 대해서 현재 블록의 하나 이상의 예측 블록들을 생성할 수 있다. 하나 이상의 인트라 모드들은 각(angular) 모드를 포함할 수 있다.The intra prediction unit 120 may configure reference sample(s) surrounding the current block through the update of the reference sample described above. The intra prediction unit 120 may generate one or more prediction blocks of the current block for one or more intra modes. The one or more intra modes may include an angular mode.

인트라 예측부(120)는 하나 이상의 예측 블록들에 대해서 최소의 율-왜곡 값을 갖는 예측 블록을 결정할 수 있다. 인트라 예측부(120)는 예측 블록에 대응하는 인트라 모드를 최종적인 인트라 예측 모드로 선택할 수 있다. 또는, 인트라 예측부(120)는 하나 이상의 인트라 모드들 중 최소의 율-왜곡 값을 갖는 예측 블록을 생성하는 인트라 모드를 최종적인 인트라 예측 모드로 선택할 수 있다.The intra prediction unit 120 may determine a prediction block having a minimum rate-distortion value with respect to one or more prediction blocks. The intra prediction unit 120 may select the intra mode corresponding to the prediction block as the final intra prediction mode. Alternatively, the intra prediction unit 120 may select an intra mode generating a prediction block having a minimum rate-distortion value among one or more intra modes as the final intra prediction mode.

도 15a에서는 33개의 각 모드들을 갖는 인트라 모드들이 예시되었다. 도 15b에서는 65개의 각 모드들을 갖는 인트라 모드들이 예시되었다. 또한, 모드 0은 플레너 모드를 나타낼 수 있다. 모드 1은 DC 모드를 나타낼 수 있다.In FIG. 15A, intra modes having 33 respective modes are illustrated. In FIG. 15B, intra modes having 65 respective modes are illustrated. Also, mode 0 may represent a planar mode. Mode 1 may represent a DC mode.

도 16은 일 예에 따른 영상의 영역을 도시한다.16 illustrates a region of an image according to an example.

도 16에서는, 영상의 일부(1600)가 도시되었다. 도시된 영상의 일부(1600)는 현재 블록(1610), 주변 블록(1620), 복원된 영역(1630), 주변 블록 참조 샘플(1631) 및 현재 블록 참조 샘플(1632)을 포함할 수 있다.In FIG. 16 , a portion 1600 of an image is shown. A portion 1600 of the illustrated image may include a current block 1610 , a neighboring block 1620 , a reconstructed region 1630 , a neighboring block reference sample 1631 , and a current block reference sample 1632 .

주변 블록 참조 샘플(1631)은 주변 블록에 대한 인트라 예측을 수행할 때 사용되는 참조 샘플일 수 있다. 현재 블록 참조 샘플(1632)는 현재 블록에 대한 인트라 예측을 수행할 때 사용되는 참조 샘플일 수 있다.The neighboring block reference sample 1631 may be a reference sample used when performing intra prediction on the neighboring block. The current block reference sample 1632 may be a reference sample used when intra prediction is performed on the current block.

주변 블록 참조 샘플(1631)의 샘플 값은 주변 블록(1620)에 대하여 단계(915) 및 단계(1022)의 참조 샘플의 갱신이 수행되었을 때의 갱신된 값일 수 있다.The sample value of the neighboring block reference sample 1631 may be an updated value when the updating of the reference sample in steps 915 and 1022 is performed with respect to the neighboring block 1620 .

현재 블록 참조 샘플(1632)의 샘플 값은 현재 블록(1610)에 대하여 단계(915) 및 단계(1022)의 참조 샘플의 갱신이 수행되었을 때의 갱신된 값일 수 있다.The sample value of the current block reference sample 1632 may be an updated value when the update of the reference sample in steps 915 and 1022 is performed with respect to the current block 1610 .

도 16에서 도시된 현재 블록(1610), 주변 블록(1620), 주변 블록 참조 샘플(1631) 및 현재 블록 참조 샘플(1632)는 주변 블록(1620)의 인트라 예측 모드 및 현재 블록(1610)의 인트라 예측 모드가 모두 수직 예측 모드인 경우의 상대적인 위치를 나타낼 수 있다. 예를 들면, 인트라 예측 모드가 수직 예측 모드인 경우, 도 9a 및 도 10c에서 설명된 제1 주변 블록은 현재 블록의 좌측 인접 블록일 수 있다. 현재 블록의 참조 샘플은 현재 블록의 상단에 인접한 수평 라인 내의 픽셀(들)일 수 있다. 또한, 주변 블록의 참조 샘플은 주변 블록의 상단에 인접한 수평 라인 내의 픽셀(들)일 수 있다.The current block 1610 , the neighboring block 1620 , the neighboring block reference sample 1631 , and the current block reference sample 1632 shown in FIG. 16 are the intra prediction mode of the neighboring block 1620 and the intra prediction mode of the current block 1610 . It may indicate a relative position when all prediction modes are vertical prediction modes. For example, when the intra prediction mode is the vertical prediction mode, the first neighboring block described in FIGS. 9A and 10C may be a left neighboring block of the current block. The reference sample of the current block may be pixel(s) in a horizontal line adjacent to the top of the current block. Also, the reference sample of the neighboring block may be pixel(s) in a horizontal line adjacent to the top of the neighboring block.

도 17은 일 예에 따른 주변 블록의 잔차 신호의 계산 방법을 설명한다.17 illustrates a method of calculating a residual signal of a neighboring block according to an example.

도 17에서는, 주변 블록(1710), 주변 블록의 예측 블록(1720) 및 주변 블록의 잔차 신호(1730)가 도시되었다. 도 17에서는, 주변 블록의 잔차 신호인 Intra 주변블록_잔차신호가 행렬 식의 형태로 설명되었다.In FIG. 17 , a neighboring block 1710 , a prediction block 1720 of the neighboring block, and a residual signal 1730 of the neighboring block are illustrated. In FIG. 17 , the Intra neighboring block_residual signal, which is the residual signal of the neighboring block , has been described in the form of a matrix formula.

주변 블록(1710)은 도 9a 및 도 10c를 참조하여 전술된 제1 주변 블록에 대응할 수 있다. 또는, 주변 블록(1710)은 도 16을 참조하여 전술된 주변 블록(1620)에 대응할 수 있다.The neighboring block 1710 may correspond to the first neighboring block described above with reference to FIGS. 9A and 10C . Alternatively, the neighboring block 1710 may correspond to the neighboring block 1620 described above with reference to FIG. 16 .

잔차 신호(1730)는 도 9a 및 도 10c를 참조하여 전술된 "제1 주변 블록의 잔차 신호"에 대응할 수 있다.The residual signal 1730 may correspond to the “residual signal of the first neighboring block” described above with reference to FIGS. 9A and 10C .

도 17에서 도시된 것처럼, 잔차 신호(1730)는 주변 블록(1710) 및 예측 블록(1720) 간의 차이일 수 있다. 또는, 잔차 신호(1730)는 주변 블록(1710)으로부터 예측 블록(1720)을 뺀 결과일 수 있다.As shown in FIG. 17 , the residual signal 1730 may be a difference between the neighboring block 1710 and the prediction block 1720 . Alternatively, the residual signal 1730 may be a result of subtracting the prediction block 1720 from the neighboring block 1710 .

예측 블록(1720)의 값은 주변 블록(1710)에 대한 인트라 예측 모드에 기반하여 결정될 수 있다.The value of the prediction block 1720 may be determined based on the intra prediction mode for the neighboring block 1710 .

예를 들면, 도 17에서 도시된 것처럼, 주변 블록(1710)의 인트라 예측 모드가 수직 예측 모드인 경우, 예측 블록(1720)의 각 행의 값은 주변 블록(1710)의 참조 픽셀들의 값일 수 있다. 말하자면, 주변 블록(1710)의 인트라 예측 모드가 수직 예측 모드인 경우, 예측 블록(1720)의 각 행의 값들은 주변 블록(1710)의 상단에 인접한 수평 라인 내의 픽셀들의 값들일 수 있다.For example, as shown in FIG. 17 , when the intra prediction mode of the neighboring block 1710 is the vertical prediction mode, the value of each row of the prediction block 1720 may be the value of reference pixels of the neighboring block 1710 . . That is, when the intra prediction mode of the neighboring block 1710 is the vertical prediction mode, values of each row of the prediction block 1720 may be values of pixels in a horizontal line adjacent to the top of the neighboring block 1710 .

또는, 주변 블록(1710)의 인트라 예측 모드가 수평 예측 모드인 경우, 예측 블록(1720)의 각 열의 값은 주변 블록(1710)의 참조 픽셀들의 값일 수 있다. 말하자면, 주변 블록(1710)의 인트라 예측 모드가 수평 예측 모드인 경우, 예측 블록(1720)의 각 열의 값들은 주변 블록(1710)의 좌측에 인접한 수직 라인 내의 픽셀들의 값들일 수 있다.Alternatively, when the intra prediction mode of the neighboring block 1710 is the horizontal prediction mode, the values of each column of the prediction block 1720 may be values of reference pixels of the neighboring block 1710 . That is, when the intra prediction mode of the neighboring block 1710 is the horizontal prediction mode, values of each column of the prediction block 1720 may be values of pixels in a vertical line adjacent to the left side of the neighboring block 1710 .

수직 예측 모드 및 수평 예측 모드 외에도, 다른 인트라 예측 모드에 대해서도 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.In addition to the vertical prediction mode and the horizontal prediction mode, the prediction block generation method of existing image encoding and/or decoding techniques such as HEVC and AVC may be used for other intra prediction modes.

도 18은 일 예에 따른 현재 블록의 잔차 신호의 계산 방법을 설명한다.18 illustrates a method of calculating a residual signal of a current block according to an example.

도 18에서는, 현재 블록(1810), 현재 블록의 예측 블록(1820) 및 현재 블록의 잔차 신호(1830)가 도시되었다. 도 18에서는, 현재 블록의 잔차 신호인 Intra 현재블록_잔차신호가 행렬 식의 형태로 설명되었다.18 , a current block 1810 , a prediction block 1820 of the current block, and a residual signal 1830 of the current block are illustrated. In FIG. 18 , the Intra current block_residual signal, which is the residual signal of the current block , has been described in the form of a matrix expression.

현재 블록(1810)은 도 9a 및 도 10a를 참조하여 전술된 현재 블록에 대응할 수 있다. 또는 현재 블록(1810)은 도 16을 참조하여 전술된 현재 블록(1610)에 대응할 수 있다.The current block 1810 may correspond to the current block described above with reference to FIGS. 9A and 10A . Alternatively, the current block 1810 may correspond to the current block 1610 described above with reference to FIG. 16 .

잔차 신호(1830)는 도 9a 및 도 10c를 참조하여 전술된 "현재 블록의 제2 잔차 신호"에 대응할 수 있다.The residual signal 1830 may correspond to the “second residual signal of the current block” described above with reference to FIGS. 9A and 10C .

도 18에서 도시된 것처럼, 잔차 신호(1830)는 현재 블록 (1810) 및 예측 블록(1820) 간의 차이일 수 있다. 또는, 잔차 신호(1830)는 현재 블록(1810)으로부터 예측 블록(1820)을 뺀 결과일 수 있다.18 , the residual signal 1830 may be the difference between the current block 1810 and the prediction block 1820 . Alternatively, the residual signal 1830 may be a result of subtracting the prediction block 1820 from the current block 1810 .

도 18에 따르면, 잔차 신호(1830)의 값들의 합은 560이다. 말하자면, 잔차 신호(1830)의 레벨 합은 560이다.According to FIG. 18 , the sum of the values of the residual signal 1830 is 560. In other words, the level sum of the residual signal 1830 is 560.

예측 블록(1820)의 값은 주변 블록에 대한 인트라 예측 모드에 기반하여 결정될 수 있다.The value of the prediction block 1820 may be determined based on the intra prediction mode for the neighboring block.

예를 들면, 도 18에서 도시된 것처럼, 현재 블록(1810)의 인트라 예측 모드가 수직 예측 모드인 경우, 예측 블록(1820)의 각 행의 값은 주변 블록의 참조 픽셀들의 값일 수 있다. 말하자면, 현재 블록(1810)의 인트라 예측 모드가 수직 예측 모드인 경우, 예측 블록(1820)의 각 행의 값들은 현재 블록(1810)의 상단에 인접한 수평 라인 내의 픽셀들의 값들일 수 있다.For example, as shown in FIG. 18 , when the intra prediction mode of the current block 1810 is the vertical prediction mode, the value of each row of the prediction block 1820 may be the value of reference pixels of the neighboring block. That is, when the intra prediction mode of the current block 1810 is the vertical prediction mode, the values of each row of the prediction block 1820 may be values of pixels in a horizontal line adjacent to the top of the current block 1810 .

또는, 현재 블록(1810)의 인트라 예측 모드가 수평 예측 모드인 경우, 예측 블록(1820)의 각 열의 값은 주변 블록의 참조 픽셀들의 값일 수 있다. 말하자면, 현재 블록(1810)의 인트라 예측 모드가 수평 예측 모드인 경우, 예측 블록(1820)의 각 열의 값들은 현재 블록(1810)의 좌측에 인접한 수직 라인 내의 픽셀들의 값들일 수 있다.Alternatively, when the intra prediction mode of the current block 1810 is the horizontal prediction mode, the value of each column of the prediction block 1820 may be the value of reference pixels of a neighboring block. That is, when the intra prediction mode of the current block 1810 is the horizontal prediction mode, the values of each column of the prediction block 1820 may be values of pixels in a vertical line adjacent to the left side of the current block 1810 .

도 18을 참조하여 설명된 현재 블록(1810)의 잔차 신호(1830)의 계산 방법은 도 9a를 참조하여 전술된 단계(940) 및 도 10c를 참조하여 전술된 단계(1045)의 현재 블록의 제2 잔차 신호 생성에 대응할 수 있다.The method of calculating the residual signal 1830 of the current block 1810 described with reference to FIG. 18 is the first step of the current block in step 940 described above with reference to FIG. 9A and step 1045 described above with reference to FIG. 10C. 2 It can correspond to the generation of a residual signal.

또한, 도 18을 참조하여 설명된 현재 블록(1810)의 잔차 신호(1830)의 계산 방법은 단계(960) 및 단계(1046)의 현재 블록의 제3 잔차 신호 생성에 대응할 수 있다.In addition, the method of calculating the residual signal 1830 of the current block 1810 described with reference to FIG. 18 may correspond to the generation of the third residual signal of the current block in steps 960 and 1046 .

실시예들에 따른 잔차 신호 예측 후의 잔차 신호가 아래에서 도 19를 설명하여 상세하게 설명된다.A residual signal after prediction of the residual signal according to embodiments is described in detail below with reference to FIG. 19 .

도 19는 일 예에 따른 잔차 신호 예측 방법을 설명한다.19 illustrates a residual signal prediction method according to an example.

도 19에서는, 현재 블록의 잔차 신호(1910), 주변 블록의 잔차 신호(1920) 및 현재 블록의 예측 잔차 신호(1930)가 도시되었다. 도 19에서는, 현재 블록의 예측 잔차 신호인 Intra 예측잔차신호가 행렬 식의 형태로 설명되었다.19 , the residual signal 1910 of the current block, the residual signal 1920 of the neighboring block, and the prediction residual signal 1930 of the current block are shown. In FIG. 19, the intra prediction residual signal, which is the prediction residual signal of the current block, has been described in the form of a matrix expression.

도 19은, 도 9의 단계(950) 및 도 10의 단계(1042)의 잔차 신호 예측을 나타낼 수 있다.19 may represent the residual signal prediction of step 950 of FIG. 9 and step 1042 of FIG. 10 .

현재 블록의 잔차 신호(1910)는 도 18을 참조하여 전술된 현재 블록의 잔차 신호(1830)에 대응할 수 있다. 또는, 현재 블록의 잔차 신호(1910)는 도 9a 및 도 10c를 참조하여 전술된 "현재 블록의 제2 잔차 신호"에 대응할 수 있다.The residual signal 1910 of the current block may correspond to the residual signal 1830 of the current block described above with reference to FIG. 18 . Alternatively, the residual signal 1910 of the current block may correspond to the “second residual signal of the current block” described above with reference to FIGS. 9A and 10C .

주변 블록의 잔차 신호(1920)는 도 17을 참조하여 전술된 주변 블록의 잔차 신호(1730)에 대응할 수 있다. 또는, 주변 블록의 잔차 신호(1920)는 도 9a 및 도 10c를 참조하여 전술된 "제1 주변 블록의 잔차 신호"에 대응할 수 있다.The residual signal 1920 of the neighboring block may correspond to the residual signal 1730 of the neighboring block described above with reference to FIG. 17 . Alternatively, the residual signal 1920 of the neighboring block may correspond to the “residual signal of the first neighboring block” described above with reference to FIGS. 9A and 10C .

현재 블록의 예측 잔차 신호(1930)는 도 9a 및 도 10c를 참조하여 전술된 "현재 블록의 제1 잔차 신호"에 대응할 수 있다.The prediction residual signal 1930 of the current block may correspond to the “first residual signal of the current block” described above with reference to FIGS. 9A and 10C .

예측 잔차 신호(1930)는 현재 블록의 잔차 신호(1910) 및 주변 블록의 잔차 신호(1920) 간의 차이일 수 있다. 또는, 예측 잔차 신호(1930)는 현재 블록의 잔차 신호(1910)에서 주변 블록의 잔차 신호(1920)를 뺀 결과일 수 있다.The prediction residual signal 1930 may be a difference between the residual signal 1910 of the current block and the residual signal 1920 of the neighboring block. Alternatively, the prediction residual signal 1930 may be a result of subtracting the residual signal 1920 of a neighboring block from the residual signal 1910 of the current block.

예측 잔차 신호(1930)의 값들의 합은 267이다. 말하자면, 예측 잔차 신호(1930)의 레벨 합은 267이다. 잔차 신호 예측에 의해, 현재 블록의 최종적인 잔차 신호의 레벨 합이 560에서 269로 감소하였다. 잔차 신호 예측에 의해 최종적인 잔차 신호의 레벨 합이 감소한다는 것은, 현재 블록의 부호화를 위해 사용되는 잔차 신호 자체의 에너지가 감소한다는 것을 나타낼 수 있다. 부호화를 위해 사용되는 잔차 신호 자체의 에너지가 감소한다는 것은, 부호화를 위해 요구되는 비트량이 감소된다는 것을 의미할 수 있다. 따라서, 부호화 장치(800)는 잔차 신호 예측을 통해 비트스트림의 용량을 감소시킬 수 있다.The sum of the values of the prediction residual signal 1930 is 267. In other words, the level sum of the prediction residual signal 1930 is 267. By the residual signal prediction, the level sum of the final residual signal of the current block is reduced from 560 to 269. The reduction in the level sum of the final residual signal by the residual signal prediction may indicate that the energy of the residual signal itself used for encoding of the current block is reduced. Reducing the energy of the residual signal itself used for encoding may mean that the amount of bits required for encoding is reduced. Accordingly, the encoding apparatus 800 may reduce the capacity of the bitstream through residual signal prediction.

도 20a는 일 예에 따른 디폴트 잔차 신호를 예시한다.20A illustrates a default residual signal according to an example.

도 20a의 디폴트 잔차는 도 9a 및 도 10c를 참조하여 전술된 제2 잔차 신호의 일 예일 수 있다. 말하자면, 디폴트 잔차는 잔차 신호 예측 전의 현재 블록의 잔차 신호일 수 있다. 또는, 도 18a의 디폴트 잔차는 도 19을 참조하여 전술된 현재 블록의 잔차 신호(1910)의 일 예일 수 있다.The default residual of FIG. 20A may be an example of the second residual signal described above with reference to FIGS. 9A and 10C . In other words, the default residual may be a residual signal of the current block before residual signal prediction. Alternatively, the default residual of FIG. 18A may be an example of the residual signal 1910 of the current block described above with reference to FIG. 19 .

도 20b는 일 예에 따른 디폴트 잔차 신호에 대한 이산 여현 변환의 결과를 도시한다.20B illustrates a result of a discrete cosine transform on a default residual signal according to an example.

도 20b에서는, 도 20a의 디폴트 잔차 신호에 대한 이산 여현 변환(discrete cosine transform)의 결과가 도시되었다.In FIG. 20B, the result of discrete cosine transform on the default residual signal of FIG. 20A is shown.

도 21a는 일 예에 따른 제안된 잔차 신호를 예시한다.21A illustrates a proposed residual signal according to an example.

도 21a의 제안된 잔차는 도 9a 및 도 10c를 참조하여 전술된 제1 잔차 신호의 일 예일 수 있다. 말하자면, 제안된 잔차는 잔차 신호 예측에 따른 현재 블록의 잔차 신호일 수 있다. 또는, 도 20a의 제안된 잔차는 도 19을 참조하여 전술된 현재 블록의 예측 잔차 신호(1930)의 일 예일 수 있다.The proposed residual of FIG. 21A may be an example of the first residual signal described above with reference to FIGS. 9A and 10C . In other words, the proposed residual may be a residual signal of the current block according to residual signal prediction. Alternatively, the proposed residual of FIG. 20A may be an example of the prediction residual signal 1930 of the current block described above with reference to FIG. 19 .

도 21b는 일 예에 따른 제안된 잔차 신호에 대한 이산 여현 변환의 결과를 도시한다.21B shows the result of discrete cosine transform on the proposed residual signal according to an example.

도 21b에서는, 도 21a의 디폴트 잔차 신호에 대한 이산 여현 변환의 결과가 도시되었다.In FIG. 21B, the result of the discrete cosine transform on the default residual signal of FIG. 21A is shown.

도 20a 내지 도 21b를 살펴보면, 잔차 신호 예측에 의해 주파수 영역에서의 에너지 집중도가 높아졌음이 확인될 수 있다. 인트라 잔차 예측부(810)는 잔차 신호 예측을 통해, 현재 블록의 잔차 신호의 주파수 영역에서의 에너지 집중도를 향상시킬 수 있다. 잔차 신호 예측에 의해 주파수 영역에서의 계수 값의 크기가 감소됨에 따라, 양자화에 의해 생성된 결과 값이 0이 될 확률 및 양자화에 의해 생성된 결과 값이 0에 가깝게 될 확률이 향상될 수 있다.Referring to FIGS. 20A to 21B , it can be confirmed that the energy concentration in the frequency domain is increased by the residual signal prediction. The intra residual predictor 810 may improve the energy concentration of the residual signal of the current block in the frequency domain through residual signal prediction. As the magnitude of the coefficient value in the frequency domain is reduced by the residual signal prediction, the probability that the result value generated by quantization becomes 0 and the probability that the result value generated by quantization becomes close to 0 may be improved.

도 22은 일 예에 따른 주변 블록의 위치를 설명한다.22 illustrates a location of a neighboring block according to an example.

도 16에서는, 주변 블록(1620)이 현재 블록(1610)의 좌측에 인접한 것으로 도시되었다. 도 16에서는, 좌측 인접 블록을 사용하여 잔차 신호 예측이 수행된 경우가 설명되었다. 그러나, 도 9a 및 도 10c를 참조하여 전술된 제1 주변 블록의 위치는 현재 블록(1610)의 좌측으로 한정되지 않을 수 있다.In FIG. 16 , the neighboring block 1620 is shown adjacent to the left side of the current block 1610 . In FIG. 16 , a case in which residual signal prediction is performed using the left adjacent block has been described. However, the position of the first neighboring block described above with reference to FIGS. 9A and 10C may not be limited to the left side of the current block 1610 .

도 9의 단계(935) 및 도 10의 단계(1043)에서 전술된 것과 같이, 인트라 잔차 예측부(810)는 현재 블록의 하나 이상의 주변 블록들 중 제1 주변 블록을 결정할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있다. 인트라 잔차 예측부(810)는 현재 블록의 하나 이상의 이미 복원된 주변 블록들 중 제1 주변 블록을 결정할 수 있다.As described above in operation 935 of FIG. 9 and operation 1043 of FIG. 10 , the intra residual predictor 810 may determine a first neighboring block from among one or more neighboring blocks of the current block. The first neighboring block may be a block used for residual signal prediction. The intra residual predictor 810 may determine a first neighboring block from among one or more previously reconstructed neighboring blocks of the current block.

복수 개의 주변 블록들 중 제1 주변 블록을 결정함에 따라, 인트라 잔차 예측부(810)는 잔차 신호에 대한 제1 주변 블록의 공간적 상관도를 향상시킬 수 있다.As the first neighboring block is determined from among the plurality of neighboring blocks, the intra residual predictor 810 may improve the spatial correlation of the first neighboring block with respect to the residual signal.

도 22에서는, 현재 블록의 하나 이상의 주변 블록들로서, 좌측 하단 인접 블록 A0(2221), 좌측 인접 블록 A1(2222), 우측 상단 인접 블록 B1(2223), 우측 인접 블록 B2(2224) 및 좌측 상단 인접 블록 B3(2225)이 도시되었다. 도시된 것과 같이, 현재 블록의 하나 이상의 주변 블록들은 좌측 하단 인접 블록, 좌측 인접 블록, 우측 상단 인접 블록, 우측 인접 블록 및 좌측 상단 인접 블록을 포함할 수 있다. 현재 블록의 하나 이상의 주변 블록들은 도 22에서 예시된 위치의 블록들로 한정되지 않는다.In FIG. 22 , as one or more neighboring blocks of the current block, the lower left neighboring block A 0 2221 , the left neighboring block A 1 2222 , the upper right neighboring block B 1 2223 , and the right neighboring block B 2 2224 ) and upper left adjacent block B 3 (2225) are shown. As illustrated, the one or more neighboring blocks of the current block may include a lower left neighboring block, a left neighboring block, an upper right neighboring block, a right neighboring block, and an upper left neighboring block. One or more neighboring blocks of the current block are not limited to the blocks of the position illustrated in FIG. 22 .

잔차 신호 예측의 효율을 향상시키기 위해서는, 현재 블록 및 주변 블록과의 공간적 상관도가 향상될 필요가 있다. 공간적 상관도가 높은 주변 블록을 향상시키기 위해, 인트라 잔차 예측부(810)는 현재 블록의 복수의 주변 블록들의 각 주변 블록에 대하여 잔차 신호 예측을 수행할 수 있다. 잔차 신호 예측에 따라 복수의 주변 블록들에 대한 복수의 잔차 신호들이 생성되면, 인트라 잔차 예측부(810)는 복수의 잔차 신호들 중 최소의 율-왜곡 값을 갖는 최소 율-왜곡 잔차 신호를 선택할 수 있다. 또한, 인트라 잔차 예측부(810)는 복수의 주변 블록들 중 최소 율-왜곡 잔차 신호에 대응하는 주변 블록을 선택할 수 있다. 인트라 잔차 예측부(810)는 현재 블록의 부호화를 위해 선택된 주변 블록 및 최소 율-왜곡 잔차 신호를 사용할 수 있다.In order to improve the residual signal prediction efficiency, the spatial correlation between the current block and the neighboring blocks needs to be improved. In order to improve a neighboring block having high spatial correlation, the intra residual prediction unit 810 may perform residual signal prediction on each neighboring block of a plurality of neighboring blocks of the current block. When a plurality of residual signals for a plurality of neighboring blocks are generated according to residual signal prediction, the intra residual predictor 810 selects a minimum rate-distortion residual signal having a minimum rate-distortion value from among the plurality of residual signals. can Also, the intra residual predictor 810 may select a neighboring block corresponding to the minimum rate-distortion residual signal from among the plurality of neighboring blocks. The intra residual predictor 810 may use the selected neighboring block and the minimum rate-distortion residual signal for encoding the current block.

예를 들면, 도 9a를 참조하여 전술된 단계(935), 단계(940) 및 단계(950)와, 도 10c를 참조하여 전술된 단계(1043), 단계(1044) 및 단계(1045)는 현재 블록의 복수의 주변 블록들의 각 블록에 대해서 수행될 수 있다. 여기에서, 현재 블록의 복수의 주변 블록들은 현재 블록에 인접한 하나 이상의 이미 복원된 블록들 중 적어도 일부일 수 있다. 복수의 주변 블록들의 개수 및 복수의 주변 블록들의 위치들은 부호화 장치(800)의 설정에 따라 변경될 수 있다.For example, steps 935, 940, and 950 described above with reference to FIG. 9A and steps 1043, 1044, and 1045 described above with reference to FIG. 10C are currently It may be performed for each block of a plurality of neighboring blocks of the block. Here, the plurality of neighboring blocks of the current block may be at least some of one or more previously reconstructed blocks adjacent to the current block. The number of the plurality of neighboring blocks and positions of the plurality of neighboring blocks may be changed according to a setting of the encoding apparatus 800 .

단계(935) 또는 단계(1043)의 반복을 통해, 인트라 잔차 예측부(810)는 현재 블록의 복수의 주변 블록들을 차례로 제1 블록으로서 선택할 수 있다.Through repetition of operation 935 or operation 1043 , the intra residual predictor 810 may sequentially select a plurality of neighboring blocks of the current block as the first block.

단계(950) 또는 단계(1045)의 반복을 통해, 인트라 잔차 예측부(810)는 현재 블록의 복수의 주변 블록들의 복수의 제1 잔차 신호들을 생성할 수 있다. 또한 인트라 잔차 예측부(810)는 복수의 제1 잔차 신호들의 각각에 대해서 율-왜곡 값을 계산할 수 있다.Through repetition of operation 950 or operation 1045 , the intra residual predictor 810 may generate a plurality of first residual signals of a plurality of neighboring blocks of the current block. Also, the intra residual predictor 810 may calculate a rate-distortion value for each of the plurality of first residual signals.

인트라 잔차 예측부(810)는 복수의 제1 잔차 신호들 중 최소의 율-왜곡 값을 갖는 최소 율-왜곡 잔차 신호를 결정할 수 있고, 최소 율-왜곡 잔차 신호에 대응하는 주변 블록을 현재 블록의 잔차 신호 예측을 위해 사용되는 제1 주변 블록으로 결정할 수 있다.The intra residual predictor 810 may determine a minimum rate-distortion residual signal having a minimum rate-distortion value from among the plurality of first residual signals, and select a neighboring block corresponding to the minimum rate-distortion residual signal of the current block. It may be determined as the first neighboring block used for residual signal prediction.

단계(940)는 단계(950)가 반복됨에 따라 함께 반복될 수도 있고, 1회만 수행될 수도 있다. 단계(1044)는 단계(1055)가 반복됨에 따라 함께 반복될 수도 있고, 1회만 수행될 수도 있다.Step 940 may be repeated together as step 950 is repeated, or may be performed only once. Step 1044 may be repeated together as step 1055 is repeated, or may be performed only once.

단계(935) 및 단계(1043)에서, 현재 블록의 제1 주변 블록은 코딩 유닛 별로 결정될 수 있다. 또한, 단계(985) 및 단계(1048)에서, 제1 주변 블록의 식별자는 코딩 유닛 별로 부호화될 수 있다.In steps 935 and 1043 , a first neighboring block of the current block may be determined for each coding unit. Also, in steps 985 and 1048 , the identifier of the first neighboring block may be encoded for each coding unit.

도 23은 일 실시예에 따른 복호화 장치의 구조도이다.23 is a structural diagram of a decoding apparatus according to an embodiment.

복호화 장치(2300)는 전술된 복호화 장치(200)에 대응할 수 있다. 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽처 버퍼(270)를 포함할 수 있고, 인트라 잔차 예측부(2310)를 더 포함할 수 있다.The decoding apparatus 2300 may correspond to the above-described decoding apparatus 200 . The decoding apparatus 200 includes an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensator 250 , an adder 255 , and a filter unit 260 . and a reference picture buffer 270 , and may further include an intra residual predictor 2310 .

엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽처 버퍼(270)는 도 2를 참조하여 전술된 것과 같은 기능 및/또는 동작을 수행할 수 있다. 중복되는 설명은 생략한다.Entropy decoding unit 210 , inverse quantization unit 220 , inverse transform unit 230 , intra prediction unit 240 , motion compensator 250 , adder 255 , filter unit 260 and reference picture buffer 270 . ) may perform the same functions and/or operations as described above with reference to FIG. 2 . A duplicate description will be omitted.

도 9a 내지 도 22을 참조하여 전술된 실시예들에서, 부호화 장치(800)의 인트라 예측부(120)에 의해 수행되는 것으로 설명된 기능 및/또는 동작은 복호화 장치(2300)의 인트라 예측부(240)에 의해서 수행될 수 있다. 또한, 부호화 장치(800)의 인트라 잔차 예측부(810)에 의해 수행되는 것으로 설명된 기능 및/또는 동작은 복호화 장치(2300)의 인트라 잔차 예측부(2310)에 의해서 수행될 수 있다.In the embodiments described above with reference to FIGS. 9A to 22 , the functions and/or operations described as being performed by the intra prediction unit 120 of the encoding apparatus 800 are performed by the intra prediction unit ( 240) can be performed. Also, functions and/or operations described as being performed by the intra residual predicting unit 810 of the encoding apparatus 800 may be performed by the intra residual predicting unit 2310 of the decoding apparatus 2300 .

또한, 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽처 버퍼(270)는 인트라 잔차 예측부(2310)와 관련된 기능 및/또는 동작을 수행할 수 있다. 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260), 참조 픽처 버퍼(270) 및 인트라 잔차 예측부(2310)의 기능 및/또는 동작에 대해서 아래에서 상세하게 설명된다.In addition, the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra prediction unit 240, the motion compensation unit 250, the adder 255, the filter unit 260 and the reference picture buffer. The 270 may perform functions and/or operations related to the intra residual predictor 2310 . Entropy decoding unit 210 , inverse quantization unit 220 , inverse transform unit 230 , intra prediction unit 240 , motion compensation unit 250 , adder 255 , filter unit 260 , reference picture buffer 270 . ) and functions and/or operations of the intra residual prediction unit 2310 will be described in detail below.

인트라 잔차 예측부(2310)는 인트라 예측부(240)와 구분되지 않을 수 있다. 인트라 예측부(240) 및 인트라 잔차 예측부(2310)는 인트라 예측부(240)로 통합될 수 있으며, 실시예들에서, 인트라 잔차 예측부(2310)에 의해 수행되는 것으로 설명된 기능 및/또는 동작은 인트라 예측부(240)에 의해 수행될 수 있다.The intra residual predictor 2310 may not be distinguished from the intra predictor 240 . The intra prediction unit 240 and the intra residual prediction unit 2310 may be integrated into the intra prediction unit 240 , and in embodiments, a function described as being performed by the intra residual prediction unit 2310 and/or The operation may be performed by the intra prediction unit 240 .

도 24a 및 도 24b는 일 실시예에 따른 복호화 방법의 흐름도이다.24A and 24B are flowcharts of a decoding method according to an embodiment.

이하에서, 현재 블록은 현재 복호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block currently being decoded, or may be a block in the current image.

우선, 도 24a를 참조하면, 단계(2410)가 수행될 수 있다.First, referring to FIG. 24A , step 2410 may be performed.

단계(2410)에서, 복호화 장치(2310)는 현재 블록의 잔차 신호를 생성할 수 있다. 여기에서, 생성된 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 현재 블록의 제1 잔차 신호에 대응할 수 있다.In operation 2410, the decoding apparatus 2310 may generate a residual signal of the current block. Here, the generated residual signal may correspond to the first residual signal of the current block described above with reference to FIGS. 9A and 10C .

단계(2410)는 엔트로피 복호화부(210), 역양자화부(220) 및 역변환부(230) 중 적어도 하나에 의해 수행될 수 있다.Operation 2410 may be performed by at least one of the entropy decoding unit 210 , the inverse quantization unit 220 , and the inverse transform unit 230 .

단계(2410)는 단계(2411), 단계(2412) 및 단계(2413)를 포함할 수 있다.Step 2410 may include steps 2411 , 2412 , and 2413 .

단계(2411)에서, 엔트로피 복호화부(210)는 현재 블록에 대한 양자화된 계수를 생성할 수 있다.In operation 2411, the entropy decoder 210 may generate a quantized coefficient for the current block.

단계(2412)에서, 역양자화부(220)는 양자화된 계수에 대한 역양자화를 수행함으로써 역양자화된 계수를 생성할 수 있다.In operation 2412 , the inverse quantization unit 220 may generate an inverse quantized coefficient by performing inverse quantization on the quantized coefficient.

단계(2413)에서, 역변환부(230)는 역양자화된 계수에 대한 역변환을 수행함으로써 잔차 신호를 생성할 수 있다.In operation 2413 , the inverse transform unit 230 may generate a residual signal by performing an inverse transform on the inverse quantized coefficients.

단계(2410)가 수행된 후, 단계(2420) 및 단계(2$40)가 수행될 수 있다.After step 2410 is performed, step 2420 and step 2$40 may be performed.

다음으로, 도 24b를 참조한다.Next, reference is made to FIG. 24B.

단계(2420)의 수행의 이전에, 참조 샘플이 생성될 수 있다. 도 11을 참조하여 전술된 참조 샘플의 생성에 관련된 내용은 본 실시예에도 적용될 수 있다. 중복되는 설명은 생략된다.Prior to performing step 2420, a reference sample may be generated. The content related to the generation of the reference sample described above with reference to FIG. 11 may also be applied to the present embodiment. A duplicate description is omitted.

단계(2420)에서, 인트라 예측부(240)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다.In operation 2420, the intra predictor 240 may determine whether to update the reference sample.

여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성하는 것일 수 있다.Here, the updating of the reference sample may be reconstructing the sample value of the reference sample used for generation of the prediction block before generation of the prediction block of the current block.

인트라 예측부(240)는 도 9a 및 도 10b를 참조하여 전술된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 포함할 수 있다. 참조 샘플의 갱신의 수행의 여부를 나타내는 정보는 비트스트림 내에서 부호화될 수 있다.The intra predictor 240 may determine whether to update the reference sample by using the information indicating whether or not to update the reference sample described above with reference to FIGS. 9A and 10B . The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include information indicating whether the reference sample is updated. Information indicating whether the update of the reference sample is performed may be encoded in the bitstream.

인트라 예측부(240)는 부호화된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 복호화할 수 있다. 인트라 예측부(240)는 복호화된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 상기의 정보가 참조 샘플의 갱신을 수행하는 것을 나타내면, 인트라 예측부(240)는 참조 샘플의 갱신을 수행할 수 있다. 상기의 정보가 참조 샘플의 갱신을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 참조 샘플의 갱신을 수행하지 않을 수 있다.The intra prediction unit 240 may decode information indicating whether to update the coded reference sample. The intra predictor 240 may determine whether to update the reference sample by using information indicating whether to update the decoded reference sample. If the above information indicates that the reference sample is updated, the intra prediction unit 240 may update the reference sample. If the above information indicates that the update of the reference sample is not performed, the intra prediction unit 240 may not perform the update of the reference sample.

참조 샘플의 갱신을 수행하기로 결정된 경우, 단계(2425)가 수행될 수 있다. 참조 샘플 갱신을 수행하지 않기로 결정된 경우, 단계(2430)가 수행될 수 있다.If it is determined to perform an update of the reference sample, step 2425 may be performed. If it is determined not to perform the reference sample update, step 2430 may be performed.

단계(2425)에서, 인트라 예측부(240)는 참조 샘플의 값을 갱신할 수 있으며, 갱신을 통해 현재 블록의 예측 블록을 생성하기 위해 사용되는 참조 샘플의 값을 결정할 수 있다.In operation 2425, the intra prediction unit 240 may update the value of the reference sample, and through the update, determine the value of the reference sample used to generate the prediction block of the current block.

도 12, 13 및 도 14를 참조하여 전술된 참조 샘플의 갱신에 관련된 내용은 본 실시예에도 적용될 수 있다. 도 12, 13 및 도 14를 참조하여 전술된 실시예들에서, 부호화 장치(800)의 인트라 예측부(120)에 수행되는 것으로 설명된 기능 및/또는 동작은 복호화 장치(2300)의 인트라 예측부(240)에 의해 수행될 수 있다. 또한, 도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서 수행되는 것으로 설명된 기능 및/또는 동작은 단계(2425)에서도 수행될 수 있다. 중복되는 설명은 생략된다.The contents related to the update of the reference sample described above with reference to FIGS. 12, 13 and 14 may also be applied to the present embodiment. In the embodiments described above with reference to FIGS. 12 , 13 and 14 , the functions and/or operations described as being performed by the intra prediction unit 120 of the encoding apparatus 800 are performed by the intra prediction unit of the decoding apparatus 2300 . (240). In addition, functions and/or operations described as being performed in step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B may also be performed in step 2425 . A duplicate description is omitted.

단계(2425)가 수행된 후 단계(2430)가 수행될 수 있다.After step 2425 is performed, step 2430 may be performed.

단계(2430)에서, 인트라 예측부(240)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(240)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In operation 2430, the intra prediction unit 240 may generate a prediction block of the current block. The intra prediction unit 240 may generate the prediction block of the current block by using the reference sample according to the intra prediction mode for the current block.

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a method of generating a prediction block of an existing image encoding and/or decoding technology such as HEVC and AVC may be used.

단계(2430)가 수행된 후, 단계(2460) 또는 단계(2490)가 수행될 수 있다.After step 2430 is performed, step 2460 or step 2490 may be performed.

단계(2440)에서, 인트라 잔차 예측부(2310)는 잔차 신호 예측의 수행의 여부를 결정할 수 있다.In operation 2440 , the intra residual predictor 2310 may determine whether to perform residual signal prediction.

인트라 잔차 예측부(2310)는 도 9a 및 도 10c를 참조하여 전술된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다. 부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 잔차 신호 예측의 수행의 여부를 나타내는 정보를 포함할 수 있다. 잔차 신호 예측의 수행의 여부를 나타내는 정보는 비트스트림 내에서 부호화될 수 있다.The intra residual prediction unit 2310 may determine whether to perform the residual signal prediction by using the information indicating whether the residual signal prediction described above with reference to FIGS. 9A and 10C is performed. The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include information indicating whether residual signal prediction is performed. Information indicating whether residual signal prediction is performed may be encoded in a bitstream.

인트라 예측부(240)는 부호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 복호화할 수 있다. 인트라 예측부(240)는 복호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행하지 않을 수 있다.The intra prediction unit 240 may decode information indicating whether prediction of the encoded residual signal is performed. The intra prediction unit 240 may determine whether to perform the residual signal prediction by using information indicating whether the decoded residual signal prediction is performed. If the above information indicates that residual signal prediction is performed, the intra prediction unit 240 may perform residual signal prediction. If the above information indicates that residual signal prediction is not performed, the intra prediction unit 240 may not perform residual signal prediction.

잔차 신호 예측을 수행하기로 결정된 경우, 단계(2450)가 수행될 수 있다.If it is determined to perform residual signal prediction, step 2450 may be performed.

잔차 신호 예측을 수행하지 않기로 결정된 경우, 단계(2490)가 수행될 수 있다.If it is determined not to perform residual signal prediction, step 2490 may be performed.

단계(2450)에서, 인트라 잔차 예측부(2310)는 제1 주변 블록을 식별할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있으며, 현재 블록의 주변에 위치한 블록일 수 있다. 도 22을 참조하여 전술된 제1 주변 블록의 결정에 관련된 내용은 본 실시예에도 적용될 수 있다.In operation 2450 , the intra residual predictor 2310 may identify a first neighboring block. The first neighboring block may be a block used for prediction of the residual signal, and may be a block located near the current block. The contents related to the determination of the first neighboring block described above with reference to FIG. 22 may also be applied to the present embodiment.

인트라 잔차 예측부(2310)는 도 9a 및 도 10c를 참조하여 전술된 제1 주변 블록의 식별자를 사용하여 제1 주변 블록을 식별할 수 있다. 부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 제1 주변 블록의 식별자를 포함할 수 있다. 제1 주변 블록의 식별자는 비트스트림 내에서 부호화될 수 있다.The intra residual predictor 2310 may identify the first neighboring block using the identifier of the first neighboring block described above with reference to FIGS. 9A and 10C . The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include the identifier of the first neighboring block. The identifier of the first neighboring block may be encoded in the bitstream.

인트라 잔차 예측부(2310)는 부호화된 제1 주변 블록의 식별자를 복호화할 수 있다. 인트라 잔차 예측부(2310)는 복호화된 제1 주변 블록의 식별자를 사용하여 제1 주변 블록을 식별할 수 있다.The intra residual predictor 2310 may decode the encoded identifier of the first neighboring block. The intra residual predictor 2310 may identify the first neighboring block by using the identifier of the decoded first neighboring block.

제1 주변 블록의 식별자는 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록이 식별되는 것을 가능하게 하는 정보일 수 있다.The identifier of the first neighboring block may be information that enables the neighboring block used for prediction of the residual signal of the current block to be identified.

예를 들면, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록을 나타낼 수 있다. 또는, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록의 위치를 나타내는 위치 정보일 수 있다. 상기의 위치는 현재 블록에 대한 선택된 주변 블록의 상대적인 위치를 나타낼 수 있다. 상기의 위치는 현재 블록에 대하여 선택된 주변 블록이 인접한 방향을 나타낼 수 있다.For example, the identifier of the first neighboring block may indicate a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. Alternatively, the identifier of the first neighboring block may be position information indicating a position of a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. The position may indicate a relative position of the selected neighboring block with respect to the current block. The position may indicate a direction in which a neighboring block selected with respect to the current block is adjacent.

주변 블록의 위치 및 개수는 부호화 파라미터에 따라 정의될 수 있다.The position and number of neighboring blocks may be defined according to encoding parameters.

제1 주변 블록의 식별자는 부호화 장치(800) 및 복호화 장치(2300)의 양자에 있어서 동일한 블록을 가리키도록 구성되어야 할 수 있다. 예를 들면, 제1 주변 블록의 식별자와 관련하여 블록의 크기 N 및 주변 블록의 위치가 부호화 장치(800) 및 복호화 장치(2300)에서 공통되어야 할 수 있다. 부호화 장치(800) 및 복호화 장치(2300)가 제1 주변 블록의 식별자와 관련하여 공통된 구성을 공유하게 하기 위해, 제1 주변 블록의 식별자는 "(이웃-잔차_인덱스) 절삭형 단항((neighboring-residual_idx) Truncated unary)" 방식으로 엔트로피 복호화될 수 있다.The identifier of the first neighboring block may be configured to indicate the same block in both the encoding apparatus 800 and the decoding apparatus 2300 . For example, in relation to the identifier of the first neighboring block, the size N of the block and the position of the neighboring block may have to be common to the encoding apparatus 800 and the decoding apparatus 2300 . In order for the encoding apparatus 800 and the decoding apparatus 2300 to share a common configuration with respect to the identifier of the first neighboring block, the identifier of the first neighboring block is "(neighboring-residual_index) truncation unary ((neighboring) -residual_idx) Truncated unary)" may be entropy-decoded.

단계(2450) 및 단계(2430)가 수행되면, 다음으로 단계(2460)가 수행될 수 있다.After steps 2450 and 2430 are performed, step 2460 may be performed next.

단계(2460)에서, 인트라 잔차 예측부(2310)는 현재 블록의 복원 블록을 생성할 수 있다.In operation 2460, the intra residual predictor 2310 may generate a reconstructed block of the current block.

인트라 잔차 예측부(2310)는 예측 블록, 현재 블록의 잔차 신호 및 제1 주변 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다. The intra residual predictor 2310 may generate a reconstructed block of the current block based on the prediction block, the residual signal of the current block, and the residual signal of the first neighboring block.

단계(2460)에서 사용되는 현재 블록의 잔차 신호는 부호화 장치(800)에서 잔차 신호 예측에 의해 생성된 잔차 신호일 수 있다. 말하자면, 단계(2460)에서 사용되는 현재 블록의 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 제1 잔차 신호에 대응할 수 있다.The residual signal of the current block used in operation 2460 may be a residual signal generated by prediction of the residual signal in the encoding apparatus 800 . In other words, the residual signal of the current block used in operation 2460 may correspond to the first residual signal described above with reference to FIGS. 9A and 10C .

제1 주변 블록은 현재 블록에 대한 복호화 이전에 이미 복원이 완료된 블록일 수 있다. 따라서, 제1 주변 블록의 잔차 신호도 현재 블록의 복호화 이전에 인트라 잔차 예측부(2310)에 의해 이미 획득되어 있을 수 있다.The first neighboring block may be a block that has already been restored before the current block is decoded. Accordingly, the residual signal of the first neighboring block may also be already obtained by the intra residual predictor 2310 before decoding of the current block.

현재 블록의 복원 블록은 현재 블록의 예측 블록, 현재 블록의 잔차 신호 및 주변 블록의 잔차 신호의 합일 수 있다. 또한, 현재 블록의 복원 블록은 현재 블록의 잔차 신호 및 제1 주변 블록의 잔차 신호의 합에 기반하여 생성될 수 있다.The reconstruction block of the current block may be the sum of the prediction block of the current block, the residual signal of the current block, and the residual signal of the neighboring block. Also, the reconstruction block of the current block may be generated based on the sum of the residual signal of the current block and the residual signal of the first neighboring block.

복원 블록은 1) 예측 블록, 2) 현재 블록의 잔차 신호 및 3) 제1 주변 블록의 잔차 신호의 합일 수 있다. 예측 블록은 인트라 예측 모드에 따라서 획득될 수 있다. 현재 블록의 잔차 신호는 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다. 제1 주변 블록의 잔차 신호는 잔차 신호 예측에 의해 획득될 수 있다. 예를 들면, 잔차 신호 예측이 수행되지 않는 경우, 제1 주변 블록의 잔차 신호는 0으로 된 신호일 수 있다.The reconstruction block may be a sum of 1) a prediction block, 2) a residual signal of the current block, and 3) a residual signal of a first neighboring block. The prediction block may be obtained according to the intra prediction mode. The residual signal of the current block may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 . The residual signal of the first neighboring block may be obtained by residual signal prediction. For example, when residual signal prediction is not performed, the residual signal of the first neighboring block may be a zero signal.

경우에 따라, 인트라 잔차 예측부(2310)가 잔차 신호 예측에 따라 제1 주변 블록의 잔차 신호를 생성하면, 인트라 예측부(240)가 현재 블록의 예측 블록, 현재 블록의 잔차 신호 및 주변 블록의 잔차 신호를 합함으로써 현재 블록의 복원 블록을 생성할 수 있다.In some cases, when the intra-residual prediction unit 2310 generates the residual signal of the first neighboring block according to the residual signal prediction, the intra-prediction unit 240 determines the prediction block of the current block, the residual signal of the current block, and the neighboring block. A reconstructed block of the current block may be generated by summing the residual signals.

단계(2430)가 수행되고, 단계(2440)에서, 잔차 신호 예측을 수행하지 않는 것으로 결정되면, 단계(2490)가 수행될 수 있다.Step 2430 may be performed, and if it is determined at step 2440 not to perform residual signal prediction, then step 2490 may be performed.

단계(2490)에서, 인트라 예측부(240) 또는 인트라 잔차 예측부(2310)는 예측 블록 및 현재 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다.In operation 2490, the intra prediction unit 240 or the intra residual prediction unit 2310 may generate a reconstructed block of the current block based on the prediction block and the residual signal of the current block.

단계(2490)에서 사용되는 현재 블록의 잔차 신호는 부호화 장치(800)에서 잔차 신호 예측을 수행을 하지 않고 생성된 잔차 신호일 수 있다. 말하자면, 단계(2490)에서 사용되는 현재 블록의 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 제3 잔차 신호에 대응할 수 있다.The residual signal of the current block used in operation 2490 may be a residual signal generated without performing residual signal prediction in the encoding apparatus 800 . That is, the residual signal of the current block used in operation 2490 may correspond to the third residual signal described above with reference to FIGS. 9A and 10C .

제3 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호일 수 있다. 예를 들면, 제3 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The third residual signal may be a residual signal of a current block in conventional image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

도 25a는 일 실시예에 따른 잔차 신호 생성 방법의 흐름도이다.25A is a flowchart of a method for generating a residual signal according to an embodiment.

이하에서, 현재 블록은 현재 복호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block currently being decoded, or may be a block in the current image.

우선, 도 25a를 참조하면, 단계(2510)가 수행될 수 있다.First, referring to FIG. 25A , step 2510 may be performed.

단계(2510)에서, 복호화 장치(2310)는 현재 블록의 잔차 신호를 생성할 수 있다. 여기에서, 생성된 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 현재 블록의 제1 잔차 신호에 대응할 수 있다.In operation 2510 , the decoding apparatus 2310 may generate a residual signal of the current block. Here, the generated residual signal may correspond to the first residual signal of the current block described above with reference to FIGS. 9A and 10C .

단계(2510)는 엔트로피 복호화부(210), 역양자화부(220) 및 역변환부(230) 중 적어도 하나에 의해 수행될 수 있다.Step 2510 may be performed by at least one of the entropy decoding unit 210 , the inverse quantization unit 220 , and the inverse transform unit 230 .

단계(2510)는 단계(2411), 단계(2412) 및 단계(2413)를 포함할 수 있다.Step 2510 may include steps 2411 , 2412 , and 2413 .

단계(2511)에서, 엔트로피 복호화부(210)는 현재 블록에 대한 양자화된 계수를 생성할 수 있다.In operation 2511, the entropy decoder 210 may generate a quantized coefficient for the current block.

단계(2512)에서, 역양자화부(220)는 양자화된 계수에 대한 역양자화를 수행함으로써 역양자화된 계수를 생성할 수 있다.In operation 2512 , the inverse quantization unit 220 may generate an inverse quantized coefficient by performing inverse quantization on the quantized coefficient.

단계(2513)에서, 역변환부(230)는 역양자화된 계수에 대한 역변환을 수행함으로써 잔차 신호를 생성할 수 있다.In operation 2513 , the inverse transform unit 230 may generate a residual signal by performing inverse transform on the inverse quantized coefficients.

단계(2510)가 수행된 후, 도 25b를 참조하여 후술될 단계(2520)가 수행될 수 있다.After step 2510 is performed, step 2520 to be described later with reference to FIG. 25B may be performed.

도 25b는 일 실시예에 따른 잔치 신호를 사용하는 현재 블록의 복호화 방법의 흐름도이다.25B is a flowchart of a method of decoding a current block using a feast signal according to an embodiment.

단계(2520)에서, 인트라 예측부(240)는 부호화된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 복호화할 수 있다.In operation 2520 , the intra predictor 240 may decode information indicating whether or not to update the encoded reference sample.

부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 포함할 수 있다. 참조 샘플의 갱신의 수행의 여부를 나타내는 정보는 비트스트림 내에서 부호화될 수 있다.The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include information indicating whether the reference sample is updated. Information indicating whether the update of the reference sample is performed may be encoded in the bitstream.

단계(2530)에서, 인트라 예측부(240)는 부호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 복호화할 수 있다.In operation 2530 , the intra prediction unit 240 may decode information indicating whether prediction of the encoded residual signal is performed.

부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 잔차 신호 예측의 수행의 여부를 나타내는 정보를 포함할 수 있다. 잔차 신호 예측의 수행의 여부를 나타내는 정보는 비트스트림 내에서 부호화될 수 있다.The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include information indicating whether residual signal prediction is performed. Information indicating whether residual signal prediction is performed may be encoded in a bitstream.

단계(2540)에서, 인트라 잔차 예측부(2310)는 부호화된 제1 주변 블록의 식별자를 복호화할 수 있다.In operation 2540, the intra residual predictor 2310 may decode the encoded identifier of the first neighboring block.

부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 제1 주변 블록의 식별자를 포함할 수 있다. 제1 주변 블록의 식별자는 비트스트림 내에서 부호화될 수 있다.The bitstream transmitted from the encoding apparatus 800 to the decoding apparatus 2300 may include the identifier of the first neighboring block. The identifier of the first neighboring block may be encoded in the bitstream.

단계(2550)에서, 인트라 예측부(240) 및 인트라 잔차 예측부(2310)는 잔차 신호의 복호화를 수행할 수 있다. 인트라 예측부(240) 및 인트라 잔차 예측부(2310)는 잔차 신호의 복호화를 수행함으로써 복원 블록을 생성할 수 있다.In operation 2550 , the intra predictor 240 and the intra residual predictor 2310 may decode the residual signal. The intra prediction unit 240 and the intra residual prediction unit 2310 may generate a reconstructed block by decoding the residual signal.

단계(2550)는 도 25c를 참조하여 후술될 단계들(2561, 2562, 2563 및 2564)를 포함할 수 있다.Step 2550 may include steps 2561 , 2562 , 2563 , and 2564 that will be described later with reference to FIG. 25C .

또한, 단계(2550)는 도 25d를 참조하여 후술될 단계들(2571, 2572, 2573 및 2574)를 포함할 수 있다.Also, step 2550 may include steps 2571 , 2572 , 2573 , and 2574 that will be described later with reference to FIG. 25D .

도 25c는 일 실시예에 따른 예측 블록 생성 방법의 흐름도이다.25C is a flowchart of a method for generating a prediction block according to an embodiment.

단계들(2561, 2562 및 2563)에 의해 참조 샘플이 생성될 수 있다. 도 11을 참조하여 전술된 참조 샘플의 생성에 관련된 내용은 본 실시예에도 적용될 수 있다. 중복되는 설명은 생략된다.A reference sample may be generated by steps 2561 , 2562 and 2563 . The content related to the generation of the reference sample described above with reference to FIG. 11 may also be applied to the present embodiment. A duplicate description is omitted.

단계(2561)에서, 인트라 예측부(240)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다.In operation 2561 , the intra predictor 240 may determine whether to update the reference sample.

여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성하는 것일 수 있다.Here, the updating of the reference sample may be reconstructing the sample value of the reference sample used for generation of the prediction block before generation of the prediction block of the current block.

인트라 예측부(240)는 도 9a 및 도 10b를 참조하여 전술된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다.The intra predictor 240 may determine whether to update the reference sample by using the information indicating whether or not to update the reference sample described above with reference to FIGS. 9A and 10B .

인트라 예측부(240)는 복호화된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 상기의 정보가 참조 샘플의 갱신을 수행하는 것을 나타내면, 인트라 예측부(240)는 참조 샘플의 갱신을 수행할 수 있다. 상기의 정보가 참조 샘플의 갱신을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 참조 샘플의 갱신을 수행하지 않을 수 있다.The intra predictor 240 may determine whether to update the reference sample by using information indicating whether to update the decoded reference sample. If the above information indicates that the reference sample is updated, the intra prediction unit 240 may update the reference sample. If the above information indicates that the update of the reference sample is not performed, the intra prediction unit 240 may not perform the update of the reference sample.

참조 샘플의 갱신을 수행하기로 결정된 경우, 단계(2563)가 수행될 수 있다. 참조 샘플 갱신을 수행하지 않기로 결정된 경우, 단계(2564)가 수행될 수 있다.If it is determined to perform an update of the reference sample, step 2563 may be performed. If it is determined not to perform the reference sample update, step 2564 may be performed.

단계(2563)에서, 인트라 예측부(240)는 참조 샘플의 값을 갱신할 수 있으며, 갱신을 통해 현재 블록의 예측 블록을 생성하기 위해 사용되는 참조 샘플의 값을 결정할 수 있다.In operation 2563 , the intra prediction unit 240 may update the value of the reference sample, and through the update, determine the value of the reference sample used to generate the prediction block of the current block.

도 12, 13 및 도 14를 참조하여 전술된 참조 샘플의 갱신에 관련된 내용은 본 실시예에도 적용될 수 있다. 도 12, 13 및 도 14를 참조하여 전술된 실시예들에서, 부호화 장치(800)의 인트라 예측부(120)에 수행되는 것으로 설명된 기능 및/또는 동작은 복호화 장치(2300)의 인트라 예측부(240)에 의해 수행될 수 있다. 또한, 도 9a를 참조하여 전술된 단계(915) 및 도 10b를 참조하여 전술된 단계(1022)에서 수행되는 것으로 설명된 기능 및/또는 동작은 단계(2563)에서도 수행될 수 있다. 중복되는 설명은 생략된다.The contents related to the update of the reference sample described above with reference to FIGS. 12, 13 and 14 may also be applied to the present embodiment. In the embodiments described above with reference to FIGS. 12 , 13 and 14 , the functions and/or operations described as being performed by the intra prediction unit 120 of the encoding apparatus 800 are performed by the intra prediction unit of the decoding apparatus 2300 . (240). In addition, functions and/or operations described as being performed in step 915 described above with reference to FIG. 9A and step 1022 described above with reference to FIG. 10B may also be performed in step 2563 . A duplicate description is omitted.

단계(2563)가 수행된 후 단계(2564)가 수행될 수 있다.After step 2563 is performed, step 2564 may be performed.

단계(2564)에서, 인트라 예측부(240)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(240)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In operation 2564 , the intra prediction unit 240 may generate a prediction block of the current block. The intra prediction unit 240 may generate the prediction block of the current block by using the reference sample according to the intra prediction mode for the current block.

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a method of generating a prediction block of an existing image encoding and/or decoding technology such as HEVC and AVC may be used.

예를 들면, 단계(2564)가 수행된 후, 도 25d를 참조하여 후술될 단계(2571) 가 수행될 수 있다.For example, after step 2564 is performed, step 2571 to be described later with reference to FIG. 25D may be performed.

도 25d는 일 실시예에 따른 복원 블록 생성 방법의 흐름도이다.25D is a flowchart of a method for generating a reconstructed block according to an embodiment.

단계(2571)에서, 인트라 잔차 예측부(2310)는 잔차 신호 예측의 수행의 여부를 결정할 수 있다.In operation 2571 , the intra residual predictor 2310 may determine whether to perform residual signal prediction.

인트라 잔차 예측부(2310)는 도 9a 및 도 10c를 참조하여 전술된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다.The intra residual prediction unit 2310 may determine whether to perform the residual signal prediction by using the information indicating whether the residual signal prediction described above with reference to FIGS. 9A and 10C is performed.

인트라 예측부(240)는 복호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행하지 않을 수 있다.The intra prediction unit 240 may determine whether to perform the residual signal prediction by using information indicating whether the decoded residual signal prediction is performed. If the above information indicates that residual signal prediction is performed, the intra prediction unit 240 may perform residual signal prediction. If the above information indicates that residual signal prediction is not performed, the intra prediction unit 240 may not perform residual signal prediction.

잔차 신호 예측을 수행하기로 결정된 경우, 단계(2572)가 수행될 수 있다.If it is determined to perform residual signal prediction, step 2572 may be performed.

잔차 신호 예측을 수행하지 않기로 결정된 경우, 단계(2574)가 수행될 수 있다.If it is determined not to perform residual signal prediction, step 2574 may be performed.

단계(2572)에서, 인트라 잔차 예측부(2310)는 제1 주변 블록을 식별할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있으며, 현재 블록의 주변에 위치한 블록일 수 있다. 도 22을 참조하여 전술된 제1 주변 블록의 결정에 관련된 내용은 본 실시예에도 적용될 수 있다.In operation 2572 , the intra residual predictor 2310 may identify a first neighboring block. The first neighboring block may be a block used for prediction of the residual signal, and may be a block located near the current block. The contents related to the determination of the first neighboring block described above with reference to FIG. 22 may also be applied to the present embodiment.

인트라 잔차 예측부(2310)는 도 9a 및 도 10c를 참조하여 전술된 제1 주변 블록의 식별자를 사용하여 제1 주변 블록을 식별할 수 있다.The intra residual predictor 2310 may identify the first neighboring block using the identifier of the first neighboring block described above with reference to FIGS. 9A and 10C .

인트라 잔차 예측부(2310)는 복호화된 제1 주변 블록의 식별자를 사용하여 제1 주변 블록을 식별할 수 있다.The intra residual predictor 2310 may identify the first neighboring block by using the identifier of the decoded first neighboring block.

제1 주변 블록의 식별자는 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록이 식별되는 것을 가능하게 하는 정보일 수 있다.The identifier of the first neighboring block may be information that enables the neighboring block used for prediction of the residual signal of the current block to be identified.

예를 들면, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록을 나타낼 수 있다. 또는, 제1 주변 블록의 식별자는 복수의 주변 블록들 중 현재 블록의 잔차 신호 예측을 위해 사용된 주변 블록의 위치를 나타내는 위치 정보일 수 있다. 상기의 위치는 현재 블록에 대한 선택된 주변 블록의 상대적인 위치를 나타낼 수 있다. 상기의 위치는 현재 블록에 대하여 선택된 주변 블록이 인접한 방향을 나타낼 수 있다.For example, the identifier of the first neighboring block may indicate a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. Alternatively, the identifier of the first neighboring block may be position information indicating a position of a neighboring block used for prediction of a residual signal of a current block among a plurality of neighboring blocks. The position may indicate a relative position of the selected neighboring block with respect to the current block. The position may indicate a direction in which a neighboring block selected with respect to the current block is adjacent.

주변 블록의 위치 및 개수는 부호화 파라미터에 따라 정의될 수 있다.The position and number of neighboring blocks may be defined according to encoding parameters.

제1 주변 블록의 식별자는 부호화 장치(800) 및 복호화 장치(2300)의 양자에 있어서 동일한 블록을 가리키도록 구성되어야 할 수 있다. 예를 들면, 제1 주변 블록의 식별자와 관련하여 블록의 크기 N 및 주변 블록의 위치가 부호화 장치(800) 및 복호화 장치(2300)에서 공통되어야 할 수 있다. 부호화 장치(800) 및 복호화 장치(2300)가 제1 주변 블록의 식별자와 관련하여 공통된 구성을 공유하게 하기 위해, 제1 주변 블록의 식별자는 "(이웃-잔차_인덱스) 절삭형 단항((neighboring-residual_idx) Truncated unary)" 방식으로 엔트로피 복호화될 수 있다.The identifier of the first neighboring block may be configured to indicate the same block in both the encoding apparatus 800 and the decoding apparatus 2300 . For example, in relation to the identifier of the first neighboring block, the size N of the block and the position of the neighboring block may have to be common to the encoding apparatus 800 and the decoding apparatus 2300 . In order for the encoding apparatus 800 and the decoding apparatus 2300 to share a common configuration with respect to the identifier of the first neighboring block, the identifier of the first neighboring block is "(neighboring-residual_index) truncation unary ((neighboring) -residual_idx) Truncated unary)" may be entropy-decoded.

단계(2572)가 수행되면, 다음으로 단계(2573)가 수행될 수 있다.Once step 2572 is performed, step 2573 may then be performed.

단계(2573)에서, 인트라 잔차 예측부(2310)는 현재 블록의 복원 블록을 생성할 수 있다.In operation 2573 , the intra residual predictor 2310 may generate a reconstructed block of the current block.

인트라 잔차 예측부(2310)는 예측 블록, 현재 블록의 잔차 신호 및 제1 주변 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다. The intra residual predictor 2310 may generate a reconstructed block of the current block based on the prediction block, the residual signal of the current block, and the residual signal of the first neighboring block.

단계(2573)에서 사용되는 현재 블록의 잔차 신호는 부호화 장치(800)에서 잔차 신호 예측에 의해 생성된 잔차 신호일 수 있다. 말하자면, 단계(2573)에서 사용되는 현재 블록의 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 제1 잔차 신호에 대응할 수 있다.The residual signal of the current block used in operation 2573 may be a residual signal generated by prediction of the residual signal in the encoding apparatus 800 . In other words, the residual signal of the current block used in step 2573 may correspond to the first residual signal described above with reference to FIGS. 9A and 10C .

제1 주변 블록은 현재 블록에 대한 복호화 이전에 이미 복원이 완료된 블록일 수 있다. 따라서, 제1 주변 블록의 잔차 신호도 현재 블록의 복호화 이전에 인트라 잔차 예측부(2310)에 의해 이미 획득되어 있을 수 있다.The first neighboring block may be a block that has already been restored before the current block is decoded. Accordingly, the residual signal of the first neighboring block may also be already obtained by the intra residual predictor 2310 before decoding of the current block.

현재 블록의 복원 블록은 현재 블록의 예측 블록, 현재 블록의 잔차 신호 및 주변 블록의 잔차 신호의 합일 수 있다. 또한, 현재 블록의 복원 블록은 현재 블록의 잔차 신호 및 제1 주변 블록의 잔차 신호의 합에 기반하여 생성될 수 있다.The reconstruction block of the current block may be the sum of the prediction block of the current block, the residual signal of the current block, and the residual signal of the neighboring block. Also, the reconstruction block of the current block may be generated based on the sum of the residual signal of the current block and the residual signal of the first neighboring block.

복원 블록은 1) 예측 블록, 2) 현재 블록의 잔차 신호 및 3) 제1 주변 블록의 잔차 신호의 합일 수 있다. 예측 블록은 인트라 예측 모드에 따라서 획득될 수 있다. 현재 블록의 잔차 신호는 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다. 제1 주변 블록의 잔차 신호는 잔차 신호 예측에 의해 획득될 수 있다. 예를 들면, 잔차 신호 예측이 수행되지 않는 경우, 제1 주변 블록의 잔차 신호는 0으로 된 신호일 수 있다.The reconstruction block may be a sum of 1) a prediction block, 2) a residual signal of the current block, and 3) a residual signal of a first neighboring block. The prediction block may be obtained according to the intra prediction mode. The residual signal of the current block may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 . The residual signal of the first neighboring block may be obtained by residual signal prediction. For example, when residual signal prediction is not performed, the residual signal of the first neighboring block may be a zero signal.

경우에 따라, 인트라 잔차 예측부(2310)가 잔차 신호 예측에 따라 제1 주변 블록의 잔차 신호를 생성하면, 인트라 예측부(240)가 현재 블록의 예측 블록, 현재 블록의 잔차 신호 및 주변 블록의 잔차 신호를 합함으로써 현재 블록의 복원 블록을 생성할 수 있다.In some cases, when the intra-residual prediction unit 2310 generates the residual signal of the first neighboring block according to the residual signal prediction, the intra-prediction unit 240 determines the prediction block of the current block, the residual signal of the current block, and the neighboring block. A reconstructed block of the current block may be generated by summing the residual signals.

단계(2570)에서, 잔차 신호 예측을 수행하지 않는 것으로 결정되면, 단계(2574)가 수행될 수 있다.If it is determined at step 2570 not to perform residual signal prediction, then step 2574 may be performed.

단계(2574)에서, 인트라 예측부(240) 또는 인트라 잔차 예측부(2310)는 예측 블록 및 현재 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다.In operation 2574, the intra prediction unit 240 or the intra residual prediction unit 2310 may generate a reconstructed block of the current block based on the prediction block and the residual signal of the current block.

단계(2574)에서 사용되는 현재 블록의 잔차 신호는 부호화 장치(800)에서 잔차 신호 예측을 수행을 하지 않고 생성된 잔차 신호일 수 있다. 말하자면, 단계(2574)에서 사용되는 현재 블록의 잔차 신호는 도 9a 및 도 10c를 참조하여 전술된 제3 잔차 신호에 대응할 수 있다.The residual signal of the current block used in operation 2574 may be a residual signal generated without performing residual signal prediction in the encoding apparatus 800 . In other words, the residual signal of the current block used in step 2574 may correspond to the third residual signal described above with reference to FIGS. 9A and 10C .

제3 잔차 신호는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술에서의 현재 블록의 잔차 신호일 수 있다. 예를 들면, 제3 잔차 신호의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 잔차 신호 생성 방법이 사용될 수 있다.The third residual signal may be a residual signal of a current block in conventional image encoding and/or decoding techniques such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generating method of an existing image encoding and/or decoding technique such as HEVC and AVC may be used.

잔차 신호 예측과 관련된 정보의 묵시적 전송Implicit transmission of information related to residual signal prediction

전술된 것과 같이, 비트스트림은 1) 잔차 신호 예측의 수행의 여부를 나타내는 정보 및 2) 현재 블록의 잔차 신호 예측을 위해 사용되는 제1 주변 블록의 식별자를 포함할 수 있다. 말하자면, 상기의 정보 및 상기의 식별자는 부호화 장치(800)에 의해 복호화 장치(2300)로 명시적으로 전송될 수 있다.As described above, the bitstream may include 1) information indicating whether residual signal prediction is performed and 2) an identifier of the first neighboring block used for residual signal prediction of the current block. That is, the information and the identifier may be explicitly transmitted to the decoding apparatus 2300 by the encoding apparatus 800 .

반면, 상기의 정보를 위해 요구되는 비트 량을 감소시키기 위해 기정의된 조건이 충족되는 경우, 1) 잔차 신호 예측의 수행의 여부를 나타내는 정보가 생략될 수 있다. 상기의 정보가 생략되었더라도, 복호화 장치(2300)는 기정의된 조건이 충족될 경우 상기의 정보를 도출할 수 있다. 말하자면, 상기의 정보는 묵시적으로 전송될 수 있다.On the other hand, when a predefined condition is satisfied in order to reduce the amount of bits required for the above information, 1) information indicating whether residual signal prediction is performed may be omitted. Even if the above information is omitted, the decoding apparatus 2300 may derive the above information when a predefined condition is satisfied. That is to say, the above information may be transmitted implicitly.

또한, 상기의 식별자를 위해 요구되는 비트 량을 감소시키기 위해 기정의된 조건이 충족되는 경우, 2) 현재 블록의 잔차 신호 예측을 위해 사용되는 제1 주변 블록의 식별자가 생략될 수 있다. 상기의 정보가 생략되었더라도, 복호화 장치(2300)는 기정의된 조건이 충족될 경우 상기의 식별자를 도출할 수 있다. 말하자면, 상기의 식별자는 명시적으로 전송될 수 있다.In addition, when a predefined condition is satisfied to reduce the amount of bits required for the identifier, 2) the identifier of the first neighboring block used for prediction of the residual signal of the current block may be omitted. Even if the above information is omitted, the decoding apparatus 2300 may derive the identifier when a predefined condition is satisfied. That is to say, the identifier may be transmitted explicitly.

도 9a를 참조하여 전술된 단계(930) 및 도 10c를 참조하여 전술된 단계(1041)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 현재 블록에 대해 잔차 신호 예측을 수행할 것을 결정할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 현재 블록에 대해 잔차 신호 예측을 수행하지 않을 것을 결정할 수 있다.In step 930 described above with reference to FIG. 9A and step 1041 described above with reference to FIG. 10C, when a predefined condition is satisfied, the intra residual prediction unit 810 predicts the residual signal for the current block. can decide what to do. Alternatively, when a predefined condition is satisfied, the intra residual predictor 810 may determine not to perform residual signal prediction on the current block.

또한, 단계(935) 및 단계(1043)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 기정의된 블록을 제1 주변 블록으로 결정할 수 있다. 또한, 단계(980), 단계(985), 단계(1048) 및 단계(1049)는 선택적으로 수행될 수 있다.In addition, when a predefined condition is satisfied in steps 935 and 1043 , the intra residual predictor 810 may determine the predefined block as the first neighboring block. Also, steps 980 , 985 , 1048 , and 1049 may be selectively performed.

단계(980) 및 단계(1049)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보를 선택적으로 부호화할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보의 부호화를 생략할 수 있다.In steps 980 and 1049 , the intra residual prediction unit 810 may selectively encode information indicating whether residual signal prediction is performed. Alternatively, when a predefined condition is satisfied, the intra residual predictor 810 may omit encoding of information indicating whether residual signal prediction is performed.

단계(985) 및 단계(1048)에서, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자를 선택적으로 부호화할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자의 부호화를 생략할 수 있다.In steps 985 and 1048 , the intra residual predictor 810 may selectively encode the identifier of the first neighboring block. Alternatively, when a predefined condition is satisfied, the intra residual predictor 810 may omit encoding of the identifier of the first neighboring block.

도 24b를 참조하여 전술된 단계(2440)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행할 것을 결정할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행하지 않을 것을 결정할 수 있다. 예를 들면, 잔차 신호 예측의 여부를 나타내는 정보가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행할 것을 결정할 수 있다.In operation 2440 described above with reference to FIG. 24B , when a predefined condition is satisfied, the intra residual predictor 2310 may determine to perform residual signal prediction. Alternatively, when a predefined condition is satisfied, the intra residual predictor 2310 may determine not to perform residual signal prediction. For example, when information indicating whether residual signal prediction is not present, the intra residual predictor 2310 may determine to perform residual signal prediction.

또한, 단계(2445)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 기정의된 방식에 따라서 선택된 블록을 제1 주변 블록으로 식별할 수 있다. 예를 들면, 제1 주변 블록의 식별자가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 기정의된 방식에 따라서 선택된 블록을 제1 주변 블록으로 식별할 수 있다.Also, when a predefined condition is satisfied in operation 2445 , the intra residual predictor 2310 may identify the selected block as the first neighboring block according to a predefined method. For example, when the identifier of the first neighboring block does not exist, the intra residual predictor 2310 may identify the selected block as the first neighboring block according to a predefined method.

예를 들면, 현재 블록의 방향성 및 제1 주변 블록의 방향성이 동일할 경우, 잔차 신호 예측에 있어서 높은 효율이 예상될 수 있다. 따라서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재할 경우, 상기의 동일한 인트라 예측 모드를 갖는 블록에 대하여 현재 블록의 잔차 신호 예측이 이루어질 수 있다.For example, when the directionality of the current block and the directionality of the first neighboring block are the same, high efficiency in prediction of the residual signal may be expected. Accordingly, when a block having the same intra prediction mode as the intra prediction mode of the current block exists around the current block, the residual signal prediction of the current block may be performed with respect to the block having the same intra prediction mode.

도 9a를 참조하여 전술된 단계(930) 및 도 10c를 참조하여 전술된 단계(1041)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(810)는 현재 블록에 대해 잔차 신호 예측을 수행할 것을 결정할 수 있다. 예를 들면, MPM 플래그가 참(또는, "1")의 값을 가지면, 인트라 잔차 예측부(2310)는 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재한다는 것을 검출할 수 있고, 현재 블록에 대해 잔차 신호 예측을 수행할 것을 결정할 수 있다. 따라서, 인트라 잔차 예측부(2310)는 MPM 플래그의 값에 기반하여 잔차 신호 예측이 사용되었는지 여부를 식별할 수 있다.In step 930 described above with reference to FIG. 9A and step 1041 described above with reference to FIG. 10C, if there is a block having the same intra prediction mode as the intra prediction mode of the current block in the vicinity of the current block, intra The residual predictor 810 may determine to perform residual signal prediction on the current block. For example, if the MPM flag has a value of true (or "1"), the intra residual prediction unit 2310 indicates that a block having the same intra prediction mode as the intra prediction mode of the current block exists in the vicinity of the current block. can be detected, and it can be determined to perform residual signal prediction on the current block. Accordingly, the intra residual predictor 2310 may identify whether residual signal prediction is used based on the value of the MPM flag.

또한, 단계(935) 및 단계(1043)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(810)는 상기의 동일한 인트라 예측 모드를 갖는 블록을 제1 주변 블록으로 결정할 수 있다. 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 복수의 블록들이 존재하는 경우, 인트라 잔차 예측부(810)는 복수의 블록들 중 기정의된 우선 순위에 따라 선택된 블록을 제1 주변 블록으로 결정할 수 있다.In addition, in steps 935 and 1043, when a block having the same intra prediction mode as the intra prediction mode of the current block exists around the current block, the intra residual prediction unit 810 performs the same intra prediction A block having a mode may be determined as a first neighboring block. When a plurality of blocks having the same intra prediction mode as the intra prediction mode of the current block exist around the current block, the intra residual prediction unit 810 selects a block selected according to a predefined priority among the plurality of blocks. It can be determined by 1 surrounding block.

단계(980) 및 단계(1049)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보의 부호화를 생략할 수 있다.In steps 980 and 1049, when a block having the same intra prediction mode as the intra prediction mode of the current block exists around the current block, the intra residual prediction unit 810 determines whether residual signal prediction is performed It is possible to omit encoding of information indicating

단계(985) 및 단계(1048)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자의 부호화를 생략할 수 있다.In steps 985 and 1048, when a block having the same intra prediction mode as the intra prediction mode of the current block exists in the vicinity of the current block, the intra residual prediction unit 810 determines the identifier of the first neighboring block. Encoding can be omitted.

도 24b를 참조하여 전술된 단계(2440)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행할 것을 결정할 수 있다. 또는, 잔차 신호 예측의 여부를 나타내는 정보가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하면 잔차 신호 예측을 수행할 것을 결정할 수 있다. 또는, 잔차 신호 예측의 여부를 나타내는 정보가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하지 않으면 잔차 신호 예측을 수행하지 않을 것을 결정할 수 있다.In step 2440 described above with reference to FIG. 24B , when a block having the same intra prediction mode as the intra prediction mode of the current block exists around the current block, the intra residual prediction unit 2310 performs residual signal prediction can decide what to do. Alternatively, when there is no information indicating whether residual signal prediction is present, the intra-residual prediction unit 2310 predicts the residual signal when a block having the same intra-prediction mode as the intra-prediction mode of the current block exists in the vicinity of the current block. can decide what to do. Alternatively, when information indicating whether residual signal prediction is not present, the intra-residual prediction unit 2310 predicts the residual signal if a block having the same intra-prediction mode as the intra-prediction mode of the current block does not exist in the vicinity of the current block. You can decide not to do it.

또한, 단계(2445)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(2310)는 상기의 동일한 인트라 예측 모드를 갖는 블록을 제1 주변 블록으로 식별할 수 있다. 또는, 재1 블록의 식별자가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하면 상기의 동일한 인트라 예측 모드를 갖는 블록을 제1 주변 블록으로 식별할 수 있다. 또는, 제1 블록의 식별자가 존재하지 않고, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 복수의 블록들이 존재하는 경우, 인트라 잔차 예측부(810)는 복수의 블록들 중 기정의된 우선 순위에 따라 선택된 블록을 제1 주변 블록으로 결정할 수 있다.In addition, in step 2445, when a block having the same intra prediction mode as the intra prediction mode of the current block exists around the current block, the intra residual prediction unit 2310 selects the block having the same intra prediction mode. It can be identified by the first neighboring block. Alternatively, when the identifier of the first block does not exist, the intra-residual prediction unit 2310 selects the same intra-prediction mode when a block having the same intra-prediction mode as the intra-prediction mode of the current block exists in the vicinity of the current block. A block having a block may be identified as a first neighboring block. Alternatively, when the identifier of the first block does not exist and a plurality of blocks having the same intra prediction mode as the intra prediction mode of the current block exist around the current block, the intra residual prediction unit 810 may select the plurality of blocks. Among them, the selected block may be determined as the first neighboring block according to a predefined priority.

인트라 예측이 수행될 경우, 인트라 예측 모드는 가장 개연성 있는 모드(Most Probable Mode; MPM) 플래그 및 MPM 인덱스를 통해 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다. 말하자면, 인트라 예측 모드는 MPM 플래그 및 MPM 인덱스에 의해 엔트로피 부호화될 수 있다. MPM은 모두 3개의 인트라 예측 모드들을 나타낼 수 있다. MPM이 나타내는 인트라 예측 모드들을 MPM 후보 모드들로 명명한다. 인트라 예측부(240)는 현재 블록의 주변의 화면 내의 예측 블록을 통해 MPM 후보 모드들을 식별할 수 있다.When intra prediction is performed, the intra prediction mode may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300 through a Most Probable Mode (MPM) flag and an MPM index. In other words, the intra prediction mode may be entropy-encoded by the MPM flag and the MPM index. MPM may indicate all three intra prediction modes. The intra prediction modes indicated by the MPM are called MPM candidate modes. The intra prediction unit 240 may identify MPM candidate modes through a prediction block in a picture adjacent to the current block.

만약, 현재 블록의 인트라 예측 모드가 MPM에 의해 식별된 3개의 인트라 예측 모드들 중 하나와 동일한 경우, MPM 플래그의 값은 참(또는, "1")이 될 수 있다. 또한, MPM 플래그의 값은 참(또는, "1")인 경우, 부호화 장치(800)는 MPM 인덱스를 복호화 장치(2300)로 전송할 수 있다. MPM 인덱스는 MPM 후보 모드들 중에서 어떤 모드가 현재 블록의 인트라 예측 모드인 가를 나타낼 수 있다.If the intra prediction mode of the current block is the same as one of three intra prediction modes identified by the MPM, the value of the MPM flag may be true (or "1"). Also, when the value of the MPM flag is true (or "1"), the encoding apparatus 800 may transmit the MPM index to the decoding apparatus 2300 . The MPM index may indicate which mode among MPM candidate modes is the intra prediction mode of the current block.

인트라 잔차 예측부(2310)는 신택스의 정의에 따라서 인트라 예측을 수행할 수 있다. 인트라 잔차 예측부(2310)는 인트라 예측을 수행한 후 획득된 최종의 인트라 예측 모드가 MPM 후보 모드들 중 하나와 동일한 경우, 현재 블록의 잔차 신호를 획득할 수 있고, 제1 주변 블록의 잔차 신호를 사용하여 현재 블록의 잔차 신호에 대한 예측을 수행할 수 있다. 현재 블록의 인트라 예측 모드가 제1 주변 블록의 인트라 예측 모드와 동일한 경우, 인트라 잔차 예측부(2310)는 MPM 인덱스를 통해 현재 블록의 잔차 신호의 예측을 위한 제1 주변 블록의 위치를 식별할 수 있다.The intra residual prediction unit 2310 may perform intra prediction according to the definition of the syntax. When the final intra prediction mode obtained after performing intra prediction is the same as one of the MPM candidate modes, the intra residual prediction unit 2310 may obtain a residual signal of the current block, and the residual signal of the first neighboring block can be used to predict the residual signal of the current block. When the intra prediction mode of the current block is the same as the intra prediction mode of the first neighboring block, the intra residual prediction unit 2310 may identify the position of the first neighboring block for prediction of the residual signal of the current block through the MPM index. have.

참조 샘플의 갱신의 단위Unit of update of reference sample

단계(2420)에서, 인트라 예측부(240)는 기정의된 단의 별로 참조 샘플의 갱신의 수행 여부를 결정할 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.In operation 2420, the intra predictor 240 may determine whether to update the reference sample for each predefined stage. The predefined unit may be at least one of 1) an entire image sequence (ie, video), 2) one image (ie, picture), 3) a slice, and 4) a coding unit.

기정의된 단위에 대해서, 참조 샘플의 갱신의 수행 여부를 나타내기 위해 참조 샘플 갱신 정보가 사용될 수 있다. 참조 샘플 갱신 정보는 기정의된 단위에 대하여 참조 샘플의 갱신이 수행되었는지 여부를 나타내는 정보일 수 있다. 예를 들면, 참조 샘플 갱신 정보의 값이 제1 값인 것은, 현재 블록의 복호화에 있어서 참조 샘플의 갱신이 수행되어야 한다는 것을 나타낼 수 있다. 참조 샘플 갱신 정보의 값이 제2 값인 것은, 현재 블록의 복호화에 있어서 참조 샘플의 갱신이 수행되지 않는다는 것을 나타낼 수 있다.For a predefined unit, reference sample update information may be used to indicate whether the reference sample is updated. The reference sample update information may be information indicating whether the reference sample is updated with respect to a predefined unit. For example, when the value of the reference sample update information is the first value, it may indicate that the reference sample should be updated in decoding the current block. When the value of the reference sample update information is the second value, it may indicate that the update of the reference sample is not performed in decoding the current block.

부호화 장치(800)는 부호화된 잔차 신호 예측 정보를 비트스트림에 포함시킬 수 있다. 복호화 장치(2300)는 잔차 신호 예측 정보를 사용하여 현재 블록에 대한 잔차 신호 예측의 수행의 여부를 판단할 수 있다.The encoding apparatus 800 may include the encoded residual signal prediction information in the bitstream. The decoding apparatus 2300 may determine whether residual signal prediction is performed on the current block by using the residual signal prediction information.

아래에서는, 기정의된 단위들 각각에 대한 참조 샘플의 갱신에 대해 설명된다.In the following, the update of the reference sample for each of the predefined units is described.

1) 영상 시퀀스 전체: 참조 샘플의 갱신의 수행 여부는 영상 시퀀스 전체에 대하여 결정될 수 있다. 이러한 경우, 시퀀스 파라미터 세트(sequence parameter set)는 참조 샘플 갱신 정보를 포함할 수 있다. 시퀀스 파라미터 세트의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(240)는 영상 시퀀스 전체에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.1) Entire image sequence: Whether to update the reference sample may be determined for the entire image sequence. In this case, the sequence parameter set may include reference sample update information. When the reference sample update information of the sequence parameter set indicates that the reference sample is to be updated, the intra prediction unit 240 may perform intra prediction using the reference sample to which the gradient according to the directionality is applied to the entire image sequence.

2) 하나의 영상: 참조 샘플의 갱신의 수행 여부는 영상 별로 결정될 수 있다. 이러한 경우, 픽처 파라미터 세트(picture parameter set)는 참조 샘플 갱신 정보를 포함할 수 있다. 픽처 파라미터 세트의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(240)는 픽처 파라미터 세트에 대응하는 영상의 전체에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.2) One image: Whether to update the reference sample may be determined for each image. In this case, the picture parameter set may include reference sample update information. If the reference sample update information of the picture parameter set indicates that the reference sample is to be updated, the intra prediction unit 240 performs intra prediction using the reference sample to which the gradient according to the directionality is applied to the entire image corresponding to the picture parameter set. can be done

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 참조 샘플의 갱신의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트(segment) 헤더는 참조 샘플 갱신 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(240)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.3) Slice: One image may be divided into a plurality of slice segments or a plurality of tiles within one slice segment. Whether to update the reference sample may be determined for each slice. In this case, the slice segment header may include reference sample update information. If the reference sample update information of the slice segment header indicates that the reference sample is to be updated, the intra prediction unit 240 performs intra prediction using the reference sample to which the gradient according to the directionality is applied on the slice corresponding to the slice segment header. can

4) 코딩 유닛: 참조 샘플의 갱신의 수행 여부는 코딩 유닛 별로 결정될 수 있다. 이러한 경우, 코딩 유닛에 대하여 참조 샘플 갱신 정보가 존재할 수 있다. 코딩 유닛에 대한 참조 샘플 갱신 정보가 코딩 유닛의 갱신이 수행됨을 나타내면, 인트라 예측부(240)는 참조 샘플 갱신 정보에 대응하는 코딩 유닛에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.4) Coding unit: Whether to update the reference sample may be determined for each coding unit. In this case, reference sample update information may be present for the coding unit. When the reference sample update information for the coding unit indicates that the coding unit is updated, the intra prediction unit 240 performs intra prediction using the reference sample to which the gradient according to the directionality is applied with respect to the coding unit corresponding to the reference sample update information. can be done

전술된 것과 같이, 참조 샘플 갱신 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the reference sample update information may be coded in a sequence parameter set, a picture parameter set, or a slice segment header. Also, update information may be coded for a coding unit.

잔차 신호 예측의 단위Unit of Residual Signal Prediction

단계(2440)에서, 인트라 잔차 예측부(2310)는 기정의된 단위 별로 잔차 신호 예측의 수행 여부를 결정할 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.In operation 2440 , the intra residual predictor 2310 may determine whether to perform residual signal prediction for each predefined unit. The predefined unit may be at least one of 1) an entire image sequence (ie, video), 2) one image (ie, picture), 3) a slice, and 4) a coding unit.

잔차 신호 예측 정보는 기정의된 단위에 대하여 잔차 신호 예측이 수행되었는지 여부를 나타내는 정보일 수 있다. 예를 들면, 잔차 신호 예측 정보의 값이 제1 값인 것은, 현재 블록의 복호화에 있어서 잔차 신호 예측이 수행되어야 한다는 것을 나타낼 수 있다. 잔차 신호 예측 정보의 값이 제2 값인 것은, 현재 블록의 복호화에 있어서 잔차 신호 예측이 수행되지 않는다는 것을 나타낼 수 있다.The residual signal prediction information may be information indicating whether residual signal prediction is performed with respect to a predefined unit. For example, the first value of the residual signal prediction information may indicate that residual signal prediction should be performed in decoding the current block. The second value of the residual signal prediction information may indicate that residual signal prediction is not performed in decoding the current block.

부호화 장치(800)는 부호화된 잔차 신호 예측 정보를 비트스트림에 포함시킬 수 있다. 복호화 장치(2300)는 잔차 신호 예측 정보를 사용하여 현재 블록에 대한 잔차 신호 예측의 수행의 여부를 판단할 수 있다.The encoding apparatus 800 may include the encoded residual signal prediction information in the bitstream. The decoding apparatus 2300 may determine whether residual signal prediction is performed on the current block by using the residual signal prediction information.

아래에서는, 기정의된 단위들 각각에 대한 잔차 신호 예측에 대해 설명된다.In the following, the residual signal prediction for each of the predefined units is described.

1) 영상 시퀀스 전체: 잔차 신호 예측의 수행 여부는 영상 시퀀스 전체에 대하여 결정될 수 있다. 이러한 경우, 시퀀스 파라미터 세트는 잔차 신호 예측 정보를 포함할 수 있다. 시퀀스 파라미터 세트의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(2310)는 영상 시퀀스 전체에 대해서 잔차 신호 예측을 수행할 수 있다. 영상 시퀀스 내의 인트라 예측으로 부호화된 모든 블록들은 전차 신호 예측의 수행의 여부에 따라, 잔치 신호 예측을 사용하여 복호화되거나, 잔차 신호 예측을 사용하지 않고 복호화될 수 있다.1) Entire image sequence: Whether to perform residual signal prediction may be determined for the entire image sequence. In this case, the sequence parameter set may include residual signal prediction information. When the residual signal prediction information of the sequence parameter set indicates that the residual signal prediction is performed, the intra residual predictor 2310 may perform the residual signal prediction on the entire image sequence. All blocks encoded by intra prediction in an image sequence may be decoded using residual signal prediction or may be decoded without using residual signal prediction, depending on whether or not full signal prediction is performed.

2) 하나의 영상: 잔차 신호 예측의 수행 여부는 영상 별로 결정될 수 있다. 이러한 경우, 픽처 파라미터 세트(picture parameter set)는 잔차 신호 예측 정보를 포함할 수 있다. 픽처 파라미터 세트의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(2310)는 픽처 파라미터 세트에 대응하는 영상의 전체에 대해서 잔차 신호 예측을 수행할 수 있다. 하나의 -처 내의 인트라 예측으로 부호화된 모든 블록들은 전차 신호 예측의 수행의 여부에 따라, 잔치 신호 예측을 사용하여 복호화되거나, 잔차 신호 예측을 사용하지 않고 복호화될 수 있다.2) One image: Whether to perform residual signal prediction may be determined for each image. In this case, the picture parameter set may include residual signal prediction information. When the residual signal prediction information of the picture parameter set indicates that residual signal prediction is performed, the intra residual prediction unit 2310 may perform residual signal prediction on the entire image corresponding to the picture parameter set. All blocks encoded by intra prediction within one destination may be decoded using residual signal prediction or decoded without using residual signal prediction, depending on whether or not full signal prediction is performed.

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 잔차 신호 예측의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(2310)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 잔차 신호 예측을 수행할 수 있다. 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함하는 경우, 슬라이스 레벨에서 인트라 예측으로 부호화된 모든 블록들은 전차 신호 예측의 수행의 여부에 따라, 잔치 신호 예측을 사용하여 복호화되거나, 잔차 신호 예측을 사용하지 않고 복호화될 수 있다.3) Slice: One image may be divided into a plurality of slice segments or a plurality of tiles within one slice segment. Whether to perform residual signal prediction may be determined for each slice. In this case, the slice segment header may include residual signal prediction information. When the residual signal prediction information of the slice segment header indicates that residual signal prediction is performed, the intra residual predictor 2310 may perform residual signal prediction on a slice corresponding to the slice segment header. When the slice segment header includes residual signal prediction information, all blocks encoded by intra prediction at the slice level are decoded using residual signal prediction or residual signal prediction is not used, depending on whether full signal prediction is performed. can be decrypted.

4) 코딩 유닛: 잔차 신호 예측의 수행 여부는 코딩 유닛 별로 결정될 수 있다. 이러한 경우, 코딩 유닛에 대하여 잔차 신호 예측 정보가 존재할 수 있다. 코딩 유닛에 대한 잔차 신호 예측 정보가 코딩 유닛의 갱신이 수행됨을 나타내면, 인트라 잔차 예측부(2310)는 잔차 신호 예측 정보에 대응하는 코딩 유닛에 대해서 잔차 신호 예측을 수행할 수 있다.4) Coding unit: Whether to perform residual signal prediction may be determined for each coding unit. In this case, residual signal prediction information may be present for the coding unit. When the residual signal prediction information for the coding unit indicates that the coding unit is updated, the intra residual prediction unit 2310 may perform residual signal prediction on the coding unit corresponding to the residual signal prediction information.

전술된 것과 같이, 잔차 신호 예측 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the residual signal prediction information may be coded within a sequence parameter set, a picture parameter set, or a slice segment header. Also, update information may be coded for a coding unit.

도 26은 일 실시예에 따른 부호화 장치를 구현하는 전자 장치의 구조도이다.26 is a structural diagram of an electronic device implementing an encoding device according to an embodiment.

일 실시예에 따르면, 부호화 장치(800)의 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180), 참조 픽처 버퍼(190) 및 인트라 잔차 예측부(810)의 적어도 일부는 프로그램 모듈들일 수 있으며, 외부의 장치 또는 시스템과 통신할 수 있다. 프로그램 모듈들은 운영 체제, 응용 프로그램 모듈 및 기타 프로그램 모듈의 형태로 부호화 장치(800)에 포함될 수 있다.According to an embodiment, the motion prediction unit 111 , the motion compensation unit 112 , the intra prediction unit 120 , the switch 115 , the subtractor 125 , the transform unit 130 , and the quantization of the encoding apparatus 800 . unit 140 , entropy encoding unit 150 , inverse quantization unit 160 , inverse transform unit 170 , adder 175 , filter unit 180 , reference picture buffer 190 , and intra residual prediction unit 810 . At least a portion of the module may be program modules, and may communicate with an external device or system. The program modules may be included in the encoding device 800 in the form of an operating system, an application program module, and other program modules.

프로그램 모듈들은 물리적으로는 여러 가지 공지의 기억 장치 상에 저장될 수 있다. 또한, 이러한 프로그램 모듈 중 적어도 일부는 부호화 장치(800)와 통신 가능한 원격 기억 장치에 저장될 수도 있다.Program modules may be physically stored on various known storage devices. In addition, at least some of these program modules may be stored in a remote storage device capable of communicating with the encoding device 800 .

프로그램 모듈들은 일 실시예에 따른 기능 또는 동작을 수행하거나, 일 실시예에 따른 추상 데이터 유형을 구현하는 루틴(routine), 서브루틴(subroutine), 프로그램, 오브젝트(object), 컴포넌트(component) 및 데이터 구조(data structure) 등을 포괄할 수 있지만, 이에 제한되지는 않는다.Program modules include routines, subroutines, programs, objects, components, and data that perform functions or operations according to an embodiment or implement abstract data types according to an embodiment. It may include, but is not limited to, a data structure and the like.

프로그램 모듈들은 부호화 장치(800)의 적어도 하나의 프로세서(processor)에 의해 수행되는 명령어(instruction) 또는 코드(code)로 구성될 수 있다.The program modules may include instructions or codes that are executed by at least one processor of the encoding apparatus 800 .

부호화 장치(800)는 도 26에서 도시된 전자 장치(2600)로서 구현될 수 있다. 전자 장치(2600)는 부호화 장치(800)로서 동작하는 범용의 컴퓨터 시스템일 수 있다.The encoding device 800 may be implemented as the electronic device 2600 illustrated in FIG. 26 . The electronic device 2600 may be a general-purpose computer system operating as the encoding device 800 .

도 26에서 도시된 바와 같이, 전자 장치(2600)는 버스(2622)를 통하여 서로 통신하는 적어도 하나의 프로세서(processor)(2621), 메모리(2623), 사용자 인터페이스(User Interface; UI) 입력 디바이스(2626), UI 출력 디바이스(2627) 및 저장소(2628)를 포함할 수 있다. 또한, 전자 장치(2600)는 네트워크(2630)에 연결되는 네트워크 인터페이스(2629)를 더 포함할 수 있다. 프로세서(2621)는 중앙 처리 장치(Central Processing Unit; CPU), 메모리(2623) 또는 저장소(2628)에 저장된 프로세싱(processing) 명령어(instruction)들을 실행하는 반도체 장치일 수 있다. 메모리(2623) 및 저장소(2628)는 다양한 형태의 휘발성 또는 비휘발성 저장 매체일 수 있다. 예를 들어, 메모리는 롬(ROM)(2624) 및 램(RAM)(2625) 중 적어도 하나를 포함할 수 있다.As shown in FIG. 26 , the electronic device 2600 includes at least one processor 2621 , a memory 2623 , and a user interface (UI) input device that communicate with each other through a bus 2622 . 2626 ), a UI output device 2627 , and storage 2628 . Also, the electronic device 2600 may further include a network interface 2629 connected to the network 2630 . The processor 2621 may be a semiconductor device that executes processing instructions stored in a central processing unit (CPU), the memory 2623 , or the storage 2628 . Memory 2623 and storage 2628 may be various forms of volatile or non-volatile storage media. For example, the memory may include at least one of a ROM 2624 and a RAM 2625 .

부호화 장치(800)는 컴퓨터에 의해 독출(read)될 수 있는 기록 매체를 포함하는 컴퓨터 시스템에서 구현될 수 있다.The encoding apparatus 800 may be implemented in a computer system including a recording medium that can be read by a computer.

기록 매체는 전자 장치(2600)가 부호화 장치(800)로서 동작하기 위해 요구되는 적어도 하나의 모듈을 저장할 수 있다. 메모리(2623)는 적어도 하나의 모듈을 저장할 수 있고, 적어도 하나의 프로세서(2621)에 의하여 실행되도록 구성될 수 있다.The recording medium may store at least one module required for the electronic device 2600 to operate as the encoding device 800 . The memory 2623 may store at least one module and may be configured to be executed by the at least one processor 2621 .

부호화 장치(800)의 데이터 또는 정보의 통신과 관련된 기능은 네트워크 인터페이스(2629)를 통해 수행될 수 있다.A function related to data or information communication of the encoding device 800 may be performed through the network interface 2629 .

도 27은 일 실시예에 따른 복호화 장치를 구현하는 전자 장치의 구조도이다.27 is a structural diagram of an electronic device implementing a decoding device according to an embodiment.

일 실시예에 따르면, 복호화 장치(2300)의 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260), 참조 픽처 버퍼(270) 및 인트라 잔차 예측부(2310)의 적어도 일부는 프로그램 모듈들일 수 있으며, 외부의 장치 또는 시스템과 통신할 수 있다. 프로그램 모듈들은 운영 체제, 응용 프로그램 모듈 및 기타 프로그램 모듈의 형태로 복호화 장치(2300)에 포함될 수 있다.According to an embodiment, the entropy decoding unit 210 , the inverse quantization unit 220 , the inverse transform unit 230 , the intra prediction unit 240 , the motion compensator 250 , and the adder 255 of the decoding apparatus 2300 . , at least some of the filter unit 260 , the reference picture buffer 270 , and the intra residual prediction unit 2310 may be program modules, and may communicate with an external device or system. The program modules may be included in the decryption apparatus 2300 in the form of an operating system, an application program module, and other program modules.

프로그램 모듈들은 물리적으로는 여러 가지 공지의 기억 장치 상에 저장될 수 있다. 또한, 이러한 프로그램 모듈 중 적어도 일부는 복호화 장치(2300)와 통신 가능한 원격 기억 장치에 저장될 수도 있다.Program modules may be physically stored on various known storage devices. Also, at least some of these program modules may be stored in a remote storage device capable of communicating with the decryption device 2300 .

프로그램 모듈들은 일 실시예에 따른 기능 또는 동작을 수행하거나, 일 실시예에 따른 추상 데이터 유형을 구현하는 루틴(routine), 서브루틴(subroutine), 프로그램, 오브젝트(object), 컴포넌트(component) 및 데이터 구조(data structure) 등을 포괄할 수 있지만, 이에 제한되지는 않는다.Program modules include routines, subroutines, programs, objects, components, and data that perform functions or operations according to an embodiment or implement abstract data types according to an embodiment. It may include, but is not limited to, a data structure and the like.

프로그램 모듈들은 복호화 장치(2300)의 적어도 하나의 프로세서(processor)에 의해 수행되는 명령어(instruction) 또는 코드(code)로 구성될 수 있다.The program modules may include instructions or codes that are executed by at least one processor of the decoding apparatus 2300 .

복호화 장치(2300)는 도 27에서 도시된 전자 장치(2700)로서 구현될 수 있다. 전자 장치(2700)는 복호화 장치(2300)로서 동작하는 범용의 컴퓨터 시스템일 수 있다.The decoding device 2300 may be implemented as the electronic device 2700 illustrated in FIG. 27 . The electronic device 2700 may be a general-purpose computer system operating as the decryption device 2300 .

도 27에서 도시된 바와 같이, 전자 장치(2700)는 버스(2722)를 통하여 서로 통신하는 적어도 하나의 프로세서(processor)(2721), 메모리(2723), 사용자 인터페이스(User Interface; UI) 입력 디바이스(2726), UI 출력 디바이스(2727) 및 저장소(2728)를 포함할 수 있다. 또한, 전자 장치(2700)는 네트워크(2730)에 연결되는 네트워크 인터페이스(2729)를 더 포함할 수 있다. 프로세서(2721)는 중앙 처리 장치(Central Processing Unit; CPU), 메모리(2723) 또는 저장소(2728)에 저장된 프로세싱(processing) 명령어(instruction)들을 실행하는 반도체 장치일 수 있다. 메모리(2723) 및 저장소(2728)는 다양한 형태의 휘발성 또는 비휘발성 저장 매체일 수 있다. 예를 들어, 메모리는 롬(ROM)(2724) 및 램(RAM)(2725) 중 적어도 하나를 포함할 수 있다.As shown in FIG. 27 , the electronic device 2700 includes at least one processor 2721 , a memory 2723 , and a user interface (UI) input device that communicate with each other through a bus 2722 . 2726 ), a UI output device 2727 , and storage 2728 . Also, the electronic device 2700 may further include a network interface 2729 connected to the network 2730 . The processor 2721 may be a semiconductor device that executes processing instructions stored in a central processing unit (CPU), the memory 2723 , or the storage 2728 . Memory 2723 and storage 2728 may be various forms of volatile or non-volatile storage media. For example, the memory may include at least one of a ROM 2724 and a RAM 2725 .

복호화 장치(2300)는 컴퓨터에 의해 독출(read)될 수 있는 기록 매체를 포함하는 컴퓨터 시스템에서 구현될 수 있다.The decryption apparatus 2300 may be implemented in a computer system including a recording medium that can be read by a computer.

기록 매체는 전자 장치(2700)가 복호화 장치(2300)로서 동작하기 위해 요구되는 적어도 하나의 모듈을 저장할 수 있다. 메모리(2723)는 적어도 하나의 모듈을 저장할 수 있고, 적어도 하나의 프로세서(2721)에 의하여 실행되도록 구성될 수 있다.The recording medium may store at least one module required for the electronic device 2700 to operate as the decryption device 2300 . The memory 2723 may store at least one module and may be configured to be executed by the at least one processor 2721 .

복호화 장치(2300)의 데이터 또는 정보의 통신과 관련된 기능은 네트워크 인터페이스(2729)를 통해 수행될 수 있다.A function related to communication of data or information of the decryption apparatus 2300 may be performed through the network interface 2729 .

상술한 실시예들에서, 방법들은 일련의 단계 또는 유닛으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described embodiments, the methods are described on the basis of a flowchart as a series of steps or units, but the present invention is not limited to the order of steps, and some steps may occur in a different order or at the same time as other steps as described above. can In addition, those of ordinary skill in the art will recognize that the steps shown in the flowchart are not exclusive, other steps may be included, or that one or more steps in the flowchart may be deleted without affecting the scope of the present invention. You will understand.

이상 설명된 본 발명에 따른 실시예들은 다양한 컴퓨터 구성요소를 통하여 수행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 컴퓨터 판독 가능한 기록 매체에 기록되는 프로그램 명령어는 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 분야의 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 ROM, RAM, 플래시 메모리 등과 같은 프로그램 명령어를 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령어의 예에는, 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드도 포함된다. 상기 하드웨어 장치는 본 발명에 따른 처리를 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The embodiments according to the present invention described above may be implemented in the form of program instructions that can be executed through various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the computer-readable recording medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the computer software field. Examples of the computer-readable recording medium include a hard disk, a magnetic medium such as a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and DVD, and a magneto-optical medium such as a floppy disk. media), and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. The hardware device may be configured to operate as one or more software modules for carrying out the processing according to the present invention, and vice versa.

이상에서 본 발명이 구체적인 구성요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나, 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명이 상기 실시예들에 한정되는 것은 아니며, 본 발명이 속하는 기술분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형을 꾀할 수 있다.In the above, the present invention has been described with specific matters such as specific components and limited embodiments and drawings, but these are provided to help a more general understanding of the present invention, and the present invention is not limited to the above embodiments. , various modifications and variations can be devised from these descriptions by those of ordinary skill in the art to which the present invention pertains.

따라서, 본 발명의 사상은 상기 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등하게 또는 등가적으로 변형된 모든 것들은 본 발명의 사상의 범주에 속한다고 할 것이다.Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and not only the claims described below but also all modifications equivalently or equivalently to the claims described below belong to the scope of the spirit of the present invention. will do it

Claims (19)

영상의 복호화 방법에 있어서,
현재 블록에 대한 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록을 사용하여 상기 현재 블록에 대한 재구축된 블록을 생성하는 단계
를 포함하는 영상의 복호화 방법.
In the video decoding method,
determining a value of a reference sample for prediction for a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstructed block for the current block using the prediction block
A video decoding method comprising:
제1항에 있어서,
상기 참조 샘플들의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 영상의 복호화 방법.
According to claim 1,
The value of the reference samples is determined based on a plurality of pixels in a horizontal line not adjacent to the current block or a plurality of pixels in a vertical line not adjacent to the current block.
제1항에 있어서,
상기 참조 샘플들의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 영상의 복호화 방법.
According to claim 1,
The value of the reference samples is determined based on at least one pixel of each horizontal line of the plurality of horizontal lines.
제3항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 영상의 복호화 방법.
4. The method of claim 3,
The plurality of horizontal lines are positioned higher than the current block.
제1항에 있어서,
상기 참조 샘플의 상기 값의 결정은 상기 샘플의 상기 값의 갱신인 영상의 복호화 방법.
According to claim 1,
The determining of the value of the reference sample is an update of the value of the sample.
제5항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인 내의 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 영상의 복호화 방법.
6. The method of claim 5,
and the updating is performed based on a calculation using values of adjacent pixels in a horizontal line included in the current block.
영상의 부호화 방법에 있어서,
현재 블록에 대한 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록을 사용하여 상기 현재 블록에 대한 재구축된 블록을 생성하는 단계
를 포함하는 영상의 부호화 방법.
In the video encoding method,
determining a value of a reference sample for prediction for a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstructed block for the current block using the prediction block
An image encoding method comprising a.
제7항에 있어서,
상기 참조 샘플들의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 영상의 부호화 방법.
8. The method of claim 7,
The value of the reference samples is determined based on a plurality of pixels in a horizontal line not adjacent to the current block or a plurality of pixels in a vertical line not adjacent to the current block.
제7항에 있어서,
상기 참조 샘플들의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 영상의 부호화 방법.
8. The method of claim 7,
The value of the reference samples is determined based on at least one pixel of each horizontal line of a plurality of horizontal lines.
제9항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 영상의 부호화 방법.
10. The method of claim 9,
The plurality of horizontal lines are positioned higher than the current block.
제7항에 있어서,
상기 참조 샘플의 상기 값의 결정은 상기 샘플의 상기 값의 갱신인 영상의 부호화 방법.
8. The method of claim 7,
and the determining of the value of the reference sample is an update of the value of the sample.
제11항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인 내의 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 영상의 부호화 방법.
12. The method of claim 11,
and the updating is performed based on a calculation using values of adjacent pixels in a horizontal line included in the current block.
제7항에 기재된 부호화 방법에 의하여 생성된 비트스트림을 기록하는 기록 매체.A recording medium for recording a bitstream generated by the encoding method according to claim 7. 비트스트림을 저장하는 컴퓨터 판독 가능한 기록 매체에 있어서,
상기 비트스트림은,
현재 블록에 대한 부호화된 정보
를 포함하고,
상기 부호화된 정보를 사용하여 상기 현재 블록에 대한 복호화가 수행되고,
상기 복호화에 있어서, 상기 현재 블록에 대한 예측을 위한 참조 샘플의 값의 결정이 수행되고, 상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록이 생성되고, 상기 예측 블록을 사용하여 상기 현재 블록에 대한 재구축된 블록이 생성되는 컴퓨터 판독 가능한 기록 매체.
A computer-readable recording medium for storing a bitstream, comprising:
The bitstream is
Encoded information about the current block
including,
Decoding is performed on the current block using the encoded information,
In the decoding, a value of a reference sample for prediction with respect to the current block is determined, a prediction block for the current block is generated using the reference sample, and the prediction block is applied to the current block using the prediction block. A computer-readable recording medium on which the reconstructed blocks are generated.
제14항에 있어서,
상기 참조 샘플들의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 컴퓨터 판독 가능한 기록 매체.
15. The method of claim 14,
The value of the reference samples is determined based on a plurality of pixels in a horizontal line not adjacent to the current block or a plurality of pixels in a vertical line not adjacent to the current block.
제14항에 있어서,
상기 참조 샘플들의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 컴퓨터 판독 가능한 기록 매체.
15. The method of claim 14,
The value of the reference samples is determined based on at least one pixel of each horizontal line of the plurality of horizontal lines.
제15항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 컴퓨터 판독 가능한 기록 매체.
16. The method of claim 15,
The plurality of horizontal lines are located above the current block.
제14항에 있어서,
상기 참조 샘플의 상기 값의 결정은 상기 샘플의 상기 값의 갱신인 컴퓨터 판독 가능한 기록 매체.
15. The method of claim 14,
and determining the value of the reference sample is an update of the value of the sample.
제18항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인 내의 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 컴퓨터 판독 가능한 기록 매체.
19. The method of claim 18,
wherein the updating is performed based on a calculation using values of adjacent pixels in a horizontal line included in the current block.
KR1020210188136A 2016-01-05 2021-12-27 Method and apparatus for prediction of residual signal KR102448084B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020210188136A KR102448084B1 (en) 2016-01-05 2021-12-27 Method and apparatus for prediction of residual signal
KR1020220120195A KR102558803B1 (en) 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020160001240A KR102345475B1 (en) 2016-01-05 2016-01-05 Method and apparatus for prediction of residual signal
KR1020210188136A KR102448084B1 (en) 2016-01-05 2021-12-27 Method and apparatus for prediction of residual signal

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020160001240A Division KR102345475B1 (en) 2016-01-05 2016-01-05 Method and apparatus for prediction of residual signal

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020220120195A Division KR102558803B1 (en) 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal

Publications (2)

Publication Number Publication Date
KR20220002207A true KR20220002207A (en) 2022-01-06
KR102448084B1 KR102448084B1 (en) 2022-09-28

Family

ID=59273764

Family Applications (4)

Application Number Title Priority Date Filing Date
KR1020160001240A KR102345475B1 (en) 2016-01-05 2016-01-05 Method and apparatus for prediction of residual signal
KR1020210188136A KR102448084B1 (en) 2016-01-05 2021-12-27 Method and apparatus for prediction of residual signal
KR1020220120195A KR102558803B1 (en) 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal
KR1020230093621A KR20230112594A (en) 2016-01-05 2023-07-19 Method and apparatus for prediction of residual signal

Family Applications Before (1)

Application Number Title Priority Date Filing Date
KR1020160001240A KR102345475B1 (en) 2016-01-05 2016-01-05 Method and apparatus for prediction of residual signal

Family Applications After (2)

Application Number Title Priority Date Filing Date
KR1020220120195A KR102558803B1 (en) 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal
KR1020230093621A KR20230112594A (en) 2016-01-05 2023-07-19 Method and apparatus for prediction of residual signal

Country Status (3)

Country Link
KR (4) KR102345475B1 (en)
CN (6) CN113891091A (en)
WO (1) WO2017119540A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019078629A1 (en) 2017-10-18 2019-04-25 한국전자통신연구원 Image encoding/decoding method and device, and recording medium having bitstream stored therein
EP4018652A4 (en) * 2019-09-22 2022-11-02 Beijing Bytedance Network Technology Co., Ltd. Padding process in adaptive loop filtering

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140110808A (en) * 2009-12-30 2014-09-17 주식회사 뉴라텍 Video encoding apparatus for performing intra-prediction based on directionality of neighboring block, video decoding apparatus and video decoding method for performing the same

Family Cites Families (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090095317A (en) * 2008-03-05 2009-09-09 삼성전자주식회사 Method and apparatus for encoding and decoding image
KR20100083957A (en) * 2009-01-15 2010-07-23 삼성전자주식회사 Method and apparatus for coding depth map using bit-plane coding
WO2010086562A1 (en) * 2009-01-28 2010-08-05 France Telecom Method and device for encoding images using separate encoding modes, decoding method and device, and corresponding computer programs
KR101452860B1 (en) * 2009-08-17 2014-10-23 삼성전자주식회사 Method and apparatus for image encoding, and method and apparatus for image decoding
TW201119407A (en) * 2009-11-19 2011-06-01 Thomson Licensing Method for coding and method for reconstruction of a block of an image
KR101700358B1 (en) * 2009-12-09 2017-01-26 삼성전자주식회사 Method and apparatus for encoding video, and method and apparatus for decoding video
KR20110068792A (en) * 2009-12-16 2011-06-22 한국전자통신연구원 Adaptive image coding apparatus and method
WO2011126309A2 (en) * 2010-04-06 2011-10-13 삼성전자 주식회사 Method and apparatus for video encoding and method and apparatus for video decoding
EP2375750A1 (en) * 2010-04-12 2011-10-12 Panasonic Corporation Complexity reduction of edge detection for edge based spatial prediction
EP2375751A1 (en) * 2010-04-12 2011-10-12 Panasonic Corporation Complexity reduction of edge-detection based spatial interpolation
AU2015202659B2 (en) * 2010-07-16 2016-05-19 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding image through intra prediction
KR20120012385A (en) * 2010-07-31 2012-02-09 오수미 Intra prediction coding apparatus
EP2421266A1 (en) * 2010-08-19 2012-02-22 Thomson Licensing Method for reconstructing a current block of an image and corresponding encoding method, corresponding devices as well as storage medium carrying an images encoded in a bit stream
KR101772046B1 (en) * 2010-11-04 2017-08-29 에스케이텔레콤 주식회사 Video Encoding/Decoding Method and Apparatus for Intra-Predicting Using Filtered Value of Pixel According to Prediction Mode
KR102295680B1 (en) * 2010-12-08 2021-08-31 엘지전자 주식회사 Intra prediction method and encoding apparatus and decoding apparatus using same
JP5592295B2 (en) * 2011-03-09 2014-09-17 日本電信電話株式会社 Image encoding method, image encoding device, image decoding method, image decoding device, and programs thereof
WO2012134046A2 (en) * 2011-04-01 2012-10-04 주식회사 아이벡스피티홀딩스 Method for encoding video
CN107071411B (en) * 2011-04-25 2020-08-28 Lg电子株式会社 Intra-frame prediction method executed by decoding device and encoding device
CN102186082B (en) * 2011-05-13 2014-04-16 哈尔滨工业大学 H.264 protocol based optimized decoding method for intra-frame coding compression technology
EP2721827A4 (en) * 2011-06-20 2016-03-02 Mediatek Singapore Pte Ltd Method and apparatus of directional intra prediction
US9179148B2 (en) * 2011-06-30 2015-11-03 Futurewei Technologies, Inc. Simplified bilateral intra smoothing filter
KR20130027400A (en) * 2011-09-07 2013-03-15 주식회사 케이티 Method and apparatus for intra prediction in dc mode
CN110650336B (en) * 2012-01-18 2022-11-29 韩国电子通信研究院 Video decoding apparatus, video encoding apparatus, and method of transmitting bit stream
WO2014003421A1 (en) * 2012-06-25 2014-01-03 한양대학교 산학협력단 Video encoding and decoding method
KR101530758B1 (en) * 2012-07-04 2015-07-20 한양대학교 산학협력단 Method and apparatus for intra prediction using adaptive filtering
KR101544390B1 (en) * 2013-06-26 2015-08-17 에스케이텔레콤 주식회사 Method and Apparatus for Encoding and Decoding Motion Vector
US9503715B2 (en) * 2013-08-30 2016-11-22 Qualcomm Incorporated Constrained intra prediction in video coding
KR20150055858A (en) * 2013-11-14 2015-05-22 삼성전자주식회사 Method and apparatus for encoding video, method and apparatus for decoding video using differential residual signal
KR101569912B1 (en) * 2013-12-17 2015-11-27 세종대학교산학협력단 Method and apparatus for encoding/decoding video

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140110808A (en) * 2009-12-30 2014-09-17 주식회사 뉴라텍 Video encoding apparatus for performing intra-prediction based on directionality of neighboring block, video decoding apparatus and video decoding method for performing the same

Also Published As

Publication number Publication date
CN113891093A (en) 2022-01-04
KR20170082071A (en) 2017-07-13
CN108432247B (en) 2021-11-19
KR20230112594A (en) 2023-07-27
CN113891094A (en) 2022-01-04
CN113891095A (en) 2022-01-04
CN108432247A (en) 2018-08-21
KR102448084B1 (en) 2022-09-28
KR102558803B1 (en) 2023-07-25
KR102345475B1 (en) 2022-01-03
KR20220136308A (en) 2022-10-07
WO2017119540A1 (en) 2017-07-13
CN113891092A (en) 2022-01-04
CN113891091A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
KR102397474B1 (en) Method and apparatus for encoding and decoding video using picture partition information
KR102328179B1 (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR20210145111A (en) Method and apparatus for intra prediction
KR20210136949A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR20220004781A (en) Method for encoding/decoding video and apparatus thereof
KR20240027646A (en) Method and apparatus for derivation of motion prediction information
KR20210156826A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR20240066144A (en) Method and apparatus for encoding and decoding using selective information sharing over channels
KR20170058838A (en) Method and apparatus for encoding/decoding of improved inter prediction
KR102619133B1 (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR20220082791A (en) Method and apparatus for derivation of motion prediction information
KR102558803B1 (en) Method and apparatus for prediction of residual signal
KR20220065740A (en) Method and apparatus for encoding and decoding video using picture partition information
CN108605123B (en) Method and apparatus for encoding and decoding video by using prediction
KR20170120418A (en) Apparatus and method for fast motion estimation encoding/decoding of enhancement later
KR102472462B1 (en) Method and apparatus for adaptive encoding and decoding based on image complexity
CN108605139B (en) Method and apparatus for encoding and decoding video by using prediction
KR20240018548A (en) Method for encoding/decoding video and apparatus thereof
CN116016911A (en) Method and apparatus for encoding and decoding video by using prediction

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right