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

Method and apparatus for prediction of residual signal Download PDF

Info

Publication number
KR102558803B1
KR102558803B1 KR1020220120195A KR20220120195A KR102558803B1 KR 102558803 B1 KR102558803 B1 KR 102558803B1 KR 1020220120195 A KR1020220120195 A KR 1020220120195A KR 20220120195 A KR20220120195 A KR 20220120195A KR 102558803 B1 KR102558803 B1 KR 102558803B1
Authority
KR
South Korea
Prior art keywords
block
prediction
current block
residual signal
reference sample
Prior art date
Application number
KR1020220120195A
Other languages
Korean (ko)
Other versions
KR20220136308A (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 KR1020220120195A priority Critical patent/KR102558803B1/en
Publication of KR20220136308A publication Critical patent/KR20220136308A/en
Priority to KR1020230093621A priority patent/KR20230112594A/en
Application granted granted Critical
Publication of KR102558803B1 publication Critical patent/KR102558803B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/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/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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

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

Abstract

잔차 신호에 대한 예측을 수행하는 방법 및 장치가 개시된다. 부호화 방법 및 부호화 장치는 현재 블록의 잔차 신호에 대해 주변 블록의 잔차 신호를 사용하는 추가적인 예측을 수행함으로써 예측된 잔차 신호를 생성한다. 복호화 방법 및 복호화 장치는 현재 블록의 복원 블록을 생성함에 있어서 이미 복원된 주변 블록의 잔차 신호를 사용한다. 부호화 및 복호화에 있어서, 예측 블록의 생성 전에, 예측 블록을 생성하기 위해 사용되는 예측 샘플의 값이 갱신될 수 있다. 잔차 신호의 예측 및 예측 샘플의 갱신을 통해 부호화의 효율이 향상될 수 있다.A method and apparatus for performing prediction on a residual signal are disclosed. An encoding method and an encoding apparatus generate a predicted residual signal by performing additional prediction on a residual signal of a current block using residual signals of neighboring blocks. A decoding method and a decoding apparatus use a residual signal of an already reconstructed neighboring block when generating a reconstructed block of a current block. In encoding and decoding, values of prediction samples used to generate a prediction block may be updated before generation of the prediction block. Encoding efficiency can be improved by predicting the residual signal and updating the prediction sample.

Description

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

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

정보 통신 산업의 지속적인 발달을 통해 HD(High Definition) 해상도를 가지는 방송 서비스가 세계적으로 확산되었다. 이러한 확산을 통해, 많은 사용자들이 고해상도이며 고화질인 영상(image)에 익숙해지게 되었다.Through the continuous development of the information communication industry, broadcasting services having high definition (HD) resolution have been spread worldwide. Through this diffusion, 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 users' demand for high image quality, many organizations are accelerating the development of next-generation video devices. Users' interest in not only High Definition TV (HDTV) and Full HD (FHD) TV, but also Ultra High Definition (UHD) TV, which has a resolution four times higher than that of FHD TV, has increased. In accordance with this increase in interest, image encoding/decoding technology for images with higher resolution and quality is required.

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

영상의 부호화 및 복호화에 있어서, 예측은 원본 신호와 유사한 예측 신호를 생성하는 것을 의미할 수 있다. 예측은 크게 공간적(spatial) 복원(reconstructed) 영상을 참조하는 예측, 시간적(temporal) 복원 영상을 참조하는 예측 및 그 밖의 심볼에 대한 예측으로 분류될 수 있다.In video encoding and decoding, prediction may mean generating a prediction signal similar to an original signal. Prediction can 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 can be a prediction technique that allows only spatial reference. The current block may be a block that is a current encoding target. Intra prediction may be a method of predicting a current block by referring to reference samples already reconstructed around the current block.

인트라 예측에 있어서, 주변의 참조 샘플은 원 영상에서의 밝기 값이 아닌 예측 및 복원된 밝기 값일 수 있으며, 후처리(post-processing) 필터링(filtering)이 적용되기 이전의 값일 수 있다. 참조 샘플은 이전에 부호화되고, 복원되었기 때문에, 부호화기(encoder) 및 복호화기(decoder)에서 현재 블록의 예측을 위해 사용할 수 있다.In intra prediction, neighboring reference samples may be predicted and reconstructed brightness values other than brightness values in the original image, and may be values 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 in an encoder and a decoder.

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

일 실시예는 인트라 부호화의 효율을 향상시키기 위해, 인트라 예측에 사용되는 참조 샘플을 부호화의 대상인 현재 블록에 가능한 가깝도록 갱신하는 방법 및 장치를 제공할 수 있다.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, which is an encoding target, 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 residual signals of neighboring blocks that have already been encoded or decoded.

일 측에 있어서, 영상의 부호화 방법에 있어서, 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 상기 현재 블록의 제1 잔차 신호를 생성하는 단계; 및 상기 현재 블록의 제1 잔차 신호를 사용하여 상기 현재 블록의 부호화를 수행하는 단계를 포함하는 영상의 부호화 방법이 제공된다.In one aspect, a video encoding method includes 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 the 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 predicted block of the current block.

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

상기 제1 잔차 신호는 상기 제2 잔차 신호 및 상기 제1 주변 블록의 잔차 신호의 차이일 수 있다.The first residual signal may be a difference between the second residual signal and the 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 performed.

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

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

다른 일 측에 있어서, 영상의 복호화 방법에 있어서, 현재 블록의 예측 블록을 생성하는 단계; 및 상기 예측 블록, 상기 현재 블록의 잔차 신호 및 상기 현재 블록의 제1 주변 블록의 잔차 신호에 기반하여 상기 현재 블록의 복원 블록을 생성하는 단계를 포함하는 영상의 복호화 방법이 제공된다.In another aspect, in a method of decoding an image, 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 the sum of the residual signal of the current block and the residual signal of the first neighboring block.

상기 복원 블록은 상기 현재 블록의 예측 블록, 상기 현재 블록의 잔차 신호 및 상기 제1 주변 블록의 잔차 신호의 합일 수 있다.The reconstruction 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 first neighboring block.

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

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

상기 제1 주변 블록은 상기 제1 주변 블록의 식별자에 의해 식별될 수 있다.The first neighboring block may be identified by an 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 method of decoding the image may further include updating a value of a reference sample used to generate the prediction block.

또 다른 일 측에 있어서, 영상의 복호화 방법에 있어서, 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정하는 단계; 및 상기 참조 샘플을 사용하여 상기 현재 블록의 예측 블록을 생성하는 단계를 포함하는 영상의 복호화 방법이 제공된다.In another aspect, a method of decoding an image includes determining a value of a reference sample based on a block adjacent to a current block; and generating a prediction block of the current block 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 forming 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 step, the value of the reference sample may be changed from a value before update to a value after update.

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

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

또 다른 일 측에 있어서, 영상의 부호화 방법에 있어서, 현재 블록의 주변 블록에 기반하여 참조 샘플의 값을 결정하는 단계; 및 상기 참조 샘플을 사용하여 상기 현재 블록의 예측 블록을 생성하는 단계를 포함하는 영상의 부호화 방법이 제공된다.In another aspect, a method of encoding an image includes determining a value of a reference sample based on a block adjacent to a current block; and generating a prediction block of the current block 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 using residual signals of neighboring blocks that have already been encoded or decoded 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 showing a configuration according to an embodiment of an encoding device to which the present invention is applied.
2 is a block diagram showing a configuration according to an embodiment of a decoding device to which the present invention is applied.
3 is a diagram schematically illustrating a division structure of an image when encoding and decoding an image.
4A to 7H are diagrams illustrating a form of a prediction unit (PU) that may be included in a coding unit (CU).
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 device according to an embodiment.
9A and 9B are flowcharts of an encoding method according to an exemplary embodiment.
10A is a flowchart of an encoding method according to an exemplary embodiment.
10B is a flowchart of a method of updating a reference sample according to an embodiment.
10C is a flowchart of a method for predicting a residual signal according to an exemplary embodiment.
10D is a flowchart of a method of encoding a current block according to an exemplary 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 gradient of a neighboring block in a horizontal direction according to an example.
13 illustrates a method of obtaining an inclination pattern according to an example.
14 illustrates a method of updating a reference sample by reflecting a gradient of a neighboring block in a vertical direction 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 shows a result of discrete cosine transformation on a default residual signal according to an example.
21A illustrates a proposed residual signal according to an example.
21B shows a result of discrete cosine transformation on the proposed residual signal according to an example.
22 illustrates locations of neighboring blocks according to an example.
23 is a structural diagram of a decryption device according to an embodiment.
24A and 24B are flowcharts of a decoding method according to an exemplary 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 exemplary embodiment.
25C is a flowchart of a prediction block generation method according to an embodiment.
25D is a flowchart of a recovery block generation method 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 decryption device according to an embodiment.

후술하는 예시적 실시예들에 대한 상세한 설명은, 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이들 실시예는 당업자가 실시예를 실시할 수 있기에 충분하도록 상세히 설명된다. 다양한 실시예들은 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 여기에 기재되어 있는 특정 형상, 구조 및 특성은 일 실시예에 관련하여 본 발명의 정신 및 범위를 벗어나지 않으면서 다른 실시예로 구현될 수 있다. 또한, 각각의 개시된 실시예 내의 개별 구성요소의 위치 또는 배치는 실시예의 정신 및 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 취하려는 것이 아니며, 예시적 실시예들의 범위는, 적절하게 설명된다면, 그 청구항들이 주장하는 것과 균등한 모든 범위와 더불어 첨부된 청구항에 의해서만 한정된다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS For detailed descriptions of exemplary embodiments described below, 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 the various embodiments are different, but need not be mutually exclusive. For example, specific shapes, structures, and characteristics described herein may be implemented in one embodiment in another embodiment without departing from the spirit and scope of the invention. Additionally, 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 to be taken in a limiting sense, and the scope of the exemplary embodiments, if properly described, is limited only by the appended claims, along with all equivalents as claimed by those claims.

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

어떤 구성요소(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 it should be understood that another component may exist in the middle of the two components. In addition, the description of "including" a specific configuration in exemplary embodiments does not exclude configurations other than the specific configuration above, and additional configurations may be included in the practice of exemplary embodiments or the scope of the technical idea of exemplary embodiments.

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

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

또한, 일부의 구성요소는 본질적인 기능을 수행하는 필수적인 구성요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성요소일 수 있다. 실시예들은 실시예의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 예를 들면, 단지 성능 향상을 위해 사용되는 구성요소와 같은, 선택적 구성요소가 제외된 구조 또한 권리 범위에 포함된다.In addition, some of the components may not be essential components for performing essential functions, but may be optional components for improving performance. Embodiments may be implemented by including only components essential to implement the essence of the embodiment, and structures excluding optional components, 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 so that those skilled in the art can easily practice 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 will be omitted.

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

우선, 실시예들에서 사용되는 용어를 설명한다.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 a region created by dividing 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 blocks, macro blocks, Coding Units (CUs), Prediction Units (PUs), and Transform Units (TUs) are used. One unit can be further divided into sub-units having a smaller size relative to the unit.

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

- 하나의 유닛은 트리 구조(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 a 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 non-split unit. The highest node may be referred to as a root node. Also, the highest node may have the smallest 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 created as the original unit is split twice.

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

- 블록(Block): 블록은 샘플의 MxN 배열일 수 있다. M 및 N은 각각 양의 정수일 수 있다. 블록은 흔히 2차원의 샘플의 배열을 의미할 수 있다. 샘플은 픽셀 또는 픽셀 값일 수 있다.- Block: A block can be an MxN array of samples. M and N may each be a positive integer. A block may refer to a two-dimensional array of samples. A sample can 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 smaller sizes.

파라미터 세트(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: An encoding device may use rate-distortion optimization to provide high encoding efficiency by using a combination of coding unit size, prediction mode, prediction unit size, motion information, and transformation unit size.

- 율-왜곡 최적화 방식은 상기의 조합들 중에서 최적의 조합을 선택하기 위해 각 조합의 율-왜곡 비용(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 among the above combinations. The rate-distortion cost can be calculated using Equation 1 below. In general, a combination that minimizes the rate-distortion cost can be selected as an optimal combination in the rate-distortion optimization method.

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

R은 율을 나타낼 수 있다. R은 관련된 문맥 정보를 이용한 비트 율을 나타낼 수 있다.R can 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 a prediction mode, motion information, and a coded block flag, but also bits generated by encoding transform coefficients.

부호화 장치는 정확한 D 및 R을 계산하기 위해 인터 예측 및/또는 인트라 예측, 변환, 양자화, 엔트로피 부호화, 역양자화, 역변환 등의 과정을 수행하는데, 이러한 과정은 부호화 장치에서의 복잡도를 크게 증가시킬 수 있다.The encoding device 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, and these processes can greatly increase complexity in the encoding device.

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

부호화 장치(100)는 비디오 부호화 장치 또는 영상 부호화 장치일 수 있다. 비디오는 하나 이상의 영상들을 포함할 수 있다. 부호화 장치(100)는 비디오의 하나 이상의 영상들을 시간에 따라 순차적으로 부호화할 수 있다.The encoding device 100 may be a video encoding device or an image encoding device. 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)를 포함할 수 있다.1, the encoding apparatus 100 includes a motion estimation 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, an entropy encoding unit 150, an inverse quantization unit 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 perform encoding on an input image in an intra mode and/or an inter mode. Also, the encoding device 100 may generate a bitstream through encoding of an input device and output the generated bitstream. When the intra mode is used, the switch 115 can be switched to intra, and when the inter mode is used, the switch 115 can be switched to inter.

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

예측 모드가 인트라 모드인 경우, 인트라 예측부(120)는 현재 블록의 주변의 이미 부호화된 블록의 픽셀 값을 참조 화소로서 이용할 수 있다. 인트라 예측부(120)는 참조 화소를 이용하여 공간적 예측을 수행할 수 있고, 공간적 예측을 통해 입력 블록에 대한 예측 샘플들을 생성할 수 있다.When the prediction mode is the intra mode, the intra predictor 120 may use pixel values of previously encoded blocks adjacent to the current block as reference pixels. The intra predictor 120 may perform spatial prediction using a reference pixel and 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 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 compensation unit 112 may generate a prediction block by performing motion compensation using a motion vector. Here, the motion vector may be a 2D 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 using a difference between the input block and the prediction block. A residual block may also be referred to as a residual signal.

변환부(130)는 잔차 블록에 대해 변환(transform)을 수행하여 변환 계수를 생성할 수 있고, 변환 계수(transform coefficient)를 출력할 수 있다. 여기서, 변환 계수는 잔차 블록에 대한 변환을 수행함으로써 생성된 계수 값일 수 있다. 변환 생략(transform skip) 모드가 적용되는 경우, 변환부(130)는 잔차 블록에 대한 변환을 생략할 수도 있다.The transform unit 130 may generate a transform coefficient by performing a transform on the residual block, and may output the 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 the 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 a quantization parameter, and may output the quantized transform coefficient level. At this time, the quantization unit 140 may quantize the transform coefficient using a quantization matrix.

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

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

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

예를 들면, 부호화 파라미터는 예측 모드, 움직임 벡터, 참조 픽처 색인(index), 부호화 블록 패턴(pattern), 잔차 신호 유무, 변환 계수, 양자화된 변환 계수, 양자화 파라미터, 블록 크기, 블록 분할(partition) 정보 등의 값 또는 통계를 포함할 수 있다. 예측 모드는 인트라 예측 모드 또는 인터 예측 모드를 가리킬 수 있다.For example, the coding parameters may include values or statistics such as prediction mode, motion vector, reference picture index, coded block pattern, presence/absence of a residual signal, transform coefficient, quantized transform coefficient, quantization parameter, block size, and block partition 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 prediction 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 the difference between the original signal and the predicted signal. A 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 symbols are represented through such allocation, the size of bitstrings for symbols that are encoding targets can be reduced. Therefore, compression performance of image encoding can 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)는 도출된 이진화 방법 또는 확률 모델을 사용하여 엔트로피 부호화를 수행할 수도 있다.Also, encoding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) 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 encoding unit 150 may derive a binarization method for a target symbol. Also, the entropy encoder 150 may derive a probability model of the 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 device 100 may decode the encoded current image again and store the decoded image as a reference image. Inverse quantization and inverse transformation of the current image encoded 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 in the inverse transformation unit 170. The inverse quantized and inverse transformed coefficients may be combined 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 pass 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 also be referred to as an adaptive in-loop filter.

디블록킹 필터는 블록들 간의 경계에 생긴 블록 왜곡을 제거할 수 있다. SAO는 코딩 에러를 보상하기 위해 픽셀 값에 적정 오프셋(offset) 값을 더할 수 있다. ALF는 복원 영상 및 원래의 영상을 비교한 값에 기반하여 필터링을 수행할 수 있다. 필터부(180)를 거친 복원 블록은 참조 픽처 버퍼(190)에 저장될 수 있다.The deblocking filter may remove block distortion generated at a boundary between blocks. SAO may add an appropriate offset value to a pixel value to compensate for a coding error. ALF may perform filtering based on a value obtained by comparing the restored image and the original image. A 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 showing a configuration according to an embodiment of a decoding device to which the present invention is applied.

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

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

복호화 장치(200)는 부호화 장치(100)에서 출력된 비트스트림을 수신할 수 있다. 복호화 장치(200)는 비트스트림에 대하여 인트라 모드 또는 인터 모드로 복호화를 수행할 수 있다. 또한, 복호화 장치(200)는 복호화를 통해 복원 영상을 생성할 수 있고, 복원 영상을 출력할 수 있다.The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding apparatus 200 may perform decoding on a bitstream in an intra mode or an inter mode. Also, the decoding apparatus 200 may generate a restored image through decoding and output the restored 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 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 on a bitstream according to a probability distribution. The generated symbols may include symbols in the form of quantized coefficients. Here, the entropy decoding method may be similar to the above-described entropy encoding method. For example, the entropy decoding method may be a reverse process of the above-described entropy encoding method.

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

인트라 모드가 사용되는 경우, 인트라 예측부(240)는 현재 블록 주변의 이미 부호화된 블록의 픽셀 값을 이용하는 공간적 예측을 수행함으로써 예측 블록을 생성할 수 있다. 인터 모드가 사용되는 경우, 움직임 보상부(250)는 움직임 벡터 및 참조 픽처 버퍼(270)에 저장되어 있는 참조 영상을 이용하는 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. When the intra mode is used, the intra predictor 240 may generate a prediction block by performing spatial prediction using pixel values of previously encoded blocks adjacent to the current block. When the inter mode is used, the motion compensation unit 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 predicted 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 reconstructed 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 division structure of an image when encoding and decoding an image.

영상을 효율적으로 분할하기 위해, 부호화 및 복호화에 있어서, 코딩 유닛(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 collectively referring to 1) a syntax element and 2) a block including 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 into units of largest coding units (LCUs), and a division structure is determined in units of LCUs. Here, LCU may be used as the same meaning as Coding Tree Unit (CTU).

분할 구조는 LCU(310) 내에서의 코딩 유닛(Coding Unit; CU)의 분포를 의미할 수 있다. CU는 영상을 효율적으로 부호화하기 위한 유닛일 수 있다. 이러한 분포는 하나의 CU를 4개의 CU들로 분할할지 여부에 따라 결정할 수 있다. 분할에 의해 생성된 CU의 가로 크기 및 세로 크기는 각각 분할 전의 CU의 가로 크기의 절반 및 세로 크기의 절반일 수 있다. 분할된 CU는 동일한 방식으로 가로 크기 및 세로 크기가 절반으로 감소된 4개의 CU로 재귀적으로 분할될 수 있다.The division structure may refer to 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 4 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 and vertical sizes are reduced by half in the same way.

이때, CU의 분할은 기정의된 깊이까지 재귀적으로 이루어질 수 있다. 깊이 정보는 CU의 크기를 나타내는 정보일 수 있다. 깊이 정보는 각 CU마다 저장될 수 있다. 예컨대, LCU의 깊이는 0일 수 있고, 최소 코딩 유닛(Smallest Coding Unit; SCU)의 깊이는 기정의된 최대 깊이일 수 있다. 여기서, LCU는 상술된 것과 같이 최대의 코딩 유닛 크기를 가지는 코딩 유닛일 수 있고, SCU는 최소의 코딩 유닛 크기를 가지는 코딩 유닛일 수 있다. In this case, the division of the CU may be recursively performed up to a predefined depth. 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 the 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 each time the horizontal and vertical sizes of the CU are reduced by half. For each depth, a CU that is not split may have a size of 2Nx2N. In the case of a CU being split, a CU of 2Nx2N size may be split into 4 CUs having a size of NxN. The size of N is halved for each increase in depth by one.

도 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. A SCU with a depth of 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 a depth of 0. A CU of 32x32 pixels can be expressed as a depth of 1. A CU of 16x16 pixels can be expressed as depth 2. A CU of 8x8 pixels, which is an SCU, can be expressed as a depth of 3.

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

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

LCU로부터 분할된 CU 중 더 이상 분할되지 않는 CU는 하나 이상의 예측 유닛(Prediction Unit; PU)들로 나뉘어질 수 있다. 이러한 처리 또한, 분할로 칭해질 수 있다.Among the CUs divided from the LCU, a CU that is not further divided 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. A PU may be coded and decoded in any one of skip mode, inter mode, and intra mode. A PU may be divided into various types according to modes.

도 4a에서 도시된 것과 같이, 스킵 모드에서는, CU 내에 분할이 존재하지 않을 수 있다. 스킵 모드에서는 분할 없이 CU와 동일한 크기를 갖는 2Nx2N 모드(410)가 지원될 수 있다.As shown in FIG. 4A , in skip mode, there may not be a split within a CU. In the skip mode, the 2Nx2N mode 410 having the same size as the 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 inter mode, 8 divided types can be supported within the CU. 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 445 may be supported.

인트라 모드에서는, 2Nx2N 모드(410) 및 NxN 모드(425)가 지원될 수 있다. In intra mode, 2Nx2N mode 410 and 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 transform, quantization, inverse transform, and inverse quantization processes 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 the CUs split from the LCU, a CU that is no longer split into CUs may be split into one or more TUs. In this case, the division 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 a quadtree structure. Through division, one CU 510 may be composed of 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 a prediction unit.

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

예측 모드의 개수는 색 성분(color component)의 타입에 따라 상이할 수 있다. 예를 들면, 색 성분이 휘도(luma) 신호인지 아니면 색차(chroma) 신호인지에 따라 예측 모드의 개수가 다를 수 있다.The number of prediction modes may be different according to 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 중 적어도 하나의 크기일 수 있다.A PU may have a square shape, with a size of NxN or a size of 2Nx2N. The size of NxN may include 4x4, 8x8, 16x16, 32x32, and 64x64. A unit of PU may be the size of at least one of CU, PU, and 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 picture). Also, arrows in FIG. 7 may indicate prediction directions. That is, an image may be encoded and/or decoded according to a 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 coded according to the coding type of each picture.

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

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

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

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

참조 픽처(reference picture)는 현재 픽처의 이전 픽처 또는 현재 픽처의 이후 픽처 중 적어도 하나일 수 있다. 이때, 인터 예측은 참조 픽처에 기반하여 현재 픽처의 블록에 대한 예측을 수행할 수 있다. 여기에서, 참조 픽처는 블록의 예측에 이용되는 영상을 의미할 수 있다.A reference picture may be at least one of a picture before the current picture or a picture after the current picture. In this case, inter prediction may perform prediction on a 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 within 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 a current block within the reference picture, and generate a prediction block for the current block using the selected reference block. The current block may be a block currently being 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 . Also, 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 may use motion information of a reconstructed neighboring block and/or motion information of a collocated block (col block) to encode and/or decode. Efficiency can be improved. A collocated block may be a block corresponding to a current block in a previously reconstructed collocated picture (col picture). The reconstructed neighboring block may be a block in the current picture and a block already reconstructed through encoding and/or decoding. Also, the restoration block may be a 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 spatially located at a position corresponding to the current block in a collocated picture, and may determine a predefined relative position with respect to the determined block. The predefined relative position may be a position inside and/or outside a block spatially existing 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 relative position. Here, the collocated picture may be one picture 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 a current block. For example, as a prediction mode applied for inter prediction, there may be an Advanced Motion Vector Predictor (AMVP) and 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 may generate a predictive motion vector candidate list using a motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block. A motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block may be used as a predicted motion vector candidate.

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

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

부호화 장치(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. A bitstream may include an encoded MVD. The MVD may be transmitted from the encoding device 100 to the decoding device 200 through a bitstream. At this time, the decoding apparatus 200 may decode the received MVD. The decoding apparatus 200 may derive a motion vector of the current block through the sum of the decoded MVD and the predicted motion vector.

비트스트림은 참조 픽처를 지시하는 참조 픽처 인덱스 등을 포함할 수 있다. 참조 픽처 인덱스는 비트스트림을 통해 부호화 장치(100)로부터 복호화 장치(200)로 전송될 수 있다. 복호화 장치(200)는 주변 블록의 움직임 정보들을 이용하여 현재 블록의 움직임 벡터를 예측할 수 있고, 예측된 움직임 벡터 및 움직임 벡터 차분을 이용하여 현재 블록의 움직임 벡터를 유도할 수 있다. 복호화 장치(200)는 유도된 움직임 벡터와 참조 픽처 인덱스 정보에 기반하여 현재 블록에 대한 예측 블록을 생성할 수 있다.A bitstream may include a reference picture index indicating a reference picture. The reference picture index may be transmitted from the encoding device 100 to the decoding device 200 through a bitstream. The decoding apparatus 200 may predict a motion vector of the current block using motion information of neighboring blocks, and may derive a 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 motion information derivation method is merge. Merge may refer to merging of motions of 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 device 100 and the decoding device 200 may generate a merge candidate list using motion information of a reconstructed neighboring block and/or motion information of a collocated block. The motion information may include at least one of 1) a motion vector, 2) an index for a reference picture, and 3) a prediction direction. The prediction direction can be unidirectional or bidirectional.

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

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

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

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

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

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

부호화 장치(800)는 전술된 부호화 장치(100)에 대응할 수 있다. 부호화 장치(800)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)를 포함할 수 있고, 인트라 잔차 예측부(810)를 더 포함할 수 있다.The encoding device 800 may correspond to the aforementioned encoding device 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, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference pick. The buffer 190 may be included, and an intra residual predictor 810 may be further included.

움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽처 버퍼(190)는 도 1을 참조하여 전술된 것과 같은 기능 및/또는 동작을 수행할 수 있다. 중복되는 설명은 생략한다.The motion prediction unit 111, the motion compensation unit 112, the intra prediction unit 120, the switch 115, the subtracter 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180, and the reference picture buffer 190 are shown in FIG. Functions and/or operations as described above with reference to 1 may be performed. Redundant descriptions are 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 prediction unit 111, the motion compensation unit 112, the intra prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180, and the reference picture buffer 190 may perform functions and/or operations related to the intra residual predictor 810. motion compensation unit 112, intra prediction unit 120, switch 115, subtractor 125, transform unit 130, quantization 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 The function and / or operation of ) is 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 predictor 120 and the intra residual predictor 810 may be integrated into the intra predictor 120 . In embodiments, functions and/or operations described as performed by the intra residual predictor 810 may be performed by the intra predictor 120 .

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

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

이하에서, 현재 블록은 현재 부호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block currently being encoded or a block within 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 created. Generation of a reference sample according to an example will be described in detail below with reference to FIG. 11 .

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

단계(910)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성(refine)하는 것일 수 있다.In step 910, the intra predictor 120 may determine whether to update the reference sample. Here, the update of the reference sample may be to refine a sample value of the reference sample used for generating the prediction block before generating 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 a reference sample update, steps 920 and 970 may be performed.

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

인트라 예측부(120)는 주변 샘플의 방향성 패턴에 따라 참조 샘플의 값을 갱신할 수 있다.The intra predictor 120 may update values of reference samples according to directional patterns of neighboring samples.

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

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

단계(920)에서, 인트라 예측부(120)는 인트라 예측을 수행할 수 있다. 인트라 예측부(120)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In step 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 a prediction block of the current block by using the reference sample according to the intra prediction mode of the current block.

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a prediction block generation method of an existing video 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 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 by using intra prediction. The intra predictor 120 may generate a second residual signal of the current block based on the intra prediction mode and the reference sample of 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 video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the second residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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 with reference to FIGS. 16, 17, and 18 below.

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

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

단계(950)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측에 따른 현재 블록의 제1 잔차 신호를 생성할 수 있다.In operation 950, the intra residual predictor 810 may generate a first residual signal of the current block according to the 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 the current block generated by residual signal prediction. Alternatively, the first residual signal may be a residual signal of the current block generated based on residual signals of first neighboring blocks of the current block.

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

일 예에 따른 제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 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 existing video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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 way.

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

기존의 인트라 예측과 달리, 참조 샘플의 갱신이 수행되는 경우, 인트라 예측부(120)는 참조 샘플의 갱신의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.Unlike conventional intra prediction, when the reference sample is updated, the intra predictor 120 can encode the above 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. For example, if the update of the reference sample is used, the value of the above information may be set to '1', and if the update of the reference sample is not used, the value of the above 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 or not residual signal prediction is performed.

잔차 신호 예측이 수행되는 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.When 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, can know whether residual signal prediction is performed or not with reference to FIG. 23 . For example, if the update of the reference sample is used, the value of the above information may be set to '1', and if the update of the reference sample is not used, the value of the above information may be set to '0'.

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

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

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

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

제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 device 800 and the decoding device 2300. For example, in relation to the identifier of the first neighboring block, the block size N and the location of the neighboring blocks may 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 may be encoded in a “(neighboring-residual_index) truncated unary ((neighboring-residual_idx) Truncated unary)” method.

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

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

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

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

단계(930)에서 잔차 신호 예측을 수행하기로 결정된 경우, 단계(950)에서 생성된 현재 블록의 제1 잔차 신호가 단계(990)에서 사용되는 잔차 신호일 수 있다. 말하자면, 잔차 신호 예측에 의해 생성된 잔차 신호가 현재 블록의 부호화를 위해 사용될 수 있고, 부호화 장치(800)는 현재 블록의 제1 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다.If it is determined in step 930 to perform residual signal prediction, the first residual signal of the current block generated in step 950 may be a residual signal used in step 990 . In other words, the residual signal generated by 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 step 930 , the third residual signal of the current block generated in step 960 may be a residual signal used in step 990 .

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

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

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

단계(993)에서, 엔트로피 부호화부(150)는 변환 계수 레벨에 대한 엔트로피 부호화를 수행할 수 있다.In step 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 encoding of information described above, steps 970, 980, and 985 may be performed by a different entity and in a different order from those described above. For example, step 993 may include step 970, step 980 and step 985. Also, the entro unit encoder 150 may encode at least one of information indicating whether reference sample update is performed, information indicating whether residual signal prediction is performed, and an identifier of the first neighboring block.

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

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

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

도 10d는 일 실시예에 따른 현재 블록의 부호화 방법의 흐름도이다.10D is a flowchart of a method of encoding a current block according to an exemplary 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 , updating of a reference sample and prediction of a residual signal can be performed separately.

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

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

단계(1010)에서, 인트라 예측부(120)는 현재 블록의 참조 샘플을 생성할 수 있다. 인트라 예측부(120)는 인트라 예측을 위한 현재 블록의 주변의 참조 샘플을 생성할 수 있다. 일 예에 따른 참조 샘플의 생성에 대해서 아래에서 도 11을 참조하여 상세하게 설명된다.In step 1010, the intra predictor 120 may generate a reference sample of the current block. The intra prediction unit 120 may generate reference samples 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 generation of reference samples, reference sample generation methods of existing video encoding and/or decoding technologies, such as high-efficiency video coding and advanced video coding, may be used.

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

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

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

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

단계(1021)에서, 인트라 예측부(120)는 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 여기에서, 참조 샘플의 갱신은 현재 블록의 예측 블록을 생성하기 이전에 예측 블록의 생성을 위해 사용되는 참조 샘플의 샘플 값을 재구성하는 것일 수 있다.In step 1021, the intra predictor 120 may determine whether to update the reference sample. Here, the update of the reference sample may be reconstructing a sample value of the reference sample used for generating the prediction block before generating 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 a reference sample update, step 1023 may be performed.

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

인트라 예측부(120)는 주변 샘플의 방향성 패턴에 따라 참조 샘플의 값을 갱신할 수 있다.The intra predictor 120 may update values of reference samples according to directional patterns of neighboring samples.

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

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

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

기존의 인트라 예측과 달리, 참조 샘플의 갱신이 수행되는 경우, 인트라 예측부(120)는 참조 샘플의 갱신의 여부를 도 23을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.Unlike conventional intra prediction, when the reference sample is updated, the intra predictor 120 can encode the above 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. For example, if the update of the reference sample is used, the value of the above information may be set to '1', and if the update of the reference sample is not used, the value of the above 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)가 수행될 수 있다.When step 1010 or step 1020 is performed, step 1030 may be performed.

다시 도 10a를 참조한다.Again refer to FIG. 10A.

단계(1030)에서, 인트라 예측부(120)는 인트라 예측을 수행할 수 있다. 인트라 예측부(120)는 현재 블록의 예측 블록을 생성할 수 있다. 인트라 예측부(120)는 현재 블록에 대한 인트라 예측 모드에 따라서 참조 샘플을 사용하여 현재 블록의 예측 블록을 생성할 수 있다.In step 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 the reference sample according to the intra prediction mode of the current block.

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

부호화 장치(800)는 잔치 신호의 예측의 기능을 선택적으로 제공할 수 있다. 잔치 신호의 예측의 기능이 사용되는 경우, 단계(1030)의 다음으로 단계(1040)가 수행될 수 있다. 잔치 신호의 예측의 기능이 사용되지 않는 경우, 단계(1030)의 다음으로 단계(1050)가 수행될 수 있다. 말하자면, 실시예에서 잔치 신호의 예측의 기능은 선택적으로 결합될 수 있다.The encoding device 800 may selectively provide a function of predicting a feast signal. When the function of predicting the feast signal is used, step 1040 may be performed following step 1030. If the function of predicting the feast signal is not used, step 1050 may be performed following step 1030. That is to say, in an embodiment the function of predicting the feast signal may 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 residual signals of neighboring blocks. Since updates are made to the residual signal once the residual signal is generated, a "prediction" on the residual signal may be considered a "re-prediction" on the residual signal.

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

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

단계(1041)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 결정할 수 있다.In step 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 step 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 before step 1044. Alternatively, step 1044 may be performed before step 1043.

단계(1043)에서, 인트라 잔차 예측부(810)는 현재 블록의 하나 이상의 주변 블록들 중 제1 주변 블록을 결정할 수 있다. 제1 주변 블록은 잔차 신호 예측을 위해 사용되는 블록일 수 있다. 일 예에 따른 주변 블록의 결정에 대하여 아래에서 도 22을 참조하여 상세하게 설명된다.In step 1043, the intra residual predictor 810 may determine a first neighboring block 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 step 1044, the intra prediction unit 120 may generate a second residual signal of the current block by using intra prediction. The intra predictor 120 may generate a second residual signal of the current block based on the intra prediction mode and the reference sample of 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 video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the second residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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 with reference to FIGS. 16, 17, and 18 below.

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

단계(1045)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측에 따른 현재 블록의 제1 잔차 신호를 생성할 수 있다.In operation 1045, the intra residual predictor 810 may generate a first residual signal of the current block according to the 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 the current block generated by residual signal prediction. Alternatively, the first residual signal may be a residual signal of the current block generated based on residual signals of first neighboring blocks of the current block.

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

일 예에 따른 제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 residual signal prediction is not to be performed, in step 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 existing video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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)가 수행될 수 있다.If step 1042 or step 1046 is performed, step 1047 may be performed next.

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

잔차 신호 예측이 수행되는 경우, 인트라 잔차 예측부(810)는 잔차 신호 예측의 여부를 도 21을 참조하여 후술될 복호화 장치(2300)가 알 수 있도록 상기의 정보를 부호화할 수 있다. 예를 들면, 참조 샘플의 갱신이 사용되었으면 상기의 정보의 값이 '1'로 설정될 수 있고, 참조 샘플의 갱신이 사용되지 않았으면 상기의 정보의 값이 '0'으로 설정될 수 있다.When 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, can know whether residual signal prediction is performed or not with reference to FIG. 21 . For example, if the update of the reference sample is used, the value of the above information may be set to '1', and if the update of the reference sample is not used, the value of the above information may be set to '0'.

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

다음으로, 도 10c를 참조한다.Next, refer 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 an identifier of a first neighboring block.

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

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

제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 device 800 and the decoding device 2300. For example, in relation to the identifier of the first neighboring block, the block size N and the location of the neighboring blocks may 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 may be encoded in a “(neighboring-residual_index) truncated unary ((neighboring-residual_idx) Truncated unary)” method.

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

단계(1049)에서, 인트라 잔차 예측부(810)는 잔차 신호 예측의 수행의 여부를 나타내는 정보를 부호화할 수 있다.In step 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 before step 1049. Alternatively, step 1049 may be performed before step 1048.

단계(1030) 또는 단계(1040)가 수행되면, 다음으로 단계(1050)가 수행될 수 있다.If 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 perform encoding of the current block by using the residual signal of the current block. Step 1050 may be performed by at least one of the transform unit 130, the quantization unit 140, and the entropy encoding unit 150.

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

단계(1041)에서 잔차 신호 예측을 수행하기로 결정된 경우, 단계(950)에서 생성된 현재 블록의 제1 잔차 신호가 단계(1050)에서 사용되는 잔차 신호일 수 있다. 말하자면, 잔차 신호 예측에 의해 생성된 잔차 신호가 현재 블록의 부호화를 위해 사용될 수 있고, 부호화 장치(800)는 현재 블록의 제1 잔차 신호를 사용하여 현재 블록의 부호화를 수행할 수 있다.When it is determined to perform residual signal prediction in step 1041 , the first residual signal of the current block generated in step 950 may be a residual signal used in step 1050 . In other words, the residual signal generated by 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 step 1050 , the third residual signal of the current block generated in step 1046 may be a residual signal used in step 1050 .

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

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

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

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

단계(1053)에서, 엔트로피 부호화부(150)는 변환 계수 레벨에 대한 엔트로피 부호화를 수행할 수 있다.In step 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 encoding of information described above, steps 1023, 1048, and 1049 may be performed by a different entity and in a different order from those described above. For example, step 1053 may include step 1023, step 1048 and step 1049. Also, the entro unit encoder 150 may encode at least one of information indicating whether reference sample update is performed, information indicating whether residual signal prediction is performed, and an identifier of the first neighboring block.

제안된 부호화 방법들Proposed Encoding Methods

도 10을 참조하여 전술된 실시예에서, 부호화 방법은 2가지의 방법들로 분류될 수 있다. 각 방법은 아래와 같다.In the embodiment described above with reference to FIG. 10, the encoding method can 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 for intra prediction using an existing method and reconstructing sample values of the reference sample generated using the existing method according to a directional pattern of neighboring samples. Here, the conventional method may refer to a method of generating a reference sample for intra prediction performed by the intra predictor 120 described above with reference to FIG. 1 .

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

실시예의 분류Classification of Examples

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

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

- 제2 실시예 : 제2 실시예는 도 10a에서 내부가 비워진 화살표로 표시되었다. 제2 실시예는 단계(1010), 단계(1020), 단계(1030), 단계(1040) 및 단계(1050)를 포함할 수 있다. 제2 실시예는 참조 샘플의 갱신 및 잔차 신호의 예측을 수행할 수 있다.- Second Embodiment: The second embodiment is indicated by an empty arrow in Fig. 10A. The second embodiment may include steps 1010, 1020, 1030, 1040 and 1050. The second embodiment may perform update 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 a hatched line inside in FIG. 10A. The third embodiment may include steps 1010, 1030, 1040 and 1050. The third embodiment does not update the reference sample, but can predict the residual signal.

부호화 장치(800)는 제1 실시예, 제2 실시예 및 제3 실시예 중 하나의 실시예를 사용하여 현재 블록의 부호화를 수행할 수 있다. 또는, 부호화 장치(800)는 3개의 실시예들 모두에 대한 율-왜곡 최적화를 수행할 수 있고, 3개의 실시예들 중 최소의 율-왜곡 값을 도출시키는 방법을 선택할 수 있다. 예를 들면, 부호화 장치(800)는 최소의 율-왜곡 값을 도출시키도록 단계(1020) 및 단계(1040)의 각각을 선택적으로 사용할 수 있다.The encoding apparatus 800 may perform encoding of the current block using one of the first embodiment, the second embodiment, and the third embodiment. Alternatively, the encoding apparatus 800 may perform rate-distortion optimization for all three embodiments, and may select a method for deriving the 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 step 910, the intra predictor 120 may determine whether or not to update reference samples 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 or not to update a reference sample. The reference sample update information may be information indicating whether the update of the reference sample is performed for 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 has been 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 encoding of the current block.

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

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

1) 영상 시퀀스 전체: 참조 샘플의 갱신의 수행 여부는 영상 시퀀스 전체에 대하여 결정될 수 있다. 이러한 경우, 시퀀스 파라미터 세트(sequence parameter set)는 참조 샘플 갱신 정보를 포함할 수 있다. 시퀀스 파라미터 세트의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(120)는 영상 시퀀스 전체에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.1) Entire video sequence: Whether to update reference samples may be determined for the entire video sequence. In this case, a sequence parameter set may include reference sample update information. If the reference sample update information of the sequence parameter set indicates that the reference sample is updated, the intra predictor 120 may perform intra prediction using a reference sample to which a directional gradient is applied to the entire video 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, a 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 updated, the intra prediction unit 120 uses a reference sample to which a gradient according to a direction is applied to the entire image corresponding to the picture parameter set. Can perform intra prediction. Alternatively, the intra predictor 120 may identify whether updating 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 can 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 updated, the intra predictor 120 may perform intra prediction using a reference sample to which a gradient according to a direction is applied to a slice corresponding to the slice segment header.

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

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

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

단계(930)에서 결정되는 잔차 신호 예측의 수행 여부는 기정의된 단위에 대하여 결정될 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.Whether to perform the residual signal prediction determined in step 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 for a predefined unit. For example, when the value of the residual signal prediction information is the first value, it may indicate that residual signal prediction is performed in encoding of the current block. When the value of the residual signal prediction information is the second value, it may indicate that residual signal prediction is not performed in encoding of the current block.

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

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

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

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

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 잔차 신호 예측의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(810)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 잔차 신호 예측을 수행할 수 있다.3) Slice: One image can 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. If 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 the 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 exist for the coding unit. If the residual signal prediction information for the coding unit indicates that residual signal prediction is to be performed, the intra residual predictor 810 may perform residual signal prediction for the coding unit corresponding to the residual signal prediction information.

전술된 것과 같이, 잔차 신호 예측 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the residual signal prediction information can 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 of the reference sample to be described below may be used to determine the value of the reference sample before updating the reference sample, and may be performed by the intra predictor 120 before step 910 described above with reference to FIG. 9A. Also, processing of a reference sample to be described below may correspond to step 1010 described above with reference to FIG. 10A.

도 11에서는, 현재 블록(1100), 상단 인접 라인(1110), 좌측 인접 라인(1120) 및 좌측 상단 샘플(1130)이 도시되었다.In FIG. 11 , a current block 1100 , a top adjacent line 1110 , a left adjacent line 1120 , and a 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 the top adjacent line 1110 , the left adjacent line 1120 , and the top 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 top left sample 1130 . The intra predictor 120 may select at least some of the pixels of the top adjacent line 1110, the left adjacent line 1120, and the top left sample 1130 as reference samples according to the intra prediction mode of 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 side of the current block 1100 . The upper left sample 1130 may be a sample adjacent to the upper left corner 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 top 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 greater. The top adjacent line 1110 may be 2N×1 pixels.

좌측 인접 라인(1120)의 최상단 샘플의 y 좌표는 현재 블록(1100)의 최상단 픽셀(들)의 y 좌표와 동일할 수 있다. 현재 블록(1100)의 크기가 NxN일 때, 좌측 인접 라인(1120)의 길이는 2N일 수 있다. 좌측 인접 라인(1120)은 1x2N의 픽셀들일 수 있다.The y coordinate of the topmost sample of the left adjacent line 1120 may be the same as the y coordinate of the topmost 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 of 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 top left sample 1130 may be a value obtained by subtracting 1 from the y coordinate of the top 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 restored by prediction and restoration, not a brightness value of pixel(s) of the original image. For example, neighboring block(s) of the current block 1100 may be encoded prior to encoding of the current block 1100, and brightness values of pixels of the neighboring blocks may be restored through prediction and restoration in the encoding process. A 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 are no reference samples available around the current block 1100, the intra predictor 120 uses samples closest to the current block 1100 among available samples (i.e., pixels) in the vicinity. Padding can be performed. A brightness value of the reference sample may be generated by padding the reference sample.

인트라 예측부(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 gradient of a neighboring block in a horizontal direction according to an example.

도 12에서 원은 샘플(또는, 픽셀)을 나타낼 수 있다. 점선의 사각형은 블록을 나타낼 수 있다. In FIG. 12 , circles may represent samples (or pixels). A dotted line 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 neighboring blocks 1230 are illustrated.

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

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

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

주변 블록(1230) 내의 점선은 주변 블록(1230) 내의 샘플들의 수평 라인을 나타낼 수 있다. 주변 블록(1230) 내의 굵은 실선은 수평 라인에 포함되는 샘플들의 경사도를 나타낼 수 있다. ∇dx는 경사도 값을 나타낼 수 있다.Dotted lines in the neighboring block 1230 may represent horizontal lines of samples in the neighboring block 1230 . Thick solid lines in the neighboring block 1230 may represent gradients of samples included in the horizontal line. ∇ dx can represent the slope value.

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

주변 블록(1230)은 현재 블록(1210)에 대한 부호화 및/또는 복호화 이전에 이미 복원이 완료된 블록일 수 있다.The neighboring block 1230 may be a block for which reconstruction has already been completed 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 the 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 of the current block 1210 . Alternatively, the reference sample may be a sample of a vertical line adjacent to the left side of the current block 1210 . The reference sample block 1220 may be a block adjacent to the left of the current block 1210 . In addition, the neighboring block 1230 may be a block obtained by adding a top adjacent block of the current block 1210 and a left top adjacent block of the current block 1210 . The top adjacent block of the current block 1210 may be a block adjacent to the top of the current block 1210 . The block adjacent to the top left of the current block 1210 may be a block adjacent to the top left of the current block 1210 . The top adjacent block and the upper 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 adjacent block and the upper left adjacent 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는 각각 실수일 수 있다.In addition, when the size of the current block 1210 is NxN, the size of the upper adjacent block and the upper left adjacent block may each be aNxbN, and the size of the neighboring block 1230 may be 2aNxbN. Here, a and b may each be a real number.

또한, 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1230)은 각각 기정의된 크기 또는 기정의된 방식에 의해 결정된 크기를 가질 수 있다.Also, each of the top adjacent block, the upper left adjacent block, and the neighboring block 1230 may 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, upper left adjacent blocks, and neighboring blocks of the same size. The encoding device 800 may set the size of each of the top adjacent block, the upper left adjacent block, and the neighboring block 1230 . The size of the top adjacent block, the size of the top left adjacent block, and the size of the neighboring block 1230 may also be used in the decoding apparatus 2300 as well. The set size may be transmitted from the encoding device 800 to the decoding device 2300 through a bitstream.

참조 샘플의 갱신은 인트라 예측을 위한 현재 블록의 주변의 참조 샘플의 복원으로 간주될 수 있다.The update of the reference sample may be regarded as restoration of reference samples around 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 composed of a texture having a direction similar to that of the second neighboring block according to spatial correlation. To reflect this direction, the intra predictor 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 according to the directionality 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 predictor 120 may detect the gradient pattern of the second neighboring block and calculate the gradient. A gradient pattern detection method 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 with reference to FIG. 9A and step 1022 described with reference to FIG. 10B , the intra predictor 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 prediction unit 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 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 주변 블록의 경사 패턴에 기반하여 참조 샘플의 값을 결정 또는 갱신할 수 있다.In addition, in steps 915 and 1022, the intra predictor 120 may determine or update a value of a reference sample based on neighboring blocks of the current block. The intra predictor 120 may determine or update a value of a reference sample based on a gradient pattern of a second neighboring block.

인트라 예측부(120)에 의해 참조 샘플의 값은 갱신 전의 값으로부터 갱신 후의 값으로 변경될 수 있고, 참조 샘플의 갱신 전의 값은 참조 샘플을 포함하는 참조 샘플 블록(1220)이 예측 및 복원됨에 따라 생성된 값일 수 있다. 말하자면, 참조 샘플 블록(1220)이 예측 및 복원되면서, 참조 샘플의 값이 결정될 수 있고, 결정된 값이 참조 샘플의 갱신에 있어서 갱신 전의 값으로 사용될 수 있다. 참조 샘플의 예측 및 복원에 있어서는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 및 복원 방법이 사용될 수 있다.The value of the reference sample may be changed from a value before update to a value after update by the intra predictor 120, and the value before update of the reference sample may be a value generated by predicting and restoring the reference sample block 1220 including the reference sample. In other words, 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 update in updating the reference sample. Prediction and reconstruction methods of existing video encoding and/or decoding technologies such as HEVC and AVC may be used to predict and restore reference samples.

경사도 ∇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 manner shown in Equation 2 below.

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 updating of the topmost sample among the reference samples 1221 . I 'may be a value after updating of the topmost sample. J , K , and L may also be pre-update values of corresponding reference samples. J ', K ', and L ' may be values after update of corresponding reference samples.

수학식 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 reflects a subtraction according to a gradient with respect to existing reference samples I , J , K and L , thereby reconstructed reference samples I ', J ', K 'and L 'can be generated. 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 subtracting the product of the value determined based on the gradient ∇ dx and the predefined weight factor w from the value of the reference sample before updating. Through updating, the value of the reference sample can be reduced by w * f (∇ dx ).

참조 샘플은 복수일 수 있다. 가중치 팩터 w는 복수의 참조 샘플들에게 동일할 수 있다. 또는, 가중치 팩터 w는 복수의 참조 샘플들의 각각에 대해 서로 상이할 수 있다. 예를 들면, 가중치 펙터 w는 복수의 참조 샘플들의 각 참조 샘플에 대하여, 각 참조 샘플의 위치 별로 상이할 수 있다. 참조 샘플의 위치는 현재 블록(1210)에 대한 상대적인 위치일 수 있다.Reference samples may be plural. A 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 position of each reference sample of a plurality of reference samples. 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 aforementioned reference sample update method and the existing method. For example, when the intra prediction unit 120 performs updating of the reference sample described above with reference to FIG. 10A, in step 1010, padding of the reference pixel may not be performed. In addition, when the intra prediction unit 120 performs updating of the reference sample described above with reference to FIG. 10A, in step 1010, smoothing using a low pass filter may not be performed.

도 13는 일 예에 따른 경사 패턴을 구하는 방법을 설명한다.13 illustrates a method of obtaining an inclination 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 predictor 120 may select, as a second neighboring block, a block at a predefined position according to an intra prediction mode among blocks reconstructed based on the position of the current block. Also, the intra predictor 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 device 800 may set the size of the second neighboring block. The set size may also be used in the decryption device 2300 as well. The set size may be transmitted from the encoding device 800 to the decoding device 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 shown. A line may be a row or column of neighboring blocks. In FIG. 12, the size of the second neighboring block is shown as 8x4, and in FIG. 13, one line of the second neighboring block is shown as 8x1.

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

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

인트라 예측부(120)는 하나 이상의 샘플 경사도들에 기반하여 라인 경사도를 계산할 수 있다. 예를 들면, 라인 경사도는 1) 하나 이상의 샘플 경사도들의 중간 값, 2) 하나 이상의 샘플 경사도들의 평균 값 또는 3) 하나 이상의 샘플 경사도들의 기정의된 대표 값일 수 있다.The intra prediction unit 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 can always be positive.

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

dx는 라인 경사도를 나타낼 수 있다.dx can represent the slope of the line.

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

전술된 방식을 통해, 인트라 예측부(120)는 제2 주변 블록의 하나 이상의 라인들의 하나 이상의 라인 경사도들을 계산할 수 있다.Through the above-described method, the intra predictor 120 may calculate one or more line gradients 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, the intra predictor 120 may apply a weight for each line gradient to one or more line gradients when calculating the gradient of the second neighboring block.

계산된 제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 sample gradients of a line increase and then decrease, the updated reference samples I', J', K', and L' may be obtained by subtracting the line gradient of the line from each of I, J, K, and L previously generated as reference samples 1221 of the current block 1210 of FIG. 12.

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

또는, 인트라 예측부(120)는 하나의 라인의 라인 경사도를 상기의 라인에 대응하는 참조 샘플의 경사도로서 사용할 수 있다. 예를 들면, 상대적인 위치가 동일한 라인 및 참조 샘플은 서로 대응할 수 있다. 예를 들면, 인트라 예측부(120)는 하나 이상의 라인들 중 최상단의 라인의 라인 경사도를 하나 이상의 참조 샘플들 중 최상단의 참조 샘플의 갱신을 위해 사용할 수 있다. 또는, 인트라 예측부(120)는 하나 이상의 라인들 중 현재 블록(1210)에 인접한 라인의 라인 경사도를 참조 샘플의 갱신을 위해 사용할 수 있다.Alternatively, the intra prediction unit 120 may use the line gradient of one line as the gradient of a reference sample corresponding to the line. For example, lines and reference samples having the same relative positions may correspond to each other. For example, the intra prediction unit 120 may use a line gradient of a topmost line among one or more lines to update a topmost reference sample among one or more reference samples. Alternatively, the intra predictor 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 predictor 120 may select only some line(s) from among all lines of the second neighboring block. The intra predictor 120 may calculate the gradient of the second neighboring block using the line gradient(s) of the selected partial line(s). The intra predictor 120 may select line(s) at a predefined position(s) or a predefined number of line(s) from among all lines of the second neighboring block. The intra predictor 120 may set a method of selecting only some line(s) from among all lines of the second neighboring block. The set method may be transmitted from the encoding device 800 to the decoding device 2300 through a bitstream.

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

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

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

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

예를 들면, 현재 블록의 특성은 현재 블록의 크기일 수 있다. 인트라 예측부(120)는 현재 블록의 크기에 따라 서로 상이한 방식들을 사용하여 현재 블록의 전체의 참조 샘플들 중 갱신을 적용할 일부의 참조 샘플(들)을 선택할 수 있다.For example, the property of the current block may be the size of the current block. The intra predictor 120 may select some reference sample(s) to be updated 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 the case where the size of the current block is relatively large, such as 16x16 and 32x32, the larger the size of the current block, the greater the number of reference samples of the current block. When the number of reference samples increases, the degree of correlation with respect to the gradient pattern according to the directionality 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 for selecting some of the reference sample(s) to be updated from among the reference samples and the number of some of the reference sample(s) to be updated from among the reference samples may be transmitted from the encoding device 800 to the decoding device 2300 through a bitstream.

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

도 14에서 원은 샘플(또는, 픽셀)을 나타낼 수 있다. 점선의 사각형은 블록을 나타낼 수 있다. In FIG. 14 , circles may represent samples (or pixels). A dotted line 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 neighboring blocks 1430 are illustrated.

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

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

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

주변 블록(1430) 내의 점선은 주변 블록(1430) 내의 픽셀들의 수직 라인을 나타낼 수 있다. 주변 블록(1430) 내의 굵은 실선은 수직 라인에 포함되는 샘플들의 경사도를 나타낼 수 있다. ∇dx는 경사도 값을 나타낼 수 있다.Dotted lines in the neighboring block 1430 may represent vertical lines of pixels in the neighboring block 1430 . Thick solid lines in the neighboring block 1430 may represent gradients of samples included in the vertical line. ∇ dx can represent the slope value.

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

주변 블록(1430)은 현재 블록(1410)에 대한 부호화 및/또는 복호화 이전에 이미 복원이 완료된 블록일 수 있다.The neighboring block 1430 may be a block for which reconstruction has already been completed 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 the 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 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.

예를 들면, 인트라 예측 모드가 수직 예측 모드인 경우, 참조 샘플은 현재 블록(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 combining the left side block of the current block 1410 and the upper left adjacent block of the current block 1410 . A block adjacent to the left of the current block 1410 may be a block adjacent to the left of the current block 1410 . The block adjacent to the top left of the current block 1410 may be a block adjacent to the top 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 adjacent block and the upper left adjacent block may be NxN, respectively, 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는 각각 실수일 수 있다.In addition, when the size of the current block 1410 is NxN, the size of the top adjacent block and the upper left adjacent block may each be aNxbN, and the size of the neighboring block 1430 may be aNx2bN. Here, a and b may each be a real number.

또한, 상단 인접 블록, 좌측 상단 인접 블록 및 주변 블록(1430)은 각각 기정의된 크기 또는 기정의된 방식에 의해 결정된 크기를 가질 수 있다.Also, each of the top adjacent block, the upper left adjacent block, and the neighboring block 1430 may 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, upper left adjacent blocks, and neighboring blocks of the same size. The encoding apparatus 800 may set the size of each of the top adjacent block, the upper left adjacent block, and the neighboring block 1430 . The size of the top adjacent block, the size of the top left adjacent block, and the size of the neighboring block 1430 may also be used in the decoding apparatus 2300 as well. The set size may be transmitted from the encoding device 800 to the decoding device 2300 through a bitstream.

참조 샘플의 갱신은 인트라 예측을 위한 현재 블록의 주변의 참조 샘플의 복원으로 간주될 수 있다.The update of the reference sample may be regarded as restoration of reference samples around 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 composed of a texture having a direction similar to that of the second neighboring block according to spatial correlation. To reflect this direction, the intra predictor 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 predictor 120 may update the reference sample to be similar to the sample of the current block by using the gradient pattern according to the direction 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 predictor 120 may detect the gradient pattern of the second neighboring block and calculate the 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 with reference to FIG. 9A and step 1022 described with reference to FIG. 10B , the intra predictor 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 the 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 row 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 predictor 120 may determine a gradient of a column adjacent to the current block 1410 among columns of the second neighboring block as a final gradient of the second neighboring block.

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

인트라 예측부(120)에 의해 참조 샘플의 값은 갱신 전의 값으로부터 갱신 후의 값으로 변경될 수 있고, 참조 샘플의 갱신 전의 값은 참조 샘플을 포함하는 참조 샘플 블록(1420)이 예측 및 복원됨에 따라 생성된 값일 수 있다. 말하자면, 참조 샘플 블록(1420)이 예측 및 복원되면서, 참조 샘플의 값이 결정될 수 있고, 결정된 값이 참조 샘플의 갱신에 있어서 갱신 전의 값으로 사용될 수 있다. 참조 샘플의 예측 및 복원에 있어서는 HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 및 복원 방법이 사용될 수 있다.The value of the reference sample may be changed from a value before update to a value after update by the intra predictor 120, and the value of the reference sample before update may be a value generated by predicting and restoring the reference sample block 1420 including the reference sample. In other words, 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 update in updating the reference sample. Prediction and reconstruction methods of existing video encoding and/or decoding technologies such as HEVC and AVC may be used to predict and restore reference samples.

경사도 ∇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 predictor 120 may determine or update the value of the reference sample in the manner shown in Equation 3 below.

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 updating of the topmost sample among the reference samples 1421 . A 'may be a value after updating of the topmost sample. B , C , and D may also be pre-update values of corresponding reference samples. B ', C ', and D ' may be post-update values of corresponding reference samples.

수학식 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 reflects a subtraction according to a gradient with respect to existing reference samples A , B, C , and D , thereby reconstructed reference samples A ', B ', C 'and D ' can be generated. 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 the product of the value determined based on the gradient ∇ dx and the predefined weight factor w to the value before the update of the reference sample. Through updating, the value of the reference sample may increase by w * f (∇ dx ).

참조 샘플은 복수일 수 있다. 가중치 팩터 w는 복수의 참조 샘플들에게 동일할 수 있다. 또는, 가중치 팩터 w는 복수의 참조 샘플들의 각각에 대해 서로 상이할 수 있다. 예를 들면, 가중치 펙터 w는 복수의 참조 샘플들의 각 참조 샘플에 대하여, 각 참조 샘플의 위치 별로 상이할 수 있다. 참조 샘플의 위치는 현재 블록(1410)에 대한 상대적인 위치일 수 있다.Reference samples may be plural. A 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 position of each reference sample of a plurality of reference samples. 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 aforementioned reference sample update method and the existing method. For example, when the intra prediction unit 120 performs updating of the reference sample described above with reference to FIG. 10A, in step 1010, padding of the reference pixel may not be performed. In addition, when the intra prediction unit 120 performs updating of the reference sample described above with reference to FIG. 10A , smoothing using a low-frequency filter may not be performed in step 1010 .

경사 패턴의 타입들Types of Oblique Patterns

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

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

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

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

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

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

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

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

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

인트라 예측부(120)는 현재 블록의 제2 주변 블록의 경사 패턴의 타입에 따라 참조 샘플의 값을 결정할 수 있다. 예를 들면, 경사 패턴이 "증가", "감소", "증가 및 포화", "감소 및 포화", "포화 및 증가" 및 "포화 및 감소" 중 하나인 경우, 인트라 예측부(120)는 "증가"의 라인의 경사도 값 또는 "감소"의 라인의 경사도 값에 기반하여 참조 샘플의 값을 결정할 수 있다.The intra predictor 120 may determine a reference sample value 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 saturation”, “decrease and saturation”, “saturation and increase”, and “saturation and decrease”, the intra prediction unit 120 may determine the value of the reference sample based on the gradient value of the “increase” line or the gradient value of the “decrease” line.

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

경사 패턴을 검출하기 위한 부호화 파라미터의 사용Use of Coding 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 predictor 120 may detect a gradient pattern using an encoding parameter. For example, the encoding parameters may include 1) syntax predefined in relation to intra prediction, 2) encoding variables, 3) current encoding unit, 4) prediction unit, 5) size of the transform unit, and 6) whether or not the encoding unit is split. For example, the intra predictor 120 may determine a value related to a neighboring block using an 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 . A value related to a neighboring block may include a size of the neighboring block. The intra predictor 120 may determine a gradient of a neighboring block using an encoding parameter. The intra prediction unit 120 may determine a range of reference samples to which an update is applied using an encoding parameter. Also, the intra predictor 120 may determine a weight factor using an encoding parameter.

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

인트라 예측부(120)는 주변 블록의 경사도를, 참조 샘플이 아닌, 예측 블록의 픽셀 값에 적용할 수 있다. 인트라 예측부(120)는 참조 샘플의 값을 고정시킬 수 있고, 주변 블록의 경사도를 사용하여 예측 블록의 픽셀 값을 갱신할 수 있다. 예측 블록의 픽셀 값을 직접적으로 갱신함에 따라, 참조 샘플의 값을 갱신하였을 때와 동일한 효과가 획득될 수 있다.The intra predictor 120 may apply the gradient of a neighboring block to a pixel value of a prediction block rather than to a reference sample. The intra predictor 120 may fix a value of a reference sample and update a pixel value of a prediction block using a gradient of a neighboring block. By directly updating the pixel value of the prediction block, the same effect as when updating the value of the reference sample 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, updates made to one row of reference samples may be equally applied to each row of a plurality of rows of a prediction block. Alternatively, for example, updates made to reference samples of one column may be equally applied to each column of a plurality of columns of the prediction block. For the update of the prediction block of the intra predictor 120, the encoding parameter can be used in the same manner as used for the update of the reference sample. In other words, the intra predictor 120 may update a pixel value of a prediction block based on an 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 with reference to FIG. 9A and step 1030 described with reference to FIG. 10A , the intra prediction unit 120 may generate a prediction block of the current block by performing intra prediction on the current block. In performing intra prediction on the current block, the intra predictor 120 may use updated (or reconstructed) reference sample(s). The intra predictor 120 may generate a prediction block of the current block using the updated (or reconstructed) reference sample(s).

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

인트라 예측부(120)는 하나 이상의 예측 블록들에 대해서 최소의 율-왜곡 값을 갖는 예측 블록을 결정할 수 있다. 인트라 예측부(120)는 예측 블록에 대응하는 인트라 모드를 최종적인 인트라 예측 모드로 선택할 수 있다. 또는, 인트라 예측부(120)는 하나 이상의 인트라 모드들 중 최소의 율-왜곡 값을 갖는 예측 블록을 생성하는 인트라 모드를 최종적인 인트라 예측 모드로 선택할 수 있다.The intra predictor 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 an intra mode corresponding to a prediction block as a final intra prediction mode. Alternatively, the intra predictor 120 may select an intra mode that generates a prediction block having a minimum rate-distortion value among one or more intra modes as a 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 indicate a planer mode. Mode 1 may indicate 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 a neighboring block. The current block reference sample 1632 may be a reference sample used when performing intra prediction on the current block.

주변 블록 참조 샘플(1631)의 샘플 값은 주변 블록(1620)에 대하여 단계(915) 및 단계(1022)의 참조 샘플의 갱신이 수행되었을 때의 갱신된 값일 수 있다.The sample value of the neighboring block reference sample 1631 may be an updated value when 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 may indicate relative positions when both the intra prediction mode of the neighboring block 1620 and the intra prediction mode of the current block 1610 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 adjacent block of the current block. The reference sample of the current block may be the pixel(s) in the 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 an upper end 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 shown. In FIG. 17, the intra neighboring block_residual signal, which is the residual signal of the neighboring block, is explained in the form of a matrix equation.

주변 블록(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 , a residual signal 1730 may be a difference between a neighboring block 1710 and a 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)에 대한 인트라 예측 모드에 기반하여 결정될 수 있다.A value of the prediction block 1720 may be determined based on an 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, values of each row of the prediction block 1720 may be values of reference pixels of the neighboring block 1710. In other words, 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 an upper end 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, values of each column of the prediction block 1720 may be values of reference pixels of the neighboring block 1710. In other words, 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, prediction block generation methods of existing video encoding and/or decoding technologies, 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 현재블록_잔차신호가 행렬 식의 형태로 설명되었다.In FIG. 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, Intra current block_residual signal, which is the residual signal of the current block, is explained in the form of a matrix equation.

현재 블록(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)을 뺀 결과일 수 있다.As shown in FIG. 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 the 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 sum of the levels of the residual signal 1830 is 560.

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

예를 들면, 도 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, values of each row of the prediction block 1820 may be values of reference pixels of neighboring blocks. In other words, when the intra prediction mode of the current block 1810 is the vertical prediction mode, values of each row of the prediction block 1820 may be values of pixels in a horizontal line adjacent to an upper end 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, values of each column of the prediction block 1820 may be values of reference pixels of neighboring blocks. In other words, when the intra prediction mode of the current block 1810 is the horizontal prediction mode, 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 may correspond to the generation of the second residual signal of the current block in step 940 described above with reference to FIG. 9A and step 1045 described above with reference to FIG. 10C.

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

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

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

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

도 19은, 도 9의 단계(950) 및 도 10의 단계(1042)의 잔차 신호 예측을 나타낼 수 있다.19 may show residual signal prediction in 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 neighboring blocks. Alternatively, the prediction residual signal 1930 may be a result of subtracting the residual signal 1920 of the 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 sum of the levels of the prediction residual signal 1930 is 267. By the residual signal prediction, the final sum level of the residual signal of the current block is reduced from 560 to 269. Reduction of the final sum of levels of the residual signal by residual signal prediction may indicate that energy of the residual signal itself used for encoding 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 bitstream capacity 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 the 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 shows a result of discrete cosine transformation on a default residual signal according to an example.

도 20b에서는, 도 20a의 디폴트 잔차 신호에 대한 이산 여현 변환(discrete cosine transform)의 결과가 도시되었다.In FIG. 20B, a result of discrete cosine transform for 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 a result of discrete cosine transformation on the proposed residual signal according to an example.

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

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

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

도 16에서는, 주변 블록(1620)이 현재 블록(1610)의 좌측에 인접한 것으로 도시되었다. 도 16에서는, 좌측 인접 블록을 사용하여 잔차 신호 예측이 수행된 경우가 설명되었다. 그러나, 도 9a 및 도 10c를 참조하여 전술된 제1 주변 블록의 위치는 현재 블록(1610)의 좌측으로 한정되지 않을 수 있다.In FIG. 16 , a neighboring block 1620 is shown adjacent to the left side of the current block 1610 . In FIG. 16, the case where residual signal prediction is performed using the left adjacent block has been described. However, the location 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 step 935 of FIG. 9 and step 1043 of FIG. 10 , the intra residual predictor 810 may determine a first neighboring block 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 among one or more previously reconstructed neighboring blocks of the current block.

복수 개의 주변 블록들 중 제1 주변 블록을 결정함에 따라, 인트라 잔차 예측부(810)는 잔차 신호에 대한 제1 주변 블록의 공간적 상관도를 향상시킬 수 있다.As the first neighboring block is determined among the plurality of neighboring blocks, the intra residual predictor 810 may improve 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, a lower left adjacent block A 0 (2221), a left adjacent block A 1 (2222), an upper right adjacent block B 1 (2223), a right adjacent block B 2 (2224), and an upper left adjacent block B 3 (2225) are shown. As shown, one or more neighboring blocks of the current block may include a lower left adjacent block, a left adjacent block, an upper right adjacent block, a right adjacent block, and an upper left adjacent block. One or more neighboring blocks of the current block are not limited to the blocks at the positions illustrated in FIG. 22 .

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

단계(935) 또는 단계(1043)의 반복을 통해, 인트라 잔차 예측부(810)는 현재 블록의 복수의 주변 블록들을 차례로 제1 블록으로서 선택할 수 있다.Through repetition of step 935 or step 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 step 950 or step 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 among a plurality of first residual signals, and may determine a neighboring block corresponding to the minimum rate-distortion residual signal as a first neighboring block used for residual signal prediction of the current block.

단계(940)는 단계(950)가 반복됨에 따라 함께 반복될 수도 있고, 1회만 수행될 수도 있다. 단계(1044)는 단계(1055)가 반복됨에 따라 함께 반복될 수도 있고, 1회만 수행될 수도 있다.Step 940 may be repeated as step 950 is repeated, or may be performed only once. Step 1044 may be repeated 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. In addition, 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 decryption device according to an embodiment.

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

엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽처 버퍼(270)는 도 2를 참조하여 전술된 것과 같은 기능 및/또는 동작을 수행할 수 있다. 중복되는 설명은 생략한다.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 270 may perform the same functions and/or operations as described above with reference to FIG. Redundant descriptions are omitted.

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

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

이하에서, 현재 블록은 현재 복호화의 대상인 블록일 수 있고, 현재 영상 내의 블록일 수 있다.Hereinafter, the current block may be a block currently being decoded or may be a block within 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) 중 적어도 하나에 의해 수행될 수 있다.Step 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 step 2411 , step 2412 and step 2413 .

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

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

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

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

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

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

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

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

인트라 예측부(240)는 도 9a 및 도 10b를 참조하여 전술된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다. 부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 포함할 수 있다. 참조 샘플의 갱신의 수행의 여부를 나타내는 정보는 비트스트림 내에서 부호화될 수 있다.The intra predictor 240 may determine whether or not 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. A bitstream transmitted from the encoding device 800 to the decoding device 2300 may include information indicating whether or not updating of reference samples is performed. Information indicating whether updating of reference samples is performed may be encoded in the bitstream.

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

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

도 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 this embodiment. In the embodiments described above with reference to FIGS. 12, 13, and 14, the function and / or operation described as being performed by the intra prediction unit 120 of the encoding apparatus 800 may be performed by the intra prediction unit 240 of the decoding apparatus 2300. In addition, the 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 . Redundant descriptions are omitted.

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

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

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

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

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

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

인트라 예측부(240)는 부호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 복호화할 수 있다. 인트라 예측부(240)는 복호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행하지 않을 수 있다.The intra predictor 240 may decode information indicating whether prediction of the coded residual signal is performed. The intra predictor 240 may determine whether or not to perform prediction of the decoded residual signal using information indicating whether to perform prediction of the decoded residual signal. 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 predictor 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 residual signal prediction and may be a block located in the vicinity of the current block. The information 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 device 800 to the decoding device 2300 may include an identifier of the first neighboring block. The identifier of the first neighboring block may be encoded within the bitstream.

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

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

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

주변 블록의 위치 및 개수는 부호화 파라미터에 따라 정의될 수 있다.The location 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 device 800 and the decoding device 2300. For example, in relation to the identifier of the first neighboring block, the block size N and the location of the neighboring blocks may 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 may be entropy-decoded using a “(neighboring-residual_index) truncated unary ((neighboring-residual_idx) truncated unary)” method.

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

단계(2460)에서, 인트라 잔차 예측부(2310)는 현재 블록의 복원 블록을 생성할 수 있다.In step 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 step 2460 may be a residual signal generated by residual signal prediction in the encoding apparatus 800 . In other words, the residual signal of the current block used in step 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 decoding the current block. Accordingly, the residual signal of the first neighboring block may have already been obtained by the intra residual predictor 2310 before decoding the current block.

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

복원 블록은 1) 예측 블록, 2) 현재 블록의 잔차 신호 및 3) 제1 주변 블록의 잔차 신호의 합일 수 있다. 예측 블록은 인트라 예측 모드에 따라서 획득될 수 있다. 현재 블록의 잔차 신호는 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다. 제1 주변 블록의 잔차 신호는 잔차 신호 예측에 의해 획득될 수 있다. 예를 들면, 잔차 신호 예측이 수행되지 않는 경우, 제1 주변 블록의 잔차 신호는 0으로 된 신호일 수 있다.The reconstructed block may be the sum of 1) the prediction block, 2) the residual signal of the current block, and 3) the residual signal of the first neighboring block. A prediction block may be obtained according to an intra prediction mode. The residual signal of the current block may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300. A 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 predictor 2310 generates the residual signal of the first neighboring block according to the residual signal prediction, the intra predictor 240 may generate a reconstructed block of the current block by summing the prediction block of the current block, the residual signal of the current block, and the residual signals of the neighboring blocks.

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

단계(2490)에서, 인트라 예측부(240) 또는 인트라 잔차 예측부(2310)는 예측 블록 및 현재 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다.In operation 2490, the intra predictor 240 or the intra residual predictor 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 step 2490 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 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 existing video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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 within 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 step 2411 , step 2412 and step 2413 .

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

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

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

단계(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 exemplary embodiment.

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

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

단계(2530)에서, 인트라 예측부(240)는 부호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 복호화할 수 있다.In operation 2530, the intra predictor 240 may decode information indicating whether prediction of the coded 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 representing whether or not residual signal prediction is performed may be coded within the bitstream.

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

부호화 장치(800)로부터 복호화 장치(2300)로 전송된 비트스트림은 제1 주변 블록의 식별자를 포함할 수 있다. 제1 주변 블록의 식별자는 비트스트림 내에서 부호화될 수 있다.The bitstream transmitted from the encoding device 800 to the decoding device 2300 may include an identifier of the first neighboring block. The identifier of the first neighboring block may be encoded within 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 predictor 240 and the intra residual predictor 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 to be described later with reference to FIG. 25D.

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

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

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

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

인트라 예측부(240)는 도 9a 및 도 10b를 참조하여 전술된 참조 샘플의 갱신의 수행의 여부를 나타내는 정보를 사용하여 참조 샘플의 갱신의 수행의 여부를 결정할 수 있다.The intra predictor 240 may determine whether or not 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 or not to update the reference sample by using information indicating whether or not to update the decoded reference sample. If the above information indicates that the reference sample is updated, the intra predictor 240 may update the reference sample. If the above information indicates that the reference sample is not updated, the intra predictor 240 may not update 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 a reference sample update, step 2564 may be performed.

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

도 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 this embodiment. In the embodiments described above with reference to FIGS. 12, 13, and 14, the function and / or operation described as being performed by the intra prediction unit 120 of the encoding apparatus 800 may be performed by the intra prediction unit 240 of the decoding apparatus 2300. In addition, the function and/or operation 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 . Redundant descriptions are omitted.

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

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

예를 들면, 예측 블록의 생성에 있어서, HEVC 및 AVC 등과 같은 기존의 영상 부호화 및/또는 복호화 기술의 예측 블록 생성 방법이 사용될 수 있다.For example, in generating a prediction block, a prediction block generation method of an existing video 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 recovery block generation method according to an embodiment.

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

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

인트라 예측부(240)는 복호화된 잔차 신호 예측의 수행의 여부를 나타내는 정보를 사용하여 잔차 신호 예측의 수행의 여부를 결정할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행할 수 있다. 상기의 정보가 잔차 신호 예측을 수행하지 않는 것을 나타내면, 인트라 예측부(240)는 잔차 신호 예측을 수행하지 않을 수 있다.The intra predictor 240 may determine whether or not to perform prediction of the decoded residual signal using information indicating whether to perform prediction of the decoded residual signal. 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 predictor 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 step 2572, the intra residual predictor 2310 may identify a first neighboring block. The first neighboring block may be a block used for residual signal prediction and may be a block located in the vicinity of the current block. The information 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 using the decoded identifier of the first neighboring block.

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

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

주변 블록의 위치 및 개수는 부호화 파라미터에 따라 정의될 수 있다.The location 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 device 800 and the decoding device 2300. For example, in relation to the identifier of the first neighboring block, the block size N and the location of the neighboring blocks may 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 may be entropy-decoded using a “(neighboring-residual_index) truncated unary ((neighboring-residual_idx) truncated unary)” method.

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

단계(2573)에서, 인트라 잔차 예측부(2310)는 현재 블록의 복원 블록을 생성할 수 있다.In step 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 step 2573 may be a residual signal generated by residual signal prediction 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 decoding the current block. Accordingly, the residual signal of the first neighboring block may have already been obtained by the intra residual predictor 2310 before decoding the current block.

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

복원 블록은 1) 예측 블록, 2) 현재 블록의 잔차 신호 및 3) 제1 주변 블록의 잔차 신호의 합일 수 있다. 예측 블록은 인트라 예측 모드에 따라서 획득될 수 있다. 현재 블록의 잔차 신호는 부호화 장치(800)로부터 복호화 장치(2300)로 전송될 수 있다. 제1 주변 블록의 잔차 신호는 잔차 신호 예측에 의해 획득될 수 있다. 예를 들면, 잔차 신호 예측이 수행되지 않는 경우, 제1 주변 블록의 잔차 신호는 0으로 된 신호일 수 있다.The reconstructed block may be the sum of 1) the prediction block, 2) the residual signal of the current block, and 3) the residual signal of the first neighboring block. A prediction block may be obtained according to an intra prediction mode. The residual signal of the current block may be transmitted from the encoding apparatus 800 to the decoding apparatus 2300. A 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 predictor 2310 generates the residual signal of the first neighboring block according to the residual signal prediction, the intra predictor 240 may generate a reconstructed block of the current block by summing the prediction block of the current block, the residual signal of the current block, and the residual signals of the neighboring blocks.

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

단계(2574)에서, 인트라 예측부(240) 또는 인트라 잔차 예측부(2310)는 예측 블록 및 현재 블록의 잔차 신호에 기반하여 현재 블록의 복원 블록을 생성할 수 있다.In operation 2574, the intra predictor 240 or the intra residual predictor 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 step 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 existing video encoding and/or decoding technologies such as HEVC and AVC. For example, in generating the third residual signal, a residual signal generation method of an existing video encoding and/or decoding technology 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 to be performed and 2) an identifier of a first neighboring block used for residual signal prediction of a current block. In other words, the above information and the above identifier may be explicitly transmitted to the decoding apparatus 2300 by the encoding apparatus 800.

반면, 상기의 정보를 위해 요구되는 비트 량을 감소시키기 위해 기정의된 조건이 충족되는 경우, 1) 잔차 신호 예측의 수행의 여부를 나타내는 정보가 생략될 수 있다. 상기의 정보가 생략되었더라도, 복호화 장치(2300)는 기정의된 조건이 충족될 경우 상기의 정보를 도출할 수 있다. 말하자면, 상기의 정보는 묵시적으로 전송될 수 있다.On the other hand, if a condition predefined for reducing the amount of bits required for the above information is met, 1) information indicating whether or not 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. In other words, the above information can be transmitted implicitly.

또한, 상기의 식별자를 위해 요구되는 비트 량을 감소시키기 위해 기정의된 조건이 충족되는 경우, 2) 현재 블록의 잔차 신호 예측을 위해 사용되는 제1 주변 블록의 식별자가 생략될 수 있다. 상기의 정보가 생략되었더라도, 복호화 장치(2300)는 기정의된 조건이 충족될 경우 상기의 식별자를 도출할 수 있다. 말하자면, 상기의 식별자는 명시적으로 전송될 수 있다.In addition, when a predefined condition for reducing the amount of bits required for the identifier is satisfied, 2) the identifier of the first neighboring block used for predicting the residual signal of the current block may be omitted. Even if the above information is omitted, the decoding device 2300 may derive the above identifier when a predefined condition is satisfied. That is to say, the above identifier may be sent 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 predictor 810 determines to perform residual signal prediction on the current block. 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, in steps 935 and 1043, when a predefined condition is satisfied, 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 predictor 810 may selectively encode information indicating whether residual signal prediction is to be performed. Alternatively, when a predefined condition is satisfied, the intra residual predictor 810 may omit encoding of information indicating whether or not residual signal prediction is performed.

단계(985) 및 단계(1048)에서, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자를 선택적으로 부호화할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(810)는 제1 주변 블록의 식별자의 부호화를 생략할 수 있다.In operations 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 coding of the identifier of the first neighboring block.

도 24b를 참조하여 전술된 단계(2440)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행할 것을 결정할 수 있다. 또는, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행하지 않을 것을 결정할 수 있다. 예를 들면, 잔차 신호 예측의 여부를 나타내는 정보가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 잔차 신호 예측을 수행할 것을 결정할 수 있다.In step 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 there is no information indicating whether residual signal prediction is performed, the intra residual predictor 2310 may determine to perform residual signal prediction.

또한, 단계(2445)에서, 기정의된 조건이 충족될 경우, 인트라 잔차 예측부(2310)는 기정의된 방식에 따라서 선택된 블록을 제1 주변 블록으로 식별할 수 있다. 예를 들면, 제1 주변 블록의 식별자가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 기정의된 방식에 따라서 선택된 블록을 제1 주변 블록으로 식별할 수 있다.In addition, in operation 2445, when a predefined condition is satisfied, the intra residual predictor 2310 may identify the selected block as a 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 can be expected in predicting the residual signal. Accordingly, 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, residual signal prediction of the current block may be performed on 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 , 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 predictor 810 may determine to perform residual signal prediction on the current block. For example, when the MPM flag has a value of true (or “1”), the intra residual predictor 2310 may detect that a block having the same intra prediction mode as that of the current block exists in the vicinity of the current block, and may determine 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 blocks having the same intra prediction mode as the intra prediction mode of the current block exist in the vicinity of the current block, the intra residual predictor 810 may determine the block having the same intra prediction mode as the 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 predictor 810 may determine a block selected according to a predefined priority among the plurality of blocks as the first neighboring 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 predictor 810 may omit encoding of information indicating whether or not residual signal prediction is performed.

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

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

또한, 단계(2445)에서, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하는 경우, 인트라 잔차 예측부(2310)는 상기의 동일한 인트라 예측 모드를 갖는 블록을 제1 주변 블록으로 식별할 수 있다. 또는, 재1 블록의 식별자가 존재하지 않는 경우, 인트라 잔차 예측부(2310)는 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 블록이 존재하면 상기의 동일한 인트라 예측 모드를 갖는 블록을 제1 주변 블록으로 식별할 수 있다. 또는, 제1 블록의 식별자가 존재하지 않고, 현재 블록의 주변에 현재 블록의 인트라 예측 모드와 동일한 인트라 예측 모드를 갖는 복수의 블록들이 존재하는 경우, 인트라 잔차 예측부(810)는 복수의 블록들 중 기정의된 우선 순위에 따라 선택된 블록을 제1 주변 블록으로 결정할 수 있다.In addition, in step 2445, if blocks having the same intra prediction mode as the intra prediction mode of the current block exist in the vicinity of the current block, the intra residual predictor 2310 may identify the block having the same intra prediction mode as the first neighboring block. Alternatively, when the identifier of the first block does not exist, the intra residual predictor 2310 may identify the block having the same intra prediction mode as the first neighboring block if there are blocks having the same intra prediction mode as the intra prediction mode of the current block in the vicinity of the current 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 predictor 810 may determine a block selected according to a predefined priority among the plurality of blocks as the first neighboring block.

인트라 예측이 수행될 경우, 인트라 예측 모드는 가장 개연성 있는 모드(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 can be entropy encoded by the MPM flag and the MPM index. MPM can represent all three intra prediction modes. Intra prediction modes represented by MPM are called MPM candidate modes. The intra prediction unit 240 may identify MPM candidate modes through prediction blocks in a picture around 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 the three intra prediction modes identified by 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 device 800 may transmit the MPM index to the decoding device 2300. The MPM index may indicate which mode among MPM candidate modes is an intra prediction mode of the current block.

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

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

단계(2420)에서, 인트라 예측부(240)는 기정의된 단의 별로 참조 샘플의 갱신의 수행 여부를 결정할 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.In step 2420, the intra predictor 240 may determine whether or not to update reference samples 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 or not to update a reference sample. The reference sample update information may be information indicating whether the update of the reference sample is performed for 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 encoded residual signal prediction information in a bitstream. The decoding apparatus 2300 may determine whether to perform residual signal prediction on the current block using residual signal prediction information.

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

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

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

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 참조 샘플의 갱신의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트(segment) 헤더는 참조 샘플 갱신 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 참조 샘플 갱신 정보가 참조 샘플의 갱신이 수행됨을 나타내면, 인트라 예측부(240)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 방향성에 따른 경사도가 적용된 참조 샘플을 사용하는 인트라 예측을 수행할 수 있다.3) Slice: One image can 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 updated, the intra prediction unit 240 may perform intra prediction using a reference sample to which a gradient according to a direction is applied for a slice corresponding to the slice segment header.

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

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

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

단계(2440)에서, 인트라 잔차 예측부(2310)는 기정의된 단위 별로 잔차 신호 예측의 수행 여부를 결정할 수 있다. 기정의된 단위는, 1) 영상 시퀀스 전체(즉, 비디오), 2) 하나의 영상(즉, 픽처), 3) 슬라이스, 4) 코딩 유닛 중 적어도 하나일 수 있다.In step 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 for a predefined unit. For example, when the value of the residual signal prediction information is the first value, it may indicate that residual signal prediction should be performed in decoding the current block. When the value of the residual signal prediction information is the second value, it may indicate that residual signal prediction is not performed in decoding the current block.

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

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

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

3) 슬라이스: 하나의 영상은 복수의 슬라이스 세그먼트들 또는 하나의 슬라이스 세그먼트 내의 복수의 타일들 등으로 분할될 수 있다. 잔차 신호 예측의 수행 여부는 슬라이스 별로 결정될 수 있다. 이러한 경우, 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함할 수 있다. 슬라이스 세그먼트 헤더의 잔차 신호 예측 정보가 잔차 신호 예측이 수행됨을 나타내면, 인트라 잔차 예측부(2310)는 슬라이스 세그먼트 헤더에 대응하는 슬라이스에 대해서 잔차 신호 예측을 수행할 수 있다. 슬라이스 세그먼트 헤더는 잔차 신호 예측 정보를 포함하는 경우, 슬라이스 레벨에서 인트라 예측으로 부호화된 모든 블록들은 전차 신호 예측의 수행의 여부에 따라, 잔치 신호 예측을 사용하여 복호화되거나, 잔차 신호 예측을 사용하지 않고 복호화될 수 있다.3) Slice: One image can 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. If 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 the slice corresponding to the slice segment header. When the slice segment header includes residual signal prediction information, all blocks coded by intra prediction at the slice level may be decoded using feast signal prediction or residual signal prediction depending on whether or not full signal prediction is performed. Can be decoded without using.

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 exist for the coding unit. If the residual signal prediction information for the coding unit indicates that the coding unit is to be updated, the intra residual predictor 2310 may perform residual signal prediction for the coding unit corresponding to the residual signal prediction information.

전술된 것과 같이, 잔차 신호 예측 정보는 시퀀스 파라미터 세트, 픽처 파라미터 세트 또는 슬라이스 세그먼트 헤더 내에서 부호화될 수 있다. 또한, 갱신 정보는 코딩 유닛에 대하여 부호화될 수 있다.As described above, the residual signal prediction information can 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 estimation unit 111, the motion compensation unit 112, the intra prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, and the filter unit 1 of the encoding apparatus 800 80), at least a part of the reference picture buffer 190 and the intra residual predictor 810 may be program modules, and may communicate with an external device or system. Program modules may be included in the encoding device 800 in the form of an operating system, application program modules, 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 may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures that perform functions or operations according to an embodiment or implement abstract data types according to an embodiment.

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

부호화 장치(800)는 도 26에서 도시된 전자 장치(2600)로서 구현될 수 있다. 전자 장치(2600)는 부호화 장치(800)로서 동작하는 범용의 컴퓨터 시스템일 수 있다.The encoding device 800 may be implemented as the electronic device 2600 shown 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, an electronic device 2600 may include at least one processor 2621, memory 2623, user interface (UI) input device 2626, UI output device 2627, and storage 2628 communicating with each other through a bus 2622. In addition, 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), memory 2623, or 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 device 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 at least one processor 2621 .

부호화 장치(800)의 데이터 또는 정보의 통신과 관련된 기능은 네트워크 인터페이스(2629)를 통해 수행될 수 있다.A function related to communication of data or information 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 decryption device according to an embodiment.

일 실시예에 따르면, 복호화 장치(2300)의 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260), 참조 픽처 버퍼(270) 및 인트라 잔차 예측부(2310)의 적어도 일부는 프로그램 모듈들일 수 있으며, 외부의 장치 또는 시스템과 통신할 수 있다. 프로그램 모듈들은 운영 체제, 응용 프로그램 모듈 및 기타 프로그램 모듈의 형태로 복호화 장치(2300)에 포함될 수 있다.According to an embodiment, at least some of 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, the reference picture buffer 270, and the intra residual prediction unit 2310 of the decoding apparatus 2300 may be program modules, Can communicate with a device or system. Program modules may be included in the decryption device 2300 in the form of an operating system, application program modules, 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 may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures that perform functions or operations according to an embodiment or implement abstract data types according to an embodiment.

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

복호화 장치(2300)는 도 27에서 도시된 전자 장치(2700)로서 구현될 수 있다. 전자 장치(2700)는 복호화 장치(2300)로서 동작하는 범용의 컴퓨터 시스템일 수 있다.The decryption device 2300 may be implemented as the electronic device 2700 shown 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 , an electronic device 2700 may include at least one processor 2721, a memory 2723, a user interface (UI) input device 2726, a UI output device 2727, and a storage 2728 that communicate with each other through a bus 2722. In addition, 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), memory 2723, or 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 device 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 at least one processor 2721 .

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

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

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

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

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

Claims (23)

삭제delete 현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,상기 인트라 예측의 예측 모드는 DC 모드이고,
상기 참조 샘플의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 영상의 복호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
Including, The prediction mode of the intra prediction is a DC mode,
The value of the reference sample 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.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,
상기 참조 샘플의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 영상의 복호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
including,
The method of decoding an image in which the value of the reference sample is determined based on at least one pixel of each horizontal line of the plurality of horizontal lines.
제3항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 영상의 복호화 방법.
According to claim 3,
The plurality of horizontal lines are located above the current block.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,상기 참조 샘플의 상기 값의 결정은 상기 참조 샘플의 상기 값의 갱신인 영상의 복호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
The method of decoding an image, wherein the determination of the value of the reference sample is an update of the value of the reference sample.
제5항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인에 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 영상의 복호화 방법.
According to claim 5,
wherein the update is performed based on calculation using values of pixels adjacent to a horizontal line included in the current block.
삭제delete 현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,
상기 인트라 예측의 예측 모드는 DC 모드이고,
상기 참조 샘플의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 영상의 부호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
including,
The prediction mode of the intra prediction is a DC mode,
Wherein the value of the reference sample 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.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,
상기 참조 샘플의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 영상의 부호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
including,
The method of encoding an image in which the value of the reference sample is determined based on at least one pixel of each horizontal line of the plurality of horizontal lines.
제9항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 영상의 부호화 방법.
According to claim 9,
The plurality of horizontal lines are an image encoding method located higher than the current block.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,
상기 참조 샘플의 상기 값의 결정은 상기 참조 샘플의 상기 값의 갱신인 영상의 부호화 방법.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
including,
Determination of the value of the reference sample is an update of the value of the reference sample.
제11항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인에 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 영상의 부호화 방법.
According to claim 11,
wherein the update is performed based on calculation using values of pixels adjacent to a horizontal line included in the current block.
제8항에 기재된 부호화 방법에 의하여 생성된 비트스트림을 기록하는 기록 매체.A recording medium on which a bitstream generated by the encoding method according to claim 8 is recorded. 삭제delete 비트스트림을 저장하는 컴퓨터 판독 가능한 기록 매체에 있어서,
상기 비트스트림은,
현재 블록에 대한 부호화된 정보
를 포함하고,
상기 부호화된 정보를 사용하여 상기 현재 블록에 대한 복호화가 수행되고,
상기 복호화에 있어서, 상기 현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정이 수행되고, 상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록이 생성되고, 상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록이 생성되고,
상기 인트라 예측의 예측 모드는 DC 모드이고,
상기 참조 샘플의 값은 상기 현재 블록에 인접하지 않은 수평 라인 내의 복수의 픽셀들 또는 상기 현재 블록에 인접하지 않은 수직 라인 내의 복수의 픽셀들에 기반하여 결정되는 컴퓨터 판독 가능한 기록 매체.
A computer-readable recording medium storing a bitstream,
The bitstream is
Coded information about the current block
including,
Decoding of the current block is performed using the encoded information;
In the decoding, a value of a reference sample for intra prediction of the current block is determined, a prediction block for the current block is generated using the reference sample, and a reconstructed block for the current block is generated using the prediction block and the reconstructed residual block,
The prediction mode of the intra prediction is a DC mode,
The value of the reference sample 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.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,
상기 참조 샘플의 값은 복수의 수평 라인들의 각 수평 라인의 적어도 하나의 픽셀에 기반하여 결정되는 컴퓨터 판독 가능한 기록 매체.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
including,
The value of the reference sample is determined based on at least one pixel of each horizontal line of the plurality of horizontal lines.
제15항에 있어서,
상기 복수의 수평 라인들은 상기 현재 블록보다 더 위에 위치한 컴퓨터 판독 가능한 기록 매체.
According to claim 15,
The plurality of horizontal lines are positioned higher than the current block.
현재 블록에 대한 인트라 예측을 위한 참조 샘플의 값의 결정을 수행하는 단계;
상기 참조 샘플을 사용하여 상기 현재 블록에 대한 예측 블록을 생성하는 단계; 및
상기 예측 블록 및 복원된 잔차 블록을 사용하여 상기 현재 블록에 대한 복원 블록을 생성하는 단계
를 포함하고,상기 참조 샘플의 상기 값의 결정은 상기 참조 샘플의 상기 값의 갱신인 컴퓨터 판독 가능한 기록 매체.
Determining a value of a reference sample for intra prediction of a current block;
generating a prediction block for the current block using the reference sample; and
generating a reconstruction block for the current block using the prediction block and the reconstructed residual block;
The computer-readable recording medium of claim 1 , wherein the determination of the value of the reference sample is an update of the value of the reference sample.
제18항에 있어서,
상기 갱신은 상기 현재 블록에 포함된 수평 라인에 인접한 픽셀들의 값들을 사용하는 계산에 기반하여 수행되는 컴퓨터 판독 가능한 기록 매체.
According to claim 18,
The update is performed based on calculation using values of pixels adjacent to a horizontal line included in the current block.
삭제delete 제6항에 있어서,
상기 갱신은 상기 현재 블록이 분할되는지 여부에 기반하여 수행되는 영상의 복호화 방법.
According to claim 6,
The method of decoding an image in which the update is performed based on whether the current block is divided.
제12항에 있어서,
상기 갱신은 상기 현재 블록이 분할되는지 여부에 기반하여 수행되는 영상의 부호화 방법.
According to claim 12,
The method of encoding an image in which the update is performed based on whether the current block is divided.
제19항에 있어서,
상기 갱신은 상기 현재 블록이 분할되는지 여부에 기반하여 수행되는 컴퓨터 판독 가능한 기록 매체.
According to claim 19,
The update is performed based on whether the current block is divided or not.
KR1020220120195A 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal KR102558803B1 (en)

Priority Applications (2)

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

Applications Claiming Priority (3)

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
KR1020220120195A KR102558803B1 (en) 2016-01-05 2022-09-22 Method and apparatus for prediction of residual signal

Related Parent Applications (1)

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

Related Child Applications (1)

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

Publications (2)

Publication Number Publication Date
KR20220136308A KR20220136308A (en) 2022-10-07
KR102558803B1 true KR102558803B1 (en) 2023-07-25

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

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

Family Applications After (1)

Application Number Title Priority Date Filing Date
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) CN113891095A (en)
WO (1) WO2017119540A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111247799B (en) 2017-10-18 2022-08-09 韩国电子通信研究院 Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN118138754A (en) 2019-06-14 2024-06-04 北京字节跳动网络技术有限公司 Processing video unit boundaries and virtual boundaries
CN117278747A (en) * 2019-09-22 2023-12-22 北京字节跳动网络技术有限公司 Filling process in adaptive loop filtering

Family Cites Families (30)

* 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
US9467705B2 (en) * 2009-12-30 2016-10-11 Ariscale Inc. Video encoding apparatus, video decoding apparatus, and video decoding method for performing intra-prediction based on directionality of neighboring block
US20130083851A1 (en) * 2010-04-06 2013-04-04 Samsung Electronics Co., Ltd. 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
CN107197257B (en) * 2010-12-08 2020-09-08 Lg 电子株式会社 Intra prediction method performed by encoding apparatus and decoding apparatus
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
MX347329B (en) * 2011-04-25 2017-04-21 Lg Electronics Inc Intra-prediction method, and encoder and decoder using same.
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
CN110830797B (en) * 2012-01-18 2023-09-15 韩国电子通信研究院 Video decoding device, video encoding device and method for 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

Also Published As

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

Similar Documents

Publication Publication Date Title
KR102531738B1 (en) Method for encoding/decoding video and apparatus thereof
CN109314785B (en) Method and apparatus for deriving motion prediction information
KR102328179B1 (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR20230113262A (en) Method and apparatus for encoding/decoding image, recording medium for stroing bitstream
KR20240066144A (en) Method and apparatus for encoding and decoding using selective information sharing over channels
KR102390452B1 (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
KR102558803B1 (en) Method and apparatus for prediction of residual signal
KR20220082791A (en) Method and apparatus for derivation of motion prediction information
KR20170120418A (en) Apparatus and method for fast motion estimation encoding/decoding of enhancement later
CN115460409A (en) Method and apparatus for encoding and decoding video by using prediction
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
KR20240110509A (en) Method and apparatus for encoding/decoding image and storage medium for storing bitstream
KR20230074682A (en) Method for encoding/decoding video and apparatus thereof
KR20200056921A (en) Method and apparatus for video processing using quantization parameter
CN115733977A9 (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
A107 Divisional application of patent
GRNT Written decision to grant