Method for decoding and encoding video, and non-transitory computer readable medium

Through adaptive block division and quantized weight scaling, the problem of low residual block encoding/decoding efficiency in video signals is solved, and more efficient video signal processing is achieved.

CN119996684APending Publication Date: 2025-05-13HANWHA VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510117555.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-06-19
Filing Date
2019-06-10
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, in the encoding and decoding process of video signals, it is difficult to effectively improve the encoding/decoding efficiency of residual blocks.

Method used

Through adaptive block division, the residual coefficients of the residual block are derived, the quantization parameters are calculated, inverse quantization and inverse transformation are performed to reconstruct the residual samples of the residual block, and the residual coefficients are scaled based on the quantized weight of the predetermined scale list.

Benefits of technology

The encoding/decoding efficiency of residual blocks is improved, and the processing process of video signals is optimized through adaptive block division and quantized weight scaling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996684A_ABST
    Figure CN119996684A_ABST
Patent Text Reader

Abstract

The invention discloses a method for decoding and encoding a video and a non-transitory computer readable medium. The method for decoding a video includes: deriving a residual coefficient of a residual block from a bitstream; calculating a quantization parameter of the residual block; performing inverse quantization on the residual coefficient using the calculated quantization parameter; and reconstructing a residual sample of the residual block by performing an inverse transform on the inverse quantized residual coefficient, in which the residual block is divided into a plurality of sub-regions based on a vertical line or a horizontal line, the plurality of sub-regions includes a first sub-region for which a residual coefficient is transmitted from the encoding device and a second sub-region for which no residual coefficient is transmitted from the encoding device, and a position of the second sub-region is determined based on index information obtained from the bitstream, the index information specifies a position of a sub-region for which no residual coefficient is transmitted from the encoding device among the plurality of sub-regions, and a residual sample of a second sub-region in the residual block is set to be equal to a default value predefined at the decoding device, the default value being 0.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of invention patent application No. 201980038897.8, with the application date of June 10, 2019, international application number PCT / KR2019 / 006962, and entered the Chinese national stage on December 11, 2020, with the invention name being "Residual coefficient encoding / decoding method and device". Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding a video signal. Background Art

[0003] The demand for high-resolution, high-quality video is growing in various applications. As image data becomes high-resolution and high-quality, the amount of data increases relative to conventional image data. Therefore, when using a medium such as a conventional wired / wireless broadband line to transmit image data or using a conventional storage medium to store image data, the transmission cost and storage cost increase. Efficient image compression technology can be used to solve these problems caused by high-resolution and high-quality image data. Summary of the invention

[0004] Technical issues

[0005] The purpose of the present invention is to improve the coding / decoding efficiency of residual blocks.

[0006] The object of the present invention is to improve the encoding / decoding efficiency through adaptive block partitioning.

[0007] One aspect of the present invention provides a method for decoding a video, the method comprising: deriving a residual coefficient of a residual block from a bitstream; calculating a quantization parameter of the residual block; performing inverse quantization on the residual coefficient using the calculated quantization parameter; and reconstructing a residual sample of the residual block by performing an inverse transform on the inversely quantized residual coefficient, wherein the residual block is divided into a plurality of sub-regions based on a vertical line or a horizontal line, wherein the plurality of sub-regions include a first sub-region for which the residual coefficient is sent from an encoding device and a second sub-region for which the residual coefficient is not sent from the encoding device. A domain, wherein, based on index information obtained from the bitstream, the position of the second sub-region for which the residual coefficient is not sent from the encoding device is determined, wherein the index information specifies the position of the sub-region for which the residual coefficient is not sent from the encoding device among the multiple sub-regions, wherein the second sub-region represents a region excluding at least one of the following: N columns from the left side of the residual block or M rows from the upper side of the residual block, wherein the residual samples of the second sub-region in the residual block are set to be equal to a default value predefined at a decoding device, and wherein the default value is 0.

[0008] Another aspect of the present invention provides a method for encoding a video, the method comprising: performing a transform on a residual sample of a residual block to obtain a transform coefficient of the residual block; performing a quantization on the transform coefficient of the residual block based on a quantization parameter to obtain a quantized transform coefficient of the residual block; and generating a bit stream by encoding the quantized transform coefficient, wherein the residual block is divided into a plurality of sub-regions based on a vertical line or a horizontal line, wherein the plurality of sub-regions include a first sub-region for which a residual coefficient is encoded in an encoding device and a second sub-region for which the residual coefficient is not encoded in the encoding device. region, wherein index information is encoded based on the position of the second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information specifies the position of the sub-region for which the residual coefficient is not encoded in the encoding device among the multiple sub-regions, wherein the second sub-region represents a region excluding at least one of the following: N columns from the left side of the residual block or M rows from the upper side of the residual block, and wherein the residual samples of the second sub-region in the residual block are set to be equal to a default value predefined at the encoding device, and wherein the default value is 0.

[0009] Another aspect of the present invention provides a non-transitory computer-readable medium storing a bit stream generated by a coding method, the coding method comprising: performing a transformation on a residual sample of a residual block to obtain a transformation coefficient of the residual block; performing a quantization on the transformation coefficient of the residual block based on a quantization parameter to obtain a quantized transformation coefficient of the residual block; and generating a bit stream by encoding the quantized transformation coefficient, wherein the residual block is divided into a plurality of sub-regions based on vertical lines or horizontal lines, wherein the plurality of sub-regions include a first sub-region for which the residual coefficient is encoded in a coding device and a second sub-region for which the residual coefficient is not encoded in the coding device. A second sub-region for encoding a coefficient, wherein index information is encoded based on a position of the second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information specifies a position of a sub-region among the multiple sub-regions for which the residual coefficient is not encoded in the encoding device, wherein the second sub-region represents an area excluding at least one of the following: N columns from the left side of the residual block or M rows from the upper side of the residual block, and wherein residual samples of the second sub-region in the residual block are set to be equal to a default value predefined at the encoding device, and wherein the default value is 0.

[0010] Technical Solutions

[0011] According to the video encoding / decoding method and device of the present invention, the residual coefficients of the residual block can be derived, the quantization parameters of the residual block can be calculated, the residual coefficients can be dequantized using the calculated quantization parameters of the residual block, and the dequantized residual coefficients can be inversely transformed to reconstruct the residual samples of the residual block.

[0012] The video encoding / decoding method and apparatus according to the present invention can scale the residual coefficients based on the quantization weights of a predetermined scaling list.

[0013] The scaling list according to the present invention may mean an arrangement of quantization weights defined for each frequency in the residual block.

[0014] The scaling list according to the present invention may be signaled in the encoding device in the form of NxM.

[0015] In the video encoding / decoding method and apparatus according to the present invention, at least one of inverse transformation or scaling may be performed in the horizontal direction and the vertical direction, respectively.

[0016] In the video encoding / decoding method and apparatus according to the present invention, inverse transform may be performed in two steps of a first inverse transform and a second inverse transform.

[0017] In the video encoding / decoding method and apparatus according to the present invention, inverse transform may be performed in the order of the first inverse transform, and scaling may be performed before the second inverse transform or between the second inverse transform and the first inverse transform.

[0018] In the video encoding / decoding method and apparatus according to the present invention, the residual block may be divided into one or more entropy groups.

[0019] In the video encoding / decoding method and apparatus according to the present invention, an entropy group may be defined as a group of residual coefficients belonging to the same / similar frequency band.

[0020] In the video encoding / decoding method and apparatus according to the present invention, at least one of a scanning order, an entropy decoding scheme or a binarization scheme associated with one of the plurality of entropy groups may be different from another of the plurality of entropy groups.

[0021] In the video encoding / decoding method and apparatus according to the present invention, the number of entropy groups may be variably determined based on encoding information related to the residual block.

[0022] In the video encoding / decoding method and apparatus according to the present invention, the entropy group may be determined based on at least one of a scanning order or a number of residual coefficients belonging to the entropy group.

[0023] In the video encoding / decoding method and apparatus according to the present invention, the entropy group may be determined based on one, two or more pieces of position information.

[0024] In the video encoding / decoding method and apparatus according to the present invention, the position information may indicate the position of a specific residual coefficient belonging to the residual block.

[0025] In the video encoding / decoding method and apparatus according to the present invention, residual coefficients are derived by scanning according to a predetermined scanning order, and the scanning may be performed for each entropy group.

[0026] In the video encoding / decoding method and apparatus according to the present invention, scanning may be performed using a different scanning order for each entropy group.

[0027] In the video encoding / decoding method and apparatus according to the present invention, scanning may be performed from a predetermined starting position within the residual block.

[0028] In the video encoding / decoding method and apparatus according to the present invention, the start position may be determined based on at least one of information indicating the start position of scanning or information specifying an entropy group including the start position of scanning.

[0029] In the video encoding / decoding method and apparatus according to the present invention, the step of deriving residual coefficients may further include: setting residual coefficients of a partial area in the residual block to default values ​​predefined in the decoding apparatus.

[0030] In the video encoding / decoding method and apparatus according to the present invention, the partial area may be an area excluding at least one of N columns from the left side of the residual block or M rows from the upper side of the residual block, or may be an area excluding an NxM area in the residual block.

[0031] In the video encoding / decoding method and apparatus according to the present invention, N and M may be derived based on information encoded to specify the partial region.

[0032] In the video encoding / decoding method and apparatus according to the present invention, the residual block may be divided into blocks of variable size / shape based on at least one of a quadtree, a binary tree, or a ternary tree.

[0033] Beneficial Effects

[0034] According to the present invention, the encoding / decoding efficiency of the residual block can be improved based on the quantization weights of the predetermined scaling list.

[0035] According to the present invention, the encoding / decoding efficiency of the residual block can be improved based on a predetermined entropy group.

[0036] According to the present invention, the encoding / decoding efficiency of the residual block can be improved by setting the residual coefficients of a predetermined area in the residual block to a predefined default value.

[0037] Furthermore, according to the present invention, encoding / decoding efficiency can be improved through tree-structured block division. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a block diagram showing an encoding apparatus according to an embodiment of the present invention.

[0039] Figure 2 is a block diagram illustrating a decoding apparatus according to an exemplary embodiment of the present invention.

[0040] Figure 3 Block partition types according to an embodiment to which the present invention is applied are shown.

[0041] Figure 4 A tree-structure based block partitioning method according to an embodiment of the present invention is shown.

[0042] Figure 5 A method for reconstructing residual samples according to an embodiment of the present invention is shown.

[0043] Figure 6 A method of deriving a quantization parameter prediction value (QPpred) according to an embodiment of the present invention is shown.

[0044] Figure 7 A method of deriving a quantization parameter prediction value of a chroma component of a block T according to an embodiment of the present invention is shown.

[0045] Figure 8 A quantization parameter derivation method of a signal transmission unit based on a quantization parameter difference (deltaQP) according to an embodiment of the present invention is shown.

[0046] Fig. 9 The inverse transform process of the residual coefficients according to an embodiment of the present invention is shown.

[0047] Fig.10 The shape of a zoom list related to a zoom process according to an embodiment of the present invention is shown.

[0048] Fig.11 A scaling and inverse transform process based on quantization weights according to an embodiment of the present invention is shown.

[0049] Fig.12 and Fig.13 A method for determining an entropy group of a residual block according to an embodiment of the present invention is shown.

[0050] Fig.14 The relationship between the scan of the residual coefficients and the entropy group according to an embodiment of the present invention is shown.

[0051] Fig.15A method of scanning residual coefficients according to an embodiment of the present invention is shown.

[0052] Fig.16 A method for processing residual coefficients of a partial region in a residual block according to an embodiment of the present invention is shown.

[0053] Best Mode for Carrying Out the Invention

[0054] The video encoding / decoding method and apparatus according to the present invention can derive residual coefficients of a residual block, calculate quantization parameters of the residual block, dequantize the residual coefficients using the calculated quantization parameters of the residual block, and inversely transform the dequantized residual coefficients to reconstruct residual samples of the residual block.

[0055] The video encoding / decoding method and apparatus according to the present invention can scale the residual coefficients based on the quantization weights of a predetermined scaling list.

[0056] The scaling list according to the present invention may mean an arrangement of quantization weights defined for each frequency in the residual block.

[0057] The scaling list according to the present invention may be signaled in an NxM form in the encoding device.

[0058] In the video encoding / decoding method and apparatus according to the present invention, at least one of inverse transformation or scaling may be performed in the horizontal direction and the vertical direction, respectively.

[0059] In the video encoding / decoding method and apparatus according to the present invention, inverse transform may be performed in two steps of a first inverse transform and a second inverse transform.

[0060] In the video encoding / decoding method and apparatus according to the present invention, inverse transform may be performed in the order of the first inverse transform, and scaling may be performed before the second inverse transform or between the second inverse transform and the first inverse transform.

[0061] In the video encoding / decoding method and apparatus according to the present invention, the residual block may be divided into one or more entropy groups.

[0062] In the video encoding / decoding method and apparatus according to the present invention, an entropy group may be defined as a group of residual coefficients belonging to the same / similar frequency band.

[0063] In the video encoding / decoding method and apparatus according to the present invention, at least one of a scanning order, an entropy decoding scheme or a binarization scheme associated with one of the plurality of entropy groups may be different from another of the plurality of entropy groups.

[0064] In the video encoding / decoding method and apparatus according to the present invention, the number of entropy groups may be variably determined based on encoding information related to the residual block.

[0065] In the video encoding / decoding method and apparatus according to the present invention, the entropy group may be determined based on at least one of a scanning order or a number of residual coefficients belonging to the entropy group.

[0066] In the video encoding / decoding method and apparatus according to the present invention, the entropy group may be determined based on one, two or more pieces of position information.

[0067] In the video encoding / decoding method and apparatus according to the present invention, the position information may indicate the position of a specific residual coefficient belonging to the residual block.

[0068] In the video encoding / decoding method and apparatus according to the present invention, residual coefficients are derived by scanning according to a predetermined scanning order, and the scanning may be performed for each entropy group.

[0069] In the video encoding / decoding method and apparatus according to the present invention, scanning may be performed using a different scanning order for each entropy group.

[0070] In the video encoding / decoding method and apparatus according to the present invention, scanning may be performed from a predetermined starting position within the residual block.

[0071] In the video encoding / decoding method and apparatus according to the present invention, the start position may be determined based on at least one of information indicating the start position of scanning or information specifying an entropy group including the start position of scanning.

[0072] In the video encoding / decoding method and apparatus according to the present invention, the step of deriving residual coefficients may further include: setting residual coefficients of a partial area in the residual block to default values ​​predefined in the decoding apparatus.

[0073] In the video encoding / decoding method and apparatus according to the present invention, the partial area may be an area excluding at least one of N columns from the left side of the residual block or M rows from the upper side of the residual block, or may be an area excluding an NxM area in the residual block.

[0074] In the video encoding / decoding method and apparatus according to the present invention, N and M may be derived based on information encoded to specify the partial region.

[0075] In the video encoding / decoding method and apparatus according to the present invention, the residual block may be divided into blocks of variable size / shape based on at least one of a quadtree, a binary tree, or a ternary tree.

[0076] Embodiments of the present invention

[0077] The present invention may be changed and modified in various ways and may be described with reference to different exemplary embodiments, some of which will be described and shown in the accompanying drawings. However, these embodiments are not intended to limit the present invention, but are understood to include all modifications, equivalents and alternatives that belong to the spirit and technical scope of the present invention. In the accompanying drawings, the same reference numerals always refer to the same elements.

[0078] Although the terms first, second, etc. may be used to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, without departing from the teachings of the present invention, a first element may be referred to as a second element, and similarly a second element may be referred to as a first element. The term "and / or" includes any and all combinations of multiple associated listed items.

[0079] It will be understood that when an element is referred to as being "connected to" or "coupled to" another element, the element may be directly connected or coupled to the other element or an intervening element. In contrast, when an element is referred to as being "directly connected to" or "directly coupled to" another element, there are no intervening elements.

[0080] The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are also intended to include plural forms. It will also be understood that when used in this specification, the terms "including" and / or "having" specify the presence of stated features, wholes, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, parts and / or their groups.

[0081] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals refer to the same elements throughout, and redundant descriptions of the same elements will be omitted herein.

[0082] Figure 1 is a block diagram showing an encoding apparatus according to an embodiment of the present invention.

[0083] Reference Figure 1 , the encoding device 100 includes a picture division unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150 and a memory 155.

[0084] Figure 1Each of the elements shown is shown independently to represent different characteristic functions in the encoding device, and it can be meant that each element is composed of separate hardware. However, for ease of description, the elements are arranged independently, wherein at least two elements can be combined into a single element, or a single element can be divided into multiple elements to perform a function. It should be noted that, without departing from the essence of the present invention, some elements are integrated into a combined element and / or the embodiment in which the element is divided into multiple separate elements is included within the scope of the present invention.

[0085] Some elements are not essential to the substantial functions of the present invention, but are optional constituent elements that can only be used to improve performance. The present invention can be implemented by only including constituent elements that are essential to the embodiments of the present invention except for the constituent elements that are only used to improve performance. Structures that only include essential constituent elements except for the optional constituent elements that are only used to improve performance belong to the scope of the present invention.

[0086] The picture division unit 110 may divide the input picture into at least one block. In this case, the block may mean a coding unit (CU), a prediction unit (PU) or a transform unit (TU). The division may be performed based on at least one of a quadtree, a binary tree or a ternary tree. A quadtree is a method of dividing an upper layer block into sub-blocks whose width and height are half of the upper layer block. A binary tree is a method of dividing an upper layer block into sub-blocks whose width or height is half of the upper layer block. In a binary tree, by dividing the upper layer block based on the above-mentioned binary tree-based division, the block may have a non-square shape as well as a square shape.

[0087] In an embodiment of the present invention, CU may be used to refer not only to a coding unit but also to a decoding unit.

[0088] The prediction units 120 and 125 may include an inter-prediction unit 120 for performing inter-prediction and an intra-prediction unit 125 for performing intra-prediction. The prediction units 120 and 125 may determine which of the inter-prediction and intra-prediction is performed on the PU, and may determine the specific information of the determined prediction method (e.g., intra-prediction mode, motion vector, and reference picture). Here, the processing unit for which prediction is performed may be different from the processing unit for which the prediction method and specific information are determined. For example, the prediction method and prediction mode may be determined for each PU, and the prediction may be performed for each TU. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded by the entropy encoding unit 165 together with the residual value and sent to the decoding device. When a specific encoding mode is used, the original block may be encoded and sent to the decoding device without the prediction block generated by the prediction units 120 and 125.

[0089] The inter prediction unit 120 may predict the PU based on information about at least one of a previous picture of the current picture and a subsequent picture of the current picture. In some cases, the inter prediction unit 120 may predict the PU based on information about a partial coding region in the current picture. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0090] The reference picture interpolation unit may be provided with reference picture information from the memory 155, and the reference picture interpolation unit may generate pixel information less than or equal to an integer pixel on the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with a variable filter coefficient may be used to generate pixel information less than or equal to an integer pixel in units of 1 / 4 pixels. In the case of chroma pixels, a 4-tap interpolation filter based on DCT with a variable filter coefficient may be used to generate pixel information less than or equal to an integer pixel in units of 1 / 8 pixels.

[0091] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as a full search based block matching algorithm (FBMA), a three-step search (TSS) algorithm, and a new three-step search (NTS) algorithm may be used to calculate a motion vector. Based on the interpolated pixel, the motion vector has a motion vector value in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit may use different motion prediction methods to predict the current PU. Various methods such as skip mode, merge mode, and advanced motion vector prediction (AMVP) mode may be used as motion prediction methods.

[0092] The intra prediction unit 125 may generate a PU based on information about reference pixels adjacent to the current block. When the reference pixel is a pixel on which inter prediction has been performed because the block adjacent to the current PU is a block on which inter prediction has been performed, the information about the reference pixel in the block on which inter prediction has been performed may be replaced with information about the reference pixel in the block on which intra prediction has been performed. That is, when the reference pixel is unavailable, the information about the unavailable reference pixel may be replaced with information about at least one reference pixel among the available reference pixels.

[0093] The prediction mode of the intra prediction includes a directional prediction mode in which reference pixel information is used according to the prediction direction and a non-directional prediction mode in which information about the direction is not used when performing prediction. The mode for predicting the luminance component and the mode for predicting the chrominance component may be different from each other. In addition, the chrominance component may be predicted by using the intra prediction mode for obtaining the luminance component or the predicted / reconstructed luminance component.

[0094] In the intra prediction method, a prediction block can be generated by applying an adaptive intra smoothing (AIS) filter to reference pixels according to an intra prediction mode. Different types of AIS filters can be applied to reference pixels. In the intra prediction method, the intra prediction mode of the current PU can be predicted based on the intra prediction mode of a PU adjacent to the current PU. When the prediction mode of the current PU is predicted using mode information predicted based on the adjacent PU, when the current PU has the same intra prediction mode as the adjacent PU, predetermined flag information can be used to send information indicating that the current PU has the same intra prediction mode as the adjacent PU. When the current PU and the adjacent PU have different intra prediction modes, information about the intra prediction mode of the current block can be encoded by entropy coding.

[0095] A residual block including residual information may be generated. The residual information is a difference between the original block and the prediction block generated by the prediction units 120 and 125. The generated residual block may be input to the transform unit 130.

[0096] The transform unit 130 may transform the residual block including the residual data by using a transform type such as DCT, DST, etc. In this case, the transform type may be determined based on an intra prediction mode of a prediction unit used to generate the residual block.

[0097] The quantization unit 135 may quantize the value transformed to the frequency domain by the transformation unit 130. The quantization coefficient may be changed according to the importance or block of the image. The value output from the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0098] The rearrangement unit 160 may perform rearrangement of coefficient values ​​on the quantized residual block.

[0099] The rearrangement unit 160 may change the coefficients of a two-dimensional (2D) block into coefficients of a one-dimensional (1D) vector by a coefficient scanning method. For example, the rearrangement unit 160 may scan a DC coefficient into coefficients in a high frequency region using a predetermined scanning type and change it into a one-dimensional vector form.

[0100] The entropy encoding unit 165 may perform entropy encoding based on the value obtained by the rearrangement unit 160. For entropy encoding, various encoding methods such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC) may be used.

[0101] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction units 120 and 125, such as residual coefficient information and block type information about the CU, prediction mode information, partition unit information, PU information, transmission unit information, motion vector information, reference frame information, block interpolation information and filtering information.

[0102] The entropy encoding unit 165 may entropy encode coefficients of the CU input from the rearrangement unit 160 .

[0103] The inverse quantization unit 140 and the inverse transform unit 145 dequantize the value quantized by the quantization unit 135, and inversely transform the value transformed by the transform unit 130. A reconstructed block may be generated by adding a residual value to the predicted PU. The residual value may be generated by the inverse quantization unit 140 and the inverse transform unit 145. The predicted PU may be predicted by a motion vector prediction unit, a motion compensation unit, and an intra prediction unit of the prediction units 120 and 125.

[0104] The filter unit 150 may include at least one of a deblocking filter, an offset unit, and an adaptive in-loop filter (ALF).

[0105] The deblocking filter can remove block distortion generated by the boundaries between blocks in the reconstructed picture. It can be determined whether to apply the deblocking filter to the current block based on the pixels included in several rows or columns of the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. When horizontal filtering and vertical filtering are performed when applying the deblocking filter, horizontal filtering and vertical filtering can be performed in parallel.

[0106] The offset unit may apply an offset relative to the original image to the deblocked filtered image in units of pixels. The region to which the offset may be applied may be determined after dividing the pixels of the picture into a predetermined number of regions. The offset may be applied to the determined region in consideration of edge information about each pixel or a method of applying the offset to the determined region.

[0107] ALF can perform filtering based on the comparison result of the filtered reconstructed image with the original image. The pixels included in the image can be divided into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed for each group. Information about whether ALF is applied can be transmitted by each coding unit (CU), and the shape and filter coefficient of ALF to be applied to each block can be varied. In addition, ALF having the same form (fixed form) can be applied to the block regardless of the characteristics of the block.

[0108] The memory 155 may store the reconstructed block or the reconstructed picture output from the filter unit 150 , and when inter prediction is performed, may provide the stored reconstructed block or the reconstructed picture to the prediction units 120 and 125 .

[0109] Figure 2 is a block diagram illustrating a decoding apparatus according to an exemplary embodiment of the present invention.

[0110] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210 , a rearrangement unit 215 , a dequantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .

[0111] Figure 2 Each of the elements shown is independently shown to represent different characteristic functions in the decoding device, and it can be meant that each element is composed of separate hardware. However, for ease of description, the elements are independently arranged, wherein at least two elements can be combined into a single element, or a single element can be divided into multiple elements to perform a function. It should be noted that, without departing from the essence of the present invention, some elements are integrated into a combined element and / or the embodiment in which the element is divided into multiple separate elements is included within the scope of the present invention.

[0112] The entropy decoding unit 210 may perform entropy decoding on the input bit stream. For example, for entropy encoding, various methods such as exponential Golomb coding, CAVLC, or CABAC may be used.

[0113] The entropy decoding unit 210 may decode information associated with intra prediction and inter prediction performed by the encoding device.

[0114] The rearrangement unit 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding unit 210. The rearrangement unit 215 may reconstruct and rearrange coefficients of the 1D vector into coefficients of the 2D block. Information about coefficient scanning performed by the encoding device may be provided to the rearrangement unit 215, and the rearrangement unit 215 may perform rearrangement using a method of inversely scanning the coefficients based on the scanning order performed by the encoding device.

[0115] The dequantization unit 220 may perform dequantization based on the quantization parameter and the rearrangement coefficient of the block.

[0116] The inverse transform unit 225 may perform inverse transform on the dequantized transform coefficient based on a predetermined transform type. In this case, the transform type may be determined based on a prediction mode (inter / intra prediction), a size / shape of a block, an intra prediction mode, a component type (luminance / chrominance component), or a partition type (QT, BT, TT, etc.).

[0117] The prediction units 230 and 235 may generate a prediction block based on the provided information for generating the prediction block and information about a previously decoded block or picture. The information for generating the prediction block may be provided from the entropy decoding unit 210. The information about a previously decoded block or picture may be provided from the memory 245.

[0118] The prediction units 230 and 235 may include a PU determination unit, an inter prediction unit, and an intra prediction unit. The PU determination unit may receive various information from the entropy decoding unit 210, such as PU information, intra prediction mode related information of the intra prediction method, and motion prediction related information of the inter prediction method, and the like, and the PU determination unit may determine the PU of the current CU. The PU determination unit may determine which of inter prediction and intra prediction is performed on the PU. The inter prediction unit 230 may perform inter prediction on the current PU based on information about at least one of the previous picture and the subsequent picture of the current picture including the current PU. The inter prediction unit 230 may use the information required for inter prediction for the current PU provided from the encoding device. Inter prediction may be performed based on information of a pre-reconstructed partial area in the current picture including the current PU. To this end, the pre-reconstructed partial area may be added to the reference picture list.

[0119] In order to perform inter prediction, whether a motion prediction method for a PU included in a CU is a skip mode, a merge mode, an AMVP mode, or a current picture reference mode may be determined in units of CUs.

[0120] The intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. When the PU is a PU on which intra prediction is performed, intra prediction may be performed based on intra prediction mode information about the PU provided from the encoding device. The intra prediction unit 235 may include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block. The AIS filter may determine whether to apply the filter based on the prediction mode of the current PU. The prediction mode of the PU provided from the encoding device and information about the AIS filter may be used to perform AIS filtering on the reference pixels of the current block. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0121] When the prediction mode of the PU indicates a prediction mode for performing intra-frame prediction based on pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolation unit may generate reference pixels by interpolating reference pixels in units of fractional pixels that are smaller than integer pixels (i.e., full pixels). When the prediction mode of the current PU indicates a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

[0122] The reconstructed block or the reconstructed picture may be provided to the filter unit 240. The filter unit 240 includes a deblocking filter, an offset unit, and an ALF.

[0123] The encoding device may provide information about whether to apply a deblocking filter to a corresponding block or picture and information about which of a strong filter and a weak filter to apply when using the deblocking filter. The deblocking filter of the decoding device may be provided with information about the deblocking filter from the encoding device, and the deblocking filter may perform deblocking filtering on the corresponding block.

[0124] The offset unit may apply an offset to the reconstructed picture based on information about an offset type and an offset value applied to the picture during encoding.

[0125] ALF may be applied to the CU based on information on whether ALF is applied and ALF coefficient information, etc., provided from the encoding device. The ALF information may be included in and provided in a specific parameter set.

[0126] The memory 245 may store a reconstructed picture or a reconstructed block used as a reference picture or a reference block, and may provide the reconstructed picture to the output unit.

[0127] Figure 3 Block partition types according to an embodiment to which the present invention is applied are shown.

[0128] One block (hereinafter referred to as a first block) may be divided into a plurality of sub-blocks (hereinafter referred to as a second block) by at least one of a vertical line or a horizontal line. The number of each of the vertical lines and the horizontal lines may be one, two or more. Here, the first block may be a coding block (CU) as a basic unit of image encoding / decoding, a prediction block (PU) as a basic unit of prediction encoding / decoding, or a transform block (TU) as a basic unit of transform encoding / decoding. The first block may be a square block or a non-square block.

[0129] The partitioning of the first block may be performed based on a quadtree, a binary tree, a ternary tree, etc., and the reference Figure 3 Describe in detail.

[0130] Figure 3 (a) shows a quadtree partition (QT). QT is a partition type in which a first block is partitioned into four second blocks. For example, when a 2N×2N first block is partitioned by QT, the first block may be partitioned into four second blocks having a size of N×N. QT may be limited to be applicable to only square blocks, but may also be applicable to non-square blocks.

[0131] Figure 3 (b) shows a horizontal binary tree (hereinafter referred to as horizontal BT) partition. Horizontal BT is a partition type in which a first block is divided into two second blocks by a horizontal line. The partition can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is divided based on horizontal BT, the first block can be divided into two second blocks with a height ratio of (a:b). Here, a and b can be the same value, and a can be greater than or less than b.

[0132] Figure 3 (c) shows a vertical binary tree (hereinafter referred to as vertical BT) partition. Vertical BT is a partition type in which a first block is divided into two second blocks by a vertical line. The partition can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is divided based on vertical BT, the first block can be divided into two second blocks with a width ratio of (a:b). Here, a and b can be the same value, and a can be greater than or less than b.

[0133] Figure 3 (d) shows a horizontal ternary tree (hereinafter referred to as horizontal TT) partition. Horizontal TT is a partition type in which a first block is divided into three second blocks by two horizontal lines. For example, when a 2N×2N first block is divided based on horizontal TT, the first block may be divided into three second blocks with a height ratio of (a:b:c). Here, a, b, and c may be the same value. Alternatively, a and c may be the same, and b may be greater than or less than a.

[0134] Figure 3 (e) shows a vertical ternary tree (hereinafter referred to as vertical TT) partition. Vertical TT is a partition type in which a first block is divided into three second blocks by two vertical lines. For example, when a 2N×2N first block is divided based on vertical TT, the first block can be divided into three second blocks with a width ratio of (a:b:c). Here, a, b, and c can be the same value or different values. Alternatively, a and c can be the same, and b can be greater than or less than a. Alternatively, a and b can be the same, and c can be greater than or less than a. Alternatively, b and c are the same, and a can be greater than or less than b.

[0135] The above-mentioned division may be performed based on division information signaled from the encoding device. The division information may include at least one of division type information, division direction information, or division ratio information.

[0136] The partition type information may specify any one of the partition types predefined in the encoding / decoding device. The predefined partition types may include at least one of QT, horizontal BT, vertical BT, horizontal TT, vertical TT, or non-partition mode (no partitioning). Alternatively, the partition type information may mean information about whether QT, BT, or TT is applied, and may be encoded in the form of a tag or index. In the case of BT or TT, the partition direction information may indicate whether it is horizontal partitioning or vertical partitioning. In the case of BT or TT, the partition ratio information may indicate the ratio of the width and / or height of the second block.

[0137] Figure 4 A tree-structure based block partitioning method according to an embodiment of the present invention is shown.

[0138] Figure 4 The block 400 shown is assumed to be a square block of size 8N×8N and a partition depth of k (hereinafter referred to as a first block). When the partition information of the first block indicates QT partitioning, the first block may be divided into four sub-blocks (hereinafter referred to as a second block). The size of the second block may be 4N×4N, and the partition depth may be (k+1).

[0139] The four second blocks may be divided again based on QT, BT, TT or non-division mode. For example, when the division information of the second block indicates a horizontal binary tree (horizontal BT), the second block is divided into Figure 4 In this case, the size of the third block may be 4N×2N, and the partition depth may be (k+2).

[0140] The third block may be further divided based on QT, BT, TT or non-division mode. For example, when the division information of the third block indicates a vertical binary tree (vertical BT), the third block is divided into Figure 4 In this case, the size of the sub-blocks 411 and 412 may be 2N×2N and the division depth may be (k+3). Alternatively, when the division information of the third block indicates a horizontal binary tree (horizontal BT), the third block may be divided into Figure 4 The two sub-blocks 413 and 414 are shown. In this case, the size of the sub-blocks 413 and 414 may be 4N×N and the partition depth may be (k+3).

[0141] The partitioning may be performed independently or in parallel with adjacent blocks, or may be performed sequentially according to a predetermined priority order.

[0142] The division information of the current block can be determined based on at least one of the division information of the upper block of the current block or the division information of the adjacent block. For example, when the second block is divided based on the horizontal BT and the upper third block is divided based on the vertical BT, it is not necessary to divide the lower third block based on the vertical BT. If the lower third block is divided by the vertical BT, this is the same as the result of dividing the second block by QT. Therefore, the encoding of the division information of the lower third block (especially the division direction information) can be skipped, and the decoding device can be set to divide the lower third block in the horizontal direction.

[0143] The upper block may mean a block having a smaller partition depth than the partition depth of the current block. For example, when the partition depth of the current block is (k+2), the partition depth of the upper block may be (k+1). The neighboring block may be a block adjacent to the top or left side of the current block. The neighboring block may be a block having the same partition depth as the current block.

[0144] The above division can be performed repeatedly until the minimum unit of encoding / decoding. When divided into the minimum unit, the division information of the block is no longer signaled from the encoding device. The information about the minimum unit may include at least one of the size or shape of the minimum unit. The size of the minimum unit may be represented by width, height, minimum or maximum value of width and height, sum of width and height, number of pixels, or division depth. The information about the minimum unit may be signaled in at least one of a video sequence, a picture, a stripe, or a block unit. Alternatively, the information about the minimum unit may be a value predefined in the encoding / decoding device. Information about the minimum unit may be signaled for each of the CU, PU, ​​and TU. Information about a minimum unit may be equally applied to CU, PU, ​​and TU.

[0145] Figure 5 A method for reconstructing residual samples according to an embodiment of the present invention is shown.

[0146] Reference Figure 5 , the residual coefficients of the residual block can be derived by entropy encoding the bit stream (S500).

[0147] The encoding device may perform transformation and / or quantization on the residual samples of the residual block to derive residual coefficients, and may encode the derived residual coefficients based on a predetermined encoding scheme. The encoding scheme may include at least one of a scanning order, an entropy encoding scheme, or a binarization scheme. Examples of entropy encoding schemes may include exponential Golomb, CAVLC, CABAC, etc. Examples of binarization schemes may include truncated Rice (TR) binarization, k-th order Exp-Colomb (EGk) binarization, fixed length (FL) binarization, etc.

[0148] In this case, the residual block can be divided into one or more groups (hereinafter, referred to as entropy groups), and each entropy group can include at least one residual coefficient. An entropy group may mean a group of residual coefficients having the same / similar frequency band. The frequency band may be divided into a low frequency band and a high frequency band, or may be divided into three frequency bands, such as a low frequency band, a mid frequency band, and a high frequency band. However, this is only an example, and the frequency band may be further subdivided considering frequency characteristics. The encoding of the residual coefficient may be performed for each entropy group in the residual block.

[0149] The decoding device may derive residual coefficients from the bitstream based on a predetermined decoding scheme. The decoding scheme is based on the above-mentioned encoding scheme, and a detailed description thereof will be omitted.

[0150] The decoding of the residual block may be performed for each entropy group. For example, the entropy group to which the residual coefficient to be decoded belongs may be identified, and the residual coefficient may be derived based on a decoding scheme corresponding to the entropy group. At least one of a scanning order, an entropy decoding scheme, or a binarization scheme associated with one of the plurality of entropy groups may be different from another of the plurality of entropy groups. Figures 12 to 15 To describe the method of deriving residual coefficients based on entropy groups.

[0151] The derivation process of the residual coefficient may further include: setting the residual coefficient of a partial area (eg, a high frequency area) in the residual block to a default value predefined in the decoding device. Fig.16 Describe this.

[0152] The derivation of the residual coefficient may be performed by decoding at least one of information on the presence or absence of a non-zero residual coefficient, an absolute value (abs), or a sign of the encoded residual coefficient.

[0153] The export may also include a process of setting the residual coefficients of the high-frequency area in the residual block to 0. The high-frequency area may be defined as an area excluding at least one of the n columns from the left of the residual block or the m rows from the top of the residual block. n and m may be values ​​pre-assigned in the encoding / decoding device, or may be determined differently according to the size / type of the residual block. For example, when the residual block is 64×32, an area excluding 32 columns (here, n=32, m=0) from the left of the residual block may be defined as a high-frequency area. When the residual block is 32×64, an area excluding 32 rows (here, n=0, m=32) from the top of the residual block may be defined as a high-frequency area. Alternatively, n and m may be derived based on the encoded information to specify the high-frequency area.

[0154] In addition, the process of setting the residual coefficient to 0 may be selectively performed considering at least one of the size or shape of the residual block. For example, the above process may be applied only when the size of the residual block is greater than or equal to a predetermined threshold. The size of the residual block may be expressed as at least one of the width or height of the residual block. The threshold may mean the minimum size that allows the residual coefficient to be set to 0. The threshold may be a value pre-assigned in the encoding / decoding of the residual block, or may be encoded and signaled by the encoding of the residual block. The threshold may be 32, 64, 128, 256 or more.

[0155] The process of setting the residual coefficient to 0 may be selectively performed based on the flag information. The flag information may indicate whether the residual coefficient of the high frequency region in the residual block is set to 0. The flag information may be derived from the decoding device based on the size / type of the residual block, or the flag information may be encoded and signaled by the encoding device. However, the above process may be limited to be performed only when the residual block is not encoded in the transform skip mode. Therefore, when the residual block is encoded in the transform skip mode, the encoding device does not encode the information required to set the residual coefficient to 0.

[0156] Reference Figure 5 , the quantization parameter of the residual block can be calculated (S510).

[0157] The quantization parameter may be derived using at least one of a quantization parameter prediction value (QPpred) or a quantization parameter difference value (deltaQP). In other words, the quantization parameter may be set to the quantization parameter prediction value (QPpred), or the quantization parameter may be derived by adding the quantization parameter difference value (deltaQP) to the quantization parameter prediction value (QPpred).

[0158] For example, when dequantization is not required for a block (e.g., merge mode, skip mode, no transform mode, PCM mode, when there are no non-zero coefficients in the block (i.e., coded block flag = 0), etc.), the quantization parameter difference (deltaQP) is not encoded. In this case, the quantization parameter prediction value (Qppred) can be set equal to the quantization parameter.

[0159] Will refer to Figure 6 to Figure 7 A method for deriving a quantization parameter prediction value (QPpred) is described. At the same time, a quantization parameter difference value (deltaQP) may be signaled in a predetermined unit and referred to Figure 8 A method for quantization parameter derivation based on a signaling unit of a quantization parameter difference (deltaQP) is described.

[0160] The calculation of the quantization parameter may also include a process of modifying the derived quantization parameter based on a predetermined quantization parameter offset (QPoffset).

[0161] The quantization parameter offset (QPoffset) may be a fixed value predefined for the encoding / decoding device, or may be encoded and signaled by the encoding device. The quantization parameter offset (QPoffset) may be signaled in at least one level of a video sequence, picture, slice, tile, or block unit. The unit for signaling the quantization parameter offset may be larger than the unit for signaling the quantization parameter difference. The value and number of the quantization parameter offset (Qpoffset) may be adaptively determined according to the block size / shape, the number of partitions, the prediction mode, the intra-frame prediction mode, the component type (e.g., luminance, chrominance), etc.

[0162] The number of quantization parameter offsets may be one, two, three or more. For example, the quantization parameter offsets may be defined in at least one of a picture level, a slice level or a block level. The quantization parameter offsets may be defined for each of an intra mode and an inter mode, or may be defined for each of a luminance component and a chrominance component. Alternatively, a separate offset for an LM mode of an intra prediction mode may be defined. Here, the LM mode may mean a mode in which a chrominance block is predicted using a prediction / reconstruction sample of a luminance block.

[0163] Reference Figure 5 , the residual coefficients may be dequantized using the calculated quantization parameters (S520).

[0164] Specifically, dequantization may be performed based on at least one of a quantization parameter or a predetermined level scale value. The level scale value may be a value predefined for an encoding / decoding device, or may be encoded and signaled by an encoding device. The level scale value may consist of k integer values ​​in a one-dimensional array. For example, the level scale value may be defined as {40, 45, 51, 57, 64, 72}. However, this does not limit the number of level scale values ​​and integer values. That is, the level scale value may be defined as another value, and the number of level scale values ​​may be defined as 4, 5, 7, 8 or more.

[0165] At the same time, a predetermined quantization weight m may also be applied to the dequantized result, and this process is called scaling. Fig.10 and Fig.11 To describe the scaling.

[0166] In addition, when the residual block includes multiple entropy groups, different quantization parameters can be applied to each entropy group. For example, each entropy group in the residual block shares the same quantization parameter difference value, but different quantization parameter prediction values ​​can be used. Conversely, each entropy group of the residual block shares the same quantization parameter prediction value, but different quantization parameter difference values ​​can be used. That is, the unit used to calculate the quantization parameter prediction value may be different from the unit used to calculate the quantization parameter difference value. In this case, dequantization can be performed for each entropy group. For entropy groups with only zero residual coefficients, the dequantization process can be skipped.

[0167] Reference Figure 5 , the residual samples can be reconstructed by performing inverse transform on the dequantized residual coefficients (S530).

[0168] The inverse transform may be performed based on a predetermined transform type, and the transform type of the residual block may be determined based on a transform candidate set. The transform candidate set may include n transform types. For example, the transform candidate set may include at least one of DCT-II, DCT-V, DCT-VIII, DST-I, or DST-VII.

[0169] In an encoding / decoding device, m transform candidate sets may be defined. Here, m may be 1, 2, 3 or more. The number and / or type of transform types belonging to one of the m transform candidate sets (hereinafter referred to as the first transform candidate set) may be different from the other (hereinafter referred to as the second transform candidate set). For example, the first transform candidate set may consist of p transform types, and the second transform candidate set may consist of q transform types less than p. Alternatively, even when the first transform candidate set and the second transform candidate set consist of the same number of transform types, at least one transform type belonging to the first transform candidate set may be different from a transform type belonging to the second transform candidate set.

[0170] Any one of the m transformation candidate sets can be selectively used.

[0171] The selection of the transform candidate set may be performed based on the size of the residual block. For example, if the size of the residual block is less than or equal to a threshold, a first transform candidate set consisting of p transform types is selected, and if the size of the residual block is greater than the threshold, a second transform candidate set consisting of q transform types may be selected. The threshold may be 32, 64, 128, 256 or greater, and p may be a value greater than q.

[0172] Alternatively, the selection of the transform candidate set may be performed based on information to be signaled from the encoding device. The information may specify any one of the m transform candidate sets. The information may be signaled in at least one level of a picture, a slice, or a block.

[0173] When the selected transform candidate set includes a plurality of transform types, the encoding device may encode information specifying any one of the plurality of transform types. The decoding device may determine the transform type of the residual block by decoding the encoded information.

[0174] At the same time, the inverse transform can be selectively performed based on a predetermined mark. Here, the mark can indicate whether to skip the inverse transform for the residual block. For example, if the mark is 1, the inverse transform is not performed on the residual block, and if the mark is 0, the inverse transform can be performed on the residual block. Therefore, the transform type of the residual block can be derived only when the mark is 0. Alternatively, the inverse transform can be selectively performed based on the characteristics of the residual block. Based on the characteristics of the residual block, the decoding device can determine whether to skip the inverse transform. These characteristics may refer to the size / type of the residual block, the partition type, the prediction mode, the component type, or other residual coefficients related to the encoding parameters.

[0175] In addition to the inverse transform (hereinafter referred to as the first inverse transform), an additional inverse transform (hereinafter referred to as the second inverse transform) may be performed, and this will refer to Fig. 9 Give a description.

[0176] Figure 6 A method of deriving a quantization parameter prediction value (QPpred) according to an embodiment of the present invention is shown.

[0177] Reference Figure 6 , a quantization parameter prediction value (QPpred) for block T can be derived based on the quantization parameters of neighboring blocks. Block T is a block of size N×M and can be square or non-square.

[0178] The neighboring block may be a block adjacent to the block T in space / time, and may be a block previously decoded before the block T. For example, the neighboring block may include at least one of a left block, an upper block, an upper left block, an upper right block, or a lower left block of the block T. Alternatively, the neighboring block may also include a collocated block corresponding to the block T in time. The collocated block may be defined as a block belonging to a different picture from the block T and including the position of at least one of the upper left corner sample, the lower right corner sample, or the center sample of the block T.

[0179] The position of the neighboring block may be a predefined position in the encoding / decoding device. For example, the predefined position may be a left block and an upper block, or may be a left block, an upper block, and an upper left block. However, the present invention is not limited thereto, and may also include a lower left block, an upper right block, and the like. The position of the neighboring block may be determined differently based on at least one characteristic (e.g., size, shape, partition depth, partition type, component type, etc.) of at least one of the block T or the neighboring blocks. For example, the neighboring block may be determined as a block having the largest area among the blocks adjacent to the block T, or the neighboring block may be determined as a block having the longest length of the borders adjacent to each other. This may be performed separately for the upper block and the left block of the block T.

[0180] Alternatively, information specifying the position of the neighboring block may be encoded by the encoding device and signaled. The information may be encoded in the form of a flag, an index, etc. For example, if the information is index 0, the quantization parameter of the left block may be used to derive the quantization parameter prediction value (QPpred) of block T. If the information is index 1, the quantization parameter of the upper block may be used to derive the quantization parameter prediction value (QPpred) of block T.

[0181] The number of neighboring blocks is n, where n can be a natural number of 1, 2, 3, 4 or more. The number can be a fixed value predefined in the encoding / decoding device. Alternatively, the number can be determined differently based on the characteristics of at least one of block T or neighboring blocks (e.g., size, type, partition depth, partition type, component type, etc.). Alternatively, the maximum number information of neighboring blocks for deriving a quantization parameter prediction value (QPpred) for block T can be encoded and signaled by the encoding device. That is, block T can use neighboring blocks within a number range according to the maximum number information. The maximum number information can be signaled at the level of at least one of a video sequence, a picture, and other fragment areas (e.g., a slice, a coding tree block row, a block).

[0182] As described above, the quantization parameter prediction value (QPpred) for block T may be derived using one or more neighboring blocks.

[0183] When multiple neighboring blocks are used, the quantization parameter prediction value (QPpred) of block T may be derived through arithmetic processing such as the median, average, minimum, maximum or mode value of the quantization parameters of the multiple neighboring blocks.

[0184] Alternatively, the quantization parameter prediction value (QPpred) of the block T may be derived by subtracting the QP of the upper left block from the sum of the QP of the upper block and the QP of the left block. In this case, if there are a plurality of upper blocks or left blocks, the QP of the upper block or the left block may be determined by an operation process such as a median value, an average value, a minimum value, a maximum value, or a mode value.

[0185] If there is an unavailable block among the neighboring blocks, the quantization parameter prediction value of block T can be derived using only the available neighboring blocks. Alternatively, when the neighboring blocks are unavailable, the quantization parameters of the neighboring blocks can be derived based on the quantization parameters defined in a predetermined fragment area. The fragment area may be a slice, a coded tree block row, a block, etc. The fragment area may represent the encoding / decoding area before block T or the area to which block T to be encoded / decoded belongs. Unavailable may be a case where the neighboring blocks do not physically exist, or a case where reference cannot be made according to the rules of the encoding / decoding device. For example, if block T and the neighboring blocks belong to different parallel processing areas (e.g., slices, slices, etc.), block T may not be allowed to refer to the neighboring blocks.

[0186] Figure 7 A method of deriving a quantization parameter prediction value for a chroma component of a block T according to an embodiment of the present invention is shown.

[0187] Hereinafter, the luma component and the chroma component of the block T will be referred to as a luma block and a chroma block, respectively.

[0188] In the case of a 4:2:0 color format, the chroma block TC may correspond to the luma block TY. A quantization parameter prediction value of the chroma block may be derived using a quantization parameter of the corresponding luma block.

[0189] However, if Figure 7 As shown, the division structure between the luminance block and the chrominance block may be different. In this case, the chrominance block may correspond to multiple luminance blocks. The quantization parameter prediction value of the chrominance block may be derived using the quantization parameter of one of the multiple luminance blocks. In this case, the luminance block corresponding to the position of the center sample or the position of the upper left sample of the chrominance block may be used. The luminance block with the largest area overlapping with the chrominance block may be used. Alternatively, the quantization parameter prediction value of the chrominance block may be derived by calculating the average value, median value, minimum value, maximum value, mode value, etc. of the quantization parameters of the multiple luminance blocks.

[0190] The quantization parameter of the neighboring block can be used to derive the quantization parameter prediction value of the chrominance block, which has been referred to Figure 6A detailed description has been made, and its detailed description will be omitted here.

[0191] As described above, the quantization parameter prediction value of the chrominance block can be derived by using both the method (first method) using the quantization parameter of the corresponding luminance block and the method (second method) using the quantization parameter of the neighboring block of the chrominance block. Alternatively, the quantization parameter prediction value of the chrominance block can be derived by selecting the first method or the second method.

[0192] The selection may be performed in consideration of whether the luminance block and the chrominance block have the same division structure, prediction mode, intra-prediction mode, color format, or size / shape with respect to block T. For example, if block T is encoded in inter-mode and the division structure of the chrominance block is the same as that of the luminance block, the first method may be used to predict the quantization parameter of the chrominance block. Alternatively, if the division structure of the chrominance block is the same as that of the luminance block, the first method may be used; otherwise, the second method may be used. Alternatively, if the intra-prediction mode of block T is the LM mode, the first method may be used to predict the quantization parameter of the chrominance block.

[0193] Alternatively, the selection may be performed based on information specifying the first method or the second method. The information may be encoded and signaled by the encoding device. The information may be signaled in at least one level of a video sequence, picture, or other fragment region (e.g., slice, slice, coding tree block row, and block).

[0194] The quantization parameter of the chrominance block may be derived to be the same as the derived quantization parameter prediction value of the chrominance block, or the quantization parameter of the chrominance block may be derived by adding the quantization parameter difference value to the quantization parameter prediction value. Figure 5 As shown, the derived quantization parameter may be modified using a predetermined quantization parameter offset.

[0195] For example, in the case of chroma blocks encoded in LM mode, the quantization parameter prediction value may be set equal to the quantization parameter. In this case, the quantization parameter difference value may not be signaled, or the process of adding the signaled quantization parameter difference value may be omitted. Alternatively, in the case of chroma blocks encoded in LM mode, one, two or more quantization parameter offsets may be used to modify the quantization parameter.

[0196] Figure 8 A quantization parameter derivation method of a signal transmission unit based on a quantization parameter difference (deltaQP) according to an embodiment of the present invention is shown.

[0197] The encoding device may determine a unit of a block for encoding deltaQP, and encode information indicating the size of the block. Here, the size may be represented by at least one of the following: the width or height of the block, the product of the width and the height, the sum of the width and the height, and the minimum / maximum value of the width and the height. The decoding device decodes the information sent by the signal to obtain the minimum size of the block in which deltaQP is allowed to be signaled. The information may be signaled at the level of at least one of a video sequence, a picture, a slice, or a slice. Alternatively, the minimum size may be derived as the minimum size of the transform block, or may be defined as a fixed size predefined in the encoding / decoding device. For example, the minimum size may be defined as 4×4, 8×4, 4×8, 8×8, etc. The information indicating the size of the block may be signaled for the luminance component and the chrominance component, respectively. Alternatively, the minimum size of the chrominance block may be derived based on the minimum size of the luminance block. For example, in a 4:2:0 color format, the minimum size of the chrominance block may be determined to be half the minimum size of the luminance block. In the inter mode, the division structure of the chroma block may be different from that of the luminance block, and the minimum size of the chroma block may be determined to be half of that of the luminance block.

[0198] Reference Figure 8 , a quantization parameter of the current block may be derived based on a comparison result between the size of the current block and the minimum size. Here, the current block may be a block that is not further divided by a block division type such as QT, BT, TT, etc.

[0199] Figure 8 (a) shows the case where the size of the current block is 2M×2N and the minimum size is M×N. Figure 8 As shown in (a), when the size of the current block is greater than the minimum size, the quantization parameter of the current block can be derived using QPpred and the signaled deltaQP.

[0200] QPpred may be derived based on at least one of the first method or the second method described above. deltaQP may be signaled at block a, and the remaining blocks b, c, d may share the deltaQP signaled from block a. In this case, the current block has one quantization parameter. Alternatively, deltaQP may be signaled for each of blocks a to d having a minimum size. In this case, a quantization parameter may be derived for each of blocks a to d belonging to the current block, and blocks a to d may have different quantization parameters.

[0201] Meanwhile, if the size of the current block is equal to the minimum size, the quantization parameter of the current block may be derived using QPpred and the signaled deltaQP.

[0202] Figure 8(b) shows the case where the minimum size is M×N and the current block (a to d) is smaller than the minimum size. Figure 8 As shown in (b), if the size of the current block is smaller than the minimum size, the quantization parameter of the current block can be derived using QPpred and the signaled deltaQP.

[0203] QPpred may be derived based on the current block using at least one of the first method or the second method described above. For example, QPpred may be derived for each of blocks a to d. Alternatively, QPpred may be derived for block a, and the remaining blocks b to d may share the QPpred derived from block a. Alternatively, QPpred may be derived based on the upper block of the current block using at least one of the first method or the second method described above. Here, the upper block may be a block including the current block and a block having a smaller depth than the current block. For example, when the partition depth of the current block is k, the partition depth of the upper block may be (k-1), (k-2), etc. The upper block may be defined as a unit of blocks sharing QPpred. The upper block may be set to a size (M×N) equal to the minimum size. Alternatively, the encoding device may determine the unit of the block sharing QPpred, and may encode information specifying the unit of the block. The decoding device may specify the position, size, shape, etc. of the upper block based on the encoding information.

[0204] The deltaQP may be signaled in an upper layer block of the current block. Here, the upper layer block may be a block including the current block and a block having a smaller depth than the current block. That is, when the partition depth of the current block is k, the partition depth of the upper layer block may be (k-1), (k-2), etc. Here, assuming that the upper layer block is Figure 8 (b) M×N. Therefore, a single and identical quantization parameter can be derived for blocks a to d, and a different quantization parameter can be derived for each of blocks a to d. Alternatively, if Figure 8 (b) If the size of the current block is less than the minimum size, the quantization parameter of the current block can be derived using QPpred. In this case, decoding for deltaQP can be omitted. As described above, QPpred can be derived based on the current block or the upper block using at least one of the first method and the second method, and its detailed description will be omitted. Similarly, a single and identical quantization parameter can be derived for blocks a to d belonging to the M×N block, and a different quantization parameter can be derived for each of the blocks a to d.

[0205] On the other hand, in the case of a block adjacent to a boundary of a picture, slice, or tile, the block may not meet the minimum size. In this case, only QPpred may be used to derive the quantization parameter of the block, and decoding for deltaQP may be omitted.

[0206] Fig. 9 The inverse transform process of the residual coefficients according to an embodiment of the present invention is shown.

[0207] Reference Fig. 9 , the residual samples of the residual block can be reconstructed by performing at least one of the first inverse transform or the second inverse transform on the residual coefficients.

[0208] The second inverse transform may be applied to the entire region of the residual block or a partial region within the residual block. The partial region may refer to a low-frequency region in the residual block. The region to which the second inverse transform is applied may be determined differently considering at least one of the size / shape of the residual block or the size / shape of the transform matrix of the second inverse transform.

[0209] For example, if the width or height of the residual block is equal to or greater than 8, a second inverse transform with an 8×8 transform matrix may be applied. When the size of the residual block is 8×8, the second inverse transform is applied to the entire area of ​​the residual block, and when the size of the residual block is 16×16, the second inverse transform may be applied only to a partial area of ​​the residual block. The partial area may be an 8×8 area located at the upper left of the residual block, a 16×8 area located at the top of the residual block, an 8×16 area located at the left side of the residual block, or an area excluding an 8×8 area located at the lower right of the residual block.

[0210] Alternatively, if the width or height of the residual block is 4, a second inverse transform with a 4×4 transform matrix may be applied. When the size of the residual block is 4×8 or 8×4, the second inverse transform may be applied only to a partial region of the residual block (e.g., a 4×4 region located at the upper left of the residual block), and the second inverse transform may be applied to each of the two 4×4 regions belonging to the residual block.

[0211] The size of the transformation matrix of the second inverse transform may be 4×4, 8×8, 16×16, 32×32 or larger. The shape of the transformation matrix is ​​not limited to a square, but may be implemented as a non-square. However, in order to reduce the complexity of the transform, the size of the transformation matrix allowed by the second inverse transform may be limited to N×M or smaller. N and M may be 4, 8 or 16, respectively, and N and M may be the same or different from each other.

[0212] In the second inverse transform process, Figure 5 The transform type of the residual block is determined by the transform type derivation method described in . Alternatively, the transform type in the second inverse transform may be predefined in the encoding / decoding device. For example, as the transform type in the second inverse transform, one of the five transform types mentioned above may be fixedly used.

[0213] The second inverse transform may be selectively performed based on a flag indicating whether the first inverse transform is skipped in the residual block (hereinafter referred to as a first flag). That is, when the first inverse transform is skipped in the residual block according to the first flag, the execution of the second inverse transform may be skipped.

[0214] Alternatively, a flag indicating whether to skip the second inverse transform (hereinafter referred to as the second flag) may be signaled separately. If the second flag is 1, the second inverse transform is not performed, and if the flag is 0, the second inverse transform may be performed. The first flag and the second flag may be independently encoded and signaled. Alternatively, the other of the first flag and the second flag may be signaled according to one of the first flag and the second flag. For example, only when either of the first flag and the second flag is 1, the other may be signaled. Conversely, only when either of the first flag and the second flag is 0, the other may be signaled.

[0215] When the number of non-zero residual coefficients belonging to the residual block is less than n, the second inverse transform may not be applied. Wherein n may be a value predefined for the encoding / decoding device. For example, n may be a natural number of 1, 2, 3, or 8 or less. Alternatively, n may be determined differently based on the size of the residual block.

[0216] at the same time, Fig. 9 The second inverse transform is shown to be performed before the first inverse transform, but the order of performing the inverse transform is not limited. That is, the second inverse transform may be performed before the first inverse transform, or the second inverse transform may be performed after the first inverse transform. When the second inverse transform is performed before the first inverse transform, the dequantization may be performed between the dequantization and the second inverse transform. Figure 5 The scaling may be performed between the first inverse transform and the second inverse transform. Figure 5 In contrast, when the second inverse transform is performed after the first inverse transform, a dequantization step may be performed between the dequantization step and the first inverse transform. Figure 5 The scaling may be performed between the first inverse transform and the second inverse transform. Figure 5 The scaling described.

[0217] Fig.10 The shape of a zoom list related to a zoom process according to an embodiment of the present invention is shown.

[0218] As in Figure 5 As mentioned in, scaling may refer to the process of applying a predetermined quantization weight (m) to the residual coefficients of the residual block. The residual coefficients of the residual block may be square or non-square of NxM. Quantization weights may be defined for each frequency in the residual block, and the array of quantization weights defined for each frequency will be referred to as a scaling list.

[0219] The quantization weights of the scaling list may be signaled at the encoding device (method A).

[0220] Regarding method A, quantization weights may be signaled for each position or frequency component of the residual coefficients in the residual block. Quantization weights may be signaled in at least one level of a video sequence, picture, or other fragment region (e.g., slice, tile, coding tree block row, and block).

[0221] like Fig.10 As shown, a zoom list having various sizes / shapes determined by a combination of N and M may be signaled. Here, N and M may be integers greater than or equal to 1. The zoom list may be signaled in a two-dimensional form of NxM, or may be signaled by arranging a two-dimensional array of NxM in a one-dimensional manner. Alternatively, the zoom list may be signaled by being divided into a horizontal zoom list of Nx1 and a vertical zoom list of 1xM.

[0222] The shape of the zoom list can be determined by whether the zoom is in Fig. 9 For example, when scaling is performed before the second inverse transform, the scaling list is signaled in one-dimensional form, otherwise the scaling list may be signaled in two-dimensional form.

[0223] The quantization weight of the scaling list may be a value pre-set in the encoding / decoding device (method B). With respect to method B, the quantization weight may be one and the same value regardless of the position of the residual coefficient in the residual block. Alternatively, the quantization weight may be derived based on table information predefined in the encoding / decoding device. The table information may define the quantization weight according to at least one of the position of the residual coefficient, the block size, the component type, and the prediction mode.

[0224] The quantization weights for a scaling list may be determined by referring to all or a portion of a previously used or signaled scaling list (method C). The scaling list to be referenced may be the most recently used or signaled in encoding / decoding order, or may be used or signaled in a previous segment area (e.g., a slice, a tile, a coding tree block (CTB) row, a CTB, other sub-blocks). To this end, information indicating whether to refer to a previous scaling list may be encoded and signaled. Information specifying quantization weights that are reused in a previous scaling list may be encoded and signaled.

[0225] The quantization weight may be determined by selectively using one of the above methods A to C. The selection may be performed based on at least one of the size / type of the residual block, the partition type, the prediction mode, the component type, the transform type, or predetermined flag information. The flag information may include a flag related to whether the quantization weight is applied, a flag related to whether to perform transform skipping, etc.

[0226] In the above-mentioned methods A to C, the quantization weight of the scaling list may be determined for each of the luminance block and the chrominance block. For example, if the color format is 4:2:0 or 4:2:2, the scaling list of each of the luminance block and the chrominance block may be signaled. Alternatively, the scaling list of the chrominance block may be determined by sampling the scaling list of the luminance block at a predetermined ratio. The ratio may be determined based on the color format as the ratio between the luminance component and the chrominance component. Alternatively, in the above-mentioned methods A to C, the scaling list may be variably determined according to the transform type of the residual block. The transform type of the residual block may be determined separately for the vertical transform and the horizontal transform. The scaling list may be variably determined according to the determined transform type of the vertical / horizontal transform. The scaling list may be variably determined according to the transform type of the residual block. Fig. 9 The transform type of the residual block is determined in at least one of the first inverse transform or the second inverse transform.

[0227] Fig.11 A scaling and inverse transform process based on quantization weights according to an embodiment of the present invention is shown.

[0228] At least one of scaling or inverse transformation based on a quantization weight may be performed by division into a horizontal direction and a vertical direction.

[0229] like Fig.10 As mentioned in , the scaling list can be signaled by dividing into a horizontal scaling list of Nx1 and a vertical scaling list of 1xM. In this case, the decoding device can perform each of the horizontal scaling based on the horizontal scaling list (hereinafter, referred to as 1D horizontal scaling) and the vertical scaling based on the vertical scaling list (hereinafter, referred to as 1D vertical scaling). And, an inverse transform can be performed on the residual coefficients to which scaling is applied. In this case, a horizontal transform (hereinafter, referred to as 1D horizontal transform) can be performed on the residual coefficients to which 1D horizontal scaling is applied. And, a vertical transform (hereinafter, referred to as 1D vertical transform) can be performed on the residual coefficients to which 1D vertical scaling is applied. Alternatively, a horizontal transform and a vertical transform (hereinafter, referred to as a 2D inverse transform) can be performed on the residual coefficients to which scaling is applied.

[0230] For example, Fig.11 As shown in , the scaling and inverse transformation for the residual coefficient may include: performing a 1D horizontal (vertical) transformation after the 1D horizontal (vertical) scaling (hereinafter, referred to as the first step), and performing a 1D vertical (horizontal) transformation after the 1D vertical (horizontal) scaling (hereinafter, referred to as the second step). The scaling and inverse transformation may be performed sequentially in the order of the first step to the second step, and the first step and the second step may be performed in parallel.

[0231] Alternatively, the horizontal / vertical transform may be performed after the horizontal / vertical scaling of the residual coefficient. That is, the scaling and inverse transform of the residual coefficient may be performed in the order of 1D horizontal (vertical) scaling -> 1D vertical (horizontal) scaling -> 1D horizontal (vertical) transform -> 1D vertical (horizontal) transform. The 1D horizontal (vertical) scaling and the 1D vertical (horizontal) scaling may be performed sequentially or in parallel. Similarly, the 1D horizontal (vertical) transform and the 1D vertical (horizontal) transform may be performed sequentially or in parallel.

[0232] On the other hand, the scaling list may be signaled in a two-dimensional form of NxM. In this case, scaling based on the scaling list (hereinafter referred to as 2D scaling) may be performed, and an inverse transform may be performed on the scaled residual coefficients. Alternatively, the scaling list may be signaled in the form of a one-dimensional array of an NxM two-dimensional array, or the scaling list may be signaled by being divided into a horizontal scaling list of Nx1 and a vertical scaling list of 1xM. In this case, the decoding device may rearrange the signaled scaling list into two dimensions of NxM. The decoding device may perform an inverse transform after 2D scaling of the residual coefficients. Here, the inverse transform may be performed by being divided into a 1D horizontal transform and a 1D vertical transform, or the inverse transform may be a 2D inverse transform.

[0233] When according to Fig. 9 When scaling is performed before the second inverse transform of , the inverse transform in this embodiment may mean the second inverse transform. Fig. 9 When scaling is performed between a first inverse transform and a second inverse transform, the inverse transform in this embodiment may mean the first inverse transform.

[0234] Fig.12 and Fig.13 A method for determining an entropy group of a residual block according to an embodiment of the present invention is shown.

[0235] The number of entropy groups belonging to the residual block may be n. For example, the residual block may be divided into two entropy groups: a first group as a low-frequency region and a second group as a high-frequency region. Alternatively, the residual block may be divided into three entropy groups: a first group as a low-frequency region, a second group as a mid-frequency region, and a third group as a high-frequency region. However, this is only an example, and n may be 1 or may be an integer greater than or equal to 4.

[0236] The value n may be a value predefined in the encoding / decoding device or may be derived based on information signaled from the encoding device. The information may include information indicating whether the residual block is divided into a plurality of entropy groups, information indicating the number of entropy groups belonging to the residual block, etc. The information may be signaled in at least one level of a video sequence, a picture, or other fragment area (e.g., a slice, a tile, a coding tree block row, a coding block, a transform block).

[0237] Alternatively, the value n may be variably determined based on encoding information about the residual block. The encoding information may include not only information encoded and signaled by the encoding device, but also information derived based on the signaled information in the decoding device.

[0238] For example, the encoding information may include at least one of the following items: block size / shape, block availability, partition type, number of partitions, component type, prediction mode, information about intra-frame prediction mode, inter-frame mode, motion information, transform type, transform skip mode, information about non-zero residual coefficients, scanning order, color format, in-loop filter information, etc.

[0239] The block size may be expressed by one of the width and height, the minimum / maximum value of the width and height, the sum of the width and height, the number of samples belonging to the block, etc. The availability of the block may be determined in consideration of the block position, the range of the parallel processing area, the decoding order, etc. The prediction mode may mean information indicating an intra mode or an inter mode. The information about the intra prediction mode includes information related to the following items: whether the intra prediction mode is a non-directional mode, whether the intra prediction mode is a vertical / horizontal mode, the directionality of the intra prediction mode, the number of intra prediction modes predefined in the encoding / decoding device, etc. The inter mode may mean information indicating a merge / skip mode, an AMVP mode, or a current picture reference mode. The current picture reference mode refers to a method of predicting the current block using a pre-reconstructed area of ​​the current picture. The current picture may be a picture to which the current block belongs. The current picture may be added to a reference picture list for inter prediction, and the current picture may be arranged in a reference picture list after a short-term reference picture or a long-term reference picture. The motion information may include a prediction direction flag, a motion vector, a reference picture index, etc. The encoding information may be related to at least one of the current block, a neighboring block of the current block, or an upper layer block of the current block. The upper layer block may mean a block having a smaller split depth than the current block.

[0240] Reference Fig.12 The entropy group may be determined based on at least one of a scanning order or the number of residual coefficients belonging to the entropy group (hereinafter, referred to as coefficient number information). The coefficient number information may be defined for each entropy group.

[0241] For example, it is assumed that the coefficient number information of the first group and the second group indicates 3 and 7 respectively, and the scanning order is zigzag scanning. In this case, Fig.12 As shown, according to the zigzag scan, the first group can be determined as a group of three residual coefficients (i.e., a group of residual coefficients at positions 0 to 2), and the second group can be determined as a group of seven residual coefficients (i.e., a group of residual coefficients at positions 3 to 9), and the third group can be determined as a group of residual coefficients excluding the first group and the second group in the residual block.

[0242] As described above, the first group is defined as a group from the upper left residual coefficient of the residual block to the residual coefficient C1 at a position offset by the coefficient number information of the first group. Similarly, the second group is defined as a group from the residual coefficient C1 to the residual coefficient C2 at a position offset by the coefficient number information of the second group. The third group is defined as a group of residual coefficients excluding the first group and the second group in the residual block. The offset is performed according to the (inverse) scanning order of the residual block or each group.

[0243] The coefficient number information may be a value predefined in the encoding / decoding device (first embodiment). Alternatively, the coefficient number information may be signaled in at least one level of a video sequence, a picture, and other fragment regions (e.g., a slice, a tile, a coding tree block row, a coding block, a transform block) (second embodiment). Alternatively, the coefficient number information may be variably determined based on the coding information about the residual block (third embodiment). Here, the coding information is the same as the above-mentioned coding information, and its detailed description will be omitted. The coefficient number information may be derived based on the coefficient number information of a predetermined reference block (fourth embodiment). Here, the reference block may be an adjacent block or an upper block of the residual block. The adjacent block refers to a pre-decoded block before the residual block, and may be at least one of the blocks adjacent to the left / right side or the upper / lower side of the residual block. The upper block may be a block having a smaller partition depth than the residual block.

[0244] On the other hand, the coefficient number information of some groups among the multiple entropy groups can be determined based on one of the above-mentioned first four embodiments to the fourth embodiment, and the coefficient number information of some other groups can be determined based on another embodiment of the above-mentioned first four embodiments to the fourth embodiment.

[0245] An entropy group may be determined based on one, two or more pieces of position information. The position information may indicate the position of a specific residual coefficient belonging to the residual block, and may be information for specifying the size, shape, position, etc. of the entropy group.

[0246] Reference Fig.13(a), entropy groups may be distinguished based on position information of one residual coefficient. In this case, when the number of entropy groups belonging to the residual block is n, the number of position information may be (n-1).

[0247] For example, when the first group of position information specifies the position of the residual coefficient A (X A , Y A ), the first group can be determined as a group of residual coefficients at the position (x1, y1) (where 0 = <x1=<X A , 0= <y1=<Y A ). When the second group of position information specifies the position of the residual coefficient B (X B , Y B ), the second group can be determined as a group excluding the first group in the residual coefficients at the position (x2, y2) (where 0 = <x2=<X B , 0= <y2=<Y B ). The third group may be determined as a group of residual coefficients excluding the first group and the second group in the residual block.

[0248] Reference Fig.13 (b), entropy groups can be distinguished based on multiple pieces of location information.

[0249] For example, when the position information of the first group specifies the position of the residual coefficients A1 and A2, the first group may be determined as a group of residual coefficients located on the left side of the line passing through A1 and A2. That is, the first group may be composed of 10 residual coefficients. When the position information of the second group specifies the position of the residual coefficients B1 and B2, the second group may be determined as a group of residual coefficients located on the left side of the line passing through B1 and B2 excluding the first group. That is, the second group may be composed of 26 residual coefficients. The third group may be determined as a group of residual coefficients excluding the first group and the second group in the residual block.

[0250] The first group may be determined using two pieces of position information that respectively specify the positions of A1 and A2, and the second group may be determined using two pieces of position information that respectively specify the positions that B1 and B2 have. Fig.13 As shown in (b), the entropy group can be implemented in a symmetrical form based on the diagonal L of the residual block. In this case, any one of the two position information can be derived based on the other position information. For example, the position information of A2 can be derived based on the position information of A1. Similarly, the position information of B2 can be derived based on the position information of B1.

[0251] In addition, some of the entropy groups in the plurality of entropy groups may be determined based on one piece of position information, and the remaining entropy groups may be determined based on two or more pieces of position information. Fig.13(a) of the embodiment of the present invention is to determine a first group of position information, and based on the Fig.13 (b) The two pieces of position information are used to determine the second group. Fig.13 (b) The two pieces of position information are used to determine the first group, and based on the following Fig.13 The second group is determined by a piece of position information in the implementation of (a).

[0252] The position information may be a value predefined in the encoding / decoding device (first embodiment). Alternatively, the position information may be signaled in at least one level of a video sequence, a picture, other fragment areas (e.g., a slice, a tile, a coding tree block row, a coding block, a transform block) (second embodiment). In this case, the block level may be a unit of a fixed size such as 4x4, 8x8, or 16x16. However, this does not limit the shape of the block level, and the block level may be a non-square unit of a fixed size. Alternatively, the position information may be variably determined based on the encoding information about the residual block (third embodiment). Here, the encoding information is the same as the above-mentioned encoding information, and its detailed description will be omitted. Alternatively, the position information may be derived based on the position information in a predetermined reference block (fourth embodiment). Here, the reference block is the same as the above-mentioned reference block, and the detailed description will be omitted.

[0253] On the other hand, the position information of some of the plurality of entropy groups may be determined based on one of the first to fourth embodiments, and the position information of the other groups may be determined based on another of the first to fourth embodiments.

[0254] Fig.14 The relationship between the scan of the residual coefficients and the entropy group according to an embodiment of the present invention is shown.

[0255] The decoding device may derive the residual coefficients of the residual block by scanning according to a predetermined scanning order. The scanning order includes zigzag scanning, z scanning, upper right diagonal scanning, lower left diagonal scanning, horizontal scanning, and vertical scanning. Here, the upper right diagonal scanning may mean a diagonal scanning from the upper right end to the lower left end of the residual block, and the lower left diagonal scanning may mean a diagonal scanning from the lower left end to the upper right end of the residual block.

[0256] When the residual block includes a plurality of entropy groups, scanning may be performed regardless of the entropy group, or scanning may be performed for each entropy group. The residual block may use only one scanning order for scanning, or a different scanning order may be used for each entropy group.

[0257] Specifically, refer to Fig.14(a), the residual block may include three entropy groups. The three entropy groups belonging to the residual block may use one and the same scanning order, i.e., zigzag scanning. However, the scanning based on the zigzag scanning is not performed in units of entropy groups, but may be performed in units of residual blocks. Therefore, at least one of the residual coefficients of the first entropy group located at the upper left of the residual block may be scanned earlier than at least one of the residual coefficients of the second entropy group.

[0258] On the other hand, referring to Fig.14 (b), the residual block may include two entropy groups. The scanning of the residual coefficients may be performed in units of entropy groups, respectively. In this case, the scanning order of the first entropy group may be different from the scanning order of the second entropy group. For example, the scanning order of the first entropy group may be a zigzag scan, and the scanning order of the second entropy group may be a vertical scan. The scanning of the residual coefficients may be performed from the lower right to the upper left of the residual block. The scanning for the first entropy group may be performed after the scanning for all the residual coefficients of the second entropy group is completed.

[0259] Reference Fig.14 (c), the residual block may include two entropy groups. The scanning of the residual coefficients may be performed in units of entropy groups. In this case, the scanning order of the first entropy group may be the same as the scanning order of the second entropy group. For example, the scanning order of both the first entropy group and the second entropy group may be vertical scanning. The scanning of the residual coefficients may be performed from the lower right to the upper left of the residual block. The scanning for the first entropy group may be performed after the scanning for all the residual coefficients of the second entropy group is completed.

[0260] Hereinafter, a method for determining a scanning order of a residual block will be described. As described above, one or more scanning orders may be used in units of residual blocks. In this case, at least one of zigzag scanning, z scanning, upper right diagonal scanning, lower left diagonal scanning, horizontal scanning, and vertical scanning may be selectively used.

[0261] The scanning order can be set to a default mode predefined in the encoding / decoding device (first embodiment). For example, the predefined default mode may be a zigzag scan or a z scan. The scanning order can be derived based on information signaled from the encoding device (second embodiment). The information may refer to information specifying the scanning order of the residual block. The information may be signaled in at least one level of a video sequence, a picture, and other fragment areas (e.g., a slice, a tile, a coding tree block row, a coding block, a transform block). The information may be signaled for each entropy group, or the information may be signaled in units of residual blocks.

[0262] Alternatively, the scanning order can be determined based on the encoding information about the residual block (third embodiment). The encoding information may include not only information encoded and signaled by the encoding device, but also information derived in the decoding device based on the signaled information. For example, the encoding information may include at least one of the following items: block size / type, block availability, partition type, number of partitions, component type, prediction mode, information about intra-frame prediction mode, inter-frame mode, motion information, transform type, transform skip mode, information about non-zero residual coefficients, color format, size / shape of entropy group, etc. Reference will be made to Fig.12 This is described, and the detailed description will be omitted.

[0263] Alternatively, the scanning order may be derived based on the scanning order of a predetermined reference block (fourth embodiment). Here, the reference block may be an adjacent block or an upper layer block of the residual block. The adjacent block refers to a pre-decoded block before the residual block, and may be at least one of the blocks adjacent to the left / right end or the upper / lower end of the residual block. The upper layer block may be a block having a smaller partition depth than the residual block.

[0264] On the other hand, when a residual block uses multiple scanning orders, a part of the multiple scanning orders is determined based on one of the first to fourth embodiments described above, and the other part is determined based on another one of the first to fourth embodiments.

[0265] Fig.15 A method of scanning residual coefficients according to an embodiment of the present invention is shown.

[0266] Scanning may be performed from the starting position of the scan in the residual block. The starting position may indicate the position of a specific residual coefficient of the residual block. A specific residual coefficient may mean a residual coefficient having a non-zero integer value (hereinafter, referred to as a non-zero value). A specific residual coefficient may be located at the end of a non-zero value belonging to the residual block in reverse scanning order. Conversely, a specific residual coefficient may be located at the beginning of a non-zero value belonging to the residual block in scanning order.

[0267] For example, scanning may be performed based on information indicating a starting position of scanning (hereinafter, referred to as first information). The first information may be encoded and signaled by an encoding device. Scanning may be performed from a position specified by the first information. Fig.15 As shown in (a), the starting position of the scan can be specified as the A position instead of the lower right position of the residual block based on the first information. In this case, the residual coefficients between the A position and the lower right position of the residual block in the scanning order can be set to zero. The residual coefficients at the lower right position of the residual block can also be set to zero.

[0268] Alternatively, scanning can be performed based on information (hereinafter referred to as second information) specifying an entropy group including a starting position of scanning. The second information can be encoded and signaled by an encoding device. Based on the second information, an entropy group including a starting position of scanning is specified, and scanning can be performed from the specified entropy group. In this case, the scanning order between entropy groups depends on the scanning order of residual coefficients. According to the second information, scanning can be skipped for a certain entropy group of the residual block. The residual coefficient of the entropy group skipped for scanning can be set equal to zero.

[0269] Reference Fig.15 (b), the residual block is composed of a first entropy group including the upper left residual coefficient, a second entropy group located at the center, and a third entropy group including the lower left residual coefficient. Based on the second information, the second entropy group can be determined as an entropy group including the starting position of the scan. In this case, the scan is performed from the second entropy group, and the residual coefficient of the third entropy group can be set to be equal to zero.

[0270] Alternatively, the starting position of the scan may be determined by a combination of the first information and the second information. That is, one of the plurality of entropy groups may be specified based on the second information, and the starting position in the specified entropy group may be specified based on the first information. Fig.15 There is no limit on the number, size, or shape of the entropy groups, and the number of entropy groups may be four or more, and the shape of the entropy groups may have a square or non-square shape.

[0271] Fig.16 A method for processing residual coefficients of a partial area in a residual block according to an embodiment of the present invention is shown.

[0272] The encoding device may transform and / or quantize the residual samples of the residual block to derive residual coefficients. In this case, the residual coefficients of the partial area in the residual block may not be entropy encoded, and only the residual coefficients of the residual area may be entropy encoded and sent to the decoding device.

[0273] The decoding device may decode only the residual coefficient sent from the encoding device, and set the residual coefficient of the partial area to a predefined default value in the decoding device. The default value may include at least one of the absolute value (abs) of the residual coefficient or the symbol. The absolute value may be zero, or may be a value greater than or equal to two or three.

[0274] Hereinafter, a method for determining a partial area in a decoding device will be described.

[0275] Reference Fig.16, the partial area (gray area) may be an area in the residual block excluding at least one of N columns from the left or M rows from the top. Alternatively, the partial area may be an area in the residual block excluding an NxM area.

[0276] N and M may be values ​​predefined in the encoding / decoding device, or may be variably determined according to the size / type of the residual block. For example, when the residual block is 64x32, an area excluding 32 columns from the left side of the residual block (where N=32, M=0) may be defined as a partial area. When the residual block is 32x64, an area excluding 32 rows from the upper side of the residual block (where N=0, M=32) may be defined as a partial area. However, the values ​​of N and M are only examples. N may be an integer greater than or equal to half the width (W) of the residual block, and M may be an integer greater than or equal to half the height (H) of the residual block.

[0277] Alternatively, N and M may be derived based on information encoded to specify a partial region. For example, the residual block may be divided into predetermined sub-regions (e.g., triangles, rectangles, squares, or any other shape). The index or coordinate information of the sub-region corresponding to the partial region may be encoded and signaled. Alternatively, the index of the sub-region corresponding to the NxM region may be encoded and signaled, or coordinate information specifying the size / shape of the NxM region may be encoded and signaled.

[0278] Specifically, the residual block may be divided into k sub-regions based on at least one of a vertical line or a horizontal line. The value k may be an integer of 2, 3, 4 or more. The value k may be a fixed value predefined in the encoding / decoding device, or the value k may be variably determined based on the vertical line / horizontal line. An index may be assigned to each sub-region. Here, the index may be a value from 0 to (k-1). In this case, the signaling may be notified with Fig.16 The index of the sub-region corresponding to the partial region shown may be signaled, or the coordinate information of the sub-region corresponding to the partial region may be signaled. Conversely, the index of the sub-region corresponding to the NxM region, which is the region in which the residual coefficient is encoded and transmitted by the encoding device, may be signaled, or the coordinate information specifying the size / shape of the NxM region may be signaled.

[0279] Alternatively, information indicating the x - coordinate or y - coordinate of the coordinates (N, M) can be encoded and signaled. In this case, a partial region can be determined as one of the following groups: a first group including residual coefficients at positions (x1, y1) where N < x1 < W and 0 <= y1 < H, a second group including residual coefficients at positions (x2, y2) where 0 <= x2 < W and M <= y2 < H, or a third group including residual coefficients at positions (x3, y3) where N < x3 < W and M <= y3 < H.

[0280] Alternatively, information indicating the coordinates (N, M) can be encoded and signaled. In this case, a group of residual coefficients can be specified, which is located on the right - hand side and below the vertical / horizontal line passing through the coordinates (N, M), and the specified group can be determined as the partial region.

[0281] In the above - described embodiment, the partial region can be determined based on at least one of the encoded information, and the residual coefficients of the partial region can be set to a predefined default value. For the NxM region of the residual block, the Figure 5 and Figures 12 to 15 described residual coefficient derivation method can be applied.

[0282] Meanwhile, the process of setting the residual coefficients to the default value can be selectively performed in consideration of at least one of the size or shape of the residual block. For example, the above - mentioned process can be applied only when the size of the residual block is greater than or equal to a predetermined threshold. The size of the residual block can be expressed by at least one of the width or height of the residual block. The threshold can mean the minimum size that allows the residual coefficients to be set to the default value (e.g., 0). The threshold can be a predefined value in the encoding / decoding device, or can be encoded and signaled by the encoding device. The threshold can be 32, 64, 128, 256 or larger.

[0283] The process of setting the residual coefficients to the default value can be selectively performed based on flag information. The flag information can indicate whether the residual coefficients of a partial region (e.g., the high - frequency region) in the residual block are set to the default value. The flag information can be derived in the decoding device based on the size / shape of the residual block, or can be encoded and signaled by the encoding device. However, the above - mentioned process can be restricted to be executed only when the residual block is not encoded in the transform skip mode. Therefore, when the residual block is encoded in the transform skip mode, the encoding device can not encode the information required to set the residual coefficients to the default value.

[0284] Although for the sake of clarity of explanation, the exemplary methods of the present disclosure are represented by a series of actions, they are not intended to limit the order in which the steps are performed, and each step can be performed simultaneously or in a different order if necessary. To implement the method according to the present disclosure, the illustrative steps may additionally include other steps, include the remaining steps except some steps, or may include other steps except some steps.

[0285] The various embodiments of the present disclosure are not intended to be all-inclusive and are intended to illustrate representative aspects of the present disclosure, and the features described in the various embodiments may be applied independently or in combination of two or more.

[0286] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of hardware implementation, the hardware may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, etc.

[0287] The scope of the present disclosure includes: software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operations of methods according to various embodiments to be performed on a device or computer; and non-transitory computer-readable media in which such software or instructions that can be executed on a device or computer are stored.

[0288] Industrial Applicability

[0289] The present disclosure may be used to encode / decode video signals.

[0290] In addition, the embodiment of the present invention further includes:

[0291] (1) A method for decoding a video, comprising:

[0292] deriving residual coefficients of a residual block, wherein the residual block is divided into one or more entropy groups;

[0293] Calculating a quantization parameter of the residual block;

[0294] Performing inverse quantization on the residual coefficient using the calculated quantization parameter; and

[0295] Residual samples of the residual block are reconstructed by performing inverse transformation on the inverse quantized residual coefficients.

[0296] (2) The method according to (1), wherein at least one of a scanning order, an entropy decoding technique, or a binarization technique associated with one of the multiple entropy groups is different from that of another of the multiple entropy groups.

[0297] (3) The method according to (2), wherein the number of the entropy groups is variably determined based on encoding information about the residual block.

[0298] (4) The method according to (1), wherein the entropy group is determined based on at least one of a scanning order or a number of residual coefficients belonging to the entropy group.

[0299] (5) The method according to (4), wherein the entropy group is determined based on one, two or more position information, and

[0300] The position information indicates the position of a specific residual coefficient belonging to the residual block.

[0301] (6) The method according to (1), wherein the residual coefficients are derived by scanning according to a predetermined scanning order, and

[0302] The scanning is performed for each entropy group.

[0303] (7) The method according to (6), wherein the scanning is performed by using a different scanning order for each entropy group.

[0304] (8) The method according to (6), wherein the scanning is performed from a predetermined starting position within the residual block.

[0305] (9) The method according to (8), wherein the starting position is determined based on at least one of information indicating the starting position of the scan or information specifying an entropy group including the starting position of the scan.

[0306] (10) The method according to (1), wherein deriving the residual coefficient further comprises: setting the residual coefficient of a partial area in the residual block to a default value predefined in the decoding device, and

[0307] The partial area is an area excluding at least one of N columns from the left side of the residual block or M rows from the top side of the residual block.

[0308] (11). The method according to (10), wherein N and M are derived based on information encoded to specify the partial area.

[0309] (12) The method according to (1), wherein the residual block is divided into variable sizes / shapes based on at least one of a quadtree, a binary tree, or a ternary tree.

[0310] (13) A device for decoding a video, comprising:

[0311] an entropy decoding unit for deriving residual coefficients of a residual block, the residual block being divided into one or more entropy groups;

[0312] an inverse quantization unit, the inverse quantization unit calculating a quantization parameter of the residual block, and performing inverse quantization on the residual coefficient using the calculated quantization parameter; and

[0313] An inverse transform unit is configured to reconstruct residual samples of the residual block by performing inverse transform on the inverse quantized residual coefficients.

Claims

1. A method for decoding a video, the method comprising: deriving residual coefficients of the residual block from the bitstream; Calculating a quantization parameter of the residual block; Performing inverse quantization on the residual coefficient using the calculated quantization parameter; as well as reconstructing residual samples of the residual block by performing an inverse transform on the inverse quantized residual coefficients, The residual block is divided into a plurality of sub-regions based on vertical lines or horizontal lines. wherein the plurality of sub-regions include a first sub-region for which the residual coefficient is sent from the encoding device and a second sub-region for which the residual coefficient is not sent from the encoding device, wherein, based on the index information obtained from the bitstream, a position of the second sub-region for which the residual coefficient is not sent from the encoding device is determined, wherein the index information specifies a position of a sub-region of the plurality of sub-regions for which the residual coefficient is not transmitted from the encoding device, The second sub-region represents a region excluding at least one of the following: N columns from the left side of the residual block or M rows from the top side of the residual block, wherein the residual samples of the second sub-region in the residual block are set equal to a default value predefined at the decoding device, and Among them, the default value is 0.

2. The method according to claim 1, wherein: The quantization parameter of the chroma component block is derived based on the quantization parameter prediction value of the chroma component block of the residual block and a predetermined quantization parameter offset.

3. The method according to claim 2, wherein: The quantization parameter prediction value of the chrominance component block is derived based on the quantization parameter of the luminance component block of the residual block.

4. The method according to claim 2, wherein: The predetermined quantization parameter offset includes a first quantization parameter offset signaled at a picture level, a second quantization parameter offset signaled at a slice level, and a third quantization parameter offset signaled at a block level.

5. The method according to claim 3, wherein: When the chroma component block has a division structure independent of the luminance component block, the quantization parameter prediction value of the chroma component block is derived based on a quantization parameter of one luminance component block among a plurality of luminance component blocks corresponding to the chroma component block.

6. The method according to claim 5, wherein: The quantization parameter of the one luminance component block among the plurality of luminance component blocks represents a quantization parameter of a luminance component block corresponding to a position of a center sample.

7. The method according to claim 1, wherein: The second sub-region for which the residual coefficient is not transmitted from the encoding device is filled with a default value predefined in the decoding device.

8. The method according to claim 1, wherein: The size of the second sub-region is derived based on the encoding information.

9. The method according to claim 1, wherein: The residual block is determined according to a tree-based partitioning, and The tree-based partitioning includes at least one of quadtree partitioning, binary tree partitioning or ternary tree partitioning.

10. A method for encoding a video, the method comprising: Performing a transformation on the residual samples of the residual block to obtain a transformation coefficient of the residual block; quantizing the transform coefficients of the residual block based on a quantization parameter to obtain quantized transform coefficients of the residual block; as well as generating a bitstream by encoding the quantized transform coefficients, The residual block is divided into a plurality of sub-regions based on vertical lines or horizontal lines. The plurality of sub-regions include a first sub-region for which a residual coefficient is encoded in the encoding device and a second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information is encoded based on the position of the second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information specifies a position of a sub-region among the plurality of sub-regions for which the residual coefficient is not encoded in the encoding device, The second sub-region represents a region excluding at least one of: N columns from the left side of the residual block or M rows from the upper side of the residual block, and wherein the residual samples of the second sub-region in the residual block are set equal to a default value predefined at the encoding device, and Among them, the default value is 0.

11. A non-transitory computer-readable medium storing a bitstream generated by a coding method, the coding method comprising: Performing a transformation on the residual samples of the residual block to obtain a transformation coefficient of the residual block; quantizing the transform coefficients of the residual block based on a quantization parameter to obtain quantized transform coefficients of the residual block; as well as generating a bitstream by encoding the quantized transform coefficients, The residual block is divided into a plurality of sub-regions based on vertical lines or horizontal lines. The plurality of sub-regions include a first sub-region for which a residual coefficient is encoded in the encoding device and a second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information is encoded based on the position of the second sub-region for which the residual coefficient is not encoded in the encoding device, wherein the index information specifies a position of a sub-region among the plurality of sub-regions for which the residual coefficient is not encoded in the encoding device, The second sub-region represents a region excluding at least one of: N columns from the left side of the residual block or M rows from the upper side of the residual block, and wherein the residual samples of the second sub-region in the residual block are set equal to a default value predefined at the encoding device, and Among them, the default value is 0.