KR20220066242A - Method and apparatus for image encoding/decoding - Google Patents

Method and apparatus for image encoding/decoding Download PDF

Info

Publication number
KR20220066242A
KR20220066242A KR1020220059344A KR20220059344A KR20220066242A KR 20220066242 A KR20220066242 A KR 20220066242A KR 1020220059344 A KR1020220059344 A KR 1020220059344A KR 20220059344 A KR20220059344 A KR 20220059344A KR 20220066242 A KR20220066242 A KR 20220066242A
Authority
KR
South Korea
Prior art keywords
current block
transform
block
transform skip
scale factor
Prior art date
Application number
KR1020220059344A
Other languages
Korean (ko)
Other versions
KR102577480B1 (en
Inventor
김휘용
임성창
이진호
최진수
김진웅
박광훈
김경용
Original Assignee
한국전자통신연구원
경희대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원, 경희대학교 산학협력단 filed Critical 한국전자통신연구원
Publication of KR20220066242A publication Critical patent/KR20220066242A/en
Priority to KR1020230118776A priority Critical patent/KR20230134107A/en
Application granted granted Critical
Publication of KR102577480B1 publication Critical patent/KR102577480B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers
    • 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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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
    • 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/186Methods 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 colour or a chrominance component
    • 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/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/196Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

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

Abstract

Disclosed are a method and device for encoding/decoding an image. The method for decoding an image comprises the steps of: deriving a scale factor for the current block according to whether the current block is a transform skip block; and scaling the current block based on the scale factor. The scale factor for the current block is derived based on a position of the transform coefficient in the current block. The transform skip block is a block to which transform is not applied to the current block. The transform skip block is specified based on information indicating whether to apply inverse transform to the current block.

Description

영상 부호화/복호화 방법 및 장치{METHOD AND APPARATUS FOR IMAGE ENCODING/DECODING}Image encoding/decoding method and apparatus

본 발명은 영상의 부호화/복호화에 관한 것으로, 보다 상세하게는 변환 계수에 대한 스케일링 방법 및 장치에 관한 것이다. The present invention relates to encoding/decoding of an image, and more particularly, to a method and apparatus for scaling a transform coefficient.

최근 HD(High Definition) 해상도(1280x1024 혹은 1920x1080)를 가지는 방송 서비스가 국내뿐만 아니라 세계적으로 확대되고 있다. 이에 따라 많은 사용자들이 고해상도, 고화질의 영상에 많이 익숙해지고 있으며 그에 발맞춰서 많은 기관에서는 차세대 영상기기에 대한 개발에 박차를 가하고 있다. 또한 HDTV와 더불어 HDTV의 4배 이상의 해상도를 갖는 UHD(Ultra High Definition)에 대한 관심이 증대되면서 동영상 표준화 단체들은 보다 높은 해상도, 고화질의 영상에 대한 압축기술의 필요성을 인식하게 되었다. 또한 현재 HDTV, 휴대전화, 블루레이 플레이어에 사용되는 H.264/AVC보다 높은 압축 효율을 통해 동일한 화질을 유지하면서도 주파수 대역이나 저장 측면에서 많은 이득을 얻을 수 있는 새로운 표준이 절실한 실정이다.Recently, a broadcasting service having a high definition (HD) resolution (1280x1024 or 1920x1080) is expanding not only in Korea but also worldwide. Accordingly, many users are accustomed to high-resolution and high-definition images, and many institutions are spurring the development of next-generation imaging devices to keep pace with it. Also, along with HDTV, as interest in Ultra High Definition (UHD), which has a resolution four times higher than that of HDTV, increases, video standardization organizations recognize the need for compression technology for higher resolution and high-definition images. In addition, there is an urgent need for a new standard that can obtain many benefits in terms of frequency band or storage while maintaining the same image quality through higher compression efficiency than H.264/AVC currently used in HDTVs, mobile phones, and Blu-ray players.

현재 MPEG(Moving Picture Experts Group)과 VCEG(Video Coding Experts Group)는 공동으로 차세대 비디오 코덱인 HEVC(High Efficiency Video Coding)를 표준화하고 있으며, UHD 영상까지 포함한 영상을 H.264/AVC 대비 2배의 압축효율로 부호화를 하는 것을 목표로 하고 있다. 이는 HD, UHD 영상뿐만 아니라 3D 방송 및 이동통신망에서도 현재보다 낮은 주파수로 고화질의 영상을 제공할 수 있다.Currently, MPEG (Moving Picture Experts Group) and VCEG (Video Coding Experts Group) are jointly standardizing HEVC (High Efficiency Video Coding), which is a next-generation video codec. It aims to encode with compression efficiency. This can provide not only HD and UHD images, but also 3D broadcasting and high-definition images at lower frequencies than the present in mobile communication networks.

본 발명은 부호화/복호화 효율을 향상시킬 수 있는 영상 부호화/복호화 방법 및 장치를 제공한다.The present invention provides an image encoding/decoding method and apparatus capable of improving encoding/decoding efficiency.

본 발명은 부호화/복호화 효율을 향상시킬 수 있는 변환 계수(혹은 잔여 신호)의 스케일링 방법 및 장치를 제공한다. The present invention provides a method and apparatus for scaling a transform coefficient (or a residual signal) capable of improving encoding/decoding efficiency.

본 발명은 부호화/복호화 효율을 향상시킬 수 있는 변환 스킵 블록에 대한 양자화/역양자화 방법 및 장치를 제공한다. The present invention provides a quantization/inverse quantization method and apparatus for a transform skip block capable of improving encoding/decoding efficiency.

본 발명의 일 양태에 따르면, 영상 복호화 방법이 제공된다. 상기 영상 복호화 방법은 현재 블록이 변환 스킵 블록인지 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 도출하는 단계 및 상기 스케일 팩터를 기반으로 상기 현재 블록에 대한 스케일링을 수행하는 단계를 포함한다. According to one aspect of the present invention, an image decoding method is provided. The image decoding method includes deriving a scale factor for the current block according to whether the current block is a transform skip block, and performing scaling on the current block based on the scale factor.

상기 현재 블록에 대한 스케일 팩터는, 상기 현재 블록 내 변환 계수의 위치를 기반으로 도출되며, 상기 변환 스킵 블록은, 상기 현재 블록에 대해 변환을 적용하지 않은 블록이며, 상기 현재 블록에 대해 역변환을 적용할지 여부를 나타내는 정보를 기반으로 특정된다. The scale factor for the current block is derived based on a position of a transform coefficient in the current block, and the transform skip block is a block to which a transform is not applied to the current block, and an inverse transform is applied to the current block. It is specified based on information indicating whether or not to do so.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록일 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 기본 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, when the current block is a transform skip block, a basic scale factor may be derived regardless of a position of a transform coefficient in the current block.

상기 기본 스케일 팩터는 소정의 스케일 팩터 값을 가지며, 상기 소정의 스케일 팩터 값은 16일 수 있다. The basic scale factor may have a predetermined scale factor value, and the predetermined scale factor value may be 16.

상기 기본 스케일 팩터는 상기 현재 블록이 양자화 행렬을 사용하는지 여부에 따라 다른 스케일 팩터 값을 가질 수 있다. The basic scale factor may have a different scale factor value depending on whether the current block uses a quantization matrix.

상기 기본 스케일 팩터는 상기 현재 블록이 휘도 블록인지 색차 블록인지에 따라 다른 스케일 팩터 값을 가질 수 있다. The basic scale factor may have a different scale factor value depending on whether the current block is a luminance block or a chrominance block.

상기 현재 블록을 포함하는 픽처에 변환 스킵 알고리즘이 사용되는지 여부를 나타내는 플래그가 PPS(Picture Parameter Set)를 통해 시그널링될 수 있다. A flag indicating whether a transform skip algorithm is used for the picture including the current block may be signaled through a picture parameter set (PPS).

상기 기본 스케일 팩터는 휘도 신호와 색차 신호에 대한 스케일 팩터 정보를 포함할 수 있다. The basic scale factor may include scale factor information for a luminance signal and a chrominance signal.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록이거나 혹은 상기 현재 블록이 양자화 행렬을 사용하지 않을 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 기본 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, when the current block is a transform skip block or the current block does not use a quantization matrix, a basic scale factor is derived regardless of the position of the transform coefficient in the current block can do.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록이 아닌 경우, 상기 현재 블록 내 변환 계수의 위치를 기반으로 양자화 행렬을 이용하여 상기 현재 블록에 대한 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, if the current block is not a transform skip block, the scale factor for the current block is derived using a quantization matrix based on the position of the transform coefficient in the current block. can

본 발명의 다른 양태에 따르면, 영상 복호화 장치가 제공된다. 상기 영상 복호화 장치는 현재 블록이 변환 스킵 블록인지 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 도출하고, 상기 스케일 팩터를 기반으로 상기 현재 블록에 대한 스케일링을 수행하는 역양자화부를 포함한다. According to another aspect of the present invention, an image decoding apparatus is provided. The image decoding apparatus includes an inverse quantizer that derives a scale factor for the current block according to whether the current block is a transform skip block, and performs scaling on the current block based on the scale factor.

상기 현재 블록에 대한 스케일 팩터는, 상기 현재 블록 내 변환 계수의 위치를 기반으로 도출되며, 상기 변환 스킵 블록은, 상기 현재 블록에 대해 변환을 적용하지 않은 블록이며, 상기 현재 블록에 대해 변환을 적용할지 여부를 나타내는 정보를 기반으로 특정될 수 있다. The scale factor for the current block is derived based on a position of a transform coefficient in the current block, and the transform skip block is a block to which a transform is not applied to the current block, and a transform is applied to the current block. It may be specified based on information indicating whether or not to do so.

본 발명의 또 다른 양태에 따르면, 영상 부호화 방법이 제공된다. 상기 영상 부호화 방법은 현재 블록이 변환 스킵 블록인지 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 도출하는 단계 및 상기 스케일 팩터를 기반으로 상기 현재 블록에 대한 스케일링을 수행하는 단계를 포함한다. According to another aspect of the present invention, an image encoding method is provided. The image encoding method includes deriving a scale factor for the current block according to whether the current block is a transform skip block, and performing scaling on the current block based on the scale factor.

상기 현재 블록에 대한 스케일 팩터는, 상기 현재 블록 내 변환 계수의 위치를 기반으로 도출되며, 상기 변환 스킵 블록은, 상기 현재 블록에 대해 변환을 적용하지 않은 블록이며, 상기 현재 블록에 대해 변환을 적용할지 여부를 나타내는 정보를 기반으로 특정될 수 있다. The scale factor for the current block is derived based on a position of a transform coefficient in the current block, and the transform skip block is a block to which a transform is not applied to the current block, and a transform is applied to the current block. It may be specified based on information indicating whether or not to do so.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록일 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 기본 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, when the current block is a transform skip block, a basic scale factor may be derived regardless of a position of a transform coefficient in the current block.

상기 기본 스케일 팩터는 소정의 스케일 팩터 값을 가지며, 상기 소정의 스케일 팩터 값은 16일 수 있다. The basic scale factor may have a predetermined scale factor value, and the predetermined scale factor value may be 16.

상기 기본 스케일 팩터는 상기 현재 블록이 양자화 행렬을 사용하는지 여부에 따라 다른 스케일 팩터 값을 가질 수 있다. The basic scale factor may have a different scale factor value depending on whether the current block uses a quantization matrix.

상기 기본 스케일 팩터는 상기 현재 블록이 휘도 블록인지 색차 블록인지에 따라 다른 스케일 팩터 값을 가질 수 있다.The basic scale factor may have a different scale factor value depending on whether the current block is a luminance block or a chrominance block.

상기 현재 블록을 포함하는 픽처에 변환 스킵 알고리즘이 사용되는지 여부를 나타내는 플래그가 PPS(Picture Parameter Set)를 통해 시그널링될 수 있다. A flag indicating whether a transform skip algorithm is used for the picture including the current block may be signaled through a picture parameter set (PPS).

상기 기본 스케일 팩터는 휘도 신호와 색차 신호에 대한 스케일 팩터 정보를 포함할 수 있다. The basic scale factor may include scale factor information for a luminance signal and a chrominance signal.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록이거나 혹은 상기 현재 블록이 양자화 행렬을 사용하지 않을 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 기본 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, when the current block is a transform skip block or the current block does not use a quantization matrix, a basic scale factor is derived regardless of the position of the transform coefficient in the current block can do.

상기 현재 블록에 대한 스케일 팩터를 도출하는 단계에서는, 상기 현재 블록이 변환 스킵 블록이 아닌 경우, 상기 현재 블록 내 변환 계수의 위치를 기반으로 양자화 행렬을 이용하여 상기 현재 블록에 대한 스케일 팩터를 도출할 수 있다. In the step of deriving the scale factor for the current block, if the current block is not a transform skip block, the scale factor for the current block is derived using a quantization matrix based on the position of the transform coefficient in the current block. can

본 발명의 또 다른 양태에 따르면, 영상 부호화 장치가 제공된다. 상기 영상 부호화 장치는 현재 블록이 변환 스킵 블록인지 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 도출하고, 상기 스케일 팩터를 기반으로 상기 현재 블록에 대한 스케일링을 수행하는 양자화부를 포함한다. According to another aspect of the present invention, an image encoding apparatus is provided. The image encoding apparatus includes a quantizer that derives a scale factor for the current block according to whether the current block is a transform skip block, and performs scaling on the current block based on the scale factor.

상기 현재 블록에 대한 스케일 팩터는, 상기 현재 블록 내 변환 계수의 위치를 기반으로 도출되며, 상기 변환 스킵 블록은, 상기 현재 블록에 대해 변환을 적용하지 않은 블록이며, 상기 현재 블록에 대해 변환을 적용할지 여부를 나타내는 정보를 기반으로 특정될 수 있다. The scale factor for the current block is derived based on a position of a transform coefficient in the current block, and the transform skip block is a block to which a transform is not applied to the current block, and a transform is applied to the current block. It may be specified based on information indicating whether or not to do so.

변환 스킵 알고리즘이 적용된 블록은 변환/역변환 과정을 수행하지 않으므로, 기존의 변환/역변환 과정을 수행한 블록과는 서로 다른 변환 계수 특성을 지닌다. 즉, 기존의 변환/역변환 과정을 수행한 블록에 적용하였던 스케일링 방법을 그대로 변환 스킵 블록에 적용할 경우 부호화/복호화 효율을 감소시킬 수 있다. 따라서, 변환 스킵 블록에 대해서는 블록 내 변환 계수의 위치에 상관없이 동일하게 스케일 팩터를 적용함으로써, 부호화 및 복호화 효율을 증가시킬 수 있다. Since the block to which the transform skip algorithm is applied does not perform the transform/inverse transform process, it has different transform coefficient characteristics from the block to which the existing transform/inverse transform process is performed. That is, when the scaling method applied to the block on which the existing transform/inverse transform process is performed is applied to the transform skip block as it is, the encoding/decoding efficiency can be reduced. Accordingly, encoding and decoding efficiency can be increased by applying the same scale factor to the transform skip block regardless of the position of the transform coefficient in the block.

도 1은 본 발명이 적용되는 영상 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 2는 본 발명이 적용되는 영상 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 3은 영상을 부호화할 때 영상의 분할 구조를 개략적으로 나타내는 도면이다.
도 4는 코딩 유닛(CU)이 포함할 수 있는 예측 유닛(PU)의 형태를 도시한 도면이다.
도 5는 코딩 유닛(CU)이 포함할 수 있는 변환 유닛(TU)의 형태를 도시한 도면이다.
도 6은 본 발명의 일 실시예에 따른 잔여 신호(혹은 변환 계수)에 대한 스케일링 방법을 나타내는 순서도이다.
도 7은 본 발명의 다른 실시예에 따른 잔여 신호(혹은 변환 계수)에 대한 스케일링 방법을 나타내는 순서도이다.
1 is a block diagram illustrating a configuration of an image encoding apparatus to which the present invention is applied according to an embodiment.
2 is a block diagram illustrating a configuration of an image decoding apparatus to which the present invention is applied according to an embodiment.
3 is a diagram schematically illustrating a split structure of an image when an image is encoded.
4 is a diagram illustrating a form of a prediction unit (PU) that a coding unit (CU) may include.
5 is a diagram illustrating a form of a transform unit (TU) that a coding unit (CU) may include.
6 is a flowchart illustrating a scaling method for a residual signal (or a transform coefficient) according to an embodiment of the present invention.
7 is a flowchart illustrating a scaling method for a residual signal (or transform coefficient) according to another embodiment of the present invention.

이하, 도면을 참조하여 본 발명의 실시 형태에 대하여 구체적으로 설명한다. 본 명세서의 실시예를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 해당 설명을 생략할 수도 있다.EMBODIMENT OF THE INVENTION Hereinafter, embodiment of this invention is described concretely with reference to drawings. In describing the embodiments of the present specification, if it is determined that a detailed description of a related known configuration or function may obscure the gist of the present specification, the corresponding description may be omitted.

본 명세서에서 어떤 구성 요소가 다른 구성 요소에 연결되어 있다거나 접속되어 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있는 것을 의미할 수도 있고, 중간에 다른 구성 요소가 존재하는 것을 의미할 수도 있다. 아울러, 본 명세서에서 특정 구성을 포함한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다.In this specification, when it is mentioned that a component is connected to or connected to another component, it may mean that it is directly connected or connected to the other component, and another component is present in the middle. could mean that In addition, the content described as including a specific configuration in the present specification does not exclude configurations other than the corresponding configuration, it means that an additional configuration may be included in the practice of the present invention or the scope of the technical spirit of the present invention.

제1, 제2 등의 용어는 다양한 구성들을 설명하는데 사용될 수 있지만, 상기 구성들은 상기 용어에 의해 한정되지 않는다. 상기 용어들은 하나의 구성을 다른 구성으로부터 구별하는 목적으로 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성은 제2 구성으로 명명될 수 있고, 유사하게 제2 구성도 제1 구성으로 명명될 수 있다.Terms such as first, second, etc. may be used to describe various components, but the components are not limited by the terms. The terms are used for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, a first configuration may be named as a second configuration, and similarly, a second configuration may also be called a first configuration.

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

또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.In addition, some of the components are not essential components for performing essential functions in the present invention, but may be optional components for merely improving performance. The present invention can be implemented by including only essential components to implement the essence of the present invention, except for components used for performance improvement, and a structure including only essential components excluding optional components used for performance improvement Also included in the scope of the present invention.

우선, 설명의 편의를 도모하고 발명의 이해를 돕기 위해, 본 명세서에서 사용되는 용어들에 대하여 간략하게 설명한다. First, for convenience of description and understanding of the present invention, terms used herein will be briefly described.

*유닛(unit)은 영상 부호화 및 복호화의 단위를 의미한다. 다시 말하면, 영상 부호화/복호화 시, 부호화 혹은 복호화 단위라 함은 하나의 영상을 세분화된 유닛으로 분할하여 부호화 혹은 복호화 할 때 그 분할된 단위를 말한다. 블록(block), 매크로 블록(Macro Block; MB), 부호화 유닛(Coding Unit; CU), 예측 유닛(Prediction Unit; PU), 변환 유닛(Transform Unit; TU), 부호화 블록(Coding Block; CB), 예측 블록(Prediction Block; PB), 변환 블록(Transform Block; TB) 등으로 부를 수 있다. 하나의 유닛은 크기가 더 작은 하위 유닛으로 분할될 수 있다. * A unit means a unit of video encoding and decoding. In other words, when encoding/decoding an image, the encoding or decoding unit refers to the divided unit when encoding or decoding an image by dividing one image into subdivided units. Block, Macro Block (MB), Coding Unit (CU), Prediction Unit (PU), Transform Unit (TU), Coding Block (CB), It may be referred to as a prediction block (PB), a transform block (TB), or the like. One unit may be divided into smaller sub-units.

블록(block)은 샘플(sample)의 MxN 배열을 말하며, M과 N은 양의 정수 값을 가진다. 블록은 흔히 2차원 형태의 배열을 의미할 수 있다.A block is an MxN array of samples, and M and N have positive integer values. A block may refer to an array in a two-dimensional form.

변환 유닛(Transform Unit; TU)은 변환, 역변환, 양자화, 역양자화, 변환 계수 부호화/복호화와 같이 잔여 신호(residual signal)의 부호화/복호화를 수행할 때의 기본 유닛이며, 하나의 변환 유닛은 분할되어 크기가 작은 다수의 변환 유닛으로 분할될 수 있다. 이때, 잔여 신호(residual signal)가 블록 형태로 존재할 경우 잔여 블록(residual block)이라고 할 수 있다. A transform unit (TU) is a basic unit when encoding/decoding a residual signal such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding/decoding is performed, and one transform unit is divided Thus, it can be divided into a plurality of small conversion units. In this case, if the residual signal exists in the form of a block, it may be referred to as a residual block.

양자화 행렬(quantization matrix)은 영상의 주관적 화질 혹은 객관적 화질을 향상시키기 위해서 양자화 혹은 역양자화 과정에서 이용하는 행렬을 의미한다. 양자화 행렬은 스케일링 리스트(scaling list)라고도 불린다.A quantization matrix refers to a matrix used in a quantization or inverse quantization process to improve subjective or objective image quality of an image. The quantization matrix is also called a scaling list.

양자화 행렬은 기본 행렬(default matrix), 비기본 행렬(non-default matrix), 평면 행렬(flat matrix)로 나뉠 수 있다. 기본 행렬은 부호화기와 복호화기에서 미리 정의되어 있는 소정의 양자화 행렬을 의미할 수 있다. 비기본 행렬은 부호화기와 복호화기에서 미리 정의되지 않고, 사용자에 의해서 전송/수신되는 양자화 행렬을 의미할 수 있다. 평면 행렬은 행렬 내 모든 원소가 동일한 값을 가지는 행렬을 의미할 수 있다. The quantization matrix may be divided into a default matrix, a non-default matrix, and a flat matrix. The basic matrix may mean a predetermined quantization matrix predefined in the encoder and the decoder. The non-basic matrix may mean a quantization matrix transmitted/received by a user that is not predefined in the encoder and the decoder. A planar matrix may mean a matrix in which all elements in the matrix have the same value.

스케일링(scaling)은 변환 계수 레벨에 인수를 곱하는 과정을 의미하며, 결과로 변환 계수를 생성한다. 스케일링은 역양자화(dequantization)라고도 한다.Scaling refers to a process of multiplying a transform coefficient level by a factor, and a transform coefficient is generated as a result. Scaling is also called dequantization.

변환 계수(transform coefficient)는 변환을 수행하고 나서 생성된 계수값을 말한다. 본 명세서에서는 변환 계수에 양자화를 적용한 양자화된 변환 계수 레벨(transform coefficient level)도 변환 계수라 통칭하여 사용한다. A transform coefficient refers to a coefficient value generated after transformation is performed. In the present specification, a quantized transform coefficient level obtained by applying quantization to a transform coefficient is also commonly referred to as a transform coefficient.

양자화 매개변수(quantization parameter)는 양자화 및 역양자화에서 변환 계수 레벨을 스케일링할 때 사용되는 값을 의미한다. 이때, 양자화 매개변수는 양자화 스텝 크기(step size)에 매핑된 값일 수 있다. A quantization parameter refers to a value used when scaling a transform coefficient level in quantization and inverse quantization. In this case, the quantization parameter may be a value mapped to a quantization step size.

파라미터 세트(parameter set)는 비트스트림 내의 구조 중 헤더 정보에 해당하며, 시퀀스 파라미터 세트(sequence parameter set), 픽처 파라미터 세트(picture parameter set), 적응 파라미터 세트(adaptation parameter set) 등을 통칭하는 의미를 가진다. A parameter set corresponds to header information in a structure in a bitstream, and collectively refers to a sequence parameter set, a picture parameter set, an adaptation parameter set, and the like. have

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

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

영상 부호화 장치(100)는 입력 영상에 대해 인트라(intra) 모드 또는 인터(inter) 모드로 부호화를 수행하고 비트스트림을 출력할 수 있다. 인트라 모드인 경우 스위치(115)가 인트라로 전환되고, 인터 모드인 경우 스위치(115)가 인터로 전환될 수 있다. 인트라 예측은 화면 내 예측, 인터 예측은 화면 간 예측을 의미한다. 영상 부호화 장치(100)는 입력 영상의 입력 블록에 대한 예측 블록을 생성한 후, 입력 블록과 예측 블록의 차분(residual)을 부호화할 수 있다. 이때, 입력 영상은 원 영상(original picture)를 의미할 수 있다. The image encoding apparatus 100 may encode an input image in an intra mode or an inter mode and output a bitstream. In the intra mode, the switch 115 may be switched to the intra mode, and in the inter mode, the switch 115 may be switched to the inter mode. Intra prediction refers to intra prediction, and inter prediction refers to inter prediction. The image encoding apparatus 100 may generate a prediction block for an input block of an input image, and then encode a residual between the input block and the prediction block. In this case, the input image may mean an original picture.

인트라 모드인 경우, 인트라 예측부(120)는 현재 블록 주변의 이미 부호화/복호화된 블록의 픽셀값을 이용하여 공간적 예측을 수행하여 예측 블록을 생성할 수 있다.In the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values of an already encoded/decoded block around the current block.

인터 모드인 경우, 움직임 예측부(111)는, 움직임 예측 과정에서 참조 픽처 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. 여기서, 움직임 벡터는 인터 예측에 사용되는 2차원 벡터이며, 현재 부호화/복호화 대상 영상과 참조 영상 사이의 오프셋을 나타낼 수 있다.In the inter mode, the motion prediction unit 111 may obtain a motion vector by finding a region that best matches the input block in the reference image stored in the reference picture buffer 190 during the motion prediction process. The motion compensator 112 may generate a prediction block by performing motion compensation using a motion vector. Here, the motion vector is a two-dimensional vector used for inter prediction, and may indicate an offset between a current encoding/decoding target image and a reference image.

감산기(125)는 입력 블록과 생성된 예측 블록의 차분에 의해 잔차 블록(residual block)을 생성할 수 있다. The subtractor 125 may generate a residual block by the difference between the input block and the generated prediction block.

변환부(130)는 잔차 블록에 대해 변환(transform)을 수행하여 변환 계수(transform coefficient)를 출력할 수 있다. 그리고 양자화부(140)는 입력된 변환 계수를 양자화 파라미터(quantization parameter, 또는 양자화 매개변수)에 따라 양자화하여 양자화된 계수(quantized coefficient)를 출력할 수 있다.The transform unit 130 may perform transform on the residual block to output a transform coefficient. In addition, the quantization unit 140 may quantize the input transform coefficient according to a quantization parameter (or quantization parameter) to output a quantized coefficient.

엔트로피 부호화부(150)는, 양자화부(140)에서 산출된 값들 또는 부호화 과정에서 산출된 부호화 파라미터 값 등을 기초로 엔트로피 부호화를 수행하여 비트스트림(bit stream)을 출력할 수 있다. 엔트로피 부호화가 적용되는 경우, 높은 발생 확률을 갖는 심볼(symbol)에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 부호화 대상 심볼들에 대한 비트열의 크기가 감소될 수 있다. 따라서 엔트로피 부호화를 통해서 영상 부호화의 압축 성능이 높아질 수 있다. 엔트로피 부호화부(150)는 엔트로피 부호화를 위해 지수-골롬(Exponential-Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 부호화 방법을 사용할 수 있다.The entropy encoding unit 150 may output a bit stream by performing entropy encoding based on the values calculated by the quantization unit 140 or encoding parameter values calculated during the encoding process. When entropy encoding is applied, a small number of bits are allocated to a symbol having a high probability of occurrence and a large number of bits are allocated to a symbol having a low probability of occurrence to express the symbol, so that bits for symbols to be encoded The size of the column may be reduced. Accordingly, compression performance of image encoding may be improved through entropy encoding. The entropy encoder 150 may use an encoding method such as Exponential-Golomb, Context-Adaptive Variable Length Coding (CAVLC), or Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy encoding.

도 1의 실시예에 따른 영상 부호화 장치(100)는 인터 예측 부호화, 즉 화면 간 예측 부호화를 수행하므로, 현재 부호화된 영상은 참조 영상으로 사용되기 위해 복호화되어 저장될 필요가 있다. 따라서 양자화된 계수는 역양자화부(160)에서 역양자화되고 역변환부(170)에서 역변환된다. 역양자화, 역변환된 계수는 가산기(175)를 통해 예측 블록과 더해지고 복원 블록이 생성된다.Since the image encoding apparatus 100 according to the embodiment of FIG. 1 performs inter prediction encoding, that is, inter prediction encoding, the currently encoded image needs to be decoded and stored to be used as a reference image. Accordingly, the quantized coefficients are inverse quantized by the inverse quantization unit 160 and inversely transformed by the inverse transformation unit 170 . The inverse-quantized and inverse-transformed coefficients are added to the prediction block through an adder 175 to generate a reconstructed block.

복원 블록은 필터부(180)를 거치고, 필터부(180)는 디블록킹 필터(deblocking filter), SAO(Sample Adaptive Offset), ALF(Adaptive Loop Filter) 중 적어도 하나 이상을 복원 블록 또는 복원 픽처에 적용할 수 있다. 필터부(180)는 적응적 인루프(in-loop) 필터로 불릴 수도 있다. 디블록킹 필터는 블록 간의 경계에 생긴 블록 왜곡을 제거할 수 있다. SAO는 코딩 에러를 보상하기 위해 픽셀값에 적정 오프셋(offset) 값을 더해줄 수 있다. ALF는 복원된 영상과 원래의 영상을 비교한 값을 기초로 필터링을 수행할 수 있다. 필터부(180)를 거친 복원 블록은 참조 픽처 버퍼(190)에 저장될 수 있다.The reconstructed block passes through the filter unit 180, and the filter unit 180 applies at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. can do. The filter unit 180 may be referred to as an adaptive in-loop filter. The deblocking filter can remove block distortion caused at the boundary between blocks. The SAO may add an appropriate offset value to a pixel value to compensate for a coding error. The ALF may perform filtering based on a value obtained by comparing the reconstructed image and the original image. The reconstructed block that has passed through the filter unit 180 may be stored in the reference picture buffer 190 .

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

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

영상 복호화 장치(200)는 부호화기에서 출력된 비트스트림을 입력 받아 인트라 모드 또는 인터 모드로 복호화를 수행하고 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 인트라 모드인 경우 스위치가 인트라로 전환되고, 인터 모드인 경우 스위치가 인터로 전환될 수 있다. The image decoding apparatus 200 may receive a bitstream output from the encoder, perform decoding in an intra mode or an inter mode, and output a reconstructed image, that is, a reconstructed image. In the case of the intra mode, the switch may be switched to the intra mode, and in the case of the inter mode, the switch may be switched to the inter mode.

영상 복호화 장치(200)는 입력 받은 비트스트림으로부터 복원된 잔차 블록(reconstructed residual block)을 얻고 예측 블록을 생성한 후 복원된 잔차 블록과 예측 블록을 더하여 재구성된 블록, 즉 복원 블록을 생성할 수 있다.The image decoding apparatus 200 obtains a reconstructed residual block from the received bitstream, generates a prediction block, and then adds the reconstructed residual block and the prediction block to generate a reconstructed block, that is, a reconstructed block. .

엔트로피 복호화부(210)는, 입력된 비트스트림을 확률 분포에 따라 엔트로피 복호화하여, 양자화된 계수(quantized coefficient) 형태의 심볼을 포함한 심볼들을 생성할 수 있다.The entropy decoding unit 210 may entropy-decode the input bitstream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients.

엔트로피 복호화 방법이 적용되는 경우, 높은 발생 확률을 갖는 심볼에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 각 심볼들에 대한 비트열의 크기가 감소될 수 있다.When the entropy decoding method is applied, a small number of bits are allocated to a symbol having a high occurrence probability and a large number of bits are allocated to a symbol having a low occurrence probability to represent the symbol, so that the size of the bit stream for each symbol is can be reduced.

양자화된 계수는 역양자화부(220)에서 역양자화되고 역변환부(230)에서 역변환되며, 양자화된 계수가 역양자화/역변환 된 결과, 복원된 잔차 블록이 생성될 수 있다.The quantized coefficient is inverse quantized by the inverse quantization unit 220 and inversely transformed by the inverse transformation unit 230 , and as a result of inverse quantization/inverse transformation of the quantized coefficient, a reconstructed residual block may be generated.

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

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

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

HEVC(High Efficiency Video Coding)에서는 영상을 효율적으로 분할하기 위해 코딩 유닛(Coding Unit; CU)으로 부호화를 수행한다. In High Efficiency Video Coding (HEVC), encoding is performed using a coding unit (CU) to efficiently segment an image.

도 3을 참조하면, HEVC에서는 영상(300)을 최대 코딩 유닛(Largest Coding Unit; LCU)(이하, LCU라 함) 단위로 순차적으로 분할한 후, LCU 단위로 분할 구조를 결정한다. 분할 구조는 LCU(310) 내에서 영상을 효율적으로 부호화하기 위한 코딩 유닛(이하, CU라 함)의 분포를 의미하며, 이러한 분포는 하나의 CU를 그 가로 크기 및 세로 크기의 절반으로 감소된 4개의 CU로 분할할지 여부에 따라 결정될 수 있다. 분할된 CU는 동일한 방식으로 분할된 CU에 대해서 그 가로 크기 및 세로 크기가 절반씩 감소된 4개의 CU로 재귀적으로 분할될 수 있다. Referring to FIG. 3 , in HEVC, an image 300 is sequentially partitioned in units of Largest Coding Units (LCUs) (hereinafter referred to as LCUs), and then a division structure is determined in units of LCUs. The division structure means a distribution of coding units (hereinafter, referred to as CUs) for efficiently encoding an image in the LCU 310 , and this distribution divides one CU by half of its horizontal and vertical sizes. It may be determined according to whether to split into CUs. A divided CU may be recursively divided into four CUs whose horizontal size and vertical size are reduced by half with respect to the divided CU in the same manner.

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

LCU(310)로부터 가로 및 세로 크기의 절반으로 분할을 수행할 때마다 CU의 깊이는 1씩 증가한다. 각각의 깊이 별로, 분할을 수행하지 않는 CU의 경우에는 2Nx2N 크기를 가지며, 분할을 수행하는 CU의 경우에는 2Nx2N 크기의 CU에서 NxN 크기를 가지는 4개의 CU로 분할된다. N의 크기는 깊이가 1씩 증가할 때마다 절반으로 감소한다. The depth of the CU increases by 1 whenever division is performed from the LCU 310 to half of the horizontal and vertical sizes. For each depth, a CU that does not perform division has a size of 2Nx2N, and a CU that performs division is divided into four CUs having a size of NxN from a CU of 2Nx2N size. The size of N is halved for each increase in depth by 1.

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

또한, 특정 CU를 분할할지에 대한 정보는 CU마다 1비트의 분할 정보를 통해 표현될 수 있다. 이 분할 정보는 SCU를 제외한 모든 CU에 포함될 수 있으며, 예컨대 CU를 분할하지 않을 경우에는 분할 정보에 0을 저장할 수 있고, CU를 분할할 경우에는 분할 정보에 1을 저장할 수 있다. In addition, information on whether to split a specific CU may be expressed through 1-bit partition information for each CU. This partition information may be included in all CUs except for the SCU. For example, when a CU is not divided, 0 may be stored in the partition information, and 1 may be stored in the partition information when a CU is divided.

한편, LCU로부터 분할된 CU는 예측을 위한 기본 단위인 예측 유닛(Prediction Unit; PU 또는 Prediction Block; PB)과 변환을 위한 기본 단위인 변환 유닛(Transform Unit; TU 또는 Transform Block; TB)으로 구성될 수 있다. On the other hand, the CU divided from the LCU is composed of a prediction unit (PU or Prediction Block; PB), which is a basic unit for prediction, and a transform unit (Transform Unit; TU or Transform Block; TB), which is a basic unit for transformation. can

도 4는 코딩 유닛(CU)이 포함할 수 있는 예측 유닛(PU)의 형태를 도시한 도면이다. 4 is a diagram illustrating a form of a prediction unit (PU) that a coding unit (CU) may include.

LCU로부터 분할된 CU 중 더 이상 분할되지 않는 CU는 하나 이상의 예측 유닛으로 분할되며 이 행위 자체 역시 분할(partition)(혹은 파티션)이라고 일컫는다. 예측 유닛(이하, PU라 함)은 예측을 수행하는 기본 단위로써, 스킵(skip) 모드, 인터(inter) 모드, 인트라(intra) 모드 중 어느 하나로 부호화되며, 각 모드에 따라서 다양한 형태로 파티션될 수 있다. A CU that is no longer split among CUs split from an LCU is split into one or more prediction units, and this action itself is also referred to as a partition (or partition). A prediction unit (hereinafter, referred to as PU) is a basic unit for performing prediction and is encoded in any one of a skip mode, an inter mode, and an intra mode, and is partitioned into various forms according to each mode. can

도 4를 참조하면, 스킵 모드의 경우, CU 내에서 파티션 없이, CU와 동일한 크기를 갖는 2Nx2N 모드(410)를 지원할 수 있다. Referring to FIG. 4 , in the case of the skip mode, the 2Nx2N mode 410 having the same size as the CU may be supported without a partition within the CU.

인터 모드의 경우, CU 내에서 8가지의 파티션된 형태, 예컨대 2Nx2N 모드(410), 2NxN 모드(415), Nx2N 모드(420), NxN 모드(425), 2NxnU 모드(430), 2NxnD 모드(435), nLx2N 모드(440), nRx2N 모드(445)를 지원할 수 있다. In the case of inter mode, there are 8 partitioned types within a CU, for example, 2Nx2N mode 410, 2NxN mode 415, Nx2N mode 420, NxN mode 425, 2NxnU mode 430, 2NxnD mode 435 ), nLx2N mode 440 , and nRx2N mode 445 may be supported.

인트라 모드의 경우, CU 내에서 2Nx2N 모드(410), NxN 모드(425)를 지원할 수 있다. In the case of the intra mode, the 2Nx2N mode 410 and the NxN mode 425 may be supported within the CU.

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

변환 유닛(이하, TU라 함)은 CU 내에서 공간 변환과 양자화/역양자화(스케일링) 과정을 위해 사용되는 기본 단위이다. TU는 정사각형 또는 직사각형 형태를 가질 수 있다. LCU로부터 분할된 CU 중 더 이상 분할되지 않는 CU는 하나 혹은 그 이상의 TU로 분할될 수 있다. A transform unit (hereinafter, referred to as a TU) is a basic unit used for spatial transform and quantization/inverse quantization (scaling) processes within a CU. A TU may have a square or rectangular shape. A CU that is no longer split among CUs split from an LCU may be split into one or more TUs.

이때, TU의 분할 구조는 쿼드트리(quad-tree) 구조일 수 있다. 예컨대, 도 5에 도시된 바와 같이, 하나의 CU(510)가 쿼드트리 구조에 따라서 한번 혹은 그 이상 분할되어 다양한 크기의 TU들로 구성될 수 있다. In this case, the partition structure of the TU may be a quad-tree structure. For example, as shown in FIG. 5 , one CU 510 may be divided one or more times according to a quadtree structure and configured as TUs of various sizes.

한편, HEVC에서는 H.264/AVC와 같이 화면 내 예측(이하, 인트라 예측) 부호화를 수행할 수 있다. 이때 현재 블록의 주변에 위치한 주변 블록으로부터 현재 블록의 인트라 예측 모드(혹은 예측 방향성)를 유도하여 부호화할 수 있다. Meanwhile, in HEVC, like H.264/AVC, intra prediction (hereinafter, intra prediction) encoding may be performed. In this case, the intra prediction mode (or prediction directionality) of the current block may be derived and encoded from the neighboring blocks located in the vicinity of the current block.

상기와 같이, 인트라 예측 모드를 기반으로 예측이 수행됨으로써 취득된 신호에 대한 예측 영상은 원본 영상과의 차이 값을 가질 수 있다. 이러한 예측 영상과 원본 영상 간의 차이 값을 가지는 차분 영상은 주파수 영역 변환과 양자화를 거쳐 엔트로피 부호화될 수 있다. 이때, 주파수 영역 변환의 부호화 효율을 높이고자 정수 변환, 정수 이산 여현 변환(Discrete Cosine Transform; DCT), 정수 이산 정현 변환(Discrete Sine Transform; DST), 또는 인트라 예측 모드 종속적인 DCT/DST 등을 블록 크기에 따라 선택적, 적응적으로 적용할 수 있다. As described above, a prediction image for a signal obtained by performing prediction based on the intra prediction mode may have a difference value from the original image. A difference image having a difference value between the predicted image and the original image may be entropy-encoded through frequency domain transformation and quantization. In this case, in order to increase the encoding efficiency of the frequency domain transform, integer transform, integer discrete cosine transform (DCT), integer discrete sine transform (DST), or intra prediction mode-dependent DCT/DST, etc. are block It can be applied selectively and adaptively according to the size.

또한, 문서 영상이나 혹은 파워포인트의 프리젠테이션 영상과 같은 스크린 컨텐츠(screen contents)에서 부호화 효율을 높이기 위해서 변환 스킵(Transform SKIP) 알고리즘을 적용할 수 있다. In addition, in order to increase encoding efficiency in screen contents such as a document image or a presentation image of PowerPoint, a transform skip algorithm may be applied.

변환 스킵 알고리즘을 적용할 경우, 부호화기에서는 원본 영상과 예측 영상 간의 차이 값을 가지는 차분 영상(잔여 블록)을 주파수 변환 과정 없이 바로 양자화하여 잔여 블록에 대해 엔트로피 부호화를 수행한다. 그리고 복호화기에서는 잔여 블록에 대해 엔트로피 복호화하고 역양자화(스케일링)를 수행하여 복원된 잔여 블록을 생성한다. 따라서 이러한 변환 스킵 알고리즘이 적용된 블록은 주파수 변환/역변환 과정을 건너뛰게 된다. When the transform skip algorithm is applied, the encoder directly quantizes a difference image (residual block) having a difference value between the original image and the predicted image without a frequency transformation process and entropy-encoding the residual block. In addition, the decoder generates a reconstructed residual block by entropy-decoding the residual block and performing inverse quantization (scaling). Accordingly, the block to which the transform skip algorithm is applied skips the frequency transform/inverse transform process.

양자화/역양자화 과정에서는 영상의 주관적 화질 향상을 위해 블록 내 변환 계수의 위치에 따라 스케일 팩터(scale factor)를 다르게 적용할 수 있다. 반면, 양자화/역양자화를 수행할 때 블록 내 변환 계수의 위치에 상관없이 스케일 팩터를 동일하게 적용하는 방법이 있다. 이러한 방법의 적용 여부는 비트스트림의 SPS(Sequence Parameter Set) 혹은 PPS(Picture Parameter Set)를 통해 시그널링될 수 있다. In the quantization/inverse quantization process, a scale factor may be applied differently according to the location of a transform coefficient in a block to improve subjective image quality. On the other hand, when performing quantization/inverse quantization, there is a method in which the scale factor is equally applied regardless of the position of the transform coefficient in the block. Whether this method is applied may be signaled through a sequence parameter set (SPS) or a picture parameter set (PPS) of the bitstream.

상기 과정의 일 실시예로, 변환 계수의 스케일링 과정(Scaling Process for transform coefficients)은 아래와 같이 수행될 수 있다. As an embodiment of the above process, a scaling process for transform coefficients may be performed as follows.

변환 계수의 스케일링 과정Scaling process of transform coefficients

여기서의 입력은 다음과 같다. The input here is as follows.

- 현재 변환 블록의 너비 Width; nW- Width of the current transformation block Width; nW

- 현재 변환 블록의 높이 Height; nH- Height of the current transformation block Height; nH

- 요소(element) cij를 가진 변환 계수의 배열; (nWxnH) array d- an array of transform coefficients with element c ij ; (nWxnH) array d

- 현재 블록의 휘도 신호 및 색차 신호에 대한 인덱스; cIdx- indices for the luminance signal and chrominance signal of the current block; cidx

만일 cIdx 가 ‘0’ 이면 휘도 신호를 의미하고, cIdx가 ‘1’ 이거나 혹은 cIdx가 ‘2’이면 색차 신호를 의미한다. 또한 cIdx 가 ‘1’이면 색차 신호에서 Cb를 의미하고, cIdx 가 ‘2’이면 색차 신호에서 Cr을 의미한다.If cIdx is ‘0’, it means a luminance signal, and if cIdx is ‘1’ or cIdx is ‘2’, it means a color difference signal. Also, if cIdx is ‘1’, it means Cb in the color difference signal, and if cIdx is ‘2’, it means Cr in the color difference signal.

- 양자화 파라미터; qP- quantization parameters; qP

여기서의 출력은 다음과 같다. The output here is:

- 스케일된 변환 계수에 대한 배열; (nWxnH) array dij - array for scaled transform coefficients; (nWxnH) array d ij

변수 log2TrSize 는 log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1 를 통해 유도된다. 변수 shift는 cIdx에 따라 다르게 유도된다. cIx가 ‘0’과 같다면(휘도 신호라면), shift = BitDepthY + log2TrSize - 5 로부터 유도되며, 그렇지 않다면(색차 신호), shift = BitDepthC + log2TrSize - 5 로부터 유도된다. 여기서 BitDepthY 와 BitDepthC 는 현재 영상에 대한 샘플의 비트수(예를 들어, 8 비트)를 의미한다.The variable log2TrSize is derived through log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1. Variable shift is derived differently according to cIdx. If cIx is equal to '0' (if luminance signal), it is derived from shift = BitDepth Y + log2TrSize - 5, otherwise (color difference signal), it is derived from shift = BitDepth C + log2TrSize - 5 . Here, BitDepth Y and BitDepth C mean the number of bits (eg, 8 bits) of a sample for the current image.

스케일링 변수들에 대한 배열 levelScale[ ]은 다음 수학식 1과 같다.The array levelScale[ ] for the scaling variables is as shown in Equation 1 below.

[수학식 1][Equation 1]

Figure pat00001
Figure pat00001

스케일된 변환 계수는 다음의 과정을 통해 계산된다. The scaled transform coefficient is calculated through the following process.

먼저, 스케일 팩터 mij가 다음 과정을 통해 유도된다.First, a scale factor m ij is derived through the following process.

- 만일 scaling_list_enable_flag 가 '0'이라면, mij는 다음 수학식2와 같이 유도된다.- If scaling_list_enable_flag is '0', m ij is derived as shown in Equation 2 below.

[수학식 2][Equation 2]

Figure pat00002
Figure pat00002

- 그렇지 않다면, mij는 다음 수학식 3과 같이 유도된다.- Otherwise, m ij is derived as in Equation 3 below.

[수학식 3][Equation 3]

Figure pat00003
Figure pat00003

여기서, SizeID는 변환 블록의 크기에 따라 아래 표 1을 통해 유도되며, RefMatrixID 그리고 trafoType는 아래 수학식 4와 수학식 5로부터 각각 유도된다. 또한, 수학식 4에서 scaling_list_pred_matrix_id_delta은 비트스트림의 SPS(Sequence Parameter Set) 혹은 PPS(Picture Parameter Set)를 통해 시그널링 된다.Here, SizeID is derived from Table 1 below according to the size of the transform block, and RefMatrixID and trafoType are derived from Equations 4 and 5, respectively. In addition, in Equation 4, scaling_list_pred_matrix_id_delta is signaled through a sequence parameter set (SPS) or a picture parameter set (PPS) of a bitstream.

[수학식 4][Equation 4]

Figure pat00004
Figure pat00004

[수학식 5][Equation 5]

Figure pat00005
Figure pat00005

표 1은 변환 블록의 크기에 따른 SizeID 값을 나타내는 일예이다. Table 1 is an example showing the SizeID value according to the size of the transform block.

[표 1][Table 1]

Figure pat00006
Figure pat00006

다음으로, 스케일된 변환 계수 dij는 다음 수학식 6으로부터 유도된다.Next, the scaled transform coefficient d ij is derived from the following Equation (6).

[수학식 6][Equation 6]

Figure pat00007
Figure pat00007

한편, 상술한 바와 같이 변환 스킵 알고리즘이 적용된 블록(이하, 변환 스킵 블록이라 함)은 주파수 변환 과정을 수행하지 않는다. 따라서, 기존의 주파수 변환 과정을 수행한 블록과 변환 스킵 블록은 서로 다른 변환 계수 특성을 가질 수 있다. 즉, 기존의 주파수 변환 과정을 수행한 블록에 적용하였던 스케일링 방법을 그대로 변환 스킵 블록에 적용할 경우 부호화 효율을 감소시킬 수 있다. Meanwhile, as described above, a block to which the transform skip algorithm is applied (hereinafter referred to as a transform skip block) does not perform a frequency transform process. Accordingly, the block on which the conventional frequency transform process has been performed and the transform skip block may have different transform coefficient characteristics. That is, when the scaling method applied to the block on which the conventional frequency transform process is performed is applied to the transform skip block as it is, the encoding efficiency can be reduced.

따라서, 본 발명에서는 변환 스킵 블록일 경우를 고려하여 스케일링을 수행하는 방법을 제공한다. Accordingly, the present invention provides a method of performing scaling in consideration of a case of a transform skip block.

부호화기와 복호화기에서 영상의 주관적 화질을 향상시키기 위해서 양자화 행렬(기본 행렬 및 비기본 행렬)을 사용하는 경우, 블록 내 변환 계수(transform coefficient)의 위치에 따라 양자화 행렬로부터 유도된 스케일 팩터(scale factor)가 달리 적용될 수 있다. 이러한 방법은 블록의 변환(transform)시 잔여 블록의 에너지가 블록의 좌측 상단 위치(저주파수 영역)로 압축되는 특성을 이용해서 일반적으로 인간의 눈에 민감한 저주파수 영역보다는 인간의 눈에 덜 민감한 고주파수 영역에 대해서 더 큰 양자화 스텝 크기(step size)로 양자화를 수행한다. 이러한 방법을 통해서 영상 부호화 시 인간의 눈에 민감한 영역에 대해 주관적 화질을 향상시킬 수 있다. When quantization matrices (basic matrix and non-basic matrix) are used to improve subjective image quality in the encoder and decoder, a scale factor derived from the quantization matrix according to the position of a transform coefficient in a block ) may be applied differently. This method utilizes the characteristic that the energy of the residual block is compressed to the upper left position (low frequency region) of the block during block transformation, and is generally applied to the high frequency region less sensitive to the human eye than the low frequency region sensitive to the human eye. Quantization is performed with a larger quantization step size. Through this method, it is possible to improve subjective image quality in a region sensitive to the human eye during image encoding.

하지만, 변환 스킵이 적용된 경우, 잔여 블록은 주파수 영역 변환/역변환을 수행하지 않으므로 블록 내에서 저주파수 영역 쪽으로 압축되지 않는다. 이러한 경우 기존의 주파수 영역에 사용하는 양자화/역양자화 방법을 적용하게 되면 영상 혹은 블록 내의 왜곡이 심해지는 단점이 있다. 따라서, 영상 내에서 양자화 행렬을 사용할 경우 주파수 영역 변환/역변환을 수행하지 않는 블록(변환 스킵 블록)에 대해서는 영상 혹은 블록 내의 왜곡을 최소화할 수 있는 스케일링(양자화/역양자화) 방법이 필요하다. 예컨대, 변환 스킵 블록에 대해서는 양자화 행렬이 적용되지 않게 하는 방법이 있다. 이러한 방법은 블록 내 변환 계수의 위치에 상관없이 기본 스케일 팩터를 동일하게 적용할 수 있다. However, when the transform skip is applied, the residual block is not compressed toward the low frequency domain within the block because the frequency domain transform/inverse transform is not performed. In this case, when the quantization/inverse quantization method used in the conventional frequency domain is applied, there is a disadvantage in that the distortion in the image or block becomes severe. Therefore, when a quantization matrix is used in an image, a scaling (quantization/inverse quantization) method capable of minimizing distortion in the image or block is required for a block (transform skip block) that does not perform frequency domain transformation/inverse transformation. For example, there is a method of not applying a quantization matrix to a transform skip block. In this method, the basic scale factor can be equally applied regardless of the position of the transform coefficient in the block.

[실시예1] 변환 스킵 블록에 대하여 블록 내 변환 계수의 위치에 상관없이 스케일 팩터를 동일하게 적용하는 방법 및 장치[Embodiment 1] Method and apparatus for equally applying a scale factor to a transform skip block regardless of a position of a transform coefficient in the block

도 6은 본 발명의 일 실시예에 따른 잔여 신호(혹은 변환 계수)에 대한 스케일링 방법을 나타내는 순서도이다.6 is a flowchart illustrating a scaling method for a residual signal (or a transform coefficient) according to an embodiment of the present invention.

도 6의 방법은 상술한 도 1의 부호화 장치 또는 상술한 도 2의 복호화 장치에서 수행될 수 있다. 보다 구체적으로는, 도 1 또는 도 2의 양자화부 혹은 역양자화부에서 수행될 수 있다. 도 6의 실시예에서는 설명의 편의를 위해 도 6의 방법이 부호화 장치에서 수행되는 것으로 설명하나, 이는 복호화 장치에서도 동일하게 적용될 수 있다.The method of FIG. 6 may be performed by the above-described encoding apparatus of FIG. 1 or the above-described decoding apparatus of FIG. 2 . More specifically, it may be performed in the quantization unit or inverse quantization unit of FIG. 1 or 2 . In the embodiment of FIG. 6 , it is described that the method of FIG. 6 is performed in the encoding apparatus for convenience of description, but this method may be equally applied to the decoding apparatus.

도 6을 참조하면, 현재 블록의 잔여 신호(혹은 변환 계수)에 대한 스케일링(양자화 혹은 역양자화)시 적용되는 스케일 팩터(mij)는 현재 블록이 변환 스킵 블록인지에 따라 유도될 수 있다. Referring to FIG. 6 , a scale factor m ij applied when scaling (quantization or inverse quantization) of a residual signal (or transform coefficient) of a current block may be derived according to whether the current block is a transform skip block.

부호화 장치는 현재 블록이 변환 스킵 블록인지 여부를 판단한다(S600).The encoding apparatus determines whether the current block is a transform skip block (S600).

이때, 현재 블록이 변환 스킵 블록인지 여부는, 변환 스킵 블록인지 여부를 지시하는 정보를 통해 판단될 수 있다. 예를 들어, 변환 스킵 블록인지 여부를 지시하는 정보는 플래그(transSkipFlag)일 수 있다. 이러한 플래그 transSkipFlag 값은 비트스트림 내의 변환 스킵 블록에 관한 정보를 엔트로피 복호화해서 유도될 수 있다. 만일 현재 블록이 변환 스킵 블록이면 transSkipFlag 값이 1이고, 그렇지 않으면 transSkipFlag 값이 0일 수 있다. In this case, whether the current block is a transform skip block may be determined based on information indicating whether the current block is a transform skip block. For example, information indicating whether it is a transform skip block may be a flag (transSkipFlag). This flag transSkipFlag value may be derived by entropy-decoding information on the transform skip block in the bitstream. If the current block is a transform skip block, the transSkipFlag value may be 1, otherwise the transSkipFlag value may be 0.

만일 현재 블록이 변환 스킵 블록일 경우(예컨대, transSkipFlag 값이 1인 경우), 부호화 장치는 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치에 상관없이 스케일 팩터(mij)를 유도한다(S610).If the current block is a transform skip block (eg, when the transSkipFlag value is 1), the encoding apparatus derives the scale factor m ij regardless of the position of the residual signal (or transform coefficient) in the current block (S610) .

이때, 도 6에 도시된 바와 같이, 스케일 팩터(mij)는 소정의 기본 스케일 팩터 값(T)으로 설정될 수 있다. 예를 들어, 소정의 기본 스케일 팩터 값(T)은 16일 수 있다. In this case, as shown in FIG. 6 , the scale factor m ij may be set to a predetermined basic scale factor value T. For example, the predetermined basic scale factor value T may be 16.

그렇지 않고 현재 블록이 변환 스킵 블록이 아닌 경우(예컨대, transSkipFlag 값이 0인 경우), 부호화 장치는 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치를 기반으로 스케일 팩터(mij)를 유도한다(S620).Otherwise, when the current block is not a transform skip block (eg, when the transSkipFlag value is 0), the encoding apparatus derives a scale factor m ij based on the position of the residual signal (or transform coefficient) in the current block ( S620).

이때, 스케일 팩터(mij)는 양자화 행렬을 이용해서 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치에 따라 다르게 설정될 수 있으며, 도 6에 도시된 바와 같이 다음 수학식 7과 같이 유도될 수 있다. In this case, the scale factor m ij may be set differently according to the position of the residual signal (or transform coefficient) in the current block using the quantization matrix, and may be derived as shown in Equation 7 below as shown in FIG. 6 . have.

[수학식 7][Equation 7]

Figure pat00008
Figure pat00008

여기서, ScalingFactor는 스케일 팩터를 저장하고 있는 배열이다. SizeID는 현재 블록(변환 블록 혹은 양자화 행렬)의 크기를 나타내기 위한 값일 수 있으며, 상술한 표 1과 같이 현재 블록(변환 블록)의 크기에 따라 SizeID 값이 유도될 수 있다. RefMatrixID와 trafoType는 아래 수학식 8과 수학식 9로부터 각각 유도될 수 있다. nW는 현재 블록의 너비를 의미한다. Here, ScalingFactor is an array storing the scale factor. SizeID may be a value for indicating the size of the current block (transform block or quantization matrix), and as shown in Table 1 above, the SizeID value may be derived according to the size of the current block (transform block). RefMatrixID and trafoType may be derived from Equations 8 and 9, respectively. nW means the width of the current block.

[수학식 8][Equation 8]

Figure pat00009
Figure pat00009

여기서, MatrixID 값은 예측 모드 및 색 성분(color component)에 따른 양자화 행렬의 종류를 의미할 수 있으며, 일예로 아래 표 2와 같이 MatrixID 값이 유도될 수 있다. scaling_list_pred_matrix_id_delta는 비트스트림의 SPS(Sequence Parameter Set) 혹은 PPS(Picture Parameter Set)를 통해 시그널링 된다.Here, the MatrixID value may mean a type of a quantization matrix according to a prediction mode and a color component, and for example, a MatrixID value may be derived as shown in Table 2 below. scaling_list_pred_matrix_id_delta is signaled through SPS (Sequence Parameter Set) or PPS (Picture Parameter Set) of the bitstream.

[수학식 9][Equation 9]

Figure pat00010
Figure pat00010

여기서, nW는 현재 블록의 너비를 의미하고, nH는 현재 블록의 높이를 의미한다. Here, nW means the width of the current block, and nH means the height of the current block.

표 2는 예측 모드 및 색 성분에 따른 MatrixID 값을 나타낸다.Table 2 shows MatrixID values according to prediction modes and color components.

[표 2][Table 2]

Figure pat00011
Figure pat00011

도 7은 본 발명의 다른 실시예에 따른 잔여 신호(혹은 변환 계수)에 대한 스케일링 방법을 나타내는 순서도이다.7 is a flowchart illustrating a scaling method for a residual signal (or transform coefficient) according to another embodiment of the present invention.

도 7의 방법은 상술한 도 1의 부호화 장치 또는 상술한 도 2의 복호화 장치에서 수행될 수 있다. 보다 구체적으로는, 도 1 또는 도 2의 양자화부 혹은 역양자화부에서 수행될 수 있다. 도 7의 실시예에서는 설명의 편의를 위해 도 7의 방법이 부호화 장치에서 수행되는 것으로 설명하나, 이는 복호화 장치에서도 동일하게 적용될 수 있다.The method of FIG. 7 may be performed by the above-described encoding apparatus of FIG. 1 or the above-described decoding apparatus of FIG. 2 . More specifically, it may be performed in the quantization unit or inverse quantization unit of FIG. 1 or 2 . In the embodiment of FIG. 7 , it is described that the method of FIG. 7 is performed in the encoding apparatus for convenience of description, but this method may be equally applied to the decoding apparatus.

도 7을 참조하면, 현재 블록의 잔여 신호(혹은 변환 계수)에 대한 스케일링(양자화 혹은 역양자화)시 적용되는 스케일 팩터(mij)는 현재 블록이 변환 스킵 블록인지 여부와 양자화 행렬의 사용 여부에 따라 유도될 수 있다. Referring to FIG. 7 , the scale factor (m ij ) applied when scaling (quantization or inverse quantization) of the residual signal (or transform coefficient) of the current block depends on whether the current block is a transform skip block and whether a quantization matrix is used. can be induced accordingly.

부호화 장치는 현재 블록이 양자화 행렬을 사용하는지 여부와 변환 스킵 블록인지 여부를 판단한다(S700).The encoding apparatus determines whether the current block uses a quantization matrix and whether it is a transform skip block (S700).

이때, 현재 블록이 양자화 행렬을 사용하는지 여부는, 양자화 행렬의 사용 여부를 지시하는 정보를 통해 판단할 수 있다. 예를 들어, 양자화 행렬의 사용 여부를 지시하는 정보는 플래그(scaling_list_enable_flag)일 수 있다. 이러한 플래그 scaling_list_enable_flag 값은 비트스트림 내의 양자화 행렬의 사용에 관한 정보를 엔트로피 복호화해서 유도될 수 있다. 만일 현재 블록이 양자화 행렬을 사용할 경우 scaling_list_enable_flag 값은 1이고, 그렇지 않은 경우 scaling_list_enable_flag 값은 0이다. In this case, whether the current block uses the quantization matrix may be determined through information indicating whether the quantization matrix is used. For example, information indicating whether a quantization matrix is used may be a flag (scaling_list_enable_flag). The value of this flag scaling_list_enable_flag may be derived by entropy-decoding information on the use of a quantization matrix in a bitstream. If the current block uses a quantization matrix, the value of scaling_list_enable_flag is 1, otherwise, the value of scaling_list_enable_flag is 0.

또한, 현재 블록이 변환 스킵 블록인지 여부는, 변환 스킵 블록인지 여부를 지시하는 정보를 통해 판단될 수 있다. 예를 들어, 변환 스킵 블록인지 여부를 지시하는 정보는 플래그(transSkipFlag)일 수 있다. 이러한 플래그 transSkipFlag 값은 비트스트림 내의 변환 스킵 블록에 관한 정보를 엔트로피 복호화해서 유도될 수 있다. 만일 현재 블록이 변환 스킵 블록이면 transSkipFlag 값이 1이고, 그렇지 않으면 transSkipFlag 값이 0일 수 있다. Also, whether the current block is a transform skip block may be determined through information indicating whether the current block is a transform skip block. For example, information indicating whether it is a transform skip block may be a flag (transSkipFlag). This flag transSkipFlag value may be derived by entropy-decoding information on the transform skip block in the bitstream. If the current block is a transform skip block, the transSkipFlag value may be 1, otherwise the transSkipFlag value may be 0.

만일 현재 블록이 변환 스킵 블록이거나 혹은 양자화 행렬을 사용하지 않을 경우(예컨대, transSkipFlag == 1 or scaling_list_enable_flag == 0), 부호화 장치는 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치에 상관없이 스케일 팩터(mij)를 유도한다(S710).If the current block is a transform skip block or does not use a quantization matrix (eg, transSkipFlag == 1 or scaling_list_enable_flag == 0), the encoding device performs the scale factor regardless of the position of the residual signal (or transform coefficient) in the current block. (m ij ) is derived (S710).

이때, 도 7에 도시된 바와 같이, 스케일 팩터(mij)는 소정의 기본 스케일 팩터 값(T)으로 설정될 수 있다. 예를 들어, 소정의 기본 스케일 팩터 값(T)은 16일 수 있다. In this case, as shown in FIG. 7 , the scale factor m ij may be set to a predetermined basic scale factor value T. For example, the predetermined basic scale factor value T may be 16.

그렇지 않다면(현재 블록이 변환 스킵 블록이 아니면서 양자화 행렬을 사용할 경우), 부호화 장치는 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치를 기반으로 스케일 팩터(mij)를 유도한다(S720).Otherwise (when the current block is not a transform skip block and a quantization matrix is used), the encoding apparatus derives a scale factor m ij based on the position of the residual signal (or transform coefficient) in the current block ( S720 ).

이때, 스케일 팩터(mij)는 양자화 행렬을 이용해서 현재 블록 내 잔여 신호(혹은 변환 계수)의 위치에 따라 다르게 설정될 수 있으며, 도 7의 단계 S720에 도시된 수학식과 같이 유도될 수 있다. 단계 S720에 도시된 수학식을 통해 유도되는 스케일 팩터(mij)는 도 6(단계 S620)에서 설명한 바와 같으므로, 여기서는 설명을 생략한다. In this case, the scale factor m ij may be set differently according to the position of the residual signal (or transform coefficient) in the current block using the quantization matrix, and may be derived as shown in the equation shown in step S720 of FIG. 7 . Since the scale factor m ij derived through the equation shown in step S720 is the same as described in FIG. 6 (step S620 ), a description thereof will be omitted.

도 6 및 도 7을 통해 상술한 바와 같이, 현재 블록(현재 부호화 혹은 복호화 대상 블록)이 변환 스킵 블록일 경우, 현재 블록 내 계수(혹은 신호)의 위치에 상관없이 현재 블록(변환 스킵 블록)에 대해 소정의 값(T)을 갖는 스케일 팩터를 적용하였다. 이때, 본 발명의 실시예에 따른 스케일 팩터 값은 해당 블록에 적용되는 다양한 부호화 파라미터에 따라 다르게 설정될 수 있다. As described above with reference to FIGS. 6 and 7 , when the current block (the current block to be encoded or decoded) is a transform skip block, regardless of the position of the coefficients (or signals) in the current block, the current block (transform skip block) A scale factor having a predetermined value (T) was applied to . In this case, the scale factor value according to the embodiment of the present invention may be set differently according to various encoding parameters applied to the corresponding block.

일예로, 해당 블록에 적용될 스케일 팩터 값은 양자화 행렬의 사용 여부를 나타내는 파라미터(예를 들어, scaling_list_enable_flag) 값에 따라 아래와 같이 설정될 수 있다. For example, a scale factor value to be applied to a corresponding block may be set as follows according to a value of a parameter (eg, scaling_list_enable_flag) indicating whether a quantization matrix is used.

- 양자화 행렬을 사용하는 경우(예컨대, scaling_list_enable_flag == 1), 기본 스케일 팩터 값은 'T1'으로 설정(mij = T1)- When using a quantization matrix (eg, scaling_list_enable_flag == 1), the default scale factor value is set to 'T1' (m ij = T1)

- 양자화 행렬을 사용하지 않는 경우(예컨대, scaling_list_enable_flag == 0), 기본 스케일 팩터 값은 'T2'으로 설정(mij = T2)- When the quantization matrix is not used (eg, scaling_list_enable_flag == 0), the default scale factor value is set to 'T2' (m ij = T2)

여기서, T1 및/또는 T2 값은 부호화기가 결정하여 시그널링할 수도 있고 미리 정해진 값을 사용할 수도 있다. 비트스트림을 통해 시그널링 될 경우, 복호화기는 비트스트림을 파싱하여 T1 및/또는 T2 값을 구할 수 있다. Here, the T1 and/or T2 values may be determined and signaled by the encoder, or a predetermined value may be used. When signaled through a bitstream, the decoder may parse the bitstream to obtain T1 and/or T2 values.

다른 예로, 해당 블록에 적용될 스케일 팩터 값은 해당 블록의 신호에 대한 색상 특성을 유도할 수 있는 정보(예를 들어, 색상 성분 인덱스 cIdx) 값에 따라 아래와 같이 설정될 수 있다. 색상 성분 인덱스 cIdx는 그 값에 따라 휘도 신호(Y 신호) 혹은 색차 신호(Cb 신호 혹은 Cr 신호)를 나타낸다. As another example, the scale factor value to be applied to the corresponding block may be set as follows according to the value of information (eg, color component index cIdx) capable of inducing color characteristics of the signal of the corresponding block. The color component index cIdx represents a luminance signal (Y signal) or a color difference signal (Cb signal or Cr signal) according to its value.

- 예1 : 해당 블록의 신호가 밝기 신호(휘도 신호)인지 아닌지에 따라 기본 스케일 팩터 값을 ‘Ty’ 혹은 ‘Tc’로 설정. 예를 들어, 밝기 신호이면 기본 스케일 팩터 값을 ‘Ty’로 설정하고, 밝기 신호가 아니면(색차 신호이면) 기본 스케일 팩터 값을 ‘Tc’로 설정함.- Example 1: Set the basic scale factor to ‘Ty’ or ‘Tc’ depending on whether the signal of the corresponding block is a brightness signal (luminance signal) or not. For example, if it is a brightness signal, the default scale factor value is set to ‘Ty’, and if it is not a brightness signal (color difference signal), the default scale factor value is set to ‘Tc’.

- 예2 : 해당 블록의 색상 성분 별로 기본 스케일 팩터 값을 설정. 예를 들어, 휘도 신호(Y 신호)의 경우 기본 스케일 팩터 값을 ‘Ty’로 설정하고, 색차 신호가 Cb 신호일 경우 기본 스케일 팩터 값을 ‘Tcb’로 설정하고, 색차 신호가 Cr 신호일 경우 기본 스케일 팩터 값을 ‘Tcr’로 설정함.- Example 2: Set the default scale factor value for each color component of the block. For example, in the case of a luminance signal (Y signal), the default scale factor value is set to 'Ty', when the chrominance signal is a Cb signal, the default scale factor value is set to 'Tcb', and when the color difference signal is a Cr signal, the default scale Set the factor value to 'Tcr'.

여기서, Ty, Tc, Tcb 및/또는 Tcr 값은 부호화기가 결정하여 시그널링할 수도 있고 미리 정해진 값을 사용할 수도 있다. 비트스트림을 통해 시그널링 될 경우, 복호화기는 비트스트림을 파싱하여 Ty, Tc, Tcb 및/또는 Tcr 값을 구할 수 있다. Here, the Ty, Tc, Tcb, and/or Tcr values may be determined and signaled by the encoder, or a predetermined value may be used. When signaled through a bitstream, the decoder may parse the bitstream to obtain Ty, Tc, Tcb, and/or Tcr values.

상술한 본 발명의 실시예에 따른 부호화 파라미터에 따라 기본 스케일 팩터를 결정하는 방법들은 독립적으로 적용될 수도 있고 조합되어 적용될 수도 있으나, 동일한 변환 스킵 블록에 대하여는 블록(부호화 또는 복호화 대상 블록) 내 계수(혹은 신호)의 위치에 상관없이 항상 동일한 스케일 팩터 값이 적용되어야 한다. The above-described methods for determining the basic scale factor according to the encoding parameter according to the embodiment of the present invention may be applied independently or in combination, but with respect to the same transform skip block, a coefficient (or The same scale factor value should always be applied regardless of the position of the signal).

상술한 본 발명의 실시예들을 반영한 변환 계수의 스케일링 과정(Scaling Process for transform coefficients)은 아래와 같이 수행될 수 있다. The scaling process for transform coefficients reflecting the above-described embodiments of the present invention may be performed as follows.

변환 계수의 스케일링 과정Scaling process of transform coefficients

여기서의 입력은 다음과 같다.The input here is as follows.

- 현재 변환 블록의 너비 Width; nW- Width of the current transformation block Width; nW

- 현재 변환 블록의 높이 Height; nH- Height of the current transformation block Height; nH

- 요소(element) cij를 가진 변환 계수의 배열; (nWxnH) array d- an array of transform coefficients with element c ij ; (nWxnH) array d

- 현재 변환 블록의 변환 스킵 적용 여부 정보- Information on whether transform skip is applied to the current transform block

- 현재 블록의 휘도 신호 및 색차 신호에 대한 인덱스; cIdx- indices for the luminance signal and chrominance signal of the current block; cidx

만일 cIdx 가 ‘0’ 이면 휘도 신호를 의미하고, cIdx가 ‘1’ 이거나 혹은 cIdx가 ‘2’이면 색차 신호를 의미한다. 또한 cIdx 가 ‘1’이면 색차 신호에서 Cb를 의미하고, cIdx 가 ‘2’이면 색차 신호에서 Cr을 의미한다.If cIdx is ‘0’, it means a luminance signal, and if cIdx is ‘1’ or cIdx is ‘2’, it means a color difference signal. Also, if cIdx is ‘1’, it means Cb in the color difference signal, and if cIdx is ‘2’, it means Cr in the color difference signal.

- 양자화 파라미터; qP- quantization parameters; qP

여기서의 출력은 다음과 같다.The output here is:

- 스케일된 변환 계수에 대한 배열; (nWxnH) array dij - array for scaled transform coefficients; (nWxnH) array d ij

변수 log2TrSize 는 log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1 를 통해 유도된다. 변수 shift는 cIdx에 따라 다르게 유도된다. cIx가 ‘0’과 같다면(휘도 신호라면), shift = BitDepthY + log2TrSize - 5 로부터 유도되며, 그렇지 않다면(색차 신호), shift = BitDepthC + log2TrSize - 5 로부터 유도된다. 여기서 BitDepthY 와 BitDepthC 는 현재 영상에 대한 샘플의 비트수(예를 들어, 8 비트)를 의미한다.The variable log2TrSize is derived through log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1. Variable shift is derived differently according to cIdx. If cIx is equal to '0' (if luminance signal), it is derived from shift = BitDepth Y + log2TrSize - 5, otherwise (color difference signal), it is derived from shift = BitDepth C + log2TrSize - 5 . Here, BitDepth Y and BitDepth C mean the number of bits (eg, 8 bits) of a sample for the current image.

스케일링 변수들의 배열 levelScale[]은 다음 수학식 10과 같다.The array levelScale[] of the scaling variables is as shown in Equation 10 below.

[수학식 10][Equation 10]

Figure pat00012
Figure pat00012

스케일된 변환 계수는 다음의 과정을 통해 계산된다. The scaled transform coefficient is calculated through the following process.

먼저, 스케일 팩터 mij가 다음 과정을 통해 유도된다.First, a scale factor m ij is derived through the following process.

- 만일 scaling_list_enable_flag 가 '0'이거나 현재 변환 블록이 변환 스킵 블록이라면, mij는 다음 수학식 11과 같이 유도된다.- If scaling_list_enable_flag is '0' or if the current transform block is a transform skip block, m ij is derived as shown in Equation 11 below.

[수학식 11][Equation 11]

Figure pat00013
Figure pat00013

- 그렇지 않다면, mij는 다음 수학식 12와 같이 유도된다.- Otherwise, m ij is derived as in Equation 12 below.

[수학식 12][Equation 12]

Figure pat00014
Figure pat00014

여기서, SizeID는 블록의 크기에 따라 상술한 표 1을 통해 유도되며, RefMatrixID 그리고 trafoType는 아래 수학식 13과 수학식 14로부터 각각 유도된다. 또한, 수학식 13에서 scaling_list_pred_matrix_id_delta은 비트스트림의 SPS(Sequence Parameter Set)를 통해 시그널링 된다.Here, SizeID is derived from Table 1 according to the size of the block, and RefMatrixID and trafoType are derived from Equations 13 and 14 below, respectively. Also, in Equation 13, scaling_list_pred_matrix_id_delta is signaled through a sequence parameter set (SPS) of the bitstream.

[수학식 13][Equation 13]

Figure pat00015
Figure pat00015

[수학식 14][Equation 14]

Figure pat00016
Figure pat00016

다음으로 스케일된 변환 계수 dij는 다음 수학식 15로부터 유도된다.Next, the scaled transform coefficient d ij is derived from the following Equation (15).

[수학식 15][Equation 15]

Figure pat00017
Figure pat00017

한편, 상기와 같이 스케일링 과정을 통해 스케일된 변환 계수는 역변환 과정을 수행한다. 이때, 변환 스킵이 적용된 현재 변환 블록은 역변환 과정을 수행하지 않고 아래와 같은 ‘shift’ 연산 과정만 수행한다. Meanwhile, the transform coefficient scaled through the scaling process as described above performs an inverse transform process. At this time, the current transform block to which the transform skip is applied does not perform the inverse transform process, but only performs the following 'shift' operation process.

1. 만일 현재 블록의 cIdx가 ‘0’이라면(휘도 신호라면) shift = 13 - BitDepthY 이고, 그렇지 않다면(색차 신호라면) shift = 13 - BitDepthC 이다.1. If the cIdx of the current block is '0' (for a luminance signal), shift = 13 - BitDepth Y , otherwise (for a chrominance signal) shift = 13 - BitDepth C.

2. 잔여 블록에 대한 배열 rij (i=0..(nW)-1, j=0..(nH)-1)는 다음과 같이 설정한다.2. The array r ij (i=0..(nW)-1, j=0..(nH)-1) for the residual block is set as follows.

만일 shift가 ‘0’보다 크다면, rij = ( dij + (1 << ( shift - 1) ) ) >> shift 이고, 그렇지 않다면 rij = ( dij << ( -shift ) 이다.If shift is greater than '0', then r ij = ( d ij + (1 << ( shift - 1) ) ) >> shift, otherwise r ij = ( d ij << ( -shift ).

여기서, dij 는 스케일된 변환 계수에 대한 배열이며, rij 는 스케일된 변환 계수를 역변환하여 구해진 잔여 블록에 대한 배열을 의미한다.Here, d ij is an array of scaled transform coefficients, and r ij is an array of residual blocks obtained by inverse transforming the scaled transform coefficients.

상술한 스케일된 변환 계수의 역변환 과정을 반영한 실시예로, 스케일된 변환 계수를 위한 변환 과정(Transformation process for scaled transform coefficients) 부분은 아래와 같이 수행될 수 있다.As an embodiment reflecting the above-described inverse transformation process of the scaled transform coefficients, a transformation process for scaled transform coefficients may be performed as follows.

스케일된 변환 계수를 위한 변환 과정Transformation Process for Scaled Transform Coefficients

여기서의 입력은 다음과 같다. The input here is as follows.

- 현재 변환 블록의 너비 Width; nW- Width of the current transformation block Width; nW

- 현재 변환 블록의 높이 Height; nH- Height of the current transformation block Height; nH

- 요소(element) dij를 가진 스케일된 변환 계수의 배열; (nWxnH) array d- an array of scaled transform coefficients with element d ij ; (nWxnH) array d

- 현재 블록에 대한 변환 스킵 적용 여부 정보- Information on whether transformation skip is applied to the current block

- 현재 블록의 휘도 신호 및 색차 신호에 대한 인덱스; cIdx- indices for the luminance signal and chrominance signal of the current block; cidx

만일 cIdx 가 ‘0’ 이면 휘도 신호를 의미하고, cIdx가 ‘1’ 이거나 혹은 cIdx가 ‘2’이면 색차 신호를 의미한다. 또한 cIdx 가 ‘1’이면 색차 신호에서 Cb를 의미하고, cIdx 가 ‘2’이면 색차 신호에서 Cr을 의미한다.If cIdx is ‘0’, it means a luminance signal, and if cIdx is ‘1’ or cIdx is ‘2’, it means a color difference signal. Also, if cIdx is ‘1’, it means Cb in the color difference signal, and if cIdx is ‘2’, it means Cr in the color difference signal.

여기서의 출력은 다음과 같다.The output here is:

- 스케일된 변환 계수를 역변환하여 구해진 잔여 블록에 대한 배열; (nWxnH) array r- an arrangement for a residual block obtained by inverse transforming the scaled transform coefficients; (nWxnH) array r

현재 블록에 대한 부호화 모드(PredMode)가 화면 내 예측 모드(Intra)이고, Log2(nW*nH) 값이 ‘4’와 같고 cIdx 값이 ‘0’이면, 휘도 신호의 화면 내 예측 방향 모드(인트라 예측 모드)에 따라 변수 horizTrType과 vertTrType은 아래 표 3를 통해 구해진다. 만일 그렇지 않다면, 변수 horizTrType과 vertTrType은 ‘0’으로 설정한다.If the encoding mode (PredMode) for the current block is the intra prediction mode (Intra), the Log2(nW*nH) value is equal to '4' and the cIdx value is '0', the intra prediction direction mode (intra) of the luminance signal According to the prediction mode), the variables horizTrType and vertTrType are obtained through Table 3 below. If not, the variables horizTrType and vertTrType are set to '0'.

표 3은 인트라 예측 모드에 따른 horizTrType과 vertTrType 값의 일예를 나타낸다. Table 3 shows an example of horizTrType and vertTrType values according to the intra prediction mode.

[표 3][Table 3]

Figure pat00018
Figure pat00018

현재 블록에 대한 잔여 신호는 아래와 같은 순서로 구한다.The residual signal for the current block is obtained in the following order.

먼저, 만일 현재 블록에 대한 변환 스킵이 적용되었을 경우에는 다음을 적용한다. First, if transform skip is applied to the current block, the following is applied.

1. 만일 cIdx가 '0'이라면 shift = 13 - BitDepthY 이고, 그렇지 않다면 shift = 13 - BitDepthC 이다.1. If cIdx is '0' then shift = 13 - BitDepth Y , otherwise shift = 13 - BitDepth C.

2. 잔여 블록에 대한 배열 rij (i=0..(nW)-1, j=0..(nH)-1)는 다음과 같이 설정한다.2. The array r ij (i=0..(nW)-1, j=0..(nH)-1) for the residual block is set as follows.

- 만일 shift가 '0'보다 크다면, rij = ( dij + (1 << ( shift - 1) ) ) >> shift 이고, 그렇지 않다면, rij = ( dij << ( -shift ) 이다.- if shift is greater than '0', r ij = ( d ij + (1 << ( shift - 1) ) ) >> shift, otherwise r ij = ( d ij << ( -shift ) .

만일, 현재 블록에 대한 변환 스킵이 적용되지 않았을 경우에는 다음을 적용한다. If the transform skip for the current block is not applied, the following is applied.

1. 변수 horizTrType과 vertTrType 값을 가지고 스케일된 변환 계수에 대한 역변환 과정을 수행한다. 먼저 현재블록의 크기(nW, nH)와 스케일된 변환 계수 배열(nWxnH array d), 변수 horizTrType 을 입력 받아 수평방향으로 1차원 역변환을 수행하여 배열(nWxnH array e)를 출력한다.1. The inverse transform process is performed on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size of the current block (nW, nH), the scaled transform coefficient array (nWxnH array d), and the variable horizTrType, performs one-dimensional inverse transformation in the horizontal direction, and outputs an array (nWxnH array e).

2. 다음으로 배열(nWxnH array e)을 입력 받아 배열(nWxnH array g)를 다음수학식 16과 같이 유도한다.2. Next, an array (nWxnH array e) is input and an array (nWxnH array g) is derived as in Equation 16 below.

[수학식 16][Equation 16]

Figure pat00019
Figure pat00019

3. 다음으로 현재 블록의 크기(nW, nH)와 배열(nWxnH array g), 변수 vertTrType을 입력 받아 수직방향으로 1차원 역변환을 수행한다.3. Next, the size of the current block (nW, nH), the array (nWxnH array g), and the variable vertTrType are received and one-dimensional inverse transformation is performed in the vertical direction.

4. 다음으로 cIdx에 따라 잔여 블록에 대한 배열 (nWxnH) array r을 다음 수학식 17과 같이 설정한다.4. Next, according to cIdx, an array (nWxnH) array r for the remaining blocks is set as in Equation 17 below.

[수학식 17][Equation 17]

Figure pat00020
Figure pat00020

여기서, shift는 cIdx가 '0'일 때는 shift = 20 - BitDepthY 이고, 그렇지 않으면 shift = 20 - BitDepthC 값을 가진다. BitDepth는 현재 영상에 대한 샘플의 비트수(예를 들어, 8 비트)를 의미한다.Here, shift has a value of shift = 20 - BitDepth Y when cIdx is '0', and shift = 20 - BitDepth C otherwise. BitDepth means the number of bits (eg, 8 bits) of a sample for the current image.

상술한 바와 같은 변환 계수의 스케일링 과정과 스케일된 변환 계수를 위한 변환 과정을 수행함으로써 복원된 잔여 블록을 생성할 수 있다. 그리고 복원된 잔여 블록에, 인트라 예측 혹은 인터 예측을 통해 생성된 예측 블록을 가산함으로써 복원 블록을 생성할 수 있다. 이때, 복원 블록은 루프 필터가 적용된 블록일 수도 있고, 루프 필터가 적용되지 않은 블록일 수도 있다. A reconstructed residual block may be generated by performing the above-described scaling process for transform coefficients and a transform process for the scaled transform coefficients. In addition, a reconstructed block may be generated by adding a prediction block generated through intra prediction or inter prediction to the reconstructed residual block. In this case, the reconstruction block may be a block to which a loop filter is applied or a block to which a loop filter is not applied.

이하, 본 발명에서는 변환 스킵 블록인지 여부에 따라 유도되는 기본 스케일 팩터를 시그널링하는 방법을 제공한다. Hereinafter, the present invention provides a method of signaling a basic scale factor derived according to whether a transform skip block is present.

본 발명의 일 실시예에 따르면, 변환 스킵 블록인지 여부에 따라 유도되는 기본 스케일 팩터는 SPS(Sequence Parameter Set)를 통해 시그널링될 수 있다. According to an embodiment of the present invention, a basic scale factor derived according to whether a transform skip block or not may be signaled through a sequence parameter set (SPS).

표 4는 본 발명의 일 실시예에 따른 기본 스케일 팩터 정보를 시그널링하기 위한 SPS 신택스의 일예를 나타낸다. Table 4 shows an example of SPS syntax for signaling basic scale factor information according to an embodiment of the present invention.

[표 4][Table 4]

Figure pat00021
Figure pat00021

표 4를 참조하면, transform_skip_enabled_flag는 현재 시퀀스에 변환 스킵 알고리즘을 사용할지 여부를 나타낸다. Referring to Table 4, transform_skip_enabled_flag indicates whether to use the transform skip algorithm for the current sequence.

만일 변환 스킵 알고리즘이 사용될 경우, flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16이 시그널링된다. 여기서 이 값들은 양수 혹은 음수 부호를 가지는 형태로 부호화(se(v))될 수 있다. 혹은 이 값들은 0과 양수 부호를 가지는 형태로 부호화(ue(v))될 수 있다. If the transform skip algorithm is used, flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 are signaled. Here, these values may be encoded (se(v)) in a form having a positive or negative sign. Alternatively, these values may be encoded (ue(v)) in a form having 0 and a positive sign.

flat_scale_factor_y_minus16은 휘도 신호에 대한 스케일 팩터를 의미한다. 예를 들어, flat_scale_factor_y_minus16 값이 ‘0’이면 휘도 신호에 대한 스케일 팩터는 상기 ‘0’ 에 ‘16’이 더해져서 ‘16’ 값을 가진다. flat_scale_factor_y_minus16 means a scale factor for the luminance signal. For example, if the flat_scale_factor_y_minus16 value is '0', the scale factor for the luminance signal has a value of '16' by adding '16' to the '0'.

flat_scale_factor_cb_minus16은 색차 신호 Cb에 대한 스케일 팩터를 의미하고, flat_scale_factor_cr_minus16은 색차 신호 Cr에 대한 스케일 팩터를 의미한다. flat_scale_factor_cb_minus16 means a scale factor for the color difference signal Cb, and flat_scale_factor_cr_minus16 means a scale factor for the color difference signal Cr.

이와 관련하여, 휘도 신호 혹은 색차 신호에 대한 스케일 팩터는 다음 수학식 18 내지 20과 같이 유도될 수 있다. In this regard, the scale factor for the luminance signal or the chrominance signal may be derived as shown in Equations 18 to 20 below.

여기서, 기본 스케일 팩터 FlatScalingFactor[cIdx]는 휘도 신호와 색차 신호에 대한 스케일 팩터를 저장하고 있다. 예를 들어, 색상 성분 인덱스 cIdx가 0이면 휘도(Y) 신호, 1이면 Cb 색차 신호, 2이면 Cr 색차 신호를 지시할 수 있다. 또한 FlatScalingFactor[cIdx] 값은 임의의 값의 범위를 가질 수 있으며, 일예로 8비트 신호의 경우 ‘-15’부터 ‘255-16’의 값을 가질 수 있다.Here, the basic scale factor FlatScalingFactor[cIdx] stores scale factors for the luminance signal and the chrominance signal. For example, if the color component index cIdx is 0, it may indicate a luminance (Y) signal, if it is 1, it may indicate a Cb chrominance signal, and if it is 2, it may indicate a Cr chrominance signal. In addition, the FlatScalingFactor[cIdx] value may have an arbitrary range of values, and for example, in the case of an 8-bit signal, it may have a value of '-15' to '255-16'.

휘도 신호에 대한 기본 스케일 팩터는 수학식 18과 같이 유도될 수 있다. A basic scale factor for the luminance signal may be derived as in Equation (18).

[수학식 18][Equation 18]

Figure pat00022
Figure pat00022

Cb 색차 신호에 대한 기본 스케일 팩터는 수학식 19와 같이 유도될 수 있다.A basic scale factor for the Cb color difference signal may be derived as in Equation (19).

[수학식 19][Equation 19]

Figure pat00023
Figure pat00023

Cr 색차 신호에 대한 기본 스케일 팩터는 수학식 20과 같이 유도될 수 있다.A basic scale factor for the Cr chrominance signal may be derived as in Equation (20).

[수학식 20][Equation 20]

Figure pat00024
Figure pat00024

상술한 본 발명의 일 실시예에 따른 변환 스킵 블록인지 여부에 따라 유도되는 기본 스케일 팩터를 시그널링하는 방법을 반영하여, 변환 계수의 스케일링 과정(Scaling Process for transform coefficients)을 아래와 같이 수행할 수 있다. By reflecting the above-described method of signaling a basic scale factor derived according to whether a transform skip block is a transform skip block according to an embodiment of the present invention, a scaling process for transform coefficients may be performed as follows.

변환 계수의 스케일링 과정Scaling process of transform coefficients

여기서의 입력은 다음과 같다. The input here is as follows.

- 현재 변환 블록의 너비 Width; nW- Width of the current transformation block Width; nW

- 현재 변환 블록의 높이 Height; nH- Height of the current transformation block Height; nH

- 요소(element) cij를 가진 변환 계수의 배열; (nWxnH) array d- an array of transform coefficients with element c ij ; (nWxnH) array d

- 현재 변환 블록의 변환 스킵 적용 여부 정보; transSkipFlag- information on whether transform skip is applied to the current transform block; transSkipFlag

transSkipFlag 값이 1이면 현재 블록에 변환 스킵이 적용되었음을 나타내고, transSkipFlag 값이 0이면 현재 블록에 변환 스킵이 적용되지 않았음을 나타낸다.A transSkipFlag value of 1 indicates that transform skip is applied to the current block, and a transSkipFlag value of 0 indicates that no transform skip is applied to the current block.

- 현재 블록의 휘도 신호 및 색차 신호에 대한 인덱스; cIdx- indices for the luminance signal and chrominance signal of the current block; cidx

만일 cIdx가 ‘0’이면 휘도 신호를 의미하고, cIdx가 ‘1’이거나 혹은 cIdx가 ‘2’이면 색차 신호를 의미한다. 또한 cIdx가 ‘1’이면 색차 신호에서 Cb를 의미하고, cIdx가 ‘2’이면 색차 신호에서 Cr을 의미한다.If cIdx is ‘0’, it means a luminance signal, and if cIdx is ‘1’ or cIdx is ‘2’, it means a color difference signal. Also, if cIdx is ‘1’, it means Cb in the color difference signal, and if cIdx is ‘2’, it means Cr in the color difference signal.

- 양자화 파라미터; qP- quantization parameters; qP

여기서의 출력은 다음과 같다.The output here is:

- 스케일된 변환 계수에 대한 배열; (nWxnH) array dij - array for scaled transform coefficients; (nWxnH) array d ij

변수 log2TrSize 는 log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1 를 통해 유도된다. 변수 shift는 cIdx에 따라 다르게 유도된다. cIx가 ‘0’과 같다면(휘도 신호라면), shift = BitDepthY + log2TrSize - 5 로부터 유도되며, 그렇지 않다면(색차 신호), shift = BitDepthC + log2TrSize - 5 로부터 유도된다. 여기서 BitDepthY 와 BitDepthC 는 현재 영상에 대한 샘플의 비트수(예를 들어, 8 비트)를 의미한다.The variable log2TrSize is derived through log2TrSize = ( Log2( nW ) + Log2( nH ) ) >> 1. Variable shift is derived differently according to cIdx. If cIx is equal to '0' (if luminance signal), it is derived from shift = BitDepth Y + log2TrSize - 5, otherwise (color difference signal), it is derived from shift = BitDepth C + log2TrSize - 5 . Here, BitDepth Y and BitDepth C mean the number of bits (eg, 8 bits) of a sample for the current image.

스케일링 변수들의 배열 levelScale[]은 다음 수학식 21과 같다.The array levelScale[] of the scaling variables is expressed by Equation 21 below.

[수학식 21][Equation 21]

Figure pat00025
Figure pat00025

스케일된 변환 계수는 다음의 과정을 통해 계산된다. The scaled transform coefficient is calculated through the following process.

먼저, 스케일 팩터 mij가 다음 과정을 통해 유도된다.First, a scale factor m ij is derived through the following process.

- 만일 scaling_list_enable_flag 가 '0'이라면, mij는 다음 수학식 22와 같이 유도된다.- If scaling_list_enable_flag is '0', m ij is derived as shown in Equation 22 below.

[수학식 22][Equation 22]

Figure pat00026
Figure pat00026

- 그렇지 않다면(즉, scaling_list_enable_flag 가 '1'이라면, mij는 다음 수학식 23과 같이 유도된다.- Otherwise (that is, if scaling_list_enable_flag is '1', m ij is derived as in Equation 23 below.

[수학식 23][Equation 23]

Figure pat00027
Figure pat00027

여기서, SizeID는 블록의 크기에 따라 상술한 표 1을 통해 유도되며, RefMatrixID 그리고 trafoType는 아래 수학식 24와 수학식 25로부터 각각 유도된다. 수학식 24에서 scaling_list_pred_matrix_id_delta은 비트스트림의 SPS(Sequence Parameter Set)를 통해 시그널링 된다.Here, SizeID is derived from Table 1 according to the size of the block, and RefMatrixID and trafoType are derived from Equations 24 and 25 below, respectively. In Equation 24, scaling_list_pred_matrix_id_delta is signaled through a sequence parameter set (SPS) of a bitstream.

[수학식 24][Equation 24]

Figure pat00028
Figure pat00028

[수학식 25][Equation 25]

Figure pat00029
Figure pat00029

다음으로 스케일된 변환 계수 dij는 다음 수학식 26으로부터 유도된다.Next, the scaled transform coefficient d ij is derived from the following equation (26).

[수학식 26][Equation 26]

Figure pat00030
Figure pat00030

한편, 본 발명의 실시예에 따른 변환 스킵 블록인지 여부에 따라 유도되는 기본 스케일 팩터는 상술한 SPS뿐만 아니라 PPS(Picture Parameter Set) 혹은 슬라이스 헤더(SliceHeader)를 통해 시그널링될 수 있다. 또한 CU 단위 혹은 TU 단위로 시그널링될 수도 있다. On the other hand, the basic scale factor derived according to whether a transform skip block according to an embodiment of the present invention can be signaled through a picture parameter set (PPS) or a slice header as well as the above-described SPS. Also, it may be signaled in units of CUs or units of TUs.

상술한 SPS에서 시그널링되는 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값은 PPS(혹은 SliceHeader, CU, TU)에서 갱신하여 사용할 수 있다. The flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values signaled in the above-described SPS may be updated and used in the PPS (or SliceHeader, CU, TU).

표 5는 본 발명의 다른 실시예에 따른 기본 스케일 팩터 정보를 시그널링하기 위한 PPS 신택스의 일예를 나타낸다. Table 5 shows an example of PPS syntax for signaling basic scale factor information according to another embodiment of the present invention.

[표 5][Table 5]

Figure pat00031
Figure pat00031

표 5를 참조하면, transform_skip_enabled_flag는 현재 픽처에 변환 스킵 알고리즘을 사용할지 여부를 나타낸다. 만일 변환 스킵 알고리즘이 사용될 경우, pps_flat_scaling_factor_present_flag 값이 시그널링된다. Referring to Table 5, transform_skip_enabled_flag indicates whether to use the transform skip algorithm for the current picture. If the transform skip algorithm is used, the pps_flat_scaling_factor_present_flag value is signaled.

예를 들어, 만일 pps_flat_scaling_factor_present_flag 값이 ‘0’일 경우, 상술한 SPS에서 적용하였던 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16을 변환 스킵 블록을 위한 스케일 팩터로 사용한다. 그렇지 않고 만일 pps_flat_scaling_factor_present_flag 값이 ‘1’일 경우, 상술한 SPS에서 적용하였던 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값을 갱신하기 위하여 해당 값들이 시그널링 된다.For example, if the value of pps_flat_scaling_factor_present_flag is '0', flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 applied in the above-described SPS are used as scale factors for the transform skip block. Otherwise, if the pps_flat_scaling_factor_present_flag value is ‘1’, the values are signaled to update the flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values applied in the above-described SPS.

시그널링된 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값들은 현재 픽처의 변환 스킵 블록에 대한 스케일 팩터로 사용된다. 이때, 이 값들은 다시 변경되지 않을 때까지 계속 사용될 수 있다. 혹은 이 값들은 현재 픽처에만 적용하여 사용하고 다음 픽처에서는 SPS에서 사용하였던 스케일 팩터 값들을 적용할 수 있다.The signaled flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values are used as scale factors for the transform skip block of the current picture. In this case, these values can continue to be used until they are not changed again. Alternatively, these values may be applied and used only to the current picture, and the scale factor values used in the SPS may be applied to the next picture.

여기서, flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16은 양수 혹은 음수 부호를 가지는 형태로 부호화(se(v))될 수 있다. 혹은 이 값들은 0과 양수 부호를 가지는 형태로 부호화(ue(v))될 수 있다. Here, flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 may be encoded (se(v)) in a form having a positive or negative sign. Alternatively, these values may be encoded (ue(v)) in a form having 0 and a positive sign.

flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값들은 휘도 신호 및 색차 신호마다 각각 다른 값을 가지고 각각 시그널링될 수 있다. 예컨대, flat_scale_factor_y_minus16 값은 휘도 신호에 대한 스케일 팩터, flat_scale_factor_cb_minus16 값은 Cb 색차 신호에 대한 스케일 팩터, flat_scale_factor_cr_minus16 값은 Cr 색차 신호에 대한 스케일 팩터를 시그널링하는데 사용될 수 있다. 혹은, 휘도 신호에 대한 스케일 팩터로 flat_scale_factor_y_minus16, 색차 신호에 대한 스케일 팩터로 flat_scale_factor_cb_cr_minus16을 이용하여 시그널링할 수도 있다. 혹은, 휘도 신호 및 색차 신호에 대한 스케일 팩터로 하나의 값 flat_scale_factor_y_cb_cr_minus16을 이용하여 시그널링할 수도 있다. The flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values may have different values for each of the luminance signal and the chrominance signal and may be respectively signaled. For example, the flat_scale_factor_y_minus16 value may be used to signal a scale factor for the luminance signal, the flat_scale_factor_cb_minus16 value may be used to signal a scale factor for the Cb chrominance signal, and the flat_scale_factor_cr_minus16 value may be used to signal a scale factor for the Cr chrominance signal. Alternatively, the signal may be signaled using flat_scale_factor_y_minus16 as the scale factor for the luminance signal and flat_scale_factor_cb_cr_minus16 as the scale factor for the chrominance signal. Alternatively, one value flat_scale_factor_y_cb_cr_minus16 may be used as a scale factor for the luminance signal and the chrominance signal.

상술한 바와 같이, SPS 혹은 PPS에서 시그널링되는 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값은 SliceHeader(혹은 CU, TU)에서 갱신하여 사용할 수 있다. As described above, the flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values signaled by the SPS or PPS may be updated and used in the SliceHeader (or CU, TU).

표 6은 본 발명의 또 다른 실시예에 따른 기본 스케일 팩터 정보를 시그널링하기 위한 슬라이스 헤더(SliceHeader) 신택스의 일예를 나타낸다. Table 6 shows an example of a slice header syntax for signaling basic scale factor information according to another embodiment of the present invention.

[표 6][Table 6]

Figure pat00032
Figure pat00032

표 6을 참조하면, transform_skip_enabled_flag는 현재 슬라이스에 변환 스킵 알고리즘을 사용할지 여부를 나타낸다. 만일 변환 스킵 알고리즘이 사용될 경우, flat_scaling_factor_override_flag 값이 시그널링된다. Referring to Table 6, transform_skip_enabled_flag indicates whether to use the transform skip algorithm for the current slice. If the transform skip algorithm is used, a flat_scaling_factor_override_flag value is signaled.

예를 들어, 만일 flat_scaling_factor_override_flag 값이 ‘0’일 경우, 상술한 SPS 혹은 PPS에서 적용하였던 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16을 변환 스킵 블록을 위한 스케일 팩터로 사용한다. 그렇지 않고 만일 flat_scaling_factor_override_flag 값이 ‘1’일 경우, 상술한 SPS 혹은 PPS에서 적용하였던 flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, flat_scale_factor_cr_minus16 값을 갱신하기 위하여 해당 값들이 시그널링된다.For example, if the flat_scaling_factor_override_flag value is '0', flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 applied in the aforementioned SPS or PPS are used as scale factors for the transform skip block. Otherwise, if the flat_scaling_factor_override_flag value is '1', corresponding values are signaled to update the flat_scale_factor_y_minus16, flat_scale_factor_cb_minus16, and flat_scale_factor_cr_minus16 values applied in the aforementioned SPS or PPS.

flat_scale_factor_y_delta, flat_scale_factor_cb_delta, flat_scale_factor_cr_delta 값들은 현재 슬라이스의 변환 스킵 블록에 대한 스케일 팩터로 사용된다. The flat_scale_factor_y_delta, flat_scale_factor_cb_delta, and flat_scale_factor_cr_delta values are used as scale factors for the transform skip block of the current slice.

여기서, flat_scale_factor_y_delta, flat_scale_factor_cb_delta, flat_scale_factor_cr_delta 값들은 양수 혹은 음수 부호를 가지는 형태로 부호화(se(v))될 수 있다. 혹은 이 값들은 0과 양수 부호를 가지는 형태로 부호화(ue(v))될 수 있다. Here, flat_scale_factor_y_delta, flat_scale_factor_cb_delta, and flat_scale_factor_cr_delta values may be coded (se(v)) in a form having a positive or negative sign. Alternatively, these values may be encoded (ue(v)) in a form having 0 and a positive sign.

flat_scale_factor_y_delta, flat_scale_factor_cb_delta, flat_scale_factor_cr_delta 값들은 휘도 신호 및 색차 신호마다 각각 다른 값을 가지고 각각 시그널링될 수 있다. 예컨대, flat_scale_factor_y_delta 값은 휘도 신호에 대한 스케일 팩터, flat_scale_factor_cb_delta 값은 Cb 색차 신호에 대한 스케일 팩터, flat_scale_factor_cr_delta 값은 Cr 색차 신호에 대한 스케일 팩터를 시그널링하는데 사용될 수 있다. 혹은, 휘도 신호에 대한 스케일 팩터로 flat_scale_factor_y_delta, 색차 신호에 대한 스케일 팩터로 flat_scale_factor_cb_cr_delta를 이용하여 시그널링할 수도 있다. 혹은, 휘도 신호 및 색차 신호에 대한 스케일 팩터로 하나의 값 flat_scale_factor_y_cb_cr_delta을 이용하여 시그널링할 수도 있다. The flat_scale_factor_y_delta, flat_scale_factor_cb_delta, and flat_scale_factor_cr_delta values may have different values for each of the luminance signal and the chrominance signal and may be respectively signaled. For example, a flat_scale_factor_y_delta value may be used to signal a scale factor for a luminance signal, a flat_scale_factor_cb_delta value to a scale factor for a Cb chrominance signal, and a flat_scale_factor_cr_delta value to signal a scale factor for a Cr chrominance signal. Alternatively, the signal may be performed using flat_scale_factor_y_delta as the scale factor for the luminance signal and flat_scale_factor_cb_cr_delta as the scale factor for the chrominance signal. Alternatively, a single value flat_scale_factor_y_cb_cr_delta may be used as a scale factor for the luminance signal and the chrominance signal.

상기와 같이 시그널링된 flat_scale_factor_y_delta, flat_scale_factor_cb_delta, flat_scale_factor_cr_delta 값들을 이용하여 아래 수학식 27 내지 29와 같이 기본 스케일 팩터를 유도할 수 있다. A basic scale factor may be derived as shown in Equations 27 to 29 below by using the flat_scale_factor_y_delta, flat_scale_factor_cb_delta, and flat_scale_factor_cr_delta values signaled as described above.

여기서, 기본 스케일 팩터 FlatScalingFactor[cIdx]는 휘도 신호와 색차 신호에 대한 스케일 팩터를 저장하고 있다. 예를 들어, 색상 성분 인덱스 cIdx가 0이면 휘도(Y) 신호, 1이면 Cb 색차 신호, 2이면 Cr 색차 신호를 지시할 수 있다. 또한 FlatScalingFactor[cIdx] 값은 임의의 값의 범위를 가질 수 있으며, 일예로 8비트 신호의 경우 ‘-15’부터 ‘255-16’의 값을 가질 수 있다.Here, the basic scale factor FlatScalingFactor[cIdx] stores scale factors for the luminance signal and the chrominance signal. For example, if the color component index cIdx is 0, it may indicate a luminance (Y) signal, if it is 1, it may indicate a Cb chrominance signal, and if it is 2, it may indicate a Cr chrominance signal. In addition, the FlatScalingFactor[cIdx] value may have an arbitrary range of values, and for example, in the case of an 8-bit signal, it may have a value of '-15' to '255-16'.

휘도 신호에 대한 기본 스케일 팩터는 flat_scale_factor_y_delta를 이용하여 수학식 27과 같이 유도될 수 있다.A basic scale factor for the luminance signal may be derived as in Equation 27 using flat_scale_factor_y_delta.

[수학식 27][Equation 27]

Figure pat00033
Figure pat00033

Cb 색차 신호에 대한 기본 스케일 팩터는 flat_scale_factor_cb_delta를 이용하여 수학식 28과 같이 유도될 수 있다.A basic scale factor for the Cb color difference signal may be derived as in Equation 28 using flat_scale_factor_cb_delta.

[수학식 28][Equation 28]

Figure pat00034
Figure pat00034

Cr 색차 신호에 대한 기본 스케일 팩터는 flat_scale_factor_cr_delta를 이용하여 수학식 29와 같이 유도될 수 있다.A basic scale factor for the Cr chrominance signal may be derived as in Equation 29 using flat_scale_factor_cr_delta.

[수학식 29][Equation 29]

Figure pat00035
Figure pat00035

한편, 상술한 실시예들은 블록 크기 혹은 CU 깊이 혹은 TU 깊이 등에 따라 적용 범위를 달리할 수 있다. 이렇게 적용 범위를 결정하는 변수(예컨대, 블록의 크기 혹은 깊이 정보)는, 부호화기 및 복호화기가 미리 정해진 값을 사용하도록 설정할 수도 있고, 프로파일 또는 레벨에 따라 정해진 값을 사용하도록 할 수도 있고, 부호화기가 변수 값을 비트스트림에 기재하면 복호화기가 비트스트림으로부터 이 값을 구하여 사용할 수도 있다. Meanwhile, the above-described embodiments may have different application ranges according to the block size, CU depth, or TU depth. As for the variable (eg, block size or depth information) that determines the application range in this way, the encoder and the decoder may be set to use a predetermined value, or a value determined according to a profile or level may be used, and the encoder may set the variable If the value is written in the bitstream, the decoder may obtain this value from the bitstream and use it.

CU 깊이에 따라 적용 범위를 달리할 때는 표 7에 예시한 바와 같이, 다음 세가지 방법이 적용될 수 있다. 방법 A는 주어진 깊이 이상의 깊이에만 적용하는 방식, 방법 B는 주어진 깊이 이하에만 적용하는 방식, 방법 C는 주어진 깊이에만 적용하는 방식이다. When changing the application range according to the CU depth, as illustrated in Table 7, the following three methods can be applied. Method A is applied only to a depth greater than or equal to a given depth, Method B is applied only to a depth below a given depth, and Method C is applied only to a given depth.

표 7은 CU(혹은 TU) 깊이에 따라 본 발명의 방법들을 적용하는 범위를 결정하는 방법의 일예를 나타낸 것이다. 표 7에서 ‘O’ 표기는 CU(혹은 TU)의 해당 깊이에 해당 방법을 적용하는 것을 의미하며, ‘X’ 표기는 CU(혹은 TU)의 해당 깊이에 해당 방법을 적용하지 않는 것을 의미한다. Table 7 shows an example of a method of determining a range to which the methods of the present invention are applied according to a CU (or TU) depth. In Table 7, the ‘O’ notation means that the method is applied to the corresponding depth of the CU (or TU), and the ‘X’ notation means that the corresponding method is not applied to the corresponding depth of the CU (or TU).

[표 7][Table 7]

Figure pat00036
Figure pat00036

표 7을 참조하면, CU(혹은 TU) 깊이가 2인 경우, 본 발명의 실시예들에 대해 방법 A, 방법 B, 방법 C를 모두 적용할 수 있다.Referring to Table 7, when a CU (or TU) depth is 2, method A, method B, and method C may all be applied to embodiments of the present invention.

CU(혹은 TU)의 모든 깊이에 대하여 본 발명의 실시예들을 적용하지 않는 경우, 임의의 지시자(예를 들어, flag)를 사용하여 나타낼 수도 있고, CU 깊이의 최대값보다 하나 더 큰 값을 적용 범위를 나타내는 CU 깊이 값으로 시그널링 함으로써 표현할 수도 있다.If the embodiments of the present invention are not applied to all depths of a CU (or TU), it may be indicated using an arbitrary indicator (eg, flag), and a value one larger than the maximum value of the CU depth is applied. It can also be expressed by signaling with a CU depth value indicating a range.

또한, 상술한 CU(혹은 TU) 깊이에 따라 본 발명의 방법들을 적용하는 범위를 결정하는 방법은, 휘도 블록과 색차 블록의 크기에 따라 다르게 적용할 수 있으며, 또한 휘도 영상 및 색차 영상에 다르게 적용할 수 있다. In addition, the method for determining the range to which the methods of the present invention are applied according to the CU (or TU) depth described above can be applied differently depending on the sizes of the luminance block and the chrominance block, and also differently applied to the luminance image and the chrominance image can do.

표 8은 휘도 블록 및 색차 블록의 크기에 따라 적용 범위를 결정하는 방법들의 조합을 개략적으로 나타낸 일예이다. Table 8 is an example schematically showing a combination of methods for determining an application range according to sizes of a luminance block and a chrominance block.

[표 8][Table 8]

Figure pat00037
Figure pat00037

표 8의 방법들 중 방법 “사 1”을 살펴보면, 휘도 블록의 크기가 8(8x8, 8x4, 2x8 등)인 경우이고 그리고 색차 블록의 크기가 4(4x4, 4x2, 2x4)인 경우, 본 발명의 실시예1(사 1 - 실시예1)을 휘도 신호 및 색차 신호 및 수평 신호 및 수직 신호에 적용할 수 있다. Referring to method “4 1” among the methods in Table 8, when the size of the luminance block is 8 (8x8, 8x4, 2x8, etc.) and the size of the chrominance block is 4 (4x4, 4x2, 2x4), the present invention Example 1 of (4-1 - Example 1) can be applied to a luminance signal and a chrominance signal, and a horizontal signal and a vertical signal.

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

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시 예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시 예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호범위는 특허청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다. The above description is merely illustrative of the technical spirit of the present invention, and various modifications and variations will be possible without departing from the essential characteristics of the present invention by those skilled in the art to which the present invention pertains. Therefore, the embodiments disclosed in the present invention are not intended to limit the technical spirit of the present invention, but to explain, and the scope of the technical spirit of the present invention is not limited by these embodiments. The protection scope of the present invention should be construed by the claims, and all technical ideas within the scope equivalent thereto should be construed as being included in the scope of the present invention.

Claims (3)

영상 복호화 방법에 있어서,
현재 픽처에 대한 변환 스킵 적용이 가능한지 또는 가능하지 않은지를 지시하는 제 1 플래그를 획득하는 단계;
상기 현재 픽처에 포함되는 현재 블록에 대한 변환 스킵이 적용되었는지 또는 적용되지 않았는지를 지시하는 제 2 플래그를 획득하는 단계;
상기 현재 블록에 대한 양자화 파라미터를 유도하는 단계;
상기 제 1 플래그의 값 및 상기 제 2 플래그의 값에 기반하여, 상기 현재 블록에 대한 스케일 팩터를 도출하는 단계; 및
상기 스케일 팩터 및 상기 양자 화파라미터를 기반으로 상기 현재 블록의 변환 계수에 대한 스케일링을 수행하는 단계를 포함하며,
상기 현재 블록에 대한 스케일 팩터는,
상기 제 1 플래그가 상기 현재 픽처에 대한 변환 스킵의 적용이 가능함을 지시하는 제 1 값을 지시하고, 상기 제 2 플래그가 상기 현재 블록에 대한 변환 스킵이 적용되지 않음을 지시하는 제 2 값을 지시하는 경우, 미리 정의된 양자화 행렬과 상기 현재 블록 내 변환 계수의 위치를 기반으로 도출되고,
상기 제 1 플래그가 상기 현재 픽처에 대한 변환 스킵의 적용이 가능함을 지시하는 상기 제 1 값을 지시하고, 상기 제 2 플래그가, 상기 현재 블록에 대한 변환 스킵이 적용됨을 지시하는 상기 제 1 값을 지시하는 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 고정된 상수값으로 도출되고,
상기 제 1 플래그는 PPS(Picture Parameter Set) 레벨에서 시그널링되고, 상기 제 2 플래그는 TU(Transform Unit) 레벨에서 시그널링되는 것을 특징으로 하는 영상 복호화 방법.
In the video decoding method,
obtaining a first flag indicating whether transform skip application to the current picture is possible or not;
obtaining a second flag indicating whether transform skip is applied or not applied to a current block included in the current picture;
deriving a quantization parameter for the current block;
deriving a scale factor for the current block based on the value of the first flag and the value of the second flag; and
performing scaling on the transform coefficients of the current block based on the scale factor and the quantization parameter,
The scale factor for the current block is,
The first flag indicates a first value indicating that transform skip is applicable to the current picture, and the second flag indicates a second value indicating that transform skip is not applied to the current block If , it is derived based on a predefined quantization matrix and the position of the transform coefficient in the current block,
The first flag indicates the first value indicating that the transform skip is applicable to the current picture, and the second flag indicates the first value indicating that the transform skip is applied to the current block. When indicated, it is derived as a fixed constant value regardless of the position of the transform coefficient in the current block,
The first flag is signaled at a picture parameter set (PPS) level, and the second flag is signaled at a transform unit (TU) level.
영상 부호화 방법에 있어서,
현재 픽처에 대한 변환 스킵의 적용이 가능한지 여부를 판단하는 단계;
상기 현재 픽처에 포함되는 현재 블록에 대한 변환 스킵의 적용 여부를 판단하는 단계;
상기 현재 블록에 대한 양자화 파라미터를 결정하는 단계;
상기 현재 픽처에 대한 변환 스킵이 가능한지 여부를 나타내는 제 1 플래그 및 상기 현재 블록에 대한 변환 스킵이 적용되는지 여부를 나타내는 제 2 플래그 중 적어도 하나를 인코딩하는 단계, 이때, 상기 제 1 플래그는 PPS(Picture Parameter Set) 레벨에서 인코딩되고, 상기 제 2 플래그는 TU(Transform Unit) 레벨에서 인코딩 됨;
현재 픽처에 대한 변환 스킵의 적용이 가능한지 여부 및 상기 현재 블록에 대한 변환 스킵의 적용 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 결정하는 단계;
상기 스케일 팩터 및 상기 양자화 파라미터를 기반으로 상기 현재 블록의 변환 계수에 대한 양자화를 수행하는 단계를 포함하며,
상기 현재 블록에 대한 스케일 팩터는,
상기 현재 픽처에 대한 변환 스킵의 적용이 가능하고, 상기 현재 블록에 대해 변환 스킵이 적용되지 않는 경우, 미리 정의된 양자화 행렬과 상기 현재 블록 내 변환 계수의 위치를 기반으로 결정되고,
상기 현재 픽처에 대한 변환 스킵의 적용이 가능하고, 상기 현재 블록에 대해 변환 스킵이 적용되는 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 고정된 상수값으로 결정되는 것을 특징으로 하는 영상 부호화 방법.
In the video encoding method,
determining whether it is possible to apply transform skip to the current picture;
determining whether transform skip is applied to a current block included in the current picture;
determining a quantization parameter for the current block;
encoding at least one of a first flag indicating whether transform skip for the current picture is possible and a second flag indicating whether transform skip for the current block is applied, wherein the first flag is a picture Parameter Set) level is encoded, and the second flag is encoded at a TU (Transform Unit) level;
determining a scale factor for the current block according to whether transform skip can be applied to the current picture and whether transform skip is applied to the current block;
performing quantization on the transform coefficients of the current block based on the scale factor and the quantization parameter,
The scale factor for the current block is,
When the transform skip can be applied to the current picture and the transform skip is not applied to the current block, it is determined based on a predefined quantization matrix and the positions of transform coefficients in the current block,
An image encoding method characterized in that when transform skip can be applied to the current picture and transform skip is applied to the current block, a fixed constant value is determined regardless of a position of a transform coefficient in the current block .
영상 부호화 방법을 이용하여 생성된 비트스트림을 전송하는 방법에 있어서,
상기 영상 부호화 방법은,
현재 픽처에 대한 변환 스킵의 적용이 가능한지 여부를 판단하는 단계;
상기 현재 픽처에 포함되는 현재 블록에 대한 변환 스킵의 적용 여부를 판단하는 단계;
상기 현재 블록에 대한 양자화 파라미터를 결정하는 단계;
상기 현재 픽처에 대한 변환 스킵이 가능한지 여부를 나타내는 제 1 플래그 및 상기 현재 블록에 대한 변환 스킵이 적용되는지 여부를 나타내는 제 2 플래그 중 적어도 하나를 인코딩하는 단계, 이때, 상기 제 1 플래그는 PPS(Picture Parameter Set) 레벨에서 인코딩되고, 상기 제 2 플래그는 TU(Transform Unit) 레벨에서 인코딩 됨;
현재 픽처에 대한 변환 스킵의 적용이 가능한지 여부 및 상기 현재 블록에 대한 변환 스킵의 적용 여부에 따라 상기 현재 블록에 대한 스케일 팩터를 결정하는 단계;
상기 스케일 팩터 및 상기 양자화 파라미터를 기반으로 상기 현재 블록의 변환 계수에 대한 양자화를 수행하는 단계를 포함하며,
상기 현재 블록에 대한 스케일 팩터는,
상기 현재 픽처에 대한 변환 스킵의 적용이 가능하고, 상기 현재 블록에 대해 변환 스킵이 적용되지 않는 경우, 미리 정의된 양자화 행렬과 상기 현재 블록 내 변환 계수의 위치를 기반으로 결정되고,
상기 현재 픽처에 대한 변환 스킵의 적용이 가능하고, 상기 현재 블록에 대해 변환 스킵이 적용되는 경우, 상기 현재 블록 내 변환 계수의 위치에 상관없이 고정된 상수값으로 결정되는 것을 특징으로 하는 비트스트림 전송 방법.
In a method of transmitting a bitstream generated using an image encoding method,
The video encoding method comprises:
determining whether it is possible to apply transform skip to the current picture;
determining whether transform skip is applied to a current block included in the current picture;
determining a quantization parameter for the current block;
encoding at least one of a first flag indicating whether transform skip for the current picture is possible and a second flag indicating whether transform skip for the current block is applied, wherein the first flag is a picture Parameter Set) level is encoded, and the second flag is encoded at a TU (Transform Unit) level;
determining a scale factor for the current block according to whether transform skip can be applied to the current picture and whether transform skip is applied to the current block;
performing quantization on the transform coefficients of the current block based on the scale factor and the quantization parameter,
The scale factor for the current block is,
When the transform skip can be applied to the current picture and the transform skip is not applied to the current block, it is determined based on a predefined quantization matrix and the positions of transform coefficients in the current block,
Bitstream transmission, characterized in that when the transform skip can be applied to the current picture and the transform skip is applied to the current block, a fixed constant value is determined regardless of the position of the transform coefficient in the current block Way.
KR1020220059344A 2012-07-02 2022-05-16 Method and apparatus for image encoding/decoding KR102577480B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020230118776A KR20230134107A (en) 2012-07-02 2023-09-07 Method and apparatus for image encoding/decoding

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
KR1020120071938 2012-07-02
KR20120071938 2012-07-02
KR1020120073847 2012-07-06
KR20120073847 2012-07-06
KR20120074814 2012-07-10
KR1020120074814 2012-07-10
KR1020130077047A KR102399795B1 (en) 2012-07-02 2013-07-02 Method and apparatus for image encoding/decoding

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020130077047A Division KR102399795B1 (en) 2012-07-02 2013-07-02 Method and apparatus for image encoding/decoding

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020230118776A Division KR20230134107A (en) 2012-07-02 2023-09-07 Method and apparatus for image encoding/decoding

Publications (2)

Publication Number Publication Date
KR20220066242A true KR20220066242A (en) 2022-05-24
KR102577480B1 KR102577480B1 (en) 2023-09-12

Family

ID=50140791

Family Applications (5)

Application Number Title Priority Date Filing Date
KR1020130077047A KR102399795B1 (en) 2012-07-02 2013-07-02 Method and apparatus for image encoding/decoding
KR1020210003241A KR102480967B1 (en) 2012-07-02 2021-01-11 Method and apparatus for image encoding/decoding
KR1020220059344A KR102577480B1 (en) 2012-07-02 2022-05-16 Method and apparatus for image encoding/decoding
KR1020220179644A KR20230002236A (en) 2012-07-02 2022-12-20 Method and apparatus for image encoding/decoding
KR1020230118776A KR20230134107A (en) 2012-07-02 2023-09-07 Method and apparatus for image encoding/decoding

Family Applications Before (2)

Application Number Title Priority Date Filing Date
KR1020130077047A KR102399795B1 (en) 2012-07-02 2013-07-02 Method and apparatus for image encoding/decoding
KR1020210003241A KR102480967B1 (en) 2012-07-02 2021-01-11 Method and apparatus for image encoding/decoding

Family Applications After (2)

Application Number Title Priority Date Filing Date
KR1020220179644A KR20230002236A (en) 2012-07-02 2022-12-20 Method and apparatus for image encoding/decoding
KR1020230118776A KR20230134107A (en) 2012-07-02 2023-09-07 Method and apparatus for image encoding/decoding

Country Status (1)

Country Link
KR (5) KR102399795B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101642092B1 (en) * 2014-10-06 2016-07-22 성균관대학교산학협력단 Video encoding and decoding method and apparatus using the same
KR102138197B1 (en) * 2014-12-08 2020-07-27 성균관대학교산학협력단 Transform skip signaling method and apparatus for video coding
KR101707164B1 (en) * 2016-03-11 2017-02-15 성균관대학교산학협력단 Video encoding and decoding method and apparatus using the same

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"Intra transform skipping"(Cuiling Lan, JCTCV-I0408, 2012.4.27.공개)* *
B. Bross, "High efficiency video coding (HEVC) text specification draft 7", JCTVC-I1003, version 6, 2012.6.29.* *
Matteo Naccari et al., "CE5.a: Quantization for transform skipping", JCTVC-H0208, version 3, 2012.02.02.* *

Also Published As

Publication number Publication date
KR20210008886A (en) 2021-01-25
KR20140005098A (en) 2014-01-14
KR102399795B1 (en) 2022-05-23
KR20230134107A (en) 2023-09-20
KR102577480B1 (en) 2023-09-12
KR20230002236A (en) 2023-01-05
KR102480967B1 (en) 2022-12-23

Similar Documents

Publication Publication Date Title
JP7266515B2 (en) Video encoding method and device, and video decoding method and device
WO2018132475A1 (en) Intra prediction techniques for video coding
KR20170044631A (en) Method and apparatus for image encoding/decoding
EP2920971B1 (en) Devices and methods for processing of non-idr related syntax for high efficiency video coding (hevc)
KR20160024886A (en) Adaptive color transforms for video coding
KR102480967B1 (en) Method and apparatus for image encoding/decoding
WO2014084903A1 (en) Devices and methods for modifications of syntax related to transform skip for high efficiency video coding (hevc)
KR20150048637A (en) Method and apparatus for inter color component prediction
WO2014100111A1 (en) Devices and methods for using base layer intra prediction mode for enhancement layer intra mode prediction
KR20150093969A (en) Method and apparatus for early mode decision of video

Legal Events

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