WO2019135448A1 - Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor - Google Patents

Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor Download PDF

Info

Publication number
WO2019135448A1
WO2019135448A1 PCT/KR2018/003830 KR2018003830W WO2019135448A1 WO 2019135448 A1 WO2019135448 A1 WO 2019135448A1 KR 2018003830 W KR2018003830 W KR 2018003830W WO 2019135448 A1 WO2019135448 A1 WO 2019135448A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
current block
coefficient
scan
scan area
Prior art date
Application number
PCT/KR2018/003830
Other languages
French (fr)
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 삼성전자 주식회사
Priority to KR1020207017052A priority Critical patent/KR20200096537A/en
Priority to CN202310312637.3A priority patent/CN116112669A/en
Priority to CN201880089530.4A priority patent/CN111727606B/en
Priority to CN202310308625.3A priority patent/CN116132694A/en
Publication of WO2019135448A1 publication Critical patent/WO2019135448A1/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

Disclosed is a method for decoding video, comprising: determining a scan area containing all of effective transform coefficients in a current block; scanning information on the transform coefficients in the scan area according to a predetermined scan order; performing binary arithmetic decoding on the basis of information on the scanned transform coefficients to generate binary arithmetic decoded information; performing inverse binarization on the binary arithmetic decoded information to obtain the information on the transform coefficients of the current block; performing inverse quantization and inverse transform on the basis of the information on the transform coefficients of the current block to generate a residual block of the current block; and restoring the current block on the basis of the generated residual block. According to the disclosed video decoding method, the binary arithmetic decoding may be performed by using a context model determined on the basis of at least one of the size and the shape of the current block.

Description

비디오 복호화 방법 및 그 장치 및 비디오 부호화 방법 및 그 장치VIDEO DECODING METHOD, DEVICE, AND VIDEO Coding METHOD AND DEVICE
비디오 복호화 방법 및 비디오 부호화에 관한 것이다. 상세하게는 엔트로피 복호화 및 엔트로피 부호화에 관한 것이다.A video decoding method and a video encoding method. And more particularly to entropy decoding and entropy encoding.
고해상도 또는 고화질 비디오 컨텐트를 재생, 저장할 수 있는 하드웨어의 개발 및 보급에 따라, 고해상도 또는 고화질 비디오 컨텐트를 효과적으로 부호화하거나 복호화하는 비디오 코덱의 필요성이 증대하고 있다. 기존의 비디오 코덱에 따르면, 비디오는 트리 구조의 부호화 단위에 기반하여 제한된 부호화 방식에 따라 부호화되고 있다. Background of the Invention [0002] As the development and dissemination of hardware capable of playing back and storing high-resolution or high-definition video content increases the need for video codecs to effectively encode or decode high-definition or high-definition video content. According to the existing video codec, video is encoded according to a limited encoding method based on a coding unit of a tree structure.
주파수 변환을 이용하여 공간 영역의 영상 데이터는 주파수 영역의 계수들로 변환된다. 비디오 코덱은, 주파수 변환의 빠른 연산을 위해 영상을 소정 크기의 블록들로 분할하고, 블록마다 DCT 변환을 수행하여, 블록 단위의 주파수 계수들을 부호화한다. 공간 영역의 영상 데이터에 비해 주파수 영역의 계수들이, 압축하기 쉬운 형태를 가진다. 특히 비디오 코덱의 인터 예측 또는 인트라 예측을 통해 공간 영역의 영상 화소값은 예측 오차로 표현되므로, 예측 오차에 대해 주파수 변환이 수행되면 많은 데이터가 0으로 변환될 수 있다. 비디오 코덱은 연속적으로 반복적으로 발생하는 데이터를 작은 크기의 데이터로 치환함으로써, 데이터량을 절감하고 있다.The image data in the spatial domain is transformed into coefficients in the frequency domain using frequency conversion. The video codec divides an image into blocks of a predetermined size for fast calculation of frequency conversion, performs DCT conversion on each block, and encodes frequency coefficients on a block-by-block basis. Compared to image data in the spatial domain, coefficients in the frequency domain have a form that is easy to compress. In particular, since the image pixel values of the spatial domain are expressed by prediction errors through inter prediction or intra prediction of the video codec, many data can be converted to 0 when the frequency transformation is performed on the prediction error. Video codecs reduce the amount of data by replacing consecutively repeated data with small-sized data.
다양한 실시예에 따라, 다양한 요소에 기초하여 스캔 영역을 결정하고, 계수에 관한 정보를 스캔하고, 이진화/역이진화 및 컨텍스트 모델에 기초한 이진 산술 부호화/복호화를 수행함으로써 엔트로피 부복호화 효율을 높일 수 있다.According to various embodiments, entropy decoding efficiency can be increased by determining scan areas based on various factors, scanning information about coefficients, and performing binary arithmetic coding / decoding based on binarization / inverse binarization and context model .
다양한 실시예에 따라, 변환 계수를 엔트로피 부복호화하는 과정에서 현재 블록 내 모든 유효 변환 계수를 포함하는 사각형 스캔 영역을 결정하고, 사각형 스캔 영역 내 유효 변환 계수를 스캔함으로써 불필요한 스캔을 줄이고, 서로 연관성이 있는 유효 변환 계수들을 인접하여 스캔함으로써 엔트로피 부복호화 효율을 높일 수 있다. 다양한 요소에 기초하여 변환 계수에 관한 신택스에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 특히, 블록의 크기 및 블록의 모양 중 적어도 하나를 고려하여 변환 계수에 관한 신택스 엘리먼트에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 또한, 스캔 영역을 고려하여 변환 계수에 관한 신택스에 관한 컨텍스트 모델을 결정함으로써 엔트로피 부복호화 효율을 높일 수 있다. 또한, 스캔 영역을 특정하는 수평 방향 좌표에 관한 정보 및 수직 방향 좌표에 관한 정보를 독립적으로 부복호화하지 않고, 수평 방향 좌표 및 수직 방향 좌표 간의 관련성을 고려하여 스캔 영역을 특정하는 좌표에 관한 정보를 부복호화함으로써 부복호화 효율을 높일 수 있다.According to various embodiments, in the process of entropy decoding the transform coefficients, a rectangular scan region including all the effective transform coefficients in the current block is determined, unnecessary scans are reduced by scanning effective transform coefficients in the rectangular scan region, The efficiency of entropy decoding can be improved by scanning the effective transform coefficients adjacent to each other. The entropy decoding efficiency can be increased by determining the context model related to the syntax regarding the transform coefficients based on various elements. Particularly, the entropy decoding efficiency can be increased by determining the context model for the syntax element related to the transform coefficient considering at least one of the size of the block and the shape of the block. In addition, the entropy decoding efficiency can be improved by determining the context model regarding the syntax regarding the transform coefficients in consideration of the scan area. The information on the coordinates specifying the scan area may be obtained by taking into consideration the relation between the horizontal direction coordinate and the vertical direction coordinate without independently decoding the information about the horizontal direction coordinate specifying the scan area and the information about the vertical direction coordinate The sub-decoding efficiency can be increased.
다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.Readable recording medium on which a program for implementing the method according to various embodiments is recorded.
물론, 다양한 실시예의 기술적 과제들은 이상에서 언급한 특징으로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 당해 기술분야의 통상의 기술자에게 명확하게 이해될 수 있을 것이다Of course, the technical objects of the various embodiments are not limited to the features mentioned above, and other technical subjects not mentioned can be clearly understood by those skilled in the art from the following description
본 발명의 기술적 과제들은 이상에서 언급한 특징으로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 당해 기술분야의 통상의 기술자에게 명확하게 이해될 수 있을 것이다.The technical objects of the present invention are not limited to the features mentioned above, and other technical subjects not mentioned can be clearly understood by those skilled in the art from the following description.
다양한 실시예에 따른 비디오 복호화 방법은 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계; 상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; 상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하는 단계; 상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 단계; 상기 현재 블록의 변환 계수들에 관한 정보를 기초로 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함하고,A video decoding method according to various embodiments includes determining a scan region including all effective transform coefficients in a current block; Scanning the information about the in-scan conversion coefficients according to a predetermined scanning order; Performing binary arithmetic decoding based on information on the scanned transform coefficients to generate binary arithmetic decoded information; Performing inverse binarization on the binary arithmetic decoding information to obtain information on transform coefficients of the current block; Generating a residual block of a current block by performing inverse quantization and inverse transform based on information on 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 a size and a shape of the current block.
상기 사각형 스캔 영역 내에는 상기 현재 블록 내 모든 유효 변환 계수를 포함하고, 상기 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0만을 포함할 수 있다.The quadrangle scan area includes all the effective transform coefficients in the current block, and the remaining area in the current block excluding the quadrangular scan area may include only 0, which is not an effective transform coefficient.
상기 스캔 영역은 사각형 스캔 영역이고,Wherein the scan area is a rectangular scan area,
상기 스캔 영역을 결정하는 단계는The step of determining the scan area
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계; 및Obtaining information on coordinates specifying the quadrangular scan area from a bitstream; And
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 변환 계수의 사각형 스캔 영역을 결정하는 단계를 포함하고,And determining a rectangular scan area of the current intra-block transform coefficient based on information about coordinates specifying the rectangular scan area,
상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,A horizontal direction coordinate specifying the quadrangular scan area indicates a coordinate of an effective transformation coefficient pixel located at the rightmost position in the current block,
상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,Wherein the vertical coordinate specifying the quadrangular scan area indicates the coordinates of the effective transformation coefficient pixel located at the lowermost part in the current block,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보가 상기 비트스트림에 포함되고,Wherein flag information indicating whether or not the rectangular scan area includes a difference between horizontal and vertical coordinate values specifying the rectangular scan area is included in the bit stream,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 The information on the coordinates specifying the quadrangular scan area is
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평 방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 대한 좌표를 나타내는 정보 및 상기 하나의 방향에 대한 좌표와 나머지 방향에 대한 좌표 간의 차분(difference)를 나타내는 정보를 포함할 수 있다.Information indicating coordinates of one of a horizontal direction coordinate of a pixel of an effective transformation coefficient located at the rightmost position in the current block and a vertical direction coordinate of a pixel of an effective transformation coefficient located at the lowermost position in the current block, And information indicating a difference between the coordinates for the one direction and the coordinates for the remaining direction.
상기 현재 블록의 크기는 상기 현재 블록의 높이 및 너비 중 최소값 및 최대값 중 적어도 하나에 기초하여 결정되고,Wherein the size of the current block is determined based on at least one of a minimum value and a maximum value of a height and a 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 or whether the height is larger than the width or the width is larger than the height.
상기 현재 블록 내 모든 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all transform coefficients in the current block comprises:
상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 현재 블록 내 변환 계수들의 위치를 나타내는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하여 변경(swap)된 현재 블록을 생성하는 단계; 및Generating a swapped current block by swapping horizontal and vertical coordinates indicating the positions of transform coefficients in the current block when the height and width of the current block are different from each other; And
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계를 포함하고,Determining a scan area containing all the effective transform coefficients in the swapped current block,
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all effective transform coefficients in the swapped current block comprises:
상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함할 수 있다.Wherein when the current block has a different height and width, the controller swaps the horizontal coordinate and the vertical coordinate specifying the scan region to each other, and based on the swapped horizontal and vertical coordinates, And determining a scan area.
비트스트림은 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보를 포함하는지를 나타내는 정보 및 상기 스캔 영역을 특정하는 좌표에 관한 정보를 포함하고,Wherein the bit stream includes information indicating whether or not the bit stream includes flag information indicating whether or not the difference between the horizontal and vertical coordinate values specifying the scan area includes a difference and coordinates information specifying the scan area,
상기 스캔 영역을 특정하는 좌표에 관한 정보는 상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함하고,The information on the coordinates specifying the scan area includes information on the horizontal direction coordinates specifying the scan area and information on the vertical direction coordinates,
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보는 상기 수평방향 좌표 및 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표와 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하고,The information on the horizontal direction coordinate specifying the scan area and the information on the vertical direction coordinate are information indicating coordinates in one of the horizontal direction coordinate and the vertical direction coordinate and information indicating coordinates in the other direction The information indicating the difference between the coordinates related to the coordinates,
상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all effective transform coefficients in the swapped current block comprises:
상기 현재 블록의 높이 및 너비가 서로 다른 경우, If the height and width of the current block are different,
상기 스캔 영역을 특정하는 좌표에 관한 정보로부터 획득된 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함할 수 있다.Swap horizontal coordinate and vertical coordinate obtained from information on the coordinates specifying the scan area, and determine the scan area based on the swapped horizontal and vertical coordinates Step < / RTI >
상기 컨텍스트 모델 중 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델은 상기 스캔 영역의 크기, 상기 스캔 영역 내에서 소정의 스캔 순서에 따라 현재 변환 계수보다 이전에 스캔된 계수의 개수(count) 및 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치 및 상기 현재 유효 변환 계수가 상기 스캔 영역 내 상기 소정의 스캔 순서에 따라 스캔된 변환 계수들 중 첫번째 변환 계수인지 여부 중 적어도 하나에 더 기초하여 결정될 수 수 있다.The context model related to the flag information of the current transform coefficient among the context models includes a size of the scan region, a count of counts that are scanned before the current transform coefficient in a predetermined scan order in the scan region, The relative position of the current transform coefficient and whether the current effective transform coefficient is the first transform coefficient among the transform coefficients scanned according to the predetermined scan order in the scan area.
상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역의 크기 및 상기 소정의 스캔 순서에 따라 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수에 기초하여 결정되는 경우,When the context model related to 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,
상기 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수가 상기 스캔 영역의 크기에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 결정될 수 있다.A context model for 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 related to the flag information of the current transform coefficient is determined based on the relative position of the current transform coefficient in the scan area,
상기 현재 변환 계수의 좌표가 상기 스캔 영역의 위치를 특정하는 좌표에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수에 관한 컨텍스트 모델이 결정될 수 있다.The context model for 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 coordinates specifying the position of the scan region.
상기 변환 계수에 관한 정보는, The information on the transform coefficients may be,
상기 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 유효 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 및 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고, A flag indicating whether the transform coefficient is larger than a predetermined value, a remaining level information about an absolute value of the effective transform coefficient, sign information of the transform coefficient, and a binarization And 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 a transform coefficient of a current block; Determining a scan area including all effective transform coefficients in the current block; Scanning the information on the transform coefficients included in the scan region according to a predetermined scan order and performing binarization based on the information about the scanned transform coefficients to generate binarized information; Performing binary arithmetic coding on the binarized information to generate entropy-encoded information; And generating a bitstream including the entropy encoded information,
상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행될 수 있다.The binary arithmetic coding may be performed using a context model determined based on at least one of a size and a shape of the current block.
상기 스캔 영역은 사각형 스캔 영역이고,Wherein the scan area is a rectangular scan area,
상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,A horizontal direction coordinate specifying the quadrangular scan area indicates a coordinate of an effective transformation coefficient pixel located at the rightmost position in the current block,
상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,Wherein the vertical coordinate specifying the quadrangular scan area indicates the coordinates of the effective transformation coefficient pixel located at the lowermost part in the current block,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보 및 상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보는 상기 비트스트림에 포함되고,Flag information indicating whether or not the information on the coordinates specifying the quadrangular scan area and the information on the coordinates specifying the quadrangular scan area include a difference between horizontal and vertical coordinate values specifying the quadrangular scan area, Stream,
상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표 및 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함할 수 있다.Wherein the information on the coordinates specifying the quadrangular scan area includes a horizontal coordinate for a pixel of an effective conversion coefficient located at the rightmost position in the current block and a vertical coordinate for a pixel of the effective conversion coefficient located at the lowermost position in the current block Information indicating the coordinates of one of the coordinates and information indicating the difference between the coordinates of the one direction and the coordinates of the remaining directions.
다양한 실시예에 따른 비디오 복호화 장치는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하고, 상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 엔트로피 복호화부; 및The video decoding apparatus according to various embodiments determines a scan area including all the effective conversion coefficients in the current block, scans information on the in-scan conversion coefficients according to a predetermined scan order, Decodes the binary arithmetic decoded information and performs inverse binarization on the binary arithmetic decoded information to obtain information on the transform coefficients of the current block, ; And
상기 현재 블록의 변환 계수들에 관한 정보에 기초하여 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 영상 복원부를 포함하고,And an image restoration unit for generating a residual block of the current block by performing inverse quantization and inverse transformation based on the information about the transform coefficients of the current block and restoring 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 a size and a shape of the current block.
다양한 실시예에 따른 비디오 부호화 장치는, 현재 블록의 변환 계수를 획득하고, 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하고, 상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 엔트로피 부호화부; 및 상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 비트스트림 생성부를 포함하고, 상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행될 수 있다.The video encoding apparatus according to various embodiments obtains a transform coefficient of a current block, determines a scan region including all the effective transform coefficients in the current block, and outputs information about transform coefficients included in the scan region to a predetermined An entropy encoding process for generating entropy-encoded information by performing binary arithmetic encoding on the binarized information, performing entropy encoding on the binarized information by performing a binary arithmetic encoding on the binarized information, part; And a bitstream generation unit for generating a bitstream including the entropy-encoded information, wherein the binary arithmetic coding is performed using a context model determined based on at least one of a size and a shape of the current block .
다양한 실시예에 따른 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 포함할 수 있다.Readable recording medium on which a program for implementing the method according to various embodiments is recorded.
도 1a는 다양한 실시예에 따른 비디오 복호화 장치의 블록도를 도시한다.FIG. 1A shows a block diagram of a video decoding apparatus according to various embodiments.
도 1b는 다양한 실시예에 따른 비디오 복호화 방법의 흐름도를 도시한다.1B shows a flow diagram of a video decoding method according to various embodiments.
도 1c는 다양한 실시예에 따른 비디오 부호화 장치의 블록도를 도시한다.1C shows a block diagram of a video encoding apparatus according to various embodiments.
도 1d는 다양한 실시예에 따른 비디오 부호화 방법의 흐름도를 도시한다.Figure 1D shows a flow diagram of a video encoding method according to various embodiments.
도 1e는 다양한 실시예에 따른 영상 복호화부의 블록도를 도시한다. FIG. 1E shows a block diagram of an image decoding unit according to various embodiments.
도 1f는 다양한 실시예에 따른 영상 부호화부의 블록도를 도시한다1F shows a block diagram of an image encoding unit according to various embodiments
도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.FIG. 2 is a diagram for explaining a method of scanning intra-block transform coefficients according to an embodiment.
도 3a는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.3A is a diagram for explaining a method of scanning an intra-block transform coefficient according to an embodiment.
도 3b는 일 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.FIG. 3B is a view for explaining an operation of determining intra-block coefficient groups (sub-blocks) and an operation performed for each coefficient group according to an embodiment.
도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 4 is a diagram for explaining a process of determining a context model for decoding context-based binary arithmetic decoding information on transform coefficients according to an exemplary embodiment of the present invention.
도 5는 다른 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 5 is a diagram for explaining a process of determining a context model for decoding context-based binary arithmetic decoding information on transform coefficients according to another embodiment.
도 6a는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.FIG. 6A is a diagram for explaining a horizontal priority zigzag scan order for scanning information on intra-block transform coefficients according to an exemplary embodiment.
도 6b는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.6B is a diagram for explaining a vertical priority zigzag scan order for scanning information on intra-block transform coefficients according to an embodiment.
도 6c는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 스캔 순서를 설명하기 위한 도면이다.FIG. 6C is a diagram for explaining a horizontal scanning order for scanning information on intra-block transform coefficients according to an embodiment.
도 6d는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 스캔 순서를 설명하기 위한 도면이다.FIG. 6D is a diagram for explaining a vertical scanning sequence for scanning information on intra-block transform coefficients according to an embodiment.
도 6e는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 대각 스캔 순서를 설명하기 위한 도면이다.FIG. 6E is a diagram for explaining a diagonal scan order for scanning information on intra-block transform coefficients according to an embodiment.
도 7a는 일 실시예에 따라서 사각형 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향 좌표를 변경(swap)하여 스캔 영역을 변경(swap)하는 과정을 설명하기 위한 도면이다.FIG. 7A is a diagram for explaining a process of swapping a scan area by swapping horizontal and vertical coordinates of transform coefficient pixels in a rectangular scan area according to an exemplary embodiment.
도 7b는 다른 실시예에 따라서 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향의 좌표를 변경(swap)하여 스캔 영역을 변경하는 과정을 설명하기 위한 도면이다.FIG. 7B is a diagram for explaining a process of changing a scan area by swapping horizontal and vertical coordinates of transform coefficient pixels in a scan area according to another embodiment.
도 8은 일 실시예에 따라 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.8 is a diagram for explaining 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.
도 9a 내지 도 9c는 일 실시예에 따른 레지듀얼 부호화 신택스 구조(syntax structure)를 설명하기 위한 도면이다.9A to 9C are diagrams for explaining a syntax structure of a residual coding according to an embodiment.
도 9d 내지 도 9f는 다른 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.9D to 9F are diagrams for explaining a residual coding syntax structure according to another embodiment.
도 10은 일 실시예에 따라 현재 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.FIG. 10 illustrates a process in which at least one encoding unit is determined by dividing a current encoding unit according to an embodiment.
도 11은 일 실시예에 따라 비-정사각형의 형태인 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.FIG. 11 illustrates a process in which at least one encoding unit is determined by dividing a non-square encoding unit according to an embodiment.
도 12는 일 실시예에 따라 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 부호화 단위가 분할되는 과정을 도시한다.FIG. 12 illustrates a process in which an encoding unit is divided based on at least one of block type information and division type information according to an embodiment.
도 13은 일 실시예에 따라 홀수개의 부호화 단위들 중 소정의 부호화 단위가 결정되는 방법을 도시한다.FIG. 13 illustrates a method of determining a predetermined encoding unit among odd number of encoding units according to an embodiment.
도 14는 일 실시예에 따라 현재 부호화 단위가 분할되어 복수개의 부호화 단위들이 결정되는 경우, 복수개의 부호화 단위들이 처리되는 순서를 도시한다.FIG. 14 shows a sequence in which a plurality of encoding units are processed when a current encoding unit is divided to determine a plurality of encoding units according to an embodiment.
도 15는 일 실시예에 따라 소정의 순서로 부호화 단위가 처리될 수 없는 경우, 현재 부호화 단위가 홀수개의 부호화 단위로 분할되는 것으로 결정되는 과정을 도시한다.FIG. 15 illustrates a process in which, when an encoding unit can not be processed in a predetermined order according to an embodiment, it is determined that the current encoding unit is divided into odd number of encoding units.
도 16은 일 실시예에 따라 제1 부호화 단위가 분할되어 적어도 하나의 부호화 단위가 결정되는 과정을 도시한다.FIG. 16 illustrates a process in which a first encoding unit is divided into at least one encoding unit according to an embodiment of the present invention.
도 17은 일 실시예에 따라 제1 부호화 단위가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위가 소정의 조건을 만족하는 경우, 제2 부호화 단위가 분할될 수 있는 형태가 제한되는 것을 도시한다.FIG. 17 shows that when the non-square type second coding unit determined by dividing the first coding unit according to an embodiment satisfies a predetermined condition, the form in which the second coding unit can be divided is limited .
도 18은 일 실시예에 따라 분할 형태 정보가 4개의 정사각형 형태의 부호화 단위로 분할하는 것을 나타낼 수 없는 경우, 정사각형 형태의 부호화 단위가 분할되는 과정을 도시한다FIG. 18 illustrates a process of dividing a square-shaped encoding unit when the division type information can not indicate division into four square-shaped encoding units according to an embodiment
도 19는 일 실시예에 따라 복수개의 부호화 단위들 간의 처리 순서가 부호화 단위의 분할 과정에 따라 달라질 수 있음을 도시한 것이다.FIG. 19 illustrates that the processing order among a plurality of coding units may be changed according to the division process of the coding unit according to an embodiment.
도 20은 일 실시예에 따라 부호화 단위가 재귀적으로 분할되어 복수개의 부호화 단위가 결정되는 경우, 부호화 단위의 형태 및 크기가 변함에 따라 부호화 단위의 심도가 결정되는 과정을 도시한다.FIG. 20 illustrates a process of determining the depth of an encoding unit according to a change in type and size of an encoding unit when the encoding unit is recursively divided according to an embodiment to determine a plurality of encoding units.
도 21은 일 실시예에 따라 부호화 단위들의 형태 및 크기에 따라 결정될 수 있는 심도 및 부호화 단위 구분을 위한 인덱스(part index, 이하 PID)를 도시한다.FIG. 21 illustrates a depth index (PID) for coding unit classification and depth that can be determined according to the type and size of coding units according to an exemplary embodiment.
도 22는 일 실시예에 따라 픽쳐에 포함되는 복수개의 소정의 데이터 단위에 따라 복수개의 부호화 단위들이 결정된 것을 도시한다.22 shows 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은 일 실시예에 따라 픽쳐에 포함되는 기준 부호화 단위의 결정 순서를 결정하는 기준이 되는 프로세싱 블록을 도시한다.FIG. 23 shows a processing block serving as a reference for determining a determination order of a reference encoding unit included in a picture according to an embodiment.
이하, '영상'은 비디오의 정지영상이거나 동영상, 즉 비디오 그 자체를 나타낼 수 있다.Hereinafter, 'video' may be a still image of a video or a video, that is, a video itself.
이하 '샘플'은, 영상의 샘플링 위치에 할당된 데이터로서 프로세싱 대상이 되는 데이터를 의미한다. 예를 들어, 공간영역의 영상에서 픽셀들이 샘플들일 수 있다.Hereinafter, 'sample' means data to be processed as data assigned to a sampling position of an image. For example, pixels in an image in the spatial domain may be samples.
이하 '현재 블록(Current Block)'은, 부호화 또는 복호화하고자 하는 영상의 블록을 의미할 수 있다.Hereinafter, the 'current block' may refer to a block of an image to be encoded or decoded.
도 1a는 다양한 실시예에 따른 비디오 복호화 장치의 블록도를 도시한다.FIG. 1A shows 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 restoring unit 120.
엔트로피 복호화부(105)는 비트스트림으로부터 수신된 신택스 엘리먼트(syntax element) 정보를 획득하고, 신택스 엘리먼트 정보에 대해 엔트로피 복호화할 수 있다. 이때, 비트스트림으로부터 수신된 신택스 엘리먼트 정보는 영상에 관한 다양한 신택스 엘리먼트에 관한 정보일 수 있다.The entropy decoding unit 105 may obtain syntax element information received from the bitstream and entropy-decode the syntax element information. At this time, the syntax element information received from the bitstream may be information on various syntax elements related to the image.
엔트로피 복호화부(105)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보들을 비트스트림으로부터 획득할 수 있고, 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보에 대해 엔트로피 복호화할 수 있다. 이때, 현재 블록은 도 10 내지 도 23을 참조하여 설명되는 영상을 부/복호화하는 과정에서 이용할 수 있는 데이터 단위일 수 있다.The entropy decoding unit 105 can obtain syntax element information on the current intra-block transformation coefficient from the bitstream and entropy-decode the syntax element information on the current intra-block transformation coefficient. At this time, the current block may be a data unit that can be used in the process of attaching / decrypting an image described with reference to FIG. 10 to FIG.
엔트로피 복호화부(105)는 엔트로피 복호화된 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록 내 변환 계수들에 관한 정보를 획득할 수 있다. 소정의 스캔 순서는 역방향의 다양한 스캔 순서일 수 있다. 여기서 역방향의 스캔 순서란, 블록 내 우측 하단의 픽셀로부터 블록 내 좌측 상단의 변환 계수 픽셀까지를 스캔하는 순서일 수 있다. 좌상측 변환 계수 픽셀부터 우하측에 위치한 변환 계수의 순서로 변환 계수들을 스캔하는 순서는 정방향 스캔 순서로 지칭될 수 있으며, 우하측에 위치한 마지막 변환 계수부터 좌상측 변환 계수의 순서로 변환 계수를 스캔하는 경우는 역방향 스캔 순서로 지칭될 수 있다. 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보는 현재 블록 내 변환 계수가 소정의 값보다 큰 지 여부를 나타내는 플래그(flag) 정보일 수 있다. 이때, 소정의 값은 0보다 크거나 같은 정수 값일 수 있다. 예를 들어, 0, 1 또는 2일 수 있다. The entropy decoding unit 105 may obtain information on the current intra-block transform coefficients by scanning the syntax element information about the transform coefficients in the current entropy-decoded block according to a predetermined scan order. The predetermined scan order may be a reverse scan order. Here, the reverse scan order may be a scan order from the pixels on the lower right side in the block to the transform coefficient pixels on the upper left side in the block. The order in which the transform coefficients are scanned in the order of the transform coefficients located on the lower left side from the upper left side transform coefficient pixels can be referred to as the forward scan order and the transform coefficients are scanned from the last transform coefficient located on the lower right side to the order of the upper left side transform coefficients May be referred to as the reverse scan order. The syntax element information on the current intra-block conversion coefficient may be flag information indicating whether the intra-block conversion coefficient is larger than a predetermined value. At this time, the predetermined value may be an integer value equal to or greater than zero. For example, 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)는 비트스트림에 포함시키지 않을 수 있다.The syntax element information regarding the current intra-block transformation coefficient may be syntax element information indicating a remaining level absolute value. The residual level absolute value may mean the 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 the syntax element information indicating that the absolute value of the transform coefficient is larger 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, where the effective transform coefficient means a transform coefficient whose absolute value of the transform coefficient is larger than 0) Flag (Greater than 1 flag or coeff_abs_level_greater1_flag; hereinafter referred to as GT1 flag) indicating whether or not the value of the flag is greater than 2 and the value of the information (Greater than 0 flag or sig_coeff_flag; hereinafter referred to as GT0 flag) (The Greater than 2 flag or the coeff_abs_level_greater2_flag; referred to as the GT2 flag) may be the absolute value of the base level. Here, when the flag information indicating whether the absolute value of the transform coefficient is larger than the predetermined value is greater than the predetermined value, the value of the flag information may be 1, and if it is smaller than the predetermined value, May be zero. On the other hand, some of the flag information related to the magnitude of the transform coefficients may not be obtained from the bitstream. According to one embodiment, a flag GTn indicating whether the magnitude of the transform coefficient is larger than n (n is an integer), a flag GT (n + 1) indicating whether the magnitude of the transform coefficient is larger than (n + 1) (N + 1), which is a relatively smaller value among the reference values of n, n + 1 and n + 2, when the coefficient GT (n + It is possible to transmit only the flags GTn, GT (n + 1) indicating whether the absolute value of the coefficient is larger and not to include GT (n + 2) 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 each indicate that the absolute value of the transform coefficient is greater than 0 and 1, if the GT2 flag is not included in the bitstream, the entropy decoding unit 105 excludes the GT2 flag, The absolute value of the conversion coefficient obtained by subtracting 2 from the absolute value of the conversion coefficient can be determined as the absolute value of the residual level of the conversion coefficient using only the GT0 flag information and the GT1 flag information.
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 respectively greater than 0, 1, and 2, the entropy decoding unit 105 determines that the absolute value of the transform coefficient is larger than 2, The absolute value can be determined as the absolute value of the residual level of the transform coefficient. That is, the absolute value of the residual level may indicate an absolute value difference between the absolute value of the effective transform coefficient and a predetermined absolute value determined based on information indicating whether the absolute value of the transform coefficient is larger than a predetermined value. ) Acquires the syntax element information received from the bitstream, performs binary arithmetic decoding on the syntax element information, and performs binary arithmetic decoding on the bin string, which is the output generated by the binary arithmetic decoding, It is possible to perform inverse binarization. The binary arithmetic decoding operation can be performed in the binary arithmetic decoding unit 110 and the inverse binarization operation can be performed in the inverse binarization unit 115. [
이진 산술 복호화부(110)는 비트스트림으로부터 획득된 신택스 엘리먼트 정보에 대해 소정의 컨텍스트 모델(context model)에 기초한 이진 산술 복호화를 수행할 수 있다. 여기서 컨텍스트 모델이란, 빈(bin)의 발생 확률에 관한 정보일 수 있다. 빈의 발생 확률에 관한 정보는 두 심볼 0과 1 중 발생 확률이 상대적으로 낮은 심볼인 LPS(Least Propbable Symbol) 및 반대로 높은 심볼인 MPS(Least Probable Symbol) 중 하나의 심볼을 나타내는 정보(valMPS) 및 하나의 심볼의 발생 확률에 관한 정보를 포함할 수 있다. 발생 확률은 0과 1 사이의 값을 갖는다. 따라서, MPS 및 LPS 중 하나의 심볼의 확률이 결정되면, 다른 심볼의 발생 확률에 관한 정보는 1에서 기결정된 심볼에 대한 발생 확률을 뺀 확률에 관한 정보이기 때문에 하나의 심볼에 대한 발생 확률이 결정되면, 이진 산술 복호화부(110)는 나머지 심볼에 대한 발생 확률을 결정할 수 있다. 이때, 먼저 결정되는 하나의 심볼에 대한 발생 확률은 LPS(Least Probable Symbol)의 발생 확률일 수 있다. 한편, 인덱스 값들에 대응하는 심볼의 발생 확률들이 테이블에 미리 결정될 수 있고, 심볼에 대한 발생 확률 정보는 테이블에 결정된 심볼의 발생 확률들을 나타내는 인덱스를 나타내는 정보(pStateIdx)일 수 있다.The binary arithmetic decoding unit 110 may perform binary arithmetic decoding based on a predetermined context model on the syntax element information obtained from the bitstream. Here, the context model may be information on the probability of occurrence of a bin. The information on the probability of occurrence of the bean includes information (valMPS) indicating one symbol of LPS (Least Propable Symbol), which is a relatively low probability of occurrence of two symbols 0 and 1, and a Least Probable Symbol (MPS) And information on the probability of occurrence of one symbol. The occurrence probability has a value between 0 and 1. Therefore, if the probability of one of the MPS and the LPS is determined, the information on the probability of occurrence of the other symbol is information on the probability of subtracting the occurrence probability for the predetermined symbol from 1, The binary arithmetic decoding unit 110 can determine the probability of occurrence of the remaining symbols. In this case, the probability of occurrence of one symbol to be determined first may be the probability of occurrence of LPS (Least Probable Symbol). On the other hand, the occurrence probabilities of symbols corresponding to the index values can be determined in advance in the table, and the occurrence probability information for the symbols can be information (pStateIdx) indicating an index indicating occurrence probabilities of symbols determined in the table.
소정의 컨텍스트 모델은 빈의 위치를 나타내는 인덱스(bin index), 빈이 포함된 블록의 주변 블록에 포함된 빈의 발생 확률 및 현재 블록 또는 주변 블록의 다양한 요소 등에 기초하여 결정될 수 있다.The predetermined context model may be determined based on an index (bin index) indicating the location of the bean, a probability of occurrence of a bean included in a neighboring block of the block including the bean, and various elements of the current block or neighboring blocks.
또는, 이진 산술 복호화부(110)는 비트스트림으부터 획득된 신택스 엘리먼트 정보에 대해 바이패스(by-pass) 모드에 따라 이진 산술 복호화를 수행할 수 있다. 이때, 현재 이진 산술 복호화되는 빈에 대한 0 또는 1이 나올 확률은 0.5로 고정되고, 이러한 확률에 기초하여 신택스 엘리먼트 정보에 대해 이진 산술 복호화를 수행할 수 있다.Alternatively, the binary arithmetic decoding unit 110 may perform binary arithmetic decoding on the syntax element information obtained from the bitstream according to a by-pass mode. At this time, the probability of 0 or 1 for the current binary arithmetic decoding is fixed to 0.5, and binary arithmetic decoding can be performed on the syntax element information based on this probability.
역이진화부(115)는 이진 산술 복호화를 수행하여 생성된 출력값인 빈 스트링(bin string)에 대해 역이진화를 수행할 수 있다. 역이진화부(115)는 소정의 이진화 방법에 대응되는 역이진화 방법에 기초하여 빈 스트링에 대해 역이진화를 수행할 수 있다. 소정의 이진화 방법은 고정 길이(Fixed Length) 이진화 방법, 라이스(Rice) 이진화 방법, 지수-골룸(Exponential-Golomb) 이진화 방법 및 골룸-라이스(Golomb-Rice) 이진화 방법을 포함할 수 있다. 또는, 소정의 이진화 방법은 제1 이진화 방법 및 제2 이진화 방법이 결합된 이진화 방법일 수 있다. 예를 들어, 역이진화부(115)는 신택스 엘리먼트의 빈 스트링 중 일부인 제1 빈 스트링에 대해서는 제1 이진화 방법에 대응되는 역이진화 방법에 기초하여 역이진화하고, 신택스 엘리먼트의 빈 스트링 중 일부인 제2 빈 스트링에 대해서는 제2 이진화 방법에 대응되는 역이진화 방법에 기초하여 역이진화를 수행할 수 있다. 상기 일부의 빈 스트링은 신택스 엘리먼트의 빈 스트링의 프리픽스(prefix) 또는 서픽스(suffix)일 수 있다.The inverse binarization unit 115 may perform inverse binarization on the bin string, which is an output value generated by performing binary arithmetic decoding. The inverse binarization unit 115 may perform inverse binarization on the bin string based on the inverse binarization method corresponding to the predetermined binarization method. The predetermined binarization method may include a fixed length binarization method, a Rice binarization method, an exponential-Golomb binarization method, and a Golomb-Rice binarization method. Alternatively, the predetermined binarization method may be a binarization method in which the first binarization method and the second binarization method are combined. For example, the inverse binarization unit 115 performs inverse binarization on the first bin string, which is a part of the bin string of the syntax element, based on the inverse binarization method corresponding to the first binarization method, For bin strings, 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 relate to a kind of code word that defines a 1: 1 correspondence of the empty string including at least one bin corresponding to the value of the syntax element. In accordance with one of the various types of binarization methods described above in terms of encoding, an empty string containing at least one bin corresponding to the value of the syntax element is determined, and in accordance with an inverse binarization method in terms of decoding, Can be determined. For example, when the bin string A corresponding to the value a (a is a real number) of the syntax element is determined according to a predetermined binarization / inverse binarization method, the process of determining the bin string A based on the value a of the syntax element is binarized , And the process of determining the value a of the syntax element based on the bin string A can be referred to as an inverse binarization process. However, as described above, the binarization and inverse binarization essentially define the mapping relationship between the value of the syntax element and the bin string, and the person skilled in the art can easily understand that binarization / inverse binarization is substantially the same.
엔트로피 복호화부(105)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트 정보를 소정의 스캔 순서에 따라 스캔하여 엔트로피 복호화함으로써 현재 블록 내 변환 계수들에 관한 정보를 획득할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔(zigzag scan)에 따른 순서 또는 역방향의 대각 스캔(diagonal scan)에 따른 순서일 수 있다. 이에 제한되지 않고, 소정의 스캔 순서는 역방향의 수평 스캔에 따른 순서 및 수직 스캔에 따른 스캔 순서 등 다양한 스캔 순서일 수 있다. 소정의 스캔 순서는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표(예를 들어, 직교 좌표계의 x좌표(x는 정수)) 값 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표(예를 들어, 직교 좌표계의 y좌표(y는 정수)) 값 중 적어도 하나에 기초하여 결정될 수 있다. 예를 들어, 엔트로피 복호화부(105)는 수평방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 소정의 스캔 순서를 결정할 수 있다. 엔트로피 복호화부(105)는 수평 방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 복호화부(105)는 수직 방향 좌표 값이 수평방향 좌표 값보다 큰 경우 역방향의 수평 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. The entropy decoding unit 105 can obtain information on the current intra-block transform coefficients by performing the entropy decoding by scanning the syntax element information about the current intra-block transform coefficient according to a predetermined scan order. The predetermined scan order may be a sequence according to a reverse zigzag scan or a sequence according to a diagonal scan in the reverse direction. However, the present invention is not limited to this, and the predetermined scan order may be various scan orders such as a reverse scan order according to a horizontal scan and a scan order according to a vertical scan. The predetermined scanning order is determined by the horizontal coordinate (for example, x coordinate (x is an integer) in the orthogonal coordinate system) of the effective conversion coefficient pixel located at the rightmost position in the current block and the effective conversion coefficient (E.g., the y coordinate of the Cartesian coordinate system (y is an integer)) values of the pixel. For example, the entropy decoding unit 105 may determine a predetermined scan order based on the size of the horizontal direction coordinate value and the size of the vertical direction coordinate value. The entropy decoding unit 105 can determine the vertical scanning order in the reverse direction in a predetermined scanning order when the horizontal direction coordinate value is larger than the vertical direction coordinate value. The entropy decoding unit 105 may determine a horizontal scanning order in the reverse direction as a predetermined scanning order when the vertical direction coordinate value is larger than the horizontal direction coordinate value.
또는, 엔트로피 복호화부(105)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 우선 지그재그 스캔 순서(vertical first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 수직 우선 지그재그 스캔 순서에 대한 구체적인 내용은 도 6b를 참조하여 설명하겠다. 엔트로피 복호화부(105)는 수직방향 좌표 값이 수평방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 수평 우선 지그재그 스캔 순서에 대한 구체적인 내용은 도 6a를 참조하여 설명하겠다. 엔트로피 복호화부(105)는 수직방향 좌표 값이 수평 방향 좌표 값과 동일한 경우, 역방향의 수직 우선 지그재그 스캔 순서 및 수평 우선 지그재그 스캔 순서 중 하나를 소정의 스캔 순서로 결정할 수 있다.Alternatively, the entropy decoding unit 105 may determine a vertical first zigzag scan order in a reverse scan direction in a predetermined scan order when the horizontal direction coordinate value is larger than the vertical direction coordinate value. Details of the vertical priority zigzag scan sequence will be described with reference to FIG. 6B. The entropy decoding unit 105 may determine a horizontal first zigzag scan order in a predetermined scanning order if the vertical direction coordinate value is larger than the horizontal direction coordinate value. The details of the horizontal priority zigzag scan sequence will be described with reference to FIG. 6A. The entropy decoding unit 105 may determine one of the reverse direction vertical priority zigzag scanning order and the horizontal priority zigzag scanning order in a predetermined scanning order when the vertical direction coordinate value is equal to the horizontal direction coordinate value.
또는, 엔트로피 복호화부(105)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. 한편, 엔트로피 복호화부(105)는 수평 방향 좌표 값이 수직방향 좌표 값보다 크지 않은 경우, 역방향의 수직 우선 지그재그 스캔 순서(vertical first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다. Alternatively, if the horizontal coordinate value is larger than the vertical coordinate value, the entropy decoding unit 105 may determine a horizontal first zigzag scan order in a predetermined scanning order. On the other hand, if the horizontal direction coordinate value is not larger than the vertical direction coordinate value, the entropy decoding unit 105 may determine a reverse direction vertical first zigzag scan order in a predetermined scan order.
엔트로피 복호화부(105)는 변환 계수에 관한 정보를 스캔하기에 앞서, 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0인 변환 계수만을 포함할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다.The entropy decoding unit 105 may determine a scan area including all the effective transform coefficients in the current block before scanning the information on the transform coefficients. In this case, the scan area includes all the effective conversion coefficients in the current block, and the remaining area within the current block excluding the scan area may include only the conversion coefficient of 0, which is not an effective conversion coefficient. At this time, when the scan area is scanned according to a predetermined forward scan order from the upper left corner of the scan area, the scan area includes the transform coefficients up to the last effective scan transform coefficient . ≪ / RTI > At this time, the coordinates specifying the scan area may be the coordinates of the effective scan conversion pixel to be scanned last.
엔트로피 복호화부(105)는 비트스트림으로부터 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 획득하고, 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 기초로 스캔 영역을 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 비트스트림으로부터 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 정보를 획득할 수 있다. 이때, 각 정보에 대하여 이진 산술 복호화를 수행하여 각 정보에 대한 빈 스트링을 획득하고, 각 빈 스트링에 대하여 소정의 이진화 방법에 대응하는 역이진화 방법을 이용하여 마지막 유효 변환 계수의 수평방향의 좌표 값 및 마지막 유효 변환 계수의 수직방향 좌표 값을 획득할 수 있다.The entropy decoding unit 105 may obtain information on the coordinates indicating the last effective transform coefficient from the bit stream and determine the scan region based on the information on the coordinates indicating the last effective transform coefficient. For example, the entropy decoding unit 105 may obtain information indicating the coordinate value in the horizontal direction of the last effective conversion coefficient and information indicating the vertical direction coordinate value of the last effective conversion coefficient from the bit stream. At this time, binary arithmetic decoding is performed on each piece of information to obtain a bin string for each piece of information, and an inverse binarization method corresponding to a predetermined binarization method is applied to each bin string to calculate a horizontal coordinate value And the vertical coordinate value of the last effective conversion coefficient.
엔트로피 복호화부(105)는 빈 스트링의 일부인 제1 빈 스트링에 대해 제1 역이진화 방법을 수행하여 제1값을 획득하고, 빈 스트링의 다른 일부인 제2 빈 스트링에 대해 제2 역이진화 방법을 수행하여 제2값을 획득할 수 있다. 제1값 및 제2값에 기초하여 마지막 유효 변환 계수의 수평방향의 좌표 값 및 마지막 유효 변환 계수의 수직방향 좌표 값을 획득할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 역이진화 방법은 고정 길이(fixed-length) 이진화 방법에 대응하는 역이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법에 대응하는 역이진화 방법일 수 있다.The entropy decoding unit 105 performs a first inverse binarization method on the first bin string that is a part of the bin string to obtain a first value and performs a second inverse binarization method on a second bin string that is another part of the bin string To obtain a second value. It is possible to obtain the horizontal coordinate value of the last effective conversion coefficient and the vertical coordinate value of the last effective conversion coefficient based on the first value and the second value. In this case, the first bin 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 bin string may be a suffix and the second inverse binarization method may be an inverse binarization method corresponding to a cutting type unary binarization method.
또는, 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. Alternatively, the scan region may be a quadrangle scan region, the quadrangle scan region may include a horizontal direction coordinate of an effective conversion coefficient pixel located at the rightmost of all effective conversion coefficients in the current block, and an effective conversion coefficient And may be an area specified by the vertical coordinate 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 decoding unit 105 may obtain information on the coordinates specifying the quadrangular scan region from the bit stream and determine the quadrangular scan region based on the information on the coordinates specifying the obtained quadrangular scan region. For example, the entropy decoding unit 105 extracts, from the bitstream, information indicating horizontal coordinate values of effective conversion coefficient pixels located at the rightmost of all the effective conversion coefficients in the current block, Information indicating the vertical coordinate value of the effective conversion coefficient pixel located at the lowermost position can be obtained. At this time, the entropy decoding unit 105 performs binary arithmetic decoding on each piece of information to obtain a bin string for each piece of information, and uses an inverse binarization method corresponding to a predetermined binarization method for an empty string, It is possible to obtain the horizontal coordinate values of the effective conversion coefficient pixels located at the rightmost of the effective conversion coefficients and the vertical coordinate values of the effective conversion coefficient pixels located at the bottom of the effective conversion coefficients. The entropy decoding unit 105 performs a first inverse binarization method on the first bin string that is a part of the bin string to obtain a first value and performs a second inverse binarization method on a second bin string that is another part of the bin string To obtain a second value. The horizontal coordinate value of the effective conversion coefficient pixel located at the rightmost of all the effective conversion coefficients in the current block and the vertical coordinate value of the effective conversion coefficient pixel located at the lowermost one among the effective conversion coefficients in the current block are calculated based on the first value and the second value, Can be obtained. In this case, the first bin 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 bin string may be a suffix and the second inverse binarization method may be an inverse binarization method corresponding to a cutting type unary binarization method.
또는, 엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 획득할 수 있다. 엔트로피 복호화부(105)는 현재 블록의 높이 및 너비에 기초하여 상기 하나의 방향을 결정할 수 있다. Alternatively, the entropy decoding unit 105 may extract, from the bitstream, the horizontal coordinate value of the effective conversion coefficient pixel located at the rightmost of all the effective conversion coefficients in the current block or the lowest position among all the effective conversion coefficients in the current block The information indicating the coordinate value of one of the vertical coordinate values of the effective conversion coefficient pixel and the information indicating the difference between the coordinate value of the one direction and the coordinate value of the remaining direction. The entropy decoding unit 105 can determine the one direction based on the height and width of the current block.
엔트로피 복호화부(105)는 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 비트스트림으로부터 획득할 수 있다. 엔트로피 복호화부(105)는 상기 플래그 정보가 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 비트스트림으로부터 획득함을 나타내는 경우, 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값(또는 마지막 유효 변환 계수 픽셀의 수평방향 좌표 값) 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값(또는 마지막 유효 변환 계수 픽셀의 수직방향 좌표 값) 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득할 수 있다.The entropy decoding unit 105 can obtain, from the bitstream, flag information indicating whether to acquire information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction from the bitstream. If the flag information indicates that information indicating the 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 extracts, from the bitstream, (Or the horizontal coordinate value of the last effective conversion factor pixel) of the effective conversion coefficient pixel located at the rightmost position or the effective direction conversion coefficient pixel located at the bottom of all the effective conversion coefficients in the current block, Value (or the vertical coordinate value of the last effective conversion coefficient pixel), and information indicating the difference between the coordinate value of the one direction and the coordinate value of the remaining direction.
엔트로피 복호화부(105)는 상기 플래그 정보가 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 비트스트림으로부터 획득하지 않음을 나타내는 경우, 비트스트림으로부터 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 정보를 획득할 수 있다.If the flag information indicates that the flag information does not acquire information indicating the difference between the coordinate value in one direction and the coordinate value in the other direction from the bitstream, the entropy decoding unit 105 extracts all the effective transform coefficients Information indicating the horizontal coordinate value of the effective conversion coefficient pixel located at the rightmost position in the current block and information indicating the vertical coordinate value of the effective conversion coefficient pixel located at the lowermost position among all the effective conversion coefficients in the current block .
한편, 엔트로피 복호화부(105)는 현재 블록의 너비 및 높이에 기초하여 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 획득할지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록의 너비 및 높이가 다른 경우(즉, 직사각형인 경우), 비트스트림으로부터 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 획득한다고 결정할 수 있다.On the other hand, the entropy decoding unit 105 determines whether to acquire flag information indicating whether to acquire information indicating a difference between a coordinate value in one direction and a coordinate value in the remaining direction from the bit stream, based on the width and height of the current block Can be determined. For example, the entropy decoding unit 105 obtains information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction from the bit stream when the width and height of the current block are different (i.e., when the width and height are different) And obtain flag information indicating whether the flag information is acquired.
예를 들어, 엔트로피 복호화부(105)는 다음의 수도 코드(pseudo code) 1에 따라 스캔 영역을 특정하기 위한 수평방향을 나타내는 좌표 값 SR_x 및 수직 방향을 나타내는 좌표 값 SR_y를 획득할 수 있다.For example, the entropy decoding unit 105 may obtain a coordinate value SR_x indicating a horizontal direction and a coordinate value SR_y indicating a vertical direction for specifying a scan region according to the following pseudo code 1.
[수도 코드 1] [Water Code 1]
Figure PCTKR2018003830-appb-I000001
Figure PCTKR2018003830-appb-I000001
수도 코드(pseudo code) 1에 의하면, 엔트로피 복호화부(105)는 수평방향의 좌표 값에 관한 정보를 먼저 복호화할 것인지를 나타내는 변수 isXfirst 및 수직 방향의 좌표 값에 관한 정보를 먼저 복호화할 것인지를 나타내는 isYfirst의 값을 0으로 초기화할 수 있다. 또한, 엔트로피 복호화부(105)는 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보 srDeltaFlag를 0으로 초기화할 수 있다.According to the pseudo code 1, the entropy decoding unit 105 outputs a variable isXfirst indicating whether to decode the information about the coordinate value in the horizontal direction first and a variable isXfirst indicating whether to decode the information on the coordinate value in the vertical direction first The value of isYfirst can be initialized to zero. Also, the entropy decoding unit 105 may initialize flag information srDeltaFlag, which indicates whether or not to acquire information indicating a difference between a coordinate value in one direction and a coordinate value in the other direction, to zero.
엔트로피 복호화부(105)는 현재 블록의 너비 W가 현재 블록의 높이 H보다 크거나, 현재 블록의 높이 H가 현재 블록의 너비 W보다 큰 경우, 비트스트림부터 srDeltFlag를 획득하고, srDeltaFlag를 복호화할 수 있다.If the width W of the current block is larger than the height H of the current block or the height H of the current block is larger than the width W of the current block, the entropy decoding unit 105 obtains srDeltFlag from the bitstream and decodes srDeltaFlag have.
엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 1인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득함을 나타내는 경우), 현재 블록의 너비 W가 현재 블록의 높이 H보다 작다면, IsXfirst의 값을 1로 결정할 수 있다.If the value of the decoded srDeltaFlag is 1 (that is, it indicates that information indicating the difference between the coordinate value in one direction and the coordinate value in the remaining direction is acquired), the width W of the current block is If it is smaller than the height H of the current block, the value of IsXfirst can be set to 1.
엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 1인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 수신함을 나타내는 경우), 현재 블록의 너비 W가 현재 블록의 높이 H보다 크다면, IsYfirst의 값을 1로 결정할 수 있다.When the value of the decoded srDeltaFlag is 1 (that is, when it indicates that the information indicating the difference between the coordinate value in one direction and the coordinate value in the remaining direction is received), the entropy decoding unit 105 determines that the width W If it is greater than the height H of the block, the value of IsYfirst can be determined to be 1.
엔트로피 복호화부(105)는 IsXfirst의 값이 1인 경우(수평방향의 좌표 값에 관한 정보를 먼저 복호화함을 나타내는 경우), 수평 방향의 좌표 값을 나타내는 정보 Sr_x 및 수직 방향의 좌표 값과 수평 방향의 좌표 값의 차분을 나타내는 정보(Sr_delta)(Sr_y-Sr_x)를 비트스트림으로부터 획득하여 복호화할 수 있다. 이때, 수직방향의 좌표 값 Sr_y는 Sr_x+Sr_delta로 결정될 수 있다.If the value of IsXfirst is 1 (indicating that the information on the coordinate value in the horizontal direction is to be decoded first), the entropy decoding unit 105 outputs the information Sr_x indicating the coordinate value in the horizontal direction and the coordinate value in the horizontal direction (Sr_delta) (Sr_y-Sr_x) indicating the difference between the coordinate values of the coordinates At this time, the coordinate value Sr_y in the vertical direction can be determined as Sr_x + Sr_delta.
엔트로피 복호화부(105)는 IsYfirst의 값이 1인 경우(수직방향의 좌표 값에 관한 정보를 먼저 복호화함을 나타내는 경우), 수직 방향의 좌표 값을 나타내는 정보 Sr_y 및 수평 방향의 좌표 값과 수직 방향의 좌표 값의 차분을 나타내는 정보(Sr_delta)(Sr_x-Sr_y)를 비트스트림으로부터 획득하여 복호화할 수 있다. 이때, 수직방향의 좌표 값 Sr_x는 Sr_y+Sr_delta로 결정될 수 있다.If the value of IsYfirst is 1 (indicating that the information on the coordinate value in the vertical direction is decoded first), the entropy decoding unit 105 outputs the information Sr_y indicating the vertical coordinate value and the vertical coordinate value (Sr_delta) (Sr_x-Sr_y) indicating the difference between the coordinate values of the coordinates (Sr_x-Sr_y) from the bit stream. At this time, the coordinate value Sr_x in the vertical direction can be determined as Sr_y + Sr_delta.
엔트로피 복호화부(105)는 복호화된 srDeltaFlag의 값이 0인 경우(즉, 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하지 않음을 나타내는 경우), 수평 방향의 좌표 값을 나타내는 정보 Sr_x 및 수직 방향의 좌표 값을 나타내는 정보 Sr_y를 비트스트림으로부터 획득하여 복호화할 수 있다.If the value of the decoded srDeltaFlag is 0 (that is, when it indicates that the information indicating the difference between the coordinate value in one direction and the coordinate value in the remaining direction is not acquired), the entropy decoding unit 105 sets the horizontal coordinate value And information Sr_y indicating the coordinate values in the vertical direction can be obtained from the bit stream and decoded.
엔트로피 복호화부(105)는 계수 복호화(coefficient decoding)에 이용되는 모든 신택스 엘리먼트 정보의 이진 산술복호화에 이용되는 컨텍스트 모델을 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 결정할 수 있다. 예를 들어, 현재 블록의 크기(size)는 현재 블록의 높이 및 너비의 최소값 및 최대값 중 적어도 하나에 따라 결정될 수 있다. 현재 블록의 모양(shape)은 현재 블록의 너비와 높이가 동일한지 여부에 따라서 결정될 수 있다. 게수 복호화에 이용되는 모든 신택스 엘리먼트 정보는 스캔 영역을 특정하기 위한 신택스 엘리먼트 정보 및스캔 영역 내에서 변환 계수에 관한 정보를 포함할 수 있다.The entropy decoding unit 105 can determine the context model used for binary arithmetic decoding of all the 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 a minimum value and a maximum value of the height and width of the current block. The shape of the current block can be determined depending on whether or not the width and height of the current block are the same. All the syntax element information used for power decoding may include syntax element information for specifying a scan area and information about a transform coefficient in the scan area.
예를 들어, 엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1를 다음과 같은 수학식 1에 기초하여 결정할 수 있다.For example, the entropy decoding unit 105 can determine the information size_tu1 on the size of the current block based on Equation (1) below.
Figure PCTKR2018003830-appb-M000001
Figure PCTKR2018003830-appb-M000001
이때, log2_width는 현재 블록의 너비 W에 log2를 취한 값일 수 있고, log2_height는 현재 블록의 높이 H에 log2를 취한 값일 수 있다.In this case, log2_width may be a value obtained by taking log2 as the width W of the current block, and log2_height may be a value obtained by taking log2 as the height H of the current block.
엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1에 대응하는 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines a context model corresponding to the information size_tu1 about the size of the current block, determines a context model for the syntax element information used for coefficient decoding, and uses the context model to perform coefficient decoding The syntax element information can be binary arithmetic-decoded.
또는, 비디오 복호화 장치(100)는 현재 블록의 크기에 관한 정보 size_tu2를 다음과 같은 수학식 2에 기초하여 결정할 수 있다.Alternatively, the video decoding apparatus 100 can determine information size_tu2 on the size of the current block based on Equation (2) below.
Figure PCTKR2018003830-appb-M000002
Figure PCTKR2018003830-appb-M000002
엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines the context model based on the information size_tu2 about the size of the current block, determines the context model for the syntax element information used for coefficient decoding, and uses the context model to decode the coefficients The syntax element information can be binary arithmetic-decoded.
또는, 엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다. Alternatively, the entropy decoding unit 105 may determine the context model based on the information size_tu1 and size_tu2 about the size of the current block, determine the context model for the syntax element information used for coefficient decoding, and use the context model It is possible to binary arithmetic-decode the syntax element information used for decoding.
엔트로피 복호화부(105)는 현재 블록의 크기 및 높이 중 최소값이 무엇인지, 최대값이 무엇인지를 결정하고, 현재 블록의 크기 및 높이 중 최소값 및 최대값에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines what the minimum value and the maximum value of the current block size and height are, determines the context model based on the minimum and maximum values of the size and height of the current block, The context model for the syntax element information to be used for coefficient decoding can be determined and binary arithmetic decoding can be performed on the syntax element information used for coefficient decoding using the context model.
한편, 엔트로피 복호화부(105)는 계수 복호화에 이용되는 모든 신택스 엘리먼트의 이진 산술복호화에 이용되는 컨텍스트 모델을 현재 블록의 모양(shape)에 기초하여 결정할 수 있다.On the other hand, the entropy decoding unit 105 can determine the context model used for binary arithmetic decoding of all the syntax elements used for coefficient decoding based on the shape of the current block.
예를 들어, 엔트로피 복호화부(105)는 현재 블록의 모양에 관한 정보 shape_tu를 하기 수학식 3에 기초하여 결정할 수 있다.For example, the entropy decoding unit 105 may determine information shape_tu about the shape of the current block based on the following equation (3).
Figure PCTKR2018003830-appb-M000003
Figure PCTKR2018003830-appb-M000003
[수학식 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 to be 2 when the width width of the current block is greater than the height height, and determines shape_tu to be 1 when the width width of the current block is smaller than the height height And shape_tu can be set to 0 if width width of the current block is equal to height height. That is, for a rectangle with a width greater than the height, shape_tu is determined to be 2. For a rectangle whose height is greater than the width, shape_tu may be determined to be 1, and for a square, shape_tu may be determined to be 0.
엔트로피 복호화부(105)는 현재 블록의 크기에 관한 정보 shape_tu에 기초하여 컨텍스트 모델을 결정하고, 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 determines the context model based on the information shape_tu about the size of the current block, determines the context model for the syntax element information used for coefficient decoding, and uses the context model to decode The syntax element information can be binary arithmetic-decoded.
엔트로피 복호화부(105)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2 중 적어도 하나와 현재 블록의 모양에 관한 정보 shape_tu에 기초하여 계수 복호화에 이용되는 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 복호화에 이용되는 신택스 엘리먼트 정보를 이진 산술 복호화할 수 있다.The entropy decoding unit 105 can determine the context model for the 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 to be used for coefficient decoding based on at least one of information size_tu1 and size_tu2 about the size of the current block and information shape_tu about the shape of the current block And binary arithmetic decoding of the syntax element information used for coefficient decoding using the context model can be performed.
엔트로피 복호화부(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 decoding unit 105 may change the height and the width of the current block when either the height or width of the current block is different from the height or width of the current block. That is, the horizontal direction coordinate and the vertical direction coordinate of the pixels included in the current block can be swapped with each other. For example, if the width of the current block is greater than the height, the entropy decoding unit 105 may change the height and width of the current block. That is, the horizontal and vertical coordinate values of the pixels included in the current block can be swapped with each other. If the width of the current block is not greater than the height, the entropy decoding unit 105 may not swap horizontal and vertical coordinates of the pixels included in the current block with each other. Without being limited to this, the entropy decoding unit 105 can change the height and the width of the current block to each other when the height of the current block is larger than the width. That is, the horizontal and vertical coordinate values of the pixels included in the current block can be swapped with each other. The entropy decoding unit 105 extracts information on horizontal and vertical coordinates specifying the scan area from the bit stream when the horizontal direction coordinate and the vertical direction coordinate of the pixels included in the current block are swapped with each other And swap the coordinates of the horizontal direction coordinate and the vertical direction coordinate that specify the scan area with each other. The entropy decoding unit 105 may determine the first scan area in the current block that has been swapped based on the coordinates specifying the swapped scan area. The entropy decoding unit 105 scans the information about the transform coefficients included in the first scan region and obtains the first transform coefficient of the changed current block based on the information about the scanned transform coefficients have. When the horizontal direction coordinate and the vertical direction coordinate of the pixels included in the current block are swapped with each other, the entropy decoding unit 105 calculates the horizontal direction coordinate and the vertical direction coordinate with respect to the first transform coefficient of the changed current block, The second transform coefficient in the current block can be obtained. The entropy decoding unit 105 may perform inverse quantization and inverse transform on the second transform coefficient of the current block to generate a residual block of the current block.
예를 들어, 엔트로피 복호화부(105)는 수도코드 2에 따라 스캔 영역을 특정하는 수평방향 좌표(Sr_x 또는 last_x) 및 수직방향 좌표(Sr_y 또는 last_y)를 서로 변경할 수 있다.For example, the entropy decoding unit 105 can change the horizontal coordinate (Sr_x or last_x) and the vertical coordinate (Sr_y or last_y) specifying the scanning region according to the water code 2.
[수도코드 2][Water supply code 2]
Figure PCTKR2018003830-appb-I000002
Figure PCTKR2018003830-appb-I000002
수도코드 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로 결정할 수 있다.The entropy decoding unit 105 decodes the current block TU (Transform Unit) if the width (TU_width) of the current block TU (Transform Unit) is larger than the height TU_height of the current block TU (Transform Unit) The width TU_width of the current block TU and the height TU_height of the current block TU can be mutually changed. The horizontal coordinate and the vertical coordinate of the four corners of the TU determined based on the height and width of the TU in the process of changing the height and the width of the TU may be mutually changed. In addition, the horizontal coordinate and the vertical coordinate of the pixels included in the TU may be swapped with each other. At this time, the entropy decoding unit 105 can determine the value of swap_flag, which indicates whether the height and the width of the TU are mutually changed,
엔트로피 복호화부(105)는 현재 블록인 TU(Transform Unit)의 너비(TU_width)가 현재 블록 TU(Transform Unit)의 높이(TU_height)보다 크지 않은 경우, 현재 블록 TU(Transform Unit)의 너비(TU_width)와 현재 블록 TU(Transform Unit)의 높이(TU_height)를 서로 변경하지 않을 수 있다.The entropy decoding unit 105 determines the width TU_width of the current block TU if the width TU_width of the current block TU_width is not greater than the height TU_height of the current block TU, And the height (TU_height) of the current block TU (Transform Unit) may not be mutually changed.
이때, 엔트로피 복호화부(105)는 TU의 높이와 너비가 서로 변경 되는지 여부를 나타내는 swap_flag의 값을 0으로 결정할 수 있다.At this time, the entropy decoding unit 105 can determine the value of swap_flag, which indicates whether the height and the width of the TU are mutually changed, as zero.
엔트로피 복호화부(105)는 스캔 영역을 특정하기 위해 비트스트림으로부터 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x, Sr_y] 또는 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]에 관한 정보를 파싱할 수 있다.The entropy decoding unit 105 decodes coordinates [Sr_x, Sr_y] for specifying a quadrangular scan region from the bitstream to specify the scan region, or coordinates [last_x, Sr_y] of the effective transformation coefficient scanned last in the TU according to a forward scan order, last_y] can be parsed.
엔트로피 복호화부(105)는 swap_flag의 값이 1인 경우, 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x,Sr_y]를 서로 변경하거나, 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]를 서로 변경할 수 있다.The entropy decoding unit 105 may change the coordinates [Sr_x, Sr_y] for specifying the quadrangular scan region to each other or change the coordinates of the effective transformation coefficient scanned last in the TU according to the forward scanning order [last_x, last_y] can be mutually changed.
예를 들어, 엔트로피 복호화부(105)는 수도코드 3에 따라 스캔 영역을 특정하는 수평방향 좌표(Sr_x 또는 last_x) 및 수직방향 좌표(Sr_y 또는 last_y)를 서로 변경할 수 있다.For example, the entropy decoding unit 105 may change the horizontal direction coordinate (Sr_x or last_x) and the vertical direction coordinate (Sr_y or last_y) specifying the scan region according to the number code 3.
[수도코드 3][Water code 3]
Figure PCTKR2018003830-appb-I000003
Figure PCTKR2018003830-appb-I000003
수도코드 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로 결정할 수 있다.The entropy decoding unit 105 decodes the current block TU (Transform Unit) if the width (TU_width) of the current block TU (Transform Unit) is larger than the height TU_height of the current block TU (Transform Unit) The width TU_width of the current block TU and the height TU_height of the current block TU can be mutually changed. The horizontal coordinate and the vertical coordinate of the four corners of the TU determined based on the height and width of the TU in the process of changing the height and the width of the TU may be mutually changed. In addition, the horizontal coordinate and the vertical coordinate of the pixels included in the TU may be swapped with each other. At this time, the entropy decoding unit 105 can determine the value of swap_flag, which indicates whether the height and the width of the TU are mutually changed,
엔트로피 복호화부(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으로 결정할 수 있다.The entropy decoding unit 105 determines the width TU_width of the current block TU if the width TU_width of the current block TU_width is not greater than the height TU_height of the current block TU, And the height (TU_height) of the current block TU (Transform Unit) may not be mutually changed. At this time, the entropy decoding unit 105 can determine the value of swap_flag, which indicates whether the height and the width of the TU are mutually changed, as zero.
엔트로피 복호화부(105)는 스캔 영역을 특정하기 위한 수평방향의 좌표 값 및 수직방향의 좌표 값 간의 차분 정보를 이용하여 스캔 영역을 특정하기 위한 수평방향의 좌표 값 및 수직방향의 좌표 값을 획득하는지를 나타내는 플래그(deltaXYflag)를 비트스트림으로부터 파싱할 수 있다. 상기 플래그(deltaXYflag)는 비디오 부호화 장치에서 수직방향의 좌표 값이 수평방향 좌표 값보다 큰 경우, 1의 값을 갖도록 생성되고, 그렇지 않으면 0의 값을 갖도록 생성될 수 있다. 만약 deltaXYflag가 0이라면, 엔트로피 복호화부(105)는 수평방향 좌표 값에 관한 정보 및 수직방향 좌표 값에 관한 정보를 별도로 획득하여 엔트로피 복호화하고, 엔트로피 복호화된 정보를 기초로 스캔 영역을 특정하기 위한 좌표를 획득할 수 있다. The entropy decoding unit 105 determines whether to obtain a coordinate value in the horizontal direction and a coordinate value in the vertical direction for specifying the scan region using the difference information between the coordinate value in the horizontal direction and the coordinate value in the vertical direction for specifying the scan region (DeltaXYflag) from the bitstream. The flag deltaXYflag may be generated to have a value of 1 when the coordinate value in the vertical direction is larger than the horizontal direction coordinate value in the video encoding apparatus, and may be generated to have a value of 0 otherwise. If deltaXYflag is 0, the entropy decoding unit 105 separately obtains information on the horizontal direction coordinate value and information on the vertical direction coordinate value, entropy decodes the entropy-decoded information, and outputs the coordinates Can be obtained.
엔트로피 복호화부(105)는 deltaXYflag의 값이 1인 경우, 비트스트림으로부터 스캔 영역을 특정하기 위한 좌표 정보를 파싱할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수평방향 좌표 값에 관한 정보 Sr_x 및 수평방향 좌표 값에 관한 정보와 수직방향 좌표 값 간의 차분에 관한 정보 Sr_xy_delta를 비트스트림으로부터 파싱할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역을 특정하기 위해 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수평방향 좌표 값에 관한 정보 last_x 및 수평방향 좌표 값에 관한 정보와 수직방향 좌표 값 간의 차분에 관한 정보 last_xy_delta를 파싱할 수 있다. If the value of deltaXYflag is 1, the entropy decoding unit 105 can parse the coordinate information for specifying the scan area from the bitstream. For example, the entropy decoding unit 105 parses information Sr_xy_delta, which is information Sr_x about horizontal coordinate values for specifying a quadrangular scan area and information about the difference between information about horizontal coordinate values and vertical coordinate values, from a bitstream can do. Alternatively, the entropy decoding unit 105 may extract information about the horizontal direction coordinate value of the effective transformation coefficient scanned last in the TU and the information about the horizontal direction coordinate value and the information about the vertical direction coordinate value in the vertical direction It is possible to parse the information last_xy_delta on the difference between the coordinate values.
엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수평방향 좌표 값 Sr_x를 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 Sr_x로 결정할 수 있다. 엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하기 위한 수직방향 좌표 값 Sr_y를 비트스트림으로부터 파싱된 Sr_xy_delta에 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 Sr_x를 합한 값으로 결정할 수 있다. The entropy decoding unit 105 may determine the horizontal direction coordinate value Sr_x for specifying the quadrangular scan region to be information Sr_x about the horizontal direction coordinate value parsed from the bitstream. The entropy decoding unit 105 may determine the vertical direction coordinate value Sr_y for specifying the quadrangular scan area as Sr_xy_delta parsed from the bit stream plus the information Sr_x about the horizontal coordinate value parsed from the bit stream.
또는, 엔트로피 복호화부(105)는 deltaXYflag의 값이 1인 경우, 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수평방향 좌표 값 last_x를 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 last_x로 결정할 수 있다. 엔트로피 복호화부(105)는 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 수직방향 좌표 값 last_y를 비트스트림으로부터 파싱된 정보 last_xy_delta에 비트스트림으로부터 파싱된 수평방향 좌표 값에 관한 정보 last_x를 합한 값으로 결정할 수 있다Alternatively, if the value of deltaXYflag is 1, the entropy decoding unit 105 extracts the horizontal direction coordinate value last_x of the effective transformation coefficient scanned last in the TU according to the forward scan order for specifying the scan region from the bitstream It can be determined as information last_x about the horizontal direction coordinate value. The entropy decoding unit 105 extracts the vertical direction coordinate value last_y of the effective transform coefficient scanned last in the TU according to the forward scan order for specifying the scan area from the bit stream to the information last_xy_delta parsed from the bit stream in the horizontal direction The information about the coordinate value last_x can be determined as a sum
엔트로피 복호화부(105)는 swap_flag의 값이 1인 경우, 사각형 스캔 영역을 특정하기 위한 좌표 [Sr_x,Sr_y]를 서로 변경하거나, 스캔 영역을 특정하기 위한 정방향의 스캔 순서에 따라 TU 내 마지막에 스캔되는 유효 변환 계수의 좌표[last_x,last_y]를 서로 변경할 수 있다.If the value of swap_flag is 1, the entropy decoding unit 105 changes the coordinates [Sr_x, Sr_y] for specifying the quadrangular scan region to each other or changes the coordinate [Sr_x, Sr_y] for the last scan in the TU according to the forward scan order for specifying the scan region The coordinates [last_x, last_y] of the effective transformation coefficients to be changed can be mutually changed.
엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 소정의 이진화 방법에 대응하는 역이진화 방법을 기초로 이진 산술 복호화된 정보에 대한 역이진화를 수행하여 사각형 스캔 영역을 특정하는 좌표에 관한 역이진화 정보를 획득할 수 있고, 상기 좌표에 관한 역이진화 정보로부터 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분(color component) 및 빈 인덱스(bin index) 중 적어도 하나에 기초하여 결정될 수 있다. 컬러 성분은 휘도 성분 및 색차 성분을 포함할 수 있다. 빈 인덱스는 신택스 엘리먼트에 관한 빈 스트링 중 현재 이진 산술 복호화되는 빈의 위치를 나타내는 정보일 수 있다. 소정의 이진화 방법에 대응하는 역이진화 방법은 고정 길이(fixed length) 역이진화 방법 및 절삭형 단항(truncated unary) 역이진화 방법 중 적어도 하나일 수 있다. 예를 들어, 엔트로피 복호화부(105)는 이진 산술 복호화된 정보 중 제1 빈 스트링에 대해 고정 길이 역이진화 방법을 이용한 역이진화를 수행하여 제1 역이진화 정보를 획득하고, 이진 산술 복호화된 정보 중 제2 빈 스트링에 대해 절삭형 단항 역이진화 방법을 이용한 역이진화를 수행하여 제2 역이진화 정보를 획득할 수 있다. 엔트로피 복호화부(105)는 제1 역이진화 정보 및 제2 역이진화 정보를 기초로 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다.The entropy decoding unit 105 can perform binary arithmetic decoding based on the context model on the information on the coordinates specifying the quadrangular scan area. The entropy decoding unit 105 may perform inverse binarization on the binary arithmetic decoded information based on the inverse binarization method corresponding to the predetermined binarization method to obtain inverse binarization information on the coordinates specifying the quadrangular scan area, Coordinates from which the quadrangular scan area is specified can be obtained from the inverse binarization information regarding the coordinates. At this time, the context model may be determined based on at least one of the size of the current block, the color component of the current block, and the bin index. The color component may include a luminance component and a chrominance component. The empty index may be information indicating the position of the bin that is currently binary arithmetic decoded among the bin strings related to the syntax element. The inverse binarization method corresponding to a predetermined binarization method may be at least one of a fixed length inverse binarization method and a truncated unary inverse binarization method. For example, the entropy decoding unit 105 performs inverse binarization using the fixed length inverse binarization method on the first bin string of the binary arithmetic decoded information to obtain the first inverse binarization information, The second inverse binarization information may be obtained by performing inverse binarization using the cutting type unary inverse inverse binarization method for the second bin string. The entropy decoding unit 105 may obtain coordinates specifying the quadrangular scan area based on the first inverse binarization information and the second inverse binarization information.
엔트로피 복호화부(105)는 현재 블록 내 스캔 영역에서 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 획득할 수 있다. 이때, 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행될 수 있다.The entropy decoding unit 105 may perform binary arithmetic decoding based on information on the scan coefficients scanned in the current block to obtain binary arithmetic decoding information. At this time, the binary arithmetic decoding can be performed using the context model determined based on at least one of the size and shape of the current block.
엔트로피 복호화부(105)는 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수들에 관한 정보를 획득할 수 있다.The entropy decoding unit 105 may perform inverse binarization on the binary arithmetic decoding information to obtain information on the transform coefficients of the current block.
엔트로피 복호화부(105)는 스캔 영역에서 스캔된 변환 계수들에 관한 정보에 기초하여 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 복호화 및 역이진화 중 적어도 하나를 수행하여 현재 블록의 변환 계수들을 획득할 수 있다. The entropy decoding unit 105 performs at least one of binary arithmetic decoding and inverse binarization based on the context model of the transform coefficients based on the information about the transform coefficients scanned in the scan area to obtain transform coefficients of the current block .
변환 계수들에 관한 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보인 경우, 엔트로피 복호화부(105)는 스캔된 변환 계수들에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 변환 계수들에 관한 정보에 대해 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 변환 계수들에 관한 제1 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보 및 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보이고, 변환 계수들에 관한 제2 정보가 현재 변환 계수와 관련된 이진화 파라메터 정보인 경우, 엔트로피 복호화부(105)는 변환 계수에 관한 제1 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다.If the information on the transform coefficients is information indicating whether the absolute value of the current transform coefficient is larger than a predetermined value, and the residual level absolute value information and the sign information of the current transform coefficient, the entropy decoding unit 105 outputs the transform coefficients It is possible to perform binary arithmetic decoding based on the context model. The entropy decoding unit 105 may perform inverse binarization on the information on the binary-arithmetically decoded transform coefficients to obtain a transform coefficient of the current block. The first information on the transform coefficients is information indicating whether the absolute value of the current transform coefficient is larger than a predetermined value and the residual level absolute value information and the sign information of the current transform coefficient, In the case of the binarization parameter information related to the coefficient, the entropy decoding unit 105 may perform binary arithmetic decoding based on the context model with respect to the first information on the transform coefficient.
엔트로피 복호화부(105)는 이진 산술 복호화된 제1 정보에 대해 제2 정보에 포함된 이진화 파라메터 정보에 기초한 역이진화를 수행하여 현재 블록의 변환 계수를 획득할 수 있다. 이진화 파라메터 정보는 현재 변환 계수에 대한 라이스 파라메터(Rice Parameter) 정보일 수 있다. 라이스 파라메터는 빈스트링에 포함된 프리픽스의 길이를 결정하기 위한 정보일 수 있다.이에 제한되지 않고, 이진화 파라메터 정보는 현재 변환 계수에 대한 다양한 이진화 파라메터 정보일 수 있다.The entropy decoding unit 105 may perform inverse binarization based on the binary parameter information included in the second information with respect to the first information subjected to the binary arithmetic decoding so as to obtain the transform coefficient of the current block. 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 bin string. Without being limited thereto, 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값을 기초로 현재 블록의 잔여레벨 절대값에 관한 값을 획득할 수 있다.If the first information on the transform coefficients is the residual level absolute value information of the current transform coefficient, the entropy decoding unit 105 performs a (truncated) Rice binarization method on the residual level absolute value information of the current transform coefficient A value relating to the absolute value of the residual level of the current transform coefficient can be obtained by using the inverse binarization method corresponding to the corresponding inverse binarization method and the exponential Gollum binarization method. For example, the entropy decoding unit 105 performs inverse binarization on the prefix of the bin string of the residual level absolute value information of the current transform coefficient using an inverse binarization method corresponding to the Rice binarization method based on the Rice parameter The first value relating to the absolute value of the residual level of the current transform coefficient is obtained and the inverse binarization using the inverse binarization method corresponding to the exponential smoothed binarization method is performed on the suffix of the bin string of the residual level absolute value information Obtains a second value relating to an absolute value of a residual level of a current transform coefficient, and based on a first value relating to an absolute value of a residual level of the current transform coefficient and a second value relating to an absolute value of a residual level of the current transform coefficient, A value relating to the absolute value of the residual level of the residual level.
상기 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치 및 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.The context model for the first transform coefficient among the context models related to the transform coefficients includes information on at least one second transform coefficient previously scanned in accordance with a predetermined scan order, position and color of the first transform coefficient in the current block, Information about the right or lower peripheral transformation coefficient, and the scan position of the first transformation coefficient.
예를 들어, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 위치의 우측 또는 하측의 변환 계수들 중 절대값이 0보다 큰 우측 또는 하측의 변환 계수의 개수에 기초하여 결정될 수 있다.For example, the context model relating to the flag information indicating whether the first conversion coefficient is greater than 0 is based on the number of the right or lower conversion coefficients whose absolute value among the right or lower conversion coefficients of the predetermined position is larger than 0 Can be determined.
이에 제한되지 않고, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수)개의 변환 계수들 중 절대값이 0보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다.The context model for flag information indicating whether the first transform coefficient is greater than 0 is not limited to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 0 Can be determined based on the number of large effective conversion coefficients.
또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 제1 변환 계수의 위치 및 대응하는 주변 우측 또는 하측의 유효 계수 그룹 플래그들에 기초하여 결정될 수 있다.Alternatively, the context model relating to the 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 peripheral right or lower effective coefficient group flags.
엔트로피 복호화부(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 decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is larger 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 smaller than a predetermined threshold value thred1, the entropy decoding unit 105 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy decoding unit 105 sets the context index to a predetermined context offset offset2 And determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction pos_y in the current block is smaller than the predetermined threshold value thred3, the entropy decoding unit 105 sets the context index to a predetermined context offset offset3 And determine the context model based on the increased context index.
엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 decodes the size of the scan area, the number of already scanned transform coefficients in the scan area, the relative position of the first transform coefficient in the scan area, and the relative position of the first transform coefficient in the first position where the first transform coefficient is scanned according to a predetermined scan order And determining whether the first conversion coefficient is greater than 0 based on at least one of the presence or absence of the coefficient.
예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 4에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다. For example, the entropy decoding unit 105 can determine the size size_sr of the quadrangular scan area on the basis of the following equation (4). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000004
Figure PCTKR2018003830-appb-M000004
다만, 이에 제한되지 않고, 스캔 영역이 마지막 유효 변환 계수 픽셀의 좌표에 의해 특정되는 경우, size_sr은 그 스캔 영역에 포함된 변환 계수 픽셀의 수일 수 잇다.However, without being limited thereto, if the scan area is specified by the coordinates of the last effective conversion factor pixel, then size_sr may be the number of the conversion factor pixels included in the scan area.
엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다.The entropy decoding unit 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 quadrangular scan area. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold thred2, the entropy decoding unit 105 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset3 and determine the context model based on the increased context index. However, the threshold values thred1 and thred2 are merely examples, and various values can be determined based on the size_sr.
엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is larger than 0 based on the relative positions of the first transform coefficients in the scan area.
엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 determines whether or not the first transform coefficient is greater than 0 based on the horizontal direction coordinate value pos_x and the vertical direction coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the square scan region The context model relating to the 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]일 수 있다.If the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the entropy decoding unit 105 can increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can be determined based on sr_x and sr_y.
엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치인 경우에 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치가 아닌 경우, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다. 이때, 사각형 스캔 영역의 우측 하단 모서리에 위치하는 픽셀의 변환 계수는 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수일 수 있다.The entropy decoding unit 105 can determine the context model of the flag information indicating whether the first transform coefficient is greater than 0 or not based on whether the first transform coefficient is a transform coefficient of the first position scanned in the reverse scan order . That is, the entropy decoding unit 105 determines the first context model related to the flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is the first position scanned in the reverse scan order, 1 conversion coefficient is not the first position to be scanned in the reverse scan order, the second context model may be determined regarding the flag information indicating whether the first conversion coefficient is greater than zero. In this case, the transform coefficients of the pixels positioned at the lower right corner of the quadrangular scan region may be the transform coefficients of the first position scanned in the reverse scan order.
또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보(GT0 플래그 정보)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (GT0 flag information) indicating whether the first transform coefficient is greater than 0 may be obtained by adding GT0 flag information of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order, The GT0 flag information of the position, color component, and neighboring right or lower n (n is a positive integer) conversion coefficients of the first conversion coefficient, whether the first conversion coefficient on the scan order is the conversion coefficient of the first position in the scan area, And whether or not the first transformation coefficient in the scan order is a transformation coefficient of the final position in the scan area.
제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 위치의 우측 또는 하측의 변환 계수 중 절대값이 1보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the absolute value of the first conversion coefficient is larger than 1 is determined based on the number of the right or lower effective conversion coefficients whose absolute value of the right or lower conversion coefficient of the predetermined position is larger than 1 .
엔트로피 복호화부(105)는 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. The entropy decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is larger 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 smaller than a predetermined threshold value thred1, the entropy decoding unit 105 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy decoding unit 105 sets the context index to a predetermined context offset offset2 And determine the context model based on the 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과 그 값이 상이할 수 있다.If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction pos_y in the current block is smaller than the predetermined threshold value thred3, the entropy decoding unit 105 sets the context index to a predetermined context offset offset3 And determine the context model based on the increased context index. At this time, the offsets offset1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 1 and predetermined thresholds thred1, 2, and 3 are flag information indicating whether the first conversion coefficient is greater than 0 The offsets offset 1, 2 and 3 associated with the context model with respect to the threshold values thred 1, 2, and 3 and their values may be different.
엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 calculates the number of transform coefficients that have already been scanned in the scan region, the relative position of the first transform coefficients in the scan region, and the first zero, that is, the first transform coefficient is scanned according to a predetermined scan order And determining whether the first conversion coefficient is larger than 1 based on at least one of whether or not the conversion coefficient is a non-conversion coefficient at a position other than the first conversion coefficient.
예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 5에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy decoding unit 105 can determine the size size_sr of the quadrangular scan area on the basis of the following equation (5). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000005
Figure PCTKR2018003830-appb-M000005
엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 0보다 큰 변환 계수의 개수일 수 있다.The entropy decoding unit 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 quadrangular scan area. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order. However, the present invention is not limited to this, and cnt_pos may be the number of transform coefficients larger than all zero scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan region.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold thred2, the entropy decoding unit 105 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset3 and determine the 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 merely examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first transform coefficient is greater than 1, and predetermined thresholds thred 1 and thred 2 are related to flag information indicating whether the first transform coefficient is greater than zero Those skilled in the art will readily understand that the offsets offset 1, 2, and 3 associated with the context model may differ from the threshold values thred 1 and thred 2 and their values.
엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is greater than 1 based on the relative position of the first transform coefficients in the scan area.
엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 determines whether or not the first transform coefficient is greater than 1 based on the horizontal direction coordinate value pos_x and the vertical direction 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 region The context model relating to the 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 the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the video decoding apparatus 100 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can 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 thresholds thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 1 and predetermined thresholds thred1_x, thred1_y, thred2_x, and thred2_y relate to the flags indicating whether the first conversion coefficient is greater than 0 It will be readily appreciated by those skilled in the art that the offsets offset 1, 2, and 3 associated with the context model for the information may differ from the threshold values thred1_x, thred1_y, thred2_x, and thred2_y.
엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 determines whether or not the first conversion coefficient is larger than 1 based on whether the first conversion coefficient is a conversion coefficient of the first position among the conversion coefficients larger than 0 that are scanned in the reverse scan order Can be determined. That is, when the first transform coefficient is the first one of the transform coefficients larger than 0, which is scanned in the reverse scan order, the video decoding apparatus 100 determines 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 one when the first transform coefficient is not the first one of the transform coefficients greater than 0 scanned in the reverse scan order, Can be determined.
이에 제한되지 않고, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the absolute value of the first transform coefficient is larger than 1 is not limited to the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order Can be determined based on the number of effective transform coefficients greater than one.
또는, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 이전에 복호화된 GT1 플래그 정보 및 이전에 복호화된 그룹 내 GT1 플래그 정보에 기초하여 결정될 수 있다.Alternatively, the context model relating to flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on GT1 flag information previously decoded in the corresponding coefficient group and GT1 flag information previously decoded in the group.
또는, 제1 변환 계수의 절대값이 1보다 큰지를 나타내는 플래그 정보(GT1 플래그 정보)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (GT1 flag information) indicating whether the absolute value of the first transform coefficient is larger than 1 is obtained by adding GT1 flag information of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order, The GT1 flag information of the position, color component, and neighboring right or lower n (n is a positive integer) conversion coefficients of the first transform coefficient in the block, whether the first transform coefficient is the transform coefficient of the first position in the scan area, And whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the absolute value of the first transform coefficient is larger than 2 can be determined based on the number of the right or lower effective transform coefficients whose absolute value is larger 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 decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is larger 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 smaller than a predetermined threshold value thred1, the entropy decoding unit 105 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy decoding unit 105 sets the context index to a predetermined context offset offset2 And determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction pos_y in the current block is smaller than the predetermined threshold value thred3, the entropy decoding unit 105 sets the context index to a predetermined context offset offset3 And determine the context model based on the increased context index. At this time, the offsets offset1, 2 and 3 associated with the context model relating to the flag information indicating whether the first transform coefficient is larger than 2 and predetermined thresholds thred1, 2 and 3 indicate whether the first transform coefficient is larger than 0 and 1 The offsets offset 1, 2, and 3 associated with the context model for the flag information and the predetermined threshold values thred 1, 2, and 3 may differ.
엔트로피 복호화부(105)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치(또는, 1보다 큰 변환 계수들 중 첫번째 위치)의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 calculates the number of transform coefficients that have already been scanned in the scan region, the relative position of the first transform coefficients in the scan region, and the first zero, that is, the first transform coefficient is scanned according to a predetermined scan order And determining whether the first transform coefficient is greater than one based on at least one of whether the transform coefficient is a transform coefficient of a position (or a transform coefficient of a transform coefficient larger than 1).
예를 들어, 엔트로피 복호화부(105)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 6에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy decoding unit 105 can determine the size size_sr of the quadrangular scan area on the basis of the following equation (6). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000006
Figure PCTKR2018003830-appb-M000006
엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 그 절대값이 1보다 큰 모든 변환 계수의 개수일 수 있다.The entropy decoding unit 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 quadrangular scan area. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order. However, cnt_pos may be the number of all transform coefficients whose absolute value scanned before scanning the first transform coefficient among the transform coefficients in the quadrangular scan area is larger than unity.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold thred2, the entropy decoding unit 105 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 복호화부(105)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset3 and determine the 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 merely examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 0 or 1 and predetermined thresholds thred 1 and thred 2 indicate whether the first conversion coefficient is greater than 0 or 1 Those skilled in the art will readily understand that the offsets offset 1, 2, and 3 associated with the context model for flag information may differ from the threshold values thred 1 and thred 2 and their values.
엔트로피 복호화부(105)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 can determine the context model related to the flag information indicating whether the first transform coefficient is larger than 2 based on the relative positions of the first transform coefficients in the scan area.
엔트로피 복호화부(105)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 determines whether or not the first transformation coefficient is greater than 2 based on the horizontal direction coordinate value pos_x and the vertical direction 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 region The context model relating to the 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]일 수 있다.If the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the entropy decoding unit 105 can increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy decoding unit 105 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can 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 thresholds thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model related to flag information indicating whether the first conversion coefficient is greater than 0 or 1 and predetermined thresholds thred1_x, thred1_y, thred2_x, and thred2_y, Those skilled in the art can easily understand that the offsets offset 1, 2, and 3 associated with the context model related to the flag information indicating may be different from the threshold values thred1_x, thred1_y, thred2_x, and thred2_y.
엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(105)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy decoding unit 105 determines whether or not the first transform coefficient is larger than 2 based on whether the first transform coefficient is a transform coefficient of the first position among the transform coefficients larger than 0 that are scanned in the reverse scan order Can be determined. That is, if the first transform coefficient is the first one of the transform coefficients larger than 0, which is scanned in the reverse scan order, the entropy decoding unit 105 outputs the first transform coefficient, A second context model for flag information indicating whether the first transform coefficient is greater than one when the first transform coefficient is not the first one of the transform coefficients greater than 0 scanned in 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 to this, and the entropy decoding unit 105 may determine whether or not the first transform coefficient is equal to or greater than 2 based on whether the first transform coefficient is the transform coefficient of the first position among the transform coefficients larger than 1, The context model can be determined. That is, if the first transform coefficient is the first one of the transform coefficients larger than 1, which is scanned in the reverse scan order, the entropy decoding unit 105 determines 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 two if the first transform coefficient is not the first one of the transform coefficients greater than one scanned in 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 to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 2 Can be determined based on the number of large effective conversion coefficients.
또는, 제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 해당 계수 그룹 내 이전에 복호화된 GT2 플래그 정보 및 이전에 복호화된 그룹 내 GT2 플래그 정보에 기초하여 결정될 수 있다.Alternatively, the context model on the flag information indicating whether the absolute value of the first transform coefficient is larger than 2 may be determined based on the previously decoded GT2 flag information and the previously decoded in-group GT2 flag information in the corresponding coefficient group.
또는, 제1 변환 계수의 절대값이 2보다 큰지를 나타내는 플래그 정보(이하 GT2 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT2 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT2 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (hereinafter referred to as GT2 flag information) indicating whether the absolute value of the first transform coefficient is greater than 2 may be used as the GT2 flag of the previously scanned n (n is a positive integer) Information and the position of the first transform coefficient in the current block, the color component, and GT2 flag information of the adjacent right or lower n (n is a positive integer) transform coefficients, the transform coefficient of the first position in the scan area And whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
또는, 제1 변환 계수가 m(m은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보(이하 GTm 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보, 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, flag information (hereinafter referred to as GTm flag information) indicating whether the first transform coefficient is larger than m (m is an integer larger than 2) is n (n is a positive integer) scanned previously according to a predetermined scan order The GTm flag information of the transform coefficients, the position of the first transform coefficient in the current block, the chrominance component, and the GTm flag information of the adjacent right or lower n (n is a positive integer) transform coefficients, Whether it is a transform coefficient of the initial position, and whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
한편, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다.On the other hand, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the absolute level of the level of the peripheral effective transform coefficient on the right side or the lower side of the first transform coefficient.
예를 들어, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 소정의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.For example, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the sum of the absolute level of the level of the predetermined peripheral effective transform coefficient on the right side or the lower side of the first transform coefficient.
또는, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 이전에 부호화된 레벨 값에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the previously encoded level value.
또는, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 최초 위치의 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be obtained from 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, (N is a positive integer) number of adjacent right or lower n-th conversion coefficients, whether the first conversion coefficient in the scan order is a conversion coefficient of the first position in the scan area, Whether it is a transform coefficient of the final position in the region, whether or not the first transform coefficient in the scan order is a coefficient of the initial position in the coefficient group, and the like.
엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [SRx,0](SRx는 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수평방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [SRx,Y](Y는 0보다 크고 SRy보다 작거나 같은 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. The entropy decoding unit 105 determines whether or not the position of the transform coefficient currently scanned in the scan region is [SRx, 0] (where SRx is an integer and SRx is the horizontal coordinate value of the right boundary pixel of the scan region on the basis of the left upper- (Y is an integer greater than 0 and less than or equal to SRy, and SRy represents a lower boundary of the scan region with respect to the upper left corner coordinate of the scan region in accordance with a predetermined scan order) The GT0 flag information of the transform coefficient currently scanned from the bit stream is not acquired and the value of the GT0 flag information can be determined to be 1. [
마찬가지로, 엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. Likewise, the entropy decoding unit 105 determines that the position of the transform coefficient currently scanned in the scan region is [0, SRy] (where SRy is an integer and SRy is the vertical coordinate of the lower boundary of the scan region on the basis of the upper left corner coordinate of the scan region) (X, SRy) (where X is an integer greater than 0 and less than or equal to SRx, SRx is an integer equal to or greater than 0, The GT0 flag information of the currently scanned transform coefficient is not obtained from the bit stream and the value of the GT0 flag information can be determined to be 1 .
한편, 엔트로피 복호화부(105)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림에 유효 변환 계수의 GT1 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.On the other hand, the entropy decoding unit 105 can determine the maximum number of GT1 flag information of the current effective conversion coefficient in the block, and receive the GT1 flag information in the current block from the bit stream within the maximum coefficient of the determined effective conversion coefficient . That is, when the entropy decoding unit 105 receives the maximum number of GT1 flag information of the effective conversion coefficient received from the bitstream, the entropy decoding unit 105 determines whether the GT1 flag information of the effective conversion coefficient exists in the bitstream I can not check it anymore.
엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT1 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT1 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT1 플래그 정보의 최대 개수 MaxCount_GT1를 하기와 같은 수학식 7에 기초하여 결정할 수 있다.The entropy decoding unit 105 can determine all non-zero effective conversion coefficients as the maximum number of GT1 flag information in the current block. Alternatively, the entropy decoding unit 105 can determine the maximum number of GT1 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 can determine the maximum number MaxCount_GT1 of the GT1 flag information based on Equation (7) below.
Figure PCTKR2018003830-appb-M000007
Figure PCTKR2018003830-appb-M000007
이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area.
K1은 스캔 영역의 크기와 GT1 플래그 간 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. Th1은 미리 정해진 임계값일 수 있다. 예를 들어, Th1은 16,8 일 수 있다. 다만 이에 제한되지 않고, K1 및 Th1은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.K1 can be the magnitude of the scan area and the adjustment factor between the GT1 flags. For example, it may be an integer greater than one. Th1 may be a predetermined threshold value. For example, Th1 may be 16,8. Those skilled in the art can easily understand that K1 and Th1 can have various values, without being limited thereto.
엔트로피 복호화부(105)는 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT2 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT2 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림에 유효 변환 계수의 GT2 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.The entropy decoding unit 105 may determine the maximum number of GT2 flag information in the current block and receive GT2 flag information in the current block from the bit stream within the maximum coefficient of the determined effective transform coefficient. That is, when the entropy decoding unit 105 receives the maximum number of GT2 flag information of the effective conversion coefficient received from the bitstream, the entropy decoding unit 105 determines whether the GT2 flag information of the effective conversion coefficient exists in the bitstream I can not check it anymore.
엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT2 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT2 플래그 정보의 최대 개수 MaxCount_GT2를 하기와 같은 수학식 8에 기초하여 결정할 수 있다.The entropy decoding unit 105 can determine all non-zero effective conversion coefficients as the maximum number of GT2 flag information in the current block. Alternatively, the entropy decoding unit 105 can determine the maximum number of GT2 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 can determine the maximum number of GT2 flag information MaxCount_GT2 based on the following expression (8).
[수학식 8]&Quot; (8) "
Figure PCTKR2018003830-appb-I000004
Figure PCTKR2018003830-appb-I000004
이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 스캔 영역의 크기와 GT2 플래그 간 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. K2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area. K2 can be the magnitude of the scan area and the adjustment factor between GT2 flags. For example, it may be an integer greater than one. K2 may be a predetermined threshold value. For example, Th2 may be 16,8. Those skilled in the art can easily understand that K2 and Th2 can have various values, without being limited thereto.
엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득할 수 있다. 여기서, 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지 여부(또는, 계수 그룹에 0인 변환 계수만을 포함하고 있는지 여부)를 나타내는 플래그 정보일 수 있다. 상기 플래그 정보는 유효 계수 그룹 플래그(significant coefficient group flag) 정보라고 칭할 수 있다. 엔트로피 복호화부(105)는 비트스트림으로부터 획득된 현재 계수 그룹에 관한 정보를 기초로 현재 계수 그룹 내 변환 계수에 관한 정보를 스캔할 수 있다. 예를 들어, 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있지 않음을 나타내면, 엔트로피 복호화부(105)는 변환 계수에 대한 정보의 스캔없이 계수 그룹 내 변환 계수의 값을 0으로 유도할 수 있다. 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있음을 나타내면 엔트로피 복호화부(105)는 변환 계수에 대한 정보를 소정의 스캔 순서에 따라 스캔하여 계수 그룹 내 변환 계수를 획득할 수 있다.The entropy decoding unit 105 can obtain information on the current intra-block coefficient group from the bitstream. Here, the information on the coefficient group may be flag information indicating whether or not the coefficient group includes at least one effective transform coefficient (or whether or not the coefficient group includes only a transform coefficient of zero). The flag information may be referred to as significant coefficient group flag information. The entropy decoding unit 105 can scan information on the current coefficient group intra-coefficient transform coefficients based on the information on the current coefficient group obtained from the bit stream. For example, if the information on the coefficient group indicates that the coefficient group does not contain at least one effective transform coefficient, the entropy decoding unit 105 sets the value of the transform coefficient in the coefficient group without scanning the information about the transform coefficient 0 < / RTI > If the information on the coefficient group indicates that the coefficient group includes at least one effective transform coefficient, the entropy decoding unit 105 scans information on the transform coefficient according to a predetermined scan order to acquire a transform coefficient in the coefficient group .
이때, 엔트로피 복호화부(105)는 스캔 영역에 포함된 변환 계수들을 소정의 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다.At this time, the entropy decoding unit 105 can determine one coefficient group for every predetermined K number of transform coefficients included in the scan region (K is an integer) scanned according to a predetermined scan order. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order that is the opposite direction of the predetermined reverse scan order.
따라서, 엔트로피 복호화부(105)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. Accordingly, the entropy decoding unit 105 can 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 in the current block. If the number of transform coefficients included in the current block is not an integral multiple of K, the last coefficient group among the groups of coefficients scanned according to the forward scan order may include a smaller number of transform coefficients.
다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.However, the present invention is not limited to this, and the entropy decoding unit 105 may perform a reverse scan order in which the coefficients located at the lower right end among the transform coefficients included in the current block are scanned up to a coefficient located at the upper left of the transform coefficients included in the current block It will be readily appreciated by those skilled in the art that scanning may be performed in accordance with the present invention to determine a coefficient group.
다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득하지 않고, 소정의 스캔 순서에 따라 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다. 계수 그룹을 결정하는 이유는 엔트로피 복호화부(105)가 계수 그룹에 따라 처리하는 동작(부호 데이터 숨김(Sign Data Hiding) 등의 동작)을 수행하기 위함이다. 엔트로피 복호화부(105)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 하나의 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 비트스트림으로부터 해당 계수 그룹에 관한 정보를 획득하지 않고, GT0 플래그 정보를 비트스트림으로부터 획득할 수 있다. Those skilled in the art can easily understand that the entropy decoding unit 105 can determine a coefficient group according to a predetermined scanning order without acquiring information on the current intra-block coefficient group from the bitstream. The reason for determining the coefficient group is to perform an operation (such as sign data hiding) for the entropy decoding unit 105 to process according to the coefficient group. If one of the groups of coefficients scanned according to a predetermined scan order includes only one transform coefficient, the entropy decoding unit 105 does not acquire information on the corresponding coefficient group from the bitstream, Information can be obtained from the bitstream.
엔트로피 복호화부(105)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy decoding unit 105 can determine whether to hide the sign of at least one transform coefficient for each coefficient group included in the current block. For example, the entropy decoding unit may decide to hide the sign of one or two transform coefficients for each coefficient group included in the current block, as the case may be.
엔트로피 복호화부(105)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy decoding unit 105 may scan the information on the transform coefficients in the quadrangular 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, those skilled in the art will readily understand that the predetermined scan order is not limited to the above-mentioned reverse scan order and may include various reverse scan orders.
엔트로피 복호화부(105)는 스캔된 변환 계수들에 관한 정보에 기초하여 현재 블록의 변환 계수를 획득할 수 있다. The entropy decoding unit 105 can obtain the transform coefficients of the current block based on the information about the scanned transform coefficients.
영상 복원부(120)는 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. The image restoring unit 120 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block.
영상 복원부(120)는 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다.The image restoring unit 120 may restore the current block based on the residual block of the current block.
영상 복원부(120)는 현재 블록에 대하여 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있다. 영상 복원부(120)는 현재 블록의 예측 블록 및 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 즉, 영상 복원부(120)는 예측 블록에 포함된 픽셀들의 값과 레지듀얼 블록에 포함된 픽셀들의 값을 합하여 현재 블록에 포함된 픽셀들의 값을 복원할 수 있다. The image restoring unit 120 may perform inter-prediction or intra-prediction on the current block to generate a prediction block of the current block. The image restoring unit 120 may restore the current block based on the prediction block of the current block and the residual block of the current block. That is, the image restoring unit 120 may restore the values of the pixels included in the current block by adding the values of the pixels included in the prediction block and the values of the pixels included in the residual block.
엔트로피 복호화부(105)는 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 대해 컨텍스트 모델에 기초한 이진 산술 복호화를 수행할 수 있다. 엔트로피 복호화부(105)는 이진 산술 복호화된 정보에 대해 소정의 역이진화 방법을 이용한 역이진화를 수행하여 사각형 스캔 영역을 특정하는 좌표에 관한 역이진화 정보를 획득할 수 있고, 상기 좌표에 관한 역이진화 정보를 기초로 사각형 스캔 영역을 특정하는 좌표를 획득할 수 있다. 이때, 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 컬러 성분 및 빈 인덱스 중 적어도 하나에 기초하여 결정될 수 있다. 컬러 성분은 휘도 성분 및 색차 성분을 포함할 수 있다. 빈 인덱스는 신택스 엘리먼트에 관한 빈 스트링 중 현재 이진 산술 복호화되는 빈의 위치를 나타내는 정보일 수 있다. 여기서, 소정의 역이진화 방법은 고정 길이 역이진화 방법 및 절삭형 단항 역이진화 방법 중 적어도 하나일 수 있다.The entropy decoding unit 105 can perform binary arithmetic decoding based on the context model on the information on the coordinates specifying the quadrangular scan area. The entropy decoding unit 105 can perform inverse binarization using the inverse binarization method on the binary arithmetic decoded information to obtain inverse binarization information related to the coordinates specifying the quadrangular scan area, Coordinates to specify a rectangular scan area can be obtained based on the information. At this time, the context model may be determined based on at least one of the size of the current block, the color component of the current block, and the empty index. The color component may include a luminance component and a chrominance component. The empty index may be information indicating the position of the bin that is currently binary arithmetic decoded among the 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 decoding unit 105 may perform at least one of binary arithmetic decoding and inverse binarization based on the context model for the effective transform coefficients based on the information about the scanned effective transform coefficients to obtain transform coefficients of the current block have. If 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, the residual level information, and the sign information of the current effective transform coefficient, the entropy decoding unit 105 performs the effective transform Binary arithmetic decoding based on the context model can be performed on the information about the coefficients. The entropy decoding unit 105 may perform inverse binarization on the binary arithmetic decoding decoded information on the effective transform coefficients to obtain a transform coefficient of the current block. Wherein the first information on the effective transform coefficients is information indicating whether the information on the effective transform coefficients is larger than the absolute value of the current effective transform coefficient and the residual level information and the sign information of the current effective transform coefficient, When the second information on the coefficients is binarization parameter information, the entropy decoding unit 105 can perform binary arithmetic decoding based on the context model on the first information on the effective transform coefficients. The entropy decoding unit 105 may perform inverse binarization based on the binary parameter information included in the second information with respect to the first information subjected to the binary arithmetic decoding so as to obtain the transform coefficient of the current block. The context model related to the first transform coefficient among the context models related to the flag information of the transform coefficients may be previously scanned according to a predetermined scan order Based on at least one of information about at least one second transform coefficient, position and color components of the first transform coefficient in the current block, information about the right or lower peripheral transform coefficient, and the scan position of the first transform coefficient have.
제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 0보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 0 can be determined based on the number of the right and lower effective conversion coefficients whose absolute values are larger than zero.
이에 제한되지 않고, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 0보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model for flag information indicating whether the first transform coefficient is greater than 0 is not limited to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 0 Can be determined based on the number of large effective conversion coefficients.
또는, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보(이하 GT0 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT0 플래그 정보, 제1 변환 계수가 스캔 영역 내 첫번째 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (hereinafter referred to as GT0 flag information) indicating whether the first conversion coefficient is greater than 0 may include GT0 flag information of n (n is a positive integer) conversion coefficients previously scanned according to a predetermined scan order, The GT0 flag information of the position of the first transform coefficient in the block, the color component and the adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is the transform coefficient of the first position in the scan area, And whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 1보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first transform coefficient is larger than 1 can be determined based on the number of the right and lower effective transform coefficients whose absolute values are larger than 1.
이에 제한되지 않고, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model of the flag information indicating whether the first transform coefficient is greater than 1 is not limited to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is larger than 1 Can be determined based on the number of large effective conversion coefficients.
또는, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보(이하 GT1 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보, 제1 변환 계수가 스캔 영역 내 첫번째 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the flag information (hereinafter referred to as GT1 flag information) indicating whether the first conversion coefficient is greater than 1 is obtained by adding GT1 flag information of n (n is a positive integer) conversion coefficients previously scanned according to a predetermined scan order, The GT1 flag information of the position of the first transform coefficient in the block, the color component, and the adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is the transform coefficient of the first position in the scan area, And whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. 2 이때, 제2이에 제한되지 않고, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 2보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 2 can be determined based on the number of the right and lower effective conversion coefficients whose absolute values are larger than 2. 2 At this time, the context model relating to the flag information indicating whether the first conversion coefficient is larger than 2 is not limited to the second, and the context model of the n (n is a positive integer) Can be determined based on the number of effective transform coefficients whose absolute values are greater than two.
또는, 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보(이하 GT2 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GT1 플래그 정보, 제1 변환 계수가 스캔 영역 내 첫번째 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, flag information (hereinafter, referred to as GT2 flag information) indicating whether the first conversion coefficient is greater than 2 may be obtained by adding GT1 flag information of n (n is a positive integer) conversion coefficients previously scanned according to a predetermined scan order, The GT1 flag information of the position of the first transform coefficient in the block, the color component, and the adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is the transform coefficient of the first position in the scan area, And whether or not the first transform coefficient is a transform coefficient of the final position in the scan area.
또는, 제1 변환 계수가 m(m은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보(이하 GTm 플래그 정보라 함)는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보 및 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 GTm 플래그 정보, 제1 변환 계수가 스캔 영역 내 첫번째 위치의 변환 계수인지 여부, 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, flag information (hereinafter referred to as GTm flag information) indicating whether the first transform coefficient is larger than m (m is an integer larger than 2) is n (n is a positive integer) scanned previously according to a predetermined scan order The GTm flag information of the transform coefficients, the position of the first transform coefficient in the current block, the chrominance component, and the GTm flag information of the adjacent right or lower n (n is a positive integer) transform coefficients, Whether the first transform coefficient is the transform coefficient of the first position, and whether the first transform coefficient is the transform coefficient of the final position in the scan area.
한편, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다.On the other hand, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the absolute level of the level of the peripheral effective transform coefficients on the right side and the lower side of the first transform coefficient.
예를 들어, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.For example, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the sum of the absolute levels of the levels 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 to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 2 Can be determined based on the number of large effective conversion coefficients.
제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 1보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first transform coefficient is larger than 1 can be determined based on the number of the right and lower effective transform coefficients whose absolute values are larger than 1.
제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 및 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 2 can be determined based on the number of the right and lower effective conversion coefficients whose absolute values are larger than 2.
한편, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다. 예를 들어, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 및 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.On the other hand, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the absolute level of the level of the peripheral effective transform coefficients on the right side and the lower side of the first transform coefficient. For example, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the sum of the absolute levels of the levels 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 on the absolute value of the residual level of the first transform coefficient is obtained by dividing the level of the previously-scanned n (n is an integer) transform coefficients according to a predetermined scan order, the position of the first transform coefficient in the current block, (N is a positive integer) number of adjacent right or lower n-th transform coefficients, whether the first transform coefficient in the scan order is the transform coefficient of the first position in the scan region, whether the first transform coefficient is in the scan region Whether it is a transform coefficient of the final position, whether or not the first transform coefficient in the scan order is a coefficient of the first position in the coefficient group, and the like.
엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [SRx,0](SRx는 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수평방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [SRx,Y](Y는 0보다 크고 SRy보다 작거나 같은 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. The entropy decoding unit 105 determines whether or not the position of the transform coefficient currently scanned in the scan region is [SRx, 0] (where SRx is an integer and SRx is the horizontal coordinate value of the right boundary pixel of the scan region on the basis of the left upper- (Y is an integer greater than 0 and less than or equal to SRy, and SRy represents a lower boundary of the scan region with respect to the upper left corner coordinate of the scan region in accordance with a predetermined scan order) The GT0 flag information of the transform coefficient currently scanned from the bit stream is not acquired and the value of the GT0 flag information can be determined to be 1. [
마찬가지로, 엔트로피 복호화부(105)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 비트스트림으로부터 현재 스캔되는 변환 계수의 GT0 플래그 정보를 획득하지 않고, GT0 플래그 정보의 값을 1로 결정할 수 있다. Likewise, the entropy decoding unit 105 determines that the position of the transform coefficient currently scanned in the scan region is [0, SRy] (where SRy is an integer and SRy is the vertical coordinate of the lower boundary of the scan region on the basis of the upper left corner coordinate of the scan region) (X, SRy) (where X is an integer greater than 0 and less than or equal to SRx, SRx is an integer equal to or greater than 0, The GT0 flag information of the currently scanned transform coefficient is not obtained from the bit stream and the value of the GT0 flag information can be determined to be 1 .
한편, 엔트로피 복호화부(105)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림으로부터 유효 변환 계수의 GT1 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.On the other hand, the entropy decoding unit 105 can determine the maximum number of GT1 flag information of the current effective conversion coefficient in the block, and receive the GT1 flag information in the current block from the bit stream within the maximum coefficient of the determined effective conversion coefficient . That is, when the entropy decoding unit 105 receives the maximum number of GT1 flag information of the effective conversion coefficient received from the bitstream, the entropy decoding unit 105 determines whether the GT1 flag information of the effective conversion coefficient exists from the bitstream I can not check it anymore.
엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT1 플래그 정보의 최대 개수로 결정할 수 있다. 또는 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT1 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT1 플래그 정보의 최대 개수MaxCount_GT1를 하기와 같은 수학식 9에 기초하여 결정할 수 있다.The entropy decoding unit 105 can determine all non-zero effective conversion coefficients as the maximum number of GT1 flag information in the current block. Or the entropy decoding unit 105 can determine the maximum number of GT1 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 can determine the maximum number MaxCount_GT1 of the GT1 flag information based on Equation (9) below.
Figure PCTKR2018003830-appb-M000008
Figure PCTKR2018003830-appb-M000008
이때, 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은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area. K1 can be the magnitude of the scan area and the adjustment factor between the GT1 flags. For example, it may be an integer greater than one. Th1 may be a predetermined threshold value. For example, Th1 may be 16,8. Those skilled in the art can easily understand that K1 and Th1 can have various values, without being limited thereto.
엔트로피 복호화부(105)는 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT2 플래그 정보를 비트스트림으로부터 수신할 수 있다. 즉, 엔트로피 복호화부(105)는 비트스트림으로부터 수신된 유효 변환 계수의 GT2 플래그 정보를 최대 개수만큼 수신하면, 이후에 엔트로피 복호화부(105)는 비트스트림으로부터 유효 변환 계수의 GT2 플래그 정보가 있는지를 더 이상 확인하지 않을 수 있다.The entropy decoding unit 105 may determine the maximum number of GT2 flag information in the current block and receive GT2 flag information in the current block from the bit stream within the maximum coefficient of the determined effective transform coefficient. That is, when the entropy decoding unit 105 receives the maximum number of GT2 flag information of the effective conversion coefficient received from the bitstream, the entropy decoding unit 105 determines whether the GT2 flag information of the effective conversion coefficient exists from the bitstream I can not check it anymore.
엔트로피 복호화부(105)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT2 플래그 정보의 최대 개수로 결정할 수 있다. 또는 엔트로피 복호화부(105)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 GT2 플래그 정보의 최대 개수MaxCount_GT2를 하기와 같은 수학식 10에 기초하여 결정할 수 있다.The entropy decoding unit 105 can determine all non-zero effective conversion coefficients as the maximum number of GT2 flag information in the current block. Or the entropy decoding unit 105 can determine the maximum number of GT2 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 can determine the maximum number MaxCount_GT2 of the GT2 flag information based on the following expression (10).
Figure PCTKR2018003830-appb-M000009
Figure PCTKR2018003830-appb-M000009
이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 조절 계수일 수 있다. 예를 들어, 1보다 큰 정수일 수 있다. K2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area. K2 can be an adjustment factor. For example, it may be an integer greater than one. K2 may be a predetermined threshold value. For example, Th2 may be 16,8. Those skilled in the art can easily understand that K2 and Th2 can have various values, without being limited thereto.
엔트로피 복호화부(105)는 비트스트림으로부터 현재 블록 내 계수 그룹에 관한 정보를 획득할 수 있다. 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지를 나타내는 플래그 정보일 수 있다. 이때, 엔트로피 복호화부(105)는 스캔 영역에 포함된 변환 계수들을 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다. 여기서 말하는 소정의 역방향 스캔 순서는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 순서를 의미할 수 있다.The entropy decoding unit 105 can obtain information on the current intra-block coefficient group 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. At this time, the entropy decoding unit 105 may determine one coefficient group for every predetermined K number of transform coefficients included in the scan region (K is an integer) scanned according to the scan order. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order that is the opposite direction of the predetermined reverse scan order. The predetermined backward scan order referred to herein may mean a scan order 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.
따라서, 엔트로피 복호화부(105)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수으로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. 다만 이에 제한되지 않고, 엔트로피 복호화부(105)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.Accordingly, the entropy decoding unit 105 can 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 in the current block. If the number of transform coefficients included in the current block is not an integral multiple of K, the last coefficient group among the groups of coefficients scanned according to the forward scan order may include a smaller number of transform coefficients. However, the present invention is not limited to this, and the entropy decoding unit 105 may perform a reverse scan order in which the coefficients located at the lower right end among the transform coefficients included in the current block are scanned up to a coefficient located at the upper left of the transform coefficients included in the current block It will be readily appreciated by those skilled in the art that scanning may be performed in accordance with the present invention to determine a coefficient group.
엔트로피 복호화부(105)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 비트스트림으로부터 계수 그룹에 관한 정보를 획득하지 않고, GT0 플래그 정보만을 비트스트림으로부터 획득할 수 있다. The entropy decoding unit 105 does not acquire the information on the coefficient group from the bitstream and outputs only the GT0 flag information if the last coefficient group among the groups of coefficients scanned according to a predetermined scanning order includes only one transform coefficient Can be obtained from the bitstream.
엔트로피 복호화부(105)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 복호화부는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy decoding unit 105 can determine whether to hide the sign of at least one transform coefficient for each coefficient group included in the current block. For example, the entropy decoding unit may decide to hide the sign of one or two transform coefficients for each coefficient group included in the current block, as the case may be.
엔트로피 복호화부(105)는 사각형 스캔 영역 내 유효 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy decoding unit 105 may scan the information on the effective transformation coefficients in the quadrangular 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, those skilled in the art will readily understand that the predetermined scan order is not limited to the above-mentioned reverse scan order and may include various reverse scan orders.
엔트로피 복호화부(105)는 스캔된 유효 변환 계수들에 관한 정보에 기초하여 현재 블록의 변환 계수를 획득할 수 있다. The entropy decoding unit 105 can obtain the transform coefficients of the current block based on the information about the scanned effective transform coefficients.
영상 복원부(120)는 현재 블록의 변환 계수들에 대해 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. The image restoring unit 120 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficients of the current block.
영상 복원부(120)는 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다.The image restoring unit 120 may restore the current block based on the residual block of the current block.
영상 복원부(120)는 현재 블록에 대하여 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있다. 영상 복원부(120)는 현재 블록의 예측 블록 및 현재 블록의 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 즉, 영상 복원부(120)는 예측 블록에 포함된 픽셀들의 값과 레지듀얼 블록에 포함된 픽셀들의 값을 합하여 현재 블록에 포함된 픽셀들의 값을 복원할 수 있다. 옵티컬 플로우에 대해서는 도 3a에 관련된 설명에서 후술하겠다. The image restoring unit 120 may perform inter-prediction or intra-prediction on the current block to generate a prediction block of the current block. The image restoring unit 120 may restore the current block based on the prediction block of the current block and the residual block of the current block. That is, the image restoring unit 120 may restore the values of the pixels included in the current block by adding the values of the pixels included in the prediction block and the values of the pixels included in the residual block. The optical flow will be described later with reference 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 restoring unit 120. The video decoding unit will be described with reference to FIG. 1E. FIG. 1B shows a flowchart of a video decoding method according to various embodiments.
S105 단계에서, 비디오 복호화 장치(100)는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 획득하고, 상기 획득된 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 기초로 스캔 영역을 결정할 수 있다.In step S105, the video decoding apparatus 100 can determine a scan area including all the effective transform coefficients in the current block. At this time, when the scan area is scanned according to a predetermined forward scan order from the upper left corner of the scan area, the scan area includes the transform coefficients up to the last effective scan transform coefficient . ≪ / RTI > At this time, the coordinates specifying the scan area may be the coordinates of the effective scan conversion pixel to be scanned last. The video decoding apparatus 100 may obtain information on the coordinate indicating the last effective transform coefficient from the bit stream and determine the scan area based on the information on the coordinate indicating the obtained last effective transform coefficient.
또는 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. 비디오 복호화 장치(100)는 비트스트림으로부터 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 획득하고, 상기 획득된 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 기초로 사각형 스캔 영역을 결정할 수 있다.Alternatively, the scan area may be a rectangular scan area, the rectangular scan area may include horizontal coordinate of the effective conversion coefficient pixel positioned at the rightmost of all the effective conversion coefficients in the current block, and effective conversion coefficient pixel located at the lowermost position in the current block And may be an area specified by the vertical direction coordinates of the pixel. The video decoding apparatus 100 may obtain information on the coordinates specifying the quadrangular scan area from the bitstream and determine the quadrangular scan area based on the information on the coordinates specifying the obtained quadrangle scan area.
S110 단계에서, 비디오 복호화 장치(100)는 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서 또는 역방향의 대각 스캔 순서를 포함할 수 있다. 지그재그 스캔 순서는 수직 우선 지그재그 스캔 순서 또는 수평 우선 지그재그 스캔 순서를 포함할 수 있다.S115 단계에서, 비디오 복호화 장치(100)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성할 수 있다. 이때, 비디오 복호화 장치(100)는 현재 블록의 크기 및 모양 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 이진 산술 복호화를 수행할 수 있다.In step S110, the video decoding apparatus 100 may scan the information on the intra-scan conversion coefficients in a predetermined scanning order. The predetermined scan order may include a reverse zigzag scan order or a reverse diagonal scan order. The zigzag scan order may include a vertical priority zigzag scan order or a horizontal priority zigzag scan order. In step S115, the video decoding apparatus 100 performs binary arithmetic decoding based on information on the scanned transform coefficients, It is possible to generate arithmetically decoded information. At this time, the video decoding apparatus 100 may perform binary arithmetic decoding using the 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 the information about the transform coefficients included in the scan area according to a predetermined scan order, performs inverse binarization on the binary arithmetic decoded information, Can be obtained.
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 transform based on the information on the transform coefficients of the current block. That is, the video decoding apparatus 100 obtains the transform coefficients of the current block based on the information on the transform coefficients of the current block, performs inverse quantization and inverse transform on the transform coefficients of the current block, Can be generated.
S130 단계에서, 비디오 복호화 장치(100)는 레지듀얼 블록에 기초하여 현재 블록을 복원할 수 있다. 비디오 복호화 장치(100)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성하고, 비디오 복호화 장치(100)는 현재 블록의 예측 블록에 포함된 픽셀 값과 레지듀얼 블록의 픽셀 값을 합하여 현재 블록의 복원 블록의 픽셀 값을 생성할 수 있다.In step S130, the video decoding apparatus 100 may restore 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 a current block. The video decoding apparatus 100 adds the pixel values of the residual blocks to the pixel values included in the prediction blocks of the current block The pixel value of the reconstruction block of the current block can be generated.
도 1c는 다양한 실시예에 따른 비디오 부호화 장치의 블록도를 도시한다.1C shows a block diagram of a video encoding apparatus according to various embodiments.
다양한 실시예에 따른 비디오 부호화 장치(150)는 엔트로피 부호화부(155) 및 비트스트림 생성부(170)를 포함한다.The video encoding apparatus 150 according to various embodiments includes an entropy encoding unit 155 and a bitstream generation unit 170.
엔트로피 부호화부(155)는 현재 블록 내 변환 계수에 관한 신택스 엘리먼트에 대해 엔트로피 부호화할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 변환 계수들에 관한 2차원 배열 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록 내 변환 계수들에 관한 1차원 배열 정보를 생성하고, 현재 블록 내 변환 계수들에 관한 1차원 배열 정보에 대해 엔트로피 부호화할 수 있다. The entropy encoding unit 155 can perform entropy encoding on the syntax element related to the intra-block transformation coefficient. The entropy encoding unit 155 scans the two-dimensional array information about the current intra-block transform coefficients according to a predetermined scan order to generate one-dimensional array information about the current intra-block transform coefficients, Can be entropy-encoded with respect to the one-dimensional array information about the one-dimensional array information.
변환 계수에 관한 신택스 엘리먼트는 변환 계수가 소정의 값보다 큰 지를 나타내는 플래그일 수 있다. 이때, 소정의 값은 0보다 크거나 같은 값일 수 있다. 예를 들어, 0, 1 또는 2일 수 있다. 또한, 변환 계수에 관한 잔여 레벨(remaining level) 절대값을 나타내는 신택스 엘리먼트일 수 있다. 즉, 잔여 레벨(remaining level) 절대값은 변환 계수 절대값과 소정의 값보다 큰 지에 기초하여 결정된 소정의 절대값 간의 절대값 차이를 나타낼 수 있다. 또한, 유효 변환 계수에 관한 신택스 엘리먼트는 유효 변환 계수의 부호에 관한 신택스 엘리먼트일 수 있다. The syntax element related to the conversion coefficient may be a flag indicating whether the conversion coefficient is larger than a predetermined value. At this time, the predetermined value may be a value equal to or greater than zero. For example, 0, 1 or 2. It may also be a syntax element indicating the absolute level of the remaining level with respect to the transform coefficients. That is, the absolute value of the remaining level may indicate an absolute value difference between a predetermined absolute value determined based on whether the absolute value of the conversion coefficient is larger than a predetermined value. The syntax element related to the effective conversion coefficient may be a syntax element related to the sign of the effective conversion coefficient.
먼저, 엔트로피 부호화부(155)는 신택스 엘리먼트에 대해 이진화를 수행하여 빈 스트링(bin)을 생성하고, 빈 스트링에 대해 이진 산술 부호화를 수행하여 신택스 엘리먼트에 대해 엔트로피 부호화된 정보를 생성할 수 있다. 이때, 이진화는 이진화부(160)에서 수행될 수 있고, 이진 산술 부호화는 이진 산술 부호화부(165)에서 수행될 수 있다.First, the entropy encoding unit 155 may perform binarization on the syntax element to generate an empty string, and perform binary arithmetic encoding on the empty string to generate entropy-encoded information for the syntax element. At this time, the binarization may be performed in the binarization unit 160, and the binary arithmetic encoding may be performed in 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 perform binarization on a predetermined syntax element to generate an empty string. 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 Golomb-Rice binarization method. Or the predetermined binarization method may be a binarization method in which the first binarization method and the second binarization method are combined. For example, the binarization unit 160 may binarize a portion of a syntax element based on a first binarization method to generate a first bin string, and for another portion of the syntax element, a second binarization method To generate a second bin string. ≪ RTI ID = 0.0 > Here, the first empty string may be part of the empty string of the syntax element, and the second empty string may be another part of the empty string of the syntax element. A portion of the empty string may be a prefix or a suffix.
이진 산술 부호화부(165)는 소정의 신택스 엘리먼트에 관한 빈 스트링에 대해 소정의 컨텍스트 모델에 기초한 이진 산술 부호화를 수행할 수 있다. 또는, 이진 산술 부호화부(165)는 소정의 신택스 엘리먼트에 관한 빈 스트링에 대해 소정의 컨텍스트 모델 없이 이진 산술 부호화를 수행할 수 있다. 이때, 현재 이진 산술 부호화되는 빈(bin)에 대한 0 또는 1이 나올 확률은 0,5로 고정되고, 이러한 확률에 기초하여 이진 산술 부호화를 수행할 수 있다.The binary arithmetic coding unit 165 may perform binary arithmetic coding based on a predetermined context model for an empty string regarding a predetermined syntax element. Alternatively, the binary arithmetic coding unit 165 may perform binary arithmetic coding on a bin string relating to a predetermined syntax element without a predetermined context model. At this time, the probability of 0 or 1 for the current binary arithmetic coding bin is fixed to 0, and binary arithmetic coding can be performed based on this probability.
엔트로피 부호화부(155)는 현재 블록의 변환 계수를 획득할 수 있다. 즉, 비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수를 생성할 수 있다. 엔트로피 부호화부(155)는 상기 생성된 현재 블록의 변환 계수를 획득할 수 있다.The entropy encoding unit 155 can obtain the transform coefficients of the current block. That is, the video encoding apparatus 150 can generate a prediction block of the current block by performing inter prediction or intra prediction, and generates 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 convert and quantize the residual block of the current block to generate a transform coefficient of the current block. The entropy encoding unit 155 may obtain the transform coefficients of the generated current block.
엔트로피 부호화부(155)는 현재 블록의 변환 계수에 관한 정보를 결정하고, 현재 블록의 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하여 현재 블록의 변환 계수에 관한 1차원 배열 정보를 생성하고, 1차원 배열 정보에 대해 엔트로피 부호화를 수행할 수 있다. 소정의 스캔 순서는 역 지그재그 스캔에 따른 순서 또는 역 대각 스캔에 따른 순서일 수 있다. 이에 제한되지 않고, 역 수평 스캔에 따른 순서 및 역 수직 스캔에 따른 스캔 순서 등 다양한 스캔 순서일 수 있다. 소정의 스캔 순서는 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 중 적어도 하나에 기초하여 결정될 수 있다. 엔트로피 부호화부(155)는 수평방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 소정의 스캔 순서를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 수평 방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수직 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직 방향 좌표 값이 수평방향 좌표 값보다 큰 경우 역방향의 수평 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. The entropy encoding unit 155 determines information on the transform coefficients of the current block, generates information about the transform coefficients of the current block in accordance with a predetermined scan order, generates one-dimensional array information on the transform coefficients of the current block , And entropy encoding can be performed on the one-dimensional array information. The predetermined scan order may be a sequence according to an inverse zigzag scan or an order according to an inverse diagonal scan. But the present invention is not limited thereto, and may be various scanning sequences such as a sequence according to reverse horizontal scanning and a scanning sequence according to reverse vertical scanning. The predetermined scan order may be determined based on at least one of the horizontal coordinate of the effective conversion coefficient pixel located at the rightmost position in the current block and the vertical direction of the effective conversion coefficient pixel located at the bottommost position in the current block. The entropy encoding unit 155 can determine a predetermined scan order based on the size of the horizontal direction coordinate value and the size of the vertical direction coordinate value. For example, if the horizontal direction coordinate value is larger than the vertical direction coordinate value, the entropy encoding unit 155 can determine the reverse vertical scanning order in a predetermined scanning order. The entropy encoding unit 155 may determine the horizontal scan order in the reverse direction as a predetermined scan order when the vertical direction coordinate value is larger than the horizontal direction coordinate value.
또는, 엔트로피 부호화부(155)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우 역방향의 수직 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직방향 좌표 값이 수평방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수직방향 좌표 값이 수평 방향 좌표 값과 동일한 경우, 역방향의 수직 우선 지그재그 스캔 순서 및 수평 우선 지그재그 스캔 순서 중 하나를 소정의 스캔 순서로 결정할 수 있다.Alternatively, the entropy encoding unit 155 may determine the reverse direction vertical priority zigzag scan order in a predetermined scan order when the horizontal direction coordinate value is larger than the vertical direction coordinate value. The entropy encoding unit 155 can determine the horizontal priority zigzag scan order in the reverse direction in a predetermined scan order when the vertical direction coordinate value is larger than the horizontal direction coordinate value. The entropy encoding unit 155 may determine one of the vertical first zigzag scan order and the horizontal priority zigzag scan order in the reverse direction in a predetermined scan order when the vertical direction coordinate value is equal to the horizontal direction coordinate value.
또는, 엔트로피 부호화부(155)는 수평방향 좌표 값이 수직방향 좌표 값보다 큰 경우, 역방향의 수평 우선 지그재그 스캔 순서를 소정의 스캔 순서로 결정할 수 있다. 엔트로피 부호화부(155)는 수평 방향 좌표 값이 수직방향 좌표 값보다 크지 않은 경우, 역방향의 수평 우선 지그재그 스캔 순서(horizontal first zigzag scan order)를 소정의 스캔 순서로 결정할 수 있다.Alternatively, if the horizontal direction coordinate value is larger than the vertical direction coordinate value, the entropy encoding unit 155 can determine the reverse horizontal zigzag scanning order in a predetermined scanning order. The entropy encoding unit 155 may determine a horizontal first zigzag scan order in the reverse direction in a predetermined scan order when the horizontal direction coordinate value is not larger than the vertical direction coordinate value.
먼저, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0의 값을 갖는 변환 계수만을 포함할 수 있다. 이때, 스캔 영역은 스캔 영역의 좌측 상단의 변환 계수부터, 소정의 정방향 스캔 순서에 따라 스캔되는 경우, 가장 마지막에 스캔되는 유효 변환 계수(이하, 마지막 유효 변환 계수라 함)까지의 변환 계수들을 포함하는 영역일 수 있다. 이때, 스캔 영역을 특정하는 좌표는 마지막 스캔되는 유효 변환 계수 픽셀의 좌표일 수 있다. First, the entropy encoding unit 155 can determine a scan area including all the effective transform coefficients in the current block. At this time, the scan area includes all the effective conversion coefficients in the current block, and the remaining area in the current block excluding the scan area may include only the conversion coefficient having a value of 0, which is not an effective conversion coefficient. At this time, when the scan area is scanned according to a predetermined forward scan order from the upper left corner of the scan area, the scan area includes the transform coefficients up to the last effective scan transform coefficient . ≪ / RTI > At this time, the coordinates specifying the scan area may be the coordinates of the effective scan conversion pixel to be scanned last.
엔트로피 부호화부(155)는 마지막 유효 변환 계수를 나타내는 좌표에 관한 정보를 생성할 수 있다. 예를 들어, 엔트로피 복호화부(105)는 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.이때, 엔트로피 부호화부(155)는 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트에 대해 이진화하여 빈 스트링을 생성하고, 빈 스트링에 대해 이진 산술 복호화를 수행하여 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.The entropy encoding unit 155 can generate information on the coordinates indicating the last effective transformation coefficient. For example, the entropy decoding unit 105 may generate syntax element information indicating a coordinate value in the horizontal direction of the last valid conversion coefficient and syntax element information indicating a vertical coordinate value of the last valid conversion coefficient. In this case, The encoding unit 155 binarizes the syntax element indicating the coordinate value in the horizontal direction of the last effective transformation coefficient and the syntax element indicating the vertical coordinate value of the last effective transformation coefficient to generate an empty string, Decoding can be performed to generate syntax element information indicating horizontal coordinate values of the last valid conversion coefficient and syntax element information indicating vertical coordinate values of the last valid conversion coefficient.
엔트로피 부호화부(155)는 신택스 엘리먼트 값 중 일부 제1값에 대해 제1 이진화 방법을 수행하여 제1 빈 스트링을 생성하고, 신택스 엘리먼트 값 중 다른 일부 제2값에 제2 이진화 방법을 수행하여 제2 빈 스트링을 생성할 수 있다. 제1 빈 스트링 및 제2 빈 스트링을 포함하는 빈 스트링을 생성할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 이진화 방법은 고정 길이(fixed-length) 이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법일 수 있다.The entropy encoding unit 155 generates a first bin string by performing a first binarization method on some first values of the syntax element values and performs a second binarization method on a second part of the syntax element values 2 You can create an empty string. A first empty string, and a second empty string. In this case, the first bin string may be a prefix, and the first binarization method may be a fixed-length binarization method. The second bin string may be a suffix and the second inverse binning method may be a cutting type unary binarization method.
또는, 엔트로피 부호화부(155)는현재 블록 내 모든 유효 변환 계수들 중 마지막 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 마지막 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 생성할 수 있다. Alternatively, the entropy encoding unit 155 may obtain information indicating a coordinate value of one of the horizontal coordinate value of the last effective conversion coefficient pixel or the vertical coordinate value of the last effective conversion coefficient pixel among all the effective conversion coefficients in the current block, and Information indicating a difference between the coordinate value in the one direction and the coordinate value in the remaining direction can be generated.
또는, 스캔 영역은 사각형 스캔 영역일 수 있고, 사각형 스캔 영역은 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 및 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표에 의해 특정된 영역일 수 있다. Alternatively, the scan region may be a quadrangle scan region, the quadrangle scan region may include a horizontal direction coordinate of an effective conversion coefficient pixel located at the rightmost of all effective conversion coefficients in the current block, and an effective conversion coefficient And may be an area specified by the vertical coordinate of the pixel.
엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트 정보를 생성할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 신택스 엘리먼트 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다. 이때, 엔트로피 부호화부(155)는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값을 나타내는 신택스 엘리먼트 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값을 나타내는 신택스 엘리먼트에 대해 이진화하여 빈 스트링을 생성하고, 빈 스트링에 대해 이진 산술 복호화를 수행하여 마지막 유효 변환 계수의 수평방향의 좌표 값을 나타내는 신택스 엘리먼트 정보 및 마지막 유효 변환 계수의 수직방향 좌표 값을 나타내는 신택스 엘리먼트 정보를 생성할 수 있다.The entropy encoding unit 155 can generate syntax element information about coordinates specifying a quadrangular scan area. For example, the entropy encoding unit 155 encodes the syntax element information indicating the horizontal coordinate value of the effective conversion coefficient pixel located at the rightmost of all the effective conversion coefficients in the current block, It is possible to generate the syntax element information indicating the vertical coordinate value of the effective conversion coefficient pixel located on the lower side. At this time, the entropy encoding unit 155 encodes the syntax element indicating the horizontal direction coordinate value of the effective transformation coefficient pixel located at the rightmost among all the effective transformation coefficients in the current block, The binary element arithmetic decoding unit performs binary arithmetic decoding on the empty string to generate syntax element information indicating the coordinate value in the horizontal direction of the last effective transformation coefficient, It is possible to generate syntax element information indicating the vertical coordinate value of the last effective transformation coefficient.
엔트로피 부호화부(155)는 신택스 엘리먼트 값 중 일부 제1 값에 대해 제1 이진화 방법을 수행하여 제1 빈 스트링을 생성하고, 신택스 엘리먼트 값 중 다른 일부 제2값에 제2 이진화 방법을 수행하여 제2 빈 스트링을 생성할 수 있다. 제1 빈 스트링 및 제2 빈 스트링을 포함하는 빈 스트링을 생성할 수 있다. 이때, 제1 빈 스트링은 프리픽스(prefix)일 수 있고, 제1 이진화 방법은 고정 길이(fixed-length) 이진화 방법일 수 있다. 제2 빈 스트링은 서픽스(suffix)일 수 있고, 제2 역이진화 방법은 절삭형 단항 이진화 방법일 수 있다.The entropy encoding unit 155 generates a first bin string by performing a first binarization method on some first values of the syntax element values and performs a second binarization method on a second part of the syntax element values 2 You can create an empty string. A first empty string, and a second empty string. In this case, the first bin string may be a prefix, and the first binarization method may be a fixed-length binarization method. The second bin string may be a suffix and the second inverse binning method may be a cutting type unary binarization method.
또는, 엔트로피 부호화부(155)는현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효 변환 계수 픽셀의 수평방향 좌표 값 또는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직방향 좌표 값 중 하나의 방향의 좌표 값을 나타내는 정보 및 상기 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분(difference)을 나타내는 정보를 생성할 수 있다. 엔트로피 부호화부(155)는 현재 블록의 높이 및 너비에 기초하여 상기 하나의 방향을 결정할 수 있다.Alternatively, the entropy coding unit 155 may calculate the horizontal coordinate value of the effective transformation coefficient pixel located at the rightmost of all the effective transformation coefficients in the current block, or the effective transformation coefficient located at the lowermost position among all the effective transformation coefficients in the current block Information indicating a coordinate value of one of the vertical coordinate values of the pixel and information indicating a difference between the coordinate value of the one direction and the coordinate value of the remaining direction. The entropy encoding unit 155 can determine the one direction based on the height and width of the current block.
엔트로피 부호화부(155)는 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성할 수 있다. The entropy encoding unit 155 can generate flag information indicating whether to acquire information indicating a difference between a coordinate value in one direction and a coordinate value in the remaining direction.
한편, 엔트로피 부호화부(155)는 현재 블록의 너비 및 높이에 기초하여 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성할지 여부를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록의 너비 및 높이가 다른 경우(즉, 직사각형인 경우), 하나의 방향의 좌표 값과 나머지 방향의 좌표 값의 차분을 나타내는 정보를 획득하는지 여부를 나타내는 플래그 정보를 생성한다고 결정하고, 플래그 정보를 생성할 수 있다.On the other hand, the entropy encoding unit 155 can determine whether to generate flag information indicating whether to acquire 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, the entropy encoding unit 155 determines whether information indicating a difference between a coordinate value in one direction and a coordinate value in the remaining direction is obtained when the width and height of the current block are different (i.e., when the width is a rectangle) , And generates flag information.
엔트로피 부호화부(155)는 계수 부호화(coefficient encoding)에 이용되는 모든 신택스 엘리먼트의 이진 산술부호화에 이용되는 컨텍스트 모델을 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 결정할 수 있다. 예를 들어, 현재 블록의 크기(size)는 현재 블록의 높이 및 너비의 최소값 및 최대값 중 적어도 하나에 따라 결정될 수 있다. 현재 블록의 모양(shape)은 현재 블록의 너비와 높이가 동일한지 여부에 따라서 결정될 수 있다. 게수 부호화에 이용되는 모든 신택스 엘리먼트는 스캔 영역을 특정하기 위한 신택스 엘리먼트 및 스캔 영역 내에서 변환 계수에 관한 신택스 엘리먼트를 포함할 수 있다.The entropy encoding unit 155 may determine the context model used for binary arithmetic coding 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 a minimum value and a maximum value of the height and width of the current block. The shape of the current block can be determined depending on whether or not the width and height of the current block are the same. All of the syntax elements used for the gain encoding may include a syntax element for specifying a scan area and a syntax element for a transformation coefficient in the scan area.
예를 들어, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1를 다음과 같은 수학식 11에 기초하여 결정할 수 있다.For example, the entropy encoding unit 155 can determine information size_tu1 on the size of the current block based on Equation (11) below.
Figure PCTKR2018003830-appb-M000010
Figure PCTKR2018003830-appb-M000010
엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1에 대응하는 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoding unit 155 determines the context model corresponding to the information size_tu1 on the size of the current block, determines the context model for the syntax element used in the coefficient encoding, and uses the context model to calculate the syntax Element can be binary arithmetic-coded.
또는, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu2를 다음과 같은 수학식 12에 기초하여 결정할 수 있다.Alternatively, the entropy encoding unit 155 may determine information size_tu2 on the size of the current block based on Equation (12).
Figure PCTKR2018003830-appb-M000011
Figure PCTKR2018003830-appb-M000011
엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoding unit 155 determines the context model based on the information size_tu2 about the size of the current block, determines the context model for the syntax element used in the coefficient encoding, and uses the context model to calculate the syntax Element can be binary arithmetic-coded.
또는, 엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다. Alternatively, the entropy encoding unit 155 may determine the context model based on the information size_tu1 and size_tu2 about the size of the current block, determine the context model for the syntax element used for the coefficient encoding, and perform the coefficient encoding Can be binary arithmetic-coded.
엔트로피 부호화부(155)는 현재 블록의 크기 및 높이 중 최소값이 무엇인지, 최대값이 무엇인지를 결정하고, 현재 블록의 크기 및 높이 중 최소값 및 최대값에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoding unit 155 determines what is the minimum value and the maximum value of the size and height of the current block, determines the context model based on the minimum and maximum values of the size and height of the current block, The context model for the syntax element used in the context model can be determined, and the syntax element used in the coefficient encoding can be binary arithmetic-coded using the context model.
한편, 엔트로피 부호화부(155)는 계수 부호화에 이용되는 모든 신택스 엘리먼트의 이진 산술 부호화에 이용되는 컨텍스트 모델을 현재 블록의 모양(shape)에 기초하여 결정할 수 있다.On the other hand, the entropy encoding unit 155 can determine the context model used for the binary arithmetic coding of all the syntax elements used for coefficient encoding, based on the shape of the current block.
예를 들어, 엔트로피 부호화부(155)는 현재 블록의 모양에 관한 정보 shape_tu를 하기 수학식 13에 기초하여 결정할 수 있다.For example, the entropy encoding unit 155 may determine information shape_tu about the shape of the current block based on Equation (13) below.
Figure PCTKR2018003830-appb-M000012
Figure PCTKR2018003830-appb-M000012
[수학식 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 encoding unit 155 determines shape_tu to be 2 when the width width of the current block is greater than the height height, and determines shape_tu to be 1 when the width width of the current block is smaller than the height height And shape_tu can be set to 0 if width width of the current block is equal to height height. That is, for a rectangle with a width greater than the height, shape_tu is determined to be 2. For a rectangle whose height is greater than the width, shape_tu may be determined to be 1, and for a square, shape_tu may be determined to be 0.
엔트로피 부호화부(155)는 현재 블록의 크기에 관한 정보 shape_tu에 기초하여 컨텍스트 모델을 결정하고, 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트를 이진 산술 부호화할 수 있다.The entropy encoding unit 155 determines the context model based on the information shape_tu about the size of the current block, determines the context model for the syntax element used for coefficient encoding, and uses the context model to calculate the syntax Element can be binary arithmetic-coded.
엔트로피 부호화부(155)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 엔트로피 복호화부(155)는 현재 블록의 크기에 관한 정보 size_tu1 및 size_tu2 중 적어도 하나와 현재 블록의 모양에 관한 정보 shape_tu에 기초하여 계수 부호화에 이용되는 신택스 엘리먼트에 대한 컨텍스트 모델을 결정하고, 컨텍스트 모델을 이용하여 계수 부호화에 이용되는 신택스 엘리먼트 를 이진 산술 부호화할 수 있다.The entropy encoding unit 155 can determine the context model for the 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 decoding unit 155 determines a context model for a syntax element used for coefficient encoding based on at least one of information size_tu1 and size_tu2 about the size of the current block and information shape_tu about the shape of the current block , The context model can be used to perform binary arithmetic coding on syntax elements used for coefficient encoding.
엔트로피 부호화부(155)는 현재 블록의 높이와 너비가 서로 다른 경우 중 높이 또는 너비 중 어느 하나가 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향의 좌표 및 수직방향의 좌표를 서로 변경(swap)할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 그리고 엔트로피 부호화부(155)는 현재 블록의 너비가 높이보다 크지 않은 경우, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)하지 않을 수 있다. 이에 제한되지 않고, 엔트로피 부호화부(155)는 현재 블록의 높이가 너비보다 큰 경우, 현재 블록의 높이 및 너비를 서로 변경할 수 있다. 즉, 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표의 값을 서로 변경(swap)할 수 있다. 엔트로피 부호화부(155)는 현재 블록에 포함된 픽셀들의 수평방향 좌표 및 수직방향의 좌표를 서로 변경(swap)한 경우, 현재 블록 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표의 좌표를 서로 변경(swap)할 수 있다. 엔트로피 부호화부(155)는 변경된(swapped) 스캔 영역을 특정하는 좌표에 기초하여 변경된(swapped) 현재 블록 내 제1 스캔 영역을 결정할 수 있다. 엔트로피 부호화부(155)는 제1 스캔 영역에 포함된 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보에 대해 엔트로피 부호화를 수행할 수 있다.엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표를 결정하고, 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 엔트로피 부호화할 수 있다. 즉, 엔트로피 부호화부(155)는 사각형 스캔 영역을 특정하는 좌표에 관한 신택스 엘리먼트에 대해 소정의 이진화 방법에 기초한 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 여기서, 소정의 이진화 방법은 고정 길이 이진화 방법 및 절삭형 단항 이진화 방법 중 적어도 하나일 수 있다.The entropy encoding unit 155 may change the height and the width of the current block when either the height or width of the current block is different from the height or width of the current block. That is, the horizontal direction coordinates and the vertical direction coordinates of the pixels included in the current block can be swapped with each other. For example, if the width of the current block is greater than the height, the entropy encoding unit 155 may change the height and width of the current block. That is, the horizontal and vertical coordinate values of the pixels included in the current block can be swapped with each other. If the width of the current block is not greater than the height, the entropy encoding unit 155 may not swap horizontal and vertical coordinates of the pixels included in the current block with each other. Without being limited thereto, the entropy encoding unit 155 may change the height and the width of the current block if the height of the current block is larger than the width. That is, the horizontal and vertical coordinate values of the pixels included in the current block can be swapped with each other. When the horizontal coordinate and the vertical coordinate of the pixels included in the current block are swapped with each other, the entropy coding unit 155 sets the horizontal coordinate and the vertical coordinate specifying the current block scanning area as a scan area The coordinates of the horizontal direction coordinate and the vertical direction coordinate can be swapped with each other. The entropy encoding unit 155 may determine the first scan area in the current block that has been swapped based on the coordinates specifying the swapped scan area. The entropy encoding unit 155 scans the information about the transform coefficients included in the first scan region and performs entropy encoding on the information about the scanned transform coefficients. And information on the coordinates specifying the quadrangular scan area can be entropy-encoded. That is, the entropy encoding unit 155 may generate a bin string by performing a binarization based on a predetermined binarization method on a syntax element related to a coordinate specifying a quadrangular 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 encoding unit 155 can perform binary arithmetic coding based on the context model on the bin string regarding the syntax element related to the coordinates specifying the quadrangular scan area. At this time, the context model may be determined based on at least one of the size of the current block, the color component of the current block, and the empty index. The color component may include a luminance component and a chrominance component. The empty index may be information indicating the position of the bin that is currently binary arithmetic-coded among the bin strings related to the syntax element.
엔트로피 부호화부(155)는 스캔된 변환 계수들에 관한 정보에 기초하여 이진화 및 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화 중 적어도 하나를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다.The entropy encoding unit 155 may generate at least one of binarization based on information on the scanned transform coefficients and binary arithmetic encoding based on the context model of the transform coefficients to generate entropy-encoded information.
변환 계수들에 관한 제1 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보이고, 변환 계수들에 관한 제2 정보가 잔여 레벨 절대값의 이진화 파라메터 정보인 경우, 엔트로피 부호화부(155)는 변환 계수들에 관한 제1 정보에 대해 제2 정보에 기초한 이진화를 수행하여 제1 정보에 관한 빈 스트링(bin string)을 생성할 수 있다. 엔트로피 부호화부(155)는 제1 정보에 관한 빈 스트링(bin string)에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다.The first information on the transform coefficients is information indicating whether the absolute value of the current transform coefficient is larger than a predetermined value, the residual level absolute value information and the sign information of the current transform coefficient, and the second information on the transform coefficients is the residual level In the case of the absolute value of the binarization parameter information, the entropy encoding unit 155 may binarize the first information on the transform coefficients based on the second information to generate a bin string for the first information have. The entropy encoding unit 155 may perform binary arithmetic encoding on a bin string related to the first information to generate entropy-encoded information.
제 2 정보는 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치, 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다. 예를 들어, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값에 기초하여 결정될 수 있다. 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 제1 변환 계수의 우측 또는 하측의 주변 유효 변환 계수의 레벨 절대값의 합에 기초하여 결정될 수 있다.The second information includes information on at least one second transform coefficient previously scanned in accordance with a predetermined scan order, information on the position, color component, right or lower peripheral transformation coefficient of the first transform coefficient in the current block, 1 < / RTI > conversion coefficient. For example, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the absolute level of the level of the peripheral effective transform coefficient on the right side or the lower side of the first transform coefficient. The binarization parameter information on the absolute value of the residual level of the first transform coefficient may be determined based on the sum of the absolute levels of the levels of the peripheral effective transform coefficients on the right side or the lower side of the first transform coefficient.
또는, 제1 변환 계수의 잔여 레벨 절대값에 관한 이진화 파라메터 정보는 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 정수)개의 변환 계수의 레벨, 현재 블록 내 제1 변환 계수의 위치, 색상 성분 및 인접하는 우측 또는 하측의 n(n은 양의 정수) 개의 변환 계수들의 레벨, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최초 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 스캔 영역 내 최종 위치의 변환 계수인지 여부, 스캔 순서상 제1 변환 계수가 계수 그룹(Coefficient Group) 내 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 결정될 수 있다.Alternatively, the binarization parameter information on the absolute value of the residual level of the first transform coefficient may be obtained from 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, (N is a positive integer) number of adjacent right or lower n-th conversion coefficients, whether the first conversion coefficient in the scan order is a conversion coefficient of the first position in the scan area, Whether the first transform coefficient in the scan order is a coefficient of the first position in the coefficient group, whether the transform coefficient is the last position in the area, whether the transform coefficient is the last position in the area, and whether the first transform coefficient in the scan order is a coefficient of the first position in the coefficient group.
변환 계수들에 관한 정보가 현재 변환 계수의 절대값이 소정의 값보다 큰 지를 나타내는 정보, 잔여레벨 절대값 정보 및 현재 변환 계수의 부호 정보인 경우, 엔트로피 부호화부(155)는 변환 계수들에 관한 정보에 대해 이진화를 수행하여 빈 스트링(bin string)을 생성할 수 있다. 엔트로피 부호화부(155)는 빈 스트링(bin string)에 대해 변환 계수들에 관한 컨텍스트 모델에 기초한 이진 산술 부호화를 수행하여 이진 산술 부호화된 정보를 생성할 수 있다. 상기 변환 계수들에 관한 컨텍스트 모델 중 제1 변환 계수에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 적어도 하나의 제2 변환 계수에 관한 정보, 현재 블록 내 제1 변환 계수의 위치, 컬러 성분, 우측 또는 하측의 주변 변환 계수에 관한 정보 및 제1 변환 계수의 스캔 위치 중 적어도 하나에 기초하여 결정될 수 있다.If the information on the transform coefficients is information indicating whether the absolute value of the current transform coefficient is larger than a predetermined value, the residual level absolute value information, and the sign information of the current transform coefficient, the entropy coding unit 155 calculates You can perform binarization on the information to create an empty string. The entropy encoding unit 155 may perform binary arithmetic coding based on the context model on the bin strings to generate binary arithmetic coded information. The context model of the first transform coefficient among the context models related to the transform coefficients includes information on at least one second transform coefficient previously scanned in accordance with a predetermined scan order, position of the first transform coefficient in the current block, Information about the right or lower peripheral transformation coefficient, and the scan position of the first transformation coefficient.
제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 0보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 0 can be determined based on the number of the right or lower effective conversion coefficients whose absolute values are larger than zero.
엔트로피 부호화부(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 encoding unit 155 can determine the context model related to the 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 smaller than the predetermined threshold value thred1, the entropy encoding unit 155 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy encoding unit 155 sets the context index to the predetermined context offset offset2 And determine the context model based on the increased context index. 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 smaller than the predetermined threshold value thred3, the entropy coding unit 155 sets the context index to the predetermined context offset offset3 And determine the context model based on the increased context index.
엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 위치의 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 calculates the number of transform coefficients that have already been scanned in the scan region, the relative positions of the first transform coefficients in the scan region, and the relative positions of the first transform coefficients in the first position where the first transform coefficient is scanned according to a predetermined scan order And determining whether the first conversion coefficient is greater than 0 based on at least one of the presence or absence of the coefficient.
예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 14에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoding unit 155 can determine the size size_sr of the quadrangular scan area on the basis of the following expression (14). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000013
Figure PCTKR2018003830-appb-M000013
다만 이에 제한되지 않고, 스캔 영역이 마지막 유효 변환 계수 픽셀의 좌표에 의해 특정되는 스캔 영역인 경우, size_sr은 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수있다. However, the present invention is not limited to this, and when the scan area is a scan area specified by the coordinates of the last effective conversion factor pixel, the size_sr may indicate the number of conversion coefficients included in the scan area.
엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다.The entropy encoding unit 155 can determine the number cnt_pos of all the transform coefficients scanned before the first transform coefficient among the transform coefficients in the rectangular scan region. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred2, the entropy encoding unit 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 다만, 상기 임계값 thred1 및 thred2는 일 예에 불과하며 size_sr에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset3 and determine the context model based on the increased context index. However, the threshold values thred1 and thred2 are merely examples, and various values can be determined based on the size_sr.
엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is larger than 0 based on the relative position of the first transform coefficients in the scan area.
엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 determines whether or not the first transformation coefficient is greater than 0 based on the horizontal direction coordinate value pos_x and the vertical direction 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 region The context model relating to the 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]일 수 있다.If the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can be determined based on sr_x and sr_y.
엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 복호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치인 경우에 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치가 아닌 경우, 제1 변환 계수가 0보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다. 이때, 사각형 스캔 영역의 우측 하단 모서리에 위치하는 픽셀의 변환 계수는 역방향의 스캔 순서에 따라 스캔되는 첫번째 위치의 변환 계수일 수 있다.The entropy encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is greater than 0 or not based on whether the first transform coefficient is a transform coefficient of the first position scanned in the reverse scan order . That is, the entropy decoding unit 155 determines the first context model related to the flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is the first position scanned in the reverse scan order, 1 conversion coefficient is not the first position to be scanned in the reverse scan order, the second context model may be determined regarding the flag information indicating whether the first conversion coefficient is greater than zero. In this case, the transform coefficients of the pixels positioned at the lower right corner of the quadrangular scan region may be the transform coefficients of the first position scanned in 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 to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is greater than 0 Can be determined based on the number of large effective conversion coefficients.
제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 1보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 1 can be determined based on the number of the right or lower effective conversion coefficients whose absolute values are larger than 1.
엔트로피 부호화부(155)는 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 현재 블록내 제1 변환 계수의 위치에 기초하여 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 현재 블록 내 수직 방향 위치 pos_y를 합한 값이 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is larger 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 smaller than the predetermined threshold value thred1, the entropy encoding unit 155 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy encoding unit 155 sets the context index to the predetermined context offset offset2 And determine the context model based on the 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과 그 값이 상이할 수 있다.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 smaller than the predetermined threshold value thred3, the entropy coding unit 155 sets the context index to the predetermined context offset offset3 And determine the context model based on the increased context index. At this time, the offsets offset1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 1 and predetermined thresholds thred1, 2, and 3 are flag information indicating whether the first conversion coefficient is greater than 0 The offsets offset 1, 2 and 3 associated with the context model with respect to the threshold values thred 1, 2, and 3 and their values may be different.
엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 encodes the size of the scan area, the number of already scanned transform coefficients in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero, And determining whether the first conversion coefficient is larger than 1 based on at least one of whether or not the conversion coefficient is a non-conversion coefficient at a position other than the first conversion coefficient.
예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 15에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoding unit 155 can determine the size size_sr of the quadrangular scan area on the basis of the following expression (15). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000014
Figure PCTKR2018003830-appb-M000014
엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 0보다 큰 변환 계수의 개수일 수 있다.The entropy encoding unit 155 can determine the number cnt_pos of all the transform coefficients scanned before the first transform coefficient among the transform coefficients in the rectangular scan region. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order. However, the present invention is not limited to this, and cnt_pos may be the number of transform coefficients larger than all zero scanned before scanning the first transform coefficient among the transform coefficients in the rectangular scan region.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred2, the entropy encoding unit 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset3 and determine the 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 merely examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first transform coefficient is greater than 1, and predetermined thresholds thred 1 and thred 2 are related to flag information indicating whether the first transform coefficient is greater than zero Those skilled in the art will readily understand that the offsets offset 1, 2, and 3 associated with the context model may differ from the threshold values thred 1 and thred 2 and their values.
엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is larger than 1 based on the relative position of the first transform coefficients in the scan area.
엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 determines whether or not the first transform coefficient is greater than 1 based on the horizontal direction coordinate value pos_x and the vertical direction 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 region The context model relating to the 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]일 수 있다.If the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can 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 thresholds thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 1 and predetermined thresholds thred1_x, thred1_y, thred2_x, and thred2_y relate to the flags indicating whether the first conversion coefficient is greater than 0 It will be readily appreciated by those skilled in the art that the offsets offset 1, 2, and 3 associated with the context model for the information may differ from the threshold values thred1_x, thred1_y, thred2_x, and thred2_y.
엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 determines whether or not the first transform coefficient is larger than 1 based on whether the first transform coefficient is a transform coefficient of the first position among the transform coefficients larger than 0 scanned in the reverse scan order Can be determined. That is, when the first transform coefficient is the first one of the transform coefficients larger than 0, which is scanned in the reverse scan order, the video decoding apparatus 100 determines 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 one when the first transform coefficient is not the first one of the transform coefficients greater than 0 scanned in the reverse scan order, Can be determined.
이에 제한되지 않고, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 소정의 스캔 순서에 따라 이전에 스캔된 n(n은 양의 정수) 개의 변환 계수들 중 절대값이 1보다 큰 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model of the flag information indicating whether the first transform coefficient is greater than 1 is not limited to this, and the absolute value of n (n is a positive integer) transform coefficients previously scanned according to a predetermined scan order is larger than 1 Can be determined based on the number of large effective conversion coefficients.
제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델은 절대값이 2보다 큰 우측 또는 하측의 유효 변환 계수의 개수에 기초하여 결정될 수 있다. The context model relating to the flag information indicating whether the first conversion coefficient is larger than 2 can be determined based on the number of the right or lower effective conversion coefficients whose absolute values are larger 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 encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is larger 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 smaller than the predetermined threshold value thred1, the entropy encoding unit 155 sets the context index to a predetermined value It is possible to increase the context offset by the context offset, and determine the context model based on the increased context index. If the sum of the horizontal direction coordinate value pos_x of the first transform coefficient in the current block and the vertical direction position pos_y in the current block is smaller than the predetermined threshold value thred2, the entropy encoding unit 155 sets the context index to the predetermined context offset offset2 And determine the context model based on the increased context index. 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 smaller than the predetermined threshold value thred3, the entropy coding unit 155 sets the context index to the predetermined context offset offset3 And determine the context model based on the increased context index. At this time, the offsets offset1, 2 and 3 associated with the context model relating to the flag information indicating whether the first transform coefficient is larger than 2 and predetermined thresholds thred1, 2 and 3 indicate whether the first transform coefficient is larger than 0 and 1 The offsets offset 1, 2, and 3 associated with the context model for the flag information and the predetermined threshold values thred 1, 2, and 3 may differ.
엔트로피 부호화부(155)는 스캔 영역의 크기, 스캔 영역 내 이미 스캔된 변환 계수의 개수, 스캔 영역 내 제1 변환 계수의 상대적인 위치 및 제1 변환 계수가 소정의 스캔 순서에 따라 스캔되는 첫번째 0이 아닌 위치(또는, 1보다 큰 변환 계수들 중 첫번째 위치)의 변환 계수인지 여부 중 적어도 하나에 기초하여 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 encodes the size of the scan area, the number of already scanned transform coefficients in the scan area, the relative position of the first transform coefficient in the scan area, and the first zero, And determining whether the first transform coefficient is greater than one based on at least one of whether the transform coefficient is a transform coefficient of a position (or a transform coefficient of a transform coefficient larger than 1).
예를 들어, 엔트로피 부호화부(155)는 사각형 스캔 영역의 크기 size_sr을 하기 수학식 16에 기초하여 결정할 수 있다. 즉, 사각형 스캔 영역의 크기 size_sr은 사각형 스캔 영역 내 포함된 변환 계수의 개수를 의미할 수 있다.For example, the entropy encoding unit 155 can determine the size size_sr of the quadrangular scan area on the basis of the following expression (16). That is, the size size_sr of the quadrangular scan region may mean the number of transform coefficients included in the quadrangular scan region.
Figure PCTKR2018003830-appb-M000015
Figure PCTKR2018003830-appb-M000015
엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 모든 변환 계수의 개수 cnt_pos를 결정할 수 있다. 이때, cnt_pos는 소정의 스캔 순서에 따라 스캔되는 스캔 영역 내 모든 변환 계수들 중 제1 변환 계수의 위치를 나타낼 수 있다. 다만 이에 제한되지 않고, cnt_pos는, 사각형 스캔 영역 내 변환 계수들 중 제1 변환 계수를 스캔하기 이전에 스캔된 그 절대값이 1보다 큰 모든 변환 계수의 개수일 수 있다.The entropy encoding unit 155 can determine the number cnt_pos of all the transform coefficients scanned before the first transform coefficient among the transform coefficients in the rectangular scan region. At this time, cnt_pos may indicate the position of the first transform coefficient among all the transform coefficients in the scan region scanned according to a predetermined scan order. However, cnt_pos may be the number of all transform coefficients whose absolute value scanned before scanning the first transform coefficient among the transform coefficients in the quadrangular scan area is larger than unity.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset1만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred1은 1일 수 있다. 또는 thred1은 1/4*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, thred1 may be one. Or thred1 may be 1/4 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred2보다 작은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset2만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다. 이때, thred2은 1/4*size_sr일 수 있다. 또는 thred2은 1/2*size_sr일 수 있다.If the cnt_pos is smaller than the predetermined threshold value thred2, the entropy encoding unit 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 may be 1/4 * size_sr. Or thred2 may be 1/2 * size_sr.
엔트로피 부호화부(155)는 cnt_pos가 소정의 임계값 thred1 및 thred2 보다 작지 않은 경우, 컨텍스트 인덱스를 소정의 컨텍스트 오프셋 offset3만큼 증가시키고, 증가시킨 컨텍스트 인덱스에 기초하여 컨텍스트 모델을 결정할 수 있다.If the cnt_pos is not smaller than the predetermined threshold values thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset3 and determine the 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 merely examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model relating to the flag information indicating whether the first conversion coefficient is greater than 0 or 1 and predetermined thresholds thred 1 and thred 2 indicate whether the first conversion coefficient is greater than 0 or 1 Those skilled in the art will readily understand that the offsets offset 1, 2, and 3 associated with the context model for flag information may differ from the threshold values thred 1 and thred 2 and their values.
엔트로피 부호화부(155)는 스캔 영역 내 제1 변환 계수의 상대적인 위치에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 can determine the context model related to the flag information indicating whether the first transform coefficient is larger than 2 based on the relative positions of the first transform coefficients in the scan area.
엔트로피 부호화부(155)는 현재 블록 내 제1 변환 계수의 수평방향 좌표 값 pos_x 및 수직방향 좌표 값 pos_y과 사각형 스캔 영역을 특정하는 좌표 Sr_x 및 Sr_y에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 determines whether or not the first transform coefficient is greater than 2 based on the horizontal direction coordinate value pos_x and the vertical direction coordinate value pos_y of the first transform coefficient in the current block and the coordinates Sr_x and Sr_y specifying the square scan region The context model relating to the 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]일 수 있다.If the pos_x is smaller than thred1_x and the pos_y is smaller than thred1_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset, and determine the context model based on the increased context index. At this time, [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]일 수 있다.If the pos_x is smaller than thred2_x and the pos_y is smaller than thred2_y, the entropy encoding unit 155 may increase the context index by a predetermined context offset offset2 and determine the context model based on the increased context index. At this time, [thred2_x, thred2_y] may be [srredx], [sr_x + 1) / 2, or [sr_y + 1) / 2.
다만, 상기 임계값 thred1_x, thred1_y 및 thred2_y,thred2_y는 일 예에 불과하며 sr_x 및 sr_y에 기초하여 다양한 값이 결정될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the thresholds thred1_x, thred1_y, and thred2_y and thred2_y are merely examples, and those skilled in the art can easily understand that various values can 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 thresholds thred1_x, thred1_y, thred2_x, and thred2_y are only examples, and various values can be determined based on the size_sr. At this time, the offsets offset 1, 2, and 3 associated with the context model related to flag information indicating whether the first conversion coefficient is greater than 0 or 1 and predetermined thresholds thred1_x, thred1_y, thred2_x, and thred2_y, Those skilled in the art can easily understand that the offsets offset 1, 2, and 3 associated with the context model related to the flag information indicating may be different from the threshold values thred1_x, thred1_y, thred2_x, and thred2_y.
엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치의 변환 계수인지 여부에 기초하여 제1 변환 계수가 2보다 큰지를 나타내는 플래그 정보에 관한 컨텍스트 모델을 결정할 수 있다. 즉, 엔트로피 부호화부(155)는 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치인 경우에 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제1 컨텍스트 모델을 결정하고, 제1 변환 계수가 역방향의 스캔 순서에 따라 스캔되는 0보다 큰 변환 계수들 중 첫번째 위치가 아닌 경우, 제1 변환 계수가 1보다 큰지를 나타내는 플래그 정보에 관한 제2 컨텍스트 모델을 결정할 수 있다.The entropy encoding unit 155 generates flag information indicating whether the first transform coefficient is greater than 2 or not based on whether the first transform coefficient is a transform coefficient of the first position among the transform coefficients larger than 0 scanned in the reverse scan order Can be determined. That is, if the first transform coefficient is the first one of the transform coefficients larger than 0, which is scanned in the reverse scan order, the entropy encoding unit 155 outputs the first transform coefficient, A second context model for flag information indicating whether the first transform coefficient is greater than one when the first transform coefficient is not the first one of the transform coefficients greater than 0 scanned in 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 to this, and the entropy encoding unit 155 may determine whether or not the first transform coefficient is equal to or greater than 2 based on whether the first transform coefficient is the transform coefficient of the first position among the transform coefficients larger than 1, The context model can be determined. That is, if the first transform coefficient is the first one of the transform coefficients larger than 1, which is scanned in the reverse scan order, the entropy encoding unit 155 outputs the first transform coefficient, A second context model for flag information indicating whether the first transform coefficient is greater than two if the first transform coefficient is not the first one of the transform coefficients greater than one scanned in the reverse scan order, The context model relating to the flag information indicating whether the first transform coefficient is greater than 2 may be used to determine whether or not n (n is a positive integer) transform coefficients among the previously scanned transform coefficients Can be determined based on the number of effective transform coefficients whose absolute values are greater than two.
엔트로피 부호화부(155)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [SRx,0](SRx는 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수평방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [SRx,Y](Y는 0보다 크고 SRy보다 작거나 같은 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 현재 스캔되는 변환 계수의 GT0 플래그 정보를 생성하지 않을 수 있다.The entropy encoding unit 155 encodes the position of the transform coefficient currently scanned in the scan region by [SRx, 0] (where SRx is an integer and SRx is the horizontal coordinate value of the right boundary pixel of the scan region on the basis of the left upper- (Y is an integer greater than 0 and less than or equal to SRy, and SRy represents a lower boundary of the scan region with respect to the upper left corner coordinate of the scan region in accordance with a predetermined scan order) (I.e., the vertical direction coordinate value of the pixel), the GT0 flag information of the currently scanned conversion coefficient may not be generated.
마찬가지로, 엔트로피 부호화부(155)는 스캔 영역 내 현재 스캔되는 변환 계수의 위치가 [0,SRy](SRy는 정수, SRy는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 하측 경계의 수직방향 좌표 값을 의미함)이고, 소정의 스캔 순서에 따라 이전에 스캔된 [X,SRy](X는 0보다 크고 SRx보다 작거나 같은 정수, SRx는 스캔 영역의 좌상단 모서리 좌표를 기준으로 스캔 영역의 우측 경계 픽셀의 수직방향 좌표 값을 의미함) 위치의 변환 계수들이 모두 0인 계수라면, 현재 스캔되는 변환 계수의 GT0 플래그 정보를 생성하지 않을 수 있다.Likewise, the entropy encoding unit 155 determines whether or not the position of the transform coefficient currently scanned in the scan region is [0, SRy] (where SRy is an integer and SRy is the vertical coordinate of the lower boundary of the scan region on the basis of the upper left corner coordinate of the scan region (X, SRy) (where X is an integer greater than 0 and less than or equal to SRx, SRx is an integer equal to or greater than 0, (I.e., the vertical direction coordinate value of the boundary pixel). If the transform coefficients of the positions are all zeros, the GT0 flag information of the currently scanned transform coefficients may not be generated.
한편, 엔트로피 부호화부(155)는 현재 블록 내 유효 변환 계수의 GT1 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT1 플래그 정보를 생성할 수 있다. 즉, 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 최대 개수만큼 생성하면, 이후에 엔트로피 부호화부(155)는 유효 변환 계수의 GT1 플래그 정보를 더 이상 생성하지 않을 수 있다.On the other hand, the entropy encoding unit 155 can determine the maximum number of GT1 flag information of the current intra-block effective transform coefficient and generate the GT1 flag information in the current block within the maximum coefficient of the determined effective transform coefficient. That is, if the entropy encoding unit 155 generates the maximum number of GT1 flag information of the effective conversion coefficient, the entropy encoding unit 155 may not generate the GT1 flag information of the effective conversion coefficient thereafter.
엔트로피 부호화부(155)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT1 플래그 정보의 최대 개수로 결정할 수 있다. 또는 엔트로피 부호화부(155)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT1 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 GT1 플래그 정보의 최대 개수 MaxCount_GT1를 하기와 같은 수학식 17에 기초하여 결정할 수 있다.The entropy encoding unit 155 can determine all non-zero effective conversion coefficients as the maximum number of GT1 flag information in the current block. Or the entropy encoding unit 155 can determine the maximum number of GT1 flag information in the current block based on the size of the scan area. For example, the entropy encoding unit 155 can determine the maximum number MaxCount_GT1 of the GT1 flag information based on the following expression (17).
Figure PCTKR2018003830-appb-M000016
Figure PCTKR2018003830-appb-M000016
이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K1은 스캔 영역의 크기와 GT1 플래그 간 조절 계수일 수 있다. 예를 들어, K1은 1보다 큰 정수일 수 있다. Th1은 미리 정해진 임계값일 수 있다. 예를 들어, Th1은 16,8 일 수 있다. 다만 이에 제한되지 않고, K1 및 Th1은 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area. K1 can be the magnitude of the scan area and the adjustment factor between the GT1 flags. For example, K1 may be an integer greater than one. Th1 may be a predetermined threshold value. For example, Th1 may be 16,8. Those skilled in the art can easily understand that K1 and Th1 can have various values, without being limited thereto.
엔트로피 부호화부(155)는 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정하고, 상기 결정된 유효 변환 계수의 최대 계수 내에서 현재 블록 내 GT2 플래그 정보를 생성할 수 있다. 즉, 엔트로피 부호화부(155)는 유효 변환 계수의 GT2 플래그 정보를 최대 개수만큼 생성하면, 이후에 엔트로피 부호화부(155)는 유효 변환 계수의 GT2 플래그 정보를 더 이상 생성하지 않을 수 있다.The entropy encoding unit 155 can determine the maximum number of GT2 flag information in the current block and generate the GT2 flag information in the current block within the maximum coefficient of the determined effective transform coefficient. That is, if the entropy encoding unit 155 generates the maximum number of GT2 flag information of the effective conversion coefficient, the entropy encoding unit 155 may not generate the GT2 flag information of the effective conversion coefficient thereafter.
엔트로피 부호화부(155)는 모든 0이 아닌 유효 변환 계수를 현재 블록 내 GT2 플래그 정보의 최대 개수로 결정할 수 있다. 또는, 엔트로피 부호화부(155)는 스캔 영역의 크기에 기초하여 현재 블록 내 GT2 플래그 정보의 최대 개수를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 GT2 플래그 정보의 최대 개수 MaxCount_GT2를 하기와 같은 수학식 18에 기초하여 결정할 수 있다.The entropy encoding unit 155 can determine all non-zero effective conversion coefficients as the maximum number of GT2 flag information in the current block. Alternatively, the entropy encoding unit 155 can determine the maximum number of GT2 flag information in the current block based on the size of the scan area. For example, the entropy encoding unit 155 can determine the maximum number MaxCount_GT2 of the GT2 flag information based on the following expression (18).
Figure PCTKR2018003830-appb-M000017
Figure PCTKR2018003830-appb-M000017
이때, sizeSR은 사각형 스캔 영역의 크기(넓이)를 의미할 수 있고, sizeSR은 (Sr_x+1)*(Sr_y+1)일 수 있다. Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 우측의 유효 변환 계수 픽셀의 수평방향 좌표를 의미할 수 있다. 다시 말해, Sr_x는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 우측 경계 픽셀의 수평 방향 좌표를 의미할 수 있다. Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 가장 하측의 유효 변환 계수 픽셀의 수직방향 좌표를 의미할 수 있다. 다시 말해, Sr_y는 스캔 영역의 좌측 상단 모서리 좌표를 기준으로 하측 경계 픽셀의 수직 방향 좌표를 의미할 수 있다. K2는 스캔 영역의 크기와 GT2 플래그 간 조절 계수일 수 있다. 예를 들어, K2는 1보다 큰 정수일 수 있다. Th2는 미리 정해진 임계값일 수 있다. 예를 들어, Th2는 16,8 일 수 있다. 다만 이에 제한되지 않고, K2 및 Th2는 다양한 값을 가질 수 있음을 당업자는 용이하게 이해할 수 있다.In this case, sizeSR may mean the size (width) of the square scan area, and sizeSR may be (Sr_x + 1) * (Sr_y + 1). Sr_x can be the horizontal coordinate of the rightmost effective transformation coefficient pixel based on the upper left corner coordinate of the scan area. In other words, Sr_x can mean the horizontal coordinate of the right boundary pixel based on the upper left corner coordinate of the scan area. Sr_y may mean the vertical coordinate of the lowest effective conversion factor pixel based on the upper left corner coordinate of the scan area. In other words, Sr_y may mean the vertical coordinate of the lower boundary pixel based on the upper left corner coordinate of the scan area. K2 can be the magnitude of the scan area and the adjustment factor between GT2 flags. For example, K2 may be an integer greater than one. Th2 may be a predetermined threshold value. For example, Th2 may be 16,8. Those skilled in the art can easily understand that K2 and Th2 can have various values, without being limited thereto.
엔트로피 부호화부(155)는 현재 블록 내 계수 그룹에 관한 정보를 생성할 수 있다. 계수 그룹에 관한 정보는 계수 그룹에 적어도 하나의 유효 변환 계수를 포함하고 있는지를 나타내는 플래그 정보일 수 있다. 이때, 엔트로피 부호화부(155)는 스캔 영역에 포함된 변환 계수들을 스캔 순서에 따라 스캔된 소정의 K개(K는 정수)의 변환 계수마다 하나의 계수 그룹을 결정할 수 있다. 즉, 하나의 계수 그룹은 K개의 변환 계수를 포함할 수 있다. 이때, 스캔 순서는 소정의 역방향 스캔 순서의 반대 방향인 정방향 스캔 순서일 수 있다. 여기서 말하는 소정의 역방향 스캔 순서는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 순서를 의미할 수 있다.The entropy encoding unit 155 can generate information on the current intra-block coefficient group. The information on the coefficient group may be flag information indicating whether the coefficient group includes at least one effective transform coefficient. At this time, the entropy encoding unit 155 can determine one coefficient group for every predetermined K number of transform coefficients included in the scan region (K is an integer) scanned according to the scan order. That is, one coefficient group may include K transform coefficients. In this case, the scan order may be a forward scan order that is the opposite direction of the predetermined reverse scan order. The predetermined backward scan order referred to herein may mean a scan order 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.
따라서, 엔트로피 부호화부(155)는 현재 블록 내 좌상측 모서리에 인접하는 계수인 DC 계수으로부터 정방향의 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있다. 이때, 현재 블록에 포함된 변환 계수의 개수가 K의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 최종 계수 그룹은 K보다 작은 개수의 변환 계수를 포함할 수 있다. 다만 이에 제한되지 않고, 엔트로피 부호화부(155)는 현재 블록에 포함된 변환 계수들 중 우측 하단에 위치하는 계수부터 현재 블록에 포함된 변환 계수들 중 좌측 상단에 위치하는 계수까지 스캔하는 역방향 스캔 순서에 따라 스캔하여 계수 그룹을 결정할 수 있음을 당업자는 용이하게 이해할 수 있다.Accordingly, the entropy encoding unit 155 can determine the coefficient group by scanning in the forward scan order from the DC coefficient, which is a coefficient adjacent to the upper left corner in the current block. If the number of transform coefficients included in the current block is not an integral multiple of K, the last coefficient group among the groups of coefficients scanned according to the forward scan order may include a smaller number of transform coefficients. However, the present invention is not limited to this, and the entropy coding unit 155 may perform the inverse scanning order in which the coefficients located in the lower right of the transform coefficients included in the current block are scanned up to the coefficient located in the upper left of the transform coefficients included in the current block It will be readily appreciated by those skilled in the art that scanning may be performed in accordance with the present invention to determine a coefficient group.
엔트로피 부호화부(155)는 소정의 스캔 순서에 따라 스캔되는 계수의 그룹들 중 하나의 계수 그룹이 1개의 변환 계수만을 포함하는 경우, 해당 계수 그룹에 관한 정보를 생성하지 않고, GT0 플래그 정보를 바로 생성할 수 있다.If one of the groups of coefficients scanned according to a predetermined scan order includes only one transform coefficient, the entropy encoding unit 155 does not generate information about the corresponding coefficient group and outputs the GT0 flag information immediately Can be generated.
엔트로피 부호화부(155)는 현재 블록에 포함된 각 계수 그룹에 대해 적어도 하나의 변환 계수의 부호(sign)를 숨기는지 여부를 결정할 수 있다. 예를 들어, 엔트로피 부호화부(155)는 경우에 따라 현재 블록에 포함된 각 계수 그룹에 대해 하나 또는 두개의 변환 계수의 부호를 숨긴다고 결정할 수 있다.The entropy encoding unit 155 can determine whether to hide the sign of at least one transform coefficient for each coefficient group included in the current block. For example, the entropy encoding unit 155 may decide to hide the sign of one or two transform coefficients for each coefficient group included in the current block, as the case may be.
엔트로피 부호화부(155)는 사각형 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.The entropy encoding unit 155 may scan the information on the transform coefficients in the quadrangular 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, those skilled in the art will readily understand 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 the information about the transform coefficients in the entropy encoder 160 and generate a bitstream including the entropy-encoded information based on the information about the scanned transform coefficients .
비트스트림 생성부(170)는 변환 계수에 관한 정보를 스캔하기 위한 영역인스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다.The bitstream generating unit 170 may generate a bitstream including information on coordinates specifying a scan area, which is an area for scanning information on transform coefficients.
비디오 부호화 장치(150)는 영상 부호화부(미도시)를 포함할 수 있고, 영상 부호화부(미도시)는 엔트로피 부호화부(155) 및 비트스트림 생성부(170)를 포함할 수 있다. 영상 부호화부에 대해서는 도 1f를 참조하여 설명하도록 한다.The video encoding apparatus 150 may include an image encoding unit (not shown), and the image encoding unit (not shown) may include an entropy encoding unit 155 and a bitstream generating unit 170. The image encoding unit will be described with reference to FIG.
도 1d는 다양한 실시예에 따른 비디오 부호화 방법의 흐름도를 도시한다.Figure 1D shows a flow diagram of a video encoding method according to various embodiments.
도 1d를 참조하면, S150 단계에서, 비디오 부호화 장치(150)는 현재 블록의 변환 계수들을 획득할 수 있다. 현재 블록은 도 10 내지 도 23을 참조하여 설명되는 영상을 부/복호화하는 과정에서 이용할 수 있는 데이터 단위일 수 있다. 비디오 부호화 장치(150)는 인터 예측 또는 인트라 예측을 수행하여 현재 블록의 예측 블록을 생성할 수 있고, 현재 블록의 원본 블록 및 현재 블록의 예측 블록에 기초하여 현재 블록의 레지듀얼 블록을 생성할 수 있다. 비디오 부호화 장치(150)는 현재 블록의 레지듀얼 블록에 대해 변환 및 양자화를 수행하여 현재 블록의 변환 계수들을 생성할 수 있다.Referring to FIG. 1D, in operation S150, the video encoding apparatus 150 may obtain the transform coefficients of the current block. The current block may be a data unit that can be used in the process of attaching / decrypting an image described with reference to FIGS. The video encoding apparatus 150 can generate a prediction block of the current block by performing inter prediction or intra prediction and generate a residual block of the current block based on the original block of the current block and the prediction block of the current block have. The video encoding apparatus 150 may transform and quantize the residual block of the current block to generate transform coefficients of the current block.
S155 단계에서, 비디오 부호화 장치(150)는 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정할 수 있다. 이때, 스캔 영역 내에는 현재 블록 내 모든 유효 변환 계수를 포함하고, 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0만을 포함할 수 있다. In step S155, the video encoding device 150 may determine a scan area including all the effective transform coefficients in the current block. In this case, the scan area includes all the effective conversion coefficients in the current block, and the remaining area in the current block excluding the scan area may include only 0, not an effective conversion coefficient.
S160 단계에서, 비디오 부호화 장치(150)는 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 변환 계수에 관한 정보는 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보를 포함할 수 있다. 이때, 소정의 값은 0, 1, 2 중 적어도 하나일 수 있다. 변환 계수의 절대값에 관한 잔여 레벨 정보, 변환 계수의 부호 정보, 잔여 레벨 절대값의 이진화 파라메터 정보 중 적어도 하나를 포함할 수 있다. 소정의 스캔 순서는 역방향의 지그재그 스캔 순서, 역방향의 대각 스캔 순서, 역방향의 수직 스캔 순서, 수평 스캔 순서를 포함할 수 있다. 다만, 소정의 스캔 순서는 상기 언급한 역방향 스캔 순서에 제한되지 않고, 다양한 역방향 스캔 순서를 포함할 수 있음을 당업자는 용이하게 이해할 수 있을 것이다.In step S160, the video encoding apparatus 150 may scan the information on the 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 larger than a predetermined value. At this time, the predetermined value may be at least one of 0, 1, and 2. Residual level information on the absolute value of the transform coefficient, sign information of the transform coefficient, and binarization parameter information of the absolute value of the residual level. 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, those skilled in the art will readily understand 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 device 150 may generate binarized information by performing binarization based on the information about the scanned transform coefficients.
S170 단계에서, 비디오 부호화 장치(150)는 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성할 수 있다. 이때, 비디오 부호화 장치(150)는 현재 블록의 크기 및 모양 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 이진 산술 부호화를 수행할 수 있다.In operation S170, the video coding apparatus 150 may perform binary arithmetic coding on the binarized information to generate entropy-encoded information. At this time, the video encoding apparatus 150 may perform binary arithmetic coding using the context model determined based on at least one of the size and shape of the current block.
S175 단계는 비디오 부호화 장치(150)는 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 비디오 부호화 장치(150)는 엔트로피 부호화부(160)에서 변환 계수에 관한 정보를 스캔하고, 스캔된 변환 계수에 관한 정보를 기초로 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성할 수 있다. 비디오 부호화 장치(150)는 변환 계수에 관한 정보를 스캔하기 위한 영역인 스캔 영역을 특정하는 좌표에 관한 정보를 포함하는 비트스트림을 생성할 수 있다.In operation S175, the video encoding apparatus 150 may generate a bitstream including entropy-encoded information. The video encoding apparatus 150 may scan the information on the transform coefficients in the entropy encoding unit 160 and generate a bitstream including the entropy-encoded information based on the information about the scanned transform coefficients. The video encoding apparatus 150 may generate a bitstream including information on coordinates specifying a scan area, which is an area for scanning information on the transform coefficients.
도 1e 는 다양한 실시예에 따른 영상 복호화부(6000)의 블록도를 도시한다.FIG. 1E shows a block diagram of an image decoding unit 6000 according to various embodiments.
다양한 실시예에 따른 영상 복호화부(6000)는, 비디오 복호화 장치(100)의 영상 복호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image decoding unit 6000 according to various embodiments performs operations to encode image data in a video decoding unit (not shown) of the video decoding apparatus 100. [
도 1e를 참조하면, 엔트로피 복호화부(6150)는 비트스트림(6050)으로부터 복호화 대상인 부호화된 영상 데이터 및 복호화를 위해 필요한 부호화 정보를 파싱한다. 부호화된 영상 데이터는 양자화된 변환계수로서, 역양자화부(6200) 및 역변환부(6250)는 양자화된 변환 계수로부터 레지듀 데이터를 복원한다. 도 1e의 엔트로피 복호화부(6150)는 도 1a의 엔트로피 복호화부(105)에 대응될 수 있다.Referring to FIG. 1E, the entropy decoding unit 6150 parses the encoded image data to be decoded and the encoding information necessary for decoding from the bitstream 6050. The encoded image data is a quantized transform coefficient, and the inverse quantization unit 6200 and the inverse transform unit 6250 reconstruct the residue data from the quantized transform coefficients. The entropy decoding unit 6150 of FIG. 1E may correspond to the entropy decoding unit 105 of FIG. 1A.
인트라 예측부(6400)는 블록 별로 인트라 예측을 수행한다. 인터 예측부(6350)는 블록 별로 복원 픽처 버퍼(6300)에서 획득된 참조 영상을 이용하여 인터 예측을 수행한다. 인트라 예측부(6400) 또는 인터 예측부(6350)에서 생성된 각 블록에 대한 예측 데이터와 레지듀 데이터가 더해짐으로써 현재 영상(6050)의 블록에 대한 공간 영역의 데이터가 복원되고, 디블로킹부(6450) 및 SAO 수행부(6500)는 복원된 공간 영역의 데이터에 대해 루프 필터링을 수행하여 필터링된 복원 영상(6600)을 출력할 수 있다. 또한, 복원 픽쳐 버퍼(6300)에 저장된 복원 영상들은 참조 영상으로서 출력될 수 있다.The intra prediction unit 6400 performs intra prediction on a block-by-block basis. The inter-prediction unit 6350 performs inter-prediction using the reference image obtained in the reconstruction picture buffer 6300 for each block. The spatial data for the block of the current image 6050 is restored by adding the predictive data and residue data for each block generated by the intra predictor 6400 or the inter predictor 6350, 6450 and the SAO performing unit 6500 may perform loop filtering on the data of the reconstructed spatial region and output the filtered reconstructed image 6600. [ In addition, restored images stored in the restored picture buffer 6300 can be output as a reference image.
비디오 복호화 장치(100)의 복호화부(미도시)에서 영상 데이터를 복호화하기 위해, 다양한 실시예에 따른 영상 복호화부(6000)의 단계별 작업들이 블록별로 수행될 수 있다. In order to decode the image data in the decoding unit (not shown) of the video decoding apparatus 100, the stepwise operations of the image decoding unit 6000 according to various embodiments may be performed block by block.
도 1f는 다양한 실시예에 따른 영상 부호화부의 블록도를 도시한다. FIG. 1F shows a block diagram of an image encoding unit according to various embodiments.
다양한 실시예에 따른 영상 부호화부(7000)는, 비디오 부호화 장치(150)의 영상 부호화부(미도시)에서 영상 데이터를 부호화하는데 거치는 작업들을 수행한다. The image encoding unit 7000 according to various embodiments performs operations to encode image data in an image encoding unit (not shown) of the video encoding device 150.
즉, 인트라 예측부(7200)는 현재 영상(7050) 중 블록별로 인트라 예측을 수행하고, 인터 예측부(7150)는 블록별로 현재 영상(7050) 및 복원 픽처 버퍼(7100)에서 획득된 참조 영상을 이용하여 인터 예측을 수행한다. That is, the intra predictor 7200 performs intraprediction on a block-by-block basis among the current image 7050, and the inter-prediction unit 7150 performs intra prediction on the current image 7050 and the reference image obtained from the reconstructed picture buffer 7100 To perform inter prediction.
인트라 예측부(7200) 또는 인터 예측부(7150)로부터 출력된 각 블록에 대한 예측 데이터를 현재 영상(7050)의 인코딩되는 블록에 대한 데이터로부터 빼줌으로써 레지듀 데이터를 생성하고, 변환부(7250) 및 양자화부(7300)는 레지듀 데이터에 대해 변환 및 양자화를 수행하여 블록별로 양자화된 변환 계수를 출력할 수 있다. 역양자화부(7450), 역변환부(7500)는 양자화된 변환 계수에 대해 역양자화 및 역변환을 수행하여 공간 영역의 레지듀 데이터를 복원할 수 있다. 복원된 공간 영역의 레지듀 데이터는 인트라 예측부(7200) 또는 인터 예측부(7150)로부터 출력된 각 블록에 대한 예측 데이터와 더해짐으로써 현재 영상(7050)의 블록에 대한 공간 영역의 데이터로 복원된다. 디블로킹부(7550) 및 SAO 수행부는 복원된 공간 영역의 데이터에 대해 인루프 필터링을 수행하여, 필터링된 복원 영상을 생성한다. 생성된 복원 영상은 복원 픽쳐 버퍼(7100)에 저장된다. 복원 픽처 버퍼(7100)에 저장된 복원 영상들은 다른 영상의 인터예측을 위한 참조 영상으로 이용될 수 있다. 엔트로피 부호화부(7350)는 양자화된 변환 계수에 대해 엔트로피 부호화하고, 엔트로피 부호화된 계수가 비트스트림(7400)으로 출력될 수 있다. 도 1f의 엔트로피 부호화부(7350)는 도 1c의 엔트로피 부호화부(155) 에 대응될 수 있다.The transform unit 7250 generates residue data 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 of the current image 7050, And quantization unit 7300 may perform conversion and quantization on the residue data and output the quantized transform coefficients on a block-by-block basis. The inverse quantization unit 7450 and the inverse transformation unit 7500 can perform inverse quantization and inverse transformation on the quantized transform coefficients to restore the residue data in the spatial domain. Residue data of the reconstructed spatial region is reconstructed into spatial domain data for a block of the current image 7050 by adding predictive data for each block output from the intra predictor 7200 or the inter predictor 7150 . The deblocking unit 7550 and the SAO performing unit perform in-loop filtering on the data of the reconstructed spatial region to generate a filtered reconstructed image. The generated restored image is stored in the restored picture buffer 7100. The reconstructed images stored in the reconstructed picture buffer 7100 can be used as reference images for inter prediction of other images. The entropy encoding unit 7350 entropy-codes the quantized transform coefficients, and the entropy-encoded coefficients can be output as a bitstream 7400. The entropy encoding unit 7350 of FIG. 1F may correspond to the entropy encoding unit 155 of FIG. 1C.
다양한 실시예에 따른 영상 부호화부(7000)가 비디오 부호화 장치(150)에 적용되기 위해서, 다양한 실시예에 따른 영상 부호화부(7000)의 단계별 작업들이 블록별로 수행될 수 있다.In order for the image encoding unit 7000 according to various embodiments to be applied to the video encoding device 150, the stepwise operations of the image encoding unit 7000 according to various embodiments may be performed for each block.
이하 도 2, 도 3a 내지 3b 의 현재 블록 내 픽셀들에 대해 도시된 '0', '1'은 유효 변환 계수 플래그(계수의 절대값이 0보다 큰지 여부를 나타내는 프플래그)의 값임을 전제로 블록 내 변환 계수를 스캔하는 방법을 상세하게 설명하겠다.Hereinafter, '0' and '1' shown for the pixels in the current block of FIG. 2 and FIGS. 3A and 3B are assumed to be values of the effective conversion coefficient flag (flag indicating whether the absolute value of the coefficient is greater than 0) The method of scanning the in-block transform coefficients will be described in detail.
도 2는 일 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.FIG. 2 is a diagram for explaining a method of scanning intra-block transform coefficients according to an embodiment.
도 2를 참조하면, 현재 블록(200)은 복수의 변환 계수를 포함하는 블록이다. 현재 블록(200)은 역변환 동작을 수행하는 데이터 단위로, MxN(M,N은 양의 정수) 크기의 블록일 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 현재 블록(200)은 16x16 크기의 블록일 수 있다.Referring to FIG. 2, the current block 200 is a block including a plurality of transform coefficients. The current block 200 is a data unit for performing an inverse transform operation, and may be a block of MxN (M, N is a positive integer) size. For example, as shown in FIG. 2, the current block 200 may be a 16x16 block.
비디오 복호화 장치(100)는 현재 블록(200)을 소정의 크기를 갖는 계수 그룹(또는 서브 블록)(205)들로 분할할 수 있다. 계수 그룹은 XxY(X,Y는 양의 정수)의 크기의 블록일 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 계수 그룹(205)은 4x4 크기의 블록일 수 있다.The video decoding apparatus 100 may divide the current block 200 into coefficient groups (or sub-blocks) 205 having a predetermined size. The coefficient group may be a block of size XxY (where 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 performs a process of scanning the current block 200 from the upper left transform coefficient to the lower right transform coefficient in accordance with the forward scan order, 210 from the bit stream. Information on the coordinates of the pixels 210 of the final effective conversion coefficients may include information on the horizontal direction coordinates of the pixels of the final effective conversion coefficients and information on the vertical direction coordinates of the pixels of the final effective conversion coefficients.
비디오 복호화 장치(100)는 최종 유효 변환 계수의 픽셀(210)의 좌표에 관한 정보를 기초로 최종 유효 변환 계수의 픽셀(210)의 좌표를 획득하고, 최종 유효 변환 계수의 픽셀(210)의 좌표를 기초로 최종 유효 변환 계수(210)에 관한 유효 변환 계수부터 소정의 역방향 스캔 순서(215)에 따라 변환 계수의 정보를 스캔할 수 있다. 예를 들어, 도 2에 도시된 바와 같이, 소정의 역방향 스캔 순서(215)는 역방향의 대각 스캔 순서일 수 있다.The video decoding apparatus 100 obtains the coordinates of the pixel 210 of the final effective conversion coefficient based on the information on the coordinates of the pixel 210 of the final effective conversion coefficient, The information of the transform coefficient may be scanned from the effective transform coefficient related to the final effective transform coefficient 210 according to a predetermined reverse scan order 215. [ For example, as illustrated in FIG. 2, the predetermined reverse scan order 215 may be a reverse diagonal scan order.
비디오 복호화 장치(100)는 계수 그룹들(205)에 대하여 소정의 스캔 순서에 따라 스캔을 수행하고, 각 계수 그룹(205)에 대해 소정의 스캔 순서에 따라 스캔을 수행할 수 있다. 비디오 복호화 장치(100)는 계수 그룹들에 대하여 소정의 스캔 순서에 따라 계수 그룹에 관한 정보를 스캔할 수 있다. 계수 그룹에 관한 정보는 비트스트림으로부터 획득되거나 유도될 수 있다. 계수 그룹에 관한 정보는, 정방향(역방향)의 스캔 순서에 따라 스캔되는 첫번째 계수 그룹 및 마지막 계수 그룹에 대하여 적어도 하나의 유효 변환 계수를 포함함을 나타내도록 유도될 수 있다. 즉, 계수 그룹에 관한 정보는, 정방향(역방향)의 스캔 순서에 따라 스캔되는 첫번째 계수 그룹 및 마지막 계수 그룹에 대하여 비트스트림에 포함되지 않을 수 있다.The video decoding apparatus 100 may scan the coefficient groups 205 according to a predetermined scanning order and perform a scanning operation on each coefficient group 205 according to a predetermined scanning order. The video decoding apparatus 100 may scan information about the coefficient groups according to a predetermined scanning order with respect to the coefficient groups. Information about the coefficient group may be obtained or derived from the bitstream. The information about the coefficient group may be derived to indicate that it includes at least one effective transform coefficient for the first coefficient group scanned according to the forward (reverse) scan order and for the last coefficient group. That is, the information about the coefficient group may not be included in the bitstream for the first coefficient group and the last coefficient group scanned in the forward (reverse) scan order.
이때, 비디오 복호화 장치(100)는 블록의 크기 및 예측 모드 중 적어도 하나에 기초하여 소정의 역방향 스캔 순서를 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 블록의 크기가 4x4이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 블록의 크기가 8x8이고, 현재 블록의 예측 모드가 인트라 예측 모드인 경우, 역방향의 수평 스캔 순서, 수직 스캔 순서, 또는 대각 스캔 순서 중 하나를 소정의 역방향 스캔 순서로 결정할 수 있다.At this time, the video decoding apparatus 100 may determine a predetermined reverse scan order based on at least one of the size of the block and the prediction mode. For example, when the current block size is 4x4 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 may set one of the reverse horizontal scanning order, vertical scanning order, It can be determined in reverse scan order. When the current block size is 8x8 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 performs one of the reverse horizontal scanning order, the vertical scanning order, or the diagonal scanning order in a predetermined reverse scan Can be determined in order.
비디오 복호화 장치(100)는 현재 블록의 크기가 4x4 또는 8x8이 아니거나, 현재 블록의 예측 모드가 인터 예측 모드가 아닌 경우, 역방향의 대각 스캔 순서를 소정의 역방향 스캔 순서로 결정할 수 있다.The video decoding apparatus 100 can determine the reverse diagonal scanning order in a predetermined reverse scanning order if the current block size is not 4x4 or 8x8 or if the prediction mode of the current block is not the inter prediction mode.
비디오 복호화 장치(100)는 계수 그룹(205)에 관한 정보가 계수 그룹(205)에 적어도 하나의 유효 계수를 포함함을 나타내는 경우, 해당 계수 그룹(205) 내 변환 계수들에 관한 정보를 역방향의 소정의 스캔 순서(215)에 따라 계수 그룹 내 변환 계수들에 관한 정보를 스캔할 수 있다.When the video decoding apparatus 100 indicates that the information on the coefficient group 205 includes at least one coefficient of validity in the coefficient group 205, The information on the transform coefficients in the coefficient group can be scanned according to a predetermined scanning order 215. [
한편, 비디오 복호화 장치(100)는 각 계수 그룹(205)에 포함된 유효 변환 계수들 중 적어도 하나의 부호(sign)를 숨기는지 여부를 결정할 수 있다.On the other hand, the video decoding apparatus 100 can determine whether to hide at least one sign among the effective transform coefficients included in each coefficient group 205.
도 3a은 다른 실시예에 따라서 블록 내 변환 계수를 스캔하는 방법을 설명하기 위한 도면이다.3A is a diagram for explaining 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 unit of data for performing an inverse transform operation, and may be a block of MxN (M, N is a positive integer) size. For example, as shown in FIG. 3, the current block 300 may be a 16x16 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 the effective transform coefficients existing in the current block 300. At this time, the quadrangular scan region 340 may be determined by the coordinates of the pixel 330 located at the lower right of the quadrangular scan region 340. The horizontal coordinate of the pixel 330 positioned at the lower right of the scan region 340 is the horizontal coordinate of the effective transformation coefficient pixel 320 located at the rightmost of all the effective transformation coefficients in the current block 300 have. The vertical direction coordinate of the pixel 330 positioned at the lower right of the scan region 340 is the vertical direction coordinate of the effective transformation coefficient pixel 310 located at the bottom of all the effective transformation coefficients in the current block 300 have. The information about the pixel 330 may include information about the upper left corner position of the pixel 330. The information about the pixel 330 may include information about the position of the bottom 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 quadrangular scan region 340 from the bit stream and generates the quadrangular scan region 340 based on the information about the received pixel 330. [ Can be determined. The video decoding apparatus 100 can scan information on the transform coefficients from the pixel 330 to the upper left pixel 345 of the rectangular scan area 340 according to a predetermined reverse scan order 355. [ At this time, the coefficient group may be determined for every K (K is a positive integer) scan coefficient scanned according to a predetermined forward scan order from the upper left transform coefficient of the rectangular scan region 340. [ It is easily understood by those skilled in the art that the number of K (K is a positive integer) scan coefficient scanned according to a predetermined reverse scan order can be determined from the transform coefficient at the lower right end. Details of the coefficient group will be described later with reference to FIG. 3B.
한편, 비디오 복호화 장치(100)는 각 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있음을 결정할 수 있고, 숨겨져 있는 적어도 하나의 유효 변환 계수에 대한 부호를 복원할 수 있다. 각 계수 그룹에 대하여 숨겨진 부호를 복원하는 동작을 수행하는 것에 대한 상세한 내용은 도 3b를 참조하여 후술하도록 하겠다.On the other hand, the video decoding apparatus 100 can determine that a sign for at least one effective transform coefficient is hidden for each coefficient group, and can restore the sign for at least one effective transform coefficient that is hidden . Details of performing the operation of restoring the hidden code for each coefficient group will be described later with reference to FIG. 3B.
도 3b는 일 실시예에 따라서 블록 내 계수 그룹(서브 블록)을 결정하는 동작 및 계수 그룹 별로 수행되는 동작을 설명하기 위한 도면이다.FIG. 3B is a view for explaining an operation of determining intra-block coefficient groups (sub-blocks) and an operation performed for each coefficient group according to an embodiment.
비디오 복호화 장치(100)는 현재 블록(350)에서 정방향의 소정의 스캔 순서(355)에 따라 K(K는 양의 정수)개의 변환 계수 픽셀마다 계수 그룹을 결정할 수 있다. 비디오 복호화 장치(100)는 K개의 변환 계수 픽셀을 포함하는 계수 그룹을 결정할 수 있다. 예를 들어, 도 3b에 도시된 바와 같이, 비디오 복호화 장치(100)는 16개의 픽셀마다 계수 그룹(360)을 결정할 수 있다.The video decoding apparatus 100 can determine a coefficient group for each of K (K is a positive integer) conversion coefficient pixels according to a predetermined scanning order 355 in the current block 350 in the forward direction. 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 the 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 every 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 can determine that a sign (Sign) for at least one effective transform coefficient is hidden for the current coefficient group based on the distance of previously decoded effective transform coefficients in the current coefficient group . Specifically, the video decoding apparatus 100 encodes 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 last valid transform coefficient scanned according to a predetermined reverse scan order, Can be determined to be hidden. In this case, the distance may be a difference in the positions of the coefficients scanned in the reverse scan order.
예를 들어 비디오 복호화 장치(100)는 소정의 역방향 스캔 순서에 따라 스캔된 최초 유효 변환 계수 및 최종 유효 변환 계수 간의 거리가 소정의 값보다 큰 경우 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정할 수 있다. 이때, 소정의 값은 다양한 정수값일 수 있다. 예를 들어, 소정의 값은 3일 수 있다.For example, when the distance between the first effective conversion coefficient and the last effective conversion coefficient scanned according to a predetermined reverse scan order is greater than a predetermined value, the video decoding apparatus 100 may determine It can be determined that the sign is hidden. At this time, the predetermined value may be various integer values. For example, the predetermined value may be three.
비디오 복호화 장치(100)는 현재 계수 그룹에 대하여 적어도 하나의 유효 변환 계수에 대한 부호(Sign)가 숨겨져 있다고 결정되면, 현재 계수 그룹에 대하여 비트스트림으로부터 부호에 관한 정보의 획득없이 현재 계수 그룹 내 적어도 하나의 유효 변환 계수에 대해 숨겨진 부호를 복원할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 현재 계수 그룹 내 유효 변환 계수들의 레벨에 대한 패리티 합(parity sum)이 홀수 또는 짝수인 경우, 적어도 하나의 유효 변환 계수에 관한 부호를 0 또는 1로 결정할 수 있다. 이때, 복원되는 유효 변환 계수의 부호는 역방향의 스캔 순서에 따라 스캔되는 최종 유효 변환 계수에 관한 부호를 포함할 수 있다. 다만, 이에 제한되지 않고, 소정의 스캔 순서에 따라 계수 그룹 내 소정의 위치에 있는 부호를 복원할 수 있음을 당업자는 용이하게 이해할 수 있다.If it is determined that the sign for at least one effective transform coefficient is hidden for the current coefficient group, the video decoding apparatus 100 determines whether or not the current coefficient group includes at least A hidden code for one effective transform coefficient can be restored. For example, when the parity sum with respect to the level of the effective transform coefficients in the current coefficient group is odd or even, the video decoding apparatus 100 determines the sign of at least one effective transform coefficient as 0 or 1 . At this time, the sign of the effective transform coefficient to be reconstructed may include a sign related to the final effective transform coefficient scanned in the reverse scan order. However, it is easily understood by those skilled in the art that a code at a predetermined position in a coefficient group can be restored according to a predetermined scanning order without being limited thereto.
비디오 복호화 장치(100)는 역방향의 소정 스캔 순서에 따라 비트스트림으로부터 해당 계수 그룹에 관한 정보를 획득하고, 해당 계수 그룹에 관한 정보가 계수 그룹에 적어도 하나의 변환 계수를 포함함을 나타내는 경우, 해당 계수 그룹 내 변환 계수에 관한 정보를 스캔할 수 있다. 해당 계수 그룹에 관한 정보가 계수 그룹에 0의 값을 갖는 변환 계수만을 포함함을 나타내는 경우, 해당 계수 그룹 내 변환 계수를 모두 0으로 결정할 수 있다.The video decoding apparatus 100 acquires information on the coefficient group from the bitstream according to a predetermined scanning 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 the transform coefficient in the coefficient group can be scanned. When the information on the coefficient group indicates that the coefficient group includes only the transform coefficient having a value of 0, all of the transform coefficients in the coefficient group can be determined as 0.
한편, 현재 블록(300) 내 사각형 스캔 영역에 포함된 변환 계수의 개수가 K개의 정수배가 아닌 경우, 정방향의 스캔 순서에 따라 마지막에 위치하는 계수 그룹을 결정하는 과정에서 K개보다 적은 개수의 변환 계수 픽셀이 존재할 수 있다. 이 경우, 비디오 복호화 장치(100)는 K개보다 적은 개수의 변환 계수 픽셀을 포함하는 계수 그룹(365)을 결정할 수 있다. 예를 들어, 도 3b에 도시된 바와 같이, 비디오 복호화 장치(100)는 2개의 변환 계수를 포함하는 계수 그룹(365)를 결정할 수 있다.If the number of transform coefficients included in the square scan region in the current block 300 is not K integer times, the process of determining the last coefficient group according to the forward scan order may perform a smaller number of transforms A coefficient pixel may be present. In this case, the video decoding apparatus 100 may determine a coefficient group 365 that includes fewer than K number of conversion coefficient pixels. 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 can obtain information on the coefficient groups 355 and 360 from the bitstream. Here, the information on the coefficient groups 355 and 360 includes flag information indicating whether at least one of the conversion coefficients included in the coefficient groups 355 and 360 is an effective conversion coefficient or only conversion coefficients whose coefficient groups 355 and 360 are 0 Group flag information).
한편, 비디오 복호화 장치(100)는 1개의 변환 계수만을 포함하는 계수 그룹이 결정된다면, 비트스트림으로부터 해당 계수 그룹에 관한 정보(예를 들어, 유효 계수 그룹 플래그 정보)를 획득하지 않고, 1개의 변환 계수에 관한 정보을 획득할 수 있다.On the other hand, if the coefficient group including only one transform coefficient is determined, the video decoding apparatus 100 does not acquire information (for example, effective coefficient group flag information) about the coefficient group from the bitstream, Information about the coefficient can be obtained.
비디오 복호화 장치(100)는 역방향의 소정의 스캔 순서(355)에 따라 현재 계수 그룹보다 이전에 스캔된 계수 그룹의 계수 그룹에 관한 정보를 기초로 현재 계수 그룹에 관한 정보를 이진 산술 복호화하기 위한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 generates a context for binary arithmetic decoding information on the current coefficient group on the basis of the information on the coefficient group of the coefficient group scanned earlier than the current coefficient group according to the predetermined scanning order 355 in the reverse direction The model can be determined.
도 4는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 4 is a diagram for explaining a process of determining a context model for decoding context-based binary arithmetic decoding information on transform coefficients according to an exemplary embodiment of the present invention.
도 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 the information about the currently scanned transform coefficient pixel 405 based on the transform coefficient pixels 410. FIG. In FIG. 4, the neighboring transform coefficient pixels 405 may be five pixels existing at a predetermined position on the right side or the lower side of the currently scanned transform coefficient pixel 405. It is easily understood by those skilled in the art that the peripheral transformation coefficient pixels 405 may be n (n is a positive integer) pixels existing at a predetermined position on the right side or the lower side, without limitation thereto.
예를 들어, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 0보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 레벨 절대값이 0보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.For example, the video decoding apparatus 100 may compare the context model of the flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 405 is greater than 0, Can be determined based on the number of larger coefficient pixels.
또한, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 1보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 1보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다The video decoding apparatus 100 further includes a context model of flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 405 is greater than 1, Can be determined based on the number of pixels
비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 절대값이 2보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 2보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 converts the context model of the flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 405 is greater than 2, Can be determined based on the number.
비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(405)의 레벨 값이 N(N은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(410) 중 절대값이 N보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 converts the context model of the flag information indicating whether the level value of the currently scanned conversion coefficient pixel 405 is larger than N (N is an integer larger than 2) Can be determined based on the number of coefficient pixels larger than N. [
비디오 복호화 장치(100)는 현재 스캔 되는 변환 계수 픽셀(405)의 잔여 레벨 절대값을 이진화하기 위한 파라메터를 주변 변환 계수 픽셀들(410)의 레벨 절대값의 합을 기초로 결정할 수 있다. 이때, 이진화 파라메터는 라이스 파라메터일 수 있다.The video decoding apparatus 100 may determine a parameter for binarizing the residual level absolute value of the currently scanned conversion coefficient pixel 405 based on the sum of the absolute level values of the peripheral conversion coefficient pixels 410. [ At this time, the binarization parameter may be a Rice parameter.
도 5는 일 실시예에 따라서 변환 계수에 관한 정보를 컨텍스트 기반 이진 산술 부복호화하기 위한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.FIG. 5 is a diagram for explaining a process of determining a context model for decoding context-based binary arithmetic 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)는 역방향의 지그재그 스캔 순서일 수 있으나, 이에 제한되지 않고, 수평 스캔 순서, 수직 스캔 순서, 대각 스캔 순서 등을 포함할 수 있음을 당업자는 용이하게 이해할 수 있다. 특히, 소정의 역방향 스캔 순서는 스캔 영역을 특정하는 수평 방향 좌표 값의 크기 및 수직방향 좌표 값의 크기에 기초하여 복수의 스캔 순서 중 하나로 결정될 수 있다.5, the video decoding apparatus 100 transmits a context model of information on the currently scanned transform coefficient pixel 505 to previously scanned transform coefficient pixels 510 according to a predetermined reverse scan sequence 515, . ≪ / RTI > As shown in FIG. 5, the transform coefficient pixels 510 may be five pixels previously scanned according to a predetermined reverse echo scan order 515 than the currently scanned transform coefficient pixel 505. Those skilled in the art will readily understand that the transform coefficient pixels 505 may be n (n is a positive integer) pixels previously scanned in accordance with a given reverse echo scan order 515 . As shown in FIG. 5, the predetermined reverse scan order 515 may be a reverse zigzag scan order, but the present invention is not limited thereto. For example, those skilled in the art can understand that the reverse scan order 515 includes a horizontal scan order, a vertical scan order, It can be easily understood. In particular, the predetermined reverse scan order may be determined in one of a plurality of scan orders based on the magnitude of the horizontal direction coordinate value specifying the scan region and the vertical direction coordinate value.
예를 들어, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 0보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 0보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.For example, the video decoding apparatus 100 may compare the context model of the flag information, which indicates whether the level absolute value of the currently scanned conversion factor pixel 505 is greater than 0, Can be determined based on the number of large coefficient pixels.
또한, 비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 1보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 변환 계수 픽셀들(510) 중 절대값이 1보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 further includes a context model of flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 505 is greater than 1, As shown in FIG.
비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 2보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 2보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 converts the context model of the flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 505 is larger than 2, Can be determined based on the number.
비디오 복호화 장치(100)는 현재 스캔되는 변환 계수 픽셀(505)의 레벨 절대값이 N(N은 2보다 큰 정수)보다 큰지를 나타내는 플래그 정보의 컨텍스트 모델을 주변 변환 계수 픽셀들(510) 중 절대값이 N보다 큰 계수 픽셀들의 개수에 기초하여 결정할 수 있다.The video decoding apparatus 100 transmits a context model of flag information indicating whether the level absolute value of the currently scanned conversion coefficient pixel 505 is larger than N (N is an integer larger than 2) The value can be determined based on the number of coefficient pixels larger 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 neighboring transform coefficient pixels 510. [ At this time, the binarization parameter may be a Rice parameter.
도 6a는 일 실시예에 따라서 블록 내 유효 변환 계수에 관한 정보를 스캔하기 위한 지그재그 스캔 순서를 설명하기 위한 도면이다.FIG. 6A is a diagram for explaining a zigzag scanning order for scanning information on effective conversion coefficients in a block according to an exemplary embodiment. Referring to FIG.
도 6a를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 지그재그 스캔 순서(602)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 6A, the video decoding apparatus 100 scans the information on the transform coefficient of the current block 600 from the transform coefficient pixel of the lower right end of the current block 600 according to the zig- You can scan up to the conversion factor pixel at the top.
구체적으로, 지그재그 스캔 순서(602)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(604)을 스캔한 후에 픽셀(604)의 좌측 픽셀(606)을 스캔하고, 픽셀(606)을 스캔한 후에 우측 상단의 대각선 방향에 위치하는 픽셀(608)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(608)의 상측에 인접하는 픽셀(610)을 스캔한다. 비디오 복호화 장치(100)는 픽셀의 좌측 하단의 대각선 방향에 위치하는 픽셀들(612)을 스캔한다. 비디오 복호화 장치(100)는 픽셀들(612) 중 현재 블록(600)의 경계에 인접하는 픽셀의 좌측에 위치하는 픽셀(614)을 스캔한다. 이와 유사한 방식으로, 지그재그 스캔 순서(602)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, in accordance with the zigzag scan sequence 602, the video decoding apparatus 100 scans the lower-left conversion coefficient pixel 604, then scans the left pixel 606 of the pixel 604, And then scans the pixel 608 located in the diagonal direction of the upper right corner. The video decoding apparatus 100 scans the pixel 610 adjacent to the upper side of the pixel 608. [ The video decoding apparatus 100 scans the pixels 612 located in the diagonal direction of the lower left corner of the pixel. The video decoding apparatus 100 scans the pixels 614 located on the left side of the pixels 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 sequence 602. [
한편, 일 실시예에 따른 지그재그 스캔 순서(602)는 픽셀(604)을 스캔한 후에 바로 수평 방향에 위치하는 좌측 방향 픽셀(606)을 스캔하므로, 지그재그 스캔 순서(602)를 수평 우선 지그재그 순서라고 칭할 수 있다.Meanwhile, the zigzag scanning procedure 602 according to an exemplary embodiment of the present invention scans the left directional pixel 606 located in the horizontal direction immediately after the pixel 604 is scanned, so that the zigzag scanning order 602 is referred to as a horizontal priority zigzag sequence Can be called.
도 6b는 다른 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 우선 지그재그 스캔 순서를 설명하기 위한 도면이다.6B is a diagram for explaining a vertical priority zigzag scan sequence for scanning information on intra-block transform coefficients according to another embodiment.
도 6b를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 지그재그 스캔 순서(616)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.6B, the video decoding apparatus 100 scans the information on the transform coefficient of the current block 600 from the transform coefficient pixel of the lower right end of the current block 600 according to the zigzag scan sequence 616, You can scan up to the conversion factor pixel at the top.
구체적으로, 지그재그 스캔 순서(616)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(618)을 스캔한 후에 픽셀(618)의 상측 픽셀(620)을 스캔하고, 픽셀(620)을 스캔한 후에 좌측 하단의 대각선 방향에 위치하는 픽셀(622)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(622)의 좌측에 인접하는 픽셀(624)을 스캔한다. 비디오 복호화 장치(100)는 픽셀의 우측 상단의 대각선 방향에 위치하는 픽셀들(626)을 스캔한다. 비디오 복호화 장치(100)는 픽셀들(626) 중 현재 블록(600)의 경계에 인접하는 픽셀의 상측에 위치하는 픽셀(628)을 스캔한다. 이와 유사한 방식으로, 지그재그 스캔 순서(616)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, in accordance with the zigzag scan sequence 616, the video decoding apparatus 100 scans the upper-side pixel 620 of the pixel 618 after scanning the lower-right conversion coefficient pixel 618, And then scans the pixel 622 located in the diagonal direction of the lower left corner. The video decoding apparatus 100 scans the pixel 624 adjacent to the left side of the pixel 622. [ The video decoding apparatus 100 scans the pixels 626 positioned in the diagonal direction of the upper right corner of the pixel. The video decoding apparatus 100 scans the pixel 628 located on the upper side of the 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 about the remaining transform coefficient pixels according to the zigzag scan sequence 616. [
한편, 일 실시예에 따른 지그재그 스캔 순서(616)는 픽셀(618)을 스캔한 후에 바로 수직 방향에 위치하는 상측 방향 픽셀(620)을 스캔하므로, 지그재그 스캔 순서(616)를 수직 우선 지그재그 순서라고 칭할 수 있다.Meanwhile, the zigzag scan sequence 616 according to an exemplary embodiment of the present invention scans the upward directional pixel 620 located immediately after the scan of the pixel 618, so that the zigzag scan sequence 616 is referred to as a vertical priority zigzag sequence Can be called.
도 6c는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수평 스캔 순서를 설명하기 위한 도면이다.FIG. 6C is a diagram for explaining a horizontal scanning order for scanning information on intra-block transform coefficients according to an embodiment.
도 6c를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 수평 스캔 순서(630)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.Referring to FIG. 6C, the video decoding apparatus 100 scans the information on the transform coefficient of the current block 600 from the transform coefficient pixel of the lower right end of the current block 600 according to the horizontal scan order 630, You can scan up to the conversion factor pixel at the top.
구체적으로, 수평 스캔 순서(630)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(632)을 스캔한 후에 수평 방향인 좌측 방향에 위치하는 픽셀들(634)을 순차적으로 스캔하고, 픽셀들(634) 중 현재 블록(600)의 좌측 경계에 인접하는 픽셀을 스캔한 후에 바로 위에 있는 행의 가장 우측 픽셀(636)을 스캔한다. 비디오 복호화 장치(100)는 이전 행의 픽셀들(634)을 스캔한 것과 같은 방식으로 수평방향인 좌측 방향에 위치하는 픽셀들(638)을 스캔한다. 이와 유사한 방식으로, 수평 스캔 순서(630)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, in the horizontal scanning order 630, the video decoding apparatus 100 scans the lower right transform coefficient pixel 632 and then sequentially scans the pixels 634 located in the horizontal direction, , And scans the pixels of the pixels 634 adjacent to the left boundary of the current block 600 and then scans the rightmost pixel 636 of the immediately preceding row. The video decoding apparatus 100 scans the pixels 638 located in the horizontal direction in the same manner as the pixels of the previous row 634 are scanned. In a similar manner, the video decoding apparatus 100 may scan information about the remaining transform coefficient pixels according to the horizontal scan order 630. [
도 6d는 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 수직 스캔 순서를 설명하기 위한 도면이다. FIG. 6D is a diagram for explaining a vertical scanning sequence for scanning information on intra-block transform coefficients according to an embodiment.
도 6d를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 수직 스캔 순서(640)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.6D, the video decoding apparatus 100 scans the information on the transform coefficient of the current block 600 from the transform coefficient pixel of the lower right end of the current block 600 according to the vertical scan sequence 640, You can scan up to the conversion factor pixel at the top.
구체적으로, 수직 스캔 순서(640)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(642)을 스캔한 후에 수직 방향인 상측 방향에 위치하는 픽셀들(644)을 순차적으로 스캔하고, 픽셀들(644) 중 현재 블록(600)의 상측 경계에 인접하는 픽셀을 스캔한 후에 바로 좌측에 있는 열의 가장 하측 픽셀(646)을 스캔한다. 비디오 복호화 장치(100)는 이전 열의 픽셀들(644)을 스캔한 것과 같은 방식으로 수직방향인 상측 방향에 위치하는 픽셀들(648)을 스캔한다. 이와 유사한 방식으로, 수직 스캔 순서(640)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, in the vertical scanning order 640, the video decoding apparatus 100 sequentially scans the pixels 644 positioned in the vertical direction, which is the vertical direction, after scanning the conversion coefficient pixel 642 at the lower right end , And scans the pixels of the pixels 644 adjacent to the upper boundary of the current block 600 and then immediately scans the lowermost pixel 646 of the column on the left side. The video decoding apparatus 100 scans the pixels 648 positioned in the vertical direction in the same manner as the pixels in the previous column 644 are scanned. In a similar manner, the video decoding apparatus 100 may scan information on the remaining transform coefficient pixels according to the vertical scan sequence 640. [
도 6e은 일 실시예에 따라서 블록 내 변환 계수에 관한 정보를 스캔하기 위한 대각 스캔 순서를 설명하기 위한 도면이다.6E is a diagram for explaining a diagonal scan order for scanning information on intra-block transform coefficients according to an embodiment.
도 6e를 참조하면, 비디오 복호화 장치(100)는 현재 블록(600)의 변환 계수에 관한 정보를 스캔하기 위해 대각 스캔 순서(650)에 따라 현재 블록(600)의 우측 하단의 변환 계수 픽셀로부터 좌측 상단의 변환 계수 픽셀까지 스캔할 수 있다.6E, the video decoding apparatus 100 reads the transform coefficients of the current block 600 from the transform coefficient pixels of the lower right end of the current block 600 according to the diagonal scan order 650 to scan information on the transform coefficients of the current block 600, You can scan up to the conversion factor pixel at the top.
구체적으로, 대각 스캔 순서(650)에 의하면, 비디오 복호화 장치(100)는 우측 하단의 변환 계수 픽셀(652)을 스캔한 후에 픽셀(652)의 상측 픽셀(654)을 스캔하고, 픽셀(654)을 스캔한 후에 좌측 하단의 대각선 방향에 위치하는 픽셀(656)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(654)의 상측에 인접하는 픽셀(658)을 스캔한다. 비디오 복호화 장치(100)는 픽셀(658)의 좌측 하단의 대각선 방향에 위치하는 픽셀들(660)을 스캔한다. 이와 유사한 방식으로, 대각 스캔 순서(650)에 따라 비디오 복호화 장치(100)는 나머지 변환 계수 픽셀들에 관한 정보를 스캔할 수 있다.Specifically, in accordance with the diagonal scan sequence 650, the video decoding apparatus 100 scans the upper right pixel 652 of the pixel 652 after scanning the lower right conversion coefficient pixel 652, And then scans the pixel 656 located in the lower left diagonal direction. The video decoding apparatus 100 scans the pixel 658 adjacent to the upper side of the pixel 654. [ The video decoding apparatus 100 scans the pixels 660 located in the diagonal direction of the lower left end of the pixel 658. [ In a similar manner, the video decoding apparatus 100 may scan information about the remaining transform coefficient pixels according to the diagonal scan sequence 650. [
이상 도 6a 내지 도 6e를 참조하여, 블록 내 유효 변환 계수에 관한 정보를 스캔하기 위한 다양한 스캔 순서를 설명하였다. 도 6a 내지 도 6e를 참조하여 설명한 스캔 순서들은 역방향의 스캔 순서나, 이에 제한되지 않고 당업자는 역방향의 스캔 순서의 반대 순서로 스캔하는 정방향의 스캔 순서를 용이하게 이해할 수 있다.6A to 6E, various scan sequences for scanning information on effective conversion coefficients in a block have been described. The scan orders described with reference to FIGS. 6A through 6E can be easily understood in a reverse scan order, or a forward scan order in which a person skilled in the art scans in the reverse order of the reverse scan order.
도 7a는 일 실시예에 따라서 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향의 좌표를 변경(swap)하여 스캔 영역을 변경하는 과정을 설명하기 위한 도면이다.FIG. 7A is a diagram for explaining a process of changing a scan area by swapping horizontal and vertical coordinates of transform coefficient pixels in a scan area according to an exemplary embodiment.
도 7a를 참조하면, 현재 블록(700)은 너비가 높이보다 큰 직사각형일 수 있다. 7A, the current block 700 may be a rectangle whose width is greater than the height.
비디오 복호화 장치(100)는 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그를 획득할 수 있다. 비디오 복호화 장치(100)는 상기 플래그가 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 경우, 현재 블록(700)의 너비가 높이보다 큰 지 여부를 결정할 수 있다. The video decoding apparatus 100 may obtain a flag indicating that the horizontal coordinate and the vertical coordinate of the conversion coefficient pixel included in the current block 700 are changed to each other. When the video decoding apparatus 100 indicates that the flag activates the operation of changing the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block 700, Can be determined.
비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 너비와 높이를 서로 변경하여, 변경된(swapped) 블록(710)을 결정할 수 있다.The video decoding apparatus 100 can determine the swapped block 710 by changing the width and the height of the current block to each other if the width of the current block is greater than the height.
즉, 비디오 복호화 장치(100)는 현재 블록(700)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하여, 변경된 블록(710) 에 포함된 변환 계수의 픽셀 위치를 결정할 수 있다. That is, the video decoding apparatus 100 can change the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block 700 to determine the pixel position of the transform coefficient included in the changed block 710 .
비디오 복호화 장치(100)는 모든 유효 변환 계수를 포함하는 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보를 비트스트림으로부터 획득할 수 있다. 여기서, 사각형 스캔 영역(705)을 특정하기 위한 좌표의 수평 방향 좌표는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표일 수 있다. 사각형 스캔 영역을 특정하기 위한 좌표의 수직방향 좌표는 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표일 수 있다. 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보는 현재 블록 내 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표 값에 관한 정보 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표 값에 관한 정보를 포함할 수 있다. 또는, 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보는 모든 유효 변환 계수들 중 가장 우측에 위치하는 유효변환 계수 픽셀의 수평 방향 좌표 값 및 현재 블록 내 모든 유효 변환 계수들 중 가장 하측에 위치하는 유효 변환 계수 픽셀의 수직 방향 좌표 값 중 하나의 좌표 값에 관한 정보 및 상기 하나의 좌표와 다른 하나의 좌표 값 간의 차분을 나타내는 정보를 포함할 수 있다. The video decoding apparatus 100 may obtain information on the coordinates for specifying the rectangular scan area 705 including all the effective transformation coefficients from the bitstream. Here, the horizontal direction coordinate of the coordinates for specifying the rectangular scan area 705 may be the horizontal direction coordinate of the effective transformation coefficient pixel located at the rightmost of all the effective transformation coefficients in the current block. The vertical direction coordinate of the coordinates for specifying the quadrangular scan region may be the vertical direction coordinate of the effective transformation coefficient pixel located at the lowermost of all the effective conversion coefficients in the current block. The information on the coordinates for specifying the rectangular scan area 705 includes information on the horizontal coordinate values of the effective conversion coefficient pixels located at the rightmost of all the effective conversion coefficients in the current block, And the vertical coordinate value of the effective conversion coefficient pixel located at the lowermost position of the effective conversion coefficient pixel. Alternatively, the information on the coordinates for specifying the quadrangular scan area 705 may be the horizontal coordinate value of the effective conversion coefficient pixel located at the rightmost of all the effective conversion coefficients, Information on one coordinate value among the vertical coordinate values of the effective conversion coefficient pixel to be located, 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 determines whether the information on the coordinates for specifying the quadrangular scan region 705 from the bitstream is a horizontal coordinate value for specifying the quadrangular scan region 705 (Hereinafter referred to as " delta flag information ") indicating whether or not the information indicating the difference between the vertical direction coordinate value and the vertical direction coordinate value is included. Based on the delta flag information, the video decoding apparatus 100 extracts information indicating a coordinate value indicating one of a horizontal direction coordinate value and a vertical direction coordinate value for specifying the quadrangular scan area 705 from the bit stream and one coordinate value Information indicating a difference between different coordinate values can be obtained.
비디오 복호화 장치(100)는 비트스트림으로부터 획득된 모든 유효 변환 계수를 포함하는 사각형 스캔 영역(705)을 특정하기 위한 좌표에 관한 정보를 기초로 사각형 스캔 영역(705)을 특정하기 위한 좌표를 획득할 수 있다. 이때, 비디오 복호화 장치(100)가 획득한 사각형 스캔 영역(705)을 특정하기 위한 좌표는 현재 블록(700) 내 사각형 스캔 영역(705)을 특정하기 위한 좌표로, 사각형 스캔 영역(705)을 특정하기 위한 좌표의 수평방향 좌표 값 및 수평 방향 좌표 값을 서로 변경함으로써 비디오 복호화 장치(100)는 변경된 블록(710)의 사각형 스캔 영역(715)을 특정하기 위한 좌표 값을 획득할 수 있다.The video decoding apparatus 100 obtains the coordinates for specifying the quadrangular scan area 705 based on the information about the coordinates for specifying the quadrangular scan area 705 including all the effective transformation coefficients obtained from the bitstream . At this time, the coordinates for specifying the quadrangular scan region 705 acquired by the video decoding apparatus 100 are coordinates for specifying the quadrangular scan region 705 in the current block 700, The video decoding apparatus 100 can obtain the coordinate value for specifying the quadrangular scan area 715 of the changed block 710 by mutually changing the horizontal coordinate value and the horizontal coordinate value of the coordinate to be changed.
비디오 복호화 장치(100)는 변경된 블록(710)의 사각형 스캔 영역(715)을 기초로 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 이때, 소정의 스캔 순서는 현재 블록(700)에 대한 소정의 스캔 순서에 대응하는 스캔 순서로 현재 블록(700)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 수평 방향의 좌표 값 및 수직 방향의 좌표 값을 서로 변경한 좌표 값에 따른 스캔 순서일 수 있다. 예를 들어, 현재 블록(700)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값이 (4,4)->(3,4)->(4,3)->...인 경우, 변경된 블록(710)에 대한 소정의 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값은 (4,4)->(4,3)->(3,4)->쪋 일 수 있다.The video decoding apparatus 100 can scan the information on the transform coefficients based on the rectangular scan area 715 of the changed block 710 according to a predetermined scan order. At this time, the predetermined scan order is a horizontal coordinate value of the transform coefficient pixel scanned according to a predetermined scan order for the current block 700 in a scan order corresponding to a predetermined scan order for the current block 700, Direction may be a scanning order according to a coordinate value obtained by mutually changing the coordinate values of the directions. For example, if the coordinate values of the conversion coefficient pixels scanned according to a predetermined scan order for the current block 700 are (4,4) -> (3,4) -> (4,3) -> ... , The coordinate values of the transform coefficient pixels scanned in a predetermined order with respect to the changed block 710 may be (4,4) -> (4,3) -> (3,4) -> 쪋.
비디오 복호화 장치(100)는 변경된 블록(710)에서 스캔된 변환 계수에 관한 정보를 소정의 컨텍스트 모델에 기초하여 이진 산술 복호화하고, 역이진화하여 변경된 블록(710)의 변환 계수들을 획득할 수 있다. 비디오 복호화 장치(100)는 변경된 블록(710)의 변환 계수들의 수평방향 좌표 값 및 수직방향의 값을 서로 변경하여 현재 블록(700)의 변환 계수들을 획득할 수 있다.The video decoding apparatus 100 may binary-arithmetically decode information on the transform coefficients scanned in the changed block 710 based on a predetermined context model, and reverse-binarize the transform coefficients to obtain transform coefficients of the changed block 710. [ The video decoding apparatus 100 may obtain the transform coefficients of the current block 700 by changing the horizontal direction coordinate value and the vertical direction value of the transform coefficients of the changed block 710 to each other.
비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 변경된 블록(710)에서 변환 계수에 관한 정보를 스캔하여 스캔된 변환 계수에 관한 정보를 엔트로피 복호화함으로써, 항상 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 변환 계수에 관한 정보를 엔트로피 복호화할 수 있다. 따라서, 현재 블록의 너비가 높이보다 큰 경우에 대한 별도의 컨텍스트 모델을 이용하지 않고, 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 컨텍스트 모델만을 이용함으로써 엔트로피 복호화의 복잡도를 감소시킬 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 swaps the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block, The information on the transform coefficient related to the block in which the height of the current block is always greater than or equal to the width can be entropy-decoded. Therefore, it is possible to reduce the complexity of entropy decoding by using only the context model for a block whose height is greater than or equal to the width of the current block, without using a separate context model for the case where the width of the current block is greater than the height.
이상 비디오 복호화 장치(100)가 현재 블록의 너비 및 높이가 서로 다른 경우, 델타 플래그 정보를 획득하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 부호화 장치(150) 및 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 다른 경우, 델타 플래그 정보를 획득하지 않고, 비트스트림으로부터 사각형 스캔 영역(715)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.The video encoding apparatus 150 and the video decoding apparatus 100 have been described as acquiring the delta flag information when the current block has different widths and heights, If the width and height of the block are different, information indicating the difference between the horizontal direction coordinate value and the vertical direction coordinate value for specifying the quadrangular scan area 715 from the bit stream can be obtained without obtaining the delta flag information Those skilled in the art will readily understand.
이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 같은지 또는 다른지에 관계없이 델타 플래그 정보를 생성하지 않고, 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.Without being limited to this, the video decoding apparatus 100 may obtain the information indicating the difference between the horizontal direction coordinate value and the vertical direction coordinate value, without generating the delta flag information regardless of whether the width and the height of the current block are the same or different It will be readily understood by those skilled in the art.
이상 비디오 부호화 장치(150)가 변경 플래그를 생성하고, 비디오 복호화 장치(100)가 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그에 기초하여 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할지를 결정하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 항상 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.Based on a flag indicating that the anomaly video encoding apparatus 150 generates a change flag and the video decrypting apparatus 100 activates an operation of changing the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block The video decoding apparatus 100 determines whether to change the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixels included in the current block to each other. However, the present invention is not limited thereto, and if the width of the current block is greater than the height, Those skilled in the art can easily understand that the horizontal direction coordinate and the vertical direction coordinate can be mutually changed.
이상, 비디오 복호화 장치(100)가 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 그렇지 않은 경우 변경하지 않는 내용을 설명하였으나, 이에 제한되지 않고, 반대로 현재 블록의 높이가 너비보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 및 수직 방향 좌표를 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.If the video decoding apparatus 100 swaps the horizontal direction coordinate and the vertical direction coordinate of the conversion coefficient pixel included in the current block, if the width of the current block is larger than the height, Those skilled in the art can easily understand that the horizontal direction and the vertical direction coordinates of the transform coefficient pixels included in the current block can be changed when the height of the current block is larger than the width.
이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하지 않고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 스캔 영역 내 변환 계수들의 수평 방향 및 수직 방향 좌표를 서로 변경하여 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.The video decoding apparatus 100 changes the horizontal direction coordinate and the vertical direction coordinate of the current block and changes the horizontal direction coordinate and the vertical direction coordinate of the scan region to scan the information about the transform coefficient, But the present invention is not limited to this. However, the present invention is not limited to this, and the present invention is not limited to this, The transformation coefficients in the scan area are obtained by performing scan and entropy decoding of information on the intra-scan transform coefficients by changing only the horizontal direction coordinate and the vertical direction coordinate of the scan area without changing the coordinate and the vertical direction coordinate, The horizontal direction and the vertical direction coordinates of the transformation coefficients in the scan area are mutually changed, Those skilled in the art can easily understand that the transform coefficients can be obtained.
이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 변환 계수들의 수평 방향 및 수직 방향 좌표의 변경없이 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 복호화하고, 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다. The video decoding apparatus 100 changes the horizontal direction coordinate and the vertical direction coordinate of the current block and changes the horizontal direction coordinate and the vertical direction coordinate of the scan region to scan the information about the transform coefficient, But the present invention is not limited to this. However, the present invention is not limited to this, and the present invention is not limited to this. For example, the horizontal direction of the transform coefficients And transforming only the horizontal coordinate and the vertical coordinate of the scan area without changing the vertical coordinate, decodes the information, scans and entropy decodes information on the intra-scan conversion coefficient to obtain the intra-scan conversion coefficient, It is easily understood by those skilled in the art that the current in-block transform coefficients can be obtained.
즉, 비디오 부호화 장치(150)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 스캔 영역의 수평 방향 및 수직 방향 좌표를 서로 변경하고, 이를 나타내는 정보를 전송할 수 있다. 이때, 일반적으로는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 너비가 높이보다 큼으로, 스캔영역을 특정하는 수평방향의 좌표는 수직방향의 좌표보다 크게 되고, 서로 좌표 값을 변경하게 되면, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 작게 된다. 따라서, 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 전송함으로써 비트수를 줄일 수 있게 된다. 하지만, 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 높이가 너비보다 크다면, 비디오 부호화 장치(150)는 변경된 수평방향의 좌표 값 정보 및 변경된 수평방향의 좌표 값 및 변경된 수직방향의 좌표 값정보를 그대로 전송할 수 있다. 즉, 차분 정보가 전송되지 않을 수 있다. 이 경우, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 크기 때문이다. That is, when the width of the current block is greater than the height, the video encoding apparatus 150 may change the horizontal and vertical coordinates of the scan area of the current block and transmit information indicating the same. In this case, generally, when the width of the current block is greater than the height, the width of the scan area is greater than the height, and the coordinates in the horizontal direction specifying the scan area are larger than the coordinates in the vertical direction. , The changed coordinate value in the horizontal direction becomes smaller than the changed vertical coordinate value. Therefore, it is possible to reduce the number of bits by transmitting the information about the changed coordinate values in the horizontal direction and the difference information about the changed coordinate values in the horizontal direction and the changed coordinate values in the vertical direction. However, if the width of the current block is greater than the height and the height of the scan area is larger than the width, the video encoding apparatus 150 displays the changed coordinate value information in the horizontal direction, the changed coordinate value in the horizontal direction, Information can be transmitted as it is. That is, difference information may not be transmitted. In this case, the changed horizontal coordinate value is larger than the changed vertical coordinate value.
비디오 부호화 장치(150)는 차분 정보를 전송하는지 여부를 나타내는 플래그를 함께 전송할 수 있다. 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역을 특정하는 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경한다고 결정할 수 있고, 비트스트림으로부터 플래그를 획득하고 플래그의 값이 1(차분 정보를 전송함을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다.The video encoding apparatus 150 may transmit a flag indicating whether or not to transmit the difference information together. The video decoding apparatus 100 may decide to change the horizontal direction coordinate value and the vertical direction coordinate value specifying the scan area to each other when the width of the current block is larger than the height, 1 (indicating that the difference information is transmitted), information on the changed coordinate value in the horizontal direction and difference information on the changed coordinate value in the horizontal direction and the coordinate value in the changed vertical direction are obtained, and the changed scanning area is specified Can be obtained.
플래그의 값이 0(차분 정보를 전송하지 않음을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수직방향의 좌표 값에 관한 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다. If the value of the flag is 0 (indicating that differential information is not transmitted), information on the changed coordinate values in the horizontal direction and information on the changed coordinate values in the vertical direction are obtained, and coordinate values Can be obtained.
비디오 복호화 장치(100)는 획득된 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경하여 최종 스캔 영역을 특정하고, 스캔 영역 내 변환 계수에 관한 정보를 스캔할 수 있다.The video decoding apparatus 100 can identify the final scan region by changing the obtained horizontal direction coordinate value and the vertical direction coordinate value, and scan the information about the intra-scan conversion coefficient.
다만 현재 블록의 너비가 높이보다 큰 경우에 제한되지 않고, 현재 블록의 높이가 너비보다 큰 경우에도 유사한 동작이 수행될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the present invention is not limited to the case where the width of the current block is larger than the height, and a person skilled in the art can easily understand that a similar operation can be performed even when the height of the current block is larger than the width.
도 7b는 다른 실시예에 따라서 사각형 스캔 영역 내 변환 계수 픽셀들의 수평 방향 및 수직 방향 좌표를 변경(swap)하여 스캔 영역을 변경(swap)하는 과정을 설명하기 위한 도면이다.FIG. 7B is a diagram for explaining a process of swapping a scan area by swapping horizontal and vertical coordinates of transform coefficient pixels in a rectangular scan area according to another embodiment.
도 7b를 참조하면, 현재 블록(720)은 그 너비가 높이보다 큰 직사각형일 수 있다. 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 the operation of changing the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block 720 to each other is activated. When the video decoding apparatus 100 indicates that the flag activates the operation of changing the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixels contained in the current block 720, the width of the current block 720 is set to a height Can be determined.
비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 너비와 높이를 서로 변경하여, 변경된(swapped) 블록(730)을 결정할 수 있다.The video decoding apparatus 100 can determine the swapped block 730 by changing the width and the height of the current block to each other if the width of the current block is greater than the height.
즉, 비디오 복호화 장치(100)는 현재 블록(720)에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하여, 변경된 블록(730) 에 포함된 변환 계수의 픽셀 위치를 결정할 수 있다. That is, the video decoding apparatus 100 can change the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block 720 to determine the pixel position of the transform coefficient included in the changed block 730 .
비디오 복호화 장치(100)는 모든 유효 변환 계수를 포함하는 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보를 비트스트림으로부터 획득할 수 있다. 여기서, 스캔 영역(725)을 특정하기 위한 좌표는 소정의 정방향 스캔 순서에 따라 스캔하는 경우 마지막 유효 변환 계수 픽셀의 수평방향 및 수직 방향 좌표일 수 있다. 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보는 마지막 유효 변환 계수 픽셀(725)의 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함할 수 있다. 또는, 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보는 마지막 유효 변환 계수 픽셀의 수평방향 좌표 및 수직 방향 좌표 중 하나의 좌표 값에 관한 정보 및 상기 하나의 좌표와 다른 하나의 좌표 값 간의 차분을 나타내는 정보를 포함할 수 있다. The video decoding apparatus 100 may obtain information on the coordinates for specifying the scan area 725 including all the effective transform coefficients from the bit stream. Here, the coordinates for specifying the scan area 725 may be horizontal and vertical coordinates of the last effective conversion factor pixel when scanning according to a predetermined forward scan order. The information about the coordinates for specifying the scan area 725 may include information about the horizontal coordinate of the last effective conversion coefficient pixel 725 and information about the vertical coordinate. Alternatively, the information on the coordinates for specifying the scan area 725 may include information on one of the horizontal direction coordinate and the vertical direction coordinate of the last effective conversion coefficient pixel, and information on the coordinate value of the difference between the one coordinate value and the other coordinate value Lt; / RTI >
비디오 복호화 장치(100)는 현재 블록의 너비와 높이가 서로 다른 경우, 비트스트림으로부터 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보가 스캔 영역(725)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 포함하는지 여부를 나타내는 플래그 정보(이하, 델타 플래그 정보라 한다)를 획득할 수 있다. 비디오 복호화 장치(100)는 델타 플래그 정보에 기초하여 비트스트림으로부터 스캔 영역(725)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값 중 하나를 나타내는 좌표 값을 나타내는 정보 및 하나의 좌표 값과 다른 좌표 값 간의 차분을 나타내는 정보를 획득할 수 있다.When the width and height of the current block are different from each other, the video decoding apparatus 100 determines whether the information related to the coordinates for specifying the scan area 725 from the bit stream corresponds to the horizontal direction coordinate value for specifying the scan area 725, (Hereinafter referred to as " delta flag information ") indicating whether or not the information indicating the difference between the direction coordinate values is included. The video decoding apparatus 100 displays information indicating a coordinate value indicating one of a horizontal direction coordinate value and a vertical direction coordinate value for specifying the scan area 725 from the bit stream based on the delta flag information, Information indicating a difference between coordinate values can be obtained.
비디오 복호화 장치(100)는 비트스트림으로부터 획득된 모든 유효 변환 계수를 포함하는 스캔 영역(725)을 특정하기 위한 좌표에 관한 정보를 기초로 스캔 영역(725)을 특정하기 위한 좌표를 획득할 수 있다. 이때, 비디오 복호화 장치(100)가 획득한 스캔 영역(725)을 특정하기 위한 좌표는 현재 블록(720) 내 스캔 영역(725)을 특정하기 위한 좌표로, 스캔 영역(725)을 특정하기 위한 좌표의 수평방향 좌표 값 및 수평 방향 좌표 값을 서로 변경함으로써 비디오 복호화 장치(100)는 변경된 블록(730)의 스캔 영역(725)을 특정하기 위한 좌표 값을 획득할 수 있다.The video decoding apparatus 100 can obtain the coordinates for specifying the scan area 725 based on the information about the coordinates for specifying the scan area 725 including all the effective transformation coefficients obtained from the bit stream . The coordinate for specifying the scan area 725 acquired by the video decoding apparatus 100 is a coordinate for specifying the scan area 725 in the current block 720. The coordinates for specifying the scan area 725 include coordinates The video decoding apparatus 100 can obtain the coordinate value for specifying the scan area 725 of the changed block 730 by changing the horizontal direction coordinate value and the horizontal direction coordinate value of the changed block 730 from each other.
비디오 복호화 장치(100)는 변경된 블록(730)의 스캔 영역(735)을 기초로 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔할 수 있다. 이때, 소정의 스캔 순서는 현재 블록(720)에 대한 소정의 스캔 순서에 대응하는 스캔 순서로 현재 블록(720)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 수평 방향의 좌표 값 및 수직 방향의 좌표 값을 서로 변경한 좌표 값에 따른 스캔 순서일 수 있다. 예를 들어, 현재 블록(720)에 대한 소정의 스캔 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값이 (4,4)->(3,4)->(4,3)->...인 경우, 변경된 블록(730)에 대한 소정의 순서에 따라 스캔되는 변환 계수 픽셀의 좌표 값은 (4,4)->(4,3)->(3,4)->... 일 수 있다.The video decoding apparatus 100 can scan the information on the transform coefficients according to a predetermined scan order based on the scan area 735 of the changed block 730. [ At this time, the predetermined scan order is a horizontal coordinate value of the conversion factor pixel scanned according to a predetermined scan order for the current block 720 in a scan order corresponding to a predetermined scan order for the current block 720, Direction may be a scanning order according to a coordinate value obtained by mutually changing the coordinate values of the directions. For example, if the coordinate values of the conversion coefficient pixels scanned according to a predetermined scan order for the current block 720 are (4,4) -> (3,4) -> (4,3) -> ... (4,4) - > (4,3) - > (3,4) - > ..., the coordinate values of the conversion coefficient pixels scanned in a predetermined order with respect to the changed block 730 have.
비디오 복호화 장치(100)는 변경된 블록(730)에서 스캔된 변환 계수에 관한 정보를 소정의 컨텍스트 모델에 기초하여 이진 산술 복호화하고, 역이진화하여 변경된 블록(730)의 변환 계수들을 획득할 수 있다. 비디오 복호화 장치(100)는 변경된 블록(730)의 변환 계수들의 수평방향 좌표 값 및 수직방향의 값을 서로 변경하여 현재 블록(720)의 변환 계수들을 획득할 수 있다.The video decoding apparatus 100 can binary-arithmetically decode information on the transform coefficients scanned in the changed block 730 based on a predetermined context model, and inverse-binarize the transform coefficients to obtain transform coefficients of the changed block 730. [ The video decoding apparatus 100 may obtain the transform coefficients of the current block 720 by changing the horizontal direction coordinate values and the vertical direction values of the transform coefficients of the changed block 730 to each other.
비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 변경된 블록(720)에서 변환 계수에 관한 정보를 스캔하여 스캔된 변환 계수에 관한 정보를 엔트로피 복호화함으로써, 항상 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 변환 계수에 관한 정보를 엔트로피 복호화할 수 있다. 따라서, 현재 블록의 너비가 높이보다 큰 경우에 대한 별도의 컨텍스트 모델을 이용하지 않고, 현재 블록의 높이가 너비보다 크거나 같은 블록에 관한 컨텍스트 모델만을 이용함으로써 엔트로피 복호화의 복잡도를 감소시킬 수 있다.When the width of the current block is greater than the height, the video decoding apparatus 100 swaps the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block, and changes the transform coefficient in the changed block 720 The information on the transform coefficient related to the block in which the height of the current block is always greater than or equal to the width can be entropy-decoded. Therefore, it is possible to reduce the complexity of entropy decoding by using only the context model for a block whose height is greater than or equal to the width of the current block, without using a separate context model for the case where the width of the current block is greater than the height.
이상 비디오 복호화 장치(100)가 현재 블록의 너비 및 높이가 서로 다른 경우, 델타 플래그 정보를 획득하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 부호화 장치(150) 및 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 다른 경우, 델타 플래그 정보를 획득하지 않고, 비트스트림으로부터 스캔 영역(720)을 특정하기 위한 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.The video encoding apparatus 150 and the video decoding apparatus 100 have been described as acquiring the delta flag information when the current block has different widths and heights, It is possible to obtain information indicating the difference between the horizontal direction coordinate value and the vertical direction coordinate value for specifying the scan area 720 from the bit stream without obtaining delta flag information when the width and height of the block are different from each other Can be easily understood.
이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비 및 높이가 같은지 또는 다른지에 관계없이 델타 플래그 정보를 생성하지 않고, 수평 방향 좌표 값과 수직 방향 좌표 값의 차분을 나타내는 정보를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.Without being limited to this, the video decoding apparatus 100 may obtain the information indicating the difference between the horizontal direction coordinate value and the vertical direction coordinate value, without generating the delta flag information regardless of whether the width and the height of the current block are the same or different It will be readily understood by those skilled in the art.
이상 비디오 부호화 장치(150)가 변경 플래그를 생성하고, 비디오 복호화 장치(150)가 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경하는 동작을 활성화함을 나타내는 플래그에 기초하여 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할지를 결정하는 내용을 설명하였으나, 이에 제한되지 않고, 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우, 항상 수평 방향 좌표 및 수직 방향 좌표를 서로 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.Based on a flag indicating that the anomaly video encoding device 150 generates a change flag and the video decrypting device 150 activates an operation of changing the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixel included in the current block The video decoding apparatus 100 determines whether to change the horizontal direction coordinate and the vertical direction coordinate of the transform coefficient pixels included in the current block to each other. However, the present invention is not limited to this, and if the width of the current block is greater than the height, Those skilled in the art can easily understand that the horizontal direction coordinate and the vertical direction coordinate can be mutually changed.
이상, 비디오 복호화 장치(100)가 현재 블록의 너비가 높이보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 좌표 및 수직 방향 좌표를 서로 변경(swap)하고, 그렇지 않은 경우 변경하지 않는 내용을 설명하였으나, 이에 제한되지 않고, 반대로 현재 블록의 높이가 너비보다 큰 경우, 현재 블록에 포함된 변환 계수 픽셀의 수평 방향 및 수직 방향 좌표를 변경할 수 있음을 당업자는 용이하게 이해할 수 있다.If the video decoding apparatus 100 swaps the horizontal direction coordinate and the vertical direction coordinate of the conversion coefficient pixel included in the current block, if the width of the current block is larger than the height, Those skilled in the art can easily understand that the horizontal direction and the vertical direction coordinates of the transform coefficient pixels included in the current block can be changed when the height of the current block is larger than the width.
이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하지 않고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 스캔 영역 내 변환 계수들의 수평 방향 및 수직 방향 좌표를 서로 변경하여 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다.The video decoding apparatus 100 changes the horizontal direction coordinate and the vertical direction coordinate of the current block and changes the horizontal direction coordinate and the vertical direction coordinate of the scan region to scan the information about the transform coefficient, But the present invention is not limited to this. However, the present invention is not limited to this, and the present invention is not limited to this, The transformation coefficients in the scan area are obtained by performing scan and entropy decoding of information on the intra-scan transform coefficients by changing only the horizontal direction coordinate and the vertical direction coordinate of the scan area without changing the coordinate and the vertical direction coordinate, The horizontal direction and the vertical direction coordinates of the transformation coefficients in the scan area are mutually changed, Those skilled in the art can easily understand that the transform coefficients can be obtained.
이상, 비디오 복호화 장치(100)가 현재 블록의 수평 방향 좌표 및 수직 방향 좌표를 변경하고, 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표를 변경하여 변환 계수에 대한 정보를 스캔하고, 스캔된 변환 계수에 대한 정보에 대하여 엔트로피 복호화를 수행하여 현재 블록 내 변환 계수를 획득하고, 획득된 변환 계수의 수평 방향 좌표 및 수직 방향 좌표를 변경하는 내용에 대해서 설명하였으나, 이에 제한되지 않고, 변환 계수들의 수평 방향 및 수직 방향 좌표의 변경없이 스캔 영역의 수평 방향 좌표 및 수직 방향의 좌표만을 서로 변경하여 복호화하고, 스캔 영역 내 변환 계수에 대한 정보를 스캔 및 엔트로피 복호화를 수행하여 스캔 영역 내 변환 계수를 획득하고, 현재 블록 내 변환 계수를 획득할 수 있음을 당업자는 용이하게 이해할 수 있다. The video decoding apparatus 100 changes the horizontal direction coordinate and the vertical direction coordinate of the current block and changes the horizontal direction coordinate and the vertical direction coordinate of the scan region to scan the information about the transform coefficient, But the present invention is not limited to this. However, the present invention is not limited to this, and the present invention is not limited to this. For example, the horizontal direction of the transform coefficients And transforming only the horizontal coordinate and the vertical coordinate of the scan area without changing the vertical coordinate, decodes the information, scans and entropy decodes information on the intra-scan conversion coefficient to obtain the intra-scan conversion coefficient, It is easily understood by those skilled in the art that the current in-block transform coefficients can be obtained.
즉, 비디오 부호화 장치(150)는 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 스캔 영역의 수평 방향 및 수직 방향 좌표를 서로 변경하고, 이를 나타내는 정보를 전송할 수 있다. 이때, 일반적으로는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 너비가 높이보다 큼으로, 스캔영역을 특정하는 수평방향의 좌표는 수직방향의 좌표보다 크게 되고, 서로 좌표 값을 변경하게 되면, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 작게 된다. 따라서, 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 전송함으로써 비트수를 줄일 수 있게 된다. 하지만, 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역의 높이가 너비보다 크다면, 비디오 부호화 장치(150)는 변경된 수평방향의 좌표 값 정보 및 변경된 수평방향의 좌표 값 및 변경된 수직방향의 좌표 값정보를 그대로 전송할 수 있다. 즉, 차분 정보가 전송되지 않을 수 있다. 이 경우, 변경된 수평방향의 좌표 값이 변경된 수직 방향의 좌표 값보다 크기 때문이다. That is, when the width of the current block is greater than the height, the video encoding apparatus 150 may change the horizontal and vertical coordinates of the scan area of the current block and transmit information indicating the same. In this case, generally, when the width of the current block is greater than the height, the width of the scan area is greater than the height, and the coordinates in the horizontal direction specifying the scan area are larger than the coordinates in the vertical direction. , The changed coordinate value in the horizontal direction becomes smaller than the changed vertical coordinate value. Therefore, it is possible to reduce the number of bits by transmitting the information about the changed coordinate values in the horizontal direction and the difference information about the changed coordinate values in the horizontal direction and the changed coordinate values in the vertical direction. However, if the width of the current block is greater than the height and the height of the scan area is larger than the width, the video encoding apparatus 150 displays the changed coordinate value information in the horizontal direction, the changed coordinate value in the horizontal direction, Information can be transmitted as it is. That is, difference information may not be transmitted. In this case, the changed horizontal coordinate value is larger than the changed vertical coordinate value.
비디오 부호화 장치(150)는 차분 정보를 전송하는지 여부를 나타내는 플래그를 함께 전송할 수 있다. 비디오 복호화 장치(100)는 현재 블록의 너비가 높이보다 큰 경우에 스캔 영역을 특정하는 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경한다고 결정할 수 있고, 비트스트림으로부터 플래그를 획득하고 플래그의 값이 1(차분 정보를 전송함을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수평방향의 좌표 값과 변경된 수직방향의 좌표 값에 관한 차분 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다.The video encoding apparatus 150 may transmit a flag indicating whether or not to transmit the difference information together. The video decoding apparatus 100 may decide to change the horizontal direction coordinate value and the vertical direction coordinate value specifying the scan area to each other when the width of the current block is larger than the height, 1 (indicating that the difference information is transmitted), information on the changed coordinate value in the horizontal direction and difference information on the changed coordinate value in the horizontal direction and the coordinate value in the changed vertical direction are obtained, and the changed scanning area is specified Can be obtained.
플래그의 값이 0(차분 정보를 전송하지 않음을 나타냄)이라면 변경된 수평방향의 좌표 값에 관한 정보 및 변경된 수직방향의 좌표 값에 관한 정보를 획득하고, 이를 기초로 변경된 스캔 영역을 특정하는 좌표 값을 획득할 수 있다. If the value of the flag is 0 (indicating that differential information is not transmitted), information on the changed coordinate values in the horizontal direction and information on the changed coordinate values in the vertical direction are obtained, and coordinate values Can be obtained.
비디오 복호화 장치(100)는 획득된 수평방향 좌표 값 및 수직 방향 좌표 값을 서로 변경하여 최종 스캔 영역을 특정하고, 스캔 영역 내 변환 계수에 관한 정보를 스캔할 수 있다.The video decoding apparatus 100 can identify the final scan region by changing the obtained horizontal direction coordinate value and the vertical direction coordinate value, and scan the information about the intra-scan conversion coefficient.
다만 현재 블록의 너비가 높이보다 큰 경우에 제한되지 않고, 현재 블록의 높이가 너비보다 큰 경우에도 유사한 동작이 수행될 수 있음을 당업자는 용이하게 이해할 수 있다.However, the present invention is not limited to the case where the width of the current block is larger than the height, and a person skilled in the art can easily understand that a similar operation can be performed even when the height of the current block is larger than the width.
도 8은 일 실시예에 따라 현재 블록의 크기 및 현재 블록의 모양(shape) 중 적어도 하나에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 대한 컨텍스트 모델을 결정하는 과정을 설명하기 위한 도면이다.8 is a diagram for explaining 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 the first block 805, the second block 810, and the third block 815. The first block may be a rectangular block whose height is greater than the width, the second block may be a rectangular block whose width is greater than the height, and the third block 815 may be a square block Lt; / RTI >
비디오 복호화 장치(100)는 수학식 19에 따라 결정된 size_tu0에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 관한 컨텍스트 모델을 결정할 수 있다. The video decoding apparatus 100 can determine the context model related to the syntax element information of the current intra-block transform coefficients based on the size_tu0 determined according to the equation (19).
Figure PCTKR2018003830-appb-M000018
Figure PCTKR2018003830-appb-M000018
여기서, 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 log2 as the width of the current block, and log2_height may be a value obtained by taking log2 as the height and height of the current block. Referring to FIG. 8, if the current block is the first block 805, size_tu may be (log 2 a + log 2 b) / 2 (where a and b are positive integers). If the current block is the second block (810), size_tu may be a (log- log 2 c + 2 d) / 2 (c, d is a positive integer). If 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 relating to the size of the current block, which is an element that determines the context model, based on the minimum of the width of the current block and the height of the current block. For example, the video decoding apparatus can determine a value size_tu1 related to the size of the current block, which is an element that determines the context model, based on the following expression (20).
Figure PCTKR2018003830-appb-M000019
Figure PCTKR2018003830-appb-M000019
여기서, 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 the minimum value among the input values. Referring to FIG. 8, if the current block is the first block 805, size_tu may be log 2 a (where a is a positive integer). If the current block is the second block (810), size_tu may be a log- 2 d (d is a positive integer). If 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 can determine the context model related to the syntax element information of the current intra-block transform coefficient based on the size_tu1 determined according to the equation (20).
또는, 비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값을 현재 블록의 너비 및 현재 블록의 높이 중 최대값에 기초하여 결정할 수 있다. 예를 들어, 비디오 복호화 장치는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값 size_tu2를 하기 수학식 21에 기초하여 결정할 수 있다.Alternatively, the video decoding apparatus 100 may determine a value relating to the size of the current block, which is an element determining the context model, based on the maximum value of the width of the current block and the height of the current block. For example, the video decoding apparatus can determine a value size_tu2 related to the size of the current block, which is an element for determining the context model, based on the following expression (21).
Figure PCTKR2018003830-appb-M000020
Figure PCTKR2018003830-appb-M000020
여기서, Max() 함수는 함수 입력값들 중 최대값을 출력으로 하는 함수일 수 있다.Here, the Max () function may be a function that outputs the maximum value among the function input values.
비디오 복호화 장치(100)는 [수학식 21]에 따라 결정된 size_tu2에 기초하여 현재 블록 내 변환 계수의 신택스 엘리먼트 정보에 관한 컨텍스트 모델을 결정할 수 있다.The video decoding apparatus 100 can determine the context model related to the syntax element information of the current intra-block transform coefficient based on the size_tu2 determined according to (Expression 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 three.
변환 계수가 현재 블록의 높이 및 너비 중 더 넓은 쪽에 분포되어 있는 경향이 있음에도 비디오 복호화 장치(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 the size_tu0 even though the conversion coefficient tends to be distributed on the wider side of the height and width of the current block . 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 thus, based on size_tu0 The efficiency of binary arithmetic decoding can be improved as compared to when determining the context model.
비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 크기에 관한 값을 현재 블록의 모양에 기초하여 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 컨텍스트 모델을 결정하는 요소인 현재 블록의 모양에 관한 값 shape_tu를 하기 수학식 22에 기초하여 결정할 수 있다.The video decoding apparatus 100 can determine a value relating to the size of the current block which is an element for determining the context model based on the shape of the current block. For example, the video decoding apparatus 100 can determine a value shape_tu related to the shape of the current block, which is an element that determines the context model, based on the following equation (22).
Figure PCTKR2018003830-appb-M000021
Figure PCTKR2018003830-appb-M000021
예를 들어, 현재 블록이 제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 if the current block is the second block 810, shape_tu may be 2. [ If the current block is the third block 815, shape_tu may be zero. That is, if the current block has a rectangular shape whose width is greater than the height of the current block, size_tu may be 2. If the current block has a rectangular shape whose height is larger than the width of the current block, If the current block has a square shape with the same width and height as the current block, size_tu may be zero.
[수힉식 22]에서는, 현재 블록의 높이 height 및 현재 블록의 너비 width를 이용하였으나, 이에 제한되지 않고, [수힉식 21]과 같이 log2_width 및 log2_height에 기초하여 결정될 수 있음을 당업자는 용이하게 이해할 수 있다. 또한, [수학식 22]에서는 shape_tu는 0 내지 2 중 하나의 값으로 결정되었으나, 이에 제한되지 않고 다른 값이 할당될 수 있고, 각 값들이 나타내는 현재 블록의 모양도 달라질 수 있음을 당업자는 용이하게 이해할 수 있다.It is easily understood by those skilled in the art that the height of the current block and the width of the width of the current block are used in the present embodiment, but not limited thereto, and can be determined based on log2_width and log2_height as in [Equation 21] have. It is to be noted that shape_tu is determined to be one of 0 to 2 in Equation (22), but it is not limited thereto and other values can be assigned, and the shape of the current block represented by each value can be easily 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, the size_tu for the first block 805 may be 3 and the size_tu for the third block 815 may be equal to 3.
변환 계수가 현재 블록의 높이 및 너비 중 더 넓은 쪽에 분포되어 있는 경향이 있음에도 비디오 복호화 장치(100)가 size_tu0를 기초로 제1 블록 및 제3 블록에 대하여 동일한 컨텍스트 모델을 결정할 수 있다. 하지만 만약 비디오 복호화 장치(100)가 shape_tu를 기초로 제1 블록(805)및 제3 블록(815)에 대한 컨텍스트 모델을 결정하면, 그 컨텍스트 모델들이 서로 다를 수 있고, 따라서 size_tu0를 기초로 컨텍스트 모델을 결정할 때보다 이진 산술 복호화의 효율이 향상 될 수 있다.The video decoding apparatus 100 can determine the same context model for the first block and the third block based on the size_tu0 even though the conversion coefficient tends to be distributed to a wider one of the height and the width of the current block. However, if the video decoding apparatus 100 determines the context models for the first block 805 and the third block 815 based on the shape_tu, the context models may be different from each other, and accordingly, the context model The efficiency of binary arithmetic decoding can be improved.
한편, 비디오 복호화 장치(100)는 현재 블록의 높이 및 너비의 최소값 size_tu1 및 최대값 size_tu2 에 기초하여 산출된 현재 블록의 최소값과 최대값 간 비율에 기초하여 변환 계수에 관한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 비디오 복호화 장치(100)는 최소값과 최대값 간 비율이 소정의 값 범위 내인 경우 해당 범위에 대응하는 컨텍스트 인덱스를 결정하고, 결정된 컨텍스트 인덱스에 기초하여 변환 계수에 관한 컨텍스트 모델을 결정할 수 있다. 예를 들어, 현재 블록의 높이가 너비보다 큰 경우, 최소값(너비)과 최대값(높이) 간 비율의 값이 1과 2 사이의 범위인 경우 이에 대응하는 컨텍스트 인덱스를 결정하고, 최소값과 최대값 간 비율의 값이 2이상의 범위인 경우 이에 대응하는 컨텍스트 인덱스를 결정할 수 있다.On the other hand, the video decoding apparatus 100 can determine the context model related to the transform coefficient based on the 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 range and determine a context model related to the transformation coefficient based on the determined context index have. For example, if the height of the current block is greater than the width, if 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, If the value of the ratio is in the range of 2 or more, the corresponding context index can be determined.
한편, 비디오 복호화 장치(100)는 현재 블록의 모양 및 크기에 기초하여 변환 계수에 대한 컨텍스트 모델을 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 현재 블록의 크기 및 현재 블록의 모양에 기초하여 변환 계수에 대한 컨텍스트 모델을 결정할 수 있다. On the other hand, the video decoding apparatus 100 can determine the context model for the transform coefficients based on the shape and size of the current block. That is, the video decoding apparatus 100 can determine the context model for the transform coefficients 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 values size_tu1 and size_tu2 related to the size of a current block and a value shape_tu related to the shape of the current block and outputs the context model corresponding to the determined context index Can be determined.
도 9a 내지 9c는 일 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.9A to 9C are diagrams for explaining a residual coding syntax structure according to an embodiment.
도 9a 내지 9c를 참조하면, 비디오 복호화 장치(100)는 변환 계수를 복원하기 위해 변환 계수에 관한 신택스 엘리먼트 정보를 스캔하고, 스캔된 신택스 엘리먼트 정보를 기초로 변환 계수를 복호화할 수 있다.9A to 9C, the video decoding apparatus 100 may scan the syntax element information about the transform coefficients to recover the transform coefficients, and may decode the transform coefficients based on the scanned syntax element information.
먼저, 비디오 복호화 장치(100)는 사각형 스캔 영역을 특정하기 위한 좌표를 나타내는 신택스 엘리먼트 정보 scan_region_x 및 scan_region_y를 비트스트림으로부터 획득할 수 있다. 이때, 신택스 엘리먼트 정보 scan_region_x는 현재 블록의 좌상측 모서리 좌표를 기준으로 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 수평방향(x축 방향) 좌표의 값을 나타낼 수 있고, 신택스 엘리먼트 정보 scan_region_y는 현재 블록의 좌상측 모서리 좌표를 기준으로 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 수직방향(y축 방향) 좌표의 값을 나타낼 수 있다. 비디오 복호화 장치(100)는 신택스 엘리먼트 정보scan_region_x 및 scan_region_y에 기초하여 스캔 영역을 특정하기 위한 좌표srX 및 srY를 결정할 수 있다.First, the video decoding apparatus 100 may obtain syntax element information scan_region_x and scan_region_y indicating coordinates for specifying a quadrangular scan region from a bitstream. At this time, the syntax element information scan_region_x may indicate the value of the horizontal direction (x-axis direction) coordinate of the effective transformation coefficient located at the rightmost position in the current block with reference to the upper left corner coordinate of the current block, and the syntax element information scan_region_y indicates (Y-axis direction) coordinate of the effective transformation coefficient located at the lowermost position in the current block with reference to the upper left corner coordinate of the block. The video decoding apparatus 100 can determine the coordinates srX and srY for specifying the scan area 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 can determine the scan order (ScanOrder (srX + 1, srY + 1)) based on the coordinates srX and srY for specifying the scan region.
비디오 복호화 장치(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 to be scanned last in a forward scan order based on the coordinates srX and srY for specifying a scan region. That is, the video decoding apparatus 100 performs an operation (" 4 ") for bit-shifting the value of (srX + 1) * (srY + The index information (lastSet) of the coefficient group to be scanned can be determined. That is, the output value of the right shifting operation by 4 can be the same as the quotient determined by dividing by 16. That is, since the video decoding apparatus 100 determines one coefficient group for every 16 transform coefficients, if the total transform coefficient scanned in the scan region is divided by 16, the number of total coefficient groups (or the end of the forward scan order) A value obtained by adding 1 to an index value indicating a group of scanned coefficients) can be determined.
비디오 복호화 장치(100)는 스캔 영역을 특정하기 위한 좌표 srX 및 srY에 기초하여 정방향의 스캔 순서상 마지막 스캔되는 계수의 위치(lastScanPos)를 결정하고, 현재 변환 계수의 위치(Pos)를 정방향의 스캔 순서상 마지막 스캔되는 계수의 위치(lastScanPos)로 결정할 수 있다.The video decoding apparatus 100 determines the position (lastScanPos) of the last scanned coefficient in the forward scan order based on the coordinates srX and srY for specifying the scan region and sets the position Pos of the current transformation coefficient as the forward scan The position of the last scanned coefficient in the sequence (lastScanPos) can be determined.
비디오 복호화 장치(100)는 i를 lastset으로 초기화하고, i가 0보다 큰 경우 i를 1만큼 감소시키고, 반복문(for문)(905)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(905)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(905)에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to last set, reduce i by 1 if i is greater than 0, and perform the operations included in the loop statement (for statement) 905. [ The video decoding apparatus 100 may perform the operations included in the for-statement (for statement) 905 until the value becomes less than zero. In this case, i may be an index indicating a coefficient group. That is, the video decoding apparatus 100 may perform an operation on one coefficient group every time the operation included in the loop statement (for statement) 905 is performed.
비디오 복호화 장치(100)는 i에 16을 곱하는 동작(i<<4)을 수행하여setPos를 결정할 수 있다. setPos는 변환 그룹의 첫번째에 위치하는 변환 계수의 인덱스 정보를 나타낼 수 있다.The video decoding apparatus 100 can determine the setPos by performing an operation (i << 4) of multiplying i by 16. setPos can represent the index information of the transform coefficient located at the first position of the transform group.
비디오 복호화 장치(100)는 i가 마지막 계수 그룹인 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(910)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(910)에 포함된 동작(sig_flag 관련 동작)을 수행할 수 있다. 이때, n은 정방향의 스캔 순서에 따른 계수 그룹 내 변환 계수의 위치를 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 determines n as 15 (lastScanPos-setPos) obtained by subtracting setPos from lastScanPos when i is the last coefficient group (i == lastSet) If greater than or equal to, i can be reduced by one and the operations contained in the loop statement (for statement) 910 can be performed. The video decoding apparatus 100 can perform the operation (sig_flag related operation) included in the forbidden statement (for statement) 910 until the value becomes less than zero. In this case, n may be index information indicating the position of the transform coefficient in the coefficient group according to the forward scan order.
예를 들어, 스캔 영역에 포함된 총 변환 계수의 개수가 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 scanned coefficient group (i = last set) according to the forward scan is greater than zero Or equal to or less than 15, and the value thereof is determined as n, and a loop statement (for statement) 910 can 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 the position of the transform coefficients according to the forward scan order.
비디오 복호화 장치(100)는 현재 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(width)에 기초하여 현재 스캔되는 수평 방향(x축 방향)의 좌표의 값 sx를 결정할 수 있다. 또한, 비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치(blkpos) 및 스캔 영역의 너비(log2width)에 기초하여 수직 방향(y축 방향)의 좌표의 값 sy를 결정할 수 있다.The video decoding apparatus 100 can determine the value sx of the coordinate in the horizontal direction (x-axis direction) currently scanned based on the position (blkpos) of the current transform coefficient and the width of the scan area. In addition, the video decoding apparatus 100 can determine the value sy of the coordinate in the vertical direction (y-axis direction) based on the position (blkpos) of the transform coefficient to be decoded and the width (log2width) of 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), 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수에 대한 유효 변환 계수 플래그 sig_flag(sig_flag[blkpos])를 획득하지 않고, 현재 변환 계수에 대한 sig_flag의 값을 1로 결정할 수 있다. 여기서 is_last_x는 스캔 영역 내 가장 하측의 행에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다. is_last_y는 스캔 영역 내 가장 우측의 열에 포함된 변환 계수들 중 현재 변환 계수보다 이전에 스캔된 변환 계수 중 그 절대값이 0보다 큰 유효 변환 계수가 있었는지를 나타내는 값일 수 있다.The video decoding apparatus 100 determines whether sx is 0, sy is srY, is_last_y is 0 (sx == 0 && sy == srY && is_last_y == 0), sy is 0, sx is srX, is_last_x 0), the video decoding apparatus 100 does not acquire the effective conversion coefficient flag sig_flag (sig_flag [blkpos]) for the current conversion coefficient from the bitstream, but does not acquire the current conversion coefficient flag sig_flag (sig_flag [blkpos] The value of sig_flag for the conversion coefficient can be determined as 1. [ Here, is_last_x may be a value indicating whether there is an effective transform coefficient whose absolute value is greater than 0 among the transform coefficients scanned before the current transform coefficient among the 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 the transform coefficients included in the rightmost column in the scan area and scanned before the current transform coefficient.
비디오 복호화 장치(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]를 획득할 수 있다.The video decoding apparatus 100 determines whether sy is 0, sy is srY, is_last_y is 0 (sx == 0 && sy == srY && is_last_y == 0), sy is 0, sx is srX, is_last_x is 0 (Sy == 0 && sx == srX && is_last_x == 0), the effective transform coefficient flag sig_flag [blkpos] for the transform coefficient to be decoded from the bit stream can be obtained.
비디오 복호화 장치(100)는 현재 변환 계수의 유효 변환 계수 플래그 sig_flag가 1인 경우에 현재 변환 계수의 x축 방향의 좌표 값 sx이 srX와 같다면(sx==srX), is_last_x를 1로 설정하고, 현재 변환 계수의 y축 방향의 좌표 값 sy이 srY와 같다면(sy==srY), is_last_y를 1로 설정할 수 있다.The video decoding apparatus 100 sets is_last_x to 1 if the coordinate value sx in the x-axis direction of the current transform coefficient is equal to srX (sx == srX) when the effective transform coefficient flag sig_flag of the current transform coefficient is 1 , And if the coordinate value sy in the y-axis direction of the current transformation coefficient is equal to srY (sy == srY), then is_last_y can be set to 1.
또한, 비디오 복호화 장치(100)는 lastSigScanPos가 -1인 경우(즉, 초기값인 경우), lastSigScanPos를 n으로 결정할 수 있다. 즉, 역방향의 스캔 순서 상 계수 그룹의 첫번째 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 n이 lastSigScanPos로 결정되기 때문에 lastSigScanPos는 정방향의 스캔 순서상 계수 그룹 내 마지막으로 유효변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다. 한편, 비디오 복호화 장치(100)는 firstSigScanPos를 n으로 결정할 수 있다. 현재 변환 계수의 유효 변환 계수 플래그 sig_flag가 1인 경우라면 firstSigScanPos의 값이 계속 현재 변환 계수의 위치를 나타내는 인덱스 정보인 n으로 갱신되기 때문에 최종적으로 특정 계수 그룹 i에 포함된 변환 계수들에 대하여 동작을 수행하게 되면, firstSigScanPos는 정방향의 스캔 순서상 계수 그룹 내 최초 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다.In addition, the video decoding apparatus 100 may determine lastSigScanPos to be n if lastSigScanPos is -1 (i.e., initial value). That is, since the index n indicating the position where the first effective transform coefficient of the coefficient group exists in the backward scan order is determined by lastSigScanPos, lastSigScanPos is an index indicating the position where the last valid transform coefficient exists in the forward scan order coefficient group Information. On the other hand, the video decoding apparatus 100 can determine firstSigScanPos as n. If the effective conversion coefficient flag sig_flag of the current conversion coefficient is 1, the value of firstSigScanPos is updated to n, which is the index information indicating the position of the current conversion coefficient, so that the operation is performed on the conversion coefficients included in the specific coefficient group i The firstSigScanPos may be index information indicating a position where the first effective transform coefficient in the forward scan order coefficient group exists.
비디오 복호화 장치(100)는 cnt_nz을 1만큼 증가시킨다. 즉, 현재 블록(또는 스캔 영역) 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cnt_nz이 현재 변환 계수가 유효 변환 계수일때마다 갱신되게 된다. 또한, 비디오 복호화 장치(100)는 현재 계수 그룹 i 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cg_nz[i]가 1만큼 증가시킨다. 즉, 현재 계수 그룹 i 내 0이 아닌 값을 갖는 계수의 개수를 나타내는 cg_nz[i]가 현재 변환 계수가 유효 변환 계수일때마다 갱신되게 된다.The video decoding apparatus 100 increases cnt_nz by one. That is, cnt_nz indicating the number of coefficients having a non-zero value in the current block (or scan area) is updated each time the current transform coefficient is an effective transform coefficient. In addition, the video decoding apparatus 100 increases cg_nz [i], which indicates the number of coefficients having non-zero values in the current coefficient group i, by one. That is, cg_nz [i] indicating the number of coefficients having a non-zero value in the current coefficient group i is updated every time 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 관련 동작)을 수행할 수 있다.  The video decoding apparatus 100 determines n as 15 (lastScanPos-setPos) obtained by subtracting setPos from lastScanPos when i is the last coefficient group (i == lastSet) If it is greater than or equal to i, i can be reduced by 1 and the operations included in the loop statement (for statement) 915 can be performed. The video decoding apparatus 100 may perform the operations (coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag related operations) included in the forbidden statement (for statement) 915 until the value becomes less than zero.
비디오 복호화 장치(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 can obtain the absolute value abs_coef for the current transform coefficient based on the current transform coefficient information gt0 flag, gt1 flag, gt2 flag, 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 conversion coefficient flag (sig_flag [blkpos]) of the current conversion coefficient is 1, the video decoding apparatus 100 determines that the absolute value of the conversion coefficient among the conversion coefficients included in the previously scanned coefficient groups is a conversion The number of coefficients cnt_g1 and the number c1 of transform coefficients obtained from the bitstream of previously scanned transform coefficients obtained from coeff_abs_level_greater1_flag obtained from coeff_abs_level_greater_flag from the bit stream among the transform coefficients having an absolute value larger than 1 The video decoding apparatus 100 can obtain coeff_abs_level_greater1_flag [blkpos] for the current transform coefficient from the bitstream when the maximum number of transform coefficients is smaller than num_gt1. coeff_abs_level_greater1_flag may be a flag indicating whether the absolute value of the current transform coefficient is greater than one. The video decoding apparatus 100 can determine the flag gt1_flag (gt1flag [blkpos]) of the current transform coefficient based on coeff_abs_level_greater1_flag obtained from the bitstream.
비디오 복호화 장치(100)는 현재 변환 계수의 플래그 gt1_flag의 값이 1인 경우, c1를 1만큼 증가시킬 수 있다. 현재 변환 계수의 플래그 gt1_flag가 1인 경우라면 c1의 값이 1만큼 증가하여 c1의 값이 갱신되기 때문에 그 다음 변환 계수들에 대하여 반복문(for문)() 동작을 수행할때, c1은 현재 계수 그룹 내 이전에 스캔된 변환 계수들 중 비트스트림으로부터 coeff_abs_level_greater1_flag를 획득한 변환 계수의 개수를 나타낼 수 있다.The video decoding apparatus 100 can increase c1 by 1 when the value of the flag gt1_flag of the current transform coefficient is 1. If the flag gt1_flag of the current transform coefficient is 1, the value of c1 is increased by 1 and the value of c1 is updated. Therefore, when performing the loop operation (for statement) () on the next transform coefficients, The number of transform coefficients obtained by obtaining coeff_abs_level_greater1_flag from the bitstream among the previously scanned transform coefficients 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 conversion coefficient flag (sig_flag [blkpos]) of the current conversion coefficient is 1, the video decoding apparatus 100 determines that the absolute value of the conversion coefficient among the conversion coefficients in the previously scanned coefficient groups is greater than 2 The number cnt_g2 of the coefficients and the number c2 of transform coefficients obtained from the previously scanned bit stream in coeff_abs_level_greater2_flag is smaller than the sum of the coefficients cnt_g2 and cnt2 of the transform coefficients that can obtain coeff_abs_level_greater_flag from the bit stream among the transform coefficients having an absolute value of the coefficient greater than 2 If it is smaller than the maximum number num_gt2, the video decoding apparatus 100 can 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 two. The video decoding apparatus 100 can 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를 획득한 변환 계수의 개수를 나타낼 수 있다.The video decoding apparatus 100 can increase the number c2 of the current gt2 flags by 1 when the value of the flag gt2_flag of the current conversion coefficient is 1. When the flag gt2_flag of the current transform coefficient is 1, the value of c2 is increased by 1 and the value of c2 is updated. Therefore, when performing the loop operation (for statement) () on the next transform coefficients, The number of transform coefficients obtained by obtaining coeff_abs_level_greater1_flag from the bitstream among the previously scanned transform coefficients in the group.
또한, 비디오 복호화 장치(100)는 escapeDataPresent를 1로 결정할 수 있다. escapeDataPresent는 현재 변환 그룹 내 변환 계수의 값을 결정하기 위해 추가로 획득해야 하는 정보(예를 들어, 잔여 레벨 절대값 정보 coeff_abs_level_remaining)가 있음을 나타내는 정보일 수 있다.In addition, the video decoding apparatus 100 may determine that escapeDataPresent is set to 1. The escapeDataPresent may be information indicating that there is additional information (e.g., 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 conversion coefficient flag (sig_flag [blkpos]) of the current conversion coefficient is 1, the video decoding apparatus 100 determines that the absolute value of the conversion coefficient among the conversion coefficients in the previously scanned coefficient groups is greater than 2 The number cnt_g2 of the coefficients and the number c2 of transform coefficients obtained from the previously scanned bit stream in coeff_abs_level_greater2_flag is smaller than the sum of the coefficients cnt_g2 and cnt2 of the transform coefficients that can obtain coeff_abs_level_greater_flag from the bit stream among the transform coefficients having an absolute value of the coefficient greater than 2 If it is not smaller than the maximum number num_gt2, the video decoding apparatus 100 can determine the escapeDataPresent to be 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 decodes the number of transform coefficients cnt_g1 having an absolute value of the transform coefficient among the transform coefficients included in the previously scanned coefficient groups greater than 1, When the sum of the number of transform coefficients c1 obtained from coeff_abs_level_greater1_flag is not smaller than num_gt1 which is the maximum number of transform coefficients capable of obtaining coeff_abs_level_greater_flag from the bit stream among the transform coefficients having an absolute value larger than 1, 100) can determine escapeDataPresent to be 1.
비디오 복호화 장치(100)는 escapeDataPresent가 1인 경우, i가 마지막 계수 그룹을 나타내는 경우(i==lastSet), n을 lastScanPos에서 setPos를 뺀 값(lastScanPos-setPos)으로 결정하고, 아닌 경우 n을 15로 결정하고, n이 0보다 크거나 같은 경우 i를 1만큼 감소시키고, 반복문(for문)(920)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(920)에 포함된 동작(coeff_abs_level_reamining 관련 동작)을 수행할 수 있다. The video decoding apparatus 100 determines n as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos) when i is the last coefficient group when escapeDataPresent is 1, and n is 15 And if n is greater than or equal to 0, i may be decreased by 1 and the operations contained in the loop statement (for statement) 920 may be performed. The video decoding apparatus 100 may perform an operation (an operation related to coeff_abs_level_reamining) included in the forbidden statement (for statement) 920 until the value becomes less than zero.
비디오 복호화 장치(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로 결정할 수 있다.The video decoding apparatus 100 can determine the base level when the absolute value of the current transform coefficient is larger than 1 (sig_flag [blkpos]). Current transform coefficient in current coefficient group number of transform coefficients having an absolute value larger than 1 among transform coefficients scanned before cnt_gt1 coeff_abs_level_greater_flag can be obtained from a bit stream among transform coefficients having an absolute value larger than 2 Cnt_gt2 where the absolute value of the transform coefficients of the transform coefficients scanned prior to the current transform coefficient in the current coefficient group is greater than 2, when the absolute value of the transform coefficient is smaller than 2 The video decoding apparatus 100 can determine the base level to be 3 when the bit rate is smaller than the maximum number num_gt2 of conversion coefficients capable of obtaining coeff_abs_level_greater_flag from the bitstream. If cnt_gt1 is smaller than num_gt1 that can be obtained from the bitstream, the video decoding apparatus 100 can determine the base level to be 2 if cnt_gt2 is smaller than num_gt2. If cnt_gt1 is not smaller than num_gt1, the video decoding apparatus 100 can determine the base level to be 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 can determine the absolute value level abs_coef of the current transform coefficient by adding 1 to the value obtained by adding the value of gt1flag and the value of gt2flag to the current transform coefficient. The video decoding apparatus 100 can obtain the residual absolute value level coeff_abs_level_remaining for the current transform coefficient from the bitstream if 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 determine the absolute value level abs_coef for the current transform coefficient by adding the residual absolute value level level_remaining to the current transform coefficient to abs_coef.
비디오 복호화 장치(100)는 현재 변환 계수에 대한 절대값 레벨 abs_coef가 2보다 크다면, cnt_gt2를 1만큼 증가시킬 수 있다. 또한, 비디오 복호화 장치(100)는 현재 변환 계수에 대한 절대값 레벨 abs_coef가 1보다 크다면, cnt_gt1을 1만큼 증가시킬 수 있다.The video decoding apparatus 100 can increase cnt_gt2 by 1 if the absolute value level abs_coef for the current transform coefficient is greater than 2. 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 one.
만약 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 by subtracting setPos from lastScanPos (lastScanPos-setPos), otherwise n is determined to be 15, If it is greater than or equal to i, then i may be reduced by one and the operations contained in the loop statement (for statement) 925 may be performed. The video decoding apparatus 100 may perform the operation (abs_coef related operation) contained in the forbidden statement (for statement) 925 until the value becomes less than zero. The index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder array can be determined by adding n to the index information (setPos).
비디오 복호화 장치(100)는 현재 변환 계수에 대한 유효 변환 계수 플래그가 1인 경우, 현재 변환 계수에 대한 절대값인 abs_coef가 2보다 크거나 같다면, cnt_gt2를 1만큼 증가 시킬 수 있다. 현재 변환 계수에 대한 유효 변환 계수 플래그가 1인 경우, 현재 변환 계수에 대한 절대값인 abs_coef가 1보다 크거나 같다면, cnt_gt1를 1만큼 증가 시킬 수 있다.The video decoding apparatus 100 can increase the cnt_gt2 by 1 if the effective conversion coefficient flag for the current conversion coefficient is 1 and abs_coef, which is an absolute value for the current conversion coefficient, is greater than or equal to 2. When the effective conversion coefficient flag for the current conversion coefficient is 1, if the absolute value abs_coef for the current conversion coefficient is greater than or equal to 1, cnt_gt1 can be increased by one.
비디오 복호화 장치(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 lastSigScanPos of the last effective transform coefficient in the current coefficient group i scanned in the forward scan order and the position firstSigScanPos of the first effective transform coefficient is greater than 3, the video decoding apparatus 100 determines that at least one The signHidden value (signHidden [i]) indicating that the sign of the sign is hidden is set to 1. If the difference between the position lastSigScanPos of the last effective transform coefficient in the current coefficient group scanned in the forward scan order and the position firstSigScanPos of the first effective transform coefficient is not greater than 3, the video decoding apparatus 100 determines that at least one The signHidden value (signHidden [i]) indicating that the sign of the signHidden is hidden can be determined as 0.
비디오 복호화 장치(100)는 i를 0으로 초기화하고, i가 lateSet보다 작거나 같은 경우 i를 1만큼 증가시키고, 반복문(for문)(930)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 i가 lateSet보다 큰 값이 될때까지 반목문(for문)(930)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(930)에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to 0 and increment i by 1 if i is less than or equal to lateSet and perform the operations contained in the loop statement (for statement) 930. [ The video decoding apparatus 100 can perform the operations included in the forbidden statement (for statement) 930 until i becomes larger 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 every time the operation included in the loop statement (for statement) 930 is performed.
만약 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)에 포함된 동작을 수행할 수 있다.The video decoding apparatus 100 determines n as 15 (lastScanPos-setPos) obtained by subtracting setPos from lastScanPos when i is the last coefficient group (i == lastSet) If it is greater than or equal to i, then i can be decreased by 1 and the operation contained in the loop statement (for statement) 935 can be performed. The video decoding apparatus 100 may perform the operations included in the forbidden statement (for statement) 935 until the value is less than zero.
비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치(blkpos)를 정방향의 스캔 순서에 따른 ScanOrder 배열에서 현재 계수 그룹의 첫번째 계수의 위치를 나타내는 인덱스 정보 setPos에 현재 n을 더한 값으로 결정할 수 있다.The video decoding apparatus 100 may determine the position (blkpos) of the currently decoded 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 according to the forward scan order .
비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치 blkpos가 rsp_pos가 아닌 경우, 변환 계수의 부호가 숨겨진 변환 계수의 위치 hidden_pos이라면, 현재 복호화되는 변환 계수의 부호에 관한 정보(sign[blkpos])를 숨겨진 변환 계수의 부호에 관한 정보 hidden_sign으로 결정할 수 있다.If the position blkpos of the transform coefficient to be currently decoded is not rsp_pos, the video decoding apparatus 100 outputs information (sign [blkpos]) about the sign of the transform coefficient to be currently decoded if the sign of the transform coefficient is the position hidden_pos of the hidden transform coefficient, Can be determined by information hidden_sign on the sign of the hidden transform coefficient.
만약 변환 계수의 부호가 숨겨진 변환 계수의 위치 hidden_pos가 아닌 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 복호화되는 변환 계수의 부호에 관한 정보(sign[blkpos])를 획득할 수 있다.If the sign of the transform coefficient is not the position hidden_pos of the hidden transform coefficient, the video decoding apparatus 100 can obtain the information (sign [blkpos]) about the sign of the transform coefficient currently being decoded from the bit stream.
비디오 복호화 장치(100)는 현재 복호화되는 변환 계수의 위치 blkpos가 rsp_pos인 경우, 비트스트림으로부터 현재 복호화되는 변환 계수의 rsp 부호에 관한 정보(sign_rsp[blkpos])를 획득할 수 있다.The video decoding apparatus 100 can obtain the information (sign_rsp [blkpos]) regarding the rsp code of the transform coefficient currently being decoded from the bitstream if the position blkpos of the transform coefficient to be currently decoded is rsp_pos.
만약 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 to be a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos) if i is the last coefficient group (i == lastSet) And if n is greater than or equal to zero, i may be decremented by one and the operations contained in the loop statement (for statement) 940 may be performed. The video decoding apparatus 100 may perform the operation included in the forbidden statement (for statement) 940 until the value is less than zero.
비디오 복호화 장치(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 according to the forward scan order.
만약 현재 변환 계수의 유효 변환 계수 플래그의 값이 1이고, 부호 데이터를 숨기는 것을 활성화하는지를 나타내는 플래그 sign_data_hiding_enabled_flag)의 값이 0이거나, 현재 그룹에 대하여 숨겨진 부호가 없거나(!signHidden[i]), 정방향의 스캔 순서상 현재 계수 그룹 내 현재 변환 계수의 위치가 첫번째 유효 변환 계수의 위치 firstSigScanPos가 아닌 경우, 비트스트림으로부터 현재 변환 계수의 부호에 관한 정보(sign[blkpos])를 획득할 수 있다.If the value of the flag sign_data_hiding_enabled_flag indicating whether the value of the effective conversion coefficient flag of the current conversion coefficient is 1 and activating the hiding of the sign data is 0 or if there is no code hidden for the current group (! SignHidden [i]), Information (sign [blkpos]) concerning the sign of the current transform coefficient can be obtained from the bit stream when the position of the current transform coefficient in the current scan group is not the position of the first effective transform coefficient in the scan order.
도 9d 내지 도 9f는 다른 실시예에 따른 레지듀얼 부호화 신택스 구조를 설명하기 위한 도면이다.9D to 9F are diagrams for explaining a residual coding syntax structure according to another embodiment.
도 9b 내지 도 9f를 참조하면, 비디오 복호화 장치(100)는 변환 계수를 복원하기 위해 변환 계수에 관한 신택스 엘리먼트 정보를 스캔하고, 스캔된 신택스 엘리먼트 정보를 기초로 변환 계수를 복호화할 수 있다.9B to 9F, the video decoding apparatus 100 may scan the syntax element information about the transform coefficients to recover the transform coefficients, and may decode the transform coefficients 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 can represent the value of the horizontal direction (x-axis direction) coordinate of the effective transformation coefficient located last 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 indicate the value of the vertical direction (y-axis direction) coordinate of the effective transformation coefficient positioned at the end in the current block according to the forward scan order based on the upper left corner coordinate of the current block. The video decoding apparatus 100 may determine the 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 the position lastScanPos of the effective transformation coefficient located last in the forward scan order in the subblock to 16. The video decoding apparatus 100 may initialize the lastSubBlock indicating the sub-block in which the last valid transform coefficient is located according to the forward scan order in the sub-block. At this time, the initialized value may indicate the last sub-block of the current block scanned according to the forward scan order. That is, the lastSubBlock may be initialized to a value indicating the last sub-block among the sub-blocks scanned in the forward scan order based on the height and width of the current block.
비디오 복호화 장치(100)는 현재 계수의 수평방향의 위치 xC가 LastSigcoeffX가 아니거나, 현재 계수의 수직방향의 위치 yC가 LastSigcoeffY가 아닌 경우 Do-while 루프문(950) 내 동작을 수행하고, xC가 LastSigcoeffX이고, 현재 계수의 수직방향의 위치 yC가 LastSigcoeffY인 경우, do-while 루프문(950) 내 동작을 더 이상 수행하지 않을 수 있다.The video decoding apparatus 100 performs an operation in the Do-while loop statement 950 when the position xC in the horizontal direction of the current coefficient is not LastSigcoeffX or the position yC in the vertical direction of the current coefficient is not LastSigcoeffY, If LastSigcoeffX and position yC in the vertical direction of the current coefficient is LastSigcoeffY, the operation in the do-while loop statement 950 may no longer be performed.
비디오 복호화 장치(100)는 lastScanPos가 0이라면, lastScanPos를 16으로결정하고, lastSubblock을 1만큼 감소시킬 수 있다. 즉, 역방향의 스캔 순서에 따라 하나의 서브 블록 내 스캔이 완료(lastScanPos이 0이 )되면, 역방향의 스캔 순서에 따라 다음 서브 블록을 스캔 하기 위해 lastScanPos를 16으로 초기화하고, 다음 서브 블록 스캔을 위해 lastSubblock을 1만큼 감소시킬 수 있다. 비디오 복호화 장치(100)는 lastScanPos를 1만큼 감소시키면서 역방향의 스캔 순서에 따라 현재 서브 블록 lastSubblock 내 변환 계수를 스캔할 수 있다.The video decoding apparatus 100 may determine the lastScanPos to be 16 and reduce the lastSubblock by 1 if lastScanPos is zero. That is, when the scan in one sub-block is completed (lastScanPos is 0) according to the reverse scan order, lastScanPos is initialized to 16 to scan the next sub-block according to the reverse scan order, the lastSubblock can be reduced by one. The video decoding apparatus 100 may scan the transform coefficients in the current subblock lastSubblock according to a reverse scan order while decrementing lastScanPos by one.
비디오 복호화 장치(100)는 현재 서브 블록의 수평방향 위치 xS 및 수직방향 위치 yS를 결정할 수 있다. 비디오 복호화 장치(100)는 현재 블록에 대하여 소정의 정방향 스캔 순서에 따라 결정되는 ScanOrder 배열에 기초하여 현재 서브 블록의 위치가 결정될 수 있다. 즉, 비디오 복호화 장치(100)는 현재 블록의 높이(log2height) 및 너비(log2width), 소정의 스캔 순서를 나타내는 스캔 인덱스 scanIdx 및 현재 서브 블록을 나타내는 값 lastSubBlock에 기초하여 현재 서브 블록의 위치가 결정될 수 있다. 이때, xS 및 yS는 실제 서브 블록의 위치가 아니라, 서브 블록들을 하나의 픽셀처럼 취급할 때의 서브 블록의 위치일 수 있다. 즉, 서브 블록의 너비 및 높이를 무시하고, 인접하는 서브 블록 간의 서브 블록 수평방향 및 수직방향 차이는 1일 수 있다.The video decoding apparatus 100 can determine the horizontal position xS and the vertical position yS of the current subblock. The video decoding apparatus 100 may determine the position of the current subblock based on the ScanOrder array determined according to a predetermined forward scan order with respect to the current block. That is, the video decoding apparatus 100 can determine the position of the current sub-block based on the height (log2height) and the width (log2width) of the current block, the scan index scanIdx indicating the predetermined scan order, and the value lastSubBlock indicating the current sub- have. Here, xS and yS may be positions of subblocks when treating subblocks as one pixel, rather than positions of actual subblocks. That is, the width and the height of the sub-block may be ignored, and the difference between the sub-block horizontal direction and the vertical direction between adjacent sub-blocks may be one.
또한, 비디오 복호화 장치(100)는 현재 서브 블록에 대하여 소정의 정방향 스캔 순서에 따라 결정되는 ScanOrder 배열에 기초하여 현재 변환 계수의 수평방향 위치 xC 및 수직방향 위치 yC가 결정될 수 있다. 즉, 비디오 복호화 장치(100)는 현재 서브 블록의 높이(log24=2) 및 너비(log24=2), 소정의 스캔 순서를 나타내는 스캔 인덱스 scanIdx, 현재 서브 블록의 위치(xS,yS) 및 현재 서브 블록 내 현재 변환 계수의 위치를 나타내는 값 lastScanPos에 기초하여 현재 변환 계수의 위치(xC,yC)가 결정될 수 있다.In addition, the video decoding apparatus 100 can determine the horizontal direction position xC and the vertical direction position yC of the current transform coefficient based on the ScanOrder array determined in accordance with a predetermined forward scan order for the current subblock. That is, the video decoding apparatus 100 determines the height (log 2 4 = 2) and the width (log 2 4 = 2) of the current subblock, the scan index scanIdx indicating a predetermined scan order, ) And a value lastScanPos indicating the position of the current transform coefficient in the current subblock, the position (xC, yC) of the current transform coefficient can be determined.
비디오 복호화 장치(100)는 현재 변환 계수의 수직방향의 위치 yC가 LastSigcoeffY인 경우에 do-while 루프문(950) 내 동작을 더 이상 수행하지 않게 되므로, do-while 루프문(950)을 통해 결정된 lastScanPos는 정방향의 스캔 순서에 따라 스캔되는 현재 블록 내 마지막 유효 변환 계수가 포함된 서브 블록 내 마지막 유효 변환 계수의 위치를 나타내는 인덱스 정보일 수 있고, lastSubBlock은 현재 블록 내 마지막 유효 변환 계수가 위치하는 서브 블록을 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 will no longer perform the operation in the do-while loop statement 950 when the vertical direction position yC of the current transform coefficient is LastSigcoeffY, lastScanPos may be index information indicating the position of the last valid transform coefficient in the subblock including the last valid transform coefficient in the current block scanned in the forward scan order, and lastSubBlock may be index information indicating the position of the last valid transform coefficient in the current block And may be index information indicating a block.
비디오 복호화 장치(100)는 i를 lastSubBlock으로초기화하고, i가 0보다 큰 경우 i를 1만큼 감소시키고, 반복문(for문)(960)에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 0보다 작은 값이 될때까지 반목문(for문)(960)에 포함된 동작을 수행할 수 있다. 이때, i는 계수 그룹을 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(960)에 포함된 동작을 한번 수행할 때마다 하나의 서브 블록에 대한 동작을 수행할 수 있다.The video decoding apparatus 100 may initialize i to lastSubBlock, reduce i by 1 if i is greater than 0, and perform the operations contained in the loop statement (for statement) 960. [ The video decoding apparatus 100 may perform the operation included in the forbidden statement (for statement) 960 until the value is less than zero. In this case, i may be an index indicating a coefficient group. That is, the video decoding apparatus 100 may perform an operation on one subblock each time the operation included in the loop statement (for statement) 960 is performed.
비디오 복호화 장치(100)는 현재 서브 블록의 수평방향 위치 xS및 수직방향 위치 yS를 결정할 수 있다. The video decoding apparatus 100 can determine the horizontal position xS and the vertical position yS of the current subblock.
비디오 복호화 장치(100)는 현재 서브 블록을 나타내는 i가 마지막 유효 변환 계수가 위치하는 서브 블록을 나타내는 값(lastSubBlock)보다 작은 값을 갖는 서브 블록을 가리키거나, DC 계수를 포함하는 서브 블록을 나타내는 값(0)보다 큰 값을 갖는 서브 블록을 가리키는 경우, 현재 서브 블록 i에 대한 coded_sub_block_flag[xS][yS]를 획득할 수 있다. coded_sub_block_flag[xS][yS]는 현재 서브 블록 i 내 적어도 하나의 유효 변환 계수를 포함하는지를 나타내는 플래그 정보일 수 있다.The video decoding apparatus 100 refers to a sub-block having a value smaller than a value (lastSubBlock) indicating a sub-block in which the current effective transform coefficient is located, indicating a current sub-block, or a sub-block including a DC coefficient Quot; coded_sub_block_flag [xS] [yS] for the current subblock i can be obtained when the subblock has a value larger than the value (0). coded_sub_block_flag [xS] [yS] may be flag information indicating whether the coded_sub_block_flag [xS] [yS] includes at least one valid conversion coefficient in the current subblock i.
비디오 복호화 장치(100)는 현재 서브 블록이 마지막 유효 변환 계수를 포함하는 서브 블록(lastSubBlock)인 경우, n을 lastScanPos-1로 초기화하고, 그렇지 않은 경우 15로 초기화하고, n이 0보다 크거나 같은 경우 n을 1만큼 감소시키고, 반복문(for문)()에 포함된 동작을 수행할 수 있다. 비디오 복호화 장치(100)는 n이 0보다 작은 값이 될 대까지 반복문(for문)(960)에 포함된 동작을 수행할 수 있다.이때, n는 서브 블록 내 현재 변환 계수의 위치를 나타내는 인덱스일 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)( )에 포함된 동작을 한번 수행할 때마다 하나의 계수 그룹에 대한 동작을 수행할 수 있다. 즉, 비디오 복호화 장치(100)는 반복문(for문)(960)에 포함된 동작을 한번 수행할 때마다 하나의 서브 블록에 대한 동작(sig_coeff_flag 관련 동작)을 수행할 수 있다.The video decoding apparatus 100 initializes n to lastScanPos-1 if the current subblock is the lastSubBlock including the last valid transform coefficient, otherwise initializes to 15 and if n is greater than or equal to 0 In this case, n can be reduced by 1, and the operation included in the loop (for statement) () can be performed. The video decoding apparatus 100 can perform the operations included in the loop statement (for statement) 960 until n becomes less than 0. Here, n is an index indicating the position of the current transform coefficient in the sub-block Lt; / RTI &gt; That is, the video decoding apparatus 100 can perform an operation on one coefficient group every time the operation included in the loop statement (for statement) () is performed once. That is, the video decoding apparatus 100 may perform an operation (operation related to sig_coeff_flag) for one subblock each time the operation included in the loop statement (for statement) 960 is performed.
비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 yC를 결정할 수 있다.The video decoding apparatus 100 can determine the positions xC and yC of the current transform coefficient n.
비디오 복호화 장치(100)는 현재 서브 블록에 대한 coded_sub_block_flag[xS][yS]가 1이고, n은 0보다 크거나 inferSbDcSigCoeffFlag가 0인 경우, 현재 변환 계수에 대한 플래그 sig_coeff_flag[xC][yC]를 비트스트림으로부터 획득할 수 있다. sig_coeff_flag[xC][yC]는 현재 변환 계수가 유효 변환 계수인지를 나타내는 플래그일 수 있다.When the coded_sub_block_flag [xS] [yS] for the current sub-block is 1, n is greater than 0 or inferSbDcSigCoeffFlag is 0, the video decoding apparatus 100 sets the flag sig_coeff_flag [xC] [yC] Can be obtained from the stream. sig_coeff_flag [xC] [yC] may be a flag indicating whether the current conversion coefficient is an effective conversion coefficient.
만약 sig_coeff_flag[xC][yC]의 값이 1이라면, inferSbDcSigCoeffFlag는 0으로 결정될 수 있다.If the value of sig_coeff_flag [xC] [yC] is 1, inferSbDcSigCoeffFlag can be determined to be 0.
비디오 복호화 장치(100)는 정방향의 스캔 순서에 따라 현재 서브 블록 내 첫번째로 스캔되는 변환 계수의 위치 firstScanPos의 값을 초기화하고, 정방향의 스캔 순서에 따라 현재 서브 블록 내 마지막으로 스캔되는 변환 계수의 위치 lastSigScanPos의 값을 초기화할 수 있다. 비디오 복호화 장치(100)는 Greater1Flag의 개수를 나타내는 numGreater1Flag의 값을 초기화하고, 정방향의 스캔 순서에 따라 Greater1Flag이 획득되는 마지막 위치 lastGreater1ScanPos의 값을 초기화할 수 있다.The video decoding apparatus 100 initializes the value of the firstScanPos position of the transform coefficient scanned first in the current subblock according to the forward scan order and outputs the position of the transform coefficient scanned last in the current subblock according to the forward scan order You can initialize the value of lastSigScanPos. The video decoding apparatus 100 may initialize the value of numGreater1Flag indicating the number of Greater1Flag and initialize the value of the last position lastGreater1ScanPos at which Greater1Flag is acquired according to the forward scanning order.
비디오 복호화 장치(100)는 서브 블록 i 내 0이 아닌 변환 계수의 개수를 나타내는 cg_nz[i]를 초기화할 수 있다.The video decoding apparatus 100 can initialize cg_nz [i] indicating the number of non-zero transform coefficients in subblock i.
비디오 복호화 장치(100)는 n을 15로 초기화하고, n이 0보다 크거나 같으면 n을 1씩 감소시키면서 n이 0보다 작을때까지 반복문(for문)(965) 내 동작을 수행할 수 있다.The video decoding apparatus 100 initializes n to 15. If n is greater than or equal to 0, n can be decreased by 1, and the operation within the loop statement (for statement) 965 can be performed until n is less than zero.
비디오 복호화 장치(100)는 현재 변환 계수 n의 위치 xC 및 Yc를 결정할 수 있다.The video decoding apparatus 100 can determine the positions xC and Yc of the current transform coefficient n.
비디오 복호화 장치(100)는 현재 변환 계수에 대한 유효 변환 계수 플래그 sig_coeff_flag가 1인 경우, numGreater1Flag가 8보다 작다면, 현재 변환 계수 n에 대한 coeff_level_greater1_flag[n]를 획득하고, numGreater1Flag의 값을 1만큼 증가시킬 수 있다. coeff_level_greater1_flag[n]는 변환 계수 n의 레벨의 절대값이 1보다 큰 지를 나타내는 플래그 정보일 수 있다. 비디오 복호화 장치(100)는 coeff_level_greater1_flag[n]d에 기초하여 Greater1Flag[n]을 결정할 수 있다.The video decoding apparatus 100 acquires coeff_level_greater1_flag [n] for the current transform coefficient n if numGreater1Flag is smaller than 8 when the effective transform coefficient flag sig_coeff_flag for the current transform coefficient is 1, and increases the value of numGreater1Flag by 1 . coeff_level_greater1_flag [n] may be flag information indicating whether the absolute value of the level of the conversion coefficient n is greater than one. The video decoding apparatus 100 can 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 the initial value, the video decoding apparatus 100 can determine the lastGreater1ScanPos as the current transform coefficient position n in the current subblock. Therefore, lastGreater1ScanPos may be index information indicating the position of a coefficient having a value of coeff_abs_level_greater_flag positioned 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 can be set to 1.
비디오 복호화 장치(100)는 numGreater1Flag가 8보다 작지 않다면 escapeDataPresent를 1로 결정할 수 있다.The video decoding apparatus 100 can determine escapeDataPresent to be 1 if numGreater1Flag is not smaller than 8.
비디오 복호화 장치(100)는 정방향 스캔 순서에 따라 현재 서브 블록 내 마지막에 위치하는 유효 변환 계수의 위치르 나타내는 lastSigScanPos가 초기값을 갖는 경우, lastSigScanPos를 현재 서브 블록 내 변환 계수의 위치 n으로 결정할 수 있다.The video decoding apparatus 100 may determine lastSigScanPos to be the current position n of the intra-subblock transform coefficient when the lastSigScanPos indicating the position of the effective transform coefficient located at the end in the current subblock has an initial value according to the forward scan order .
비디오 복호화 장치(100)는 정방향 스캔 순서에 따라 현재 서브 블록 내 첫번째에 위치하는 유효 변환 계수의 위치를 나타내는 firstSigScanPos를 현재 서브 블록 내 변환 계수의 위치 n으로 결정할 수 있다. 현재 변환 계수의 유효 변환 계수 플래그 sig_coeff_flag[xC][yC]가 1인 경우라면 firstSigScanPos의 값이 계속 현재 서브 블록 내 현재 변환 계수의 위치를 나타내는 인덱스 정보인 n으로 갱신되기 때문에 최종적으로 현재 서브 블록 i에 포함된 변환 계수들에 대하여 동작을 수행하게 되면, firstSigScanPos는 정방향의 스캔 순서상 서브 블록 내 첫번째 유효 변환 계수가 존재하는 위치를 나타내는 인덱스 정보일 수 있다.The video decoding apparatus 100 may determine firstSigScanPos, which indicates the position of the effective transform coefficient located first in the current subblock, as the current transform coefficient position n in the current subblock according to the forward scan order. If the effective conversion coefficient flag sig_coeff_flag [xC] [yC] of the current conversion coefficient is 1, the value of firstSigScanPos continues to be updated to n, which is the index information indicating the position of the current transform coefficient in the current subblock. The firstSigScanPos may be the index information indicating the position where the first effective transform coefficient exists in the subblock in the forward scan order.
비디오 복호화 장치(100)는 lastSigScanPos과 firstSigScanPos의 차이가 3보다 큰 경우 sigHidden 값을 1로 결정하고, lastSigScanPos과 firstSigScanPos의 차이가 3보다 크지 않은 경우 sigHidden 값을 0으로 결정할 수 있다. 이때, sigHidden은 현재 서브 블록에 대하여 적어도 하나의 변환 계수의 부호가 숨겨져 있음을 나타내는 값일 수 있다.The video decoding apparatus 100 may determine the sigHidden value to be 1 if the difference between lastSigScanPos and firstSigScanPos is greater than 3 and may determine the sigHidden value to be 0 if the difference between lastSigScanPos and firstSigScanPos is not greater than 3. In this case, sigHidden may be a value indicating that the sign of at least one transform coefficient is hidden for the current 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 coeff_abs_level_greater1_flag of the coeff_abs_level_greater1_flag (Greater1Flag) for the transform coefficient obtained from the scanned bitstream according to the forward scan order is not the initial value (i.e., at least one Greater1Flag from the bitstream) Is obtained in the current subblock), the video decoding apparatus 100 can obtain the flag coeff_abs_level_greater2_flag [lastGreater1ScanPos] for the transform coefficient of the lastGreater1ScanPos position from the bitstream. coeff_abs_level_greater2_flag may be a flag indicating whether the absolute value of the transform coefficient is greater than two. If the value of the flag coeff_abs_level_greater2_flag [lastGreater1ScanPos] for the conversion coefficient at the lastGreater1ScanPos position is 1, the video decoding apparatus 100 can determine the escapeDataPresent to be 1. [ The video decoding apparatus 100 can determine Greater2Flag [n] based on coeff_level_greater2_flag [n].
비디오 복호화 장치(100)는 numSigCoeff을 초기화할 수 있다. 이때, numSigCoeff는 역방향의 스캔 순서에 따라 현재 변환 계수 이전까지 스캔된변환 계수들 중 유효 변환 계수의 개수를 의미할 수 있다.The video decoding apparatus 100 can initialize numSigCoeff. In this case, numSigCoeff may mean the number of effective transform coefficients among the transform coefficients scanned before the current transform coefficient according to the reverse scan order.
비디오 복호화 장치(100)는 n을 15로 초기화하고, n이 0보다 크거나 같은 경우 n을 1만큼 감소시키고 for 문(970) 내 동작을 수행하고, n이 0보다 작은 경우, for 문(970) 내 동작을 더 이상 수행하지 않을 수 있다. 비디오 복호화 장치(100)는 역방향의 스캔 순서에 따라 현재 서브 블록 내 변환 계수들에 관한 정보를 스캔하는 동작 등을 수행할 수 있다.The video decoding apparatus 100 initializes n to 15. If n is greater than or equal to 0, n is decreased by 1 and an operation within the for 970 is performed. If n is smaller than 0, the for decoding 970 ) My action may no longer be performed. The video decoding apparatus 100 may perform an operation of scanning information on the current intra-block transform coefficients in a backward scan order.
비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 기초하여 현재 변환 계수의 위치 xC, yC를 결정할 수 있다.The video decoding apparatus 100 can determine the position xC, yC of the current transform coefficient based on the position n of the current transform coefficient in the current subblock.
비디오 복호화 장치(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 conversion coefficient flag sig_coeff_flag [xC] [yC] related to the current conversion coefficient is 1, the video decoding apparatus 100 sets the value of the flag coeff_abs_level_greater1_flag related to the current conversion coefficient, the value of the flag coeff_abs_level_greater2_flag You can determine baseLevel by adding the sum to the sum.
만약 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, if the base level is 3, the video decoding apparatus 100 extracts the residual level value information coeff_abs_level_remaining [n] for the current transform coefficient n from the bitstream Can be obtained.
만약 numSigCoeff가 8보다 작고, 현재 변환 계수의 위치 n이 lastGreater1ScanPos이 아닌 경우라면, base level이 2인 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수 n에 대한 잔여 레벨값 정보 coeff_abs_level_remaining[n]를 획득할 수 있다. 만약 numSigCoeff가 8보다 크다면, base level이 1인 경우, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수 n에 대한 잔여 레벨값 정보 coeff_abs_level_remaining[n]를 획득할 수 있다.If numSigCoeff is less than 8 and the current position n of the transform coefficient is not lastGreater1ScanPos, if the base level is 2, the video decoding apparatus 100 extracts residual level value information 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 the residual level value information coeff_abs_level_remaining [n] for the current transform coefficient n from the bitstream.
비디오 복호화 장치(100)는 현재 변환 계수에 대한 베이스 레벨 및 현재 변환 계수에 대한 잔여 레벨 값을 합하여 현재 블록 내 현재 변환 계수의 레벨 값인 TransCoeffLevel[x0][y0][cIdx][xC][yC]을 결정할 수 있다. 여기서, cIdx는 색상 성분을 나타내는 인덱스일 수 있다.The video decoding apparatus 100 obtains the 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, it can perform the operations contained in the forbidden statement (for statement) 975 until it becomes less than or equal to the value of lastSubBlock. In this case, i may be an index indicating a sub-block. That is, the video decoding apparatus 100 can perform an operation for one coefficient group every time the syntax in the for statement 975 is performed 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 and rsp is applied (rsp_apply), the video decoding apparatus 100 determines n to be 15, and if n is greater than 0 If it is the same, the for statement (980) operation can be performed again if n is greater than or equal to 0 after performing the operation in the for statement (980) and decrementing n by 1. If n is less than 0, the operation in the for statement (980) may not be performed any more.
비디오 복호화 장치(100)는 현재 서브 블록 내 현재 변환 계수의 위치 n에 대응하는 현재 변환 계수의 수평방향 위치 및 수직방향 위치 xC 및 yC를 결정할 수 있다. 비디오 복호화 장치(100)는 xC 및 yC에 기초하여 현재 변환 계수의 위치(blkpos)를 결정할 수 있다.The video decoding apparatus 100 can determine the horizontal position and the vertical position xC and yC of the current transform coefficient corresponding to the position n of the current transform coefficient in the current subblock. The video decoding apparatus 100 can determine the position (blkpos) of the current transform coefficient based on xC and yC.
비디오 복호화 장치(100)는 현재 변환 계수의 위치 blkpos가 rsp_pos가 아닌 경우, 부호가 숨겨진 변환 계수의 위치 hidden_pos이라면, 현재 변환 계수의 부호를 숨겨진 변환 계수의 부호 hidden_sign으로 결정할 수 있다.If the position blkpos of the current transform coefficient is not rsp_pos, the video decoding apparatus 100 can determine the sign of the current transform coefficient as the sign hidden_sign of the hidden transform coefficient if the code is the position hidden_pos of the transform coefficient hidden therein.
만약 그렇지 않은 경우(부호가 숨겨진 변환 계수의 위치 hidden_pos이 아닌 경우)라면, 비디오 복호화 장치(100)는 비트스트림으로부터 현재 변환 계수의 부호에 관한 정보 sign[xC][yC]를 획득할 수 있다.If not, the video decoding apparatus 100 can obtain the information sign [xC] [yC] concerning the sign of the current transform coefficient from the bitstream, if the code is not the position hidden_pos of the hidden transform coefficient.
비디오 복호화 장치(100)는 현재 변환 계수의 위치가 rsp_pos인 경우, 비트스트림으로부터 현재 변환 계수의 rsp 부호에 관한 정보 sign_rsp[xC][yC]를 획득할 수 있다.The video decoding apparatus 100 can obtain the information sign_rsp [xC] [yC] regarding the rsp code of the current transform coefficient from the bit stream when the current transform coefficient position is rsp_pos.
만약 rsp가 적용되지 않는다면, 비디오 복호화 장치(100)는 n을 15로 결정하고, n이 0보다 크다면 for문(985) 내 동작을 수행하고, n을 1만큼 감소시킨 후에 다시 n이 0보다 크거나 같다면 for문(985) 동작을 다시 수행할 수 있고, 만약, n이 0보다 작다면 for문(985) 내 동작을 더 이상 수행하지 않을 수 있다.If rsp is not applied, the video decoding apparatus 100 determines n to be 15. If n is greater than 0, the video decoding apparatus 100 performs the operation in the for statement (985), reduces n by 1, If greater than or equal to, the for statement (985) operation can 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 can determine the horizontal position and the vertical position xC and yC of the current transform coefficient corresponding to the position n of the current transform coefficient in the current subblock. The video decoding apparatus 100 can 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 flag sign_data_hiding_enabled_flag indicating whether the value of the effective conversion coefficient flag sig_coeff_flag [xC] [yC] of the current conversion coefficient is 1 and activating the hiding of the sign data is 0, or if there is no hidden code for the current subblock (! SignHidden If the position of the current transform coefficient in the current sub-block in the forward scan order is not the first effective transform coefficient position firstSigScanPos is 0, the sign information sign [xC] [yC] of the current transform coefficient is calculated from the bit stream Can be obtained.
이하, 도 10 내지 도 23을 참조하여 일 실시예에 따른 비디오 복호화 장치(100)가 영상을 복호화하는 과정에서 이용할 수 있는 데이터 단위를 결정하는 방법을 설명하도록 한다. 비디오 부호화 장치(150)의 동작은 후술하는 비디오 복호화 장치(100)의 동작에 대한 다양한 실시예와 유사하거나 반대되는 동작이 될 수 있다.Hereinafter, a method of determining a data unit usable in the process of decoding a video by the video decoding apparatus 100 according to an embodiment will be described with reference to FIGS. 10 to 23. FIG. The operation of the video encoding apparatus 150 may be similar to or opposite to the various embodiments of the operation of the video decoding apparatus 100 described later.
도 10은 일 실시예에 따라 비디오 복호화 장치(100)가 현재 부호화 단위를 분할하여 적어도 하나의 부호화 단위를 결정하는 과정을 도시한다.FIG. 10 illustrates a process in which the video decoding apparatus 100 determines at least one encoding unit by dividing a current encoding unit according to an embodiment.
일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보를 이용하여 부호화 단위의 형태를 결정할 수 있고, 분할 형태 정보를 이용하여 부호화 단위가 어떤 형태로 분할되는지를 결정할 수 있다. 즉, 비디오 복호화 장치(100)가 이용하는 블록 형태 정보가 어떤 블록 형태를 나타내는지에 따라 분할 형태 정보가 나타내는 부호화 단위의 분할 방법이 결정될 수 있다. According to an embodiment, the video decoding apparatus 100 can determine the type of an encoding unit using block type information, and can determine a type of an encoding unit to be divided using the type information. That is, the division method of the coding unit indicated by the division type information can 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 the current encoding unit is a square type. For example, the video decoding apparatus 100 can determine whether to divide a square encoding unit according to division type information, vertically divide, horizontally divide, or divide into four encoding units. 10, if the block type information of the current encoding unit 1000 indicates a square shape, the video decoding apparatus 100 may calculate the size of the current encoding unit 1000 according to the division type information indicating that the current block is not divided, (1010b), 1010c (1010d, etc.) based on the division type information indicating the predetermined division method.
도 10을 참조하면 비디오 복호화 장치(100)는 일 실시예에 따라 수직방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향으로 분할한 두개의 부호화 단위(1010b)를 결정할 수 있다. 비디오 복호화 장치(100)는 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수평방향으로 분할한 두개의 부호화 단위(1010c)를 결정할 수 있다. 비디오 복호화 장치(100)는 수직방향 및 수평방향으로 분할됨을 나타내는 분할 형태 정보에 기초하여 현재 부호화 단위(1000)를 수직방향 및 수평방향으로 분할한 네개의 부호화 단위(1010d)를 결정할 수 있다. 다만 정사각형의 부호화 단위가 분할될 수 있는 분할 형태는 상술한 형태로 한정하여 해석되어서는 안되고, 분할 형태 정보가 나타낼 수 있는 다양한 형태가 포함될 수 있다. 정사각형의 부호화 단위가 분할되는 소정의 분할 형태들은 이하에서 다양한 실시예를 통해 구체적으로 설명하도록 한다. Referring to FIG. 10, the video decoding apparatus 100 determines two coding units 1010b obtained by dividing the current coding unit 1000 in the vertical direction based on division type information indicating division in the vertical direction according to an embodiment . The video decoding apparatus 100 can determine two coding units 1010c obtained by dividing the current coding unit 1000 in the horizontal direction based on the division type information indicating that the coding unit is divided in the horizontal direction. The video decoding apparatus 100 can determine four coding units 1010d obtained by dividing the current coding unit 1000 in the vertical direction and the horizontal direction based on the division type information indicating that the coding unit 1000 is divided in the vertical direction and the horizontal direction. However, the division type in which the square coding unit can be divided should not be limited to the above-mentioned form, but may include various forms in which the division type information can be represented. The predetermined divisional form in which the square encoding unit is divided will be described in detail by way of various embodiments below.
도 11은 일 실시예에 따라 비디오 복호화 장치(100)가 비-정사각형의 형태인 부호화 단위를 분할하여 적어도 하나의 부호화 단위를 결정하는 과정을 도시한다.FIG. 11 illustrates a process in which the video decoding apparatus 100 determines at least one encoding unit by dividing an encoding unit in the form of a non-square 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 exemplary embodiment, the video decoding apparatus 100 may use block type information indicating that the current encoding unit is a non-square format. The video decoding apparatus 100 can determine whether to divide the non-square current encoding unit according to the division type information or not in a predetermined method. 11, if the block type information of the current encoding unit 1100 or 1150 indicates a non-square shape, the video decoding apparatus 100 determines the current encoding unit 1100 or 1150 according to the division type information indicating that the current block is not divided 1130a, 1130b, 1130c, 1170a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1130a, 1170b, 1180a, 1180b, and 1180c. The predetermined division method in which the non-square coding unit is divided will be described in detail through various embodiments.
일 실시예에 따라 비디오 복호화 장치(100)는 분할 형태 정보를 이용하여 부호화 단위가 분할되는 형태를 결정할 수 있고, 이 경우 분할 형태 정보는 부호화 단위가 분할되어 생성되는 적어도 하나의 부호화 단위의 개수를 나타낼 수 있다. 도 11를 참조하면 분할 형태 정보가 두개의 부호화 단위로 현재 부호화 단위(1100 또는 1150)가 분할되는 것을 나타내는 경우, 비디오 복호화 장치(100)는 분할 형태 정보에 기초하여 현재 부호화 단위(1100 또는 1150)를 분할하여 현재 부호화 단위에 포함되는 두개의 부호화 단위(1120a, 11420b, 또는 1170a, 1170b)를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine a type in which a coding unit is divided using the division type information. In this case, the division type information indicates a number of at least one coding unit generated by dividing an encoding unit . 11, when the division type information indicates that the current encoding unit 1100 or 1150 is divided into two encoding units, the video decoding apparatus 100 determines the current encoding unit 1100 or 1150 based on the division type information, To determine two encoding units 1120a, 11420b, or 1170a and 1170b included in the current encoding unit.
일 실시예에 따라 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 비-정사각형의 형태의 현재 부호화 단위(1100 또는 1150)를 분할하는 경우, 비-정사각형의 현재 부호화 단위(1100 또는 1150)의 긴 변의 위치를 고려하여 현재 부호화 단위를 분할할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)의 형태를 고려하여 현재 부호화 단위(1100 또는 1150)의 긴 변을 분할하는 방향으로 현재 부호화 단위(1100 또는 1150)를 분할하여 복수개의 부호화 단위를 결정할 수 있다. When the video decoding apparatus 100 divides the current encoding unit 1100 or 1150 in the form of non-square based on the division type information according to an embodiment, the non-square current encoding unit 1100 or 1150 The current encoding unit can be divided in consideration of the position of the long side. For example, the video decoding apparatus 100 divides the current encoding unit 1100 or 1150 in the direction of dividing the long side of the current encoding unit 1100 or 1150 in consideration of the type of the current encoding unit 1100 or 1150 So that a plurality of encoding units can be determined.
일 실시예에 따라, 분할 형태 정보가 홀수개의 블록으로 부호화 단위를 분할하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)에 포함되는 홀수개의 부호화 단위를 결정할 수 있다. 예를 들면, 분할 형태 정보가 3개의 부호화 단위로 현재 부호화 단위(1100 또는 1150)를 분할하는 것을 나타내는 경우, 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)를 3개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c)로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위(1100 또는 1150)에 포함되는 홀수개의 부호화 단위를 결정할 수 있으며, 결정된 부호화 단위들의 크기 모두가 동일하지는 않을 수 있다. 예를 들면, 결정된 홀수개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c) 중 소정의 부호화 단위(1130b 또는 1180b)의 크기는 다른 부호화 단위(1130a, 1130c, 1180a, 1180c)들과는 다른 크기를 가질 수도 있다. 즉, 현재 부호화 단위(1100 또는 1150)가 분할되어 결정될 수 있는 부호화 단위는 복수의 종류의 크기를 가질 수 있고, 경우에 따라서는 홀수개의 부호화 단위(1130a, 1130b, 1130c, 1180a, 1180b, 1180c)가 각각 서로 다른 크기를 가질 수도 있다. According to an embodiment, when the division type information indicates division of an encoding unit into odd number of blocks, the video decoding apparatus 100 may determine an odd number of encoding units included in the current encoding unit 1100 or 1150. For example, when the division type information indicates that the current encoding unit 1100 or 1150 is divided into three encoding units, the video decoding apparatus 100 divides the current encoding unit 1100 or 1150 into three encoding units 1130a , 1130b, 1130c, 1180a, 1180b, 1180c. According to an embodiment, the video decoding apparatus 100 may determine an odd number of encoding units included in the current encoding unit 1100 or 1150, and the sizes of the determined encoding units may not be the same. For example, the size of a predetermined encoding unit 1130b or 1180b among the determined odd number of encoding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c is different from that of other encoding units 1130a, 1130c, 1180a, and 1180c . That is, an encoding unit that can be determined by dividing the current encoding unit 1100 or 1150 may have a plurality of types of sizes, and an odd number of encoding units 1130a, 1130b, 1130c, 1180a, 1180b, May have different sizes.
일 실시예에 따라 분할 형태 정보가 홀수개의 블록으로 부호화 단위가 분할되는 것을 나타내는 경우, 비디오 복호화 장치(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 division type information indicates that an encoding unit is divided into an odd number of blocks, the video decoding apparatus 100 can determine an odd number of encoding units included in the current encoding unit 1100 or 1150, The video decoding apparatus 100 may limit a coding unit of at least one of odd number of coding units generated by division. Referring to FIG. 11, the video decoding apparatus 100 includes an encoding unit 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c generated by dividing a current encoding unit 1100 or 1150, 1130b, and 1180b may be different from the other encoding units 1130a, 1130c, 1180a, and 1180c. For example, in the video decoding apparatus 100, unlike the other encoding units 1130a, 1130c, 1180a, and 1180c, the encoding units 1130b and 1180b positioned at the center are restricted so as not to be further divided, It can be limited to be divided.
도 12는 일 실시예에 따라 비디오 복호화 장치(100)가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 부호화 단위를 분할하는 과정을 도시한다.12 shows a process in which the video decoding apparatus 100 divides an encoding unit based on at least one of block type information and division 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 to divide or not divide the first coding unit 1200 in units of coding units into coding units based on at least one of the block type information and the division type information. According to an embodiment, when the division type information indicates that the first encoding unit 1200 is divided in the horizontal direction, the video decoding apparatus 100 divides the first encoding unit 1200 in the horizontal direction, (1210). The first encoding unit, the second encoding unit, and the third encoding unit used according to an embodiment are terms used to understand the relation before and after the division between encoding units. For example, if the first encoding unit is divided, the second encoding unit can be determined, and if the second encoding unit is divided, the third encoding unit can be determined. Hereinafter, the relationship between the first coding unit, the second coding unit and the third coding unit used can be understood to be in accordance with the above-mentioned characteristic.
일 실시예에 따라 비디오 복호화 장치(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 encoding unit 1210 is not divided or divided into encoding units based on at least one of the block type information and the division type information. 12, the video decoding apparatus 100 includes a second encoding unit 1210 of a non-square shape determined by dividing a first encoding unit 1200 based on at least one of block type information and division type information, It may be divided into at least one third encoding unit 1220a, 1220b, 1220c, 1220d, or the like, or the second encoding unit 1210 may not be divided. The video decoding apparatus 100 can acquire at least one of block type information and division type information and the video decoding apparatus 100 can acquire at least one of the first encoding unit 1200 The second encoding unit 1210 may divide a plurality of second encoding units (for example, 1210) of various types into a first encoding unit 1210 based on at least one of block type information and division type information, The unit 1200 can be divided according to the divided method. According to one embodiment, when the first encoding unit 1200 is divided into the second encoding units 1210 based on at least one of the block type information and the division type information for the first encoding unit 1200, The encoding unit 1210 may also be divided into a third encoding unit (e.g., 1220a, 1220b, 1220c, 1220d, etc.) based on at least one of block type information and division type information for the second encoding unit 1210 have. That is, an encoding unit can be recursively divided based on at least one of division type information and block type information associated with each encoding unit. Therefore, a square encoding unit may be determined in a non-square encoding unit, and a non-square encoding unit may be determined by dividing the square encoding unit recursively. Referring to FIG. 12, among the odd third encoding units 1220b, 1220c, and 1220d in which the non-square second encoding unit 1210 is divided and determined, predetermined encoding units (for example, An encoding unit or a square-shaped encoding unit) can be recursively divided. According to an exemplary embodiment, the third encoding unit 1220c in the form of a square, which is one of the odd numbered third encoding units 1220b, 1220c, and 1220d, may be divided in the horizontal direction and divided into a plurality of fourth encoding units. The non-square fourth encoding unit 1240, which is one of the plurality of fourth encoding units, may be further divided into a plurality of encoding units. For example, the non-square-shaped fourth encoding unit 1240 may be further divided into odd-numbered encoding units 1250a, 1250b, and 1250c.
부호화 단위의 재귀적 분할에 이용될 수 있는 방법에 대하여는 다양한 실시예를 통해 후술하도록 한다.A method which can be used for recursive division of an encoding unit will be described later in 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 one embodiment, the video decoding apparatus 100 divides each of the third encoding units 1220a, 1220b, 1220c, and 1220d into units of encoding based on at least one of block type information and division type information, It can be determined that the unit 1210 is not divided. The video decoding apparatus 100 may divide the second encoding unit 1210 in a non-square form into third encoding units 1220b, 1220c, and 1220d in an odd number according to an embodiment. The video decoding apparatus 100 may set a predetermined restriction on a predetermined third encoding unit among odd numbered third encoding units 1220b, 1220c, and 1220d. For example, the video decoding apparatus 100 may restrict the encoding unit 1220c located in the middle among the odd-numbered third encoding units 1220b, 1220c, and 1220d to no longer be divided, or be divided into a set number of times . 12, the video decoding apparatus 100 may include an encoding unit (not shown) located in the middle among the odd third encoding units 1220b, 1220c, and 1220d included in the second encoding unit 1210 in the non- 1220c may not be further divided or may be limited to being divided into a predetermined division type (for example, divided into four coding units or divided into a form corresponding to the divided form of the second coding unit 1210) (For example, dividing only n times, n > 0). The above restriction on the encoding unit 1220c positioned in the center is merely an example and should not be construed to be limited to the above embodiments and the encoding unit 1220c located in the center is not limited to the other encoding units 1220b and 1220d Quot;), &lt; / RTI &gt; which can be decoded differently.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하기 위해 이용되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 현재 부호화 단위 내의 소정의 위치에서 획득할 수 있다. According to an embodiment, the video decoding apparatus 100 can acquire at least one of the block type information and the division type information used for dividing the current encoding unit at a predetermined position in the current encoding unit.
도 13은 일 실시예에 따라 비디오 복호화 장치(100)가 홀수개의 부호화 단위들 중 소정의 부호화 단위를 결정하기 위한 방법을 도시한다. 도 13을 참조하면, 현재 부호화 단위(1300)의 블록 형태 정보 및 분할 형태 정보 중 적어도 하나는 현재 부호화 단위(1300)에 포함되는 복수개의 샘플 중 소정 위치의 샘플(예를 들면, 가운데에 위치하는 샘플(1340))에서 획득될 수 있다. 다만 이러한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나가 획득될 수 있는 현재 부호화 단위(1300) 내의 소정 위치가 도 13에서 도시하는 가운데 위치로 한정하여 해석되어서는 안되고, 소정 위치에는 현재 부호화 단위(1300)내에 포함될 수 있는 다양한 위치(예를 들면, 최상단, 최하단, 좌측, 우측, 좌측상단, 좌측하단, 우측상단 또는 우측하단 등)가 포함될 수 있는 것으로 해석되어야 한다. 비디오 복호화 장치(100)는 소정 위치로부터 획득되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 획득하여 현재 부호화 단위를 다양한 형태 및 크기의 부호화 단위들로 분할하거나 분할하지 않는 것으로 결정할 수 있다.FIG. 13 illustrates a method for the video decoding apparatus 100 to determine a predetermined encoding unit among an odd number of encoding units according to an embodiment. 13, at least one of the block type information and the division type information of the current encoding unit 1300 is a sample of a predetermined position among a plurality of samples included in the current encoding unit 1300 (for example, Sample 1340). However, the predetermined position in the current coding unit 1300 in which at least one of the block type information and the division type information can be obtained should not be limited to the middle position shown in FIG. 13, and the current coding unit 1300 (E.g., top, bottom, left, right, top left, bottom left, top right or bottom right, etc.) The video decoding apparatus 100 may determine that the current encoding unit is not divided or divided into the encoding units of various types and sizes by acquiring at least one of the block type information and the division type information obtained from the predetermined position.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위가 소정의 개수의 부호화 단위들로 분할된 경우 그 중 하나의 부호화 단위를 선택할 수 있다. 복수개의 부호화 단위들 중 하나를 선택하기 위한 방법은 다양할 수 있으며, 이러한 방법들에 대한 설명은 이하의 다양한 실시예를 통해 후술하도록 한다.According to an exemplary embodiment, when the current encoding unit is divided into a predetermined number of encoding units, the video decoding apparatus 100 may select one of the encoding units. The method for selecting one of the plurality of encoding units may be various, and description of these methods will be described later in various embodiments.
일 실시예에 따라 비디오 복호화 장치(100) 는 현재 부호화 단위를 복수개의 부호화 단위들로 분할하고, 소정 위치의 부호화 단위를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may divide the current encoding unit into a plurality of encoding units and determine a unit of encoding at a predetermined position.
도 13은 일 실시예에 따라 비디오 복호화 장치(100)가 홀수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위한 방법을 도시한다.FIG. 13 illustrates a method for the video decoding apparatus 100 to determine an encoding unit of a predetermined position among odd number of encoding 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 positions of odd-numbered encoding units in order to determine an encoding unit located in the middle among odd-numbered encoding units. Referring to FIG. 13, the video decoding apparatus 100 may determine an odd number of encoding units 1320a, 1320b, and 1320c by dividing the current encoding unit 1300. FIG. The video decoding apparatus 100 may determine the center encoding unit 1320b using information on the positions of odd number of encoding units 1320a, 1320b, and 1320c. For example, the video decoding apparatus 100 determines the positions of the encoding units 1320a, 1320b, and 1320c based on information indicating the positions of predetermined samples included in the encoding units 1320a, 1320b, and 1320c, Can be determined. More specifically, the video decoding apparatus 100 decodes the coding units 1320a, 1320b, and 1320c based on information indicating the positions of the upper left samples 1330a, 1330b, and 1330c of the coding units 1320a, 1320b, By determining the position, the coding unit 1320b located in the center can be determined.
일 실시예에 따라 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 정보는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 위치 또는 좌표에 대한 정보를 포함할 수 있다. 일 실시예에 따라 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 정보는 현재 부호화 단위(1300)에 포함되는 부호화단위(1320a, 1320b, 1320c)들의 너비 또는 높이를 나타내는 정보를 포함할 수 있고, 이러한 너비 또는 높이는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 좌표 간의 차이를 나타내는 정보에 해당할 수 있다. 즉, 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)의 픽쳐 내에서의 위치 또는 좌표에 대한 정보를 직접이용하거나 좌표간의 차이값에 대응하는 부호화 단위의 너비 또는 높이에 대한 정보를 이용함으로써 가운데에 위치하는 부호화 단위(1320b)를 결정할 수 있다. Information indicating the positions of the upper left samples 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c according to an exemplary embodiment is a position in the picture of the coding units 1320a, 1320b, and 1320c Or information about the coordinates. Information indicating the positions of the upper left samples 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c according to one embodiment is stored in the coding units 1320a and 1320b included in the current coding unit 1300 And 1320c, and the width or height may correspond to information indicating a difference between coordinates in the picture of the encoding units 1320a, 1320b, and 1320c. That is, the video decoding apparatus 100 can directly use the information on the position or the coordinates in the picture of the coding units 1320a, 1320b, and 1320c or the information on the width or height of the coding unit corresponding to the difference value between the coordinates The encoding unit 1320b located in the center can be determined.
일 실시예에 따라, 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 나타내는 정보는 (xa, ya) 좌표를 나타낼 수 있고, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 위치를 나타내는 정보는 (xb, yb) 좌표를 나타낼 수 있고, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 위치를 나타내는 정보는 (xc, yc) 좌표를 나타낼 수 있다. 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)에 각각 포함되는 좌측 상단의 샘플(1330a, 1330b, 1330c)의 좌표를 이용하여 가운데 부호화 단위(1320b)를 결정할 수 있다. 예를 들면, 좌측 상단의 샘플(1330a, 1330b, 1330c)의 좌표를 오름차순 또는 내림차순으로 정렬하였을 때, 가운데에 위치하는 샘플(1330b)의 좌표인 (xb, yb)를 포함하는 부호화 단위(1320b)를 현재 부호화 단위(1300)가 분할되어 결정된 부호화 단위(1320a, 1320b, 1320c) 중 가운데에 위치하는 부호화 단위로 결정할 수 있다. 다만 좌측 상단의 샘플(1330a, 1330b, 1330c)의 위치를 나타내는 좌표는 픽쳐 내에서의 절대적인 위치를 나타내는 좌표를 나타낼 수 있고, 나아가 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 기준으로, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 상대적 위치를 나타내는 정보인 (dxb, dyb)좌표, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 상대적 위치를 나타내는 정보인 (dxc, dyc)좌표를 이용할 수도 있다. 또한 부호화 단위에 포함되는 샘플의 위치를 나타내는 정보로서 해당 샘플의 좌표를 이용함으로써 소정 위치의 부호화 단위를 결정하는 방법이 상술한 방법으로 한정하여 해석되어서는 안되고, 샘플의 좌표를 이용할 수 있는 다양한 산술적 방법으로 해석되어야 한다.The information indicating the position of the upper left sample 1330a of the upper coding unit 1320a may indicate the coordinates (xa, ya) and the upper left sample 1330b of the middle coding unit 1320b May represent the coordinates (xb, yb), and the information indicating the position of the upper left sample 1330c of the lower coding unit 1320c may indicate the coordinates (xc, yc). The video decoding apparatus 100 can determine the center encoding unit 1320b using the coordinates of the upper left samples 1330a, 1330b, and 1330c included in the encoding units 1320a, 1320b, and 1320c. For example, when the coordinates of the upper left samples 1330a, 1330b, and 1330c are sorted in ascending or descending order, the coding unit 1320b including the coordinates (xb, yb) of the sample 1330b positioned at the center, May be determined as a coding unit located in the middle of the coding units 1320a, 1320b, and 1320c determined by dividing the current coding unit 1300. [ However, the coordinates indicating the positions of the samples 1330a, 1330b, and 1330c in the upper left corner may indicate the coordinates indicating the absolute position in the picture, and the position of the upper left sample 1330a of the upper coding unit 1320a may be (Dxb, dyb), which is the information indicating the relative position of the sample 1330b at the upper left of the middle encoding unit 1320b, and the relative position of the sample 1330c at the upper left of the lower encoding unit 1320c Information dyn (dxc, dyc) coordinates may also be used. Also, the method of determining the coding unit at a predetermined position by using the coordinates of the sample as information indicating the position of the sample included in the coding unit should not be limited to the above-described method, and various arithmetic Should be interpreted as a method.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위(1300)를 복수개의 부호화 단위(1320a, 1320b, 1320c)로 분할할 수 있고, 부호화 단위(1320a, 1320b, 1320c)들 중 소정의 기준에 따라 부호화 단위를 선택할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c) 중 크기가 다른 부호화 단위(1320b)를 선택할 수 있다.The video decoding apparatus 100 may divide the current encoding unit 1300 into a plurality of encoding units 1320a, 1320b, and 1320c and may convert the encoding units 1320a, 1320b, The encoding unit can be selected. For example, the video decoding apparatus 100 can select an encoding unit 1320b having a different size from among the encoding units 1320a, 1320b, and 1320c.
일 실시예에 따라 비디오 복호화 장치(100)는 상단 부호화 단위(1320a)의 좌측 상단의 샘플(1330a)의 위치를 나타내는 정보인 (xa, ya) 좌표, 가운데 부호화 단위(1320b)의 좌측 상단의 샘플(1330b)의 위치를 나타내는 정보인 (xb, yb) 좌표, 하단 부호화 단위(1320c)의 좌측 상단의 샘플(1330c)의 위치를 나타내는 정보인 (xc, yc) 좌표를 이용하여 부호화 단위(1320a, 1320b, 1320c) 각각의 너비 또는 높이를 결정할 수 있다. 비디오 복호화 장치(100)는 부호화 단위(1320a, 1320b, 1320c)의 위치를 나타내는 좌표인 (xa, ya), (xb, yb), (xc, yc)를 이용하여 부호화 단위(1320a, 1320b, 1320c) 각각의 크기를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may be configured to include (xa, ya) coordinates, which is information indicating the position of the upper left sample 1330a of the upper encoding unit 1320a, (Xc, yc) coordinates, which is information indicating the position of the lower-stage coding unit 1330b and the position of the upper-left sample 1330c of the lower- stage coding unit 1320c, 1320b, and 1320c, respectively. The video decoding apparatus 100 encodes the encoding units 1320a, 1320b, and 1320c using the coordinates (xa, ya), (xb, yb), (xc, yc) indicating the positions of the encoding units 1320a, ) Can be determined.
일 실시예에 따라, 비디오 복호화 장치(100)는 상단 부호화 단위(1320a)의 너비를 xb-xa로 결정할 수 있고 높이를 yb-ya로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 가운데 부호화 단위(1320b)의 너비를 xc-xb로 결정할 수 있고 높이를 yc-yb로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 하단 부호화 단위의 너비 또는 높이는 현재 부호화 단위의 너비 또는 높이와 상단 부호화 단위(1320a) 및 가운데 부호화 단위(1320b)의 너비 및 높이를 이용하여 결정할 수 있다. 비디오 복호화 장치(100)는 결정된 부호화 단위(1320a, 1320b, 1320c)의 너비 및 높이에 기초하여 다른 부호화 단위와 다른 크기를 갖는 부호화 단위를 결정할 수 있다. 도 13을 참조하면, 비디오 복호화 장치(100)는 상단 부호화 단위(1320a) 및 하단 부호화 단위(1320c)의 크기와 다른 크기를 가지는 가운데 부호화 단위(1320b)를 소정 위치의 부호화 단위로 결정할 수 있다. 다만 상술한 비디오 복호화 장치(100)가 다른 부호화 단위와 다른 크기를 갖는 부호화 단위를 결정하는 과정은 샘플 좌표에 기초하여 결정되는 부호화 단위의 크기를 이용하여 소정 위치의 부호화 단위를 결정하는 일 실시예에 불과하므로, 소정의 샘플 좌표에 따라 결정되는 부호화 단위의 크기를 비교하여 소정 위치의 부호화 단위를 결정하는 다양한 과정이 이용될 수 있다. According to one embodiment, the video decoding apparatus 100 can determine the width of the upper encoding unit 1320a as xb-xa and the height as yb-ya. According to an embodiment, the video decoding apparatus 100 can determine the width of the middle encoding unit 1320b as xc-xb and the height as yc-yb. The video decoding apparatus 100 may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit 1320a and the middle encoding unit 1320b . The video decoding apparatus 100 may determine an encoding unit having a different size from the other encoding units based on the widths and heights of the determined encoding units 1320a, 1320b, and 1320c. Referring to FIG. 13, the video decoding apparatus 100 may determine a coding unit 1320b as a coding unit at a predetermined position while having a size different from that of the upper coding unit 1320a and the lower coding unit 1320c. However, the process of the above-described video decoding apparatus 100 determining an encoding unit having a size different from that of the other encoding units may be the same as the process of determining an encoding unit at a predetermined position using the size of an encoding unit determined based on sample coordinates , Various processes may be used for determining the encoding unit at a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates.
다만 부호화 단위의 위치를 결정하기 위하여 고려하는 샘플의 위치는 상술한 좌측 상단으로 한정하여 해석되어서는 안되고 부호화 단위에 포함되는 임의의 샘플의 위치에 대한 정보가 이용될 수 있는 것으로 해석될 수 있다. However, the position of the sample to be considered for determining the position of the coding unit should not be interpreted as being limited to the left upper end, and information about the position of any sample included in the coding unit can be interpreted as being available.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위의 형태를 고려하여, 현재 부호화 단위가 분할되어 결정되는 홀수개의 부호화 단위들 중 소정 위치의 부호화 단위를 선택할 수 있다. 예를 들면, 현재 부호화 단위가 너비가 높이보다 긴 비-정사각형 형태라면 비디오 복호화 장치(100)는 수평 방향에 따라 소정 위치의 부호화 단위를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 수평 방향으로 위치를 달리 하는 부호화 단위들 중 하나를 결정하여 해당 부호화 단위에 대한 제한을 둘 수 있다. 현재 부호화 단위가 높이가 너비보다 긴 비-정사각형 형태라면 비디오 복호화 장치(100)는 수직 방향에 따라 소정 위치의 부호화 단위를 결정할 수 있다. 즉, 비디오 복호화 장치(100)는 수직 방향으로 위치를 달리 하는 부호화 단위들 중 하나를 결정하여 해당 부호화 단위에 대한 제한을 둘 수 있다. According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position among the odd number of coding units in which the current coding unit is divided by considering the type of the current coding unit. For example, if the current coding unit is a non-square shape having a width greater than the height, the video decoding apparatus 100 can determine a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may determine one of the encoding units that are located in the horizontal direction and set a restriction on the encoding unit. If the current coding unit is a non-square shape having a height greater than the width, the video decoding apparatus 100 can determine a coding unit at a predetermined position in the vertical direction. That is, the video decoding apparatus 100 may determine one of the encoding units which are located in the vertical direction and limit the encoding unit.
일 실시예에 따라 비디오 복호화 장치(100)는 짝수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여 짝수개의 부호화 단위들 각각의 위치를 나타내는 정보를 이용할 수 있다. 비디오 복호화 장치(100)는 현재 부호화 단위를 분할하여 짝수개의 부호화 단위들을 결정할 수 있고 짝수개의 부호화 단위들의 위치에 대한 정보를 이용하여 소정 위치의 부호화 단위를 결정할 수 있다. 이에 대한 구체적인 과정은 도 13에서 상술한 홀수개의 부호화 단위들 중 소정 위치(예를 들면, 가운데 위치)의 부호화 단위를 결정하는 과정에 대응하는 과정일 수 있으므로 생략하도록 한다.According to an exemplary embodiment, the video decoding apparatus 100 may use information indicating positions of even-numbered encoding units to determine encoding units at predetermined positions among the even-numbered encoding units. The video decoding apparatus 100 can determine an even number of encoding units by dividing the current encoding unit and determine a encoding unit at a predetermined position using information on the positions of the even number of encoding units. A concrete procedure for this is omitted because it may be a process corresponding to a process of determining a coding unit of a predetermined position (for example, a middle position) among the above-mentioned odd number of coding units.
일 실시예에 따라, 비-정사각형 형태의 현재 부호화 단위를 복수개의 부호화 단위로 분할한 경우, 복수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여 분할 과정에서 소정 위치의 부호화 단위에 대한 소정의 정보를 이용할 수 있다. 예를 들면 비디오 복호화 장치(100)는 현재 부호화 단위가 복수개로 분할된 부호화 단위들 중 가운데에 위치하는 부호화 단위를 결정하기 위하여 분할 과정에서 가운데 부호화 단위에 포함된 샘플에 저장된 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. According to one embodiment, when a non-square current encoding unit is divided into a plurality of encoding units, in order to determine an encoding unit at a predetermined position among a plurality of encoding units, Can be used. For example, in order to determine a coding unit located in the middle among the coding units in which the current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 may include block type information stored in a sample included in the middle coding unit, 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)를 가운데에 위치하는 부호화 단위로 결정할 수 있다. 다만 가운데에 위치하는 부호화 단위로 결정하기 위해 이용되는 정보가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나로 한정하여 해석되어서는 안되고, 다양한 종류의 정보가 가운데에 위치하는 부호화 단위를 결정하는 과정에서 이용될 수 있다.13, the video decoding apparatus 100 may divide the current encoding unit 1300 into a plurality of encoding units 1320a, 1320b, and 1320c based on at least one of the block type information and the division type information, The encoding unit 1320b positioned in the middle of the plurality of encoding units 1320a, 1320b, and 1320c can be determined. Furthermore, the video decoding apparatus 100 may determine a coding unit 1320b positioned at the center in consideration of a position where at least one of the block type information and the division type information is obtained. That is, at least one of the block type information and the division type information of the current encoding unit 1300 can be acquired in the sample 1340 located in the middle of the current encoding unit 1300, and the block type information and the division type information If the current encoding unit 1300 is divided into a plurality of encoding units 1320a, 1320b, and 1320c based on at least one of the encoding units 1320a to 1320c and 1320c, You can decide. However, the information used for determining the coding unit located in the middle should not be limited to at least one of the block type information and the division type information, and various kinds of information may be used in the process of determining the coding unit located in the middle .
일 실시예에 따라 소정 위치의 부호화 단위를 식별하기 위한 소정의 정보는, 결정하려는 부호화 단위에 포함되는 소정의 샘플에서 획득될 수 있다. 도 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 position may be obtained from a predetermined sample included in a coding unit to be determined. 13, the video decoding apparatus 100 includes a plurality of coding units 1320a, 1320b, and 1320c, which are determined by dividing the current coding unit 1300, and encoding units (for example, (For example, a sample located in the middle of the current encoding unit 1300) at a predetermined position in the current encoding unit 1300 in order to determine an encoding unit located in the middle of the encoding unit, And at least one of division type information. . That is, the video decoding apparatus 100 can determine the sample of the predetermined position in consideration of the block block type of the current encoding unit 1300, and the video decoding apparatus 100 determines that the current encoding unit 1300 is divided A coding unit 1320b including a sample from which predetermined information (for example, at least one of block type information and division type information) can be obtained is determined among a plurality of coding units 1320a, 1320b, and 1320c A predetermined limit can be set. Referring to FIG. 13, the video decoding apparatus 100 may determine a sample 1340 located in the middle of a current encoding unit 1300 as a sample from which predetermined information can be obtained, The coding unit 100 may limit the coding unit 1320b including the sample 1340 to a predetermined limit in the decoding process. However, the position of the sample from which predetermined information can be obtained can not be construed to be limited to the above-mentioned position, but can be interpreted as samples at arbitrary positions included in the encoding unit 1320b to be determined for limiting.
일 실시예에 따라 소정의 정보가 획득될 수 있는 샘플의 위치는 현재 부호화 단위(1300)의 형태에 따라 결정될 수 있다. 일 실시예에 따라 블록 형태 정보는 현재 부호화 단위의 형태가 정사각형인지 또는 비-정사각형인지 여부를 결정할 수 있고, 형태에 따라 소정의 정보가 획득될 수 있는 샘플의 위치를 결정할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위의 너비에 대한 정보 및 높이에 대한 정보 중 적어도 하나를 이용하여 현재 부호화 단위의 너비 및 높이 중 적어도 하나를 반으로 분할하는 경계 상에 위치하는 샘플을 소정의 정보가 획득될 수 있는 샘플로 결정할 수 있다. 또다른 예를 들면, 비디오 복호화 장치(100)는 현재 부호화 단위에 관련된 블록 형태 정보가 비-정사각형 형태임을 나타내는 경우, 현재 부호화 단위의 긴 변을 반으로 분할하는 경계에 인접하는 샘플 중 하나를 소정의 정보가 획득될 수 있는 샘플로 결정할 수 있다. The position of a sample from which predetermined information can be obtained according to an embodiment may be determined according to the type of the current encoding unit 1300. According to one embodiment, the block type information can determine whether the current encoding unit is a square or a non-square, and determine the position of a sample from which predetermined information can be obtained according to the shape. For example, the video decoding apparatus 100 may use at least one of the information on the width of the current encoding unit and the information on the height, and may be located on a boundary that divides at least one of the width and the height of the current encoding unit by half The sample can be determined as a sample from which predetermined information can be obtained. In another example, when the video decoding apparatus 100 indicates that the block type information related to the current encoding unit is a non-square format, one of the samples adjacent to the boundary dividing the long side of the current encoding unit into half is divided into a predetermined Can be determined as a sample from which the information of &lt; / RTI &gt;
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위를 복수개의 부호화 단위로 분할한 경우, 복수개의 부호화 단위들 중 소정 위치의 부호화 단위를 결정하기 위하여, 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 부호화 단위에 포함된 소정 위치의 샘플에서 획득할 수 있고, 비디오 복호화 장치(100)는 현재 부호화 단위가 분할되어 생성된 복수개의 부호화 단위들을 복수개의 부호화 단위 각각에 포함된 소정 위치의 샘플로부터 획득되는 분할 형태 정보 및 블록 형태 정보 중 적어도 하나를 이용하여 분할할 수 있다. 즉, 부호화 단위는 부호화 단위 각각에 포함된 소정 위치의 샘플에서 획득되는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나를 이용하여 재귀적으로 분할될 수 있다. 부호화 단위의 재귀적 분할 과정에 대하여는 도 12를 통해 상술하였으므로 자세한 설명은 생략하도록 한다. According to an exemplary embodiment, when the current encoding unit is divided into a plurality of encoding units, the video decoding apparatus 100 may determine at least one of the block type information and the division type information One can be used. According to an embodiment, the video decoding apparatus 100 can acquire at least one of the block type information and the division type information from a sample at a predetermined position included in an encoding unit, and the video decoding apparatus 100 determines whether the current encoding unit is divided And divide the generated plurality of coding units by using at least one of division type information and block type information obtained from samples at predetermined positions included in each of the plurality of coding units. That is, the coding unit can be recursively divided using at least one of the block type information and the division type information obtained in the sample at the predetermined position included in each of the coding units. Since the recursive division process of the encoding unit has been described 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 encoding unit by dividing the current encoding unit, and the order in which the at least one encoding unit is decoded is determined as a predetermined block (for example, ). &Lt; / RTI &gt;
도 14는 일 실시예에 따라 비디오 복호화 장치(100)가 현재 부호화 단위를 분할하여 복수개의 부호화 단위들을 결정하는 경우, 복수개의 부호화 단위들이 처리되는 순서를 도시한다.FIG. 14 shows a sequence 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 divides the first encoding unit 1400 in the vertical direction according to the block type information and the division type information to determine the second encoding units 1410a and 1410b, 1450b, 1450c, and 1450d by dividing the first coding unit 1400 in the horizontal direction to determine the second coding units 1430a and 1430b or dividing the first coding unit 1400 in the vertical direction and the horizontal direction, 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 the order in which the second encoding units 1410a and 1410b determined by dividing the first encoding unit 1400 in the vertical direction are processed in the horizontal direction 1410c . The video decoding apparatus 100 may determine the processing order of the second encoding units 1430a and 1430b determined by dividing the first encoding unit 1400 in the horizontal direction as the vertical direction 1430c. The video decoding apparatus 100 processes the encoding units located in one row of the second encoding units 1450a, 1450b, 1450c, and 1450d determined by dividing the first encoding unit 1400 in the vertical direction and the horizontal direction (For example, a raster scan order or a z scan order 1450e) in which the encoding units located in the next row are processed.
일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위들을 재귀적으로 분할할 수 있다. 도 14를 참조하면, 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 분할하여 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)을 결정할 수 있고, 결정된 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d) 각각을 재귀적으로 분할할 수 있다. 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)을 분할하는 방법은 제1 부호화 단위(1400)를 분할하는 방법에 대응하는 방법이 될 수 있다. 이에 따라 복수개의 부호화 단위들(1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, 1450d)은 각각 독립적으로 복수개의 부호화 단위들로 분할될 수 있다. 도 14를 참조하면 비디오 복호화 장치(100)는 제1 부호화 단위(1400)를 수직 방향으로 분할하여 제2 부호화 단위(1410a, 1410b)를 결정할 수 있고, 나아가 제2 부호화 단위(1410a, 1410b) 각각을 독립적으로 분할하거나 분할하지 않는 것으로 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may recursively divide encoding units. 14, the video decoding apparatus 100 may determine a plurality of encoding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d by dividing the first encoding unit 1400, It is possible to recursively divide each of the determined plurality of encoding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d. The method of dividing the plurality of encoding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be a method corresponding to the method of dividing the first encoding unit 1400. [ Accordingly, the plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be independently divided into a plurality of coding units. Referring to FIG. 14, the video decoding apparatus 100 may determine the second encoding units 1410a and 1410b by dividing the first encoding unit 1400 in the vertical direction, and may further determine the second encoding units 1410a and 1410b Can be determined not to divide or separate independently.
일 실시예에 따라 비디오 복호화 장치(100)는 좌측의 제2 부호화 단위(1410a)를 수평 방향으로 분할하여 제3 부호화 단위(1420a, 1420b)로 분할할 수 있고, 우측의 제2 부호화 단위(1410b)는 분할하지 않을 수 있다. The video decoding apparatus 100 may divide the left second encoding unit 1410a in the horizontal direction into the third encoding units 1420a and 1420b and the second encoding units 1410b ) 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 the encoding units may be determined based on the division process of the encoding units. In other words, the processing order of the divided coding units can be determined based on the processing order of the coding units immediately before being divided. The video decoding apparatus 100 can determine the order in which the third coding units 1420a and 1420b determined by dividing the left second coding unit 1410a are processed independently of the second coding unit 1410b on the right side. The third coding units 1420a and 1420b may be processed in the vertical direction 1420c since the second coding units 1410a on the left side are divided in the horizontal direction and the third coding units 1420a and 1420b are determined. Since the order in which the left second encoding unit 1410a and the right second encoding unit 1410b are processed corresponds to the horizontal direction 1410c, the third encoding unit 1410a included in the left second encoding unit 1410a, The right encoding unit 1410b can be processed after the blocks 1420a and 1420b are processed in the vertical direction 1420c. The above description is intended to explain the process sequence in which encoding units are determined according to the encoding units before division. Therefore, it should not be construed to be limited to the above-described embodiments, It should be construed as being used in various ways that can be handled independently in sequence.
도 15는 일 실시예에 따라 비디오 복호화 장치(100)가 소정의 순서로 부호화 단위가 처리될 수 없는 경우, 현재 부호화 단위가 홀수개의 부호화 단위로 분할되는 것임을 결정하는 과정을 도시한다.FIG. 15 illustrates a process of determining that the current encoding unit is divided into odd number of encoding units when the video decoding apparatus 100 can not process the encoding units 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 encoding unit is divided into odd number of encoding units based on the obtained block type information and the division type information. Referring to FIG. 15, the first encoding unit 1500 in a square form may be divided into second non-square encoding units 1510a and 1510b, and the second encoding units 1510a and 1510b may be independently 3 encoding units 1520a, 1520b, 1520c, 1520d, and 1520e. According to an embodiment, the video decoding apparatus 100 may determine a plurality of third encoding units 1520a and 1520b by dividing the left encoding unit 1510a of the second encoding unit in the horizontal direction, May be divided into an odd number of third encoding 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 one embodiment, the video decoding apparatus 100 determines whether or not the third encoding units 1520a, 1520b, 1520c, 1520d, and 1520e can be processed in a predetermined order and determines whether there are odd-numbered encoding units You can decide. Referring to FIG. 15, the video decoding apparatus 100 may recursively divide the first encoding unit 1500 to determine the third encoding units 1520a, 1520b, 1520c, 1520d, and 1520e. The video decoding apparatus 100 may further include a first coding unit 1500, a second coding unit 1510a and 1510b or a third coding unit 1520a, 1520b, 1520c, and 1520c based on at least one of block type information and division type information, 1520d, and 1520e may be divided into odd number of coding units among the divided types. For example, an encoding unit located on the right of the second encoding units 1510a and 1510b may be divided into odd third encoding units 1520c, 1520d, and 1520e. The order in which the plurality of coding units included in the first coding unit 1500 are processed may be a predetermined order (for example, a z-scan order 1530) 100 can determine whether the third encoding units 1520c, 1520d, and 1520e determined by dividing the right second encoding unit 1510b into odd numbers satisfy the condition that the third encoding units 1520c, 1520d, and 1520e can be processed according to the predetermined order.
일 실시예에 따라 비디오 복호화 장치(100)는 제1 부호화 단위(1500)에 포함되는 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)가 소정의 순서에 따라 처리될 수 있는 조건을 만족하는지를 결정할 수 있으며, 상기 조건은 제3 부호화 단위(1520a, 1520b, 1520c, 1520d, 1520e)의 경계에 따라 제2 부호화 단위(1510a, 1510b)의 너비 및 높이 중 적어도 하나를 반으로 분할되는지 여부와 관련된다. 예를 들면 비-정사각형 형태의 좌측 제2 부호화 단위(1510a)의 높이를 반으로 분할하여 결정되는 제3 부호화 단위(1520a, 1520b)는 조건을 만족하지만, 우측 제2 부호화 단위(1510b)를 3개의 부호화 단위로 분할하여 결정되는 제3 부호화 단위(1520c, 1520d, 1520e)들의 경계가 우측 제2 부호화 단위(1510b)의 너비 또는 높이를 반으로 분할하지 못하므로 제3 부호화 단위(1520c, 1520d, 1520e)는 조건을 만족하지 못하는 것으로 결정될 수 있고, 비디오 복호화 장치(100)는 이러한 조건 불만족의 경우 스캔 순서의 단절(disconnection)로 판단하고, 판단 결과에 기초하여 우측 제2 부호화 단위(1510b)는 홀수개의 부호화 단위로 분할되는 것으로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 홀수개의 부호화 단위로 분할되는 경우 분할된 부호화 단위들 중 소정 위치의 부호화 단위에 대하여 소정의 제한을 둘 수 있으며, 이러한 제한 내용 또는 소정 위치 등에 대하여는 다양한 실시예를 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the video decoding apparatus 100 satisfies a condition that third encoding units 1520a, 1520b, 1520c, 1520d, and 1520e included in the first encoding unit 1500 can be processed in a predetermined order And it is determined whether or not at least one of the width and the height of the second encoding units 1510a and 1510b is divided in half according to the boundaries of the third encoding units 1520a, 1520b, 1520c, 1520d, and 1520e . For example, the third coding units 1520a and 1520b determined by dividing the height of the left-side second coding unit 1510a in the non-square form by half are satisfied, but the right second coding unit 1510b is set to 3 Since the boundaries of the third encoding units 1520c, 1520d, and 1520e determined by dividing the number of encoding units 1520c, 1520d, and 1520e can not divide the width or height of the right second encoding unit 1510b in half, The video decoding apparatus 100 may determine that the condition is not satisfied and the video decoding apparatus 100 determines that the scanning order is disconnection in the case of such unsatisfactory condition and the right second encoding unit 1510b is based on the determination result It can be determined to be divided into odd number of encoding units. According to an exemplary embodiment, when the video decoding apparatus 100 is divided into odd-numbered coding units, the video decoding apparatus 100 may limit a coding unit of a predetermined position among the divided coding units. Since the embodiment has been described above, a detailed description thereof 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 encoding unit by dividing a first encoding unit 1600 according to an embodiment. The video decoding apparatus 100 may divide the first encoding unit 1600 based on at least one of the block type information and the division type information acquired through the acquisition unit 110. [ The first encoding unit 1600 in the form of a square may be divided into four encoding units having a square shape or may be divided into a plurality of non-square encoding units. For example, referring to FIG. 16, when the block type information indicates that the first encoding unit 1600 is square and the division type information is divided into non-square encoding units, the video decoding apparatus 100 transmits the first encoding unit The encoding unit 1600 may be divided into a plurality of non-square encoding units. More specifically, when the division type information indicates that the first encoding unit 1600 is divided horizontally or vertically to determine an odd number of encoding units, the video decoding apparatus 100 includes a first encoding unit 1600 in the form of a square 1620b, and 1610c divided in the vertical direction as the odd number of coding units, or into the second coding units 1620a, 1620b, and 1620c determined by being divided in the horizontal direction.
일 실시예에 따라 비디오 복호화 장치(100)는 제1 부호화 단위(1600)에 포함되는 제2 부호화 단위(1610a, 1610b, 1610c, 1620a, 1620b, 1620c)가 소정의 순서에 따라 처리될 수 있는 조건을 만족하는지를 결정할 수 있으며, 상기 조건은 제2 부호화 단위(1610a, 1610b, 1610c, 1620a, 1620b, 1620c)의 경계에 따라 제1 부호화 단위(1600)의 너비 및 높이 중 적어도 하나를 반으로 분할되는지 여부와 관련된다. 도 16를 참조하면 정사각형 형태의 제1 부호화 단위(1600)를 수직 방향으로 분할하여 결정되는 제2 부호화 단위(1610a, 1610b, 1610c)들의 경계가 제1 부호화 단위(1600)의 너비를 반으로 분할하지 못하므로 제1 부호화 단위(1600)는 소정의 순서에 따라 처리될 수 있는 조건을 만족하지 못하는 것으로 결정될 수 있다. 또한 정사각형 형태의 제1 부호화 단위(1600)를 수평 방향으로 분할하여 결정되는 제2 부호화 단위(1620a, 1620b, 1620c)들의 경계가 제1 부호화 단위(1600)의 너비를 반으로 분할하지 못하므로 제1 부호화 단위(1600)는 소정의 순서에 따라 처리될 수 있는 조건을 만족하지 못하는 것으로 결정될 수 있다. 비디오 복호화 장치(100)는 이러한 조건 불만족의 경우 스캔 순서의 단절(disconnection)로 판단하고, 판단 결과에 기초하여 제1 부호화 단위(1600)는 홀수개의 부호화 단위로 분할되는 것으로 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 홀수개의 부호화 단위로 분할되는 경우 분할된 부호화 단위들 중 소정 위치의 부호화 단위에 대하여 소정의 제한을 둘 수 있으며, 이러한 제한 내용 또는 소정 위치 등에 대하여는 다양한 실시예를 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the video decoding apparatus 100 may be configured such that the second encoding units 1610a, 1610b, 1610c, 1620a, 1620b, and 1620c included in the first encoding unit 1600 can be processed in a predetermined order And the condition is that at least one of the width and height of the first encoding unit 1600 is divided in half according to the boundaries of the second encoding units 1610a, 1610b, 1610c, 1620a, 1620b, and 1620c . 16, the boundaries of the second encoding units 1610a, 1610b, and 1610c, which are determined by dividing the first encoding unit 1600 in the vertical direction, are divided in half by the width of the first encoding unit 1600 The first encoding unit 1600 can be determined as not satisfying a condition that can be processed in a predetermined order. In addition, since the boundaries of the second encoding units 1620a, 1620b, and 1620c determined by dividing the first encoding unit 1600 in the horizontal direction into the horizontal direction can not divide the width of the first encoding unit 1600 in half, 1 encoding unit 1600 may be determined as not satisfying a condition that can be processed in a predetermined order. The video decoding apparatus 100 may determine that the scan sequence is disconnection in the case of such unsatisfactory condition and determine that the first encoding unit 1600 is divided into odd number of encoding units based on the determination result. According to an exemplary embodiment, when the video decoding apparatus 100 is divided into odd-numbered coding units, the video decoding apparatus 100 may limit a coding unit of a predetermined position among the divided coding units. Since the embodiment has been described above, a detailed description thereof will be omitted.
일 실시예에 따라, 비디오 복호화 장치(100)는 제1 부호화 단위를 분할하여 다양한 형태의 부호화 단위들을 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 may determine the encoding units of various types by dividing the first encoding unit.
도 16을 참조하면, 비디오 복호화 장치(100)는 정사각형 형태의 제1 부호화 단위(1600), 비-정사각형 형태의 제1 부호화 단위(1630 또는 1650)를 다양한 형태의 부호화 단위들로 분할할 수 있다. 16, the video decoding apparatus 100 may divide a first coding unit 1600 in a square form and a first coding unit 1630 or 1650 in a non-square form into various types of coding units .
도 17은 일 실시예에 따라 비디오 복호화 장치(100)가 제1 부호화 단위(1700)가 분할되어 결정된 비-정사각형 형태의 제2 부호화 단위가 소정의 조건을 만족하는 경우 제2 부호화 단위가 분할될 수 있는 형태가 제한되는 것을 도시한다.17 is a diagram illustrating a case where the second encoding unit is divided when the non-square second encoding unit determined by dividing the first encoding unit 1700 by the video decoding apparatus 100 satisfies a predetermined condition Lt; RTI ID = 0.0 &gt; limited. &Lt; / RTI &gt;
일 실시예에 따라 비디오 복호화 장치(100)는 획득부(105)를 통해 획득한 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 정사각형 형태의 제1 부호화 단위(1700)를 비-정사각형 형태의 제2 부호화 단위(1710a, 1710b, 1720a, 1720b)로 분할하는 것으로 결정할 수 있다. 제2 부호화 단위(1710a, 1710b, 1720a, 1720b)는 독립적으로 분할될 수 있다. 이에 따라 비디오 복호화 장치(100)는 제2 부호화 단위(1710a, 1710b, 1720a, 1720b) 각각에 관련된 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 복수개의 부호화 단위로 분할하거나 분할하지 않는 것을 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 수직 방향으로 제1 부호화 단위(1700)가 분할되어 결정된 비-정사각형 형태의 좌측 제2 부호화 단위(1710a)를 수평 방향으로 분할하여 제3 부호화 단위(1712a, 1712b)를 결정할 수 있다. 다만 비디오 복호화 장치(100)는 좌측 제2 부호화 단위(1710a)를 수평 방향으로 분할한 경우, 우측 제2 부호화 단위(1710b)는 좌측 제2 부호화 단위(1710a)가 분할된 방향과 동일하게 수평 방향으로 분할될 수 없도록 제한할 수 있다. 만일 우측 제2 부호화 단위(1710b)가 동일한 방향으로 분할되어 제3 부호화 단위(1714a, 1714b)가 결정된 경우, 좌측 제2 부호화 단위(1710a) 및 우측 제2 부호화 단위(1710b)가 수평 방향으로 각각 독립적으로 분할됨으로써 제3 부호화 단위(1712a, 1712b, 1714a, 1714b)가 결정될 수 있다. 하지만 이는 비디오 복호화 장치(100)가 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1700)를 4개의 정사각형 형태의 제2 부호화 단위(1730a, 1730b, 1730c, 1730d)로 분할한 것과 동일한 결과이며 이는 영상 복호화 측면에서 비효율적일 수 있다.According to an embodiment, the video decoding apparatus 100 may convert a first encoded unit 1700 of a square form into a non-square format (e.g., a first encoded unit 1700) based on at least one of the block type information and the division type information acquired through the acquisition unit 105 It can be determined to divide it into the second encoding units 1710a, 1710b, 1720a, and 1720b. The second encoding units 1710a, 1710b, 1720a, and 1720b may be independently divided. Accordingly, the video decoding apparatus 100 determines whether to divide or not divide into a plurality of coding units based on at least one of the block type information and the division type information related to each of the second coding units 1710a, 1710b, 1720a, and 1720b . According to an embodiment, the video decoding apparatus 100 divides the left second encoding unit 1710a in the non-square form determined by dividing the first encoding unit 1700 in the vertical direction into the horizontal direction, 1712a, and 1712b. However, in the case where the left second encoding unit 1710a is divided in the horizontal direction, the right side second encoding unit 1710b is arranged in the horizontal direction in the same way as the direction in which the left second encoding unit 1710a is divided, As shown in Fig. When the right second encoding unit 1710b is divided in the same direction and the third encoding units 1714a and 1714b are determined, the left second encoding unit 1710a and the right second encoding unit 1710b are arranged in the horizontal direction The third encoding units 1712a, 1712b, 1714a, and 1714b can be determined by being independently divided. However, the video decoding apparatus 100 divides the first encoding unit 1700 into four square-shaped second encoding units 1730a, 1730b, 1730c, and 1730d based on at least one of the block type information and the division type information. 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 encoding unit 1720a or 1720b in the non-square form determined by dividing the first encoding unit 11300 in the horizontal direction into the vertical direction, (1722a, 1722b, 1724a, 1724b). However, when one of the second coding units (for example, the upper second coding unit 1720a) is divided in the vertical direction, the video decoding apparatus 100 may generate a second coding unit (for example, Coding unit 1720b) can be restricted such that the upper second encoding unit 1720a can not be divided vertically in the same direction as the divided direction.
도 18은 일 실시예에 따라 분할 형태 정보가 4개의 정사각형 형태의 부호화 단위로 분할하는 것을 나타낼 수 없는 경우, 비디오 복호화 장치(100)가 정사각형 형태의 부호화 단위를 분할하는 과정을 도시한다.FIG. 18 illustrates a process in which the video decoding apparatus 100 divides a square-shaped encoding unit when the division type information can not be divided into four square-shaped encoding 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 encoding unit 1800 based on at least one of the block type information and the division type information, and outputs the second encoding units 1810a, 1810b, 1820a, and 1820b You can decide. The division type information may include information on various types in which the coding unit can be divided, but information on various types may not include information for dividing into four square units of coding units. According to the division type information, the video decoding apparatus 100 can not divide the first encoding unit 1800 in the square form into the second encoding units 1830a, 1830b, 1830c, and 1830d in the form of four squares. Based on the division type information, the video decoding apparatus 100 can determine the second encoding units 1810a, 1810b, 1820a, and 1820b in the non-square form.
일 실시예에 따라 비디오 복호화 장치(100)는 비-정사각형 형태의 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등)를 각각 독립적으로 분할할 수 있다. 재귀적인 방법을 통해 제2 부호화 단위(1810a, 1810b, 1820a, 1820b 등) 각각이 소정의 순서대로 분할될 수 있으며, 이는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 제1 부호화 단위(1800)가 분할되는 방법에 대응하는 분할 방법일 수 있다. According to an embodiment, the video decoding apparatus 100 may independently divide the second encoding units 1810a, 1810b, 1820a, and 1820b in the non-square form. Each of the second encoding units 1810a, 1810b, 1820a, 1820b, and the like may be divided in a predetermined order through a recursive method, and the first encoding unit 1800 May be a partitioning method corresponding to a method in which a partition is divided.
예를 들면 비디오 복호화 장치(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 can determine the third encoding units 1812a and 1812b in the form of a square by dividing the left second encoding unit 1810a in the horizontal direction, and the right second encoding unit 1810b It is possible to determine the third encoding units 1814a and 1814b in the form of a square by being divided in the horizontal direction. Further, the video decoding apparatus 100 may divide the left second encoding unit 1810a and the right second encoding unit 1810b in the horizontal direction to determine the square-shaped third encoding units 1816a, 1816b, 1816c, and 1816d have. In this case, the encoding unit may be determined in the same manner as the first encoding unit 1800 is divided into the four second-type second encoding 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)로 분할된 것과 동일한 형태로 부호화 단위가 결정될 수 있다.  In another example, the video decoding apparatus 100 can determine the third encoding units 1822a and 1822b in the form of a square by dividing the upper second encoding unit 1820a in the vertical direction, and the lower second encoding units 1820b May be divided in the vertical direction to determine the third encoding units 1824a and 1824b in the form of a square. Further, the video decoding apparatus 100 may divide the upper second encoding unit 1820a and the lower second encoding unit 1820b in the vertical direction to determine the square-shaped third encoding units 1822a, 1822b, 1824a, and 1824b have. In this case, the encoding unit may be determined in the same manner as the first encoding unit 1800 is divided into the four second-type second encoding units 1830a, 1830b, 1830c, and 1830d.
도 19는 일 실시예에 따라 복수개의 부호화 단위들 간의 처리 순서가 부호화 단위의 분할 과정에 따라 달라질 수 있음을 도시한 것이다.FIG. 19 illustrates that the processing order among a plurality of coding units may be changed according to the division process of the 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 divide the first encoding unit 1900 based on the block type information and the division type information. When the block type information indicates a square shape and the division type information indicates that the first encoding unit 1900 is divided into at least one of a horizontal direction and a vertical direction, the video decoding apparatus 100 includes a first encoding unit 1900 (For example, 1910a, 1910b, 1920a, 1920b, 1930a, 1930b, 1930c, 1930d, etc.) can be determined. Referring to FIG. 19, the non-square second encoding units 1910a, 1910b, 1920a, and 1920b, which are determined by dividing the first encoding unit 1900 only in the horizontal direction or the vertical direction, As shown in FIG. For example, the video decoding apparatus 100 divides the second encoding units 1910a and 1910b, which are generated by dividing the first encoding unit 1900 in the vertical direction, in the horizontal direction to generate third encoding units 1916a, 1916b, 1926c and 1916d can be determined and the second encoding units 1920a and 1920b generated by dividing the first encoding unit 1900 in the horizontal direction are divided in the horizontal direction and the third encoding units 1926a, 1926b, and 1926c , 1926d) can be determined. Since the process of dividing the second encoding units 1910a, 1910b, 1920a, and 1920b has been described in detail 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 an encoding unit in a predetermined order. The features of the processing of the encoding unit in the predetermined order have been described in detail with reference to FIG. 14, and a detailed description thereof will be omitted. 19, the video decoding apparatus 100 divides a first encoding unit 1900 in a square form into four quadrangle-shaped third encoding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d Can be determined. According to an embodiment, the video decoding apparatus 100 may process the third encoding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d according to the form in which the first encoding unit 1900 is divided 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 divides the second encoding units 1910a and 1910b generated in the vertical direction and divides them in the horizontal direction to determine the third encoding units 1916a, 1916b, 1916c, and 1916d And the video decoding apparatus 100 first processes the third encoding units 1916a and 1916b included in the left second encoding unit 1910a in the vertical direction and then processes the third encoding units 1916a and 1916b included in the right second encoding unit 1910b The third encoding units 1916a, 1916b, 1916c, and 1916d can be processed in accordance with the order 1917 of processing the third encoding 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 divides the second encoding units 1920a and 1920b generated in the horizontal direction into vertical directions to determine the third encoding units 1926a, 1926b, 1926c, and 1926d And the video decoding apparatus 100 first processes the third encoding units 1926a and 1926b included in the upper second encoding unit 1920a in the horizontal direction and then processes the third encoding units 1926a and 1926b included in the lower second encoding unit 1920b The third encoding units 1926a, 1926b, 1926c, and 1926d can be processed according to the order 1927 of processing the third encoding units 1926c and 1926d in the horizontal direction.
도 19를 참조하면, 제2 부호화 단위(1910a, 1910b, 1920a, 1920b)가 각각 분할되어 정사각형 형태의 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)가 결정될 수 있다. 수직 방향으로 분할되어 결정된 제2 부호화 단위(1910a, 1910b) 및 수평 방향으로 분할되어 결정된 제2 부호화 단위(1920a, 1920b)는 서로 다른 형태로 분할된 것이지만, 이후에 결정되는 제3 부호화 단위(1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, 1926d)에 따르면 결국 동일한 형태의 부호화 단위들로 제1 부호화 단위(1900)가 분할된 결과가 된다. 이에 따라 비디오 복호화 장치(100)는 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 상이한 과정을 통해 재귀적으로 부호화 단위를 분할함으로써 결과적으로 동일한 형태의 부호화 단위들을 결정하더라도, 동일한 형태로 결정된 복수개의 부호화 단위들을 서로 다른 순서로 처리할 수 있다.Referring to FIG. 19, the second encoding units 1910a, 1910b, 1920a, and 1920b are divided to determine the third encoding units 1916a, 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d, have. The second encoding units 1910a and 1910b determined to be divided in the vertical direction and the second encoding units 1920a and 1920b determined to be divided in the horizontal direction are divided into different formats, but the third encoding unit 1916a , 1916b, 1916c, 1916d, 1926a, 1926b, 1926c, and 1926d, the result is that the first encoding unit 1900 is divided into the same type of encoding units. Accordingly, the video decoding apparatus 100 recursively divides the encoding units through different processes based on at least one of the block type information and the division type information, thereby eventually determining the same type of encoding units, Lt; RTI ID = 0.0 &gt; units of &lt; / RTI &gt;
도 20은 일 실시예에 따라 부호화 단위가 재귀적으로 분할되어 복수개의 부호화 단위가 결정되는 경우, 부호화 단위의 형태 및 크기가 변함에 따라 부호화 단위의 심도가 결정되는 과정을 도시한다.FIG. 20 illustrates a process of determining the depth of an encoding unit according to a change in type and size of an encoding unit when the encoding unit is recursively divided according to an embodiment to determine a plurality of encoding units.
일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 심도를 소정의 기준에 따라 결정할 수 있다. 예를 들면 소정의 기준은 부호화 단위의 긴 변의 길이가 될 수 있다. 비디오 복호화 장치(100)는 현재 부호화 단위의 긴 변의 길이가 분할되기 전의 부호화 단위의 긴 변의 길이보다 2n (n>0) 배로 분할된 경우, 현재 부호화 단위의 심도는 분할되기 전의 부호화 단위의 심도보다 n만큼 심도가 증가된 것으로 결정할 수 있다. 이하에서는 심도가 증가된 부호화 단위를 하위 심도의 부호화 단위로 표현하도록 한다.According to an embodiment, the video decoding apparatus 100 may determine the depth of a coding unit according to a predetermined criterion. For example, a predetermined criterion may be a length of a long side of a coding unit. When the length of the long side of the current coding unit is divided by 2n (n > 0) times longer than the length of the long side of the coding unit before the current coding unit is divided, the depth of the current coding unit is smaller than the depth of the coding unit before being divided it can be determined that the depth is increased by n. Hereinafter, an encoding unit with an increased depth is expressed as a lower-depth encoding unit.
도 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, on the basis of block type information (for example, block type information may indicate '0: SQUARE') indicating a square form according to an embodiment, the video decoding apparatus 100 generates a square 1 coding unit 2000 can be divided to determine the second coding unit 2002, the third coding unit 2004, etc. of the lower depth. If the size of the first encoding unit 2000 in the form of a square is 2Nx2N, the second encoding unit 2002 determined by dividing the width and height of the first encoding unit 2000 by 1/21 times may have a size of NxN have. Furthermore, the third encoding unit 2004 determined by dividing the width and height of the second encoding unit 2002 by a half size may have a size of N / 2xN / 2. In this case, the width and the height of the third encoding unit 2004 correspond to 1/22 of the first encoding unit 2000. When the depth of the first encoding unit 2000 is D, the depth of the second encoding unit 2002, which is 1/21 times the width and height of the first encoding unit 2000, may be D + 1, The depth of the third encoding unit 2004, which is one-22 times the width and height of the second encoding unit 2000, may be D + 2.
일 실시예에 따라 비-정사각형 형태를 나타내는 블록 형태 정보(예를 들면 블록 형태 정보는, 높이가 너비보다 긴 비-정사각형임을 나타내는 ′1: NS_VER′ 또는 너비가 높이보다 긴 비-정사각형임을 나타내는 ′2: NS_HOR′를 나타낼 수 있음)에 기초하여, 비디오 복호화 장치(100)는 비-정사각형 형태인 제1 부호화 단위(2010 또는 2020)를 분할하여 하위 심도의 제2 부호화 단위(2012 또는 2022), 제3 부호화 단위(2014 또는 2024) 등을 결정할 수 있다. According to an exemplary embodiment, block type information indicating a non-square shape (for example, block type information is' 1: NS_VER 'indicating that the height is a non-square having a width greater than the width or' 2 &gt;: NS_HOR '), the video decoding apparatus 100 divides the first coding unit 2010 or 2020 in a non-square form to generate a second coding unit 2012 or 2022 of lower depth, The third encoding unit 2014 or 2024, or the like.
비디오 복호화 장치(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 encoding unit (e.g., 2002, 2012, 2022, etc.) by dividing at least one of the width and the height of the first encoding unit 2010 of Nx2N size. That is, the video decoding apparatus 100 can determine the second encoding unit 2002 of the NxN size or the second encoding unit 2022 of the NxN / 2 size by dividing the first encoding unit 2010 in the horizontal direction, The second encoding unit 2012 may be divided into the horizontal direction and the vertical direction to determine the second encoding unit 2012 of N / 2xN size.
일 실시예에 따라 비디오 복호화 장치(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 divides at least one of the width and the height of the 2NxN-size first encoding unit 2020 to determine a second encoding unit (for example, 2002, 2012, 2022, etc.) It is possible. That is, the video decoding apparatus 100 can determine the second encoding unit 2002 of NxN size or the second encoding unit 2012 of N / 2xN size by dividing the first encoding unit 2020 in the vertical direction, The second encoding unit 2022 of the NxN / 2 size may be determined by dividing the image data 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 divides at least one of the width and the height of the second encoding unit 2002 of NxN size to determine a third encoding unit (for example, 2004, 2014, 2024, etc.) It is possible. That is, the video decoding apparatus 100 determines the third encoding unit 2004 of N / 2xN / 2 size by dividing the second encoding unit 2002 in the vertical direction and the horizontal direction, 3 encoding unit 2014 or a third encoding unit 2024 of N / 2xN / 22 size.
일 실시예에 따라 비디오 복호화 장치(100)는 N/2xN 크기의 제2 부호화 단위(2012)의 너비 및 높이 중 적어도 하나를 분할하여 제3 부호화 단위(예를 들면, 2004, 2014, 2024 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제2 부호화 단위(2012)를 수평 방향으로 분할하여 N/2xN/2 크기의 제3 부호화 단위(2004) 또는 N/2xN/22 크기의 제3 부호화 단위(2024)를 결정하거나 수직 방향 및 수평 방향으로 분할하여 N/22xN/2 크기의 제3 부호화 단위(2014)를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 divides at least one of the width and the height of the second encoding unit 2012 of N / 2xN size, and encodes the third encoding unit (for example, 2004, 2014, 2024, . That is, the video decoding apparatus 100 divides the second encoding unit 2012 in the horizontal direction to generate a third encoding unit 2004 of N / 2xN / 2 or a third encoding unit 2024 of N / 2xN / 22 size ) Or may be divided into vertical and horizontal directions to determine a third encoding unit 2014 of N / 22xN / 2 size.
일 실시예에 따라 비디오 복호화 장치(100)는 NxN/2 크기의 제2 부호화 단위(2014)의 너비 및 높이 중 적어도 하나를 분할하여 제3 부호화 단위(예를 들면, 2004, 2014, 2024 등)를 결정할 수도 있다. 즉, 비디오 복호화 장치(100)는 제2 부호화 단위(2012)를 수직 방향으로 분할하여 N/2xN/2 크기의 제3 부호화 단위(2004) 또는 N/22xN/2 크기의 제3 부호화 단위(2014)를 결정하거나 수직 방향 및 수평 방향으로 분할하여 N/2xN/22크기의 제3 부호화 단위(2024)를 결정할 수 있다.According to an embodiment, the video decoding apparatus 100 divides at least one of the width and the height of the second encoding unit 2014 of NxN / 2 size into a third encoding unit (e.g., 2004, 2014, 2024, etc.) . That is, the video decoding apparatus 100 divides the second encoding unit 2012 in the vertical direction to obtain a third encoding unit 2004 of N / 2xN / 2 or a third encoding unit 2014 of N / 22xN / 2 size ) Or may be divided into vertical and horizontal directions to determine a third encoding unit 2024 of N / 2xN / 22 size.
일 실시예에 따라 비디오 복호화 장치(100)는 정사각형 형태의 부호화 단위(예를 들면, 2000, 2002, 2004)를 수평 방향 또는 수직 방향으로 분할할 수 있다. 예를 들면, 2Nx2N 크기의 제1 부호화 단위(2000)를 수직 방향으로 분할하여 Nx2N 크기의 제1 부호화 단위(2010)를 결정하거나 수평 방향으로 분할하여 2NxN 크기의 제1 부호화 단위(2020)를 결정할 수 있다. 일 실시예에 따라 심도가 부호화 단위의 가장 긴 변의 길이에 기초하여 결정되는 경우, 2Nx2N 크기의 제1 부호화 단위(2000, 2002 또는 2004)가 수평 방향 또는 수직 방향으로 분할되어 결정되는 부호화 단위의 심도는 제1 부호화 단위(2000, 2002 또는 2004)의 심도와 동일할 수 있다.According to an embodiment, the video decoding apparatus 100 may divide a square-shaped encoding unit (for example, 2000, 2002, 2004) into a horizontal direction or a vertical direction. For example, the first encoding unit 2000 of the size 2Nx2N is divided in the vertical direction to determine the first encoding unit 2010 of the size Nx2N or the horizontal direction to determine the first encoding unit 2020 of 2NxN size . If the depth is determined based on the length of the longest side of the encoding unit according to one embodiment, the depth of the encoding unit in which the first encoding unit 2000, 2002, or 2004 of size 2Nx2N is divided in the horizontal direction or the vertical direction is determined May be the same as the depth of the first encoding 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 one embodiment, the width and height of the third encoding unit 2014 or 2024 may correspond to 1/22 of the first encoding 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 half the width and height of the first coding unit 2010 or 2020, is D + 1 And 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)를 도시한다.FIG. 21 illustrates a depth index (PID) for coding unit classification and depth that can be determined according to the type and size of coding units according to an exemplary 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 divide the first encoding unit 2100 in a square form to determine various types of second encoding units. 21, the video decoding apparatus 100 divides the first coding unit 2100 into at least one of a vertical direction and a horizontal direction according to the division type information, and outputs the second coding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, and 2106d. That is, the video decoding apparatus 100 can determine the second encoding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, and 2106d based on the division type information for the first encoding 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의 심도일 수 있다.The second encoding units 2102a, 2102b, 2104a, 2104b, 2106a, 2106b, 2106c, and 2106d, which are determined according to the division type information for the first encoding unit 2100 in a square form, Depth can be determined based on. For example, since the length of one side of the first encoding unit 2100 in the square form is the same as the length of long sides of the second encoding units 2102a, 2102b, 2104a, and 2104b in the non-square form, 2100 and the non-square type second encoding units 2102a, 2102b, 2104a, and 2104b are denoted by D in the same manner. On the other hand, when the video decoding apparatus 100 divides the first encoding unit 2100 into four square-shaped second encoding units 2106a, 2106b, 2106c, and 2106d based on the division type information, The length of one side of the second encoding units 2106a, 2106b, 2106c and 2106d is one-half the length of one side of the first encoding unit 2100. Therefore, the depths of the second encoding units 2106a, 2106b, May be a depth of D + 1 that is one depth lower than D, which is the depth of the first encoding 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 divides a first coding unit 2110 having a height greater than a width in a horizontal direction according to the division type information, and generates a plurality of second coding units 2112a, 2112b, 2114a, 2114b, and 2114c. According to an embodiment, the video decoding apparatus 100 divides the first coding unit 2120 of a shape whose width is longer than a height in the vertical direction according to the division type information, and generates a plurality of second coding units 2122a, 2122b, 2124a, 2124b, and 2124c.
일 실시예에 따라 비-정사각형 형태의 제1 부호화 단위(2110 또는 2120)에 대한 분할 형태 정보에 따라 결정되는 제2 부호화 단위(2112a, 2112b, 2114a, 2114b, 2116a, 2116b, 2116c, 2116d)는 긴 변의 길이에 기초하여 심도가 결정될 수 있다. 예를 들면, 정사각형 형태의 제2 부호화 단위(2112a, 2112b)의 한 변의 길이는 높이가 너비보다 긴 비-정사각형 형태의 제1 부호화 단위(2110)의 한 변의 길이의 1/2배이므로, 정사각형 형태의 제2 부호화 단위(2102a, 2102b, 2104a, 2104b)의 심도는 비-정사각형 형태의 제1 부호화 단위(2110)의 심도 D보다 한 심도 하위의 심도인 D+1이다. The second encoding units 2112a, 2112b, 2114a, 2114b, 2116a, 2116b, 2116c, and 2116d determined according to the division type information for the first encoding unit 2110 or 2120 in the non- The depth can be determined based on the length of the long side. For example, since the length of one side of the square-shaped second encoding units 2112a and 2112b is 1/2 times the length of one side of the non-square first encoding unit 2110 whose height is longer than the width, The depth of the second encoding units 2102a, 2102b, 2104a and 2104b in the form of D + 1 is one depth lower than the depth D of the first encoding unit 2110 in the non-square form.
나아가 비디오 복호화 장치(100)가 분할 형태 정보에 기초하여 비-정사각형 형태의 제1 부호화 단위(2110)를 홀수개의 제2 부호화 단위(2114a, 2114b, 2114c)로 분할할 수 있다. 홀수개의 제2 부호화 단위(2114a, 2114b, 2114c)는 비-정사각형 형태의 제2 부호화 단위(2114a, 2114c) 및 정사각형 형태의 제2 부호화 단위(2114b)를 포함할 수 있다. 이 경우 비-정사각형 형태의 제2 부호화 단위(2114a, 2114c)의 긴 변의 길이 및 정사각형 형태의 제2 부호화 단위(2114b)의 한 변의 길이는 제1 부호화 단위(2110)의 한 변의 길이의 1/2배 이므로, 제2 부호화 단위(2114a, 2114b, 2114c)의 심도는 제1 부호화 단위(2110)의 심도인 D보다 한 심도 하위인 D+1의 심도일 수 있다. 비디오 복호화 장치(100)는 제1 부호화 단위(2110)와 관련된 부호화 단위들의 심도를 결정하는 상기 방식에 대응하는 방식으로, 너비가 높이보다 긴 비-정사각형 형태의 제1 부호화 단위(2120)와 관련된 부호화 단위들의 심도를 결정할 수 있다.Furthermore, the video decoding apparatus 100 may divide the non-square first encoding unit 2110 into odd second encoding units 2114a, 2114b, and 2114c based on the division type information. The odd number of second encoding units 2114a, 2114b and 2114c may include non-square second encoding units 2114a and 2114c and a square second encoding unit 2114b. In this case, the length of the longer sides of the non-square second encoding units 2114a and 2114c and the length of one side of the second encoding unit 2114b of the square shape are 1 / The depth of the second encoding units 2114a, 2114b and 2114c may be a depth of D + 1 which is one depth lower than the depth D of the first encoding unit 2110. [ The video decoding apparatus 100 is connected to the first encoding unit 2120 in the form of a non-square shape whose width is longer than the height in a manner corresponding to the scheme for determining the depths of the encoding units associated with the first encoding unit 2110 The depth of the encoding units can 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 exemplary embodiment, the video decoding apparatus 100 determines an index (PID) for distinguishing divided coding units. If the odd-numbered coding units are not the same size, The index can be determined based on the index. 21, an encoding unit 2114b positioned at the center among the odd-numbered encoding units 2114a, 2114b, and 2114c has the same width as other encoding units 2114a and 2114c, May be two times as high as the height of the first and second electrodes 2114a and 2114c. That is, in this case, the coding unit 2114b positioned at the center may include two of the other coding units 2114a and 2114c. Accordingly, if the index (PID) of the coding unit 2114b positioned at the center is 1 according to the scanning order, the coding unit 2114c positioned next to the coding unit 2114c may be three days in which the index is increased by two. That is, there may be a discontinuity in the value of the index. According to an embodiment, the video decoding apparatus 100 may determine whether odd-numbered encoding units are not the same size based on the presence or absence of an index discontinuity for distinguishing between the divided encoding units.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 부호화 단위로부터 분할되어 결정된 복수개의 부호화 단위들을 구분하기 위한 인덱스의 값에 기초하여 특정 분할 형태로 분할된 것인지를 결정할 수 있다. 도 21를 참조하면 비디오 복호화 장치(100)는 높이가 너비보다 긴 직사각형 형태의 제1 부호화 단위(2110)를 분할하여 짝수개의 부호화 단위(2112a, 2112b)를 결정하거나 홀수개의 부호화 단위(2114a, 2114b, 2114c)를 결정할 수 있다. 비디오 복호화 장치(100)는 복수개의 부호화 단위 각각을 구분하기 위하여 각 부호화 단위를 나타내는 인덱스(PID)를 이용할 수 있다. 일 실시예에 따라 PID는 각각의 부호화 단위의 소정 위치의 샘플(예를 들면, 좌측 상단 샘플)에서 획득될 수 있다. According to an embodiment, the video decoding apparatus 100 may determine whether the video decoding apparatus 100 is divided into a specific division type based on a value of an index for identifying a plurality of coding units divided and determined from the current coding unit. 21, the video decoding apparatus 100 divides a rectangular first encoding unit 2110 having a height greater than the width to determine even-numbered encoding units 2112a and 2112b or odd-numbered encoding units 2114a and 2114b , 2114c can be determined. The video decoding apparatus 100 may use an index (PID) indicating each coding unit in order to identify each of the plurality of coding units. According to one embodiment, the PID may be obtained at a sample of a predetermined position of each coding unit (e.g., the upper left sample).
일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 구분을 위한 인덱스를 이용하여 분할되어 결정된 부호화 단위들 중 소정 위치의 부호화 단위를 결정할 수 있다. 일 실시예에 따라 높이가 너비보다 긴 직사각형 형태의 제1 부호화 단위(2110)에 대한 분할 형태 정보가 3개의 부호화 단위로 분할됨을 나타내는 경우 비디오 복호화 장치(100)는 제1 부호화 단위(2110)를 3개의 부호화 단위(2114a, 2114b, 2114c)로 분할할 수 있다. 비디오 복호화 장치(100)는 3개의 부호화 단위(2114a, 2114b, 2114c) 각각에 대한 인덱스를 할당할 수 있다. 비디오 복호화 장치(100)는 홀수개로 분할된 부호화 단위 중 가운데 부호화 단위를 결정하기 위하여 각 부호화 단위에 대한 인덱스를 비교할 수 있다. 비디오 복호화 장치(100)는 부호화 단위들의 인덱스에 기초하여 인덱스들 중 가운데 값에 해당하는 인덱스를 갖는 부호화 단위(2114b)를, 제1 부호화 단위(2110)가 분할되어 결정된 부호화 단위 중 가운데 위치의 부호화 단위로서 결정할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 분할된 부호화 단위들의 구분을 위한 인덱스를 결정함에 있어서, 부호화 단위들이 서로 동일한 크기가 아닌 경우, 부호화 단위들 간의 크기 비율에 기초하여 인덱스를 결정할 수 있다. 도 21를 참조하면, 제1 부호화 단위(2110)가 분할되어 생성된 부호화 단위(2114b)는 다른 부호화 단위들(2114a, 2114c)와 너비는 동일하지만 높이가 다른 부호화 단위들(2114a, 2114c)의 높이의 두 배일 수 있다. 이 경우 가운데에 위치하는 부호화 단위(2114b)의 인덱스(PID)가 1이라면 그 다음 순서에 위치하는 부호화 단위(2114c)는 인덱스가 2가 증가한 3일수 있다. 이러한 경우처럼 균일하게 인덱스가 증가하다가 증가폭이 달라지는 경우, 비디오 복호화 장치(100)는 다른 부호화 단위들과 다른 크기를 가지는 부호화 단위를 포함하는 복수개의 부호화 단위로 분할된 것으로 결정할 수 있다, 일 실시예에 따라 분할 형태 정보가 홀수개의 부호화 단위로 분할됨을 나타내는 경우, 비디오 복호화 장치(100)는 홀수개의 부호화 단위 중 소정 위치의 부호화 단위(예를 들면 가운데 부호화 단위)가 다른 부호화 단위와 크기가 다른 형태로 현재 부호화 단위를 분할할 수 있다. 이 경우 비디오 복호화 장치(100)는 부호화 단위에 대한 인덱스(PID)를 이용하여 다른 크기를 가지는 가운데 부호화 단위를 결정할 수 있다. 다만 상술한 인덱스, 결정하고자 하는 소정 위치의 부호화 단위의 크기 또는 위치는 일 실시예를 설명하기 위해 특정한 것이므로 이에 한정하여 해석되어서는 안되며, 다양한 인덱스, 부호화 단위의 위치 및 크기가 이용될 수 있는 것으로 해석되어야 한다. According to an embodiment, the video decoding apparatus 100 may determine a coding unit at a predetermined position among the coding units divided and determined using an index for classifying a coding unit. According to an embodiment, when the division type information for the rectangular first type encoding unit 2110 whose height is longer than the width is divided into three encoding units, the video decoding apparatus 100 transmits the first encoding unit 2110 It can be divided into three encoding units 2114a, 2114b, and 2114c. The video decoding apparatus 100 can assign an index to each of the three encoding units 2114a, 2114b, and 2114c. The video decoding apparatus 100 may compare the indexes of the respective encoding units in order to determine the middle encoding unit among the encoding units divided into odd numbers. The video decoding apparatus 100 encodes an encoding unit 2114b having an index corresponding to a middle value among indices based on indexes of encoding units into an encoding unit 2114b encoding an intermediate position among encoding units determined by dividing the first encoding unit 2110 Can be determined as a unit. According to an embodiment, the video decoding apparatus 100 may determine an index based on a size ratio between coding units when the coding units are not the same size in determining the index for dividing the divided coding units . 21, the coding unit 2114b generated by dividing the first coding unit 2110 is divided into coding units 2114a and 2114c having the same width as the coding units 2114a and 2114c but different in height Can be double the height. In this case, if the index (PID) of the coding unit 2114b positioned at the center is 1, the coding unit 2114c located next to the coding unit 2114c may be three (3) In this case, if the index increases uniformly and the increment increases, the video decoding apparatus 100 may determine that the encoding unit is divided into a plurality of encoding units including encoding units having different sizes from other encoding units. , The video decoding apparatus 100 determines that the encoding unit (for example, the middle encoding unit) at a predetermined position among the odd number of encoding units has a format different from that of the other encoding units The current encoding unit can be divided into. In this case, the video decoding apparatus 100 may determine an encoding unit having a different size by using an index (PID) for the encoding unit. However, the index and the size or position of the encoding unit at a predetermined position to be determined are specific for explaining an embodiment, and thus should not be construed to be limited thereto, and various indexes, positions and sizes of encoding units can be used Should be interpreted.
일 실시예에 따라 비디오 복호화 장치(100)는 부호화 단위의 재귀적인 분할이 시작되는 소정의 데이터 단위를 이용할 수 있다. According to an embodiment, the video decoding apparatus 100 may use a predetermined data unit in which recursive division of an encoding unit starts.
도 22는 일 실시예에 따라 픽쳐에 포함되는 복수개의 소정의 데이터 단위에 따라 복수개의 부호화 단위들이 결정된 것을 도시한다.22 shows 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 exemplary embodiment, a predetermined data unit may be defined as a data unit in which an encoding unit starts to be recursively segmented using at least one of block type information and partition type information. That is, it may correspond to a coding unit of the highest depth used in the process of determining a plurality of coding units for dividing the current picture. Hereinafter, such a predetermined data unit is referred to as a reference data unit for convenience of explanation.
일 실시예에 따라 기준 데이터 단위는 소정의 크기 및 형태를 나타낼 수 있다. 일 실시예에 따라, 기준 부호화 단위는 MxN의 샘플들을 포함할 수 있다. 여기서 M 및 N은 서로 동일할 수도 있으며, 2의 승수로 표현되는 정수일 수 있다. 즉, 기준 데이터 단위는 정사각형 또는 비-정사각형의 형태를 나타낼 수 있으며, 이후에 정수개의 부호화 단위로 분할될 수 있다. According to one embodiment, the reference data unit may represent a predetermined size and shape. According to one embodiment, the reference encoding unit may comprise samples of MxN. Here, M and N may be equal to each other, or may be an integer represented by a multiplier of 2. That is, the reference data unit may represent a square or a non-square shape, and may be divided into an integer number of encoding units.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 복수개의 기준 데이터 단위로 분할할 수 있다. 일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐를 분할하는 복수개의 기준 데이터 단위를 각각의 기준 데이터 단위에 대한 분할 정보를 이용하여 분할할 수 있다. 이러한 기준 데이터 단위의 분할 과정은 쿼드 트리(quad-tree)구조를 이용한 분할 과정에 대응될 수 있다. According to an embodiment, the video decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide a plurality of reference data units for dividing a current picture into pieces using division information for each reference data unit. The segmentation process of the reference data unit may correspond to the segmentation process using a quad-tree structure.
일 실시예에 따라 비디오 복호화 장치(100)는 현재 픽쳐에 포함되는 기준 데이터 단위가 가질 수 있는 최소 크기를 미리 결정할 수 있다. 이에 따라, 비디오 복호화 장치(100)는 최소 크기 이상의 크기를 갖는 다양한 크기의 기준 데이터 단위를 결정할 수 있고, 결정된 기준 데이터 단위를 기준으로 블록 형태 정보 및 분할 형태 정보를 이용하여 적어도 하나의 부호화 단위를 결정할 수 있다. According to an embodiment, the video decoding apparatus 100 may determine in advance the minimum size that the reference data unit included in the current picture can have. Accordingly, the video decoding apparatus 100 can determine reference data units of various sizes having sizes equal to or larger than a minimum size, and determine at least one coding unit using block type information and division type information based on the determined reference data unit You can decide.
도 22를 참조하면, 비디오 복호화 장치(100)는 정사각형 형태의 기준 부호화 단위(2200)를 이용할 수 있고, 또는 비-정사각형 형태의 기준 부호화 단위(2202)를 이용할 수도 있다. 일 실시예에 따라 기준 부호화 단위의 형태 및 크기는 적어도 하나의 기준 부호화 단위를 포함할 수 있는 다양한 데이터 단위(예를 들면, 시퀀스(sequence), 픽쳐(picture), 슬라이스(slice), 슬라이스 세그먼트(slice segment), 최대부호화단위 등)에 따라 결정될 수 있다. 22, the video decoding apparatus 100 may use a reference encoding unit 2200 in a square form or a reference encoding unit 2202 in a non-square form. According to an exemplary embodiment, the type and size of the reference encoding unit may include various data units (e.g., a sequence, a picture, a slice, a slice segment a slice segment, a maximum encoding unit, and the like).
일 실시예에 따라 비디오 복호화 장치(100)의 획득부(105)는 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보 중 적어도 하나를 상기 다양한 데이터 단위마다 비트스트림으로부터 획득할 수 있다. 정사각형 형태의 기준 부호화 단위(2200)에 포함되는 적어도 하나의 부호화 단위가 결정되는 과정은 도 10의 현재 부호화 단위(300)가 분할되는 과정을 통해 상술하였고, 비-정사각형 형태의 기준 부호화 단위(2200)에 포함되는 적어도 하나의 부호화 단위가 결정되는 과정은 도 11의 현재 부호화 단위(1100 또는 1150)가 분할되는 과정을 통해 상술하였으므로 자세한 설명은 생략하도록 한다.According to an embodiment, the obtaining unit 105 of the video decoding apparatus 100 may obtain at least one of the information on the type of the reference encoding unit and the size of the reference encoding unit from the bit stream for each of the various data units have. The process of determining at least one encoding unit included in the reference-type encoding unit 2200 in the form of a square is described in detail in the process of dividing the current encoding unit 300 of FIG. 10, and the non- Is determined in the process of dividing the current encoding unit 1100 or 1150 of FIG. 11, so that a detailed description thereof will be omitted.
일 실시예에 따라 비디오 복호화 장치(100)는 소정의 조건에 기초하여 미리 결정되는 일부 데이터 단위에 따라 기준 부호화 단위의 크기 및 형태를 결정하기 위하여, 기준 부호화 단위의 크기 및 형태를 식별하기 위한 인덱스를 이용할 수 있다. 즉, 획득부(105)는 비트스트림으로부터 상기 다양한 데이터 단위(예를 들면, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트, 최대부호화단위 등) 중 소정의 조건(예를 들면 슬라이스 이하의 크기를 갖는 데이터 단위)을 만족하는 데이터 단위로서 슬라이스, 슬라이스 세그먼트, 최대부호화 단위 등 마다, 기준 부호화 단위의 크기 및 형태의 식별을 위한 인덱스만을 획득할 수 있다. 비디오 복호화 장치(100)는 인덱스를 이용함으로써 상기 소정의 조건을 만족하는 데이터 단위마다 기준 데이터 단위의 크기 및 형태를 결정할 수 있다. 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 상대적으로 작은 크기의 데이터 단위마다 비트스트림으로부터 획득하여 이용하는 경우, 비트스트림의 이용 효율이 좋지 않을 수 있으므로, 기준 부호화 단위의 형태에 대한 정보 및 기준 부호화 단위의 크기에 대한 정보를 직접 획득하는 대신 상기 인덱스만을 획득하여 이용할 수 있다. 이 경우 기준 부호화 단위의 크기 및 형태를 나타내는 인덱스에 대응하는 기준 부호화 단위의 크기 및 형태 중 적어도 하나는 미리 결정되어 있을 수 있다. 즉, 비디오 복호화 장치(100)는 미리 결정된 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 인덱스에 따라 선택함으로써, 인덱스 획득의 기준이 되는 데이터 단위에 포함되는 기준 부호화 단위의 크기 및 형태 중 적어도 하나를 결정할 수 있다.In order to determine the size and type of the reference encoding unit according to a predetermined data unit predetermined based on a predetermined condition, the video decoding apparatus 100 may include an index for identifying the size and type of the reference encoding unit Can be used. That is, the acquiring unit 105 acquires from the bitstream a predetermined condition (for example, a data unit having a size equal to or smaller than a slice) among the various data units (e.g., sequence, picture, slice, slice segment, ), It is possible to obtain only an index for identification of the size and type of the reference encoding unit for each slice, slice segment, maximum encoding unit, and the like. The video decoding apparatus 100 can determine the size and type of the reference data unit for each data unit satisfying the predetermined condition by using the index. When the information on the type of the reference encoding unit and the information on the size of the reference encoding unit are obtained from the bitstream for each relatively small data unit and used, the use efficiency of the bitstream may not be good. Therefore, Information on the size of the reference encoding unit and information on the size of the reference encoding unit can be acquired and used. In this case, at least one of the size and the type of the reference encoding unit corresponding to the index indicating the size and type of the reference encoding unit may be predetermined. That is, the video decoding apparatus 100 selects at least one of the size and the type of the reference encoding unit included in the data unit that is the basis of the index acquisition by selecting at least one of the size and the shape of the predetermined reference encoding unit You can decide.
일 실시예에 따라 비디오 복호화 장치(100)는 하나의 최대 부호화 단위에 포함하는 적어도 하나의 기준 부호화 단위를 이용할 수 있다. 즉, 영상을 분할하는 최대 부호화 단위에는 적어도 하나의 기준 부호화 단위가 포함될 수 있고, 각각의 기준 부호화 단위의 재귀적인 분할 과정을 통해 부호화 단위가 결정될 수 있다. 일 실시예에 따라 최대 부호화 단위의 너비 및 높이 중 적어도 하나는 기준 부호화 단위의 너비 및 높이 중 적어도 하나의 정수배에 해당할 수 있다. 일 실시예에 따라 기준 부호화 단위의 크기는 최대부호화단위를 쿼드 트리 구조에 따라 n번 분할한 크기일 수 있다. 즉, 비디오 복호화 장치(100)는 최대부호화단위를 쿼드 트리 구조에 따라 n 번 분할하여 기준 부호화 단위를 결정할 수 있고, 다양한 실시예들에 따라 기준 부호화 단위를 블록 형태 정보 및 분할 형태 정보 중 적어도 하나에 기초하여 분할할 수 있다.According to an exemplary embodiment, the video decoding apparatus 100 may use at least one reference encoding unit included in one maximum encoding unit. That is, the maximum encoding unit for dividing an image may include at least one reference encoding unit, and the encoding unit may be determined through a recursive division process of each reference encoding unit. According to an exemplary embodiment, at least one of the width and the height of the maximum encoding unit may correspond to at least one integer multiple of the width and height of the reference encoding unit. According to an exemplary embodiment, the size of the reference encoding unit may be a size obtained by dividing the maximum encoding unit n times according to a quadtree structure. That is, the video decoding apparatus 100 may determine the reference encoding unit by dividing the maximum encoding unit n times according to the quad tree structure, and may determine the reference encoding unit based on at least one of the block type information and the division type information As shown in FIG.
도 23은 일 실시예에 따라 픽쳐(2300)에 포함되는 기준 부호화 단위의 결정 순서를 결정하는 기준이 되는 프로세싱 블록을 도시한다.23 shows a processing block serving as a reference for determining a determination order of the reference encoding 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 one embodiment, the video decoding apparatus 100 may determine at least one processing block that divides a picture. The processing block is a data unit including at least one reference encoding unit for dividing an image, and at least one reference encoding unit included in the processing block may be determined in a specific order. That is, the order of determination of at least one reference encoding unit determined in each processing block may correspond to one of various kinds of order in which the reference encoding unit can be determined, and the reference encoding unit determination order determined in each processing block May be different for each processing block. The order of determination of the reference encoding unit determined for each processing block is a raster scan, a Z scan, an N scan, an up-right diagonal scan, a horizontal scan a horizontal scan, and a vertical scan. However, the order that can be determined should not be limited to the scan orders.
일 실시예에 따라 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 대한 정보를 비트스트림으로부터 획득하여 영상에 포함되는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있다. 이러한 프로세싱 블록의 크기는 프로세싱 블록의 크기에 대한 정보가 나타내는 데이터 단위의 소정의 크기일 수 있다. According to an embodiment, the video decoding apparatus 100 may obtain information on the size of the processing block to determine the size of the at least one processing block included in the image. The video decoding apparatus 100 may obtain information on the size of the processing block from the bitstream to determine the size of the at least one processing block included in the image. The size of such a processing block may be a predetermined size of a data unit represented by information on the size of the processing block.
일 실시예에 따라 비디오 복호화 장치(100)의 획득부(105)는 비트스트림으로부터 프로세싱 블록의 크기에 대한 정보를 특정의 데이터 단위마다 획득할 수 있다. 예를 들면 프로세싱 블록의 크기에 대한 정보는 영상, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트 등의 데이터 단위로 비트스트림으로부터 획득될 수 있다. 즉 획득부(105)는 상기 여러 데이터 단위마다 비트스트림으로부터 프로세싱 블록의 크기에 대한 정보를 획득할 수 있고 비디오 복호화 장치(100)는 획득된 프로세싱 블록의 크기에 대한 정보를 이용하여 픽쳐를 분할하는 적어도 하나의 프로세싱 블록의 크기를 결정할 수 있으며, 이러한 프로세싱 블록의 크기는 기준 부호화 단위의 정수배의 크기일 수 있다. According to an embodiment, the obtaining unit 105 of the video decoding apparatus 100 may obtain information on the size of the processing block from the bitstream for each specific data unit. For example, information on the size of a processing block can be obtained from a bitstream in units of data such as an image, a sequence, a picture, a slice, a slice segment, and the like. That is, the obtaining unit 105 may obtain information on the size of the processing block from the bitstream for each of the plurality of data units, and the video decoding apparatus 100 divides the picture using information on the size of the obtained processing block The size of the at least one processing block may be determined, and the size of the processing block may be an integer multiple of the reference encoding unit.
일 실시예에 따라 비디오 복호화 장치(100)는 픽쳐(2300)에 포함되는 프로세싱 블록(2302, 2312)의 크기를 결정할 수 있다. 예를 들면, 비디오 복호화 장치(100)는 비트스트림으로부터 획득된 프로세싱 블록의 크기에 대한 정보에 기초하여 프로세싱 블록의 크기를 결정할 수 있다. 도 23을 참조하면, 비디오 복호화 장치(100)는 일 실시예에 따라 프로세싱 블록(2302, 2312)의 가로크기를 기준 부호화 단위 가로크기의 4배, 세로크기를 기준 부호화 단위의 세로크기의 4배로 결정할 수 있다. 비디오 복호화 장치(100)는 적어도 하나의 프로세싱 블록 내에서 적어도 하나의 기준 부호화 단위가 결정되는 순서를 결정할 수 있다.According to one embodiment, the video decoding apparatus 100 may determine the size 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, the video decoding apparatus 100 according to an exemplary embodiment of the present invention has a horizontal size of the processing blocks 2302 and 2312 of four times the horizontal size of the reference encoding unit, a vertical size of four times the vertical size of the reference encoding unit You can decide. The video decoding apparatus 100 may determine an order in which at least one reference encoding unit is determined in at least one processing block.
일 실시예에 따라, 비디오 복호화 장치(100)는 프로세싱 블록의 크기에 기초하여 픽쳐(2300)에 포함되는 각각의 프로세싱 블록(2302, 2312)을 결정할 수 있고, 프로세싱 블록(2302, 2312)에 포함되는 적어도 하나의 기준 부호화 단위의 결정 순서를 결정할 수 있다. 일 실시예에 따라 기준 부호화 단위의 결정은 기준 부호화 단위의 크기의 결정을 포함할 수 있다.According to one 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 may include in the processing blocks 2302 and 2312 The determination order of at least one reference encoding unit is determined. The determination of the reference encoding unit may include determining the size of the reference encoding unit according to an embodiment.
일 실시예에 따라 비디오 복호화 장치(100)는 비트스트림으로부터 적어도 하나의 프로세싱 블록에 포함되는 적어도 하나의 기준 부호화 단위의 결정 순서에 대한 정보를 획득할 수 있고, 획득한 결정 순서에 대한 정보에 기초하여 적어도 하나의 기준 부호화 단위가 결정되는 순서를 결정할 수 있다. 결정 순서에 대한 정보는 프로세싱 블록 내에서 기준 부호화 단위들이 결정되는 순서 또는 방향으로 정의될 수 있다. 즉, 기준 부호화 단위들이 결정되는 순서는 각각의 프로세싱 블록마다 독립적으로 결정될 수 있다.According to an embodiment, the video decoding apparatus 100 may obtain information on a determination order of at least one reference encoding unit included in at least one processing block from a bitstream, So that the order in which at least one reference encoding unit is determined can be determined. The information on the decision order can be defined in the order or direction in which the reference encoding units are determined in the processing block. That is, the order in which the reference encoding units are determined may be independently determined for each processing block.
일 실시예에 따라 비디오 복호화 장치(100)는 특정 데이터 단위마다 기준 부호화 단위의 결정 순서에 대한 정보를 비트스트림으로부터 획득할 수 있다. 예를 들면, 획득부(105)는 기준 부호화 단위의 결정 순서에 대한 정보를 영상, 시퀀스, 픽쳐, 슬라이스, 슬라이스 세그먼트, 프로세싱 블록 등의 데이터 단위로마다 비트스트림으로부터 획득할 수 있다. 기준 부호화 단위의 결정 순서에 대한 정보는 프로세싱 블록 내에서의 기준 부호화 단위 결정 순서를 나타내므로, 결정 순서에 대한 정보는 정수개의 프로세싱 블록을 포함하는 특정 데이터 단위 마다 획득될 수 있다.According to an embodiment, the video decoding apparatus 100 may acquire information on a determination order of a reference encoding unit from a bitstream for each specific data unit. For example, the acquiring unit 105 can acquire information on the order of determination of the reference encoding unit from a 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 encoding unit indicates the reference encoding unit determination order in the processing block, the information on the determination order can be obtained for each specific data unit including an integer number of processing blocks.
비디오 복호화 장치(100)는 일 실시예에 따라 결정된 순서에 기초하여 적어도 하나의 기준 부호화 단위를 결정할 수 있다.The video decoding apparatus 100 may determine at least one reference encoding unit based on the determined order 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 one embodiment, the acquiring unit 105 may acquire information on the reference encoding unit determination order from the bitstream as information related to the processing blocks 2302 and 2312, and the video decoding apparatus 100 may acquire information It is possible to determine the order of determining at least one reference encoding unit included in the pictures 2302 and 2312 and determine at least one reference encoding unit included in the picture 2300 according to the determination order of the encoding units. Referring to FIG. 23, the video decoding apparatus 100 can determine the determination order 2304 and 2314 of at least one reference encoding unit associated with each processing block 2302 and 2312. For example, when information on a determination order of reference encoding units is obtained for each processing block, the reference encoding unit determination order associated with each processing block 2302, 2312 may be different for each processing block. When the reference encoding unit determination order 2304 related to the processing block 2302 is a raster scan order, the reference encoding unit included in the processing block 2302 can be determined according to the raster scan order. On the other hand, when the reference encoding unit determination order 2314 related to the other processing block 2312 is in the reverse order of the raster scan order, the reference encoding unit included in the processing block 2312 can be determined according to the reverse order of the raster scan order.
비디오 복호화 장치(100)는 일 실시예에 따라, 결정된 적어도 하나의 기준 부호화 단위를 복호화할 수 있다. 비디오 복호화 장치(100)는 상술한 실시예를 통해 결정된 기준 부호화 단위에 기초하여 영상을 복호화 할 수 있다. 기준 부호화 단위를 복호화 하는 방법은 영상을 복호화 하는 다양한 방법들을 포함할 수 있다.The video decoding apparatus 100 may decode the determined at least one reference encoding unit according to an embodiment. The video decoding apparatus 100 can decode an image based on the reference encoding unit determined through the above-described embodiment. The method of decoding the reference encoding 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 block type information indicating a type of a current encoding unit or division type information indicating a method of dividing a current encoding unit from a bitstream. The block type information or the division type information may be included in a bitstream related to various data units. For example, the video decoding apparatus 100 may include a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header slice segment type information included in the segment header can be used. Further, the video decoding apparatus 100 may obtain a syntax corresponding to the maximum encoding unit, the reference encoding unit, and the block type information or the division type information from the bitstream for each processing block, from the bitstream.
이제까지 다양한 실시예들을 중심으로 살펴보았다. 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자는 본 개시가 본 개시의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 개시의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 개시에 포함된 것으로 해석되어야 할 것이다.Various embodiments have been described above. It will be understood by those skilled in the art that the present disclosure may be embodied in various forms without departing from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered in an illustrative rather than a restrictive sense. The scope of the present disclosure is set forth in the appended claims rather than the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present disclosure.
한편, 상술한 본 개시의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등)와 같은 저장매체를 포함한다.Meanwhile, the above-described embodiments of the present disclosure can be implemented in a general-purpose digital computer that can be created as a program that can be executed by a computer and operates the program using a computer-readable recording medium. The computer-readable recording medium includes a storage medium such as a magnetic storage medium (e.g., ROM, floppy disk, hard disk, etc.), optical reading medium (e.g., CD ROM,

Claims (15)

  1. 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계;Determining a scan area including all effective transform coefficients in a current block;
    상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하는 단계; Scanning the information about the in-scan conversion coefficients according to a predetermined scanning order;
    상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하는 단계;Performing binary arithmetic decoding based on information on the scanned transform coefficients to generate binary arithmetic decoded information;
    상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 단계;Performing inverse binarization on the binary arithmetic decoding information to obtain information on transform coefficients of the current block;
    상기 현재 블록의 변환 계수들에 관한 정보를 기초로 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하는 단계; 및Generating a residual block of a current block by performing inverse quantization and inverse transform based on information on transform coefficients of the current block; And
    상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 단계를 포함하고,And reconstructing a current block based on the generated residual block,
    상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행되는 것을 특징으로 하는 비디오 복호화 방법.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.
  2. 제 1 항에 있어서,The method according to claim 1,
    상기 사각형 스캔 영역 내에는 상기 현재 블록 내 모든 유효 변환 계수를 포함하고,Wherein the rectangular scan area includes all effective transformation coefficients in the current block,
    상기 사각형 스캔 영역을 제외한 현재 블록 내 나머지 영역은 유효 변환 계수가 아닌 0만을 포함하는 것을 특징으로 하는 비디오 복호화 방법.Wherein the remaining region in the current block excluding the quadrangular scan region includes only &lt; RTI ID = 0.0 &gt; 0 &lt; / RTI &gt;
  3. 제 1 항에 있어서,The method according to claim 1,
    상기 스캔 영역은 사각형 스캔 영역이고,Wherein the scan area is a rectangular scan area,
    상기 스캔 영역을 결정하는 단계는The step of determining the scan area
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보를 비트스트림으로부터 획득하는 단계; 및Obtaining information on coordinates specifying the quadrangular scan area from a bitstream; And
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 기초하여 현재 블록 내 변환 계수의 사각형 스캔 영역을 결정하는 단계를 포함하고,And determining a rectangular scan area of the current intra-block transform coefficient based on information about coordinates specifying the rectangular scan area,
    상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,A horizontal direction coordinate specifying the quadrangular scan area indicates a coordinate of an effective transformation coefficient pixel located at the rightmost position in the current block,
    상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,Wherein the vertical coordinate specifying the quadrangular scan area indicates the coordinates of the effective transformation coefficient pixel located at the lowermost part in the current block,
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보가 상기 비트스트림에 포함되고,Wherein flag information indicating whether or not the rectangular scan area includes a difference between horizontal and vertical coordinate values specifying the rectangular scan area is included in the bit stream,
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 The information on the coordinates specifying the quadrangular scan area is
    상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평 방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
    상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 대한 좌표를 나타내는 정보 및 상기 하나의 방향에 대한 좌표와 나머지 방향에 대한 좌표 간의 차분(difference)를 나타내는 정보를 포함하는 것을 특징으로 하는 비디오 복호화 방법.Information indicating coordinates of one of a horizontal direction coordinate of a pixel of an effective transformation coefficient located at the rightmost position in the current block and a vertical direction coordinate of a pixel of an effective transformation coefficient located at the lowermost position in the current block, And information indicating a difference between the coordinates of the one direction and the coordinates of the remaining direction.
  4. 제 1 항에 있어서,The method according to claim 1,
    상기 현재 블록의 크기는 상기 현재 블록의 높이 및 너비 중 최소값 및 최대값 중 적어도 하나에 기초하여 결정되고,Wherein the size of the current block is determined based on at least one of a minimum value and a maximum value of a height and a width of the current block,
    상기 현재 블록의 모양은 상기 현재 블록의 높이 및 너비가 동일한지 또는 높이가 너비보다 큰지 또는 너비가 높이보다 큰지에 기초하여 결정되는 것을 특징으로 하는 비디오 복호화 방법.Wherein the shape of the current block is determined based on whether the height and width of the current block are the same or whether the height is greater than the width or the width is greater than the height.
  5. 제 1 항에 있어서,The method according to claim 1,
    상기 현재 블록 내 모든 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all transform coefficients in the current block comprises:
    상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 현재 블록 내 변환 계수들의 위치를 나타내는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하여 변경(swap)된 현재 블록을 생성하는 단계; 및Generating a swapped current block by swapping horizontal and vertical coordinates indicating the positions of transform coefficients in the current block when the height and width of the current block are different from each other; And
    상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계를 포함하고,Determining a scan area containing all the effective transform coefficients in the swapped current block,
    상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all effective transform coefficients in the swapped current block comprises:
    상기 현재 블록의 높이 및 너비가 서로 다른 경우, 상기 스캔 영역을 특정하는 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.Wherein when the current block has a different height and width, the controller swaps the horizontal coordinate and the vertical coordinate specifying the scan region to each other, and based on the swapped horizontal and vertical coordinates, And determining a scan area.
  6. 제 5 항에 있어서,6. The method of claim 5,
    비트스트림은 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보를 포함하는지를 나타내는 정보 및 상기 스캔 영역을 특정하는 좌표에 관한 정보를 포함하고,Wherein the bit stream includes information indicating whether or not the bit stream includes flag information indicating whether or not the difference between the horizontal and vertical coordinate values specifying the scan area includes a difference and coordinates information specifying the scan area,
    상기 스캔 영역을 특정하는 좌표에 관한 정보는 상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보를 포함하고,The information on the coordinates specifying the scan area includes information on the horizontal direction coordinates specifying the scan area and information on the vertical direction coordinates,
    상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
    상기 스캔 영역을 특정하는 수평방향 좌표에 관한 정보 및 수직방향 좌표에 관한 정보는 상기 수평방향 좌표 및 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표와 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하고,The information on the horizontal direction coordinate specifying the scan area and the information on the vertical direction coordinate are information indicating coordinates in one of the horizontal direction coordinate and the vertical direction coordinate and information indicating coordinates in the other direction The information indicating the difference between the coordinates related to the coordinates,
    상기 변경(swap)된 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계는,Wherein the step of determining a scan area including all effective transform coefficients in the swapped current block comprises:
    상기 현재 블록의 높이 및 너비가 서로 다른 경우, If the height and width of the current block are different,
    상기 스캔 영역을 특정하는 좌표에 관한 정보로부터 획득된 수평방향 좌표 및 수직방향 좌표를 서로 변경(swap)하고, 상기 변경(swap)된 수평방향 좌표 및 수직방향 좌표에 기초하여 상기 스캔 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 비디오 복호화 방법.Swap horizontal coordinate and vertical coordinate obtained from information on the coordinates specifying the scan area, and determine the scan area based on the swapped horizontal and vertical coordinates And decoding the video data.
  7. 제 1 항에 있어서, The method according to claim 1,
    상기 컨텍스트 모델 중 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델은 상기 스캔 영역의 크기, 상기 스캔 영역 내에서 소정의 스캔 순서에 따라 현재 변환 계수보다 이전에 스캔된 계수의 개수(count) 및 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치 및 상기 현재 유효 변환 계수가 상기 스캔 영역 내 상기 소정의 스캔 순서에 따라 스캔된 변환 계수들 중 첫번째 변환 계수인지 여부 중 적어도 하나에 더 기초하여 결정된 것을 특징으로 하는 비디오 복호화 방법.The context model related to the flag information of the current transform coefficient among the context models includes a size of the scan region, a count of counts that are scanned before the current transform coefficient in a predetermined scan order in the scan region, Whether or not the current effective transform coefficient is a first transform coefficient among the transform coefficients scanned according to the predetermined scan order in the scan area, Decoding method.
  8. 제 7 항에 있어서, 8. The method of claim 7,
    상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역의 크기 및 상기 소정의 스캔 순서에 따라 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수에 기초하여 결정되는 경우,When the context model related to 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,
    상기 현재 계수보다 이전에 스캔된 변환 계수의 플래그 정보의 개수가 상기 스캔 영역의 크기에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 결정되는 것을 특징으로 하는 비디오 복호화 방법.A context model for 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, Is determined.
  9. 제 7 항에 있어서, 8. The method of claim 7,
    상기 현재 변환 계수의 플래그 정보에 관한 컨텍스트 모델이 상기 스캔 영역 내 상기 현재 변환 계수의 상대적인 위치에 기초하여 결정되는 경우, When the context model related to the flag information of the current transform coefficient is determined based on the relative position of the current transform coefficient in the scan area,
    상기 현재 변환 계수의 좌표가 상기 스캔 영역의 위치를 특정하는 좌표에 기초한 소정의 값보다 작은 경우에 대응하는 소정의 컨텍스트 오프셋에 기초하여 상기 현재 변환 계수에 관한 컨텍스트 모델이 결정되는 것을 특징으로 하는 비디오 복호화 방법.Wherein the context model for the current transform coefficient is 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 coordinates specifying the position of the scan region. Decoding method.
  10. 제 1 항에 있어서,The method according to claim 1,
    상기 변환 계수에 관한 정보는, The information on the transform coefficients may be,
    상기 변환 계수가 소정의 값보다 큰지 여부를 나타내는 플래그 정보, 상기 유효 변환 계수의 절대값에 관한 잔여 레벨(remaining level) 정보, 상기 변환 계수의 부호 정보, 및 상기 변환 계수의 역이진화에 이용되는 이진화 파라메터 정보 중 적어도 하나를 포함하고, A flag indicating whether the transform coefficient is larger than a predetermined value, a remaining level information about an absolute value of the effective transform coefficient, sign information of the transform coefficient, and a binarization And parameter information,
    상기 소정의 값은 0, 1, 2 중 적어도 하나인 것을 특징으로 하는 비디오 복호화 방법. Wherein the predetermined value is at least one of 0, 1, and 2.
  11. 현재 블록의 변환 계수를 획득하는 단계;Obtaining a transform coefficient of a current block;
    상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하는 단계; Determining a scan area including all effective transform coefficients in the current block;
    상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하는 단계;Scanning the information on the transform coefficients included in the scan region according to a predetermined scan order and performing binarization based on the information about the scanned transform coefficients to generate binarized information;
    상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 단계; 및Performing binary arithmetic coding on the binarized information to generate entropy-encoded information; And
    상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 단계를 포함하고,And generating a bitstream including the entropy-encoded information,
    상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행되는 것을 특징으로 하는 비디오 부호화 방법.Wherein the binary arithmetic coding is performed using a context model determined based on at least one of a size and a shape of the current block.
  12. 제 9 항에 있어서,10. The method of claim 9,
    상기 스캔 영역은 사각형 스캔 영역이고,Wherein the scan area is a rectangular scan area,
    상기 사각형 스캔 영역을 특정하는 수평 방향 좌표는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,A horizontal direction coordinate specifying the quadrangular scan area indicates a coordinate of an effective transformation coefficient pixel located at the rightmost position in the current block,
    상기 사각형 스캔 영역을 특정하는 수직 방향 좌표는 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수 픽셀의 좌표를 나타내고,Wherein the vertical coordinate specifying the quadrangular scan area indicates the coordinates of the effective transformation coefficient pixel located at the lowermost part in the current block,
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보 및 상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보에 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함하는지를 나타내는 플래그 정보는 상기 비트스트림에 포함되고,Flag information indicating whether or not the information on the coordinates specifying the quadrangular scan area and the information on the coordinates specifying the quadrangular scan area include a difference between horizontal and vertical coordinate values specifying the quadrangular scan area, Stream,
    상기 플래그 정보가 상기 사각형 스캔 영역을 특정하는 수평방향과 수직 방향의 좌표 값 간의 차분을 포함함을 나타내는 경우,When the flag information indicates that the difference between the horizontal and vertical coordinate values specifying the rectangular scan area is included,
    상기 사각형 스캔 영역을 특정하는 좌표에 관한 정보는 상기 현재 블록 내 가장 우측에 위치하는 유효 변환 계수의 픽셀에 대한 수평방향 좌표 및 상기 현재 블록 내 가장 하측에 위치하는 유효 변환 계수의 픽셀에 대한 수직방향 좌표 중 하나의 방향에 관한 좌표를 나타내는 정보 및 상기 하나의 방향에 관한 좌표 및 나머지 방향에 관한 좌표 간의 차분(difference)를 나타내는 정보를 포함하는 것을 특징으로 하는 비디오 부호화 방법.Wherein the information on the coordinates specifying the quadrangular scan area includes a horizontal coordinate for a pixel of an effective conversion coefficient located at the rightmost position in the current block and a vertical coordinate for a pixel of the effective conversion coefficient located at the lowermost position in the current block Information indicating a coordinate of one of the coordinates and information indicating a difference between coordinates of the one direction and coordinates of the remaining directions.
  13. 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역 내 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수들에 관한 정보에 기초하여 이진 산술 복호화를 수행하여 이진 산술 복호화된 정보를 생성하고, 상기 이진 산술 복호화된 정보에 대해 역이진화를 수행하여 상기 현재 블록의 변환 계수들에 관한 정보를 획득하는 엔트로피 복호화부; 및The method comprising the steps of: determining a scan area including all valid conversion coefficients in a current block; scanning information on the in-scan conversion coefficients according to a predetermined scanning order; and performing binary arithmetic decoding An entropy decoding unit for generating binary arithmetic decoding information and performing inverse binarization on the binary arithmetic decoding information to obtain information on transform coefficients of the current block; And
    상기 현재 블록의 변환 계수들에 관한 정보에 기초하여 역양자화 및 역변환을 수행하여 현재 블록의 레지듀얼 블록을 생성하고, 상기 생성된 레지듀얼 블록에 기초하여 현재 블록을 복원하는 영상 복원부를 포함하고,And an image restoration unit for generating a residual block of the current block by performing inverse quantization and inverse transformation based on the information about the transform coefficients of the current block and restoring the current block based on the generated residual block,
    상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 복호화가 수행되는 것을 특징으로 하는 비디오 복호화 장치.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.
  14. 현재 블록의 변환 계수를 획득하고, 상기 현재 블록 내 모든 유효 변환 계수를 포함하는 스캔 영역을 결정하고, 상기 스캔 영역에 포함된 변환 계수에 관한 정보를 소정의 스캔 순서에 따라 스캔하고, 상기 스캔된 변환 계수에 관한 정보를 기초로 이진화를 수행하여 이진화된 정보를 생성하고, 상기 이진화된 정보에 대해 이진 산술 부호화를 수행하여 엔트로피 부호화된 정보를 생성하는 엔트로피 부호화부; 및Acquires a conversion coefficient of the current block, determines a scan area including all the effective conversion coefficients in the current block, scans information on the conversion coefficient included in the scan area according to a predetermined scan order, An entropy encoding unit for generating binarized information by performing binarization based on information on the transform coefficients, and performing binary arithmetic encoding on the binarized information to generate entropy-encoded information; And
    상기 엔트로피 부호화된 정보를 포함하는 비트스트림을 생성하는 비트스트림 생성부를 포함하고,And a bitstream generator for generating a bitstream including the entropy-encoded information,
    상기 현재 블록의 크기 및 모양(shape) 중 적어도 하나에 기초하여 결정된 컨텍스트 모델을 이용하여 상기 이진 산술 부호화가 수행되는 것을 특징으로 하는 비디오 부호화 장치.Wherein the binary arithmetic coding is performed using a context model determined based on at least one of a size and a shape of the current block.
  15. 제 1 항의 비디오 복호화 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록매체.A computer-readable recording medium on which a program for implementing the video decoding method of claim 1 is recorded.
PCT/KR2018/003830 2018-01-02 2018-03-30 Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor WO2019135448A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020207017052A KR20200096537A (en) 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
CN202310312637.3A CN116112669A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium
CN201880089530.4A CN111727606B (en) 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
CN202310308625.3A CN116132694A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862612840P 2018-01-02 2018-01-02
US62/612,840 2018-01-02

Publications (1)

Publication Number Publication Date
WO2019135448A1 true WO2019135448A1 (en) 2019-07-11

Family

ID=67143807

Family Applications (1)

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

Country Status (3)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112449192A (en) * 2019-08-27 2021-03-05 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140025590A (en) * 2011-07-22 2014-03-04 모토로라 모빌리티 엘엘씨 Device and methods for scanning rectangular-shaped transforms in video coding
KR20140120341A (en) * 2012-01-22 2014-10-13 퀄컴 인코포레이티드 Coding of coefficients in video coding
KR20150003327A (en) * 2012-04-16 2015-01-08 퀄컴 인코포레이티드 Transform coefficient coding
KR101622450B1 (en) * 2011-06-27 2016-05-18 브리티쉬브로드캐스팅코퍼레이션 Video encoding and decoding using transforms
WO2017043760A1 (en) * 2015-09-08 2017-03-16 삼성전자 주식회사 Device and method for entropy encoding and decoding

Family Cites Families (1)

* 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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101622450B1 (en) * 2011-06-27 2016-05-18 브리티쉬브로드캐스팅코퍼레이션 Video encoding and decoding using transforms
KR20140025590A (en) * 2011-07-22 2014-03-04 모토로라 모빌리티 엘엘씨 Device and methods for scanning rectangular-shaped transforms in video coding
KR20140120341A (en) * 2012-01-22 2014-10-13 퀄컴 인코포레이티드 Coding of coefficients in video coding
KR20150003327A (en) * 2012-04-16 2015-01-08 퀄컴 인코포레이티드 Transform coefficient coding
WO2017043760A1 (en) * 2015-09-08 2017-03-16 삼성전자 주식회사 Device and method for entropy encoding and decoding

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112449192A (en) * 2019-08-27 2021-03-05 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2017171370A1 (en) Method and apparatus for processing video signal
WO2017176030A1 (en) Method and apparatus for processing video signal
WO2017146526A1 (en) Video signal processing method and device
WO2018070552A1 (en) Method and apparatus for encoding/decoding image
WO2017135759A1 (en) Video decoding method and apparatus by chroma-multi-transform, and video encoding method and apparatus by chroma-multi-transform
WO2020076116A1 (en) Image encoding/decoding methods and apparatuses
WO2011040794A2 (en) Method and apparatus for encoding/decoding image using variable-size macroblocks
WO2016182317A1 (en) Image decoding method for performing intra prediction and device thereof, and image encoding method for performing intra prediction and device thereof
WO2012044104A2 (en) Video encoding method for encoding hierarchical-structure symbols and a device therefor, and video decoding method for decoding hierarchical-structure symbols and a device therefor
WO2018226066A1 (en) Method and apparatus for decoding video according to affine prediction in video coding system
WO2017142335A1 (en) Video decoding method and device for same and video encoding method and device for same
WO2017222331A1 (en) Video signal processing method and device
WO2020235951A1 (en) Image encoding method and device, and image decoding method and device
WO2020256442A1 (en) Method for encoding/decoding image signal and apparatus therefor
WO2019225994A1 (en) Method and apparatus for processing video signal
WO2020213963A1 (en) Method for encoding/decoding image signal, and device for same
WO2016190627A1 (en) Method and device for processing video signal
WO2020013532A1 (en) Method and device for image encoding/decoding, and recording medium having bitstream stored thereon
WO2020004978A1 (en) Method and apparatus for processing video signal
WO2020139059A1 (en) Method and apparatus for encoding motion vector difference, and method and apparatus for decoding motion vector difference
WO2020159199A1 (en) Image signal encoding/decoding method and device therefor
WO2019093598A1 (en) Apparatus and method for encoding motion information, and decoding apparatus and method
WO2020141904A1 (en) Image signal encoding/decoding method and device for same
WO2019135448A1 (en) Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor
WO2020130714A1 (en) Video signal encoding/decoding method, and device therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18898122

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18898122

Country of ref document: EP

Kind code of ref document: A1