KR20200088297A - Video decoding method and apparatus and video encoding method and apparatus - Google Patents

Video decoding method and apparatus and video encoding method and apparatus Download PDF

Info

Publication number
KR20200088297A
KR20200088297A KR1020207011249A KR20207011249A KR20200088297A KR 20200088297 A KR20200088297 A KR 20200088297A KR 1020207011249 A KR1020207011249 A KR 1020207011249A KR 20207011249 A KR20207011249 A KR 20207011249A KR 20200088297 A KR20200088297 A KR 20200088297A
Authority
KR
South Korea
Prior art keywords
information
transform coefficient
coding unit
video decoding
decoding apparatus
Prior art date
Application number
KR1020207011249A
Other languages
Korean (ko)
Other versions
KR102653848B1 (en
Inventor
표인지
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Publication of KR20200088297A publication Critical patent/KR20200088297A/en
Application granted granted Critical
Publication of KR102653848B1 publication Critical patent/KR102653848B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/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/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/18Methods 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 a set of transform coefficients

Landscapes

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

Abstract

현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 스캔된 변환 계수들에 관한 정보에 기초하여 현재 블록의 변환 계수들을 획득하고, 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 비디오 복호화 방법이 개시된다. A rectangular scan area including all the effective transform coefficients in the current block is determined, information on the transform coefficients in the rectangular scan area is scanned according to a predetermined scan order, and based on the information on the scanned transform coefficients. Disclosed is a video decoding method for acquiring transform coefficients, performing inverse quantization and inverse transform on transform coefficients of a current block, generating a residual block of the current block, and restoring the current block based on the generated residual block. .

Description

비디오 복호화 방법 및 그 장치 및 비디오 부호화 방법 및 그 장치Video decoding method and apparatus and video encoding method and apparatus

비디오 복호화 방법 및 비디오 부호화에 관한 것이다. 상세하게는 엔트로피 복호화 및 엔트로피 부호화에 관한 것이다.It relates to a video decoding method and video encoding. Specifically, it relates to entropy decoding and entropy encoding.

고해상도 또는 고화질 비디오 컨텐트를 재생, 저장할 수 있는 하드웨어의 개발 및 보급에 따라, 고해상도 또는 고화질 비디오 컨텐트를 효과적으로 부호화하거나 복호화하는 비디오 코덱의 필요성이 증대하고 있다. 기존의 비디오 코덱에 따르면, 비디오는 트리 구조의 부호화 단위에 기반하여 제한된 부호화 방식에 따라 부호화되고 있다. With the development and dissemination of hardware capable of playing and storing high-resolution or high-definition video content, the need for a video codec that effectively encodes or decodes high-definition or high-definition video content is increasing. According to the existing video codec, a video is coded according to a limited encoding method based on a coding unit having a tree structure.

주파수 변환을 이용하여 공간 영역의 영상 데이터는 주파수 영역의 계수들로 변환된다. 비디오 코덱은, 주파수 변환의 빠른 연산을 위해 영상을 소정 크기의 블록들로 분할하고, 블록마다 DCT 변환을 수행하여, 블록 단위의 주파수 계수들을 부호화한다. 공간 영역의 영상 데이터에 비해 주파수 영역의 계수들이, 압축하기 쉬운 형태를 가진다. 특히 비디오 코덱의 인터 예측 또는 인트라 예측을 통해 공간 영역의 영상 화소값은 예측 오차로 표현되므로, 예측 오차에 대해 주파수 변환이 수행되면 많은 데이터가 0으로 변환될 수 있다. 비디오 코덱은 연속적으로 반복적으로 발생하는 데이터를 작은 크기의 데이터로 치환함으로써, 데이터량을 절감하고 있다.The image data in the spatial domain is transformed into coefficients in the frequency domain using frequency conversion. The video codec divides an image into blocks having a predetermined size and performs DCT transformation for each block to encode frequency coefficients in block units for fast calculation of frequency transformation. The coefficients in the frequency domain are easier to compress than the spatial domain image data. In particular, since the image pixel value in the spatial domain is expressed as a prediction error through inter prediction or intra prediction of a video codec, a lot of data may be converted to 0 when frequency conversion is performed on the prediction error. The video codec reduces the amount of data by replacing the data that occurs repeatedly repeatedly with small-sized data.

다양한 실시예에 의하면, 다양한 요소에 기초하여 스캔 영역을 결정하고, 계수에 관한 정보를 스캔하고, 이진화/역이진화 및 컨텍스트 모델에 기초한 이진 산술 부호화/복호화를 수행함으로써 엔트로피 부복호화 효율을 높일 수 있다. According to various embodiments, entropy decoding and decoding efficiency may be improved by determining a scan region based on various factors, scanning information about coefficients, and performing binary arithmetic encoding/decoding based on binary/inverse binarization and context model. .

다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.A computer-readable recording medium in which a program for implementing a method according to various embodiments is recorded may be included.

물론, 다양한 실시예의 기술적 과제들은 이상에서 언급한 특징으로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 당해 기술분야의 통상의 기술자에게 명확하게 이해될 수 있을 것이다Of course, the technical problems of various embodiments are not limited to the features mentioned above, and other technical problems that are not mentioned will be clearly understood by those skilled in the art from the following description.

본 발명의 기술적 과제들은 이상에서 언급한 특징으로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 당해 기술분야의 통상의 기술자에게 명확하게 이해될 수 있을 것이다.The technical problems of the present invention are not limited to the features mentioned above, and other technical problems that are not mentioned will be clearly understood by those skilled in the art from the following description.

다양한 실시예에 따른 비디오 복호화 방법은 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계; 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 및 상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 단계; 상기 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함한다. A video decoding method according to various embodiments may include determining a rectangular scan area including all effective transform coefficients in a current block; Scanning information on a transform coefficient in the rectangular scan area according to a predetermined scan order; And obtaining transform coefficients of the current block based on information about the scanned transform coefficients. Generating a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block; And restoring the current block based on the generated residual block.

상기 사각형 스캔 영역 내에는 상기 현재 블록 내 모든 유효 변환 계수를 포함하고, 상기 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 변환계수만을 포함할 수 있다.The rectangular scan area includes all the effective transform coefficients in the current block, and the remaining areas in the current block excluding the rectangular scan area may include only transform coefficients having a value of 0, not valid transform coefficients.

상기 사각형 스캔 영역을 결정하는 단계는,Determining the rectangular scan area,

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계; 및Obtaining information on coordinates specifying the rectangular scan area from a bitstream; And

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계를 포함하고,And determining a rectangular scan area including all effective transform coefficients in the current block based on information regarding coordinates specifying the rectangular scan area,

상기 사각형 스캔 영역을 특정하는 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수에 대한 수직방향 좌표를 나타낼 수 있다.The coordinates specifying the rectangular scan area may represent horizontal coordinates of the effective transform coefficient located at the rightmost position in the current block and vertical coordinates of the effective transform coefficient located at the bottom of the current block.

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계는,The step of obtaining information on coordinates specifying the rectangular scan area from a bitstream may include:

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행하는 단계; 및 상기 이진 산술 복호화된 정보에 대해 소정의 역이진화 방법을 이용한 역이진화를 수행하여 상기 사각형 스캔영역을 특정하는 좌표에 관한 역이진화 정보를 획득하는 단계를 더 포함할 수 있다.Performing binary arithmetic decoding based on a context model on information regarding coordinates specifying the rectangular scan area; And performing inverse binarization using a predetermined inverse binarization method on the binary arithmetic decoded information to obtain inverse binarization information regarding coordinates specifying the rectangular scan region.

상기 컨텍스트 모델은 상기 현재 블록의 크기, 상기 현재 블록의 컬러 성분(color component) 및 빈 인덱스(bin index) 중 적어도 하나에 기초하여 결정될 수 있다.The context model may be determined based on at least one of a size of the current block, a color component of the current block, and a bin index.

상기 소정의 역이진화 방법은 고정 길이(fixed length) 역이진화 방법 및 절삭형 단항(truncated unary) 역이진화 방법 중 적어도 하나일 수 있다.The predetermined inverse binarization method may be at least one of a fixed length inverse binarization method and a truncated unary inverse binarization method.

상기 소정의 스캔 순서는 역 지그재그 스캔(inverse zig-zag scan)에 따른 순서 또는 역 대각 스캔(inverse diagonal scan)에 따른 순서일 수 있다.The predetermined scan order may be an order according to an inverse zig-zag scan or an inverse diagonal scan.

상기 소정의 스캔 순서는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 중 적어도 하나에 기초하여 결정될 수 있다.The predetermined scan order may be determined based on at least one of a horizontal direction coordinate of an effective transform coefficient pixel positioned at the rightmost position in the current block and a vertical coordinate of an effective transform coefficient pixel positioned at the lowermost position in the current block. .

상기 변환 계수에 관한 정보는, The information about the transform coefficient,

상기 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고, 상기 소정의 값은 0, 1, 2 중 적어도 하나일 수 있다.Flag information indicating whether or not the absolute value of the transform coefficient is greater than a predetermined value, residual level information about the absolute value of the transform coefficient, sign information of the transform coefficient, and used for inverse binarization of the transform coefficient It includes at least one of the binarization parameter information, and the predetermined value may be at least one of 0, 1, and 2.

상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 단계는,The step of obtaining transform coefficients of the current block based on the information about the scanned transform coefficients,

상기 변환 계수들의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 상기 현재 블록의 변환 계수들을 획득하는 단계를 포함할 수 있다.And obtaining transform coefficients of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model for flag information indicating whether the absolute value of the transform coefficients is greater than a predetermined value. .

상기 변환 계수들의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보는 제1 변환 계수를 포함하고,Flag information indicating whether the absolute value of the transform coefficients is greater than a predetermined value includes a first transform coefficient,

상기 제1 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보에 관한 컨텍스트 모델은 상기 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 상기 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 상기 제1 변환 계수의 스캔 위치, 상기 제1 변환 계수의 스캔영역에서의 상대 위치, 첫번째 스캔위치 여부 중 적어도 하나에 기초하여 결정될 수 있다.The context model for flag information indicating whether or not the absolute value of the first transform coefficient is greater than a predetermined value includes: information about at least one second transform coefficient previously scanned according to the predetermined scan order, in the current block At least one of a position and color component of a first transform coefficient, information about a right or lower peripheral transform coefficient, a scan position of the first transform coefficient, a relative position in a scan area of the first transform coefficient, and a first scan position It can be determined based on.

상기 변환 계수들에 관한 정보는 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보를 포함하고,The information about the transform coefficients includes flag information indicating whether the absolute value of the transform coefficient is greater than a predetermined value,

비트스트림으로부터 획득될 수 있는 상기 플래그 정보의 최대 개수(maximum count)는 상기 스캔 영역의 크기에 기초하여 결정될 수 있다.The maximum number of flag information that can be obtained from the bitstream (maximum count) may be determined based on the size of the scan area.

소정의 스캔 순서에 따라 상기 사각형 스캔 영역 내 각 변환 계수들의 스캔 순위가 결정되고, 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계는, 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 사각형 스캔 영역 내 각 변환 계수들의 스캔 순위에 따라 스캔하는 단계를 포함할 수 있다.The scan rank of each transform coefficient in the rectangular scan area is determined according to a predetermined scan order, and the step of scanning information on the transform coefficient in the rectangular scan area according to a predetermined scan order comprises: transform coefficients in the rectangular scan area It may include the step of scanning the information according to the scan rank of each of the transform coefficients in the rectangular scan area.

소정의 정방향 스캔 순서에 따라 상기 사각형 스캔 영역 내 소정의 복수개의 변환 계수를 포함하는 적어도 하나의 계수 그룹이 결정되고,At least one coefficient group including a predetermined plurality of transform coefficients in the rectangular scan area is determined according to a predetermined forward scan order,

상기 계수 그룹 단위로 적어도 하나의 변환 계수의 부호에 관한 정보를 숨기는지 여부가 결정될 수 있다.It may be determined whether to hide information about the sign of at least one transform coefficient in units of the coefficient group.

다양한 실시예에 따른 비디오 복호화 장치는 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 엔트로피 복호화부; 및 상기 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 상기 현재 블록을 복원하는 영상 복원부를 포함할 수 있다.The video decoding apparatus according to various embodiments determines a rectangular scan area including all the effective transform coefficients in the current block, scans information about the transform coefficients in the rectangular scan area according to a predetermined scan order, and the scanned transform An entropy decoding unit that obtains transform coefficients of the current block based on information on coefficients; And an image reconstruction unit to generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block, and restoring the current block based on the generated residual block.

다양한 실시예에 따른 비디오 부호화 방법은 현재 블록의 변환 계수들을 획득하는 단계; 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계; 상기 사각형 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 상기 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화하여 엔트로피 부호화된 정보를 생성하는 단계; 및 상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함할 수 있다.A video encoding method according to various embodiments may include obtaining transform coefficients of a current block; Determining a rectangular scan area including all effective transform coefficients in the current block; Scanning information on the transform coefficients included in the rectangular scan area according to a predetermined scan order; Generating entropy-encoded information by entropy-coding based on the information on the scanned transform coefficients; And generating a bitstream including the entropy-encoded information.

다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.A computer-readable recording medium in which a program for implementing a method according to various embodiments is recorded may be included.

다양한 실시예에 따라, 다양한 요소에 기초하여 스캔 영역을 결정하고, 계수에 관한 정보를 스캔하고, 이진화/역이진화 및 컨텍스트 모델에 기초한 이진 산술 부호화/복호화를 수행함으로써 엔트로피 부복호화 효율을 높일 수 있다. 특히, 변환 계수에 관한 정보를 엔트로피 부복호화하는 과정에서 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 사각형 스캔 영역 내 변환 계수를 스캔함으로써 불필요한 스캔을 줄이고, 서로 연관성이 있는 변환 계수들을 인접하여 스캔함으로써 엔트로피 부복호화 효율을 높일 수 있다. According to various embodiments, it is possible to increase entropy decoding and decoding efficiency by determining a scan region based on various factors, scanning information about coefficients, and performing binary arithmetic encoding/decoding based on binary/inverse binarization and context model. . In particular, in the process of encoding and decoding information about the transform coefficients, a rectangular scan area including all the effective transform coefficients in the current block is determined, and unnecessary scans are reduced by scanning the transform coefficients in the rectangular scan area, and the transforms are correlated with each other. Entropy decoding and decoding efficiency can be increased by scanning coefficients adjacently.

도 1a는 다양한 실시예에 따른 비디오 복호화 장치의 블록도를 도시한다.
도 1b는 다양한 실시예에 따른 비디오 복호화 방법의 흐름도를 도시한다.
도 1c는 다양한 실시예에 따른 비디오 부호화 장치의 블록도를 도시한다.
도 1d는 다양한 실시예에 따른 비디오 부호화 방법의 흐름도를 도시한다.
도 1e는 다양한 실시예에 따른 영상 복호화부의 블록도를 도시한다.
도 1f는 다양한 실시예에 따른 영상 복호화부의 블록도를 도시한다
도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.
도 3a는 다른 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.
도 3b는 다른 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.
도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.
도 5는 다른 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.
도 6a는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.
도 6b는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.
도 7a는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 스캔 순서를 설명하기 위한 도면이다.
도 7b는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 스캔 순서를 설명하기 위한 도면이다.
도 8은 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 대각 스캔 순서를 설명하기 위한 도면이다.
도 9a 내지 9c는 일 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.
도 9d 내지 9f는 다른 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.
도 10은 일 실시예에 따라 현재 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.
도 11은 일 실시예에 따라 비-정사각형의 형태인 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.
도 12는 일 실시예에 따라 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 부호화 단위가 분할되는 과정을 도시한다.
도 13은 일 실시예에 따라 홀수개의 부호화 단위들 중 소정의 부호화 단위가 결정되는 방법을 도시한다.
도 14는 일 실시예에 따라 현재 부호화 단위가 분할되어 복수개의 부호화 단위들이 결정되는 경우, 복수개의 부호화 단위들이 처리되는 순서를 도시한다.
도 15는 일 실시예에 따라 소정의 순서로 부호화 단위가 처리될 수 없는 경우, 현재 부호화 단위가 홀수개의 부호화 단위로 분할되는 것으로 결정되는 과정을 도시한다.
도 16은 일 실시예에 따라 제1 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.
도 17은 일 실시예에 따라 제1 부호화 단위가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위가 소정의 조건을 만족하는 경우, 제2 부호화 단위가 분할될 수 있는 형태가 제한되는 것을 도시한다.
도 18은 일 실시예에 따라 분할 형태 정보가 4개의 정사각형 형태의 부호화 단위로 분할하는 것을 나타낼 수 없는 경우, 정사각형 형태의 부호화 단위가 분할되는 과정을 도시한다
도 19는 일 실시예에 따라 복수개의 부호화 단위들 간의 처리 순서가 부호화 단위의 분할 과정에 따라 달라질 수 있음을 도시한 것이다.
도 20은 일 실시예에 따라 부호화 단위가 재귀적으로 분할되어 복수개의 부호화 단위가 결정되는 경우, 부호화 단위의 형태 및 크기가 변함에 따라 부호화 단위의 심도가 결정되는 과정을 도시한다.
도 21은 일 실시예에 따라 부호화 단위들의 형태 및 크기에 따라 결정될 수 있는 심도 및 부호화 단위 구분을 위한 인덱스(part index, 이하 PID)를 도시한다.
도 22는 일 실시예에 따라 픽쳐에 포함되는 복수개의 소정의 데이터 단위에 따라 복수개의 부호화 단위들이 결정된 것을 도시한다.
도 23은 일 실시예에 따라 픽쳐에 포함되는 기준 부호화 단위의 결정 순서를 결정하는 기준이 되는 프로세싱 블록을 도시한다.
1A is a block diagram of a video decoding apparatus according to various embodiments.
1B is a flowchart of a video decoding method according to various embodiments.
1C is a block diagram of a video encoding apparatus according to various embodiments.
1D is a flowchart of a video encoding method according to various embodiments.
1E is a block diagram of an image decoder according to various embodiments.
1F is a block diagram of an image decoder according to various embodiments of the present disclosure.
2 is a diagram for describing a method of scanning a transform coefficient in a block according to an embodiment.
3A is a diagram illustrating a method of scanning a transform coefficient in a block according to another embodiment.
3B is a diagram for explaining an operation of determining a coefficient group (sub-block) in a block and an operation performed for each coefficient group according to another embodiment.
4 is a diagram for explaining a process of determining a context model for context-based binary arithmetic decoding and decoding of information on transform coefficients according to an embodiment.
5 is a diagram for explaining a process of determining a context model for context-based binary arithmetic decoding and decoding of information on transform coefficients according to another embodiment.
6A is a diagram for explaining a horizontal priority zigzag scan order for scanning information on transform coefficients in a block according to an embodiment.
FIG. 6B is a diagram for explaining a vertical priority zigzag scan sequence for scanning information on transform coefficients in a block according to an embodiment.
7A is a diagram for explaining a horizontal scan order for scanning information on transform coefficients in a block according to an embodiment.
7B is a diagram for explaining a vertical scan order for scanning information on transform coefficients in a block according to an embodiment.
8 is a diagram for explaining a diagonal scan order for scanning information on transform coefficients in a block according to an embodiment.
9A to 9C are diagrams for explaining a residual encoding syntax structure according to an embodiment.
9D to 9F are diagrams for explaining a residual encoding syntax structure according to another embodiment.
10 illustrates a process in which at least one coding unit is determined by dividing a current coding unit according to an embodiment.
11 illustrates a process in which at least one coding unit is determined by dividing a coding unit having a non-square shape according to an embodiment.
12 is a diagram illustrating a process in which a coding unit is split based on at least one of block type information and split type information according to an embodiment.
13 illustrates a method of determining a predetermined coding unit among odd coding units according to an embodiment.
14 illustrates an order in which a plurality of coding units are processed when a plurality of coding units are determined by splitting a current coding unit according to an embodiment.
15 illustrates a process in which the current coding unit is determined to be divided into an odd number of coding units when the coding units cannot be processed in a predetermined order according to an embodiment.
16 illustrates a process in which the first coding unit is divided and at least one coding unit is determined according to an embodiment.
17 illustrates that when a second coding unit having a non-square shape determined by dividing a first coding unit satisfies a predetermined condition according to an embodiment, a form in which the second coding unit can be split is limited. .
18 is a diagram illustrating a process in which a coding unit of a square shape is split when the split type information cannot be divided into four coding units of a square shape according to an embodiment.
19 illustrates that a processing order among a plurality of coding units may vary according to a splitting process of coding units according to an embodiment.
20 is a diagram illustrating a process in which a depth of a coding unit is determined as a shape and a size of a coding unit change when a coding unit is recursively divided and a plurality of coding units are determined according to an embodiment.
21 is a diagram for a depth and a coding index (part index, hereinafter, PID) that can be determined according to the type and size of coding units, according to an embodiment.
22 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to an embodiment.
23 illustrates a processing block serving as a criterion for determining a determination order of a reference coding unit included in a picture according to an embodiment.

발명의 실시를 위한 최선의 형태Best mode for carrying out the invention

다양한 실시예에 따른 비디오 복호화 방법은 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계; 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 및 상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 단계; 상기 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함한다. A video decoding method according to various embodiments may include determining a rectangular scan area including all effective transform coefficients in a current block; Scanning information on a transform coefficient in the rectangular scan area according to a predetermined scan order; And obtaining transform coefficients of the current block based on information about the scanned transform coefficients. Generating a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block; And restoring the current block based on the generated residual block.

다양한 실시예에 따른 비디오 복호화 장치는 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 엔트로피 복호화부; 및 상기 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 상기 현재 블록을 복원하는 영상 복원부를 포함할 수 있다.The video decoding apparatus according to various embodiments determines a rectangular scan area including all the effective transform coefficients in the current block, scans information about the transform coefficients in the rectangular scan area according to a predetermined scan order, and the scanned transform An entropy decoding unit that obtains transform coefficients of the current block based on information on coefficients; And an image reconstruction unit to generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block, and restoring the current block based on the generated residual block.

다양한 실시예에 따른 비디오 부호화 방법은 현재 블록의 변환 계수들을 획득하는 단계; 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계; 상기 사각형 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 상기 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화하여 엔트로피 부호화된 정보를 생성하는 단계; 및 상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함할 수 있다.A video encoding method according to various embodiments may include obtaining transform coefficients of a current block; Determining a rectangular scan area including all effective transform coefficients in the current block; Scanning information on the transform coefficients included in the rectangular scan area according to a predetermined scan order; Generating entropy-encoded information by entropy-coding based on the information on the scanned transform coefficients; And generating a bitstream including the entropy-encoded information.

다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.A computer-readable recording medium in which a program for implementing a method according to various embodiments is recorded may be included.

발명의 실시를 위한 형태Mode for carrying out the invention

이하, '영상'은 비디오의 정지영상이거나 동영상, 즉 비디오 그 자체를 나타낼 수 있다.Hereinafter, the'image' may represent a still image of a video or a video, that is, the video itself.

이하 '샘플'은, 영상의 샘플링 위치에 할당된 데이터로서 프로세싱 대상이 되는 데이터를 의미한다. 예를 들어, 공간영역의 영상에서 픽셀들이 샘플들일 수 있다.Hereinafter,'sample' means data to be processed as data allocated to a sampling location of an image. For example, pixels in a spatial domain image may be samples.

이하 '현재 블록(Current Block)'은, 부호화 또는 복호화하고자 하는 영상의 블록을 의미할 수 있다.Hereinafter,'current block' may mean a block of an image to be encoded or decoded.

도 1a는 다양한 실시예에 따른 비디오 복호화 장치의 블록도를 도시한다.1A is a block diagram of a video decoding apparatus according to various embodiments.

다양한 실시예에 따른 비디오 복호화 장치(100)는 엔트로피 복호화부(105) 및 영상 복원부(120)을 포함할 수 있다.The video decoding apparatus 100 according to various embodiments may include an entropy decoding unit 105 and an image restoration unit 120.

엔트로피 복호화부(105)는 비트스트림으로부터 수신된 신택스 엘리먼트(syntax element) 정보를 획득하고, 신택스 엘리먼트 정보에 대해 엔트로피 복호화할 수 있다. 이때, 비트스트림으로부터 수신된 신택스 엘리먼트 정보는 영상에 관한 다양한 신택스 엘리먼트에 관한 정보일 수 있다.The entropy decoding unit 105 may acquire syntax element information received from the bitstream and entropy decode the syntax element information. In this case, the syntax element information received from the bitstream may be information on various syntax elements related to an image.

엔트로피 복호화부(105)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보들을 비트스트림으로부터 획득할 수 있고, 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보에 대해 엔트로피 복호화할 수 있다. 이때, 현재 블록은 도 10 내지 도 23을 참조하여 설명되는 영상을 부/복호화하는 과정에서 이용할 수 있는 데이터 단위일 수 있다.The entropy decoding unit 105 may obtain syntax element information about the transform coefficient in the current block from the bitstream, and may entropy decode the syntax element information about the transform coefficient in the current block. In this case, the current block may be a data unit that can be used in the process of encoding/decoding an image described with reference to FIGS. 10 to 23.

엔트로피 복호화부(105)는 엔트로피 복호화된 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록 내 변환 계수들에 관한 정보를 획득할 수 있다. 소정의 스캔 순서는 역방향의 다양한 스캔 순서일 수 있다. 여기서 역방향의 스캔 순서란, 블록 내 우측 하단의 픽셀로부터 블록 내 좌측 상단의 변환 계수 픽셀까지를 스캔하는 순서일 수 있다. 좌상측 변환 계수 픽셀부터 우하측에 위치한 변환 계수의 순서로 변환 계수들을 스캔하는 순서는 정방향 스캔 순서로 지칭될 수 있으며, 우하측에 위치한 마지막 변환 계수부터 좌상측 변환 계수의 순서로 변환 계수를 스캔하는 경우는 역방향 스캔 순서로 지칭될 수 있다. 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보는 현재 블록 내 변환 계수가 소정의 값보다 큰 지 여부를 나타내는 플래그(flag) 정보일 수 있다. 이때, 소정의 값은 0보다 크거나 같은 정수 값일 수 있다. 예를 들어, 0, 1 또는 2일 수 있다. The entropy decoding unit 105 may scan syntax element information related to the entropy decoded transform coefficients in the current block according to a predetermined scan order to obtain information about transform coefficients in the current block. The predetermined scan order may be various scan orders in the reverse direction. Here, the reverse scan order may be an order of scanning from the lower right pixel in the block to the transform coefficient pixel in the upper left in the block. The order of scanning the transform coefficients in the order of the transform coefficients located at the lower right side from the pixel of the upper left transform coefficient may be referred to as a forward scan order, and the transform coefficients are scanned in the order of the left upper transform coefficients from the last transform coefficient located at the lower right. Can be referred to as a reverse scan order. The syntax element information about the transform coefficient in the current block may be flag information indicating whether the transform coefficient in the current block is greater than a predetermined value. In this case, the predetermined value may be an integer value greater than or equal to 0. For example, it can be 0, 1 or 2.

또한, 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보는 잔여 레벨 절대값(remaining level absolute value)을 나타내는 신택스 엘리먼트 정보일 수 있다. 잔여 레벨 절대값은 변환 계수의 레벨의 절대값과 베이스 레벨(base level)의 절대값 간의 차이를 의미할 수 있다. 베이스 레벨의 절대값은 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 신택스 엘리먼트 정보에 기초하여 결정될 수 있다. 예를 들어, 변환 계수의 절대값이 0보다 큰지 여부(또는 변환 계수가 유효 변환 계수인지 여부; 여기서, 유효 변환 계수는 변환 계수의 절대값이 0보다 큰 변환 계수를 의미함.)를 나타내는 플래그 정보(Greater than 0 flag 또는 sig_coeff_flag; 이하, GT0 플래그라 함)의 값과 1보다 큰지 여부를 나타내는 플래그 정보(Greater than 1 flag 또는 coeff_abs_level_greater1_flag; 이하, GT1 플래그라 함)의 값과 2보다 큰지 여부를 나타내는 플래그 정보(Greater than 2 flag 또는 coeff_abs_level_greater2_flag; GT2 플래그라 함)의 값의 총 합이 베이스 레벨(base level)의 절대값이 될 수 있다. 여기서, 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보가 소정의 값보다 큼을 나타내는 경우, 그 플래그 정보의 값은 1일 수 있고, 소정의 값보다 작음을 나타내는 경우, 그 플래그 정보의 값은 0일 수 있다. 한편, 플래그 정보들 중 일부는 비트스트림으로부터 획득되지 않을 수 있다. 일 실시예에 따르면, 변환 계수의 크기가 n(n은 정수)보다 큰지 여부를 나타내는 플래그를 GTn, 변환 계수의 크기가 (n+1)보다 큰지 여부를 나타내는 플래그 GT(n+1), 변환 계수의 크기가 (n+2)보다 큰지 여부를 나타내는 플래그 GT(n+2)라고 할 때, n, n+1 및 n+2의 기준값 중 상대적으로 더 작은값인 n이나 n+1보다 변환 계수의 절대값이 더 큰 지 여부를 나타내는 플래그들, 즉 GTn, GT(n+1)만을 전송하고, GT(n+2)는 비트스트림에 포함시키지 않을 수 있다.Also, the syntax element information about the transform coefficient in the current block may be syntax element information indicating a residual level absolute value. The residual level absolute value may mean a difference between the absolute value of the level of the transform coefficient and the absolute value of the base level. The absolute value of the base level may be determined based on syntax element information indicating whether the absolute value of the transform coefficient is greater than a predetermined value. For example, a flag indicating whether the absolute value of the transform coefficient is greater than 0 (or whether the transform coefficient is a valid transform coefficient; where, the effective transform coefficient means a transform coefficient where the absolute value of the transform coefficient is greater than 0). Whether the value of information (Greater than 1 flag or sig_coeff_flag; hereinafter referred to as GT0 flag) is greater than 1 and the value of flag information (Greater than 1 flag or coeff_abs_level_greater1_flag; hereinafter referred to as GT1 flag) The sum of the values of the flag information (Greater than 2 flag or coeff_abs_level_greater2_flag; referred to as GT2 flag) may be the absolute value of the base level. Here, when the flag information indicating whether the absolute value of the transform coefficient is greater than the predetermined value is greater than the predetermined value, the value of the flag information may be 1, and when indicating that the flag information is smaller than the predetermined value, the flag information The value of may be 0. Meanwhile, some of the flag information may not be obtained from the bitstream. According to an embodiment, the flag indicating whether the size of the transform coefficient is greater than n (n is an integer) is GTn, and the flag GT(n+1) indicating whether the size of the transform coefficient is greater than (n+1), the transform When the flag GT(n+2) indicating whether the size of the coefficient is greater than (n+2), it is converted to n or n+1, which is a relatively smaller reference value of n, n+1 and n+2. Only flags indicating whether the absolute value of the coefficient is greater, namely GTn, GT(n+1), are transmitted, and GT(n+2) may not be included in the bitstream.

예를 들어, GT0 플래그 정보 및 GT1 플래그 정보가 각각 변환 계수의 절대값이 0 및 1보다 큼을 나타내는 경우, GT2 플래그가 비트스트림에 포함되지 않는 경우 엔트로피 복호화부(105)는 GT2 플래그를 제외하고, GT0 플래그 정보 및 GT1 플래그 정보만을 이용하여 변환 계수의 절대값이 1보다 크기 때문에 변환 계수의 절대값에서 2를 뺀 나머지 절대값을 변환 계수의 잔여 레벨 절대값으로 결정할 수 있다.For example, when the GT0 flag information and the GT1 flag information indicate that the absolute values of the transform coefficients are greater than 0 and 1, respectively, when the GT2 flag is not included in the bitstream, the entropy decoding unit 105 excludes the GT2 flag, Since only the absolute value of the transform coefficient is greater than 1 using only the GT0 flag information and the GT1 flag information, the remaining absolute value obtained by subtracting 2 from the absolute value of the transform coefficient can be determined as the absolute value of the residual level of the transform coefficient.

GT0 플래그 정보, GT1 플래그 정보, GT2 플래그 정보가 각각 0, 1, 2보다 큼을 나타내는 경우, 엔트로피 복호화부(105)는 변환 계수의 절대값이 2보다 크기 때문에 변환 계수의 절대값에서 3을 뺀 나머지 절대값을 변환 계수의 잔여 레벨의 절대값으로 결정할 수 있다. 즉, 잔여 레벨 절대값은 변환 계수의 절대값이 소정의 값보다 큰지를 나타내는 정보에 기초하여 결정된 소정의 절대값과 유효 변환 계수의 절대값 간의 절대값 차이를 나타낼 수 있다. When the GT0 flag information, the GT1 flag information, and the GT2 flag information indicate greater than 0, 1, and 2, respectively, the entropy decoder 105 subtracts 3 from the absolute value of the transform coefficient because the absolute value of the transform coefficient is greater than 2 The absolute value can be determined as the absolute value of the residual level of the transform coefficient. That is, the residual level absolute value may represent an absolute value difference between a predetermined absolute value determined based on information indicating whether the absolute value of the transform coefficient is greater than a predetermined value and the absolute value of the effective transform coefficient.

엔트로피 복호화부(105)는 비트스트림으로부터 수신된 신택스 엘리먼트 정보를 획득하고, 신택스 엘리먼트 정보에 대해 이진 산술 복호화(binary arithmetic decoding)를 수행하고, 이진 산술 복호화를 수행하여 생성된 출력인 빈 스트링(bin string)에 대해 역이진화(inverse binarization)를 수행할 수 있다. 이때, 이진 산술 복호화 동작은 이진 산술 복호화부(110)에서 수행될 수 있고, 역이진화 동작은 역이진화부(115)에서 수행될 수 있다.The entropy decoding unit 105 obtains syntax element information received from the bitstream, performs binary arithmetic decoding on the syntax element information, and performs binary arithmetic decoding, thereby generating an empty string (bin) that is an output. string) can be performed inverse binarization. At this time, the binary arithmetic decoding operation may be performed by the binary arithmetic decoding unit 110, and the inverse binarization operation may be performed by the inverse binarization unit 115.

이진 산술 복호화부(110)는 비트스트림으로부터 획득된 신택스 엘리먼트 정보에 대해 소정의 컨텍스트 모델(context model)에 기초한 이진 산술 복호화를 수행할 수 있다. 여기서 컨텍스트 모델이란, 빈(bin)의 발생 확률에 관한 정보일 수 있다. 빈의 발생 확률에 관한 정보는 두 심볼 0과 1 중 발생 확률이 상대적으로 낮은 심볼인 LPS(Least Propbable Symbol) 및 반대로 높은 심볼인 MPS(Least Probable Symbol) 중 하나의 심볼을 나타내는 정보(valMPS) 및 하나의 심볼의 발생 확률에 관한 정보를 포함할 수 있다. 발생 확률은 0과 1 사이의 값을 갖는다. 따라서, MPS 및 LPS 중 하나의 심볼의 확률이 결정되면, 다른 심볼의 발생 확률에 관한 정보는 1에서 기결정된 심볼에 대한 발생 확률을 뺀 확률에 관한 정보이기 때문에 하나의 심볼에 대한 발생 확률이 결정되면, 이진 산술 복호화부(110)는 나머지 심볼에 대한 발생 확률을 결정할 수 있다. 이때, 먼저 결정되는 하나의 심볼에 대한 발생 확률은 LPS(Least Probable Symbol)의 발생 확률일 수 있다. 한편, 인덱스 값들에 대응하는 심볼의 발생 확률들이 테이블에 미리 결정될 수 있고, 심볼에 대한 발생 확률 정보는 테이블에 결정된 심볼의 발생 확률들을 나타내는 인덱스를 나타내는 정보(pStateIdx)일 수 있다.The binary arithmetic decoding unit 110 may perform binary arithmetic decoding based on a predetermined context model on syntax element information obtained from a bitstream. Here, the context model may be information on the probability of occurrence of a bin. Information on the probability of occurrence of the bin includes information showing a symbol of one of two symbols 0 and 1, a symbol having a relatively low probability of occurrence, LPS (Least Propbable Symbol) and a symbol having a high symbol (Least Probable Symbol), MPS (valMPS), and It may include information about the probability of occurrence of one symbol. The probability of occurrence has a value between 0 and 1. Therefore, when the probability of one of the MPS and LPS is determined, the probability of occurrence of one symbol is determined because the information about the probability of occurrence of another symbol is information about the probability of subtracting the probability of occurrence of a predetermined symbol from 1 If it is, the binary arithmetic decoding unit 110 may determine the probability of occurrence of the remaining symbols. At this time, the probability of occurrence of one symbol determined first may be the probability of occurrence of LPS (Least Probable Symbol). Meanwhile, the probability of occurrence of the symbol corresponding to the index values may be previously determined in the table, and the probability of occurrence of the symbol may be information (pStateIdx) indicating an index indicating the probability of occurrence of the symbol determined in the table.

소정의 컨텍스트 모델은 빈의 위치를 나타내는 인덱스(bin index), 빈이 포함된 블록의 주변 블록에 포함된 빈의 발생 확률 및 현재 블록 또는 주변 블록의 다양한 요소 등에 기초하여 결정될 수 있다.The predetermined context model may be determined based on an index indicating the location of the bin, the probability of occurrence of the bin included in the neighboring block of the block containing the bin, and various elements of the current block or the neighboring block.

또는, 이진 산술 복호화부(110)는 비트스트림으부터 획득된 신택스 엘리먼트 정보에 대해 바이패스(by-pass) 모드에 따라 이진 산술 복호화를 수행할 수 있다. 이때, 현재 이진 산술 복호화되는 빈에 대한 0 또는 1이 나올 확률은 0.5로 고정되고, 이러한 확률에 기초하여 신택스 엘리먼트 정보에 대해 이진 산술 복호화를 수행할 수 있다.Alternatively, the binary arithmetic decoding unit 110 may perform binary arithmetic decoding on the syntax element information obtained from the bitstream according to a bypass mode. At this time, the probability that 0 or 1 for the bin to be currently decoded in binary arithmetic is fixed to 0.5, and binary arithmetic decoding may be performed for syntax element information based on the probability.

역이진화부(115)는 이진 산술 복호화를 수행하여 생성된 출력값인 빈 스트링(bin string)에 대해 역이진화를 수행할 수 있다. 역이진화부(115)는 소정의 이진화 방법에 대응되는 역이진화 방법에 기초하여 빈 스트링에 대해 역이진화를 수행할 수 있다. 소정의 이진화 방법은 고정 길이(Fixed Length) 이진화 방법, 라이스(Rice) 이진화 방법, 지수-골룸(Exponential-Golomb) 이진화 방법 및 골룸-라이스(Golomb-Rice) 이진화 방법을 포함할 수 있다. 또는, 소정의 이진화 방법은 제1 이진화 방법 및 제2 이진화 방법이 결합된 이진화 방법일 수 있다. 예를 들어, 역이진화부(115)는 신택스 엘리먼트의 빈 스트링 중 일부인 제1 빈 스트링에 대해서는 제1 이진화 방법에 대응되는 역이진화 방법에 기초하여 역이진화하고, 신택스 엘리먼트의 빈 스트링 중 일부인 제2 빈 스트링에 대해서는 제2 이진화 방법에 대응되는 역이진화 방법에 기초하여 역이진화를 수행할 수 있다. 상기 일부의 빈 스트링은 신택스 엘리먼트의 빈 스트링의 프리픽스(prefix) 또는 서픽스(suffix)일 수 있다.The inverse binarization unit 115 may perform inverse binarization on an empty string that is an output value generated by performing binary arithmetic decoding. The inverse binarization unit 115 may perform inverse binarization on an empty string based on an inverse binarization method corresponding to a predetermined binarization method. The predetermined binarization method may include a fixed length binarization method, a Rice binarization method, an exponential-Golomb binarization method, and a Golomb-Rice binarization method. Alternatively, the predetermined binarization method may be a binarization method in which the first binarization method and the second binarization method are combined. For example, the inverse binarization unit 115 de-binarizes the first bin string that is part of the empty string of the syntax element based on the inverse binarization method corresponding to the first binarization method, and the second that is part of the empty string of the syntax element. For the empty string, inverse binarization may be performed based on the inverse binarization method corresponding to the second binarization method. The part of the empty string may be a prefix or suffix of the empty string of the syntax element.

이진화 방법이나 역이진화 방법 모두 신택스 엘리먼트의 값과 대응되는 적어도 하나의 빈을 포함하는 빈스트링의 1:1 대응 관계를 규정하는 일종의 코드 워드와 관련된 것이다. 인코딩 측면에서 전술한 다양한 방식의 이진화 방법 중 하나에 따라서, 신택스 엘리먼트의 값에 대응되는 적어도 하나의 빈을 포함하는 빈스트링이 결정되며, 디코딩 측면에서 역이진화 방법에 따라서 빈스트링에 해당되는 신택스 엘리먼트의 값이 결정될 수 있다. 예를 들어, 신택스 엘리먼트의 값 a(a는 실수)에 대응되는 빈 스트링 A가 소정 이진화/역이진화 방법에 따라 결정되는 경우, 신택스 엘리먼트의 값 a를 기준으로 빈 스트링 A를 결정하는 과정을 이진화 과정으로 지칭되며, 빈스트링 A를 기준으로 신택스 엘리먼트의 값 a를 결정하는 과정을 역이진화 과정으로 지칭할 수 있다. 그러나, 전술한 바와 같이, 이진화와 역이진화는 본질적으로 신택스 엘리먼트의 값과 빈스트링의 매핑 관계를 규정하는 것으로 이진화/역이진화는 실질적으로 동일함을 당업자는 용이하게 이해할 수 있다.Both the binarization method and the inverse binarization method are related to a kind of code word that defines a 1:1 correspondence relationship of a bean string including at least one bean corresponding to a value of a syntax element. According to one of the various methods of binarization described above in terms of encoding, a bean string including at least one bin corresponding to the value of the syntax element is determined, and in terms of decoding, a syntax element corresponding to the bin string according to an inverse binarization method The value of can be determined. For example, when the empty string A corresponding to the value a (a is a real number) of the syntax element is determined according to a predetermined binarization/de-binarization method, the process of determining the empty string A based on the value a of the syntax element is binarized It is referred to as a process, and the process of determining the value a of the syntax element based on the empty string A may be referred to as an inverse binarization process. However, as described above, those skilled in the art can readily understand that binarization and de-binarization essentially define the mapping relationship between the value of a syntax element and the binstring, and that binarization/de-binarization is substantially the same.

엔트로피 복호화부(105)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보를 소정의 스캔 순서에 따라 스캔하여 엔트로피 복호화함으로써 현재 블록 내 변환 계수들에 관한 정보를 획득할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔(zigzag scan)에 따른 순서 또는 역방향의 대각 스캔(diagonal scan)에 따른 순서일 수 있다. 이에 제한되지 않고, 소정의 스캔 순서는 역방향의 수평 스캔에 따른 순서 및 수직 스캔에 따른 스캔 순서 등 다양한 스캔 순서일 수 있다. 소정의 스캔 순서는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표(예를 들어, 직교 좌표계의 x좌표(x는 정수)) 값 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표(예를 들어, 직교 좌표계의 y좌표(y는 정수)) 값 중 적어도 하나에 기초하여 결정될 수 있다. 예를 들어, 엔트로피 복호화부(105)는 수평방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 소정의 스캔 순서를 결정할 수 있다. 엔트로피 복호화부(105)는 수평 방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 복호화부(105)는 수직 방향 좌표 값이 수평방향 좌표 값보다 큰 경우 역방향의 수평 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. The entropy decoding unit 105 may obtain information about transform coefficients in the current block by scanning and decoding syntax element information regarding transform coefficients in the current block according to a predetermined scan order. The predetermined scan order may be a sequence according to a zigzag scan in the reverse direction or a sequence according to a diagonal scan in the reverse direction. The scan order is not limited thereto, and may be various scan orders such as an order according to a horizontal scan in the reverse direction and a scan order according to a vertical scan. The predetermined scan order is the value of the effective transform coefficient located at the rightmost position in the current block, and the value of the horizontal coordinate of the pixel (for example, the x-coordinate of the Cartesian coordinate system (x is an integer)) and the effective transform coefficient located at the bottom of the current block. It may be determined based on at least one of the values of the vertical coordinates of the pixel (eg, the y-coordinate of the Cartesian coordinate system (y is an integer)). For example, the entropy decoding unit 105 may determine a predetermined scan order based on the size of the horizontal coordinate value and the size of the vertical coordinate value. When the horizontal coordinate value is greater than the vertical coordinate value, the entropy decoding unit 105 may determine a reverse vertical scan order in a predetermined scan order. When the vertical coordinate value is greater than the horizontal coordinate value, the entropy decoding unit 105 may determine the horizontal scan order in the reverse direction as a predetermined scan order.

또는, 엔트로피 복호화부(105)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 우선 지그재그 스캔 순서(vertical first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 수직 우선 지그재그 스캔 순서에 대한 구체적인 내용은 도 6b를 참조하여 설명하겠다. 엔트로피 복호화부(105)는 수직방향 좌표 값이 수평방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 수평 우선 지그재그 스캔 순서에 대한 구체적인 내용은 도 6a를 참조하여 설명하겠다. 엔트로피 복호화부(105)는 수직방향 좌표 값이 수평 방향 좌표 값과 동일한 경우, 역방향의 수직 우선 지그재그 스캔 순서 및 수평 우선 지그재그 스캔 순서 중 하나를 소정의 스캔 순서로 결정할 수 있다.Alternatively, when the horizontal coordinate value is greater than the vertical coordinate value, the entropy decoding unit 105 may determine a reverse vertical first zigzag scan order in a predetermined scan order. The details of the vertical priority zigzag scan order will be described with reference to FIG. 6B. When the vertical coordinate value is greater than the horizontal coordinate value, the entropy decoding unit 105 may determine a horizontal first zigzag scan order in a predetermined scan order. The details of the horizontal priority zigzag scan order will be described with reference to FIG. 6A. When the vertical coordinate value is the same as the horizontal coordinate value, the entropy decoding unit 105 may determine one of a reverse vertical priority zigzag scan order and a horizontal priority zigzag scan order in a predetermined scan order.

또는, 엔트로피 복호화부(105)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 한편, 엔트로피 복호화부(105)는 수평 방향 좌표 값이 수직방향 좌표 값보다 크지 않은 경우, 역방향의 수직 우선 지그재그 스캔 순서(vertical first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. Alternatively, when the horizontal coordinate value is greater than the vertical coordinate value, the entropy decoding unit 105 may determine a horizontal first zigzag scan order in a predetermined scan order. Meanwhile, when the horizontal coordinate value is not greater than the vertical coordinate value, the entropy decoding unit 105 may determine a vertical first zigzag scan order in a predetermined scan order.

엔트로피 복호화부(105)는 변환 계수에 관한 정보를 스캔하기에 앞서, 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정할 수 있다. 이때, 사각형 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0인 변환 계수만을 포함할 수 있다.Before scanning the information about the transform coefficients, the entropy decoder 105 may determine a rectangular scan area including all the effective transform coefficients in the current block. In this case, the square scan area includes all the effective transform coefficients in the current block, and the remaining areas in the current block except the square scan area may include only 0 transform coefficients, not the effective transform coefficients.

엔트로피 복호화부(105)는 비트스트림으로부터 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 획득할 수 있다. 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수에 대한 수평방향 좌표에 관한 정보 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수에 대한 수직방향 좌표에 관한 정보를 포함할 수 있다. 다만 이에 제한되지 않고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수에 대한 수평방향의 좌표 값과 현재 블록 내 가장 하측에 위치하는 유효 변환 계수에 대한 수직방향 좌표 값 중 큰 값에 대한 정보만을 포함할 수 있다. 이때 특정되는 사각형 스캔 영역은 정사각형의 스캔 영역으로 비트스트림으로부터 획득된 하나의 방향에 대한 좌표 값을 이용하여 다른 방향의 좌표값을 결정하고, 상기 결정된 수평방향 좌표 값 및 수직방향 좌표 값을 기초로 정사각형의 스캔 영역이 결정될 수 있다. 이때, 상기 결정된 수평방향 좌표 값 및 수직방향 좌표 값은 사각형 스캔 영역의 우하측 모서리에 위치하는 픽셀의 좌표 값을 나타낼 수 있다. 즉, 비트스트림으로부터 하나의 방향에 대한 좌표만이 획득되는 경우, 엔트로피 복호화부(105)는 정사각형의 스캔 영역을 특정한다고 결정하고, 상기 획득된 하나의 방향에 대한 좌표 값을 기초로 정사각형 스캔 영역을 특정하는 좌표 값을 결정할 수 있고, 정사각형 스캔 영역을 특정하는 좌표 값을 기초로 정사각형 스캔 영역을 결정할 수 있다.The entropy decoding unit 105 may obtain information on coordinates specifying a rectangular scan area from the bitstream. The information on the coordinates specifying the rectangular scan area includes information on the horizontal coordinates for the effective transform coefficient located at the far right in the current block and information on the vertical coordinates for the effective transform coefficient located at the bottom in the current block. It may include. However, the present invention is not limited thereto, and the information on the coordinates that specify the rectangular scan area is the horizontal coordinate value of the effective transform coefficient located at the rightmost position in the current block and the vertical value of the effective transform coefficient located at the bottom of the current block. It may include only information on a larger one of the direction coordinate values. At this time, the specified rectangular scan area is a square scan area and determines coordinate values in the other direction using coordinate values for one direction obtained from the bitstream, and is based on the determined horizontal and vertical coordinate values. A square scan area can be determined. At this time, the determined horizontal and vertical coordinate values may represent the coordinate values of pixels located in the lower right corner of the rectangular scan area. That is, when only the coordinates for one direction are obtained from the bitstream, the entropy decoding unit 105 determines that the square scan area is specified, and the square scan area is based on the obtained coordinate values for one direction. A coordinate value specifying a may be determined, and a square scan region may be determined based on a coordinate value specifying a square scan area.

엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정할 수 있다.The entropy decoding unit 105 may determine a rectangular scan area including all effective transform coefficients in the current block based on information on coordinates specifying the rectangular scan area.

엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 소정의 이진화 방법에 대응하는 역이진화 방법을 기초로 이진 산술 복호화된 정보에 대한 역이진화를 수행하여 사각형 스캔 영역을 특정하는 좌표에 관한 역이진화 정보를 획득할 수 있고, 상기 좌표에 관한 역이진화 정보로부터 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분(color component) 및 빈 인덱스(bin index) 중 적어도 하나에 기초하여 결정될 수 있다. 컬러 성분은 휘도 성분 및 색차 성분을 포함할 수 있다. 빈 인덱스는 신택스 엘리먼트에 관한 빈 스트링 중 현재 이진 산술 복호화되는 빈의 위치를 나타내는 정보일 수 있다. 소정의 이진화 방법에 대응하는 역이진화 방법은 고정 길이(fixed length) 역이진화 방법 및 절삭형 단항(truncated unary) 역이진화 방법 중 적어도 하나일 수 있다. 예를 들어, 엔트로피 복호화부(105)는 이진 산술 복호화된 정보 중 제1 빈 스트링에 대해 고정 길이 역이진화 방법을 이용한 역이진화를 수행하여 제1 역이진화 정보를 획득하고, 이진 산술 복호화된 정보 중 제2 빈 스트링에 대해 절삭형 단항 역이진화 방법을 이용한 역이진화를 수행하여 제2 역이진화 정보를 획득할 수 있다. 엔트로피 복호화부(105)는 제1 역이진화 정보 및 제2 역이진화 정보를 기초로 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다.The entropy decoding unit 105 may perform binary arithmetic decoding based on a context model on information about coordinates specifying a rectangular scan area. The entropy decoding unit 105 may perform inverse binarization on the binary arithmetic decoded information based on an inverse binarization method corresponding to a predetermined binarization method to obtain inverse binarization information regarding coordinates that specify a rectangular scan area, Coordinates specifying a rectangular scan area may be obtained from the inverse binarization information regarding the coordinates. At this time, the context model may be determined based on at least one of a size of a current block, a color component of a current block, and a bin index. The color component may include a luminance component and a color difference component. The empty index may be information indicating the position of the current binary arithmetic decoded empty string among empty strings related to the syntax element. The inverse binarization method corresponding to a predetermined binarization method may be at least one of a fixed length inverse binarization method and a truncated unary inverse binarization method. For example, the entropy decoding unit 105 obtains the first inverse binarization information by performing inverse binarization using a fixed length inverse binarization method on the first empty string among the binary arithmetic decoded information, and among the arithmetic decoded information. The second inverse binarization information may be obtained by performing inverse binarization using a truncated unary inverse binarization method on the second empty string. The entropy decoding unit 105 may obtain coordinates that specify a rectangular scan area based on the first inverse binarization information and the second inverse binarization information.

엔트로피 복호화부(105)는 사각형 스캔 영역에서 스캔된 유효 변환 계수들에 관한 정보에 기초하여 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 현재 블록의 변환 계수들을 획득할 수 있다.The entropy decoding unit 105 performs at least one of binary arithmetic decoding and inverse binarization based on a context model on transform coefficients based on information on valid transform coefficients scanned in a rectangular scan region to convert transform coefficients of the current block. Can be obtained.

변환 계수들에 관한 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보인 경우, 엔트로피 복호화부(105)는 스캔된 변환 계수들에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 변환 계수들에 관한 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 변환 계수들에 관한 제1 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보이고, 변환 계수들에 관한 제2 정보가 현재 변환 계수와 관련된 이진화 파라메터 정보인 경우, 엔트로피 복호화부(105)는 변환 계수에 관한 제1 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다.When the information about the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, residual level absolute value information, and sign information of the current transform coefficient, the entropy decoding unit 105 scans the transform coefficients Binary arithmetic decoding based on the context model may be performed on the information on. The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing inverse binarization on the information on the transform coefficients that are binary arithmetic decoded. The first information about the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, residual level absolute value information, and sign information of the current transform coefficient, and the second information about the transform coefficients is the current transform. In the case of the binarization parameter information related to the coefficient, the entropy decoding unit 105 may perform binary arithmetic decoding based on the context model on the first information about the transform coefficient.

엔트로피 복호화부(105)는 이진 산술 복호화된 제1 정보에 대해 제2 정보에 포함된 이진화 파라메터 정보에 기초한 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 이진화 파라메터 정보는 현재 변환 계수에 대한 라이스 파라메터(Rice Parameter) 정보일 수 있다. 라이스 파라메터는 빈스트링에 포함된 프리픽스의 길이를 결정하기 위한 정보일 수 있다 이에 제한되지 않고, 이진화 파라메터 정보는 현재 변환 계수에 대한 다양한 이진화 파라메터 정보일 수 있다.The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing inverse binarization based on the binarization parameter information included in the second information with respect to the binary arithmetic decoded first information. The binarization parameter information may be Rice Parameter information for the current transform coefficient. The rice parameter may be information for determining the length of the prefix included in the binstring, but is not limited thereto, and the binarization parameter information may be various binarization parameter information for the current transform coefficient.

변환 계수들에 관한 제1 정보가 현재 변환 계수의 잔여레벨 절대값 정보 인 경우, 엔트로피 복호화부(105)는 현재 변환 계수의 잔여레벨 절대값 정보에 대해 (절삭형)(truncated) 라이스 이진화 방법에 대응하는 역이진화 방법 및 지수 골룸 이진화 방법에 대응하는 역이진화 방법을 이용하여 현재 변환 계수의 잔여 레벨 절대값에 관한 값을 획득할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 변환 계수의 잔여레벨 절대값 정보의 빈 스트링의 프리픽스(prefix)에 대해 라이스 파라메터에 기초한 라이스 이진화 방법에 대응하는 역이진화 방법을 이용한 역이진화를 수행하여 현재 변환 계수의 잔여레벨 절대값에 관한 제1값을 획득하고, 잔여레벨 절대값 정보의 빈 스트링의 서픽스(suffix)에 대해 지수 골룸 이진화 방법에 대응하는 역이진화 방법을 이용한 역이진화를 수행하여 현재 변환 계수의 잔여레벨 절대값에 관한 제2값을 획득하고 상기 현재 변환 계수의 잔여레벨 절대값에 관한 제1값 및 상기 현재 변환 계수의 잔여레벨 절대값에 관한 제2값을 기초로 현재 블록의 잔여레벨 절대값에 관한 값을 획득할 수 있다.When the first information on the transform coefficients is absolute level information of the residual level of the current transform coefficient, the entropy decoding unit 105 uses the (truncated) rice binarization method for the residual level absolute value information of the current transform coefficient. By using the corresponding inverse binarization method and the inverse binarization method corresponding to the exponential Gollum binarization method, it is possible to obtain a value for the absolute level of the residual level of the current transform coefficient. For example, the entropy decoding unit 105 performs inverse binarization using an inverse binarization method corresponding to a rice binarization method based on a rice parameter with respect to the prefix of the empty string of the residual level absolute value information of the current transform coefficient. Obtaining a first value of the residual level absolute value of the current transform coefficient, and performing inverse binarization using an inverse binarization method corresponding to the exponential Golem binarization method for the suffix of the empty string of residual level absolute value information. The current block is obtained based on a second value of the absolute value of the residual level of the current transform coefficient and a first value of the absolute value of the residual level of the current transform coefficient and a second value of the absolute value of the residual level of the current transform coefficient. A value related to the absolute value of the residual level of can be obtained.

상기 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.Among the context models for the transform coefficients, the context model for the first transform coefficient is information on at least one second transform coefficient that has been previously scanned according to a predetermined scan order, and the position and color of the first transform coefficient in the current block. It may be determined based on at least one of the component, information about the right or bottom peripheral transform coefficient and the scan position of the first transform coefficient.

예를 들어, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 위치의 우측 또는 하측의 변환 계수들 중 절대값이 0보다 큰 우측 또는 하측의 변환 계수의 개수에 기초하여 결정될 수 있다.For example, the context model for flag information indicating whether the first transform coefficient is greater than 0 is based on the number of right or lower transform coefficients whose absolute value is greater than 0 among the right or lower transform coefficients at a predetermined position. Can be determined.

이에 제한되지 않고, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수)개의 변환 계수들 중 절대값이 0보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다.The context model for flag information indicating whether the first transform coefficient is greater than 0 is not limited thereto, and an absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order has an absolute value greater than 0 It can be determined based on the number of large effective transform coefficients.

또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 제1 변환 계수의 위치 및 대응하는 주변 우측 또는 하측의 유효 계수 그룹 플래그들에 기초하여 결정될 수 있다.Alternatively, the context model for flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the position of the first transform coefficient in the corresponding coefficient group and corresponding effective right or lower valid coefficient group flags.

또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보(GT0 플래그 정보)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information indicating whether the first transform coefficient is greater than 0 (GT0 flag information) includes GT0 flag information of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order and the current block information. 1, the position of the transform coefficient, the color component and the adjacent right or lower n (n is a positive integer) GT0 flag information of the transform coefficients, whether the first transform coefficient in the scan area is the transform coefficient of the initial position in the scan area, In the scan order, the first transform coefficient may be determined based on at least one of whether the transform coefficient is a final position in the scan area.

제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 위치의 우측 또는 하측의 변환 계수 중 절대값이 1보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 1 is determined based on the number of right or lower valid transform coefficients whose absolute value is greater than 1 among the transform coefficients on the right or lower side of a predetermined position. Can.

이에 제한되지 않고, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 1 is not limited thereto, and the absolute value among n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order. It can be determined based on the number of effective transform coefficients greater than one.

또는, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 이전에 복호화된 GT1 플래그 정보 및 이전에 복호화된 그룹 내 GT1 플래그 정보에 기초하여 결정될 수 있다.Alternatively, a context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on previously decoded GT1 flag information in the corresponding coefficient group and GT1 flag information in the previously decoded group.

또는, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보(GT1 플래그 정보)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (GT1 flag information) indicating whether the absolute value of the first transform coefficient is greater than 1 is GT1 flag information of the n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order and the current Position of the first transform coefficient in the block, color component and GT1 flag information of n (n is a positive integer) transform coefficients of the adjacent right or lower side, whether the first transform coefficient is the transform coefficient of the initial position in the scan area, The first transform coefficient may be determined based on at least one of whether the transform coefficient is a final position in the scan area.

제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the number of valid transform coefficients on the right or lower side where the absolute value is greater than 2.

이에 제한되지 않고, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 2보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 2 is not limited thereto, and an absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 2 It can be determined based on the number of large effective transform coefficients.

또는, 제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 이전에 복호화된 GT2 플래그 정보 및 이전에 복호화된 그룹 내 GT2 플래그 정보에 기초하여 결정될 수 있다.Alternatively, a context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on previously decoded GT2 flag information in the corresponding coefficient group and GT2 flag information in the previously decoded group.

또는, 제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보(이하 GT2 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT2 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT2 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information indicating whether the absolute value of the first transform coefficient is greater than 2 (hereinafter referred to as GT2 flag information) is a GT2 flag of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order. Information and the position of the first transform coefficient in the current block, the color component and GT2 flag information of n (n is a positive integer) transform coefficients of the adjacent right or lower side, where the first transform coefficient is the transform coefficient of the first position in the scan area Whether or not the first transform coefficient is a transform coefficient of a final position in the scan area.

또는, 제1 변환 계수가 m(m은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보(이하 GTm 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (hereinafter referred to as GTm flag information) indicating whether the first transform coefficient is greater than m (m is an integer greater than 2) includes n (n is a positive integer) previously scanned according to a predetermined scan order. GTm flag information of the transform coefficients and the position, color component, and adjacent right or lower n (n is a positive integer) GTm flag information of the first transform coefficient in the current block, the first transform coefficient is in the scan area It may be determined based on at least one of whether the transform coefficient is the initial position or whether the first transform coefficient is the transform coefficient of the final position in the scan area.

한편, 제1 변환 계수의 잔여 레벨 값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다.Meanwhile, the binarization parameter information regarding the residual level value of the first transform coefficient may be determined based on the level absolute value of the neighboring effective transform coefficients to the right or lower of the first transform coefficient.

예를 들어, 제1 변환 계수에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 소정의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.For example, the binarization parameter information for the first transform coefficient may be determined based on the sum of the level absolute values of a predetermined peripheral effective transform coefficient to the right or lower of the first transform coefficient.

또는, 제1 변환 계수의 잔여 레벨 값에 관한 이진화 파라메터 정보는 이전에 부호화된 레벨 값에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information regarding the residual level value of the first transform coefficient may be determined based on the previously encoded level value.

또는, 제1 변환 계수에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 최초 위치의 계수인지 여부, 제1변환 계수의 위치가 스캔 영역에서의 상대 위치 등 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information related to the first transform coefficient includes the level of n (n is an integer) transform coefficients previously scanned according to a predetermined scan order, the position of the first transform coefficient in the current block, the color component, and the adjacent right side Or the level of n (n is a positive integer) transform coefficients at the lower side, whether the first transform coefficient is the transform coefficient of the first position in the scan area, or the first transform coefficient in the scan order is the last position in the scan area. Whether it is a transform coefficient, whether the first transform coefficient is a coefficient of an initial position in a coefficient group in the scan order, the position of the first transform coefficient can be determined based on at least one of a relative position in the scan area, and the like. .

엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [SRx,0](SRx는 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수평방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [SRx,Y](Y는 0보다 크고 SRy보다 작거나 같은 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. The entropy decoding unit 105 has a position of a transform coefficient currently scanned in the scan area [SRx,0] (SRx is an integer, SRx is a horizontal coordinate value of a right boundary pixel of the scan area based on the coordinates of the upper left corner of the scan area) And (SR is an integer greater than 0 and less than or equal to SRy, SRy is the lower boundary of the scan area based on the coordinates of the upper left corner of the scan area). If the transform coefficients of the position are all zero coefficients, the value of the GT0 flag information may be determined as 1 without obtaining the GT0 flag information of the transform coefficient currently scanned from the bitstream.

마찬가지로, 엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. Similarly, the entropy decoding unit 105 has the position of the transform coefficient currently scanned in the scan area [0,SRy] (SRy is an integer, SRy is the vertical coordinate of the lower boundary of the scan area based on the coordinates of the upper left corner of the scan area) Value, and [X,SRy] previously scanned according to a predetermined scan order (X is an integer greater than 0 and less than or equal to SRx, SRx is the right side of the scan area based on the coordinates of the upper left corner of the scan area) If the transform coefficients of the position are all zero coefficients, the value of the GT0 flag information can be determined as 1 without obtaining the GT0 flag information of the transform coefficient currently scanned from the bitstream. .

한편, 엔트로피 복호화부(105)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림에 유효 변환 계수의 GT1 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.Meanwhile, the entropy decoding unit 105 may determine the maximum number of GT1 flag information of the effective transform coefficient in the current block, and receive GT1 flag information in the current block from the bitstream within the determined maximum coefficient of the effective transform coefficient. . That is, when the maximum number of GT1 flag information of the effective transform coefficient received from the bitstream is received by the entropy decoder 105, the entropy decoder 105 later determines whether the bitstream has GT1 flag information of the effective transform coefficient. You may not check further.

엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT1 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT1 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT1 플래그 정보의 최대 개수 MaxCount_GT1를 하기와 같은 수학식 1에 기초하여 결정할 수 있다.The entropy decoding unit 105 may determine all non-zero effective transform coefficients as the maximum number of GT1 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum number of GT1 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT1 flag information MaxCount_GT1 based on Equation 1 below.

Figure pct00001
Figure pct00001

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. In this case, sizeSR may mean the size (width) of the rectangular scan area, and sizeSR may be (Sr_x+1)*(Sr_y+1). Sr_x may mean the horizontal coordinate of the rightmost effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_x may mean the horizontal direction coordinate of the right border pixel based on the coordinates of the upper left corner of the scan area. Sr_y may mean the vertical coordinate of the lowest effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_y may mean the vertical direction coordinate of the lower boundary pixel based on the coordinates of the upper left corner of the scan area.

K1은 스캔 영역의 크기와 GT1 플래그 간 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. Th1은 미리 정해진 임계값일 수 있다. 예를 들어, Th1은 16,8 일 수 있다. 다만 이에 제한되지 않고, K1 및 Th1은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.K1 may be an adjustment coefficient between the size of the scan area and the GT1 flag. For example, it may be an integer greater than one. Th1 may be a predetermined threshold. For example, Th1 may be 16,8. However, it is not limited thereto, and those skilled in the art can easily understand that K1 and Th1 may have various values.

엔트로피 복호화부(105)는 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT2 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT2 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림에 유효 변환 계수의 GT2 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.The entropy decoding unit 105 may determine the maximum number of GT2 flag information in the current block, and receive GT2 flag information in the current block from the bitstream within the determined maximum coefficient of the effective transform coefficient. That is, if the entropy decoding unit 105 receives the maximum number of GT2 flag information of the effective transform coefficients received from the bitstream, the entropy decoding unit 105 subsequently determines whether the bitstream has GT2 flag information of the effective transform coefficients. You may not check further.

엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT2 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT2 플래그 정보의 최대 개수 MaxCount_GT2를 하기와 같은 수학식 2에 기초하여 결정할 수 있다.The entropy decoding unit 105 may determine all non-zero effective transform coefficients as the maximum number of GT2 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum number of GT2 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT2 flag information MaxCount_GT2 based on Equation 2 below.

Figure pct00002
Figure pct00002

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 스캔 영역의 크기와 GT2 플래그 간 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. K2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the rectangular scan area, and sizeSR may be (Sr_x+1)*(Sr_y+1). Sr_x may mean the horizontal coordinate of the rightmost effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_x may mean the horizontal direction coordinate of the right border pixel based on the coordinates of the upper left corner of the scan area. Sr_y may mean the vertical coordinate of the lowest effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_y may mean the vertical direction coordinate of the lower boundary pixel based on the coordinates of the upper left corner of the scan area. K2 may be an adjustment factor between the size of the scan area and the GT2 flag. For example, it may be an integer greater than one. K2 may be a predetermined threshold. For example, Th2 may be 16,8. However, it is not limited thereto, and those skilled in the art can easily understand that K2 and Th2 may have various values.

엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득할 수 있다. 여기서, 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지 여부(또는, 계수 그룹에 0인 변환 계수만을 포함하고 있는지 여부)를 나타내는 플래그 정보일 수 있다. 상기 플래그 정보는 유효 계수 그룹 플래그(significant coefficient group flag) 정보라고 칭할 수 있다. 엔트로피 복호화부(105)는 비트스트림으로부터 획득된 현재 계수 그룹에 관한 정보를 기초로 현재 계수 그룹 내 변환 계수에 관한 정보를 스캔할 수 있다. 예를 들어, 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있지 않음을 나타내면, 엔트로피 복호화부(105)는 변환 계수에 대한 정보의 스캔없이 계수 그룹 내 변환 계수의 값을 0으로 유도할 수 있다. 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있음을 나타내면 엔트로피 복호화부(105)는 변환 계수에 대한 정보를 소정의 스캔 순서에 따라 스캔하여 계수 그룹 내 변환 계수를 획득할 수 있다.The entropy decoding unit 105 may obtain information about a coefficient group in a current block from a bitstream. Here, the information about the coefficient group may be flag information indicating whether the coefficient group includes at least one effective transform coefficient (or, whether the coefficient group includes only zero transform coefficients). The flag information may be referred to as significant coefficient group flag information. The entropy decoding unit 105 may scan information about transform coefficients in the current coefficient group based on information about the current coefficient group obtained from the bitstream. For example, if the information about the coefficient group indicates that the coefficient group does not include at least one effective transform coefficient, the entropy decoding unit 105 can determine the value of the transform coefficient in the coefficient group without scanning information about the transform coefficient. It can be derived to zero. If the information on the coefficient group indicates that the coefficient group includes at least one effective transform coefficient, the entropy decoding unit 105 scans the information on the transform coefficient according to a predetermined scan order to obtain transform coefficients within the coefficient group. Can.

이때, 엔트로피 복호화부(105)는 스캔 영역에 포함된 변환 계수들을 소정의 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다.At this time, the entropy decoding unit 105 may determine one coefficient group for each of the predetermined K (K is an integer) transform coefficients scanned according to a predetermined scan order of the transform coefficients included in the scan region. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order, which is the opposite direction of the predetermined reverse scan order.

따라서, 엔트로피 복호화부(105)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. Accordingly, the entropy decoding unit 105 may determine a coefficient group by scanning in a forward scan order from DC coefficients, which are coefficients adjacent to the upper left corner in the current block. At this time, if the number of transform coefficients included in the current block is not an integer multiple of K, the final coefficient group among the groups of coefficients scanned according to the forward scan order may include a smaller number of transform coefficients than K.

다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the present invention is not limited thereto, and the entropy decoding unit 105 performs a reverse scan order of scanning from the coefficient located at the lower right of the transform coefficients included in the current block to the coefficient located at the upper left of the transform coefficients included in the current block. Those skilled in the art can readily understand that a group of coefficients can be determined by scanning accordingly.

다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득하지 않고, 소정의 스캔 순서에 따라 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다. 계수 그룹을 결정하는 이유는 엔트로피 복호화부(105)가 계수 그룹에 따라 처리하는 동작(부호 데이터 숨김(Sign Data Hiding) 등의 동작)을 수행하기 위함이다. 엔트로피 복호화부(105)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 하나의 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 비트스트림으로부터 해당 계수 그룹에 관한 정보를 획득하지 않고, GT0 플래그 정보를 비트스트림으로부터 획득할 수 있다. However, the present invention is not limited thereto, and a person skilled in the art can easily understand that the entropy decoding unit 105 may determine the coefficient group according to a predetermined scan order without obtaining information about the coefficient group in the current block from the bitstream. The reason for determining the coefficient group is that the entropy decoding unit 105 performs an operation (eg, operation of sign data hiding) according to the coefficient group. The entropy decoding unit 105 does not acquire information about the corresponding coefficient group from the bitstream when one coefficient group among the coefficient groups scanned according to a predetermined scan order includes only one transform coefficient, and the GT0 flag Information can be obtained from a bitstream.

엔트로피 복호화부(105)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨긴다고 결정할 수 있다. 예를 들어, 엔트로피 복호화부는 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy decoding unit 105 may determine that the sign of at least one transform coefficient is hidden for each coefficient group included in the current block. For example, the entropy decoder may determine that the sign of one or two transform coefficients is hidden for each coefficient group included in the current block.

엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy decoding unit 105 may scan information on transform coefficients in a rectangular scan area according to a predetermined scan order. The predetermined scan order may include a reverse zigzag scan order, a reverse diagonal scan order, a reverse vertical scan order, and a horizontal scan order. However, it will be readily understood by those skilled in the art that the predetermined scan order is not limited to the above-mentioned reverse scan order and may include various reverse scan orders.

엔트로피 복호화부(105)는 스캔된 변환 계수들에 관한 정보에 기초하여 현재 블록의 변환 계수를 획득할 수 있다. The entropy decoding unit 105 may obtain the transform coefficient of the current block based on the information about the scanned transform coefficients.

영상 복원부(120)는 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. The image restoration unit 120 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block.

영상 복원부(120)는 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다.The image restoration unit 120 may restore the current block based on the residual block of the current block.

영상 복원부(120)는 현재 블록에 대하여 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있다. 영상 복원부(120)는 현재 블록의 예측 블록 및 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 즉, 영상 복원부(120)는 예측 블록에 포함된 픽셀들의 값과 레지듀얼 블록에 포함된 픽셀들의 값을 합하여 현재 블록에 포함된 픽셀들의 값을 복원할 수 있다. The image reconstructor 120 may perform inter prediction or intra prediction on the current block to generate a prediction block of the current block. The image reconstructor 120 may reconstruct the current block based on the prediction block of the current block and the residual block of the current block. That is, the image reconstructor 120 may restore the values of the pixels included in the current block by adding the values of the pixels included in the prediction block and the pixels included in the residual block.

비디오 복호화 장치(100)는 영상 복호화부(미도시)를 포함할 수 있고, 영상 복호화부(미도시)는 엔트로피 복호화부(105) 및 영상 복원부(120)를 포함할 수 있다. 영상 복호화부에 대해서는 도 1e를 참조하여 설명하도록 한다.The video decoding apparatus 100 may include an image decoding unit (not shown), and the image decoding unit (not shown) may include an entropy decoding unit 105 and an image restoration unit 120. The image decoding unit will be described with reference to FIG. 1E.

도 1b는 다양한 실시예에 따른 비디오 복호화 방법의 흐름도를 도시한다.1B is a flowchart of a video decoding method according to various embodiments.

S105 단계에서, 비디오 복호화 장치(100)는 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정할 수 있다. 이때, 사각형 스캔 영역을 특정하는 좌표는 현재 블록 내 유효 변환 계수들 중 가장 오른쪽에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 유효 변환 계수들 중 가장 아래쪽에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표를 나타낼 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 획득하고, 상기 획득된 사각형 스캔 영역을 특정하는 좌표를 기초로 사각형 스캔 영역을 결정할 수 있다.In operation S105, the video decoding apparatus 100 may determine a rectangular scan area including all effective transform coefficients in the current block. At this time, the coordinates specifying the rectangular scan area are the horizontal coordinates of the effective transform coefficient pixels located at the rightmost of the effective transform coefficients in the current block and the effective transform coefficient pixels located at the bottom of the effective transform coefficients in the current block. It can represent vertical coordinates. The video decoding apparatus 100 may obtain information on coordinates specifying a rectangular scan area from a bitstream, and determine the rectangular scan area based on the obtained coordinates specifying the rectangular scan area.

S110 단계에서, 비디오 복호화 장치(100)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서 또는 역방향의 대각 스캔 순서를 포함할 수 있다. 지그재그 스캔 순서는 수직 우선 지그재그 스캔 순서 또는 수평 우선 지그재그 스캔 순서를 포함할 수 있다.In operation S110, the video decoding apparatus 100 may scan information regarding transform coefficients in the rectangular scan area according to a predetermined scan order. The predetermined scan order may include a reverse zigzag scan order or a reverse diagonal scan order. The zigzag scan order may include a vertical priority zigzag scan order or a horizontal priority zigzag scan order.

S115 단계에서, 비디오 복호화 장치(100)는 스캔된 변환 계수들에 관한 정보에 기초하여 현재 블록의 변환 계수들을 획득할 수 있다.In operation S115, the video decoding apparatus 100 may obtain transform coefficients of the current block based on information about the scanned transform coefficients.

S120 단계에서, 비디오 복호화 장치(100)는 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다.In operation S120, the video decoding apparatus 100 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block.

S125 단계에서, 비디오 복호화 장치(100)는 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 비디오 복호화 장치(100)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성하고, 비디오 복호화 장치(100)는 현재 블록의 예측 블록에 포함된 픽셀 값과 레지듀얼 블록의 픽셀 값을 합하여 현재 블록의 복원 블록의 픽셀 값을 생성할 수 있다.In operation S125, the video decoding apparatus 100 may reconstruct the current block based on the residual block. The video decoding apparatus 100 performs inter prediction or intra prediction to generate a prediction block of the current block, and the video decoding apparatus 100 adds the pixel values of the current block to the pixel values of the residual block The pixel value of the reconstructed block of the current block can be generated.

도 1c는 다양한 실시예에 따른 비디오 부호화 장치의 블록도를 도시한다.1C is a block diagram of a video encoding apparatus according to various embodiments.

다양한 실시예에 따른 비디오 부호화 장치(150)는 엔트로피 부호화부(155) 및 비트스트림 생성부(170)를 포함한다.The video encoding apparatus 150 according to various embodiments includes an entropy encoding unit 155 and a bitstream generation unit 170.

엔트로피 부호화부(155)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트에 대해 엔트로피 부호화할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 변환 계수들에 관한 2차원 배열 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록 내 변환 계수들에 관한 1차원 배열 정보를 생성하고, 현재 블록 내 변환 계수들에 관한 1차원 배열 정보에 대해 엔트로피 부호화할 수 있다. The entropy encoding unit 155 may entropy encode a syntax element related to a transform coefficient in a current block. The entropy encoding unit 155 scans two-dimensional array information on transform coefficients in the current block according to a predetermined scan order to generate one-dimensional array information on transform coefficients in the current block, and transform coefficients in the current block. Entropy encoding can be performed on 1-dimensional array information about.

변환 계수에 관한 신택스 엘리먼트는 변환 계수가 소정의 값보다 큰 지를 나타내는 플래그일 수 있다. 이때, 소정의 값은 0보다 크거나 같은 값일 수 있다. 예를 들어, 0, 1 또는 2일 수 있다. 또한, 변환 계수에 관한 잔여 레벨(remaining level) 절대값을 나타내는 신택스 엘리먼트일 수 있다. 즉, 잔여 레벨(remaining level) 절대값은 변환 계수 절대값과 소정의 값보다 큰 지에 기초하여 결정된 소정의 절대값 간의 절대값 차이를 나타낼 수 있다. 또한, 유효 변환 계수에 관한 신택스 엘리먼트는 유효 변환 계수의 부호에 관한 신택스 엘리먼트일 수 있다. The syntax element for the transform coefficient may be a flag indicating whether the transform coefficient is greater than a predetermined value. At this time, the predetermined value may be greater than or equal to zero. For example, it can be 0, 1 or 2. Also, it may be a syntax element indicating the absolute value of the residual level with respect to the transform coefficient. That is, the absolute value of the residual level may represent an absolute value difference between the absolute value of the transform coefficient and a predetermined absolute value determined based on whether it is greater than a predetermined value. Further, the syntax element for the effective transform coefficient may be a syntax element for the sign of the effective transform coefficient.

먼저, 엔트로피 부호화부(155)는 신택스 엘리먼트에 대해 이진화를 수행하여 빈 스트링(bin)을 생성하고, 빈 스트링에 대해 이진 산술 부호화를 수행하여 신택스 엘리먼트에 대해 엔트로피 부호화된 정보를 생성할 수 있다. 이때, 이진화는 이진화부(160)에서 수행될 수 있고, 이진 산술 부호화는 이진 산술 부호화부(165)에서 수행될 수 있다.First, the entropy encoding unit 155 may perform binarization on the syntax element to generate an empty string, and perform binary arithmetic encoding on the empty string to generate entropy-encoded information on the syntax element. At this time, binarization may be performed by the binarization unit 160, and binary arithmetic encoding may be performed by the binary arithmetic encoding unit 165.

이진화부(160)는 소정의 신택스 엘리먼트에 대해 이진화를 수행하여 빈 스트링을 생성할 수 있다. 이진화부(160)는 소정의 이진화 방법에 기초하여 소정의 신택스 엘리먼트에 대해 이진화를 수행할 수 있다. 소정의 이진화 방법은 고정 길이(Fixed Length) 이진화 방법, 라이스(Rice) 이진화 방법, 지수-골룸(Exponential Golomb) 이진화 방법 및 골룸-라이스(Golomb-Rice) 이진화 방법을 포함할 수 있다. 또는 소정의 이진화 방법은 제1 이진화 방법 및 제2 이진화 방법이 결합된 이진화 방법일 수 있다. 예를 들어, 이진화부(160)는 신택스 엘리먼트의 일부에 대해서는 제1 이진화 방법에 기초하여 이진화하여 제1 빈 스트링(bin string)을 생성할 수 있고, 신택스 엘리먼트 중 다른 일부에 대해서는 제2 이진화 방법에 기초하여 이진화를 수행하여 제2 빈 스트링(bin string)을 생성할 수 있다. 이 때, 제1 빈 스트링은 신택스 엘리먼트의 빈 스트링의 일부이고, 제2 빈 스트링은 신택스 엘리먼트의 빈 스트링의 다른 일부일 수 있다. 빈 스트링의 일부는 프리픽스(prefix) 또는 서픽스(suffix)일 수 있다.The binarization unit 160 may binarize a given syntax element to generate an empty string. The binarization unit 160 may binarize a syntax element based on a predetermined binarization method. The predetermined binarization method may include a fixed length binarization method, a Rice binarization method, an exponential Golomb binarization method, and a Golomb-Rice binarization method. Alternatively, the predetermined binarization method may be a binarization method in which the first binarization method and the second binarization method are combined. For example, the binarization unit 160 may binarize a portion of the syntax element based on the first binarization method to generate a first bin string, and the second binarization method for other portions of the syntax elements On the basis of, binarization may be performed to generate a second empty string. In this case, the first empty string may be part of the empty string of the syntax element, and the second empty string may be another part of the empty string of the syntax element. The part of the empty string may be a prefix or suffix.

이진 산술 부호화부(165)는 소정의 신택스 엘리먼트에 관한 빈 스트링에 대해 소정의 컨텍스트 모델에 기초한 이진 산술 부호화를 수행할 수 있다. 또는, 이진 산술 부호화부(165)는 소정의 신택스 엘리먼트에 관한 빈 스트링에 대해 소정의 컨텍스트 모델 없이 이진 산술 부호화를 수행할 수 있다. 이때, 현재 이진 산술 부호화되는 빈(bin)에 대한 0 또는 1이 나올 확률은 0,5로 고정되고, 이러한 확률에 기초하여 이진 산술 부호화를 수행할 수 있다.The binary arithmetic encoding unit 165 may perform binary arithmetic encoding based on a predetermined context model on an empty string related to a given syntax element. Alternatively, the binary arithmetic encoding unit 165 may perform binary arithmetic encoding on an empty string related to a given syntax element without a predetermined context model. At this time, the probability that 0 or 1 will appear for a bin that is currently binary arithmetic encoded is fixed at 0,5, and binary arithmetic encoding may be performed based on the probability.

엔트로피 부호화부(155)는 현재 블록의 변환 계수를 획득할 수 있다. 즉, 비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수를 생성할 수 있다. 엔트로피 부호화부(155)는 상기 생성된 현재 블록의 변환 계수를 획득할 수 있다.The entropy encoding unit 155 may obtain a transform coefficient of the current block. That is, the video encoding apparatus 150 may perform inter prediction or intra prediction to generate a prediction block of the current block, and generate a residual block of the current block based on the original block of the current block and the prediction block of the current block can do. The video encoding apparatus 150 may generate transform coefficients of the current block by performing transform and quantization on the residual block of the current block. The entropy encoding unit 155 may obtain transform coefficients of the generated current block.

엔트로피 부호화부(155)는 현재 블록의 변환 계수에 관한 정보를 결정하고, 현재 블록의 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록의 변환 계수에 관한 1차원 배열 정보를 생성하고, 1차원 배열 정보에 대해 엔트로피 부호화를 수행할 수 있다. 소정의 스캔 순서는 역 지그재그 스캔에 따른 순서 또는 역 대각 스캔에 따른 순서일 수 있다 이에 제한되지 않고, 역 수평 스캔에 따른 순서 및 역 수직 스캔에 따른 스캔 순서 등 다양한 스캔 순서일 수 있다. 소정의 스캔 순서는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 중 적어도 하나에 기초하여 결정될 수 있다. 엔트로피 부호화부(155)는 수평방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 소정의 스캔 순서를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 수평 방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수직 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직 방향 좌표 값이 수평방향 좌표 값보다 큰 경우 역방향의 수평 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. The entropy encoding unit 155 determines information about transform coefficients of the current block, scans information about transform coefficients of the current block according to a predetermined scan order, and generates one-dimensional array information about transform coefficients of the current block. , Entropy encoding may be performed on one-dimensional array information. The predetermined scan order may be an order according to an inverse zigzag scan or an order corresponding to an inverse diagonal scan, but is not limited thereto, and may be various scan orders such as an order according to an inverse horizontal scan and an order corresponding to an inverse vertical scan. The predetermined scan order may be determined based on at least one of a horizontal direction coordinate of a valid transform coefficient pixel positioned at the rightmost position in the current block and a vertical direction of a valid transform coefficient pixel positioned at the lowermost position in the current block. The entropy encoding unit 155 may determine a predetermined scan order based on the size of the horizontal coordinate value and the size of the vertical coordinate value. For example, when the horizontal coordinate value is greater than the vertical coordinate value, the entropy encoding unit 155 may determine a reverse vertical scan order as a predetermined scan order. When the vertical coordinate value is greater than the horizontal coordinate value, the entropy encoding unit 155 may determine the horizontal scan order in the reverse direction as a predetermined scan order.

또는, 엔트로피 부호화부(155)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직방향 좌표 값이 수평방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직방향 좌표 값이 수평 방향 좌표 값과 동일한 경우, 역방향의 수직 우선 지그재그 스캔 순서 및 수평 우선 지그재그 스캔 순서 중 하나를 소정의 스캔 순서로 결정할 수 있다.Alternatively, when the horizontal coordinate value is greater than the vertical coordinate value, the entropy encoding unit 155 may determine a reverse vertical priority zigzag scan order as a predetermined scan order. When the vertical coordinate value is greater than the horizontal coordinate value, the entropy encoding unit 155 may determine the horizontal priority zigzag scan order in the reverse direction as a predetermined scan order. When the vertical coordinate value is the same as the horizontal coordinate value, the entropy encoding unit 155 may determine one of a reverse vertical priority zigzag scan order and a horizontal priority zigzag scan order in a predetermined scan order.

또는, 엔트로피 부호화부(155)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수평 방향 좌표 값이 수직방향 좌표 값보다 크지 않은 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다.Alternatively, when the horizontal coordinate value is greater than the vertical coordinate value, the entropy encoding unit 155 may determine a reverse horizontal priority zigzag scan order in a predetermined scan order. When the horizontal coordinate value is not greater than the vertical coordinate value, the entropy encoding unit 155 may determine a horizontal first zigzag scan order in a predetermined scan order.

먼저, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정할 수 있다. 이때, 사각형 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 변환 계수만을 포함할 수 있다. 엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표를 결정하고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 엔트로피 부호화할 수 있다. 즉, 엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트에 대해 소정의 이진화 방법에 기초한 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 여기서, 소정의 이진화 방법은 고정 길이 이진화 방법 및 절삭형 단항 이진화 방법 중 적어도 하나일 수 있다.First, the entropy encoding unit 155 may determine a rectangular scan area including all effective transform coefficients in the current block. At this time, the square scan area includes all the effective transform coefficients in the current block, and the remaining areas in the current block except the square scan area may include only transform coefficients having a value of 0, not the effective transform coefficients. The entropy encoding unit 155 may determine coordinates that specify a rectangular scan area, and entropy encode information about coordinates that specify the rectangular scan area. That is, the entropy encoding unit 155 may generate bin strings by performing binarization based on a predetermined binarization method on syntax elements related to coordinates that specify a rectangular scan region. Here, the predetermined binarization method may be at least one of a fixed length binarization method and a cutting-type unary binarization method.

엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트에 관한 빈 스트링에 대해 컨텍스트 모델에 기초한 이진 산술 부호화를 수행할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분 및 빈 인덱스 중 적어도 하나에 기초하여 결정될 수 있다. 컬러 성분은 휘도 성분 및 색차 성분을 포함할 수 있다. 빈 인덱스는 신택스 엘리먼트에 관한 빈 스트링 중 현재 이진 산술 부호화되는 빈의 위치를 나타내는 정보일 수 있다.The entropy encoding unit 155 may perform binary arithmetic encoding based on a context model on an empty string related to a syntax element related to a coordinate specifying a rectangular scan area. In this case, the context model may be determined based on at least one of a size of a current block, a color component of the current block, and an empty index. The color component may include a luminance component and a color difference component. The empty index may be information indicating the position of the current binary arithmetic-encoded bin among the empty strings related to the syntax element.

엔트로피 부호화부(155)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진화 및 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화 중 적어도 하나를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다.The entropy encoding unit 155 may generate entropy-encoded information by performing at least one of binarization and binary arithmetic encoding based on a context model for transform coefficients based on information about the scanned transform coefficients.

변환 계수들에 관한 제1 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보이고, 변환 계수들에 관한 제2 정보가 이진화 파라메터 정보인 경우, 엔트로피 부호화부(155)는 변환 계수들에 관한 제1 정보에 대해 제2 정보에 기초한 이진화를 수행하여 제1 정보에 관한 빈 스트링(bin string)을 생성할 수 있다. 엔트로피 부호화부(155)는 제1 정보에 관한 빈 스트링(bin string)에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다.The first information about the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, residual level absolute value information, and sign information of the current transform coefficient, and the second information about the transform coefficients is a binarization parameter. In the case of information, the entropy encoding unit 155 may generate bin strings related to the first information by performing binarization based on the second information on the first information regarding the transform coefficients. The entropy encoding unit 155 may generate entropy-encoded information by performing binary arithmetic encoding on an empty string related to the first information.

제 2 정보는 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치, 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다. 예를 들어, 제1 변환 계수에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다. 제1 변환 계수에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.The second information includes information about at least one second transform coefficient that has been previously scanned according to a predetermined scan order, location of the first transform coefficient in the current block, color components, information about the right or lower peripheral transform coefficients, and the second information. It may be determined based on at least one of the scan positions of one transform coefficient. For example, the binarization parameter information regarding the first transform coefficient may be determined based on the level absolute value of the neighboring effective transform coefficients to the right or lower of the first transform coefficient. The binarization parameter information regarding the first transform coefficient may be determined based on the sum of the absolute levels of the levels of the neighboring effective transform coefficients on the right or bottom of the first transform coefficient.

또는, 제1 변환 계수에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information related to the first transform coefficient includes the level of n (n is an integer) transform coefficients previously scanned according to a predetermined scan order, the position of the first transform coefficient in the current block, the color component, and the adjacent right side Or the level of n (n is a positive integer) transform coefficients at the lower side, whether the first transform coefficient is the transform coefficient of the first position in the scan area, or the first transform coefficient in the scan order is the last position in the scan area. The coefficient may be determined based on at least one of whether the coefficient is a coefficient, and whether the first coefficient is the coefficient of the first position in the coefficient group in the scan order.

변환 계수들에 관한 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보인 경우, 엔트로피 부호화부(155)는 변환 계수들에 관한 정보에 대해 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 엔트로피 부호화부(155)는 빈 스트링(bin string)에 대해 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화를 수행하여 이진 산술 부호화된 정보를 생성할 수 있다. 상기 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치, 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.When the information about the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, residual level absolute value information, and sign information of the current transform coefficient, the entropy encoding unit 155 may be configured to determine the transform coefficients. Binarization may be performed on information to generate an empty string. The entropy encoding unit 155 may generate binary arithmetic coded information by performing binary arithmetic encoding based on a context model for transform coefficients on an empty string. Among the context models for the transform coefficients, the context model for the first transform coefficient is information about at least one second transform coefficient that has been previously scanned according to a predetermined scan order, the position and color of the first transform coefficient in the current block. It may be determined based on at least one of the component, information about the right or bottom peripheral transform coefficient and the scan position of the first transform coefficient.

제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 0보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the number of right or lower valid transform coefficients whose absolute value is greater than zero.

이에 제한되지 않고, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 0보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 0 is not limited thereto, and an absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 0 It can be determined based on the number of large effective transform coefficients.

제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 1보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 1 may be determined based on the number of right or lower valid transform coefficients whose absolute value is greater than 1.

이에 제한되지 않고, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 1 is not limited thereto, and an absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 1 It can be determined based on the number of large effective transform coefficients.

제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 2 may be determined based on the number of right or lower valid transform coefficients whose absolute value is greater than 2.

이에 제한되지 않고, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 2보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 2 is not limited thereto, and an absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 2 It can be determined based on the number of large effective transform coefficients.

엔트로피 부호화부(155)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [SRx,0](SRx는 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수평방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [SRx,Y](Y는 0보다 크고 SRy보다 작거나 같은 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 현재 스캔되는 변환 계수의 GT0 플래그 정보를 생성하지 않을 수 있다.The entropy encoding unit 155 has a position of a transform coefficient currently scanned in the scan area [SRx,0] (SRx is an integer, SRx is a horizontal coordinate value of a right boundary pixel of the scan area based on the coordinates of the upper left corner of the scan area) And (SR is an integer greater than 0 and less than or equal to SRy, SRy is the lower boundary of the scan area based on the coordinates of the upper left corner of the scan area). If the transform coefficients of the position are all zero coefficients, GT0 flag information of the currently scanned transform coefficient may not be generated.

마찬가지로, 엔트로피 부호화부(155)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 현재 스캔되는 변환 계수의 GT0 플래그 정보를 생성하지 않을 수 있다.Similarly, the entropy encoding unit 155 has the position of the transform coefficient currently scanned in the scan area [0,SRy] (SRy is an integer, SRy is the vertical coordinate of the lower boundary of the scan area based on the coordinates of the upper left corner of the scan area) Value, and [X,SRy] previously scanned according to a predetermined scan order (X is an integer greater than 0 and less than or equal to SRx, SRx is the right side of the scan area based on the coordinates of the upper left corner of the scan area) If the transform coefficients of the position are all zero coefficients, GT0 flag information of the currently scanned transform coefficient may not be generated.

한편, 엔트로피 부호화부(155)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 생성할 수 있다. 즉, 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 생성하면, 이후에 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 더 이상 생성하지 않을 수 있다.Meanwhile, the entropy encoding unit 155 may determine the maximum number of GT1 flag information of the effective transform coefficients in the current block, and generate GT1 flag information in the current block within the determined maximum coefficient of the effective transform coefficients. That is, when the maximum number of GT1 flag information of the effective transform coefficient is generated by the entropy encoder 155, the entropy encoder 155 may no longer generate GT1 flag information of the effective transform coefficient.

엔트로피 부호화부(155)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT1 플래그 정보의 최대 개수로 결정할 수 있다. 또는 엔트로피 부호화부(155)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT1 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 GT1 플래그 정보의 최대 개수 MaxCount_GT1를 하기와 같은 수학식 3에 기초하여 결정할 수 있다.The entropy encoding unit 155 may determine all non-zero effective transform coefficients as the maximum number of GT1 flag information in the current block. Alternatively, the entropy encoding unit 155 may determine the maximum number of GT1 flag information in the current block based on the size of the scan area. For example, the entropy encoder 155 may determine the maximum number of GT1 flag information MaxCount_GT1 based on Equation 3 below.

Figure pct00003
Figure pct00003

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K1은 스캔 영역의 크기와 GT1 플래그 간 조절 계수일 수 있다. 예를 들어, K1은 1보다 큰 정수일 수 있다. Th1은 미리 정해진 임계값일 수 있다. 예를 들어, Th1은 16,8 일 수 있다. 다만 이에 제한되지 않고, K1 및 Th1은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the rectangular scan area, and sizeSR may be (Sr_x+1)*(Sr_y+1). Sr_x may mean the horizontal coordinate of the rightmost effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_x may mean the horizontal direction coordinate of the right border pixel based on the coordinates of the upper left corner of the scan area. Sr_y may mean the vertical coordinate of the lowest effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_y may mean the vertical direction coordinate of the lower boundary pixel based on the coordinates of the upper left corner of the scan area. K1 may be an adjustment coefficient between the size of the scan area and the GT1 flag. For example, K1 may be an integer greater than 1. Th1 may be a predetermined threshold. For example, Th1 may be 16,8. However, it is not limited thereto, and those skilled in the art can easily understand that K1 and Th1 may have various values.

엔트로피 부호화부(155)는 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT2 플래그 정보를 생성할 수 있다. 즉, 엔트로피 부호화부(155)는 유효 변환 계수의 GT2 플래그 정보를 최대 개수만큼 생성하면, 이후에 엔트로피 부호화부(155)는 유효 변환 계수의 GT2 플래그 정보를 더 이상 생성하지 않을 수 있다.The entropy encoding unit 155 may determine the maximum number of GT2 flag information in the current block, and generate GT2 flag information in the current block within the determined maximum coefficient of the effective transform coefficient. That is, if the entropy encoding unit 155 generates the maximum number of GT2 flag information of the effective transform coefficient, the entropy encoding unit 155 may no longer generate GT2 flag information of the effective transform coefficient.

엔트로피 부호화부(155)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT2 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 부호화부(155)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 GT2 플래그 정보의 최대 개수 MaxCount_GT2를 하기와 같은 수학식 4에 기초하여 결정할 수 있다.The entropy encoding unit 155 may determine all non-zero effective transform coefficients as the maximum number of GT2 flag information in the current block. Alternatively, the entropy encoding unit 155 may determine the maximum number of GT2 flag information in the current block based on the size of the scan area. For example, the entropy encoder 155 may determine the maximum number of GT2 flag information MaxCount_GT2 based on Equation 4 below.

Figure pct00004
Figure pct00004

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 스캔 영역의 크기와 GT2 플래그 간 조절 계수일 수 있다. 예를 들어, K2는 1보다 큰 정수일 수 있다. Th2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the rectangular scan area, and sizeSR may be (Sr_x+1)*(Sr_y+1). Sr_x may mean the horizontal coordinate of the rightmost effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_x may mean the horizontal direction coordinate of the right border pixel based on the coordinates of the upper left corner of the scan area. Sr_y may mean the vertical coordinate of the lowest effective transform coefficient pixel based on the coordinates of the upper left corner of the scan area. In other words, Sr_y may mean the vertical direction coordinate of the lower boundary pixel based on the coordinates of the upper left corner of the scan area. K2 may be an adjustment factor between the size of the scan area and the GT2 flag. For example, K2 may be an integer greater than 1. Th2 may be a predetermined threshold. For example, Th2 may be 16,8. However, it is not limited thereto, and those skilled in the art can easily understand that K2 and Th2 may have various values.

엔트로피 부호화부(155)는 현재 블록 내 계수 그룹에 관한 정보를 생성할 수 있다. 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지를 나타내는 플래그 정보일 수 있다. 이때, 엔트로피 부호화부(155)는 스캔 영역에 포함된 변환 계수들을 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다. 여기서 말하는 소정의 역방향 스캔 순서는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 순서를 의미할 수 있다.The entropy encoding unit 155 may generate information about coefficient groups in the current block. The information on the coefficient group may be flag information indicating whether the coefficient group includes at least one effective transform coefficient. At this time, the entropy encoding unit 155 may determine one coefficient group for each of the predetermined K (K is an integer) transform coefficients scanned according to the scan order of the transform coefficients included in the scan region. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order, which is the opposite direction of the predetermined reverse scan order. Here, the predetermined reverse scan order may mean an order of scanning from the coefficient located at the lower right of the transform coefficients included in the current block to the coefficient located at the upper left of the transform coefficients included in the current block.

따라서, 엔트로피 부호화부(155)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수으로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. 다만 이에 제한되지 않고, 엔트로피 부호화부(155)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.Therefore, the entropy encoding unit 155 may determine a coefficient group by scanning in a forward scan order from DC coefficients, which are coefficients adjacent to the upper left corner in the current block. At this time, if the number of transform coefficients included in the current block is not an integer multiple of K, the final coefficient group among the groups of coefficients scanned according to the forward scan order may include a smaller number of transform coefficients than K. However, the present invention is not limited thereto, and the entropy encoding unit 155 scans a reverse scan order from a coefficient located in the lower right of the transform coefficients included in the current block to a coefficient located in the upper left of the transform coefficients included in the current block. Those skilled in the art can readily understand that a group of coefficients can be determined by scanning accordingly.

엔트로피 부호화부(155)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 하나의 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 해당 계수 그룹에 관한 정보를 생성하지 않고, GT0 플래그 정보를 바로 생성할 수 있다.When one coefficient group among the groups of coefficients scanned according to a predetermined scan order includes only one transform coefficient, the entropy encoding unit 155 does not generate information about the coefficient group, and immediately displays GT0 flag information. Can be created.

엔트로피 부호화부(155)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다.. 예를 들어, 엔트로피 부호화부(155)는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy encoding unit 155 may determine whether to hide the sign of at least one transform coefficient for each coefficient group included in the current block. For example, in the case of the entropy encoding unit 155 Accordingly, it can be determined that the sign of one or two transform coefficients is hidden for each coefficient group included in the current block.

엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy encoding unit 155 may scan information on transform coefficients within a rectangular scan area according to a predetermined scan order. The predetermined scan order may include a reverse zigzag scan order, a reverse diagonal scan order, a reverse vertical scan order, and a horizontal scan order. However, it will be readily understood by those skilled in the art that the predetermined scan order is not limited to the above-mentioned reverse scan order and may include various reverse scan orders.

비트스트림 생성부(170)는 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 즉, 비트스트림 생성부(170)는 엔트로피 부호화부(155)에서 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다.The bitstream generator 170 may generate a bitstream including entropy-encoded information. That is, the bitstream generator 170 may scan the information about the transform coefficients in the entropy encoder 155 and generate a bitstream including the entropy-coded information based on the information about the scanned transform coefficients. .

비트스트림 생성부(170)는 변환 계수에 관한 정보를 스캔하기 위한 영역인 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다. 이때, 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 현재 블록에 포함된 유효 변환 계수 픽셀들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 및 현재 블록에 포함된 유효 변환 계수 픽셀들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 정보를 포함할 수 있다. 다만 이에 제한되지 않고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 현재 블록에 포함된 유효 변환 계수 픽셀들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 및 현재 블록에 포함된 유효 변환 계수 픽셀들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값 중 큰 값을 갖는 좌표 값을 나타내는 정보를 포함할 수 있다. 즉, 비트스트림 생성부(170)은 경우에 따라 유효 변환 계수 픽셀들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 및 현재 블록에 포함된 유효 변환 계수 픽셀들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값이 서로 다른 경우에도 직사각형 스캔 영역을 결정하지 않고, 그 중 큰 값에 기초하여 정사각형의 스캔 영역을 결정할 수 있다. 이 경우, 직사각형 스캔 영역보다는 큰 정사각형의 스캔 영역이 결정될 수 있으나, 비디오 부호화 장치(150)는 하나의 방향에 대한 좌표 값만을 나타내는 정보만을 전송하게 됨으로써 시그널링하는 비트수를 줄일 수 있다.The bitstream generation unit 170 may generate a bitstream including information on coordinates that specify a rectangular scan area, which is an area for scanning information on transform coefficients. At this time, information on the coordinates specifying the rectangular scan area includes the horizontal coordinate values of the effective transform coefficient pixels located at the rightmost of the effective transform coefficient pixels included in the current block and the effective transform coefficient pixels included in the current block. It may include information indicating the vertical coordinate value of the effective transform coefficient pixel located at the bottom. However, the present invention is not limited thereto, and the information on the coordinates specifying the rectangular scan area includes the horizontal coordinate values of the effective transform coefficient pixels located at the rightmost of the effective transform coefficient pixels included in the current block and the effective transform included in the current block It may include information indicating a coordinate value having a larger value among the vertical coordinate values of the effective transform coefficient pixel located at the bottom of the coefficient pixels. That is, the bitstream generation unit 170 may be located at the lowermost of the horizontal coordinate values of the effective transform coefficient pixels located at the rightmost of the effective transform coefficient pixels and the effective transform coefficient pixels included in the current block. Even when the vertical coordinate values of the effective transform coefficient pixels are different, the rectangular scan area may not be determined, but the square scan area may be determined based on the larger value. In this case, a square scan area larger than a rectangular scan area may be determined, but the video encoding apparatus 150 may reduce the number of signaling bits by transmitting only information indicating coordinate values for one direction.

비디오 부호화 장치(150)는 영상 부호화부(미도시)를 포함할 수 있고, 영상 부호화부(미도시)는 엔트로피 부호화부(155) 및 비트스트림 생성부(170)를 포함할 수 있다. 영상 부호화부에 대해서는 도 1f를 참조하여 설명하도록 한다.The video encoding apparatus 150 may include an image encoding unit (not shown), and the image encoding unit (not shown) may include an entropy encoding unit 155 and a bitstream generation unit 170. The video encoding unit will be described with reference to FIG. 1F.

도 1d는 다양한 실시예에 따른 비디오 부호화 방법의 흐름도를 도시한다.1D is a flowchart of a video encoding method according to various embodiments.

도 1d를 참조하면, S150 단계에서, 비디오 부호화 장치(150)는 현재 블록의 변환 계수들을 획득할 수 있다. 현재 블록은 도 10 내지 도 23을 참조하여 설명되는 영상을 부/복호화하는 과정에서 이용할 수 있는 데이터 단위일 수 있다.Referring to FIG. 1D, in step S150, the video encoding apparatus 150 may obtain transform coefficients of the current block. The current block may be a data unit that can be used in the process of encoding/decoding an image described with reference to FIGS. 10 to 23.

비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수들을 생성할 수 있다.The video encoding apparatus 150 may perform inter prediction or intra prediction to generate a prediction block of the current block, and generate a residual block of the current block based on the original block of the current block and the prediction block of the current block have. The video encoding apparatus 150 may generate transform coefficients of the current block by performing transform and quantization on the residual block of the current block.

S155 단계에서, 비디오 부호화 장치(150)는 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정할 수 있다. 이때, 사각형 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 계수만을 포함할 수 있다. 비디오 부호화 장치(150)는 사각형 스캔 영역을 특정하는 좌표를 결정하고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 엔트로피 부호화할 수 있다. 즉, 비디오 부호화 장치(150)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트 정보에 대해 소정의 이진화 방법에 기초한 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 여기서, 소정의 이진화 방법은 고정 길이 이진화 방법 및 절삭형 단항 이진화 방법 중 적어도 하나일 수 있다. 비디오 부호화 장치(150)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스에 관한 빈 스트링에 대해 컨텍스트 모델에 기초한 이진 산술 부호화를 수행할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분 및 빈 인덱스 중 적어도 하나에 기초하여 결정될 수 있다.In operation S155, the video encoding apparatus 150 may determine a rectangular scan area including all effective transform coefficients in the current block. In this case, the square scan area includes all the effective transform coefficients in the current block, and the remaining areas in the current block except the square scan area may include only coefficients having a value of 0, not the effective transform coefficients. The video encoding apparatus 150 may determine coordinates that specify a rectangular scan area and entropy encode information about coordinates that specify the rectangular scan area. That is, the video encoding apparatus 150 may generate bin strings by performing binarization based on a predetermined binarization method on syntax element information related to coordinates specifying a rectangular scan area. Here, the predetermined binarization method may be at least one of a fixed length binarization method and a cutting-type unary binarization method. The video encoding apparatus 150 may perform binary arithmetic encoding based on a context model on an empty string related to syntax related to a coordinate specifying a rectangular scan area. In this case, the context model may be determined based on at least one of a size of a current block, a color component of the current block, and an empty index.

S160 단계에서, 비디오 부호화 장치(150)는 사각형 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 변환 계수에 관한 정보는 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보를 포함할 수 있다. 이때, 소정의 값은 0, 1, 2 중 적어도 하나일 수 있다. 변환 계수의 잔여 레벨 절대값 정보, 변환 계수의 부호 정보, 이진화 파라메터 정보 중 적어도 하나를 포함할 수 있다. 이진화 파라메터는 라이스 파라메터 및 다양한 이진화 파라메터 중 적어도 하나를 포함할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.In operation S160, the video encoding apparatus 150 may scan information on transform coefficients included in the rectangular scan area according to a predetermined scan order. The information regarding the transform coefficient may include flag information indicating whether the transform coefficient is greater than a predetermined value. At this time, the predetermined value may be at least one of 0, 1, and 2. It may include at least one of residual level absolute value information of the transform coefficient, sign information of the transform coefficient, and binarization parameter information. The binarization parameter may include at least one of a rice parameter and various binarization parameters. The predetermined scan order may include a reverse zigzag scan order, a reverse diagonal scan order, a reverse vertical scan order, and a horizontal scan order. However, it will be readily understood by those skilled in the art that the predetermined scan order is not limited to the above-mentioned reverse scan order and may include various reverse scan orders.

S165 단계에서, 비디오 부호화 장치(150)는 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화하여 엔트로피 부호화된 정보를 생성할 수 있다. 비디오 부호화 장치(150)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진화 및 컨텍스트 모델에 기초한 이진 산술 부호화 중 적어도 하나를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다. 변환 계수들에 관한 제1 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보이고, 유효 변환 계수들에 관한 제2 정보가 이진화 파라메터 정보인 경우, 비디오 부호화 장치(150)는 유효 변환 계수들에 관한 제1 정보에 대해 제2 정보에 기초한 이진화를 수행하여 제1 정보에 관한 빈 스트링(bin string)을 생성할 수 있다. 비디오 부호화 장치(150)는 제1 정보에 관한 빈 스트링(bin string)에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다. In operation S165, the video encoding apparatus 150 may entropy-encode the generated entropy-encoded information based on the information about the scanned transform coefficients. The video encoding apparatus 150 may generate entropy-encoded information by performing at least one of binarization and binary arithmetic encoding based on a context model based on information about the scanned transform coefficients. The first information about the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, the residual level absolute value information and the sign information of the current transform coefficient, and the second information about the effective transform coefficients is binarized In the case of parameter information, the video encoding apparatus 150 may generate bin strings related to the first information by performing binarization based on the second information on the first information regarding the effective transform coefficients. The video encoding apparatus 150 may generate entropy-encoded information by performing binary arithmetic encoding on an empty string related to the first information.

제 2 정보는 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다. 한편, 제1 변환 계수에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다. 예를 들어, 제1 변환 계수에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.The second information includes information about at least one second transform coefficient that has been previously scanned according to a predetermined scan order, location and color components of the first transform coefficient in the current block, and information about the peripheral transform coefficients on the right or lower side. It may be determined based on at least one of the scan positions of one transform coefficient. Meanwhile, the binarization parameter information regarding the first transform coefficient may be determined based on the level absolute value of the neighboring effective transform coefficients to the right or lower of the first transform coefficient. For example, the binarization parameter information regarding the first transform coefficient may be determined based on the sum of the level absolute values of the neighboring effective transform coefficients to the right or lower of the first transform coefficient.

변환 계수들에 관한 정보가 현재 유효 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 유효 변환 계수의 부호 정보인 경우, 비디오 부호화 장치(150)는 변환 계수들에 관한 정보에 대해 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 비디오 부호화 장치(150)는 빈 스트링(bin string)에 대해 유효 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화를 수행하여 이진 산술 부호화된 정보를 생성할 수 있다. 상기 유효 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.When the information on the transform coefficients is information indicating whether an absolute value of the current effective transform coefficient is greater than a predetermined value, residual level absolute value information, and sign information of the current valid transform coefficient, the video encoding apparatus 150 converts the transform coefficients Binarization may be performed on information about to generate an empty string. The video encoding apparatus 150 may generate binary arithmetic coded information by performing binary arithmetic encoding based on a context model regarding effective transform coefficients for an empty string. Among the context models for the effective transform coefficients, the context model for the first transform coefficient includes information on at least one second transform coefficient previously scanned according to a predetermined scan order, the position of the first transform coefficient in the current block, and It may be determined based on at least one of a color component, information about a right or bottom peripheral transform coefficient, and a scan position of the first transform coefficient.

S170 단계에서, 비디오 부호화 장치(150)는 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 비디오 부호화 장치(150)는 엔트로피 부호화부(155)에서 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. In operation S170, the video encoding apparatus 150 may generate a bitstream including entropy-encoded information. The video encoding apparatus 150 may scan the information about the transform coefficients from the entropy encoder 155 and generate a bitstream including the entropy-coded information based on the information about the scanned transform coefficients.

또한, 비디오 부호화 장치(150)는 변환 계수에 관한 정보를 스캔하기 위한 영역인 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다.Also, the video encoding apparatus 150 may generate a bitstream including information on coordinates that specify a rectangular scan area, which is an area for scanning information on transform coefficients.

도 1e 는 다양한 실시예에 따른 영상 복호화부(6000)의 블록도를 도시한다.1E is a block diagram of an image decoder 6000 according to various embodiments.

다양한 실시예에 따른 영상 복호화부(6000)는, 비디오 복호화 장치(100)의 영상 복호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image decoding unit 6000 according to various embodiments performs operations that are performed by the image decoding unit (not shown) of the video decoding apparatus 100 to encode image data.

도 1e를 참조하면, 엔트로피 복호화부(6150)는 비트스트림(6050)으로부터 복호화 대상인 부호화된 영상 데이터 및 복호화를 위해 필요한 부호화 정보를 파싱한다. 부호화된 영상 데이터는 양자화된 변환계수로서, 역양자화부(6200) 및 역변환부(6250)는 양자화된 변환 계수로부터 레지듀 데이터를 복원한다. 도 1e의 엔트로피 복호화부(6150)는 도 1a의 엔트로피 복호화부(105)에 대응될 수 있다.Referring to FIG. 1E, the entropy decoding unit 6150 parses the encoded image data to be decoded and encoding information necessary for decoding from the bitstream 6050. The coded image data is a quantized transform coefficient, and the inverse quantization unit 6200 and the inverse transform unit 6250 recover residual data from the quantized transform coefficients. The entropy decoding unit 6150 of FIG. 1E may correspond to the entropy decoding unit 105 of FIG. 1A.

인트라 예측부(6400)는 블록 별로 인트라 예측을 수행한다. 인터 예측부(6350)는 블록 별로 복원 픽처 버퍼(6300)에서 획득된 참조 영상을 이용하여 인터 예측을 수행한다. 인트라 예측부(6400) 또는 인터 예측부(6350)에서 생성된 각 블록에 대한 예측 데이터와 레지듀 데이터가 더해짐으로써 현재 영상(6050)의 블록에 대한 공간 영역의 데이터가 복원되고, 디블로킹부(6450) 및 SAO 수행부(6500)는 복원된 공간 영역의 데이터에 대해 루프 필터링을 수행하여 필터링된 복원 영상(6600)을 출력할 수 있다. 또한, 복원 픽쳐 버퍼(6300)에 저장된 복원 영상들은 참조 영상으로서 출력될 수 있다.The intra prediction unit 6400 performs intra prediction for each block. The inter prediction unit 6350 performs inter prediction by using a reference image obtained from the reconstructed picture buffer 6300 for each block. By adding prediction data and residual data for each block generated by the intra prediction unit 6400 or the inter prediction unit 6350, the data of the spatial region for the block of the current image 6050 is restored, and the deblocking unit ( 6450) and the SAO performing unit 6500 may perform a loop filtering on the data of the reconstructed spatial region to output the filtered reconstructed image 6600. Also, reconstructed images stored in the reconstructed picture buffer 6300 may be output as reference images.

비디오 복호화 장치(100)의 복호화부(미도시)에서 영상 데이터를 복호화하기 위해, 다양한 실시예에 따른 영상 복호화부(6000)의 단계별 작업들이 블록별로 수행될 수 있다. In order to decode image data in a decoding unit (not shown) of the video decoding apparatus 100, step-by-step operations of the image decoding unit 6000 according to various embodiments may be performed block by block.

도 1f는 다양한 실시예에 따른 영상 부호화부의 블록도를 도시한다. 1F is a block diagram of an image encoder according to various embodiments.

다양한 실시예에 따른 영상 부호화부(7000)는, 비디오 부호화 장치(150)의 영상 부호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image encoding unit 7000 according to various embodiments performs operations that are performed by the image encoding unit (not shown) of the video encoding apparatus 150 to encode image data.

즉, 인트라 예측부(7200)는 현재 영상(7050) 중 블록별로 인트라 예측을 수행하고, 인터 예측부(7150)는 블록별로 현재 영상(7050) 및 복원 픽처 버퍼(7100)에서 획득된 참조 영상을 이용하여 인터 예측을 수행한다. That is, the intra prediction unit 7200 performs intra prediction for each block among the current images 7050, and the inter prediction unit 7150 performs reference images obtained from the current image 7050 and the reconstructed picture buffer 7100 for each block. To perform inter prediction.

인트라 예측부(7200) 또는 인터 예측부(7150)로부터 출력된 각 블록에 대한 예측 데이터를 현재 영상(7050)의 인코딩되는 블록에 대한 데이터로부터 빼줌으로써 레지듀 데이터를 생성하고, 변환부(7250) 및 양자화부(7300)는 레지듀 데이터에 대해 변환 및 양자화를 수행하여 블록별로 양자화된 변환 계수를 출력할 수 있다. 역양자화부(7450), 역변환부(7500)는 양자화된 변환 계수에 대해 역양자화 및 역변환을 수행하여 공간 영역의 레지듀 데이터를 복원할 수 있다. 복원된 공간 영역의 레지듀 데이터는 인트라 예측부(7200) 또는 인터 예측부(7150)로부터 출력된 각 블록에 대한 예측 데이터와 더해짐으로써 현재 영상(7050)의 블록에 대한 공간 영역의 데이터로 복원된다. 디블로킹부(7550) 및 SAO 수행부는 복원된 공간 영역의 데이터에 대해 인루프 필터링을 수행하여, 필터링된 복원 영상을 생성한다. 생성된 복원 영상은 복원 픽쳐 버퍼(7100)에 저장된다. 복원 픽처 버퍼(7100)에 저장된 복원 영상들은 다른 영상의 인터예측을 위한 참조 영상으로 이용될 수 있다. 엔트로피 부호화부(7350)는 양자화된 변환 계수에 대해 엔트로피 부호화하고, 엔트로피 부호화된 계수가 비트스트림(7400)으로 출력될 수 있다. 도 1f의 엔트로피 부호화부(7350)는 도 1c의 엔트로피 부호화부(155) 에 대응될 수 있다.Residue data is generated by subtracting prediction data for each block output from the intra prediction unit 7200 or the inter prediction unit 7150 from data for an encoded block of the current image 7050, and converting unit 7250 And the quantization unit 7300 may perform transform and quantization on the residual data to output quantized transform coefficients for each block. The inverse quantization unit 7450 and the inverse transform unit 7500 may perform inverse quantization and inverse transformation on the quantized transform coefficients to restore residual data in the spatial domain. The residual data of the reconstructed spatial region is restored to the data of the spatial region for the block of the current image 7050 by adding it to the prediction data for each block output from the intra prediction unit 7200 or the inter prediction unit 7150. . The deblocking unit 7550 and the SAO performing unit perform in-loop filtering on the data of the reconstructed spatial region to generate a filtered reconstructed image. The generated reconstructed image is stored in the reconstructed picture buffer 7100. The reconstructed images stored in the reconstructed picture buffer 7100 may be used as reference images for inter prediction of other images. The entropy encoding unit 7350 may entropy-encode the quantized transform coefficients, and the entropy-encoded coefficients may be output to the bitstream 7400. The entropy encoding unit 7350 of FIG. 1F may correspond to the entropy encoding unit 155 of FIG. 1C.

다양한 실시예에 따른 영상 부호화부(7000)가 비디오 부호화 장치(150)에 적용되기 위해서, 다양한 실시예에 따른 영상 부호화부(7000)의 단계별 작업들이 블록별로 수행될 수 있다.In order for the image encoder 7000 according to various embodiments to be applied to the video encoding apparatus 150, step-by-step operations of the image encoder 7000 according to various embodiments may be performed block by block.

이하 도 2, 도 3a 내지 3b 의 현재 블록 내 픽셀들에 대해 도시된 '0', '1'은 유효 변환 계수 플래그(계수의 절대값이 0보다 큰지 여부를 나타내는 프플래그)의 값임을 전제로 블록 내 변환 계수를 스캔하는 방법을 상세하게 설명하겠다.Hereinafter, '0' and '1' shown for pixels in the current block of FIGS. 2 and 3A to 3B are values of valid transform coefficient flags (flags indicating whether the absolute value of the coefficient is greater than 0). We will explain in detail how to scan transform coefficients in blocks.

도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.2 is a diagram for describing a method of scanning a transform coefficient in a block according to an embodiment.

도 2를 참조하면, 현재 블록(200)은 복수의 변환 계수를 포함하는 블록이다. 현재 블록(200)은 역변환 동작을 수행하는 데이터 단위로, MxN(M,N은 양의 정수) 크기의 블록일 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 현재 블록(200)은 16x16 크기의 블록일 수 있다.Referring to FIG. 2, the current block 200 is a block including a plurality of transform coefficients. The current block 200 is a data unit that performs an inverse transform operation, and may be a block of size MxN (M,N is a positive integer). For example, as illustrated in FIG. 2, the current block 200 may be a 16×16 block.

비디오 복호화 장치(100)는 현재 블록(200)을 소정의 크기를 갖는 계수 그룹(또는 서브 블록)(205)들로 분할할 수 있다. 계수 그룹은 XxY(X,Y는 양의 정수)의 크기의 블록일 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 계수 그룹(205)은 4x4 크기의 블록일 수 있다.The video decoding apparatus 100 may divide the current block 200 into coefficient groups (or sub-blocks) 205 having a predetermined size. The coefficient group may be a block of the size of XxY (X,Y is a positive integer). For example, as shown in FIG. 2, the coefficient group 205 may be a 4x4 block.

비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 현재 블록(200)을 좌측 상단의 변환 계수로부터 우측 하단의 변환 계수까지 스캔하는 과정에서 스캔되는 모든 유효 변환 계수들 중 최종 유효 변환 계수의 픽셀(210)의 좌표에 관한 정보를 비트스트림으로부터 획득할 수 있다. 최종 유효 변환 계수의 픽셀(210)의 좌표에 관한 정보는 최종 유효 변환 계수의 픽셀의 수평방향 좌표에 관한 정보 및 최종 유효 변환 계수의 픽셀의 수직방향 좌표에 관한 정보를 포함할 수 있다.The video decoding apparatus 100 scans the current block 200 from a transform coefficient in the upper left to a transform coefficient in the lower right according to a scan order in the forward direction, and a pixel of the final effective transform coefficient among all the valid transform coefficients scanned ( 210) can be obtained from the bitstream. The information about the coordinates of the pixel 210 of the final effective transform coefficient may include information about the horizontal coordinates of the pixel of the final effective transform coefficient and the information about the vertical coordinates of the pixel of the final effective transform coefficient.

비디오 복호화 장치(100)는 최종 유효 변환 계수의 픽셀(210)의 좌표에 관한 정보를 기초로 최종 유효 변환 계수의 픽셀(210)의 좌표를 획득하고, 최종 유효 변환 계수의 픽셀(210)의 좌표를 기초로 최종 유효 변환 계수(210)에 관한 유효 변환 계수부터 소정의 역방향 스캔 순서(215)에 따라 변환 계수의 정보를 스캔할 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 소정의 역방향 스캔 순서(215)는 역방향의 대각 스캔 순서일 수 있다.The video decoding apparatus 100 obtains the coordinates of the pixel 210 of the final effective transform coefficient based on information about the coordinates of the pixel 210 of the final effective transform coefficient, and the coordinates of the pixel 210 of the final effective transform coefficient Based on the, it is possible to scan the information of the transform coefficient from the effective transform coefficient for the final effective transform coefficient 210 according to a predetermined reverse scan order 215. For example, as illustrated in FIG. 2, the predetermined reverse scan order 215 may be a reverse diagonal scan order.

비디오 복호화 장치(100)는 계수 그룹들(205)에 대하여 소정의 스캔 순서에 따라 스캔을 수행하고, 각 계수 그룹(205)에 대해 소정의 스캔 순서에 따라 스캔을 수행할 수 있다. 비디오 복호화 장치(100)는 계수 그룹들에 대하여 소정의 스캔 순서에 따라 계수 그룹에 관한 정보를 스캔할 수 있다. 계수 그룹에 관한 정보는 비트스트림으로부터 획득되거나 유도될 수 있다. 계수 그룹에 관한 정보는, 정방향(역방향)의 스캔 순서에 따라 스캔되는 첫번째 계수 그룹 및 마지막 계수 그룹에 대하여 적어도 하나의 유효 변환 계수를 포함함을 나타내도록 유도될 수 있다. 즉, 계수 그룹에 관한 정보는, 정방향(역방향)의 스캔 순서에 따라 스캔되는 첫번째 계수 그룹 및 마지막 계수 그룹에 대하여 비트스트림에 포함되지 않을 수 있다.The video decoding apparatus 100 may scan the coefficient groups 205 according to a predetermined scan order, and scan each coefficient group 205 according to a predetermined scan order. The video decoding apparatus 100 may scan information about the coefficient group according to a predetermined scan order for the coefficient groups. Information about the coefficient group can be obtained or derived from the bitstream. The information about the coefficient group may be derived to indicate that it includes at least one valid transform coefficient for the first coefficient group and the last coefficient group that are scanned according to a forward (reverse) scan order. That is, the information about the coefficient group may not be included in the bitstream for the first coefficient group and the last coefficient group scanned according to the scan order of the forward direction (reverse direction).

이때, 비디오 복호화 장치(100)는 블록의 크기 및 예측 모드 중 적어도 하나에 기초하여 소정의 역방향 스캔 순서를 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 블록의 크기가 4x4이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 블록의 크기가 8x8이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다.At this time, the video decoding apparatus 100 may determine a predetermined reverse scan order based on at least one of a block size and a prediction mode. For example, when the size of the current block is 4x4 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 determines one of the reverse horizontal scan order, vertical scan order, or diagonal scan order. It can be determined in the reverse scan order. In addition, when the size of the current block is 8x8 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 performs one of the reverse horizontal scan order, vertical scan order, or diagonal scan order in a predetermined reverse scan. You can decide in order.

비디오 복호화 장치(100)는 현재 블록의 크기가 4x4 또는 8x8이 아니거나, 현재 블록의 예측 모드가 인터 예측 모드가 아닌 경우, 역방향의 대각 스캔 순서를 소정의 역방향 스캔 순서로 결정할 수 있다.When the size of the current block is not 4x4 or 8x8, or when the prediction mode of the current block is not the inter prediction mode, the video decoding apparatus 100 may determine the reverse diagonal scan order as a predetermined reverse scan order.

비디오 복호화 장치(100)는 계수 그룹(205)에 관한 정보가 계수 그룹(205)에 적어도 하나의 유효 계수를 포함함을 나타내는 경우, 해당 계수 그룹(205) 내 변환 계수들에 관한 정보를 역방향의 소정의 스캔 순서(215)에 따라 계수 그룹 내 변환 계수들에 관한 정보를 스캔할 수 있다.When the video decoding apparatus 100 indicates that the information on the coefficient group 205 includes at least one valid coefficient in the coefficient group 205, the information on the transform coefficients in the coefficient group 205 is reversed. Information on transform coefficients in a coefficient group may be scanned according to a predetermined scan order 215.

한편, 비디오 복호화 장치(100)는 각 계수 그룹(205)에 포함된 유효 변환 계수들 중 적어도 하나의 부호(sign)를 숨긴다고 결정할 수 있다.Meanwhile, the video decoding apparatus 100 may determine that at least one sign among the effective transform coefficients included in each coefficient group 205 is hidden.

도 3a는 다른 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.3A is a diagram illustrating a method of scanning a transform coefficient in a block according to another embodiment.

도 3a를 참조하면, 현재 블록(300)은 복수의 변환 계수를 포함하는 블록이다. 현재 블록(300)은 역변환 동작을 수행하는 데이터 단위로, MxN (M,N은 양의 정수) 크기의 블록일 수 있다. 예를 들어, 도 3a에 도시된 바와 같이, 현재 블록(300)은 16x16 크기의 블록일 수 있다.Referring to FIG. 3A, the current block 300 is a block including a plurality of transform coefficients. The current block 300 is a data unit that performs an inverse transform operation, and may be a block of size MxN (M,N is a positive integer). For example, as illustrated in FIG. 3A, the current block 300 may be a 16×16 block.

도 3a를 참조하면, 비디오 복호화 장치(100)는 현재 블록(300)에 존재하는 모든 유효 변환 계수를 포함하는 사각형 스캔 영역(340)을 결정할 수 있다. 이때, 사각형 스캔 영역(340)은 사각형 스캔 영역(340) 우측 하단에 위치하는 픽셀(330)의 좌표에 의해 결정될 수 있다. 스캔 영역(340)의 우측 하단에 위치하는 픽셀(330)의 수평방향 좌표는 현재 블록(300) 내 모든 유효 변환 계수들 중 가장 오른쪽에 위치하는 유효 변환 계수 픽셀(320)의 수평방향 좌표일 수 있다. 스캔 영역(340)의 우측 하단에 위치하는 픽셀(330)의 수직 방향 좌표는 현재 블록(300) 내 모든 유효 변환 계수들 중 가장 아래쪽에 위치하는 유효 변환 계수 픽셀(310)의 수직방향 좌표일 수 있다. 픽셀(330)에 관한 정보는 픽셀(330)의 좌측 상단 모서리 위치에 관한 정보를 포함할 수 있다. 다만 이에 제한되지 않고, 픽셀(330)에 관한 정보는 픽셀(330)의 우측 하단 모서리 위치에 관한 정보를 포함할 수도 있다.Referring to FIG. 3A, the video decoding apparatus 100 may determine a rectangular scan area 340 including all effective transform coefficients present in the current block 300. In this case, the rectangular scan area 340 may be determined by the coordinates of the pixel 330 located at the lower right of the rectangular scan area 340. The horizontal coordinate of the pixel 330 positioned at the lower right of the scan area 340 may be the horizontal coordinate of the effective transform coefficient pixel 320 positioned at the right of all the effective transform coefficients in the current block 300. have. The vertical coordinates of the pixel 330 located at the lower right of the scan area 340 may be vertical coordinates of the effective transform coefficient pixel 310 located at the bottom of all effective transform coefficients in the current block 300. have. The information about the pixel 330 may include information about the position of the upper left corner of the pixel 330. However, the present invention is not limited thereto, and the information on the pixel 330 may include information on the position of the lower right corner of the pixel 330.

비디오 복호화 장치(100)는 사각형 스캔 영역(340)을 특정하는 픽셀(330)의 좌표에 관한 정보를 비트스림으로부터 수신하고, 수신된 픽셀(330)에 관한 정보를 기초로 사각형 스캔 영역(340)을 결정할 수 있다. 비디오 복호화 장치(100)는 픽셀(330)부터 사각형의 스캔 영역(340)의 좌측 상단의 픽셀(345)까지 소정의 역방향 스캔 순서(355)에 따라 변환 계수에 관한 정보를 스캔할 수 있다. 이때, 계수 그룹은 사각형의 스캔 영역(340)의 좌측 상단의 변환 계수로부터 소정의 정방향 스캔 순서에 따라 스캔되는 K개(K는 양의 정수)의 스캔 계수마다 결정될 수 있다. 다만 이에 제한되지 않고, 우측 하단의 변환 계수로부터 소정의 역방향 스캔 순서에 따라 스캔되는 K개(K는 양의 정수)의 스캔 계수마다 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 계수 그룹에 대한 상세한 내용은 도 3b를 참조하여 후술하도록 하겠다.The video decoding apparatus 100 receives the information on the coordinates of the pixel 330 specifying the rectangular scan area 340 from the bitstream, and based on the information on the received pixel 330, the rectangular scan area 340 Can decide. The video decoding apparatus 100 may scan information about the transform coefficient according to a predetermined reverse scan order 355 from the pixel 330 to the pixel 345 at the upper left of the rectangular scan area 340. At this time, the coefficient group may be determined for each of the K (K is a positive integer) scan coefficients scanned according to a predetermined forward scan order from the transform coefficients at the upper left of the rectangular scan area 340. However, the present invention is not limited thereto, and a person skilled in the art can easily understand that the number of scan coefficients (K is a positive integer) scanned according to a predetermined reverse scan order from the conversion coefficient at the lower right can be determined. Details of the coefficient group will be described later with reference to FIG. 3B.

한편, 비디오 복호화 장치(100)는 각 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있음을 결정할 수 있고, 숨겨져 있는 적어도 하나의 유효 변환 계수에 대한 부호를 복원할 수 있다. 각 계수 그룹에 대하여 숨겨진 부호를 복원하는 동작을 수행하는 것에 대한 상세한 내용은 도 3b를 참조하여 후술하도록 하겠다.Meanwhile, the video decoding apparatus 100 may determine that a sign for at least one effective transform coefficient is hidden for each coefficient group, and may restore a code for at least one hidden effective transform coefficient. . Details of performing an operation of restoring a hidden code for each coefficient group will be described later with reference to FIG. 3B.

도 3b는 다른 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.3B is a diagram for explaining an operation of determining a coefficient group (sub-block) in a block and an operation performed for each coefficient group according to another embodiment.

비디오 복호화 장치(100)는 현재 블록(350)에서 정방향의 소정의 스캔 순서(355)에 따라 K(K는 양의 정수)개의 변환 계수 픽셀마다 계수 그룹을 결정할 수 있다. 비디오 복호화 장치(100)는 K개의 변환 계수 픽셀을 포함하는 계수 그룹을 결정할 수 있다. 예를 들어, 도 3b에 도시된 바와 같이, 비디오 복호화 장치(100)는 16개의 픽셀마다 계수 그룹(360)을 결정할 수 있다.The video decoding apparatus 100 may determine a coefficient group for every K (K is a positive integer) transform coefficient pixels according to a predetermined scan order 355 in the forward direction in the current block 350. The video decoding apparatus 100 may determine a coefficient group including K transform coefficient pixels. For example, as illustrated in FIG. 3B, the video decoding apparatus 100 may determine the coefficient group 360 for every 16 pixels.

비디오 복호화 장치(100)는 계수 그룹(360)마다 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정하고, 계수 그룹(360)마다 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 계수 그룹 내 이전에 복호화된 유효 변환 계수들의 거리에 기초하여 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정할 수 있다. 구체적으로, 비디오 복호화 장치(100)는 소정의 역방향 스캔 순서에 따라 스캔된 최초 유효 변환 계수 및 최종 유효 변환 계수 간의 거리에 기초하여 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정할 수 있다. 이때, 거리는 역방향의 스캔 순서에 따라 스캔되는 계수의 위치의 차이일 수 있다.The video decoding apparatus 100 determines that the sign for at least one effective transform coefficient is hidden for each coefficient group 360, and the sign for at least one effective transform coefficient for each coefficient group 360 is You can decide that it is hidden. For example, the video decoding apparatus 100 may determine that the sign for at least one effective transform coefficient is hidden for the current coefficient group based on the distance of the effective transform coefficients previously decoded in the current coefficient group. . Specifically, the video decoding apparatus 100 signs the at least one valid transform coefficient for the current coefficient group based on the distance between the first valid transform coefficient and the last valid transform coefficient scanned according to a predetermined reverse scan order. You can decide that is hidden. At this time, the distance may be a difference in the positions of the coefficients scanned according to the reverse scan order.

예를 들어 비디오 복호화 장치(100)는 소정의 역방향 스캔 순서에 따라 스캔된 최초 유효 변환 계수 및 최종 유효 변환 계수 간의 거리가 소정의 값보다 큰 경우 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정할 수 있다. 이때, 소정의 값은 다양한 정수값일 수 있다. 예를 들어, 소정의 값은 3일 수 있다.For example, when the distance between the first effective transform coefficient and the last valid transform coefficient scanned according to a predetermined reverse scan order is greater than a predetermined value, the video decoding apparatus 100 may generate a value for at least one effective transform coefficient for the current coefficient group. It can be determined that the sign is hidden. At this time, the predetermined value may be various integer values. For example, the predetermined value may be 3.

비디오 복호화 장치(100)는 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정되면, 현재 계수 그룹에 대하여 비트스트림으로부터 부호에 관한 정보의 획득없이 현재 계수 그룹 내 적어도 하나의 유효 변환 계수에 대해 숨겨진 부호를 복원할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 계수 그룹 내 유효 변환 계수들의 레벨에 대한 패리티 합(parity sum)이 홀수 또는 짝수인 경우, 적어도 하나의 유효 변환 계수에 관한 부호를 0 또는 1로 결정할 수 있다. 이때, 복원되는 유효 변환 계수의 부호는 역방향의 스캔 순서에 따라 스캔되는 최종 유효 변환 계수에 관한 부호를 포함할 수 있다. 다만, 이에 제한되지 않고, 소정의 스캔 순서에 따라 계수 그룹 내 소정의 위치에 있는 부호를 복원할 수 있음을 당업자는 용이하게 이해할 수 있다.If it is determined that the sign for at least one effective transform coefficient is hidden for the current coefficient group, the video decoding apparatus 100 may obtain at least the current coefficient group in the current coefficient group without obtaining information about the code from the bitstream. It is possible to recover a hidden code for one effective transform coefficient. For example, when the parity sum for the level of the effective transform coefficients in the current coefficient group is odd or even, for example, the video decoding apparatus 100 determines a sign for at least one effective transform coefficient as 0 or 1 Can. In this case, the sign of the reconstructed effective transform coefficient may include a sign regarding the final effective transform coefficient scanned in the reverse scan order. However, the present invention is not limited thereto, and a person skilled in the art can easily understand that a code located at a predetermined position in the coefficient group can be restored according to a predetermined scan order.

비디오 복호화 장치(100)는 역방향의 소정 스캔 순서에 따라 비트스트림으로부터 해당 계수 그룹에 관한 정보를 획득하고, 해당 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 변환 계수를 포함함을 나타내는 경우, 해당 계수 그룹 내 변환 계수에 관한 정보를 스캔할 수 있다. 해당 계수 그룹에 관한 정보가 계수 그룹에 0의 값을 갖는 변환 계수만을 포함함을 나타내는 경우, 해당 계수 그룹 내 변환 계수를 모두 0으로 결정할 수 있다.The video decoding apparatus 100 obtains information about a corresponding coefficient group from a bitstream according to a predetermined scan order in the reverse direction, and indicates that the information about the corresponding coefficient group includes at least one transform coefficient in the coefficient group. Information about transform coefficients within a coefficient group can be scanned. When the information on the coefficient group indicates that the coefficient group includes only transform coefficients having a value of 0, all of the transform coefficients in the coefficient group may be determined as 0.

한편, 현재 블록(300) 내 사각형 스캔 영역에 포함된 변환 계수의 개수가 K개의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 마지막에 위치하는 계수 그룹을 결정하는 과정에서 K개보다 적은 개수의 변환 계수 픽셀이 존재할 수 있다. 이 경우, 비디오 복호화 장치(100)는 K개보다 적은 개수의 변환 계수 픽셀을 포함하는 계수 그룹(365)을 결정할 수 있다. 예를 들어, 도 3b에 도시된 바와 같이, 비디오 복호화 장치(100)는 2개의 변환 계수를 포함하는 계수 그룹(365)를 결정할 수 있다.On the other hand, if the number of transform coefficients included in the rectangular scan area in the current block 300 is not an integer multiple of K, fewer transforms than K in the process of determining the last coefficient group according to the forward scan order Counting pixels may be present. In this case, the video decoding apparatus 100 may determine the coefficient group 365 including fewer transform coefficient pixels than K. For example, as illustrated in FIG. 3B, the video decoding apparatus 100 may determine a coefficient group 365 including two transform coefficients.

비디오 복호화 장치(100)는 비트스트림으로부터 계수 그룹(355, 360)에 관한 정보를 획득할 수 있다. 여기서, 계수 그룹(355,360)에 관한 정보는 계수 그룹(355,360)에 포함된 변환 계수들 중 적어도 하나가 유효 변환 계수인지 또는 계수 그룹(355,360)에 0인 변환 계수들만 포함하는지를 나타내는 플래그 정보(유효 계수 그룹 플래그 정보)일 수 있다.The video decoding apparatus 100 may obtain information about the coefficient groups 355 and 360 from the bitstream. Here, the information about the coefficient group (355,360) is flag information indicating whether at least one of the transform coefficients included in the coefficient group (355,360) is a valid transform coefficient or only transform coefficients that are 0 in the coefficient group (355,360) (effective coefficients) Group flag information).

한편, 비디오 복호화 장치(100)는 1개의 변환 계수만을 포함하는 계수 그룹이 결정된다면, 비트스트림으로부터 해당 계수 그룹에 관한 정보(예를 들어, 유효 계수 그룹 플래그 정보)를 획득하지 않고, 1개의 변환 계수에 관한 정보을 획득할 수 있다.Meanwhile, if a coefficient group including only one transform coefficient is determined, the video decoding apparatus 100 does not acquire information (eg, effective coefficient group flag information) about the corresponding coefficient group from the bitstream, and converts one. You can get information about counting.

비디오 복호화 장치(100)는 역방향의 소정의 스캔 순서(355)에 따라 현재 계수 그룹보다 이전에 스캔된 계수 그룹의 계수 그룹에 관한 정보를 기초로 현재 계수 그룹에 관한 정보를 이진 산술 복호화하기 위한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 is a context for binary arithmetic decoding of information on the current coefficient group based on information on the coefficient group of the coefficient group scanned before the current coefficient group according to a predetermined scan order 355 in the reverse direction. The model can be determined.

도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.4 is a diagram for explaining a process of determining a context model for context-based binary arithmetic decoding and decoding of information on transform coefficients according to an embodiment.

도 4를 참조하면, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)에 관한 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410)에 기초하여 결정할 수 있다. 도 4에서, 주변 변환 계수 픽셀들(405)은 현재 스캔되는 변환 계수 픽셀(405)의 우측 또는 하측의 소정의 위치에 존재하는 5개의 픽셀일 수 있다. 다만 이에 제한되지 않고, 주변 변환 계수 픽셀들(405)이 우측 또는 하측의 소정의 위치에 존재하는 n(n은 양의 정수)개의 픽셀일 수 있음을 당업자는 용이하게 이해할 수 있다.Referring to FIG. 4, the video decoding apparatus 100 may determine a context model of information about the currently transformed transform coefficient pixel 405 based on the peripheral transform coefficient pixels 410. In FIG. 4, the peripheral transform coefficient pixels 405 may be five pixels present at a predetermined position on the right or lower side of the transform coefficient pixel 405 that is currently scanned. However, the present invention is not limited thereto, and a person skilled in the art can easily understand that the peripheral transform coefficient pixels 405 may be n (n is a positive integer) pixels located at a predetermined position on the right or lower side.

예를 들어, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 0보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 레벨 절대값이 0보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.For example, the video decoding apparatus 100 displays the context model of the flag information indicating whether the level absolute value of the currently-transformed transform coefficient pixel 405 is greater than 0, and the level absolute value of the peripheral transform coefficient pixels 410 is 0. It can be determined based on the number of larger coefficient pixels.

또한, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 1보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 1보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다In addition, the video decoding apparatus 100 measures the context model of the flag information indicating whether the level absolute value of the currently-transformed transform coefficient pixel 405 is greater than 1, and the coefficient whose absolute value is greater than 1 among the peripheral transform coefficient pixels 410. Can be determined based on the number of pixels

비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 2보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 2보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 displays the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 405 that is currently scanned is greater than 2 of the coefficient pixels whose absolute value is greater than 2 among the neighbor transform coefficient pixels 410. It can be decided based on the number.

비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 값이 N(N은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 N보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 displays the context model of the flag information indicating whether the level value of the currently-converted transform coefficient pixel 405 is greater than N (N is an integer greater than 2), an absolute value of the peripheral transform coefficient pixels 410. It can be determined based on the number of coefficient pixels larger than N.

비디오 복호화 장치(100)는 현재 스캔 되는 변환 계수 픽셀(405)의 잔여 레벨 절대값을 이진화하기 위한 파라메터를 주변 변환 계수 픽셀들(410)의 레벨 절대값의 합을 기초로 결정할 수 있다. 이때, 이진화 파라메터는 라이스 파라메터일 수 있다.The video decoding apparatus 100 may determine a parameter for binarizing the residual level absolute value of the transform coefficient pixel 405 that is currently scanned based on the sum of the level absolute values of the peripheral transform coefficient pixels 410. At this time, the binarization parameter may be a rice parameter.

도 5는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.5 is a diagram for explaining a process of determining a context model for context-based binary arithmetic decoding/decoding of information on transform coefficients according to an embodiment.

도 5를 참조하면, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)에 관한 정보의 컨텍스트 모델을 소정의 역방향 스캔 순서(515)에 따라 이전에 스캔된 변환 계수 픽셀들(510)에 기초하여 결정할 수 있다. 도 5에 도시된 바와 같이, 변환 계수 픽셀들(510)은 현재 스캔되는 변환 계수 픽셀(505)보다 소정의 역반향 스캔 순서(515)에 따라 이전에 스캔된 5개의 픽셀일 수 있다. 다만 이에 제한되지 않고, 변환 계수 픽셀들(505)이 소정의 역반향 스캔 순서(515)에 따라 이전에 스캔된 n(n은 양의 정수)개의 픽셀일 수 있음을 당업자는 용이하게 이해할 수 있다. 도 5에 도시된 바와 같이 소정의 역방향 스캔 순서(515)는 역방향의 지그재그 스캔 순서일 수 있으나, 이에 제한되지 않고, 수평 스캔 순서, 수직 스캔 순서, 대각 스캔 순서 등을 포함할 수 있음을 당업자는 용이하게 이해할 수 있다. 특히, 소정의 역방향 스캔 순서는 스캔 영역을 특정하는 수평 방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 복수의 스캔 순서 중 하나로 결정될 수 있다.Referring to FIG. 5, the video decoding apparatus 100 converts the context model of information about the currently-converted transform coefficient pixel 505 into transform coefficient pixels 510 previously scanned according to a predetermined reverse scan order 515 It can be decided based on. As illustrated in FIG. 5, the transform coefficient pixels 510 may be five pixels previously scanned according to a predetermined inverse scan order 515 than the currently scanned transform coefficient pixel 505. However, the present invention is not limited thereto, and those skilled in the art can easily understand that the transform coefficient pixels 505 may be n (n is a positive integer) pixels previously scanned according to a predetermined inverse scanning order 515. . As illustrated in FIG. 5, a predetermined reverse scan order 515 may be a reverse zigzag scan order, but is not limited thereto, and those skilled in the art may include a horizontal scan order, a vertical scan order, a diagonal scan order, and the like. Easy to understand. In particular, the predetermined reverse scan order may be determined as one of a plurality of scan orders based on the size of the horizontal coordinate values and the vertical coordinate values specifying the scan area.

예를 들어, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 0보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 0보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.For example, the video decoding apparatus 100 displays the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 505 currently being scanned is greater than 0, and the absolute value of the peripheral transform coefficient pixels 510 is greater than 0. It can be determined based on the number of large coefficient pixels.

또한, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 1보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 변환 계수 픽셀들(510) 중 절대값이 1보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.Also, the video decoding apparatus 100 converts a context model of flag information indicating whether the level absolute value of the currently-transformed transform coefficient pixel 505 is greater than 1, which is a count pixel whose absolute value is greater than 1 among the transform coefficient pixels 510. It can be determined based on the number of them.

비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 2보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 2보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 displays the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 505 that is currently scanned is greater than 2 of the coefficient pixels whose absolute value is greater than 2 among the neighbor transform coefficient pixels 510. It can be decided based on the number.

비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 N(N은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 N보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 displays the context model of the flag information indicating whether the level absolute value of the currently-transformed transform coefficient pixel 505 is greater than N (N is an integer greater than 2). It may be determined based on the number of counted pixels whose value is greater than N.

비디오 복호화 장치(100)는 현재 스캔 되는 변환 계수 픽셀(505)의 잔여 레벨 절대값을 이진화하기 위한 파라메터를 주변 변환 계수 픽셀들(510)의 절대값 레벨의 합을 기초로 결정할 수 있다. 이때, 이진화 파라메터는 라이스 파라메터일 수 있다.The video decoding apparatus 100 may determine a parameter for binarizing the residual level absolute value of the transform coefficient pixel 505 that is currently scanned based on the sum of the absolute value levels of the peripheral transform coefficient pixels 510. At this time, the binarization parameter may be a rice parameter.

도 6a는 일 실시예에 따라서 블록 내 유효 변환 계수에 관한 정보를 스캔하기 위한 지그재그 스캔 순서를 설명하기 위한 도면이다.FIG. 6A is a diagram for explaining a zigzag scan sequence for scanning information on a valid transform coefficient in a block according to an embodiment.

도 6a를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 지그재그 스캔 순서(605)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 6A, the video decoding apparatus 100 is left from the transform coefficient pixel in the lower right of the current block 600 according to the zigzag scan order 605 to scan information regarding the transform coefficient of the current block 600 You can scan up to the conversion factor pixels at the top.

구체적으로, 지그재그 스캔 순서(605)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(610)을 스캔한 후에 픽셀(610)의 좌측 픽셀(615)을 스캔하고, 픽셀(615)을 스캔한 후에 우측 상단의 대각선 방향에 위치하는 픽셀(620)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(620)의 상측에 인접하는 픽셀(625)을 스캔한다. 비디오 복호화 장치(100)는 픽셀의 좌측 하단의 대각선 방향에 위치하는 픽셀들(630)을 스캔한다. 비디오 복호화 장치(100)는 픽셀들(630) 중 현재 블록(600)의 경계에 인접하는 픽셀의 좌측에 위치하는 픽셀(635)을 스캔한다. 이와 유사한 방식으로, 지그재그 스캔 순서(605)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, according to the zigzag scan order 605, the video decoding apparatus 100 scans the left pixel 615 of the pixel 610 after scanning the transform coefficient pixel 610 in the lower right, and the pixel 615 After scanning, the pixel 620 positioned in the diagonal direction of the upper right is scanned. The video decoding apparatus 100 scans the pixel 625 adjacent to the upper side of the pixel 620. The video decoding apparatus 100 scans pixels 630 positioned in a diagonal direction at the bottom left of the pixel. The video decoding apparatus 100 scans a pixel 635 located to the left of a pixel adjacent to the boundary of the current block 600 among the pixels 630. In a similar manner, according to the zigzag scan order 605, the video decoding apparatus 100 may scan information regarding the remaining transform coefficient pixels.

한편, 일 실시예에 따른 지그재그 스캔 순서(605)는 픽셀(610)을 스캔한 후에 바로 수평 방향에 위치하는 좌측 방향 픽셀(615)을 스캔하므로, 지그재그 스캔 순서(605)를 수평 우선 지그재그 순서라고 칭할 수 있다.On the other hand, since the zigzag scan order 605 according to an embodiment scans the pixel 615 in the horizontal direction immediately after scanning the pixel 610, the zigzag scan order 605 is called a horizontal priority zigzag order. Can be called

도 6b는 다른 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 지그재그 스캔 순서를 설명하기 위한 도면이다.6B is a diagram for explaining a zigzag scan sequence for scanning information on transform coefficients in a block according to another embodiment.

도 6b를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 지그재그 스캔 순서(635)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 6B, the video decoding apparatus 100 is left from the transform coefficient pixel in the lower right of the current block 600 according to the zigzag scan order 635 to scan information about the transform coefficient of the current block 600 You can scan up to the conversion factor pixels at the top.

구체적으로, 지그재그 스캔 순서(635)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(645)을 스캔한 후에 픽셀(645)의 상측 픽셀(650)을 스캔하고, 픽셀(650)을 스캔한 후에 좌측 하단의 대각선 방향에 위치하는 픽셀(655)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(655)의 좌측에 인접하는 픽셀(660)을 스캔한다. 비디오 복호화 장치(100)는 픽셀의 우측 상단의 대각선 방향에 위치하는 픽셀들(665)을 스캔한다. 비디오 복호화 장치(100)는 픽셀들(665) 중 현재 블록(500)의 경계에 인접하는 픽셀의 상측에 위치하는 픽셀(670)을 스캔한다. 이와 유사한 방식으로, 지그재그 스캔 순서(605)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, according to the zigzag scan order 635, the video decoding apparatus 100 scans the upper right pixel 650 of the pixel 645 after scanning the transform coefficient pixel 645 at the lower right, and the pixel 650 After scanning, the pixel 655 positioned in the diagonal direction of the lower left is scanned. The video decoding apparatus 100 scans the pixel 660 adjacent to the left side of the pixel 655. The video decoding apparatus 100 scans pixels 665 positioned in a diagonal direction at the upper right of the pixel. The video decoding apparatus 100 scans a pixel 670 located above the pixel adjacent to the boundary of the current block 500 among the pixels 665. In a similar manner, according to the zigzag scan order 605, the video decoding apparatus 100 may scan information regarding the remaining transform coefficient pixels.

한편, 일 실시예에 따른 지그재그 스캔 순서(605)는 픽셀(645)을 스캔한 후에 바로 수직 방향에 위치하는 상측 방향 픽셀(650)을 스캔하므로, 지그재그 스캔 순서(605)를 수직 우선 지그재그 순서라고 칭할 수 있다.Meanwhile, since the zigzag scan order 605 according to an embodiment scans the upper pixel 650 positioned in the vertical direction immediately after scanning the pixel 645, the zigzag scan order 605 is called a vertical priority zigzag order. Can be called

도 7a는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 스캔 순서를 설명하기 위한 도면이다.7A is a diagram for explaining a horizontal scan order for scanning information on transform coefficients in a block according to an embodiment.

도 7a를 참조하면, 비디오 복호화 장치(100)는 현재 블록(700)의 변환 계수에 관한 정보를 스캔하기 위해 수평 스캔 순서(705)에 따라 현재 블록(700)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 7A, the video decoding apparatus 100 is left from the transform coefficient pixel in the lower right of the current block 700 according to the horizontal scan order 705 to scan information about the transform coefficient of the current block 700 You can scan up to the conversion factor pixels at the top.

구체적으로, 수평 스캔 순서(705)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(710)을 스캔한 후에 수평 방향인 좌측 방향에 위치하는 픽셀들(715)을 순차적으로 스캔하고, 픽셀들(715) 중 현재 블록(700)의 좌측 경계에 인접하는 픽셀을 스캔한 후에 바로 위에 있는 행의 가장 우측 픽셀(720)을 스캔한다. 비디오 복호화 장치(100)는 이전 행의 픽셀들(715)을 스캔한 것과 같은 방식으로 수평방향인 좌측 방향에 위치하는 픽셀들(725)을 스캔한다. 이와 유사한 방식으로, 수평 스캔 순서(605)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, according to the horizontal scan order 705, the video decoding apparatus 100 sequentially scans the pixels 715 positioned in the left direction in the horizontal direction after scanning the transform coefficient pixel 710 in the lower right. In addition, after scanning a pixel adjacent to the left boundary of the current block 700 among the pixels 715, the rightmost pixel 720 of the row immediately above is scanned. The video decoding apparatus 100 scans the pixels 725 positioned in the left direction in the horizontal direction in the same way as the pixels 715 in the previous row are scanned. In a similar manner, according to the horizontal scan order 605, the video decoding apparatus 100 may scan information on the remaining transform coefficient pixels.

도 7b는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 스캔 순서를 설명하기 위한 도면이다. 7B is a diagram for explaining a vertical scan order for scanning information on transform coefficients in a block according to an embodiment.

도 7b를 참조하면, 비디오 복호화 장치(100)는 현재 블록(700)의 변환 계수에 관한 정보를 스캔하기 위해 수직 스캔 순서(730)에 따라 현재 블록(700)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 7B, the video decoding apparatus 100 is left from the transform coefficient pixel in the lower right of the current block 700 according to the vertical scan order 730 to scan information regarding the transform coefficient of the current block 700 You can scan up to the conversion factor pixels at the top.

구체적으로, 수직 스캔 순서(730)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(735)을 스캔한 후에 수직 방향인 상측 방향에 위치하는 픽셀들(740)을 순차적으로 스캔하고, 픽셀들(740) 중 현재 블록(700)의 상측 경계에 인접하는 픽셀을 스캔한 후에 바로 좌측에 있는 열의 가장 하측 픽셀(745)을 스캔한다. 비디오 복호화 장치(100)는 이전 열의 픽셀들(740)을 스캔한 것과 같은 방식으로 수직방향인 상측 방향에 위치하는 픽셀들(750)을 스캔한다. 이와 유사한 방식으로, 수직 스캔 순서(730)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, according to the vertical scan order 730, the video decoding apparatus 100 sequentially scans the pixels 740 positioned in the upper direction, which is the vertical direction, after scanning the transform coefficient pixel 735 in the lower right. , After scanning a pixel adjacent to the upper boundary of the current block 700 among the pixels 740, the lowermost pixel 745 of the column on the left is scanned. The video decoding apparatus 100 scans the pixels 750 positioned in the vertical direction in the vertical direction in the same way as the pixels 740 in the previous column are scanned. In a similar manner, according to the vertical scan order 730, the video decoding apparatus 100 may scan information regarding the remaining transform coefficient pixels.

도 8은 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 대각 스캔 순서를 설명하기 위한 도면이다.8 is a diagram for explaining a diagonal scan order for scanning information on transform coefficients in a block according to an embodiment.

도 8을 참조하면, 비디오 복호화 장치(100)는 현재 블록(800)의 변환 계수에 관한 정보를 스캔하기 위해 대각 스캔 순서(805)에 따라 현재 블록(800)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 8, the video decoding apparatus 100 is left from the transform coefficient pixel in the lower right of the current block 800 according to the diagonal scan order 805 to scan information regarding the transform coefficient of the current block 800 You can scan up to the conversion factor pixels at the top.

구체적으로, 대각 스캔 순서(805)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(810)을 스캔한 후에 픽셀(810)의 상측 픽셀(815)을 스캔하고, 픽셀(815)을 스캔한 후에 좌측 하단의 대각선 방향에 위치하는 픽셀(820)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(815)의 상측에 인접하는 픽셀(825)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(825)의 좌측 하단의 대각선 방향에 위치하는 픽셀들(830)을 스캔한다. 이와 유사한 방식으로, 대각 스캔 순서(805)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, according to the diagonal scan order 805, the video decoding apparatus 100 scans the upper pixel 815 of the pixel 810 after scanning the transform coefficient pixel 810 in the lower right, and the pixel 815 After scanning, the pixel 820 located in the diagonal direction of the lower left is scanned. The video decoding apparatus 100 scans the pixel 825 adjacent to the upper side of the pixel 815. The video decoding apparatus 100 scans pixels 830 positioned in a diagonal direction at the bottom left of the pixel 825. In a similar manner, according to the diagonal scan order 805, the video decoding apparatus 100 may scan information regarding the remaining transform coefficient pixels.

이상 도 6a 내지 도 8을 참조하여, 블록 내 유효 변환 계수에 관한 정보를 스캔하기 위한 다양한 스캔 순서를 설명하였다. 도 6a 내지 도 8을 참조하여 설명한 스캔 순서들은 역방향의 스캔 순서나, 이에 제한되지 않고 당업자는 역방향의 스캔 순서의 반대 순서로 스캔하는 정방향의 스캔 순서를 용이하게 이해할 수 있다.6A to 8, various scan procedures for scanning information on the effective transform coefficient in a block have been described. The scan sequences described with reference to FIGS. 6A to 8 are not limited to the reverse scan order, but those skilled in the art can easily understand the forward scan order to scan in the reverse order of the reverse scan order.

도 9a 내지 9c는 일 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.9A to 9C are diagrams for explaining a residual encoding syntax structure according to an embodiment.

도 9a 내지 9c를 참조하면, 비디오 복호화 장치(100)는 변환 계수를 복원하기 위해 변환 계수에 관한 신택스 엘리먼트 정보를 스캔하고, 스캔된 신택스 엘리먼트 정보를 기초로 변환 계수를 복호화할 수 있다.9A to 9C, the video decoding apparatus 100 may scan syntax element information regarding the transform coefficient to reconstruct the transform coefficient, and decode the transform coefficient based on the scanned syntax element information.

먼저, 비디오 복호화 장치(100)는 사각형 스캔 영역을 특정하기 위한 좌표를 나타내는 신택스 엘리먼트 정보 scan_region_x 및 scan_region_y를 비트스트림으로부터 획득할 수 있다. 이때, 신택스 엘리먼트 정보 scan_region_x는 현재 블록의 좌상측 모서리 좌표를 기준으로 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 수평방향(x축 방향) 좌표의 값을 나타낼 수 있고, 신택스 엘리먼트 정보 scan_region_y는 현재 블록의 좌상측 모서리 좌표를 기준으로 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 수직방향(y축 방향) 좌표의 값을 나타낼 수 있다. 비디오 복호화 장치(100)는 신택스 엘리먼트 정보scan_region_x 및 scan_region_y에 기초하여 스캔 영역을 특정하기 위한 좌표srX 및 srY를 결정할 수 있다.First, the video decoding apparatus 100 may obtain syntax element information scan_region_x and scan_region_y indicating coordinates for specifying a rectangular scan region from a bitstream. At this time, the syntax element information scan_region_x may indicate the value of the horizontal direction (x-axis direction) coordinate of the effective transform coefficient located at the rightmost side of the current block based on the coordinates of the upper left corner of the current block, and the syntax element information scan_region_y is currently Based on the coordinates of the upper left corner of the block, the value of the vertical (y-axis) coordinate of the effective transform coefficient located at the bottom of the current block may be indicated. The video decoding apparatus 100 may determine coordinates srX and srY for specifying a scan region based on syntax element information scan_region_x and scan_region_y.

비디오 복호화 장치(100)는 스캔 영역을 특정하기 위한 좌표 srX 및 srY에 기초하여 스캔 순서에 따라 결정되는 스캔 영역 내 변환 계수들의 스캔 순위 (ScanOrder(srX+1,srY+1))를 결정할 수 있다.The video decoding apparatus 100 may determine the scan rank (ScanOrder(srX+1,srY+1)) of transform coefficients in the scan area determined according to the scan order based on the coordinates srX and srY for specifying the scan area. .

비디오 복호화 장치(100)는 스캔 영역을 특정하기 위한 좌표 srX 및 srY에 기초하여 정방향의 스캔 순서상 마지막에 스캔되는 계수 그룹을 나타내는 인덱스 정보(lastSet)를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 스캔 영역의 크기값인 (srX+1)*(srY+1)) -1 한 값을 4만큼 우측으로 비트쉬프트하는 연산(>>4)을 수행하여 마지막에 스캔되는 계수 그룹의 인덱스 정보(lastSet)를 결정할 수 있다. 즉, 4만큼 우측으로 쉬프트 하는 연산의 출력 값은 16만큼 나누는 연산에 따라 결정된 몫과 동일할 수 있다. 즉, 비디오 복호화 장치(100)는 16개의 변환 계수마다 하나의 계수 그룹을 결정하게 되므로, 스캔 영역에서 스캔되는 총 변환 계수를 16으로 나누게 되면 총 계수 그룹의 수(또는 정방향의 스캔 순서상 마지막에 스캔되는 계수 그룹을 나타내는 인덱스 값에 1을 더한 값)가 결정될 수 있다.The video decoding apparatus 100 may determine index information (lastSet) indicating a group of coefficients that are scanned last in the forward scan order based on the coordinates srX and srY for specifying the scan area. That is, the video decoding apparatus 100 performs an operation (>>4) that bit-shifts one value to the right by one value (srX+1)*(srY+1)) -1, which is the size of the scan area. Index information (lastSet) of the coefficient group to be scanned may be determined. That is, the output value of the operation shifted to the right by 4 may be the same as the quotient determined by the operation divided by 16. That is, since the video decoding apparatus 100 determines one coefficient group for every 16 transform coefficients, when the total transform coefficients scanned in the scan area are divided by 16, the total number of coefficient groups (or last in the forward scan order) An index value representing a group of coefficients to be scanned plus 1) may be determined.

비디오 복호화 장치(100)는 스캔 영역을 특정하기 위한 좌표 srX 및 srY에 기초하여 정방향의 스캔 순서상 마지막 스캔되는 계수의 위치(lastScanPos)를 결정하고, 현재 변환 계수의 위치(Pos)를 정방향의 스캔 순서상 마지막 스캔되는 계수의 위치(lastScanPos)로 결정할 수 있다.The video decoding apparatus 100 determines the position (lastScanPos) of the last scanned coefficient in the scan order in the forward direction based on the coordinates srX and srY for specifying the scan area, and scans the position (Pos) of the current transform coefficient in the forward direction In order, the position of the last scanned coefficient (lastScanPos) can be determined.

비디오 복호화 장치(100)는 i를 lastset으로 초기화하고, i가 0보다 큰 경우 i를 1만큼 감소시키고, 반복문(for문)(905)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(905)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(905)에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to lastset, reduce i by 1 when i is greater than 0, and perform an operation included in the repetition (for statement) 905. The video decoding apparatus 100 may perform an operation included in the banmokmun (for statement) 905 until a value less than 0 is reached. In this case, i may be an index indicating a group of coefficients. That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time the operation included in the repetition (for statement) 905 is performed.

비디오 복호화 장치(100)는 i에 16을 곱하는 동작(i<<4)을 수행하여setPos를 결정할 수 있다. setPos는 변환 그룹의 첫번째에 위치하는 변환 계수의 인덱스 정보를 나타낼 수 있다.The video decoding apparatus 100 may determine setPos by performing an operation of multiplying i by 16 (i<<4). setPos may indicate index information of a transform coefficient located at the first of the transform group.

비디오 복호화 장치(100)는 i가 마지막 계수 그룹인 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(910)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(910)에 포함된 동작(sig_flag 관련 동작)을 수행할 수 있다. 이때, n은 정방향의 스캔 순서에 따른 계수 그룹 내 변환 계수의 위치를 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 determines that if i is the last coefficient group (i==lastSet), n is determined by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15, and n is 0 If it is greater than or equal to, i is decreased by 1, and the operation included in the repetition statement (for statement) 910 may be performed. The video decoding apparatus 100 may perform an operation (sig_flag-related operation) included in the anti-text (for statement) 910 until a value less than 0 is reached. In this case, n may be index information indicating the position of the transform coefficient in the coefficient group according to the scan order in the forward direction.

예를 들어, 스캔 영역에 포함된 총 변환 계수의 개수가 16의 정수배가 아닌 경우, 정방향의 스캔에 따라 마지막에 스캔되는 계수 그룹(i=lastset)에 대한 lastScanPos에서 setPos를 뺀 값은 0보다 크거나 같고 15보다 작거나 같은 값을 갖게 되고, 그 값을 n으로 결정하고 반복문(for문)(910)을 수행할 수 있다. 비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다. ScanOrder 배열은 정방향의 스캔 순서에 따른 변환 계수의 위치를 나타내는 배열일 수 있다.For example, if the total number of transform coefficients included in the scan area is not an integer multiple of 16, the last scanPos for the last count group (i=lastset) scanned by forward scan minus setPos is greater than 0 It is equal to or less than or equal to 15, and the value is determined to be n and a loop (for statement) 910 may be performed. The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient as a value obtained by adding n to index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder array. The ScanOrder array may be an array indicating the position of the transform coefficient according to the forward scan order.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(width)에 기초하여 현재 스캔되는 수평 방향(x축 방향)의 좌표의 값 sx를 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(log2width)에 기초하여 수직 방향(y축 방향)의 좌표의 값 sy를 결정할 수 있다.The video decoding apparatus 100 may determine a value sx of a coordinate in a horizontal direction (x-axis direction) that is currently scanned based on a position of a current transform coefficient (blkpos) and a width of a scan area. Also, the video decoding apparatus 100 may determine a value sy of coordinates in a vertical direction (y-axis direction) based on a position of a transform coefficient currently decoded (blkpos) and a width of a scan area (log2width).

비디오 복호화 장치(100)는 sx가 0이고, sy가 srY이고, is_last_y가 0인 경우(sx==0 && sy==srY&&is_last_y==0)나, sy가 0이고, sx가 srX이고, is_last_x가 0인 경우(sy==0 && sx==srX&&is_last_x==0), 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수에 대한 유효 변환 계수 플래그 sig_flag(sig_flag[blkpos])를 획득하지 않고, 현재 변환 계수에 대한 sig_flag의 값을 1로 결정할 수 있다. 여기서 is_last_x는 스캔 영역 내 가장 하측의 행에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다. is_last_y는 스캔 영역 내 가장 우측의 열에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다.In the video decoding apparatus 100, when sx is 0, sy is srY, and is_last_y is 0 (sx==0 && sy==srY&&is_last_y==0), sy is 0, sx is srX, and is_last_x is When 0 (sy==0 && sx==srX&&is_last_x==0), the video decoding apparatus 100 does not acquire the effective transform coefficient flag sig_flag (sig_flag[blkpos]) for the current transform coefficient from the bitstream, and The value of sig_flag for the transform coefficient can be determined as 1. Here, is_last_x may be a value indicating whether there is an effective transform coefficient whose absolute value is greater than 0 among transform coefficients scanned before the current transform coefficient among the transform coefficients included in the lowest row in the scan area. is_last_y may be a value indicating whether there is a valid transform coefficient whose absolute value is greater than 0 among transform coefficients scanned before the current transform coefficient among the transform coefficients included in the rightmost column in the scan area.

비디오 복호화 장치(100)는 sx가 0이고, sy가 srY이고, is_last_y가 0인 경우(sx==0 && sy==srY&&is_last_y==0)나 sy가 0이고, sx가 srX이고, is_last_x가 0인 경우(sy==0 && sx==srX&&is_last_x==0)가 아니라면, 비트스트림으로부터 현재 복호화되는 변환 계수에 대한 유효 변환 계수 플래그 sig_flag(sig_flag[blkpos])를 획득할 수 있다.In the video decoding apparatus 100, when sx is 0, sy is srY, and is_last_y is 0 (sx==0 && sy==srY&&is_last_y==0) or sy is 0, sx is srX, and is_last_x is 0 If not (sy==0 && sx==srX&&is_last_x==0), the effective transform coefficient flag sig_flag (sig_flag[blkpos]) for the transform coefficient currently decoded from the bitstream can be obtained.

비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그 sig_flag가 1인 경우에 현재 변환 계수의 x축 방향의 좌표 값 sx이 srX와 같다면(sx==srX), is_last_x를 1로 설정하고, 현재 변환 계수의 y축 방향의 좌표 값 sy이 srY와 같다면(sy==srY), is_last_y를 1로 설정할 수 있다.When the effective transform coefficient flag sig_flag of the current transform coefficient is 1, the video decoding apparatus 100 sets is_last_x to 1 if the coordinate value sx in the x-axis direction of the current transform coefficient is equal to srX (sx==srX). , If the coordinate value sy in the y-axis direction of the current transform coefficient is equal to srY (sy==srY), is_last_y may be set to 1.

또한, 비디오 복호화 장치(100)는 lastSigScanPos가 -1인 경우(즉, 초기값인 경우), lastSigScanPos를 n으로 결정할 수 있다. 즉, 역방향의 스캔 순서 상 계수 그룹의 첫번째 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 n이 lastSigScanPos로 결정되기 때문에 lastSigScanPos는 정방향의 스캔 순서상 계수 그룹 내 마지막으로 유효변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다. 한편, 비디오 복호화 장치(100)는 firstSigScanPos를 n으로 결정할 수 있다. 현재 변환 계수의 유효 변환 계수 플래그 sig_flag가 1인 경우라면 firstSigScanPos의 값이 계속 현재 변환 계수의 위치를 나타내는 인덱스 정보인 n으로 갱신되기 때문에 최종적으로 특정 계수 그룹 i에 포함된 변환 계수들에 대하여 동작을 수행하게 되면, firstSigScanPos는 정방향의 스캔 순서상 계수 그룹 내 최초 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다.Further, the video decoding apparatus 100 may determine that lastSigScanPos is n when lastSigScanPos is -1 (ie, an initial value). That is, since the index n indicating the position of the first valid transform coefficient of the count group in the scan order in the reverse direction is determined as lastSigScanPos, lastSigScanPos is the index indicating the position of the last valid transform coefficient in the count group in the forward scan order. It can be information. Meanwhile, the video decoding apparatus 100 may determine firstSigScanPos as n. If the effective transform coefficient flag sig_flag of the current transform coefficient is 1, the value of firstSigScanPos is continuously updated to n, which is index information indicating the position of the current transform coefficient, and thus finally operates on transform coefficients included in the specific coefficient group i. When performed, firstSigScanPos may be index information indicating a position where the first effective transform coefficient in the coefficient group exists in the forward scan order.

비디오 복호화 장치(100)는 cnt_nz을 1만큼 증가시킨다. 즉, 현재 블록(또는 스캔 영역) 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cnt_nz이 현재 변환 계수가 유효 변환 계수일때마다 갱신되게 된다. 또한, 비디오 복호화 장치(100)는 현재 계수 그룹 i 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cg_nz[i]가 1만큼 증가시킨다. 즉, 현재 계수 그룹 i 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cg_nz[i]가 현재 변환 계수가 유효 변환 계수일때마다 갱신되게 된다.The video decoding apparatus 100 increases cnt_nz by one. That is, cnt_nz indicating the number of coefficients having a non-zero value in the current block (or scan area) is updated whenever the current transform coefficient is a valid transform coefficient. Also, the video decoding apparatus 100 increases cg_nz[i] indicating the number of coefficients having a non-zero value in the current coefficient group i by one. That is, cg_nz[i] indicating the number of coefficients having a non-zero value in the current coefficient group i is updated whenever the current transform coefficient is a valid transform coefficient.

비디오 복호화 장치(100)는 i가 마지막 계수 그룹인 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(915)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(915)에 포함된 동작(coeff_abs_level_greater1_flag 및 coeff_abs_level_greater2_flag 관련 동작)을 수행할 수 있다.The video decoding apparatus 100 determines if i is the last coefficient group (i==lastSet), n is determined by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15, and n is 0 If it is greater than or equal to i, i is reduced by 1, and the operation included in the repetition statement (for statement) 915 may be performed. The video decoding apparatus 100 may perform operations (coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag-related operations) included in the anti-text (for statement) 915 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient as a value obtained by adding n to index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder array.

비디오 복호화 장치(100)는 현재 변환 계수에 관한 정보 gt0 flag, gt1 flag, gt2 flag, remainining_abolute value level를 기초로 현재 변환 계수에 대한 절대값 abs_coef를 획득할수 있다.The video decoding apparatus 100 may obtain an absolute value abs_coef for the current transform coefficient based on information about the current transform coefficient gt0 flag, gt1 flag, gt2 flag, and remainining_abolute value level.

비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그(sig_flag[blkpos])가 1인 경우, 이전에 스캔된 계수 그룹들에 포함된 변환 계수들 중 변환 계수의 절대값이 1보다 큰 변환 계수의 개수 cnt_g1과 현재 계수 그룹 내 이전에 스캔된 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater1_flag를 획득한 변환 계수 의 개수 c1의 합이 계수의 절대값이 1보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수인 num_gt1보다 작은 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수에 대한 coeff_abs_level_greater1_flag(coeff_abs_level_greater1_flag[blkpos])를 획득할 수 있다. coeff_abs_level_greater1_flag는 현재 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 획득된 coeff_abs_level_greater1_flag를 기초로 현재 변환 계수의 플래그 gt1_flag(gt1flag[blkpos])를 결정할 수 있다.When the effective transform coefficient flag (sig_flag[blkpos]) of the current transform coefficient is 1, the video decoding apparatus 100 converts an absolute value of the transform coefficient greater than 1 among transform coefficients included in the previously scanned coefficient groups The sum of the number of coefficients cnt_g1 and the number of transform coefficients c1 obtained coeff_abs_level_greater1_flag from the bitstream among the previously scanned transform coefficients in the current coefficient group obtains coeff_abs_level_greater_flag from the bitstream among the conversion coefficients whose absolute value of the coefficient is greater than one If it is smaller than num_gt1, which is the maximum number of transform coefficients, the video decoding apparatus 100 may obtain coeff_abs_level_greater1_flag (coeff_abs_level_greater1_flag[blkpos]) for the current transform coefficient from the bitstream. coeff_abs_level_greater1_flag may be a flag indicating whether the absolute value of the current transform coefficient is greater than 1. The video decoding apparatus 100 may determine the flag gt1_flag (gt1flag[blkpos]) of the current transform coefficient based on coeff_abs_level_greater1_flag obtained from the bitstream.

비디오 복호화 장치(100)는 현재 변환 계수의 플래그 gt1_flag의 값이 1인 경우, c1를 1만큼 증가시킬 수 있다. 현재 변환 계수의 플래그 gt1_flag가 1인 경우라면 c1의 값이 1만큼 증가하여 c1의 값이 갱신되기 때문에 그 다음 변환 계수들에 대하여 반복문(for문)() 동작을 수행할때, c1은 현재 계수 그룹 내 이전에 스캔된 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater1_flag를 획득한 변환 계수의 개수를 나타낼 수 있다.When the value of the flag gt1_flag of the current transform coefficient is 1, the video decoding apparatus 100 may increase c1 by 1. When the flag gt1_flag of the current transform coefficient is 1, since the value of c1 is increased by 1 and the value of c1 is updated, when executing a loop (for statement)() operation on the next transform coefficients, c1 is the current coefficient Among the transform coefficients previously scanned in the group, it may indicate the number of transform coefficients obtained coeff_abs_level_greater1_flag from the bitstream.

비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그(sig_flag[blkpos])가 1인 경우, 이전에 스캔된 계수 그룹들 내 변환 계수들 중 변환 계수의 절대값이 2보다 큰 변환 계수의 개수 cnt_g2과 현재 계수 그룹 내 이전에 스캔된 비트스트림으로부터 coeff_abs_level_greater2_flag를 획득한 변환 계수의 개수 c2의 합이 계수의 절대값이 2보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수num_gt2보다 작은 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수에 대한 coeff_abs_level_greater2_flag를 획득할 수 있다. coeff_abs_level_greater2_flag는 현재 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 획득된 coeff_abs_level_greater2_flag를 기초로 현재 변환 계수의 플래그 gt2_flag를 결정할 수 있다.When the effective transform coefficient flag (sig_flag[blkpos]) of the current transform coefficient is 1, the video decoding apparatus 100 has a transform coefficient in which the absolute value of the transform coefficient is greater than 2 among the transform coefficients in the previously scanned coefficient groups. The sum of the number cnt_g2 and the number of transform coefficients c2 that obtained coeff_abs_level_greater2_flag from the bitstream previously scanned in the current coefficient group is the number of transform coefficients that can obtain coeff_abs_level_greater_flag from the bitstream among the transform coefficients whose absolute value is greater than 2. If the maximum number is smaller than num_gt2, the video decoding apparatus 100 may obtain coeff_abs_level_greater2_flag for the current transform coefficient from the bitstream. coeff_abs_level_greater2_flag may be a flag indicating whether the absolute value of the current transform coefficient is greater than 2. The video decoding apparatus 100 may determine the flag gt2_flag of the current transform coefficient based on coeff_abs_level_greater2_flag obtained from the bitstream.

비디오 복호화 장치(100)는 현재 변환 계수의 플래그 gt2_flag의 값이 1인 경우, 현재 gt2 flag의 개수 c2를 1만큼 증가시킬 수 있다. 현재 변환 계수의 플래그 gt2_flag가 1인 경우라면 c2의 값이 1만큼 증가하여 c2의 값이 갱신되기 때문에 그 다음 변환 계수들에 대하여 반복문(for문)() 동작을 수행할 때, c2는 현재 계수 그룹 내 이전에 스캔된 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater1_flag를 획득한 변환 계수의 개수를 나타낼 수 있다. When the value of the flag gt2_flag of the current transform coefficient is 1, the video decoding apparatus 100 may increase the number c2 of the current gt2 flags by 1. When the flag gt2_flag of the current transform coefficient is 1, since the value of c2 is increased by 1 and the value of c2 is updated, when performing a loop (for statement)() operation on the next transform coefficients, c2 is the current coefficient. Among the transform coefficients previously scanned in the group, it may indicate the number of transform coefficients obtained coeff_abs_level_greater1_flag from the bitstream.

또한, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다. escapeDataPresent는 현재 변환 그룹 내 변환 계수의 값을 결정하기 위해 추가로 획득해야 하는 정보(예를 들어, 잔여 레벨 절대값 정보 coeff_abs_level_remaining)가 있음을 나타내는 정보일 수 있다.Also, the video decoding apparatus 100 may determine escapeDataPresent as 1. escapeDataPresent may be information indicating that there is information (eg, residual level absolute value information coeff_abs_level_remaining) that must be additionally acquired to determine the value of the transform coefficient in the current transform group.

비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그(sig_flag[blkpos])가 1인 경우, 이전에 스캔된 계수 그룹들 내 변환 계수들 중 변환 계수의 절대값이 2보다 큰 변환 계수의 개수 cnt_g2과 현재 계수 그룹 내 이전에 스캔된 비트스트림으로부터 coeff_abs_level_greater2_flag를 획득한 변환 계수의 개수 c2의 합이 계수의 절대값이 2보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수 num_gt2보다 작지 않은 경우, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다.When the effective transform coefficient flag (sig_flag[blkpos]) of the current transform coefficient is 1, the video decoding apparatus 100 has a transform coefficient in which the absolute value of the transform coefficient is greater than 2 among the transform coefficients in the previously scanned coefficient groups. The sum of the number cnt_g2 and the number of transform coefficients c2 that obtained coeff_abs_level_greater2_flag from the bitstream previously scanned in the current coefficient group is the number of transform coefficients that can obtain coeff_abs_level_greater_flag from the bitstream among the transform coefficients whose absolute value is greater than 2. If the maximum number is not smaller than num_gt2, the video decoding apparatus 100 may determine escapeDataPresent as 1.

비디오 복호화 장치(100)는 이전에 스캔된 계수 그룹들에 포함된 변환 계수들 중 변환 계수의 절대값이 1보다 큰 변환 계수의 개수 cnt_g1과 현재 계수 그룹 내 이전에 스캔된 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater1_flag를 획득한 변환 계수 의 개수 c1의 합이 계수의 절대값이 1보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수인 num_gt1보다 작지 않은 경우, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다. The video decoding apparatus 100 includes the number of transform coefficients cnt_g1 in which the absolute value of the transform coefficient is greater than 1 among the transform coefficients included in the previously scanned coefficient groups and the bitstream of the transform coefficients previously scanned in the current coefficient group If the sum of the number of transform coefficients c1 obtained from coeff_abs_level_greater1_flag from is not less than num_gt1, which is the maximum number of transform coefficients that can obtain coeff_abs_level_greater_flag from the bitstream, among the transform coefficients whose absolute value is greater than 1, the video decoding apparatus ( 100) may set escapeDataPresent to 1.

비디오 복호화 장치(100)는 escapeDataPresent가 1인 경우, i가 마지막 계수 그룹을 나타내는 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(920)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(920)에 포함된 동작(coeff_abs_level_reamining 관련 동작)을 수행할 수 있다. The video decoding apparatus 100 determines that when escapeDataPresent is 1, i represents the last coefficient group (i==lastSet), n is determined by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15 If n is greater than or equal to 0, i is decreased by 1, and an operation included in the repetition statement (for statement) 920 may be performed. The video decoding apparatus 100 may perform an operation (coeff_abs_level_reamining-related operation) included in the anti-text (for statement) 920 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient as a value obtained by adding n to index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder array.

비디오 복호화 장치(100)는 현재 변환 계수의 절대값이 1보다 큰 경우(sig_flag[blkpos]), 베이스 레벨을 결정할 수 있다. 현재 계수 그룹 내 현재 변환 계수 이전에 스캔된 변환 계수들 중 변환 계수들의 절대값이 1보다 큰 변환 계수들의 개수 cnt_gt1이 계수의 절대값이 2보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수 num_gt1보다 작은 경우, 현재 계수 그룹 내 현재 변환 계수 이전에 스캔된 변환 계수들 중 변환 계수들의 절대값이 2보다 큰 변환 계수들의 개수 cnt_gt2가 계수의 절대값이 2보다 큰 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater_flag를 획득할 수 있는 변환 계수의 최대 개수 num_gt2보다 작은 경우, 비디오 복호화 장치(100)는 베이스 레벨을 3으로 결정할 수 있다. cnt_gt1이 비트스트림으로부터 획득될 수 있는 num_gt1보다 작은 경우, cnt_gt2가 num_gt2보다 작다면, 비디오 복호화 장치(100)는 베이스 레벨을 2로 결정할 수 있다. cnt_gt1이 num_gt1보다 작지 않은 경우, 비디오 복호화 장치(100)는 베이스 레벨을 1로 결정할 수 있다.When the absolute value of the current transform coefficient is greater than 1 (sig_flag[blkpos]), the video decoding apparatus 100 may determine the base level. Among the transform coefficients scanned before the current transform coefficient in the current coefficient group, the number of transform coefficients whose absolute value is greater than 1 cnt_gt1 can obtain coeff_abs_level_greater_flag from the bitstream of the transform coefficients whose absolute value is greater than 2 If the maximum number of transform coefficients is less than num_gt1, the number of transform coefficients cnt_gt2 whose absolute value of the transform coefficients is greater than 2 among the transform coefficients scanned before the current transform coefficient in the current coefficient group is a transform whose absolute value of the coefficient is greater than 2 When the maximum number of transform coefficients that can obtain coeff_abs_level_greater_flag from the bitstream among the coefficients is less than num_gt2, the video decoding apparatus 100 may determine the base level as 3. When cnt_gt1 is smaller than num_gt1 that can be obtained from a bitstream, if cnt_gt2 is smaller than num_gt2, the video decoding apparatus 100 may determine the base level to be 2. When cnt_gt1 is not smaller than num_gt1, the video decoding apparatus 100 may determine the base level as 1.

비디오 복호화 장치(100)는 현재 변환 계수에 대한 gt1flag의 값 및 gt2flag의 값을 더한 값에 1을 더한 값으로 현재 변환 계수의 절대값 레벨 abs_coef을 결정할 수 있다. 비디오 복호화 장치(100)는 현재 변환 계수의 절대값이 베이스 레벨과 동일한 값을 갖는 경우(abs_coef[blkpos]==base_level), 비트스트림으로부터 현재 변환 계수에 대한 잔여 절대값 레벨 coeff_abs_level_remaining을 획득할 수 있다. 비디오 복호화 장치(100)는 abs_coef에 현재 변환 계수에 대한 잔여 절대값 레벨 level_remaining을 더하여 현재 변환 계수에 대한 절대값 레벨 abs_coef를 결정할 수 있다.The video decoding apparatus 100 may determine the absolute value level abs_coef of the current transform coefficient by adding 1 to the value of gt1flag and gt2flag for the current transform coefficient. When the absolute value of the current transform coefficient has the same value as the base level (abs_coef[blkpos]==base_level), the video decoding apparatus 100 may obtain a residual absolute value level coeff_abs_level_remaining for the current transform coefficient from the bitstream. . The video decoding apparatus 100 may determine the absolute value level abs_coef for the current transform coefficient by adding the residual absolute level level_remaining for the current transform coefficient to abs_coef.

비디오 복호화 장치(100)는 현재 변환 계수에 대한 절대값 레벨 abs_coef가 2보다 크다면, cnt_gt2를 1만큼 증가시킬 수 있다. 또한, 비디오 복호화 장치(100)는 현재 변환 계수에 대한 절대값 레벨 abs_coef가 1보다 크다면, cnt_gt1을 1만큼 증가시킬 수 있다.If the absolute value level abs_coef for the current transform coefficient is greater than 2, the video decoding apparatus 100 may increase cnt_gt2 by 1. Also, if the absolute value level abs_coef for the current transform coefficient is greater than 1, the video decoding apparatus 100 may increase cnt_gt1 by 1.

만약 escapeDataPresent가 0이라면, i가 마지막 계수 그룹을 나타내는 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(925)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(925)에 포함된 동작(abs_coef 관련 동작)을 수행할 수 있다. ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다.If escapeDataPresent is 0, i is the last count group (i==lastSet), n is determined by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15 and n is 0 If it is greater than or equal to, i is decreased by 1, and the operation included in the repetition statement (for statement) 925 may be performed. The video decoding apparatus 100 may perform an operation (abs_coef-related operation) included in the anti-text (for statement) 925 until a value less than 0 is reached. It can be determined by adding n to index information (setPos) indicating the position of the first coefficient in the current coefficient group in the ScanOrder array.

비디오 복호화 장치(100)는 현재 변환 계수에 관한 정보 gt0 flag, gt1 flag, gt2 flag, remainining_abolute value level를 기초로 현재 변환 계수에 대한 절대값 abs_coef를 획득할수 있다.The video decoding apparatus 100 may obtain an absolute value abs_coef for the current transform coefficient based on information about the current transform coefficient gt0 flag, gt1 flag, gt2 flag, and remainining_abolute value level.

비디오 복호화 장치(100)는 현재 변환 계수에 대한 유효 변환 계수 플래그가 1인 경우, 현재 변환 계수에 대한 절대값인 abs_coef가 2보다 크거나 같다면, cnt_gt2를 1만큼 증가 시킬 수 있다. 현재 변환 계수에 대한 유효 변환 계수 플래그가 1인 경우, 현재 변환 계수에 대한 절대값인 abs_coef가 1보다 크거나 같다면, cnt_gt1를 1만큼 증가 시킬 수 있다.When the effective transform coefficient flag for the current transform coefficient is 1, the video decoding apparatus 100 may increase cnt_gt2 by 1 if abs_coef, which is an absolute value for the current transform coefficient, is greater than or equal to 2. If the effective transform coefficient flag for the current transform coefficient is 1, if abs_coef, which is an absolute value for the current transform coefficient, is greater than or equal to 1, cnt_gt1 can be increased by 1.

비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 스캔되는 현재 계수 그룹 i 내 마지막 유효 변환 계수의 위치 lastSigScanPos와 첫번째 유효 변환 계수의 위치 firstSigScanPos의 차이가 3보다 큰 경우, 현재 계수 그룹 i 내 적어도 하나의 부호가 숨겨져 있음을 나타내는 signHidden의 값(signHidden[i])을 1로 결정할 수 있다. 비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 스캔되는 현재 계수 그룹 내 마지막 유효 변환 계수의 위치 lastSigScanPos와 첫번째 유효 변환 계수의 위치 firstSigScanPos의 차이가 3보다 크지 않은 경우, 현재 계수 그룹 i 내 적어도 하나의 부호가 숨겨져 있음을 나타내는 signHidden의 값(signHidden[i])을 0으로 결정할 수 있다.If the difference between the position lastSigScanPos of the last effective transform coefficient in the current coefficient group i and the position firstSigScanPos of the first effective transform coefficient is greater than 3, the video decoding apparatus 100 scans according to the scan order in the forward direction, at least one of the current coefficient group i The value of signHidden (signHidden[i]) indicating that the sign of is hidden can be determined as 1. When the difference between the position of the last effective transform coefficient in the current coefficient group lastSigScanPos and the position of the first effective transform coefficient firstSigScanPos is not greater than 3, the video decoding apparatus 100 scans according to the scan order in the forward direction, at least one in the current coefficient group i The value of signHidden (signHidden[i]) indicating that the sign of is hidden can be determined as 0.

비디오 복호화 장치(100)는 i를 0으로 초기화하고, i가 lateSet보다 작거나 같은 경우 i를 1만큼 증가시키고, 반복문(for문)(930)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 i가 lateSet보다 큰 값이 될때까지 반목문(for문)(930)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(930)에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to 0, increase i by 1 when i is less than or equal to lateSet, and perform an operation included in the loop (for statement) 930. The video decoding apparatus 100 may perform an operation included in the half-text statement (for statement) 930 until i is greater than lateSet. In this case, i may be an index indicating a group of coefficients. That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time the operation included in the repetition (for statement) 930 is performed.

만약 rsp(residual sign prediction)가 적용되는 경우라면(rsp_apply), If residual sign prediction (rsp) is applied (rsp_apply),

비디오 복호화 장치(100)는 i가 마지막 계수 그룹인 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(935)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(935)에 포함된 동작을 수행할 수 있다.The video decoding apparatus 100 determines that if i is the last coefficient group (i==lastSet), n is determined by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15, and n is 0 If it is greater than or equal to, i is decreased by 1, and the operation included in the repetition statement (for statement) 935 may be performed. The video decoding apparatus 100 may perform an operation included in the anti-text (for statement) 935 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치(blkpos)를 정방향의 스캔 순서에 따른 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보 setPos에 현재 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine a position (blkpos) of a transform coefficient currently decoded as a value obtained by adding current n to index information setPos indicating the position of the first coefficient of the current coefficient group in the ScanOrder array according to the forward scan order. .

비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치 blkpos가 rsp_pos가 아닌 경우, 변환 계수의 부호가 숨겨진 변환 계수의 위치 hidden_pos이라면, 현재 복호화되는 변환 계수의 부호에 관한 정보(sign[blkpos])를 숨겨진 변환 계수의 부호에 관한 정보 hidden_sign으로 결정할 수 있다.If the blkpos position of the transform coefficient currently decoded is not rsp_pos, the video decoding apparatus 100, if the sign of the transform coefficient is hidden_pos of the hidden transform coefficient, information about the sign of the transform coefficient currently decoded (sign[blkpos]) Can be determined by information hidden_sign regarding the sign of the hidden transform coefficient.

만약 변환 계수의 부호가 숨겨진 변환 계수의 위치 hidden_pos가 아닌 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 복호화되는 변환 계수의 부호에 관한 정보(sign[blkpos])를 획득할 수 있다.If the sign of the transform coefficient is not the hidden hidden position of the transform coefficient, the video decoding apparatus 100 may obtain information (sign[blkpos]) about the sign of the transform coefficient currently decoded from the bitstream.

비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치 blkpos가 rsp_pos인 경우, 비트스트림으로부터 현재 복호화되는 변환 계수의 rsp 부호에 관한 정보(sign_rsp[blkpos])를 획득할 수 있다.When the position blkpos of the currently decoded transform coefficient is rsp_pos, the video decoding apparatus 100 may obtain information (sign_rsp[blkpos]) about the rsp code of the transform coefficient currently decoded from the bitstream.

만약 rsp가 적용되지 않는다면, 비디오 복호화 장치(100)는 i가 마지막 계수 그룹인 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(940)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(940)에 포함된 동작을 수행할 수 있다.If rsp is not applied, the video decoding apparatus 100 determines if i is the last coefficient group (i==lastSet), n is the value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15 If n is greater than or equal to 0, i is decreased by 1, and the operation included in the loop (for statement) 940 may be performed. The video decoding apparatus 100 may perform an operation included in the anti-text (for statement) 940 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 정방향의 스캔 순서에 따른 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보 setPos에 현재 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient as a value obtained by adding current n to index information setPos indicating the position of the first coefficient of the current coefficient group in the ScanOrder array according to the forward scan order.

만약 현재 변환 계수의 유효 변환 계수 플래그의 값이 1이고, 부호 데이터를 숨기는 것을 활성화하는지를 나타내는 플래그 sign_data_hiding_enabled_flag)의 값이 0이거나, 현재 그룹에 대하여 숨겨진 부호가 없거나(!signHidden[i]), 정방향의 스캔 순서상 현재 계수 그룹 내 현재 변환 계수의 위치가 첫번째 유효 변환 계수의 위치 firstSigScanPos가 아닌 경우, 비트스트림으로부터 현재 변환 계수의 부호에 관한 정보(sign[blkpos])를 획득할 수 있다.If the value of the effective transform coefficient flag of the current transform coefficient is 1, the value of the flag sign_data_hiding_enabled_flag indicating whether to enable hiding of sign data is 0, or there is no hidden sign for the current group (!signHidden[i]), or forward When the position of the current transform coefficient in the current coefficient group in the scan order is not the position of the first valid transform coefficient firstSigScanPos, information about the sign of the current transform coefficient (sign[blkpos]) may be obtained from the bitstream.

도 9d 내지 9f는 다른 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.9D to 9F are diagrams for explaining a residual encoding syntax structure according to another embodiment.

도 9d 내지 9f를 참조하면, 비디오 복호화 장치(100)는 변환 계수를 복원하기 위해 변환 계수에 관한 신택스 엘리먼트 정보를 스캔하고, 스캔된 신택스 엘리먼트 정보를 기초로 변환 계수를 복호화할 수 있다.9D to 9F, the video decoding apparatus 100 may scan syntax element information about the transform coefficient to reconstruct the transform coefficient, and decode the transform coefficient based on the scanned syntax element information.

먼저, 비디오 복호화 장치(100)는 스캔 영역을 특정하기 위한 좌표를 나타내는 신택스 엘리먼트 정보 last_sig_coeff_x 및 last_sig_coeff_y를 비트스트림으로부터 획득할 수 있다. 이때, 신택스 엘리먼트 정보last_sig_coeff_x는 현재 블록의 좌상측 모서리 좌표를 기준으로 정방향의 스캔 순서에 따라 가장 마지막에 위치하는 유효 변환 계수의 수평방향(x축 방향) 좌표의 값을 나타낼 수 있고, 신택스 엘리먼트 정보 last_sig_coeff_y는 현재 블록의 좌상측 모서리 좌표를 기준으로 정방향의 스캔 순서에 따라 현재 블록 내 마지막에 위치하는 유효 변환 계수의 수직방향(y축 방향) 좌표의 값을 나타낼 수 있다. 비디오 복호화 장치(100)는 신택스 엘리먼트 정보last_sig_coeff_x 및 last_sig_coeff_y에 기초하여 스캔 영역을 특정하기 위한 좌표 LastSigcoeffX 및 LastSigCoeffY를 결정할 수 있다. First, the video decoding apparatus 100 may obtain syntax element information last_sig_coeff_x and last_sig_coeff_y representing the coordinates for specifying the scan area from the bitstream. At this time, the syntax element information last_sig_coeff_x may indicate the value of the horizontal (x-axis direction) coordinate of the effective transform coefficient located last in the forward scan order based on the coordinates of the upper left corner of the current block, and syntax element information last_sig_coeff_y may indicate the value of the coordinates in the vertical direction (y-axis direction) of the effective transform coefficient located at the end of the current block according to the scan order in the forward direction based on the coordinates of the upper left corner of the current block. The video decoding apparatus 100 may determine coordinates LastSigcoeffX and LastSigCoeffY for specifying a scan area based on syntax element information last_sig_coeff_x and last_sig_coeff_y.

비디오 복호화 장치(100)는 서브 블록 내 정방향의 스캔 순서에 따라 가장 마지막에 위치하는 유효 변환 계수의 위치 lastScanPos를 16으로 초기화할 수 있다. 비디오 복호화 장치(100)는 서브 블록 내 정방향의 스캔 순서에 따라 가장 마지막에 위치하는 유효 변환 계수가 위치하는 서브 블록을 나타내는 lastSubBlock을 초기화할 수 있다. 이때, 초기화되는 값은 정방향의 스캔 순서에 따라 스캔되는 현재 블록의 서브 블록들 중 마지막에 위치하는 서브 블록을 나타낼 수 있다. 즉, lastSubBlock은 현재 블록의 높이 및 너비에 기초하여 정방향의 스캔 순서에 따라 스캔되는 서브 블록들 중 마지막에 위치하는 서브 블록을 나타내는 값으로 초기화될 수 있다.The video decoding apparatus 100 may initialize the position lastScanPos of the last effective transform coefficient located at 16 according to the forward scan order in the sub-block. The video decoding apparatus 100 may initialize the lastSubBlock indicating the sub-block in which the last effective transform coefficient is located according to the forward scan order in the sub-block. In this case, the initialized value may indicate the last sub-block among the sub-blocks of the current block scanned according to the forward scan order. That is, lastSubBlock may be initialized to a value indicating the last subblock among the subblocks scanned in the forward scan order based on the height and width of the current block.

비디오 복호화 장치(100)는 현재 계수의 수평방향의 위치 xC가 LastSigcoeffX가 아니거나, 현재 계수의 수직방향의 위치 yC가 LastSigcoeffY가 아닌 경우 Do-while 루프문(950) 내 동작을 수행하고, xC가 LastSigcoeffX이고, 현재 계수의 수직방향의 위치 yC가 LastSigcoeffY인 경우, do-while 루프문(950) 내 동작을 더 이상 수행하지 않을 수 있다.The video decoding apparatus 100 performs an operation in the Do-while loop statement 950 when the horizontal position xC of the current coefficient is not LastSigcoeffX, or the vertical position yC of the current coefficient is not LastSigcoeffY, and the xC is When it is LastSigcoeffX and the vertical position yC of the current coefficient is LastSigcoeffY, the operation in the do-while loop statement 950 may no longer be performed.

비디오 복호화 장치(100)는 lastScanPos가 0이라면, lastScanPos를 16으로결정하고, lastSubblock을 1만큼 감소시킬 수 있다. 즉, 역방향의 스캔 순서에 따라 하나의 서브 블록 내 스캔이 완료(lastScanPos이 0이 )되면, 역방향의 스캔 순서에 따라 다음 서브 블록을 스캔 하기 위해 lastScanPos를 16으로 초기화하고, 다음 서브 블록 스캔을 위해 lastSubblock을 1만큼 감소시킬 수 있다. 비디오 복호화 장치(100)는 lastScanPos를 1만큼 감소시키면서 역방향의 스캔 순서에 따라 현재 서브 블록 lastSubblock 내 변환 계수를 스캔할 수 있다.If the lastScanPos is 0, the video decoding apparatus 100 may determine lastScanPos as 16 and decrease the lastSubblock by 1. That is, when the scan in one sub-block is completed according to the reverse scan order (lastScanPos is 0), the lastScanPos is initialized to 16 to scan the next sub-block according to the reverse scan order, and for the next sub-block scan The lastSubblock can be reduced by 1. The video decoding apparatus 100 may scan the transform coefficients in the current subblock lastSubblock in the reverse scan order while reducing lastScanPos by one.

비디오 복호화 장치(100)는 현재 서브 블록의 수평방향 위치 xS 및 수직방향 위치 yS를 결정할 수 있다. 비디오 복호화 장치(100)는 현재 블록에 대하여 소정의 정방향 스캔 순서에 따라 결정되는 ScanOrder 배열에 기초하여 현재 서브 블록의 위치가 결정될 수 있다. 즉, 비디오 복호화 장치(100)는 현재 블록의 높이(log2height) 및 너비(log2width), 소정의 스캔 순서를 나타내는 스캔 인덱스 scanIdx 및 현재 서브 블록을 나타내는 값 lastSubBlock에 기초하여 현재 서브 블록의 위치가 결정될 수 있다. 이때, xS 및 yS는 실제 서브 블록의 위치가 아니라, 서브 블록들을 하나의 픽셀처럼 취급할 때의 서브 블록의 위치일 수 있다. 즉, 서브 블록의 너비 및 높이를 무시하고, 인접하는 서브 블록 간의 서브 블록 수평방향 및 수직방향 차이는 1일 수 있다.The video decoding apparatus 100 may determine the horizontal position xS and the vertical position yS of the current sub-block. The video decoding apparatus 100 may determine the position of the current sub-block based on the ScanOrder array determined according to a predetermined forward scan order for the current block. That is, the video decoding apparatus 100 may determine the position of the current subblock based on the height (log2height) and the width (log2width) of the current block, the scan index scanIdx indicating the predetermined scan order, and the value lastSubBlock indicating the current subblock. have. In this case, xS and yS may not be actual sub-block positions, but may be sub-block positions when the sub-blocks are treated as one pixel. That is, ignoring the width and height of the sub-block, the horizontal and vertical difference between the sub-blocks between adjacent sub-blocks may be 1.

또한, 비디오 복호화 장치(100)는 현재 서브 블록에 대하여 소정의 정방향 스캔 순서에 따라 결정되는 ScanOrder 배열에 기초하여 현재 변환 계수의 수평방향 위치 xC 및 수직방향 위치 yC가 결정될 수 있다. 즉, 비디오 복호화 장치(100)는 현재 서브 블록의 높이(log24=2) 및 너비(log24=2), 소정의 스캔 순서를 나타내는 스캔 인덱스 scanIdx, 현재 서브 블록의 위치(xS,yS) 및 현재 서브 블록 내 현재 변환 계수의 위치를 나타내는 값 lastScanPos에 기초하여 현재 변환 계수의 위치(xC,yC)가 결정될 수 있다.Also, the video decoding apparatus 100 may determine the horizontal position xC and the vertical position yC of the current transform coefficient based on the ScanOrder array determined according to a predetermined forward scan order for the current sub-block. That is, the video decoding apparatus 100 includes the current subblock height (log 2 4=2) and width (log 2 4=2), scan index scanIdx indicating a predetermined scan order, and the current subblock position (xS,yS) ) And a value indicating the position of the current transform coefficient in the current sub-block, lastScanPos, the position (xC,yC) of the current transform coefficient may be determined.

비디오 복호화 장치(100)는 현재 변환 계수의 수직방향의 위치 yC가 LastSigcoeffY인 경우에 do-while 루프문(950) 내 동작을 더 이상 수행하지 않게 되므로, do-while 루프문(950)을 통해 결정된 lastScanPos는 정방향의 스캔 순서에 따라 스캔되는 현재 블록 내 마지막 유효 변환 계수가 포함된 서브 블록 내 마지막 유효 변환 계수의 위치를 나타내는 인덱스 정보일 수 있고, lastSubBlock은 현재 블록 내 마지막 유효 변환 계수가 위치하는 서브 블록을 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 no longer performs the operation in the do-while loop statement 950 when the vertical position yC of the current transform coefficient is LastSigcoeffY, and thus is determined through the do-while loop statement 950 lastScanPos may be index information indicating the position of the last valid transform coefficient in the subblock including the last valid transform coefficient in the current block scanned according to the forward scan order, and lastSubBlock is a sub in which the last valid transform coefficient in the current block is located It may be index information indicating a block.

비디오 복호화 장치(100)는 i를 lastSubBlock으로초기화하고, i가 0보다 큰 경우 i를 1만큼 감소시키고, 반복문(for문)(960)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(960)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(960)에 포함된 동작을 한번 수행할 때마다 하나의 서브 블록에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to lastSubBlock, decrease i by 1 when i is greater than 0, and perform an operation included in the loop (for statement) 960. The video decoding apparatus 100 may perform an operation included in the banmokmun (for statement) 960 until a value less than 0 is reached. In this case, i may be an index indicating a group of coefficients. That is, the video decoding apparatus 100 may perform an operation for one sub-block every time the operation included in the repetition (for statement) 960 is performed.

비디오 복호화 장치(100)는 현재 서브 블록의 수평방향 위치 xS및 수직방향 위치 yS를 결정할 수 있다. The video decoding apparatus 100 may determine the horizontal position xS and the vertical position yS of the current sub-block.

비디오 복호화 장치(100)는 현재 서브 블록을 나타내는 i가 마지막 유효 변환 계수가 위치하는 서브 블록을 나타내는 값(lastSubBlock)보다 작은 값을 갖는 서브 블록을 가리키거나, DC 계수를 포함하는 서브 블록을 나타내는 값(0)보다 큰 값을 갖는 서브 블록을 가리키는 경우, 현재 서브 블록 i에 대한 coded_sub_block_flag[xS][yS]를 획득할 수 있다. coded_sub_block_flag[xS][yS]는 현재 서브 블록 i 내 적어도 하나의 유효 변환 계수를 포함하는지를 나타내는 플래그 정보일 수 있다.The video decoding apparatus 100 indicates a sub-block having a value where i representing the current sub-block is less than a value (lastSubBlock) indicating the sub-block where the last effective transform coefficient is located, or indicates a sub-block including the DC coefficient. When a sub-block having a value greater than the value 0 is indicated, coded_sub_block_flag[xS][yS] for the current sub-block i can be obtained. coded_sub_block_flag[xS][yS] may be flag information indicating whether at least one valid transform coefficient is included in the current subblock i.

비디오 복호화 장치(100)는 현재 서브 블록이 마지막 유효 변환 계수를 포함하는 서브 블록(lastSubBlock)인 경우, n을 lastScanPos-1로 초기화하고, 그렇지 않은 경우 15로 초기화하고, n이 0보다 크거나 같은 경우 n을 1만큼 감소시키고, 반복문(for문)()에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 n이 0보다 작은 값이 될 대까지 반복문(for문)(960)에 포함된 동작을 수행할 수 있다.이때, n는 서브 블록 내 현재 변환 계수의 위치를 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)( )에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(960)에 포함된 동작을 한번 수행할 때마다 하나의 서브 블록에 대한 동작(sig_coeff_flag 관련 동작)을 수행할 수 있다.The video decoding apparatus 100 initializes n to lastScanPos-1 if the current sub-block is a sub-block (lastSubBlock) including the last effective transform coefficient, otherwise initializes to 15, and n is greater than or equal to 0 In case n is decreased by 1, the operation included in the repetition (for statement) () may be performed. The video decoding apparatus 100 may perform an operation included in the loop (for statement) 960 until n becomes a value less than 0. In this case, n is an index indicating the position of the current transform coefficient in the sub-block. Can be That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time the operation included in the repetition (for statement) () is performed. That is, the video decoding apparatus 100 may perform an operation (sig_coeff_flag-related operation) for one sub-block every time an operation included in the repetition (for statement) 960 is performed.

비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 yC를 결정할 수 있다.The video decoding apparatus 100 may determine the positions xC and yC of the current transform coefficient n.

비디오 복호화 장치(100)는 현재 서브 블록에 대한 coded_sub_block_flag[xS][yS]가 1이고, n은 0보다 크거나 inferSbDcSigCoeffFlag가 0인 경우, 현재 변환 계수에 대한 플래그 sig_coeff_flag[xC][yC]를 비트스트림으로부터 획득할 수 있다. sig_coeff_flag[xC][yC]는 현재 변환 계수가 유효 변환 계수인지를 나타내는 플래그일 수 있다.When videod_sub_block_flag[xS][yS] is 1 for a current sub-block and n is greater than 0 or inferSbDcSigCoeffFlag is 0, the video decoding apparatus 100 bits a flag sig_coeff_flag[xC][yC] for the current transform coefficient Can be obtained from a stream. sig_coeff_flag[xC][yC] may be a flag indicating whether the current transform coefficient is a valid transform coefficient.

만약 sig_coeff_flag[xC][yC]의 값이 1이라면, inferSbDcSigCoeffFlag는 0으로 결정될 수 있다.If sig_coeff_flag[xC][yC] has a value of 1, inferSbDcSigCoeffFlag may be determined as 0.

비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 현재 서브 블록 내 첫번째로 스캔되는 변환 계수의 위치 firstScanPos의 값을 초기화하고, 정방향의 스캔 순서에 따라 현재 서브 블록 내 마지막으로 스캔되는 변환 계수의 위치 lastSigScanPos의 값을 초기화할 수 있다. 비디오 복호화 장치(100)는 Greater1Flag의 개수를 나타내는 numGreater1Flag의 값을 초기화하고, 정방향의 스캔 순서에 따라 Greater1Flag이 획득되는 마지막 위치 lastGreater1ScanPos의 값을 초기화할 수 있다.The video decoding apparatus 100 initializes the value of the position firstScanPos of the first transform coefficient scanned in the current sub-block according to the forward scan order, and the position of the last transform coefficient scanned in the current sub-block according to the forward scan order The value of lastSigScanPos can be initialized. The video decoding apparatus 100 may initialize the value of numGreater1Flag indicating the number of Greater1Flags, and initialize the value of lastGreater1ScanPos at the last position at which the Greater1Flag is acquired according to a forward scan order.

비디오 복호화 장치(100)는 서브 블록 i 내 0이 아닌 변환 계수의 개수를 나타내는 cg_nz[i]를 초기화할 수 있다.The video decoding apparatus 100 may initialize cg_nz[i] indicating the number of non-zero transform coefficients in sub-block i.

비디오 복호화 장치(100)는 n을 15로 초기화하고, n이 0보다 크거나 같으면 n을 1씩 감소시키면서 n이 0보다 작을때까지 반복문(for문)(965) 내 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize n to 15, and if n is greater than or equal to 0, decrease n by 1 and perform operations in the loop (for statement) 965 until n is less than 0.

비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 Yc를 결정할 수 있다.The video decoding apparatus 100 may determine the positions xC and Yc of the current transform coefficient n.

비디오 복호화 장치(100)는 현재 변환 계수에 대한 유효 변환 계수 플래그 sig_coeff_flag가 1인 경우, numGreater1Flag가 8보다 작다면, 현재 변환 계수 n에 대한 coeff_level_greater1_flag[n]를 획득하고, numGreater1Flag의 값을 1만큼 증가시킬 수 있다. coeff_level_greater1_flag[n]는 변환 계수 n의 레벨의 절대값이 1보다 큰 지를 나타내는 플래그 정보일 수 있다. 비디오 복호화 장치(100)는 coeff_level_greater1_flag[n]에 기초하여 Greater1Flag[n]을 결정할 수 있다.When the effective transform coefficient flag sig_coeff_flag for the current transform coefficient is 1, the video decoding apparatus 100 obtains coeff_level_greater1_flag[n] for the current transform coefficient n if numGreater1Flag is less than 8, and increases the value of numGreater1Flag by 1 I can do it. coeff_level_greater1_flag[n] may be flag information indicating whether the absolute value of the level of the transform coefficient n is greater than 1. The video decoding apparatus 100 may determine Greater1Flag[n] based on coeff_level_greater1_flag[n].

비디오 복호화 장치(100)는 현재 변환 계수에 대한 coeff_abs_level_greater_flag의 값이 1이고, lastreater1ScanPos의 값이 초기값이라면, lastGreater1ScanPos를 현재 서브 블록 내 현재 변환 계수의 위치 n으로 결정할 수 있다. 따라서, lastGreater1ScanPos는 정방향 스캔 순서에 따라 현재 서브 블록 내 마지막에 위치하는 coeff_abs_level_greater_flag의 값을 갖는 계수의 위치를 나타내는 인덱스 정보일 수 있다. 그렇지 않고(현재 변환 계수에 대한 coeff_abs_level_greater1_flag의 값이 1이고, lastreater1ScanPos의 값이 초기값인 경우가 아니고), coeff_abs_level_greater1_flag가 1인 경우라면, escapeDataPresent를 1로 결정할 수 있다. If the value of coeff_abs_level_greater_flag for the current transform coefficient is 1 and the value of lastreater1ScanPos is the initial value, the video decoding apparatus 100 may determine lastGreater1ScanPos as the position n of the current transform coefficient in the current sub-block. Accordingly, lastGreater1ScanPos may be index information indicating a position of a coefficient having a value of coeff_abs_level_greater_flag located at the end of the current subblock according to a forward scan order. Otherwise (if the value of coeff_abs_level_greater1_flag for the current transform coefficient is 1 and the value of lastreater1ScanPos is not the initial value), and if coeff_abs_level_greater1_flag is 1, escapeDataPresent may be determined as 1.

비디오 복호화 장치(100)는 numGreater1Flag가 8보다 작지 않다면 escapeDataPresent를 1로 결정할 수 있다.The video decoding apparatus 100 may determine escapeDataPresent as 1 if numGreater1Flag is not less than 8.

비디오 복호화 장치(100)는 정방향 스캔 순서에 따라 현재 서브 블록 내 마지막에 위치하는 유효 변환 계수의 위치르 나타내는 lastSigScanPos가 초기값을 갖는 경우, lastSigScanPos를 현재 서브 블록 내 변환 계수의 위치 n으로 결정할 수 있다.The video decoding apparatus 100 may determine lastSigScanPos as the position n of the transform coefficient in the current sub-block when the lastSigScanPos indicating the location of the effective transform coefficient located at the end of the current sub-block has an initial value according to the forward scan order. .

비디오 복호화 장치(100)는 정방향 스캔 순서에 따라 현재 서브 블록 내 첫번째에 위치하는 유효 변환 계수의 위치를 나타내는 firstSigScanPos를 현재 서브 블록 내 변환 계수의 위치 n으로 결정할 수 있다. 현재 변환 계수의 유효 변환 계수 플래그 sig_coeff_flag[xC][yC]가 1인 경우라면 firstSigScanPos의 값이 계속 현재 서브 블록 내 현재 변환 계수의 위치를 나타내는 인덱스 정보인 n으로 갱신되기 때문에 최종적으로 현재 서브 블록 i에 포함된 변환 계수들에 대하여 동작을 수행하게 되면, firstSigScanPos는 정방향의 스캔 순서상 서브 블록 내 첫번째 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 may determine firstSigScanPos indicating the position of the effective transform coefficient located first in the current sub-block as the position n of the transform coefficient in the current sub-block according to the forward scan order. When the effective transform coefficient flag sig_coeff_flag[xC][yC] of the current transform coefficient is 1, the value of firstSigScanPos is continuously updated to n, which is index information indicating the position of the current transform coefficient in the current subblock, and finally the current subblock i When the operation is performed on the transform coefficients included in, firstSigScanPos may be index information indicating the position of the first valid transform coefficient in the sub-block in the forward scan order.

비디오 복호화 장치(100)는 lastSigScanPos과 firstSigScanPos의 차이가 3보다 큰 경우 sigHidden 값을 1로 결정하고, lastSigScanPos과 firstSigScanPos의 차이가 3보다 크지 않은 경우 sigHidden 값을 0으로 결정할 수 있다. 이때, sigHidden은 현재 서브 블록에 대하여 적어도 하나의 변환 계수의 부호가 숨겨져 있음을 나타내는 값일 수 있다.The video decoding apparatus 100 may determine the sigHidden value as 1 when the difference between lastSigScanPos and firstSigScanPos is greater than 3, and determine the sigHidden value as 0 when the difference between lastSigScanPos and firstSigScanPos is not greater than 3. In this case, sigHidden may be a value indicating that the sign of at least one transform coefficient is hidden for the current sub-block.

만약 정방향의 스캔 순서에 따라 스캔된 비트스트림으로부터 획득된 변환 계수에 대한 coeff_abs_level_greater1_flag(Greater1Flag) 중 마지막으로 coeff_abs_level_greater1_flag가 획득된 변환 계수의 위치 lastGreater1ScanPos가 초기값이 아닌 경우(즉, 비트스트림으로부터 적어도 하나의 Greater1Flag가 현재 서브 블록에서 획득된 경우), 비디오 복호화 장치(100)는 비트스트림으로부터 lastGreater1ScanPos 위치의 변환 계수에 대한 플래그 coeff_abs_level_greater2_flag[lastGreater1ScanPos]를 획득할 수 있다. coeff_abs_level_greater2_flag는 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그일 수 있다. 만약 lastGreater1ScanPos 위치의 변환 계수에 대한 플래그 coeff_abs_level_greater2_flag[lastGreater1ScanPos]의 값이 1인 경우, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다. 비디오 복호화 장치(100)는 coeff_level_greater2_flag[n] 에 기초하여 Greater2Flag[n]을 결정할 수 있다.If the last coefficient_abs_level_greater1_flag of the coeff_abs_level_greater1_flag of the transform coefficient obtained from the bitstream scanned from the bitstream scanned according to the forward scan order is not the initial value (i.e., at least one Greater1Flag from the bitstream) Is obtained in the current sub-block), the video decoding apparatus 100 may obtain a flag coeff_abs_level_greater2_flag[lastGreater1ScanPos] for the transform coefficient of the lastGreater1ScanPos position from the bitstream. coeff_abs_level_greater2_flag may be a flag indicating whether the absolute value of the transform coefficient is greater than 2. If the value of the flag coeff_abs_level_greater2_flag[lastGreater1ScanPos] for the transform coefficient of the lastGreater1ScanPos position is 1, the video decoding apparatus 100 may determine escapeDataPresent as 1. The video decoding apparatus 100 may determine Greater2Flag[n] based on coeff_level_greater2_flag[n].

비디오 복호화 장치(100)는 numSigCoeff을 초기화할 수 있다. 이때, numSigCoeff는 역방향의 스캔 순서에 따라 현재 변환 계수 이전까지 스캔된 변환 계수들 중 유효 변환 계수의 개수를 의미할 수 있다. The video decoding apparatus 100 may initialize numSigCoeff. In this case, numSigCoeff may mean the number of effective transform coefficients among the transform coefficients scanned before the current transform coefficient according to the reverse scan order.

비디오 복호화 장치(100)는 n을 15로 초기화하고, n이 0보다 크거나 같은 경우 n을 1만큼 감소시키고 for 문(970) 내 동작을 수행하고, n이 0보다 작은 경우, for 문(970) 내 동작을 더 이상 수행하지 않을 수 있다. 비디오 복호화 장치(100)는 역방향의 스캔 순서에 따라 현재 서브 블록 내 변환 계수들에 관한 정보를 스캔하는 동작 등을 수행할 수 있다.The video decoding apparatus 100 initializes n to 15, decreases n by 1 when n is greater than or equal to 0, performs an operation in the for statement 970, and when n is less than 0, the for statement 970 ) My actions may not be performed anymore. The video decoding apparatus 100 may perform an operation of scanning information on transform coefficients in the current sub-block according to a reverse scan order.

비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 기초하여 현재 변환 계수의 위치 xC, yC를 결정할 수 있다.The video decoding apparatus 100 may determine the positions xC and yC of the current transform coefficients based on the position n of the current transform coefficients in the current sub-block.

비디오 복호화 장치(100)는 현재 변환 계수에 관한 유효 변환 계수 플래그 sig_coeff_flag[xC][yC]의 값이 1인 경우, 현재 변환 계수에 관한 플래그 coeff_abs_level_greater1_flag의 값, 현재 변환 계수에 관한 플래그 coeff_abs_level_greater2_flag의 값의 합에 1을 합한 값을 baseLevel로 결정할 수 있다.If the value of the effective transform coefficient flag sig_coeff_flag[xC][yC] for the current transform coefficient is 1, the video decoding apparatus 100 has the value of the flag coeff_abs_level_greater1_flag for the current transform coefficient, the value of the flag coeff_abs_level_greater2_flag for the current transform coefficient You can determine the sum of 1 plus baseBase.

만약 numSigCoeff가 8보다 작고, 현재 변환 계수의 위치 n이 lastGreater1ScanPos인 경우라면 base level이 3인 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수 n에 대한 잔여 레벨값 정보 coeff_abs_level_remaining[n]를 획득할 수 있다.If numSigCoeff is less than 8 and the position n of the current transform coefficient is lastGreater1ScanPos, when the base level is 3, the video decoding apparatus 100 receives residual level value information coeff_abs_level_remaining[n] for the current transform coefficient n from the bitstream. Can be obtained.

만약 numSigCoeff가 8보다 작고, 현재 변환 계수의 위치 n이 lastGreater1ScanPos이 아닌 경우라면, base level이 2인 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수 n에 대한 잔여 레벨값 정보 coeff_abs_level_remaining[n]를 획득할 수 있다. 만약 numSigCoeff가 8보다 크다면, base level이 1인 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수 n에 대한 잔여 레벨값 정보 coeff_abs_level_remaining[n]를 획득할 수 있다.If numSigCoeff is less than 8 and the position n of the current transform coefficient is not lastGreater1ScanPos, when the base level is 2, the video decoding apparatus 100 residual information on the residual level value for the current transform coefficient n from the bitstream coeff_abs_level_remaining[n ]. If numSigCoeff is greater than 8, when the base level is 1, the video decoding apparatus 100 may obtain residual level value information coeff_abs_level_remaining[n] for the current transform coefficient n from the bitstream.

비디오 복호화 장치(100)는 현재 변환 계수에 대한 베이스 레벨 및 현재 변환 계수에 대한 잔여 레벨 값을 합하여 현재 블록 내 현재 변환 계수의 레벨 값인 TransCoeffLevel[x0][y0][cIdx][xC][yC]을 결정할 수 있다. 여기서, cIdx는 색상 성분을 나타내는 인덱스일 수 있다.The video decoding apparatus 100 adds the base level for the current transform coefficients and the residual level values for the current transform coefficients to TransCoeffLevel[x0][y0][cIdx][xC][yC], which is the level value of the current transform coefficient in the current block. Can decide. Here, cIdx may be an index indicating a color component.

만약 i가 0부터 1씩 증가하여 lastSubBlock보다 작거나 같은 값이 될때까지 반목문(for문)(975)에 포함된 동작을 수행할 수 있다. 이때, i는 서브 블록을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 for문(975) 내 구문을 한번 수행할 때마다, 하나의 계수 그룹에 대한 동작을 수행할 수 있다. If i increases from 0 to 1 and becomes a value less than or equal to lastSubBlock, the operation included in the foreword (for statement) 975 may be performed. At this time, i may be an index indicating a sub-block. That is, each time the syntax in the for statement 975 is executed, the video decoding apparatus 100 may perform an operation for one coefficient group.

만약 현재 서브 블록 i에 대한 플래그 coded_sub_block_flag[xS][yS]가 1인 경우, rsp가 적용되는 경우라면(rsp_apply), 비디오 복호화 장치(100)는 n을 15로 결정하고, n이 0보다 크거나 같다면 for문(980) 내 동작을 수행하고, n을 1만큼 감소시킨 후에, n이 0보다 크거나 같다면 for문(980) 동작을 다시 수행할 수 있다. 만약, n이 0보다 작다면 for문(980) 내 동작을 더 이상 수행하지 않을 수 있다.If the flag coded_sub_block_flag[xS][yS] for the current sub-block i is 1, if rsp is applied (rsp_apply), the video decoding apparatus 100 determines n as 15, and n is greater than 0 or If they are the same, the operation in the for statement 980 is performed, and after n is decreased by 1, if n is greater than or equal to 0, the operation of the for statement 980 may be performed again. If n is less than 0, the operation in the for statement 980 may no longer be performed.

비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 대응하는 현재 변환 계수의 수평방향 위치 및 수직방향 위치 xC 및 yC를 결정할 수 있다. 비디오 복호화 장치(100)는 xC 및 yC에 기초하여 현재 변환 계수의 위치(blkpos)를 결정할 수 있다.The video decoding apparatus 100 may determine the horizontal position and the vertical position xC and yC of the current transform coefficient corresponding to the position n of the current transform coefficient in the current sub-block. The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient based on xC and yC.

비디오 복호화 장치(100)는 현재 변환 계수의 위치 blkpos가 rsp_pos가 아닌 경우, 부호가 숨겨진 변환 계수의 위치 hidden_pos이라면, 현재 변환 계수의 부호를 숨겨진 변환 계수의 부호 hidden_sign으로 결정할 수 있다.When the position blkpos of the current transform coefficient is not rsp_pos, the video decoding apparatus 100 may determine the sign of the current transform coefficient to be the hidden hidden sign of the hidden transform coefficient if the sign is hidden_pos of the hidden transform coefficient.

만약 그렇지 않은 경우(부호가 숨겨진 변환 계수의 위치 hidden_pos이 아닌 경우)라면, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수의 부호에 관한 정보 sign[xC][yC]를 획득할 수 있다.If it is not (if the code is not hidden_pos where the hidden transform coefficient is located), the video decoding apparatus 100 may obtain information sign[xC][yC] regarding the code of the current transform coefficient from the bitstream.

비디오 복호화 장치(100)는 현재 변환 계수의 위치가 rsp_pos인 경우, 비트스트림으로부터 현재 변환 계수의 rsp 부호에 관한 정보 sign_rsp[xC][yC]를 획득할 수 있다.When the position of the current transform coefficient is rsp_pos, the video decoding apparatus 100 may obtain information sign_rsp[xC][yC] about the rsp code of the current transform coefficient from the bitstream.

만약 rsp가 적용되지 않는다면, 비디오 복호화 장치(100)는 n을 15로 결정하고, n이 0보다 크다면 for문(985) 내 동작을 수행하고, n을 1만큼 감소시킨 후에 다시 n이 0보다 크거나 같다면 for문(985) 동작을 다시 수행할 수 있고, 만약, n이 0보다 작다면 for문(985) 내 동작을 더 이상 수행하지 않을 수 있다.If rsp is not applied, the video decoding apparatus 100 determines n to 15, and if n is greater than 0, performs an operation in the for statement 985, decreases n by 1, and then n is greater than 0. If it is greater than or equal to, the for statement 985 operation may be performed again, and if n is less than 0, the operation in the for statement 985 may not be performed anymore.

비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 대응하는 현재 변환 계수의 수평방향 위치 및 수직방향의 위치 xC 및 yC를 결정할 수 있다. 비디오 복호화 장치(100)는 xC 및 yC에 기초하여 현재 변환 계수의 위치(blkpos)를 결정할 수 있다.The video decoding apparatus 100 may determine the horizontal position and the vertical position xC and yC of the current transform coefficient corresponding to the position n of the current transform coefficient in the current sub-block. The video decoding apparatus 100 may determine a position (blkpos) of the current transform coefficient based on xC and yC.

만약 현재 변환 계수의 유효 변환 계수 플래그 sig_coeff_flag[xC][yC]의 값이 1이고, 부호 데이터를 숨기는 것을 활성화하는지를 나타내는 플래그 sign_data_hiding_enabled_flag의 값이 0이거나, 현재 서브 블록에 대하여 숨겨진 부호가 없거나(!signHidden[i]), 정방향의 스캔 순서상 현재 서브 블록 내 현재 변환 계수의 위치가 첫번째 유효 변환 계수의 위치 firstSigScanPos가 0이 아닌 경우, 비트스트림으로부터 현재 변환 계수의 부호 정보 sign[xC][yC]를 획득할 수 있다.If the value of the effective transform coefficient flag sig_coeff_flag[xC][yC] of the current transform coefficient is 1, the flag sign_data_hiding_enabled_flag indicating whether to enable hiding sign data is 0, or there is no hidden sign for the current subblock (!signHidden [i]), if the position of the current transform coefficient in the current sub-block in the forward scan order is the position of the first valid transform coefficient firstSigScanPos is not 0, sign information of the current transform coefficient from the bitstream sign[xC][yC] Can be obtained.

이하, 도 10 내지 도 23을 참조하여 일 실시예에 따른 비디오 복호화 장치(100)가 영상을 복호화하는 과정에서 이용할 수 있는 데이터 단위를 결정하는 방법을 설명하도록 한다. 비디오 부호화 장치(150)의 동작은 후술하는 비디오 복호화 장치(100)의 동작에 대한 다양한 실시예와 유사하거나 반대되는 동작이 될 수 있다.Hereinafter, a method of determining a data unit that can be used in the process of decoding an image by the video decoding apparatus 100 according to an embodiment will be described with reference to FIGS. 10 to 23. The operation of the video encoding apparatus 150 may be similar or opposite to various embodiments of the operation of the video decoding apparatus 100 described later.

도 10은 일 실시예에 따라 비디오 복호화 장치(100)가 현재 부호화 단위를 분할하여 적어도 하나의 부호화 단위를 결정하는 과정을 도시한다.10 illustrates a process in which the video decoding apparatus 100 determines at least one coding unit by dividing a current coding unit according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보를 이용하여 부호화 단위의 형태를 결정할 수 있고, 분할 형태 정보를 이용하여 부호화 단위가 어떤 형태로 분할되는지를 결정할 수 있다. 즉, 비디오 복호화 장치(100)가 이용하는 블록 형태 정보가 어떤 블록 형태를 나타내는지에 따라 분할 형태 정보가 나타내는 부호화 단위의 분할 방법이 결정될 수 있다. According to an embodiment, the video decoding apparatus 100 may determine a type of a coding unit using block shape information, and determine what type of coding unit is split using split type information. That is, a method of dividing a coding unit indicated by split type information may be determined according to what block type the block type information used by the video decoding apparatus 100 represents.

일 실시예에 따라, 비디오 복호화 장치(100)는 현재 부호화 단위가 정사각형 형태임을 나타내는 블록 형태 정보를 이용할 수 있다. 예를 들어 비디오 복호화 장치(100)는 분할 형태 정보에 따라 정사각형의 부호화 단위를 분할하지 않을지, 수직으로 분할할지, 수평으로 분할할지, 4개의 부호화 단위로 분할할지 등을 결정할 수 있다. 도 10을 참조하면, 현재 부호화 단위(1000)의 블록 형태 정보가 정사각형의 형태를 나타내는 경우, 비디오 복호화 장치(100)는 분할되지 않음을 나타내는 분할 형태 정보에 따라 현재 부호화 단위(1000)와 동일한 크기를 가지는 부호화 단위(1010a)를 분할하지 않거나, 소정의 분할방법을 나타내는 분할 형태 정보에 기초하여 분할된 부호화 단위(1010b, 1010c, 1010d 등)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is in a square shape. For example, the video decoding apparatus 100 may determine whether to divide the square coding unit according to the split type information, vertically, horizontally, or split into four coding units. Referring to FIG. 10, when the block type information of the current coding unit 1000 indicates a square shape, the video decoding apparatus 100 is the same size as the current coding unit 1000 according to the split type information indicating that it is not split. It is possible to determine the coding units (1010b, 1010c, 1010d, etc.) that are not split, or split based on split type information indicating a predetermined splitting method.

도 10을 참조하면 비디오 복호화 장치(100)는 일 실시예에 따라 수직방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향으로 분할한 두개의 부호화 단위(1010b)를 결정할 수 있다. 비디오 복호화 장치(100)는 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수평방향으로 분할한 두개의 부호화 단위(1010c)를 결정할 수 있다. 비디오 복호화 장치(100)는 수직방향 및 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향 및 수평방향으로 분할한 네개의 부호화 단위(1010d)를 결정할 수 있다. 다만 정사각형의 부호화 단위가 분할될 수 있는 분할 형태는 상술한 형태로 한정하여 해석되어서는 안되고, 분할 형태 정보가 나타낼 수 있는 다양한 형태가 포함될 수 있다. 정사각형의 부호화 단위가 분할되는 소정의 분할 형태들은 이하에서 다양한 실시예를 통해 구체적으로 설명하도록 한다. Referring to FIG. 10, the video decoding apparatus 100 determines two coding units 1010b in which the current coding unit 1000 is vertically divided, based on split type information indicating that it is vertically split, according to an embodiment Can. The video decoding apparatus 100 may determine two coding units 1010c that split the current coding unit 1000 in the horizontal direction based on split type information indicating split in the horizontal direction. The video decoding apparatus 100 may determine four coding units 1010d that split the current coding unit 1000 in the vertical direction and the horizontal direction based on split type information indicating split in the vertical direction and the horizontal direction. However, the division form in which a square coding unit may be divided should not be interpreted as being limited to the above-described form, and various forms that can be represented by the division form information may be included. Predetermined division types in which a square coding unit is divided will be described in detail through various embodiments below.

도 11은 일 실시예에 따라 비디오 복호화 장치(100)가 비-정사각형의 형태인 부호화 단위를 분할하여 적어도 하나의 부호화 단위를 결정하는 과정을 도시한다.11 illustrates a process in which the video decoding apparatus 100 determines at least one coding unit by dividing a coding unit having a non-square shape according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위가 비-정사각형 형태임을 나타내는 블록 형태 정보를 이용할 수 있다. 비디오 복호화 장치(100)는 분할 형태 정보에 따라 비-정사각형의 현재 부호화 단위를 분할하지 않을지 소정의 방법으로 분할할지 여부를 결정할 수 있다. 도 11을 참조하면, 현재 부호화 단위(1100 또는 1150)의 블록 형태 정보가 비-정사각형의 형태를 나타내는 경우, 비디오 복호화 장치(100)는 분할되지 않음을 나타내는 분할 형태 정보에 따라 현재 부호화 단위(1100 또는 1150)와 동일한 크기를 가지는 부호화 단위(1110 또는 1160)를 분할하지 않거나, 소정의 분할방법을 나타내는 분할 형태 정보에 따라 기초하여 분할된 부호화 단위(1120a, 1120b, 1130a, 1130b, 1130c, 1170a, 1170b, 1180a, 1180b, 1180c)를 결정할 수 있다. 비-정사각형의 부호화 단위가 분할되는 소정의 분할 방법은 이하에서 다양한 실시예를 통해 구체적으로 설명하도록 한다.According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is a non-square shape. The video decoding apparatus 100 may determine whether to divide the non-square current coding unit according to the split type information or to split in a predetermined method. Referring to FIG. 11, when the block type information of the current coding unit 1100 or 1150 indicates a non-square shape, the video decoding apparatus 100 according to the split type information indicating that it is not split, the current coding unit 1100 Alternatively, the coding units 1110 or 1160 having the same size as 1150 are not split, or the coding units 1120a, 1120b, 1130a, 1130b, 1130c, and 1170a split based on split type information indicating a predetermined splitting method. 1170b, 1180a, 1180b, 1180c). The predetermined division method in which the non-square coding unit is divided will be described in detail through various embodiments below.

일 실시예에 따라 비디오 복호화 장치(100)는 분할 형태 정보를 이용하여 부호화 단위가 분할되는 형태를 결정할 수 있고, 이 경우 분할 형태 정보는 부호화 단위가 분할되어 생성되는 적어도 하나의 부호화 단위의 개수를 나타낼 수 있다. 도 11를 참조하면 분할 형태 정보가 두개의 부호화 단위로 현재 부호화 단위(1100 또는 1150)가 분할되는 것을 나타내는 경우, 비디오 복호화 장치(100)는 분할 형태 정보에 기초하여 현재 부호화 단위(1100 또는 1150)를 분할하여 현재 부호화 단위에 포함되는 두개의 부호화 단위(1120a, 11420b, 또는 1170a, 1170b)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine a form in which a coding unit is split by using split type information, and in this case, the split type information may determine the number of at least one coding unit generated by splitting the coding unit. Can be represented. Referring to FIG. 11, when the split type information indicates that the current coding unit 1100 or 1150 is split into two coding units, the video decoding apparatus 100 may use the current coding unit 1100 or 1150 based on the split type information. By splitting, two coding units 1120a, 11420b, or 1170a, 1170b included in the current coding unit may be determined.

일 실시예에 따라 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 비-정사각형의 형태의 현재 부호화 단위(1100 또는 1150)를 분할하는 경우, 비-정사각형의 현재 부호화 단위(1100 또는 1150)의 긴 변의 위치를 고려하여 현재 부호화 단위를 분할할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)의 형태를 고려하여 현재 부호화 단위(1100 또는 1150)의 긴 변을 분할하는 방향으로 현재 부호화 단위(1100 또는 1150)를 분할하여 복수개의 부호화 단위를 결정할 수 있다. According to an embodiment, when the video decoding apparatus 100 splits the current coding unit 1100 or 1150 in a non-square form based on the split type information, the video decoding apparatus 100 determines the current coding unit 1100 or 1150 in a non-square form. The current coding unit may be divided by considering the position of the long side. For example, the video decoding apparatus 100 divides the current coding unit 1100 or 1150 in a direction of dividing the long side of the current coding unit 1100 or 1150 in consideration of the form of the current coding unit 1100 or 1150 A plurality of coding units can be determined.

일 실시예에 따라, 분할 형태 정보가 홀수개의 블록으로 부호화 단위를 분할하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)에 포함되는 홀수개의 부호화 단위를 결정할 수 있다. 예를 들면, 분할 형태 정보가 3개의 부호화 단위로 현재 부호화 단위(1100 또는 1150)를 분할하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)를 3개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c)로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)에 포함되는 홀수개의 부호화 단위를 결정할 수 있으며, 결정된 부호화 단위들의 크기 모두가 동일하지는 않을 수 있다. 예를 들면, 결정된 홀수개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c) 중 소정의 부호화 단위(1130b 또는 1180b)의 크기는 다른 부호화 단위(1130a, 1130c, 1180a, 1180c)들과는 다른 크기를 가질 수도 있다. 즉, 현재 부호화 단위(1100 또는 1150)가 분할되어 결정될 수 있는 부호화 단위는 복수의 종류의 크기를 가질 수 있고, 경우에 따라서는 홀수개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c)가 각각 서로 다른 크기를 가질 수도 있다. According to an embodiment, when the split type information indicates that the coding unit is split into odd blocks, the video decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 1100 or 1150. For example, when the split type information indicates that the current coding unit 1100 or 1150 is split into three coding units, the video decoding apparatus 100 sets the current coding unit 1100 or 1150 to three coding units 1130a. , 1130b, 1130c, 1180a, 1180b, 1180c). According to an embodiment, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 1100 or 1150, and all of the determined coding units may not have the same size. For example, the size of a predetermined coding unit 1130b or 1180b among the determined odd number of coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c is different from other coding units 1130a, 1130c, 1180a, and 1180c. You may have That is, the coding units that can be determined by dividing the current coding unit 1100 or 1150 may have a plurality of types of sizes, and in some cases, an odd number of coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c. Each may have a different size.

일 실시예에 따라 분할 형태 정보가 홀수개의 블록으로 부호화 단위가 분할되는 것을 나타내는 경우, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)에 포함되는 홀수개의 부호화 단위를 결정할 수 있고, 나아가 비디오 복호화 장치(100)는 분할하여 생성되는 홀수개의 부호화 단위들 중 적어도 하나의 부호화 단위에 대하여 소정의 제한을 둘 수 있다. 도 11을 참조하면 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)가 분할되어 생성된 3개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c)들 중 중앙에 위치하는 부호화 단위(1130b, 1180b)에 대한 복호화 과정을 다른 부호화 단위(1130a, 1130c, 1180a, 1180c)와 다르게 할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 중앙에 위치하는 부호화 단위(1130b, 1180b)에 대하여는 다른 부호화 단위(1130a, 1130c, 1180a, 1180c)와 달리 더 이상 분할되지 않도록 제한하거나, 소정의 횟수만큼만 분할되도록 제한할 수 있다.According to an embodiment, when the split type information indicates that the coding unit is split into an odd number of blocks, the video decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 1100 or 1150, and further The video decoding apparatus 100 may place a predetermined restriction on at least one coding unit among odd coding units generated by splitting. Referring to FIG. 11, the video decoding apparatus 100 is a coding unit positioned in the center among three coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c generated by dividing the current coding unit 1100 or 1150. The decoding process for (1130b, 1180b) may be different from other coding units 1130a, 1130c, 1180a, 1180c. For example, the video decoding apparatus 100 restricts the coding units 1130b and 1180b located at the center from being split further, unlike other coding units 1130a, 1130c, 1180a, and 1180c, or only a predetermined number of times It can be restricted to split.

도 12는 일 실시예에 따라 비디오 복호화 장치(100)가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 부호화 단위를 분할하는 과정을 도시한다.12 illustrates a process in which the video decoding apparatus 100 splits a coding unit based on at least one of block type information and split type information according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 정사각형 형태의 제1 부호화 단위(1200)를 부호화 단위들로 분할하거나 분할하지 않는 것으로 결정할 수 있다. 일 실시예에 따라 분할 형태 정보가 수평 방향으로 제1 부호화 단위(1200)를 분할하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 제1 부호화 단위(1200)를 수평 방향으로 분할하여 제2 부호화 단위(1210)를 결정할 수 있다. 일 실시예에 따라 이용되는 제1 부호화 단위, 제2 부호화 단위, 제3 부호화 단위는 부호화 단위 간의 분할 전후 관계를 이해하기 위해 이용된 용어이다. 예를 들면, 제1 부호화 단위를 분할하면 제2 부호화 단위가 결정될 수 있고, 제2 부호화 단위가 분할되면 제3 부호화 단위가 결정될 수 있다. 이하에서는 이용되는 제1 부호화 단위, 제2 부호화 단위 및 제3 부호화 단위의 관계는 상술한 특징에 따르는 것으로 이해될 수 있다. According to an embodiment, the video decoding apparatus 100 may determine that the first coding unit 1200 in a square shape is split into coding units or not based on at least one of block shape information and split shape information. According to an embodiment, when the split type information indicates that the first coding unit 1200 is split in the horizontal direction, the video decoding apparatus 100 splits the first coding unit 1200 in the horizontal direction and is the second coding unit. (1210) can be determined. The first coding unit, the second coding unit, and the third coding unit used according to an embodiment are terms used to understand before and after splitting between coding units. For example, when the first coding unit is split, the second coding unit may be determined, and when the second coding unit is split, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood as following the characteristics described above.

일 실시예에 따라 비디오 복호화 장치(100)는 결정된 제2 부호화 단위(1210)를 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 부호화 단위들로 분할하거나 분할하지 않는 것으로 결정할 수 있다. 도 12를 참조하면 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1200)를 분할하여 결정된 비-정사각형의 형태의 제2 부호화 단위(1210)를 적어도 하나의 제3 부호화 단위(1220a, 1220b, 1220c, 1220d 등)로 분할하거나 제2 부호화 단위(1210)를 분할하지 않을 수 있다. 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 획득할 수 있고 비디오 복호화 장치(100)는 획득한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1200)를 분할하여 다양한 형태의 복수개의 제2 부호화 단위(예를 들면, 1210)를 분할할 수 있으며, 제2 부호화 단위(1210)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1200)가 분할된 방식에 따라 분할될 수 있다. 일 실시예에 따라, 제1 부호화 단위(1200)가 제1 부호화 단위(1200)에 대한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제2 부호화 단위(1210)로 분할된 경우, 제2 부호화 단위(1210) 역시 제2 부호화 단위(1210)에 대한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제3 부호화 단위(예를 들면, 1220a, 1220b, 1220c, 1220d 등)으로 분할될 수 있다. 즉, 부호화 단위는 부호화 단위 각각에 관련된 분할 형태 정보 및 블록 형태 정보 중 적어도 하나에 기초하여 재귀적으로 분할될 수 있다. 따라서 비-정사각형 형태의 부호화 단위에서 정사각형의 부호화 단위가 결정될 수 있고, 이러한 정사각형 형태의 부호화 단위가 재귀적으로 분할되어 비-정사각형 형태의 부호화 단위가 결정될 수도 있다. 도 12를 참조하면, 비-정사각형 형태의 제2 부호화 단위(1210)가 분할되어 결정되는 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d) 중 소정의 부호화 단위(예를 들면, 가운데에 위치하는 부호화 단위 또는 정사각형 형태의 부호화 단위)는 재귀적으로 분할될 수 있다. 일 실시예에 따라 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d) 중 하나인 정사각형 형태의 제3 부호화 단위(1220c)는 수평 방향으로 분할되어 복수개의 제4 부호화 단위로 분할될 수 있다. 복수개의 제4 부호화 단위 중 하나인 비-정사각형 형태의 제4 부호화 단위(1240)는 다시 복수개의 부호화 단위들로 분할될 수 있다. 예를 들면, 비-정사각형 형태의 제4 부호화 단위(1240)는 홀수개의 부호화 단위(1250a, 1250b, 1250c)로 다시 분할될 수도 있다.According to an embodiment, the video decoding apparatus 100 may determine that the determined second coding unit 1210 is split or not split into coding units based on at least one of block type information and split type information. Referring to FIG. 12, the video decoding apparatus 100 determines a second coding unit 1210 in a non-square shape determined by dividing the first coding unit 1200 based on at least one of block shape information and split shape information. The second coding unit 1210 may not be split into at least one third coding unit 1220a, 1220b, 1220c, or 1220d. The video decoding apparatus 100 may acquire at least one of the block shape information and the split shape information, and the video decoding apparatus 100 may obtain the first coding unit 1200 based on at least one of the obtained block shape information and the split shape information. ) To divide a plurality of second coding units (for example, 1210) of various types, and the second coding unit 1210 may first encode based on at least one of block type information and split type information. The unit 1200 may be divided according to the divided method. According to an embodiment, when the first coding unit 1200 is divided into the second coding unit 1210 based on at least one of block type information and split type information for the first coding unit 1200, the second coding unit 1200 The coding unit 1210 may also be divided into a third coding unit (eg, 1220a, 1220b, 1220c, 1220d, etc.) based on at least one of block type information and split type information for the second coding unit 1210. have. That is, the coding unit may be recursively divided based on at least one of split type information and block type information related to each coding unit. Accordingly, the coding unit of the square may be determined from the coding units of the non-square shape, and the coding unit of the square shape may be recursively divided to determine the coding unit of the non-square shape. Referring to FIG. 12, a predetermined coding unit (for example, located in the center) among odd third coding units 1220b, 1220c, and 1220d determined by dividing and determining the second coding unit 1210 in a non-square shape The coding unit or the coding unit in the square form) may be recursively divided. According to an embodiment, the third coding unit 1220c having a square shape, which is one of the odd numbered third coding units 1220b, 1220c, and 1220d, may be split in a horizontal direction and divided into a plurality of fourth coding units. The fourth coding unit 1240 having a non-square shape, which is one of the plurality of fourth coding units, may be divided into a plurality of coding units. For example, the fourth coding unit 1240 in a non-square shape may be divided into odd numbered coding units 1250a, 1250b, and 1250c.

부호화 단위의 재귀적 분할에 이용될 수 있는 방법에 대하여는 다양한 실시예를 통해 후술하도록 한다.Methods that can be used for recursive division of coding units will be described later through various embodiments.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제3 부호화 단위(1220a, 1220b, 1220c, 1220d 등) 각각을 부호화 단위들로 분할하거나 제2 부호화 단위(1210)를 분할하지 않는 것으로 결정할 수 있다. 비디오 복호화 장치(100)는 일 실시예에 따라 비-정사각형 형태의 제2 부호화 단위(1210)를 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d)로 분할할 수 있다. 비디오 복호화 장치(100)는 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d) 중 소정의 제3 부호화 단위에 대하여 소정의 제한을 둘 수 있다. 예를 들면 비디오 복호화 장치(100)는 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d) 중 가운데에 위치하는 부호화 단위(1220c)에 대하여는 더 이상 분할되지 않는 것으로 제한하거나 또는 설정 가능한 횟수로 분할되어야 하는 것으로 제한할 수 있다. 도 12를 참조하면, 비디오 복호화 장치(100)는 비-정사각형 형태의 제2 부호화 단위(1210)에 포함되는 홀수개의 제3 부호화 단위(1220b, 1220c, 1220d)들 중 가운데에 위치하는 부호화 단위(1220c)는 더 이상 분할되지 않거나, 소정의 분할 형태로 분할(예를 들면 4개의 부호화 단위로만 분할하거나 제2 부호화 단위(1210)가 분할된 형태에 대응하는 형태로 분할)되는 것으로 제한하거나, 소정의 횟수로만 분할(예를 들면 n회만 분할, n>0)하는 것으로 제한할 수 있다. 다만 가운데에 위치한 부호화 단위(1220c)에 대한 상기 제한은 단순한 실시예들에 불과하므로 상술한 실시예들로 제한되어 해석되어서는 안되고, 가운데에 위치한 부호화 단위(1220c)가 다른 부호화 단위(1220b, 1220d)와 다르게 복호화 될 수 있는 다양한 제한들을 포함하는 것으로 해석되어야 한다.According to an embodiment, the video decoding apparatus 100 divides each of the third coding units 1220a, 1220b, 1220c, and 1220d into coding units based on at least one of block type information and split type information, or second coding It can be determined that the unit 1210 is not divided. The video decoding apparatus 100 may divide the second coding unit 1210 in a non-square form into an odd number of third coding units 1220b, 1220c, and 1220d according to an embodiment. The video decoding apparatus 100 may place a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 1220b, 1220c, and 1220d. For example, the video decoding apparatus 100 is limited to being no longer split or to be divided into a settable number of times for the coding unit 1220c located in the center among the odd number of third coding units 1220b, 1220c, and 1220d. It can be limited to. Referring to FIG. 12, the video decoding apparatus 100 includes a coding unit located in the center among odd numbered third coding units 1220b, 1220c, and 1220d included in the non-square second coding unit 1210 1220c) is no longer divided, or is divided into a predetermined partitioning form (for example, only divided into 4 coding units or the second coding unit 1210 is divided into a form corresponding to the divided form), or is predetermined It can be limited to dividing only by the number of times (eg, dividing only n times, n>0). However, the above limitation on the coding unit 1220c located in the middle is only simple embodiments and should not be interpreted as being limited to the above-described embodiments, and the coding unit 1220c located in the middle is different coding units 1220b and 1220d. ) And should be interpreted as including various restrictions that can be decoded.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하기 위해 이용되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 현재 부호화 단위 내의 소정의 위치에서 획득할 수 있다. According to an embodiment, the video decoding apparatus 100 may acquire at least one of block shape information and split shape information used to split the current coding unit at a predetermined location in the current coding unit.

도 13은 일 실시예에 따라 비디오 복호화 장치(100)가 홀수개의 부호화 단위들 중 소정의 부호화 단위를 결정하기 위한 방법을 도시한다. 도 13을 참조하면, 현재 부호화 단위(1300)의 블록 형태 정보 및 분할 형태 정보 중 적어도 하나는 현재 부호화 단위(1300)에 포함되는 복수개의 샘플 중 소정 위치의 샘플(예를 들면, 가운데에 위치하는 샘플(1340))에서 획득될 수 있다. 다만 이러한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나가 획득될 수 있는 현재 부호화 단위(1300) 내의 소정 위치가 도 13에서 도시하는 가운데 위치로 한정하여 해석되어서는 안되고, 소정 위치에는 현재 부호화 단위(1300)내에 포함될 수 있는 다양한 위치(예를 들면, 최상단, 최하단, 좌측, 우측, 좌측상단, 좌측하단, 우측상단 또는 우측하단 등)가 포함될 수 있는 것으로 해석되어야 한다. 비디오 복호화 장치(100)는 소정 위치로부터 획득되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 획득하여 현재 부호화 단위를 다양한 형태 및 크기의 부호화 단위들로 분할하거나 분할하지 않는 것으로 결정할 수 있다.13 illustrates a method for the video decoding apparatus 100 to determine a predetermined coding unit among odd coding units according to an embodiment. Referring to FIG. 13, at least one of block type information and split type information of the current coding unit 1300 is a sample at a predetermined position (eg, centered) among a plurality of samples included in the current coding unit 1300. Sample 1340). However, a predetermined position in the current coding unit 1300 in which at least one of the block type information and the split type information can be obtained should not be interpreted as being limited to the center position shown in FIG. 13, and the current coding unit 1300 at a predetermined position. It should be interpreted that various positions (for example, top, bottom, left, right, top left, bottom left, top right, or bottom right, etc.) that may be included in) may be included. The video decoding apparatus 100 may obtain at least one of block shape information and split shape information obtained from a predetermined location, and determine that the current coding unit is not split or split into coding units having various shapes and sizes.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위가 소정의 개수의 부호화 단위들로 분할된 경우 그 중 하나의 부호화 단위를 선택할 수 있다. 복수개의 부호화 단위들 중 하나를 선택하기 위한 방법은 다양할 수 있으며, 이러한 방법들에 대한 설명은 이하의 다양한 실시예를 통해 후술하도록 한다.According to an embodiment, when the current coding unit is divided into a predetermined number of coding units, the video decoding apparatus 100 may select one coding unit therefrom. Methods for selecting one of a plurality of coding units may be various, and descriptions of these methods will be described later through various embodiments.

일 실시예에 따라 비디오 복호화 장치(100) 는 현재 부호화 단위를 복수개의 부호화 단위들로 분할하고, 소정 위치의 부호화 단위를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may divide the current coding unit into a plurality of coding units and determine a coding unit at a predetermined location.

도 13은 일 실시예에 따라 비디오 복호화 장치(100)가 홀수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위한 방법을 도시한다.13 illustrates a method for the video decoding apparatus 100 to determine a coding unit of a predetermined position among odd coding units according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 홀수개의 부호화 단위들 중 가운데에 위치하는 부호화 단위를 결정하기 위하여 홀수개의 부호화 단위들 각각의 위치를 나타내는 정보를 이용할 수 있다. 도 13을 참조하면, 비디오 복호화 장치(100)는 현재 부호화 단위(1300)를 분할하여 홀수개의 부호화 단위들(1320a, 1320b, 1320c)을 결정할 수 있다. 비디오 복호화 장치(100)는 홀수개의 부호화 단위들(1320a, 1320b, 1320c)의 위치에 대한 정보를 이용하여 가운데 부호화 단위(1320b)를 결정할 수 있다. 예를 들면 비디오 복호화 장치(100)는 부호화 단위들(1320a, 1320b, 1320c)에 포함되는 소정의 샘플의 위치를 나타내는 정보에 기초하여 부호화 단위들(1320a, 1320b, 1320c)의 위치를 결정함으로써 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. 구체적으로, 비디오 복호화 장치(100)는 부호화 단위들(1320a, 1320b, 1320c)의 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 정보에 기초하여 부호화 단위(1320a, 1320b, 1320c)의 위치를 결정함으로써 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may use information indicating the location of each of the odd number of coding units to determine a coding unit located in the middle of the odd number of coding units. Referring to FIG. 13, the video decoding apparatus 100 may determine the odd number of coding units 1320a, 1320b, and 1320c by dividing the current coding unit 1300. The video decoding apparatus 100 may determine the middle coding unit 1320b using information about the positions of the odd number of coding units 1320a, 1320b, and 1320c. For example, the video decoding apparatus 100 determines the position of the coding units 1320a, 1320b, and 1320c based on information indicating the location of a predetermined sample included in the coding units 1320a, 1320b, and 1320c. The coding unit 1320b located at may be determined. Specifically, the video decoding apparatus 100 based on information indicating the positions of the samples 1330a, 1330b, and 1330c at the upper left of the coding units 1320a, 1320b, and 1320c, of the coding units 1320a, 1320b, and 1320c. By determining the position, the coding unit 1320b located in the center can be determined.

일 실시예에 따라 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 정보는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 위치 또는 좌표에 대한 정보를 포함할 수 있다. 일 실시예에 따라 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 정보는 현재 부호화 단위(1300)에 포함되는 부호화단위(1320a, 1320b, 1320c)들의 너비 또는 높이를 나타내는 정보를 포함할 수 있고, 이러한 너비 또는 높이는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 좌표 간의 차이를 나타내는 정보에 해당할 수 있다. 즉, 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 위치 또는 좌표에 대한 정보를 직접이용하거나 좌표간의 차이값에 대응하는 부호화 단위의 너비 또는 높이에 대한 정보를 이용함으로써 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. According to an embodiment, information indicating the positions of the samples 1330a, 1330b, and 1330c at the upper left included in the coding units 1320a, 1320b, and 1320c are located in a picture of the coding units 1320a, 1320b, and 1320c. Or, it may include information about coordinates. According to an embodiment, information indicating the positions of the samples 1330a, 1330b, and 1330c in the upper left included in the coding units 1320a, 1320b, and 1320c are encoded units 1320a, 1320b included in the current coding unit 1300. , 1320c), and the width or height may correspond to information indicating a difference between coordinates in a picture of the coding units 1320a, 1320b, and 1320c. That is, the video decoding apparatus 100 directly uses information about the position or coordinates in a picture of the coding units 1320a, 1320b, and 1320c, or receives information about the width or height of the coding unit corresponding to a difference value between coordinates. By using, the coding unit 1320b located in the middle can be determined.

일 실시예에 따라, 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 나타내는 정보는 (xa, ya) 좌표를 나타낼 수 있고, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 위치를 나타내는 정보는 (xb, yb) 좌표를 나타낼 수 있고, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 위치를 나타내는 정보는 (xc, yc) 좌표를 나타낼 수 있다. 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 좌표를 이용하여 가운데 부호화 단위(1320b)를 결정할 수 있다. 예를 들면, 좌측 상단의 샘플(1330a, 1330b, 1330c)의 좌표를 오름차순 또는 내림차순으로 정렬하였을 때, 가운데에 위치하는 샘플(1330b)의 좌표인 (xb, yb)를 포함하는 부호화 단위(1320b)를 현재 부호화 단위(1300)가 분할되어 결정된 부호화 단위(1320a, 1320b, 1320c) 중 가운데에 위치하는 부호화 단위로 결정할 수 있다. 다만 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 좌표는 픽쳐 내에서의 절대적인 위치를 나타내는 좌표를 나타낼 수 있고, 나아가 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 기준으로, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 상대적 위치를 나타내는 정보인 (dxb, dyb)좌표, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 상대적 위치를 나타내는 정보인 (dxc, dyc)좌표를 이용할 수도 있다. 또한 부호화 단위에 포함되는 샘플의 위치를 나타내는 정보로서 해당 샘플의 좌표를 이용함으로써 소정 위치의 부호화 단위를 결정하는 방법이 상술한 방법으로 한정하여 해석되어서는 안되고, 샘플의 좌표를 이용할 수 있는 다양한 산술적 방법으로 해석되어야 한다.According to an embodiment, the information indicating the position of the sample 1330a in the upper left of the upper coding unit 1320a may indicate (xa, ya) coordinates, and the sample 1330b in the upper left of the middle coding unit 1320b Information indicating the location of) may indicate (xb, yb) coordinates, and information indicating the location of the sample 1330c at the upper left of the lower coding unit 1320c may indicate (xc, yc) coordinates. The video decoding apparatus 100 may determine the middle coding unit 1320b using coordinates of samples 1330a, 1330b, and 1330c at the upper left included in the coding units 1320a, 1320b, and 1320c, respectively. For example, when the coordinates of the samples 1330a, 1330b, and 1330c in the upper left are sorted in ascending or descending order, the coding unit 1320b including (xb, yb) which is the coordinates of the sample 1330b located at the center is 1320b. The current coding unit 1300 may be determined as a coding unit located in the center among split coding units 1320a, 1320b, and 1320c determined by being split. However, the coordinates representing the positions of the upper left samples 1330a, 1330b, and 1330c may represent the coordinates representing the absolute position in the picture, and further, the position of the upper left sample 1330a of the upper coding unit 1320a. As a reference, (dxb, dyb) coordinates, which is information indicating the relative position of the sample 1330b at the upper left of the middle coding unit 1320b, and the relative position of the sample 1330c at the upper left of the lower coding unit 1320c Information (dxc, dyc) coordinates can also be used. In addition, a method for determining a coding unit at a predetermined location by using coordinates of a corresponding sample as information indicating a location of a sample included in a coding unit should not be interpreted as limited to the above-described method, and various arithmetic operations that can use the coordinates of the sample It should be interpreted as a method.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위(1300)를 복수개의 부호화 단위(1320a, 1320b, 1320c)로 분할할 수 있고, 부호화 단위(1320a, 1320b, 1320c)들 중 소정의 기준에 따라 부호화 단위를 선택할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c) 중 크기가 다른 부호화 단위(1320b)를 선택할 수 있다.According to an embodiment, the video decoding apparatus 100 may divide the current coding unit 1300 into a plurality of coding units 1320a, 1320b, and 1320c, and a predetermined reference among coding units 1320a, 1320b, and 1320c. According to the coding unit can be selected. For example, the video decoding apparatus 100 may select coding units 1320b having different sizes among coding units 1320a, 1320b, and 1320c.

일 실시예에 따라 비디오 복호화 장치(100)는 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 나타내는 정보인 (xa, ya) 좌표, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 위치를 나타내는 정보인 (xb, yb) 좌표, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 위치를 나타내는 정보인 (xc, yc) 좌표를 이용하여 부호화 단위(1320a, 1320b, 1320c) 각각의 너비 또는 높이를 결정할 수 있다. 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)의 위치를 나타내는 좌표인 (xa, ya), (xb, yb), (xc, yc)를 이용하여 부호화 단위(1320a, 1320b, 1320c) 각각의 크기를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may include (xa, ya) coordinates, which is information indicating the location of the sample 1330a at the upper left of the upper coding unit 1320a, and a sample at the upper left of the middle coding unit 1320b. Coding unit 1320a, using (xb, yb) coordinates, which are information indicating the location of (1330b), and (xc, yc) coordinates, which are information indicating the location of the sample 1330c at the upper left of the lower coding unit 1320c, 1320b, 1320c) each width or height can be determined. The video decoding apparatus 100 uses coding units 1320a, 1320b, and 1320c using coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 1320a, 1320b, and 1320c. ) Each size can be determined.

일 실시예에 따라, 비디오 복호화 장치(100)는 상단 부호화 단위(1320a)의 너비를 xb-xa로 결정할 수 있고 높이를 yb-ya로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 가운데 부호화 단위(1320b)의 너비를 xc-xb로 결정할 수 있고 높이를 yc-yb로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 하단 부호화 단위의 너비 또는 높이는 현재 부호화 단위의 너비 또는 높이와 상단 부호화 단위(1320a) 및 가운데 부호화 단위(1320b)의 너비 및 높이를 이용하여 결정할 수 있다. 비디오 복호화 장치(100)는 결정된 부호화 단위(1320a, 1320b, 1320c)의 너비 및 높이에 기초하여 다른 부호화 단위와 다른 크기를 갖는 부호화 단위를 결정할 수 있다. 도 13을 참조하면, 비디오 복호화 장치(100)는 상단 부호화 단위(1320a) 및 하단 부호화 단위(1320c)의 크기와 다른 크기를 가지는 가운데 부호화 단위(1320b)를 소정 위치의 부호화 단위로 결정할 수 있다. 다만 상술한 비디오 복호화 장치(100)가 다른 부호화 단위와 다른 크기를 갖는 부호화 단위를 결정하는 과정은 샘플 좌표에 기초하여 결정되는 부호화 단위의 크기를 이용하여 소정 위치의 부호화 단위를 결정하는 일 실시예에 불과하므로, 소정의 샘플 좌표에 따라 결정되는 부호화 단위의 크기를 비교하여 소정 위치의 부호화 단위를 결정하는 다양한 과정이 이용될 수 있다. According to an embodiment, the video decoding apparatus 100 may determine the width of the upper coding unit 1320a as xb-xa and the height as yb-ya. According to an embodiment, the video decoding apparatus 100 may determine the width of the middle coding unit 1320b as xc-xb and the height as yc-yb. According to an embodiment, the video decoding apparatus 100 may determine the width or height of the lower coding unit using the width or height of the current coding unit and the width and height of the upper coding unit 1320a and the middle coding unit 1320b. . The video decoding apparatus 100 may determine coding units having different sizes from other coding units based on the width and height of the determined coding units 1320a, 1320b, and 1320c. Referring to FIG. 13, the video decoding apparatus 100 may determine a coding unit 1320b having a size different from that of the upper coding unit 1320a and the lower coding unit 1320c as coding units of a predetermined position. However, in the process of determining the coding unit having a different size from other coding units, the above-described video decoding apparatus 100 determines an coding unit at a predetermined location by using the size of the coding unit determined based on sample coordinates. Since it is merely a method, various processes of determining a coding unit at a predetermined location by comparing the sizes of coding units determined according to predetermined sample coordinates may be used.

다만 부호화 단위의 위치를 결정하기 위하여 고려하는 샘플의 위치는 상술한 좌측 상단으로 한정하여 해석되어서는 안되고 부호화 단위에 포함되는 임의의 샘플의 위치에 대한 정보가 이용될 수 있는 것으로 해석될 수 있다. However, the location of the sample considered in order to determine the location of the coding unit should not be interpreted as being limited to the upper left, and it can be interpreted that information about the location of any sample included in the coding unit can be used.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위의 형태를 고려하여, 현재 부호화 단위가 분할되어 결정되는 홀수개의 부호화 단위들 중 소정 위치의 부호화 단위를 선택할 수 있다. 예를 들면, 현재 부호화 단위가 너비가 높이보다 긴 비-정사각형 형태라면 비디오 복호화 장치(100)는 수평 방향에 따라 소정 위치의 부호화 단위를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 수평 방향으로 위치를 달리 하는 부호화 단위들 중 하나를 결정하여 해당 부호화 단위에 대한 제한을 둘 수 있다. 현재 부호화 단위가 높이가 너비보다 긴 비-정사각형 형태라면 비디오 복호화 장치(100)는 수직 방향에 따라 소정 위치의 부호화 단위를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 수직 방향으로 위치를 달리 하는 부호화 단위들 중 하나를 결정하여 해당 부호화 단위에 대한 제한을 둘 수 있다. According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position among odd coding units determined by dividing the current coding unit in consideration of the shape of the current coding unit. For example, if the current coding unit is a non-square shape having a width greater than a height, the video decoding apparatus 100 may determine a coding unit at a predetermined position according to a horizontal direction. That is, the video decoding apparatus 100 may determine one of the coding units having different positions in the horizontal direction and place restrictions on the coding unit. If the current coding unit is a non-square shape having a height higher than a width, the video decoding apparatus 100 may determine a coding unit at a predetermined position according to a vertical direction. That is, the video decoding apparatus 100 may determine one of the coding units having different positions in the vertical direction and place restrictions on the corresponding coding unit.

일 실시예에 따라 비디오 복호화 장치(100)는 짝수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여 짝수개의 부호화 단위들 각각의 위치를 나타내는 정보를 이용할 수 있다. 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하여 짝수개의 부호화 단위들을 결정할 수 있고 짝수개의 부호화 단위들의 위치에 대한 정보를 이용하여 소정 위치의 부호화 단위를 결정할 수 있다. 이에 대한 구체적인 과정은 도 13에서 상술한 홀수개의 부호화 단위들 중 소정 위치(예를 들면, 가운데 위치)의 부호화 단위를 결정하는 과정에 대응하는 과정일 수 있으므로 생략하도록 한다.According to an embodiment, the video decoding apparatus 100 may use information indicating the location of each of the even numbered coding units to determine a coding unit of a predetermined position among the even numbered coding units. The video decoding apparatus 100 may determine an even number of coding units by dividing the current coding unit, and determine a coding unit at a predetermined location by using information about the positions of the even number of coding units. A detailed process for this may be omitted because it may be a process corresponding to a process of determining a coding unit of a predetermined position (for example, a center position) among the odd number of coding units described in FIG.

일 실시예에 따라, 비-정사각형 형태의 현재 부호화 단위를 복수개의 부호화 단위로 분할한 경우, 복수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여 분할 과정에서 소정 위치의 부호화 단위에 대한 소정의 정보를 이용할 수 있다. 예를 들면 비디오 복호화 장치(100)는 현재 부호화 단위가 복수개로 분할된 부호화 단위들 중 가운데에 위치하는 부호화 단위를 결정하기 위하여 분할 과정에서 가운데 부호화 단위에 포함된 샘플에 저장된 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. According to an embodiment, when a current coding unit having a non-square form is divided into a plurality of coding units, a predetermined coding unit for a predetermined position in a splitting process is determined in order to determine a coding unit at a predetermined position among a plurality of coding units. You can use the information. For example, the video decoding apparatus 100, in order to determine a coding unit positioned in the center among coding units in which a current coding unit is divided into a plurality of pieces, block shape information and split shape stored in a sample included in the middle coding unit in the splitting process At least one of the information can be used.

도 13을 참조하면 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 현재 부호화 단위(1300)를 복수개의 부호화 단위들(1320a, 1320b, 1320c)로 분할할 수 있으며, 복수개의 부호화 단위들(1320a, 1320b, 1320c) 중 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. 나아가 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나가 획득되는 위치를 고려하여, 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. 즉, 현재 부호화 단위(1300)의 블록 형태 정보 및 분할 형태 정보 중 적어도 하나는 현재 부호화 단위(1300)의 가운데에 위치하는 샘플(1340)에서 획득될 수 있으며, 상기 블록 형태 정보 및 상기 분할 형태 정보 중 적어도 하나에 기초하여 현재 부호화 단위(1300)가 복수개의 부호화 단위들(1320a, 1320b, 1320c)로 분할된 경우 상기 샘플(1340)을 포함하는 부호화 단위(1320b)를 가운데에 위치하는 부호화 단위로 결정할 수 있다. 다만 가운데에 위치하는 부호화 단위로 결정하기 위해 이용되는 정보가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나로 한정하여 해석되어서는 안되고, 다양한 종류의 정보가 가운데에 위치하는 부호화 단위를 결정하는 과정에서 이용될 수 있다.Referring to FIG. 13, the video decoding apparatus 100 may divide the current coding unit 1300 into a plurality of coding units 1320a, 1320b, and 1320c based on at least one of block type information and split type information, A coding unit 1320b positioned in the center among the plurality of coding units 1320a, 1320b, and 1320c may be determined. Furthermore, the video decoding apparatus 100 may determine a coding unit 1320b located in the center in consideration of a position at least one of block type information and split type information is acquired. That is, at least one of block type information and split type information of the current coding unit 1300 may be obtained from a sample 1340 located in the center of the current coding unit 1300, and the block type information and the split type information When the current coding unit 1300 is divided into a plurality of coding units 1320a, 1320b, and 1320c based on at least one of them, the coding unit 1320b including the sample 1340 is a coding unit positioned in the center. Can decide. However, the information used to determine the coding unit located in the middle should not be interpreted as being limited to at least one of the block type information and the split type information. Can.

일 실시예에 따라 소정 위치의 부호화 단위를 식별하기 위한 소정의 정보는, 결정하려는 부호화 단위에 포함되는 소정의 샘플에서 획득될 수 있다. 도 13을 참조하면, 비디오 복호화 장치(100)는 현재 부호화 단위(1300)가 분할되어 결정된 복수개의 부호화 단위들(1320a, 1320b, 1320c) 중 소정 위치의 부호화 단위(예를 들면, 복수개로 분할된 부호화 단위 중 가운데에 위치하는 부호화 단위)를 결정하기 위하여 현재 부호화 단위(1300) 내의 소정 위치의 샘플(예를 들면, 현재 부호화 단위(1300)의 가운데에 위치하는 샘플)에서 획득되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. . 즉, 비디오 복호화 장치(100)는 현재 부호화 단위(1300)의 블록 블록 형태를 고려하여 상기 소정 위치의 샘플을 결정할 수 있고, 비디오 복호화 장치(100)는 현재 부호화 단위(1300)가 분할되어 결정되는 복수개의 부호화 단위(1320a, 1320b, 1320c)들 중, 소정의 정보(예를 들면, 블록 형태 정보 및 분할 형태 정보 중 적어도 하나)가 획득될 수 있는 샘플이 포함된 부호화 단위(1320b)를 결정하여 소정의 제한을 둘 수 있다. 도 13을 참조하면 일 실시예에 따라 비디오 복호화 장치(100)는 소정의 정보가 획득될 수 있는 샘플로서 현재 부호화 단위(1300)의 가운데에 위치하는 샘플(1340)을 결정할 수 있고, 비디오 복호화 장치(100)는 이러한 샘플(1340)이 포함되는 부호화 단위(1320b)를 복호화 과정에서의 소정의 제한을 둘 수 있다. 다만 소정의 정보가 획득될 수 있는 샘플의 위치는 상술한 위치로 한정하여 해석되어서는 안되고, 제한을 두기 위해 결정하려는 부호화 단위(1320b)에 포함되는 임의의 위치의 샘플들로 해석될 수 있다.According to an embodiment, predetermined information for identifying a coding unit at a predetermined location may be obtained from a predetermined sample included in a coding unit to be determined. Referring to FIG. 13, the video decoding apparatus 100 may include a coding unit (eg, divided into a plurality of units) at a predetermined position among a plurality of coding units 1320a, 1320b, and 1320c determined by dividing the current coding unit 1300. Block type information obtained from a sample at a predetermined position in the current coding unit 1300 (for example, a sample located in the center of the current coding unit 1300) to determine a coding unit positioned in the center among coding units, and At least one of split type information may be used. . That is, the video decoding apparatus 100 may determine the sample at the predetermined position in consideration of the block block form of the current coding unit 1300, and the video decoding apparatus 100 may determine that the current coding unit 1300 is divided. Of the plurality of coding units 1320a, 1320b, and 1320c, a coding unit 1320b including a sample capable of obtaining predetermined information (for example, at least one of block type information and split type information) is determined to determine Certain restrictions may be imposed. Referring to FIG. 13, according to an embodiment, the video decoding apparatus 100 may determine a sample 1340 located in the center of the current coding unit 1300 as a sample from which predetermined information can be obtained, and the video decoding apparatus The (100) may place a predetermined restriction in the decoding process of the coding unit 1320b in which the sample 1340 is included. However, the location of the sample where the predetermined information can be obtained should not be interpreted as being limited to the above-described location, but can be interpreted as samples at any location included in the coding unit 1320b to be determined in order to limit the location.

일 실시예에 따라 소정의 정보가 획득될 수 있는 샘플의 위치는 현재 부호화 단위(1300)의 형태에 따라 결정될 수 있다. 일 실시예에 따라 블록 형태 정보는 현재 부호화 단위의 형태가 정사각형인지 또는 비-정사각형인지 여부를 결정할 수 있고, 형태에 따라 소정의 정보가 획득될 수 있는 샘플의 위치를 결정할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위의 너비에 대한 정보 및 높이에 대한 정보 중 적어도 하나를 이용하여 현재 부호화 단위의 너비 및 높이 중 적어도 하나를 반으로 분할하는 경계 상에 위치하는 샘플을 소정의 정보가 획득될 수 있는 샘플로 결정할 수 있다. 또다른 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위에 관련된 블록 형태 정보가 비-정사각형 형태임을 나타내는 경우, 현재 부호화 단위의 긴 변을 반으로 분할하는 경계에 인접하는 샘플 중 하나를 소정의 정보가 획득될 수 있는 샘플로 결정할 수 있다. According to an embodiment, a location of a sample from which predetermined information can be obtained may be determined according to the type of the current coding unit 1300. According to an embodiment, the block shape information may determine whether the shape of the current coding unit is square or non-square, and may determine a location of a sample from which predetermined information can be obtained according to the shape. For example, the video decoding apparatus 100 is located on a boundary dividing at least one of the width and height of the current coding unit by using at least one of information about the width and height of the current coding unit. The sample may be determined as a sample from which predetermined information can be obtained. For another example, when the block type information related to the current coding unit is in a non-square form, the video decoding apparatus 100 determines one of samples adjacent to a boundary dividing the long side of the current coding unit in half. It can be determined as a sample from which information can be obtained.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 복수개의 부호화 단위로 분할한 경우, 복수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여, 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 부호화 단위에 포함된 소정 위치의 샘플에서 획득할 수 있고, 비디오 복호화 장치(100)는 현재 부호화 단위가 분할되어 생성된 복수개의 부호화 단위들을 복수개의 부호화 단위 각각에 포함된 소정 위치의 샘플로부터 획득되는 분할 형태 정보 및 블록 형태 정보 중 적어도 하나를 이용하여 분할할 수 있다. 즉, 부호화 단위는 부호화 단위 각각에 포함된 소정 위치의 샘플에서 획득되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용하여 재귀적으로 분할될 수 있다. 부호화 단위의 재귀적 분할 과정에 대하여는 도 12를 통해 상술하였으므로 자세한 설명은 생략하도록 한다. According to an embodiment, when the current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 may determine at least one of block type information and split type information in order to determine a coding unit at a predetermined position among a plurality of coding units. You can use one. According to an embodiment, the video decoding apparatus 100 may obtain at least one of block shape information and split shape information from a sample at a predetermined location included in the coding unit, and the video decoding apparatus 100 may split the current coding unit. The generated coding units may be split using at least one of split type information and block shape information obtained from samples at a predetermined location included in each of the plurality of coding units. That is, the coding unit may be recursively divided by using at least one of block shape information and split shape information obtained from a sample at a predetermined location included in each coding unit. The recursive splitting process of the coding unit has been described with reference to FIG. 12, so a detailed description thereof will be omitted.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하여 적어도 하나의 부호화 단위를 결정할 수 있고, 이러한 적어도 하나의 부호화 단위가 복호화되는 순서를 소정의 블록(예를 들면, 현재 부호화 단위)에 따라 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine at least one coding unit by dividing the current coding unit, and the order in which the at least one coding unit is decoded may be determined by a predetermined block (eg, the current coding unit). ).

도 14는 일 실시예에 따라 비디오 복호화 장치(100)가 현재 부호화 단위를 분할하여 복수개의 부호화 단위들을 결정하는 경우, 복수개의 부호화 단위들이 처리되는 순서를 도시한다.14 illustrates an order in which a plurality of coding units are processed when the video decoding apparatus 100 determines a plurality of coding units by dividing a current coding unit according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보에 따라 제1 부호화 단위(1400)를 수직 방향으로 분할하여 제2 부호화 단위(1410a, 1410b)를 결정하거나 제1 부호화 단위(1400)를 수평 방향으로 분할하여 제2 부호화 단위(1430a, 1430b)를 결정하거나 제1 부호화 단위(1400)를 수직 방향 및 수평 방향으로 분할하여 제2 부호화 단위(1450a, 1450b, 1450c, 1450d)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 determines the second coding units 1410a and 1410b by dividing the first coding unit 1400 in the vertical direction according to the block type information and the split type information, or the first coding unit The second coding units 1450a, 1450b, 1450c, and 1450d are determined by dividing the 1400 in the horizontal direction to determine the second coding units 1430a and 1430b, or by dividing the first coding unit 1400 in the vertical and horizontal directions. Can decide.

도 14를 참조하면, 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 수직 방향으로 분할하여 결정된 제2 부호화 단위(1410a, 1410b)를 수평 방향(1410c)으로 처리되도록 순서를 결정할 수 있다. 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 수평 방향으로 분할하여 결정된 제2 부호화 단위(1430a, 1430b)의 처리 순서를 수직 방향(1430c)으로 결정할 수 있다. 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 수직 방향 및 수평 방향으로 분할하여 결정된 제2 부호화 단위(1450a, 1450b, 1450c, 1450d)를 하나의 행에 위치하는 부호화 단위들이 처리된 후 다음 행에 위치하는 부호화 단위들이 처리되는 소정의 순서(예를 들면, 래스터 스캔 순서((raster scan order) 또는 z 스캔 순서(z scan order)(1450e) 등)에 따라 결정할 수 있다. Referring to FIG. 14, the video decoding apparatus 100 may determine an order to process the second coding units 1410a and 1410b determined by dividing the first coding unit 1400 in the vertical direction in the horizontal direction 1410c. . The video decoding apparatus 100 may determine the processing order of the second coding units 1430a and 1430b determined by dividing the first coding unit 1400 in the horizontal direction in the vertical direction 1430c. After the video decoding apparatus 100 processes the coding units positioned in one row, the second coding units 1450a, 1450b, 1450c, and 1450d determined by dividing the first coding unit 1400 in a vertical direction and a horizontal direction are processed. The coding units positioned in the next row may be determined according to a predetermined order (for example, a raster scan order or a z scan order 1450e).

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위들을 재귀적으로 분할할 수 있다. 도 14를 참조하면, 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 분할하여 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)을 결정할 수 있고, 결정된 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d) 각각을 재귀적으로 분할할 수 있다. 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)을 분할하는 방법은 제1 부호화 단위(1400)를 분할하는 방법에 대응하는 방법이 될 수 있다. 이에 따라 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)은 각각 독립적으로 복수개의 부호화 단위들로 분할될 수 있다. 도 14를 참조하면 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 수직 방향으로 분할하여 제2 부호화 단위(1410a, 1410b)를 결정할 수 있고, 나아가 제2 부호화 단위(1410a, 1410b) 각각을 독립적으로 분할하거나 분할하지 않는 것으로 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may recursively divide coding units. Referring to FIG. 14, the video decoding apparatus 100 may determine a plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d by dividing the first coding unit 1400, Each of the determined plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be recursively divided. A method of dividing the plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be a method corresponding to a method of dividing the first coding unit 1400. Accordingly, the plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be independently divided into a plurality of coding units. Referring to FIG. 14, the video decoding apparatus 100 may determine the second coding units 1410a and 1410b by dividing the first coding unit 1400 in the vertical direction, and further, each of the second coding units 1410a and 1410b You can decide to split independently or not.

일 실시예에 따라 비디오 복호화 장치(100)는 좌측의 제2 부호화 단위(1410a)를 수평 방향으로 분할하여 제3 부호화 단위(1420a, 1420b)로 분할할 수 있고, 우측의 제2 부호화 단위(1410b)는 분할하지 않을 수 있다. According to an embodiment, the video decoding apparatus 100 may split the second coding unit 1410a on the left side into the third coding units 1420a and 1420b by splitting it in the horizontal direction, and the second coding unit 1410b on the right side. ) May or may not divide.

일 실시예에 따라 부호화 단위들의 처리 순서는 부호화 단위의 분할 과정에 기초하여 결정될 수 있다. 다시 말해, 분할된 부호화 단위들의 처리 순서는 분할되기 직전의 부호화 단위들의 처리 순서에 기초하여 결정될 수 있다. 비디오 복호화 장치(100)는 좌측의 제2 부호화 단위(1410a)가 분할되어 결정된 제3 부호화 단위(1420a, 1420b)가 처리되는 순서를 우측의 제2 부호화 단위(1410b)와 독립적으로 결정할 수 있다. 좌측의 제2 부호화 단위(1410a)가 수평 방향으로 분할되어 제3 부호화 단위(1420a, 1420b)가 결정되었으므로 제3 부호화 단위(1420a, 1420b)는 수직 방향(1420c)으로 처리될 수 있다. 또한 좌측의 제2 부호화 단위(1410a) 및 우측의 제2 부호화 단위(1410b)가 처리되는 순서는 수평 방향(1410c)에 해당하므로, 좌측의 제2 부호화 단위(1410a)에 포함되는 제3 부호화 단위(1420a, 1420b)가 수직 방향(1420c)으로 처리된 후에 우측 부호화 단위(1410b)가 처리될 수 있다. 상술한 내용은 부호화 단위들이 각각 분할 전의 부호화 단위에 따라 처리 순서가 결정되는 과정을 설명하기 위한 것이므로, 상술한 실시예에 한정하여 해석되어서는 안되고, 다양한 형태로 분할되어 결정되는 부호화 단위들이 소정의 순서에 따라 독립적으로 처리될 수 있는 다양한 방법으로 이용되는 것으로 해석되어야 한다.According to an embodiment, a processing order of coding units may be determined based on a splitting process of coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units immediately before being split. The video decoding apparatus 100 may independently determine the order in which the third coding units 1420a and 1420b determined by dividing the second coding unit 1410a on the left are processed independently from the second coding unit 1410b on the right. Since the second coding unit 1410a on the left side is split in the horizontal direction to determine the third coding units 1420a and 1420b, the third coding units 1420a and 1420b may be processed in the vertical direction 1420c. Also, since the order in which the second coding unit 1410a on the left and the second coding unit 1410b on the right are processed corresponds to the horizontal direction 1410c, the third coding unit included in the second coding unit 1410a on the left side. After (1420a, 1420b) is processed in the vertical direction 1420c, the right coding unit 1410b may be processed. Since the above-described content is for explaining a process in which a processing order is determined according to coding units before division, each coding unit should not be interpreted to be limited to the above-described embodiment. It should be interpreted as being used in a variety of ways that can be processed independently in sequence.

도 15는 일 실시예에 따라 비디오 복호화 장치(100)가 소정의 순서로 부호화 단위가 처리될 수 없는 경우, 현재 부호화 단위가 홀수개의 부호화 단위로 분할되는 것임을 결정하는 과정을 도시한다.15 illustrates a process in which the video decoding apparatus 100 determines that the current coding unit is divided into an odd number of coding units when the coding units cannot be processed in a predetermined order according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 획득된 블록 형태 정보 및 분할 형태 정보에 기초하여 현재 부호화 단위가 홀수개의 부호화 단위들로 분할되는 것을 결정할 수 있다. 도 15를 참조하면 정사각형 형태의 제1 부호화 단위(1500)가 비-정사각형 형태의 제2 부호화 단위(1510a, 1510b)로 분할될 수 있고, 제2 부호화 단위(1510a, 1510b)는 각각 독립적으로 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)로 분할될 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 제2 부호화 단위 중 좌측 부호화 단위(1510a)는 수평 방향으로 분할하여 복수개의 제3 부호화 단위(1520a, 1520b)를 결정할 수 있고, 우측 부호화 단위(1510b)는 홀수개의 제3 부호화 단위(1520c, 1520d, 1520e)로 분할할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine that the current coding unit is split into an odd number of coding units based on the obtained block shape information and split shape information. Referring to FIG. 15, a first coding unit 1500 in a square shape may be divided into second coding units 1510a and 1510b in a non-square shape, and the second coding units 1510a and 1510b may be independently selected from each other. It may be divided into 3 coding units 1520a, 1520b, 1520c, 1520d, and 1520e. According to an embodiment, the video decoding apparatus 100 may determine a plurality of third coding units 1520a and 1520b by dividing the left coding unit 1510a among the second coding units in a horizontal direction, and the right coding unit 1510b ) May be divided into an odd number of third coding units 1520c, 1520d, and 1520e.

일 실시예에 따라 비디오 복호화 장치(100)는 제3 부호화 단위들(1520a, 1520b, 1520c, 1520d, 1520e)이 소정의 순서로 처리될 수 있는지 여부를 판단하여 홀수개로 분할된 부호화 단위가 존재하는지를 결정할 수 있다. 도 15를 참조하면, 비디오 복호화 장치(100)는 제1 부호화 단위(1500)를 재귀적으로 분할하여 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)를 결정할 수 있다. 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여, 제1 부호화 단위(1500), 제2 부호화 단위(1510a, 1510b) 또는 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)가 분할되는 형태 중 홀수개의 부호화 단위로 분할되는지 여부를 결정할 수 있다. 예를 들면, 제2 부호화 단위(1510a, 1510b) 중 우측에 위치하는 부호화 단위가 홀수개의 제3 부호화 단위(1520c, 1520d, 1520e)로 분할될 수 있다. 제1 부호화 단위(1500)에 포함되는 복수개의 부호화 단위들이 처리되는 순서는 소정의 순서(예를 들면, z-스캔 순서(z-scan order)(1530))가 될 수 있고, 비디오 복호화 장치(100)는 우측 제2 부호화 단위(1510b)가 홀수개로 분할되어 결정된 제3 부호화 단위(1520c, 1520d, 1520e)가 상기 소정의 순서에 따라 처리될 수 있는 조건을 만족하는지를 판단할 수 있다.According to an embodiment, the video decoding apparatus 100 determines whether third coding units 1520a, 1520b, 1520c, 1520d, and 1520e can be processed in a predetermined order to determine whether an odd number of coding units exist. Can decide. Referring to FIG. 15, the video decoding apparatus 100 may recursively divide the first coding unit 1500 to determine third coding units 1520a, 1520b, 1520c, 1520d, and 1520e. The video decoding apparatus 100 based on at least one of block type information and split type information, the first coding unit 1500, the second coding units 1510a, 1510b, or the third coding units 1520a, 1520b, 1520c, 1520d, 1520e) may be determined whether or not to be divided into odd number of coding units. For example, among the second coding units 1510a and 1510b, a coding unit positioned on the right side may be divided into an odd number of third coding units 1520c, 1520d, and 1520e. The order in which the plurality of coding units included in the first coding unit 1500 are processed may be a predetermined order (for example, a z-scan order 1530), and the video decoding apparatus ( 100) may determine whether the third coding unit 1520c, 1520d, 1520e determined by dividing the right second coding unit 1510b into odd numbers satisfies a condition that can be processed according to the predetermined order.

일 실시예에 따라 비디오 복호화 장치(100)는 제1 부호화 단위(1500)에 포함되는 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)가 소정의 순서에 따라 처리될 수 있는 조건을 만족하는지를 결정할 수 있으며, 상기 조건은 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)의 경계에 따라 제2 부호화 단위(1510a, 1510b)의 너비 및 높이 중 적어도 하나를 반으로 분할되는지 여부와 관련된다. 예를 들면 비-정사각형 형태의 좌측 제2 부호화 단위(1510a)의 높이를 반으로 분할하여 결정되는 제3 부호화 단위(1520a, 1520b)는 조건을 만족하지만, 우측 제2 부호화 단위(1510b)를 3개의 부호화 단위로 분할하여 결정되는 제3 부호화 단위(1520c, 1520d, 1520e)들의 경계가 우측 제2 부호화 단위(1510b)의 너비 또는 높이를 반으로 분할하지 못하므로 제3 부호화 단위(1520c, 1520d, 1520e)는 조건을 만족하지 못하는 것으로 결정될 수 있고, 비디오 복호화 장치(100)는 이러한 조건 불만족의 경우 스캔 순서의 단절(disconnection)로 판단하고, 판단 결과에 기초하여 우측 제2 부호화 단위(1510b)는 홀수개의 부호화 단위로 분할되는 것으로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 홀수개의 부호화 단위로 분할되는 경우 분할된 부호화 단위들 중 소정 위치의 부호화 단위에 대하여 소정의 제한을 둘 수 있으며, 이러한 제한 내용 또는 소정 위치 등에 대하여는 다양한 실시예를 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the video decoding apparatus 100 satisfies a condition that the third coding units 1520a, 1520b, 1520c, 1520d, and 1520e included in the first coding unit 1500 may be processed in a predetermined order. Whether or not the condition is divided in half by at least one of the width and height of the second coding unit 1510a, 1510b according to the boundary of the third coding unit 1520a, 1520b, 1520c, 1520d, 1520e. Related. For example, the third coding units 1520a and 1520b determined by dividing the height of the left second coding unit 1510a in a non-square shape in half satisfy the condition, but the right second coding unit 1510b is 3 Since the boundaries of the third coding units 1520c, 1520d, and 1520e determined by dividing into two coding units do not divide the width or height of the right second coding unit 1510b in half, the third coding units 1520c, 1520d, 1520e) may be determined as not satisfying the condition, and the video decoding apparatus 100 determines that the scan sequence is disconnected in the case of dissatisfaction with the condition, and based on the determination result, the right second coding unit 1510b is It can be determined to be divided into an odd number of coding units. According to an embodiment, when the video decoding apparatus 100 is divided into an odd number of coding units, a predetermined limit may be placed on a coding unit at a predetermined position among split coding units, and various restrictions may be applied to the content or the predetermined location. Since it has been described through examples, detailed description will be omitted.

도 16은 일 실시예에 따라 비디오 복호화 장치(100)가 제1 부호화 단위(1600)를 분할하여 적어도 하나의 부호화 단위를 결정하는 과정을 도시한다. 일 실시예에 따라 비디오 복호화 장치(100)는 획득부(110)를 통해 획득한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1600)를 분할할 수 있다. 정사각형 형태의 제1 부호화 단위(1600)는 4개의 정사각형 형태를 가지는 부호화 단위로 분할되거나 또는 비-정사각형 형태의 복수개의 부호화 단위로 분할할 수 있다. 예를 들면 도 16을 참조하면, 블록 형태 정보가 제1 부호화 단위(1600)는 정사각형임을 나타내고 분할 형태 정보가 비-정사각형의 부호화 단위로 분할됨을 나타내는 경우 비디오 복호화 장치(100)는 제1 부호화 단위(1600)를 복수개의 비-정사각형의 부호화 단위들로 분할할 수 있다. 구체적으로, 분할 형태 정보가 제1 부호화 단위(1600)를 수평 방향 또는 수직 방향으로 분할하여 홀수개의 부호화 단위를 결정하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(1600)을 홀수개의 부호화 단위들로서 수직 방향으로 분할되어 결정된 제2 부호화 단위(1610a, 1610b, 1610c) 또는 수평 방향으로 분할되어 결정된 제2 부호화 단위(1620a, 1620b, 1620c)로 분할할 수 있다. 16 illustrates a process in which the video decoding apparatus 100 determines the at least one coding unit by dividing the first coding unit 1600 according to an embodiment. According to an embodiment, the video decoding apparatus 100 may split the first coding unit 1600 based on at least one of block shape information and split shape information acquired through the acquisition unit 110. The first coding unit 1600 having a square shape may be divided into coding units having four square shapes, or may be divided into a plurality of coding units having a non-square shape. For example, referring to FIG. 16, when the block type information indicates that the first coding unit 1600 is a square and indicates that the split type information is divided into coding units of a non-square, the video decoding apparatus 100 first coding unit 1600 may be divided into a plurality of non-square coding units. Specifically, when the split type information indicates that the first coding unit 1600 is divided in a horizontal direction or a vertical direction to determine an odd number of coding units, the video decoding apparatus 100 may include a square type first coding unit 1600 ) May be divided into second coding units 1610a, 1610b, and 1610c determined by splitting in the vertical direction as odd coding units or second coding units 1620a, 1620b, and 1620c determined by splitting in the horizontal direction.

일 실시예에 따라 비디오 복호화 장치(100)는 제1 부호화 단위(1600)에 포함되는 제2 부호화 단위(1610a, 1610b, 1610c, 1620a, 1620b, 1620c)가 소정의 순서에 따라 처리될 수 있는 조건을 만족하는지를 결정할 수 있으며, 상기 조건은 제2 부호화 단위(1610a, 1610b, 1610c, 1620a, 1620b, 1620c)의 경계에 따라 제1 부호화 단위(1600)의 너비 및 높이 중 적어도 하나를 반으로 분할되는지 여부와 관련된다. 도 16를 참조하면 정사각형 형태의 제1 부호화 단위(1600)를 수직 방향으로 분할하여 결정되는 제2 부호화 단위(1610a, 1610b, 1610c)들의 경계가 제1 부호화 단위(1600)의 너비를 반으로 분할하지 못하므로 제1 부호화 단위(1600)는 소정의 순서에 따라 처리될 수 있는 조건을 만족하지 못하는 것으로 결정될 수 있다. 또한 정사각형 형태의 제1 부호화 단위(1600)를 수평 방향으로 분할하여 결정되는 제2 부호화 단위(1620a, 1620b, 1620c)들의 경계가 제1 부호화 단위(1600)의 너비를 반으로 분할하지 못하므로 제1 부호화 단위(1600)는 소정의 순서에 따라 처리될 수 있는 조건을 만족하지 못하는 것으로 결정될 수 있다. 비디오 복호화 장치(100)는 이러한 조건 불만족의 경우 스캔 순서의 단절(disconnection)로 판단하고, 판단 결과에 기초하여 제1 부호화 단위(1600)는 홀수개의 부호화 단위로 분할되는 것으로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 홀수개의 부호화 단위로 분할되는 경우 분할된 부호화 단위들 중 소정 위치의 부호화 단위에 대하여 소정의 제한을 둘 수 있으며, 이러한 제한 내용 또는 소정 위치 등에 대하여는 다양한 실시예를 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the video decoding apparatus 100 may include conditions in which second coding units 1610a, 1610b, 1610c, 1620a, 1620b, and 1620c included in the first coding unit 1600 may be processed according to a predetermined order. It may be determined whether or not, and the condition is divided into at least one of the width and height of the first coding unit 1600 according to the boundary of the second coding unit (1610a, 1610b, 1610c, 1620a, 1620b, 1620c). Whether it is related. Referring to FIG. 16, the boundary of the second coding units 1610a, 1610b, and 1610c determined by dividing the square first coding unit 1600 in the vertical direction divides the width of the first coding unit 1600 in half. Therefore, it may be determined that the first coding unit 1600 does not satisfy a condition that can be processed according to a predetermined order. Also, since the boundary of the second coding units 1620a, 1620b, and 1620c determined by dividing the square first coding unit 1600 in the horizontal direction does not divide the width of the first coding unit 1600 in half. It may be determined that one coding unit 1600 does not satisfy a condition that can be processed according to a predetermined order. In the case of dissatisfaction with the condition, the video decoding apparatus 100 determines that the scan sequence is disconnected, and based on the determination result, the first coding unit 1600 may be divided into an odd number of coding units. According to an embodiment, when the video decoding apparatus 100 is divided into an odd number of coding units, a predetermined limit may be placed on a coding unit at a predetermined position among split coding units, and various restrictions may be applied to the content or the predetermined location. Since it has been described through examples, detailed description will be omitted.

일 실시예에 따라, 비디오 복호화 장치(100)는 제1 부호화 단위를 분할하여 다양한 형태의 부호화 단위들을 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 may determine various types of coding units by dividing the first coding unit.

도 16을 참조하면, 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(1600), 비-정사각형 형태의 제1 부호화 단위(1630 또는 1650)를 다양한 형태의 부호화 단위들로 분할할 수 있다. Referring to FIG. 16, the video decoding apparatus 100 may divide a first coding unit 1600 in a square shape and a first coding unit 1630 or 1650 in a non-square shape into various coding units. .

도 17은 일 실시예에 따라 비디오 복호화 장치(100)가 제1 부호화 단위(1700)가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위가 소정의 조건을 만족하는 경우 제2 부호화 단위가 분할될 수 있는 형태가 제한되는 것을 도시한다.FIG. 17 is a diagram for a video decoding apparatus 100 according to an embodiment in which a second coding unit in a non-square shape determined by dividing a first coding unit 1700 satisfies a predetermined condition. It shows that the possible forms are limited.

일 실시예에 따라 비디오 복호화 장치(100)는 획득부(105)를 통해 획득한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 정사각형 형태의 제1 부호화 단위(1700)를 비-정사각형 형태의 제2 부호화 단위(1710a, 1710b, 1720a, 1720b)로 분할하는 것으로 결정할 수 있다. 제2 부호화 단위(1710a, 1710b, 1720a, 1720b)는 독립적으로 분할될 수 있다. 이에 따라 비디오 복호화 장치(100)는 제2 부호화 단위(1710a, 1710b, 1720a, 1720b) 각각에 관련된 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 복수개의 부호화 단위로 분할하거나 분할하지 않는 것을 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 수직 방향으로 제1 부호화 단위(1700)가 분할되어 결정된 비-정사각형 형태의 좌측 제2 부호화 단위(1710a)를 수평 방향으로 분할하여 제3 부호화 단위(1712a, 1712b)를 결정할 수 있다. 다만 비디오 복호화 장치(100)는 좌측 제2 부호화 단위(1710a)를 수평 방향으로 분할한 경우, 우측 제2 부호화 단위(1710b)는 좌측 제2 부호화 단위(1710a)가 분할된 방향과 동일하게 수평 방향으로 분할될 수 없도록 제한할 수 있다. 만일 우측 제2 부호화 단위(1710b)가 동일한 방향으로 분할되어 제3 부호화 단위(1714a, 1714b)가 결정된 경우, 좌측 제2 부호화 단위(1710a) 및 우측 제2 부호화 단위(1710b)가 수평 방향으로 각각 독립적으로 분할됨으로써 제3 부호화 단위(1712a, 1712b, 1714a, 1714b)가 결정될 수 있다. 하지만 이는 비디오 복호화 장치(100)가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1700)를 4개의 정사각형 형태의 제2 부호화 단위(1730a, 1730b, 1730c, 1730d)로 분할한 것과 동일한 결과이며 이는 영상 복호화 측면에서 비효율적일 수 있다.According to an embodiment, the video decoding apparatus 100 may use the non-square form of the first coding unit 1700 having a square shape based on at least one of block shape information and split shape information acquired through the acquisition unit 105. It can be determined to be divided into second coding units 1710a, 1710b, 1720a, and 1720b. The second coding units 1710a, 1710b, 1720a, and 1720b may be divided independently. Accordingly, the video decoding apparatus 100 determines whether to divide or not split into a plurality of coding units based on at least one of block type information and split type information related to each of the second coding units 1710a, 1710b, 1720a, and 1720b. Can. According to an embodiment, the video decoding apparatus 100 splits the left second coding unit 1710a of the non-square shape determined by dividing the first coding unit 1700 in the vertical direction in the horizontal direction, thereby dividing the third coding unit ( 1712a, 1712b). However, when the video decoding apparatus 100 divides the left second coding unit 1710a in the horizontal direction, the right second coding unit 1710b has the same horizontal direction as the left second coding unit 1710a is split. It can be limited so that it cannot be divided into. If the right second coding unit 1710b is split in the same direction and the third coding units 1714a and 1714b are determined, the left second coding unit 1710a and the right second coding unit 1710b are respectively in the horizontal direction. The third coding units 1712a, 1712b, 1714a, and 1714b may be determined by being independently divided. However, this means that the video decoding apparatus 100 divides the first coding unit 1700 into four square second coding units 1730a, 1730b, 1730c, and 1730d based on at least one of block type information and split type information. This is the same result as the one done, which can be inefficient in terms of image decoding.

일 실시예에 따라 비디오 복호화 장치(100)는 수평 방향으로 제1 부호화 단위(11300)가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위(1720a 또는 1720b)를 수직 방향으로 분할하여 제3 부호화 단위(1722a, 1722b, 1724a, 1724b)를 결정할 수 있다. 다만 비디오 복호화 장치(100)는 제2 부호화 단위 중 하나(예를 들면 상단 제2 부호화 단위(1720a))를 수직 방향으로 분할한 경우, 상술한 이유에 따라 다른 제2 부호화 단위(예를 들면 하단 부호화 단위(1720b))는 상단 제2 부호화 단위(1720a)가 분할된 방향과 동일하게 수직 방향으로 분할될 수 없도록 제한할 수 있다. According to an embodiment, the video decoding apparatus 100 may divide the second coding unit 1720a or 1720b in the non-square shape determined by dividing the first coding unit 11300 in the horizontal direction in the vertical direction, and thereby the third coding unit. (1722a, 1722b, 1724a, 1724b) can be determined. However, when the video decoding apparatus 100 divides one of the second coding units (for example, the upper second coding unit 1720a) in the vertical direction, other second coding units (for example, lower ends) according to the aforementioned reason The coding unit 1720b) may restrict the upper second coding unit 1720a from being split in the same vertical direction as the split direction.

도 18은 일 실시예에 따라 분할 형태 정보가 4개의 정사각형 형태의 부호화 단위로 분할하는 것을 나타낼 수 없는 경우, 비디오 복호화 장치(100)가 정사각형 형태의 부호화 단위를 분할하는 과정을 도시한다.FIG. 18 is a diagram illustrating a process in which the video decoding apparatus 100 divides a square-type coding unit when the split-type information cannot be divided into four square-type coding units according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1800)를 분할하여 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등)를 결정할 수 있다. 분할 형태 정보에는 부호화 단위가 분할될 수 있는 다양한 형태에 대한 정보가 포함될 수 있으나, 다양한 형태에 대한 정보에는 정사각형 형태의 4개의 부호화 단위로 분할하기 위한 정보가 포함될 수 없는 경우가 있다. 이러한 분할 형태 정보에 따르면, 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(1800)를 4개의 정사각형 형태의 제2 부호화 단위(1830a, 1830b, 1830c, 1830d)로 분할하지 못한다. 분할 형태 정보에 기초하여 비디오 복호화 장치(100)는 비-정사각형 형태의 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 splits the first coding unit 1800 on the basis of at least one of block type information and split type information to obtain second coding units 1810a, 1810b, 1820a, 1820b, and the like. Can decide. The split type information may include information on various types in which coding units can be split, but information on various types may not include information for splitting into four coding units in a square shape. According to the split type information, the video decoding apparatus 100 does not divide the first coding unit 1800 in a square shape into four second coding units 1830a, 1830b, 1830c, and 1830d in a square shape. Based on the split type information, the video decoding apparatus 100 may determine a second coding unit (1810a, 1810b, 1820a, 1820b, etc.) in a non-square shape.

일 실시예에 따라 비디오 복호화 장치(100)는 비-정사각형 형태의 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등)를 각각 독립적으로 분할할 수 있다. 재귀적인 방법을 통해 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등) 각각이 소정의 순서대로 분할될 수 있으며, 이는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1800)가 분할되는 방법에 대응하는 분할 방법일 수 있다. According to an embodiment, the video decoding apparatus 100 may independently partition the second coding units (1810a, 1810b, 1820a, 1820b, etc.) in a non-square form, respectively. Each of the second coding units (1810a, 1810b, 1820a, 1820b, etc.) may be divided in a predetermined order through a recursive method, which is based on at least one of block type information and split type information (1800) ) May be a partitioning method corresponding to the partitioning method.

예를 들면 비디오 복호화 장치(100)는 좌측 제2 부호화 단위(1810a)가 수평 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1812a, 1812b)를 결정할 수 있고, 우측 제2 부호화 단위(1810b)가 수평 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1814a, 1814b)를 결정할 수 있다. 나아가 비디오 복호화 장치(100)는 좌측 제2 부호화 단위(1810a) 및 우측 제2 부호화 단위(1810b) 모두 수평 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1816a, 1816b, 1816c, 1816d)를 결정할 수도 있다. 이러한 경우 제1 부호화 단위(1800)가 4개의 정사각형 형태의 제2 부호화 단위(1830a, 1830b, 1830c, 1830d)로 분할된 것과 동일한 형태로 부호화 단위가 결정될 수 있다. For example, the video decoding apparatus 100 may determine the third coding units 1812a and 1812b in a square shape by dividing the left second coding unit 1810a in the horizontal direction, and the right second coding unit 1810b. The third coding units 1814a and 1814b in a square shape may be determined by being split in a horizontal direction. Furthermore, the video decoding apparatus 100 may determine the third coding units 1816a, 1816b, 1816c, and 1816d in a square shape by dividing both the left second coding unit 1810a and the right second coding unit 1810b in the horizontal direction. have. In this case, the coding unit may be determined in the same form as the first coding unit 1800 is divided into four square second coding units 1830a, 1830b, 1830c, and 1830d.

또 다른 예를 들면 비디오 복호화 장치(100)는 상단 제2 부호화 단위(1820a)가 수직 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1822a, 1822b)를 결정할 수 있고, 하단 제2 부호화 단위(1820b)가 수직 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1824a, 1824b)를 결정할 수 있다. 나아가 비디오 복호화 장치(100)는 상단 제2 부호화 단위(1820a) 및 하단 제2 부호화 단위(1820b) 모두 수직 방향으로 분할되어 정사각형 형태의 제3 부호화 단위(1822a, 1822b, 1824a, 1824b)를 결정할 수도 있다. 이러한 경우 제1 부호화 단위(1800)가 4개의 정사각형 형태의 제2 부호화 단위(1830a, 1830b, 1830c, 1830d)로 분할된 것과 동일한 형태로 부호화 단위가 결정될 수 있다. For another example, the video decoding apparatus 100 may determine the third coding units 1822a and 1822b in a square shape by dividing the upper second coding unit 1820a in the vertical direction, and the lower second coding unit 1820b. ) Is divided in the vertical direction to determine the third coding units 1824a and 1824b in a square shape. Furthermore, the video decoding apparatus 100 may determine the third coding units 1822a, 1822b, 1824a, and 1824b in a square shape by dividing both the upper second coding unit 1820a and the lower second coding unit 1820b in the vertical direction. have. In this case, the coding unit may be determined in the same form as the first coding unit 1800 is divided into four square second coding units 1830a, 1830b, 1830c, and 1830d.

도 19는 일 실시예에 따라 복수개의 부호화 단위들 간의 처리 순서가 부호화 단위의 분할 과정에 따라 달라질 수 있음을 도시한 것이다.19 illustrates that a processing order among a plurality of coding units may vary according to a splitting process of coding units according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보에 기초하여 제1 부호화 단위(1900)를 분할할 수 있다. 블록 형태 정보가 정사각형 형태를 나타내고, 분할 형태 정보가 제1 부호화 단위(1900)가 수평 방향 및 수직 방향 중 적어도 하나의 방향으로 분할됨을 나타내는 경우, 비디오 복호화 장치(100)는 제1 부호화 단위(1900)를 분할하여 제2 부호화 단위(예를 들면, 1910a, 1910b, 1920a, 1920b, 1930a, 1930b, 1930c, 1930d 등)를 결정할 수 있다. 도 19를 참조하면 제1 부호화 단위1900)가 수평 방향 또는 수직 방향만으로 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위(1910a, 1910b, 1920a, 1920b)는 각각에 대한 블록 형태 정보 및 분할 형태 정보에 기초하여 독립적으로 분할될 수 있다. 예를 들면 비디오 복호화 장치(100)는 제1 부호화 단위(1900)가 수직 방향으로 분할되어 생성된 제2 부호화 단위(1910a, 1910b)를 수평 방향으로 각각 분할하여 제3 부호화 단위(1916a, 1916b, 1916c, 1916d)를 결정할 수 있고, 제1 부호화 단위(1900)가 수평 방향으로 분할되어 생성된 제2 부호화 단위(1920a, 1920b)를 수평 방향으로 각각 분할하여 제3 부호화 단위(1926a, 1926b, 1926c, 1926d)를 결정할 수 있다. 이러한 제2 부호화 단위(1910a, 1910b, 1920a, 1920b)의 분할 과정은 도 17과 관련하여 상술하였으므로 자세한 설명은 생략하도록 한다. According to an embodiment, the video decoding apparatus 100 may split the first coding unit 1900 based on the block shape information and the split shape information. When the block shape information indicates a square shape and the split shape information indicates that the first coding unit 1900 is split in at least one of a horizontal direction and a vertical direction, the video decoding apparatus 100 first coding unit 1900 ) To determine a second coding unit (eg, 1910a, 1910b, 1920a, 1920b, 1930a, 1930b, 1930c, 1930d, etc.). Referring to FIG. 19, the second coding units 1910a, 1910b, 1920a, and 1920b of the non-square shape determined by dividing the first coding unit 1900 in the horizontal direction or the vertical direction only include block shape information and split shape information for each It can be divided independently on the basis of. For example, the video decoding apparatus 100 splits the second coding units 1910a and 1910b generated by dividing the first coding unit 1900 in the vertical direction, respectively, in the horizontal direction, and the third coding units 1916a and 1916b, respectively. 1916c, 1916d), and the third coding units 1926a, 1926b, and 1926c by dividing the second coding units 1920a and 1920b generated by splitting the first coding unit 1900 in the horizontal direction, respectively. , 1926d). Since the splitting process of the second coding units 1910a, 1910b, 1920a, and 1920b has been described above with reference to FIG. 17, a detailed description thereof will be omitted.

일 실시예에 따라 비디오 복호화 장치(100)는 소정의 순서에 따라 부호화 단위를 처리할 수 있다. 소정의 순서에 따른 부호화 단위의 처리에 대한 특징은 도 14과 관련하여 상술하였으므로 자세한 설명은 생략하도록 한다. 도 19를 참조하면 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(1900)를 분할하여 4개의 정사각형 형태의 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)를 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 제1 부호화 단위(1900)가 분할되는 형태에 따라 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)의 처리 순서를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may process coding units according to a predetermined order. Characteristics of the processing of the coding unit according to a predetermined order have been described above with reference to FIG. 14, so a detailed description thereof will be omitted. Referring to FIG. 19, the video decoding apparatus 100 divides the first coding unit 1900 in a square shape, and the third coding units in four square shapes 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d ). According to an embodiment, the video decoding apparatus 100 may process the processing order of the third coding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d according to the form in which the first coding unit 1900 is divided. Can decide.

일 실시예에 따라 비디오 복호화 장치(100)는 수직 방향으로 분할되어 생성된 제2 부호화 단위(1910a, 1910b)를 수평 방향으로 각각 분할하여 제3 부호화 단위(1916a, 1916b, 1916c, 1916d)를 결정할 수 있고, 비디오 복호화 장치(100)는 좌측 제2 부호화 단위(1910a)에 포함되는 제3 부호화 단위(1916a, 1916b)를 수직 방향으로 먼저 처리한 후, 우측 제2 부호화 단위(1910b)에 포함되는 제3 부호화 단위(1916c, 1916d)를 수직 방향으로 처리하는 순서(1917)에 따라 제3 부호화 단위(1916a, 1916b, 1916c, 1916d)를 처리할 수 있다. According to an embodiment, the video decoding apparatus 100 determines the third coding units 1916a, 1916b, 1916c, and 1916d by dividing the second coding units 1910a and 1910b generated by being split in the vertical direction, respectively, in the horizontal direction. The video decoding apparatus 100 may first process the third coding units 1916a and 1916b included in the left second coding unit 1910a in the vertical direction, and then are included in the right second coding unit 1910b. The third coding units 1916a, 1916b, 1916c, and 1916d may be processed according to a procedure 1917 for processing the third coding units 1916c and 1916d in the vertical direction.

일 실시예에 따라 비디오 복호화 장치(100)는 수평 방향으로 분할되어 생성된 제2 부호화 단위(1920a, 1920b)를 수직 방향으로 각각 분할하여 제3 부호화 단위(1926a, 1926b, 1926c, 1926d)를 결정할 수 있고, 비디오 복호화 장치(100)는 상단 제2 부호화 단위(1920a)에 포함되는 제3 부호화 단위(1926a, 1926b)를 수평 방향으로 먼저 처리한 후, 하단 제2 부호화 단위(1920b)에 포함되는 제3 부호화 단위(1926c, 1926d)를 수평 방향으로 처리하는 순서(1927)에 따라 제3 부호화 단위(1926a, 1926b, 1926c, 1926d)를 처리할 수 있다.According to an embodiment, the video decoding apparatus 100 determines the third coding units 1926a, 1926b, 1926c, and 1926d by dividing the second coding units 1920a and 1920b generated by being split in the horizontal direction in the vertical direction, respectively. The video decoding apparatus 100 may first process the third coding units 1926a and 1926b included in the upper second coding unit 1920a in the horizontal direction, and then include the third coding units 1920b in the lower second coding unit 1920b. The third coding units 1926a, 1926b, 1926c, and 1926d may be processed according to an order 1927 for processing the third coding units 1926c and 1926d in the horizontal direction.

도 19를 참조하면, 제2 부호화 단위(1910a, 1910b, 1920a, 1920b)가 각각 분할되어 정사각형 형태의 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)가 결정될 수 있다. 수직 방향으로 분할되어 결정된 제2 부호화 단위(1910a, 1910b) 및 수평 방향으로 분할되어 결정된 제2 부호화 단위(1920a, 1920b)는 서로 다른 형태로 분할된 것이지만, 이후에 결정되는 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)에 따르면 결국 동일한 형태의 부호화 단위들로 제1 부호화 단위(1900)가 분할된 결과가 된다. 이에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 상이한 과정을 통해 재귀적으로 부호화 단위를 분할함으로써 결과적으로 동일한 형태의 부호화 단위들을 결정하더라도, 동일한 형태로 결정된 복수개의 부호화 단위들을 서로 다른 순서로 처리할 수 있다.Referring to FIG. 19, the second coding units 1910a, 1910b, 1920a, and 1920b are divided, so that a third coding unit in a square form (1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d) may be determined. have. The second coding units 1910a and 1910b determined by splitting in the vertical direction and the second coding units 1920a and 1920b determined by splitting in the horizontal direction are split in different forms, but the third coding units 1916a determined later. , 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d) results in the first coding unit 1900 being divided into coding units of the same type. Accordingly, the video decoding apparatus 100 divides coding units recursively through a different process based on at least one of block type information and split type information, so as to determine coding units of the same type as a result, a plurality of determined in the same type The coding units may be processed in different orders.

도 20은 일 실시예에 따라 부호화 단위가 재귀적으로 분할되어 복수개의 부호화 단위가 결정되는 경우, 부호화 단위의 형태 및 크기가 변함에 따라 부호화 단위의 심도가 결정되는 과정을 도시한다.20 is a diagram illustrating a process in which a depth of a coding unit is determined as a shape and a size of a coding unit change when a coding unit is recursively divided and a plurality of coding units are determined according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 심도를 소정의 기준에 따라 결정할 수 있다. 예를 들면 소정의 기준은 부호화 단위의 긴 변의 길이가 될 수 있다. 비디오 복호화 장치(100)는 현재 부호화 단위의 긴 변의 길이가 분할되기 전의 부호화 단위의 긴 변의 길이보다 2n (n>0) 배로 분할된 경우, 현재 부호화 단위의 심도는 분할되기 전의 부호화 단위의 심도보다 n만큼 심도가 증가된 것으로 결정할 수 있다. 이하에서는 심도가 증가된 부호화 단위를 하위 심도의 부호화 단위로 표현하도록 한다.According to an embodiment, the video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the current coding unit is split by 2n (n>0) times than the length of the long side of the coding unit before being split, the video decoding apparatus 100 may have a depth greater than that of the coding unit before being split. It can be determined that the depth is increased by n. Hereinafter, a coding unit having an increased depth is expressed as a coding unit of a lower depth.

도 20을 참조하면, 일 실시예에 따라 정사각형 형태임을 나타내는 블록 형태 정보(예를 들면 블록 형태 정보는 ′0: SQUARE′를 나타낼 수 있음)에 기초하여 비디오 복호화 장치(100)는 정사각형 형태인 제1 부호화 단위(2000)를 분할하여 하위 심도의 제2 부호화 단위(2002), 제3 부호화 단위(2004) 등을 결정할 수 있다. 정사각형 형태의 제1 부호화 단위(2000)의 크기를 2Nx2N이라고 한다면, 제1 부호화 단위(2000)의 너비 및 높이를 1/21배로 분할하여 결정된 제2 부호화 단위(2002)는 NxN의 크기를 가질 수 있다. 나아가 제2 부호화 단위(2002)의 너비 및 높이를 1/2크기로 분할하여 결정된 제3 부호화 단위(2004)는 N/2xN/2의 크기를 가질 수 있다. 이 경우 제3 부호화 단위(2004)의 너비 및 높이는 제1 부호화 단위(2000)의 1/22배에 해당한다. 제1 부호화 단위(2000)의 심도가 D인 경우 제1 부호화 단위(2000)의 너비 및 높이의 1/21배인 제2 부호화 단위(2002)의 심도는 D+1일 수 있고, 제1 부호화 단위(2000)의 너비 및 높이의 1/22배인 제3 부호화 단위(2004)의 심도는 D+2일 수 있다. Referring to FIG. 20, according to an embodiment, the video decoding apparatus 100 may be configured to have a square shape based on block shape information indicating that it is a square shape (for example, block shape information may indicate '0: SQUARE'). The first coding unit 2000 may be divided to determine the second coding unit 2002 of the lower depth, the third coding unit 2004, and the like. If the size of the square first coding unit 2000 is 2Nx2N, the second coding unit 2002 determined by dividing the width and height of the first coding unit 2000 by 1/21 times may have a size of NxN. have. Furthermore, the third coding unit 2004 determined by dividing the width and height of the second coding unit 2002 by 1/2 size may have a size of N/2xN/2. In this case, the width and height of the third coding unit 2004 are 1/22 times the first coding unit 2000. When the depth of the first coding unit 2000 is D, the depth of the second coding unit 2002 that is 1/21 times the width and height of the first coding unit 2000 may be D+1, and the first coding unit The depth of the third coding unit 2004 that is 1/22 times the width and height of (2000) may be D+2.

일 실시예에 따라 비-정사각형 형태를 나타내는 블록 형태 정보(예를 들면 블록 형태 정보는, 높이가 너비보다 긴 비-정사각형임을 나타내는 ′1: NS_VER′ 또는 너비가 높이보다 긴 비-정사각형임을 나타내는 ′2: NS_HOR′를 나타낼 수 있음)에 기초하여, 비디오 복호화 장치(100)는 비-정사각형 형태인 제1 부호화 단위(2010 또는 2020)를 분할하여 하위 심도의 제2 부호화 단위(2012 또는 2022), 제3 부호화 단위(2014 또는 2024) 등을 결정할 수 있다. According to an embodiment, block shape information indicating a non-square shape (eg, block shape information is '1: NS_VER' in which a height is longer than a width, or'N_square' in which a width is longer than a height) 2: NS_HOR′), the video decoding apparatus 100 splits the first coding unit (2010 or 2020) having a non-square shape, and a second coding unit (2012 or 2022) of a lower depth, The third coding unit 2014 or 2024 may be determined.

비디오 복호화 장치(100)는 Nx2N 크기의 제1 부호화 단위(2010)의 너비 및 높이 중 적어도 하나를 분할하여 제2 부호화 단위(예를 들면, 2002, 2012, 2022 등)를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 부호화 단위(2010)를 수평 방향으로 분할하여 NxN 크기의 제2 부호화 단위(2002) 또는 NxN/2 크기의 제2 부호화 단위(2022)를 결정할 수 있고, 수평 방향 및 수직 방향으로 분할하여 N/2xN 크기의 제2 부호화 단위(2012)를 결정할 수도 있다.The video decoding apparatus 100 may determine a second coding unit (eg, 2002, 2012, 2022, etc.) by dividing at least one of the width and height of the Nx2N-sized first coding unit 2010. That is, the video decoding apparatus 100 may divide the first coding unit 2010 in the horizontal direction to determine the second coding unit 2002 of NxN size or the second coding unit 2022 of NxN/2 size, The second coding unit 2012 having an N/2×N size may be determined by dividing it in a horizontal direction and a vertical direction.

일 실시예에 따라 비디오 복호화 장치(100)는 2NxN 크기의 제1 부호화 단위(2020) 의 너비 및 높이 중 적어도 하나를 분할하여 제2 부호화 단위(예를 들면, 2002, 2012, 2022 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제1 부호화 단위(2020)를 수직 방향으로 분할하여 NxN 크기의 제2 부호화 단위(2002) 또는 N/2xN 크기의 제2 부호화 단위(2012)를 결정할 수 있고, 수평 방향 및 수직 방향으로 분할하여 NxN/2 크기의 제2 부호화 단위(2022)를 결정할 수도 있다.According to an embodiment, the video decoding apparatus 100 determines a second coding unit (eg, 2002, 2012, 2022, etc.) by dividing at least one of a width and a height of the 2NxN-sized first coding unit 2020. It might be. That is, the video decoding apparatus 100 may determine the second coding unit 2002 having an NxN size or a second coding unit 2012 having an N/2xN size by dividing the first coding unit 2020 in the vertical direction, The second coding unit 2022 having an NxN/2 size may be determined by dividing it in a horizontal direction and a vertical direction.

일 실시예에 따라 비디오 복호화 장치(100)는 NxN 크기의 제2 부호화 단위(2002) 의 너비 및 높이 중 적어도 하나를 분할하여 제3 부호화 단위(예를 들면, 2004, 2014, 2024 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제2 부호화 단위(2002)를 수직 방향 및 수평 방향으로 분할하여 N/2xN/2 크기의 제3 부호화 단위(2004)를 결정하거나 N/22xN/2 크기의 제3 부호화 단위(2014)를 결정하거나 N/2xN/22 크기의 제3 부호화 단위(2024)를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 determines a third coding unit (eg, 2004, 2014, 2024, etc.) by dividing at least one of the width and height of the NxN-sized second coding unit 2002. It might be. That is, the video decoding apparatus 100 divides the second coding unit 2002 in the vertical direction and the horizontal direction to determine the third coding unit 2004 having the size of N/2xN/2 or the N/22xN/2 size. The third coding unit 2014 may be determined, or the third coding unit 2024 having an N/2xN/22 size may be determined.

일 실시예에 따라 비디오 복호화 장치(100)는 N/2xN 크기의 제2 부호화 단위(2012)의 너비 및 높이 중 적어도 하나를 분할하여 제3 부호화 단위(예를 들면, 2004, 2014, 2024 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제2 부호화 단위(2012)를 수평 방향으로 분할하여 N/2xN/2 크기의 제3 부호화 단위(2004) 또는 N/2xN/22 크기의 제3 부호화 단위(2024)를 결정하거나 수직 방향 및 수평 방향으로 분할하여 N/22xN/2 크기의 제3 부호화 단위(2014)를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 divides at least one of the width and height of the second coding unit 2012 having an N/2xN size, and a third coding unit (eg, 2004, 2014, 2024, etc.) You can also decide That is, the video decoding apparatus 100 divides the second coding unit 2012 in the horizontal direction, and thus a third coding unit 2004 having an N/2xN/2 size or a third coding unit 2024 having an N/2xN/22 size. ) Or split in the vertical direction and the horizontal direction to determine the third coding unit 2014 having a size of N/22xN/2.

일 실시예에 따라 비디오 복호화 장치(100)는 NxN/2 크기의 제2 부호화 단위(2014)의 너비 및 높이 중 적어도 하나를 분할하여 제3 부호화 단위(예를 들면, 2004, 2014, 2024 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제2 부호화 단위(2012)를 수직 방향으로 분할하여 N/2xN/2 크기의 제3 부호화 단위(2004) 또는 N/22xN/2 크기의 제3 부호화 단위(2014)를 결정하거나 수직 방향 및 수평 방향으로 분할하여 N/2xN/22크기의 제3 부호화 단위(2024)를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 divides at least one of the width and height of the second coding unit 2014 having the size of NxN/2, and the third coding unit (eg, 2004, 2014, 2024, etc.) You can also decide That is, the video decoding apparatus 100 divides the second coding unit 2012 in the vertical direction, and thus a third coding unit 2004 having an N/2xN/2 size or a third coding unit having an N/22xN/2 size (2014) ) Or split in a vertical direction and a horizontal direction to determine a third coding unit 2024 having an N/2xN/22 size.

일 실시예에 따라 비디오 복호화 장치(100)는 정사각형 형태의 부호화 단위(예를 들면, 2000, 2002, 2004)를 수평 방향 또는 수직 방향으로 분할할 수 있다. 예를 들면, 2Nx2N 크기의 제1 부호화 단위(2000)를 수직 방향으로 분할하여 Nx2N 크기의 제1 부호화 단위(2010)를 결정하거나 수평 방향으로 분할하여 2NxN 크기의 제1 부호화 단위(2020)를 결정할 수 있다. 일 실시예에 따라 심도가 부호화 단위의 가장 긴 변의 길이에 기초하여 결정되는 경우, 2Nx2N 크기의 제1 부호화 단위(2000, 2002 또는 2004)가 수평 방향 또는 수직 방향으로 분할되어 결정되는 부호화 단위의 심도는 제1 부호화 단위(2000, 2002 또는 2004)의 심도와 동일할 수 있다.According to an embodiment, the video decoding apparatus 100 may divide a coding unit (eg, 2000, 2002, 2004) having a square shape in a horizontal direction or a vertical direction. For example, the first coding unit 2000 of size 2Nx2N is determined by dividing the first coding unit 2000 of size 2Nx2N in the vertical direction, or the first coding unit 2010 of size Nx2N is determined by splitting in the horizontal direction. Can. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit (2000, 2002, or 2004) having a size of 2Nx2N in the horizontal direction or the vertical direction May be the same as the depth of the first coding unit (2000, 2002 or 2004).

일 실시예에 따라 제3 부호화 단위(2014 또는 2024)의 너비 및 높이는 제1 부호화 단위(2010 또는 2020)의 1/22배에 해당할 수 있다. 제1 부호화 단위(2010 또는 2020)의 심도가 D인 경우 제1 부호화 단위(2010 또는 2020)의 너비 및 높이의 1/2배인 제2 부호화 단위(2012 또는 2014)의 심도는 D+1일 수 있고, 제1 부호화 단위(2010 또는 2020)의 너비 및 높이의 1/22배인 제3 부호화 단위(2014 또는 2024)의 심도는 D+2일 수 있다. According to an embodiment, the width and height of the third coding unit 2014 or 2024 may correspond to 1/22 times the first coding unit 2010 or 2020. When the depth of the first coding unit (2010 or 2020) is D, the depth of the second coding unit (2012 or 2014) that is 1/2 times the width and height of the first coding unit (2010 or 2020) may be D+1. The depth of the third coding unit 2014 or 2024 that is 1/22 times the width and height of the first coding unit 2010 or 2020 may be D+2.

도 21은 일 실시예에 따라 부호화 단위들의 형태 및 크기에 따라 결정될 수 있는 심도 및 부호화 단위 구분을 위한 인덱스(part index, 이하 PID)를 도시한다.21 is a diagram for a depth and a coding index (part index, hereinafter, PID) that can be determined according to the type and size of coding units, according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(2100)를 분할하여 다양한 형태의 제2 부호화 단위를 결정할 수 있다. 도 21를 참조하면, 비디오 복호화 장치(100)는 분할 형태 정보에 따라 제1 부호화 단위(2100)를 수직 방향 및 수평 방향 중 적어도 하나의 방향으로 분할하여 제2 부호화 단위(2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, 2106d)를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 부호화 단위(2100)에 대한 분할 형태 정보에 기초하여 제2 부호화 단위(2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, 2106d)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine the second coding unit of various types by dividing the first coding unit 2100 of a square shape. Referring to FIG. 21, the video decoding apparatus 100 divides the first coding unit 2100 into at least one of a vertical direction and a horizontal direction according to the split type information, and then splits the second coding units 2102a, 2102b, and 2104a. 2104b, 2106a, 2106b, 2106c, 2106d). That is, the video decoding apparatus 100 may determine the second coding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, 2106d based on the split type information for the first coding unit 2100.

일 실시예에 따라 정사각형 형태의 제1 부호화 단위(2100)에 대한 분할 형태 정보에 따라 결정되는 제2 부호화 단위(2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, 2106d)는 긴 변의 길이에 기초하여 심도가 결정될 수 있다. 예를 들면, 정사각형 형태의 제1 부호화 단위(2100)의 한 변의 길이와 비-정사각형 형태의 제2 부호화 단위(2102a, 2102b, 2104a, 2104b)의 긴 변의 길이가 동일하므로, 제1 부호화 단위(2100)와 비-정사각형 형태의 제2 부호화 단위(2102a, 2102b, 2104a, 2104b)의 심도는 D로 동일하다고 볼 수 있다. 이에 반해 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 제1 부호화 단위(2100)를 4개의 정사각형 형태의 제2 부호화 단위(2106a, 2106b, 2106c, 2106d)로 분할한 경우, 정사각형 형태의 제2 부호화 단위(2106a, 2106b, 2106c, 2106d)의 한 변의 길이는 제1 부호화 단위(2100)의 한 변의 길이의 1/2배 이므로, 제2 부호화 단위(2106a, 2106b, 2106c, 2106d)의 심도는 제1 부호화 단위(2100)의 심도인 D보다 한 심도 하위인 D+1의 심도일 수 있다.According to an embodiment, the second coding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, 2106d, which are determined according to split type information for the first coding unit 2100 in a square shape, have a long side length. Depth may be determined on the basis of. For example, since the length of one side of the first coding unit 2100 in the square shape and the length of the long side of the second coding unit 2102a, 2102b, 2104a, and 2104b in the non-square shape are the same, the first coding unit ( 2100) and the non-square form of the second coding units 2102a, 2102b, 2104a, and 2104b may be considered to have the same depth as D. On the other hand, when the video decoding apparatus 100 divides the first coding unit 2100 into four square-type second coding units 2106a, 2106b, 2106c, and 2106d based on the split-type information, the square-shaped second Since the length of one side of the two coding units 2106a, 2106b, 2106c, and 2106d is 1/2 times the length of one side of the first coding unit 2100, the depth of the second coding unit 2106a, 2106b, 2106c, 2106d May be a depth of D+1 that is one depth lower than D that is the depth of the first coding unit 2100.

일 실시예에 따라 비디오 복호화 장치(100)는 높이가 너비보다 긴 형태의 제1 부호화 단위(2110)를 분할 형태 정보에 따라 수평 방향으로 분할하여 복수개의 제2 부호화 단위(2112a, 2112b, 2114a, 2114b, 2114c)로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 너비가 높이보다 긴 형태의 제1 부호화 단위(2120)를 분할 형태 정보에 따라 수직 방향으로 분할하여 복수개의 제2 부호화 단위(2122a, 2122b, 2124a, 2124b, 2124c)로 분할할 수 있다.According to an embodiment of the present disclosure, the video decoding apparatus 100 divides the first coding unit 2110 having a height greater than a width in a horizontal direction according to the split type information, so that the plurality of second coding units 2112a, 2112b, 2114a, 2114b, 2114c). According to an embodiment of the present disclosure, the video decoding apparatus 100 divides the first coding unit 2120 having a width longer than a height in a vertical direction according to the splitting type information, thereby providing a plurality of second coding units 2122a, 2122b, 2124a, 2124b, 2124c).

일 실시예에 따라 비-정사각형 형태의 제1 부호화 단위(2110 또는 2120)에 대한 분할 형태 정보에 따라 결정되는 제2 부호화 단위(2112a, 2112b, 2114a, 2114b, 2116a, 2116b, 2116c, 2116d)는 긴 변의 길이에 기초하여 심도가 결정될 수 있다. 예를 들면, 정사각형 형태의 제2 부호화 단위(2112a, 2112b)의 한 변의 길이는 높이가 너비보다 긴 비-정사각형 형태의 제1 부호화 단위(2110)의 한 변의 길이의 1/2배이므로, 정사각형 형태의 제2 부호화 단위(2102a, 2102b, 2104a, 2104b)의 심도는 비-정사각형 형태의 제1 부호화 단위(2110)의 심도 D보다 한 심도 하위의 심도인 D+1이다. According to an embodiment, the second coding units 2112a, 2112b, 2114a, 2114b, 2116a, 2116b, 2116c, and 2116d determined according to split type information for the first coding unit 2110 or 2120 in a non-square shape are Depth may be determined based on the length of the long side. For example, the length of one side of the second coding units 2112a and 2112b in the square shape is 1/2 times the length of one side of the first coding unit 2110 in the non-square shape having a height greater than the width, so that the square The depth of the second coding units 2102a, 2102b, 2104a, and 2104b of the form is D+1, which is a depth lower than a depth D of the first coding unit 2110 of the non-square form.

나아가 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 비-정사각형 형태의 제1 부호화 단위(2110)를 홀수개의 제2 부호화 단위(2114a, 2114b, 2114c)로 분할할 수 있다. 홀수개의 제2 부호화 단위(2114a, 2114b, 2114c)는 비-정사각형 형태의 제2 부호화 단위(2114a, 2114c) 및 정사각형 형태의 제2 부호화 단위(2114b)를 포함할 수 있다. 이 경우 비-정사각형 형태의 제2 부호화 단위(2114a, 2114c)의 긴 변의 길이 및 정사각형 형태의 제2 부호화 단위(2114b)의 한 변의 길이는 제1 부호화 단위(2110)의 한 변의 길이의 1/2배 이므로, 제2 부호화 단위(2114a, 2114b, 2114c)의 심도는 제1 부호화 단위(2110)의 심도인 D보다 한 심도 하위인 D+1의 심도일 수 있다. 비디오 복호화 장치(100)는 제1 부호화 단위(2110)와 관련된 부호화 단위들의 심도를 결정하는 상기 방식에 대응하는 방식으로, 너비가 높이보다 긴 비-정사각형 형태의 제1 부호화 단위(2120)와 관련된 부호화 단위들의 심도를 결정할 수 있다.Furthermore, the video decoding apparatus 100 may divide the first coding unit 2110 in a non-square shape into odd numbered second coding units 2114a, 2114b, and 2114c based on the split type information. The odd number of second coding units 2114a, 2114b, and 2114c may include non-square second coding units 2114a and 2114c and square second coding units 2114b. In this case, the length of one side of the second coding unit 2114b in the non-square shape and the length of one side of the second coding unit 2114b in the square shape is 1/ of the length of one side of the first coding unit 2110. Since it is twice, the depth of the second coding units 2114a, 2114b, and 2114c may be a depth of D+1 that is one depth lower than D, which is the depth of the first coding unit 2110. The video decoding apparatus 100 is a method corresponding to the above method for determining the depth of coding units related to the first coding unit 2110, and is associated with the first coding unit 2120 in a non-square shape having a width greater than a height. The depth of coding units may be determined.

일 실시예에 따라 비디오 복호화 장치(100)는 분할된 부호화 단위들의 구분을 위한 인덱스(PID)를 결정함에 있어서, 홀수개로 분할된 부호화 단위들이 서로 동일한 크기가 아닌 경우, 부호화 단위들 간의 크기 비율에 기초하여 인덱스를 결정할 수 있다. 도 21를 참조하면, 홀수개로 분할된 부호화 단위들(2114a, 2114b, 2114c) 중 가운데에 위치하는 부호화 단위(2114b)는 다른 부호화 단위들(2114a, 2114c)와 너비는 동일하지만 높이가 다른 부호화 단위들(2114a, 2114c)의 높이의 두 배일 수 있다. 즉, 이 경우 가운데에 위치하는 부호화 단위(2114b)는 다른 부호화 단위들(2114a, 2114c)의 두 개를 포함할 수 있다. 따라서, 스캔 순서에 따라 가운데에 위치하는 부호화 단위(2114b)의 인덱스(PID)가 1이라면 그 다음 순서에 위치하는 부호화 단위(2114c)는 인덱스가 2가 증가한 3일수 있다. 즉 인덱스의 값의 불연속성이 존재할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 이러한 분할된 부호화 단위들 간의 구분을 위한 인덱스의 불연속성의 존재 여부에 기초하여 홀수개로 분할된 부호화 단위들이 서로 동일한 크기가 아닌지 여부를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 determines an index (PID) for distinguishing the divided coding units, when the odd-numbered coding units are not the same size as each other, according to the size ratio between the coding units. The index can be determined based on this. Referring to FIG. 21, among the coding units 2114a, 2114b, and 2114c divided into odd numbers, the coding unit 2114b positioned in the center has the same width as other coding units 2114a, 2114c but different heights. It may be twice the height of the fields 2114a, 2114c. That is, in this case, the coding unit 2114b positioned at the center may include two of other coding units 2114a and 2114c. Accordingly, if the index (PID) of the coding unit 2114b positioned at the center is 1 according to the scan order, the coding unit 2114c positioned at the next order may be 3 with an index of 2. That is, there may be discontinuity in the value of the index. According to an embodiment, the video decoding apparatus 100 may determine whether odd-numbered coding units are not the same size based on whether there is a discontinuity in an index for distinguishing between the split coding units.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위로부터 분할되어 결정된 복수개의 부호화 단위들을 구분하기 위한 인덱스의 값에 기초하여 특정 분할 형태로 분할된 것인지를 결정할 수 있다. 도 21를 참조하면 비디오 복호화 장치(100)는 높이가 너비보다 긴 직사각형 형태의 제1 부호화 단위(2110)를 분할하여 짝수개의 부호화 단위(2112a, 2112b)를 결정하거나 홀수개의 부호화 단위(2114a, 2114b, 2114c)를 결정할 수 있다. 비디오 복호화 장치(100)는 복수개의 부호화 단위 각각을 구분하기 위하여 각 부호화 단위를 나타내는 인덱스(PID)를 이용할 수 있다. 일 실시예에 따라 PID는 각각의 부호화 단위의 소정 위치의 샘플(예를 들면, 좌측 상단 샘플)에서 획득될 수 있다. According to an embodiment, the video decoding apparatus 100 may determine whether the video decoding apparatus 100 is split in a specific splitting form based on an index value for distinguishing a plurality of coding units determined by being split from the current coding unit. Referring to FIG. 21, the video decoding apparatus 100 determines an even number of coding units 2112a and 2112b by dividing a rectangular first coding unit 2110 having a height greater than a width or an odd number of coding units 2114a and 2114b. , 2114c). The video decoding apparatus 100 may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to an embodiment, the PID may be obtained from a sample at a predetermined position of each coding unit (eg, an upper left sample).

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 구분을 위한 인덱스를 이용하여 분할되어 결정된 부호화 단위들 중 소정 위치의 부호화 단위를 결정할 수 있다. 일 실시예에 따라 높이가 너비보다 긴 직사각형 형태의 제1 부호화 단위(2110)에 대한 분할 형태 정보가 3개의 부호화 단위로 분할됨을 나타내는 경우 비디오 복호화 장치(100)는 제1 부호화 단위(2110)를 3개의 부호화 단위(2114a, 2114b, 2114c)로 분할할 수 있다. 비디오 복호화 장치(100)는 3개의 부호화 단위(2114a, 2114b, 2114c) 각각에 대한 인덱스를 할당할 수 있다. 비디오 복호화 장치(100)는 홀수개로 분할된 부호화 단위 중 가운데 부호화 단위를 결정하기 위하여 각 부호화 단위에 대한 인덱스를 비교할 수 있다. 비디오 복호화 장치(100)는 부호화 단위들의 인덱스에 기초하여 인덱스들 중 가운데 값에 해당하는 인덱스를 갖는 부호화 단위(2114b)를, 제1 부호화 단위(2110)가 분할되어 결정된 부호화 단위 중 가운데 위치의 부호화 단위로서 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 분할된 부호화 단위들의 구분을 위한 인덱스를 결정함에 있어서, 부호화 단위들이 서로 동일한 크기가 아닌 경우, 부호화 단위들 간의 크기 비율에 기초하여 인덱스를 결정할 수 있다. 도 21를 참조하면, 제1 부호화 단위(2110)가 분할되어 생성된 부호화 단위(2114b)는 다른 부호화 단위들(2114a, 2114c)와 너비는 동일하지만 높이가 다른 부호화 단위들(2114a, 2114c)의 높이의 두 배일 수 있다. 이 경우 가운데에 위치하는 부호화 단위(2114b)의 인덱스(PID)가 1이라면 그 다음 순서에 위치하는 부호화 단위(2114c)는 인덱스가 2가 증가한 3일수 있다. 이러한 경우처럼 균일하게 인덱스가 증가하다가 증가폭이 달라지는 경우, 비디오 복호화 장치(100)는 다른 부호화 단위들과 다른 크기를 가지는 부호화 단위를 포함하는 복수개의 부호화 단위로 분할된 것으로 결정할 수 있다, 일 실시예에 따라 분할 형태 정보가 홀수개의 부호화 단위로 분할됨을 나타내는 경우, 비디오 복호화 장치(100)는 홀수개의 부호화 단위 중 소정 위치의 부호화 단위(예를 들면 가운데 부호화 단위)가 다른 부호화 단위와 크기가 다른 형태로 현재 부호화 단위를 분할할 수 있다. 이 경우 비디오 복호화 장치(100)는 부호화 단위에 대한 인덱스(PID)를 이용하여 다른 크기를 가지는 가운데 부호화 단위를 결정할 수 있다. 다만 상술한 인덱스, 결정하고자 하는 소정 위치의 부호화 단위의 크기 또는 위치는 일 실시예를 설명하기 위해 특정한 것이므로 이에 한정하여 해석되어서는 안되며, 다양한 인덱스, 부호화 단위의 위치 및 크기가 이용될 수 있는 것으로 해석되어야 한다. According to an embodiment, the video decoding apparatus 100 may determine an encoding unit at a predetermined location among the determined encoding units by using an index for classification of coding units. According to an embodiment, when the split type information for the first coding unit 2110 in a rectangular shape having a height higher than a width is divided into three coding units, the video decoding apparatus 100 may display the first coding unit 2110. It can be divided into three coding units 2114a, 2114b, and 2114c. The video decoding apparatus 100 may allocate an index for each of the three coding units 2114a, 2114b, and 2114c. The video decoding apparatus 100 may compare an index for each coding unit to determine a middle coding unit among coding units divided into odd numbers. The video decoding apparatus 100 encodes a coding unit 2114b having an index corresponding to a middle value among indexes based on an index of coding units, and encoding of a center position among coding units determined by splitting the first coding unit 2110. It can be determined as a unit. According to an embodiment, the video decoding apparatus 100 may determine an index based on a size ratio between coding units when the coding units are not the same size as each other in determining an index for dividing the divided coding units. . Referring to FIG. 21, the coding unit 2114b generated by dividing the first coding unit 2110 has the same widths as other coding units 2114a and 2114c, but different coding units 2114a and 2114c having different heights. It can be twice the height. In this case, if the index (PID) of the coding unit 2114b positioned at the center is 1, the coding unit 2114c positioned in the next order may be 3 with an index of 2. In such a case, when the index is uniformly increased and the increase is different, the video decoding apparatus 100 may determine that the video decoding apparatus 100 is divided into a plurality of coding units including coding units having different sizes from other coding units. When the split type information is divided into odd number of coding units, the video decoding apparatus 100 has a different coding unit and a size having a different coding unit (eg, a middle coding unit) at a predetermined position among odd coding units. Can split the current coding unit. In this case, the video decoding apparatus 100 may determine a coding unit having a different size using an index (PID) for the coding unit. However, the above-described index, the size or position of the coding unit at a predetermined position to be determined is specific to explain one embodiment, and should not be interpreted as being limited thereto, and the position and size of various indexes and coding units can be used. Should be interpreted.

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 재귀적인 분할이 시작되는 소정의 데이터 단위를 이용할 수 있다. According to an embodiment, the video decoding apparatus 100 may use a predetermined data unit in which recursive division of the coding unit starts.

도 22는 일 실시예에 따라 픽쳐에 포함되는 복수개의 소정의 데이터 단위에 따라 복수개의 부호화 단위들이 결정된 것을 도시한다.22 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to an embodiment.

일 실시예에 따라 소정의 데이터 단위는 부호화 단위가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용하여 재귀적으로 분할되기 시작하는 데이터 단위로 정의될 수 있다. 즉, 현재 픽쳐를 분할하는 복수개의 부호화 단위들이 결정되는 과정에서 이용되는 최상위 심도의 부호화 단위에 해당할 수 있다. 이하에서는 설명 상 편의를 위해 이러한 소정의 데이터 단위를 기준 데이터 단위라고 지칭하도록 한다. According to an embodiment, a predetermined data unit may be defined as a data unit in which the coding unit starts to be recursively divided using at least one of block type information and split type information. That is, it may correspond to a coding unit of a highest depth used in a process in which a plurality of coding units for splitting a current picture are determined. Hereinafter, for convenience of description, the predetermined data unit will be referred to as a reference data unit.

일 실시예에 따라 기준 데이터 단위는 소정의 크기 및 형태를 나타낼 수 있다. 일 실시예에 따라, 기준 부호화 단위는 MxN의 샘플들을 포함할 수 있다. 여기서 M 및 N은 서로 동일할 수도 있으며, 2의 승수로 표현되는 정수일 수 있다. 즉, 기준 데이터 단위는 정사각형 또는 비-정사각형의 형태를 나타낼 수 있으며, 이후에 정수개의 부호화 단위로 분할될 수 있다. According to an embodiment, the reference data unit may represent a predetermined size and shape. According to an embodiment, the reference coding unit may include samples of MxN. Here, M and N may be the same as each other, or may be integers represented by a power of two. That is, the reference data unit may represent a square or non-square shape, and may be divided into an integer number of coding units.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 복수개의 기준 데이터 단위로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 분할하는 복수개의 기준 데이터 단위를 각각의 기준 데이터 단위에 대한 분할 정보를 이용하여 분할할 수 있다. 이러한 기준 데이터 단위의 분할 과정은 쿼드 트리(quad-tree)구조를 이용한 분할 과정에 대응될 수 있다. According to an embodiment, the video decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide a plurality of reference data units that split the current picture using split information for each reference data unit. The division process of the reference data unit may correspond to a division process using a quad-tree structure.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐에 포함되는 기준 데이터 단위가 가질 수 있는 최소 크기를 미리 결정할 수 있다. 이에 따라, 비디오 복호화 장치(100)는 최소 크기 이상의 크기를 갖는 다양한 크기의 기준 데이터 단위를 결정할 수 있고, 결정된 기준 데이터 단위를 기준으로 블록 형태 정보 및 분할 형태 정보를 이용하여 적어도 하나의 부호화 단위를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in the current picture can have. Accordingly, the video decoding apparatus 100 may determine reference data units of various sizes having a size equal to or greater than a minimum size, and use at least one coding unit using block type information and split type information based on the determined reference data unit. Can decide.

도 22를 참조하면, 비디오 복호화 장치(100)는 정사각형 형태의 기준 부호화 단위(2200)를 이용할 수 있고, 또는 비-정사각형 형태의 기준 부호화 단위(2202)를 이용할 수도 있다. 일 실시예에 따라 기준 부호화 단위의 형태 및 크기는 적어도 하나의 기준 부호화 단위를 포함할 수 있는 다양한 데이터 단위(예를 들면, 시퀀스(sequence), 픽쳐(picture), 슬라이스(slice), 슬라이스 세그먼트(slice segment), 최대부호화단위 등)에 따라 결정될 수 있다. Referring to FIG. 22, the video decoding apparatus 100 may use a reference coding unit 2200 in a square shape or may use a reference coding unit 2202 in a non-square shape. According to an embodiment, the shape and size of the reference coding unit may include various data units (eg, sequences, pictures, slices, slice segments (eg, sequences) that may include at least one reference coding unit. slice segment, maximum coding unit, etc.).

일 실시예에 따라 비디오 복호화 장치(100)의 획득부(105)는 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보 중 적어도 하나를 상기 다양한 데이터 단위마다 비트스트림으로부터 획득할 수 있다. 정사각형 형태의 기준 부호화 단위(2200)에 포함되는 적어도 하나의 부호화 단위가 결정되는 과정은 도 10의 현재 부호화 단위(300)가 분할되는 과정을 통해 상술하였고, 비-정사각형 형태의 기준 부호화 단위(2200)에 포함되는 적어도 하나의 부호화 단위가 결정되는 과정은 도 11의 현재 부호화 단위(1100 또는 1150)가 분할되는 과정을 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the acquisition unit 105 of the video decoding apparatus 100 may acquire at least one of information on a type of a reference coding unit and information on a size of a reference coding unit from a bitstream for each of the various data units. have. The process of determining at least one coding unit included in the square type reference coding unit 2200 is described through a process in which the current coding unit 300 of FIG. 10 is divided, and the non-square type reference coding unit 2200 The process of determining at least one coding unit included in) has been described through a process in which the current coding unit 1100 or 1150 of FIG. 11 is divided, so a detailed description thereof will be omitted.

일 실시예에 따라 비디오 복호화 장치(100)는 소정의 조건에 기초하여 미리 결정되는 일부 데이터 단위에 따라 기준 부호화 단위의 크기 및 형태를 결정하기 위하여, 기준 부호화 단위의 크기 및 형태를 식별하기 위한 인덱스를 이용할 수 있다. 즉, 획득부(105)는 비트스트림으로부터 상기 다양한 데이터 단위(예를 들면, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트, 최대부호화단위 등) 중 소정의 조건(예를 들면 슬라이스 이하의 크기를 갖는 데이터 단위)을 만족하는 데이터 단위로서 슬라이스, 슬라이스 세그먼트, 최대부호화 단위 등 마다, 기준 부호화 단위의 크기 및 형태의 식별을 위한 인덱스만을 획득할 수 있다. 비디오 복호화 장치(100)는 인덱스를 이용함으로써 상기 소정의 조건을 만족하는 데이터 단위마다 기준 데이터 단위의 크기 및 형태를 결정할 수 있다. 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 상대적으로 작은 크기의 데이터 단위마다 비트스트림으로부터 획득하여 이용하는 경우, 비트스트림의 이용 효율이 좋지 않을 수 있으므로, 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 직접 획득하는 대신 상기 인덱스만을 획득하여 이용할 수 있다. 이 경우 기준 부호화 단위의 크기 및 형태를 나타내는 인덱스에 대응하는 기준 부호화 단위의 크기 및 형태 중 적어도 하나는 미리 결정되어 있을 수 있다. 즉, 비디오 복호화 장치(100)는 미리 결정된 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 인덱스에 따라 선택함으로써, 인덱스 획득의 기준이 되는 데이터 단위에 포함되는 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 indexes to identify the size and shape of the reference coding unit in order to determine the size and shape of the reference coding unit according to some predetermined data units based on predetermined conditions Can be used. That is, the acquiring unit 105 is a data unit having a size less than or equal to a slice among the various data units (eg, sequence, picture, slice, slice segment, maximum coding unit, etc.) from the bitstream. As a data unit that satisfies ), only an index for identifying the size and shape of a reference coding unit can be obtained for each slice, slice segment, and maximum coding unit. The video decoding apparatus 100 may determine the size and shape of a reference data unit for each data unit that satisfies the predetermined condition by using an index. When the information on the type of the reference coding unit and the information on the size of the reference coding unit are obtained and used from the bitstream for each data unit of a relatively small size, the utilization efficiency of the bitstream may not be good, so the type of the reference coding unit Instead of directly acquiring information about the size of the information and the size of the reference coding unit, the index can be obtained and used. In this case, at least one of the size and shape of the reference coding unit corresponding to the index indicating the size and shape of the reference coding unit may be predetermined. That is, the video decoding apparatus 100 selects at least one of the size and shape of the predetermined reference coding unit according to the index, thereby selecting at least one of the size and shape of the reference coding unit included in the data unit that is the basis of index acquisition. Can decide.

일 실시예에 따라 비디오 복호화 장치(100)는 하나의 최대 부호화 단위에 포함하는 적어도 하나의 기준 부호화 단위를 이용할 수 있다. 즉, 영상을 분할하는 최대 부호화 단위에는 적어도 하나의 기준 부호화 단위가 포함될 수 있고, 각각의 기준 부호화 단위의 재귀적인 분할 과정을 통해 부호화 단위가 결정될 수 있다. 일 실시예에 따라 최대 부호화 단위의 너비 및 높이 중 적어도 하나는 기준 부호화 단위의 너비 및 높이 중 적어도 하나의 정수배에 해당할 수 있다. 일 실시예에 따라 기준 부호화 단위의 크기는 최대부호화단위를 쿼드 트리 구조에 따라 n번 분할한 크기일 수 있다. 즉, 비디오 복호화 장치(100)는 최대부호화단위를 쿼드 트리 구조에 따라 n 번 분할하여 기준 부호화 단위를 결정할 수 있고, 다양한 실시예들에 따라 기준 부호화 단위를 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 분할할 수 있다.According to an embodiment, the video decoding apparatus 100 may use at least one reference coding unit included in one largest coding unit. That is, the largest coding unit for splitting an image may include at least one reference coding unit, and a coding unit may be determined through a recursive splitting process of each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may correspond to an integer multiple of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be a size obtained by dividing the largest coding unit n times according to a quad tree structure. That is, the video decoding apparatus 100 may determine the reference coding unit by dividing the largest coding unit n times according to a quad tree structure, and the reference coding unit according to various embodiments at least one of block type information and split type information It can be divided based on.

도 23은 일 실시예에 따라 픽쳐(2300)에 포함되는 기준 부호화 단위의 결정 순서를 결정하는 기준이 되는 프로세싱 블록을 도시한다.23 illustrates a processing block serving as a criterion for determining a determination order of a reference coding unit included in the picture 2300 according to an embodiment.

일 실시예에 따라 비디오 복호화 장치(100)는 픽쳐를 분할하는 적어도 하나의 프로세싱 블록을 결정할 수 있다. 프로세싱 블록이란, 영상을 분할하는 적어도 하나의 기준 부호화 단위를 포함하는 데이터 단위로서, 프로세싱 블록에 포함되는 적어도 하나의 기준 부호화 단위는 특정 순서대로 결정될 수 있다. 즉, 각각의 프로세싱 블록에서 결정되는 적어도 하나의 기준 부호화 단위의 결정 순서는 기준 부호화 단위가 결정될 수 있는 다양한 순서의 종류 중 하나에 해당할 수 있으며, 각각의 프로세싱 블록에서 결정되는 기준 부호화 단위 결정 순서는 프로세싱 블록마다 상이할 수 있다. 프로세싱 블록마다 결정되는 기준 부호화 단위의 결정 순서는 래스터 스캔(raster scan), Z 스캔(Z-scan), N 스캔(N-scan), 우상향 대각 스캔(up-right diagonal scan), 수평적 스캔(horizontal scan), 수직적 스캔(vertical scan) 등 다양한 순서 중 하나일 수 있으나, 결정될 수 있는 순서는 상기 스캔 순서들에 한정하여 해석되어서는 안 된다. According to an embodiment, the video decoding apparatus 100 may determine at least one processing block that splits a picture. The processing block is a data unit including at least one reference coding unit that splits an image, and at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of the at least one reference coding unit determined in each processing block may correspond to one of various types of order in which the reference coding unit can be determined, and the reference coding unit determination order determined in each processing block May be different for each processing block. Decision order of the reference coding unit determined for each processing block includes raster scan, Z-scan, N-scan, up-right diagonal scan, and horizontal scan ( It may be one of various sequences, such as a horizontal scan and a vertical scan, but the order that can be determined should not be interpreted as being limited to the scan sequences.

일 실시예에 따라 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 비트스트림으로부터 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 이러한 프로세싱 블록의 크기는 프로세싱 블록의 크기에 대한 정보가 나타내는 데이터 단위의 소정의 크기일 수 있다. According to an embodiment, the video decoding apparatus 100 may obtain information on the size of the processing block to determine the size of at least one processing block included in the image. The video decoding apparatus 100 may obtain information on the size of the processing block from the bitstream and determine the size of at least one processing block included in the image. The size of the processing block may be a predetermined size of a data unit indicated by information about the size of the processing block.

일 실시예에 따라 비디오 복호화 장치(100)의 획득부(105)는 비트스트림으로부터 프로세싱 블록의 크기에 대한 정보를 특정의 데이터 단위마다 획득할 수 있다. 예를 들면 프로세싱 블록의 크기에 대한 정보는 영상, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트 등의 데이터 단위로 비트스트림으로부터 획득될 수 있다. 즉 획득부(105)는 상기 여러 데이터 단위마다 비트스트림으로부터 프로세싱 블록의 크기에 대한 정보를 획득할 수 있고 비디오 복호화 장치(100)는 획득된 프로세싱 블록의 크기에 대한 정보를 이용하여 픽쳐를 분할하는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있으며, 이러한 프로세싱 블록의 크기는 기준 부호화 단위의 정수배의 크기일 수 있다. According to an embodiment, the acquisition unit 105 of the video decoding apparatus 100 may acquire information on the size of a processing block from a bitstream for each specific data unit. For example, information on the size of a processing block may be obtained from a bitstream in units of data such as an image, a sequence, a picture, a slice, and a slice segment. That is, the acquisition unit 105 may acquire information on the size of a processing block from a bitstream for each of the data units, and the video decoding apparatus 100 may divide a picture using information on the size of the obtained processing block. The size of at least one processing block may be determined, and the size of the processing block may be an integer multiple of a reference coding unit.

일 실시예에 따라 비디오 복호화 장치(100)는 픽쳐(2300)에 포함되는 프로세싱 블록(2302, 2312)의 크기를 결정할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 비트스트림으로부터 획득된 프로세싱 블록의 크기에 대한 정보에 기초하여 프로세싱 블록의 크기를 결정할 수 있다. 도 23을 참조하면, 비디오 복호화 장치(100)는 일 실시예에 따라 프로세싱 블록(2302, 2312)의 가로크기를 기준 부호화 단위 가로크기의 4배, 세로크기를 기준 부호화 단위의 세로크기의 4배로 결정할 수 있다. 비디오 복호화 장치(100)는 적어도 하나의 프로세싱 블록 내에서 적어도 하나의 기준 부호화 단위가 결정되는 순서를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 may determine the sizes of the processing blocks 2302 and 2312 included in the picture 2300. For example, the video decoding apparatus 100 may determine the size of the processing block based on information about the size of the processing block obtained from the bitstream. Referring to FIG. 23, the video decoding apparatus 100 sets the horizontal size of the processing blocks 2302 and 2312 to four times the horizontal size of the reference coding unit and the vertical size to four times the vertical size of the reference coding unit, according to an embodiment. Can decide. The video decoding apparatus 100 may determine an order in which at least one reference coding unit is determined in at least one processing block.

일 실시예에 따라, 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 기초하여 픽쳐(2300)에 포함되는 각각의 프로세싱 블록(2302, 2312)을 결정할 수 있고, 프로세싱 블록(2302, 2312)에 포함되는 적어도 하나의 기준 부호화 단위의 결정 순서를 결정할 수 있다. 일 실시예에 따라 기준 부호화 단위의 결정은 기준 부호화 단위의 크기의 결정을 포함할 수 있다.According to an embodiment, the video decoding apparatus 100 may determine each processing block 2302 and 2312 included in the picture 2300 based on the size of the processing block, and include the processing block 2302 and 2312 The determination order of the at least one reference coding unit may be determined. According to an embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

일 실시예에 따라 비디오 복호화 장치(100)는 비트스트림으로부터 적어도 하나의 프로세싱 블록에 포함되는 적어도 하나의 기준 부호화 단위의 결정 순서에 대한 정보를 획득할 수 있고, 획득한 결정 순서에 대한 정보에 기초하여 적어도 하나의 기준 부호화 단위가 결정되는 순서를 결정할 수 있다. 결정 순서에 대한 정보는 프로세싱 블록 내에서 기준 부호화 단위들이 결정되는 순서 또는 방향으로 정의될 수 있다. 즉, 기준 부호화 단위들이 결정되는 순서는 각각의 프로세싱 블록마다 독립적으로 결정될 수 있다.According to an embodiment, the video decoding apparatus 100 may obtain information on a decision order of at least one reference coding unit included in at least one processing block from a bitstream, and based on the obtained decision order information Accordingly, an order in which at least one reference coding unit is determined may be determined. The information about the decision order may be defined in the order or direction in which the reference coding units are determined in the processing block. That is, the order in which the reference coding units are determined may be independently determined for each processing block.

일 실시예에 따라 비디오 복호화 장치(100)는 특정 데이터 단위마다 기준 부호화 단위의 결정 순서에 대한 정보를 비트스트림으로부터 획득할 수 있다. 예를 들면, 획득부(105)는 기준 부호화 단위의 결정 순서에 대한 정보를 영상, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트, 프로세싱 블록 등의 데이터 단위로마다 비트스트림으로부터 획득할 수 있다. 기준 부호화 단위의 결정 순서에 대한 정보는 프로세싱 블록 내에서의 기준 부호화 단위 결정 순서를 나타내므로, 결정 순서에 대한 정보는 정수개의 프로세싱 블록을 포함하는 특정 데이터 단위 마다 획득될 수 있다.According to an embodiment, the video decoding apparatus 100 may obtain information on a determination order of a reference coding unit for each specific data unit from a bitstream. For example, the acquiring unit 105 may acquire information on the determination order of the reference coding unit from the bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, and a processing block. Since the information on the decision order of the reference coding unit indicates the reference coding unit decision order in the processing block, information on the decision order can be obtained for each specific data unit including an integer number of processing blocks.

비디오 복호화 장치(100)는 일 실시예에 따라 결정된 순서에 기초하여 적어도 하나의 기준 부호화 단위를 결정할 수 있다.The video decoding apparatus 100 may determine at least one reference coding unit based on the order determined according to an embodiment.

일 실시예에 따라 획득부(105)는 비트스트림으로부터 프로세싱 블록(2302, 2312)과 관련된 정보로서, 기준 부호화 단위 결정 순서에 대한 정보를 획득할 수 있고, 비디오 복호화 장치(100)는 상기 프로세싱 블록(2302, 2312)에 포함된 적어도 하나의 기준 부호화 단위를 결정하는 순서를 결정하고 부호화 단위의 결정 순서에 따라 픽쳐(2300)에 포함되는 적어도 하나의 기준 부호화 단위를 결정할 수 있다. 도 23을 참조하면, 비디오 복호화 장치(100)는 각각의 프로세싱 블록(2302, 2312)과 관련된 적어도 하나의 기준 부호화 단위의 결정 순서(2304, 2314)를 결정할 수 있다. 예를 들면, 기준 부호화 단위의 결정 순서에 대한 정보가 프로세싱 블록마다 획득되는 경우, 각각의 프로세싱 블록(2302, 2312)과 관련된 기준 부호화 단위 결정 순서는 프로세싱 블록마다 상이할 수 있다. 프로세싱 블록(2302)과 관련된 기준 부호화 단위 결정 순서(2304)가 래스터 스캔(raster scan)순서인 경우, 프로세싱 블록(2302)에 포함되는 기준 부호화 단위는 래스터 스캔 순서에 따라 결정될 수 있다. 이에 반해 다른 프로세싱 블록(2312)과 관련된 기준 부호화 단위 결정 순서(2314)가 래스터 스캔 순서의 역순인 경우, 프로세싱 블록(2312)에 포함되는 기준 부호화 단위는 래스터 스캔 순서의 역순에 따라 결정될 수 있다.According to an embodiment, the acquisition unit 105 may obtain information on a reference coding unit determination order as information related to processing blocks 2302 and 2312 from a bitstream, and the video decoding apparatus 100 may process the processing block An order of determining at least one reference coding unit included in (2302, 2312) may be determined, and at least one reference coding unit included in the picture 2300 may be determined according to a decision order of the coding unit. Referring to FIG. 23, the video decoding apparatus 100 may determine a determination order 2304 and 2314 of at least one reference coding unit associated with each processing block 2302 and 2312. For example, when information on a decision order of a reference coding unit is obtained for each processing block, a reference coding unit decision order associated with each processing block 2302 and 2312 may be different for each processing block. When the reference coding unit determination order 2304 related to the processing block 2302 is a raster scan order, the reference coding units included in the processing block 2302 may be determined according to the raster scan order. On the other hand, when the reference coding unit determination order 2314 associated with another processing block 2312 is in the reverse order of the raster scan order, the reference coding unit included in the processing block 2312 may be determined according to the reverse order of the raster scan order.

비디오 복호화 장치(100)는 일 실시예에 따라, 결정된 적어도 하나의 기준 부호화 단위를 복호화할 수 있다. 비디오 복호화 장치(100)는 상술한 실시예를 통해 결정된 기준 부호화 단위에 기초하여 영상을 복호화 할 수 있다. 기준 부호화 단위를 복호화 하는 방법은 영상을 복호화 하는 다양한 방법들을 포함할 수 있다.The video decoding apparatus 100 may decode the determined at least one reference coding unit, according to an embodiment. The video decoding apparatus 100 may decode an image based on the reference coding unit determined through the above-described embodiment. The method of decoding the reference coding unit may include various methods of decoding the image.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위의 형태를 나타내는 블록 형태 정보 또는 현재 부호화 단위를 분할하는 방법을 나타내는 분할 형태 정보를 비트스트림으로부터 획득하여 이용할 수 있다. 블록 형태 정보 또는 분할 형태 정보는 다양한 데이터 단위와 관련된 비트스트림에 포함될 수 있다. 예를 들면, 비디오 복호화 장치(100)는 시퀀스 파라메터 세트(sequence parameter set), 픽쳐 파라메터 세트(picture parameter set), 비디오 파라메터 세트(video parameter set), 슬라이스 헤더(slice header), 슬라이스 세그먼트 헤더(slice segment header)에 포함된 블록 형태 정보 또는 분할 형태 정보를 이용할 수 있다. 나아가, 비디오 복호화 장치(100)는 최대 부호화 단위, 기준 부호화 단위, 프로세싱 블록마다 비트스트림으로부터 블록 형태 정보 또는 분할 형태 정보에 대응하는 신택스를 비트스트림으로부터 획득하여 이용할 수 있다.According to an embodiment, the video decoding apparatus 100 may obtain and use block type information indicating a type of a current coding unit or split type information indicating a method of splitting a current coding unit from a bitstream. The block type information or split type information may be included in a bitstream associated with various data units. For example, the video decoding apparatus 100 may include a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. Block type information or segment type information included in the segment header) may be used. Furthermore, the video decoding apparatus 100 may obtain and use syntax corresponding to block type information or split type information from the bitstream for each largest coding unit, reference coding unit, and processing block.

이제까지 다양한 실시예들을 중심으로 살펴보았다. 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자는 본 개시가 본 개시의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 개시의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 개시에 포함된 것으로 해석되어야 할 것이다.So far, we have focused on various embodiments. Those skilled in the art to which the present disclosure pertains will appreciate that the present disclosure may be implemented in a modified form without departing from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered in terms of explanation, not limitation. The scope of the present disclosure is shown in the claims rather than the foregoing description, and all differences within the equivalent range should be interpreted as being included in the present disclosure.

한편, 상술한 본 개시의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등)와 같은 저장매체를 포함한다.Meanwhile, the above-described embodiments of the present disclosure may be written in a program executable on a computer, and may be implemented on a general-purpose digital computer that operates the program using a computer-readable recording medium. The computer-readable recording medium includes a storage medium such as a magnetic storage medium (eg, ROM, floppy disk, hard disk, etc.), an optical reading medium (eg, CD-ROM, DVD, etc.).

Claims (15)

현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계;
상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 및
상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 단계;
상기 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및
상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함하는 비디오 복호화 방법.
Determining a rectangular scan area including all effective transform coefficients in the current block;
Scanning information on a transform coefficient in the rectangular scan area according to a predetermined scan order; And
Obtaining transform coefficients of the current block based on information about the scanned transform coefficients;
Generating a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block; And
And restoring a current block based on the generated residual block.
제 1 항에 있어서,
상기 사각형 스캔 영역 내에는 상기 현재 블록 내 모든 유효 변환 계수를 포함하고,
상기 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 변환계수만을 포함하는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The square scan area includes all effective transform coefficients in the current block,
The video decoding method of claim 1, wherein the remaining areas in the current block except for the rectangular scan area include only a conversion coefficient having a value of 0, not a valid conversion coefficient.
제 1항에 있어서,
상기 사각형 스캔 영역을 결정하는 단계는,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계; 및
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계를 포함하고,
상기 사각형 스캔 영역을 특정하는 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수에 대한 수직방향 좌표를 나타내는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
Determining the rectangular scan area,
Obtaining information on coordinates specifying the rectangular scan area from a bitstream; And
And determining a rectangular scan area including all effective transform coefficients in the current block based on information regarding coordinates specifying the rectangular scan area,
The coordinates specifying the rectangular scan area indicate horizontal coordinates for the effective transform coefficient located at the far right in the current block and vertical coordinates for the effective transform coefficient located at the bottom in the current block. Video decoding method.
제 3 항에 있어서,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계는,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행하는 단계; 및
상기 이진 산술 복호화된 정보에 대해 소정의 역이진화 방법을 이용한 역이진화를 수행하여 상기 사각형 스캔영역을 특정하는 좌표에 관한 역이진화 정보를 획득하는 단계를 더 포함하는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 3,
The step of obtaining information on coordinates specifying the rectangular scan area from a bitstream may include:
Performing binary arithmetic decoding based on a context model on information regarding coordinates specifying the rectangular scan area; And
And performing inverse binarization using the predetermined inverse binarization method on the binary arithmetic decoded information to obtain inverse binarization information regarding coordinates specifying the rectangular scan region.
제 4 항에 있어서,
상기 컨텍스트 모델은 상기 현재 블록의 크기, 상기 현재 블록의 컬러 성분(color component) 및 빈 인덱스(bin index) 중 적어도 하나에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 4,
The context model is determined based on at least one of a size of the current block, a color component of the current block, and a blank index.
제 4 항에 있어서,
상기 소정의 역이진화 방법은 고정 길이(fixed length) 역이진화 방법 및 절삭형 단항(truncated unary) 역이진화 방법 중 적어도 하나인 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 4,
The predetermined inverse binarization method is at least one of a fixed length inverse binarization method and a truncated unary inverse binarization method.
제 1 항에 있어서,
상기 소정의 스캔 순서는 역 지그재그 스캔(inverse zig-zag scan)에 따른 순서 또는 역 대각 스캔(inverse diagonal scan)에 따른 순서인 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The predetermined scan order is a video decoding method, characterized in that the order according to an inverse zigzag scan (inverse zig-zag scan) or an inverse diagonal scan (inverse diagonal scan).
제 3 항에 있어서,
상기 소정의 스캔 순서는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 중 적어도 하나에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 3,
The predetermined scan order is determined based on at least one of the horizontal coordinates of the effective transform coefficient pixel located at the rightmost position in the current block and the vertical coordinates of the effective transform coefficient pixel located at the lowermost position in the current block. Video decoding method characterized in that.
제 1 항에 있어서,
상기 변환 계수에 관한 정보는,
상기 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고,
상기 소정의 값은 0, 1, 2 중 적어도 하나인 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The information about the transform coefficient,
Flag information indicating whether or not the absolute value of the transform coefficient is greater than a predetermined value, residual level information about the absolute value of the transform coefficient, sign information of the transform coefficient, and used for inverse binarization of the transform coefficient At least one of the binarization parameter information,
The predetermined value is a video decoding method, characterized in that at least one of 0, 1, 2.
제 1 항에 있어서,
상기 스캔된 변환 계수들에 관한 정보에 기초하여 상기 현재 블록의 변환 계수들을 획득하는 단계는,
상기 변환 계수들의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 상기 현재 블록의 변환 계수들을 획득하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The step of obtaining transform coefficients of the current block based on the information about the scanned transform coefficients,
And obtaining transform coefficients of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model for flag information indicating whether an absolute value of the transform coefficients is greater than a predetermined value. Video decoding method.
제 9 항에 있어서,
상기 변환 계수들의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보는 제1 변환 계수를 포함하고,
상기 제1 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보에 관한 컨텍스트 모델은 상기 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 상기 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 상기 제1 변환 계수의 스캔 위치, 상기 제1 변환 계수의 스캔영역에서의 상대 위치, 첫번째 스캔위치 여부 중 적어도 하나에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 9,
Flag information indicating whether the absolute value of the transform coefficients is greater than a predetermined value includes a first transform coefficient,
The context model for flag information indicating whether or not the absolute value of the first transform coefficient is greater than a predetermined value includes: information about at least one second transform coefficient previously scanned according to the predetermined scan order, in the current block At least one of a position and color component of a first transform coefficient, information about a right or lower peripheral transform coefficient, a scan position of the first transform coefficient, a relative position in a scan area of the first transform coefficient, and a first scan position Video decoding method characterized in that it is determined based on.
제 1 항에 있어서,
상기 변환 계수들에 관한 정보는 변환 계수의 절대값이 소정의 값보다 큰지 여부를 나타내는 플래그 정보를 포함하고,
비트스트림으로부터 획득될 수 있는 상기 플래그 정보의 최대 개수(maximum count)는 상기 스캔 영역의 크기에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The information about the transform coefficients includes flag information indicating whether the absolute value of the transform coefficient is greater than a predetermined value,
The maximum number of pieces of flag information that can be obtained from a bitstream (maximum count) is determined based on the size of the scan area.
제 1 항에 있어서,
소정의 스캔 순서에 따라 상기 사각형 스캔 영역 내 각 변환 계수들의 스캔 순위가 결정되고,
상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계는,
상기 사각형 스캔 영역 내 변환 계수에 관한 정보를 사각형 스캔 영역 내 각 변환 계수들의 스캔 순위에 따라 스캔하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
The scan rank of each transform coefficient in the rectangular scan area is determined according to a predetermined scan order,
The step of scanning the information on the transform coefficients in the rectangular scan area according to a predetermined scan order,
And scanning information on transform coefficients in the rectangular scan area according to scan ranks of respective transform coefficients in the rectangular scan area.
제 1 항에 있어서,
소정의 정방향 스캔 순서에 따라 상기 사각형 스캔 영역 내 소정의 복수개의 변환 계수를 포함하는 적어도 하나의 계수 그룹이 결정되고,
상기 계수 그룹 단위로 적어도 하나의 변환 계수의 부호에 관한 정보를 숨기는지 여부가 결정되는 것을 특징으로 하는 비디오 복호화 방법.
According to claim 1,
At least one coefficient group including a predetermined plurality of transform coefficients in the rectangular scan area is determined according to a predetermined forward scan order,
And determining whether to hide information about a code of at least one transform coefficient in units of the coefficient group.
현재 블록의 변환 계수들을 획득하는 단계;
상기 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하는 단계;
상기 사각형 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계;
상기 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화하여 엔트로피 부호화된 정보를 생성하는 단계; 및
상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함하는 비디오 부호화 방법.
Obtaining transform coefficients of the current block;
Determining a rectangular scan area including all effective transform coefficients in the current block;
Scanning information on the transform coefficients included in the rectangular scan area according to a predetermined scan order;
Generating entropy-encoded information by entropy-coding based on the information on the scanned transform coefficients; And
And generating a bitstream including the entropy-encoded information.
KR1020207011249A 2017-12-13 2018-03-30 Video decoding method and device and video encoding method and device KR102653848B1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US201762598002P 2017-12-13 2017-12-13
US62/598,002 2017-12-13
PCT/KR2018/003820 WO2019117402A1 (en) 2017-12-13 2018-03-30 Video decoding method and device thereof, and video encoding method and device thereof

Publications (2)

Publication Number Publication Date
KR20200088297A true KR20200088297A (en) 2020-07-22
KR102653848B1 KR102653848B1 (en) 2024-04-02

Family

ID=66819653

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020207011249A KR102653848B1 (en) 2017-12-13 2018-03-30 Video decoding method and device and video encoding method and device

Country Status (3)

Country Link
KR (1) KR102653848B1 (en)
CN (3) CN111788830B (en)
WO (1) WO2019117402A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3664449A1 (en) * 2018-12-05 2020-06-10 InterDigital VC Holdings, Inc. Method and device for picture encoding and decoding
CN112887727B (en) * 2019-11-29 2023-06-13 腾讯美国有限责任公司 Video encoding and decoding method and electronic equipment
WO2023193260A1 (en) * 2022-04-08 2023-10-12 Oppo广东移动通信有限公司 Encoding/decoding method, code stream, encoder, decoder, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120005984A (en) * 2010-07-09 2012-01-17 삼성전자주식회사 Method and apparatus for entropy coding and decoding of transformation coefficient
WO2016196369A1 (en) * 2015-05-29 2016-12-08 Qualcomm Incorporated Coding data using an enhanced context-adaptive binary arithmetic coding (cabac) design

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100927733B1 (en) * 2006-09-20 2009-11-18 한국전자통신연구원 An apparatus and method for encoding / decoding selectively using a transformer according to correlation of residual coefficients
GB2492333B (en) * 2011-06-27 2018-12-12 British Broadcasting Corp Video encoding and decoding using transforms
JP5733590B2 (en) * 2011-07-15 2015-06-10 モトローラ モビリティ エルエルシーMotorola Mobility Llc A context modeling technique for encoding transform coefficient levels.
EP2735154A1 (en) * 2011-07-22 2014-05-28 Motorola Mobility LLC Device and methods for scanning rectangular-shaped transforms in video coding
US9866829B2 (en) * 2012-01-22 2018-01-09 Qualcomm Incorporated Coding of syntax elements that correspond to coefficients of a coefficient block in video coding
US9621921B2 (en) * 2012-04-16 2017-04-11 Qualcomm Incorporated Coefficient groups and coefficient coding for coefficient scans
EP3293975A4 (en) * 2015-09-08 2018-10-10 Samsung Electronics Co., Ltd. Device and method for entropy encoding and decoding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120005984A (en) * 2010-07-09 2012-01-17 삼성전자주식회사 Method and apparatus for entropy coding and decoding of transformation coefficient
WO2016196369A1 (en) * 2015-05-29 2016-12-08 Qualcomm Incorporated Coding data using an enhanced context-adaptive binary arithmetic coding (cabac) design

Also Published As

Publication number Publication date
CN116132674A (en) 2023-05-16
CN116132673A (en) 2023-05-16
KR102653848B1 (en) 2024-04-02
CN111788830B (en) 2023-04-04
WO2019117402A1 (en) 2019-06-20
CN111788830A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
KR102625144B1 (en) A method and an apparatus for video decoding by multiple core transformation, a method and an apparatus for video encoding by multiple core transformation
JP6574025B2 (en) Video decoding method and video decoding apparatus
TWI711302B (en) Apparatus and method for decoding and encoding a significance map, and related decoder, data stream and computer readable digital storage medium
KR20180093950A (en) Image coding method and apparatus, image decoding method and apparatus
KR20180107153A (en) Image coding method and apparatus, image decoding method and apparatus
KR102653848B1 (en) Video decoding method and device and video encoding method and device
KR20190039790A (en) METHOD AND APPARATUS FOR ENCODING / DECODING IMAGE
KR20180075558A (en) Video decoding method and apparatus, coding method and apparatus thereof
KR20200096537A (en) Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
EP2999218A1 (en) Method and apparatus for unification of significance map context selection

Legal Events

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