Method and device for encoding / decoding residual coefficients
Adaptive block division and entropy group management enhance encoding/decoding efficiency for high-definition video, addressing the inefficiencies in residual block processing and reducing data costs.
Patent Information
- Authority / Receiving Office
- RU · RU
- Patent Type
- Patents
- Current Assignee / Owner
- KHANVKHA VIZHN KO LTD
- Filing Date
- 2019-06-10
- Publication Date
- 2026-07-09
AI Technical Summary
The increasing demand for high-quality, high-definition video leads to higher data volumes, resulting in increased transmission and storage costs due to inefficient encoding/decoding processes, particularly in residual blocks.
The method involves adaptive block division, scaling residual coefficients based on a quantization weight coefficient, performing inverse transforms in multiple stages, and dividing residual blocks into entropy groups for efficient encoding/decoding.
Improves encoding/decoding efficiency by optimizing residual block processing through adaptive block division and entropy group management, reducing data transmission and storage costs.
Smart Images

Figure 00000001_ABST
Abstract
Description
Field of technology to which the invention relates
[0001] The present invention relates to a method and device for encoding / decoding a video signal.Background of the invention
[0002] The demand for high-quality, high-definition video is increasing in various applications. As image data becomes high-resolution and high-quality, the data volume increases relative to traditional image data. Consequently, when image data is transmitted using a medium such as traditional wired / wireless broadband or stored using traditional storage media, transmission costs and storage costs increase. High-efficiency image compression technologies can be used to solve these problems caused by high-resolution and high-quality image data. Summary of the InventionTechnical Problem
[0003] The object of the present invention is to improve the encoding / decoding efficiency of residual blocks.
[0004] The object of the present invention is to improve the encoding / decoding efficiency through adaptive block division.Technical solution
[0005] The video encoding / decoding method and device according to the present invention can extract a residual coefficient of a residual block, calculate a quantization parameter for the residual block, perform dequantization on the residual coefficient using the calculated quantization parameter for the residual block, and perform an inverse transform on the dequantized residual coefficient to reconstruct a residual sample of the residual block.
[0006] The video encoding / decoding method and device according to the present invention can scale a residual coefficient based on a quantization weight coefficient of a predetermined scaling list.
[0007] The scaling list according to the present invention may mean an arrangement of quantization weights specified for each frequency in the residual block.
[0008] The scaling list according to the present invention may be transmitted in service signals in the form of NxM in the encoding device.
[0009] In the video encoding / decoding method and device according to the present invention, at least one of inverse transform or scaling can be performed separately in the horizontal direction and the vertical direction.
[0010] In the video encoding / decoding method and device according to the present invention, the inverse transform can be performed in two stages as a first inverse transform and a second inverse transform.
[0011] In the video encoding / decoding method and device according to the present invention, the 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.
[0012] In the video encoding / decoding method and device according to the present invention, the residual blocks may be divided into one or more entropy groups.
[0013] In the video encoding / decoding method and device according to the present invention, the entropy group may be defined as a group of residual coefficients belonging to an identical / similar frequency band.
[0014] In the video encoding / decoding method and device according to the present invention, at least one of the scanning order, the entropy decoding scheme, or the binarization scheme associated with one of the plurality of entropy groups may be different from another of the plurality of entropy groups.
[0015] In the video encoding / decoding method and device according to the present invention, the number of entropy groups can be variably determined based on encoding information associated with the residual block.
[0016] In the video encoding / decoding method and device according to the present invention, an entropy group may be determined based on at least one of a number of residual coefficients belonging to the entropy group or a scanning order.
[0017] In the video encoding / decoding method and device according to the present invention, the entropy group can be determined based on one, two or more pieces of position information.
[0018] In the video encoding / decoding method and device according to the present invention, the position information may indicate the position of a specific residual coefficient belonging to a residual block.
[0019] In the video encoding / decoding method and device according to the present invention, residual coefficients are extracted by scanning according to a predetermined scanning order, and scanning can be performed for each entropy group.
[0020] In the video encoding / decoding method and device according to the present invention, scanning may be performed using a different scanning order for each entropy group.
[0021] In the video encoding / decoding method and device according to the present invention, scanning may be performed from a predetermined starting position in the residual block.
[0022] In the video encoding / decoding method and device according to the present invention, the starting position may be determined based on at least one of information indicating the scanning starting position or information indicating an entropy group including the scanning starting position.
[0023] In the video encoding / decoding method and device according to the present invention, the residual coefficient extraction step may further include setting the residual coefficient of the partial zone in the residual block to a default value preset in the decoding device.
[0024] In the video encoding / decoding method and device according to the present invention, the partial zone may be a zone excluding at least one of the N columns on the left side or one of the M rows on the upper side relative to the residual block, or may be a zone excluding an NxM zone in the residual block.
[0025] In the video encoding / decoding method and device according to the present invention, N and M can be extracted based on information encoded to indicate a partial zone.
[0026] In the video encoding / decoding method and device according to the present invention, the residual block may be a block divided according to a variable size / shape based on at least one of a quadtree, a binary tree, or a ternary tree. Advantages of the invention
[0027] According to the present invention, the encoding / decoding efficiency of a residual block can be improved based on a quantization weight of a predetermined scaling list.
[0028] According to the present invention, the encoding / decoding efficiency of the residual block can be improved based on a predetermined entropy group.
[0029] According to the present invention, the encoding / decoding efficiency of a residual block can be improved by setting the residual coefficient of a predetermined area in the residual block to a predetermined default value.
[0030] In addition, according to the present invention, the encoding / decoding efficiency can be improved by dividing into tree structure blocks. Description of the drawings
[0031] Fig. 1 is a block diagram illustrating an encoding device according to one embodiment of the present invention.
[0032] Fig. 2 is a block diagram illustrating a decoding device according to an exemplary embodiment of the present invention.
[0033] Fig. 3 illustrates a type of block division according to an embodiment to which the present invention is applied.
[0034] Fig. 4 illustrates a method for dividing into blocks based on a tree structure according to an embodiment to which the present invention is applied.
[0035] Fig. 5 illustrates a method for reconstructing a residual sample according to an embodiment of the present invention.
[0036] Fig. 6 illustrates a method for extracting a predicted quantization parameter value (QPpred) according to an embodiment of the present invention.
[0037] Fig. 7 illustrates a method for extracting a predicted quantization parameter value for a chrominance signal component of a block T according to an embodiment of the present invention.
[0038] Fig. 8 illustrates a method for extracting quantization parameters based on a transmission unit in quantization parameter difference value (deltaQP) service signals according to an embodiment of the present invention.
[0039] Fig. 9 illustrates a process of inverse transformation of a residual coefficient according to an embodiment of the present invention.
[0040] Fig. 10 illustrates the form of a scaling list associated with a scaling process according to an embodiment of the present invention.
[0041] Fig. 11 illustrates a scaling process based on quantization weights and inverse transform according to an embodiment of the present invention.
[0042] Fig. 12 and 13 illustrate a method for determining an entropy group of a residual block according to an embodiment of the present invention.
[0043] Fig. 14 illustrates the relationship between the scanning of residual coefficients and the entropy group according to an embodiment of the present invention.
[0044] Fig. 15 illustrates a method for scanning a residual coefficient according to an embodiment of the present invention.
[0045] Fig. 16 illustrates a method for processing residual coefficients of a partial zone in a residual block according to an embodiment of the present invention. Optimum mode for carrying out the invention
[0046] The video encoding / decoding method and device according to the present invention can extract a residual coefficient of a residual block, calculate a quantization parameter for the residual block, perform dequantization on the residual coefficient using the calculated quantization parameter for the residual block, and perform an inverse transform on the dequantized residual coefficient to reconstruct a residual sample of the residual block.
[0047] The video encoding / decoding method and device according to the present invention can scale a residual coefficient based on a quantization weight coefficient of a predetermined scaling list.
[0048] The scaling list according to the present invention may mean an arrangement of quantization weights specified for each frequency in the residual block.
[0049] The scaling list according to the present invention may be transmitted in service signals in the form of NxM in the encoding device.
[0050] In the video encoding / decoding method and device according to the present invention, at least one of the inverse transform or scaling can be performed separately in the horizontal direction and the vertical direction.
[0051] In the video encoding / decoding method and device according to the present invention, the inverse transform can be performed in two stages as a first inverse transform and a second inverse transform.
[0052] In the video encoding / decoding method and device according to the present invention, the 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.
[0053] In the video encoding / decoding method and device according to the present invention, residual blocks may be divided into one or more entropy groups.
[0054] In the video encoding / decoding method and device according to the present invention, the entropy group may be defined as a group of residual coefficients belonging to an identical / similar frequency band.
[0055] In the video encoding / decoding method and device according to the present invention, at least one of the scanning order, the entropy decoding scheme, or the binarization scheme associated with one of the plurality of entropy groups may be different from another of the plurality of entropy groups.
[0056] In the video encoding / decoding method and device according to the present invention, the number of entropy groups can be variably determined based on encoding information associated with the residual block.
[0057] In the video encoding / decoding method and device according to the present invention, an entropy group may be determined based on at least one of a number of residual coefficients belonging to the entropy group or a scanning order.
[0058] In the video encoding / decoding method and device according to the present invention, the entropy group can be determined based on one, two or more pieces of position information.
[0059] In the video encoding / decoding method and device according to the present invention, the position information may indicate the position of a specific residual coefficient belonging to a residual block.
[0060] In the video encoding / decoding method and device according to the present invention, residual coefficients are extracted by scanning according to a predetermined scanning order, and scanning can be performed for each entropy group.
[0061] In the video encoding / decoding method and device according to the present invention, scanning may be performed using a different scanning order for each entropy group.
[0062] In the video encoding / decoding method and device according to the present invention, scanning may be performed from a predetermined starting position in the residual block.
[0063] In the video encoding / decoding method and device according to the present invention, the starting position may be determined based on at least one of information indicating the scanning starting position or information indicating an entropy group including the scanning starting position.
[0064] In the video encoding / decoding method and device according to the present invention, the residual coefficient extraction step may further include setting the residual coefficient of the partial zone in the residual block to a default value preset in the decoding device.
[0065] In the video encoding / decoding method and device according to the present invention, the partial zone may be a zone excluding at least one of the N columns on the left side or one of the M rows on the upper side relative to the residual block, or may be a zone excluding an NxM zone in the residual block.
[0066] In the video encoding / decoding method and device according to the present invention, N and M can be extracted based on information encoded to indicate a partial zone.
[0067] In the video encoding / decoding method and device according to the present invention, the residual block may be a block divided according to a variable size / shape based on at least one of a quadtree, a binary tree, or a ternary tree. Optimal mode for carrying out the invention
[0068] The present invention can be varied and modified in various ways and is illustrated with respect to various exemplary embodiments, some of which are described and shown in the drawings. However, these embodiments are not intended to limit the invention, but are construed as including all modifications, equivalents, and substitutions that belong to the spirit and scope of the invention. Like reference numbers throughout the drawings mean like elements.
[0069] Although the terms "first," "second," and so on may be used to describe various elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another element. For example, a first element may be referred to as a "second element," and a second element may similarly be referred to as a "first element" without departing from the teachings of the present invention. The term "and / or" includes any and all combinations of a plurality of associated listed elements.
[0070] It should be understood that when an element is referred to as "connected to" or "coupled to" another element, the element may be directly connected or coupled to the other element or intermediate elements. Conversely, when an element is referred to as "directly connected to" or "directly coupled to" another element, there are no intermediate elements.
[0071] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms "a," "an," and "the" are intended to include plural forms as well, unless the context clearly dictates otherwise. It should be further emphasized that the terms "includes" and "has," when used in this detailed description, specify the presence of the stated features, integral parts, steps, operations, elements, or components, but do not preclude the presence or addition of one or more other features, integral parts, steps, operations, elements, components, or groups thereof.
[0072] The following describes exemplary embodiments of the invention in detail with reference to the accompanying drawings. Like reference numbers throughout the drawings denote like elements, and redundant descriptions of like elements are omitted herein.
[0073] Fig. 1 is a block diagram illustrating an encoding device according to one embodiment of the present invention.
[0074] Referring to Fig. 1, the encoding device 100 includes a frame dividing unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a reordering unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filtering unit 150, and a memory unit 155.
[0075] Each of the elements shown in Fig. 1 is shown independently to represent different characteristic functions in the encoding device, and may mean that each element consists of separate hardware. In other words, the elements are arranged independently for convenience of description, and at least two elements can be combined into one element, or one element can be divided into a plurality of elements to perform functions. It should be noted that embodiments in which some elements are integrated into one combined element, and / or an element is divided into several separate elements, are included in the scope of the present invention without departing from the essence of the present invention.
[0076] Some elements are not essential to the essential functions of the invention and may be optional components simply used to improve performance. The invention may be implemented by including only the components essential to the embodiment of the invention, excluding components used simply to improve performance. A structure including only the essential components, excluding optical components used simply to improve performance, falls within the scope of the invention.
[0077] The frame division module 110 can divide the input frame into at least one block. In this case, the block may be a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The division can 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 block into sub-blocks whose width and height are half of the upper block. A binary tree is a method of dividing an upper block into sub-blocks whose width or height is half of the upper block. In a binary tree, a block can have a non-square shape as well as a square shape by dividing the upper block based on the above-described binary tree-based division.
[0078] In the embodiments of the invention, the coding unit may be used to mean not only the coding unit but also the decoding unit.
[0079] Prediction modules 120 and 125 may include an inter-prediction module 120 for performing inter-prediction and an intra-prediction module 125 for performing intra-prediction. Prediction modules 120 and 125 may determine which of the inter-prediction and intra-prediction is performed on a PU and may determine specific information (for example, an intra-prediction mode, a motion vector, and a reference frame) of a determined prediction method. Here, the processing unit on which prediction is performed may differ 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, while prediction may be performed for each TU.A residual value (residual block) between the generated predicted block and the original block may be input to transformation unit 130. Additionally, prediction mode information, motion vector information, etc., used for prediction may be encoded along with the residual value via entropy encoding unit 165 and transmitted to the decoding device. When a specific encoding mode is used, the original block may be encoded and transmitted to the decoding device without generating a prediction block via prediction units 120 and 125.
[0080] The inter prediction module 120 may predict the PU based on information about at least one frame from among the previous frame relative to the current frame and the subsequent frame relative to the current frame. In some cases, the inter prediction module 120 may predict the PU based on information of a partially encoded region in the current frame. The inter prediction module 120 may include a reference frame interpolation module, a motion prediction module, and a motion compensation module.
[0081] The reference frame interpolation module can be supplied with reference frame information from the memory 155 and generate pixel information less than or equal to an integer pixel for the reference frame. In the case of luminance signal pixels, an 8-tap DCT-based interpolation filter with a variable filter coefficient can be used to generate pixel information less than or equal to an integer pixel in a unit of 1 / 4 pixel. In the case of chrominance signal pixels, a 4-tap DCT-based interpolation filter with a variable filter coefficient can be used to generate pixel information less than or equal to an integer pixel in a unit of 1 / 8 pixel.
[0082] The motion prediction module can perform motion prediction based on a reference frame interpolated by the reference frame interpolation module. Various methods, such as the full-search block matching algorithm (FBMA), the three-stage search algorithm (TSS), and the new three-stage search (NTS), can be used to calculate the motion vector. The motion vector has a motion vector value in units of 1 / 2 or 1 / 4 of a pixel based on the interpolated pixel. The motion prediction module can predict the current PU using various motion prediction methods. Various methods, such as skip mode, fusion mode, and advanced motion vector prediction (AMVP), can be used as the motion prediction method.
[0083] The intra-prediction unit 125 can generate a PU based on information regarding a reference pixel neighboring the current block. When the reference pixel is a pixel for which inter-prediction is performed, because the block neighboring the current PU is a block for which inter-prediction is performed, information regarding the reference pixel in the block for which inter-prediction is performed can be replaced with information regarding the reference pixel in the block for which intra-prediction is performed. In other words, when the reference pixel is unavailable, information regarding the unavailable reference pixel can be replaced with information regarding at least one reference pixel from the available reference pixels.
[0084] The intra-prediction prediction mode 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 directional information is not used when performing prediction. The luminance signal component prediction mode and the chrominance signal component prediction mode may differ from each other. Additionally, the chrominance signal component can be predicted using the intra-prediction mode, which is used to obtain either the luminance signal component or the predicted / reconstructed luminance signal component.
[0085] In the intra-prediction method, a predicted block can be generated by applying an adaptive intra-smoothing filter (AIS) to reference pixels according to the intra-prediction mode. Various types of AIS filters can be applied to the reference pixels. In the intra-prediction method, the intra-prediction mode of the current PU can be predicted from the intra-prediction mode of the PU neighboring the current PU. When predicting the prediction mode of the current PU using the mode information predicted from the neighboring PU, when the current PU and the neighboring PU have the same intra-prediction mode, information indicating that the current PU and the neighboring PU have the same intra-prediction mode can be transmitted using predetermined flag information.When the current PU and the neighboring PU have different intra prediction modes, information regarding the intra prediction mode of the current block can be encoded by entropy coding.
[0086] A residual block including residual information can be generated. The residual information is the difference between the original block and the predicted block generated by prediction modules 120 and 125. The generated residual block can be input to transformation module 130.
[0087] The transformation module 130 may transform the residual block including the residual data by using a transformation type such as DCT, DST, etc. In this case, the transformation type may be determined based on the intra-prediction mode of the prediction module used to generate the residual block.
[0088] Quantization unit 135 can quantize the values converted into the frequency domain by transformation unit 130. The quantization coefficient can vary depending on the block or significance of the image. The values output from quantization unit 135 can be provided to inverse quantization unit 140 and reflow unit 160.
[0089] The rearrangement module 160 may perform rearrangement of the coefficient values over the quantized residual block.
[0090] The rearrangement module 160 can change the coefficients from a two-dimensional coefficient block to coefficients from a one-dimensional coefficient vector using a coefficient scanning method. For example, the rearrangement module 160 can scan a DC coefficient into a high-frequency domain coefficient using a predetermined scanning type and change it to a one-dimensional vector form.
[0091] Entropy encoding unit 165 can perform entropy encoding based on the values obtained by rearrangement unit 160. Various encoding methods, such as exponential Golomb coding, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC), can be used for entropy encoding.
[0092] The entropy encoding unit 165 may encode various information, such as residual coefficient information and block type information regarding the CU, prediction mode information, segmentation unit information, PU information, transmission unit information, motion vector information, reference frame information, block interpolation information and filtering information, from the rearrangement unit 160 and the prediction units 120 and 125.
[0093] The entropy encoding unit 165 may entropy encode the CU coefficients input from the rearrangement unit 160.
[0094] Inverse quantization unit 140 and inverse transform unit 145 dequantize the values quantized by quantization unit 135 and inversely transform the values transformed by transform unit 130. A reconstructed block can be formed by summing the residual values with the predicted PU. The residual values can be formed by inverse quantization unit 140 and inverse transform unit 145. The predicted PU can be predicted by a motion vector prediction unit, a motion compensation unit, and an intra prediction unit of prediction units 120 and 125.
[0095] The filtering module 150 may include at least one of a deblocking filter, an offset calculating module, and an adaptive loop filter (ALF).
[0096] The deblocking filter can remove blocking distortion caused by the boundaries between blocks in the reconstructed frame. Whether or not to apply the deblocking filter to the current block can be determined based on the pixels included in multiple rows or columns of the block. When applying the deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required filtering strength for deblocking. When horizontal filtering and vertical filtering are performed while applying the deblocking filter, horizontal filtering and vertical filtering can be performed in parallel.
[0097] The offset calculation module can apply an offset relative to the original image to the deblocked image in pixel units. The area to which the offset can be applied can be determined after segmenting the frame's pixels into a predetermined number of areas. The offset can be applied to a specific area by considering edge information relative to each pixel or by the method for applying the offset to a specific area.
[0098] ALF can perform filtering based on the comparison result between the filtered reconstructed image and the original image. Pixels included in the image can be segmented into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed for each group. Information on whether or not to apply ALF can be transmitted by each coding unit (CU), and the shape and filter coefficients of the ALF to be applied to each block can vary. Additionally, ALF with an identical shape (fixed shape) can be applied to a block regardless of the block's characteristics.
[0099] The memory device 155 may store the reconstructed block or frame output from the filtering unit 150, and the stored reconstructed block or frame may be provided to the prediction units 120 and 125 when performing external prediction.
[0100] Fig. 2 is a block diagram illustrating a decoding device according to an exemplary embodiment of the present invention.
[0101] Referring to Fig. 2, the decoding device 200 may include an entropy decoding module 210, a rearrangement module 215, a dequantization module 220, an inverse transform module 225, prediction modules 230 and 235, a filtering module 240, and a memory device 245.
[0102] Each of the elements shown in Fig. 2 is shown independently to represent different characteristic functions in the decoding device, and may mean that each element consists of separate hardware. In other words, the elements are arranged independently for convenience of description, and at least two elements can be combined into one element, or one element can be divided into multiple elements to perform functions. It should be noted that embodiments in which some elements are integrated into one combined element, and / or an element is divided into several separate elements, are included in the scope of the present invention without departing from the essence of the present invention.
[0103] The entropy decoding module 210 can perform entropy decoding on the input bitstream. For example, various methods, such as Exponential Golomb coding, CAVLC, or CABAC, can be used for entropy coding.
[0104] The entropy decoding module 210 can decode information associated with the intra-prediction and the inter-prediction performed by the encoding device.
[0105] Rearrangement unit 215 can perform rearrangement on the bit stream entropy decoded by entropy decoding unit 210. Rearrangement unit 215 can restore and rearrange the coefficients of a one-dimensional vector into coefficients of a two-dimensional block. Rearrangement unit 215 can be supplied with information regarding the scanning of coefficients performed by the encoding device and can perform rearrangement using a method of inverse scanning of coefficients, based on the scanning order performed by the encoding device.
[0106] The dequantization module 220 can perform dequantization based on the quantization parameter and the recombined block coefficients.
[0107] The inverse transform module 225 can perform the inverse transform of the dequantized transform coefficients based on a predetermined transform type. In this case, the transform type can be determined based on at least one of the prediction mode (inter / intra prediction), block size / shape, intra prediction mode, component type (luminance / chrominance component), or segmentation type (QT, BT, TT, etc.).
[0108] Prediction units 230 and 235 may generate a prediction block based on the provided prediction block generation information and information regarding a previously decoded block or frame. The information for generating the prediction block may be provided from entropy decoding unit 210. Information regarding a previously decoded block or frame may be provided from memory unit 245.
[0109] Prediction modules 230 and 235 may include a PU determination module, an inter prediction module, and an intra prediction module. The PU determination module may receive various information, such as PU information, information related to the intra prediction mode for the intra prediction method, and information related to motion prediction for the inter prediction method, etc., from the entropy decoding module 210, and may determine the PU for the current CU. The PU determination module may determine which of the inter prediction and intra prediction is performed on the PU. The inter prediction module 230 may perform inter prediction on the current PU based on information about at least one frame of the previous frame and the subsequent frame relative to the current frame, which includes the current PU.Inter-prediction module 230 may use information required for inter-prediction for the current PU, provided by the encoding device. Inter-prediction may be performed based on information from a pre-reconstructed partial region in the current frame that includes the current PU. For this purpose, the pre-reconstructed partial region may be added to a list of reference frames.
[0110] In order to perform inter-prediction, it may be determined, in a CU unit, that is, a motion prediction method for a PU included in the CU, a skip mode, a fusion mode, an AMVP mode, or a reference mode based on the current frames.
[0111] The intra-prediction unit 235 can generate a prediction block based on pixel information in the current frame. When the PU is a PU for which intra-prediction is performed, the intra-prediction can be performed based on the intra-prediction mode information regarding the PU provided from the encoding device. The intra-prediction unit 235 can 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 can determine whether to apply the filter or not depending on the prediction mode for the current PU. The AIS filter can be performed on the reference pixels of the current block using the prediction mode for the prediction unit and the information regarding the AIS filter provided from the encoding device.When the prediction mode for the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
[0112] When the prediction mode for the PU specifies a prediction mode for performing intra-prediction based on pixel values obtained through reference pixel interpolation, the reference pixel interpolation module can generate reference pixels in a fractional pixel unit smaller than an integer pixel (i.e., a full pixel) through reference pixel interpolation. When the prediction mode for the current PU specifies a prediction mode for generating a prediction block without reference pixel interpolation, reference pixels cannot be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode for the current block is the DC mode.
[0113] The recovered block or frame can be provided to filtering module 240. Filtering module 240 includes a deblocking filter, an offset calculation module, and an ALF.
[0114] The encoding device can provide information regarding whether a deblocking filter is applied to the corresponding block or frame, and information regarding which of the strong filter and weak filter is applied when the deblocking filter is used. The deblocking filter of the decoding device can be supplied with information regarding the deblocking filter from the encoding device and can perform deblocking filtering on the corresponding block.
[0115] The offset calculation module can apply offset to the reconstructed frame based on the information regarding the offset type and offset value applied to the frame during the encoding process.
[0116] ALF can be applied to the CU based on the information regarding whether ALF is applied or not and the ALF coefficient information, etc., provided from the coding device. ALF information can be included and provided in a specific parameter set.
[0117] The storage device 245 may store the recovered frame or block for use as a reference frame or a reference block and may provide the recovered frame to the output module.
[0118] Fig. 3 illustrates a type of block division according to an embodiment to which the present invention is applied.
[0119] One block (hereinafter referred to as the "first block") can be divided into a plurality of sub-blocks (hereinafter referred to as the "second block") by at least one of a vertical line or a horizontal line. The number of each of the vertical and horizontal lines can be one, two, or more. Here, the first block can be a coding unit (CU), which is a basic unit of image encoding / decoding, a prediction unit (PU), which is a basic unit of predictive encoding / decoding, or a transform unit (TU), which is a basic unit of transform encoding / decoding. The first block can be a square block or a non-square block.
[0120] The division of the first block can be performed based on a quad tree, a binary tree, a ternary tree, etc., and is described in detail with reference to Fig. 3.
[0121] Fig. 3(a) illustrates a quadtree (QT) partition. QT is a partitioning type in which the first block is partitioned into four second blocks. For example, when the first 2Nx2N block is partitioned using QT, the first block can be partitioned into four second blocks of size NxN. QT may be limited to applying only to square blocks, but it is also applicable to non-square blocks.
[0122] Fig. 3(b) illustrates partitioning into a horizontal binary tree (hereinafter referred to as "horizontal BT"). Horizontal BT is a type of partitioning in which the first block is divided into two second blocks by a single horizontal line. This partitioning can be performed symmetrically or asymmetrically. For example, when the first 2Nx2N block is partitioned 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 identical values, and a can be greater or less than b.
[0123] Fig. 3(c) illustrates partitioning into a vertical binary tree (hereinafter referred to as "vertical BT"). Vertical BT is a type of partitioning in which the first block is divided into two second blocks by a single vertical line. This partitioning can be performed symmetrically or asymmetrically. For example, when the first 2Nx2N block is partitioned 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 identical values, and a can be greater or less than b.
[0124] Fig. 3(d) illustrates partitioning into a horizontal ternary tree (hereinafter referred to as "horizontal TT"). Horizontal TT is a partition type in which the first block is divided into three second blocks by two horizontal lines. For example, when the first 2Nx2N block is partitioned based on horizontal TT, the first block can be divided into three second blocks with a height ratio of (a:b:c). Here, a, b, and c can be identical. Alternatively, a and c can be identical, and b can be greater than or less than a.
[0125] Fig. 3(e) illustrates partitioning into a vertical ternary tree (hereinafter referred to as "vertical TT"). Vertical TT is a type of partitioning in which the first block is divided into three second blocks by two vertical lines. For example, when the first 2Nx2N block is partitioned 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 identical, while b can be greater than or less than a. Alternatively, a and b can be identical, while c can be greater than or less than a. Alternatively, b and c are identical, while a can be greater than or less than b.
[0126] The splitting described above may be performed based on splitting information transmitted in service signals from the coding device. The splitting information may include at least one of splitting type information, splitting direction information, or splitting relationship information.
[0127] The division type information may indicate any of the division types that are preset in the encoding / decoding device. The preset division type may include at least one of QT, horizontal BT, vertical BT, horizontal TT, vertical TT, or no division mode (no split). Alternatively, the division type information may mean information regarding whether QT, BT, or TT is applied and may be encoded in the form of a flag or index. In the case of BT or TT, the division direction information may indicate whether it is divided horizontally or vertically. In the case of BT or TT, the division ratio information may indicate the ratio of the width and / or height of the second block.
[0128] Fig. 4 illustrates a method for dividing into blocks based on a tree structure according to an embodiment to which the present invention is applied.
[0129] Block 400 illustrated in Fig. 4 is assumed to be a square block (hereinafter referred to as the "first block") having a size of 8Nx8N and a division depth of k. When the division information of the first block indicates QT division, the first block can be divided into four sub-blocks (hereinafter referred to as the "second block"). The second block can have a size of 4Nx4N and can have a division depth of (k+1).
[0130] The four second blocks can be divided again based on QT, BT, TT, or based on the non-divided mode. For example, when the division information of the second block indicates a horizontal binary tree (horizontal BT), the second block is divided into two sub-blocks (hereinafter referred to as the "third block") as the second block 410 in Fig. 4. In this case, the third block may have a size of 4Nx2N and may have a division depth of (k+2).
[0131] The third block can also be divided again either based on QT, BT, TT, or based on the non-divided mode. For example, when the division information of the third block indicates a vertical binary tree (vertical BT), the third block is divided into two sub-blocks 411 and 412, as illustrated in Fig. 4. In this case, the sub-blocks 411 and 412 may have a size of 2Nx2N and a division depth of (k+3). Alternatively, when the division information of the third block indicates a horizontal binary tree (horizontal BT), the third block can be divided into two sub-blocks 413 and 414, as illustrated in Fig. 4. In this case, the sub-blocks 413 and 414 may have a size of 4NxN and a division depth of (k+3).
[0132] The partition can be performed independently or in parallel with the adjacent block, or can be performed sequentially according to a predetermined priority order.
[0133] The split information of the current block may be determined depending on at least one of the split information of the upper block relative to the current block or the split information of the adjacent block. For example, when the second block is split based on the horizontal BT and the upper third block is split based on the vertical BT, the lower third block need not be split based on the vertical BT. If the lower third block is split by the vertical BT, this is the same result as when the second block is split by the QT. Therefore, coding for obtaining the split information (in particular, the split direction information) of the lower third block may be skipped, and the decoding device may be configured such that the lower third block is split in the horizontal direction.
[0134] The upper block may refer to a block with a smaller split depth than the current block. For example, when the split depth of the current block is (k+2), the split depth of the upper block may be (k+1). The adjacent block may be a block adjacent to the top or left side of the current block. The adjacent block may be a block with a split depth identical to the split depth of the current block.
[0135] The above-described division can be repeatedly performed up to the minimum encoding / decoding unit. When divided into the minimum unit, the division information for the block is no longer transmitted in the signaling from the encoding device. The information regarding the minimum unit may include at least one of the size or shape of the minimum unit. The size of the minimum unit can be expressed by the width, height, minimum or maximum value of the width and height, the sum of the width and height, the number of pixels, or the division depth. The information regarding the minimum unit can be transmitted in the signaling in at least one of the video sequence unit, frame, slice, or block. Alternatively, the information regarding the minimum unit may be a value preset in the encoding / decoding device.Information regarding the minimum unit may be transmitted in service signals for each of the CU, PU, and TU. Information regarding one minimum unit may be applied equally to the CU, PU, and TU.
[0136] Fig. 5 illustrates a method for reconstructing a residual sample according to an embodiment of the present invention.
[0137] Referring to Fig. 5, the residual coefficient of the residual block can be extracted by entropy decoding the bit stream (S500).
[0138] The encoding device may perform transformation and / or quantization on residual samples of the residual block to extract residual coefficients, and may encode the extracted residual coefficients based on a predetermined encoding scheme. The encoding scheme may include at least one of a scan order, an entropy encoding scheme, or a binarization scheme. Examples of the entropy encoding scheme may include an Exponential Golomb code, CAVLC, CABAC, and the like. Examples of the binarization scheme may include binarization by a truncated Rice code (TR), binarization by an Exponential Golomb code of the k-th order (EGk), binarization by a fixed-length code (FL), and the like.
[0139] In this case, the residual block may be divided into one or more groups (hereinafter referred to as "entropy groups"), and each entropy group may include at least one residual coefficient. An entropy group may refer to a group of residual coefficients with the same / similar frequency band. The frequency band may be divided into a low-frequency band and a high-frequency band, or it may be divided into three bands, for example, a low-frequency band, an intermediate frequency band, and a high-frequency band. However, this is just an example, and the frequency band may be further subdivided based on frequency properties. Residual coefficient coding may be performed for each entropy group in the residual block.
[0140] The decoding device can extract the residual coefficient from the bitstream based on a predetermined decoding scheme. The decoding scheme is based on the above-described coding scheme, and its detailed description is omitted.
[0141] 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 extracted based on the decoding scheme corresponding to the entropy group. At least one of the scanning order, the entropy decoding scheme, or the binarization scheme associated with one of the plurality of entropy groups may differ from another of the plurality of entropy groups. Hereinafter, a method for extracting residual coefficients based on entropy groups is described with reference to Figs. 12-15.
[0142] The process of extracting residual coefficients may further include setting the residual coefficient of a partial zone (for example, a high-frequency zone) in the residual block to a default value preset in the decoding device. This is described with reference to Fig. 16.
[0143] Extracting the residual coefficient may be performed by decoding at least one of information regarding the presence or absence of a non-zero residual coefficient, an absolute value (abs), or a sign of the encoded residual coefficient.
[0144] The extraction may further include a process of setting the residual coefficient of the high-frequency region in the residual block to 0. The high-frequency region may be set as a region excluding at least one of n columns to the left of the residual block or one of m rows to the top of the residual block. N and m may be values pre-fixed 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 64×32, the region excluding 32 columns (here, n=32, m=0) to the left of the residual block may be set as the high-frequency region. When the residual block is 32×64, the region excluding 32 rows (here, n=0, m=32) to the top of the residual block may be set as the high-frequency region.Alternatively, N and M can be extracted based on information encoded to indicate the high frequency region.
[0145] In addition, the process of setting the residual coefficient to 0 may be selectively performed based on at least one of the size and 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 value. The size of the residual block may be expressed as at least one of the width and height of the residual block. The threshold value may indicate the minimum size allowed for setting the residual coefficient to 0. The threshold value may be a value pre-fixed during encoding / decoding of the residual block, or may be encoded and transmitted in signaling through encoding of the residual block. The threshold value may be 32, 64, 128, 256, or more.
[0146] The process of setting the residual coefficient to 0 can be selectively performed based on flag information. The flag information may indicate whether or not the residual coefficient of the high-frequency region in the residual block is set to 0. The flag information may be extracted from the decoding device based on the size / type of the residual block, or may be encoded and transmitted in signaling by the encoding device. However, the above process may be limited to execution only when the residual block is not encoded in the skip transform mode. Accordingly, when the residual block is encoded in the skip transform mode, the encoding device may not encode the information necessary for setting the residual coefficient to 0.
[0147] Referring to Fig. 5, the quantization parameter for the residual block can be calculated (S510).
[0148] The quantization parameter can be extracted using at least one of the predicted quantization parameter value (QPpred) or the quantization parameter difference value (deltaQP). In other words, the quantization parameter can be set as the predicted quantization parameter value (QPpred), or can be extracted by adding the quantization parameter difference value (deltaQP) to the predicted quantization parameter value (QPpred).
[0149] For example, when dequantization is optional for a block (e.g., concatenation mode, skip mode, no-transform mode, PCM mode, the case in which there are no non-zero coefficients in the block (i.e., encoded block flag=0), etc.), the quantization parameter difference value (deltaQP) may not be encoded. In this case, the predicted quantization parameter value (Qppred) can be set equal to the quantization parameter.
[0150] The following describes a method for extracting a predicted quantization parameter value (QPpred) with reference to Fig. 6 and 7. Meanwhile, the quantization parameter difference value (deltaQP) can be transmitted in service signals in a predetermined unit, and the following describes a method for extracting quantization parameters based on the transmission unit in service signals of the quantization parameter difference value (deltaQP) with reference to Fig. 8.
[0151] The quantization parameter calculation may further include a process of modifying the extracted quantization parameter based on a predetermined quantization parameter offset (QPoffset).
[0152] The quantization parameter offset (QPoffset) may be a fixed value that is preset in the encoding / decoding device, or may be encoded and transmitted in service signals by the encoding device. The quantization parameter offset (QPoffset) may be transmitted in service signals at least at one level for a unit of a video sequence, a frame, a slice, a tile, or a block. The unit in which the quantization parameter offset is transmitted in service signals may be greater than the unit in which the quantization parameter difference value is transmitted in service signals. 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-prediction mode, the component type (e.g., luminance signal, chrominance signal), etc.
[0153] The number of quantization parameter offsets may be one, two, three, or more. For example, the quantization parameter offset may be set at at least one of the frame level, slice level, or block level. The quantization parameter offset may be set for each of the intra-mode and inter-mode, or may be set for each luminance signal component and chrominance signal component. Alternatively, a separate offset may be set for the LM mode in the intra-prediction mode. Here, the LM mode may refer to a mode in which a chrominance signal block is predicted using the prediction / reconstruction samples of a luminance signal block.
[0154] Referring to Fig. 5, dequantization can be performed on the residual coefficient using the calculated quantization parameter (S520).
[0155] Specifically, dequantization can be performed based on at least one of a quantization parameter or a predetermined level scale division value. The level scale division value may be a value preset in the encoding / decoding device, or may be encoded and transmitted in service signals by the encoding device. The level scale division value may consist of k integer values of a one-dimensional array. For example, the level scale division value may be set as {40, 45, 51, 57, 64, 72}. However, this does not limit the number of level scale division values and integer values. That is, the level scale division value can be set as another value, and the number of level scale division values can be set as 4, 5, 7, 8 or more.
[0156] Meanwhile, a predetermined quantization weighting coefficient m can be additionally applied to the dequantization result, and this process is called "scaling." Scaling is described below with reference to Figs. 10 and 11.
[0157] Additionally, when a residual block includes multiple entropy groups, different quantization parameters may be applied to each entropy group. For example, each entropy group in a residual block shares the same quantization parameter difference value, but may use different predicted quantization parameter values. Conversely, each entropy group in a residual block shares the same predicted quantization parameter value, but may use different quantization parameter difference values. Therefore, the unit for calculating the predicted quantization parameter value may differ from the unit for calculating the quantization parameter difference value. In this case, dequantization may be performed for each entropy group. The dequantization process may be skipped for an entropy group that only has a residual coefficient of zero.
[0158] Referring to Fig. 5, the residual sample can be reconstructed by performing an inverse transform on the dequantized residual coefficient (S530).
[0159] 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 set of candidate transform types. The set of candidate transform types may include n transform types. For example, the set of candidate transform types may include at least one of DCT-II, DCT-V, DCT-VIII, DST-I, or DST-VII.
[0160] In the encoding / decoding device, m sets of possible transformation options may be set. Here, m may be 1, 2, 3 or more. The number and / or kind of transformation types belonging to one of the m sets of possible transformation options (hereinafter referred to as the "first set of possible transformation options") may be different from another (hereinafter referred to as the "second set of possible transformation options"). For example, the first set of possible transformation options may consist of p transformation types, and the second set of possible transformation options may consist of q transformation types less than p. Alternatively, even when the first and second sets of possible transformation options consist of the same number of transformation types, at least one transformation type belonging to the first set of possible transformation options may be different from the transformation type belonging to the second set of possible transformation options.
[0161] Any of m sets of possible transformation options can be selectively used.
[0162] The selection of a set of candidate transformation types can be based on the size of the residual block. For example, if the size of the residual block is less than or equal to the threshold, the first set of candidate transformation types consisting of p transformation types is selected. Otherwise, the second set of candidate transformation types consisting of q transformation types can be selected. The threshold can be 32, 64, 128, 256, or greater, and p can be a value greater than q.
[0163] Alternatively, the selection of a set of possible transformation options may be performed based on information to be transmitted in signaling from the encoding device. The information may indicate any of m sets of possible transformation options. The information may be transmitted in signaling at least at one frame, slice, or block level.
[0164] When the set of possible variants of the selected transformation includes a plurality of transformation types, the encoding device may encode information indicating any of the plurality of transformation types. The decoding device may determine the transformation type of the residual block by decoding the encoded information.
[0165] Meanwhile, the inverse transform can be selectively performed based on a predefined flag. Here, the flag can indicate whether the inverse transform is skipped for the residual block. For example, if the flag is 1, the inverse transform is not performed on the residual block, and if the flag is 0, the inverse transform can be performed on the residual block. Therefore, the transform type of the residual block can only be extracted when the flag is 0. Alternatively, the inverse transform can be selectively performed based on the properties of the residual block. Based on the properties of the residual block, the decoding device can determine whether the inverse transform is skipped. The properties can refer to the size / type of the residual block, the partition type, the prediction mode, the component type, or other coding parameters related to the residual coefficients.
[0166] An additional inverse transformation (hereinafter referred to as a "second inverse transformation") in addition to the inverse transformation (hereinafter referred to as a "first inverse transformation") can be performed, and this is described with reference to Fig. 9.
[0167] Fig. 6 illustrates a method for extracting a predicted quantization parameter value (QPpred) according to an embodiment of the present invention.
[0168] Referring to Fig. 6, the predicted quantization parameter value (QPpred) for a block T can be extracted based on the quantization parameter of the neighboring block. The block T is an NxM block and can be square or non-square.
[0169] The neighboring block may be a block spatially / temporally adjacent to the block T, 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 relative to the block T. Alternatively, the neighboring block may further include a co-located block that temporarily corresponds to the block T. The co-located block may be defined as a block belonging to a frame different from the block T, and including a position of at least one of an upper left corner sample, a lower right corner sample, or a center sample of the block T.
[0170] The position of the adjacent block may be a predetermined position in the encoding / decoding device. For example, the predetermined 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 to this and may further include a lower-left block, an upper-right block, and the like. The position of the adjacent block may be variably determined based on at least one property (for example, size, shape, division depth, division type, component type, etc.) of at least one of the block T or the adjacent block. For example, the adjacent block may be determined as being a block having the largest area among the blocks adjacent to the block T, or may be determined as being a block whose boundary length next to each other is the largest.This can be done for the top block and the left block relative to the T block, respectively.
[0171] Alternatively, information indicating the position of the neighboring block can be encoded and transmitted in the signaling signal by the encoding device. The information can be encoded in the form of a flag, index, etc. For example, if the information is index 0, the predicted quantization parameter value (QPpred) of block T can be extracted using the quantization parameter of the left block. If the information is index 1, the predicted quantization parameter value (QPpred) of block T can be extracted using the quantization parameter of the upper block.
[0172] 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 preset in the encoding / decoding device. Alternatively, the number can be variably determined based on the properties (for example, size, type, division depth, division type, component type, etc.) of at least one of the block T or the neighboring block. Alternatively, the maximum number information for the neighboring blocks used to extract the predicted quantization parameter value (QPpred) of the block T can be encoded and transmitted in service signals by the encoding device. In this way, the block T can use neighboring blocks in the range of numbers according to the maximum number information.The maximum number of information may be transmitted in service signals at the level of at least one of a video sequence, a frame, and another fragment zone (for example, a slice, a mosaic fragment, a line of coding tree blocks, a block).
[0173] As described above, the predicted quantization parameter value (QPpred) of a block T can be extracted using one or more neighboring blocks.
[0174] When a plurality of neighboring blocks is used, the predicted quantization parameter value (QPpred) of block T can be extracted through a workflow such as the intermediate value, average value, minimum value, maximum value, or mode value of the quantization parameters of the plurality of neighboring blocks.
[0175] Alternatively, the predicted quantization parameter value (QPpred) of block T can be obtained 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. If multiple upper blocks or left blocks are provided, the QP of the upper block or left block can be determined through a workflow, such as an intermediate value, mean value, minimum value, maximum value, or mode value.
[0176] If there is an unavailable block among the neighboring blocks, the predicted quantization parameter value of block T can be extracted only by using the available neighboring blocks. Alternatively, when the neighboring block is unavailable, the quantization parameter of the neighboring block can be extracted based on the quantization parameter set in a predetermined fragment area. A fragment area may be a slice, a tile, a row of coding tree blocks, a block, etc. The fragment area may denote a coded / decoded area before block T or an area to which block T to be coded / decoded belongs. Unavailability may be a case in which the neighboring block does not physically exist, or a case in which reference is impossible according to the rules of the encoding / decoding device. For example, if block T and the neighboring block belong to different parallel processing areas (e.g., slices, tiles, etc.),d.), block T may not be allowed to reference an adjacent block.
[0177] Fig. 7 illustrates a method for extracting a predicted quantization parameter value for a chrominance signal component of a block T according to an embodiment of the present invention.
[0178] Hereinafter in this document, the luminance signal component and the chrominance signal component of the T block are referred to as a "luminance signal block" and a "chrominance signal block", respectively.
[0179] In the case of 4:2:0 color format, the TC block of chroma signals may correspond to the TY block of luminance signals. The predicted quantization parameter of the chroma block can be extracted using the quantization parameter of the corresponding luminance block.
[0180] However, as illustrated in Fig. 7, the division structure between the luminance signal block and the chrominance signal block may differ. In this case, the chrominance signal block may correspond to a plurality of luminance signal blocks. The predicted value of the quantization parameter of the chrominance signal block can be extracted using the quantization parameter of one of the plurality of luminance signal blocks. In this case, the luminance signal block corresponding to the position of the center sample or the position of the left upper sample of the chrominance signal block may be used. The luminance signal block having the largest area overlapping the chrominance signal block may be used. Alternatively, the predicted value of the quantization parameter of the chrominance signal block may be extracted by calculating the average value, median value, minimum value, maximum value, mode value, etc. of the quantization parameters of the plurality of luminance signal blocks.
[0181] The predicted value of the quantization parameter of the color signal block can be extracted using the quantization parameter of the neighboring block, which is described in detail with reference to Fig. 6, and its detailed description is omitted here.
[0182] As described above, the predicted quantization parameter value of a chrominance signal block can be extracted using either the method using the quantization parameter of the corresponding luminance signal block (the first method) or the method using the quantization parameter of the adjacent block relative to the chrominance signal block (the second method). Alternatively, the predicted quantization parameter value of the chrominance signal block can be extracted by selecting either the first method or the second method.
[0183] The selection can be made taking into account whether the luminance signal block and the chrominance signal block have the same partition structure, prediction mode, intra-prediction mode, color format, or size / shape associated with the T block. For example, if the T block is encoded in the inter-mode, and the partition structure of the chrominance signal block is the same as the partition structure of the luminance signal block, the quantization parameter of the chrominance signal block can be predicted using the first method. Alternatively, if the partition structure of the chrominance signal block is the same as the partition structure of the luminance signal block, the first method is used; otherwise, the second method can be used. Alternatively, if the intra-prediction mode of the T block is the LM mode, the quantization parameter of the chrominance signal block can be predicted using the first method.
[0184] Alternatively, the selection may be performed based on information indicating the first method or the second method. The information may be encoded and transmitted in service signals by a coding device. The information may be transmitted in service signals at at least one level of a video sequence, a frame, or another fragment area (e.g., a slice, a tile, a row of coding tree blocks, and a block).
[0185] The quantization parameter of the chrominance signal block may be extracted as the same as the predicted value of the extracted quantization parameter of the chrominance signal block, or may be extracted by adding the difference value of the quantization parameter to the predicted value of the quantization parameter. In addition, the extracted quantization parameter may be modified using a predetermined quantization parameter offset, as illustrated in Fig. 5.
[0186] For example, in the case of a chroma signal block encoded in the LM mode, the predicted quantization parameter value may be set equal to the quantization parameter. In this case, the quantization parameter difference value may not be transmitted in the signaling, or the summation process of the quantization parameter difference value transmitted in the signaling may be omitted. Alternatively, in the case of a chroma signal block encoded in the LM mode, the quantization parameter may be modified using one, two, or more quantization parameter offsets.
[0187] Fig. 8 illustrates a method for extracting quantization parameters based on a transmission unit in a quantization parameter difference value (deltaQP) service signal according to an embodiment of the present invention.
[0188] The encoding device may determine a block unit for deltaQP encoding and encode information indicating the block size. Here, the size may be represented by at least one of the width or height of the block, the product of the width and height, the sum of the width and height, and the minimum value / maximum value of the width and height. The decoding device decodes the service information to obtain the minimum block size in which the transmission of deltaQP in the service signaling is permitted. The information may be transmitted in the service signaling at the level of at least one of a video sequence, a frame, a slice, or a tile. Alternatively, the minimum size may be extracted as the minimum size of the transform block or may be set as a fixed size preset in the encoding / decoding device. For example, the minimum size may be set as 4×4, 8×4, 4×8, 8×8, etc.Information indicating the block size may be transmitted in the overhead signals for the luminance and chrominance components, respectively. Alternatively, the minimum size of the chrominance block may be derived from the minimum size of the luminance block. For example, in the 4:2:0 color format, the minimum size of the chrominance block may be defined as half the minimum size of the luminance block. In external mode, the partition structure of the chrominance block may differ from the partition structure of the luminance block, and the minimum size of the chrominance block may be defined as half the size of the luminance block.
[0189] Referring to Fig. 8, the quantization parameter of the current block can be extracted based on the 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.
[0190] Fig. 8(a) illustrates the case in which the current block size is 2Mx2N and the minimum size is MxN. As illustrated in Fig. 8(a), when the current block size exceeds the minimum size, the quantization parameter of the current block can be extracted using QPpred and deltaQP signaled in the overhead.
[0191] QPpred may be extracted based on at least one of the first method or the second method described above. DeltaQP may be signaled in step a, and the remaining blocks b, c, and d may share the deltaQP signaled from block a. In this case, the current block has a single quantization parameter. Alternatively, deltaQP may be signaled for each of the blocks ad with a minimum size. In this case, the quantization parameter may be extracted for each of the blocks ad belonging to the current block, and the blocks ad may have different quantization parameters.
[0192] Meanwhile, if the current block size is equal to the minimum size, it can be extracted using QPpred and the deltaQP signaled in the overhead.
[0193] Fig. 8(b) illustrates the case where the minimum size is MxN and the current block (ad) is smaller than the minimum size. As illustrated in Fig. 8(b), if the current block size is smaller than the minimum size, the quantization parameter of the current block can be extracted using QPpred and deltaQP signaled in the overhead.
[0194] QPpred may be retrieved based on the current block using at least one of the first method or the second method described above. For example, QPpred may be retrieved for each of the blocks a-d. Alternatively, QPpred may be retrieved for a block, and the remaining blocks b-d may share QPpred retrieved from block a. Alternatively, QPpred may be retrieved based on the upper block relative to 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 splitting depth of the current block is k, the splitting depth of the upper block may be (k-1), (k-2), etc. The upper block may be defined as a unit of the block sharing QPpred. The upper block may be set to a size (MXN) equal to the minimum size.Alternatively, the encoding device may determine the unit of a block sharing QPpred and encode information indicating the unit of the block. The decoding device may indicate the position, size, shape, etc. of the upper block based on the encoded information.
[0195] DeltaQP can be signaled in the upper block relative to the current block. Here, the upper block may be a block including the current block and a block having a smaller depth than the current block. Thus, when the division depth of the current block is k, the division depth of the upper block may be (k-1), (k-2), etc. Here, it is assumed that the upper block is MxN, as illustrated in Fig. 8(b). Thus, one and identical quantization parameter can be extracted for ad blocks, and a different quantization parameter can be extracted for each of the ad blocks. Alternatively, if the size of the current block is smaller than the minimum size, as illustrated in Fig. 8(b), the quantization parameter of the current block can be extracted using QPpred. In this case, decoding for deltaQP can be omitted.As described above, QPpred can be extracted based on the current block or the upper block using at least one of the first and second methods, and their detailed description is omitted. Similarly, a single and identical quantization parameter can be extracted for the ad blocks belonging to the MxN block, and a different quantization parameter can be extracted for each of the ad blocks.
[0196] On the other hand, if a block is adjacent to a frame, slice, or tile boundary, the block may not meet the minimum size. In this case, the block's quantization parameter can only be extracted using QPpred, and decoding for deltaQP can be omitted.
[0197] Fig. 9 illustrates a process of inverse transformation of a residual coefficient according to an embodiment of the present invention.
[0198] Referring to Fig. 9, a residual sample of a residual block can be reconstructed by performing at least one of a first inverse transform or a second inverse transform on the residual coefficient.
[0199] The second inverse transform may be applied to the entire region of the residual block or a partial region within the residual block. A partial region may refer to a low-frequency region within the residual block. The region to which the second inverse transform is applied may be variably determined based on at least one of the size / shape of the residual block or the size / shape of the transform matrix for the second inverse transform.
[0200] For example, if either the width or the height of the residual block is equal to or greater than 8, the second inverse transform with an 8×8 transform matrix can be applied. When the residual block size is 8×8, the second inverse transform is applied to the entire area of the residual block, and when the residual block size is 16×16, the second inverse transform can only be applied to a partial area of the residual block. The partial area can be an 8×8 area located at the upper left of the residual block, a 16×8 area located at the upper edge of the residual block, an 8×16 area located at the left of the residual block, or an area excluding the 8×8 area located at the lower right of the residual block.
[0201] Alternatively, if either the width or the height of the residual block is 4, the second inverse transform with a 4×4 transform matrix can be applied. When the size of the residual block is 4×8 or 8×4, the second inverse transform can be applied only to a partial zone of the residual block (e.g., the 4×4 zone located at the upper left of the residual block), and the second inverse transform can be applied to each of the two 4×4 zones belonging to the residual block.
[0202] The transformation matrix size for the second inverse transform may be 4×4, 8×8, 16×16, 32×32, or larger. The transformation matrix shape is not limited to square and can be implemented as a non-square shape. However, to reduce the transformation complexity, the transformation matrix size allowed for the second inverse transform may be limited to N×M or smaller. N and M may be equal to 4, 8, or 16, respectively, and N and M may be identical or different from each other.
[0203] In the process of the second inverse transform, the transform type of the residual block can be determined through the transform type extraction method described in Fig. 5. Alternatively, the transform type in the second inverse transform can be preset in the encoding / decoding device. For example, one of the above five transform types can be fixed as the transform type in the second inverse transform.
[0204] The second inverse transform can be selectively executed based on a flag indicating whether the first inverse transform (hereinafter referred to as the "first flag") is skipped in the residual block. Thus, when the first inverse transform is skipped in the residual block according to the first flag, the execution of the second inverse transform can be skipped.
[0205] Alternatively, a flag indicating whether the second inverse transformation is omitted (hereinafter referred to as the "second flag") can be separately transmitted in the signaling. If the second flag is 1, the second inverse transformation is not performed, and if the flag is 0, the second inverse transformation can be performed. The first flag and the second flag can be independently encoded and transmitted in the signaling. Alternatively, either of the first flag and the second flag can be transmitted in the signaling depending on the other. For example, only when either of the first flag and the second flag is 1, the other can be transmitted in the signaling. Conversely, only when either of the first flag and the second flag is 0, the other can be transmitted in the signaling.
[0206] The second inverse transform may not be applied when the number of non-zero residual coefficients belonging to the residual block is less than n. In this case, n may be a value preset in the encoding / decoding device. For example, n may be a natural number of 1, 2, 3, or 8 or less. Alternatively, n may be variably determined based on the size of the residual block.
[0207] Meanwhile, Fig. 9 illustrates the execution of the second inverse transform before the first inverse transform, but it does not limit the execution order of the inverse transform. Thus, the second inverse transform may be executed before the first inverse transform or may be executed after the first inverse transform. When the second inverse transform is executed before the first inverse transform, the scaling described in Fig. 5 may be performed between dequantization and the second inverse transform, or may be performed between the first inverse transform and the second inverse transform. On the other hand, when the second inverse transform is executed after the first inverse transform, the scaling described in Fig. 5 may be performed between dequantization and the first inverse transform, or may be performed between the first inverse transform and the second inverse transform.
[0208] Fig. 10 illustrates the form of a scaling list associated with a scaling process according to an embodiment of the present invention.
[0209] As mentioned in Fig. 5, scaling may refer to the process of applying a predetermined quantization weight (m) to the residual coefficient of a residual block. The residual coefficient of a residual block may be square or non-square NxM. A quantization weight may be specified for each frequency in the residual block, and the array of quantization weights specified for each frequency is called a "scaling list."
[0210] The quantization weight of the scaling list can be transmitted in the overhead signals in the encoding device (method A).
[0211] With respect to method A, a quantization weight may be transmitted in signaling for each position or frequency component of the residual coefficients in the residual block. The quantization weight may be transmitted in signaling at least at one level of a video sequence, frame, or other fragment area (e.g., slice, tile, coding tree block row, and block).
[0212] As illustrated in Fig. 10, a scaling list having different sizes / shapes defined by a combination of N and M can be signaled. Here, N and M can be integers greater than or equal to 1. The scaling list can be signaled in a two-dimensional NxM form or can be signaled by arranging a two-dimensional NxM array in one dimension. Alternatively, the scaling list can be signaled by dividing it into a horizontal Nx1 scaling list and a vertical 1xM scaling list.
[0213] The shape of the scaling list may differ depending on whether or not scaling is performed before the second inverse transform according to Fig. 9. For example, when scaling is performed before the second inverse transform, it is transmitted in the service signals in one-dimensional form, otherwise, it may be transmitted in the service signals in two-dimensional form.
[0214] The quantization weight of the scaling list may be a value preset in the encoding / decoding device (method B). With respect to method B, the quantization weight may be a single and identical value regardless of the position of the residual coefficients in the residual block. Alternatively, the quantization weight may be derived based on information in a table form that is preset in the encoding / decoding device. The information in the table form may specify 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.
[0215] The quantization weight of the scaling list may be determined by referring to all or part of a previously used or signaled scaling list (Method C). The scaling list to be referenced may be the last one used or signaled in the encoding / decoding order, or may be used or signaled in the previous fragment area (e.g., in a slice, tile, coding tree block (CTB) row, CTB, other sub-block). For this purpose, information indicating whether or not to refer to the previous scaling list may be encoded and signaled. Information indicating the quantization weight repeatedly used in the previous scaling list may be encoded and signaled.
[0216] The quantization weight may be determined by selectively using one of the AC methods described above. The selection may be performed based on at least one of the residual block size / type, partition type, prediction mode, component type, transform type, or predetermined flag information. The flag information may include a flag indicating whether or not to apply the quantization weight, a flag indicating whether or not to perform a transform skip, and the like.
[0217] In the AC methods described above, the quantization weight of the scaling list may be determined for each of the luminance signal block and the chrominance signal block. For example, if the color format is 4:2:0 or 4:2:2, the scaling list for each of the luminance signal block and the chrominance signal block may be transmitted in the overhead signals. Alternatively, the scaling list of the chrominance signal block may be determined by sampling the scaling list of the luminance signal block at a predetermined ratio. The ratio may be determined based on the color format, which is the ratio between the luminance signal component and the chrominance signal component. Alternatively, in the AC methods described above, the scaling list may be determined differently depending on the transformation type of the residual block.The residual block transformation type may be determined for the vertical transformation and the horizontal transformation, respectively. The scaling list may be determined differently depending on the determined transformation type of the vertical / horizontal transformation. The residual block transformation type may be determined in at least one of the first inverse transformation and the second inverse transformation, as shown in Fig. 9.
[0218] Fig. 11 illustrates a scaling process based on quantization weights and inverse transform according to an embodiment of the present invention.
[0219] At least one of scaling based on quantization weights or inverse transform may be performed by dividing into a horizontal direction and a vertical direction.
[0220] As mentioned in Fig. 10, the scaling list may be signaled by dividing it into an Nx1 horizontal scaling list and a 1xM vertical scaling list. In this case, the decoding device may perform horizontal scaling based on the horizontal scaling list (hereinafter referred to as "one-dimensional horizontal scaling") and vertical scaling based on the vertical scaling list (hereinafter referred to as "one-dimensional vertical scaling"). In addition, the inverse transform may be performed on the residual coefficients to which the scaling is applied. In this case, the horizontal transform (hereinafter referred to as "one-dimensional horizontal transform") may be performed on the residual coefficients to which the one-dimensional horizontal scaling is applied.Additionally, a vertical transformation (hereinafter referred to as a "one-dimensional vertical transformation") can be performed on residual coefficients to which one-dimensional vertical scaling is applied. Alternatively, horizontal and vertical transformations (hereinafter referred to as a "two-dimensional inverse transformation") can be performed on residual coefficients to which scaling is applied.
[0221] For example, as illustrated in Fig. 11, the scaling and inverse transformation for the residual coefficients may include performing a one-dimensional horizontal (vertical) transformation after one-dimensional horizontal (vertical) scaling (hereinafter referred to as the "first stage") and performing a one-dimensional vertical (horizontal) transformation after one-dimensional vertical (horizontal) scaling (hereinafter referred to as the "second stage"). The scaling and inverse transformation may be sequentially performed in order from the first stage to the second stage, and the first stage and the second stage may be performed in parallel.
[0222] Alternatively, the horizontal / vertical transformation can be performed after the horizontal / vertical scaling with respect to the residual coefficients. That is, the scaling and inverse transformation of the residual coefficients can be performed in the order of one-dimensional horizontal (vertical) scaling -> one-dimensional vertical (horizontal) scaling -> one-dimensional horizontal (vertical) transformation -> one-dimensional vertical (horizontal) transformation. One-dimensional horizontal (vertical) scaling and one-dimensional vertical (horizontal) scaling can be performed sequentially or in parallel. Similarly, one-dimensional horizontal (vertical) transformation and one-dimensional vertical (horizontal) transformation can be performed sequentially or in parallel.
[0223] Alternatively, the scaling list may be signaled in a two-dimensional NxM form. In this case, scaling based on the scaling lists (hereinafter referred to as "two-dimensional scaling") can be performed, and the inverse transform can be performed on the scaled residual coefficients. Alternatively, the scaling list may be signaled in the form of a one-dimensional array of two-dimensional NxM arrays, or may be signaled by dividing it into an Nx1 horizontal scaling list and a 1xM vertical scaling list. In this case, the decoding device can rearrange the signaled scaling list into two NxM dimensions. The decoding device can perform the inverse transform after two-dimensional scaling on the residual coefficients.Here, the inverse transform can be performed by dividing into a one-dimensional horizontal transform and a one-dimensional vertical transform, or it can be a two-dimensional inverse transform.
[0224] When scaling is performed before the second inverse transform according to Fig. 9, the inverse transform in this embodiment may mean the second inverse transform. On the other hand, when scaling is performed between the first inverse transform and the second inverse transform according to Fig. 9, the inverse transform in this embodiment may mean the first inverse transform.
[0225] Fig. 12 and 13 illustrate a method for determining an entropy group of a residual block according to an embodiment of the present invention.
[0226] The number of entropy groups belonging to a residual block can be n. For example, a residual block can be divided into two entropy groups: the first group representing the low-frequency region and the second group representing the high-frequency region. Alternatively, a residual block can be divided into three entropy groups: the first group representing the low-frequency region, the second group representing the mid-frequency region, and the third group representing the high-frequency region. However, this is just an example, and n can be equal to 1 or an integer greater than or equal to 4.
[0227] The value n may be a value preset in the encoding / decoding device, or may be extracted based on the information transmitted in the service signals from the encoding device. The information may include information indicating whether or not 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 transmitted in the service signals at least at one level of a video sequence, a frame, or another fragment area (e.g., a slice, a tile, a row of coding tree blocks, a coding block, a transform block).
[0228] Alternatively, the value of n may be variably determined based on coding information regarding the residual block. The coding information may include not only information encoded and transmitted in service signals by the coding device, but also information extracted in the decoding device based on the information transmitted in the service signals.
[0229] For example, the encoding information may include at least one of a block size / shape, block availability, partition type, partition number, component type, prediction mode, information regarding an intra-prediction mode, an inter-prediction mode, motion information, a transform type, a transform skip mode, information regarding non-zero residual coefficients, a scanning order, a color format, in-loop filter information, etc.
[0230] The block size can be expressed by one of width and height, minimum / maximum value of width and height, sum of width and height, number of samples belonging to the block, etc. The availability of the block can be determined by considering the block position, range of parallel processing area, decoding order, etc. The prediction mode can mean information indicating the intra mode or the external mode. The information regarding the intra prediction mode includes information related to 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 preset in the encoding / decoding device, etc.The inter-prediction mode may refer to information indicating the merging / skipping mode, the AMVP mode, or the current-frame-based reference mode. The current-frame-based reference mode refers to a method for predicting the current block using a previously reconstructed area of the current frame. The current frame may be the frame to which the current block belongs. The current frame may be added to a reference frame list for inter-prediction, and the current frame may be located in the reference frame list after a short-term reference frame or a long-term reference frame. The motion information may include a prediction direction flag, a motion vector, a reference frame index, etc. The coding information may be associated with at least one of the current block, a neighboring block relative to the current block, or an upper block relative to the current block. An upper block may refer to a block having a smaller subdivision depth than the current block.
[0231] Referring to Fig. 12, an entropy group can be determined based on at least one of the number of residual coefficients belonging to the entropy group (hereinafter referred to as "coefficient number information") or the scan order. The coefficient number information can be set for each entropy group.
[0232] For example, it is assumed that the coefficient number information of the first group and the second group indicate 3 and 7, respectively, and that the scanning order is a zigzag scan. In this case, as illustrated in Fig. 12, according to the zigzag scan, the first group is determined as a group of three residual coefficients (i.e., a group of residual coefficients at positions 0 to 2), and the second group is 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.
[0233] As described above, the first group is defined as the group from the upper-left residual coefficient of the residual block to the residual coefficient C1 in the position shifted by the coefficient number information of the first group. Similarly, the second group is defined as the group from the residual coefficient C1 to the residual coefficient C2 in the position shifted by the coefficient number information of the second group. The third group is defined as the set of residual coefficients excluding the first group and the second group in the residual block. The shift corresponds to the (reverse) scan order of the residual block or each group.
[0234] The information on the number of coefficients may be a value preset in the encoding / decoding device (first embodiment). Alternatively, the information on the number of coefficients may be transmitted in service signals at least at one level of a video sequence, a frame, and another fragment area (for example, a slice, a tile, a row of coding tree blocks, a coding block, a transform block) (second embodiment). Alternatively, the information on the number of coefficients may be variably determined based on the coding information with respect to the residual block (third embodiment). Here, the coding information is identical to the above-described coding information, and a detailed description thereof is omitted. The information on the number of coefficients may be derived based on the information on the number of coefficients of a predetermined reference block (fourth embodiment).Here, the reference block may be a neighboring block or an upper block relative to the residual block. A neighboring block refers to a previously decoded block before the residual block and may be at least one of the blocks adjacent to the left / right or above / below the residual block. An upper block may be a block with a smaller partition depth than the residual block.
[0235] On the other hand, the information on the number of coefficients of some groups of the plurality of entropy groups may be determined based on one of the first to fourth embodiments described above, and the information on the number of coefficients of some other groups may be determined based on another one of the first to fourth embodiments described above.
[0236] One entropy group can be defined based on one, two, or more pieces of position information. The position information may indicate the position of a specific residual coefficient belonging to a residual block and may be information specifying the size, shape, position, etc. of the entropy group.
[0237] Referring to Fig. 13(a), the entropy group can be distinguished based on the 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 can be (n-1).
[0238] For example, when the position information of the first group indicates the position (X A , Y A ) residual coefficient A, the first group can be defined as the group of residual coefficients in position (x1, y1) (where 0= <x1=<X A , 0= <y1=<Y A ). When the position information of the second group indicates the position (X B , Y B) residual coefficient B, the second group can be defined as a group excluding the first group in the residual coefficients in position (x2, y2) (where 0= <x2=<X B , 0= <y2=< Y B ). The third group can be defined as the group of residual coefficients excluding the first group and the second group in the residual block.
[0239] Referring to Fig. 13(b), the entropy group can be distinguished based on a plurality of pieces of position information.
[0240] For example, when the position information of the first group indicates the positions of the residual coefficients A1 and A2, the first group can be defined as the group of residual coefficients located on the left side relative to the line passing through A1 and A2. Therefore, the first group can consist of 10 residual coefficients. When the position information of the second group indicates the positions of the residual coefficients B1 and B2, the second group can be defined as the group excluding the first group in the group of residual coefficients located on the left side relative to the line passing through B1 and B2. Therefore, the second group can consist of 26 residual coefficients. The third group can be defined as the group of residual coefficients excluding the first group and the second group in the residual block.
[0241] The first group can be determined using two pieces of position information indicating positions A1 and A2, respectively, and the second group can be determined using two pieces of position information indicating positions B1 and B2, respectively. However, as illustrated in Fig. 13(b), the entropy group can be realized in a symmetric form based on the diagonal line L of the residual block. In this case, either of the two pieces of position information can be extracted based on the other. For example, position information A2 can be extracted based on position information A1. Similarly, position information B2 can be extracted based on position information B1.
[0242] Additionally, some of the plurality of entropy groups may be determined based on one piece of position information, and the rest may be determined based on two or more pieces of position information. For example, the first group is determined based on one piece of position information, similar to the embodiment of Fig. 13(a), and the second group is determined based on two pieces of position information, similar to the embodiment of Fig. 13(b). On the other hand, the first group is determined based on two pieces of position information, similar to the embodiment of Fig. 13(b), and the second group is determined based on one piece of position information, similar to the embodiment of Fig. 13(a).
[0243] The position information may be a value preset in the encoding / decoding device (first embodiment). Alternatively, the position information may be transmitted in service signals at least at one level of a video sequence, a frame, or another fragment area (for example, a slice, a tile, a row of coding tree blocks, a coding block, a transform block) (second embodiment). In this case, the block level may be a unit with a fixed size, for example, 4×4, 8×8, or 16×16. However, this does not limit the shape of the block level, and the block level may be a non-square unit with a fixed size. Alternatively, the position information may be variably determined based on coding information with respect to the residual block (third embodiment). Here, the coding information is the same as the above-described coding information, and a detailed description thereof is omitted.Alternatively, position information can be extracted based on position information in a predetermined reference block (fourth embodiment). Here, the reference block is identical to the reference block described above, and a detailed description is omitted.
[0244] On the other hand, the position information of some groups of the plurality of entropy groups may be determined based on one of the first to fourth embodiments, and the position information of other groups may be determined based on another one of the first to fourth embodiments.
[0245] Fig. 14 illustrates the relationship between the scanning of residual coefficients and the entropy group according to an embodiment of the present invention.
[0246] The decoding device can extract the residual coefficient of the residual block by scanning according to a predetermined scanning order. The scanning order includes zigzag scanning, Z scanning, diagonal up and right scanning, diagonal down and left scanning, horizontal scanning, and vertical scanning. Here, diagonal up and right scanning refers to diagonal scanning from the upper-right end to the lower-left end of the residual block, and diagonal down and left scanning refers to diagonal scanning from the lower-left end to the upper-right end of the residual block.
[0247] When a residual block includes multiple entropy groups, scanning may be performed independently of the entropy group or may be performed for each entropy group. A residual block may use only one scanning order for scanning or may use a different scanning order for each entropy group.
[0248] Specifically, referring to Fig. 14(a), a residual block may include three entropy groups. The three entropy groups belonging to the residual block may use the same scanning order, i.e., zigzag scanning. However, zigzag scanning is not performed in a unit of an entropy group, but may be performed in a unit of the residual block. 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 before at least one of the residual coefficients of the second entropy group.
[0249] On the other hand, referring to Fig. 14(b), the residual block may include two entropy groups. Scanning for the residual coefficients may be performed in one entropy group, respectively. In this case, the scanning order of the first entropy group may differ 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. Scanning for the residual coefficients may be performed from the bottom right and from the top left of the residual block. Scanning for the first entropy group may be performed after scanning is completed for all the residual coefficients of the second entropy group.
[0250] Referring to Fig. 14(c), a residual block may include two entropy groups. Scanning for residual coefficients may be performed in each entropy group unit. In this case, the scanning order of the first entropy group may be identical to the scanning order of the second entropy group. For example, the scanning order of the first and second entropy groups may be vertical scanning. Scanning for residual coefficients may be performed from the bottom right and from the top left of the residual block. Scanning for the first entropy group may be performed after scanning for all residual coefficients of the second entropy group is completed.
[0251] This document further describes a method for determining the scanning order of residual blocks. As described above, one or more scanning orders may be used in a residual block unit. In this case, at least one of zigzag scanning, Z-scanning, diagonal up-and-right scanning, diagonal down-and-left scanning, horizontal scanning, and vertical scanning may be selectively used.
[0252] The scanning order may be set as a default mode preset in the encoding / decoding device (the first embodiment). For example, the preset default mode may be zigzag scanning or Z-scan. The scanning order may be extracted based on information transmitted in overhead signals from the encoding device (the second embodiment). The information may mean information indicating the scanning order of the residual block. The information may be transmitted in overhead signals at at least one level of a video sequence, a frame, and another fragment area (for example, a slice, a tile, a row of coding tree blocks, a coding block, a transform block). The information may be transmitted in overhead signals for each entropy group or may be transmitted in overhead signals in a unit of the residual block.
[0253] Alternatively, the scanning order may be determined based on encoding information regarding the residual block (third embodiment). The encoding information may include not only information encoded and signaled by the encoding device, but also information extracted at the decoding device based on the signaled information. For example, the encoding information may include at least one of a block size / type, block availability, partition type, number of partitions, component type, prediction mode, information regarding an intra-prediction mode, an inter-prediction mode, motion information, a transform type, a transform skip mode, information regarding non-zero residual coefficients, a color format, an entropy group size / shape, and the like. This is as described with reference to FIG. 12, and a detailed description is omitted.
[0254] Alternatively, the scanning order can be derived based on the scanning order of a predetermined reference block (fourth embodiment). Here, the reference block can be an adjacent block or an upper block relative to the residual block. The adjacent block refers to a predecoded block before the residual block and can be at least one of the blocks adjacent to the left / right or upper / lower end relative to the residual block. The upper block can be a block having a smaller partition depth than the residual block.
[0255] On the other hand, when one residual block uses a plurality of scan orders, one part of the plurality of scan orders is determined based on one of the first to fourth embodiments described above, and another part is determined based on another one of the first to fourth embodiments.
[0256] Fig. 15 illustrates a method for scanning a residual coefficient according to an embodiment of the present invention.
[0257] Scanning can be performed from the scan start position in the residual block. The start position may indicate the position of a specific residual coefficient of the residual block. A specific residual coefficient may refer to a residual coefficient with a non-zero integer value (hereinafter referred to as a "non-zero value"). A specific residual coefficient may be located at the end of the non-zero values belonging to the residual block in reverse scan order. Conversely, a specific residual coefficient may be located at the beginning of the non-zero values belonging to the residual block in scan order.
[0258] For example, scanning may be performed based on information indicating a scanning start position (hereinafter referred to as "first information"). The first information may be encoded and transmitted in service signals by an encoding device. Scanning may be performed from the position indicated by the first information. As illustrated in Fig. 15(a), the scanning start position may be indicated as an A position instead of the lower right position of the residual block based on the first information. In this case, the residual coefficient existing between the A position and the lower right position of the residual block in the scanning order may be set to zero. The residual coefficient at the lower right position of the residual block may also be set to zero.
[0259] Alternatively, scanning can be performed based on information indicating an entropy group including the scanning start position (hereinafter referred to as "second information"). The second information can be encoded and transmitted in service signals by a coding device. Based on the second information, an entropy group including the scanning start position is indicated, and scanning can be performed from the specified entropy group. In this case, the scanning order between entropy groups depends on the scanning order for the 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 in which scanning is skipped can be set to zero.
[0260] Referring to Fig. 15(b), the residual block consists of a first entropy group including the upper-left residual coefficient, a second entropy group located in 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 the entropy group including the scanning start position. In this case, scanning is performed from the second entropy group, and the residual coefficient of the third entropy group can be set to zero.
[0261] Alternatively, the scanning start position can be determined through a combination of the first information and the second information. Thus, one of the plurality of entropy groups can be specified based on the second information, and the start position in said entropy group can be specified based on the first information. In addition, Fig. 15 does not limit the number, size, or shape of the entropy groups, and the number of entropy groups can be four or more, and the shape of the entropy group can be square or non-square.
[0262] Fig. 16 illustrates a method for processing residual coefficients of a partial zone in a residual block according to an embodiment of the present invention.
[0263] The encoding device may perform transform and / or quantization on the residual samples of the residual block to extract residual coefficients. In this case, the residual coefficient of a partial region in the residual block may not be entropy encoded, and only the residual coefficient of the remaining region may be entropy encoded and transmitted to the decoding device.
[0264] The decoding device can only decode the residual coefficient transmitted from the encoding device and set the residual coefficient of the partial domain as a preset default value in the decoding device. The default value may include at least one of the absolute value (abs) of the residual coefficient and the sign. The absolute value may be zero or a value greater than or equal to two or three.
[0265] Hereinafter, this document describes a method for determining a partial area in a decoding device.
[0266] Referring to Fig. 16, the partial zone (gray zone) may be a zone excluding at least one of the N columns on the left side or one of the M rows on the top side in the residual block. Alternatively, the partial zone may be a zone excluding the NxM zone in the residual block.
[0267] N and M can be a value preset in the encoding / decoding device or can be variably determined according to the size / type of the residual block. For example, when the residual block is 64×32, the area excluding 32 columns (where N=32, M=0) on the left side of the residual block can be set as a partial area. When the residual block is 32×64, the area excluding 32 rows (where N=0, M=32) on the upper side of the residual block can be set as a partial area. However, the values of N and M are only examples. N can be an integer greater than or equal to half the width (W) of the residual block, and M can be an integer greater than or equal to half the height (H) of the residual block.
[0268] Alternatively, N and M can be extracted based on information encoded to indicate a partial zone. For example, the residual block can be divided into a predetermined subzone (e.g., a triangle, rectangle, square, or any other shape). The index or coordinate information of the subzone corresponding to the partial zone can be encoded and transmitted in the signaling. Alternatively, the index of the subzone corresponding to the NxM zone can be encoded and transmitted in the signaling, or coordinate information indicating the size / shape of the NxM zone can be encoded and transmitted in the signaling.
[0269] Specifically, the residual block may be divided into k sub-zones based on at least one of a vertical line or a horizontal line. The value of k may be an integer of 2, 3, 4 or more. The value of k may be a fixed value preset in the encoding / decoding device, or may be variably determined based on the vertical / horizontal line. An index may be assigned to each sub-zone. Here, the index may be a value of 0-(k-1). In this case, the index of the sub-zone corresponding to the partial zone illustrated in Fig. 16 may be transmitted in the service signals, or coordinate information of the sub-zone corresponding to the partial zone may be transmitted in the service signals.On the other hand, the index of the subzone corresponding to the NxM zone, which is the zone in which the residual coefficient is encoded and transmitted by the encoding device, may be transmitted in the service signals, or the coordinate information indicating the size / shape of the NxM zone may be transmitted in the service signals.
[0270] Alternatively, information indicating the X coordinate or Y coordinate for the (N, M) coordinates may be encoded and transmitted in the service signals. In this case, the partial zone may be defined as one of the first group including the residual coefficient with the position (x1, y1) (where N= <x1<w, 0="<x2<W," второй группы, включающей в себя остаточный коэффициент с позицией (x2, y2) (где m="<y3<H).<br" или третьей (x3, y3) n="<x3<W,">
[0271] Alternatively, information indicating the (N, M) coordinates can be encoded and transmitted in service signals. In this case, a group of residual coefficients located on the right and lower sides of the vertical / horizontal line passing through the (N, M) coordinates can be indicated, and this group can be defined as a partial zone.
[0272] In the above-described embodiment, a partial zone may be determined based on at least one of the encoded information, and a residual coefficient of the partial zone may be set to a predetermined default value. For the NxM zone of the residual block, the residual coefficient extraction method described in Fig. 5 and Figs. 12-15 may be applied.
[0273] Meanwhile, the process of setting the residual coefficient to the default value may be selectively performed based on 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 value. The size of the residual block may be expressed by at least one of the width or height of the residual block. The threshold value may indicate the minimum size at which the residual coefficient is allowed to be set to the default value (e.g., 0). The threshold value may be a value preset in the encoding / decoding device, or may be encoded and transmitted in signaling by the encoding device. The threshold value may be 32, 64, 128, 256, or more.
[0274] The process of setting the residual coefficient to the default value can be selectively performed based on flag information. The flag information may indicate whether or not to set the residual coefficient of a partial area (e.g., a high-frequency area) in the residual block to the default value. The flag information may be extracted at the decoding device based on the size / shape of the residual block, or may be encoded and transmitted in signaling by the encoding device. However, the above process may be limited to execution only when the residual block is not encoded in the skip transform mode. Therefore, when the residual block is encoded in the skip transform mode, the encoding device may not encode the information necessary for setting the residual coefficient to the default value.
[0275] Although the exemplary methods of this disclosure are presented in a sequence of steps for clarity of explanation, they are not intended to limit the order in which the steps are performed, and, if necessary, each step can be performed simultaneously or in a different order. To implement the method according to the present disclosure, the illustrative steps may additionally include other steps, include the remaining steps excluding some steps, or may include additional steps different from some steps.
[0276] The various embodiments of the disclosure are not intended to be comprehensive and are intended to illustrate characteristic aspects of the disclosure, and the features described in the various embodiments may be applied independently or in combination of two or more of them.
[0277] Furthermore, various embodiments of the present disclosure may be implemented using hardware, firmware, software, or a combination thereof. In the case of a hardware implementation, the hardware may be implemented using 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), a general-purpose processor, a controller, a microcontroller, a microprocessor, and the like.
[0278] The scope of the present disclosure includes software or computer-executable instructions (e.g., an operating system, applications, firmware, program, etc.) that instruct the execution of operations according to the methods of various embodiments on a device or computer, and a non-transitory computer-readable medium on which such software or instructions are stored, executed on the device or computer. Industrial applicability
[0279] The present disclosure can be used to encode / decode a video signal. 1. A video decoding method, comprising the steps of: - extracting a residual coefficient of a residual block, wherein the residual block is divided into one or more entropy groups; - calculating a quantization parameter for 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. 2. The method of claim 1, wherein at least one of a scanning order, an entropy decoding technology, or a binarization technology associated with one of the plurality of entropy groups is different from the scanning order, the entropy decoding technology, or the binarization technology of another of them. 3. The method of claim2, wherein the number of entropy groups is variably determined based on coding information for the residual block. 4. The method of claim 1, wherein the entropy group is determined based on at least one of a number of residual coefficients belonging to the entropy group or a scan order. 5. The method of claim 4, wherein the entropy group is determined based on one, two or more items of position information, and wherein the position information indicates the position of a specific residual coefficient belonging to the residual block. 6. The method of claim 1, wherein the residual coefficient is extracted by scanning according to a predetermined scan order, and wherein the scanning is performed for each entropy group. 7. The method of claim 6, wherein the scanning is performed by using a different scan order for each entropy group. 8. The method of claim6, wherein scanning is performed from a predetermined starting position in the residual block.9. The method of claim 8, wherein the starting position is determined based on at least one of information indicating a starting position of scanning or information indicating an entropy group including the starting position of scanning.10. The method of claim 1, wherein extracting the residual coefficient further comprises the step of setting the residual coefficient of a partial region in the residual block as a default value preset in the decoding device, and- wherein the partial region is a region excluding at least one of the N columns on the left side with respect to the residual block or one of the M rows on the top with respect to the residual block.11. The method of claim 10, wherein N and M are extracted based on information encoded to indicate the partial region.12. The method of claim1, wherein the residual block is partitioned according to a variable size / shape based on at least one of a quadtree, a binary tree, or a ternary tree.13. A device for decoding video, comprising:- an entropy decoding module that extracts a residual coefficient of a residual block, wherein the residual block is partitioned into one or more entropy groups;- an inverse quantization module that calculates a quantization parameter for the residual block and performs inverse quantization on the residual coefficient using the calculated quantization parameter; and- an inverse transform module that reconstructs a residual sample of the residual block by performing an inverse transform on the inversely quantized residual coefficient.
Claims
1. A method for decoding a video signal, comprising the steps of: extract the residual coefficient of the residual block; calculate the quantization parameter for the residual block; performing inverse quantization on the residual coefficient using the calculated quantization parameter; and form a residual sample of the residual block by performing an inverse transform on the inversely quantized residual coefficient, in this case, the encoded residual coefficient for the partial region in the residual block is not transmitted from the encoding device, wherein the residual sample of the partial region in the residual block is set equal to the default value preset in the decoding device, the default value is 0, wherein the setting to the default value is performed based on at least one of the size or shape of the residual block, and wherein the partial region is a region excluding at least one of the N columns on the left side of the residual block or M rows on the top side of the residual block.
2. The method of claim 1, wherein N and M are extracted based on information that is encoded to indicate the size or position of the partial region.
3. The method of claim 1, wherein the residual block is a block obtained as a result of a split based on at least one of a quadtree, a binary tree, or a ternary tree.
4. A method for encoding a video signal, comprising the steps of: perform a transformation on the residual sample of the residual block to obtain a transformation coefficient of the residual block; performing quantization on the transform coefficient of the residual block based on the quantization parameter to obtain a quantized transform coefficient of the residual block; and form a bit stream by encoding a quantized transform coefficient, in this case, the residual coefficient for the partial region in the residual block is not encoded, wherein the residual sample of the partial region in the residual block is set equal to the default value preset in the encoding device, the default value is 0, wherein the setting to the default value is performed based on at least one of the size or shape of the residual block, and wherein the partial region is a region excluding at least one of the N columns on the left side of the residual block or M rows on the top side of the residual block.
5. The method according to claim 4, wherein the bit stream includes information for indicating the size or position of the partial region, and this information is the basis for extracting N and M in the decoding device.
6. The method of claim 4, wherein the residual block is a block obtained as a result of a split based on at least one of a quadtree, a binary tree, or a ternary tree.
7. A method for transmitting a bit stream, wherein the method comprises the steps of: perform a transformation on the residual sample of the residual block to obtain a transformation coefficient of the residual block; performing quantization on the transform coefficient of the residual block based on the quantization parameter to obtain a quantized transform coefficient of the residual block; forming a bit stream by encoding the quantized transform coefficient; and transmit a stream of bits, in this case, the residual coefficient for the partial region in the residual block is not encoded, wherein the residual sample of the partial region in the residual block is set equal to the default value preset in the encoding device, the default value is 0, wherein the setting to the default value is performed based on at least one of the size or shape of the residual block, and wherein the partial region is a region excluding at least one of the N columns on the left side of the residual block or M rows on the top side of the residual block.
8. The method according to claim 7, wherein the bit stream includes information for indicating the size or position of the partial region, and this information is the basis for extracting N and M in the decoding device.
9. The method of claim 7, wherein the residual block is a block obtained as a result of a partition based on at least one of a quadtree, a binary tree, or a ternary tree.