KR20200096537A - Video decoding method and apparatus thereof, and video encoding method and apparatus thereof - Google Patents

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

Info

Publication number
KR20200096537A
KR20200096537A KR1020207017052A KR20207017052A KR20200096537A KR 20200096537 A KR20200096537 A KR 20200096537A KR 1020207017052 A KR1020207017052 A KR 1020207017052A KR 20207017052 A KR20207017052 A KR 20207017052A KR 20200096537 A KR20200096537 A KR 20200096537A
Authority
KR
South Korea
Prior art keywords
information
current block
transform coefficient
scan area
coordinates
Prior art date
Application number
KR1020207017052A
Other languages
Korean (ko)
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 KR20200096537A publication Critical patent/KR20200096537A/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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • H04N19/45Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder performing compensation of the inverse transform mismatch, e.g. Inverse Discrete Cosine Transform [IDCT] mismatch
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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

Abstract

현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하고, 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하고, 현재 블록의 변환 계수들에 관한 정보에 기초하여 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 비디오 복호화 방법이 개시된다. 개시된 비디오 복호화 방법에 의하면, 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행될 수 있다.A scan area including all effective transform coefficients in the current block is determined, information on transform coefficients in the scan area is scanned according to a predetermined scan order, and binary arithmetic decoding is performed based on information on the scanned transform coefficients. To generate binary arithmetic-decoded information, inverse binarization is performed on the binary arithmetic-decoded information to obtain information on transform coefficients of the current block, and inverse quantization based on information on transform coefficients of the current block And a video decoding method of performing inverse transformation to generate a residual block of a current block, and reconstructing the current block based on the generated residual block. According to the disclosed video decoding method, the binary arithmetic decoding may be performed using a context model determined based on at least one of a size and shape of a current block.

Description

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

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

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

주파수 변환을 이용하여 공간 영역의 영상 데이터는 주파수 영역의 계수들로 변환된다. 비디오 코덱은, 주파수 변환의 빠른 연산을 위해 영상을 소정 크기의 블록들로 분할하고, 블록마다 DCT 변환을 수행하여, 블록 단위의 주파수 계수들을 부호화한다. 공간 영역의 영상 데이터에 비해 주파수 영역의 계수들이, 압축하기 쉬운 형태를 가진다. 특히 비디오 코덱의 인터 예측 또는 인트라 예측을 통해 공간 영역의 영상 화소값은 예측 오차로 표현되므로, 예측 오차에 대해 주파수 변환이 수행되면 많은 데이터가 0으로 변환될 수 있다. 비디오 코덱은 연속적으로 반복적으로 발생하는 데이터를 작은 크기의 데이터로 치환함으로써, 데이터량을 절감하고 있다.Image data in the spatial domain is transformed into coefficients in the frequency domain using frequency transformation. The video codec divides an image into blocks of a predetermined size in order to perform frequency transformation quickly, performs DCT transformation for each block, and encodes frequency coefficients in units of blocks. Compared to image data in the spatial domain, coefficients in the frequency domain are more easily compressed. In particular, since an image pixel value in a 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 zero when frequency conversion is performed on the prediction error. The video codec reduces the amount of data by replacing continuously and repeatedly generated data with data of a small size.

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

다양한 실시예에 따라, 변환 계수를 엔트로피 부복호화하는 과정에서 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 사각형 스캔 영역 내 유효 변환 계수를 스캔함으로써 불필요한 스캔을 줄이고, 서로 연관성이 있는 유효 변환 계수들을 인접하여 스캔함으로써 엔트로피 부복호화 효율을 높일 수 있다. 다양한 요소에 기초하여 변환 계수에 관한 신택스에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 특히, 블록의 크기 및 블록의 모양 중 적어도 하나를 고려하여 변환 계수에 관한 신택스 엘리먼트에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 또한, 스캔 영역을 고려하여 변환 계수에 관한 신택스에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 또한, 스캔 영역을 특정하는 수평 방향 좌표에 관한 정보 및 수직 방향 좌표에 관한 정보를 독립적으로 부복호화하지 않고, 수평 방향 좌표 및 수직 방향 좌표 간의 관련성을 고려하여 스캔 영역을 특정하는 좌표에 관한 정보를 부복호화함으로써 부복호화 효율을 높일 수 있다.According to various embodiments, in the process of entropy encoding and decoding a transform coefficient, a rectangular scan area including all effective transform coefficients in the current block is determined, and effective transform coefficients in the rectangular scan area are scanned to reduce unnecessary scans, and interrelationships are possible. Entropy encoding and decoding efficiency can be improved by scanning adjacent effective transform coefficients. Entropy encoding and decoding efficiency can be improved by determining a context model for the syntax for a transform coefficient based on various factors. In particular, entropy encoding and decoding efficiency can be improved by determining a context model for a syntax element related to a transform coefficient in consideration of at least one of a block size and a block shape. In addition, entropy encoding and decoding efficiency can be improved by determining a context model for a syntax regarding a transform coefficient in consideration of a scan area. In addition, without independently encoding and decoding information on horizontal coordinates specifying the scan area and information on vertical coordinates, information on coordinates specifying the scan area is provided in consideration of the relationship between horizontal coordinates and vertical coordinates. By encoding and decoding, the encoding and decoding efficiency can be improved.

다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.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 scan area including all effective transform coefficients in a current block; Scanning information on transform coefficients in the scan area according to a predetermined scan order; Generating binary arithmetic-decoded information by performing binary arithmetic decoding based on the information on the scanned transform coefficients; Obtaining information on transform coefficients of the current block by performing inverse binarization on the binary arithmetic-decoded information; Generating a residual block of the current block by performing inverse quantization and inverse transformation based on information on the transform coefficients of the current block; And restoring a current block based on the generated residual block,

상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행될 수 있다.The binary arithmetic decoding may be performed using a context model determined based on at least one of the size and shape of the current block.

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

상기 스캔 영역은 사각형 스캔 영역이고,The scan area is a rectangular scan area,

상기 스캔 영역을 결정하는 단계는The step of determining the scan area

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

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 변환 계수의 사각형 스캔 영역을 결정하는 단계를 포함하고,Determining a rectangular scan area of a transform coefficient in a current block based on information on coordinates specifying the rectangular scan area,

상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,The horizontal coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the rightmost position in the current block,

상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,The vertical coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the bottom of the current block,

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보가 상기 비트스트림에 포함되고,Flag information indicating whether information on coordinates specifying the rectangular scan area includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area is included in the bitstream,

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 Information on coordinates specifying the rectangular scan area is

상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평 방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,

상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 대한 좌표를 나타내는 정보 및 상기 하나의 방향에 대한 좌표와 나머지 방향에 대한 좌표 간의 차분(difference)를 나타내는 정보를 포함할 수 있다.Information indicating coordinates in one direction among horizontal coordinates for a pixel of an effective transform coefficient positioned at the rightmost side in the current block and vertical coordinates for a pixel of an effective transform coefficient positioned at the bottom of the current block; and It may include information indicating a difference between the coordinates for one direction and the coordinates for the other direction.

상기 현재 블록의 크기는 상기 현재 블록의 높이 및 너비 중 최소값 및 최대값 중 적어도 하나에 기초하여 결정되고,The size of the current block is determined based on at least one of a minimum value and a maximum value of the height and width of the current block,

상기 현재 블록의 모양은 상기 현재 블록의 높이 및 너비가 동일한지 또는 높이가 너비보다 큰지 또는 너비가 높이보다 큰지에 기초하여 결정될 수 있다.The shape of the current block may be determined based on whether the height and width of the current block are the same, the height is greater than the width, or the width is greater than the height.

상기 현재 블록 내 모든 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Determining a scan area including all transform coefficients in the current block,

상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 현재 블록 내 변환 계수들의 위치를 나타내는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하여 변경(swap)된 현재 블록을 생성하는 단계; 및If the height and width of the current block are different from each other, generating a swapped current block by swapping horizontal and vertical coordinates representing positions of transform coefficients in the current block; And

상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계를 포함하고,And determining a scan area including all effective transform coefficients in the swapped current block,

상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,The step of determining a scan area including all effective transform coefficients in the swapped current block,

상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함할 수 있다.When the height and width of the current block are different from each other, horizontal coordinates and vertical coordinates specifying the scan area are changed (swap), and based on the swapped horizontal coordinates and vertical coordinates, the It may include the step of determining the scan area.

비트스트림은 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보를 포함하는지를 나타내는 정보 및 상기 스캔 영역을 특정하는 좌표에 관한 정보를 포함하고,The bitstream includes information indicating whether flag information indicating whether a difference between coordinate values in a horizontal direction and a vertical direction specifying a scan area is included, and information about coordinates specifying the scan area,

상기 스캔 영역을 특정하는 좌표에 관한 정보는 상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함하고,The information on coordinates specifying the scan area includes information on horizontal coordinates and information on vertical coordinates specifying the scan area,

상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,

상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보는 상기 수평방향 좌표 및 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표와 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하고,The information on the horizontal coordinates specifying the scan area and the information on the vertical coordinates are information indicating coordinates related to one of the horizontal coordinates and vertical coordinates, and the coordinates related to the one direction and the other directions. It contains information indicating the difference (difference) between the relative coordinates,

상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,The step of determining a scan area including all effective transform coefficients in the swapped current block,

상기 현재 블록의 높이 및 너비가 서로 다른 경우, If the height and width of the current block are different,

상기 스캔 영역을 특정하는 좌표에 관한 정보로부터 획득된 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함할 수 있다.Swapping horizontal coordinates and vertical coordinates obtained from information on coordinates specifying the scan area, and determining the scan area based on the swapped horizontal coordinates and vertical coordinates It may include steps.

상기 컨텍스트 모델 중 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델은 상기 스캔 영역의 크기, 상기 스캔 영역 내에서 소정의 스캔 순서에 따라 현재 변환 계수보다 이전에 스캔된 계수의 개수(count) 및 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치 및 상기 현재 유효 변환 계수가 상기 스캔 영역 내 상기 소정의 스캔 순서에 따라 스캔된 변환 계수들 중 첫번째 변환 계수인지 여부 중 적어도 하나에 더 기초하여 결정될 수 수 있다.Among the context models, the context model related to flag information of the current transform coefficient includes the size of the scan area, the number of coefficients scanned before the current transform coefficient according to a predetermined scan order within the scan area, and the scan area. It may be further determined based on at least one of a relative position of the current transform coefficient and whether the current effective transform coefficient is a first transform coefficient among transform coefficients scanned according to the predetermined scan order in the scan area.

상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역의 크기 및 상기 소정의 스캔 순서에 따라 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수에 기초하여 결정되는 경우,When the context model for the flag information of the current transform coefficient is determined based on the size of the scan area and the number of flag information of the transform coefficient scanned before the current coefficient according to the predetermined scan order,

상기 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수가 상기 스캔 영역의 크기에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 결정될 수 있다.Context model regarding flag information of the current transform coefficient based on a predetermined context offset corresponding to a case where the number of flag information of the transform coefficient scanned before the current coefficient is smaller than a predetermined value based on the size of the scan area Can be determined.

상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치에 기초하여 결정되는 경우, When the context model for the flag information of the current transform coefficient is determined based on the relative position of the current transform coefficient in the scan area,

상기 현재 변환 계수의 좌표가 상기 스캔 영역의 위치를 특정하는 좌표에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수에 관한 컨텍스트 모델이 결정될 수 있다.A context model relating to the current transform coefficient may be determined based on a predetermined context offset corresponding to a case where the coordinate of the current transform coefficient is smaller than a predetermined value based on a coordinate specifying the position of the scan area.

상기 변환 계수에 관한 정보는, Information about the transformation coefficient,

상기 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 유효 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 및 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고, Flag information indicating whether the transform coefficient is greater than a predetermined value, remaining level information regarding the absolute value of the effective transform coefficient, code information of the transform coefficient, and binarization used for inverse binarization of the transform coefficient It includes at least one of parameter information,

상기 소정의 값은 0, 1, 2 중 적어도 하나일 수 있다. The predetermined value may be at least one of 0, 1, and 2.

다양한 실시예에 따른 비디오 부호화 방법은 현재 블록의 변환 계수를 획득하는 단계; 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계; 상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하는 단계; 상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 단계; 및 상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함하고,A video encoding method according to various embodiments includes obtaining transform coefficients of a current block; Determining a scan area including all effective transform coefficients in the current block; Scanning information about transform coefficients included in the scan area according to a predetermined scan order and performing binarization based on the information about the scanned transform coefficients to generate binarized information; Generating entropy-encoded information by performing binary arithmetic encoding on the binarized information; And generating a bitstream including the entropy-encoded information,

상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행될 수 있다.The binary arithmetic encoding may be performed using a context model determined based on at least one of the size and shape of the current block.

상기 스캔 영역은 사각형 스캔 영역이고,The scan area is a rectangular scan area,

상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,The horizontal coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the rightmost position in the current block,

상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,The vertical coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the bottom of the current block,

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보 및 상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보는 상기 비트스트림에 포함되고,The flag information indicating whether the information on coordinates specifying the rectangular scan area and the coordinates specifying the rectangular scan area includes a difference between coordinate values in the horizontal direction and the vertical direction specifying the rectangular scan area is the bit Is included in the stream,

상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,

상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표 및 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함할 수 있다.The information on the coordinates specifying the rectangular scan area is a horizontal coordinate for a pixel of an effective transform coefficient positioned at the rightmost position in the current block and a vertical direction for a pixel of an effective transform coefficient positioned at the bottom of the current block. It may include information indicating a coordinate of one direction among the coordinates and information indicating a difference between the coordinates of the one direction and the coordinates of the other direction.

다양한 실시예에 따른 비디오 복호화 장치는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하고, 상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 엔트로피 복호화부; 및A video decoding apparatus according to various embodiments determines a scan area including all effective transform coefficients in a current block, scans information on transform coefficients in the scan area according to a predetermined scan order, and scans the scanned transform coefficients. An entropy decoder for generating binary arithmetic-decoded information by performing binary arithmetic decoding on the basis of the information on, and obtaining information on transform coefficients of the current block by performing inverse binarization on the binary arithmetic-decoded information ; And

상기 현재 블록의 변환 계수들에 관한 정보에 기초하여 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 영상 복원부를 포함하고,Inverse quantization and inverse transformation are performed based on information on the transform coefficients of the current block to generate a residual block of the current block, and an image restoration unit reconstructing the current block based on the generated residual block,

상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행될 수 있다.The binary arithmetic decoding may be performed using a context model determined based on at least one of the size and shape of the current block.

다양한 실시예에 따른 비디오 부호화 장치는, 현재 블록의 변환 계수를 획득하고, 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하고, 상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 엔트로피 부호화부; 및 상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 비트스트림 생성부를 포함하고, 상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행될 수 있다.A video encoding apparatus according to various embodiments may obtain transform coefficients of a current block, determine a scan area including all effective transform coefficients in the current block, and determine information on transform coefficients included in the scan area. Entropy encoding that scans according to the scan order, performs binarization based on the information on the scanned transform coefficients to generate binarized information, and performs binary arithmetic coding on the binarized information to generate entropy-encoded information part; And a bitstream generator for generating a bitstream including the entropy-encoded information, wherein the binary arithmetic encoding is performed using a context model determined based on at least one of the size and shape of the current block. I can.

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

도 1a는 다양한 실시예에 따른 비디오 복호화 장치의 블록도를 도시한다.
도 1b는 다양한 실시예에 따른 비디오 복호화 방법의 흐름도를 도시한다.
도 1c는 다양한 실시예에 따른 비디오 부호화 장치의 블록도를 도시한다.
도 1d는 다양한 실시예에 따른 비디오 부호화 방법의 흐름도를 도시한다.
도 1e는 다양한 실시예에 따른 영상 복호화부의 블록도를 도시한다.
도 1f는 다양한 실시예에 따른 영상 부호화부의 블록도를 도시한다
도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.
도 3a는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.
도 3b는 일 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.
도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.
도 5는 다른 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.
도 6a는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.
도 6b는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.
도 6c는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 스캔 순서를 설명하기 위한 도면이다.
도 6d는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 스캔 순서를 설명하기 위한 도면이다.
도 6e는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 대각 스캔 순서를 설명하기 위한 도면이다.
도 7a는 일 실시예에 따라서 사각형 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향 좌표를 변경(swap)하여 스캔 영역을 변경(swap)하는 과정을 설명하기 위한 도면이다.
도 7b는 다른 실시예에 따라서 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향의 좌표를 변경(swap)하여 스캔 영역을 변경하는 과정을 설명하기 위한 도면이다.
도 8은 일 실시예에 따라 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.
도 9a 내지 도 9c는 일 실시예에 따른 레지듀얼 부호화 신택스 구조(syntax structure)를 설명하기 위한 도면이다.
도 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 encoder according to various embodiments.
FIG. 2 is a diagram for describing a method of scanning an intra-block transform coefficient according to an exemplary embodiment.
3A is a diagram for describing a method of scanning an intra-block transform coefficient according to an exemplary embodiment.
3B is a diagram for describing an operation of determining a coefficient group (subblock) within a block and an operation performed for each coefficient group, according to an exemplary embodiment.
FIG. 4 is a diagram for describing a process of determining a context model for context-based binary arithmetic encoding and decoding information on transform coefficients, according to an embodiment.
FIG. 5 is a diagram for describing a process of determining a context model for context-based binary arithmetic encoding and decoding information on transform coefficients according to another embodiment.
6A is a diagram for explaining a horizontal-first zigzag scan sequence for scanning information on transform coefficients in a block, according to an exemplary embodiment.
6B is a diagram illustrating a vertical priority zigzag scan sequence for scanning information on transform coefficients in a block, according to an exemplary embodiment.
6C is a diagram for explaining a horizontal scan sequence for scanning information about transform coefficients in a block according to an embodiment.
6D is a diagram for describing a vertical scan sequence for scanning information on transform coefficients in a block according to an embodiment.
6E is a diagram for explaining a diagonal scan order for scanning information about transform coefficients in a block according to an embodiment.
7A is a diagram for explaining a process of changing a scan area by changing horizontal and vertical coordinates of transform coefficient pixels in a rectangular scan area according to an exemplary embodiment.
FIG. 7B is a diagram for explaining a process of changing a scan area by swapping coordinates in a horizontal direction and a vertical direction of transform coefficient pixels in the scan area according to another embodiment.
FIG. 8 is a diagram for describing a process of determining a context model for syntax element information of a transform coefficient in a current block based on at least one of a size of a current block and a shape of the current 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 splitting a current coding unit according to an embodiment.
11 illustrates a process in which at least one coding unit is determined by splitting coding units having a non-square shape according to an embodiment.
12 illustrates 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 current coding unit is split to determine a plurality of coding units, according to an embodiment.
15 illustrates a process of determining that a current coding unit is divided into odd number of coding units when coding units cannot be processed in a predetermined order according to an embodiment.
16 illustrates a process in which at least one coding unit is determined by splitting a first coding unit according to an embodiment.
FIG. 17 illustrates that when a second coding unit of a non-square shape determined by splitting a first coding unit satisfies a predetermined condition, a form in which the second coding unit can be split is limited. .
FIG. 18 is a diagram illustrating a process in which a square type coding unit is divided when it is not possible to indicate that split type information is divided into four square type coding units, according to an embodiment.
19 illustrates that a processing order between a plurality of coding units may vary according to a splitting process of a coding unit, according to an embodiment.
FIG. 20 illustrates a process in which a depth of a coding unit is determined according to a change in a shape and size of a coding unit when a coding unit is recursively split to determine a plurality of coding units according to an embodiment.
21 illustrates a depth that may be determined according to a shape and size of coding units and a part index (hereinafter referred to as PID) for classifying 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 that serves as a reference for determining an order of determining reference coding units included in a picture, according to an embodiment.

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

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

이하 '현재 블록(Current Block)'은, 부호화 또는 복호화하고자 하는 영상의 블록을 의미할 수 있다.Hereinafter, the'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 reconstruction unit 120.

엔트로피 복호화부(105)는 비트스트림으로부터 수신된 신택스 엘리먼트(syntax element) 정보를 획득하고, 신택스 엘리먼트 정보에 대해 엔트로피 복호화할 수 있다. 이때, 비트스트림으로부터 수신된 신택스 엘리먼트 정보는 영상에 관한 다양한 신택스 엘리먼트에 관한 정보일 수 있다.The entropy decoding unit 105 may acquire syntax element information received from a bitstream and perform entropy decoding on 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 decoder 105 may obtain syntax element information about a transform coefficient in a current block from a bitstream, and may entropy decode syntax element information about a transform coefficient in a 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 decoder 105 may obtain information about transform coefficients in the current block by scanning syntax element information about transform coefficients in the current block, which is entropy-decoded, according to a predetermined scan order. 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 at the upper left in the block. The order of scanning the transform coefficients from the upper left transform coefficient pixel to the lower right transform coefficient can be referred to as the forward scan order, and scan the transform coefficients in the order of the last transform coefficient located at the lower right to the upper left transform coefficient. If so, it may 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 may 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)는 비트스트림에 포함시키지 않을 수 있다.In addition, the syntax element information on the transform coefficient in the current block may be syntax element information indicating a remaining 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 an effective transform coefficient; here, the effective transform coefficient means a transform coefficient whose absolute value is greater than 0.) The value of information (Greater than 0 flag or sig_coeff_flag; hereinafter referred to as GT0 flag) and flag information indicating whether it is greater than 1 (Greater than 1 flag or coeff_abs_level_greater1_flag; hereinafter referred to as GT1 flag) and whether it is greater than 2 The sum of the values of flag information indicated (Greater than 2 flag or coeff_abs_level_greater2_flag; referred to as GT2 flag) may be an absolute value of the base level. Here, when flag information indicating whether the absolute value of the transform coefficient is greater than a predetermined value is greater than a predetermined value, the value of the flag information may be 1, and when it indicates that it is less than a predetermined value, the flag information The value of may be 0. Meanwhile, some of the flag information related to the size of the transform coefficient may not be obtained from the bitstream. According to an embodiment, a flag indicating whether the size of the transform coefficient is greater than n (n is an integer) is GTn, a flag indicating whether the size of the transform coefficient is greater than (n+1) GT(n+1), and transform When a flag indicating whether the coefficient size is greater than (n+2) is GT(n+2), it is converted from the relatively smaller value of n or n+1 among the reference values of n, n+1 and n+2. Only flags indicating whether the absolute value of the coefficient is larger, that is, GTn and 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 the absolute value of the transform coefficient is greater than 1 by using only the GT0 flag information and the GT1 flag information, the remaining absolute value of the transform coefficient by subtracting 2 can be determined as the residual level absolute value of the transform coefficient.

GT0 플래그 정보, GT1 플래그 정보, GT2 플래그 정보가 각각 0, 1, 2보다 큼을 나타내는 경우, 엔트로피 복호화부(105)는 변환 계수의 절대값이 2보다 크기 때문에 변환 계수의 절대값에서 3을 뺀 나머지 절대값을 변환 계수의 잔여 레벨의 절대값으로 결정할 수 있다. 즉, 잔여 레벨 절대값은 변환 계수의 절대값이 소정의 값보다 큰지를 나타내는 정보에 기초하여 결정된 소정의 절대값과 유효 변환 계수의 절대값 간의 절대값 차이를 나타낼 수 있다.엔트로피 복호화부(105)는 비트스트림으로부터 수신된 신택스 엘리먼트 정보를 획득하고, 신택스 엘리먼트 정보에 대해 이진 산술 복호화(binary arithmetic decoding)를 수행하고, 이진 산술 복호화를 수행하여 생성된 출력인 빈 스트링(bin string)에 대해 역이진화(inverse binarization)를 수행할 수 있다. 이진 산술 복호화 동작은 이진 산술 복호화부(110)에서 수행될 수 있고, 역이진화 동작은 역이진화부(115)에서 수행될 수 있다.When the GT0 flag information, the GT1 flag information, and the GT2 flag information indicate that they are greater than 0, 1, and 2, respectively, the entropy decoding unit 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 an absolute value of a transform coefficient is greater than a predetermined value and an absolute value of an effective transform coefficient. Entropy decoding unit 105 ) Acquires syntax element information received from the bitstream, performs binary arithmetic decoding on the syntax element information, and performs binary arithmetic decoding, inversely with respect to a bin string, which is an output generated by performing binary arithmetic decoding. Inverse binarization can be performed. 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 decoder 110 may perform binary arithmetic decoding based on a predetermined context model on the syntax element information obtained from the bitstream. Here, the context model may be information on a probability of occurrence of a bin. The information on the probability of occurrence of a bin includes information (valMPS) indicating one symbol of the least propbable symbol (LPS), which is a symbol with a relatively low probability of occurrence among the two symbols 0 and 1, and the least probable symbol (MPS), which is a high symbol. It may include information on the probability of occurrence of one symbol. The probability of occurrence has a value between 0 and 1. Therefore, when the probability of one symbol among MPS and LPS is determined, the probability of occurrence of one symbol is determined because 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 so, the binary arithmetic decoder 110 may determine the probability of occurrence of the remaining symbols. In this case, the probability of occurrence of one symbol determined first may be the probability of occurrence of a least probable symbol (LPS). Meanwhile, the occurrence probabilities of symbols corresponding to the index values may be determined in advance in the table, and the occurrence probability information on the symbol may be information indicating an index (pStateIdx) indicating the occurrence probabilities of symbols determined in the table.

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

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

역이진화부(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 a bin 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 Gollum-Rice binarization method. Alternatively, the predetermined binarization method may be a binarization method in which a first binarization method and a second binarization method are combined. For example, the inverse binarization unit 115 performs inverse binarization on a first bin string, which is a part of the empty string of the syntax element, based on the inverse binarization method corresponding to the first binarization method, and performs a second binarization, which is a part of the empty string of the syntax element. For an empty string, inverse binarization may be performed based on an 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 binstring including at least one bin corresponding to the value of the syntax element. In terms of encoding, a binstring including at least one bin corresponding to a value of a syntax element is determined according to one of the aforementioned various binarization methods, and in terms of decoding, a syntax element corresponding to a binstring according to an inverse binarization method The value of can be determined. For example, when the empty string A corresponding to the value a of the syntax element (a is a real number) is determined according to a predetermined binarization/inverse 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 binstring A may be referred to as an inverse binarization process. However, as described above, binarization and inverse binarization essentially define a mapping relationship between a value of a syntax element and a binstring, and it can be easily understood by those skilled in the art that binarization/inverse binarization are substantially the same.

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

엔트로피 복호화부(105)는 변환 계수에 관한 정보를 스캔하기에 앞서, 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0인 변환 계수만을 포함할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다.The entropy decoder 105 may determine a scan area including all effective transform coefficients in the current block before scanning information on the transform coefficient. In this case, all effective transform coefficients in the current block may be included in the scan area, and the remaining areas in the current block excluding the scan area may include only transform coefficients of 0, not effective transform coefficients. At this time, the scan area includes transform coefficients from the upper left of the scan area to the last effective transform coefficient (hereinafter referred to as the last effective transform coefficient) when scanned according to a predetermined forward scan order. It may be an area to do. In this case, the coordinates specifying the scan area may be the coordinates of the last scanned effective transform coefficient pixel.

엔트로피 복호화부(105)는 비트스트림으로부터 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 획득하고, 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 기초로 스캔 영역을 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 비트스트림으로부터 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 정보를 획득할 수 있다. 이때, 각 정보에 대하여 이진 산술 복호화를 수행하여 각 정보에 대한 빈 스트링을 획득하고, 각 빈 스트링에 대하여 소정의 이진화 방법에 대응하는 역이진화 방법을 이용하여 마지막 유효 변환 계수의 수평방향의 좌표 값 및 마지막 유효 변환 계수의 수직방향 좌표 값을 획득할 수 있다.The entropy decoder 105 may obtain information about coordinates representing the last effective transform coefficient from the bitstream, and determine a scan area based on information about coordinates representing the last effective transform coefficient. For example, the entropy decoder 105 may obtain information indicating a horizontal coordinate value of the last effective transform coefficient and information indicating a vertical coordinate value of the last effective transform coefficient from the bitstream. At this time, binary arithmetic decoding is performed on each information to obtain an empty string for each information, and the horizontal coordinate value of the last effective transform coefficient by using an inverse binarization method corresponding to a predetermined binarization method for each empty string And a vertical coordinate value of the last effective transform coefficient.

엔트로피 복호화부(105)는 빈 스트링의 일부인 제1 빈 스트링에 대해 제1 역이진화 방법을 수행하여 제1값을 획득하고, 빈 스트링의 다른 일부인 제2 빈 스트링에 대해 제2 역이진화 방법을 수행하여 제2값을 획득할 수 있다. 제1값 및 제2값에 기초하여 마지막 유효 변환 계수의 수평방향의 좌표 값 및 마지막 유효 변환 계수의 수직방향 좌표 값을 획득할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 역이진화 방법은 고정 길이(fixed-length) 이진화 방법에 대응하는 역이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법에 대응하는 역이진화 방법일 수 있다.The entropy decoder 105 obtains a first value by performing a first inverse binarization method on a first empty string that is a part of the empty string, and performs a second inverse binarization method on a second empty string that is another part of the empty string. Thus, the second value can be obtained. Based on the first value and the second value, a horizontal coordinate value of the last effective transform coefficient and a vertical coordinate value of the last effective transform coefficient may be obtained. In this case, the first empty string may be a prefix, and the first inverse binarization method may be an inverse binarization method corresponding to a fixed-length binarization method. The second empty string may be a suffix, and the second inverse binarization method may be an inverse binarization method corresponding to the truncated unary binarization method.

또는, 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. Alternatively, the scan area may be a rectangular scan area, and the rectangular scan area is a horizontal coordinate of an effective transform coefficient pixel positioned at the rightmost among all effective transform coefficients in the current block and an effective transform coefficient positioned at the bottom of the current block. It may be an area specified by the vertical coordinates of the pixel.

엔트로피 복호화부(105)는 비트스트림으로부터 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 획득하고, 상기 획득된 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 기초로 사각형 스캔 영역을 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 정보를 획득할 수 있다. 이때, 엔트로피 복호화부(105)는 각 정보에 대하여 이진 산술 복호화를 수행하여 각 정보에 대한 빈 스트링을 획득하고, 빈 스트링에 대하여 소정의 이진화 방법에 대응하는 역이진화 방법을 이용하여 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 및 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 획득할 수 있다. 엔트로피 복호화부(105)는 빈 스트링의 일부인 제1 빈 스트링에 대해 제1 역이진화 방법을 수행하여 제1값을 획득하고, 빈 스트링의 다른 일부인 제2 빈 스트링에 대해 제2 역이진화 방법을 수행하여 제2값을 획득할 수 있다. 제1값 및 제2값에 기초하여 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 및 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 획득할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 역이진화 방법은 고정 길이(fixed-lenth) 이진화 방법에 대응하는 역이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법에 대응하는 역이진화 방법일 수 있다.The entropy decoder 105 may obtain information on coordinates specifying the rectangular scan area from the bitstream, and determine the rectangular scan area based on information about coordinates specifying the acquired rectangular scan area. For example, the entropy decoder 105 includes information representing a horizontal coordinate value of an effective transform coefficient pixel located at the rightmost among all effective transform coefficients in the current block from the bitstream and among all effective transform coefficients in the current block. Information indicating a vertical coordinate value of an effective transform coefficient pixel positioned at the lowermost side may be obtained. At this time, the entropy decoder 105 performs binary arithmetic decoding on each information to obtain an empty string for each information, and uses an inverse binarization method corresponding to a predetermined binarization method for the empty string. Among the effective transform coefficients, a horizontal coordinate value of an effective transform coefficient pixel positioned at the rightmost position and a vertical coordinate value of an effective transform coefficient pixel positioned at the lowermost side of the effective transform coefficients may be obtained. The entropy decoder 105 obtains a first value by performing a first inverse binarization method on a first empty string that is a part of the empty string, and performs a second inverse binarization method on a second empty string that is another part of the empty string. Thus, the second value can be obtained. Based on the first value and the second value, the horizontal coordinate value of the rightmost effective transform coefficient pixel among all the effective transform coefficients in the current block and the vertical coordinate value of the lowest effective transform coefficient pixel Can be obtained. In this case, the first empty string may be a prefix, and the first inverse binarization method may be an inverse binarization method corresponding to a fixed-lenth binarization method. The second empty string may be a suffix, and the second inverse binarization method may be an inverse binarization method corresponding to the truncated unary binarization method.

또는, 엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 획득할 수 있다. 엔트로피 복호화부(105)는 현재 블록의 높이 및 너비에 기초하여 상기 하나의 방향을 결정할 수 있다. Alternatively, the entropy decoding unit 105 is a horizontal coordinate value of an effective transform coefficient pixel located at the rightmost among all effective transform coefficients in the current block from the bitstream, or the lowest among all effective transform coefficients in the current block. Information indicating a coordinate value in one direction among vertical coordinate values of an effective transform coefficient pixel and information indicating a difference between the coordinate value in the one direction and the coordinate value in the other direction may be obtained. The entropy decoder 105 may determine the one direction based on the height and width of the current block.

엔트로피 복호화부(105)는 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 비트스트림으로부터 획득할 수 있다. 엔트로피 복호화부(105)는 상기 플래그 정보가 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 비트스트림으로부터 획득함을 나타내는 경우, 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값(또는 마지막 유효 변환 계수 픽셀의 수평방향 좌표 값) 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값(또는 마지막 유효 변환 계수 픽셀의 수직방향 좌표 값) 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득할 수 있다.The entropy decoder 105 may obtain flag information indicating whether to obtain information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction from the bitstream. When the flag information indicates that information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction is obtained from the bitstream, the entropy decoding unit 105 is selected from among all effective transform coefficients in the current block from the bitstream. The horizontal coordinate value of the rightmost effective transform coefficient pixel (or the horizontal coordinate value of the last effective transform coefficient pixel) or the vertical coordinate of the lowest effective transform coefficient pixel among all the effective transform coefficients in the current block. Information indicating a coordinate value in one direction among values (or a vertical coordinate value of the last effective transform coefficient pixel) and information indicating a difference between the coordinate value in the one direction and the coordinate value in the other direction may be obtained.

엔트로피 복호화부(105)는 상기 플래그 정보가 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 비트스트림으로부터 획득하지 않음을 나타내는 경우, 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 정보를 획득할 수 있다.When the flag information indicates that information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction is not obtained from the bitstream, the entropy decoding unit 105 includes all effective transform coefficients in the current block from the bitstream. Information indicating a horizontal coordinate value of an effective transform coefficient pixel positioned at the rightmost of the, and information indicating a vertical coordinate value of an effective transform coefficient pixel positioned at the bottom of all effective transform coefficients in the current block may be obtained. .

한편, 엔트로피 복호화부(105)는 현재 블록의 너비 및 높이에 기초하여 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 획득할지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록의 너비 및 높이가 다른 경우(즉, 직사각형인 경우), 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 획득한다고 결정할 수 있다.On the other hand, whether to acquire flag information indicating whether the entropy decoder 105 acquires information indicating the difference between the coordinate value of one direction and the coordinate value of the other direction from the bitstream based on the width and height of the current block. Can be determined. For example, when the width and height of the current block are different (ie, rectangular), the entropy decoding unit 105 obtains information indicating the difference between the coordinate value in one direction and the coordinate value in the other direction from the bitstream. It may be determined to obtain flag information indicating whether or not.

예를 들어, 엔트로피 복호화부(105)는 다음의 수도 코드(pseudo code) 1에 따라 스캔 영역을 특정하기 위한 수평방향을 나타내는 좌표 값 SR_x 및 수직 방향을 나타내는 좌표 값 SR_y를 획득할 수 있다.For example, the entropy decoder 105 may obtain a coordinate value SR_x indicating a horizontal direction for specifying a scan area and a coordinate value SR_y indicating a vertical direction according to the following pseudo code 1.

[수도 코드 1] [Water Code 1]

Figure pct00001
Figure pct00001

수도 코드(pseudo code) 1에 의하면, 엔트로피 복호화부(105)는 수평방향의 좌표 값에 관한 정보를 먼저 복호화할 것인지를 나타내는 변수 isXfirst 및 수직 방향의 좌표 값에 관한 정보를 먼저 복호화할 것인지를 나타내는 isYfirst의 값을 0으로 초기화할 수 있다. 또한, 엔트로피 복호화부(105)는 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보 srDeltaFlag를 0으로 초기화할 수 있다.According to the pseudo code 1, the entropy decoding unit 105 indicates whether to first decode the variable isXfirst indicating whether information on the coordinate value in the horizontal direction is to be decoded first and the information about the coordinate value in the vertical direction. You can initialize the value of isYfirst to 0. In addition, the entropy decoder 105 may initialize flag information srDeltaFlag to 0, indicating whether information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction is acquired.

엔트로피 복호화부(105)는 현재 블록의 너비 W가 현재 블록의 높이 H보다 크거나, 현재 블록의 높이 H가 현재 블록의 너비 W보다 큰 경우, 비트스트림부터 srDeltFlag를 획득하고, srDeltaFlag를 복호화할 수 있다.When the width W of the current block is greater than the height H of the current block or the height H of the current block is greater than the width W of the current block, the entropy decoder 105 may acquire srDeltFlag from the bitstream and decode srDeltaFlag. have.

엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 1인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득함을 나타내는 경우), 현재 블록의 너비 W가 현재 블록의 높이 H보다 작다면, IsXfirst의 값을 1로 결정할 수 있다.When the value of the decoded srDeltaFlag is 1 (that is, when it indicates that information indicating the difference between the coordinate value in one direction and the coordinate value in the other direction is obtained), the entropy decoding unit 105 has a width W of the current block. If the height of the current block is smaller than H, the value of IsXfirst can be determined as 1.

엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 1인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 수신함을 나타내는 경우), 현재 블록의 너비 W가 현재 블록의 높이 H보다 크다면, IsYfirst의 값을 1로 결정할 수 있다.When the value of the decoded srDeltaFlag is 1 (that is, when it indicates that information indicating the difference between the coordinate value in one direction and the coordinate value in the other direction is received), the width W of the current block is If the height of the block is greater than H, the value of IsYfirst can be determined as 1.

엔트로피 복호화부(105)는 IsXfirst의 값이 1인 경우(수평방향의 좌표 값에 관한 정보를 먼저 복호화함을 나타내는 경우), 수평 방향의 좌표 값을 나타내는 정보 Sr_x 및 수직 방향의 좌표 값과 수평 방향의 좌표 값의 차분을 나타내는 정보(Sr_delta)(Sr_y-Sr_x)를 비트스트림으로부터 획득하여 복호화할 수 있다. 이때, 수직방향의 좌표 값 Sr_y는 Sr_x+Sr_delta로 결정될 수 있다.When the value of IsXfirst is 1 (indicating that information on the coordinate value in the horizontal direction is to be decoded first), the entropy decoding unit 105 includes information indicating the coordinate value in the horizontal direction Sr_x and the coordinate value in the vertical direction and the horizontal direction. Information (Sr_delta) (Sr_y-Sr_x) indicating the difference of the coordinate values of is obtained from the bitstream and decoded. In this case, the vertical coordinate value Sr_y may be determined as Sr_x+Sr_delta.

엔트로피 복호화부(105)는 IsYfirst의 값이 1인 경우(수직방향의 좌표 값에 관한 정보를 먼저 복호화함을 나타내는 경우), 수직 방향의 좌표 값을 나타내는 정보 Sr_y 및 수평 방향의 좌표 값과 수직 방향의 좌표 값의 차분을 나타내는 정보(Sr_delta)(Sr_x-Sr_y)를 비트스트림으로부터 획득하여 복호화할 수 있다. 이때, 수직방향의 좌표 값 Sr_x는 Sr_y+Sr_delta로 결정될 수 있다.When the value of IsYfirst is 1 (indicating that information on the coordinate value in the vertical direction is first decoded), the entropy decoding unit 105 provides information indicating the coordinate value in the vertical direction, Sr_y, and the coordinate value in the horizontal direction and the vertical direction. Information (Sr_delta) (Sr_x-Sr_y) indicating the difference of the coordinate values of is obtained from the bitstream and decoded. In this case, the vertical coordinate value Sr_x may be determined as Sr_y+Sr_delta.

엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 0인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하지 않음을 나타내는 경우), 수평 방향의 좌표 값을 나타내는 정보 Sr_x 및 수직 방향의 좌표 값을 나타내는 정보 Sr_y를 비트스트림으로부터 획득하여 복호화할 수 있다.When the value of the decoded srDeltaFlag is 0 (i.e., it indicates that information indicating the difference between the coordinate value in one direction and the coordinate value in the other direction is not obtained), the entropy decoding unit 105 Information Sr_x indicating a and information Sr_y indicating a coordinate value in a vertical direction may be obtained from a bitstream and decoded.

엔트로피 복호화부(105)는 계수 복호화(coefficient decoding)에 이용되는 모든 신택스 엘리먼트 정보의 이진 산술복호화에 이용되는 컨텍스트 모델을 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 결정할 수 있다. 예를 들어, 현재 블록의 크기(size)는 현재 블록의 높이 및 너비의 최소값 및 최대값 중 적어도 하나에 따라 결정될 수 있다. 현재 블록의 모양(shape)은 현재 블록의 너비와 높이가 동일한지 여부에 따라서 결정될 수 있다. 게수 복호화에 이용되는 모든 신택스 엘리먼트 정보는 스캔 영역을 특정하기 위한 신택스 엘리먼트 정보 및스캔 영역 내에서 변환 계수에 관한 정보를 포함할 수 있다.The entropy decoder 105 may determine a context model used for binary arithmetic decoding of all syntax element information used for coefficient decoding based on at least one of the size of the current block and the shape of the current block. have. For example, the size of the current block may be determined according to at least one of minimum and maximum values of the height and width of the current block. The shape of the current block may be determined according to whether the width and height of the current block are the same. All syntax element information used for coefficient decoding may include syntax element information for specifying the scan area and information on transform coefficients within the scan area.

예를 들어, 엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1를 다음과 같은 수학식 1에 기초하여 결정할 수 있다.For example, the entropy decoder 105 may determine information size_tu1 about the size of the current block based on Equation 1 below.

Figure pct00002
Figure pct00002

이때, log2_width는 현재 블록의 너비 W에 log2를 취한 값일 수 있고, log2_height는 현재 블록의 높이 H에 log2를 취한 값일 수 있다.In this case, log2_width may be a value obtained by taking log2 to the width W of the current block, and log2_height may be a value obtained by taking log2 to the height H of the current block.

엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1에 대응하는 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoder 105 determines a context model corresponding to information size_tu1 about the size of the current block, determines a context model for syntax element information used for coefficient decoding, and uses the context model for coefficient decoding. It is possible to perform binary arithmetic decoding on syntax element information.

또는, 비디오 복호화 장치(100)는 현재 블록의 크기에 관한 정보 size_tu2를 다음과 같은 수학식 2에 기초하여 결정할 수 있다.Alternatively, the video decoding apparatus 100 may determine information size_tu2 about the size of the current block based on Equation 2 below.

Figure pct00003
Figure pct00003

엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoder 105 determines a context model based on information size_tu2 about the size of the current block, determines a context model for syntax element information used for coefficient decoding, and uses the context model for coefficient decoding. It is possible to perform binary arithmetic decoding on syntax element information.

또는, 엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다. Alternatively, the entropy decoder 105 determines a context model based on information size_tu1 and size_tu2 on the size of the current block, determines a context model for syntax element information used for coefficient decoding, and uses the context model It is possible to perform binary arithmetic decoding on syntax element information used for decoding.

엔트로피 복호화부(105)는 현재 블록의 크기 및 높이 중 최소값이 무엇인지, 최대값이 무엇인지를 결정하고, 현재 블록의 크기 및 높이 중 최소값 및 최대값에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines what is the minimum value and the maximum value among the sizes and heights of the current block, determines a context model based on the minimum and maximum values among the sizes and heights of the current block, and decodes coefficients. A context model for the syntax element information used for is determined, and the syntax element information used for coefficient decoding may be binary arithmetic decoding using the context model.

한편, 엔트로피 복호화부(105)는 계수 복호화에 이용되는 모든 신택스 엘리먼트의 이진 산술복호화에 이용되는 컨텍스트 모델을 현재 블록의 모양(shape)에 기초하여 결정할 수 있다.Meanwhile, the entropy decoder 105 may determine a context model used for binary arithmetic decoding of all syntax elements used for coefficient decoding based on the shape of the current block.

예를 들어, 엔트로피 복호화부(105)는 현재 블록의 모양에 관한 정보 shape_tu를 하기 수학식 3에 기초하여 결정할 수 있다.For example, the entropy decoder 105 may determine information shape_tu on the shape of the current block based on Equation 3 below.

Figure pct00004
Figure pct00004

[수학식 3]에 의하면, 엔트로피 복호화부(105)는 현재 블록의 너비 width가 높이 height보다 큰 경우 shape_tu를 2로 결정하고, 현재 블록의 너비 width가 높이 height보다 작은 경우, shape_tu를 1로 결정하고, 현재 블록의 너비 width가 높이 height와 동일한 경우 shape_tu를 0으로 결정할 수 있다. 즉, 너비가 높이보다 큰 직사각형의 경우 shape_tu를 2로 결정하고, 높이가 너비보다 큰 직사각형의 경우 shape_tu를 1로 결정하고, 정사각형의 경우 shape_tu를 0으로 결정할 수 있다. According to [Equation 3], the entropy decoding unit 105 determines shape_tu as 2 when the width of the current block is greater than the height and height, and determines shape_tu as 1 when the width of the current block is smaller than the height and height. And, if the width of the current block is equal to the height and height, shape_tu may be determined as 0. That is, for a rectangle having a width greater than the height, shape_tu may be determined as 2, for a rectangle having a height greater than the width, shape_tu may be determined as 1, and in the case of a square, shape_tu may be determined as 0.

엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 shape_tu에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines a context model based on information shape_tu about the size of the current block, determines a context model for syntax element information used for coefficient decoding, and uses the context model for coefficient decoding. It is possible to perform binary arithmetic decoding on syntax element information.

엔트로피 복호화부(105)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2 중 적어도 하나와 현재 블록의 모양에 관한 정보 shape_tu에 기초하여 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoder 105 may determine a context model for syntax element information used for coefficient decoding based on the size of the current block and the shape of the current block. For example, the video decoding apparatus 100 determines a context model for syntax element information used for coefficient decoding based on at least one of information about the size of the current block size_tu1 and size_tu2 and information about the shape of the current block shape_tu. And, using the context model, it is possible to perform binary arithmetic decoding on the syntax element information used for coefficient decoding.

엔트로피 복호화부(105)는 현재 블록의 높이와 너비가 서로 다른 경우 중 높이 또는 너비 중 어느 하나가 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 그리고 엔트로피 복호화부(105)는 현재 블록의 너비가 높이보다 크지 않은 경우, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)하지 않을 수 있다. 이에 제한되지 않고, 엔트로피 복호화부(105)는 현재 블록의 높이가 너비보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 엔트로피 복호화부(105)는 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)한 경우, 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표에 관한 정보를 비트스트림으로부터 획득하고, 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표의 좌표를 서로 변경(swap)할 수 있다. 엔트로피 복호화부(105)는 변경된(swapped) 스캔 영역을 특정하는 좌표에 기초하여 변경된(swapped) 현재 블록 내 제1 스캔 영역을 결정할 수 있다. 엔트로피 복호화부(105)는 제1 스캔 영역에 포함된 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보에 기초하여 변경된 현재 블록(swapped current block)의 제1 변환 계수를 획득할 수 있다. 엔트로피 복호화부(105)는 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)한 경우, 변경된 현재 블록의 제1 변환 계수에 관한 수평방향 좌표 및 수직 방향의 좌표를 변경함으로써 현재 블록 내 제2 변환 계수를 획득할 수 있다. 엔트로피 복호화부(105)는 현재 블록의 제2 변환 계수에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다.The entropy decoder 105 may change the height and width of the current block when either the height or the width is larger among the cases in which the height and width of the current block are different from each other. That is, horizontal coordinates and vertical coordinates of pixels included in the current block may be swapped. For example, when the width of the current block is greater than the height, the entropy decoder 105 may change the height and width of the current block. That is, values of horizontal coordinates and vertical coordinates of pixels included in the current block may be swapped. In addition, when the width of the current block is not larger than the height, the entropy decoder 105 may not swap horizontal coordinates and vertical coordinates of pixels included in the current block. The present invention is not limited thereto, and the entropy decoder 105 may change the height and width of the current block when the height of the current block is greater than the width. That is, values of horizontal coordinates and vertical coordinates of pixels included in the current block may be swapped. When the horizontal and vertical coordinates of the pixels included in the current block are swapped, the entropy decoding unit 105 transmits information on the horizontal and vertical coordinates specifying the scan area from the bitstream. It is possible to acquire and swap the coordinates of the horizontal direction coordinates and the vertical direction coordinates specifying the scan area. The entropy decoder 105 may determine the first scan area in the swapped current block based on coordinates specifying the swapped scan area. The entropy decoding unit 105 may scan information about transform coefficients included in the first scan area, and obtain a first transform coefficient of a changed current block based on the information about the scanned transform coefficient. have. When the horizontal and vertical coordinates of the pixels included in the current block are swapped, the entropy decoding unit 105 calculates the horizontal and vertical coordinates of the first transformation coefficient of the changed current block. By changing, the second transform coefficient in the current block can be obtained. The entropy decoder 105 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the second transform coefficient of the current block.

예를 들어, 엔트로피 복호화부(105)는 수도코드 2에 따라 스캔 영역을 특정하는 수평방향 좌표(Sr_x 또는 last_x) 및 수직방향 좌표(Sr_y 또는 last_y)를 서로 변경할 수 있다.For example, the entropy decoding unit 105 may change the horizontal coordinate (Sr_x or last_x) and the vertical coordinate (Sr_y or last_y) specifying the scan area according to the pseudocode 2 from each other.

[수도코드 2][Water code 2]

Figure pct00005
Figure pct00005

수도코드 2에 의하면, 엔트로피 복호화부(105)는 현재 블록인 TU(Transform Unit)의 너비(TU_width)가 현재 블록 TU(Transform Unit)의 높이(TU_height)보다 큰 경우, 현재 블록 TU(Transform Unit)의 너비(TU_width)와 현재 블록 TU(Transform Unit)의 높이(TU_height)를 서로 변경할 수 있다. TU의 높이와 너비를 서로 변경하는 과정에서 TU의 높이와 너비에 기초하여 결정되는 TU의 네 모서리의 수평방향 좌표 및 수직방향의 좌표가 서로 변경될 수 있다. 또한, TU에 포함된 픽셀들의 수평방향 좌표 및 수직방향 좌표가 서로 변경(Swap)될 수 있다. 이때, 엔트로피 복호화부(105)는 TU의 높이와 너비가 서로 변경 되는지 여부를 나타내는 swap_flag의 값을 1로 결정할 수 있다.According to the pseudo code 2, the entropy decoding unit 105, when the width (TU_width) of the current block TU (Transform Unit) is greater than the height (TU_height) of the current block TU (Transform Unit), the current block TU (Transform Unit) The width of (TU_width) and the height (TU_height) of the current block TU (Transform Unit) can be changed. In the process of changing the height and width of the TU, horizontal coordinates and vertical coordinates of the four corners of the TU determined based on the height and width of the TU may be changed. Also, horizontal coordinates and vertical coordinates of pixels included in the TU may be swapped. In this case, the entropy decoder 105 may determine a value of swap_flag indicating whether the height and width of the TU are changed as 1.

엔트로피 복호화부(105)는 현재 블록인 TU(Transform Unit)의 너비(TU_width)가 현재 블록 TU(Transform Unit)의 높이(TU_height)보다 크지 않은 경우, 현재 블록 TU(Transform Unit)의 너비(TU_width)와 현재 블록 TU(Transform Unit)의 높이(TU_height)를 서로 변경하지 않을 수 있다.If the width (TU_width) of the current block TU (Transform Unit) is not greater than the height (TU_height) of the current block TU (Transform Unit), the entropy decoding unit 105 is the width of the current block TU (Transform Unit) (TU_width) And the height (TU_height) of the current block TU (Transform Unit) may not be changed.

이때, 엔트로피 복호화부(105)는 TU의 높이와 너비가 서로 변경 되는지 여부를 나타내는 swap_flag의 값을 0으로 결정할 수 있다.In this case, the entropy decoder 105 may determine a value of swap_flag indicating whether the height and width of the TU are changed as 0.

엔트로피 복호화부(105)는 스캔 영역을 특정하기 위해 비트스트림으로부터 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x, Sr_y] 또는 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]에 관한 정보를 파싱할 수 있다.In order to specify the scan area, the entropy decoding unit 105 includes coordinates [Sr_x, Sr_y] for specifying a rectangular scan area from a bitstream or coordinates of an effective transform coefficient that is last scanned in the TU according to a forward scan order [last_x, last_y] can be parsed.

엔트로피 복호화부(105)는 swap_flag의 값이 1인 경우, 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x,Sr_y]를 서로 변경하거나, 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]를 서로 변경할 수 있다.When the value of swap_flag is 1, the entropy decoding unit 105 changes the coordinates [Sr_x,Sr_y] for specifying the rectangular scan area to each other, or the coordinates of the effective transform coefficients that are scanned last in the TU according to the scan order in the forward direction [last_x,last_y] can be changed to each other.

예를 들어, 엔트로피 복호화부(105)는 수도코드 3에 따라 스캔 영역을 특정하는 수평방향 좌표(Sr_x 또는 last_x) 및 수직방향 좌표(Sr_y 또는 last_y)를 서로 변경할 수 있다.For example, the entropy decoder 105 may change the horizontal coordinate (Sr_x or last_x) and the vertical coordinate (Sr_y or last_y) specifying the scan area according to the capital code 3 to each other.

[수도코드 3][Water Code 3]

Figure pct00006
Figure pct00006

수도코드 3에 의하면, 엔트로피 복호화부(105)는 현재 블록인 TU(Transform Unit)의 너비(TU_width)가 현재 블록 TU(Transform Unit)의 높이(TU_height)보다 큰 경우, 현재 블록 TU(Transform Unit)의 너비(TU_width)와 현재 블록 TU(Transform Unit)의 높이(TU_height)를 서로 변경할 수 있다. TU의 높이와 너비를 서로 변경하는 과정에서 TU의 높이와 너비에 기초하여 결정되는 TU의 네 모서리의 수평방향 좌표 및 수직방향의 좌표가 서로 변경될 수 있다. 또한, TU에 포함된 픽셀들의 수평방향 좌표 및 수직방향 좌표가 서로 변경(Swap)될 수 있다. 이때, 엔트로피 복호화부(105)는 TU의 높이와 너비가 서로 변경 되는지 여부를 나타내는 swap_flag의 값을 1로 결정할 수 있다.According to the pseudo code 3, the entropy decoding unit 105, when the width (TU_width) of the current block TU (Transform Unit) is greater than the height (TU_height) of the current block TU (Transform Unit), the current block TU (Transform Unit) The width of (TU_width) and the height (TU_height) of the current block TU (Transform Unit) can be changed. In the process of changing the height and width of the TU, horizontal coordinates and vertical coordinates of the four corners of the TU determined based on the height and width of the TU may be changed. Also, horizontal coordinates and vertical coordinates of pixels included in the TU may be swapped. In this case, the entropy decoder 105 may determine a value of swap_flag indicating whether the height and width of the TU are changed as 1.

엔트로피 복호화부(105)는 현재 블록인 TU(Transform Unit)의 너비(TU_width)가 현재 블록 TU(Transform Unit)의 높이(TU_height)보다 크지 않은 경우, 현재 블록 TU(Transform Unit)의 너비(TU_width)와 현재 블록 TU(Transform Unit)의 높이(TU_height)를 서로 변경하지 않을 수 있다. 이때, 엔트로피 복호화부(105)는 TU의 높이와 너비가 서로 변경 되는지 여부를 나타내는 swap_flag의 값을 0으로 결정할 수 있다.If the width (TU_width) of the current block TU (Transform Unit) is not greater than the height (TU_height) of the current block TU (Transform Unit), the entropy decoding unit 105 is the width of the current block TU (Transform Unit) (TU_width) And the height (TU_height) of the current block TU (Transform Unit) may not be changed. In this case, the entropy decoder 105 may determine a value of swap_flag indicating whether the height and width of the TU are changed as 0.

엔트로피 복호화부(105)는 스캔 영역을 특정하기 위한 수평방향의 좌표 값 및 수직방향의 좌표 값 간의 차분 정보를 이용하여 스캔 영역을 특정하기 위한 수평방향의 좌표 값 및 수직방향의 좌표 값을 획득하는지를 나타내는 플래그(deltaXYflag)를 비트스트림으로부터 파싱할 수 있다. 상기 플래그(deltaXYflag)는 비디오 부호화 장치에서 수직방향의 좌표 값이 수평방향 좌표 값보다 큰 경우, 1의 값을 갖도록 생성되고, 그렇지 않으면 0의 값을 갖도록 생성될 수 있다. 만약 deltaXYflag가 0이라면, 엔트로피 복호화부(105)는 수평방향 좌표 값에 관한 정보 및 수직방향 좌표 값에 관한 정보를 별도로 획득하여 엔트로피 복호화하고, 엔트로피 복호화된 정보를 기초로 스캔 영역을 특정하기 위한 좌표를 획득할 수 있다. The entropy decoding unit 105 determines whether to obtain a coordinate value in a horizontal direction and a coordinate value in a vertical direction for specifying the scan area by using difference information between the coordinate value in the horizontal direction and the coordinate value in the vertical direction for specifying the scan area. The indicated flag (deltaXYflag) can be parsed from the bitstream. The flag (deltaXYflag) may be generated to have a value of 1 when the coordinate value in the vertical direction is greater than the coordinate value in the horizontal direction in the video encoding apparatus, otherwise it may be generated to have a value of 0. If deltaXYflag is 0, the entropy decoding unit 105 separately acquires information on the horizontal coordinate value and the information on the vertical coordinate value to decode entropy, and to specify the scan area based on the entropy-decoded information. Can be obtained.

엔트로피 복호화부(105)는 deltaXYflag의 값이 1인 경우, 비트스트림으로부터 스캔 영역을 특정하기 위한 좌표 정보를 파싱할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수평방향 좌표 값에 관한 정보 Sr_x 및 수평방향 좌표 값에 관한 정보와 수직방향 좌표 값 간의 차분에 관한 정보 Sr_xy_delta를 비트스트림으로부터 파싱할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역을 특정하기 위해 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수평방향 좌표 값에 관한 정보 last_x 및 수평방향 좌표 값에 관한 정보와 수직방향 좌표 값 간의 차분에 관한 정보 last_xy_delta를 파싱할 수 있다. When the value of deltaXYflag is 1, the entropy decoder 105 may parse coordinate information for specifying the scan area from the bitstream. For example, the entropy decoding unit 105 parses information about a horizontal coordinate value Sr_x for specifying a rectangular scan area, and information about a difference between information about a horizontal coordinate value and a vertical coordinate value Sr_xy_delta from a bitstream. can do. Alternatively, the entropy decoding unit 105 includes information about the horizontal coordinate value of the effective transform coefficient last scanned in the TU according to the scan order in the forward direction to specify the scan area, last_x, information about the horizontal coordinate value, and the vertical direction. Information on the difference between coordinate values last_xy_delta can be parsed.

엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수평방향 좌표 값 Sr_x를 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 Sr_x로 결정할 수 있다. 엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수직방향 좌표 값 Sr_y를 비트스트림으로부터 파싱된 Sr_xy_delta에 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 Sr_x를 합한 값으로 결정할 수 있다. The entropy decoder 105 may determine the horizontal coordinate value Sr_x for specifying the rectangular scan area as information Sr_x about the horizontal coordinate value parsed from the bitstream. The entropy decoder 105 may determine a vertical coordinate value Sr_y for specifying a rectangular scan area as a sum of Sr_xy_delta parsed from the bitstream and information Sr_x on a horizontal coordinate value parsed from the bitstream.

또는, 엔트로피 복호화부(105)는 deltaXYflag의 값이 1인 경우, 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수평방향 좌표 값 last_x를 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 last_x로 결정할 수 있다. 엔트로피 복호화부(105)는 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수직방향 좌표 값 last_y를 비트스트림으로부터 파싱된 정보 last_xy_delta에 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 last_x를 합한 값으로 결정할 수 있다Alternatively, when the value of deltaXYflag is 1, the entropy decoding unit 105 parses the horizontal coordinate value last_x of the effective transform coefficient last scanned in the TU according to the scan order in the forward direction for specifying the scan area from the bitstream. It can be determined as information last_x about the horizontal coordinate value. The entropy decoding unit 105 uses the vertical coordinate value last_y of the effective transform coefficient scanned last in the TU according to the scan order in the forward direction for specifying the scan area, and the horizontal direction parsed from the bitstream in information last_xy_delta parsed from the bitstream. Information about the coordinate value can be determined as a sum of last_x

엔트로피 복호화부(105)는 swap_flag의 값이 1인 경우, 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x,Sr_y]를 서로 변경하거나, 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]를 서로 변경할 수 있다.When the value of swap_flag is 1, the entropy decoding unit 105 changes the coordinates [Sr_x,Sr_y] for specifying the rectangular scan area with each other, or scans the last in the TU according to the scan order in the forward direction for specifying the scan area. It is possible to change the coordinates [last_x, last_y] of the effective transform coefficients to each other.

엔트로피 복호화부(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 on 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 about coordinates specifying a rectangular scan area, From the inverse binarization information on the coordinates, coordinates specifying the rectangular scan area may be obtained. In this case, the context model may be determined based on at least one of the size of the current block, a color component of the current block, and a bin index. The color component may include a luminance component and a color difference component. The bin index may be information indicating a position of a bin currently binary arithmetic-decoded among bin strings related to the syntax element. The inverse binarization method corresponding to the 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 decoder 105 obtains first inverse binarization information by performing inverse binarization using a fixed-length inverse binarization method on a first bin string among the binary arithmetic decoded information, and Inverse binarization using a truncated unary inverse binarization method may be performed on the second empty string to obtain second inverse binarization information. The entropy decoding unit 105 may obtain coordinates specifying the rectangular scan area based on the first inverse binarization information and the second inverse binarization information.

엔트로피 복호화부(105)는 현재 블록 내 스캔 영역에서 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 획득할 수 있다. 이때, 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행될 수 있다.The entropy decoder 105 may obtain binary arithmetic-decoded information by performing binary arithmetic decoding on the basis of information on transform coefficients scanned in the scan area within the current block. In this case, the binary arithmetic decoding may be performed using a context model determined based on at least one of the size and shape of the current block.

엔트로피 복호화부(105)는 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수들에 관한 정보를 획득할 수 있다.The entropy decoder 105 may obtain information on transform coefficients of the current block by performing inverse binarization on the binary arithmetic-decoded information.

엔트로피 복호화부(105)는 스캔 영역에서 스캔된 변환 계수들에 관한 정보에 기초하여 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 현재 블록의 변환 계수들을 획득할 수 있다. The entropy decoding unit 105 may obtain transform coefficients of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model for the transform coefficients based on information on the transform coefficients scanned in the scan area. I can.

변환 계수들에 관한 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보인 경우, 엔트로피 복호화부(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, information about the absolute value of the residual level, and the sign information of the current transform coefficient, the entropy decoder 105 includes the scanned transform coefficients. Binary arithmetic decoding based on a context model may be performed on the information about. The entropy decoder 105 may obtain transform coefficients of the current block by performing inverse binarization on information about the transform coefficients that are binary arithmetic-decoded. The first information on the transform coefficients is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, information on the absolute value of the residual level, and sign information of the current transform coefficient, and the second information about the transform coefficients is current transform In the case of coefficient-related binarization parameter information, the entropy decoder 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 decoder 105 may obtain transform coefficients of the current block by performing inverse binarization based on the binarization parameter information included in the second information on 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. The present invention 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 about the transform coefficients is information about the absolute residual level of the current transform coefficient, the entropy decoding unit 105 uses a (truncated) Rice binarization method for the absolute residual level information of the current transform coefficient. A value of the residual level absolute value of the current transform coefficient may be obtained by using a corresponding inverse binarization method and an inverse binarization method corresponding to the exponential Gollum binarization method. For example, the entropy decoder 105 performs inverse binarization using an inverse binarization method corresponding to the Rice binarization method based on the Rice parameter on the prefix of the empty string of the residual level absolute value information of the current transform coefficient. Acquire a first value for the absolute residual level of the current transform coefficient, and perform inverse binarization using an inverse binarization method corresponding to the exponential Gollum binarization method on the suffix of the empty string of the residual level absolute value information. A current block is obtained based on a second value relating to the absolute residual level value of the current transform coefficient and a first value relating to the absolute residual level value of the current transform coefficient and a second value relating to the absolute residual level value of the current transform coefficient It is possible to obtain a value about the absolute value of the residual level of.

상기 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.The context model for the first transform coefficient among the context models for the transform coefficients includes information on at least one second transform coefficient 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 a component, information about a right or a lower peripheral transform coefficient, and a scan position of the first transform coefficient.

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

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

또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 제1 변환 계수의 위치 및 대응하는 주변 우측 또는 하측의 유효 계수 그룹 플래그들에 기초하여 결정될 수 있다.Alternatively, the context model regarding 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 coefficient group and the corresponding effective coefficient group flags on the right or lower side of the corresponding coefficient group.

엔트로피 복호화부(105)는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록 내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 may determine a context model regarding flag information indicating whether the first transform coefficient is greater than 0 based on the position of the first transform coefficient in the current block. For example, if the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy decoding unit 105 determines the context index by a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy decoding unit 105 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy decoding unit 105 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index.

엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 includes the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first position in which the first transform coefficient is scanned according to a predetermined scan order. A context model regarding flag information indicating whether the first transform coefficient is greater than 0 may be determined based on at least one of the coefficients.

예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 4에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다. For example, the entropy decoder 105 may determine the size_sr of the rectangular scan area based on Equation 4 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00007
Figure pct00007

다만, 이에 제한되지 않고, 스캔 영역이 마지막 유효 변환 계수 픽셀의 좌표에 의해 특정되는 경우, size_sr은 그 스캔 영역에 포함된 변환 계수 픽셀의 수일 수 잇다.However, the present invention is not limited thereto, and when the scan area is specified by the coordinates of the last effective transform coefficient pixel, size_sr may be the number of transform coefficient pixels included in the scan area.

엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다.The entropy decoder 105 may determine the number cnt_pos of all the transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy decoder 105 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index. However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr.

엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 may determine a context model for flag information indicating whether the first transform coefficient is greater than 0 based on the relative position of the first transform coefficient in the scan area.

엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 indicates whether the first transform coefficient is greater than 0 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

엔트로피 복호화부(105)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x, thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x, thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the entropy decoder 105 may increase the context index by a predetermined context offset offset1, and determine the context model based on the increased context index. In this case, [thred1_x, thred1_y] may be [1,1]. Alternatively, [thred1_x, thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 복호화부(105)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치인 경우에 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치가 아닌 경우, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다. 이때, 사각형 스캔 영역의 우측 하단 모서리에 위치하는 픽셀의 변환 계수는 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수일 수 있다.The entropy decoder 105 may determine a context model for flag information indicating whether the first transform coefficient is greater than 0 based on whether the first transform coefficient is a transform coefficient of a first position scanned according to a reverse scan order. . That is, the entropy decoder 105 determines a first context model for flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is the first position scanned according to the reverse scan order, and If one transform coefficient is not the first position scanned according to the reverse scan order, a second context model regarding flag information indicating whether the first transform coefficient is greater than 0 may be determined. In this case, the transform coefficient of the pixel positioned at the lower right corner of the rectangular scan area may be a transform coefficient of the first position scanned according to the reverse scan order.

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

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

엔트로피 복호화부(105)는 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. The entropy decoder 105 may determine a context model regarding flag information indicating whether the first transform coefficient is greater than 1 based on the position of the first transform coefficient in the current block. For example, if the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy decoding unit 105 determines the context index by a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy decoding unit 105 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index.

엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3은 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3과 그 값이 상이할 수 있다.When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy decoding unit 105 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index. At this time, offsets 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1 and predetermined threshold values thred 1,2 and 3 are flag information indicating whether the first transform coefficient is greater than 0 Offsets offsets 1, 2, and 3 related to the context model for and predetermined threshold values thred 1, 2, and 3 may be different from each other.

엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 determines the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero in which the first transform coefficient is scanned according to a predetermined scan order. A context model for flag information indicating whether the first transform coefficient is greater than 1 may be determined based on at least one of whether the transform coefficient of a non-location position is not.

예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 5에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy decoder 105 may determine the size_sr of the rectangular scan area based on Equation 5 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00008
Figure pct00008

엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 0보다 큰 변환 계수의 개수일 수 있다.The entropy decoder 105 may determine the number cnt_pos of all the transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order. However, the present invention is not limited thereto, and cnt_pos may be the number of transform coefficients greater than all zeros scanned before scanning the first transform coefficient among transform coefficients in the rectangular scan area.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy decoder 105 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index.

다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1 and predetermined threshold values thred 1 and thred2 are related to flag information indicating whether the first transform coefficient is greater than 0. Those skilled in the art can easily understand that the offsets offset1, 2, and 3 related to the context model and the predetermined threshold values thred 1 and thred2 and their values may be different.

엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 may determine a context model of flag information indicating whether the first transform coefficient is greater than 1 based on the relative position of the first transform coefficient in the scan area.

엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 indicates whether the first transform coefficient is greater than 1 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

비디오 복호화 장치(100)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x,thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x,thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the video decoding apparatus 100 may increase the context index by a predetermined context offset offset1, and determine the context model based on the increased context index. In this case, [thred1_x,thred1_y] may be [1,1]. Alternatively, [thred1_x,thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 복호화부(105)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

다만, 상기 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on size_sr. At this time, offsets offset1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y are flags indicating whether the first transform coefficient is greater than 0 Those skilled in the art can easily understand that offsets offset1, 2, and 3 related to the context model for information and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y and their values may be different.

엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 uses flag information indicating whether the first transform coefficient is greater than 1 based on whether the first transform coefficient is a transform coefficient at the first position among transform coefficients larger than 0 scanned according to the reverse scan order. Can determine the context model for That is, when the first transform coefficient is a first position among transform coefficients larger than 0 scanned according to the reverse scan order, the video decoding apparatus 100 provides first information regarding flag information indicating whether the first transform coefficient is greater than 1 A second context model for flag information indicating whether the first transform coefficient is greater than 1 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 0 scanned according to the reverse scan order Can be determined.

이에 제한되지 않고, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. Without being limited thereto, the context model for flag information indicating whether the absolute value of the first transform coefficient is greater than 1 is an 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, the 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, flag information indicating whether the absolute value of the first transform coefficient is greater than 1 (GT1 flag information) is the GT1 flag information of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order and the current GT1 flag information of the position of the first transform coefficient in the block, the color component, and n (n is a positive integer) adjacent right or lower transform coefficients, whether the first transform coefficient is a transform coefficient at the first position in the scan area, The first transform coefficient may be determined based on at least one of whether the first transform coefficient is a transform coefficient of 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 effective transform coefficients on the right or the lower side where the absolute value is greater than 2.

엔트로피 복호화부(105)는 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록 내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3은 제1 변환 계수가 0 및 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3과 그 값이 상이할 수 있다.The entropy decoder 105 may determine a context model for flag information indicating whether the first transform coefficient is greater than 2 based on the position of the first transform coefficient in the current block. For example, if the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy decoding unit 105 determines the context index by a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy decoding unit 105 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy decoding unit 105 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index. At this time, offsets offset 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 2 and predetermined threshold values thred 1,2 and 3 indicate whether the first transform coefficient is greater than 0 and 1. Offsets offsets 1, 2, and 3 related to the context model for flag information and predetermined threshold values thred 1, 2, and 3 may be different from each other.

엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치(또는, 1보다 큰 변환 계수들 중 첫번째 위치)의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 determines the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero in which the first transform coefficient is scanned according to a predetermined scan order. A context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be determined based on at least one of whether the transform coefficient is a transform coefficient of a position that is not (or a first position among transform coefficients greater than 1).

예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 6에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy decoder 105 may determine the size_sr of the rectangular scan area based on Equation 6 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00009
Figure pct00009

엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 그 절대값이 1보다 큰 모든 변환 계수의 개수일 수 있다.The entropy decoder 105 may determine the number cnt_pos of all the transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order. However, the present invention is not limited thereto, and cnt_pos may be the number of all transform coefficients whose absolute values are scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area is greater than 1.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy decoder 105 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoder 105 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index.

다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2는 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model related to flag information indicating whether the first transform coefficient is greater than 0 or 1 and predetermined threshold values thred 1 and thred2 indicate whether the first transform coefficient is greater than 0 or 1. Those skilled in the art can easily understand that the offsets offset1, 2, and 3 related to the context model for the flag information and the predetermined threshold values thred 1 and thred2 and their values may be different.

엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 may determine a context model of flag information indicating whether the first transform coefficient is greater than 2 based on the relative position of the first transform coefficient in the scan area.

엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 indicates whether the first transform coefficient is greater than 2 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

엔트로피 복호화부(105)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x,thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x,thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the entropy decoder 105 may increase the context index by a predetermined context offset offset1, and determine the context model based on the increased context index. In this case, [thred1_x,thred1_y] may be [1,1]. Alternatively, [thred1_x,thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 복호화부(105)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy decoder 105 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

다만, 상기 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model related to flag information indicating whether the first transform coefficient is greater than 0 or 1, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y indicate whether the first transform coefficient is greater than 0. Those skilled in the art can easily understand that offsets offset1, 2, and 3 related to the context model for the indicated flag information, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y, and their values may be different.

엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy decoder 105 uses flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is a transform coefficient at the first position among transform coefficients larger than 0 scanned according to the reverse scan order. Can determine the context model for That is, when the first transform coefficient is the first among transform coefficients larger than 0 scanned according to the reverse scan order, the entropy decoding unit 105 is the first flag information indicating whether the first transform coefficient is greater than 1 A second context model for flag information indicating whether the first transform coefficient is greater than 1 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 0 scanned according to the reverse scan order Can be determined.

다만, 이에 제한되지 않고, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.However, the present invention is not limited thereto, and the entropy decoder 105 has a first transform coefficient of 2 based on whether the first transform coefficient is a transform coefficient of a first position among transform coefficients larger than 1 scanned according to the reverse scan order. It is possible to determine a context model for flag information indicating whether it is greater. That is, when the first transform coefficient is the first among transform coefficients greater than 1 scanned according to the reverse scan order, the entropy decoding unit 105 is the first of the flag information indicating whether the first transform coefficient is greater than 1 A second context model for flag information indicating whether the first transform coefficient is greater than 2 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 1 scanned according to the reverse scan order Can be determined.

이에 제한되지 않고, 제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 the absolute value of the n transform coefficients previously scanned according to a predetermined scan order (n is a positive integer) is greater than 2 It can be determined based on the number of large effective transform coefficients.

또는, 제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 이전에 복호화된 GT2 플래그 정보 및 이전에 복호화된 그룹 내 GT2 플래그 정보에 기초하여 결정될 수 있다.Alternatively, the context model regarding 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, 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 GT2 flag information of the position of the first transform coefficient in the current block, the color component, and n (n is a positive integer) adjacent right or lower transform coefficients, the first transform coefficient is the transform coefficient at the first position in the scan area It may be determined based on at least one of 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, flag information indicating whether the first transform coefficient is greater than m (m is an integer greater than 2) (hereinafter referred to as GTm flag information) is n (n is a positive integer) previously scanned according to a predetermined scan order. GTm flag information of the transform coefficients, the position of the first transform coefficient in the current block, the color component, and GTm flag information of n adjacent right or lower transform coefficients (n is a positive integer), the first transform coefficient is in the scan area It may be determined based on at least one of whether the first transform coefficient is a transform coefficient of the first position and whether the first transform coefficient is a transform coefficient of the final position in the scan area.

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

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

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

또는, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 최초 위치의 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information about the absolute value of the residual level of the first transform coefficient is 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, and the color. The level of the component and n (n is a positive integer) transform coefficients adjacent to the right or lower side, whether the first transform coefficient in the scan order is the transform coefficient at the first position in the scan area, and the first transform coefficient is scanned in the scan order It may be determined based on at least one of whether or not the transform coefficient of the final position in the region and whether the first transform coefficient is the coefficient of the first position in the coefficient group in the scan order.

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

한편, 엔트로피 복호화부(105)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림에 유효 변환 계수의 GT1 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.Meanwhile, the entropy decoder 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 maximum coefficient of the determined effective transform coefficient. . That is, when the entropy decoding unit 105 receives the maximum number of GT1 flag information of the effective transform coefficients received from the bitstream, the entropy decoding unit 105 later determines whether there is GT1 flag information of the effective transform coefficient in the bitstream. May not be checked any more.

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

Figure pct00010
Figure pct00010

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate 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 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.

엔트로피 복호화부(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 within the determined maximum coefficient of the effective transform coefficient from the bitstream. That is, when the entropy decoding unit 105 receives the maximum number of GT2 flag information of the effective transform coefficients received from the bitstream, the entropy decoder 105 later determines whether there is GT2 flag information of the effective transform coefficient in the bitstream. May not be checked any more.

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

Figure pct00011
Figure pct00011

이때, 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는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate of the upper left corner of the scan area. K2 may be an adjustment coefficient between the size of the scan area and the GT2 flag. For example, it may be an integer greater than 1. 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 decoder 105 may obtain information on a coefficient group in the current block from the bitstream. Here, the information on 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 decoder 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 on the coefficient group indicates that the coefficient group does not include at least one effective transform coefficient, the entropy decoding unit 105 calculates the value of the transform coefficient within the coefficient group without scanning the information about the transform coefficient. It can be derived to zero. When the information on the coefficient group indicates that the coefficient group includes at least one effective transform coefficient, the entropy decoder 105 scans the information on the transform coefficient according to a predetermined scan order to obtain the transform coefficient within the coefficient group. I can.

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

따라서, 엔트로피 복호화부(105)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. Accordingly, the entropy decoder 105 may determine a coefficient group by scanning in a forward scan order from a DC coefficient that is a coefficient adjacent to the upper left corner of the current block. In this case, when 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 number of transform coefficients smaller than K.

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

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

엔트로피 복호화부(105)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy decoder 105 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 some cases, the entropy decoder may determine to hide the signs of one or two transform coefficients for each coefficient group included in the current block.

엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy decoder 105 may scan information about transform coefficients in the 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 easily 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 decoder 105 may obtain transform coefficients of the current block based on information on the scanned transform coefficients.

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

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

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

엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 정보에 대해 소정의 역이진화 방법을 이용한 역이진화를 수행하여 사각형 스캔 영역을 특정하는 좌표에 관한 역이진화 정보를 획득할 수 있고, 상기 좌표에 관한 역이진화 정보를 기초로 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분 및 빈 인덱스 중 적어도 하나에 기초하여 결정될 수 있다. 컬러 성분은 휘도 성분 및 색차 성분을 포함할 수 있다. 빈 인덱스는 신택스 엘리먼트에 관한 빈 스트링 중 현재 이진 산술 복호화되는 빈의 위치를 나타내는 정보일 수 있다. 여기서, 소정의 역이진화 방법은 고정 길이 역이진화 방법 및 절삭형 단항 역이진화 방법 중 적어도 하나일 수 있다.The entropy decoding unit 105 may perform binary arithmetic decoding based on a context model on information on coordinates specifying a rectangular scan area. The entropy decoding unit 105 may perform inverse binarization using a predetermined inverse binarization method on the binary arithmetic decoded information to obtain inverse binarization information about coordinates specifying a rectangular scan area, and inverse binarization about the coordinates. Coordinates specifying the rectangular scan area may be acquired based on the information. In this case, 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 blank index. The color component may include a luminance component and a color difference component. The bin index may be information indicating a position of a bin currently binary arithmetic-decoded among bin strings related to the syntax element. Here, the predetermined inverse binarization method may be at least one of a fixed length inverse binarization method and a cutting-type unary inverse binarization method.

엔트로피 복호화부(105)는 스캔된 유효 변환 계수들에 관한 정보에 기초하여 유효 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 현재 블록의 변환 계수들을 획득할 수 있다. 유효 변환 계수들에 관한 정보가 현재 유효 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 정보 및 현재 유효 변환 계수의 부호 정보인 경우, 엔트로피 복호화부(105)는 스캔된 유효 변환 계수들에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 유효 변환 계수들에 관한 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 유효 변환 계수들에 관한 제1 정보가 유효 변환 계수들에 관한 정보가 현재 유효 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여 레벨 정보 및 현재 유효 변환 계수의 부호 정보이고, 유효 변환 계수들에 관한 제2 정보가 이진화 파라메터 정보인 경우, 엔트로피 복호화부(105)는 유효 변환 계수에 관한 제1 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 제1 정보에 대해 제2 정보에 포함된 이진화 파라메터 정보에 기초한 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 이진화 파라메터 정보는 현재 변환 계수에 대한 라이스 파라메터(Rice Parameter) 정보일 수 있다.상기 변환 계수들의 플래그 정보에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다. The entropy decoder 105 may obtain transform coefficients of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model for the effective transform coefficients based on information on the scanned effective transform coefficients. have. When the information on the effective transform coefficients is information indicating whether the absolute value of the current effective transform coefficient is greater than a predetermined value, residual level information, and sign information of the current effective transform coefficient, the entropy decoding unit 105 performs the scanned effective transform. Binary arithmetic decoding based on a context model may be performed on information about coefficients. The entropy decoder 105 may obtain transform coefficients of the current block by performing inverse binarization on information about the effective transform coefficients that have been binary arithmetic-decoded. The first information about the effective transform coefficients is information indicating whether the information about the effective transform coefficients is greater than the absolute value of the current effective transform coefficient, residual level information, and sign information of the current effective transform coefficient, and the effective transform When the second information about the coefficients is the binarization parameter information, the entropy decoder 105 may perform binary arithmetic decoding based on the context model on the first information about the effective transform coefficient. The entropy decoder 105 may obtain transform coefficients of the current block by performing inverse binarization based on the binarization parameter information included in the second information on the binary arithmetic-decoded first information. The binarization parameter information may be Rice parameter information for the current transform coefficient. The context model for the first transform coefficient among the context models for flag information of the transform coefficients is previously scanned according to a predetermined scan order. It may be determined based on at least one of information on at least one second transform coefficient, a position and a color component of the first transform coefficient in the current block, information on a right or lower peripheral transform coefficient, and a scan position of the first transform coefficient. have.

제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 effective transform coefficients on the right side and the bottom side having an absolute value greater than 0.

이에 제한되지 않고, 제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 the absolute value of the n transform coefficients previously scanned according to a predetermined scan order (n is a positive integer) is greater than 0. It can be determined based on the number of large effective transform coefficients.

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

제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 effective transform coefficients on the right side and the bottom side having an absolute value greater than 1.

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

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

제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. 2 이때, 제2이에 제한되지 않고, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 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 effective transform coefficients on the right side and the bottom side having an absolute value greater than 2. 2 In this case, the context model for flag information indicating whether the first transform coefficient is greater than 2 is not limited to the second tooth, among n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order. The absolute value may be determined based on the number of effective transform coefficients greater than 2.

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

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

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

이에 제한되지 않고, 제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 the absolute value of the n transform coefficients previously scanned according to a predetermined scan order (n is a positive integer) is greater than 2 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 effective transform coefficients on the right side and the bottom side having an absolute value greater than 1.

제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 effective transform coefficients on the right side and the bottom side having an absolute value greater than 2.

한편, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다. 예를 들어, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.Meanwhile, the binarization parameter information about the residual level absolute value of the first transform coefficient may be determined based on the absolute level values of the adjacent effective transform coefficients on the right side and the lower side of the first transform coefficient. For example, the binarization parameter information about the residual level absolute value of the first transform coefficient may be determined based on the sum of the level absolute values of the right and lower peripheral effective transform coefficients of the first transform coefficient.

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

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

한편, 엔트로피 복호화부(105)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림으로부터 유효 변환 계수의 GT1 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.Meanwhile, the entropy decoder 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 maximum coefficient of the determined effective transform coefficient. . That is, when the entropy decoding unit 105 receives the maximum number of GT1 flag information of the effective transform coefficients received from the bitstream, the entropy decoding unit 105 later determines whether there is GT1 flag information of the effective transform coefficient from the bitstream. May not be checked any more.

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

Figure pct00012
Figure pct00012

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K1은 스캔 영역의 크기와 GT1 플래그 간 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. Th1은 미리 정해진 임계값일 수 있다. 예를 들어, Th1은 16,8 일 수 있다. 다만 이에 제한되지 않고, K1 및 Th1은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate 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, it 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.

엔트로피 복호화부(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 within the determined maximum coefficient of the effective transform coefficient from the bitstream. That is, when 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 later determines whether there is GT2 flag information of the effective transform coefficient from the bitstream. May not be checked any more.

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

Figure pct00013
Figure pct00013

이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. K2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate of the upper left corner of the scan area. K2 may be an adjustment factor. For example, it may be an integer greater than 1. 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)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득할 수 있다. 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지를 나타내는 플래그 정보일 수 있다. 이때, 엔트로피 복호화부(105)는 스캔 영역에 포함된 변환 계수들을 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다. 여기서 말하는 소정의 역방향 스캔 순서는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 순서를 의미할 수 있다.The entropy decoder 105 may obtain information on a coefficient group in the current block from the bitstream. The information on the coefficient group may be flag information indicating whether the coefficient group includes at least one effective transform coefficient. In this case, the entropy decoder 105 may determine one coefficient group for each 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 that is opposite to a predetermined reverse scan order. The predetermined reverse scan order referred to herein may mean an order of scanning from a coefficient positioned at the lower right of the transform coefficients included in the current block to a coefficient positioned at the upper left of the transform coefficients included in the current block.

따라서, 엔트로피 복호화부(105)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수으로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. 다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.Accordingly, the entropy decoder 105 may determine a coefficient group by scanning from a DC coefficient, which is a coefficient adjacent to the upper left corner of the current block, in a forward scan order. In this case, when 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 number of transform coefficients smaller than K. However, the present invention is not limited thereto, and the entropy decoding unit 105 scans from a coefficient located at the lower right of the transform coefficients included in the current block to a coefficient located at the upper left of the transform coefficients included in the current block. It can be easily understood by those skilled in the art that coefficient groups can be determined by scanning according to.

엔트로피 복호화부(105)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 비트스트림으로부터 계수 그룹에 관한 정보를 획득하지 않고, GT0 플래그 정보만을 비트스트림으로부터 획득할 수 있다. The entropy decoding unit 105 does not obtain information on the coefficient group from the bitstream, but only GT0 flag information, when the final coefficient group among the coefficient groups scanned according to a predetermined scan order includes only one transform coefficient. It can be obtained from the bitstream.

엔트로피 복호화부(105)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy decoder 105 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 some cases, the entropy decoder may determine to hide the signs of one or two transform coefficients for each coefficient group included in the current block.

엔트로피 복호화부(105)는 사각형 스캔 영역 내 유효 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy decoding unit 105 may scan information about an effective transform coefficient 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 easily 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 decoder 105 may obtain transform coefficients of the current block based on information about the scanned effective transform coefficients.

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

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

영상 복원부(120)는 현재 블록에 대하여 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있다. 영상 복원부(120)는 현재 블록의 예측 블록 및 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 즉, 영상 복원부(120)는 예측 블록에 포함된 픽셀들의 값과 레지듀얼 블록에 포함된 픽셀들의 값을 합하여 현재 블록에 포함된 픽셀들의 값을 복원할 수 있다. 옵티컬 플로우에 대해서는 도 3a에 관련된 설명에서 후술하겠다. The image reconstructor 120 may generate a prediction block of the current block by performing inter prediction or intra prediction on the current block. The image restoration unit 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 restoration unit 120 may restore values of pixels included in the current block by adding values of pixels included in the prediction block and values of pixels included in the residual block. The optical flow will be described later in the description related to FIG. 3A.

비디오 복호화 장치(100)는 영상 복호화부(미도시)를 포함할 수 있고, 영상 복호화부(미도시)는 엔트로피 복호화부(105) 및 영상 복원부(120)를 포함할 수 있다. 영상 복호화부에 대해서는 도 1e를 참조하여 설명하도록 한다도 1b는 다양한 실시예에 따른 비디오 복호화 방법의 흐름도를 도시한다.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. An image decoding unit will be described with reference to FIG. 1E. FIG. 1B is a flowchart of a video decoding method according to various embodiments.

S105 단계에서, 비디오 복호화 장치(100)는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 획득하고, 상기 획득된 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 기초로 스캔 영역을 결정할 수 있다.In step S105, the video decoding apparatus 100 may determine a scan area including all effective transform coefficients in the current block. At this time, the scan area includes transform coefficients from the upper left of the scan area to the last effective transform coefficient (hereinafter referred to as the last effective transform coefficient) when scanned according to a predetermined forward scan order. It may be an area to do. In this case, the coordinates specifying the scan area may be the coordinates of the last scanned effective transform coefficient pixel. The video decoding apparatus 100 may obtain information about coordinates representing a last effective transform coefficient from a bitstream, and determine a scan area based on information about coordinates representing the obtained last effective transform coefficient.

또는 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 획득하고, 상기 획득된 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 기초로 사각형 스캔 영역을 결정할 수 있다.Alternatively, the scan area may be a rectangular scan area, and the rectangular scan area is a horizontal coordinate of an effective transform coefficient pixel positioned at the rightmost among all effective transform coefficients in the current block and an effective transform coefficient pixel positioned at the bottom of the current block. It may be an area specified by the vertical coordinate of. The video decoding apparatus 100 may obtain information about coordinates specifying the rectangular scan area from the bitstream, and determine the rectangular scan area based on information about coordinates specifying the obtained rectangular scan area.

S110 단계에서, 비디오 복호화 장치(100)는 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서 또는 역방향의 대각 스캔 순서를 포함할 수 있다. 지그재그 스캔 순서는 수직 우선 지그재그 스캔 순서 또는 수평 우선 지그재그 스캔 순서를 포함할 수 있다.S115 단계에서, 비디오 복호화 장치(100)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성할 수 있다. 이때, 비디오 복호화 장치(100)는 현재 블록의 크기 및 모양 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 이진 산술 복호화를 수행할 수 있다.In step S110, the video decoding apparatus 100 may scan information about transform coefficients in the 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 first zigzag scan order or a horizontal first zigzag scan order. In step S115, the video decoding apparatus 100 performs binary arithmetic decoding on the basis of information on the scanned transform coefficients It is possible to generate arithmetic-decoded information. In this case, the video decoding apparatus 100 may perform binary arithmetic decoding by using a context model determined based on at least one of the size and shape of the current block.

S120 단계에서, 비디오 복호화 장치(100)는 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수들에 관한 정보를 획득할 수 있다.In step S120, the video decoding apparatus 100 scans information on transform coefficients included in the scan area according to a predetermined scan order, performs inverse binarization on the binary arithmetic decoded information, and converts the transform coefficients of the current block. You can get information about it.

S125 단계에서, 비디오 복호화 장치(100)는 현재 블록의 변환 계수들에 관한 정보를 기초로 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 즉, 비디오 복호화 장치(100)는 현재 블록의 변환 계수들에 관한 정보를 기초로 현재 블록의 변환 계수들을 획득하고, 현재 블록의 변환 계수에 대한 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다.In step S125, the video decoding apparatus 100 may generate a residual block of the current block by performing inverse quantization and inverse transformation based on information on transform coefficients of the current block. That is, the video decoding apparatus 100 obtains transform coefficients of the current block based on information on the transform coefficients of the current block, and performs inverse quantization and inverse transform of the transform coefficients of the current block to obtain a residual block of the current block. Can be created.

S130 단계에서, 비디오 복호화 장치(100)는 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 비디오 복호화 장치(100)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성하고, 비디오 복호화 장치(100)는 현재 블록의 예측 블록에 포함된 픽셀 값과 레지듀얼 블록의 픽셀 값을 합하여 현재 블록의 복원 블록의 픽셀 값을 생성할 수 있다.In step S130, 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 a pixel value included in the prediction block of the current block and the pixel value of the residual block. A pixel value of a 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 encoder 155 may entropy-encode a syntax element related to a transform coefficient in a current block. The entropy encoder 155 scans 2D array information about transform coefficients in the current block according to a predetermined scan order to generate 1D array information about transform coefficients in the current block, and generates transform coefficients in the current block. Entropy encoding can be performed on the one-dimensional array information of.

변환 계수에 관한 신택스 엘리먼트는 변환 계수가 소정의 값보다 큰 지를 나타내는 플래그일 수 있다. 이때, 소정의 값은 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. In this case, the predetermined value may be greater than or equal to 0. For example, it may be 0, 1 or 2. In addition, it may be a syntax element indicating an absolute value of a remaining level for a transform coefficient. That is, the absolute value of the remaining 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 the predetermined value. Also, the syntax element related to the effective transform coefficient may be a syntax element related to the sign of the effective transform coefficient.

먼저, 엔트로피 부호화부(155)는 신택스 엘리먼트에 대해 이진화를 수행하여 빈 스트링(bin)을 생성하고, 빈 스트링에 대해 이진 산술 부호화를 수행하여 신택스 엘리먼트에 대해 엔트로피 부호화된 정보를 생성할 수 있다. 이때, 이진화는 이진화부(160)에서 수행될 수 있고, 이진 산술 부호화는 이진 산술 부호화부(165)에서 수행될 수 있다.First, the entropy encoder 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. In this case, 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 generate an empty string by performing binarization on a predetermined syntax element. The binarization unit 160 may perform binarization on a predetermined 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 Gollum-Rice binarization method. Alternatively, the predetermined binarization method may be a binarization method in which a first binarization method and a second binarization method are combined. For example, the binarization unit 160 may generate a first bin string by binarizing a part of the syntax element based on a first binarization method, and a second binarizing method for another part of the syntax element. A second bin string may be generated by performing binarization based on. In this case, the first empty string may be a 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. A part of the empty string may be a prefix or a 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 for a predetermined syntax element. Alternatively, the binary arithmetic encoding unit 165 may perform binary arithmetic encoding on an empty string for a predetermined syntax element without a predetermined context model. At this time, the probability of generating 0 or 1 for a bin currently binary arithmetic coding is fixed at 0,5, and binary arithmetic coding may be performed based on this probability.

엔트로피 부호화부(155)는 현재 블록의 변환 계수를 획득할 수 있다. 즉, 비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수를 생성할 수 있다. 엔트로피 부호화부(155)는 상기 생성된 현재 블록의 변환 계수를 획득할 수 있다.The entropy encoder 155 may obtain transform coefficients 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 encoder 155 may obtain transform coefficients of the generated current block.

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

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

먼저, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 변환 계수만을 포함할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다. First, the entropy encoder 155 may determine a scan area including all effective transform coefficients in the current block. In this case, all effective transform coefficients in the current block may be included in the scan area, and the remaining areas in the current block excluding the scan area may include only transform coefficients having a value of 0, not the effective transform coefficient. At this time, the scan area includes transform coefficients from the upper left of the scan area to the last effective transform coefficient (hereinafter referred to as the last effective transform coefficient) when scanned according to a predetermined forward scan order. It may be an area to do. In this case, the coordinates specifying the scan area may be the coordinates of the last scanned effective transform coefficient pixel.

엔트로피 부호화부(155)는 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 생성할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.이때, 엔트로피 부호화부(155)는 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트에 대해 이진화하여 빈 스트링을 생성하고, 빈 스트링에 대해 이진 산술 복호화를 수행하여 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.The entropy encoder 155 may generate information on coordinates representing the last effective transform coefficient. For example, the entropy decoder 105 may generate syntax element information indicating a horizontal coordinate value of the last effective transform coefficient and syntax element information indicating a vertical coordinate value of the last effective transform coefficient. In this case, entropy The encoding unit 155 generates an empty string by binarizing the syntax element representing the horizontal coordinate value of the last effective transform coefficient and the syntax element representing the vertical coordinate value of the last effective transform coefficient, and performs binary arithmetic on the empty string. By performing decoding, syntax element information indicating a horizontal coordinate value of the last effective transform coefficient and syntax element information indicating a vertical coordinate value of the last effective transform coefficient may be generated.

엔트로피 부호화부(155)는 신택스 엘리먼트 값 중 일부 제1값에 대해 제1 이진화 방법을 수행하여 제1 빈 스트링을 생성하고, 신택스 엘리먼트 값 중 다른 일부 제2값에 제2 이진화 방법을 수행하여 제2 빈 스트링을 생성할 수 있다. 제1 빈 스트링 및 제2 빈 스트링을 포함하는 빈 스트링을 생성할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 이진화 방법은 고정 길이(fixed-length) 이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법일 수 있다.The entropy encoder 155 generates a first bin string by performing a first binarization method on some first values of the syntax element values, and performing a second binarization method on some other second values of the syntax element values. 2 You can create an empty string. An empty string including the first empty string and the second empty string may be generated. In this case, the first empty string may be a prefix, and the first binarization method may be a fixed-length binarization method. The second empty string may be a suffix, and the second inverse binarization method may be a truncated unary binarization method.

또는, 엔트로피 부호화부(155)는현재 블록 내 모든 유효 변환 계수들 중 마지막 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 마지막 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 생성할 수 있다. Alternatively, the entropy encoding unit 155 includes information indicating a coordinate value in one direction of a horizontal coordinate value of the last effective transform coefficient pixel or a vertical coordinate value of the last effective transform coefficient pixel among all effective transform coefficients in the current block, and Information indicating a difference between the coordinate value of one direction and the coordinate value of the other direction may be generated.

또는, 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. Alternatively, the scan area may be a rectangular scan area, and the rectangular scan area is a horizontal coordinate of an effective transform coefficient pixel positioned at the rightmost among all effective transform coefficients in the current block and an effective transform coefficient positioned at the bottom of the current block. It may be an area specified by the vertical coordinates of the pixel.

엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트 정보를 생성할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 신택스 엘리먼트 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다. 이때, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 신택스 엘리먼트 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 신택스 엘리먼트에 대해 이진화하여 빈 스트링을 생성하고, 빈 스트링에 대해 이진 산술 복호화를 수행하여 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.The entropy encoder 155 may generate syntax element information about coordinates specifying a rectangular scan area. For example, the entropy encoder 155 includes syntax element information indicating a horizontal coordinate value of an effective transform coefficient pixel located at the rightmost among all effective transform coefficients in the current block, and the most effective transform coefficient among all effective transform coefficients in the current block. Syntax element information indicating a vertical coordinate value of an effective transform coefficient pixel located at the lower side may be generated. At this time, the entropy encoding unit 155 is a syntax element representing a horizontal coordinate value of an effective transform coefficient pixel positioned at the rightmost among all effective transform coefficients in the current block and a lowermost position among all effective transform coefficients in the current block. Syntax element information representing the horizontal coordinate value of the last effective transform coefficient by binarizing the syntax element representing the vertical coordinate value of the effective transform coefficient pixel to generate an empty string, and performing binary arithmetic decoding on the empty string, and Syntax element information indicating the vertical coordinate value of the last effective transform coefficient may be generated.

엔트로피 부호화부(155)는 신택스 엘리먼트 값 중 일부 제1 값에 대해 제1 이진화 방법을 수행하여 제1 빈 스트링을 생성하고, 신택스 엘리먼트 값 중 다른 일부 제2값에 제2 이진화 방법을 수행하여 제2 빈 스트링을 생성할 수 있다. 제1 빈 스트링 및 제2 빈 스트링을 포함하는 빈 스트링을 생성할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 이진화 방법은 고정 길이(fixed-length) 이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법일 수 있다.The entropy encoder 155 generates a first bin string by performing a first binarization method on some first values of the syntax element values, and performing a second binarization method on some other second values of the syntax element values. 2 You can create an empty string. An empty string including the first empty string and the second empty string may be generated. In this case, the first empty string may be a prefix, and the first binarization method may be a fixed-length binarization method. The second empty string may be a suffix, and the second inverse binarization method may be a truncated unary binarization method.

또는, 엔트로피 부호화부(155)는현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 생성할 수 있다. 엔트로피 부호화부(155)는 현재 블록의 높이 및 너비에 기초하여 상기 하나의 방향을 결정할 수 있다.Alternatively, the entropy encoding unit 155 is a horizontal coordinate value of an effective transform coefficient pixel positioned at the rightmost among all effective transform coefficients in the current block, or an effective transform coefficient positioned at the bottom of all effective transform coefficients in the current block. Information indicating a coordinate value in one direction among vertical coordinate values of a pixel and information indicating a difference between the coordinate value in the one direction and the coordinate value in the other direction may be generated. The entropy encoder 155 may determine the one direction based on the height and width of the current block.

엔트로피 부호화부(155)는 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성할 수 있다. The entropy encoder 155 may generate flag information indicating whether to obtain information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction.

한편, 엔트로피 부호화부(155)는 현재 블록의 너비 및 높이에 기초하여 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성할지 여부를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록의 너비 및 높이가 다른 경우(즉, 직사각형인 경우), 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성한다고 결정하고, 플래그 정보를 생성할 수 있다.Meanwhile, the entropy encoder 155 may determine whether to generate flag information indicating whether to obtain information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction based on the width and height of the current block. have. For example, when the width and height of the current block are different (i.e., in the case of a rectangle), the entropy encoder 155 determines whether to obtain information indicating the difference between a coordinate value in one direction and a coordinate value in the other direction. It is determined to generate the indicated flag information, and the flag information can be generated.

엔트로피 부호화부(155)는 계수 부호화(coefficient encoding)에 이용되는 모든 신택스 엘리먼트의 이진 산술부호화에 이용되는 컨텍스트 모델을 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 결정할 수 있다. 예를 들어, 현재 블록의 크기(size)는 현재 블록의 높이 및 너비의 최소값 및 최대값 중 적어도 하나에 따라 결정될 수 있다. 현재 블록의 모양(shape)은 현재 블록의 너비와 높이가 동일한지 여부에 따라서 결정될 수 있다. 게수 부호화에 이용되는 모든 신택스 엘리먼트는 스캔 영역을 특정하기 위한 신택스 엘리먼트 및 스캔 영역 내에서 변환 계수에 관한 신택스 엘리먼트를 포함할 수 있다.The entropy encoder 155 may determine a context model used for binary arithmetic encoding of all syntax elements used for coefficient encoding based on at least one of the size of the current block and the shape of the current block. . For example, the size of the current block may be determined according to at least one of minimum and maximum values of the height and width of the current block. The shape of the current block may be determined according to whether the width and height of the current block are the same. All syntax elements used for coefficient coding may include a syntax element for specifying a scan area and a syntax element for transform coefficients within the scan area.

예를 들어, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1를 다음과 같은 수학식 11에 기초하여 결정할 수 있다.For example, the entropy encoder 155 may determine information size_tu1 about the size of the current block based on Equation 11 below.

Figure pct00014
Figure pct00014

엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1에 대응하는 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoder 155 determines a context model corresponding to information size_tu1 about the size of the current block, determines a context model for a syntax element used for coefficient encoding, and uses the context model to determine a syntax used for coefficient encoding. Elements can be binary arithmetic coding.

또는, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu2를 다음과 같은 수학식 12에 기초하여 결정할 수 있다.Alternatively, the entropy encoder 155 may determine information size_tu2 about the size of the current block based on Equation 12 below.

Figure pct00015
Figure pct00015

엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoder 155 determines a context model based on information size_tu2 on the size of the current block, determines a context model for a syntax element used for coefficient encoding, and uses the context model to determine a syntax used for coefficient encoding. Elements can be binary arithmetic coding.

또는, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다. Alternatively, the entropy encoder 155 determines a context model based on information size_tu1 and size_tu2 on the size of the current block, determines a context model for a syntax element used for coefficient encoding, and encodes coefficients using the context model. The syntax element used for can be subjected to binary arithmetic coding.

엔트로피 부호화부(155)는 현재 블록의 크기 및 높이 중 최소값이 무엇인지, 최대값이 무엇인지를 결정하고, 현재 블록의 크기 및 높이 중 최소값 및 최대값에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoder 155 determines what is the minimum value and the maximum value among the sizes and heights of the current block, determines a context model based on the minimum and maximum values among the sizes and heights of the current block, and encodes the coefficients. A context model for a syntax element used for is determined, and a syntax element used for coefficient coding may be subjected to binary arithmetic coding using the context model.

한편, 엔트로피 부호화부(155)는 계수 부호화에 이용되는 모든 신택스 엘리먼트의 이진 산술 부호화에 이용되는 컨텍스트 모델을 현재 블록의 모양(shape)에 기초하여 결정할 수 있다.Meanwhile, the entropy encoder 155 may determine a context model used for binary arithmetic coding of all syntax elements used for coefficient coding based on the shape of the current block.

예를 들어, 엔트로피 부호화부(155)는 현재 블록의 모양에 관한 정보 shape_tu를 하기 수학식 13에 기초하여 결정할 수 있다.For example, the entropy encoder 155 may determine information shape_tu on the shape of the current block based on Equation 13 below.

Figure pct00016
Figure pct00016

[수학식 13]에 의하면, 엔트로피 부호화부(155)는 현재 블록의 너비 width가 높이 height보다 큰 경우 shape_tu를 2로 결정하고, 현재 블록의 너비 width가 높이 height보다 작은 경우, shape_tu를 1로 결정하고, 현재 블록의 너비 width가 높이 height와 동일한 경우 shape_tu를 0으로 결정할 수 있다. 즉, 너비가 높이보다 큰 직사각형의 경우 shape_tu를 2로 결정하고, 높이가 너비보다 큰 직사각형의 경우 shape_tu를 1로 결정하고, 정사각형의 경우 shape_tu를 0으로 결정할 수 있다. According to [Equation 13], the entropy encoder 155 determines shape_tu as 2 when the width of the current block is greater than the height and height, and determines shape_tu as 1 when the width of the current block is smaller than the height and height. And, if the width of the current block is equal to the height and height, shape_tu may be determined as 0. That is, for a rectangle having a width greater than the height, shape_tu may be determined as 2, for a rectangle having a height greater than the width, shape_tu may be determined as 1, and in the case of a square, shape_tu may be determined as 0.

엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 shape_tu에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoder 155 determines a context model based on information shape_tu on the size of the current block, determines a context model for a syntax element used for coefficient encoding, and uses the context model to determine a syntax used for coefficient encoding. Elements can be binary arithmetic coding.

엔트로피 부호화부(155)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 엔트로피 복호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2 중 적어도 하나와 현재 블록의 모양에 관한 정보 shape_tu에 기초하여 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트 를 이진 산술 부호화할 수 있다.The entropy encoder 155 may determine a context model for a syntax element used for coefficient encoding based on the size of the current block and the shape of the current block. For example, the entropy decoder 155 determines a context model for a syntax element used for coefficient encoding based on at least one of size_tu1 and size_tu2 on the size of the current block and shape_tu on the shape of the current block, and , A syntax element used for coefficient coding may be subjected to binary arithmetic coding using the context model.

엔트로피 부호화부(155)는 현재 블록의 높이와 너비가 서로 다른 경우 중 높이 또는 너비 중 어느 하나가 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향의 좌표 및 수직방향의 좌표를 서로 변경(swap)할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 그리고 엔트로피 부호화부(155)는 현재 블록의 너비가 높이보다 크지 않은 경우, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)하지 않을 수 있다. 이에 제한되지 않고, 엔트로피 부호화부(155)는 현재 블록의 높이가 너비보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 엔트로피 부호화부(155)는 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)한 경우, 현재 블록 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표의 좌표를 서로 변경(swap)할 수 있다. 엔트로피 부호화부(155)는 변경된(swapped) 스캔 영역을 특정하는 좌표에 기초하여 변경된(swapped) 현재 블록 내 제1 스캔 영역을 결정할 수 있다. 엔트로피 부호화부(155)는 제1 스캔 영역에 포함된 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보에 대해 엔트로피 부호화를 수행할 수 있다.엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표를 결정하고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 엔트로피 부호화할 수 있다. 즉, 엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트에 대해 소정의 이진화 방법에 기초한 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 여기서, 소정의 이진화 방법은 고정 길이 이진화 방법 및 절삭형 단항 이진화 방법 중 적어도 하나일 수 있다.The entropy encoder 155 may change the height and width of the current block when either the height or the width is large among the cases in which the height and width of the current block are different. That is, the coordinates in the horizontal direction and the coordinates in the vertical direction of pixels included in the current block may be swapped. For example, when the width of the current block is greater than the height, the entropy encoder 155 may change the height and width of the current block. That is, values of horizontal coordinates and vertical coordinates of pixels included in the current block may be swapped. In addition, when the width of the current block is not greater than the height, the entropy encoder 155 may not swap horizontal coordinates and vertical coordinates of pixels included in the current block. This is not limited thereto, and the entropy encoder 155 may change the height and width of the current block when the height of the current block is greater than the width. That is, values of horizontal coordinates and vertical coordinates of pixels included in the current block may be swapped. When the horizontal and vertical coordinates of the pixels included in the current block are swapped, the entropy encoder 155 specifies the horizontal coordinates and vertical coordinates that specify the current block scan area. It is possible to change (swap) the coordinates of the horizontal and vertical coordinates to each other. The entropy encoder 155 may determine the first scan area in the swapped current block based on coordinates specifying the swapped scan area. The entropy encoder 155 may scan information about transform coefficients included in the first scan area, and perform entropy encoding on the information about the scanned transform coefficient. The entropy encoder 155 may perform a rectangular scan area. It is possible to determine the coordinates for specifying a, and entropy encoding information on the coordinates for specifying the rectangular scan area. That is, the entropy encoder 155 may generate a bin string by performing binarization based on a predetermined binarization method on a syntax element relating 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.

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

엔트로피 부호화부(155)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진화 및 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화 중 적어도 하나를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다.The entropy encoder 155 may generate entropy-encoded information by performing at least one of binarization and binary arithmetic encoding based on a context model for the 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, information about the absolute value of the residual level, and sign information of the current transform coefficient, and the second information about the transform coefficients is the residual level. In the case of the absolute value of the binarization parameter information, the entropy encoder 155 may generate a bin string for the first information by performing binarization based on the second information on the first information on the transform coefficients. have. The entropy encoder 155 may generate entropy-encoded information by performing binary arithmetic encoding on a bin string related to the first information.

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

또는, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information about the absolute value of the residual level of the first transform coefficient is 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, and the color. The level of the component and n (n is a positive integer) transform coefficients adjacent to the right or lower side, whether the first transform coefficient in the scan order is the transform coefficient at the first position in the scan area, and the first transform coefficient is scanned in the scan order It may be determined based on at least one of whether a transform coefficient at a final position in the region or whether the first transform coefficient is a coefficient at a first position in a coefficient group in a 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, information about the absolute value of the residual level, and the sign information of the current transform coefficient, the entropy encoder 155 Binaryization can be performed on information to generate a bin string. The entropy encoder 155 may generate binary arithmetic-encoded information by performing binary arithmetic encoding based on a context model for transform coefficients on a bin string. Among the context models for the 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 a color. It may be determined based on at least one of a component, information about a right or a lower peripheral transform coefficient, and a 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 effective transform coefficients on the right or the lower side having an absolute value greater than 0.

엔트로피 부호화부(155)는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록 내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 0 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy encoder 155 sets the context index to a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy encoder 155 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy encoder 155 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index.

엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 includes the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first position in which the first transform coefficient is scanned according to a predetermined scan order. A context model regarding flag information indicating whether the first transform coefficient is greater than 0 may be determined based on at least one of the coefficients.

예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 14에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoder 155 may determine the size_sr of the rectangular scan area based on Equation 14 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00017
Figure pct00017

다만 이에 제한되지 않고, 스캔 영역이 마지막 유효 변환 계수 픽셀의 좌표에 의해 특정되는 스캔 영역인 경우, size_sr은 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수있다. However, the present invention is not limited thereto, and when the scan area is a scan area specified by the coordinates of the last effective transform coefficient pixel, size_sr may mean the number of transform coefficients included in the scan area.

엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다.The entropy encoder 155 may determine the number cnt_pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index. However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr.

엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 0 based on the relative position of the first transform coefficient in the scan area.

엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 indicates whether the first transform coefficient is greater than 0 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

엔트로피 부호화부(155)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x, thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x, thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. In this case, [thred1_x, thred1_y] may be [1,1]. Alternatively, [thred1_x, thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 부호화부(155)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치인 경우에 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치가 아닌 경우, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다. 이때, 사각형 스캔 영역의 우측 하단 모서리에 위치하는 픽셀의 변환 계수는 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수일 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 0 based on whether the first transform coefficient is a transform coefficient of a first position scanned according to a reverse scan order. . That is, the entropy decoding unit 155 determines a first context model for flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is a first position scanned according to the reverse scan order, and If one transform coefficient is not the first position scanned according to the reverse scan order, a second context model regarding flag information indicating whether the first transform coefficient is greater than 0 may be determined. In this case, the transform coefficient of the pixel positioned at the lower right corner of the rectangular scan area may be a transform coefficient of the first position scanned according to the reverse scan order.

이에 제한되지 않고, 제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 the absolute value of the n transform coefficients previously scanned according to a predetermined scan order (n is a positive integer) 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 effective transform coefficients on the right or the lower side having an absolute value greater than 1.

엔트로피 부호화부(155)는 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 may determine a context model regarding flag information indicating whether the first transform coefficient is greater than 1 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy encoder 155 sets the context index to a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy encoder 155 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index.

엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3은 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3과 그 값이 상이할 수 있다.When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy encoder 155 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index. At this time, offsets 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1 and predetermined threshold values thred 1,2 and 3 are flag information indicating whether the first transform coefficient is greater than 0 Offsets offsets 1, 2, and 3 related to the context model for and predetermined threshold values thred 1, 2, and 3 may be different from each other.

엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 determines the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero in which the first transform coefficient is scanned according to a predetermined scan order. A context model for flag information indicating whether the first transform coefficient is greater than 1 may be determined based on at least one of whether the transform coefficient of a non-location position is not.

예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 15에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoder 155 may determine the size_sr of the rectangular scan area based on Equation 15 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00018
Figure pct00018

엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 0보다 큰 변환 계수의 개수일 수 있다.The entropy encoder 155 may determine the number cnt_pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order. However, the present invention is not limited thereto, and cnt_pos may be the number of transform coefficients greater than all zeros scanned before scanning the first transform coefficient among transform coefficients in the rectangular scan area.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index.

다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1 and predetermined threshold values thred 1 and thred2 are related to flag information indicating whether the first transform coefficient is greater than 0. Those skilled in the art can easily understand that the offsets offset1, 2, and 3 related to the context model and the predetermined threshold values thred 1 and thred2 and their values may be different.

엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 1 based on the relative position of the first transform coefficient in the scan area.

엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 indicates whether the first transform coefficient is greater than 1 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

엔트로피 부호화부(155)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x,thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x,thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. In this case, [thred1_x,thred1_y] may be [1,1]. Alternatively, [thred1_x,thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 부호화부(155)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

다만, 상기 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on size_sr. At this time, offsets offset1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 1, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y are flags indicating whether the first transform coefficient is greater than 0 Those skilled in the art can easily understand that offsets offset1, 2, and 3 related to the context model for information and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y and their values may be different.

엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 uses flag information indicating whether the first transform coefficient is greater than 1 based on whether the first transform coefficient is a transform coefficient at the first position among transform coefficients larger than 0 scanned according to the reverse scan order. Can determine the context model for That is, when the first transform coefficient is a first position among transform coefficients larger than 0 scanned according to the reverse scan order, the video decoding apparatus 100 provides first information regarding flag information indicating whether the first transform coefficient is greater than 1 A second context model for flag information indicating whether the first transform coefficient is greater than 1 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 0 scanned according to the reverse scan order Can be determined.

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

엔트로피 부호화부(155)는 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록 내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred3보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3은 제1 변환 계수가 0 및 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1,2 및 3과 그 값이 상이할 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 2 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred1, the entropy encoder 155 sets the context index to a predetermined value. The context offset may be increased by offset1, and the context model may be determined based on the increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred2, the entropy encoder 155 sets the context index by a predetermined context offset offset2. The context model may be determined based on the increased and increased context index. When the sum of the horizontal coordinate value pos_x of the first transform coefficient in the current block and the vertical position pos_y in the current block is less than a predetermined threshold value thred3, the entropy encoder 155 sets the context index by a predetermined context offset offset3. The context model may be determined based on the increased and increased context index. At this time, offsets offset 1, 2, and 3 related to the context model regarding flag information indicating whether the first transform coefficient is greater than 2 and predetermined threshold values thred 1,2 and 3 indicate whether the first transform coefficient is greater than 0 and 1. Offsets offsets 1, 2, and 3 related to the context model for flag information and predetermined threshold values thred 1, 2, and 3 may be different from each other.

엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치(또는, 1보다 큰 변환 계수들 중 첫번째 위치)의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 determines the size of the scan area, the number of transform coefficients already scanned in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero in which the first transform coefficient is scanned according to a predetermined scan order. A context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be determined based on at least one of whether the transform coefficient is a transform coefficient of a position that is not (or a first position among transform coefficients greater than 1).

예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 16에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoder 155 may determine the size_sr of the rectangular scan area based on Equation 16 below. That is, the size_sr of the rectangular scan area may mean the number of transform coefficients included in the rectangular scan area.

Figure pct00019
Figure pct00019

엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 그 절대값이 1보다 큰 모든 변환 계수의 개수일 수 있다.The entropy encoder 155 may determine the number cnt_pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area. In this case, cnt_pos may indicate the position of the first transform coefficient among all transform coefficients in the scan area scanned according to a predetermined scan order. However, the present invention is not limited thereto, and cnt_pos may be the number of all transform coefficients whose absolute values are scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan area is greater than 1.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred1, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.When cnt_pos is less than a predetermined threshold value thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine a context model based on the increased context index. In this case, thred2 may be 1/4*size_sr. Alternatively, thred2 may be 1/2*size_sr.

엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.When cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoder 155 may increase the context index by a predetermined context offset offset3 and determine a context model based on the increased context index.

다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2는 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred 1 및 thred2와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1 and thred2 are only examples, and it can be easily understood by those skilled in the art that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model related to flag information indicating whether the first transform coefficient is greater than 0 or 1 and predetermined threshold values thred 1 and thred2 indicate whether the first transform coefficient is greater than 0 or 1. Those skilled in the art can easily understand that the offsets offset1, 2, and 3 related to the context model for the flag information and the predetermined threshold values thred 1 and thred2 and their values may be different.

엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 may determine a context model for flag information indicating whether the first transform coefficient is greater than 2 based on the relative position of the first transform coefficient in the scan area.

엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 indicates whether the first transform coefficient is greater than 2 based on the horizontal coordinate value pos_x and the vertical coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the rectangular scan area. A context model for flag information can be determined.

엔트로피 부호화부(155)는 pos_x가 thred1_x보다 작고, pos_y가 thred1_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred1_x,thred1_y]는 [1,1]일 수 있다. 또는, [thred1_x,thred1_y]는 [sr_x/4,sr_y/4]또는 [(sr_x+1)/4,(sr_y+1)/4]일 수 있다.When pos_x is smaller than thred1_x and pos_y is smaller than thred1_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset1 and determine a context model based on the increased context index. In this case, [thred1_x,thred1_y] may be [1,1]. Alternatively, [thred1_x,thred1_y] may be [sr_x/4,sr_y/4] or [(sr_x+1)/4, (sr_y+1)/4].

엔트로피 부호화부(155)는 pos_x가 thred2_x보다 작고, pos_y가 thred2_y보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, [thred2_x,thred2_y]는 [thred1_x,thred1_y]는 [sr_x/2,sr_y/2] 또는 [(sr_x+1)/2,(sr_y+1)/2]일 수 있다.When pos_x is smaller than thred2_x and pos_y is smaller than thred2_y, the entropy encoder 155 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. In this case, [thred2_x,thred2_y] may be [thred1_x, thred1_y], [sr_x/2,sr_y/2] or [(sr_x+1)/2, (sr_y+1)/2].

다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, and thred2_y, thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on sr_x and sr_y.

다만, 상기 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 이때, 제1 변환 계수가 0 또는 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x, thred1_y, thred2_x 및 thred2_y는 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델과 관련된 오프셋 offset1, 2 및 3과 소정의 임계값 thred1_x,thred1_y, thred2_x 및 thred2_y와 그 값이 상이할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the threshold values thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and a person skilled in the art can easily understand that various values may be determined based on size_sr. At this time, offsets 1, 2, and 3 related to the context model related to flag information indicating whether the first transform coefficient is greater than 0 or 1, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y indicate whether the first transform coefficient is greater than 0. Those skilled in the art can easily understand that offsets offset1, 2, and 3 related to the context model for the indicated flag information, and predetermined threshold values thred1_x, thred1_y, thred2_x, and thred2_y, and their values may be different.

엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy encoder 155 uses flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is a transform coefficient at the first position among transform coefficients larger than 0 scanned according to the reverse scan order. Can determine the context model for That is, when the first transform coefficient is the first among transform coefficients larger than 0 scanned according to the reverse scan order, the entropy encoding unit 155 is configured to provide a first flag information indicating whether the first transform coefficient is greater than 1. A second context model for flag information indicating whether the first transform coefficient is greater than 1 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 0 scanned according to the reverse scan order Can be determined.

다만, 이에 제한되지 않고, 엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 1보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.이에 제한되지 않고, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 2보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. However, the present invention is not limited thereto, and the entropy encoder 155 has a first transform coefficient of 2 based on whether the first transform coefficient is a transform coefficient of a first position among transform coefficients larger than 1 scanned according to the reverse scan order. It is possible to determine a context model for flag information indicating whether it is greater. That is, when the first transform coefficient is the first among transform coefficients larger than 1 scanned according to the reverse scan order, the entropy encoding unit 155 performs first information regarding flag information indicating whether the first transform coefficient is greater than 1 A second context model for flag information indicating whether the first transform coefficient is greater than 2 when the context model is determined and the first transform coefficient is not the first position among transform coefficients larger than 1 scanned according to the reverse scan order Without being limited thereto, the context model for flag information indicating whether the first transform coefficient is greater than 2 is among n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order. The absolute value may be determined based on the number of effective transform coefficients greater than 2.

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

마찬가지로, 엔트로피 부호화부(155)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 현재 스캔되는 변환 계수의 GT0 플래그 정보를 생성하지 않을 수 있다.Similarly, the entropy encoder 155 determines the position of the currently scanned transform coefficient 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) Refers to the vertical coordinate value of the boundary pixel) If the transform coefficients of the position are all zeros, GT0 flag information of the transform coefficient currently being scanned may not be generated.

한편, 엔트로피 부호화부(155)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 생성할 수 있다. 즉, 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 생성하면, 이후에 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 더 이상 생성하지 않을 수 있다.Meanwhile, the entropy encoder 155 may determine the maximum number of GT1 flag information of the effective transform coefficient in the current block, and generate GT1 flag information in the current block within the maximum coefficient of the determined effective transform coefficient. That is, when the entropy encoder 155 generates the maximum number of GT1 flag information of the effective transform coefficients, 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를 하기와 같은 수학식 17에 기초하여 결정할 수 있다.The entropy encoder 155 may determine all non-zero effective transform coefficients as the maximum number of GT1 flag information in the current block. Alternatively, the entropy encoder 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 17 below.

Figure pct00020
Figure pct00020

이때, 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은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate 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 encoder 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 maximum coefficient of the determined effective transform coefficient. That is, if the entropy encoder 155 generates the maximum number of GT2 flag information of the effective transform coefficients, the entropy encoder 155 may no longer generate GT2 flag information of the effective transform coefficient.

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

Figure pct00021
Figure pct00021

이때, 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는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.Here, 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 coordinate of the upper left corner of the scan area. In other words, Sr_x may mean horizontal coordinates of the right boundary 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 coordinate of the upper left corner of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the coordinate of the upper left corner of the scan area. K2 may be an adjustment coefficient 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 encoder 155 may generate information on a coefficient group within 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. In this case, the entropy encoder 155 may determine one coefficient group for every K (K is an integer) transform coefficients scanned according to the scan order of the transform coefficients included in the scan area. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order that is opposite to a predetermined reverse scan order. The predetermined reverse scan order referred to herein may mean an order of scanning from a coefficient positioned at the lower right of the transform coefficients included in the current block to a coefficient positioned at the upper left of the transform coefficients included in the current block.

따라서, 엔트로피 부호화부(155)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수으로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. 다만 이에 제한되지 않고, 엔트로피 부호화부(155)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.Accordingly, the entropy encoder 155 may determine a coefficient group by scanning from a DC coefficient that is a coefficient adjacent to the upper left corner of the current block in a forward scan order. In this case, when 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 number of transform coefficients smaller than K. However, the present invention is not limited thereto, and the entropy encoder 155 scans from a coefficient positioned at the lower right of the transform coefficients included in the current block to a coefficient positioned at the upper left of the transform coefficients included in the current block. It can be easily understood by those skilled in the art that coefficient groups can be determined by scanning according to.

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

엔트로피 부호화부(155)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy encoder 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 some cases, the entropy encoder 155 may determine to hide the signs of one or two transform coefficients for each coefficient group included in the current block.

엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy encoder 155 may scan information about transform coefficients in the 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 easily 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)는 엔트로피 부호화부(160)에서 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다.The bitstream generator 170 may generate a bitstream including entropy-encoded information. That is, the bitstream generator 170 may scan information about a transform coefficient in the entropy encoder 160 and generate a bitstream including entropy-encoded information based on the information about the scanned transform coefficient. .

비트스트림 생성부(170)는 변환 계수에 관한 정보를 스캔하기 위한 영역인스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다.The bitstream generation unit 170 may generate a bitstream including information about coordinates specifying an area scan area for scanning information about transform coefficients.

비디오 부호화 장치(150)는 영상 부호화부(미도시)를 포함할 수 있고, 영상 부호화부(미도시)는 엔트로피 부호화부(155) 및 비트스트림 생성부(170)를 포함할 수 있다. 영상 부호화부에 대해서는 도 1f를 참조하여 설명하도록 한다.The video encoding apparatus 150 may include an image encoder (not shown), and the image encoder (not shown) may include an entropy encoder 155 and a bitstream generator 170. The video encoder 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을 참조하여 설명되는 영상을 부/복호화하는 과정에서 이용할 수 있는 데이터 단위일 수 있다. 비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수들을 생성할 수 있다.Referring to FIG. 1D, in step S150, the video encoding apparatus 150 may obtain transform coefficients of a current block. The current block may be a data unit that can be used in a process of encoding/decoding an image described with reference to FIGS. 10 to 23. The video encoding apparatus 150 may perform inter prediction or intra prediction to generate a prediction block of the current block, and may generate a residual block of the current block based on an original block of the current block and a 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만을 포함할 수 있다. In step S155, the video encoding apparatus 150 may determine a scan area including all effective transform coefficients in the current block. In this case, all effective transform coefficients in the current block may be included in the scan area, and the remaining areas in the current block excluding the scan area may include only 0, not the effective transform coefficient.

S160 단계에서, 비디오 부호화 장치(150)는 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 변환 계수에 관한 정보는 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보를 포함할 수 있다. 이때, 소정의 값은 0, 1, 2 중 적어도 하나일 수 있다. 변환 계수의 절대값에 관한 잔여 레벨 정보, 변환 계수의 부호 정보, 잔여 레벨 절대값의 이진화 파라메터 정보 중 적어도 하나를 포함할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.In step S160, the video encoding apparatus 150 may scan information on transform coefficients included in the scan area according to a predetermined scan order. The information on the transform coefficient may include flag information indicating whether the transform coefficient is greater than a predetermined value. In this case, the predetermined value may be at least one of 0, 1, and 2. It may include at least one of residual level information about the absolute value of the transform coefficient, code information of the transform coefficient, and binarization parameter information of the residual level absolute value. 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 easily 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)는 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성할 수 있다. In step S165, the video encoding apparatus 150 may generate binarized information by performing binarization based on information on the scanned transform coefficient.

S170 단계에서, 비디오 부호화 장치(150)는 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다. 이때, 비디오 부호화 장치(150)는 현재 블록의 크기 및 모양 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 이진 산술 부호화를 수행할 수 있다.In step S170, the video encoding apparatus 150 may generate entropy-encoded information by performing binary arithmetic encoding on the binarized information. In this case, the video encoding apparatus 150 may perform binary arithmetic encoding using a context model determined based on at least one of the size and shape of the current block.

S175 단계는 비디오 부호화 장치(150)는 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 비디오 부호화 장치(150)는 엔트로피 부호화부(160)에서 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 비디오 부호화 장치(150)는 변환 계수에 관한 정보를 스캔하기 위한 영역인 스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다.In step S175, the video encoding apparatus 150 may generate a bitstream including entropy-encoded information. The video encoding apparatus 150 may scan information about a transform coefficient in the entropy encoder 160 and generate a bitstream including entropy-encoded information based on the information about the scanned transform coefficient. The video encoding apparatus 150 may generate a bitstream including information about coordinates specifying a scan area, which is an area for scanning information about transform coefficients.

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

다양한 실시예에 따른 영상 복호화부(6000)는, 비디오 복호화 장치(100)의 영상 복호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image decoder 6000 according to various embodiments of the present disclosure performs tasks performed by an image decoder (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, an entropy decoder 6150 parses encoded image data to be decoded and encoding information necessary for decoding from a bitstream 6050. The encoded image data is a quantized transform coefficient, and the inverse quantization unit 6200 and the inverse transform unit 6250 restore residual data from the quantized transform coefficient. 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 for each block by using a reference image acquired from the reconstructed picture buffer 6300. By adding the prediction data for each block generated by the intra prediction unit 6400 or the inter prediction unit 6350 and the residual data, data in the spatial domain of the block of the current image 6050 is restored, and the deblocking unit ( 6450 and the SAO performing unit 6500 may perform loop filtering on the reconstructed spatial domain data to output the filtered reconstructed image 6600. Also, reconstructed pictures stored in the reconstructed picture buffer 6300 may be output as reference pictures.

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

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

다양한 실시예에 따른 영상 부호화부(7000)는, 비디오 부호화 장치(150)의 영상 부호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image encoder 7000 according to various embodiments performs tasks performed by an image encoder (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 of the current image 7050, and the inter prediction unit 7150 calculates the current image 7050 and the reference image acquired from the reconstructed picture buffer 7100 for each block. Inter prediction is performed by using.

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

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

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

도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.FIG. 2 is a diagram for describing a method of scanning an intra-block transform coefficient according to an exemplary 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 having a size of MxN (M and N are positive integers). For example, as shown 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 having a size of XxY (X and Y are positive integers). 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 the upper left transform coefficient to the lower right transform coefficient according to the forward scan order. Among all the effective transform coefficients scanned, the pixel of the final effective transform coefficient ( 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 coordinate of the pixel of the final effective transform coefficient and information about the vertical coordinate of the pixel of the final effective transform coefficient.

비디오 복호화 장치(100)는 최종 유효 변환 계수의 픽셀(210)의 좌표에 관한 정보를 기초로 최종 유효 변환 계수의 픽셀(210)의 좌표를 획득하고, 최종 유효 변환 계수의 픽셀(210)의 좌표를 기초로 최종 유효 변환 계수(210)에 관한 유효 변환 계수부터 소정의 역방향 스캔 순서(215)에 따라 변환 계수의 정보를 스캔할 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 소정의 역방향 스캔 순서(215)는 역방향의 대각 스캔 순서일 수 있다.The video decoding apparatus 100 acquires the coordinates of the pixel 210 of the final effective transform coefficient based on the information on 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 The information of the transform coefficient may be scanned according to a predetermined reverse scan order 215 from the effective transform coefficient for the final effective transform coefficient 210. For example, as shown in FIG. 2, a 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 on a coefficient group with respect to the coefficient groups according to a predetermined scan order. Information about the coefficient group may be obtained or derived from the bitstream. The information on the coefficient group may be derived to indicate that at least one effective transform coefficient is included for the first coefficient group and the last coefficient group scanned according to the forward (reverse) scan order. That is, 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 forward (reverse) scan order.

이때, 비디오 복호화 장치(100)는 블록의 크기 및 예측 모드 중 적어도 하나에 기초하여 소정의 역방향 스캔 순서를 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 블록의 크기가 4x4이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 블록의 크기가 8x8이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다.In this case, 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 selects one of a reverse horizontal scan order, a vertical scan order, or a diagonal scan order. It can be determined in 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 a reverse horizontal scan order, a vertical scan order, or a diagonal scan order. You can decide in order.

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

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

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

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

도 3a를 참조하면, 현재 블록(300)은 복수의 변환 계수를 포함하는 블록이다. 현재 블록(300)은 역변환 동작을 수행하는 데이터 단위로, MxN (M,N은 양의 정수) 크기의 블록일 수 있다. 예를 들어, 도 3에 도시된 바와 같이, 현재 블록(300)은 16x16 크기의 블록일 수 있다.Referring to FIG. 3A, a 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 having a size of MxN (M,N are positive integers). For example, as shown in FIG. 3, 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 existing in the current block 300. In this case, the rectangular scan area 340 may be determined by the coordinates of the pixel 330 positioned at the lower right of the rectangular scan area 340. The horizontal coordinates of the pixel 330 positioned at the lower right of the scan area 340 may be the horizontal coordinates of the effective transform coefficient pixel 320 positioned at the rightmost among all the effective transform coefficients in the current block 300 have. The vertical coordinate of the pixel 330 positioned at the lower right of the scan area 340 may be the vertical coordinate of the effective transform coefficient pixel 310 positioned at the bottom of all effective transform coefficients in the current block 300 have. The information on the pixel 330 may include information on 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 information on the coordinates of the pixel 330 specifying the rectangular scan area 340 from the bitstream, and the rectangular scan area 340 based on the received information on the pixel 330 Can be determined. The video decoding apparatus 100 may scan information on the transform coefficient from the pixel 330 to the pixel 345 at the upper left of the rectangular scan area 340 according to a predetermined reverse scan order 355. In this case, the coefficient group may be determined for each K scan coefficients (K is a positive integer) scanned according to a predetermined forward scan order from the transform coefficient at the upper left of the rectangular scan area 340. However, it is not limited thereto, and those skilled in the art can easily understand that it may be determined for each K scan coefficients (K is a positive integer) scanned according to a predetermined reverse scan order from the transform coefficient at the lower right. 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 sign for at least one effective transform coefficient that is hidden. . Details on performing the operation of restoring hidden codes for each coefficient group will be described later with reference to FIG. 3B.

도 3b는 일 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.3B is a diagram for describing an operation of determining a coefficient group (subblock) within a block and an operation performed for each coefficient group, according to an exemplary 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 shown in FIG. 3B, the video decoding apparatus 100 may determine a coefficient group 360 for every 16 pixels.

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

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

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

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

한편, 현재 블록(300) 내 사각형 스캔 영역에 포함된 변환 계수의 개수가 K개의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 마지막에 위치하는 계수 그룹을 결정하는 과정에서 K개보다 적은 개수의 변환 계수 픽셀이 존재할 수 있다. 이 경우, 비디오 복호화 장치(100)는 K개보다 적은 개수의 변환 계수 픽셀을 포함하는 계수 그룹(365)을 결정할 수 있다. 예를 들어, 도 3b에 도시된 바와 같이, 비디오 복호화 장치(100)는 2개의 변환 계수를 포함하는 계수 그룹(365)를 결정할 수 있다.Meanwhile, when the number of transform coefficients included in the rectangular scan area in the current block 300 is not an integer multiple of K, the number of transforms less than K in the process of determining the last coefficient group according to the forward scan order There may be coefficient pixels. In this case, the video decoding apparatus 100 may determine a coefficient group 365 including a number of transform coefficient pixels less than K. For example, as shown 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 on the coefficient groups 355 and 360 from the bitstream. Here, the information on the coefficient groups 355 and 360 is flag information indicating whether at least one of the transform coefficients included in the coefficient group 355 and 360 is an effective transform coefficient or whether only the transform coefficients having 0 in the coefficient group 355 and 360 are included (effective coefficient 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 obtain information about the coefficient group (eg, effective coefficient group flag information) from the bitstream, Information about the coefficient can be obtained.

비디오 복호화 장치(100)는 역방향의 소정의 스캔 순서(355)에 따라 현재 계수 그룹보다 이전에 스캔된 계수 그룹의 계수 그룹에 관한 정보를 기초로 현재 계수 그룹에 관한 정보를 이진 산술 복호화하기 위한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 is a context for binary arithmetic decoding 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. You can decide the model.

도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 4 is a diagram for describing a process of determining a context model for context-based binary arithmetic encoding and decoding 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 on the currently scanned transform coefficient pixel 405 based on the surrounding transform coefficient pixels 410. In FIG. 4, the peripheral transform coefficient pixels 405 may be five pixels existing at a predetermined position on the right or lower side of the currently scanned transform coefficient pixel 405. However, the present invention is not limited thereto, and those skilled in the art can easily understand that the peripheral transform coefficient pixels 405 may be n (n is a positive integer) pixels present at predetermined positions on the right or the lower side.

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

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

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

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

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

도 5는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 5 is a diagram for describing a process of determining a context model for context-based binary arithmetic encoding and decoding 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 determines a context model of information about a transform coefficient pixel 505 currently being scanned, and transform coefficient pixels 510 previously scanned according to a predetermined reverse scan order 515. Can be determined based on As illustrated in FIG. 5, the transform coefficient pixels 510 may be five pixels previously scanned according to a predetermined reverse reflection 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 reverse reflection scan order 515. . As shown in FIG. 5, a predetermined reverse scan sequence 515 may be a reverse zig-zag scan sequence, but is not limited thereto, and those skilled in the art that it may include a horizontal scan sequence, a vertical scan sequence, and a diagonal scan sequence. It can be easily understood. 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 value and the size of the vertical coordinate value specifying the scan area.

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

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

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

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

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

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

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

한편, 일 실시예에 따른 지그재그 스캔 순서(602)는 픽셀(604)을 스캔한 후에 바로 수평 방향에 위치하는 좌측 방향 픽셀(606)을 스캔하므로, 지그재그 스캔 순서(602)를 수평 우선 지그재그 순서라고 칭할 수 있다.Meanwhile, in the zigzag scan sequence 602 according to an embodiment, since the left-facing pixel 606 positioned in the horizontal direction is scanned immediately after scanning the pixel 604, the zigzag scan sequence 602 is referred to as the horizontal first zigzag sequence. Can be called.

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

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

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

한편, 일 실시예에 따른 지그재그 스캔 순서(616)는 픽셀(618)을 스캔한 후에 바로 수직 방향에 위치하는 상측 방향 픽셀(620)을 스캔하므로, 지그재그 스캔 순서(616)를 수직 우선 지그재그 순서라고 칭할 수 있다.Meanwhile, in the zigzag scan sequence 616 according to an embodiment, since the upward direction pixels 620 positioned in the vertical direction are scanned immediately after scanning the pixels 618, the zigzag scan sequence 616 is referred to as the vertical priority zigzag sequence Can be called.

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

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

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

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

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

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

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

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

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

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

도 7a는 일 실시예에 따라서 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향의 좌표를 변경(swap)하여 스캔 영역을 변경하는 과정을 설명하기 위한 도면이다.FIG. 7A is a diagram for explaining a process of changing a scan area by changing (swap) coordinates in a horizontal direction and a vertical direction of transform coefficient pixels in the scan area according to an exemplary embodiment.

도 7a를 참조하면, 현재 블록(700)은 너비가 높이보다 큰 직사각형일 수 있다. Referring to FIG. 7A, the current block 700 may be a rectangle having a width greater than a height.

비디오 복호화 장치(100)는 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그를 획득할 수 있다. 비디오 복호화 장치(100)는 상기 플래그가 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 경우, 현재 블록(700)의 너비가 높이보다 큰 지 여부를 결정할 수 있다. The video decoding apparatus 100 may obtain a flag indicating that an operation of changing horizontal coordinates and vertical coordinates of a transform coefficient pixel included in the current block 700 is activated. When the flag indicates that an operation of changing horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block 700 is activated, the width of the current block 700 is increased. You can decide whether it is greater than.

비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 너비와 높이를 서로 변경하여, 변경된(swapped) 블록(710)을 결정할 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 may determine a swapped block 710 by changing the width and height of the current block.

즉, 비디오 복호화 장치(100)는 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하여, 변경된 블록(710) 에 포함된 변환 계수의 픽셀 위치를 결정할 수 있다. That is, the video decoding apparatus 100 may determine the pixel position of the transform coefficient included in the changed block 710 by changing the horizontal coordinate and the vertical coordinate of the transform coefficient pixel included in the current block 700. .

비디오 복호화 장치(100)는 모든 유효 변환 계수를 포함하는 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보를 비트스트림으로부터 획득할 수 있다. 여기서, 사각형 스캔 영역(705)을 특정하기 위한 좌표의 수평 방향 좌표는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표일 수 있다. 사각형 스캔 영역을 특정하기 위한 좌표의 수직방향 좌표는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표일 수 있다. 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표 값에 관한 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표 값에 관한 정보를 포함할 수 있다. 또는, 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보는 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표 값 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표 값 중 하나의 좌표 값에 관한 정보 및 상기 하나의 좌표와 다른 하나의 좌표 값 간의 차분을 나타내는 정보를 포함할 수 있다. The video decoding apparatus 100 may obtain information about coordinates for specifying the rectangular scan area 705 including all effective transform coefficients from the bitstream. Here, the horizontal coordinates of the coordinates for specifying the rectangular scan area 705 may be the horizontal coordinates of the effective transform coefficient pixel located at the rightmost among all the effective transform coefficients in the current block. The vertical coordinates of the coordinates for specifying the rectangular scan area may be the vertical coordinates of the lowest effective transform coefficient pixel among all the effective transform coefficients in the current block. The information on the coordinates for specifying the rectangular scan area 705 is information on the horizontal coordinate value of the most right effective transform coefficient pixel among all the effective transform coefficients in the current block and all effective transform coefficients in the current block. It may include information on a vertical coordinate value of an effective transform coefficient pixel located at the lowest of the ones. Alternatively, the information on the coordinates for specifying the rectangular scan area 705 is the horizontal coordinate value of the effective transform coefficient pixel located at the rightmost among all the effective transform coefficients and the lowest among all the effective transform coefficients in the current block. It may include information about one coordinate value among vertical coordinate values of the located effective transform coefficient pixel and information indicating a difference between the one coordinate value and the other coordinate value.

비디오 복호화 장치(100)는 현재 블록의 너비와 높이가 서로 다른 경우, 비트스트림으로부터 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보가 사각형 스캔 영역(705)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 포함하는지 여부를 나타내는 플래그 정보(이하, 델타 플래그 정보라 한다)를 획득할 수 있다. 비디오 복호화 장치(100)는 델타 플래그 정보에 기초하여 비트스트림으로부터 사각형 스캔 영역(705)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값 중 하나를 나타내는 좌표 값을 나타내는 정보 및 하나의 좌표 값과 다른 좌표 값 간의 차분을 나타내는 정보를 획득할 수 있다.When the width and height of the current block are different from each other, the video decoding apparatus 100 includes information about coordinates for specifying the rectangular scan area 705 from the bitstream, as a horizontal coordinate value for specifying the rectangular scan area 705 Flag information (hereinafter referred to as delta flag information) indicating whether information indicating a difference between the and vertical coordinate values is included may be obtained. The video decoding apparatus 100 includes information representing a coordinate value representing one of a horizontal coordinate value and a vertical coordinate value for specifying the rectangular scan area 705 from the bitstream based on the delta flag information, and one coordinate value. Information indicating a difference between different coordinate values may be obtained.

비디오 복호화 장치(100)는 비트스트림으로부터 획득된 모든 유효 변환 계수를 포함하는 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보를 기초로 사각형 스캔 영역(705)을 특정하기 위한 좌표를 획득할 수 있다. 이때, 비디오 복호화 장치(100)가 획득한 사각형 스캔 영역(705)을 특정하기 위한 좌표는 현재 블록(700) 내 사각형 스캔 영역(705)을 특정하기 위한 좌표로, 사각형 스캔 영역(705)을 특정하기 위한 좌표의 수평방향 좌표 값 및 수평 방향 좌표 값을 서로 변경함으로써 비디오 복호화 장치(100)는 변경된 블록(710)의 사각형 스캔 영역(715)을 특정하기 위한 좌표 값을 획득할 수 있다.The video decoding apparatus 100 may acquire coordinates for specifying the rectangular scan area 705 based on information about coordinates for specifying the rectangular scan area 705 including all effective transform coefficients obtained from the bitstream. I can. At this time, the coordinates for specifying the rectangular scan area 705 acquired by the video decoding apparatus 100 are coordinates for specifying the rectangular scan area 705 in the current block 700, and specify the rectangular scan area 705 The video decoding apparatus 100 may obtain a coordinate value for specifying the rectangular scan area 715 of the changed block 710 by changing the horizontal coordinate value and the horizontal coordinate value of the coordinate to be used.

비디오 복호화 장치(100)는 변경된 블록(710)의 사각형 스캔 영역(715)을 기초로 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 이때, 소정의 스캔 순서는 현재 블록(700)에 대한 소정의 스캔 순서에 대응하는 스캔 순서로 현재 블록(700)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 수평 방향의 좌표 값 및 수직 방향의 좌표 값을 서로 변경한 좌표 값에 따른 스캔 순서일 수 있다. 예를 들어, 현재 블록(700)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값이 (4,4)->(3,4)->(4,3)->...인 경우, 변경된 블록(710)에 대한 소정의 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값은 (4,4)->(4,3)->(3,4)->?? 일 수 있다.The video decoding apparatus 100 may scan information on a transform coefficient based on the rectangular scan area 715 of the changed block 710 according to a predetermined scan order. In this case, the predetermined scan order is a scan order corresponding to a predetermined scan order for the current block 700, and a horizontal coordinate value and a vertical coordinate value of the transform coefficient pixels scanned according to a predetermined scan order for the current block 700 It may be a scan order according to coordinate values obtained by changing coordinate values of directions. For example, the coordinate value of the transform coefficient pixels scanned according to a predetermined scan order for the current block 700 is (4,4)->(3,4)->(4,3)->... In the case of, the coordinate value of the transform coefficient pixels scanned in a predetermined order for the changed block 710 is (4,4)->(4,3)->(3,4)->?? Can be

비디오 복호화 장치(100)는 변경된 블록(710)에서 스캔된 변환 계수에 관한 정보를 소정의 컨텍스트 모델에 기초하여 이진 산술 복호화하고, 역이진화하여 변경된 블록(710)의 변환 계수들을 획득할 수 있다. 비디오 복호화 장치(100)는 변경된 블록(710)의 변환 계수들의 수평방향 좌표 값 및 수직방향의 값을 서로 변경하여 현재 블록(700)의 변환 계수들을 획득할 수 있다.The video decoding apparatus 100 may perform binary arithmetic decoding on information about the transform coefficients scanned in the changed block 710 based on a predetermined context model, and inverse binarization to obtain transform coefficients of the changed block 710. The video decoding apparatus 100 may obtain transform coefficients of the current block 700 by changing a horizontal coordinate value and a vertical direction of the transform coefficients of the changed block 710.

비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 변경된 블록(710)에서 변환 계수에 관한 정보를 스캔하여 스캔된 변환 계수에 관한 정보를 엔트로피 복호화함으로써, 항상 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 변환 계수에 관한 정보를 엔트로피 복호화할 수 있다. 따라서, 현재 블록의 너비가 높이보다 큰 경우에 대한 별도의 컨텍스트 모델을 이용하지 않고, 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 컨텍스트 모델만을 이용함으로써 엔트로피 복호화의 복잡도를 감소시킬 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 swaps horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block, and changes the transform coefficients in the changed block 710. By entropy-decoding the information on the scanned transform coefficient by scanning the information, it is always possible to entropy-decode the information on the transform coefficient for the block whose height is greater than or equal to the width of the current block. Therefore, it is possible to reduce the complexity of entropy decoding by not using a separate context model for a case where the width of the current block is greater than the height, and only using a context model for a block whose height is greater than or equal to the width of the current block.

이상 비디오 복호화 장치(100)가 현재 블록의 너비 및 높이가 서로 다른 경우, 델타 플래그 정보를 획득하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 부호화 장치(150) 및 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 다른 경우, 델타 플래그 정보를 획득하지 않고, 비트스트림으로부터 사각형 스캔 영역(715)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.In the above, when the width and height of the current block are different from each other, the content of obtaining delta flag information has been described, but the present invention is not limited thereto, and the video encoding apparatus 150 and the video decoding apparatus 100 When the width and height of the blocks are different, information indicating the difference between the horizontal coordinate value and the vertical coordinate value for specifying the rectangular scan area 715 from the bitstream can be obtained without obtaining delta flag information. Those skilled in the art can easily understand.

이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 같은지 또는 다른지에 관계없이 델타 플래그 정보를 생성하지 않고, 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.Without being limited thereto, the video decoding apparatus 100 may obtain information indicating a difference between a horizontal coordinate value and a vertical coordinate value without generating delta flag information regardless of whether the width and height of the current block are the same or different. It can be readily understood by those skilled in the art.

이상 비디오 부호화 장치(150)가 변경 플래그를 생성하고, 비디오 복호화 장치(100)가 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그에 기초하여 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할지를 결정하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 항상 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.Based on a flag indicating that the ideal video encoding apparatus 150 generates a change flag, and the video decoding apparatus 100 activates an operation of changing the horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block with each other Thus, the content of determining whether to change the horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block to each other has been described, but the present invention is not limited thereto, and the video decoding apparatus 100 includes: It can be easily understood by those skilled in the art that the horizontal direction coordinates and the vertical direction coordinates can always be changed from each other.

이상, 비디오 복호화 장치(100)가 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 그렇지 않은 경우 변경하지 않는 내용을 설명하였으나, 이에 제한되지 않고, 반대로 현재 블록의 높이가 너비보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 및 수직 방향 좌표를 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.As described above, when the width of the current block is greater than the height of the current block, the video decoding apparatus 100 swaps the horizontal and vertical coordinates of the transform coefficient pixels included in the current block. Otherwise, the content is not changed. Has been described, but is not limited thereto, and conversely, when the height of the current block is greater than the width, it may be easily understood by those skilled in the art that horizontal and vertical coordinates of the transform coefficient pixels included in the current block can be changed.

이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하지 않고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 스캔 영역 내 변환 계수들의 수평 방향 및 수직 방향 좌표를 서로 변경하여 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.As described above, the video decoding apparatus 100 changes the horizontal and vertical coordinates of the current block, changes the horizontal and vertical coordinates of the scan area to scan information on the transformation coefficient, and scans the scanned transformation coefficient. Contents for obtaining transformation coefficients in the current block by performing entropy decoding on the information about and changing the horizontal and vertical coordinates of the obtained transformation coefficients have been described, but are not limited thereto, and the horizontal direction of the current block Without changing the coordinates and vertical coordinates, by changing only the horizontal coordinates and the vertical coordinates of the scan area to each other, scan and entropy decoding information on the transform coefficients in the scan area to obtain the transform coefficients in the scan area, Those skilled in the art can easily understand that the transform coefficients in the current block can be obtained by changing the horizontal and vertical coordinates of the transform coefficients in the scan area.

이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 변환 계수들의 수평 방향 및 수직 방향 좌표의 변경없이 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 복호화하고, 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다. As described above, the video decoding apparatus 100 changes the horizontal and vertical coordinates of the current block, changes the horizontal and vertical coordinates of the scan area to scan information on the transformation coefficient, and scans the scanned transformation coefficient. The information about entropy decoding is performed to obtain transformation coefficients in the current block, and the contents of changing the horizontal and vertical coordinates of the obtained transformation coefficients have been described, but are not limited thereto, and the horizontal direction of the transformation coefficients And decoding by changing only the horizontal coordinates and the vertical coordinates of the scan area without changing the vertical coordinates, scanning and entropy decoding information on the transform coefficients in the scan area to obtain the transform coefficients in the scan area, It can be easily understood by those skilled in the art that the transform coefficient within the current block can be obtained.

즉, 비디오 부호화 장치(150)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 스캔 영역의 수평 방향 및 수직 방향 좌표를 서로 변경하고, 이를 나타내는 정보를 전송할 수 있다. 이때, 일반적으로는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 너비가 높이보다 큼으로, 스캔영역을 특정하는 수평방향의 좌표는 수직방향의 좌표보다 크게 되고, 서로 좌표 값을 변경하게 되면, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 작게 된다. 따라서, 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 전송함으로써 비트수를 줄일 수 있게 된다. 하지만, 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 높이가 너비보다 크다면, 비디오 부호화 장치(150)는 변경된 수평방향의 좌표 값 정보 및 변경된 수평방향의 좌표 값 및 변경된 수직방향의 좌표 값정보를 그대로 전송할 수 있다. 즉, 차분 정보가 전송되지 않을 수 있다. 이 경우, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 크기 때문이다. That is, when the width of the current block is greater than the height of the current block, the video encoding apparatus 150 may change coordinates in the horizontal direction and the vertical direction of the scan area of the current block with each other, and transmit information indicating this. At this time, in general, when the width of the current block is larger than the height, the width of the scan area is larger than the height, and the coordinates in the horizontal direction specifying the scan area become larger than the coordinates in the vertical direction. , The changed coordinate value in the horizontal direction becomes smaller than the changed coordinate value in the vertical direction. Accordingly, it is possible to reduce the number of bits by transmitting information about the changed coordinate value in the horizontal direction and difference information about the changed coordinate value in the horizontal direction and the changed coordinate value in the vertical direction. However, when the width of the current block is greater than the height and the height of the scan area is greater than the width, the video encoding apparatus 150 provides the changed coordinate value information in the horizontal direction, the changed coordinate value in the horizontal direction, and the changed coordinate value in the vertical direction. Information can be transmitted as it is. That is, difference information may not be transmitted. In this case, this is because the changed coordinate value in the horizontal direction is larger than the changed coordinate value in the vertical direction.

비디오 부호화 장치(150)는 차분 정보를 전송하는지 여부를 나타내는 플래그를 함께 전송할 수 있다. 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역을 특정하는 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경한다고 결정할 수 있고, 비트스트림으로부터 플래그를 획득하고 플래그의 값이 1(차분 정보를 전송함을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다.The video encoding apparatus 150 may also transmit a flag indicating whether to transmit difference information. When the width of the current block is greater than the height of the current block, the video decoding apparatus 100 may determine to change the horizontal coordinate value and the vertical coordinate value specifying the scan area to each other, obtain a flag from the bitstream, and the flag value is If it is 1 (indicating that the difference information is transmitted), information about the changed coordinate value in the horizontal direction and the difference information about the changed coordinate value in the horizontal direction and the changed coordinate value in the vertical direction are obtained, and based on this, the changed scan area is specified. It is possible to obtain a coordinate value.

플래그의 값이 0(차분 정보를 전송하지 않음을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수직방향의 좌표 값에 관한 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다. If the flag value is 0 (indicating that the difference information is not transmitted), information about the changed horizontal coordinate value and the changed vertical coordinate value is obtained, and based on this, the coordinate value specifying the changed scan area Can be obtained.

비디오 복호화 장치(100)는 획득된 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경하여 최종 스캔 영역을 특정하고, 스캔 영역 내 변환 계수에 관한 정보를 스캔할 수 있다.The video decoding apparatus 100 may specify a final scan area by changing the acquired horizontal coordinate value and vertical coordinate value with each other, and scan information about transformation coefficients within the scan area.

다만 현재 블록의 너비가 높이보다 큰 경우에 제한되지 않고, 현재 블록의 높이가 너비보다 큰 경우에도 유사한 동작이 수행될 수 있음을 당업자는 용이하게 이해할 수 있다.However, it can be easily understood by those skilled in the art that the current block is not limited when the width is greater than the height, and a similar operation may be performed even when the current block height is greater than the width.

도 7b는 다른 실시예에 따라서 사각형 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향 좌표를 변경(swap)하여 스캔 영역을 변경(swap)하는 과정을 설명하기 위한 도면이다.FIG. 7B is a diagram for explaining a process of changing a scan area by changing horizontal and vertical coordinates of transform coefficient pixels in a rectangular scan area according to another embodiment.

도 7b를 참조하면, 현재 블록(720)은 그 너비가 높이보다 큰 직사각형일 수 있다. Referring to FIG. 7B, the current block 720 may be a rectangle whose width is greater than the height.

비디오 복호화 장치(100)는 현재 블록(720)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그를 획득할 수 있다. 비디오 복호화 장치(100)는 상기 플래그가 현재 블록(720)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 경우, 현재 블록(720)의 너비가 높이보다 큰 지 여부를 결정할 수 있다. The video decoding apparatus 100 may obtain a flag indicating that an operation of changing horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block 720 is activated. When the flag indicates that an operation of changing horizontal coordinates and vertical coordinates of a transform coefficient pixel included in the current block 720 is activated, the width of the current block 720 is increased. You can decide whether it is greater than.

비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 너비와 높이를 서로 변경하여, 변경된(swapped) 블록(730)을 결정할 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 may determine the swapped block 730 by changing the width and the height of the current block.

즉, 비디오 복호화 장치(100)는 현재 블록(720)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하여, 변경된 블록(730) 에 포함된 변환 계수의 픽셀 위치를 결정할 수 있다. That is, the video decoding apparatus 100 may determine the pixel position of the transform coefficient included in the changed block 730 by changing the horizontal coordinate and the vertical coordinate of the transform coefficient pixel included in the current block 720. .

비디오 복호화 장치(100)는 모든 유효 변환 계수를 포함하는 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보를 비트스트림으로부터 획득할 수 있다. 여기서, 스캔 영역(725)을 특정하기 위한 좌표는 소정의 정방향 스캔 순서에 따라 스캔하는 경우 마지막 유효 변환 계수 픽셀의 수평방향 및 수직 방향 좌표일 수 있다. 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보는 마지막 유효 변환 계수 픽셀(725)의 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함할 수 있다. 또는, 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보는 마지막 유효 변환 계수 픽셀의 수평방향 좌표 및 수직 방향 좌표 중 하나의 좌표 값에 관한 정보 및 상기 하나의 좌표와 다른 하나의 좌표 값 간의 차분을 나타내는 정보를 포함할 수 있다. The video decoding apparatus 100 may obtain information about coordinates for specifying the scan area 725 including all effective transform coefficients from the bitstream. Here, the coordinates for specifying the scan area 725 may be horizontal and vertical coordinates of the last effective transform coefficient pixel when scanning is performed according to a predetermined forward scan order. Information about coordinates for specifying the scan area 725 may include information about horizontal coordinates of the last effective transform coefficient pixel 725 and information about vertical coordinates. Alternatively, the information on the coordinates for specifying the scan area 725 is information on one of the horizontal and vertical coordinates of the last effective transform coefficient pixel, and the difference between the one coordinate and the other coordinate value. It may include information indicating

비디오 복호화 장치(100)는 현재 블록의 너비와 높이가 서로 다른 경우, 비트스트림으로부터 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보가 스캔 영역(725)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 포함하는지 여부를 나타내는 플래그 정보(이하, 델타 플래그 정보라 한다)를 획득할 수 있다. 비디오 복호화 장치(100)는 델타 플래그 정보에 기초하여 비트스트림으로부터 스캔 영역(725)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값 중 하나를 나타내는 좌표 값을 나타내는 정보 및 하나의 좌표 값과 다른 좌표 값 간의 차분을 나타내는 정보를 획득할 수 있다.When the width and height of the current block are different from each other, the video decoding apparatus 100 may obtain information about coordinates for specifying the scan area 725 from the bitstream, perpendicular to the horizontal coordinate value for specifying the scan area 725. Flag information (hereinafter referred to as delta flag information) indicating whether information indicating a difference in direction coordinate values is included may be obtained. The video decoding apparatus 100 includes information indicating a coordinate value indicating one of a horizontal coordinate value and a vertical coordinate value for specifying the scan area 725 from the bitstream based on the delta flag information, and information indicating a coordinate value different from one coordinate value. Information indicating a difference between coordinate values may be obtained.

비디오 복호화 장치(100)는 비트스트림으로부터 획득된 모든 유효 변환 계수를 포함하는 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보를 기초로 스캔 영역(725)을 특정하기 위한 좌표를 획득할 수 있다. 이때, 비디오 복호화 장치(100)가 획득한 스캔 영역(725)을 특정하기 위한 좌표는 현재 블록(720) 내 스캔 영역(725)을 특정하기 위한 좌표로, 스캔 영역(725)을 특정하기 위한 좌표의 수평방향 좌표 값 및 수평 방향 좌표 값을 서로 변경함으로써 비디오 복호화 장치(100)는 변경된 블록(730)의 스캔 영역(725)을 특정하기 위한 좌표 값을 획득할 수 있다.The video decoding apparatus 100 may obtain coordinates for specifying the scan area 725 based on information about coordinates for specifying the scan area 725 including all effective transform coefficients obtained from the bitstream. . In this case, the coordinates for specifying the scan area 725 acquired by the video decoding apparatus 100 are coordinates for specifying the scan area 725 in the current block 720, and coordinates for specifying the scan area 725 The video decoding apparatus 100 may obtain a coordinate value for specifying the scan area 725 of the changed block 730 by changing the horizontal coordinate value and the horizontal coordinate value of.

비디오 복호화 장치(100)는 변경된 블록(730)의 스캔 영역(735)을 기초로 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 이때, 소정의 스캔 순서는 현재 블록(720)에 대한 소정의 스캔 순서에 대응하는 스캔 순서로 현재 블록(720)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 수평 방향의 좌표 값 및 수직 방향의 좌표 값을 서로 변경한 좌표 값에 따른 스캔 순서일 수 있다. 예를 들어, 현재 블록(720)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값이 (4,4)->(3,4)->(4,3)->...인 경우, 변경된 블록(730)에 대한 소정의 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값은 (4,4)->(4,3)->(3,4)->... 일 수 있다.The video decoding apparatus 100 may scan information about a transform coefficient based on the scan area 735 of the changed block 730 according to a predetermined scan order. In this case, the predetermined scan order is a scan order corresponding to a predetermined scan order for the current block 720, and a horizontal coordinate value and a vertical coordinate value of the transform coefficient pixels scanned according to a predetermined scan order for the current block 720 It may be a scan order according to coordinate values obtained by changing coordinate values of directions. For example, the coordinate value of the transform coefficient pixels scanned according to a predetermined scan order for the current block 720 is (4,4)->(3,4)->(4,3)->... In the case of, the coordinate value of the transform coefficient pixels scanned in a predetermined order for the changed block 730 is (4,4)->(4,3)->(3,4)->... have.

비디오 복호화 장치(100)는 변경된 블록(730)에서 스캔된 변환 계수에 관한 정보를 소정의 컨텍스트 모델에 기초하여 이진 산술 복호화하고, 역이진화하여 변경된 블록(730)의 변환 계수들을 획득할 수 있다. 비디오 복호화 장치(100)는 변경된 블록(730)의 변환 계수들의 수평방향 좌표 값 및 수직방향의 값을 서로 변경하여 현재 블록(720)의 변환 계수들을 획득할 수 있다.The video decoding apparatus 100 may perform binary arithmetic decoding on information about the transform coefficients scanned in the changed block 730 based on a predetermined context model, and inverse binarization to obtain transform coefficients of the changed block 730. The video decoding apparatus 100 may obtain transform coefficients of the current block 720 by changing a horizontal coordinate value and a vertical direction value of the transform coefficients of the changed block 730.

비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 변경된 블록(720)에서 변환 계수에 관한 정보를 스캔하여 스캔된 변환 계수에 관한 정보를 엔트로피 복호화함으로써, 항상 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 변환 계수에 관한 정보를 엔트로피 복호화할 수 있다. 따라서, 현재 블록의 너비가 높이보다 큰 경우에 대한 별도의 컨텍스트 모델을 이용하지 않고, 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 컨텍스트 모델만을 이용함으로써 엔트로피 복호화의 복잡도를 감소시킬 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 swaps horizontal coordinates and vertical coordinates of transform coefficient pixels included in the current block, and changes the transform coefficients in the changed block 720. By entropy-decoding the information on the scanned transform coefficient by scanning the information, it is always possible to entropy-decode the information on the transform coefficient for the block whose height is greater than or equal to the width of the current block. Therefore, it is possible to reduce the complexity of entropy decoding by not using a separate context model for the case where the width of the current block is greater than the height, and only using the context model for the block whose height is greater than or equal to the width of the current block.

이상 비디오 복호화 장치(100)가 현재 블록의 너비 및 높이가 서로 다른 경우, 델타 플래그 정보를 획득하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 부호화 장치(150) 및 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 다른 경우, 델타 플래그 정보를 획득하지 않고, 비트스트림으로부터 스캔 영역(720)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.In the above, when the width and height of the current block are different from each other, the content of obtaining delta flag information has been described, but the present invention is not limited thereto, and the video encoding apparatus 150 and the video decoding apparatus 100 If the width and height of the blocks are different, those skilled in the art can obtain information indicating the difference between the horizontal coordinate value and the vertical coordinate value for specifying the scan area 720 from the bitstream without obtaining delta flag information. Is easily understandable.

이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 같은지 또는 다른지에 관계없이 델타 플래그 정보를 생성하지 않고, 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.Without being limited thereto, the video decoding apparatus 100 may obtain information indicating a difference between a horizontal coordinate value and a vertical coordinate value without generating delta flag information regardless of whether the width and height of the current block are the same or different. It can be readily understood by those skilled in the art.

이상 비디오 부호화 장치(150)가 변경 플래그를 생성하고, 비디오 복호화 장치(150)가 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그에 기초하여 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할지를 결정하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 항상 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.Based on a flag indicating that the ideal video encoding apparatus 150 generates a change flag, and the video decoding apparatus 150 activates an operation of changing horizontal coordinates and vertical coordinates of transform coefficient pixels included in the current block. Thus, the content of determining whether to change the horizontal coordinates and vertical coordinates of the transform coefficient pixels included in the current block to each other has been described, but the present invention is not limited thereto, and the video decoding apparatus 100 includes: It can be easily understood by those skilled in the art that the horizontal direction coordinates and the vertical direction coordinates can always be changed from each other.

이상, 비디오 복호화 장치(100)가 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 그렇지 않은 경우 변경하지 않는 내용을 설명하였으나, 이에 제한되지 않고, 반대로 현재 블록의 높이가 너비보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 및 수직 방향 좌표를 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.As described above, when the width of the current block is greater than the height of the current block, the video decoding apparatus 100 swaps the horizontal and vertical coordinates of the transform coefficient pixels included in the current block. Otherwise, the content is not changed. Has been described, but is not limited thereto, and conversely, when the height of the current block is greater than the width, it may be easily understood by those skilled in the art that horizontal and vertical coordinates of the transform coefficient pixels included in the current block can be changed.

이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하지 않고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 스캔 영역 내 변환 계수들의 수평 방향 및 수직 방향 좌표를 서로 변경하여 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.As described above, the video decoding apparatus 100 changes the horizontal and vertical coordinates of the current block, changes the horizontal and vertical coordinates of the scan area to scan information on the transformation coefficient, and scans the scanned transformation coefficient. The information about entropy decoding is performed to obtain transformation coefficients in the current block, and the contents of changing the horizontal and vertical coordinates of the obtained transformation coefficients have been described, but are not limited thereto, and the horizontal direction of the current block Without changing the coordinates and vertical coordinates, by changing only the horizontal coordinates and the vertical coordinates of the scan area to each other, scan and entropy decoding information on the transform coefficients in the scan area to obtain the transform coefficients in the scan area, Those skilled in the art can easily understand that the transform coefficients in the current block can be obtained by changing the horizontal and vertical coordinates of the transform coefficients in the scan area.

이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 변환 계수들의 수평 방향 및 수직 방향 좌표의 변경없이 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 복호화하고, 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다. As described above, the video decoding apparatus 100 changes the horizontal and vertical coordinates of the current block, changes the horizontal and vertical coordinates of the scan area to scan information on the transformation coefficient, and scans the scanned transformation coefficient. The information about entropy decoding is performed to obtain transformation coefficients in the current block, and the contents of changing the horizontal and vertical coordinates of the obtained transformation coefficients have been described, but are not limited thereto, and the horizontal direction of the transformation coefficients And decoding by changing only the horizontal coordinates and the vertical coordinates of the scan area without changing the vertical coordinates, scanning and entropy decoding information on the transform coefficients in the scan area to obtain the transform coefficients in the scan area, It can be easily understood by those skilled in the art that the transform coefficient within the current block can be obtained.

즉, 비디오 부호화 장치(150)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 스캔 영역의 수평 방향 및 수직 방향 좌표를 서로 변경하고, 이를 나타내는 정보를 전송할 수 있다. 이때, 일반적으로는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 너비가 높이보다 큼으로, 스캔영역을 특정하는 수평방향의 좌표는 수직방향의 좌표보다 크게 되고, 서로 좌표 값을 변경하게 되면, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 작게 된다. 따라서, 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 전송함으로써 비트수를 줄일 수 있게 된다. 하지만, 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 높이가 너비보다 크다면, 비디오 부호화 장치(150)는 변경된 수평방향의 좌표 값 정보 및 변경된 수평방향의 좌표 값 및 변경된 수직방향의 좌표 값정보를 그대로 전송할 수 있다. 즉, 차분 정보가 전송되지 않을 수 있다. 이 경우, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 크기 때문이다. That is, when the width of the current block is greater than the height of the current block, the video encoding apparatus 150 may change coordinates in the horizontal direction and the vertical direction of the scan area of the current block with each other, and transmit information indicating this. At this time, in general, when the width of the current block is larger than the height, the width of the scan area is larger than the height, and the coordinates in the horizontal direction specifying the scan area become larger than the coordinates in the vertical direction. , The changed coordinate value in the horizontal direction becomes smaller than the changed coordinate value in the vertical direction. Accordingly, it is possible to reduce the number of bits by transmitting information about the changed coordinate value in the horizontal direction and difference information about the changed coordinate value in the horizontal direction and the changed coordinate value in the vertical direction. However, when the width of the current block is greater than the height and the height of the scan area is greater than the width, the video encoding apparatus 150 provides the changed coordinate value information in the horizontal direction, the changed coordinate value in the horizontal direction, and the changed coordinate value in the vertical direction. Information can be transmitted as it is. That is, difference information may not be transmitted. In this case, this is because the changed coordinate value in the horizontal direction is larger than the changed coordinate value in the vertical direction.

비디오 부호화 장치(150)는 차분 정보를 전송하는지 여부를 나타내는 플래그를 함께 전송할 수 있다. 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역을 특정하는 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경한다고 결정할 수 있고, 비트스트림으로부터 플래그를 획득하고 플래그의 값이 1(차분 정보를 전송함을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다.The video encoding apparatus 150 may also transmit a flag indicating whether to transmit difference information. When the width of the current block is greater than the height of the current block, the video decoding apparatus 100 may determine to change the horizontal coordinate value and the vertical coordinate value specifying the scan area to each other, obtain a flag from the bitstream, and the flag value is If it is 1 (indicating that the difference information is transmitted), information about the changed coordinate value in the horizontal direction and the difference information about the changed coordinate value in the horizontal direction and the changed coordinate value in the vertical direction are obtained, and based on this, the changed scan area is specified. It is possible to obtain a coordinate value.

플래그의 값이 0(차분 정보를 전송하지 않음을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수직방향의 좌표 값에 관한 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다. If the flag value is 0 (indicating that the difference information is not transmitted), information about the changed horizontal coordinate value and the changed vertical coordinate value is obtained, and based on this, the coordinate value specifying the changed scan area Can be obtained.

비디오 복호화 장치(100)는 획득된 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경하여 최종 스캔 영역을 특정하고, 스캔 영역 내 변환 계수에 관한 정보를 스캔할 수 있다.The video decoding apparatus 100 may specify a final scan area by changing the acquired horizontal coordinate value and vertical coordinate value with each other, and scan information about transformation coefficients within the scan area.

다만 현재 블록의 너비가 높이보다 큰 경우에 제한되지 않고, 현재 블록의 높이가 너비보다 큰 경우에도 유사한 동작이 수행될 수 있음을 당업자는 용이하게 이해할 수 있다.However, it can be easily understood by those skilled in the art that the current block is not limited when the width is greater than the height, and a similar operation may be performed even when the current block height is greater than the width.

도 8은 일 실시예에 따라 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 8 is a diagram for describing a process of determining a context model for syntax element information of a transform coefficient in a current block based on at least one of a size of a current block and a shape of a current block, according to an embodiment.

도 8를 참조하면, 현재 블록은 제1 블록(805), 제2 블록(810), 제3 블록(815) 중 하나의 모양(shape)을 가질 수 있다. 제1 블록은 높이가 너비보다 큰 직사각형 모양의 블록일 수 있고, 제2 블록은 너비가 높이보다 큰 직사각형 모양의 블록일 수 있고, 제3 블록(815)은 너비와 높이가 동일한 정사각형 모양의 블록일 수 있다.Referring to FIG. 8, the current block may have a shape of one of a first block 805, a second block 810, and a third block 815. The first block may be a rectangular block having a height greater than the width, the second block may be a rectangular block having a width greater than the height, and the third block 815 may be a square block having the same width and height. Can be

비디오 복호화 장치(100)는 수학식 19에 따라 결정된 size_tu0에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 관한 컨텍스트 모델을 결정할 수 있다. The video decoding apparatus 100 may determine a context model for syntax element information of a transform coefficient in a current block based on size_tu0 determined according to Equation 19.

Figure pct00022
Figure pct00022

여기서, log2_width는 현재 블록의 너비 width에 로그 2를 취한 값일 수 있고, log2_height는 현재 블록의 높이 height에 로그 2를 취한 값일 수 있다. 도 8을 참조하면, 현재 블록이 제1 블록(805)인 경우, size_tu는 (log2a+ log2b)/2 (a,b는 양의 정수)일 수 있다. 현재 블록이 제2 블록(810)인 경우, size_tu는 (log2c+log-2d)/2(c,d는 양의 정수)일 수 있다. 현재 블록이 제3 블록(815)인 경우, size_tu는 log2e(e는 양의 정수)일 수 있다.Here, log2_width may be a value obtained by taking log 2 from the width of the current block, and log2_height may be a value obtained by taking log 2 from the height of the current block. Referring to FIG. 8, when the current block is the first block 805, size_tu may be (log 2 a+ log 2 b)/2 (a, b are positive integers). When the current block is the second block 810, size_tu may be (log 2 c+log- 2 d)/2 (c,d are positive integers). When the current block is the third block 815, size_tu may be log 2 e (e is a positive integer).

또는, 비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값을 현재 블록의 너비 및 현재 블록의 높이 중 최소값에 기초하여 결정할 수 있다. 예를 들어, 비디오 복호화 장치는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값 size_tu1을 하기 수학식 20에 기초하여 결정할 수 있다.Alternatively, the video decoding apparatus 100 may determine a value for the size of the current block, which is an element determining the context model, based on a minimum value among the width of the current block and the height of the current block. For example, the video decoding apparatus may determine a value size_tu1 relating to the size of the current block, which is an element determining the context model, based on Equation 20 below.

Figure pct00023
Figure pct00023

여기서, Min() 함수는 입력값들 중 최소값을 출력으로 하는 함수일 수 있다. 도 8를 참조하면, 현재 블록이 제1 블록(805)인 경우, size_tu는 log2a(a는 양의 정수)일 수 있다. 현재 블록이 제2 블록(810)인 경우, size_tu는 log-2d(d는 양의 정수)일 수 있다. 현재 블록이 제3 블록(815) 인 경우, size_tu는 log2e(e는 양의 정수)일 수 있다.Here, the Min() function may be a function that outputs a minimum value among input values. Referring to FIG. 8, when the current block is the first block 805, size_tu may be log 2 a (a is a positive integer). When the current block is the second block 810, size_tu may be log- 2 d (d is a positive integer). When the current block is the third block 815, size_tu may be log 2 e (e is a positive integer).

비디오 복호화 장치(100)는 [수학식 20]에 따라 결정된 size_tu1에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 관한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 may determine a context model for syntax element information of a transform coefficient in a current block based on size_tu1 determined according to [Equation 20].

또는, 비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값을 현재 블록의 너비 및 현재 블록의 높이 중 최대값에 기초하여 결정할 수 있다. 예를 들어, 비디오 복호화 장치는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값 size_tu2를 하기 수학식 21에 기초하여 결정할 수 있다.Alternatively, the video decoding apparatus 100 may determine a value for the size of the current block, which is an element determining the context model, based on a maximum value among the width of the current block and the height of the current block. For example, the video decoding apparatus may determine a value size_tu2 relating to the size of the current block, which is an element determining the context model, based on Equation 21 below.

Figure pct00024
Figure pct00024

여기서, Max() 함수는 함수 입력값들 중 최대값을 출력으로 하는 함수일 수 있다.Here, the Max() function may be a function that outputs a maximum value among function input values.

비디오 복호화 장치(100)는 [수학식 21]에 따라 결정된 size_tu2에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 관한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 may determine a context model for syntax element information of a transform coefficient in a current block based on size_tu2 determined according to [Equation 21].

만약, a가 4이고, b가 16이고, e가 8인 경우, 제1 블록(805)에 대한 size_tu 및 제3 블록(815)에 대한 size_tu0는 3으로 동일할 수 있다.If a is 4, b is 16, and e is 8, size_tu for the first block 805 and size_tu0 for the third block 815 may be equal to 3.

변환 계수가 현재 블록의 높이 및 너비 중 더 넓은 쪽에 분포되어 있는 경향이 있음에도 비디오 복호화 장치(100)가 size_tu0를 기초로 제1 블록(805) 및 제3 블록(815)에 대하여 동일한 컨텍스트 모델을 결정할 수 있다. 하지만 만약 비디오 복호화 장치(100)가 size_tu1 또는 size_tu2를 기초로 제1 블록(805)및 제3블록(815)에 대한 컨텍스트 모델을 결정하면, 그 컨텍스트 모델들이 서로 다를 수 있고, 따라서 size_tu0를 기초로 컨텍스트 모델을 결정할 때보다 이진 산술 복호화의 효율이 향상 될 수 있다.The video decoding apparatus 100 determines the same context model for the first block 805 and the third block 815 based on size_tu0 even though the transform coefficient tends to be distributed to the wider of the height and width of the current block. I can. However, if the video decoding apparatus 100 determines the context models for the first block 805 and the third block 815 based on size_tu1 or size_tu2, the context models may be different from each other, and therefore, based on size_tu0 The efficiency of binary arithmetic decoding can be improved compared to when determining the context model.

비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값을 현재 블록의 모양에 기초하여 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 모양에 관한 값 shape_tu를 하기 수학식 22에 기초하여 결정할 수 있다.The video decoding apparatus 100 may determine a value of the size of the current block, which is an element determining the context model, based on the shape of the current block. For example, the video decoding apparatus 100 may determine a value shape_tu for the shape of the current block, which is an element determining the context model, based on Equation 22 below.

Figure pct00025
Figure pct00025

예를 들어, 현재 블록이 제1 블록(805)인 경우, shape_tu는 1일 수 있고, 현재 블록이 제2 블록(810)인 경우, shape_tu가 2일 수 있다. 현재 블록이 제3 블록(815)인 경우, shape_tu는 0일 수 있다. 즉, 현재 블록의 모양이 현재 블록의 높이보다 너비가 큰 직사각형 모양을 갖는 경우 size_tu는 2일 수 있고, 현재 블록의 모양이 현재 블록의 너비보다 높이가 큰 직사각형 모양을 갖는 경우 size_tu는 1일 수 있고, 현재 블록의 모양이 현재 블록의 너비와 높이가 동일한 정사각형 모양을 갖는 경우 size_tu는 0일 수 있다.For example, when the current block is the first block 805, shape_tu may be 1, and when the current block is the second block 810, shape_tu may be 2. When the current block is the third block 815, shape_tu may be 0. That is, if the shape of the current block has a rectangular shape with a width greater than the height of the current block, size_tu may be 2, and if the shape of the current block has a rectangular shape with a height greater than the width of the current block, size_tu may be 1. In addition, when the shape of the current block has a square shape having the same width and height of the current block, size_tu may be 0.

[수힉식 22]에서는, 현재 블록의 높이 height 및 현재 블록의 너비 width를 이용하였으나, 이에 제한되지 않고, [수힉식 21]과 같이 log2_width 및 log2_height에 기초하여 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 또한, [수학식 22]에서는 shape_tu는 0 내지 2 중 하나의 값으로 결정되었으나, 이에 제한되지 않고 다른 값이 할당될 수 있고, 각 값들이 나타내는 현재 블록의 모양도 달라질 수 있음을 당업자는 용이하게 이해할 수 있다.In [Equation 22], the height of the current block and the width of the current block are used, but are not limited thereto, and those skilled in the art can easily understand that it can be determined based on log2_width and log2_height as in [Equation 21]. have. In addition, in [Equation 22], shape_tu is determined to be one of 0 to 2, but it is not limited thereto, and other values may be assigned, and the shape of the current block represented by each value may be changed. I can understand.

만약 a가 4이고, b가 16이고, e가 8인 경우, 제1 블록(805)에 대한 size_tu는 3이고 제3 블록(815)에 대한 size_tu는 3으로 동일할 수 있다. If a is 4, b is 16, and e is 8, size_tu for the first block 805 may be 3 and size_tu for the third block 815 may be the same as 3.

변환 계수가 현재 블록의 높이 및 너비 중 더 넓은 쪽에 분포되어 있는 경향이 있음에도 비디오 복호화 장치(100)가 size_tu0를 기초로 제1 블록 및 제3 블록에 대하여 동일한 컨텍스트 모델을 결정할 수 있다. 하지만 만약 비디오 복호화 장치(100)가 shape_tu를 기초로 제1 블록(805)및 제3 블록(815)에 대한 컨텍스트 모델을 결정하면, 그 컨텍스트 모델들이 서로 다를 수 있고, 따라서 size_tu0를 기초로 컨텍스트 모델을 결정할 때보다 이진 산술 복호화의 효율이 향상 될 수 있다.Although the transform coefficient tends to be distributed to the wider of the height and width of the current block, the video decoding apparatus 100 may determine the same context model for the first block and the third block based on size_tu0. However, if the video decoding apparatus 100 determines the context models for the first block 805 and the third block 815 based on shape_tu, the context models may be different from each other, and therefore, the context model based on size_tu0 The efficiency of binary arithmetic decoding can be improved compared to when determining.

한편, 비디오 복호화 장치(100)는 현재 블록의 높이 및 너비의 최소값 size_tu1 및 최대값 size_tu2 에 기초하여 산출된 현재 블록의 최소값과 최대값 간 비율에 기초하여 변환 계수에 관한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 최소값과 최대값 간 비율이 소정의 값 범위 내인 경우 해당 범위에 대응하는 컨텍스트 인덱스를 결정하고, 결정된 컨텍스트 인덱스에 기초하여 변환 계수에 관한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 현재 블록의 높이가 너비보다 큰 경우, 최소값(너비)과 최대값(높이) 간 비율의 값이 1과 2 사이의 범위인 경우 이에 대응하는 컨텍스트 인덱스를 결정하고, 최소값과 최대값 간 비율의 값이 2이상의 범위인 경우 이에 대응하는 컨텍스트 인덱스를 결정할 수 있다.Meanwhile, the video decoding apparatus 100 may determine a context model for a transform coefficient based on a ratio between the minimum value and the maximum value of the current block calculated based on the minimum value size_tu1 and the maximum value size_tu2 of the height and width of the current block. For example, when the ratio between the minimum value and the maximum value is within a predetermined value range, the video decoding apparatus 100 may determine a context index corresponding to the corresponding range, and determine a context model for a transformation coefficient based on the determined context index. have. For example, if the height of the current block is larger than the width, if the value of the ratio between the minimum value (width) and the maximum value (height) is in the range between 1 and 2, the corresponding context index is determined, and the minimum and maximum values When the value of the liver ratio is in the range of 2 or more, a context index corresponding thereto may be determined.

한편, 비디오 복호화 장치(100)는 현재 블록의 모양 및 크기에 기초하여 변환 계수에 대한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 변환 계수에 대한 컨텍스트 모델을 결정할 수 있다. Meanwhile, the video decoding apparatus 100 may determine a context model for a transform coefficient based on the shape and size of the current block. That is, the video decoding apparatus 100 may determine a context model for a transform coefficient based on the size of the current block and the shape of the current block.

비디오 복호화 장치(100)는 현재 블록의 크기에 관한 값 size_tu1 및 size_tu2 중 적어도 하나와 현재 블록의 모양에 관한 값 shape_tu에 기초하여 변환 계수에 대한 컨텍스트 인덱스를 결정하고, 결정된 컨텍스트 인덱스에 대응하는 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 determines a context index for a transform coefficient based on at least one of size_tu1 and size_tu2 for the size of the current block and shape_tu for the shape of the current block, and a context model corresponding to the determined context index Can be determined.

도 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 about a transform coefficient to restore 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, from a bitstream, syntax element information scan_region_x and scan_region_y indicating coordinates for specifying a rectangular scan region. At this time, the syntax element information scan_region_x may represent a value of the horizontal coordinate (x-axis direction) of the effective transform coefficient located at the rightmost position in the current block based on the upper left corner coordinate of the current block, and the syntax element information scan_region_y A value of a coordinate value in the vertical direction (y-axis direction) of an effective transform coefficient positioned at the bottom of the current block based on the coordinates of the upper left corner of the block. The video decoding apparatus 100 may determine coordinates srX and srY for specifying the scan region based on the 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 a scan order (ScanOrder(srX+1, srY+1)) based on 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 coefficient group that is last scanned in a forward scan order based on coordinates srX and srY for specifying a scan area. That is, the video decoding apparatus 100 performs an operation (>>4) of bit shifting a value of (srX+1)*(srY+1)) -1 which is the size of the scan area to the right by 4, and finally 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 according to the division 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 the last in the forward scan order A value obtained by adding 1 to the index value representing the coefficient group to be scanned) may be determined.

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

비디오 복호화 장치(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, decrease i by 1 when i is greater than 0, and perform an operation included in the loop (for statement) 905. The video decoding apparatus 100 may perform an operation included in the for statement 905 until a value less than 0 is reached. In this case, i may be an index indicating a coefficient group. That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time an operation included in the for statement 905 is performed.

비디오 복호화 장치(100)는 i에 16을 곱하는 동작(i<<4)을 수행하여setPos를 결정할 수 있다. setPos는 변환 그룹의 첫번째에 위치하는 변환 계수의 인덱스 정보를 나타낼 수 있다.The video decoding apparatus 100 may determine setPos by multiplying i by 16 (i<<4). setPos may represent index information of a transform coefficient positioned at the first of a 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은 정방향의 스캔 순서에 따른 계수 그룹 내 변환 계수의 위치를 나타내는 인덱스 정보일 수 있다.When i is the last coefficient group (i==lastSet), the video decoding apparatus 100 determines n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is determined as 15, and n is 0. If it is greater than or equal to, i may be decreased by 1, and the operation included in the for statement 910 may be performed. The video decoding apparatus 100 may perform an operation (operation related to sig_flag) included in the 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)을 수행할 수 있다. For example, if the total number of transform coefficients included in the scan area is not an integer multiple of 16, the value obtained by subtracting setPos from lastScanPos for the last coefficient group (i=lastset) scanned according to the forward scan is greater than 0. It is equal to or has a value less than or equal to 15, and the value is determined as n, and a for statement 910 may be performed.

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

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(width)에 기초하여 현재 스캔되는 수평 방향(x축 방향)의 좌표의 값 sx를 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(log2width)에 기초하여 수직 방향(y축 방향)의 좌표의 값 sy를 결정할 수 있다.The video decoding apparatus 100 may determine a value sx of coordinates in the currently scanned horizontal direction (x-axis direction) based on the position blkpos of the current transform coefficient and the width of the scan area. In addition, the video decoding apparatus 100 may determine a value sy of a coordinate in a vertical direction (y-axis direction) based on a location (blkpos) of a transform coefficient currently being decoded and a width (log2width) of a 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), 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수에 대한 유효 변환 계수 플래그 sig_flag(sig_flag[blkpos])를 획득하지 않고, 현재 변환 계수에 대한 sig_flag의 값을 1로 결정할 수 있다. 여기서 is_last_x는 스캔 영역 내 가장 하측의 행에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다. is_last_y는 스캔 영역 내 가장 우측의 열에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다.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 If 0 (sy==0 && sx==srX&&is_last_x==0), the video decoding apparatus 100 does not obtain the effective transform coefficient flag sig_flag(sig_flag[blkpos]) for the current transform coefficient from the bitstream, A value of sig_flag for the transform coefficient may be determined as 1. Here, is_last_x may be a value indicating whether there is an effective transform coefficient having an absolute value greater than 0 among transform coefficients scanned before the current transform coefficient among transform coefficients included in the lowermost row in the scan area. is_last_y 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 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[blkpos]를 획득할 수 있다.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), an effective transform coefficient flag sig_flag[blkpos] for a transform coefficient currently decoded from the bitstream may be obtained.

비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그 sig_flag가 1인 경우에 현재 변환 계수의 x축 방향의 좌표 값 sx이 srX와 같다면(sx==srX), is_last_x를 1로 설정하고, 현재 변환 계수의 y축 방향의 좌표 값 sy이 srY와 같다면(sy==srY), is_last_y를 1로 설정할 수 있다.The video decoding apparatus 100 sets is_last_x to 1 if the coordinate value sx of the current transform coefficient in the x-axis direction is equal to srX (sx==srX) when the effective transform coefficient flag sig_flag of the current transform coefficient is 1, and , If the coordinate value sy of the current transform coefficient in the y-axis direction 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는 정방향의 스캔 순서상 계수 그룹 내 최초 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다.Also, when lastSigScanPos is -1 (ie, an initial value), the video decoding apparatus 100 may determine lastSigScanPos as n. In other words, lastSigScanPos is an index indicating the position of the last effective transform coefficient in the coefficient group in the forward scan order because the index n indicating the location of the first effective transform coefficient in the coefficient group is determined as lastSigScanPos. It could 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, so the operation is finally performed on the 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 exists in the coefficient group 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 1. That is, cnt_nz representing the number of coefficients having a non-zero value in the current block (or scan area) is updated whenever the current transform coefficient is an effective 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] representing the number of coefficients having a non-zero value in the current coefficient group i is updated whenever the current transform coefficient is an effective 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 관련 동작)을 수행할 수 있다.When i is the last coefficient group (i==lastSet), the video decoding apparatus 100 determines n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is determined as 15, and n is 0. If it is greater than or equal to, i may be decreased by 1 and an operation included in the for statement 915 may be performed. The video decoding apparatus 100 may perform operations (operations related to coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag) included in the for statement 915 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine the position blkpos of the current transform coefficient as a value obtained by adding n to the 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 the absolute value abs_coef for the current transform coefficient based on information on 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[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 transforms the transform coefficient having an absolute value greater than 1 among transform coefficients included in previously scanned coefficient groups. The sum of the number of coefficients cnt_g1 and the number of transform coefficients c1 that obtains coeff_abs_level_greater1_flag from the bitstream among the previously scanned transform coefficients in the current coefficient group is obtained from the bitstream among the transform coefficients whose absolute value is greater than 1 (coeff_abs_level_greater_flag) If it is less than num_gt1, which is the maximum number of transform coefficients that can be performed, the video decoding apparatus 100 may obtain 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 a 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. If the flag gt1_flag of the current transform coefficient is 1, the value of c1 increases by 1 and the value of c1 is updated. Therefore, when the for statement () operation is performed on the next transform coefficients, c1 is the current coefficient. It may represent the number of transform coefficients obtained by obtaining coeff_abs_level_greater1_flag from a bitstream among transform coefficients previously scanned in the group.

비디오 복호화 장치(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 includes a transform coefficient whose absolute value is greater than 2 among transform coefficients in previously scanned coefficient groups. The sum of the number cnt_g2 and the number of transform coefficients that have obtained coeff_abs_level_greater2_flag from the previously scanned bitstream in the current coefficient group is the sum of the 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 number is less than the maximum number 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 flag by 1. If the flag gt2_flag of the current transform coefficient is 1, the value of c2 increases by 1 and the value of c2 is updated. Therefore, when the for statement () operation is performed on the next transform coefficients, c2 is the current coefficient. It may represent the number of transform coefficients obtained by obtaining coeff_abs_level_greater1_flag from a bitstream among transform coefficients previously scanned in the group.

또한, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다. escapeDataPresent는 현재 변환 그룹 내 변환 계수의 값을 결정하기 위해 추가로 획득해야 하는 정보(예를 들어, 잔여 레벨 절대값 정보 coeff_abs_level_remaining)가 있음을 나타내는 정보일 수 있다.In addition, the video decoding apparatus 100 may determine escapeDataPresent as 1. The escapeDataPresent may be information indicating that there is additionally acquired information (eg, residual level absolute value information coeff_abs_level_remaining) 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 includes a transform coefficient whose absolute value is greater than 2 among transform coefficients in previously scanned coefficient groups. The sum of the number cnt_g2 and the number of transform coefficients that have obtained coeff_abs_level_greater2_flag from the previously scanned bitstream in the current coefficient group is the sum of the 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 less 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 having an absolute value greater than 1 among transform coefficients included in previously scanned coefficient groups, and a bitstream among transform coefficients previously scanned in the current coefficient group. If the sum of the number c1 of the transform coefficients that have obtained 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 determine 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 관련 동작)을 수행할 수 있다. When the escapeDataPresent is 1, when i represents the last coefficient group (i==lastSet), the video decoding apparatus 100 determines n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is 15 And, if n is greater than or equal to 0, i is decreased by 1, and the operation included in the for statement 920 may be performed. The video decoding apparatus 100 may perform an operation (coeff_abs_level_reamining related operation) included in the for statement 920 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보(setPos)에 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine the position blkpos of the current transform coefficient as a value obtained by adding n to the 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. The number of transform coefficients whose absolute values are greater than 1 among transform coefficients scanned before the current transform coefficient in the current coefficient group cnt_gt1 can acquire coeff_abs_level_greater_flag from the bitstream among transform coefficients whose absolute value is greater than 2 If the maximum number of existing transform coefficients is less than num_gt1, the number of transform coefficients whose absolute values are greater than 2 among transform coefficients scanned before the current transform coefficient in the current coefficient group cnt_gt2 is a transform whose absolute value is greater than 2 If among the coefficients, the maximum number of transform coefficients capable of obtaining coeff_abs_level_greater_flag from the bitstream is smaller 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 the bitstream, if cnt_gt2 is smaller than num_gt2, the video decoding apparatus 100 may determine the base level as 2. When cnt_gt1 is not less 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 as a value obtained by adding 1 to the value obtained by adding the value of gt1flag and the value of gt2flag to 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 the 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 value 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, if i represents the last coefficient group (i==lastSet), n is determined as lastScanPos minus setPos (lastScanPos-setPos), and if not, n is determined as 15, and n is 0. If it is greater than or equal to, i may be decreased by 1 and the operation included in the for statement 925 may be performed. The video decoding apparatus 100 may perform an operation (an abs_coef related operation) included in the for statement 925 until a value less than 0 is reached. In the ScanOrder array, it may be determined as a value obtained by adding n to index information (setPos) indicating the position of the first coefficient in the current coefficient group.

비디오 복호화 장치(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. When 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 may be increased by 1.

비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 스캔되는 현재 계수 그룹 i 내 마지막 유효 변환 계수의 위치 lastSigScanPos와 첫번째 유효 변환 계수의 위치 firstSigScanPos의 차이가 3보다 큰 경우, 현재 계수 그룹 i 내 적어도 하나의 부호가 숨겨져 있음을 나타내는 signHidden의 값(signHidden[i])을 1로 결정할 수 있다. 비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 스캔되는 현재 계수 그룹 내 마지막 유효 변환 계수의 위치 lastSigScanPos와 첫번째 유효 변환 계수의 위치 firstSigScanPos의 차이가 3보다 크지 않은 경우, 현재 계수 그룹 i 내 적어도 하나의 부호가 숨겨져 있음을 나타내는 signHidden의 값(signHidden[i])을 0으로 결정할 수 있다.When the difference between the position of the last effective transform coefficient lastSigScanPos and the position of the first effective transform coefficient firstSigScanPos in the current coefficient group i scanned according to the forward scan order is greater than 3, at least one in the current coefficient group i A value of signHidden (signHidden[i]) indicating that the sign of is hidden may be determined as 1. When the difference between the position of the last effective transform coefficient lastSigScanPos and the position of the first effective transform coefficient firstSigScanPos in the current coefficient group scanned according to the forward scan order is not greater than 3, at least one in the current coefficient group i A value of signHidden (signHidden[i]) indicating that the sign of is hidden may 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 for statement 930. The video decoding apparatus 100 may perform an operation included in the for statement 930 until i becomes a value greater than lateSet. In this case, i may be an index indicating a coefficient group. That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time an operation included in the repetition statement (for statement) 930 is performed once.

만약 rsp(residual sign prediction)가 적용되는 경우라면(rsp_apply), If rsp (residual sign prediction) 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)에 포함된 동작을 수행할 수 있다.When i is the last coefficient group (i==lastSet), the video decoding apparatus 100 determines n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), and if not, n is determined as 15, and n is 0. If it is greater than or equal to, i may be decreased by 1 and the operation included in the for statement 935 may be performed. The video decoding apparatus 100 may perform an operation included in the for statement 935 until a value less than 0 is reached.

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

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

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

비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치 blkpos가 rsp_pos인 경우, 비트스트림으로부터 현재 복호화되는 변환 계수의 rsp 부호에 관한 정보(sign_rsp[blkpos])를 획득할 수 있다.When the location 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 currently decoded transform coefficient 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 n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos) when i is the last coefficient group (i==lastSet), and if not, n is 15 And, if n is greater than or equal to 0, i is decreased by 1, and the operation included in the for statement 940 may be performed. The video decoding apparatus 100 may perform an operation included in the for statement 940 until a value less than 0 is reached.

비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos)를 정방향의 스캔 순서에 따른 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보 setPos에 현재 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine the location of the current transform coefficient blkpos as a value obtained by adding the current n to the index information setPos indicating the location 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 hiding the sign data is activated is 0, there is no hidden sign for the current group (!signHidden[i]), or the forward direction When the position of the current transform coefficient in the current coefficient group in the scan order is not the position of the first effective 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.

도 9b 내지 도 9f를 참조하면, 비디오 복호화 장치(100)는 변환 계수를 복원하기 위해 변환 계수에 관한 신택스 엘리먼트 정보를 스캔하고, 스캔된 신택스 엘리먼트 정보를 기초로 변환 계수를 복호화할 수 있다.9B to 9F, the video decoding apparatus 100 may scan syntax element information about a transform coefficient to restore 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 indicating coordinates for specifying a scan area from a bitstream. At this time, the syntax element information last_sig_coeff_x may represent the value of the horizontal coordinate (x-axis direction) of the last effective transform coefficient in the forward scan order based on the upper left corner coordinate of the current block, and the syntax element information last_sig_coeff_y may represent a value of a vertical coordinate (y-axis direction) of an effective transform coefficient positioned at the end of a current block according to a scan order in a 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 the scan area based on the 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 a position lastScanPos of the last effective transform coefficient to 16 according to a scan order in the forward direction within the subblock. The video decoding apparatus 100 may initialize a lastSubBlock indicating a sub-block in which the last effective transform coefficient is located according to a forward scan order in the sub-block. In this case, the initialized value may indicate a subblock positioned at the last among subblocks of the current block scanned according to the scan order in the forward direction. That is, the lastSubBlock may be initialized to a value indicating the last sub-block among sub-blocks scanned according to the scan order in the forward direction 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) 내 동작을 더 이상 수행하지 않을 수 있다.When the horizontal position xC of the current coefficient is not LastSigcoeffX or the vertical position yC of the current coefficient is not LastSigcoeffY, the video decoding apparatus 100 performs an operation within the Do-while loop statement 950, and xC is If it is LastSigcoeffX, and the vertical position yC of the current coefficient is LastSigcoeffY, the operation within 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 lastScanPos is 0, the video decoding apparatus 100 may determine lastScanPos as 16 and decrease the lastSubblock by 1. In other words, 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. You can decrease the lastSubblock by 1. The video decoding apparatus 100 may scan transform coefficients in the current subblock lastSubblock according to the reverse scan order while decreasing lastScanPos by 1.

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

비디오 복호화 장치(100)는 현재 변환 계수의 수직방향의 위치 yC가 LastSigcoeffY인 경우에 do-while 루프문(950) 내 동작을 더 이상 수행하지 않게 되므로, do-while 루프문(950)을 통해 결정된 lastScanPos는 정방향의 스캔 순서에 따라 스캔되는 현재 블록 내 마지막 유효 변환 계수가 포함된 서브 블록 내 마지막 유효 변환 계수의 위치를 나타내는 인덱스 정보일 수 있고, lastSubBlock은 현재 블록 내 마지막 유효 변환 계수가 위치하는 서브 블록을 나타내는 인덱스 정보일 수 있다.Since the video decoding device 100 no longer performs the operation within the do-while loop statement 950 when the vertical position yC of the current transform coefficient is LastSigcoeffY, it is determined through the do-while loop statement 950. lastScanPos may be index information indicating the position of the last effective transform coefficient in the sub-block including the last effective transform coefficient in the current block scanned according to the forward scan order, and lastSubBlock is the sub where the last effective 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 as lastSubBlock, decrease i by 1 when i is greater than 0, and perform an operation included in the for statement 960. The video decoding apparatus 100 may perform an operation included in the for statement 960 until a value less than 0 is reached. In this case, i may be an index indicating a coefficient group. That is, the video decoding apparatus 100 may perform an operation for one sub-block each time an operation included in the for statement 960 is performed once.

비디오 복호화 장치(100)는 현재 서브 블록의 수평방향 위치 xS및 수직방향 위치 yS를 결정할 수 있다. The video decoding apparatus 100 may determine a horizontal position xS and a 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 that i, which represents the current sub-block, indicates a sub-block having a value smaller than the value (lastSubBlock) representing a sub-block in which the last effective transform coefficient is located, or represents a sub-block including a DC coefficient. When a subblock having a value greater than the value (0) is indicated, coded_sub_block_flag[xS][yS] for the current subblock i may be obtained. coded_sub_block_flag[xS][yS] may be flag information indicating whether at least one effective transform coefficient in the current subblock i is included.

비디오 복호화 장치(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 subblock is a subblock including the last effective transform coefficient (lastSubBlock), otherwise it initializes to 15, and n is greater than or equal to 0. In case n is reduced by 1, the operation included in the loop (for statement)() can be performed. The video decoding apparatus 100 may perform the operation included in the 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 an operation included in the for statement () is performed once. That is, the video decoding apparatus 100 may perform an operation (operation related to sig_coeff_flag) on one sub-block whenever an operation included in the repetition statement (for statement) 960 is performed once.

비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 yC를 결정할 수 있다.The video decoding apparatus 100 may determine 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 the coded_sub_block_flag[xS][yS] for the current subblock is 1 and n is greater than 0 or inferSbDcSigCoeffFlag is 0, the video decoding apparatus 100 bit the flag sig_coeff_flag[xC][yC] for the current transform coefficient. It can be obtained from the stream. sig_coeff_flag[xC][yC] may be a flag indicating whether the current transform coefficient is an effective transform coefficient.

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

비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 현재 서브 블록 내 첫번째로 스캔되는 변환 계수의 위치 firstScanPos의 값을 초기화하고, 정방향의 스캔 순서에 따라 현재 서브 블록 내 마지막으로 스캔되는 변환 계수의 위치 lastSigScanPos의 값을 초기화할 수 있다. 비디오 복호화 장치(100)는 Greater1Flag의 개수를 나타내는 numGreater1Flag의 값을 초기화하고, 정방향의 스캔 순서에 따라 Greater1Flag이 획득되는 마지막 위치 lastGreater1ScanPos의 값을 초기화할 수 있다.The video decoding apparatus 100 initializes the position of the transform coefficient firstScanPos that is first scanned in the current sub-block according to the forward scan order, and the position of the transform coefficient that is last scanned in the current sub-block according to the forward scan order. You can initialize the value of lastSigScanPos. The video decoding apparatus 100 may initialize a value of numGreater1Flag indicating the number of Greater1Flags, and initialize a value of lastGreater1ScanPos at a last location where Greater1Flag is obtained 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 an operation in the loop (for statement) 965 until n is less than 0.

비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 Yc를 결정할 수 있다.The video decoding apparatus 100 may determine 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]d에 기초하여 Greater1Flag[n]을 결정할 수 있다.When the effective transform coefficient flag sig_coeff_flag for the current transform coefficient is 1, the video decoding apparatus 100 acquires coeff_level_greater1_flag[n] for the current transform coefficient n when numGreater1Flag is less than 8, and increases the value of numGreater1Flag by 1 I can make 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]d.

비디오 복호화 장치(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 an initial value, the video decoding apparatus 100 may determine lastGreater1ScanPos as the position n of the current transform coefficient in the current subblock. Accordingly, lastGreater1ScanPos may be index information indicating a position of a coefficient having a value of coeff_abs_level_greater_flag located last in the current subblock according to the forward scan order. Otherwise (not the case where the value of coeff_abs_level_greater1_flag for the current transform coefficient is 1 and the value of lastreater1ScanPos is 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 lastSigScanPos indicating the position of the last effective transform coefficient in the current sub-block according to the forward scan order has an initial value. .

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

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

만약 정방향의 스캔 순서에 따라 스캔된 비트스트림으로부터 획득된 변환 계수에 대한 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 position of the transform coefficient at which the last coeff_abs_level_greater1_flag is obtained among coeff_abs_level_greater1_flag (Greater1Flag) for the transform coefficients obtained from the bitstream scanned according to the forward scan order, lastGreater1ScanPos is not an initial value (ie, at least one Greater1Flag from the bitstream). Is acquired in the current sub-block), the video decoding apparatus 100 may obtain a flag coeff_abs_level_greater2_flag[lastGreater1ScanPos] for a transform coefficient at the position of lastGreater1ScanPos 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 at the lastGreater1ScanPos position is 1, the video decoding apparatus 100 may determine the 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 transform coefficients scanned before the current transform coefficient according to the scan order in the reverse direction.

비디오 복호화 장치(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, and performs an operation within the for statement 970, and when n is less than 0, the for statement 970 ) I may no longer perform my actions. The video decoding apparatus 100 may perform an operation of scanning information on transform coefficients in a current subblock 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 coefficient based on the position n of the current transform coefficient in the current sub-block.

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

만약 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, and the base level is 3, the video decoding apparatus 100 obtains residual level 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, and the base level is 2, the video decoding apparatus 100 provides information on residual level values for the current transform coefficient n from the bitstream coeff_abs_level_remaining[n ] Can be obtained. If numSigCoeff is greater than 8, if the base level is 1, the video decoding apparatus 100 may obtain residual level 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 TransCoeffLevel[x0][y0][cIdx][xC][yC], which is the level value of the current transform coefficient in the current block by summing the base level for the current transform coefficient and the residual level value for the current transform coefficient. Can be determined. 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 for statement 975 may be performed. In this case, i may be an index indicating a sub-block. That is, the video decoding apparatus 100 may perform an operation for one coefficient group each time the syntax in the for statement 975 is executed once.

만약 현재 서브 블록 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 subblock 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 it is the same, an operation within 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 a horizontal position and a 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 the position blkpos of the current transform coefficient based on xC and yC.

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

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

비디오 복호화 장치(100)는 현재 변환 계수의 위치가 rsp_pos인 경우, 비트스트림으로부터 현재 변환 계수의 rsp 부호에 관한 정보 sign_rsp[xC][yC]를 획득할 수 있다.When the location 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 as 15, and if n is greater than 0, performs the operation in the for statement 985, and decreases n by 1, and then n is greater than 0. If it is greater than or equal to, the operation of the for statement 985 may be performed again, and if n is less than 0, the operation within the for statement 985 may no longer be performed.

비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 대응하는 현재 변환 계수의 수평방향 위치 및 수직방향의 위치 xC 및 yC를 결정할 수 있다. 비디오 복호화 장치(100)는 xC 및 yC에 기초하여 현재 변환 계수의 위치(blkpos)를 결정할 수 있다.The video decoding apparatus 100 may determine a horizontal position and a 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 the 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 value of the flag sign_data_hiding_enabled_flag indicating whether hiding the sign data is enabled is 0, or there is no hidden sign for the current sub-block (!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 effective transform coefficient firstSigScanPos is not 0, the sign information sign[xC][yC] of the current transform coefficient from the bitstream is obtained. Can be obtained.

이하, 도 10 내지 도 23을 참조하여 일 실시예에 따른 비디오 복호화 장치(100)가 영상을 복호화하는 과정에서 이용할 수 있는 데이터 단위를 결정하는 방법을 설명하도록 한다. 비디오 부호화 장치(150)의 동작은 후술하는 비디오 복호화 장치(100)의 동작에 대한 다양한 실시예와 유사하거나 반대되는 동작이 될 수 있다.Hereinafter, a method of determining a data unit that can be used in a process of decoding an image by the video decoding apparatus 100 according to an exemplary embodiment will be described with reference to FIGS. 10 to 23. The operation of the video encoding apparatus 150 may be an operation similar or opposite to that of various embodiments of the operation of the video decoding apparatus 100 to be 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 type information, and may determine in what type a coding unit is divided using the split type information. That is, a method of dividing a coding unit indicated by the division type information may be determined according to which 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 type information indicating that a current coding unit is a square shape. For example, the video decoding apparatus 100 may determine whether to split a square coding unit, split it vertically, split it horizontally, split it into four coding units, or the like according to split type information. Referring to FIG. 10, when block shape information of the current coding unit 1000 indicates a square shape, the video decoding apparatus 100 has the same size as the current coding unit 1000 according to split type information indicating that the division is not divided. The coding unit 1010a having a is not split, or split coding units 1010b, 1010c, 1010d, etc. may be determined based on split type information indicating a predetermined splitting method.

도 10을 참조하면 비디오 복호화 장치(100)는 일 실시예에 따라 수직방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향으로 분할한 두개의 부호화 단위(1010b)를 결정할 수 있다. 비디오 복호화 장치(100)는 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수평방향으로 분할한 두개의 부호화 단위(1010c)를 결정할 수 있다. 비디오 복호화 장치(100)는 수직방향 및 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향 및 수평방향으로 분할한 네개의 부호화 단위(1010d)를 결정할 수 있다. 다만 정사각형의 부호화 단위가 분할될 수 있는 분할 형태는 상술한 형태로 한정하여 해석되어서는 안되고, 분할 형태 정보가 나타낼 수 있는 다양한 형태가 포함될 수 있다. 정사각형의 부호화 단위가 분할되는 소정의 분할 형태들은 이하에서 다양한 실시예를 통해 구체적으로 설명하도록 한다. Referring to FIG. 10, according to an exemplary embodiment, the video decoding apparatus 100 determines two coding units 1010b obtained by vertically splitting the current coding unit 1000 based on split type information indicating vertical splitting. I can. The video decoding apparatus 100 may determine two coding units 1010c obtained by splitting the current coding unit 1000 in the horizontal direction based on split type information indicating splitting in the horizontal direction. The video decoding apparatus 100 may determine four coding units 1010d obtained by splitting the current coding unit 1000 vertically and horizontally based on split type information indicating splitting in the vertical and horizontal directions. However, the split form in which the square coding unit can be split is limited to the above-described form and should not be interpreted, and various forms that can be represented by split form information may be included. Predetermined splitting forms in which the square coding unit is split 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 splitting coding units 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 type information indicating that a current coding unit is a non-square type. The video decoding apparatus 100 may determine whether to split the non-square current coding unit or split it by a predetermined method according to the split type information. Referring to FIG. 11, when block type information of a current coding unit 1100 or 1150 indicates a non-square type, the video decoding apparatus 100 may display the current coding unit 1100 according to split type information indicating that the current coding unit 1100 or 1150 is not divided. Alternatively, coding units 1110 or 1160 having the same size as 1150) are not split, or coding units 1120a, 1120b, 1130a, 1130b, 1130c, 1170a, which are split based on split type information indicating a predetermined splitting method. 1170b, 1180a, 1180b, 1180c) may be determined. A predetermined splitting method in which a non-square coding unit is split 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 using split form information, and in this case, the split form information indicates the number of at least one coding unit generated by splitting the coding unit. Can be indicated. Referring to FIG. 11, when split type information indicates that a current coding unit (1100 or 1150) is split into two coding units, the video decoding apparatus 100 includes a current coding unit (1100 or 1150) based on split type information. The two coding units 1120a and 11420b or 1170a and 1170b included in the current coding unit may be determined by dividing.

일 실시예에 따라 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 비-정사각형의 형태의 현재 부호화 단위(1100 또는 1150)를 분할하는 경우, 비-정사각형의 현재 부호화 단위(1100 또는 1150)의 긴 변의 위치를 고려하여 현재 부호화 단위를 분할할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)의 형태를 고려하여 현재 부호화 단위(1100 또는 1150)의 긴 변을 분할하는 방향으로 현재 부호화 단위(1100 또는 1150)를 분할하여 복수개의 부호화 단위를 결정할 수 있다. According to an embodiment, when the video decoding apparatus 100 splits a non-square type of current coding unit (1100 or 1150) based on the split type information, a non-square type of current coding unit (1100 or 1150) is The current coding unit may be split in consideration of the position of the long side. For example, the video decoding apparatus 100 splits the current coding unit 1100 or 1150 in a direction for dividing the long side of the current coding unit 1100 or 1150 in consideration of the shape of the current coding unit 1100 or 1150 Thus, a plurality of coding units may 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 coding units are split into odd blocks, the video decoding apparatus 100 may determine an 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 converts the current coding unit (1100 or 1150) into 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 sizes of the determined coding units may not be the same. 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, 1180c) is different from other coding units (1130a, 1130c, 1180a, 1180c) You can also have That is, a coding unit that can be determined by splitting 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 May each 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 coding units are split into odd blocks, the video decoding apparatus 100 may determine an 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 limit 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 located at the center of three coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c generated by splitting a current coding unit 1100 or 1150. A decoding process for (1130b, 1180b) may be different from other coding units (1130a, 1130c, 1180a, 1180c). For example, unlike other coding units 1130a, 1130c, 1180a, 1180c, the video decoding apparatus 100 limits the coding units 1130b and 1180b located at the center so that they are not further divided, or limited to a predetermined number of times. Can be restricted to be divided.

도 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 square-shaped first coding unit 1200 is split into coding units or not split based on at least one of block type information and split type 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 to obtain a second coding unit. (1210) can be determined. A first coding unit, a second coding unit, and a third coding unit used according to an embodiment are terms used to understand a relationship before and after splitting between coding units. For example, when the first coding unit is split, a second coding unit may be determined, and when the second coding unit is split, a third coding unit may be determined. Hereinafter, it may be understood that the relationship between the used first coding unit, the second coding unit, and the third coding unit follows the above-described characteristics.

일 실시예에 따라 비디오 복호화 장치(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 into coding units or not split based on at least one of block type information and split type information. Referring to FIG. 12, the video decoding apparatus 100 divides the first coding unit 1200 based on at least one of block type information and split type information to determine a non-square type second coding unit 1210. It may be split into at least one third coding unit 1220a, 1220b, 1220c, 1220d, etc., or the second coding unit 1210 may not be split. The video decoding apparatus 100 may obtain at least one of block type information and split type information, and the video decoding apparatus 100 may obtain a first coding unit 1200 based on at least one of the obtained block type information and split type information. ) Can be divided into a plurality of second coding units (eg, 1210) of various types, and the second coding unit 1210 is a first coding based on at least one of block type information and split type information The unit 1200 may be divided according to the division method. According to an embodiment, when the first coding unit 1200 is split 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 third coding units (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 units may be recursively split 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, among odd-numbered third coding units 1220b, 1220c, 1220d) determined by splitting a second coding unit 1210 in a non-square shape Coding units or square-shaped coding units) may be recursively divided. According to an embodiment, a square-shaped third coding unit 1220c, which is one of the odd number of third coding units 1220b, 1220c, and 1220d, may be split in a horizontal direction and split 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 having a non-square shape may be divided into odd number of coding units 1250a, 1250b, and 1250c.

부호화 단위의 재귀적 분할에 이용될 수 있는 방법에 대하여는 다양한 실시예를 통해 후술하도록 한다.A method that can be used for recursive splitting 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, 1220d, etc. into coding units based on at least one of block type information and split type information, or second encoding It can be determined that the unit 1210 is not divided. The video decoding apparatus 100 may split the second coding unit 1210 of a non-square shape into odd number of third coding units 1220b, 1220c, and 1220d according to an embodiment. The video decoding apparatus 100 may place a predetermined limit 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 should be limited to a coding unit 1220c positioned in the middle of the odd number of third coding units 1220b, 1220c, and 1220d, or divided by a settable number of times. It can be limited to what you do. Referring to FIG. 12, the video decoding apparatus 100 includes an odd number of third coding units 1220b, 1220c, and 1220d included in the second coding unit 1210 of a non-square type. 1220c) is not further divided or is divided into a predetermined division (for example, divided into four coding units or divided into a shape corresponding to the divided second coding unit 1210), or a predetermined It can be limited to dividing only by the number of times (for example, dividing only n times, n>0). However, since the limitation on the central coding unit 1220c is merely exemplary embodiments, it is limited to the above-described exemplary embodiments and should not be interpreted, and the central coding unit 1220c is different from the other coding units 1220b and 1220d. It should be interpreted as including various restrictions that can be decrypted differently from ).

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하기 위해 이용되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 현재 부호화 단위 내의 소정의 위치에서 획득할 수 있다. According to an embodiment, the video decoding apparatus 100 may obtain at least one of block type information and split type information used to divide a current coding unit at a predetermined position 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 among a plurality of samples included in the current coding unit 1300 (eg, It may be obtained in 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 It should be construed that various locations that may be included within (eg, top, bottom, left, right, top left, bottom left, top right or bottom right, etc.) can be included. The video decoding apparatus 100 may determine that the current coding unit is divided into coding units of various types and sizes or not divided by obtaining at least one of block type information and split type information obtained from a predetermined location.

일 실시예에 따라 비디오 복호화 장치(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 of the coding units. Methods for selecting one of a plurality of coding units may be various, and a description of these methods will be described later through various embodiments below.

일 실시예에 따라 비디오 복호화 장치(100) 는 현재 부호화 단위를 복수개의 부호화 단위들로 분할하고, 소정 위치의 부호화 단위를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may divide a 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 at 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 a 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 odd number of coding units 1320a, 1320b, and 1320c by dividing a current coding unit 1300. The video decoding apparatus 100 may determine a central coding unit 1320b by using information on the positions of the odd number of coding units 1320a, 1320b, and 1320c. For example, the video decoding apparatus 100 determines the location 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 positioned at may be determined. In more detail, the video decoding apparatus 100 includes the coding units 1320a, 1320b, and 1320c 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. By determining the position, the coding unit 1320b positioned in the center may 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 position of the upper left sample 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c, respectively, is the position in the picture of the coding units 1320a, 1320b, and 1320c. Alternatively, it may include information about coordinates. According to an embodiment, information indicating the location of the upper left sample 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c, respectively, is the coding units 1320a and 1320b included in the current coding unit 1300. , 1320c) may include information indicating the width or height, and the width or height may correspond to information indicating a difference between coordinates within a picture of the coding units 1320a, 1320b, and 1320c. That is, the video decoding apparatus 100 directly uses information on a position or coordinates within a picture of the coding units 1320a, 1320b, and 1320c, or provides information on a width or height of a coding unit corresponding to a difference value between coordinates. By using it, the coding unit 1320b positioned in the center may 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, information indicating the position of the upper left sample 1330a of the upper coding unit 1320a may represent (xa, ya) coordinates, and the upper left sample 1330b of the center coding unit 1320b Information indicating the location of) may indicate (xb, yb) coordinates, and information indicating the location of the upper left sample 1330c of the lower coding unit 1320c may indicate (xc, yc) coordinates. The video decoding apparatus 100 may determine the middle coding unit 1320b by using coordinates of the upper left samples 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c, respectively. For example, when the coordinates of the upper left samples 1330a, 1330b, and 1330c are arranged in ascending or descending order, the coding unit 1320b including (xb, yb), which is the coordinates of the sample 1330b located in the middle, is May be determined as a coding unit positioned at the center of the coding units 1320a, 1320b, and 1320c determined by splitting the current coding unit 1300. However, the coordinates indicating the position of the upper left samples 1330a, 1330b, 1330c may indicate the coordinates indicating the absolute position in the picture, and furthermore, 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 upper left sample 1330b of the center coding unit 1320b, indicating the relative position of the upper left sample 1330c of the lower coding unit 1320c Information (dxc, dyc) coordinates can also be used. In addition, as information indicating the location of a sample included in the coding unit, the method of determining the coding unit of a predetermined location by using the coordinates of the sample should not be interpreted limited to the above-described method. Should be interpreted in a way.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위(1300)를 복수개의 부호화 단위(1320a, 1320b, 1320c)로 분할할 수 있고, 부호화 단위(1320a, 1320b, 1320c)들 중 소정의 기준에 따라 부호화 단위를 선택할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c) 중 크기가 다른 부호화 단위(1320b)를 선택할 수 있다.According to an embodiment, the video decoding apparatus 100 may split the current coding unit 1300 into a plurality of coding units 1320a, 1320b, and 1320c, and a predetermined criterion among coding units 1320a, 1320b, and 1320c The coding unit may be selected according to the following. 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 includes (xa, ya) coordinates, which is information indicating the location of the upper left sample 1330a of the upper coding unit 1320a, and the upper left sample of the center coding unit 1320b. The coding unit 1320a, using (xb, yb) coordinates, which is information indicating the position of (1330b), and (xc, yc) coordinates, which are information indicating the position of the upper left sample 1330c of the lower coding unit 1320c. 1320b, 1320c) Each width or height may be determined. The video decoding apparatus 100 uses (xa, ya), (xb, yb), and (xc, yc) which are coordinates representing the positions of the coding units 1320a, 1320b, and 1320c. ) You can decide the size of each.

일 실시예에 따라, 비디오 복호화 장치(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 center 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 center coding unit 1320b. . The video decoding apparatus 100 may determine a coding unit having a size different from other coding units based on the determined width and height of the 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 the size of the upper coding unit 1320a and the lower coding unit 1320c as the coding unit at a predetermined position. However, in the above-described process of determining a coding unit having a size different from other coding units, the video decoding apparatus 100 determines a coding unit at a predetermined location by using a size of a coding unit determined based on sample coordinates. Therefore, various processes of determining a coding unit at a predetermined location by comparing sizes of coding units determined according to predetermined sample coordinates may be used.

다만 부호화 단위의 위치를 결정하기 위하여 고려하는 샘플의 위치는 상술한 좌측 상단으로 한정하여 해석되어서는 안되고 부호화 단위에 포함되는 임의의 샘플의 위치에 대한 정보가 이용될 수 있는 것으로 해석될 수 있다. However, the location of the sample considered to determine the location of the coding unit should not be interpreted by being limited to the upper left corner described above, and it may be interpreted that information on the location of an arbitrary 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 from among odd number of coding units determined by splitting the current coding unit in consideration of a shape of a current coding unit. For example, if the current coding unit has a non-square shape whose width is longer than the height, the video decoding apparatus 100 may determine the coding unit at a predetermined position according to the horizontal direction. That is, the video decoding apparatus 100 may determine one of coding units having different positions in the horizontal direction and place restrictions on the corresponding coding unit. If the current coding unit has a non-square shape whose height is longer than the width, the video decoding apparatus 100 may determine a coding unit at a predetermined position according to the vertical direction. That is, the video decoding apparatus 100 may determine one of coding units that have 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 a position of each of the even number of coding units to determine a coding unit of a predetermined position among even number of coding units. The video decoding apparatus 100 may determine an even number of coding units by dividing the current coding unit, and may determine a coding unit at a predetermined position by using information on positions of the even number of coding units. A detailed process for this may be a process corresponding to a process of determining a coding unit at a predetermined location (eg, a center location) among the odd numbered coding units described above in FIG. 13, and thus will be omitted.

일 실시예에 따라, 비-정사각형 형태의 현재 부호화 단위를 복수개의 부호화 단위로 분할한 경우, 복수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여 분할 과정에서 소정 위치의 부호화 단위에 대한 소정의 정보를 이용할 수 있다. 예를 들면 비디오 복호화 장치(100)는 현재 부호화 단위가 복수개로 분할된 부호화 단위들 중 가운데에 위치하는 부호화 단위를 결정하기 위하여 분할 과정에서 가운데 부호화 단위에 포함된 샘플에 저장된 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. According to an embodiment, when a current coding unit in a non-square shape is divided into a plurality of coding units, a predetermined coding unit at a predetermined position is determined during the splitting process to determine a coding unit at a predetermined position among the plurality of coding units. Information of is available. For example, the video decoding apparatus 100 may determine the block type information and the split type stored in a sample included in the middle coding unit during the splitting process in order to determine a coding unit located in the middle of the coding units divided into a plurality of the current coding unit. 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 split a 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 middle of the plurality of coding units 1320a, 1320b, and 1320c may be determined. Furthermore, the video decoding apparatus 100 may determine a coding unit 1320b positioned at the center in consideration of a position at which at least one of block type information and split type information is obtained. 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, the coding unit 1320b including the sample 1340 is used as a coding unit positioned at the center. You can decide. However, the information used to determine the centered coding unit should not be interpreted as being limited to at least one of block type information and split type information, and various types of information will be used in the process of determining the centered coding unit. I 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 includes coding units (eg, split into a plurality of coding units 1320a, 1320b, and 1320c) of a plurality of coding units determined by splitting the current coding unit 1300. Block type information obtained from a sample (eg, a sample located in the center of the current coding unit 1300) at a predetermined position in the current coding unit 1300 in order to determine a coding unit located in the middle of the coding units, and At least one of the division 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 shape of the current coding unit 1300, and the video decoding apparatus 100 may determine the current coding unit 1300 by splitting it. From among the plurality of coding units 1320a, 1320b, 1320c, a coding unit 1320b including a sample from which predetermined information (eg, at least one of block type information and split type information) can be obtained is determined Certain restrictions can be placed. Referring to FIG. 13, according to an embodiment, the video decoding apparatus 100 may determine a sample 1340 positioned 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 coding unit 1320b including the sample 1340 may be limited in a decoding process. However, the location of the sample from which predetermined information can be obtained should not be interpreted as being limited to the above-described location, but may be interpreted as samples at an arbitrary location included in the coding unit 1320b to be determined to impose restrictions.

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

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

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

도 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 may determine the second coding units 1410a and 1410b by vertically splitting the first coding unit 1400 according to the block type information and the split type information, or Second coding units 1450a, 1450b, 1450c, 1450d by splitting 1400 in the horizontal direction to determine second coding units 1430a and 1430b, or splitting the first coding unit 1400 in vertical and horizontal directions Can be determined.

도 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 so that the second coding units 1410a and 1410b determined by dividing the first coding unit 1400 in the vertical direction are processed in the horizontal direction 1410c. . The video decoding apparatus 100 may determine a processing order of the second coding units 1430a and 1430b determined by dividing the first coding unit 1400 in the horizontal direction as the vertical direction 1430c. After the video decoding apparatus 100 divides the first coding unit 1400 in the vertical and horizontal directions, the second coding units 1450a, 1450b, 1450c, and 1450d determined by processing the coding units located in one row are processed. The coding units located in the next row may be determined according to a predetermined order (eg, 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 split coding units. Referring to FIG. 14, the video decoding apparatus 100 may divide the first coding unit 1400 to determine a plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d, and Each of the determined 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 correspond 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 second coding units 1410a and 1410b by dividing the first coding unit 1400 in a vertical direction, and further, each of the second coding units 1410a and 1410b. It can be decided to divide independently or not to divide.

일 실시예에 따라 비디오 복호화 장치(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 in a horizontal direction and split it into third coding units 1420a and 1420b, and the second coding unit 1410b on the right side. ) May not be divided.

일 실시예에 따라 부호화 단위들의 처리 순서는 부호화 단위의 분할 과정에 기초하여 결정될 수 있다. 다시 말해, 분할된 부호화 단위들의 처리 순서는 분할되기 직전의 부호화 단위들의 처리 순서에 기초하여 결정될 수 있다. 비디오 복호화 장치(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, the processing order of coding units may be determined based on a splitting process of the 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 divided. The video decoding apparatus 100 may independently determine an order in which the third coding units 1420a and 1420b determined by splitting the second coding unit 1410a on the left side are processed, independently from the second coding unit 1410b on the right side. Since the second coding unit 1410a on the left 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. In addition, since the order in which the left second coding unit 1410a and the right second coding unit 1410b are processed corresponds to the horizontal direction 1410c, the third coding unit included in the left second coding unit 1410a After the 1420a and 1420b are processed in the vertical direction 1420c, the right coding unit 1410b may be processed. Since the above description is for explaining a process in which the processing order of coding units is determined according to the coding unit before division, each coding unit should not be interpreted as being limited to the above-described embodiment, and coding units determined by being divided into various forms It should be construed as being used in a variety of ways that can be processed independently in sequence.

도 15는 일 실시예에 따라 비디오 복호화 장치(100)가 소정의 순서로 부호화 단위가 처리될 수 없는 경우, 현재 부호화 단위가 홀수개의 부호화 단위로 분할되는 것임을 결정하는 과정을 도시한다.FIG. 15 illustrates a process of determining that a current coding unit is divided into odd number of coding units when 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 divided into odd number of coding units based on the obtained block type information and split type information. Referring to FIG. 15, a first coding unit 1500 having a square shape may be divided into second coding units 1510a and 1510b having a non-square shape, and the second coding units 1510a and 1510b are each independently 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 splitting a left coding unit 1510a among the second coding units in a horizontal direction, and determining a plurality of third coding units 1520a and 1520b, and the right coding unit 1510b ) May be divided into 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 or not the third coding units 1520a, 1520b, 1520c, 1520d, and 1520e can be processed in a predetermined order to determine whether there are coding units divided into odd numbers. You can decide. Referring to FIG. 15, the video decoding apparatus 100 may determine third coding units 1520a, 1520b, 1520c, 1520d, and 1520e by recursively splitting the first coding unit 1500. The video decoding apparatus 100 may include a first coding unit 1500, a second coding unit 1510a, 1510b, or a third coding unit 1520a, 1520b, 1520c, based on at least one of block type information and split type information. It may be determined whether the 1520d and 1520e) are split into odd number of coding units among the split types. For example, a coding unit positioned to the right of the second coding units 1510a and 1510b may be divided into 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 (eg, z-scan order 1530), and the video decoding apparatus ( 100) may determine whether the third coding units 1520c, 1520d, and 1520e determined by dividing the right second coding units 1510b into odd numbers satisfies a condition capable of being 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 in which the third coding units 1520a, 1520b, 1520c, 1520d, and 1520e included in the first coding unit 1500 can be processed in a predetermined order. Whether or not at least one of the widths and heights of the second coding units 1510a and 1510b is divided in half according to the boundary of the third coding units 1520a, 1520b, 1520c, 1520d, and 1520e, and 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 second coding unit 1510b on the right is 3 Since the boundary of the third coding units 1520c, 1520d, and 1520e determined by dividing into two coding units cannot split the width or height of the right second coding unit 1510b in half, the third coding unit 1520c, 1520d, 1520e) may be determined not to satisfy the condition, and the video decoding apparatus 100 determines that the scan order is disconnected when the condition is not satisfied, and based on the determination result, the right second coding unit 1510b is It may be determined to be split into odd number of coding units. According to an embodiment, when the video decoding apparatus 100 is divided into an odd number of coding units, the video decoding apparatus 100 may place a predetermined restriction on a coding unit at a predetermined position among the divided coding units. Since it has been described above through the embodiment, 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 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 divide the first coding unit 1600 based on at least one of block type information and split type information acquired through the acquirer 110. The first coding unit 1600 having a square shape may be divided into four coding units having a square shape, 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 the split type information is divided into non-square coding units, the video decoding apparatus 100 (1600) may be divided into a plurality of non-square coding units. Specifically, when the split type information indicates that an odd number of coding units is determined by splitting the first coding unit 1600 in a horizontal direction or a vertical direction, the video decoding apparatus 100 includes a first coding unit 1600 having a square shape. ) May be divided into odd-numbered coding units, divided into second coding units 1610a, 1610b, and 1610c determined by splitting in the vertical direction or second coding units 1620a, 1620b, and 1620c splitting in the horizontal direction and determined.

일 실시예에 따라 비디오 복호화 장치(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 process the second coding units 1610a, 1610b, 1610c, 1620a, 1620b, and 1620c included in the first coding unit 1600 according to a predetermined order. Is satisfied, and the condition is whether at least one of the width and height of the first coding unit 1600 is divided in half according to the boundary of the second coding units 1610a, 1610b, 1610c, 1620a, 1620b, and 1620c. It is related to whether or not. Referring to FIG. 16, the boundary of the second coding units 1610a, 1610b, and 1610c determined by dividing the square-shaped first coding unit 1600 in a 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 capable of being processed according to a predetermined order. Also, since the boundaries of the second coding units 1620a, 1620b, and 1620c determined by dividing the square-shaped first coding unit 1600 in the horizontal direction cannot divide the width of the first coding unit 1600 It may be determined that one coding unit 1600 does not satisfy a condition capable of being processed according to a predetermined order. In the case of dissatisfaction with this condition, the video decoding apparatus 100 may determine that the scan order is disconnected, and determine that the first coding unit 1600 is divided into odd number of coding units based on the determination result. According to an embodiment, when the video decoding apparatus 100 is divided into an odd number of coding units, the video decoding apparatus 100 may place a predetermined restriction on a coding unit at a predetermined position among the divided coding units. Since it has been described above through the embodiment, 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 split a square type first coding unit 1600 and a non-square type first coding unit 1630 or 1650 into various types of coding units. .

도 17은 일 실시예에 따라 비디오 복호화 장치(100)가 제1 부호화 단위(1700)가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위가 소정의 조건을 만족하는 경우 제2 부호화 단위가 분할될 수 있는 형태가 제한되는 것을 도시한다.17 illustrates a second coding unit in a non-square shape determined by splitting a first coding unit 1700 according to an embodiment, and when a second coding unit satisfies a predetermined condition, a second coding unit is split. 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 uses the first coding unit 1700 in a square shape based on at least one of block shape information and split type information acquired through the acquisition unit 105 to be in a non-square shape. It may be determined to divide into second coding units 1710a, 1710b, 1720a, and 1720b. The second coding units 1710a, 1710b, 1720a, and 1720b may be independently split. Accordingly, the video decoding apparatus 100 determines that the second coding units 1710a, 1710b, 1720a, and 1720b are divided into a plurality of coding units or not divided 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. I can. According to an embodiment, the video decoding apparatus 100 splits the left second coding unit 1710a of a non-square shape determined by splitting the first coding unit 1700 in a vertical direction in a horizontal direction, and splitting the third coding unit ( 1712a, 1712b) can be determined. However, when the video decoding apparatus 100 splits the left second coding unit 1710a in the horizontal direction, the right second coding unit 1710b is in the horizontal direction in the same direction as the left second coding unit 1710a. It can be restricted so that it cannot be divided into. If the right second coding unit 1710b is split in the same direction to determine the third coding units 1714a and 1714b, the left second coding unit 1710a and the right second coding unit 1710b are respectively The third coding units 1712a, 1712b, 1714a, and 1714b may be determined by being split independently. However, this is because the video decoding apparatus 100 divides the first coding unit 1700 into four square-shaped 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, and this may 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 divides the second coding unit 1720a or 1720b in a non-square shape determined by dividing the first coding unit 11300 in a horizontal direction in a vertical direction to obtain a third coding unit. (1722a, 1722b, 1724a, 1724b) can be determined. However, when the video decoding apparatus 100 splits one of the second coding units (for example, the upper second coding unit 1720a) in the vertical direction, another second coding unit (for example, the lower The coding unit 1720b may be limited so that the upper second coding unit 1720a cannot be split in the vertical direction in the same way as the split direction.

도 18은 일 실시예에 따라 분할 형태 정보가 4개의 정사각형 형태의 부호화 단위로 분할하는 것을 나타낼 수 없는 경우, 비디오 복호화 장치(100)가 정사각형 형태의 부호화 단위를 분할하는 과정을 도시한다.FIG. 18 illustrates a process in which the video decoding apparatus 100 splits a square coding unit when it is not possible to indicate that split type information is split into four square 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 divides the first coding unit 1800 based on at least one of block type information and split type information to generate second coding units 1810a, 1810b, 1820a, 1820b, etc. You can decide. Split type information may include information on various types in which a coding unit can be divided, but information on various types may not include information for dividing into four coding units in a square shape. According to the split type information, the video decoding apparatus 100 cannot split the square-shaped first coding unit 1800 into four square-shaped second coding units 1830a, 1830b, 1830c, and 1830d. The video decoding apparatus 100 may determine the non-square type of second coding units 1810a, 1810b, 1820a, 1820b, etc. based on the split type information.

일 실시예에 따라 비디오 복호화 장치(100)는 비-정사각형 형태의 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등)를 각각 독립적으로 분할할 수 있다. 재귀적인 방법을 통해 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등) 각각이 소정의 순서대로 분할될 수 있으며, 이는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1800)가 분할되는 방법에 대응하는 분할 방법일 수 있다. According to an embodiment, the video decoding apparatus 100 may independently split the second coding units 1810a, 1810b, 1820a, 1820b, etc. of a non-square shape. Each of the second coding units 1810a, 1810b, 1820a, 1820b, etc. may be split in a predetermined order through a recursive method, and this is based on at least one of block type information and split type information. ) May be a division method corresponding to the division 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 splitting the left second coding unit 1810a in a horizontal direction, and the second coding unit 1810b on the right The third coding units 1814a and 1814b having 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 splitting 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 splitting the upper second coding unit 1820a in a vertical direction, and the lower second coding unit 1820b ) Is divided in a vertical direction to determine the third coding units 1824a and 1824b having 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 splitting both the upper second coding units 1820a and the lower second coding units 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 between a plurality of coding units may vary according to a splitting process of a coding unit, 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 block type information and split type information. When the block shape information indicates a square shape and the split type information indicates that the first coding unit 1900 is divided in at least one of a horizontal direction and a vertical direction, the video decoding apparatus 100 may perform the first coding unit 1900. ) May be split 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 a non-square shape determined by splitting a first coding unit 1900 only in a horizontal direction or a vertical direction are block type information and split type information for each Can be divided independently based on. For example, the video decoding apparatus 100 splits the second coding units 1910a and 1910b generated by splitting the first coding unit 1900 in the vertical direction and splitting the second coding units 1910a and 1910b in the horizontal direction, 1916c and 1916d) may be determined, and the second coding units 1920a and 1920b generated by splitting the first coding unit 1900 in the horizontal direction are split in the horizontal direction, respectively, and the third coding units 1926a, 1926b, and 1926c , 1926d). Since the dividing 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. Features of processing of coding units according to a predetermined order have been described above with reference to FIG. 14, and thus detailed descriptions will be omitted. Referring to FIG. 19, the video decoding apparatus 100 divides the first coding unit 1900 in a square shape to form four square-shaped third coding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d. ) Can be determined. According to an embodiment, the video decoding apparatus 100 performs a 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 split. You 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 third coding units 1916a, 1916b, 1916c, and 1916d by dividing the second coding units 1910a and 1910b generated by being split in a vertical direction, respectively, in a 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 process the third coding units 1916a and 1916b included in the right second coding unit 1910b. The third coding units 1916a, 1916b, 1916c, and 1916d may be processed according to an order 1917 of 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 third coding units 1926a, 1926b, 1926c, and 1926d by dividing the second coding units 1920a and 1920b generated by being split in a horizontal direction in a 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, the lower second coding unit 1920b. The third coding units 1926a, 1926b, 1926c, and 1926d may be processed according to an order 1927 of 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, second coding units 1910a, 1910b, 1920a, and 1920b are respectively divided to determine square-shaped third coding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d. 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 into different forms, but the third coding unit 1916a determined later , 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d), eventually, the first coding unit 1900 is divided into coding units of the same type. Accordingly, the video decoding apparatus 100 recursively divides coding units through different processes based on at least one of block type information and split type information, and consequently determines coding units of the same type, The coding units may be processed in different orders.

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

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 심도를 소정의 기준에 따라 결정할 수 있다. 예를 들면 소정의 기준은 부호화 단위의 긴 변의 길이가 될 수 있다. 비디오 복호화 장치(100)는 현재 부호화 단위의 긴 변의 길이가 분할되기 전의 부호화 단위의 긴 변의 길이보다 2n (n>0) 배로 분할된 경우, 현재 부호화 단위의 심도는 분할되기 전의 부호화 단위의 심도보다 n만큼 심도가 증가된 것으로 결정할 수 있다. 이하에서는 심도가 증가된 부호화 단위를 하위 심도의 부호화 단위로 표현하도록 한다.According to an embodiment, the video decoding apparatus 100 may determine a depth of a 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 the length of the long side of the coding unit before splitting, the depth of the current coding unit is greater than the depth of the coding unit before splitting. 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 having 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, based on block shape information indicating a square shape (for example, block shape information may indicate '0: SQUARE'), the video decoding apparatus 100 One coding unit 2000 may be split to determine a second coding unit 2002 and a third coding unit 2004 having a lower depth. If the size of the square-shaped 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 into 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 that of the first coding unit 2000. When the depth of the first coding unit 2000 is D, the depth of the second coding unit 2002, which 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, which 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 (for example, block shape information is '1: NS_VER' indicating that the height is a non-square that is longer than the width, or ′ indicating that the width is a non-square shape that is longer than the height. 2: NS_HOR′), the video decoding apparatus 100 splits a first coding unit (2010 or 2020) having a non-square shape and a second coding unit (2012 or 2022) having a lower depth, A 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 splitting at least one of the width and height of the first coding unit 2010 having a size of Nx2N. That is, the video decoding apparatus 100 may split the first coding unit 2010 in a horizontal direction to determine a second coding unit 2002 having a size of NxN or a second coding unit 2022 having a size of NxN/2, A second coding unit 2012 having a size of N/2xN may be determined by dividing 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 (for example, 2002, 2012, 2022, etc.) by dividing at least one of a width and a height of the first coding unit 2020 having a size of 2NxN. May be. That is, the video decoding apparatus 100 may determine a second coding unit 2002 having a size of NxN or a second coding unit 2012 having a size of N/2xN by splitting the first coding unit 2020 in a vertical direction, The second coding unit 2022 having a size of NxN/2 may be determined by dividing in the horizontal direction and the 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 a width and a height of the second coding unit 2002 having a size of NxN. May be. That is, the video decoding apparatus 100 determines the third coding unit 2004 having a size of N/2xN/2 by splitting the second coding unit 2002 in a vertical direction and a horizontal direction, or determining the third coding unit 2004 having a size of N/22xN/2. 3 coding units 2014 may be determined or a third coding unit 2024 having a size of N/2xN/22 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 a width and a height of the second coding unit 2012 having a size of N/2xN to a third coding unit (eg, 2004, 2014, 2024, etc.) You can also decide. In other words, the video decoding apparatus 100 splits the second coding unit 2012 in a horizontal direction to determine the third coding unit 2004 having a size of N/2xN/2 or a third coding unit 2024 having a size of N/2xN/22. ) May be determined or divided in a vertical direction and a 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 a width and a height of the second coding unit 2014 having a size of NxN/2 to a third coding unit (eg, 2004, 2014, 2024, etc.). You can also decide. That is, the video decoding apparatus 100 splits the second coding unit 2012 in a vertical direction to determine the third coding unit 2004 having a size of N/2xN/2 or a third coding unit having a size of N/22xN/2. ) May be determined or divided in a vertical direction and a horizontal direction to determine the third coding unit 2024 having a size of N/2xN/22.

일 실시예에 따라 비디오 복호화 장치(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 split square coding units (for example, 2000, 2002, 2004) in a horizontal direction or a vertical direction. For example, the first coding unit 2000 having a size of 2Nx2N is split in a vertical direction to determine a first coding unit 2010 having a size of Nx2N, or a first coding unit having a size of 2NxN is determined by splitting in the horizontal direction. I 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 splitting a 2Nx2N sized first coding unit (2000, 2002 or 2004) in a horizontal direction or a 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) which is 1/2 times the width and height of the first coding unit (2010 or 2020) may be D+1 In addition, the depth of the third coding unit 2014 or 2024, which 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 illustrates a depth that may be determined according to a shape and size of coding units and a part index (hereinafter referred to as PID) for classifying 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 various types of second coding units by splitting the first coding unit 2100 having a square shape. Referring to FIG. 21, the video decoding apparatus 100 divides a first coding unit 2100 in at least one of a vertical direction and a horizontal direction according to split type information, and divides the second coding units 2102a, 2102b, and 2104a. 2104b, 2106a, 2106b, 2106c, 2106d) can be determined. That is, the video decoding apparatus 100 may determine the second coding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, and 2106d based on split type information on 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, and 2106d determined according to split type information for the first coding unit 2100 in a square shape are Based on the depth can be determined. For example, since the length of one side of the first coding unit 2100 in a square shape and the length of the long side of the second coding units 2102a, 2102b, 2104a, 2104b in a non-square shape are the same, the first coding unit ( 2100) and the non-square second coding units 2102a, 2102b, 2104a, and 2104b may 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 second coding units 2106a, 2106b, 2106c, 2106d based on the split type information, Since the length of one side of the 2 coding units 2106a, 2106b, 2106c, 2106d is 1/2 times the length of one side of the first coding unit 2100, the depth of the second coding units 2106a, 2106b, 2106c, 2106d May be a depth of D+1 that is one depth lower than the depth of D 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, the video decoding apparatus 100 splits a first coding unit 2110 having a height longer than a width in a horizontal direction according to split type information, and a plurality of second coding units 2112a, 2112b, 2114a, 2114b, 2114c) can be divided. According to an embodiment, the video decoding apparatus 100 divides a first coding unit 2120 having a width longer than a height in a vertical direction according to the split type information to obtain a plurality of second coding units 2122a, 2122b, 2124a, 2124b, 2124c) can be divided.

일 실시예에 따라 비-정사각형 형태의 제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, 2116d, which are determined according to split type information for the first non-square type coding unit 2110 or 2120, are The depth may be determined based on the length of the long side. For example, since the length of one side of the second coding units 2112a and 2112b in a square shape is 1/2 times the length of one side of the first coding unit 2110 in a non-square shape whose height is longer than the width, the square The depth of the second coding units 2102a, 2102b, 2104a, and 2104b of the form is D+1, which is one depth lower than the 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 split the first coding unit 2110 of the non-square shape into odd number of second coding units 2114a, 2114b, 2114c based on the split type information. The odd number of second coding units 2114a, 2114b, and 2114c may include second coding units 2114a and 2114c having a non-square shape and a second coding unit 2114b having a square shape. In this case, the length of the long side of the second coding units 2114a and 2114c of the non-square form and the length of one side of the second coding unit 2114b of the square form are 1/ of the length of one side of the first coding unit 2110 Since it is twice as large, the depth of the second coding units 2114a, 2114b, and 2114c may be a depth of D+1 that is one depth lower than the depth of D of the first coding unit 2110. The video decoding apparatus 100 is a method corresponding to the method of determining the depth of coding units related to the first coding unit 2110, and is related to the first coding unit 2120 in a non-square shape having a width greater than a height. The depth of the 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, in determining an index (PID) for classifying divided coding units, if the coding units divided into odd numbers are not the same size, the size ratio between the coding units is Based on the index can be determined. Referring to FIG. 21, among the coding units 2114a, 2114b, and 2114c divided into odd numbers, a coding unit 2114b positioned in the middle is a coding unit having the same width as other coding units 2114a and 2114c, but different heights. It may be twice the height of the fields 2114a and 2114c. That is, in this case, the coding unit 2114b positioned in the center may include two of the other coding units 2114a and 2114c. Accordingly, if the index (PID) of the coding unit 2114b located in the middle according to the scan order is 1, the coding unit 2114c located in the next order may have an index of 3 with an increase of 2. That is, there may be discontinuities in the index value. According to an embodiment, the video decoding apparatus 100 may determine whether or not the odd-numbered coding units are of the same size based on whether there is 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 to be split into a specific split type based on an index value for classifying a plurality of coding units determined by being split from a 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) can be determined. The video decoding apparatus 100 may use an index (PID) representing each coding unit to distinguish each of a plurality of coding units. According to an embodiment, the PID may be obtained from a sample (eg, an upper left sample) at a predetermined position of each coding unit.

일 실시예에 따라 비디오 복호화 장치(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 a coding unit at a predetermined position among coding units that are split and determined using an index for classifying coding units. According to an embodiment, when it is indicated that split type information for the first coding unit 2110 having a rectangular shape having a height longer than a width is divided into three coding units, the video decoding apparatus 100 may determine the first coding unit 2110. It can be divided into three coding units 2114a, 2114b, and 2114c. The video decoding apparatus 100 may allocate indexes 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 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 the indices based on the indexes of the coding units, and a center position among coding units determined by splitting the first coding unit 2110 It can be determined as a unit. In determining an index for classifying divided coding units, according to an embodiment, when the coding units are not the same size, the video decoding apparatus 100 may determine the index based on a size ratio between coding units. . Referring to FIG. 21, a coding unit 2114b generated by splitting the first coding unit 2110 is the same as the other coding units 2114a and 2114c, but the 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 in the middle is 1, the coding unit 2114c positioned in the next order may have an index of 3 with an increase of 2. As in this case, when the index increases evenly and then the increase width varies, the video decoding apparatus 100 may determine that the index is divided into a plurality of coding units including coding units having different sizes from other coding units. According to this, when it indicates that the split type information is split into odd number of coding units, the video decoding apparatus 100 includes a coding unit (for example, a center coding unit) at a predetermined position among odd coding units having a different size from other coding units. The current coding unit can be split by. In this case, the video decoding apparatus 100 may determine a coding unit having a different size using an index (PID) for a coding unit. However, the above-described index and the size or position of the coding unit at a predetermined position to be determined are specific for describing an embodiment and should not be interpreted as being limited thereto, and various indexes and positions and sizes of the coding unit may be used. It must be interpreted.

일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 재귀적인 분할이 시작되는 소정의 데이터 단위를 이용할 수 있다. According to an embodiment, the video decoding apparatus 100 may use a predetermined data unit in which recursive division of a 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 a coding unit starts to be recursively split 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, such a predetermined data unit is 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 MxN samples. Here, M and N may be identical to each other, and may be integers expressed as a multiplier of 2. 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 thereafter.

일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 복수개의 기준 데이터 단위로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 분할하는 복수개의 기준 데이터 단위를 각각의 기준 데이터 단위에 대한 분할 정보를 이용하여 분할할 수 있다. 이러한 기준 데이터 단위의 분할 과정은 쿼드 트리(quad-tree)구조를 이용한 분할 과정에 대응될 수 있다. According to an embodiment, the video decoding apparatus 100 may divide a 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 for dividing a current picture using split information for each reference data unit. The partitioning process of the reference data unit may correspond to the partitioning 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 a current picture can have. Accordingly, the video decoding apparatus 100 may determine a reference data unit of various sizes having a size equal to or greater than the minimum size, and determine at least one coding unit using block type information and split type information based on the determined reference data unit. You 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 having a square shape or a non-square reference coding unit 2202. According to an embodiment, the shape and size of a reference coding unit is various data units that may include at least one reference coding unit (e.g., a sequence, a picture, a slice, and a slice segment ( slice segment), maximum coding unit, etc.).

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

일 실시예에 따라 비디오 복호화 장치(100)는 소정의 조건에 기초하여 미리 결정되는 일부 데이터 단위에 따라 기준 부호화 단위의 크기 및 형태를 결정하기 위하여, 기준 부호화 단위의 크기 및 형태를 식별하기 위한 인덱스를 이용할 수 있다. 즉, 획득부(105)는 비트스트림으로부터 상기 다양한 데이터 단위(예를 들면, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트, 최대부호화단위 등) 중 소정의 조건(예를 들면 슬라이스 이하의 크기를 갖는 데이터 단위)을 만족하는 데이터 단위로서 슬라이스, 슬라이스 세그먼트, 최대부호화 단위 등 마다, 기준 부호화 단위의 크기 및 형태의 식별을 위한 인덱스만을 획득할 수 있다. 비디오 복호화 장치(100)는 인덱스를 이용함으로써 상기 소정의 조건을 만족하는 데이터 단위마다 기준 데이터 단위의 크기 및 형태를 결정할 수 있다. 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 상대적으로 작은 크기의 데이터 단위마다 비트스트림으로부터 획득하여 이용하는 경우, 비트스트림의 이용 효율이 좋지 않을 수 있으므로, 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 직접 획득하는 대신 상기 인덱스만을 획득하여 이용할 수 있다. 이 경우 기준 부호화 단위의 크기 및 형태를 나타내는 인덱스에 대응하는 기준 부호화 단위의 크기 및 형태 중 적어도 하나는 미리 결정되어 있을 수 있다. 즉, 비디오 복호화 장치(100)는 미리 결정된 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 인덱스에 따라 선택함으로써, 인덱스 획득의 기준이 되는 데이터 단위에 포함되는 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 determines the size and shape of a reference coding unit according to some data units that are predetermined based on a predetermined condition, and an index for identifying the size and shape of the reference coding unit You can use That is, the acquisition 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 satisfying ), only an index for identifying the size and shape of the reference coding unit may be obtained for each slice, slice segment, and maximum coding unit. The video decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When information about the shape of the reference coding unit and information about the size of the reference coding unit are obtained from a bitstream for each relatively small data unit, the use efficiency of the bitstream may not be good, so the type of the reference coding unit Instead of directly obtaining information on and information on the size of the reference coding unit, only the index may 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, so that at least one of the size and shape of the reference coding unit included in the data unit that is the reference for obtaining the index is selected. You 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, at least one reference coding unit may be included in the largest coding unit for dividing an image, 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 largest coding unit may correspond to an integer multiple of at least one 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 a maximum 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 maximum coding unit n times according to the quad tree structure, and according to various embodiments, the reference coding unit is at least one of block type information and split type information. Can be divided based on

도 23은 일 실시예에 따라 픽쳐(2300)에 포함되는 기준 부호화 단위의 결정 순서를 결정하는 기준이 되는 프로세싱 블록을 도시한다.23 illustrates a processing block that serves as a reference for determining an order of determining reference coding units 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 for dividing a picture. A processing block is a data unit including at least one reference coding unit that divides an image, and at least one reference coding unit included in the processing block may be determined in a specific order. That is, the order of determination of at least one reference coding unit determined in each processing block may correspond to one of a variety of order types in which the reference coding unit may be determined, and the order of determination of the reference coding unit determined in each processing block May be different for each processing block. The order of determination of the reference coding units determined for each processing block is raster scan, Z-scan, N-scan, up-right diagonal scan, and horizontal scan ( Horizontal scan) and vertical scan may be one of various orders, but the order that can be determined is limited to the scan orders and should not be interpreted.

일 실시예에 따라 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 비트스트림으로부터 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 이러한 프로세싱 블록의 크기는 프로세싱 블록의 크기에 대한 정보가 나타내는 데이터 단위의 소정의 크기일 수 있다. According to an embodiment, the video decoding apparatus 100 may determine the size of at least one processing block included in the image by obtaining information on the size of the processing block. The video decoding apparatus 100 may determine the size of at least one processing block included in the image by obtaining information on the size of the processing block from the bitstream. 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 data units such as an image, a sequence, a picture, a slice, and a slice segment. That is, the acquisition unit 105 may obtain information on the size of the processing block from the bitstream for each of the several data units, and the video decoding apparatus 100 divides a picture using the information on the size of the obtained processing block. The size of at least one processing block may be determined, and the size of such a processing block may be an integer multiple of the 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 on the size of the processing block obtained from the bitstream. Referring to FIG. 23, according to an embodiment, the video decoding apparatus 100 sets the horizontal size of the processing blocks 2302 and 2312 to 4 times the horizontal size of the reference coding unit and the vertical size to 4 times the vertical size of the reference coding unit. You 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 of the processing blocks 2302 and 2312 included in the picture 2300 based on the size of the processing block, and are included in the processing blocks 2302 and 2312. It is possible to determine an order of determining at least one of the reference coding units. According to an embodiment, determining 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 Thus, an order in which at least one reference coding unit is determined may be determined. The information on the order of determination may be defined as an order or direction in which reference coding units are determined in a 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 about a determination order of a reference coding unit for each specific data unit from a bitstream. For example, the acquirer 105 may obtain 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 determination order of the reference coding unit indicates the determination order of the reference coding unit within the processing block, the information on the determination order may 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 an 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 is information related to the processing blocks 2302 and 2312 from a bitstream, and may obtain information on an order of determining a reference coding unit, and the video decoding apparatus 100 An order of determining at least one reference coding unit included in 2302 and 2312 may be determined, and at least one reference coding unit included in the picture 2300 may be determined according to the determining order of the coding units. Referring to FIG. 23, the video decoding apparatus 100 may determine a determination order 2304 and 2314 of at least one reference coding unit related to each of the processing blocks 2302 and 2312. For example, when information about a determination order of a reference coding unit is obtained for each processing block, the order of determining a reference coding unit related to each of the processing blocks 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 a reference coding unit determination order 2314 related to another processing block 2312 is in the reverse order of the raster scan order, the reference coding units 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 at least one determined 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 dividing a current coding unit from a bitstream. Block type information or split type information may be included in a bitstream related to various data units. For example, the video decoding apparatus 100 includes a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. Segment header) may use block type information or segmentation type information. Furthermore, the video decoding apparatus 100 may obtain and use a syntax corresponding to block type information or split type information from a bitstream for each maximum coding unit, reference coding unit, and processing block.

이제까지 다양한 실시예들을 중심으로 살펴보았다. 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자는 본 개시가 본 개시의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 개시의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 개시에 포함된 것으로 해석되어야 할 것이다.So far, we have looked at the center of various embodiments. Those of ordinary skill 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 from an illustrative point of view rather than a limiting point of view. The scope of the present disclosure is shown in the claims rather than the foregoing description, and all differences within the scope equivalent thereto should be construed as being included in the present disclosure.

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

Claims (15)

현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계;
상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계;
상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하는 단계;
상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 단계;
상기 현재 블록의 변환 계수들에 관한 정보를 기초로 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및
상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함하고,
상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행되는 것을 특징으로 하는 비디오 복호화 방법.
Determining a scan area including all effective transform coefficients in the current block;
Scanning information on transform coefficients in the scan area according to a predetermined scan order;
Generating binary arithmetic-decoded information by performing binary arithmetic decoding based on the information on the scanned transform coefficients;
Obtaining information on transform coefficients of the current block by performing inverse binarization on the binary arithmetic-decoded information;
Generating a residual block of the current block by performing inverse quantization and inverse transformation based on information on the transform coefficients of the current block; And
Including the step of restoring the current block based on the generated residual block,
The video decoding method, wherein the binary arithmetic decoding is performed by using a context model determined based on at least one of a size and a shape of the current block.
제 1 항에 있어서,
상기 사각형 스캔 영역 내에는 상기 현재 블록 내 모든 유효 변환 계수를 포함하고,
상기 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0만을 포함하는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
All effective transform coefficients in the current block are included in the rectangular scan area,
The video decoding method according to claim 1, wherein the remaining areas in the current block excluding the rectangular scan area include only 0, not an effective transform coefficient.
제 1 항에 있어서,
상기 스캔 영역은 사각형 스캔 영역이고,
상기 스캔 영역을 결정하는 단계는
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계; 및
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 변환 계수의 사각형 스캔 영역을 결정하는 단계를 포함하고,
상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,
상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보가 상기 비트스트림에 포함되고,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평 방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,
상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 대한 좌표를 나타내는 정보 및 상기 하나의 방향에 대한 좌표와 나머지 방향에 대한 좌표 간의 차분(difference)를 나타내는 정보를 포함하는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
The scan area is a rectangular scan area,
The step of determining the scan area
Obtaining information about coordinates specifying the rectangular scan area from a bitstream; And
Determining a rectangular scan area of a transform coefficient in a current block based on information on coordinates specifying the rectangular scan area,
The horizontal coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the rightmost position in the current block,
The vertical coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the bottom of the current block,
Flag information indicating whether information on coordinates specifying the rectangular scan area includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area is included in the bitstream,
Information on coordinates specifying the rectangular scan area is
When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,
Information indicating coordinates in one direction among horizontal coordinates for a pixel of an effective transform coefficient positioned at the rightmost side in the current block and vertical coordinates for a pixel of an effective transform coefficient positioned at the bottom of the current block; and And information indicating a difference between the coordinates for the one direction and the coordinates for the other direction.
제 1 항에 있어서,
상기 현재 블록의 크기는 상기 현재 블록의 높이 및 너비 중 최소값 및 최대값 중 적어도 하나에 기초하여 결정되고,
상기 현재 블록의 모양은 상기 현재 블록의 높이 및 너비가 동일한지 또는 높이가 너비보다 큰지 또는 너비가 높이보다 큰지에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
The size of the current block is determined based on at least one of a minimum value and a maximum value of the height and width of the current block,
The shape of the current block is determined based on whether the height and width of the current block are the same, the height is greater than the width, or the width is greater than the height.
제 1 항에 있어서,
상기 현재 블록 내 모든 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,
상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 현재 블록 내 변환 계수들의 위치를 나타내는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하여 변경(swap)된 현재 블록을 생성하는 단계; 및
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계를 포함하고,
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,
상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
Determining a scan area including all transform coefficients in the current block,
If the height and width of the current block are different from each other, generating a swapped current block by swapping horizontal and vertical coordinates representing positions of transform coefficients in the current block; And
And determining a scan area including all effective transform coefficients in the swapped current block,
The step of determining a scan area including all effective transform coefficients in the swapped current block,
When the height and width of the current block are different from each other, horizontal coordinates and vertical coordinates specifying the scan area are changed (swap), and based on the swapped horizontal coordinates and vertical coordinates, the And determining a scan area.
제 5 항에 있어서,
비트스트림은 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보를 포함하는지를 나타내는 정보 및 상기 스캔 영역을 특정하는 좌표에 관한 정보를 포함하고,
상기 스캔 영역을 특정하는 좌표에 관한 정보는 상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함하고,
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,
상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보는 상기 수평방향 좌표 및 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표와 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하고,
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,
상기 현재 블록의 높이 및 너비가 서로 다른 경우,
상기 스캔 영역을 특정하는 좌표에 관한 정보로부터 획득된 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 5,
The bitstream includes information indicating whether flag information indicating whether a difference between coordinate values in a horizontal direction and a vertical direction specifying a scan area is included, and information about coordinates specifying the scan area,
The information on coordinates specifying the scan area includes information on horizontal coordinates and information on vertical coordinates specifying the scan area,
When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,
The information on the horizontal coordinates specifying the scan area and the information on the vertical coordinates are information indicating coordinates related to one of the horizontal coordinates and vertical coordinates, and the coordinates related to the one direction and the other directions. It contains information indicating the difference (difference) between the relative coordinates,
The step of determining a scan area including all effective transform coefficients in the swapped current block,
If the height and width of the current block are different,
Swapping horizontal and vertical coordinates obtained from information about coordinates specifying the scan area, and determining the scan area based on the swapped horizontal and vertical coordinates Video decoding method comprising the step.
제 1 항에 있어서,
상기 컨텍스트 모델 중 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델은 상기 스캔 영역의 크기, 상기 스캔 영역 내에서 소정의 스캔 순서에 따라 현재 변환 계수보다 이전에 스캔된 계수의 개수(count) 및 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치 및 상기 현재 유효 변환 계수가 상기 스캔 영역 내 상기 소정의 스캔 순서에 따라 스캔된 변환 계수들 중 첫번째 변환 계수인지 여부 중 적어도 하나에 더 기초하여 결정된 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
Among the context models, the context model related to flag information of the current transform coefficient includes the size of the scan area, the number of coefficients scanned before the current transform coefficient according to a predetermined scan order within the scan area, and the scan area. A video, characterized in that it is further determined based on at least one of a relative position of the current transform coefficient within and whether the current effective transform coefficient is the first transform coefficient among transform coefficients scanned according to the predetermined scan order in the scan area Decryption method.
제 7 항에 있어서,
상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역의 크기 및 상기 소정의 스캔 순서에 따라 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수에 기초하여 결정되는 경우,
상기 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수가 상기 스캔 영역의 크기에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 7,
When the context model for the flag information of the current transform coefficient is determined based on the size of the scan area and the number of flag information of the transform coefficient scanned before the current coefficient according to the predetermined scan order,
Context model regarding flag information of the current transform coefficient based on a predetermined context offset corresponding to a case where the number of flag information of the transform coefficient scanned before the current coefficient is smaller than a predetermined value based on the size of the scan area A video decoding method, characterized in that is determined.
제 7 항에 있어서,
상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치에 기초하여 결정되는 경우,
상기 현재 변환 계수의 좌표가 상기 스캔 영역의 위치를 특정하는 좌표에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수에 관한 컨텍스트 모델이 결정되는 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 7,
When the context model for the flag information of the current transform coefficient is determined based on the relative position of the current transform coefficient in the scan area,
A video, characterized in that the context model for the current transform coefficient is determined based on a predetermined context offset corresponding to a case in which the coordinates of the current transform coefficient are smaller than a predetermined value based on a coordinate specifying the position of the scan area. Decryption method.
제 1 항에 있어서,
상기 변환 계수에 관한 정보는,
상기 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 유효 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 및 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고,
상기 소정의 값은 0, 1, 2 중 적어도 하나인 것을 특징으로 하는 비디오 복호화 방법.
The method of claim 1,
Information about the transformation coefficient,
Flag information indicating whether the transform coefficient is greater than a predetermined value, remaining level information regarding the absolute value of the effective transform coefficient, code information of the transform coefficient, and binarization used for inverse binarization of the transform coefficient It includes at least one of parameter information,
The video decoding method, wherein the predetermined value is at least one of 0, 1, and 2.
현재 블록의 변환 계수를 획득하는 단계;
상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계;
상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하는 단계;
상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 단계; 및
상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함하고,
상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행되는 것을 특징으로 하는 비디오 부호화 방법.
Obtaining a transform coefficient of the current block;
Determining a scan area including all effective transform coefficients in the current block;
Scanning information about transform coefficients included in the scan area according to a predetermined scan order and performing binarization based on the information about the scanned transform coefficients to generate binarized information;
Generating entropy-encoded information by performing binary arithmetic encoding on the binarized information; And
And generating a bitstream including the entropy-encoded information,
The video encoding method, wherein the binary arithmetic encoding is performed using a context model determined based on at least one of a size and a shape of the current block.
제 9 항에 있어서,
상기 스캔 영역은 사각형 스캔 영역이고,
상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,
상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보 및 상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보는 상기 비트스트림에 포함되고,
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표 및 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하는 것을 특징으로 하는 비디오 부호화 방법.
The method of claim 9,
The scan area is a rectangular scan area,
The horizontal coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the rightmost position in the current block,
The vertical coordinates specifying the rectangular scan area represent coordinates of an effective transform coefficient pixel located at the bottom of the current block,
The flag information indicating whether the information on coordinates specifying the rectangular scan area and the coordinates specifying the rectangular scan area includes a difference between coordinate values in the horizontal direction and the vertical direction specifying the rectangular scan area is the bit Is included in the stream,
When it is indicated that the flag information includes a difference between coordinate values in a horizontal direction and a vertical direction specifying the rectangular scan area,
The information on the coordinates specifying the rectangular scan area is a horizontal coordinate for a pixel of an effective transform coefficient positioned at the rightmost position in the current block and a vertical direction for a pixel of an effective transform coefficient positioned at the bottom of the current block. And information indicating a coordinate in one direction among the coordinates and information indicating a difference between the coordinates in the one direction and the coordinates in the other direction.
현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하고, 상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 엔트로피 복호화부; 및
상기 현재 블록의 변환 계수들에 관한 정보에 기초하여 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 영상 복원부를 포함하고,
상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행되는 것을 특징으로 하는 비디오 복호화 장치.
Determine a scan area including all effective transform coefficients in the current block, scan information on the transform coefficients in the scan area according to a predetermined scan order, and perform binary arithmetic decoding based on the information on the scanned transform coefficients An entropy decoder for generating binary arithmetic-decoded information by performing, and obtaining information on transform coefficients of the current block by performing inverse binarization on the binary arithmetic-decoded information; And
Inverse quantization and inverse transformation are performed based on information on the transform coefficients of the current block to generate a residual block of the current block, and an image restoration unit reconstructing the current block based on the generated residual block,
The video decoding apparatus, wherein the binary arithmetic decoding is performed using a context model determined based on at least one of a size and a shape of the current block.
현재 블록의 변환 계수를 획득하고, 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하고, 상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 엔트로피 부호화부; 및
상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 비트스트림 생성부를 포함하고,
상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행되는 것을 특징으로 하는 비디오 부호화 장치.
Obtaining transform coefficients of the current block, determining a scan area including all effective transform coefficients in the current block, scanning information on transform coefficients included in the scan area according to a predetermined scan order, and scanning the scanned area An entropy encoder for generating binarized information by performing binarization on the basis of information on transform coefficients, and generating entropy-encoded information by performing binary arithmetic coding on the binarized information; And
A bitstream generator for generating a bitstream including the entropy-encoded information,
The video encoding apparatus, wherein the binary arithmetic encoding is performed using a context model determined based on at least one of a size and a shape of the current block.
제 1 항의 비디오 복호화 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록매체.A computer-readable recording medium on which a program for implementing the video decoding method of claim 1 is recorded.
KR1020207017052A 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof KR20200096537A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US201862612840P 2018-01-02 2018-01-02
US62/612,840 2018-01-02
PCT/KR2018/003830 WO2019135448A1 (en) 2018-01-02 2018-03-30 Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor

Publications (1)

Publication Number Publication Date
KR20200096537A true KR20200096537A (en) 2020-08-12

Family

ID=67143807

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020207017052A KR20200096537A (en) 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof

Country Status (3)

Country Link
KR (1) KR20200096537A (en)
CN (3) CN116132694A (en)
WO (1) WO2019135448A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842916A (en) * 2019-08-27 2023-03-24 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device
CN114979642A (en) * 2021-02-22 2022-08-30 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, computer readable medium and electronic equipment
CN113068033B (en) * 2021-03-11 2022-05-31 腾讯科技(深圳)有限公司 Multimedia inverse quantization processing method, device, equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100718134B1 (en) * 2005-07-21 2007-05-14 삼성전자주식회사 Method and apparatus of encoding/decoding video data using bitrate adaptive binary arithmetic coding
GB2492333B (en) * 2011-06-27 2018-12-12 British Broadcasting Corp Video encoding and decoding using transforms
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
JP2018530211A (en) * 2015-09-08 2018-10-11 サムスン エレクトロニクス カンパニー リミテッド Apparatus and method for entropy encoding and decoding

Also Published As

Publication number Publication date
CN116132694A (en) 2023-05-16
CN111727606B (en) 2023-04-11
CN116112669A (en) 2023-05-12
WO2019135448A1 (en) 2019-07-11
CN111727606A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
JP6574025B2 (en) Video decoding method and video decoding apparatus
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
KR101974320B1 (en) Method, apparatus and medium for encoding and decoding a sub block of transform units of video data
KR20180093950A (en) Image coding method and apparatus, image decoding method and apparatus
KR20180101711A (en) Method and apparatus for video decoding by chroma multiple conversion, video coding method and apparatus by chroma multiple conversion
KR102568900B1 (en) method and apparatus for encoding/decoding image
US11936870B2 (en) Image encoding method and device, and image decoding method and device
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
KR20180107097A (en) VIDEO DECODING METHOD, DEVICE, AND VIDEO Coding METHOD AND DEVICE
KR20200096537A (en) Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
KR20180075484A (en) METHOD AND APPARATUS FOR ENCODING / DECODING IMAGE

Legal Events

Date Code Title Description
A201 Request for examination