KR20220134309A - A method and an apparatus for processing a video signal - Google Patents

A method and an apparatus for processing a video signal Download PDF

Info

Publication number
KR20220134309A
KR20220134309A KR1020210039812A KR20210039812A KR20220134309A KR 20220134309 A KR20220134309 A KR 20220134309A KR 1020210039812 A KR1020210039812 A KR 1020210039812A KR 20210039812 A KR20210039812 A KR 20210039812A KR 20220134309 A KR20220134309 A KR 20220134309A
Authority
KR
South Korea
Prior art keywords
value
abs
flag
level
binarization
Prior art date
Application number
KR1020210039812A
Other languages
Korean (ko)
Inventor
임성원
Original Assignee
주식회사 케이티
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 케이티 filed Critical 주식회사 케이티
Priority to KR1020210039812A priority Critical patent/KR20220134309A/en
Publication of KR20220134309A publication Critical patent/KR20220134309A/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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

Abstract

The present invention provides a method for encoding/decoding a residual signal and an apparatus therefor. The purpose of the present invention is to improve the coding efficiency of a video signal. A method for encoding a residual signal in a block, an RC method, a TSRC method, a truncated rice (TR) binarization method, and a limited k-th order exp-golomb binarization method are provided.

Description

비디오 신호 처리 방법 및 장치{A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL}Video signal processing method and apparatus {A METHOD AND AN APPARATUS FOR PROCESSING A VIDEO SIGNAL}

본 발명은 비디오 신호 처리 방법 및 장치에 관한 것이다.The present invention relates to a video signal processing method and apparatus.

비디오 영상은 시공간적 중복성 및 시점 간 중복성을 제거하여 압축부호화되며, 이는 통신 회선을 통해 전송되거나 저장 매체에 적합한 형태로 저장될 수 있다.The video image is compression-encoded by removing temporal and spatial redundancy and inter-view redundancy, which may be transmitted through a communication line or stored in a form suitable for a storage medium.

본 발명은 비디오 신호의 코딩 효율을 향상시키고자 함에 있다.An object of the present invention is to improve the coding efficiency of a video signal.

상기 과제를 해결하기 위하여 잔차 신호의 부/복호화 방법 및 이를 위한 장치를 제공한다.In order to solve the above problems, a method for encoding/decoding a residual signal and an apparatus therefor are provided.

본 발명에 따른 비디오 신호 처리 방법 및 장치는 영상 부호화/복호화 효율을 향상시킬 수 있다.A video signal processing method and apparatus according to the present invention can improve image encoding/decoding efficiency.

최근, 초고해상도 영상은 디지털 방송뿐 아니라 넷플릭스 및 유튜브 등의 스트리밍 서비스 분야의 핵심이다. 게다가 기존의 2D영상이외에도 VR, 3D 영상 서비스가 상용화되고 있으며, 디지털 TV뿐만 아니라 스마트폰과 같은 모바일 장비에서도 위와 같은 영상 서비스를 사용할 수 있다. 이러한 영상 서비스의 공통점은, 영상 압축의 적용 없이는 서비스가 불가능하다는 점이다. Full-HD라고 할 수 있는 1080p@60Hz의 경우, 1920x1080크기의 화면을 1초에 60번 전송해야 한다. 3D 영상과 같이 양쪽 눈에 정보를 전달하기 위해서는 2배의 데이터가 필요하며, 4K(4096x2048), 8K(8192x4096) 등 초고해상도 영상 서비스는 한 화면을 1초에 120번 이상 전송해야 되기 때문에 full-HD대비 엄청난 데이터가 발생된다. 이러한 데이터를 감당하기 위해서는 통신 대역폭, 영상 압축 기술 등 다양한 분야의 기술이 필요하다. 우선, 데이터에 예측 기술이 사용되어 잔차 값을 생성한다. 예측이 정확하게 수행될수록 원본 데이터와의 잔차 신호들은 0에 가까워진다. 그 후 변환을 통해 에너지를 집중시키며, 양자화된 계수 값들은 문맥 정보를 참조하여 부호화가 수행된다. Recently, ultra-high-resolution video is the core of not only digital broadcasting but also streaming services such as Netflix and YouTube. In addition to the existing 2D images, VR and 3D image services are being commercialized, and the above image services can be used not only on digital TVs but also on mobile devices such as smartphones. What these video services have in common is that the service is impossible without the application of video compression. In the case of 1080p@60Hz, which can be called Full-HD, a 1920x1080 screen must be transmitted 60 times per second. Like 3D video, twice as much data is required to deliver information to both eyes, and 4K (4096x2048) and 8K (8192x4096) ultra-high-resolution video services require one screen to be transmitted more than 120 times per second. Huge amount of data is generated compared to HD. In order to handle such data, technologies in various fields such as communication bandwidth and image compression technology are required. First, predictive techniques are used on the data to generate residual values. The more accurately the prediction is performed, the closer the residual signals with the original data are to zero. After that, energy is concentrated through transformation, and the quantized coefficient values are encoded with reference to context information.

특히 낮은 QP를 이용하여 부호화하는 경우, 혹은 12비트 이상의 의료영상이나 초고화질 영상의 경우, 부호화해야될 레지듀얼 신호는 극단적으로 커질 수 있다. 이러한 값들을 위해 최적화된 부호화 방식이 사용된다면, 부호화 효율을 크게 증가시켜줄 수 있다.In particular, in the case of encoding using a low QP, or in the case of a 12-bit or more medical image or an ultra-high-definition image, the residual signal to be encoded may become extremely large. If an encoding method optimized for these values is used, encoding efficiency can be greatly increased.

1.One. 블록 내 레지듀얼 신호 부호화 방법 In-block residual signal encoding method

블록을 부호화 할 때, 레지듀얼(residual) 신호를 생성하고, 생성된 레지듀얼 신호에 대하여 엔트로피 부호화를 수행한다. 이 레지듀얼 신호는 다양한 방법으로 생성될 수 있다. 일 예로, 원본 블록안에 존재하는 샘플(화소)들로부터, 화면 간 예측 혹은 화면 내 예측 등과 같은 예측을 통해 생성된 예측 샘플(화소)들을 차분하여, 잔차 값들로 이루어진 잔차 블록이 생성된다. 이 잔차 블록들에 변환, 및 양자화가 이루어진 양자화된 변환 계수가 레지듀얼 신호로 설정될 수 있다. 혹은, 예측, 변환, 또는 양자화 중 적어도 하나 이상을 스킵한 채, 레지듀얼 신호를 생성할 수도 있다. When encoding a block, a residual signal is generated, and entropy encoding is performed on the generated residual signal. This residual signal may be generated in various ways. For example, a residual block including residual values is generated by differentiating prediction samples (pixels) generated through prediction such as inter prediction or intra prediction from samples (pixels) existing in the original block. A quantized transform coefficient obtained by transforming and quantizing the residual blocks may be set as a residual signal. Alternatively, the residual signal may be generated while at least one of prediction, transformation, and quantization is skipped.

생성된 레지듀얼 신호는 다양한 신택스로 표현되고, 이들에 대한 엔트로피 부호화가 수행된다. 이진화 과정을 거쳐 다수의 빈(bin)들로 변경된 후, 엔트로피 부호화를 이용하여 부호화 된다. 이때, 블록을 추가적으로 서브 블록 단위로 분할한 뒤, 서브 블록 단위로 레지듀얼 신호에 대해 엔트로피 부호화를 수행할 수도 있다. The generated residual signal is expressed in various syntaxes, and entropy encoding is performed on them. After being changed into a plurality of bins through a binarization process, it is encoded using entropy encoding. In this case, after the block is additionally divided into sub-block units, entropy encoding may be performed on the residual signal in sub-block units.

엔트로피 부호화는 문맥 정보(context)를 이용한 부호화와 문맥 정보를 이용하지 않는 부호화를 포함할 수 있다.Entropy encoding may include encoding using context information and encoding not using context information.

엔트로피 코더의 처리율(throughput)을 증가시키기 위해, 부호화 하려는 블록마다 문맥정보를 이용하여 엔트로피 부호화를 수행하는 빈의 개수를 제한할 수 있다. 이를 위해, 임계값을 정한다. 발생한 다수의 빈들 중 정해진 임계값 만큼은, 문맥 정보를 이용한 부호화가 수행된다. 문맥 정보를 이용하여 부호화된 빈의 개수를 카운팅(counting)하고, 카운팅 된 값이 임계값을 넘어서는 경우, 나머지 빈들에 대해서는, 문맥 정보를 이용하지 않고 부호화한다. In order to increase the throughput of the entropy coder, the number of bins for performing entropy encoding may be limited by using context information for each block to be encoded. For this, a threshold is set. Encoding using context information is performed for a predetermined threshold value among a plurality of generated bins. The number of encoded bins is counted using context information, and when the counted value exceeds a threshold value, the remaining bins are encoded without using context information.

임계값은 적응적으로 결정될 수 있다. 일 예로, 임계값은 블록의 크기, 형태, 0이 아닌 레지듀얼 신호의 개수, 변환(또는 변환 스킵)이 적용되었는지 여부, 변환 커널의 종류, 양자화가 적용되었는지 여부, 예측 모드, 컬러 콤포넌트(YCbCr), 양자화 파라미터 또는 비트 심도(BitDepth) 중 적어도 하나를 기초로 결정될 수 있다.The threshold may be adaptively determined. For example, the threshold value may include the size and shape of a block, the number of non-zero residual signals, whether a transform (or transform skip) is applied, a type of a transform kernel, whether quantization is applied, a prediction mode, and a color component (YCbCr). ), a quantization parameter, and a bit depth may be determined based on at least one of (BitDepth).

일 예로, 블록 내에 존재하는 0이 아닌 양자화 된 계수의 개수를 기초로 임계값이 결정될 수 있다. 일 예로, 상기 개수의 실수 배 또는 상기 개수에 오프셋을 가산/감산한 값이 임계값으로 정의 될 수 있다. For example, the threshold value may be determined based on the number of non-zero quantized coefficients present in the block. For example, a real multiple of the number or a value obtained by adding/subtracting an offset to the number may be defined as the threshold value.

일 예로, 블록 내에 존재하는 화소의 개수(즉, 블록 크기)에 기초하여 임계값이 결정될 수 있다. 일 예로, 상기 개수의 실수 배 또는 상기 개수에 오프셋을 가산/감산한 값이 임계값으로 정의 될 수 있다. For example, the threshold value may be determined based on the number of pixels (ie, block size) existing in the block. For example, a real multiple of the number or a value obtained by adding/subtracting an offset to the number may be defined as the threshold value.

다른 예로, 임계값을 결정하기 위한 정보가 부호화되어 시그날링될 수 있다. 일 예로, 상기 정보는 혹은 상위 헤더를 통해 부호화 되어 복호화기로 전송 될 수 있다. As another example, information for determining a threshold may be encoded and signaled. For example, the information may be encoded through a higher header or transmitted to a decoder.

다른 예로, 블록 크기/형태 별로 임계값이 기 정의되어 있을 수 있다. 또는, 블록 크기/형태 별로 임계값 후보들을 기 정의한 뒤, 복수의 임계값 후보들 중 하나를 부호화하여 시그날링할 수 있다. As another example, a threshold value may be predefined for each block size/type. Alternatively, after defining threshold value candidates for each block size/type, one of a plurality of threshold value candidates may be encoded and signaled.

또는, 부호화기 및 복호화기에서 고정된 값을 임계값으로 정의할 수 있다. Alternatively, a fixed value in the encoder and the decoder may be defined as the threshold value.

레지듀얼 신호를 부호화하는 방법에는 RC(Residual Codong) 방식과 TSRC(Transform Skip Residual Coding) 방식이 존재한다. 예를 들어 블록에 RC방법이 적용된다면 블록 내 존재하는 모든 서브블록들은 RC로 수행된다. 여기서 서브 블록은, 엔트로피 부호화가 수행되기 전, TSRC 혹은 RC가 사용되는 단위를 의미한다. As a method for encoding the residual signal, there are a residual codong (RC) method and a transform skip residual coding (TSRC) method. For example, if the RC method is applied to a block, all subblocks existing in the block are performed by RC. Here, the sub-block means a unit in which TSRC or RC is used before entropy encoding is performed.

1-1: RC방법1-1: RC method

다음의 그림 1은 RC 방법의 예시이다. 설명의 편의를 위해, 서브 블록의 크기는 4x4크기라고 가정한다. 또한, 문맥 정보를 이용하여 부호화되는 사용할 빈의 개수(즉, 임계값, CCB(Coded Context Bin))은 52라고 가정한다.Figure 1 below is an example of the RC method. For convenience of description, it is assumed that the size of the sub-block is 4x4. Also, it is assumed that the number of bins to be encoded using context information (ie, a threshold value, coded context bin (CCB)) is 52.

Figure pat00001
Figure pat00001

그림 1 Figure 1

위 그림 1 에서, C15~C0은 서브 블록 내에 존재하는 레지듀얼 신호를 의미한다. 서브 블록 내 레지듀얼 신호는 서브 블록 내 오른쪽 아래방향에서부터 왼쪽 위 방향으로 부호화가 진행된다. 위 그림에서 C15는 서브 블록 내 오른쪽 아래에 존재하는 신호이며, C0은 서브 블록 내 왼쪽 위에 존재하는 신호를 의미한다. 또한 검은색 화살표(context coding)로 표시된 부분은, 문맥정보를 이용하여 부호화되는 빈들을 나타내고, 파란색 화살표(bypass coding)로 표시된 부분은, 문맥정보를 이용하지 않고 부호화되는 빈들을 나타낸다. 또한, 화살표 방향을 따라, 각 신택스들에 대한 부호화가 수행될 수 있다.In Figure 1 above, C 15 ~ C 0 means residual signals in the sub-block. The residual signal in the sub-block is encoded from the lower-right direction to the upper-left direction in the sub-block. In the above figure, C 15 is a signal that exists at the lower right of the sub-block, and C 0 means a signal that exists at the upper left of the sub-block. In addition, a portion indicated by a black arrow (context coding) indicates bins encoded using context information, and a portion indicated by a blue arrow (bypass coding) indicates bins encoded without using context information. Also, encoding may be performed on each syntax along the arrow direction.

또한, sig_coeff_flag, abs_level_gtx_flag[0], par_level_flag, abs_level_gtx_flag[1], abs_remainder, dec_abs_level, coeff_sign_flag는 다음의 표에 존재하는 수식과 같이 정의될 수 있다.In addition, sig_coeff_flag, abs_level_gtx_flag[0], par_level_flag, abs_level_gtx_flag[1], abs_remainder, dec_abs_level, and coeff_sign_flag may be defined as in the following equations.

PassPass 신택스명syntax name 수식Equation pass 1pass 1 sig_coeff_flagsig_coeff_flag CN != 0C N != 0 abs_level_gtx_flag[0]abs_level_gtx_flag[0] !! ( |CN| - 1 )!! ( |C N | - 1 ) par_level_flagpar_level_flag ( |CN| - 2 ) & 1( |C N | - 2 ) & 1 abs_level_gtx_flag[1]abs_level_gtx_flag[1] ( |CN| - 2 ) >> 1( |C N | - 2 ) >> 1 pass 2-1pass 2-1 abs_remainderabs_remainder ( |CN| - 4 ) >> 1( |C N | - 4 ) >> 1 pass 2-2pass 2-2 dec_abs_leveldec_abs_level pass 3pass 3 coeff_sign_flagcoeff_sign_flag CN < 0 ? 1 : 0C N < 0 ? 1: 0

만약, C15의 값이 -21 이라면, C15에 해당하는 sig_coeff_flag는 1, abs_level_gtx_flag[0]는 1, par_level_flag은 1, abs_level_gtx_flag[1]는 1, abs_remainder의 값은 8이되며, coeff_sign_flag의 값은 1로 표현되며 이 신택스들이 엔트로피 부호화되어 디코더로 시그널링 된다.If the value of C 15 is -21, sig_coeff_flag corresponding to C 15 is 1, abs_level_gtx_flag[0] is 1, par_level_flag is 1, abs_level_gtx_flag[1] is 1, abs_remainder is 8, and the value of coeff_sign_flag is It is expressed as 1, and these syntaxes are entropy-encoded and signaled to the decoder.

디코더에서는 다음의 표를 이용하여 레지듀얼 신호를 복원한다. The decoder restores the residual signal using the following table.

수식Equation TmpCN TmpC N sig_coeff_flag + abs_level_gtx_flag[0] + par_level_flag + (abs_level_gtx_flag[1]<<1) sig_coeff_flag + abs_level_gtx_flag[0] + par_level_flag + (abs_level_gtx_flag[1]<<1) |CN||C N | TmpCN + (abs_remainder<<1)TmpC N + (abs_remainder<<1)

상기 설명한 대로 |C15|에 대해 복원하면, TmpCN의 값은 1+1+1+(1<<1)를 통해 5가 되며, (abs_remainder<<1)의 결과를 더해 21로 복원 된다. 그 후, coeff_sign_flag값을 통해 C15의 값은 -21로 최종 복원된다. As described above, when |C 15 | is restored, the value of TmpC N becomes 5 through 1+1+1+(1<<1), and is restored to 21 by adding the result of (abs_remainder<<1). After that, the value of C 15 is finally restored to -21 through the coeff_sign_flag value.

1-2: TSRC방법1-2: TSRC method

다음의 그림 2는 TSRC 방식의 예시이다. 설명의 편의를 위해, 서브 블록의 크기는 4x4크기라고 가정한다. 또한 문맥 정보를 이용하여 부호화되는 빈의 개수(즉, 임계값, CCB(Coded Context Bin))은 112라고 가정한다.Figure 2 below is an example of the TSRC method. For convenience of description, it is assumed that the size of the sub-block is 4x4. Also, it is assumed that the number of bins (ie, a threshold value, coded context bin (CCB)) encoded using context information is 112.

Figure pat00002
Figure pat00002

그림 2Figure 2

위 그림 2에서, C0~C15는 서브 블록 내에 존재하는 레지듀얼 신호를 의미한다. TSRC 방식이 적용 될 때, 서브 블록 내에 존재하는 레지듀얼 신호는 서브 블록내 왼쪽 위 방향에서 오른쪽 아래방향으로 부호화가 진행된다. 위 그림에서 C15는 서브 블록 내 오른쪽 아래에 존재하는 신호이며, C0은 서브 블록 내 왼쪽 위에 존재하는 신호를 의미한다. 또한 검은색 화살표(context coding)로 표시된 부분은 문맥정보를 이용하여 부호화가 수행되는 빈들을 나타낸다. 파란색 화살표(bypass coding)로 표시된 부분은 문맥정보를 이용하지 않고 부호화되는 빈을 나타낸다. 또한, 화살표 방향대로, 각 신택스들에 대한 부호화가 수행될 수 있다.In Figure 2 above, C 0 ~ C 15 means residual signals existing in the sub-block. When the TSRC method is applied, the encoding of the residual signal existing in the sub-block is performed from the upper-left direction to the lower-right direction in the sub-block. In the above figure, C 15 is a signal that exists at the lower right of the sub-block, and C 0 means a signal that exists at the upper left of the sub-block. In addition, a portion indicated by a black arrow (context coding) indicates bins on which encoding is performed using context information. A portion indicated by a blue arrow (bypass coding) indicates a bin that is coded without using context information. Also, in the direction of the arrow, encoding may be performed for each syntax.

또한, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[0], par_level_flag, abs_level_gtx_flag[1], abs_level_gtx_flag[2], abs_level_gtx_flag[3], abs_level_gtx_flag[4], abs_remainder는 다음의 표에 존재하는 수식과 같이 정의된다.In addition, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[0], par_level_flag, abs_level_gtx_flag[1], abs_level_gtx_flag[2], abs_level_gtx_flag[3], abs_level_gtx_flag[4] are defined as in the following table,

passpass 신택스명syntax name 수식Equation pass 1pass 1 sig_coeff_flagsig_coeff_flag CN != 0C N != 0 coeff_sign_flagcoeff_sign_flag CN < 0 ? 1 : 0C N < 0 ? 1: 0 abs_level_gtx_flag[0]abs_level_gtx_flag[0] !! ( |CN| - 1 )!! ( |C N | - 1 ) par_level_flagpar_level_flag ( |CN| - 2 ) & 1( |C N | - 2 ) & 1 pass 2pass 2 abs_level_gtx_flag[1]abs_level_gtx_flag[1] ( |CN| - 2 ) >= 4( |C N | - 2 ) >= 4 abs_level_gtx_flag[2]abs_level_gtx_flag[2] ( |CN| - 2 ) >= 6( |C N | - 2 ) >= 6 abs_level_gtx_flag[3]abs_level_gtx_flag[3] ( |CN| - 2 ) >= 8( |C N | - 2 ) >= 8 abs_level_gtx_flag[4]abs_level_gtx_flag[4] ( |CN| - 2 ) >= 10( |C N | - 2 ) >= 10 pass 3pass 3 abs_remainderabs_remainder ( |CN| - 10 ) >> 1( |C N | - 10 ) >> 1

만약, C0의 값이 -21 이라면, C0에 해당하는 sig_coeff_flag는 1, coeff_sign_flag는 1, abs_level_gtx_flag[0]는 1, par_level_flag는1, abs_level_gtx_flag[1]은 1, abs_level_gtx_flag[2]는 1, abs_level_gtx_flag[3]은 1, abs_level_gtx_flag[4]는 1, abs_remainder의 값은 5로 표현되며, 이 신택스들이 엔트로피 부호화되어 디코더로 시그널링 된다.If the value of C 0 is -21, sig_coeff_flag corresponding to C 0 is 1, coeff_sign_flag is 1, abs_level_gtx_flag[0] is 1, par_level_flag is 1, abs_level_gtx_flag[1] is 1, abs_level_gtx_flag[2] is 1, abs_level_gtx_flag[2] is 1 [3] is 1, abs_level_gtx_flag[4] is 1, and the value of abs_remainder is 5. These syntaxes are entropy-encoded and signaled to the decoder.

디코더에서는 다음의 표를 이용하여 레지듀얼 신호를 복원한다. The decoder restores the residual signal using the following table.

수식Equation TmpCN TmpC N sig_coeff_flag + abs_level_gtx_flag[0] + par_level_flag sig_coeff_flag + abs_level_gtx_flag[0] + par_level_flag CN C N TmpCN + (abs_level_gtx_flag[1]<<1) + (abs_level_gtx_flag[2]<<1) + (abs_level_gtx_flag[3]<<1) + (abs_level_gtx_flag[4]<<1) +
(abs_remainder<<1)
TmpC N + (abs_level_gtx_flag[1]<<1) + (abs_level_gtx_flag[2]<<1) + (abs_level_gtx_flag[3]<<1) + (abs_level_gtx_flag[4]<<1) +
(abs_remainder<<1)

상기 설명한 대로 |C0|에 대해 복원하면, TmpCN의 값은 1+1+1을 통해 3이 되며, (abs_level_gtx_flag[1]<<1) + (abs_level_gtx_flag[2]<<1) + (abs_level_gtx_flag[3]<<1) + (abs_level_gtx_flag[4]<<1) 을 통해 8이 복원되고, (abs_remainder<<1)을 통해 10이 복원됨으로, 전부 합하면 21로 복원 된다. 그 후, coeff_sign_flag값을 통해 C0의 값은 -21로 최종 복원된다. As described above, when |C 0 | is restored, the value of TmpC N becomes 3 through 1+1+1, (abs_level_gtx_flag[1]<<1) + (abs_level_gtx_flag[2]<<1) + (abs_level_gtx_flag 8 is restored through [3]<<1) + (abs_level_gtx_flag[4]<<1), and 10 is restored through (abs_remainder<<1). After that, the value of C 0 is finally restored to -21 through the coeff_sign_flag value.

1-3: 절삭된 라이스 (TR: Truncated Rice) 이진화 방법1-3: Truncated Rice (TR) binarization method

어떤 값에 대해 엔트로피 부호화를 수행하기 위해서는 이진화가 선행되어야 한다. 다양한 이진화 방법들 중, 절삭된 라이스(TR) 이진화 방법을 수행하기 위해서는 두개의 파라미터가 요구된다. 구체적으로, 절삭된 라이스 이진화 방법을 수행하기 위해, cMax 파라미터와 라이스파라미터(cRiceParam)가 결정되어야 한다. In order to perform entropy encoding on a certain value, binarization must be preceded. Among various binarization methods, two parameters are required to perform the truncated rice (TR) binarization method. Specifically, in order to perform the truncated rice binarization method, the cMax parameter and the rice parameter (cRiceParam) must be determined.

TR 이진화 방식이 적용되는 경우, 파라미터에 기초하여, 부호화하려는 값을 프리픽스(prefix) 부분과 서픽스(suffix) 부분으로 분류할 수 있다. 이후, 각 부분을 설정된 방법에 따라 이진화할 수 있다. 프리픽스 부분은 다음의 수식으로 분류된다. When the TR binarization method is applied, a value to be encoded may be classified into a prefix part and a suffix part based on the parameter. Thereafter, each part can be binarized according to a set method. The prefix part is classified by the following equation.

prefixVal = symbolVal >> cRiceParam (1)prefixVal = symbolVal >> cRiceParam (1)

위 수식에서 symbolVal은 부호화하려는 값을 의미하며 prefixVal은 프리픽스를 의미한다. 그 후, 다음의 테이블을 이용하여 이진화한다.In the above formula, symbolVal means the value to be encoded, and prefixVal means the prefix. After that, it is binarized using the following table.

prefixValprefixVal Bin stringBin string 00 00 1One 1One 00 22 1One 1One 00 33 1One 1One 1One 00 44 1One 1One 1One 1One 00 55 1One 1One 1One 1One 1One 00 ...... bin indexbin index 00 1One 22 33 44 55 ......

이 때, prefixVal의 값이 (cMax >> cRiceParam)의 결과보다 작은 경우, 위의 표와 같이 이진화할 수 있다. 그렇지 않은 경우, 빈 스트링(Bin string)의 길이를 더 이상 늘리지 않고, 마지막 빈을 1로 대체한다. 예를 들어 (cMax >> cRiceParam)의 값이 6이고 prefixVal의 값이 6인 경우, 아래와 같이 빈 스트링이 설정될 수 있다. At this time, if the value of prefixVal is smaller than the result of (cMax >> cRiceParam), it can be binarized as shown in the table above. Otherwise, the length of the bin string is not increased further, and the last bin is replaced with 1. For example, when the value of (cMax >> cRiceParam) is 6 and the value of prefixVal is 6, an empty string may be set as follows.

prefixValprefixVal Bin stringBin string 00 00 1One 1One 00 22 1One 1One 00 33 1One 1One 1One 00 44 1One 1One 1One 1One 00 55 1One 1One 1One 1One 1One 00 66 1One 1One 1One 1One 1One 1One bin indexbin index 00 1One 22 33 44 55

cMax가 symbolVal보다 크고 cRiceParam이 0보다 큰 경우에만 서픽스를 사용할 수 있다. 그렇지 않은 경우, 서픽스는 사용되지 않는다. 서픽스가 사용되는 경우, 다음의 수식에 의해 서픽스 값이 설정된다.The suffix can be used only when cMax is greater than symbolVal and cRiceParam is greater than 0. Otherwise, the suffix is not used. When a suffix is used, the suffix value is set by the following equation.

suffixVal = symbolVal - (prefixVal << cRiceParam) (2)suffixVal = symbolVal - (prefixVal << cRiceParam) (2)

그 후, suffixVal의 이진화할 때, 고정길이 (FL : Fixed-length)이진화 방식이 적용될 수 있다. FL이진화를 위한 cMax값은 (1 << cRiceParam)-1 의 값으로 설정된다.Thereafter, when suffixVal is binarized, a fixed-length (FL) binarization method may be applied. The cMax value for FL binarization is set to a value of (1 << cRiceParam)-1.

고정길이 이진화 방식 하에서, 고정길이가 다음의 수식과 같이 설정될 수 있다.Under the fixed-length binarization method, the fixed length can be set as follows.

fixedLength = Ceil ( Log2 (cMax+1) ) (3) fixedLength = Ceil ( Log2 (cMax+1) ) (3)

fixedLength은 FL이진화 방식에 사용되는 고정길이를 의미하며 Ceil( )는 올림 연산을 의미한다. 또한, (2fixedLength) 개의 값을 이진화 할 수 있다. 예를 들어 fixedLength가 2 설정된 경우 22 = 4개의 값을 이진화 할 수 있다. 다음의 표는 이에 따른 예시이다. fixedLength means a fixed length used in the FL binarization method, and Ceil( ) means round-up operation. Also, (2 fixedLength ) values can be binarized. For example, if fixedLength is set to 2, 2 2 = 4 values can be binarized. The following table is an example accordingly.

ValVal Bin stringBin string 00 00 00 1One 00 1One 22 1One 00 33 1One 1One bin indexbin index 00 1One

1-4: 제한된 k차 지수골룸 (Limited k-th order Exp-Golomb) 이진화 방법1-4: Limited k-th order Exp-Golomb binarization method

이 이진화 방식의 입력으로는, 이진화하려는 값인 symbolVal과, 변수 k, maxPreExtLen, truncSuffixLen이 존재한다.As inputs of this binarization method, symbolVal, which is a value to be binarized, and variables k, maxPreExtLen, and truncSuffixLen exist.

이 입력값들을 이용하여 제한된 k차 지수골룸 이진화하는 방법은 다음의 표를 통해 설명된다.A method for constrained k-order exponential Gollum binarization using these input values is described through the following table.

codeValue = symbolVal >> k
preExtLen = 0
while( ( preExtLen < maxPreExtLen ) && ( codeValue > ( ( 2 << preExtLen ) - 2 ) ) ) {
preExtLen++
put( 1 )
}
if( preExtLen = = maxPreExtLen )
escapeLength = truncSuffixLen
else {
escapeLength = preExtLen + k
put( 0 )
}
symbolVal = symbolVal - ( ( ( 1 << preExtLen ) - 1 ) << k )
while( ( escapeLength-- ) > 0 )
put( ( symbolVal >> escapeLength ) & 1 )
codeValue = symbolVal >> k
preExtLen = 0
while( ( preExtLen < maxPreExtLen ) && ( codeValue > ( ( 2 << preExtLen ) - 2 ) ) ) {
preExtLen++
put( 1 )
}
if( preExtLen = = maxPreExtLen )
escapeLength = truncSuffixLen
else {
escapeLength = preExtLen + k
put( 0 )
}
symbolVal = symbolVal - ( ( ( 1 << preExtLen ) - 1 ) << k )
while( ( escapeLength-- ) > 0 )
put( ( symbolVal >> escapeLength ) & 1 )

1-5: abs_remainder과 dec_abs_level의 이진화 방법1-5: The binarization method of abs_remainder and dec_abs_level

abs_remainder의 이진화를 위해 abs_remainder를 프리픽스 부분과 서픽스 부분으로 분류한다. 그 후, 프리픽스 부분은 TR방식으로 이진화하고, 서픽스 부분은 제한된 k차 지수골룸 (Limited k-th order Exp-Golomb )방식으로 이진화가 수행된다. 이 때, TR방식으로 이진화한 결과가 111111인 경우에만(즉, prefixVal의 값이 (cMax >> cRiceParam)인 경우), abs_remainder의 서픽스를 생성하여 이진화한다.For the binarization of abs_remainder, abs_remainder is classified into a prefix part and a suffix part. Thereafter, the prefix part is binarized in the TR method, and the suffix part is binarized in the limited k-th order Exp-Golomb method. At this time, only when the result of binarization by the TR method is 111111 (that is, when the value of prefixVal is (cMax >> cRiceParam)), a suffix of abs_remainder is generated and binarized.

우선, abs_remainder의 프리픽스를 TR방식으로의 이진화하기 위해, cRiceParam의 값과 cMax값이 설정되어야 한다. 이때, cRiceParam의 값은, 레지듀얼 신호의 부호화 방식에 따라 결정될 수 있다. 일 예로, 레지듀얼 신호의 부호화를 위해 TSRC방식이 적용된 경우, cRiceParam가 기 정의된 상수로 설정될 수 있다. 여기서, 기 정의된 상수는, 1일 수 있다. 만약, 레지듀얼 신호의 부호화를 위해, RC이 적용된 경우, 다음 설명에 따라, cRiceParam가 설정된다. First, in order to binarize the prefix of abs_remainder in the TR method, the value of cRiceParam and the value of cMax must be set. In this case, the value of cRiceParam may be determined according to the encoding method of the residual signal. For example, when the TSRC method is applied for encoding the residual signal, cRiceParam may be set to a predefined constant. Here, the predefined constant may be 1. If RC is applied for encoding the residual signal, cRiceParam is set according to the following description.

우선 그림 3과 같이, 현재 부호화하려는 위치를 기준으로 주변 참조위치 각각에 존재하는 레지듀얼 신호들의 절대값합(locSumAbs)를 유도한다.First, as shown in Figure 3, the absolute value sum (locSumAbs) of the residual signals existing at each of the surrounding reference positions is derived based on the current encoding position.

Figure pat00003
Figure pat00003

그림 3Figure 3

이때, 참조위치에 존재하는 각 레지듀얼 신호의 절대값은 표 2를 이용해서 생성된다. 그 후, 다음의 수식 (4)를 통해 클리핑을 수행한다. 여기서 Clip3 (A,B,C)의 의미는, 만약 C의 값이 A이하라면 A를 출력하고, 그게 아니라 만약 C의 값이 B이상이라면 B를 출력하며, 그게아니라면 C를 출력한다는 의미이다.At this time, the absolute value of each residual signal existing at the reference position is generated using Table 2. After that, clipping is performed through the following Equation (4). Here, Clip3 (A,B,C) means that if the value of C is less than or equal to A, output A, otherwise, if the value of C is greater than B, output B, otherwise output C.

locSumAbs = Clip3(0, 31, locSumAbs - baseLevel*5 ) (4)locSumAbs = Clip3(0, 31, locSumAbs - baseLevel*5 ) (4)

위 수식에서 baseLevel은 4로 고정된다. 그 후, 수식에 의해 계산된 locSumAbs에 따라서 다음의 표와 같이 cRiceParam를 유도한다.In the above formula, baseLevel is fixed to 4. Then, according to the locSumAbs calculated by the equation, cRiceParam is derived as shown in the following table.

locSumAbslocSumAbs 00 1One 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 cRiceParamcRiceParam 00 00 00 00 00 00 00 1One 1One 1One 1One 1One 1One 1One 22 22 locSumAbslocSumAbs 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131 cRiceParamcRiceParam 22 22 22 22 22 22 22 22 22 22 22 22 33 33 33 33

파라미터 cMax는 다음의 수식을 이용하여 설정된다. The parameter cMax is set using the following equation.

cMax = 6<< cRiceParam (5) cMax = 6<< cRiceParam (5)

상기 설명한 방식을 이용하여, abs_remainder의 프리픽스를 TR방식으로의 이진화하기 위해 cRiceParam의 값과 cMax값이 설정되면, abs_remainder의 프리픽스를 다음의 수식 (6)을 이용하여 설정한다. Using the above-described method, if the value of cRiceParam and the value of cMax are set to binarize the prefix of abs_remainder to the TR method, the prefix of abs_remainder is set using the following Equation (6).

prefixVal = Min (cMax, abs_remainder) (6)prefixVal = Min(cMax, abs_remainder) (6)

이렇게 설정된 prefixVal은 파라미터 cMax와 cRiceParam를 이용하여 TR방식으로 이진화 된다.The prefixVal set in this way is binarized in the TR method using the parameters cMax and cRiceParam.

다음의 예시는, abs_remainder를 이진화하는 예시를 나타낸다. 설명의 편의를 위해 cRiceParam은 2, abs_remainder의 값은 23이라고 가정한다.The following example shows an example of binarizing abs_remainder. For convenience of explanation, it is assumed that cRiceParam is 2 and the value of abs_remainder is 23.

우선, cRiceParam가 2이기 때문에, 수식 (5)에 의해 cMax는 24로 설정된다. 그 후, 수식 (6)에 의해 abs_remainder의 프리픽스 값이 23으로 설정된다. 이 프리픽스 값과 cMax, cRiceParam를 입력값으로 이용하여 TR이진화를 수행한다. 이 때. 이 프리픽스 값이 TR이진화의 symbolVal로 입력된다. First, since cRiceParam is 2, cMax is set to 24 by Equation (5). After that, the prefix value of abs_remainder is set to 23 by Equation (6). TR binarization is performed using this prefix value and cMax and cRiceParam as input values. At this time. This prefix value is input as symbolVal of TR binarization.

TR이진화를 수행하기 위해 symbolVal을 프리픽스와 서픽스로 분류한다. symbolVal이 23이고 수식 (1)을 통해, prefixVal이 5로 설정된다. 그 후, 이 프리픽스 값은 (cMax >> cRiceParam)의 결과인 6보다 작으므로 표 5에 의해 111110 으로 이진화 된다. To perform TR binarization, symbolVal is classified into prefix and suffix. symbolVal is 23 and prefixVal is set to 5 through Equation (1). After that, since this prefix value is less than 6 which is the result of (cMax >> cRiceParam), it is binarized to 111110 by Table 5.

그리고, cMax값이 symbolVal 값인 23보다 크고 cRiceParam이 2이기 때문에, symbolVal의 서픽스를 추가로 설정하여야 한다. 수식 (2)와 같이 설정하면 suffixVal의 값은 23 - (5<<2)의 결과인 3이 설정되며, (1 << cRiceParam)-1의 값을 FL이진화 방식을 위한 cMax로 설정된다. 그 후, suffixVal 값인 3과, cMax 값인 3을 고정길이 (FL : Fixed-length)이진화 방식의 입력으로 적용하여 이진화를 수행한다. 이 때, 수식 (3)에 의해 fixedLength의 값은 2가 되며, 표 7에 의해 11로 이진화된다.And, since the cMax value is greater than the symbolVal value of 23 and the cRiceParam is 2, the suffix of symbolVal must be additionally set. When set as in Equation (2), the value of suffixVal is set to 3, which is the result of 23 - (5<<2), and the value of (1 << cRiceParam)-1 is set to cMax for the FL binarization method. Thereafter, binarization is performed by applying the suffixVal value of 3 and the cMax value of 3 as inputs of a fixed-length (FL) binarization method. At this time, the value of fixedLength becomes 2 by Equation (3), and is binarized to 11 according to Table 7.

위와 같은 방식으로, abs_remainder의 프리픽스 값인 23을 TR이진화를 수행하면 111110 11 로 표현된다. 따라서, 111111이 아니기때문에 abs_remainder의 서픽스는 생성하지 않고 abs_remainder의 이진화 과정이 종료된다.In the same way as above, when TR binarization is performed on 23, which is the prefix value of abs_remainder, it is expressed as 111110 11 . Therefore, since it is not 111111, the suffix of abs_remainder is not generated and the binarization process of abs_remainder is terminated.

다음의 예시는, abs_remainder를 이진화하는 또다른 예시를 나타낸다. 설명의 편의성을 위해 cRiceParam은 2, abs_remainder의 값은 25라고 가정한다. The following example shows another example of binarizing abs_remainder. For convenience of explanation, it is assumed that cRiceParam is 2 and the value of abs_remainder is 25.

우선, cRiceParam가 2이기 때문에, 수식 (5)에 의해 cMax는 24로 설정된다. 그 후, 수식 (6)에 의해 abs_remainder의 프리픽스 값이 24으로 설정된다. 이 프리픽스 값과 cMax, cRiceParam를 입력값으로 이용하여 TR이진화를 수행한다. 이 때. 이 프리픽스 값이 TR이진화의 symbolVal로 입력된다. First, since cRiceParam is 2, cMax is set to 24 by Equation (5). After that, the prefix value of abs_remainder is set to 24 by Equation (6). TR binarization is performed using this prefix value and cMax and cRiceParam as input values. At this time. This prefix value is input as symbolVal of TR binarization.

TR이진화를 수행하기 위해 symbolVal을 프리픽스와 서픽스로 분류한다. symbolVal이 24이고 수식 (1)을 통해, prefixVal이 6으로 설정된다. 그 후, 이 프리픽스 값은 (cMax >> cRiceParam)의 결과인 6보다 작지 않기 때문에, 표 6에 의해 111111 로 이진화 된다. To perform TR binarization, symbolVal is classified into prefix and suffix. symbolVal is 24 and prefixVal is set to 6 through Equation (1). Then, since this prefix value is not less than 6 which is the result of (cMax >> cRiceParam), it is binarized to 111111 by Table 6.

그리고, cMax값이 symbolVal 값인 24보다 크지 않기 때문에 TR이진화의 서픽스를 생성하지 않으며, abs_remainder의 프리픽스를 이진화한 결과는 111111로 종료된다.And, since the cMax value is not greater than the symbolVal value of 24, the TR binarization suffix is not generated, and the result of binarizing the abs_remainder prefix ends with 111111.

그 후, abs_remainder의 프리픽스를 TR방식으로 이진화한 결과가 111111이기 때문에, abs_remainder의 서픽스를 다음의 수식으로 생성한다.After that, since the result of binarizing the prefix of abs_remainder by the TR method is 111111, the suffix of abs_remainder is generated by the following equation.

SuffixVal = abs_remainder - cMax (7)SuffixVal = abs_remainder - cMax (7)

따라서 수식 (7)을 적용하면, 25-24의 결과인 1이 서픽스 값으로 생성된다. 그 후 k의 값을 cRiceParam+1의 결과로 설정하고, maxPreExtLen과 truncSuffixLen를 각각 11과 15로 설정한다. 마지막으로 서픽스값, k, maxPreExtLen, truncSuffixLen을 입력값으로 이용하여 제한된 k차 지수골룸 (Limited k-th order Exp-Golomb )방식으로 이진화한다.Therefore, if Equation (7) is applied, 1, which is the result of 25-24, is generated as a suffix value. After that, the value of k is set as the result of cRiceParam+1, and maxPreExtLen and truncSuffixLen are set to 11 and 15, respectively. Finally, the suffix value, k, maxPreExtLen, and truncSuffixLen are used as input values and binarized in a limited k-th order Exp-Golomb method.

dec_abs_level의 이진화는 abs_remainder의 이진화와 동일하다. 단, 수식(4)에 사용되는 baseLevel은 0으로 고정된다.The binarization of dec_abs_level is the same as that of abs_remainder. However, the baseLevel used in Equation (4) is fixed to 0.

2.2. 변환 계수 범위 설정 방법 How to set the conversion factor range

비트스트림은 CABAC, 역양자화, 역변환 과정을 통해 복원된다. 이때 각 과정이 끝난 후 값의 범위는 -(1<<15) ~ (1<<15)-1에 존재하여야 한다. 이를 위해, 클리핑이 수행될 수 있다. 다음의 그림은 이와 관련된 예시를 나타낸다. The bitstream is restored through CABAC, inverse quantization, and inverse transformation processes. At this time, after each process, the range of values must exist in -(1<<15) ~ (1<<15)-1. For this purpose, clipping may be performed. The following figure shows an example related to this.

Figure pat00004
Figure pat00004

그림 4Figure 4

일 예로, 변환 블록 내에서 CABAC을 통해 디코딩된 값은 변환 블록 만큼의 크기를 가지는 TransCoeffLevel 버퍼에 저장이 된다. 이 버퍼에 존재하는 값들은 항상 -(1<<15) ~ (1<<15)-1, 즉 -32768 ~ 32767 사이에 존재하여야만 한다. 그 후, 이 버퍼에 존재하는 값들은 dz버퍼로 복사되고 역양자화 과정을 거쳐 dnc 버퍼에 저장되며, 클리핑을 통해 d버퍼에 저장된다. 다음의 수식은 이를 나타낸다.For example, a value decoded through CABAC in a transform block is stored in a TransCoeffLevel buffer having a size equal to that of the transform block. Values in this buffer must always exist between -(1<<15) ~ (1<<15)-1, that is, -32768 ~ 32767. After that, the values present in this buffer are copied to the dz buffer and stored in the dnc buffer through inverse quantization, and then stored in the d buffer through clipping. The following formula represents this.

bdShift1= BitDepth + rectNonTsFlag + (( Log2(W) + Log2(H) ) / 2 ) - 5 + DQflag (8)bdShift1= BitDepth + rectNonTsFlag + (( Log2(W) + Log2(H) ) / 2 ) - 5 + DQflag (8)

dnc[ x ][ y ] = (  dz[ x ][ y ] * ls[ x ][ y ] + (1<<(bdShift1 - 1)) )  >>  bdShift1 (9)dnc[ x ][ y ] = (  dz[ x ][ y ] *ls[ x ][ y ] + (1<<(bdShift1 - 1)) )>>

d[ x ][ y ] = Clip3( CoeffMin, CoeffMax, dnc[ x ][ y ] ) (10)d[ x ][ y ] = Clip3( CoeffMin, CoeffMax, dnc[ x ][ y ] ) (10)

위 수식들에서 BitDepth는 신호의 비트심도를 의미하며 rectNonTsFlag는 블록의 가로길이와 세로길이의 곱이 4의 지수승인지 여부를 나타내는 플래그이다. 만약 블록의 가로길이와 세로길이의 곱이 4의 지수승이라면 rectNonTsFlag의 값은 1, 아니라면 0으로 설정된다. W와 H는 각각 블록의 가로길이와 세로길이를 의미하며, DQflag는 DQ(Dependent Quantization)이 사용되었는지를 알려주는 정보이다. 만약 DQ가 사용되었다면 DQflag의 값은 1, 아니라면 0으로 설정된다. 또한, ls버퍼는 역양자화 매트릭스를 의미한다. CoeffMin와 CoeffMax는 그림 4에서 표시된 것처럼 각각 -32768과 32767로 설정된다. Clip3함수는 dnc[x][y]의 값이 CoeffMin보다 작다면 CoeffMin를 결과값으로 출력하며, dnc[x][y]의 값이 CoeffMax보다 크다면 CoeffMax를 결과값으로 출력한다. dnc[x][y]의 값이 CoeffMin과 CoeffMax 사이에 존재하는 경우에는 dnc[x][y]를 출력한다. In the above equations, BitDepth means the bit depth of the signal, and rectNonTsFlag is a flag indicating whether the product of the horizontal and vertical lengths of a block is an exponential power of 4. If the product of the width and height of the block is a power of 4, the value of rectNonTsFlag is set to 1, otherwise it is set to 0. W and H denote the horizontal and vertical length of the block, respectively, and DQflag is information indicating whether Dependent Quantization (DQ) is used. If DQ is used, the value of DQflag is set to 1, otherwise it is set to 0. Also, the ls buffer means an inverse quantization matrix. CoeffMin and CoeffMax are set to -32768 and 32767 respectively, as shown in Figure 4. The Clip3 function outputs CoeffMin as a result if the value of dnc[x][y] is less than CoeffMin, and outputs CoeffMax as a result if the value of dnc[x][y] is greater than CoeffMax. If the value of dnc[x][y] exists between CoeffMin and CoeffMax, dnc[x][y] is output.

만약 인코더에서 LFNST가 수행되었다면, d버퍼는 1D로 재정렬되어 역변환(LFNST)이 수행되고, 그 결과가 다시 d 버퍼에 저장된다. 다음의 수식은 이 과정을 나타낸다.If LFNST is performed in the encoder, the d buffer is rearranged to 1D, the inverse transform (LFNST) is performed, and the result is stored in the d buffer again. The following formula represents this process.

Figure pat00005
(10)
Figure pat00005
(10)

위 수식에서 nonZeroSize는 블록의 크기에 따라 8 혹은 16으로 설정되며 lowFreqTransMatrix는 LFNST변환매트릭스를 의미한다. x버퍼는 수식 (10)의 결과인 d 버퍼를 1D로 재정렬한 버퍼이다. y버퍼는 LFNST의 출력값을 나타낸다. 이 y버퍼는 다시 2D로 재정렬되어 d버퍼에 저장된다.In the above formula, nonZeroSize is set to 8 or 16 depending on the size of the block, and lowFreqTransMatrix means the LFNST transformation matrix. The x buffer is a buffer in which the d buffer, which is the result of Equation (10), is rearranged in 1D. The y buffer represents the output value of LFNST. This y-buffer is reordered in 2D and stored in the d-buffer.

그 후, 인코더에서 변환(MTS등)이 수행되었다면, d버퍼에 역변환(Ver)를 수행하고 클리핑을 수행한다. 다음의 수식은 이를 나타낸다. After that, if transform (MTS, etc.) is performed in the encoder, an inverse transform (Ver) is performed on the d buffer and clipping is performed. The following formula represents this.

g[ x ][ y ] = Clip3( CoeffMin, CoeffMax, ( e[ x ][ y ] + 64 ) >> 7 ) (11)g[ x ][ y ] = Clip3( CoeffMin, CoeffMax, ( e[ x ][ y ] + 64 ) >> 7 ) (11)

위 수식에서 버퍼 e는 d버퍼에 역변환(Ver)을 수행한 결과값을 나타낸다. e버퍼를 클리핑하여 g버퍼에 대입한 후, g버퍼에 역변환(Hor)을 수행하여 클리핑을 수행하여 복원값을 생성한다. 다음의 수식은 이를 나타낸다. In the above equation, buffer e represents the result of performing inverse transformation (Ver) on buffer d. After clipping the e-buffer and substituting it into the g-buffer, an inverse transform (Hor) is performed on the g-buffer to perform clipping to generate a restored value. The following formula represents this.

bdShift2 = ( H > 1  &&  W > 1 ) ? ( 20 - BitDepth ) : ( 21 - BitDepth ) (12)bdShift2 = ( H > 1  &&  W > 1 ) ? ( 20 - BitDepth ) : ( 21 - BitDepth ) (12)

res[ x ][ y ] = ( r[ x ][ y ] + (1<<(bdShift2 - 1)) ) >> bdShift2 (13)res[ x ][ y ] = ( r[ x ][ y ] + (1<<(bdShift2 - 1)) ) >> bdShift2 (13)

위 수식에서 r은 g버퍼에 역변환(Hor)을 수행한 결과값을 나타내며 W와 H는 각각 블록의 가로길이와 세로길이를 의미한다. 이 수식을 통해, r버퍼를 클리핑하여 복원버퍼인 res에 대입한다.In the above equation, r denotes the result of inverse transformation (Hor) on the g buffer, and W and H denote the horizontal and vertical lengths of the block, respectively. Through this formula, the r buffer is clipped and assigned to the restoration buffer res.

상기 설명은 디코더를 기준으로 한 것이다. 인코더에서는 설명한 것의 역 과정으로 변환을 수행할 수 있다. The above description is based on the decoder. In the encoder, the transformation can be performed in the reverse process of that described.

3.3. 확장된 변환 계수 범위 설정 방법 How to Set the Extended Transform Coefficient Range

샘플이 10비트를 초과하거나 매우 낮은 QP가 사용되는 경우, 효율적인 부/복호화를 위해 값의 범위 및 비트의 정밀도를 조절할 수 있다. 다음의 그림은 이에 대한 예시를 나타낸다. When the sample exceeds 10 bits or a very low QP is used, the range of values and bit precision may be adjusted for efficient encoding/decoding. The following figure shows an example of this.

Figure pat00006
Figure pat00006

그림 5Figure 5

그림 4와 달리, 그림 5에서는 Range라는 변수를 추가하여 값의 범위를 조절할 수 있다. Range는 비트 심도에 기초하여 가변적으로 결정될 수 있다. 혹은 인코더와 디코더에서 Range 값을 임의의 상수로 고정/정의할 수 있다. Unlike Figure 4, in Figure 5, the range of values can be adjusted by adding a variable called Range. The range may be variably determined based on the bit depth. Alternatively, the Range value can be fixed/defined as an arbitrary constant in the encoder and decoder.

일 예로 Range는 다음의 수식을 통해 결정될 수 있다.As an example, the Range may be determined through the following equation.

Range = MAX (BitDepth+5, 15) (14)Range = MAX (BitDepth+5, 15) (14)

위 수식에서 MAX(A,B)는 A와 B중에서 큰 값을 출력한다.In the above formula, MAX(A,B) outputs the larger value among A and B.

또한 Range에 따라 수식 (8)도 다음의 수식으로 변경될 수 있다. Also, Equation (8) may be changed to the following expression according to the range.

bdShift1= BitDepth + rectNonTsFlag + (( Log2(W) + Log2(H) ) / 2 ) + 10 - Range + DQflag (15)bdShift1= BitDepth + rectNonTsFlag + (( Log2(W) + Log2(H) ) / 2 ) + 10 - Range + DQflag (15)

일 예로, 영상의 비트심도가 10이라면 bdShift1의 값은 수식(8)과 동일하게 설정된다.For example, if the bit depth of the image is 10, the value of bdShift1 is set to be the same as in Equation (8).

또한 Range에 따라 수식 (12)도 다음의 수식으로 변경될 수 있다.Also, Equation (12) may be changed to the following expression according to the range.

bdShift2 = ( H>1  &&  W>1 ) ? (5+Range - BitDepth ) : ( 6+Range - BitDepth ) (16)bdShift2 = ( H>1  &&  W>1 ) ? (5+Range - BitDepth ) : ( 6+Range - BitDepth ) (16)

일 예로, 영상의 비트심도가 10이라면 bdShift2의 값은 수식(12)와 동일하게 설정된다.For example, if the bit depth of the image is 10, the value of bdShift2 is set to be the same as in Equation (12).

abs_remainder과 dec_abs_level는 앞서 설명한바와 같이, 이진화를 수행할 때 프리픽스 부분과 서픽스 부분으로 분류하여 이진화를 진행한다. 프리픽스 부분을 이진화하는 경우에는 TR방식이 적용되고 서픽스 부분을 이진화하는 경우에는 제한된 k차 지수골룸(이하, EG(k)로 명칭함) 방식이 적용된다. As described above, abs_remainder and dec_abs_level perform binarization by classifying them into a prefix part and a suffix part when performing binarization. When the prefix part is binarized, the TR method is applied, and when the suffix part is binarized, the limited k-order exponential Gollum (hereinafter, referred to as EG(k)) method is applied.

abs_remainder과 dec_abs_level에 대해 이진화를 수행할 때, 하드웨어 구현의 편의성을 위해 프리픽스와 서픽스에 대한 비트수의 합이 기설정된 임계값이 되도록 설정할 수 있다. 다음의 표는 기설정된 임계값에 따른 프리픽스와 서픽스의 최대 비트수를 나타낸 예시이다. 이하, 설명의 편의성을 위해 임계값은 32로 가정하고 설명한다.When binarization is performed on abs_remainder and dec_abs_level, the sum of the number of bits for the prefix and the suffix may be set to a preset threshold for convenience of hardware implementation. The following table is an example showing the maximum number of bits of a prefix and a suffix according to a preset threshold. Hereinafter, it is assumed that the threshold value is 32 for convenience of description.

TRTR EG(k)EG(k) RangeRange prefixVal의 최대 길이Maximum length of prefixVal maxPreExtLenmaxPreExtLen truncSuffixLentruncSuffixLen 임계값threshold 1515 66 1111 1515 3232 1616 66 1010 1616 3232 1717 66 99 1717 3232 1818 66 88 1818 3232 1919 66 77 1919 3232 2020 66 66 2020 3232 2121 66 55 2121 3232 2222 66 44 2222 3232 ...... ...... ...... ...... 3232

위 표 10에서 TR은 절삭된 라이스 (TR: Truncated Rice) 이진화 방법을 나타내며 EG(k)는 제한된 k차 지수골룸 (Limited k-th order Exp-Golomb) 이진화 방법을 나타낸다.In Table 10 above, TR denotes a truncated rice (TR) binarization method, and EG(k) denotes a limited k-th order Exp-Golomb binarization method.

위 표에서 표현된 prefixVal은 표 6에서 정의된 값이다. 따라서, prefixVal이 6을 초과하는 경우에만 서픽스값이 존재할 수 있다. 또한, maxPreExtLen와 truncSuffixLen은 서픽스의 이진화를 위해 표 8에서 사용된다. The prefixVal expressed in the above table is the value defined in Table 6. Accordingly, a suffix value may exist only when prefixVal exceeds 6. In addition, maxPreExtLen and truncSuffixLen are used in Table 8 for suffix binarization.

상기 표 10의 maxPreExtLen과 truncSuffixLen의 값은 다음의 수식을 이용하여 설정될 수 있다. The values of maxPreExtLen and truncSuffixLen of Table 10 may be set using the following equation.

truncSuffixLen = Range (16)truncSuffixLen = Range (16)

maxPreExtLen = 임계값 - 6 - truncSuffixLen (17) maxPreExtLen = threshold - 6 - truncSuffixLen (17)

이때, Range가 늘어날수록, maxPreExtLen이 줄어들어 값을 충분히 표현하기 부족할 수 있다. 따라서, 수식 (16)을 이용하지 않고 Range와 무관하게, truncSuffixLen 값을 고정적으로 사용할 수도 있다. 일 예로, truncSuffixLen의 값을 20으로 고정할 수 있다. 이 경우, maxPreExtLen의 값은 수식 (17)에 의해 항상 6으로 고정된다. In this case, as the Range increases, maxPreExtLen decreases, which may be insufficient to sufficiently express the value. Therefore, the truncSuffixLen value may be fixedly used regardless of the Range without using Equation (16). As an example, the value of truncSuffixLen may be fixed to 20. In this case, the value of maxPreExtLen is always fixed to 6 by Equation (17).

혹은, 수식 (17)의 관계를 이용하여, maxPreExtLen과 truncSuffixLen중 어느 하나를 결정하기 위한 정보를 슬라이스헤더, PPS와 같은 상위 헤더를 통해 부호화하여 인코더에서 디코더로 시그널링 할 수 있다. 혹은, 타일과 같은 병렬처리를 위해 분할된 임의의 영역마다 상기 정보를 부호화하여 인코더에서 디코더로 시그널링 하는 방법 또한 가능하다.Alternatively, by using the relationship of Equation (17), information for determining either maxPreExtLen or truncSuffixLen may be encoded through upper headers such as slice headers and PPSs to be signaled from the encoder to the decoder. Alternatively, a method of encoding the information for each arbitrary region divided for parallel processing such as a tile and signaling the information from the encoder to the decoder is also possible.

혹은, 수식 (14)를 다음의 수식 (18)로 변경할 수도 있다. Alternatively, the formula (14) can be changed to the following formula (18).

Range = MAX( 15, Min(20, BitDepth+5) ) (18)Range = MAX( 15, Min(20, BitDepth+5) ) (18)

수식 (18)을 이용하는 경우, 10비트 이하의 영상을 부호화할때는 종래의 방식(그림 4)과 동일하게 Range의 값은 15로 설정되며, 10비트를 넘어서는 영상을 부호화하는 경우에만 Range의 값이 15를 넘어선 값으로 변경된다.In case of using Equation (18), when encoding an image of 10 bits or less, the value of Range is set to 15 as in the conventional method (Figure 4), and only when encoding an image exceeding 10 bits, the value of Range is 15 is changed to a value that exceeds

혹은 비트심도와 관련없이, 비트정밀도의 확장 여부를 알려주는 정보를 인코더에서 디코더로 시그널링하여, 이 정보에 따라 Range를 변경할 수도 있다. 일 예로, 비트정밀도의 확장 여부를 알려주는 정보를 ExtPrecFlag라고 가정하면, 다음의 수식에 따라 Range를 설정하는 방식 또한 가능하다.Alternatively, regardless of the bit depth, information indicating whether or not the bit precision is extended may be signaled from the encoder to the decoder, and the range may be changed according to this information. For example, assuming that the information indicating whether or not the bit precision is extended is ExtPrecFlag, a method of setting a range according to the following equation is also possible.

Range = (ExtPrecFlag == 1) ? R : 15) (19)Range = (ExtPrecFlag == 1) ? R: 15) (19)

위 수식에서 변수 R은 인코더와 디코더에서 기설정된 값을 사용하는 것이 가능하며, 혹은 인코더에서 디코더로 시그널링하는 방법 또한 가능하다. 이 때, R을 그대로 시그널링 할 수도 있으며 R과 15의 차분값을 시그널링하고, 디코더에서는 이 차분값과 15를 더하여 R을 복원하여 Range로 사용하는 방법 또한 가능하다. 그 후, 수식 (16)과 (17)을 이용하여 maxPreExtLen과 truncSuffixLen의 값을 설정한다. In the above equation, it is possible to use a value preset by the encoder and the decoder for the variable R, or a method for signaling from the encoder to the decoder is also possible. In this case, R may be signaled as it is, and the difference between R and 15 is signaled, and the decoder adds 15 to this difference to restore R and use it as a range. After that, the values of maxPreExtLen and truncSuffixLen are set using Equations (16) and (17).

혹은 ExtPrecFlag 및 비트심도 모두를 이용하여, Range를 결정하는 방식 또한 가능하다. 다음의 수식은 이와 관련된 예시를 나타낸다.Alternatively, a method of determining the range using both ExtPrecFlag and bit depth is also possible. The following formula shows an example related to this.

Range = (ExtPrecFlag == 1) ? MAX ( 15, MIN( 20, BitDepth+6 )) : 15 (20)Range = (ExtPrecFlag == 1) ? MAX ( 15, MIN( 20, BitDepth+6 )) : 15 (20)

위 수식에서 MIN(A,B)는 A와 B중 작은 값을 출력한다.In the above formula, MIN(A,B) outputs the smaller of A and B.

Claims (1)

잔차 신호의 부호화/복호화 방법. A method of encoding/decoding a residual signal.
KR1020210039812A 2021-03-26 2021-03-26 A method and an apparatus for processing a video signal KR20220134309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210039812A KR20220134309A (en) 2021-03-26 2021-03-26 A method and an apparatus for processing a video signal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210039812A KR20220134309A (en) 2021-03-26 2021-03-26 A method and an apparatus for processing a video signal

Publications (1)

Publication Number Publication Date
KR20220134309A true KR20220134309A (en) 2022-10-05

Family

ID=83596884

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210039812A KR20220134309A (en) 2021-03-26 2021-03-26 A method and an apparatus for processing a video signal

Country Status (1)

Country Link
KR (1) KR20220134309A (en)

Similar Documents

Publication Publication Date Title
EP3304909B1 (en) Advanced arithmetic coder
US10609374B2 (en) Method and apparatus for entropy-encoding and entropy-decoding video signal
AU2023202899B2 (en) Method and device for entropy encoding, decoding video signal
EP2984761B1 (en) Data encoding and decoding
KR20080082147A (en) Method and apparatus for context adaptive binary arithmetic coding and decoding
EP2805487A1 (en) Throughput improvement for cabac coefficient level coding
KR20130058524A (en) Method for generating chroma intra prediction block
EP2801195A1 (en) Devices and methods for sample adaptive offset coding and/or selection of edge offset parameters
KR20130088087A (en) Method and apparatus for encoding/decoding video with predicting quantization parameter of hierarchical data unit
WO2015008478A1 (en) Modified coding for a transform skipped block for cabac in hevc
KR20200110220A (en) Method and apparatus for efficiently coding residual block
Wang et al. United coding for compound image compression
KR20220051341A (en) Transform coefficient coding method and apparatus in video/image coding system
WO2020142608A1 (en) Escape coding for coefficient levels
KR20220038121A (en) Method and apparatus for deriving rice parameters in video/video coding system
KR20220027162A (en) Independent CABAC for sub-sections of a picture
KR20220134309A (en) A method and an apparatus for processing a video signal
KR20220121426A (en) A method and an apparatus for processing a video signal
KR20220088072A (en) A method and an apparatus for processing a video signal
KR20220088074A (en) A method and an apparatus for processing a video signal
KR20220088073A (en) A method and an apparatus for processing a video signal
KR20220121424A (en) A method and an apparatus for processing a video signal
KR20220121425A (en) A method and an apparatus for processing a video signal
KR20220062540A (en) Video data encoding and decoding
WO2022212214A1 (en) Residual and coefficients coding for video coding