Video decoding method, video encoding method, and recording medium

By enabling flexible selection of quantization matrices based on transform block sizes and types, the method improves coding efficiency and reduces complexity in video encoding/decoding processes.

JP7735353B2Active Publication Date: 2025-09-08ELECTRONICS & TELECOMM RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023123831
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2013-01-21
Filing Date
2023-07-28
Publication Date
2025-09-08
Estimated Expiration
2033-01-21

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies lack flexibility and efficiency in selecting quantization matrices, leading to reduced coding efficiency and increased computational complexity due to uniform application of quantization matrices without considering transform block sizes or types.

Method used

The method and apparatus allow for the mixing and use of base and non-base quantization matrices based on transform block sizes and types, utilizing a reference quantization matrix identifier to improve encoding efficiency and reduce complexity by predictive encoding/decoding of DC matrix coefficients.

Benefits of technology

This approach enhances coding efficiency and reduces computational complexity by allowing flexible selection of quantization matrices, improving the encoding/decoding process for video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007735353000042
    Figure 0007735353000042
  • Figure 0007735353000043
    Figure 0007735353000043
  • Figure 0007735353000044
    Figure 0007735353000044
Patent Text Reader

Abstract

To provide methods for encoding and decoding a quantized matrix and an apparatus using the same, which improve the coding efficiency and reduce the degree of complexity of calculation.SOLUTION: A method for encoding a quantized matrix comprises the steps of: determining a quantization matrix to be used for quantization, and quantizing; determining a prediction method of the quantization matrix used for the quantization; and encoding quantization matrix information on the basis of the determined prediction method; where the prediction method is either a prediction method between coefficients in the quantization matrix or a duplicate of the quantization matrix.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to video encoding and decoding techniques, and more particularly to a method and apparatus for encoding / decoding quantization matrices. [Background technology]

[0002] Recently, HD (High Definition) resolution broadcasting services have been expanding not only in Korea but also around the world. As a result, many users have become accustomed to high-resolution, high-quality images, and many organizations are accelerating the development of next-generation video equipment.

[0003] Along with HDTV, interest in UHD (Ultra High Definition), which has a resolution four times higher than HDTV, is increasing, and a compression technique for higher resolution, higher quality images is being demanded.

[0004] For video compression, pixel information of a current picture can be coded using prediction, such as an inter-prediction technique that predicts pixel values ​​included in the current picture from previous and / or subsequent pictures, or an intra-prediction technique that predicts pixel values ​​included in the current picture using pixel information within the current picture.

[0005] In addition, by applying entropy coding technology, which assigns short codes to symbols that occur frequently and long codes to symbols that occur infrequently, it is possible to increase coding efficiency and reduce the amount of information transmitted.

[0006] The problem then becomes how to more effectively perform quantization of the transform coefficients for the residual blocks generated by prediction. Summary of the Invention [Problem to be solved by the invention]

[0007] The present invention aims to provide a method and apparatus for limiting quantization matrix encoding / decoding based on the size of available transform blocks.

[0008] Another object of the present invention is to provide an encoding / decoding method and apparatus that can mix and use base quantization matrices and non-base quantization matrices depending on the size of a transform block or the type of quantization matrix within a sequence, picture, or slice.

[0009] Another object of the present invention is to provide an encoding / decoding method and apparatus that uses a base quantization matrix based on a reference quantization matrix identifier.

[0010] Another object of the present invention is to provide an encoding / decoding method and apparatus that improves encoding efficiency by performing quantization matrix prediction only when a reference quantization matrix exists.

[0011] Another object of the present invention is to provide a method and apparatus for effectively predictively encoding / decoding DC matrix coefficients.

[0012] Another object of the present invention is to provide an encoding / decoding method and apparatus for performing quantization matrix prediction from a quantization matrix having the same size as the quantization matrix used in encoding / decoding.

[0013] Another object of the present invention is to provide a method and apparatus for performing predictive coding / decoding based on the first coefficient in a quantization matrix. [Means for solving the problem]

[0014] One embodiment of the present invention is a quantization matrix encoding method, which includes the steps of determining a quantization matrix to be used for quantization and quantizing it, determining a prediction method for the quantization matrix used for the quantization, and encoding information about the quantization matrix according to the determined prediction method, wherein the prediction method is one of an inter-coefficient prediction method within the quantization matrix and copying of the quantization matrix.

[0015] The quantization matrix decoding method of the present invention includes a step of determining a prediction method of a quantization matrix used for inverse quantization, and a step of decoding the quantization matrix used for inverse quantization according to the determined prediction method, wherein the prediction method of the quantization matrix is ​​one of a prediction method between coefficients within the quantization matrix and copying of the quantization matrix. [Effects of the Invention]

[0016] According to the present invention, by limiting the quantization matrix coding according to the size of the available transform blocks, it is possible to improve coding efficiency and reduce computational complexity.

[0017] According to the present invention, by mixing base quantization matrices and non-base quantization matrices according to the size of the transform block or the type of quantization matrix within a sequence, picture, or slice, it is possible to improve coding efficiency and increase the degree of freedom in selecting quantization matrices in the encoder.

[0018] According to the present invention, by using a reference quantization matrix identifier to encode / decode whether a base quantization matrix can be used, or by performing quantization matrix prediction only when a reference quantization matrix exists, it is possible to improve coding efficiency, reduce computational complexity, and increase the freedom of quantization matrix selection in the encoder.

[0019] According to the present invention, by predictively encoding / decoding DC matrix coefficients or by performing quantization matrix prediction from a quantization matrix that is the same size as the quantization matrix during encoding / decoding, it is possible to improve coding efficiency, reduce computational complexity, and increase the degree of freedom in selecting a quantization matrix for the encoder.

[0020] Furthermore, according to the present invention, the first coefficient in a quantization matrix is ​​encoded / decoded using frequently occurring coefficient values, thereby improving coding efficiency and reducing computational complexity. [Brief explanation of the drawings]

[0021] [Figure 1] 1 is a block diagram showing a configuration of an embodiment of a video encoding device to which the present invention is applied. [Figure 2] 1 is a block diagram showing a configuration of an embodiment of a video decoding device to which the present invention is applied; [Figure 3] FIG. 1 is a conceptual diagram illustrating an embodiment in which one unit is divided into multiple sub-units. [Figure 4] 1 is a flow chart illustrating a video encoding method according to the present invention; [Figure 5] 10 is a flow chart illustrating an example of a decoder operation for decoding information on a quantization matrix and performing decoding using the information. [Figure 6] 1 is a flowchart that outlines an example of a method for performing inverse quantization in accordance with the present invention. [Figure 7] 10 is a diagram for explaining an example of a method for obtaining information on a quantization matrix and performing inverse quantization when a quantization matrix exists in a parameter set; [Figure 8] 10 is a diagram for explaining another example of a method for obtaining information on a quantization matrix and performing inverse quantization when a quantization matrix exists in a parameter set; DETAILED DESCRIPTION OF THE INVENTION

[0022] Hereinafter, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the embodiments of the present specification, if a detailed description of related known structures or functions is deemed to obscure the gist of the specification, the detailed description will be omitted.

[0023] In this specification, when a component is said to be "coupled" or "connected" to another component, it means that the component is directly coupled or connected to the other component, or that there is another component between them. Furthermore, in this specification, when a component is described as "including" a specific component, it does not exclude components other than the component, but means that additional components may be included in the scope of the implementation or technical idea of ​​the present invention.

[0024] Terms such as "first" and "second" may be used to describe various components, but the components are not limited by these terms. These terms are used only to distinguish one component from another. For example, a first component may be called a "second component," and similarly, a second component may be called a "first component" without departing from the scope of the present invention.

[0025] Furthermore, the components disclosed in the embodiments of the present invention are illustrated independently to demonstrate different characteristic functions, and do not mean that each component is configured as a separate hardware or software unit. That is, each component is included as a separate component for convenience of explanation, and at least two of the components may be integrated into one component, or one component may be divided into multiple components to perform its function. Both integrated and separated embodiments of each component are within the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0026] In addition, some components are not essential components for performing essential functions in the present invention, but are optional components merely for improving performance. The present invention may be embodied by including only components essential for embodying the essence of the present invention, excluding components merely used for improving performance, and a structure including only essential components, excluding optional components merely used for improving performance, is also included in the scope of the present invention.

[0027] First, for the convenience of explanation and understanding of the invention, a brief explanation will be given of terms used in this specification.

[0028] A unit refers to a unit of video encoding and decoding. That is, in video encoding / decoding, a coding unit or decoding unit refers to the divided unit when an image is divided into smaller units for encoding or decoding. A unit may be called a block, macroblock, coding unit, prediction unit, transform unit, coding block, prediction block, or transform block. One unit can be divided into smaller sub-units.

[0029] A transform unit is a basic unit or a basic unit for performing encoding / decoding of a residual block, such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding, and one transform unit can be divided into multiple smaller transform units. Also, it can be used in the same sense as a transform block, and a form including syntax elements related to a transform block for luma and chroma signals is also called a transform unit.

[0030] A quantization matrix is ​​a matrix used in a quantization or dequantization process to improve the subjective or objective image quality of an image. A quantization matrix is ​​also called a scaling list.

[0031] The quantization matrices used for quantization / dequantization may be transmitted to the bitstream, or a default matrix already stored in the encoder and / or decoder may be used. The information on the quantization matrices to be transmitted may be transmitted collectively by the size of the quantization matrix or the size of the transform block to which the quantization matrix is ​​applied via a sequence parameter set (SPS) or a picture parameter set (PPS). For example, a 4×4 quantization matrix may be transmitted for a 4×4 transform block, an 8×8 matrix for an 8×8 transform block, a 16×16 matrix for a 16×16 transform block, and a 32×32 matrix for a 32×32 transform block.

[0032] The quantization matrix applied to the current block may be (1) obtained by copying a quantization matrix of the same size, or (2) generated by prediction from previous matrix coefficients in the quantization matrix. The matrix of the same size may be a quantization matrix previously encoded, decoded, or used, a reference quantization matrix, or a base quantization matrix. Alternatively, it may be selectively determined from a combination including at least two of a quantization matrix previously encoded, decoded, or used, a reference quantization matrix, and a base quantization matrix.

[0033] A parameter set corresponds to header information among structures in a bitstream, and is commonly called a sequence parameter set, a picture parameter set, an adaptation parameter set, etc.

[0034] A quantization parameter is a value used in quantization and dequantization, and is a value mapped to a quantization step size.

[0035] A base matrix refers to a predetermined quantization matrix predefined in an encoder and / or decoder, and a base quantization matrix described later in this specification may be used interchangeably with the base matrix. A non-default matrix refers to a quantization matrix that is not predefined in an encoder and / or decoder and is transmitted from the encoder to the decoder, i.e., transmitted / received by a user, and a non-default quantization matrix described later in this specification may be used interchangeably with the non-base matrix.

[0036] FIG. 1 is a block diagram showing the configuration of an embodiment of a video encoding device to which the present invention is applied.

[0037] Referring to FIG. 1, the video encoding device 100 includes a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference video buffer 190.

[0038] The video encoding device 100 may output a bitstream by encoding an input image in intra mode or inter mode. Intra prediction refers to intra-frame prediction, and inter prediction refers to inter-frame prediction. In the intra mode, the switch 115 may switch to intra, and in the inter mode, the switch 115 may switch to inter. The video encoding device 100 may generate a predicted block for an input block of the input image, and then encode the difference between the input block and the predicted block. In this case, the input image refers to an original picture.

[0039] In the case of the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values ​​of already coded blocks surrounding the current block.

[0040] In the case of inter mode, the motion prediction unit 111 may obtain a motion vector by searching for an area that best matches the input block in a reference image stored in the reference image buffer 190 during the motion prediction process. The motion compensation unit 112 may generate a predicted block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used in inter prediction and may indicate an offset between the current block and a block in the reference image.

[0041] The subtractor 125 may generate a residual block based on the difference between the input block and the generated prediction block. The transform unit 130 may output transform coefficients by performing a transform on the residual block. The quantization unit 140 may output quantized coefficients by quantizing the input transform coefficients using at least one of a quantization parameter and a quantization matrix. In this case, the quantization matrix may be input to an encoder, and it may be determined that the input quantization matrix is ​​to be used in the encoder.

[0042] The entropy encoder 150 may output a bit stream by performing entropy encoding based on values ​​calculated by the quantizer 140 or encoding parameter values ​​calculated during the encoding process. When entropy encoding is applied, fewer bits are assigned to symbols with a high occurrence probability and more bits are assigned to symbols with a low occurrence probability to represent the symbols, thereby reducing the size of a bit string for a symbol to be encoded. Therefore, the compression performance of video encoding may be improved through entropy encoding. The entropy encoder 150 may use encoding methods such as Exponential-Golomb Code, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy encoding.

[0043] 1 performs inter-prediction coding, i.e., inter-frame predictive coding, so that a currently coded image needs to be decoded and stored to be used as a reference image. Therefore, the quantized coefficients are inversely quantized by the inverse quantization unit 160 and inversely transformed by the inverse transform unit 170. The inversely quantized and inverse transformed coefficients become a reconstructed residual block, which is added to the predicted block via the adder 175 to generate a reconstructed block.

[0044] The reconstructed block passes through the filter unit 180, which can apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or picture. The filter unit 180 is also called an in-loop filter. The deblocking filter can remove block distortion that occurs at boundaries between blocks. The SAO can add an appropriate offset value to pixel values ​​to compensate for coding errors. The ALF can perform filtering based on a value obtained by comparing a reconstructed image with an original image. The reconstructed block that has passed through the filter unit 180 can be stored in the reference image buffer 190.

[0045] FIG. 2 is a block diagram showing the configuration of an embodiment of a video decoding device to which the present invention is applied.

[0046] Referring to FIG. 2, the video decoding apparatus 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference video buffer 270.

[0047] The video decoding apparatus 200 may receive a bitstream output from an encoder, perform decoding in an intra mode or an inter mode, and output a reconstructed image, i.e., a restored image. In the intra mode, a switch may be switched to intra, and in the inter mode, a switch may be switched to inter. The video decoding apparatus 200 may obtain a reconstructed residual block from the input bitstream to generate a prediction block, and then generate a reconstructed block, i.e., a restored block, by adding the reconstructed residual block and the prediction block.

[0048] The entropy decoding unit 210 can generate symbols including symbols in the form of quantized coefficients by entropy decoding the input bitstream according to a probability distribution. The entropy decoding method is the same as the entropy encoding method described above.

[0049] When the entropy decoding method is applied, symbols are represented by assigning fewer bits to symbols with a higher probability of occurrence and more bits to symbols with a lower probability of occurrence, thereby reducing the size of the bit string for each symbol.

[0050] The quantized coefficients are inverse quantized using quantization parameters in the inverse quantization unit 220 and inverse transformed in the inverse transform unit 230, and a reconstructed residual block can be generated as a result of the inverse quantization / inverse transform of the quantized coefficients.

[0051] The quantization matrix used for dequantization is also called a scaling list. The dequantization unit 220 can generate dequantized coefficients by applying the quantization matrix to the quantized coefficients.

[0052] In this case, the inverse quantization unit 220 may perform inverse quantization corresponding to the quantization applied by the encoder. For example, the inverse quantization unit 220 may perform inverse quantization by inversely applying the quantization matrix applied by the encoder to the quantized coefficients.

[0053] The quantization matrix used for inverse quantization in the video decoding apparatus 200 may be received from a bitstream, or a base matrix already stored in the encoder and / or decoder may be used. Information on the quantization matrix to be transmitted may be collectively received by the size of the quantization matrix or the size of the transform block to which the quantization matrix is ​​applied via a sequence parameter set or a picture parameter set. For example, a 4x4 quantization matrix may be received for a 4x4 transform block, an 8x8 matrix for an 8x8 transform block, a 16x16 matrix for a 16x16 transform block, and a 32x32 matrix for a 32x32 transform block.

[0054] In the case of the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values ​​of already decoded blocks surrounding the current block. In the case of the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference image buffer 270.

[0055] The reconstructed residual block and the prediction block are added via an adder 255, and the added block may pass through a filter unit 260. The filter unit 260 may apply at least one of a de-locking filter, SAO, and ALF to the reconstructed block or the reconstructed picture. The filter unit 260 may output a reconstructed image, i.e., a reconstructed image. The reconstructed image may be stored in a reference image buffer 270 and used for inter prediction.

[0056] Meanwhile, the block division information may include information regarding the depth of the unit, which may indicate the number and / or degree to which the unit is divided.

[0057] FIG. 3 is a conceptual diagram that illustrates an example in which one unit is divided into multiple sub-units.

[0058] A unit or block may be hierarchically divided with depth information based on a tree structure. Each divided sub-unit may have depth information. The depth information may include information on the size of the sub-unit to indicate the number and / or degree of division of the unit.

[0059] Referring to 310 in Figure 3, the highest node, also called a root node, may have the smallest depth value, and may have a depth of level 0, indicating the first unit that is not divided.

[0060] A subnode with a depth of level 1 may indicate a unit in which the initial unit is divided once, and a subnode with a depth of level 2 may indicate a unit in which the initial unit is divided twice. For example, in 320 of Figure 3, unit a corresponding to node a is a unit in which the initial unit is divided once, and may have a depth of level 1.

[0061] A leaf node at level 3 may represent a unit that is obtained by dividing the initial unit three times. For example, in 320 of FIG. 3, unit d corresponding to node d is a unit that is obtained by dividing the initial unit three times and may have a depth of level 3. Therefore, the leaf node at level 3, which is the lowest node, may have the deepest depth.

[0062] The encoding / decoding method has been described above in brief. The quantization matrix encoding / decoding method used in the quantization and inverse quantization processes of the encoding / decoding process has a significant impact on the coding efficiency, as with other processes of the encoding / decoding process. Therefore, it is necessary to improve the quantization / inverse quantization in consideration of the coding efficiency.

[0063] Specifically, in the conventional method, quantization matrices for all transforms are coded / decoded without considering the minimum and maximum sizes of the transforms that can be used. Also, in the conventional method, base matrices and non-base matrices are not mixed and used according to the transform size or quantization matrix type within a sequence, picture, or slice, but a uniform quantization matrix is ​​applied, which has drawbacks such as low flexibility in selecting a quantization matrix in an encoder and reduced coding efficiency because a base matrix that does not need to be coded / decoded must be coded and transmitted.

[0064] As described above, the conventional method not only has low flexibility in applying the quantization matrix and low coding efficiency, but also has high complexity.

[0065] Therefore, in order to improve coding efficiency and reduce complexity in quantization / dequantization, it is necessary to consider how to effectively use the quantization matrix.

[0066] FIG. 4 is a flow chart illustrating a video encoding method according to the present invention.

[0067] Referring to FIG. 4, the encoder determines and encodes information regarding the size of a transform unit of a current sequence or picture (S410).

[0068] The size information of the transform unit indicates at least one of the minimum size and the maximum size of the transform unit, and the encoder can determine the minimum size and the maximum size of the transform unit when encoding video.

[0069] For example, the encoder may determine the minimum size of a square transform unit to be 4x4 blocks or the maximum size to be 32x32 blocks. The encoder may also determine the minimum and maximum sizes of a square transform unit to be 4x4 blocks and 32x32 blocks, respectively. Encoding may be performed according to the minimum and maximum sizes of the square transform unit.

[0070] The encoder may entropy encode the determined transform unit size information into a bitstream. For example, the encoder may encode the determined transform unit size information into a parameter set within the bitstream.

[0071] As described above, the transform unit size information refers to information on at least one of the minimum size and the maximum size of the transform unit. Therefore, the encoder can encode information on the minimum size and the maximum size of the transform unit into a bitstream as the transform unit size information. In this case, the maximum size of the transform unit can be determined using a difference value from the minimum size of the transform unit.

[0072] Table 1 outlines an example of transform unit size information entropy coded into the sequence parameter set of the bitstream.

[0073] [Table 1]

[0074] As shown in Table 1, the syntax elements can be specified by applying a Log2 function to the minimum width or height of the square transform unit to calculate Log2MinTrafoSize, and then subtracting 2 from Log2MinTrafoSize to determine the resulting value using log2_min_transform_block_size_minus2. Alternatively, the Log2MaxTrafoSize can be specified by applying a Log2 function to the maximum width or height of the square transform unit to determine the difference between Log2MaxTrafoSize and Log2MinTrafoSize to determine the difference using log2_diff_max_min_transform_block_size. The encoder can encode the syntax elements log2_min_transform_block_size_minus2 and log2_diff_max_min_transform_block_size into a bitstream and transmit it to the decoder. That is, the encoder can encode values ​​indicated by log2_min_transform_block_size_minus2 and log2_diff_max_min_transform_block_size and transmit them as a bitstream.

[0075] The encoder may encode quantization matrix information (S420). The encoder encodes quantization matrix information including at least one of (1) information on whether a quantization matrix is ​​usable, (2) information on whether a quantization matrix is ​​present, (3) information on whether a quantization matrix is ​​usable and whether a base matrix is ​​usable, (4) a quantization matrix predictive encoding method and type, (5) a reference quantization matrix identifier, or (6) a difference value between a quantization matrix coefficient value previously encoded within a quantization matrix and a quantization matrix coefficient value to be encoded.

[0076] In this case, the encoder may encode the quantization matrix information based on information about the size of the transform unit.

[0077] Hereinafter, a method for encoding quantization matrix information will be described in detail with reference to the drawings and tables.

[0078] The quantization matrix information indicates a method determined or used by an encoder. For example, the encoder may determine whether or not to use a quantization matrix, and then encode the quantization matrix use information into a parameter set. Therefore, the encoded quantization matrix use information indicates whether or not to use the quantization matrix determined by the encoder.

[0079] Table 2 shows an example in which information on whether or not a quantization matrix can be used is coded into a sequence parameter.

[0080] [Table 2]

[0081] As shown in the syntax example of Table 2, the encoder can encode scaling_list_enabled_flag, which is information on whether a quantization matrix can be used, into a sequence parameter set and transmit it to the decoder. In this case, if the value of scaling_list_enabled_flag is 1, it indicates that a quantization matrix is ​​to be used in dequantization / scaling of transform coefficients for the entire sequence, and if the value of scaling_list_enabled_flag is 0, it indicates that a quantization matrix is ​​not to be used in dequantization / scaling of transform coefficients. Here, syntax refers to a syntax element.

[0082] After determining whether or not a quantization matrix is ​​present, the encoder can encode the information about whether or not a quantization matrix is ​​present into a parameter set.

[0083] Table 3 shows an example of encoding information on the presence or absence of a quantization matrix into a parameter set.

[0084] [Table 3]

[0085] As shown in the syntax example of Table 3, the encoder can encode aps_scaling_list_data_present_flag, which is information on the presence or absence of a quantization matrix, into a parameter set. Table 3 illustrates an example in which the information on the presence or absence of a quantization matrix is ​​encoded into an adaptive parameter set, but the present invention is not limited thereto, and the encoder can also encode the information on the presence or absence of a quantization matrix into another parameter set.

[0086] In Table 3, a value of aps_scaling_list_data_present_flag of 1 indicates that a quantization matrix is ​​present in the adaptation parameter set, and a value of aps_scaling_list_data_present_flag of 0 indicates that a quantization matrix is ​​not present in the adaptation parameter set. If scaling_list_enabled_flag is 1 and aps_scaling_list_data_present_flag is 0, it means that a base matrix is ​​used during dequantization. In addition, information on the presence or absence of a quantization matrix exists in different parameter sets. For example, when sps_scaling_list_data_present_flag indicating the presence or absence of a quantization matrix in a sequence and pps_scaling_list_data_present_flag indicating the presence or absence of a quantization matrix in a picture are used, if sps_scaling_list_data_present_flag is 1 and pps_scaling_list_data_present_flag is 0, the quantization matrix corresponding to the sequence can be used during quantization / dequantization. That is, when quantization matrices are transmitted in multiple parameter sets and a quantization matrix does not exist in some parameter sets, a quantization matrix existing in an existing or activated parameter set can be used during quantization / dequantization. The above content can also be applied to the content of encoding / decoding information on the presence or absence of a quantization matrix in the embodiments described below.

[0087] After determining whether to encode the quantization matrix and whether to use the base matrix, the encoder can encode information regarding whether to encode the quantization matrix and whether to use the base matrix into a parameter set.

[0088] Table 4 shows an example of encoding information on whether a quantization matrix can be coded and whether a base matrix can be used in a parameter set.

[0089] [Table 4]

[0090] The encoder can encode use_default_scaling_list_flag, which is information on whether the quantization matrix is ​​coded and whether the base matrix is ​​used, into the adaptive parameter set, as shown in the example of Table 4. When the value of use_default_scaling_list_flag is 1, the quantization matrix is ​​not coded, and all quantization matrix coefficient values ​​are determined to be the same as the base matrix coefficient values ​​predetermined by the encoder and / or decoder. When the value of use_default_scaling_list_flag is 0, the quantization matrix is ​​coded, and the encoder and / or decoder do not use the base matrix predetermined by the encoder and / or decoder.

[0091] Table 4 describes the case where use_default_scaling_list_flag is coded into the adaptation parameter set, but this is merely an example for convenience of explanation, and use_default_scaling_list_flag may be coded into other parameter sets.

[0092] The quantization matrix information may be determined taking into consideration the size of the transform unit or the size of the transform block, the coding mode, and the color components. The quantization matrix information may also indicate whether the information is for the luminance component (Y, luma) or the color difference component (Cb, Cr, chroma).

[0093] For example, the encoder determines at least one of encoding the quantization matrix, whether to use a base matrix, and a predictive encoding method by using SizeID, which is information corresponding to the size of the quantization matrix, and MatrixID, which is information corresponding to the type of each quantization matrix. In this case, SizeID can be interpreted as information on a quantization matrix corresponding to the size of a transform unit or information on a quantization matrix corresponding to the size of a transform block. In addition, SizeID, as used herein, is the same as sizeID or sizeId, and MatrixID is the same as matrixID or matrixId.

[0094] In this case, the encoder may also use tables stored in the encoder and / or decoder.

[0095] Table 5 shows an example of a table that may be used to indicate the size of a transform block or the size of a quantization matrix corresponding to a transform block.

[0096] [Table 5]

[0097] In the example of Table 5, the SizeID value specifies the size of a transform unit, the size of a transform block, or the size of a quantization matrix.

[0098] Table 6 shows an example of a table for the coding mode of the block in which the quantization matrix is ​​used and the type of quantization matrix that maps to the color components.

[0099] [Table 6]

[0100] In the example of Table 6, the MatrixID value indicates the type of quantization matrix that specifies the coding mode and color component in which the quantization matrix is ​​used, where the coding mode refers to the prediction mode.

[0101] Tables 7 and 8 are examples of base quantization matrix tables used to identify base quantization matrices based on SizeID and MatrixID determined in Tables 5 and 6. Here, each value in the table means a value identified by ScalingList[SizeID][MatrixID][i].

[0102] [Table 7]

[0103] [Table 8]

[0104] Table 7 is for the base quantization matrix with a SizeID value of 0 (4x4 blocks), and Table 8 is for the base quantization matrix with SizeID values ​​of 1 (8x8 blocks), 2 (16x16 blocks), and 3 (32x32 blocks). In Tables 7 and 8, the SizeID and MatrixID values ​​are as specified in Tables 5 and 6.

[0105] In Tables 7 and 8, i specifies the position of each coefficient in the quantization matrix. In the case of a quantization matrix for a 16x16 block or a 32x32 block, quantization matrix coefficients can be specified only for an 8x8 block without specifying quantization matrix values ​​for the entire 16x16 block and 32x32 block, and the unspecified coefficients can be derived and used based on the 8x8 block values. The example in Table 8 also shows an example of specifying a base quantization matrix in 8x8 block units. Quantization matrix coefficients for a 16x16 block or a 32x32 block can be derived by interpolation from a quantization matrix stored in 8x8 block units, or can be derived in a predetermined manner. When deriving a 16x16 or 32x32 quantization matrix from an 8x8 quantization matrix through interpolation, the quantization matrix coefficients at the DC position can use separate values ​​instead of interpolated values.

[0106] On the other hand, if a quantization matrix is ​​not used taking into account the minimum and maximum sizes of available transform units, quantization matrices for transform units of all sizes must be coded, which can reduce coding efficiency and increase computational complexity.

[0107] Therefore, the encoder can encode information about the quantization matrix taking into account the size of the transform unit. For example, the encoder can limit SizeID according to the minimum and maximum sizes of the transform unit size information.

[0108] The encoder can use the restricted SizeID to perform at least one of encoding a quantization matrix, encoding information indicating whether a base matrix can be used, and encoding information indicating the type of predictive encoding method.

[0109] Table 9 shows an example of a syntax structure used when restricting SizeID and performing quantization matrix encoding.

[0110] [Table 9]

[0111] As shown in the example of Table 9, the encoder can limit SizeID by the minimum and maximum sizes of the transform unit size information, and encode information regarding at least one of the quantization matrix, whether or not a base matrix can be used, and the type of predictive encoding method only for a specific transform unit size.

[0112] For example, if the value of Log2MinTrafoSize is 3 and the value of Log2MaxTrafoSize is 4, at least one of the following can be performed: encoding of a quantization matrix corresponding to an 8x8 transform unit to a 16x16 transform unit; encoding information on whether a base matrix can be used; and encoding information on the type of predictive encoding method.

[0113] On the other hand, in the example of Table 9, use_default_scaling_list_flag does not need to be coded.

[0114] In addition, SizeID can be limited by the difference between the maximum size and the minimum size of the transform unit size information, and encoding can be performed for at least one of information on the quantization matrix, whether or not a base matrix can be used, and the type of predictive encoding method.

[0115] Table 10 outlines an example of a syntax structure used when SizeID is limited by a difference value between the maximum size and the minimum size of the transform unit size information and information on the quantization matrix is ​​coded.

[0116] [Table 10]

[0117] In the syntax example of Table 10, SizeID is restricted by a difference between the maximum size and the minimum size of the transform unit size information. The encoder restricts SizeID by a difference between the maximum size and the minimum size of the transform unit size information, and can encode at least one of information on the quantization matrix, whether or not a base matrix can be used, and the type of predictive coding method only for a specific transform unit size range.

[0118] In the example of Table 10, if the value of Log2MinTrafoSize is 3 and the value of Log2MaxTrafoSize is 4, at least one of encoding of a quantization matrix corresponding to an 8x8 transform unit to a 16x16 transform unit, encoding of whether a base matrix can be used, and encoding of the type of predictive encoding method can be performed.

[0119] In this case, the difference between Log2MaxTrafoSize and Log2MinTrafoSize is the difference between the maximum and minimum sizes of the transform unit, and is equal to log2_diff_max_min_transform_block_size. And Log2MinTrafoSize-2 is equal to log2_min_transform_block_size_minus2.

[0120] In the example of Table 10, use_default_scaling_list_flag does not need to be coded.

[0121] On the other hand, if base matrices and non-base matrices cannot be mixed depending on the size of a transform block (unit) or the type of quantization matrix within a sequence, picture, or slice, the encoder has less flexibility in selecting a quantization matrix. For example, to use a base matrix for a transform block of a specific size within a slice and a non-base matrix for a transform block of another specific size, the base matrix must be coded and transmitted to the decoder, resulting in reduced coding efficiency.

[0122] In order to use a mixture of base and non-base matrices according to the transform size or quantization matrix type within a sequence, picture, or slice, the encoder can encode whether to encode the quantization matrix and whether to use the base matrix in the parameter set according to SizeID.

[0123] Table 11 shows an example of a syntax structure that can be applied when encoding quantization matrix information using SizeID.

[0124] [Table 11]

[0125] As shown in the example of Table 11, the encoder can encode sid_use_default_scaling_list_flag[SizeID][MatrixID], which is information specifying whether to encode a quantization matrix according to SizeID and whether to use a base matrix, into the adaptation parameter set. MatrixID indicates a specific quantization matrix type as shown in Table 6.

[0126] In this case, if the value of sid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the quantization matrix corresponding to SizeID is not encoded, and the quantization matrix coefficient values ​​corresponding to SizeID may be determined to be the same as the base matrix coefficient values ​​predetermined in the encoder and / or decoder. If the value of sid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to SizeID is encoded, and the base matrix predetermined in the encoder and / or decoder is not used in the quantization matrix corresponding to SizeID.

[0127] In the example of Table 11, use_default_scaling_list_flag does not have to be coded.

[0128] In addition, the encoder can encode whether or not the quantization matrix is ​​to be coded and whether or not the base matrix is ​​to be used into the parameter set by using MatrixID.

[0129] Table 12 outlines an example of syntax that can be applied when encoding quantization matrix information using MatrixID.

[0130] [Table 12]

[0131] As in the example of Table 12, the encoder can encode mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information on whether a quantization matrix can be coded by MatrixID and whether a base matrix can be used, into the adaptation parameter set.

[0132] In this case, if the value of mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the quantization matrix corresponding to MatrixID is not encoded, and the quantization matrix coefficient values ​​corresponding to MatrixID may be determined to be the same as the base matrix coefficient values ​​predetermined in the encoder and / or decoder. If the value of mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to MatrixID is encoded, and the base matrix predetermined in the encoder and / or decoder is not used as the quantization matrix corresponding to MatrixID.

[0133] In the example of Table 12, use_default_scaling_list_flag does not need to be coded.

[0134] Furthermore, the encoder can encode into the parameter set whether or not to encode the quantization matrix and whether or not to use the base matrix, using SizeID and MatrixID.

[0135] Table 13 outlines an example of syntax that can be applied when encoding quantization matrix information using SizeID and MatrixID.

[0136] [Table 13]

[0137] As shown in the example of Table 13, the encoder can encode sid_mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information on whether the quantization matrix can be coded and whether the base matrix can be used, into the adaptation parameter set according to SizeID and MatrixID.

[0138] In this case, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the quantization matrix corresponding to SizeID and MatrixID is not encoded, and the coefficient values ​​of the quantization matrix corresponding to SizeID and MatrixID can be determined to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder.

[0139] If the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to SizeID and MatrixID is encoded, and the base matrix predetermined by the encoder and / or decoder is not used as the quantization matrix corresponding to SizeID and MatrixID.

[0140] In the example of Table 13, use_default_scaling_list_flag does not need to be coded.

[0141] Meanwhile, the encoder may also encode whether to encode the quantization matrix and whether to use the base matrix into the parameter set according to SizeID and MatrixID in a manner different from the example of Table 13. SizeID may be limited by the minimum and maximum sizes of the transform unit size information, and at least one of quantization matrix encoding, base matrix use / non-use encoding, and predictive encoding method type encoding may be performed.

[0142] Table 14 outlines another example of syntax that can be applied when encoding quantization matrix information using SizeID and MatrixID.

[0143] [Table 14]

[0144] In the example of Table 14, use_default_scaling_list_flag does not need to be coded.

[0145] The encoder may also limit SizeID by the difference between the maximum and minimum size of the transform unit size information, and perform encoding for at least one of the following information: the quantization matrix, whether or not a base matrix can be used, and the type of predictive encoding method.

[0146] Table 15 outlines another example of syntax that can be applied when encoding quantization matrix information using SizeID and MatrixID.

[0147] [Table 15]

[0148] In the example of Table 15, the difference between Log2MaxTrafoSize, which specifies the maximum size of a transform unit, and Log2MinTrafoSize, which specifies the minimum size of a transform unit, is the difference between the maximum and minimum sizes of a transform unit, and is the same as log2_diff_max_min_transform_block_size. Log2MinTrafoSize-2 is the same as log2_min_transform_block_size_minus2.

[0149] In the example of Table 15, the encoder can encode into the parameter set whether to encode the quantization matrix and whether to use the base matrix based on SizeID and MatrixID, which are limited by Log2MaxTrafoSize-Log2MinTrafoSize+1.

[0150] In the example of Table 15, use_default_scaling_list_flag does not need to be coded.

[0151] Meanwhile, information on whether quantization matrix information exists in the parameter set to be coded or whether it is to be updated can be coded into the parameter set and used for coding / decoding.

[0152] Table 16 outlines an example of syntax that can be used when encoding information regarding the presence or absence of quantization matrix information.

[0153] [Table 16]

[0154] In Table 16, the encoder can use the syntax element scaling_list_update_flag[SizeID][MatrixID] to identify whether quantization matrix information exists in the parameters to be coded.

[0155] For example, a value of scaling_list_update_flag[SizeID][MatrixID] of 1 may indicate that quantization matrix information corresponding to SizeID and MatrixID exists. Alternatively, a value of scaling_list_update_flag[SizeID][MatrixID] of 1 may indicate that previously coded quantization matrix information corresponding to SizeID and MatrixID should be updated to the quantization matrix information corresponding to SizeID and MatrixID in the parameter set to be coded. In this case, updating means changing the previously coded quantization matrix information to the quantization matrix information in the parameter set to be coded.

[0156] If the value of scaling_list_update_flag[SizeID][MatrixID] is 0, it can indicate that there is no quantization matrix information corresponding to SizeID and MatrixID, or it can indicate that the coding matrix information is not updated if the value of scaling_list_update_flag[SizeID][MatrixID] is 0.

[0157] If the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the parameter set does not contain quantization matrix information corresponding to SizeID and MatrixID, and the quantization matrix information was not coded, so the decoder does not know what quantization matrix information to use to perform inverse quantization on the quantized transform coefficient corresponding to SizeID and MatrixID. Therefore, if scaling_list_update_flag[SizeID][MatrixID] is 0, since there is no quantization matrix information corresponding to SizeID and MatrixID, the quantization matrix corresponding to SizeID and MatrixID means that the base matrix is ​​used, or that no quantization matrix is ​​used.

[0158] In the example of Table 16, scaling_list_update_flag[SizeID][MatrixID] is coded using SizeID and MatrixID, so when the value of scaling_list_update_flag[SizeID][MatrixID] is 1, the encoder can code at least one of the following information: quantization matrix, whether or not a base matrix can be used, and the type of predictive coding method.

[0159] If the value of scaling_list_update_flag[SizeID][MatrixID] is 0, at least one of the information on the quantization matrix, whether or not the base matrix can be used, and the type of predictive coding method is not coded. That is, scaling_list_update_flag[SizeID][MatrixID] is used to not code unnecessary quantization matrices.

[0160] Using only scaling_list_update_flag[SizeID][MatrixID] has the disadvantage that the encoder has little freedom in selecting quantization matrices, as it is not possible to mix base and non-base matrices according to the transformation size or quantization matrix type within a sequence, picture, or slice.

[0161] Therefore, the encoder can encode sid_mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information specifying whether or not a quantization matrix can be coded using SizeID and MatrixID and whether or not a base matrix can be used, into the parameter set.

[0162] For example, in the example of Table 16, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the quantization matrix corresponding to SizeID and MatrixID is not encoded, and the quantization matrix coefficient values ​​corresponding to SizeID and MatrixID may be determined to be the same as the base matrix coefficient values ​​predetermined in the encoder and / or decoder. If the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to SizeID and MatrixID is encoded, and the base matrix predetermined in the encoder and / or decoder is not used for the quantization matrix corresponding to SizeID and MatrixID.

[0163] In the example of Table 16, use_default_scaling_list_flag does not have to be coded.

[0164] In addition, the encoder can encode whether to encode a quantization matrix and whether to use a base matrix into a parameter set according to SizeID and MatrixID. In this way, the encoder can use scaling_list_update_flag[SizeID][MatrixID] in the encoding target parameters as information for indicating whether to update the quantization matrix information to the quantization matrix information corresponding to SizeID and MatrixID.

[0165] Table 17 outlines an example of a syntax structure that can be used when encoding quantization matrix information using SizeID and MatrixID, as described above.

[0166] [Table 17]

[0167] In the example of Table 17, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0 and the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to SizeID and MatrixID is encoded. The quantization matrix corresponding to the previously encoded SizeID and MatrixID is not updated to the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be encoded, and the quantization matrix corresponding to the previously encoded SizeID and MatrixID is used as is.

[0168] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0 and the value of scaling_list_update_flag[SizeID][MatrixID] is 1, the quantization matrix corresponding to SizeID and MatrixID is encoded, and the quantization matrix corresponding to the previously encoded SizeID and MatrixID is updated to the quantization matrix corresponding to SizeID and MatrixID in the parameters to be encoded.

[0169] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1 and the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the quantization matrix corresponding to SizeID and MatrixID is not coded, and the quantization matrix coefficient values ​​are determined to be the same as the base matrix coefficient values ​​predetermined in the encoder and / or decoder. The quantization matrix corresponding to the previously coded SizeID and MatrixID is not updated to the quantization matrix corresponding to the SizeID and MatrixID in the coding target parameters, and the encoder and decoder use the quantization matrix corresponding to the previously coded SizeID and MatrixID.

[0170] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1 and the value of scaling_list_update_flag[SizeID][MatrixID] is also 1, the quantization matrix corresponding to SizeID and MatrixID is not coded, and the quantization matrix coefficient values ​​are determined to be the same as the base matrix coefficient values ​​predetermined in the encoder and / or decoder. The quantization matrix corresponding to the previously coded SizeID and MatrixID is updated to the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be coded.

[0171] In the example of Table 17, use_default_scaling_list_flag does not need to be coded.

[0172] In addition, the encoder may determine the type of predictive coding method for the quantization matrix, and then encode information about the predictive coding method for the quantization matrix into the parameter set.

[0173] Tables 18 and 19 outline examples of syntax that can be applied when encoding a method for predictively encoding a quantization matrix into a parameter set.

[0174] [Table 18]

[0175] [Table 19]

[0176] As shown in the example of Table 18, the encoder may encode pred_mode_flag, which is information specifying a method for predictively encoding a quantization matrix, into the adaptation parameter set. scaling_list_pred_mode_flag, which will be described later in this specification, may be interpreted to have the same meaning as pred_mode_flag.

[0177] For example, in the example of Table 18, if the value of pred_mode_flag is 1, the encoder may encode the quantization matrix using DPCM (Differential Pulse Code Modulation) and Exponential-Golomb coding. If the value of pred_mode_flag is 0, the encoder may determine that the coefficient values ​​of the quantization matrix have the same values ​​as the coefficient values ​​of a previously encoded quantization matrix. In this case, the coefficient values ​​of the quantization matrix and the coefficient values ​​of the previously encoded quantization matrix are values ​​in different quantization matrices.

[0178] If the predictive coding method of the quantization matrix is ​​a method of determining the quantization matrix to be coded as the same as a previously coded quantization matrix, the encoder can code the reference quantization matrix identifier of the quantization matrix to be coded into the parameter set.

[0179] Therefore, as in the example of Table 18, the encoder can encode pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be encoded, into the adaptation parameter set.

[0180] The scaling_list_pred_matrix_id_delta described later in this specification can be interpreted as having the same meaning as pred_matrix_id_delta. In this case, the encoder and decoder can determine the value of RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be coded, using pred_matrix_id_delta and Equation 1.

[0181] [Number 1] RefMatrixID=MatrixID-(1+pred_matrix_id_delta)

[0182] When the predictive coding method of the quantization matrix is ​​a coding method using DPCM and Exponential-Golomb code, the encoder may code the difference value between the coefficient value of a previously coded quantization matrix and the coefficient value of the quantization matrix to be coded into the parameter set. In this case, the previously coded quantization matrix coefficient value is the coefficient value in the quantization matrix to be coded. That is, the previously coded quantization matrix coefficient value and the coefficient value of the quantization matrix to be coded are values ​​in the same quantization matrix.

[0183] Therefore, as shown in the example of Table 19, the encoder can encode delta_coef, which is a difference value between the coefficient values ​​of a previously encoded quantization matrix and the coefficient values ​​of the quantization matrix to be encoded, into the adaptive parameter set. delta_coef, which will be described later in this specification, can be interpreted as having the same meaning as scaling_list_delta_coef.

[0184] The encoder can use a mix of base and non-base quantization matrices within a sequence, picture, or slice using the following method, and can avoid unnecessary quantization matrix transmission.

[0185] If the predictive coding method of the quantization matrix is ​​a method of determining the same as a previously coded quantization matrix that the encoder already has (pred_mode_flag=0), the encoder can code whether or not to use the base matrix in the parameter set using the reference quantization matrix identifier of the quantization matrix to be coded.

[0186] For example, as shown in the example of Table 18, the encoder can encode pred_matrix_id_delta, which is a reference quantization matrix identifier of a quantization matrix to be encoded, into a parameter set. In this case, the encoder and decoder can determine RefMatrixID, which indicates the reference quantization matrix or base matrix of the quantization matrix to be encoded, using pred_matrix_id_delta and Equation 2, and determine whether to use the base matrix.

[0187] [Number 2] RefMatrixID=MatrixID-pred_matrix_id_delta

[0188] In Equation 2, if the RefMatrixID value is the same as the MatrixID value, the quantization matrix coefficient values ​​corresponding to SizeID and RefMatrixID are determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. In this case, the base matrix refers to the base matrix identified by SizeID and RefMatrixID.

[0189] Also, if the pred_matrix_id_delta value is 0, the RefMatrixID value and the MatrixID value will be the same. If the RefMatrixID value is not the same as the MatrixID value, the encoder may determine the quantization matrix corresponding to RefMatrixID as the reference quantization matrix for the quantization matrix to be coded. In this case, the encoder may determine that the coefficient values ​​of the quantization matrix to be coded are the same as the coefficient values ​​of the reference quantization matrix.

[0190] If the size of a quantization matrix corresponding to SizeID is included in the minimum and maximum sizes of transform units usable in the decoder, it can be determined whether to use a reference quantization matrix and a base matrix for the quantization matrix to be encoded using the above method. If the size of a quantization matrix corresponding to SizeID is not included in the range of the minimum and maximum sizes of transform units usable in the decoder, the encoding method for the quantization matrix corresponding to SizeID is not determined to be the same as that for the base matrix. The above determining process can be performed when encoding information regarding at least one of the quantization matrix, whether to use a base matrix, and the type of predictive encoding method, depending on SizeID and the difference between the maximum size of the transform unit and the minimum size of the transform unit.

[0191] After determining whether or not a quantization matrix is ​​to be used, the encoder can encode information regarding whether or not a quantization matrix is ​​to be used into a parameter set.

[0192] Table 20 shows an example of encoding information on whether or not a quantization matrix can be used in a parameter set.

[0193] [Table 20]

[0194] As shown in the example of Table 20, the encoder can encode scaling_list_enable_flag, which is information on whether a quantization matrix can be used, into the parameter set.

[0195] In the example of Table 20, if the value of scaling_list_enable_flag is 1, a quantization matrix such as a base matrix or a non-base matrix can be used in quantization / dequantization, and conversely, if the value of scaling_list_enable_flag is 0, no quantization matrix is ​​used in quantization / dequantization, or a quantization matrix with all coefficient values ​​being the same can be used. In this case, all coefficient values ​​are 16.

[0196] Furthermore, when the predictive coding method for the quantization matrix is ​​a coding method using DPCM and Exponential-Golomb code, the encoder may code the difference value between the coefficient values ​​of a previously coded quantization matrix and the coefficient values ​​of the quantization matrix to be coded into the parameter set. In this case, the coefficient values ​​of the previously coded quantization matrix are coefficient values ​​in the quantization matrix to be coded. That is, the coefficient values ​​of the previously coded quantization matrix and the coefficient values ​​of the quantization matrix to be coded are values ​​in the same quantization matrix.

[0197] Table 21 outlines an example of a syntax structure that can be used when encoding quantization matrix information using the difference value between the coefficient values ​​of a previously encoded quantization matrix and the coefficient values ​​of the quantization matrix to be encoded.

[0198] [Table 21]

[0199] In the example of Table 21, delta_coef, which is the difference value between the previously coded quantization matrix coefficient value and the current quantization matrix coefficient value to be coded, is coded into the parameter set.

[0200] In the example of Table 21, the coefficients of the quantization matrix can be calculated using Equation 3.

[0201] [Number 3] Nextcoef=(nextcoef+delta_coef+256)%256

[0202] If the quantization matrix coefficient value nextcoef calculated using Equation 3 is (1) the same as a specific value and (2) the first value of the quantization matrix, the coefficient value of the corresponding quantization matrix can be determined to be the same as the coefficient value of a base matrix predetermined in the encoder and / or decoder.

[0203] That is, if the value of nextcoef is (1) the same as a specific value and (2) the first value of a quantization matrix, the corresponding quantization matrix can be used as a base matrix.

[0204] In this case, the specific value is 0. The base matrix is ​​the base matrix corresponding to SizeID and MatrixID. Therefore, if the coefficient value nextcoef of the quantization matrix is ​​0 and corresponds to the first value of the quantization matrix, encoding of the quantization matrix difference value for the corresponding quantization matrix can be stopped.

[0205] When the predictive coding method of the quantization matrix is ​​a coding method using DPCM and Exponential-Golomb code, the encoder may code the difference value between the coefficient values ​​of a previously coded quantization matrix and the coefficient values ​​of the quantization matrix to be coded into the parameter set. In this case, the coefficient values ​​of the previously coded quantization matrix are coefficient values ​​in the quantization matrix to be coded. That is, the coefficient values ​​of the previously coded quantization matrix and the coefficient values ​​of the quantization matrix to be coded are values ​​in the same quantization matrix.

[0206] Table 22 shows a simple example of a syntax structure for the case where difference values ​​between coefficient values ​​of a previously coded quantization matrix and coefficient values ​​of a quantization matrix to be coded are used.

[0207] [Table 22]

[0208] In the example of Table 22, delta_coef, which is a difference between the coefficient values ​​of a previously coded quantization matrix and the coefficient values ​​of a current quantization matrix, is coded into a parameter set. In the example of Table 22, if the quantization matrix coefficient value nextcoef calculated using Equation 3 is the same as a specific value and is the first value of the quantization matrix, the coefficient value of the corresponding quantization matrix may be determined to be the same as the coefficient value of a base matrix predetermined in the encoder and / or decoder.

[0209] That is, if nextcoef is (1) equal to a specific value and (2) the first value of a quantization matrix, the corresponding quantization matrix can be used as a base matrix. In this case, the specific value is 0, and the quantization matrix coefficient values ​​calculated by Equation 3 are quantization matrix coefficient values ​​of 4x4 and 8x8 quantization matrix sizes or transform sizes.

[0210] Also, the first value of the quantization matrix may be a value that uses scaling_list_dc_coef_minus8, and the specific value may be a value that corresponds to scaling_list_dc_coef_minus8+8.

[0211] In this case, scaling_list_dc_coef_minus8 refers to the first value of a quantization matrix having a size of 16x16 or a quantization matrix having a size of 32x32. That is, scaling_list_dc_coef_minus8 refers to a coefficient value of a quantization matrix for a DC matrix coefficient, or refers to a DC matrix coefficient. In this specification, the DC matrix coefficient exists in a quantization matrix used during inverse quantization and refers to a quantization matrix coefficient for a DC transform coefficient in a transform block.

[0212] For example, scaling_list_dc_coef_minus8[sizeID-2][MatrixID] means the coefficient value of a quantization matrix for a DC coefficient in a 16x16 quantization matrix or transform when sizeID is 2. scaling_list_dc_coef_minus8[sizeID-2][MatrixID] means the coefficient value of a quantization matrix for a DC coefficient in a 32x32 quantization matrix or transform when sizeID is 3.

[0213] Also, the base matrix mentioned above refers to the base matrix corresponding to SizeID and MatrixID. As mentioned above, when the coefficient value nextcoef of the quantization matrix is ​​0 and is the first value of the quantization matrix, encoding of the quantization matrix difference value for the corresponding quantization matrix can be stopped.

[0214] By using this method, whether scaling_list_dc_coef_minus8, which is a coefficient value of the quantization matrix for the DC matrix coefficient, can be coded and whether a base matrix can be used can be coded differently depending on the size of the quantization matrix or the transformation size.

[0215] Meanwhile, the quantization matrix encoding / decoding method that determines whether to use a base matrix using coefficient values ​​of a quantization matrix has a drawback in that the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix increases.

[0216] Hereinafter, a method for determining whether to use a default matrix using an identifier (reference quantization matrix identifier) ​​for a reference quantization matrix in video encoding / decoding will be provided. Therefore, by using the following method, it is possible to reduce the computational complexity when encoding / decoding a quantization matrix.

[0217] Tables 23 and 24 briefly show an example of a syntax structure that can be applied when using an identifier for a reference quantization matrix.

[0218] [Table 23]

[0219] [Table 24]

[0220] First, the encoder can encode information indicating the presence or absence of a quantization matrix into the parameter set.

[0221] As shown in the example of Table 23, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if a quantization matrix does not exist and the quantization matrix is ​​determined to be the base quantization matrix, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0222] The encoder may determine a type of predictive coding method for a quantization matrix and encode information about the determined predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which information about the predictive coding method for the quantization matrix is ​​encoded is an adaptive parameter set.

[0223] As shown in the example of Table 23, the encoder may encode scaling_list_pred_mode_flag, which is information specifying a predictive encoding method for a quantization matrix, into a parameter set. For example, when scanning a quantization matrix and encoding it using DPCM and Exponential-Golomb coding to predictively encode the coefficients of the quantization matrix, the encoder encodes the value of scaling_list_pred_mode_flag to 1. Furthermore, when determining that the reference quantization matrix and the quantization matrix to be encoded have the same value for inter-quantization matrix prediction, or when determining that the coefficient values ​​of the quantization matrix to be encoded are the same as the base matrix coefficient values, the encoder may encode the value of scaling_list_pred_mode_flag to 0.

[0224] Here, determining to have the same value means using a quantization matrix prediction method that copies coefficient values ​​of a specific quantization matrix to coefficient values ​​of a quantization matrix to be encoded.

[0225] When the predictive coding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix or a base matrix in inter-quantization matrix prediction, the encoder may encode a reference quantization matrix identifier of a quantization matrix to be coded and whether or not the base matrix can be used in a parameter set. In this case, the parameter set is an adaptive parameter set.

[0226] As in the example of Table 23, if the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, or if the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the base matrix coefficient values, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be coded, into the parameter set.

[0227] In this case, the encoder can determine the value of scaling_list_pred_matrix_id_delta, which is a quantization matrix identifier, using matrixID indicating the quantization matrix to be coded, RefMatrixID indicating the reference quantization matrix or base matrix, and Equation 4.

[0228] [Number 4] scaling_list_pred_matrix_id_delta=matrixID-RefMatrixID

[0229] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of a base matrix predetermined by the encoder and / or decoder, the encoder codes the value of scaling_list_pred_matrix_id_delta to 0, and the RefMatrixID value and the matrixID value become the same. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0230] When determining that the quantization matrix coefficient values ​​to be coded are the same as the reference quantization matrix coefficient values ​​(i.e., when determining that the quantization matrix coefficient values ​​are the same as the previously coded quantization matrix coefficient values), the encoder may make the RefMatrixID value and the matrixID value different from each other by coding the scaling_list_pred_matrix_id_delta value to a value other than 0. In this case, the scaling_list_pred_matrix_id_delta value is a positive integer value.

[0231] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of a quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0232] As in the example of Table 24, when the size of the quantization matrix to be coded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can code the DC matrix coefficient scaling_list_dc_coef_minus8 into the parameter set.

[0233] As shown in the example of Table 24, the encoder may encode scaling_list_delta_coef, which is a difference value between the coefficient values ​​of a quantization matrix previously encoded within the quantization matrix and the coefficient values ​​of the quantization matrix to be encoded, into a parameter set. Tables 23 and 24 illustrate the case where quantization matrix information is encoded into an adaptive parameter set, but the present invention is not limited thereto, and the encoder may also encode quantization matrix information into other parameter sets (parameter sets including at least one of a sequence parameter set and a picture parameter set).

[0234] As described above, the conventional quantization matrix encoding / decoding has a drawback in that unnecessary information is encoded / decoded when predicting a quantization matrix, resulting in a decrease in encoding efficiency.

[0235] In the present invention, quantization matrix encoding / decoding is performed differently depending on whether a reference quantization matrix exists, thereby improving coding efficiency during quantization matrix encoding / decoding.

[0236] Tables 25 and 26 briefly show an example of a syntax structure that can be applied when quantization matrix encoding / decoding is performed differently depending on whether a reference quantization matrix exists.

[0237] [Table 25]

[0238] [Table 26]

[0239] First, the encoder can encode information indicating the presence or absence of a quantization matrix into the parameter set.

[0240] As shown in the example of Table 25, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0241] After determining the type of predictive coding method of the quantization matrix, the encoder may encode predictive coding method information of the quantization matrix into a parameter set if matrixID is greater than 0. In this case, the parameter set into which the predictive coding method information of the quantization matrix is ​​encoded is an adaptive parameter set.

[0242] As shown in the example of Table 25, the encoder can encode scaling_list_pred_mode_flag, which is information specifying a predictive coding method for a quantization matrix, into a parameter set only if matrixID is greater than 0. When scanning a quantization matrix and encoding it using DPCM and Exponential-Golomb coding to predictively encode coefficients in the quantization matrix, the encoder encodes the value of scaling_list_pred_mode_flag to 1. Furthermore, when determining that a reference quantization matrix and a target quantization matrix have the same value for inter-quantization matrix prediction, the encoder encodes the value of scaling_list_pred_mode_flag to 0. In this case, determining that they have the same value means using a quantization matrix prediction method that copies reference quantization matrix coefficient values ​​to target quantization matrix coefficient values.

[0243] If matrixID is 0, as in the example of Table 23, the value of scaling_list_pred_mode_flag is TRUE, and the encoder can scan the quantization matrix and encode it with DPCM and Exponential-Golomb code without encoding scaling_list_pred_mode_flag.

[0244] If the predictive coding method of a quantization matrix is ​​a method of determining the same as a reference quantization matrix for inter-quantization matrix prediction and matrixID is greater than 0, the encoder can encode the reference quantization matrix identifier of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the reference quantization matrix identifier is coded is an adaptive parameter set.

[0245] As in the example of Table 25, when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be coded, into the parameter set only if matrixID is greater than 0. In this case, the encoder and decoder can determine the value of scaling_list_pred_matrix_id_delta, which is the quantization matrix identifier, using matrixID indicating the quantization matrix to be coded, RefMatrixID indicating the reference quantization matrix, and Equation 5.

[0246] [Number 5] scaling_list_pred_matrix_id_delta=matrixID-(RefMatrixID+1)

[0247] If the value of matrixID is 0, it indicates the first quantization matrix for each sizeID. Since quantization matrix prediction is only possible from previously coded quantization matrices with the same sizeID, there is no reference quantization matrix with the same sizeID value for the first quantization matrix for each sizeID. Therefore, quantization matrix prediction by matrix duplication cannot be performed. Ultimately, only when matrixID is greater than 0 can the encoder determine RefMatrixID by coding the reference quantization matrix identifier scaling_list_pred_matrix_id_delta, and determine that the coefficient values ​​of the quantization matrix to be coded are the same as the reference quantization matrix coefficient values.

[0248] Determining the coefficient values ​​of a quantization matrix to be encoded to be the same as the coefficient values ​​of a reference quantization matrix means a quantization matrix prediction method in which the reference quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be encoded, and the coefficient values ​​of the reference quantization matrix are copied to the coefficient values ​​of the quantization matrix to be encoded.

[0249] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of a quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0250] As in the example of Table 26, when the size of the quantization matrix to be coded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can code scaling_list_dc_coef_minus8, which is a DC matrix coefficient, into the parameter set.

[0251] As in the example of Table 26, the encoder can encode scaling_list_delta_coef, which is the difference value between the coefficient value of a quantization matrix previously encoded within the quantization matrix and the coefficient value of the quantization matrix to be encoded, into the parameter set.

[0252] In addition, the encoder can encode whether or not to use the base matrix by using scaling_list_dc_coef_minus8 or scaling_list_delta_coef used in calculating nextCoef. That is, the encoder can instruct the decoder to use the base matrix by encoding the value of scaling_list_dc_coef_minus8 to -8, and can instruct the decoder to use the base matrix by encoding scaling_list_delta_coef so that the first nextCoef value becomes 0.

[0253] Meanwhile, the quantization matrix encoding / decoding method that determines whether to use a base matrix using the coefficient values ​​of the quantization matrix has the disadvantages of increasing the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix, and also of reducing the coding efficiency because unnecessary information is encoded / decoded during quantization matrix prediction.

[0254] In the present invention, whether or not to use a base matrix is ​​determined using an identifier of a reference quantization matrix in video encoding / decoding, thereby reducing computational complexity when encoding / decoding a quantization matrix. Also, in the present invention, encoding / decoding of a quantization matrix is ​​performed differently depending on whether or not a reference quantization matrix is ​​present, thereby improving coding efficiency when encoding / decoding a quantization matrix.

[0255] Tables 27 and 28 briefly show an example of a syntax structure that can be applied when using an identifier for a reference quantization matrix.

[0256] [Table 27]

[0257] [Table 28]

[0258] The encoder can first encode information indicating the presence or absence of a quantization matrix into a parameter set.

[0259] As shown in the example of Table 27, the encoder can encode scaling_list_present_flag, which is information specifying whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0260] After determining the type of predictive coding method for the quantization matrix, the encoder may encode information about the predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which information about the predictive coding method is encoded is an adaptive parameter set.

[0261] As shown in the example of Table 27, the encoder may code scaling_list_pred_mode_flag, which is information regarding a predictive coding method for a quantization matrix, into a parameter set. For example, when scanning a quantization matrix and encoding it using DPCM and Exponential-Golomb coding to predictively encode coefficients in the quantization matrix, the encoder may code the value of scaling_list_pred_mode_flag to 1. For inter-quantization matrix prediction, when determining that the reference quantization matrix and the quantization matrix to be encoded have the same value or when determining that the coefficient values ​​of the quantization matrix to be encoded are the same as the coefficient values ​​of the base matrix, the encoder may code the value of scaling_list_pred_mode_flag to 0. In this case, determining that they have the same value means using a quantization matrix prediction method in which coefficient values ​​of a specific quantization matrix are copied to coefficient values ​​of the quantization matrix to be encoded.

[0262] When the predictive coding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix or a base matrix for inter-quantization matrix prediction and matrixID is greater than 0, the encoder can encode the reference quantization matrix identifier of the quantization matrix to be coded and whether the base matrix can be used in a parameter set. In this case, the parameter set that codes the reference quantization matrix identifier and whether the base matrix can be used is an adaptive parameter set.

[0263] As in the example of Table 27, if the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, or if the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the base matrix, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier for the quantization matrix to be coded, into the parameter set only if matrixID is greater than 0.

[0264] In this case, the encoder may determine scaling_list_pred_matrix_id_delta, which is a quantization matrix identifier, using matrixID indicating a quantization matrix to be coded, RefMatrixID indicating a reference quantization matrix or a base matrix, and Equation 6.

[0265] [Number 6] scaling_list_pred_matrix_id_delta=matrixID-RefMatrixID

[0266] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of a base matrix predetermined by the encoder and / or decoder, the encoder may code the value of scaling_list_pred_matrix_id_delta to 0 and make the RefMatrixID value and the matrixID value the same. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0267] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the reference quantization matrix coefficient values, the encoder can make the RefMatrixID value and matrixID value different from each other by coding the scaling_list_pred_matrix_id_delta value to a non-zero value.

[0268] Also, if the value of scaling_list_pred_mode_flag is 0, the predictive coding method of the quantization matrix indicates a method of determining the quantization matrix to be the same as the reference quantization matrix or base matrix. In this case, quantization matrix prediction is possible from a previously coded quantization matrix or base matrix having the same sizeID.

[0269] When matrixID is 0, it means the first quantization matrix for each sizeID, so when scaling_list_pred_mode_flag is 0 and matrixID is 0, there is no reference quantization matrix with the same sizeID value for the first quantization matrix for each sizeID. Therefore, quantization matrix prediction using a method such as matrix duplication cannot be performed for the first quantization matrix for each sizeID.

[0270] In this case, the encoder may not encode scaling_list_pred_matrix_id_delta and may infer the value of scaling_list_pred_matrix_id_delta to be 0. When the value of scaling_list_pred_matrix_id_delta is 0, the RefMatrixID value is the same as the matrixID value, so the coefficient values ​​of the quantization matrix to be encoded corresponding to sizeID and matrixID may be determined to be the same as the base matrix coefficient values ​​predetermined by the encoder and / or decoder. Here, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0271] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of a quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0272] As in the example of Table 28, when the size of the quantization matrix to be coded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can code scaling_list_dc_coef_minus8, which is a DC matrix coefficient, into the parameter set.

[0273] The scaling_list_delta_coef, which is the difference value between the coefficient value of a previously coded quantization matrix and the coefficient value of the current quantization matrix, can be coded into a parameter set as in the example of Table 28.

[0274] In conventional quantization matrix encoding / decoding, when transmitting a quantization matrix, the overall coefficients in the matrix and the DC matrix coefficients are encoded / decoded, and predictive encoding / decoding is not performed on the DC matrix coefficients, so there is a limit to improving the encoding efficiency.

[0275] Alternatively, predictive coding / decoding of DC matrix coefficients in a quantization matrix can improve coding efficiency.

[0276] Here, the present invention provides a method for predicting DC matrix coefficients from surrounding AC coefficients by utilizing the high correlation between surrounding coefficients, rather than predicting DC matrix coefficients from a constant 8. As a result, the present invention can improve coding efficiency.

[0277] Tables 29 and 30 briefly show an example of a syntax structure that is applied when predicting DC matrix coefficients using the correlation between peripheral coefficients.

[0278] [Table 29]

[0279] [Table 30]

[0280] In the embodiment shown in Tables 29 and 30, the encoding / decoding order of the quantization matrices and the restoration order of the quantization matrices are the same. Therefore, it is possible to save memory space for storing DC matrix coefficients. Also, in the embodiment shown in Tables 29 and 30, when specifying whether or not to use a base matrix, only the syntax element scaling_list_delta_coef can be used without using multiple syntax elements.

[0281] The encoder can first encode information indicating the presence or absence of a quantization matrix into a parameter set.

[0282] As shown in the example of Table 28, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be the base quantization matrix, the encoder can encode the value of scaling_list_present_flag to 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag to 1.

[0283] After determining the type of predictive coding method for the quantization matrix, the encoder may encode information about the predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which the predictive coding method is encoded is an adaptive parameter set.

[0284] As shown in the example of Table 29, scaling_list_pred_mode_flag, which is predictive coding method information for a quantization matrix, can be coded into a parameter set. For example, when scanning a quantization matrix and coding it using DPCM and Exponential-Golomb coding to predictively code coefficients in the quantization matrix, the encoder can code the value of scaling_list_pred_mode_flag to 1. When it is determined that the reference quantization matrix and the quantization matrix to be coded have the same value for inter-quantization matrix prediction, the encoder can code the value of scaling_list_pred_mode_flag to 0. In this case, determining that they have the same value means using a quantization matrix prediction method that copies coefficient values ​​of a reference quantization matrix to coefficient values ​​of a quantization matrix to be coded.

[0285] When the predictive coding method of the quantization matrix is ​​a method of determining a quantization matrix identical to a reference quantization matrix for inter-quantization matrix prediction, the encoder may encode the reference quantization matrix identifier of the quantization matrix to be coded into a parameter set. In this case, the parameter set for coding the reference quantization matrix identifier is an adaptive parameter set.

[0286] As in the example of Table 29, when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be coded, into the parameter set. In this case, the encoder can determine scaling_list_pred_matrix_id_delta, which is the quantization matrix identifier, by using matrixID, which indicates the quantization matrix to be coded, RefMatrixID, which indicates the reference quantization matrix, and the following Equation 7.

[0287] [Number 7] scaling_list_pred_matrix_id_delta=matrixID-(RefMatrixID+1)

[0288] Determining the coefficient values ​​of the quantization matrix to be encoded to be the same as the coefficient values ​​of the reference quantization matrix means using a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be encoded and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be encoded.

[0289] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code a difference value between the coefficient values ​​of a quantization matrix previously coded in the quantization matrix and the coefficient values ​​of the quantization matrix to be coded into a parameter set. In this case, the parameter set for coding the difference value is an adaptive parameter set.

[0290] As in the example of Table 30, the encoder can encode scaling_list_delta_coef, which is the difference value between a previously encoded quantization matrix coefficient value in the quantization matrix and the quantization matrix coefficient value to be encoded, into the parameter set.

[0291] In this case, the encoder can encode whether or not to use the base matrix by using scaling_list_delta_coef used in calculating nextCoef. For example, the encoder can instruct the decoder to use the base matrix by encoding scaling_list_delta_coef so that the value of the first nextCoef is 0.

[0292] The encoder may encode scaling_list_dc_coef_res, which is a difference value of quantization matrix coefficient values ​​corresponding to DC matrix coefficients, into a parameter set as shown in the example of Table 30. In this case, scaling_list_dc_coef_res may be encoded when the size of the quantization matrix to be encoded is a 16x16 (sizeID=2) or 32x32 (sizeID=3) quantization matrix and when a base matrix is ​​not used (useDefaultScalingMatrixFlag=0).

[0293] In the example of Table 30, the value of scaling_list_dc_coef_res for a 16x16 or 32x32 quantization matrix that separately encodes the coefficients of the DC matrix can be calculated using the difference between the DC matrix coefficient value and the matrix coefficient present at the DC position.

[0294] Meanwhile, the quantization matrix encoding / decoding method that determines whether to use a base matrix using the coefficient values ​​of the quantization matrix has a drawback in that it increases the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix. Also, in the conventional method, when transmitting a quantization matrix, all coefficients in the matrix and DC matrix coefficients are encoded / decoded, and at this time, predictive encoding / decoding is not performed on the DC matrix coefficients, which limits the improvement of coding efficiency.

[0295] In the present invention, whether or not to use a base matrix is ​​determined using an identifier of a reference quantization matrix in video encoding / decoding. Therefore, it is possible to reduce computational complexity when encoding / decoding a quantization matrix. In addition, in the present invention, predictive encoding / decoding is performed on DC matrix coefficients in a quantization matrix, thereby improving coding efficiency. In addition, DC matrix coefficients are predicted from surrounding AC coefficients using high correlation between surrounding coefficients rather than from a constant 8, thereby improving coding efficiency.

[0296] Tables 31 and 32 outline an example of a syntax structure that can be used when all of the above features are applied.

[0297] [Table 31]

[0298] [Table 32]

[0299] In the embodiments of Tables 31 and 32, the encoding / decoding order of the quantization matrices and the restoration order of the quantization matrices are matched. Therefore, it is possible to save memory space for storing DC matrix coefficients. Also, in the embodiments of Tables 31 and 32, when specifying whether or not to use a base matrix, only the syntax element scaling_list_delta_coef can be used without using multiple syntax elements.

[0300] First, the encoder can encode information indicating the presence or absence of a quantization matrix into the parameter set.

[0301] As shown in the example of Table 31, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0302] After determining the type of predictive coding method for the quantization matrix, the encoder may encode information about the predictive coding method for the quantization matrix into a parameter set, where the parameter set for encoding the predictive coding method is an adaptive parameter set.

[0303] As shown in the example of Table 31, the encoder may encode scaling_list_pred_mode_flag, which is information specifying a predictive encoding method for a quantization matrix, into a parameter set. For example, when scanning a quantization matrix and encoding it using DPCM and Exponential-Golomb coding to predictively encode coefficients in the quantization matrix, the encoder encodes the value of scaling_list_pred_mode_flag as 1. Furthermore, when determining that the reference quantization matrix and the quantization matrix to be encoded have the same value for inter-quantization matrix prediction, or when determining that the coefficient values ​​of the quantization matrix to be encoded are the same as the coefficient values ​​of the base matrix, the encoder encodes the value of scaling_list_pred_mode_flag as 0. In this case, determining that the reference quantization matrix and the quantization matrix to be encoded have the same value means applying a quantization matrix prediction method that copies the coefficient values ​​of a specific quantization matrix to the coefficient values ​​of the quantization matrix to be encoded.

[0304] When the predictive coding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix or a base matrix for inter-quantization matrix prediction, the encoder may encode a reference quantization matrix identifier of a quantization matrix to be coded and whether or not the base matrix can be used in a parameter set. In this case, the parameter set used for coding is an adaptive parameter set.

[0305] As in the example of Table 31, if the quantization matrix coefficient values ​​to be coded are determined to be the same as the reference quantization matrix coefficient values, or if the quantization matrix coefficient values ​​to be coded are determined to be the same as the base matrix coefficient values, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be coded, into the parameter set.

[0306] In this case, the encoder and decoder can determine the value of scaling_list_pred_matrix_id_delta, which is a quantization matrix identifier, using matrixID, which indicates the quantization matrix to be encoded, RefMatrixID, which indicates the reference quantization matrix or base matrix, and Equation 8.

[0307] [Number 8] scaling_list_pred_matrix_id_delta=matrixID-RefMatrixID

[0308] If the quantization matrix coefficient values ​​to be coded are determined to be equal to the base matrix coefficient values ​​predetermined by the encoder and / or decoder, the encoder may code the value of scaling_list_pred_matrix_id_delta to 0, and make the RefMatrixID value and the matrixID value equal. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0309] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the reference quantization matrix coefficient values, the encoder can make the RefMatrixID value and matrixID value different from each other by coding the value of scaling_list_pred_matrix_id_delta to a non-zero value.

[0310] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of a quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0311] As in the example of Table 32, scaling_list_delta_coef, which is the difference value between the quantization matrix coefficient value previously coded in the quantization matrix and the quantization matrix coefficient value to be coded, can be coded in the parameter set.

[0312] The encoder may encode scaling_list_dc_coef_res, which is a difference value of coefficient values ​​of a quantization matrix corresponding to the coefficients of a DC matrix, into a parameter set, as in the example of Table 32. In this case, scaling_list_dc_coef_res may be encoded when the size of the quantization matrix to be encoded is 16x16 (sizeID=2) or 32x32 (sizeID=3) and when a base matrix is ​​not used (useDefaultScalingMatrixFlag=0).

[0313] The scaling_list_dc_coef_res value for a 16x16 quantization matrix or a 32x32 quantization matrix that separately encodes DC matrix coefficients can be calculated using the difference between the DC matrix coefficient value and the matrix coefficients present at the DC position.

[0314] Meanwhile, in conventional quantization matrix encoding / decoding, the quantization matrix is ​​copied using the size of the quantization matrix when quantizing and inverse quantization, rather than the size of the quantization matrix when encoding / decoding, so the quantization matrix is ​​copied from a limited number of quantization matrices, which means that there is a limit to the improvement of coding efficiency when encoding / decoding the quantization matrix.

[0315] In the present invention, quantization matrix prediction is performed from a quantization matrix that is the same size as the quantization matrix when encoding / decoding, thereby improving coding efficiency and increasing the degree of freedom in quantization matrix prediction.

[0316] Tables 33 and 34 show an example of a syntax structure that can be used when predicting a quantization matrix from a quantization matrix that has the same size as the quantization matrix used for encoding / decoding.

[0317] [Table 33]

[0318] [Table 34]

[0319] The encoder can first encode information indicating the presence or absence of a quantization matrix into a parameter set.

[0320] As in the example of Table 33 or Table 34, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0321] After determining the type of predictive coding method for the quantization matrix, the encoder may code information about the predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which the predictive coding method is coded is an adaptive parameter set. For example, the encoder may code scaling_list_pred_mode_flag, which is information about the predictive coding method for the quantization matrix, into the parameter set, as shown in Table 33 or Table 34. As a specific example, when scanning a quantization matrix and coding it using DPCM and Exponential-Golomb coding to predictively code coefficients in the quantization matrix, the encoder may code the value of scaling_list_pred_mode_flag to 1. When determining that a reference quantization matrix and a target quantization matrix have the same value for inter-quantization matrix prediction, the encoder may code the value of scaling_list_pred_mode_flag to 0. In this case, determining that the reference quantization matrix and a target quantization matrix have the same value means using a quantization matrix prediction method in which coefficient values ​​of a reference quantization matrix are copied to coefficient values ​​of a target quantization matrix.

[0322] Furthermore, when the predictive coding method of a quantization matrix is ​​a method of determining a reference quantization matrix and a quantization matrix to be the same for inter-quantization matrix prediction, the encoder can code a reference quantization matrix identifier of a quantization matrix to be coded into a parameter set. At this time, at least one of information specifying the size of a reference quantization matrix of a quantization matrix to be coded and information specifying a reference quantization matrix can be coded into the parameter set as identification information (identifier) ​​of the reference quantization matrix. The parameter set in which the identifier or identification information is coded is an adaptive parameter set.

[0323] For example, as in the example of Table 33, when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, the encoder may code scaling_list_pred_size_matrix_id_delta, which is identification information for the reference quantization matrix of the quantization matrix to be coded, into the parameter set. In this case, the value of scaling_list_pred_size_matrix_id_delta, which is identification information for the quantization matrix, may be determined using RefSizeID, which is the size of the reference quantization matrix of the quantization matrix to be coded, RefMatrixID, which indicates the reference quantization matrix, and Equation 9.

[0324] [Number 9] scaling_list_pred_size_matrix_id_delta=6*(RefSizeID-sizeID)+(RefMatrixID%6)

[0325] As another example, when the coefficient values ​​of a quantization matrix to be coded are determined to be the same as the coefficient values ​​of a reference quantization matrix as in the example of Table 34, the encoder may encode scaling_list_pred_size_id_delta and scaling_list_pred_size_matrix_id_delta, which are identification information for the reference quantization matrix of the quantization matrix to be coded, into the parameter set. In this case, the value of scaling_list_pred_size_id_delta may be determined using RefSizeID and Equation 10, and the value of scaling_list_pred_matrix_id_delta may be determined using RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be coded, and Equation 11.

[0326] [Number 10] scaling_list_pred_size_id_delta=sizeID-RefSizeID

[0327] [Number 11] scaling_list_pred_matrix_id_delta=matrixID-RefMatrixID

[0328] Determining the coefficient values ​​of the quantization matrix to be encoded to be the same as the coefficient values ​​of the reference quantization matrix means using a quantization matrix prediction method in which the reference quantization matrix corresponding to RefSizeID and RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be encoded, and the coefficient values ​​of the reference quantization matrix are copied to the coefficient values ​​of the quantization matrix to be encoded.

[0329] Therefore, through the examples of Table 33 or Table 34, it is not only possible to predict a quantization matrix from a quantization matrix with the same size ID, but also possible to predict a quantization matrix from a quantization matrix with the same matrix size but a different size ID during encoding / decoding.

[0330] Furthermore, in the example of Table 33 or the example of Table 34, the value range of a syntax element may be limited to a specific value. For example, in the example of Table 33 or Table 34, scaling_list_pred_size_matrix_id_delta may have a value of 0 to 17, scaling_list_pred_size_id_delta may have a value of 0 to 2, and scaling_list_pred_matrix_id_delta may have a value of 0 to 5.

[0331] Also, in the embodiments of Table 33 or Table 34, the encoder may not perform quantization matrix prediction from quantization matrices that have a larger magnitude than the quantization matrix to be encoded.

[0332] Furthermore, DC matrix coefficients and AC matrix coefficients may be predicted separately depending on the size of the quantization matrix. For example, for a quantization matrix having an 8x8 size, DC matrix coefficients and AC matrix coefficients may be predicted separately, and for quantization matrices of other sizes, DC matrix coefficients and AC matrix coefficients may be predicted together. That is, when performing prediction from a quantization matrix having an 8x8 size, the encoder may determine a value corresponding to a DC matrix coefficient position in the 8x8 size quantization matrix as a DC matrix coefficient of the matrix to be coded and predict the value at the corresponding position. When performing prediction from a quantization matrix having a 16x16 or 32x32 size, the encoder may also predict the DC matrix coefficient of the quantization matrix.

[0333] Meanwhile, when the predictive coding method of the quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code the coefficients in the quantization matrix, the difference value between the quantization matrix coefficient value previously coded in the quantization matrix and the quantization matrix coefficient value to be coded can be coded into a parameter set. In this case, the parameter set is an adaptive parameter set.

[0334] Table 35 shows an example of a syntax structure that can be applied when predicting coefficients in a quantization matrix using quantization matrix coefficient values ​​previously coded in the quantization matrix.

[0335] [Table 35]

[0336] As in the example of Table 35, when the size of the quantization matrix to be coded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can code scaling_list_dc_coef_minus8, which is coefficient information of the DC matrix, into the parameter set.

[0337] As in the example of Table 35, the encoder can encode scaling_list_delta_coef, which is the difference value between the coefficient value of a quantization matrix previously encoded within the quantization matrix and the coefficient value of the quantization matrix to be encoded, into the parameter set.

[0338] In addition, the encoder may encode information indicating whether to use a base matrix by using scaling_list_delta_coef, which is used to derive the value of scaling_list_dc_coef_minus8 or nextCoef. For example, the encoder may instruct the decoder to use a base matrix by encoding the value of scaling_list_dc_coef_minus8 to -8, and may instruct the decoder to use a base matrix by encoding scaling_list_delta_coef so that the first nextCoef value is 0.

[0339] That is, a quantization matrix encoding / decoding method that determines whether to use a base matrix using coefficient values ​​of a quantization matrix has a drawback in that it increases the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix. Also, it has a drawback in that it reduces coding efficiency because unnecessary information is encoded / decoded during quantization matrix prediction. Furthermore, it performs quantization matrix copying using the size of the quantization matrix during quantization and inverse quantization, rather than the size of the quantization matrix during encoding / decoding. Since a quantization matrix is ​​copied from a limited number of quantization matrices, there is a limit to improving coding efficiency during quantization matrix encoding / decoding.

[0340] In the present invention, whether or not to use a base matrix can be determined using an identifier of a reference quantization matrix in video encoding / decoding. Therefore, it is possible to reduce the computational complexity when encoding / decoding a quantization matrix. Furthermore, since quantization matrix prediction is performed from a quantization matrix that has the same size as the quantization matrix during encoding / decoding, it is possible to improve coding efficiency and increase the degree of freedom in predicting a quantization matrix.

[0341] Tables 36 and 37 briefly show an example of a syntax structure that can be applied when prediction is performed using a quantization matrix of the same size during encoding / decoding using an identifier of a reference quantization matrix.

[0342] [Table 36]

[0343] [Table 37]

[0344] The encoder can first encode information indicating the presence or absence of a quantization matrix into a parameter set.

[0345] As in the example of Table 36 or Table 37, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder encodes the value of scaling_list_present_flag to 0, and if an encoded quantization matrix exists, the encoder encodes the value of scaling_list_present_flag to 1.

[0346] After determining the type of predictive coding method for the quantization matrix, the encoder may encode information about the predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which information about the predictive coding method is encoded is an adaptive parameter set.

[0347] As shown in the examples of Table 36 or Table 37, the encoder may code scaling_list_pred_mode_flag, which is information specifying a predictive coding method for a quantization matrix, into a parameter set. For example, when scanning a quantization matrix and encoding it using DPCM and Exponential-Golomb coding to predictively encode coefficients in the quantization matrix, the encoder may code the value of scaling_list_pred_mode_flag to 1. Furthermore, when determining that the reference quantization matrix and the quantization matrix to be encoded have the same value for prediction between quantization matrices, or when determining that the coefficient values ​​of the quantization matrix to be encoded are the same as those of the base matrix, the encoder may code the value of scaling_list_pred_mode_flag to 0. Determining that the coefficient values ​​of a specific quantization matrix have the same value means using a quantization matrix prediction method that copies the coefficient values ​​of a specific quantization matrix to the coefficient values ​​of the quantization matrix to be encoded.

[0348] When the predictive coding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix or a base matrix for inter-quantization matrix prediction, the encoder can code a reference quantization matrix identifier of a quantization matrix to be coded into a parameter set. At this time, at least one of information specifying the size of the reference quantization matrix of the quantization matrix to be coded and information specifying the reference quantization matrix can be coded into the parameter set as identification information (identifier) ​​of the reference quantization matrix. The parameter set in which the identifier or identification information is coded is an adaptive parameter set.

[0349] For example, as in the example of Table 36, when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as those of the reference quantization matrix, or when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as those of the base matrix, the encoder can encode scaling_list_pred_size_matrix_id_delta, which is information identifying the reference quantization matrix of the quantization matrix to be coded, into the parameter set. In this case, the encoder can determine scaling_list_pred_size_matrix_id_delta, which is identification information of the quantization matrix, using RefSizeID, RefMatrixID indicating the reference quantization matrix or the base matrix, and Equation 12.

[0350] [Number 12] scaling_list_pred_size_matrix_id_delta=6*(RefSizeID-sizeID)+(RefMatrixID%6)

[0351] As another example, when the coefficient values ​​of a quantization matrix to be coded are determined to be the same as those of a reference quantization matrix or when the coefficient values ​​of a quantization matrix to be coded are determined to be the same as those of a base matrix as shown in Table 37, the encoder may encode scaling_list_pred_size_id_delta and scaling_list_pred_size_matrix_id_delta, which are identification information for the reference quantization matrix of the quantization matrix to be coded, into the parameter set. In this case, the encoder may derive the value of scaling_list_pred_size_id_delta using RefSizeID and Equation 13, and may derive the value of scaling_list_pred_matrix_id_delta using RefMatrixID indicating the reference quantization matrix or base matrix of the quantization matrix to be coded and Equation 14.

[0352] [Number 13] scaling_list_pred_size_id_delta=sizeID-RefSizeID

[0353] [Number 14] scaling_list_pred_matrix_id_delta=matrixID-RefMatrixID

[0354] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the base matrix coefficient values ​​predetermined by the encoder and / or decoder, the encoder may code the value of scaling_list_pred_matrix_id_delta to 0, and make the RefMatrixID value and the matrixID value the same. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0355] If the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, the encoder can make the RefMatrixID value and matrixID value different from each other by coding the value of scaling_list_pred_matrix_id_delta to a value other than 0.

[0356] Therefore, through the examples of Table 36 or Table 37, it is possible not only to predict a quantization matrix from a quantization matrix having the same sizeID, but also to predict a quantization matrix from a quantization matrix having the same matrix size but a different sizeID during encoding / decoding.

[0357] Also, in the example of Table 36 or Table 37, the range of values ​​of scaling_list_pred_size_matrix_id_delta, scaling_list_pred_size_id_delta, and scaling_list_pred_matrix_id_delta can be restricted. For example, scaling_list_pred_size_matrix_id_delta can have a value of 0 to 17, scaling_list_pred_size_id_delta can have a value of 0 to 2, and scaling_list_pred_matrix_id_delta can have a value of 0 to 5.

[0358] Furthermore, it is also possible to prevent quantization matrix prediction from being performed from a quantization matrix having a size larger than the quantization matrix to be coded.

[0359] In predicting a quantization matrix, the prediction method may be different depending on the size of the matrix. For example, when predicting from a quantization matrix having a size of 8×8, the encoder determines a value corresponding to a DC coefficient position in the quantization matrix having a size of 8×8 as a DC matrix coefficient and predicts the value at the corresponding position. When predicting from a quantization matrix having a size of 16×16 or 32×32, the encoder can also predict the DC matrix coefficient.

[0360] Meanwhile, when the predictive coding method of the quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code the coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of the quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0361] Table 38 shows an example of a syntax structure that can be applied when predicting coefficients in a quantization matrix using quantization matrix coefficient values ​​previously coded in the quantization matrix.

[0362] [Table 38]

[0363] As in the example of Table 38, when the size of the quantization matrix to be encoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can encode scaling_list_dc_coef_minus8, which is information that identifies the coefficients of the DC matrix, into the parameter set.

[0364] The encoder may also encode scaling_list_delta_coef, which is the difference value between the coefficient value of a previously encoded quantization matrix and the coefficient value of the quantization matrix to be encoded, into the parameter set, as in the example of Table 38.

[0365] In conventional quantization matrix encoding / decoding, quantization matrix coefficients are encoded without considering coefficient values ​​that often occur when encoding / decoding the first coefficient in the quantization matrix. Therefore, in the case of conventional quantization matrix encoding / decoding, there is a limit to the improvement in coding efficiency.

[0366] In the present invention, predictive encoding / decoding of the first coefficient in a quantization matrix can be performed using frequently occurring coefficient values. Also, in the present invention, if the first coefficient value or DC matrix coefficient value of a base matrix is ​​defined as 16, or if the first coefficient value or DC matrix coefficient value of a non-base matrix is ​​distributed based on 16, the first coefficient value or DC matrix coefficient value in a quantization matrix to be encoded / decoded can also be predicted from the constant 16 and encoded / decoded. Therefore, according to the present invention, coding efficiency can be improved.

[0367] Tables 39 and 40 outline an example of a syntax structure that can be applied when considering the first coefficient in a quantization matrix.

[0368] [Table 39]

[0369] [Table 40]

[0370] The encoder can first encode information indicating the presence or absence of a quantization matrix into a parameter set.

[0371] As shown in the example of Table 39, the encoder can encode scaling_list_present_flag, which is information indicating whether a quantization matrix exists in the bitstream, into the parameter set. For example, if no quantization matrix exists and all quantization matrices are determined to be base quantization matrices, the encoder can encode the value of scaling_list_present_flag as 0, and if an encoded quantization matrix exists, the encoder can encode the value of scaling_list_present_flag as 1.

[0372] After determining the type of predictive coding method for the quantization matrix, the encoder may encode information about the predictive coding method for the quantization matrix into a parameter set. In this case, the parameter set in which information about the predictive coding method is encoded is an adaptive parameter set.

[0373] As shown in the example of Table 39, scaling_list_pred_mode_flag, which is information regarding the predictive coding method of the quantization matrix, can be coded in the parameter set. For example, when scanning a quantization matrix and coding it using DPCM and Exponential-Golomb coding to predictively code coefficients in the quantization matrix, the encoder can code the value of scaling_list_pred_mode_flag to 1. Also, when determining that the reference quantization matrix and the quantization matrix to be coded have the same value for inter-quantization matrix prediction, the encoder can code the value of scaling_list_pred_mode_flag to 0. Determining that they have the same value means using a quantization matrix prediction method that copies coefficient values ​​of the reference quantization matrix to coefficient values ​​of the quantization matrix to be coded.

[0374] When the predictive coding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix for inter-quantization matrix prediction, the encoder may encode a reference quantization matrix identifier of a quantization matrix to be coded into a parameter set. In this case, the parameter set for coding the reference quantization matrix identifier is an adaptive parameter set.

[0375] As in the example of Table 39, when the coefficient values ​​of the quantization matrix to be coded are determined to be the same as the coefficient values ​​of the reference quantization matrix, the encoder can code scaling_list_pred_matrix_id_delta, which is the reference quantization matrix identifier of the quantization matrix to be coded, into the parameter set. In this case, the encoder can determine scaling_list_pred_matrix_id_delta, which is the quantization matrix identifier, by using matrixID, which indicates the quantization matrix to be coded, RefMatrixID, which indicates the reference quantization matrix, and Equation 15.

[0376] [Number 15] scaling_list_pred_matrix_id_delta=matrixID-(RefMatrixID+1)

[0377] Determining the coefficient values ​​of the quantization matrix to be encoded to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method in which the reference quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be encoded, and the coefficient values ​​of the reference quantization matrix are copied to the coefficient values ​​of the quantization matrix to be encoded.

[0378] When the predictive coding method for a quantization matrix is ​​a method of coding using DPCM and Exponential-Golomb code via scanning to predictively code coefficients in the quantization matrix, the encoder may code the difference value between the coefficient value of a quantization matrix previously coded in the quantization matrix and the coefficient value of the quantization matrix to be coded into a parameter set. In this case, the parameter set into which the difference value is coded is an adaptive parameter set.

[0379] As shown in the example of Table 40, when the size of the quantization matrix to be coded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the encoder can code scaling_list_dc_coef_minus16, which is the coefficient value of the quantization matrix corresponding to the coefficient of the DC matrix, into the parameter set. In this case, the value of scaling_list_dc_coef_minus16 indicates the coefficient of the DC matrix calculated with the prediction value set to 16.

[0380] As shown in the example of Table 40, the encoder may encode scaling_list_delta_coef, which is the difference between the coefficient values ​​of a previously coded quantization matrix and the coefficient values ​​of the current quantization matrix, into the parameter set. As shown in the example of Table 40, the encoder may set 'nextCoef=16', i.e., the predicted value for the first coefficient value, to 16.

[0381] In addition, the encoder can determine whether to use the base matrix by using scaling_list_dc_coef_minus16 or scaling_list_delta_coef used in calculating nextCoef. That is, the encoder can instruct the decoder to use the base matrix by encoding the value of scaling_list_dc_coef_minus16 to -16, and can instruct the decoder to use the base matrix by encoding scaling_list_delta_coef so that the first nextCoef value is 0.

[0382] In the examples of Tables 39 and 40, as well as in the examples of the preceding and following tables, the encoder can set nextCoef to 16, and the value of scaling_list_dc_coef_minus16 means the coefficient of the DC matrix calculated with the predicted value set to 16. Also, in the examples of the preceding and following tables, the encoder can instruct the decoder to use the base matrix by encoding the value of scaling_list_dc_coef_minus16 to -16.

[0383] An example of the operation of the encoder that encodes and signals quantization matrix information has been described above. Hereinafter, an example of the decoder that decodes quantization matrix information and obtains quantization matrices using the above example table will be described.

[0384] FIG. 5 is a flow chart illustrating an example of a decoder operation for decoding information on a quantization matrix and performing decoding using the information.

[0385] Referring to FIG. 5, the decoder decodes size information of the transform unit and determines the size of the transform unit based on the decoded information (S510).

[0386] The decoder entropy decodes information about the size of the transform unit from the received bitstream, and can decode information about the size of the transform unit from a parameter set in the bitstream.

[0387] For example, the decoder can decode information regarding the minimum and maximum sizes of the transform units from the bitstream.

[0388] As shown in the example of Table 1, the decoder can decode the minimum horizontal or vertical size of a square transform unit to which the Log2 function is applied by using the log2_min_transform_block_size_minus2 syntax element in the bitstream, and the decoder can also decode the difference value between the maximum horizontal or vertical size and the minimum horizontal or vertical size of a square transform unit to which the Log2 function is applied by using the log2_diff_max_min_transform_block_size syntax element in the bitstream.

[0389] The decoder can determine the minimum size and the maximum size of the decoded transform unit. At this time, the maximum size of the transform unit can also be determined by using the difference value between the decoded maximum size and the minimum size and the decoded minimum size.

[0390] For example, the decoder adds 2 to the decoded log2_min_transform_block_size_minus2 to calculate Log2MinTrafoSize, and then can determine the value calculated using 1<<Log2MinTrafoSize as the minimum size in the horizontal or vertical direction of the square transform unit. The decoder calculates Log2MaxTrafoSize based on the value of the decoded log2_diff_max_min_transform_block_size and the value obtained by adding 2 to the decoded log2_min_transform_block_size_minus2, and then can determine the value calculated using 1<<Log2MaxTrafoSize as the maximum size in the horizontal or vertical direction of the square transform unit.

[0391] Here, the minimum size of the transform unit means the value calculated using Log2MinTrafoSize or 1<<Log2MinTrafoSize, and the maximum size of the transform unit means the value calculated using Log2MaxTrafoSize or 1<<Log2MaxTrafoSize.

[0392] The decoder decodes quantization matrix information (S520). The decoder can decode quantization matrix information including at least one or more of (1) whether the quantization matrix can be used, (2) the presence or absence of the quantization matrix, (3) the decodability of the quantization matrix and the usability of the basic matrix, (4) the type of the quantization matrix prediction decoding method, (5) the reference quantization matrix identifier, or (6) the difference value between the coefficient value of the quantization matrix decoded previously within the quantization matrix and the coefficient value of the quantization matrix to be decoded. At this time, the quantization matrix information is dependent on the size of the transform unit.

[0393] The decoder can first determine whether to use a quantization matrix by decoding information on whether a quantization matrix is ​​available from a parameter set. As shown in the example of Table 2, the decoder can decode scaling_list_enabled_flag, which is information on whether a quantization matrix is ​​available, from a sequence parameter set. In this case, if the value of scaling_list_enabled_flag is 1, the decoder can use a quantization matrix in dequantization / scaling of transform coefficients for the entire sequence. If the value of scaling_list_enabled_flag is 0, the decoder does not use a quantization matrix in dequantization / scaling of transform coefficients.

[0394] The decoder can determine whether a quantization matrix is ​​present by decoding information on the presence or absence of a quantization matrix using a parameter set. As shown in the example of Table 3, the decoder can decode aps_scaling_list_data_present_flag, which is information on the presence or absence of a quantization matrix, using an adaptive parameter set. For example, if the value of aps_scaling_list_data_present_flag is 1, it means that a quantization matrix is ​​present in the adaptive parameter set, and if the value of aps_scaling_list_data_present_flag is 0, it means that a quantization matrix is ​​not present in the adaptive parameter set. If scaling_list_enabled_flag is 1 and aps_scaling_list_data_present_flag is 0, it means that a base matrix is ​​used during dequantization. Furthermore, although the example has been given in which the information on the presence or absence of a quantization matrix is ​​decoded into an adaptive parameter set, the present invention is not limited thereto, and the decoder can also decode information on the presence or absence of a quantization matrix into other parameter sets.

[0395] The decoder can determine whether to decode the quantization matrix and whether to use the base matrix by decoding information on whether to decode the quantization matrix and whether to use the base matrix using a parameter set. As shown in the example of Table 4, the decoder can decode use_default_scaling_list_flag, which is information on whether to decode the quantization matrix and whether to use the base matrix, using an adaptive parameter set. For example, if the value of use_default_scaling_list_flag is 1, the quantization matrix is ​​not decoded and the coefficient values ​​of all the quantization matrices can be determined to be the same as the coefficient values ​​of the base quantization matrix predetermined in the encoder and / or decoder. If the value of use_default_scaling_list_flag is 0, the quantization matrix is ​​decoded and the base matrix predetermined in the encoder and / or decoder is not used.

[0396] The decoder can use SizeID and MatrixID to determine at least one of decoding a quantization matrix, using a base matrix, or performing predictive decoding.

[0397] As shown in the examples of Tables 5 and 6, the SizeID value can identify a quantization matrix according to the size of a transform unit or the size of a quantization matrix using a table, and the MatrixID value can identify the type of quantization matrix corresponding to the coding mode and color component in which the quantization matrix is ​​used.

[0398] Meanwhile, the base quantization matrix can be indicated using Tables 7 and 8.

[0399] If the minimum and maximum sizes of the available transform units are not taken into consideration, quantization matrices for transform units of all sizes must be decoded, resulting in reduced coding efficiency and increased computational complexity.

[0400] According to the present invention, it is possible to decode information on a quantization matrix taking into account the size of a transform unit.

[0401] As an example, Table 9 shows that the SizeID corresponding to each transform unit size is limited by the minimum and maximum sizes of the transform unit size information, and at least one of quantization matrix decoding, base matrix use / non-use decoding, or predictive decoding method type decoding is performed.

[0402] As shown in the example of Table 9, SizeID can be limited by the minimum and maximum sizes of the size information of the transform unit, and decoding can be performed only for transform units of a specific size on at least one of information on whether a quantization matrix or base matrix can be used or the type of predictive decoding method.

[0403] For example, if the value of Log2MinTrafoSize, which specifies the minimum size of a transform unit, is 3 and the value of Log2MaxTrafoSize, which specifies the maximum size of a transform unit, is 4, the decoder can perform at least one of decoding of a quantization matrix corresponding to a transform unit ranging from 8x8 to 16x16 in size, decoding of whether a base matrix can be used, and decoding of the type of predictive decoding method.

[0404] On the other hand, in the example of Table 9, use_default_scaling_list_flag does not need to be decoded.

[0405] In addition, unlike the above, the decoder can also limit SizeID by the difference value between the maximum and minimum sizes of the transform unit and perform at least one of decoding the quantization matrix, decoding information on whether the base matrix can be used, and decoding information on the type of predictive decoding method.

[0406] The decoder can limit SizeID by the difference value between the maximum and minimum sizes of the transform unit, as in the example of Table 10, and perform at least one of decoding the quantization matrix, decoding information on whether the base matrix can be used, and decoding information on the type of predictive decoding method only for transform units of a specific size (i.e., only for a specific size of the transform unit).

[0407] For example, if the value of Log2MinTrafoSize, which specifies the minimum size of a transform unit, is 3 and the value of Log2MaxTrafoSize, which specifies the maximum size of a transform unit, is 4, at least one of the following can be performed: decoding of quantization matrices corresponding to transform units ranging from 8x8 to 16x16 in size; decoding of information regarding whether a base matrix can be used; and decoding of information regarding the type of predictive decoding method.

[0408] In this case, the difference between Log2MaxTrafoSize and Log2MinTrafoSize is the difference between the maximum and minimum size of the transform unit and can be specified by log2_diff_max_min_transform_block_size, and Log2MinTrafoSize-2 is the same as log2_min_transform_block_size_minus2.

[0409] In the example of Table 10, use_default_scaling_list_flag does not need to be decoded.

[0410] On the other hand, if base matrices and non-base matrices cannot be mixed and used according to the size of transform blocks or the type of quantization matrix within a sequence, picture, or slice, the encoder has less flexibility in selecting a quantization matrix. For example, in order to use a base matrix for a specific transform size within a slice and a non-base matrix for another specific transform size, the base matrix must be coded and transmitted, which may reduce coding efficiency.

[0411] In the present invention, base matrices and non-base matrices can be mixed and used according to the size of the transform block or the type of quantization matrix within a sequence, picture, or slice.

[0412] For example, the decoder may decode whether a quantization matrix can be decoded and whether a base matrix can be used according to SizeID using a parameter set. As shown in the example of Table 11, the decoder may decode sid_use_default_scaling_list_flag[SizeID][MatrixID], which is information specifying whether a quantization matrix can be decoded and whether a base matrix can be used according to SizeID, from an adaptation parameter set. For example, if the value of sid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the decoder does not decode the quantization matrix corresponding to SizeID, and the coefficient values ​​of the quantization matrix corresponding to SizeID may be determined to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder. If the value of sid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the decoder decodes the quantization matrix corresponding to SizeID and does not use a base matrix predetermined in the encoder and / or decoder as the quantization matrix corresponding to SizeID.

[0413] On the other hand, in the example of Table 11, use_default_scaling_list_flag does not need to be decoded.

[0414] Alternatively, the decoder may use MatrixID instead of SizeID to decode whether the quantization matrix can be decoded and whether the base matrix can be used in the parameter set.

[0415] As shown in the example of Table 12, the decoder may decode mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information specifying whether a quantization matrix can be decoded and whether a base matrix can be used according to MatrixID, from the adaptation parameter set. For example, if the value of mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the decoder does not decode the quantization matrix corresponding to MatrixID, and the coefficient values ​​of the quantization matrix corresponding to MatrixID may be determined to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder. If the value of mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the decoder decodes the quantization matrix corresponding to MatrixID, and does not use the base matrix predetermined in the encoder and / or decoder as the quantization matrix corresponding to MatrixID.

[0416] In the example of Table 12, use_default_scaling_list_flag does not need to be decoded.

[0417] In addition, instead of considering only SizeID or only MatrixID, the decoder can also consider both SizeID and MatrixID and decode information on whether the quantization matrix can be decoded and whether the base matrix can be used from the parameter set based on SizeID and MatrixID.

[0418] As shown in the example of Table 13, the decoder can decode sid_mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information specifying whether a quantization matrix can be decoded and whether a base matrix can be used, from the adaptation parameter set according to SizeID and MatrixID. For example, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the decoder does not decode the quantization matrix corresponding to SizeID and MatrixID, and the coefficient values ​​of the quantization matrix corresponding to SizeID and MatrixID can be determined to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder. If the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the decoder decodes the quantization matrix corresponding to SizeID and MatrixID, and does not use the base matrix predetermined in the encoder and / or decoder as the quantization matrix corresponding to SizeID and MatrixID.

[0419] In the example of Table 13, use_default_scaling_list_flag does not need to be decoded.

[0420] Meanwhile, as shown in the example of Table 14, the decoder restricts SizeID according to the minimum and maximum sizes of the transform unit, and performs at least one of decoding the quantization matrix, decoding information on whether the base matrix can be used, and decoding information on the type of predictive decoding method. Also, the decoder can decode information on whether the quantization matrix can be decoded and information on whether the base matrix can be used from the parameter set according to SizeID and MatrixID.

[0421] In the example of Table 14, use_default_scaling_list_flag does not need to be decoded.

[0422] As shown in the example of Table 15, the decoder may limit SizeID by a difference between the maximum and minimum sizes of the size information of the transform unit, and perform at least one of decoding the quantization matrix, decoding information on whether the base matrix can be used, and decoding information on the type of predictive decoding method. For example, the difference between Log2MaxTrafoSize and Log2MinTrafoSize specifies the difference between the maximum and minimum sizes of the transform unit, and is therefore the same as log2_diff_max_min_transform_block_size, and Log2MinTrafoSize-2 is the same as log2_min_transform_block_size_minus2. In addition, the decoder may decode information on whether the quantization matrix can be decoded and whether the base matrix can be used from the parameter set using SizeID and MatrixID.

[0423] In the example of Table 15, use_default_scaling_list_flag does not need to be decoded.

[0424] Also, as in the example of Table 16, the decoder can determine whether quantization matrix information exists in the parameter set to be decoded or whether to update the quantization matrix based on scaling_list_update_flag[SizeID][MatrixID] in the parameter set. For example, scaling_list_update_flag[SizeID][MatrixID] having a value of 1 indicates that quantization matrix information identified by SizeID and MatrixID exists in the parameter set to be decoded, or indicates that previously decoded quantization matrix information corresponding to SizeID and MatrixID should be updated to quantization matrix information corresponding to SizeID and MatrixID in the parameter set to be decoded. In this case, updating quantization matrix information means changing previously decoded quantization matrix information to quantization matrix information in the parameter set to be decoded. Furthermore, scaling_list_update_flag[SizeID][MatrixID] having a value of 0 indicates that quantization matrix information corresponding to SizeID and MatrixID does not exist in the parameter set to be decoded, or that previously decoded quantization matrix information should not be updated. For example, when the value of scaling_list_update_flag[SizeID][MatrixID] is 0, quantization matrix information corresponding to SizeID and MatrixID does not exist in the parameter set, and quantization matrix information has not been decoded, so the decoder does not know what quantization matrix information to use for dequantizing the coefficients of the quantization matrix identified by SizeID and MatrixID. Therefore, when the value of scaling_list_update_flag[SizeID][MatrixID] is 0, quantization matrix information corresponding to SizeID and MatrixID does not exist in the parameter set to be decoded, so it can be indicated that a base matrix should be used as the quantization matrix corresponding to SizeID and MatrixID, or that no quantization matrix should be used.

[0425] At this time, scaling_list_update_flag[SizeID][MatrixID] is decoded by SizeID and MatrixID corresponding to each transform unit size, so when the value of scaling_list_update_flag[SizeID][MatrixID] is 1, the decoder can perform at least one of decoding a quantization matrix, decoding information on whether a base matrix can be used, and decoding information on the type of predictive decoding method. When the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the decoder does not perform at least one of decoding a quantization matrix, decoding information on whether a base matrix can be used, and decoding information on the type of predictive decoding method. That is, the decoder does not decode unnecessary quantization matrices according to the instruction of scaling_list_update_flag[SizeID][MatrixID].

[0426] On the other hand, using only scaling_list_update_flag[SizeID][MatrixID] has the disadvantage of limited flexibility in selecting a quantization matrix because it is not possible to mix base and non-base matrices according to the size of a transform block in a sequence, picture, or slice, or according to the type of quantization matrix. Therefore, based on SizeID and MatrixID, a decoder can decode sid_mid_use_default_scaling_list_flag[SizeID][MatrixID], which is information on whether a quantization matrix can be decoded and whether a base matrix can be used, using a parameter set. For example, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1, the decoder does not decode the quantization matrix identified by SizeID and MatrixID, and the coefficient values ​​of the quantization matrix corresponding to SizeID and MatrixID are determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. If the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0, the decoder decodes the quantization matrix identified by SizeID and MatrixID, and does not use the base matrix predetermined in the encoder and / or decoder as the quantization matrix corresponding to SizeID and MatrixID.

[0427] In the example of Table 16, use_default_scaling_list_flag does not need to be decoded.

[0428] Also, the decoder can decode whether to decode the quantization matrix and whether to use the base matrix in a parameter set according to SizeID and MatrixID, as in the example of Table 17. Also, scaling_list_update_flag[SizeID][MatrixID], which indicates whether to update to quantization matrix information corresponding to SizeID and MatrixID, can be used in the decoding target parameters.

[0429] For example, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0 and the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the decoder decodes the quantization matrix corresponding to SizeID and MatrixID, and uses the quantization matrix corresponding to the previously decoded SizeID and MatrixID without updating the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be decoded.

[0430] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 0 and the value of scaling_list_update_flag[SizeID][MatrixID] is 1, the decoder decodes the quantization matrix corresponding to SizeID and MatrixID, and updates the quantization matrix corresponding to the previously decoded SizeID and MatrixID to the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be decoded.

[0431] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1 and the value of scaling_list_update_flag[SizeID][MatrixID] is 0, the decoder does not decode the quantization matrix corresponding to SizeID and MatrixID, but determines the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder, and uses the quantization matrix corresponding to the previously decoded SizeID and MatrixID without updating the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be decoded.

[0432] Also, if the value of sid_mid_use_default_scaling_list_flag[SizeID][MatrixID] is 1 and the value of scaling_list_update_flag[SizeID][MatrixID] is 1, the decoder does not decode the quantization matrix corresponding to SizeID and MatrixID, but determines the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the base matrix predetermined in the encoder and / or decoder, and updates the quantization matrix corresponding to the previously decoded SizeID and MatrixID to the quantization matrix corresponding to the SizeID and MatrixID in the parameters to be decoded.

[0433] In the example of Table 17, use_default_scaling_list_flag does not need to be decoded.

[0434] In addition, the decoder can determine the type of predictive decoding method for the quantization matrix by decoding information on the predictive decoding method for the quantization matrix using a parameter set. As shown in the example of Table 18, the decoder can decode pred_mode_flag, which is information on the predictive decoding method for the quantization matrix, from the adaptive parameter set. For example, if the value of pred_mode_flag is 1, the decoder can decode the quantization matrix using Exponential-Golomb coding and inverse DPCM (Inverse Differential Pulse Code Modulation). If the value of pred_mode_flag is 0, the decoder determines the coefficients of the quantization matrix to be the same as the coefficient values ​​of a previously decoded quantization matrix. In this case, the coefficients of the quantization matrix and the coefficient values ​​of the previously decoded quantization matrix are values ​​in different quantization matrices, and the previously decoded quantization matrix refers to a reference quantization matrix.

[0435] When the predictive decoding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a previously decoded quantization matrix, the decoder can decode a reference quantization matrix identifier of the quantization matrix to be decoded from a parameter set. As shown in the example of Table 18, the decoder can decode pred_matrix_id_delta, which is a reference quantization matrix identifier of the quantization matrix to be decoded, using an adaptive parameter set. In this case, the decoder can determine RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be decoded, using pred_matrix_id_delta and Equation 16.

[0436] [Number 16] RefMatrixID=MatrixID-(1+pred_matrix_id_delta)

[0437] When the predictive decoding method of the quantization matrix is ​​a method of decoding using Exponential-Golomb coding and inverse DPCM, the decoder can decode the difference value between the coefficient values ​​of a previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded from the parameter set. In this case, the coefficient values ​​of the previously decoded quantization matrix are coefficient values ​​in the quantization matrix to be decoded. As in the example of Table 19, delta_coef, which is the difference value between the coefficient values ​​of a previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, can be decoded from the adaptive parameter set.

[0438] Meanwhile, the following method can be used to mix base and non-base quantization matrices within a sequence, picture, or slice, thereby preventing unnecessary quantization matrices from being received.

[0439] For example, if the predictive decoding method of the quantization matrix is ​​a method of determining a quantization matrix to be the same as a previously decoded quantization matrix that the decoder already has (pred_mode_flag=0), the decoder can decode whether or not the base matrix can be used by using the reference quantization matrix identifier of the quantization matrix to be decoded from the parameter set.

[0440] As shown in the example of Table 18, the decoder can decode pred_matrix_id_delta, which is a reference quantization matrix identifier of the quantization matrix to be decoded, from the parameter set. In this case, the decoder can determine information RefMatrixID that identifies the reference quantization matrix or base matrix of the quantization matrix to be decoded and whether or not the base matrix can be used, using pred_matrix_id_delta and Equation 17.

[0441] [Number 17] RefMatrixID=MatrixID-pred_matrix_id_delta

[0442] For example, if the RefMatrixID value is the same as the MatrixID value, the coefficient values ​​of the quantization matrix corresponding to SizeID and RefMatrixID are determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. In this case, the base matrix refers to the base matrix corresponding to SizeID and RefMatrixID. And, if the pred_matrix_id_delta value is 0, the RefMatrixID value and the MatrixID value are the same. If the RefMatrixID value is not the same as the MatrixID value, the quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be decoded, and the coefficient values ​​of the quantization matrix to be decoded are determined to be the same as the coefficient values ​​of the reference quantization matrix.

[0443] If the size of a quantization matrix corresponding to SizeID is included in the minimum and maximum sizes of transform units usable in the decoder, the method can be used to determine whether a reference quantization matrix and a base matrix can be used for a quantization matrix to be decoded. If the size of a quantization matrix corresponding to SizeID is not included in the minimum and maximum sizes of transform units usable in the decoder, the quantization matrix corresponding to SizeID is not determined to be the same as the base matrix. The determining process can be performed when performing at least one of quantization matrix decoding, base matrix use / non-use decoding, and predictive decoding method type decoding based on the difference between the maximum and minimum sizes of transform unit size information using SizeID.

[0444] Furthermore, after determining whether or not a quantization matrix is ​​usable, the decoder can decode information regarding whether or not a quantization matrix is ​​usable from the parameter set.

[0445] As shown in the example of Table 20, the decoder can decode scaling_list_enable_flag, which is information on whether a quantization matrix can be used, using a parameter set. In this case, if the value of scaling_list_enable_flag is 1, the decoder can use a quantization matrix such as a base matrix or a non-base matrix in inverse quantization. In this case, if the value of scaling_list_enable_flag is 0, the decoder can use no quantization matrix in inverse quantization or can use a quantization matrix with all coefficient values ​​that are the same. In this case, all coefficient values ​​are 16.

[0446] Furthermore, when the predictive decoding method of the quantization matrix is ​​a method of decoding using inverse DPCM and exponential-Golomb code, the decoder can decode, from the parameter set, difference values ​​between coefficient values ​​of a previously decoded quantization matrix and coefficient values ​​of the quantization matrix to be decoded. The coefficient values ​​of the previously decoded quantization matrix are coefficient values ​​within the quantization matrix to be decoded. That is, the coefficient values ​​of the previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded are values ​​within the same quantization matrix.

[0447] As shown in the example of Table 21, the decoder can decode delta_coef, which is a difference between the coefficient values ​​of a previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, using a parameter set. If, as shown in the example of Table 21, the coefficient value nextcoef of the quantization matrix is ​​(1) the same as a specific value and (2) the first value of the quantization matrix using Equation 18, the coefficient value of the corresponding quantization matrix can be determined to be the same as the coefficient value of a base matrix predetermined in the encoder and / or decoder.

[0448] [Number 18] nextcoef=(nextcoef+delta_coef+256)%256

[0449] That is, if the coefficient nextcoef of a quantization matrix is ​​(1) equal to a specific value and (2) the first value of the quantization matrix, the decoder can use the corresponding quantization matrix as a base matrix. In this case, the specific value is 0. Here, the base matrix refers to the base matrix specified by SizeID and MatrixID. Therefore, if the quantization matrix coefficient value nextcoef is 0 and the first value of the quantization matrix, the decoder can stop decoding the quantization matrix difference value for the corresponding quantization matrix.

[0450] On the other hand, when the predictive decoding method of the quantization matrix is ​​a method of decoding using inverse DPCM and exponential-Golomb code, the decoder can decode the difference value between the previously decoded quantization matrix coefficient value and the quantization matrix coefficient value to be decoded using a parameter set. The coefficient value of the previously decoded quantization matrix is ​​the coefficient value in the quantization matrix to be decoded. That is, the previously decoded quantization matrix coefficient value and the coefficient value of the quantization matrix to be decoded are values ​​in the same quantization matrix.

[0451] As shown in the example of Table 22, the decoder can decode delta_coef, which is a difference between the coefficient values ​​of a previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, using a parameter set. For example, as shown in the example of Table 22, if the quantization matrix coefficient value nextcoef calculated using Equation 18, i.e., (nextcoef+delta_coef+256)%256, is equal to a specific value and is the first value of the quantization matrix, the decoder can determine that the coefficient values ​​of the corresponding quantization matrix are the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. That is, if nextcoef is (1) equal to a specific value and (2) the first value of the quantization matrix, the decoder can use the corresponding quantization matrix as a base matrix. In this case, the specific value is 0, and the coefficient values ​​of the quantization matrix calculated using (nextcoef+delta_coef+256)%256 are coefficient values ​​of a quantization matrix having a size of 4x4 or 8x8.

[0452] In addition, the first value of the quantization matrix is ​​a value that uses scaling_list_dc_coef_minus8, and the specific value is a value that corresponds to scaling_list_dc_coef_minus8+8.

[0453] scaling_list_dc_coef_minus8 means the first value of a quantization matrix having a size of 16x16 or 32x32, which means the DC matrix coefficient value.

[0454] If sizeID is 2, scaling_list_dc_coef_minus8[sizeID-2][MatrixID] may correspond to DC matrix coefficient values ​​of 16x16 size. In this case, 16x16 is the size of the transform block corresponding to the quantization matrix. If SizeID is 3, scaling_list_dc_coef_minus8[sizeID-2][MatrixID] may correspond to DC matrix coefficient values ​​in a quantization matrix of 32x32 size. In this case, 32x32 may be the size of the transform block corresponding to the quantization matrix. In each case, the base matrix refers to the base matrix corresponding to SizeID and MatrixID. Therefore, if the coefficient value nextcoef of the quantization matrix is ​​0 and is the first value of the quantization matrix, the decoder may stop decoding the difference value (difference of coefficient values) of the quantization matrix for the corresponding quantization matrix.

[0455] Using this method, the decoder can perform decoding of scaling_list_dc_coef_minus8, which is a DC matrix coefficient value, differently depending on the size of the quantization matrix or the size of the transform, and decoding of whether or not the base matrix is ​​used.

[0456] Meanwhile, a quantization matrix encoding / decoding method that determines whether to use a base matrix using coefficient values ​​of a quantization matrix has a drawback in that the complexity of the encoding / decoding process for the quantization matrix coefficient values ​​increases. In contrast, the present invention can determine whether to use a base matrix using a reference quantization matrix identifier in video encoding / decoding. Therefore, the computational complexity of the quantization matrix encoding / decoding process can be reduced.

[0457] First, the decoder can decode information indicating the presence or absence of a quantization matrix from a parameter set. As shown in the example of Table 23, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in the bitstream, from the parameter set. For example, if the value of scaling_list_present_flag is 0, it means that no quantization matrix exists, and the quantization matrix is ​​determined to be the base quantization matrix. If the value of scaling_list_present_flag is 1, it means that an encoded quantization matrix exists.

[0458] The decoder can determine the type of predictive decoding method for the quantization matrix by decoding information for the predictive decoding method from a parameter set. In this case, the parameter set for decoding the information for the predictive decoding method is an adaptive parameter set. As shown in the example of Table 23, the decoder can decode scaling_list_pred_mode_flag, which is information for the predictive decoding method for the quantization matrix, from the parameter set. For example, when the value of scaling_list_pred_mode_flag is 1, the decoder decodes the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode the coefficients in the quantization matrix. When the value of scaling_list_pred_mode_flag is 0, the decoder determines the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix or to be the same as the coefficient values ​​of the base matrix, thereby performing inter-quantization matrix prediction. Here, determining to have the same value means applying a quantization matrix prediction method that copies coefficient values ​​of a specific quantization matrix to coefficient values ​​of a quantization matrix to be decoded.

[0459] When the predictive decoding method of a quantization matrix is ​​a method of determining a quantization matrix as the same as a reference quantization matrix or a base matrix and performing inter-quantization matrix prediction, the decoder can decode the reference quantization matrix identifier of the quantization matrix to be decoded and whether the base matrix can be used from a parameter set. In this case, the parameter set for decoding information is an adaptive parameter set.

[0460] That is, the decoder can decode scaling_list_pred_matrix_id_delta, which is information specifying whether or not a reference quantization matrix identifier and a base matrix can be used for a quantization matrix to be decoded, from the parameter set, as in the example of Table 23. In this case, the decoder can determine RefMatrixID, which indicates the reference quantization matrix or base matrix of the quantization matrix to be decoded, using scaling_list_pred_matrix_id_delta and Equation 19.

[0461] [Number 19] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta

[0462] If the RefMatrixID value is the same as the matrixID value, the coefficient values ​​of the quantization matrix to be decoded corresponding to sizeID and matrixID may be determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. Here, the base matrix is ​​the base matrix corresponding to sizeID and matrixID. Referring to Equation 19, if the scaling_list_pred_matrix_id_delta value is 0, it means that the RefMatrixID value is the same as the matrixID value.

[0463] If the RefMatrixID value is not the same as the matrixID value, the decoder may determine the quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and may determine the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded. In this case, the scaling_list_pred_matrix_id_delta value is a positive integer value.

[0464] When the predictive decoding method of the quantization matrix is ​​a method of predictively decoding coefficients in the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning, the decoder can decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set from which the decoder decodes the difference values ​​is an adaptive parameter set.

[0465] As in the example of Table 24, when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the decoder can decode scaling_list_dc_coef_minus8, which is a DC matrix coefficient, from the parameter set. Also, as in the example of Table 24, the decoder can decode scaling_list_delta_coef, which is a difference value between the coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, from the parameter set. Tables 23 and 24 illustrate the case where quantization matrix information is decoded using an adaptive parameter set, but the present invention is not limited thereto, and the decoder can also decode quantization matrix information using other parameter sets (parameter sets including at least one of a sequence parameter set and a picture parameter set).

[0466] As described in the example of the encoder, in conventional quantization matrix encoding / decoding, unnecessary information is encoded / decoded when predicting a quantization matrix, which can reduce coding efficiency. In the present invention, quantization matrix encoding / decoding can be performed differently depending on whether a reference quantization matrix exists, thereby improving coding efficiency when encoding / decoding a quantization matrix.

[0467] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from the parameter set. The decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in the bitstream, from the parameter set, as in the example of Table 25. For example, when the value of scaling_list_present_flag is 0, it means that no quantization matrix exists and all quantization matrices are determined to be the base quantization matrix, and when the value of scaling_list_present_flag is 1, it means that an encoded quantization matrix exists.

[0468] Also, if matrixID is greater than 0, the decoder may determine the type of predictive decoding method of the quantization matrix by decoding information on the predictive decoding method from the parameter set. In this case, the parameter set for decoding information on the predictive decoding method is an adaptive parameter set.

[0469] For example, as in the example of Table 25, when matrixID is greater than 0, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, from the parameter set. In the example of Table 25, when the value of scaling_list_pred_mode_flag is 1, the decoder may predictively decode coefficients in a quantization matrix by decoding the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning. When the value of scaling_list_pred_mode_flag is 0, the decoder may perform inter-quantization matrix prediction by determining that coefficient values ​​of a quantization matrix to be decoded have the same values ​​as coefficient values ​​of a reference quantization matrix. Here, determining that the coefficient values ​​have the same values ​​means applying a quantization matrix prediction method that copies coefficient values ​​of a reference quantization matrix to coefficient values ​​of a quantization matrix to be decoded.

[0470] Also, in the example of Table 25, when matrixID is 0, the value of scaling_list_pred_mode_flag is true (TRUE), so the decoder can decode by scanning the quantization matrix using inverse DPCM and exponential-Golomb code without decoding scaling_list_pred_mode_flag.

[0471] If the predictive decoding method for a decoded quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix and performing inter-quantization matrix prediction, and matrixID is greater than 0, the decoder can decode a reference quantization matrix identifier of the quantization matrix to be decoded from a parameter set. In this case, the parameter set for decoding the reference quantization matrix identifier is an adaptive parameter set.

[0472] For example, as shown in Table 25, when matrixID is greater than 0, the decoder can decode scaling_list_pred_matrix_id_delta, which is a reference quantization matrix identifier of the quantization matrix to be decoded, using a parameter set. In this case, RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be decoded, can be determined using scaling_list_pred_matrix_id_delta and Equation 20.

[0473] [Number 20] RefMatrixID=matrixID-(1+scaling_list_pred_matrix_id_delta)

[0474] In the example of Table 25, a matrixID with a value of 0 indicates the first quantization matrix for each sizeID. Quantization matrix prediction is only possible from previously decoded quantization matrices with the same sizeID, and the first quantization matrix for each sizeID cannot perform quantization matrix prediction using a method such as matrix duplication because there is no reference quantization matrix with the same sizeID value. Therefore, when matrixID is greater than 0, the decoder decodes the reference quantization matrix identifier scaling_list_pred_matrix_id_delta, determines the quantization matrix corresponding to RefMatrixID as the reference quantization matrix for the quantization matrix to be decoded, and determines the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix means determining the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and applying a quantization matrix prediction method that copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0475] If the predictive decoding method for the decoded quantization matrix is ​​a method of predictively decoding coefficients in the quantization matrix using Exponential-Golomb coding, inverse DPCM, or scanning, the decoder may decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set for decoding the difference values ​​is an adaptive parameter set.

[0476] For example, as in the example of Table 26, when the size of the quantization matrix to be decoded is 16×16 (sizeID=2) or 32×32 (sizeID=3), the decoder can decode scaling_list_dc_coef_minus8, which is a DC matrix coefficient, from the parameter set. Also, as in the example of Table 26, the decoder can decode scaling_list_delta_coef, which is a difference value between the coefficient value of a quantization matrix previously decoded within the quantization matrix and the coefficient value of the quantization matrix to be decoded, from the parameter set.

[0477] In addition, the decoder can determine whether to use a base matrix by using scaling_list_dc_coef_minus8 or scaling_list_delta_coef used in calculating nextCoef. For example, if the value of scaling_list_dc_coef_minus8 is decoded to -8, the decoder can determine the corresponding quantization matrix as a base matrix, and if the first nextCoef value calculated by decoding scaling_list_delta_coef is 0, the decoder can determine the corresponding quantization matrix as a base matrix.

[0478] As described in the example of the encoder, a quantization matrix encoding / decoding method that determines whether to use a base matrix using coefficient values ​​of a quantization matrix has the disadvantage of increasing the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix. Furthermore, coding / decoding unnecessary information during quantization matrix prediction reduces coding efficiency. In the present invention, whether to use a base matrix can be determined using a reference quantization matrix identifier during video encoding / decoding, thereby reducing computational complexity during quantization matrix encoding / decoding. Furthermore, coding / decoding of a quantization matrix can be performed differently depending on the presence or absence of a reference quantization matrix, thereby improving coding efficiency during quantization matrix encoding / decoding.

[0479] Specifically, the decoder can first decode information indicating the presence or absence of a quantization matrix from the parameter set. As shown in the example of Table 27, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in the bitstream, from the parameter set. For example, when the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices are determined to be the base quantization matrix, and when the value of scaling_list_present_flag is 1, it is determined that an encoded quantization matrix exists.

[0480] In addition, the decoder may determine the type of predictive decoding method of the quantization matrix by decoding information on the predictive decoding method from the parameter set. In this case, the parameter set from which the information on the predictive decoding method is decoded is an adaptive parameter set.

[0481] Specifically, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, from the parameter set, as shown in the example of Table 27. For example, when the value of scaling_list_pred_mode_flag is 1, the decoder predictively decodes coefficients in a quantization matrix by decoding the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning. When the value of scaling_list_pred_mode_flag is 0, the decoder may perform inter-quantization matrix prediction by determining that coefficient values ​​of a quantization matrix to be decoded have the same values ​​as those of a reference quantization matrix, or by determining that coefficient values ​​of a quantization matrix to be decoded are the same as those of a base matrix. Here, determining that the coefficient values ​​have the same values ​​means applying a quantization matrix prediction method that copies coefficient values ​​of a specific quantization matrix to coefficient values ​​of the quantization matrix to be decoded.

[0482] When the predictive decoding method of the decoded quantization matrix is ​​a method of determining the same as a reference quantization matrix or a base matrix for inter-quantization matrix prediction and matrixID is greater than 0, the decoder can decode the reference quantization matrix identifier of the quantization matrix to be decoded and whether the base matrix can be used from the parameter set. In this case, the parameter set in which the reference quantization matrix identifier and whether the base matrix can be used are decoded is an adaptive parameter set.

[0483] In this case, as shown in the example of Table 27, the decoder can decode scaling_list_pred_matrix_id_delta, which is information on whether a reference quantization matrix identifier and a base matrix can be used for a quantization matrix to be decoded, from the parameter set when matrixID is greater than 0. In this case, RefMatrixID, which indicates a reference quantization matrix or a base matrix for a quantization matrix to be decoded, can be determined using scaling_list_pred_matrix_id_delta and Equation 21.

[0484] [Number 21] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta

[0485] If the RefMatrixID value is the same as the matrixID value, the coefficient values ​​of the quantization matrix to be decoded corresponding to sizeID and matrixID are determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. Here, the base matrix refers to the base matrix corresponding to sizeID and matrixID. According to Equation 21, if the scaling_list_pred_matrix_id_delta value is 0, it means that the RefMatrixID value is the same as the matrixID value.

[0486] If the RefMatrixID value is not the same as the matrixID value, the quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be decoded, and the coefficient values ​​of the quantization matrix to be decoded are determined to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0487] In this case, if the value of scaling_list_pred_mode_flag is 0, it indicates that the predictive decoding method of the quantization matrix is ​​a method of determining the quantization matrix to be the same as a previously decoded quantization matrix, and prediction of the quantization matrix is ​​possible from a previously decoded quantization matrix having the same sizeID.

[0488] On the other hand, if the value of matrixID is 0, it indicates the first quantization matrix for each sizeID, and if the value of scaling_list_pred_mode_flag is 0 and the value of matrixID is 0, the first quantization matrix for each sizeID does not have a reference quantization matrix with the same sizeID value, so quantization matrix prediction using a method such as matrix duplication cannot be performed. Therefore, in this case, the decoder does not decode scaling_list_pred_matrix_id_delta and infers the value of scaling_list_pred_matrix_id_delta to 0. If the value of scaling_list_pred_matrix_id_delta is 0, the values ​​of RefMatrixID and matrixID are the same, so the coefficient values ​​of the quantization matrix to be decoded corresponding to sizeID and matrixID are determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. Here, the base matrix refers to the base matrix corresponding to sizeID and matrixID.

[0489] If the predictive decoding method for the decoded quantization matrix is ​​a method of predictively decoding coefficients in the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning, the decoder may decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set for decoding the difference values ​​is an adaptive parameter set.

[0490] For example, as in the example of Table 28, when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the decoder can decode scaling_list_dc_coef_minus8, which is a DC matrix coefficient, from the parameter set. As in the example of Table 28, the decoder can decode scaling_list_delta_coef, which is a difference value between the coefficient value of a quantization matrix previously decoded in the quantization matrix and the coefficient value of the quantization matrix to be decoded, from the parameter set.

[0491] As described in the example of the encoder, conventional quantization matrix encoding / decoding encodes / decodes the overall coefficients and DC matrix coefficients in a quantization matrix when transmitting the quantization matrix, without performing predictive encoding / decoding on the DC matrix coefficients. This limits the improvement in coding efficiency. The present invention can perform predictive encoding / decoding of the DC matrix coefficients in a quantization matrix, thereby improving coding efficiency. For example, the embodiments of Tables 29 and 30 can improve coding efficiency by predicting the DC matrix coefficients from the surrounding AC coefficients using the high correlation between the surrounding coefficients, rather than predicting them from the constant 8. Furthermore, the embodiments of Tables 29 and 30 can save memory space for storing the DC matrix coefficients by matching the encoding / decoding order of the quantization matrix with the restoration order of the quantization matrix. Furthermore, the embodiments of Tables 29 and 30 can use the syntax element scaling_list_delta_coef instead of multiple syntax elements to indicate whether or not a base matrix is ​​used.

[0492] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from a parameter set. For example, as shown in the example of Table 29, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in a bitstream, from a parameter set. In this case, if the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices are determined to be base quantization matrices. If the value of scaling_list_present_flag is 1, it is determined that an encoded quantization matrix exists.

[0493] The decoder can determine the type of predictive decoding method of the quantization matrix by decoding information on the predictive decoding method from the parameter set. In this case, the parameter set for decoding information on the predictive decoding method is an adaptive parameter set.

[0494] Specifically, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, from the parameter set, as shown in the example of Table 29. For example, when the value of scaling_list_pred_mode_flag is 1, the decoder may predictively decode coefficients in a quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning. When the value of scaling_list_pred_mode_flag is 0, the decoder may perform inter-quantization matrix prediction by determining that coefficient values ​​of a quantization matrix to be decoded have the same values ​​as coefficient values ​​of a reference quantization matrix. Here, determining that they have the same values ​​means applying a quantization matrix prediction method that copies coefficient values ​​of a reference quantization matrix to coefficient values ​​of a quantization matrix to be decoded.

[0495] When the predictive decoding method of the decoded quantization matrix is ​​a method of determining the quantization matrix to be the same as the reference quantization matrix for inter-quantization matrix prediction, the decoder can decode the reference quantization matrix identifier of the quantization matrix to be decoded using a parameter set. In this case, the parameter set for decoding the reference quantization matrix identifier is an adaptive parameter set.

[0496] Specifically, the decoder can decode scaling_list_pred_matrix_id_delta, which is a reference quantization matrix identifier of the quantization matrix to be decoded, from the parameter set, as shown in the example of Table 29. In this case, RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be decoded, can be determined using scaling_list_pred_matrix_id_delta and Equation 22.

[0497] [Number 22] RefMatrixID=matrixID-(1+scaling_list_pred_matrix_id_delta)

[0498] The decoder determines the quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and determines the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0499] If the predictive decoding method for the decoded quantization matrix is ​​a method of predictively decoding coefficients in the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning, the decoder may decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set from which the difference values ​​are decoded is an adaptive parameter set.

[0500] For example, the decoder may decode scaling_list_delta_coef, which is a difference between the coefficient values ​​of a previously decoded quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, from the parameter set as shown in Table 30. In this case, the decoder may determine whether to use a base matrix using scaling_list_delta_coef used in calculating nextCoef. That is, if the first nextCoef value calculated by decoding scaling_list_delta_coef is 0, the decoder may determine the corresponding quantization matrix as the base matrix.

[0501] Furthermore, the decoder may decode scaling_list_dc_coef_res, which is a difference value between coefficient values ​​of a quantization matrix corresponding to a DC matrix coefficient, from the parameter set, as in the example of Table 30. In this case, scaling_list_dc_coef_res may be decoded when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3) and when the base matrix is ​​not used (useDefaultScalingMatrixFlag=0).

[0502] For a quantization matrix of 16x16 or 32x32 size in which the DC matrix coefficient is decoded separately, the DC matrix coefficient can be calculated using the sum of the scaling_list_dc_coef_res value and the matrix coefficient present at the DC position, as shown in Equation 23.

[0503] [Number 23] ScalingFactor[2][MatrixID][0][0]=scaling_list_dc_coef_res[0][MatrixID]+ScalingFactor[2][MatrixID][0][0]withmatrixID=0...5 ScalingFactor[3][MatrixID][0][0]=scaling_list_dc_coef_res[1][MatrixID]+ScalingFactor[3][MatrixID][0][0]withmatrixID=0...1

[0504] In Equation 23, ScalingFactor[2] means a 16×16 quantization matrix, ScalingFactor[3] means a 32×32 quantization matrix, ScalingFactor[2][MatrixID][0][0] means a DC matrix coefficient in the 16×16 quantization matrix corresponding to matrixID, and ScalingFactor[3][MatrixID][0][0] means a DC matrix coefficient in the 32×32 quantization matrix corresponding to matrixID.

[0505] Meanwhile, the quantization matrix encoding / decoding method that determines whether to use a base matrix using the coefficient values ​​of the quantization matrix has the disadvantage of increasing the complexity of the encoding / decoding process for the coefficient values ​​of the quantization matrix. Also, when transmitting the quantization matrix, all coefficients in the matrix and DC matrix coefficients are encoded / decoded, and at this time, predictive encoding / decoding is not performed on the DC matrix coefficients, which limits the improvement of coding efficiency.

[0506] In the present invention, whether or not to use a base matrix is ​​determined using a reference quantization matrix identifier in video encoding / decoding, thereby reducing complexity when encoding / decoding a quantization matrix, and performing predictive encoding / decoding on DC matrix coefficients in the quantization matrix, thereby improving coding efficiency. For example, in the examples of Tables 31 and 32, the DC matrix coefficients of a matrix are predicted from surrounding AC coefficients using high correlation between surrounding coefficients, rather than predicted from a constant 8, thereby improving coding efficiency. Also, in the examples of Tables 31 and 32, the encoding / decoding order of the quantization matrix and the restoration order of the quantization matrix can be matched, thereby saving memory space for storing DC matrix coefficients. Also, in the examples of Tables 31 and 32, when indicating whether or not to use a base matrix, the syntax element scaling_list_delta_coef can be used instead of multiple syntax elements.

[0507] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from a parameter set. As shown in the example of Table 31, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in a bitstream, from a parameter set. In this case, if the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices are determined to be the base quantization matrix, and if the value of scaling_list_present_flag is 1, it is determined that an encoded quantization matrix exists.

[0508] The decoder may determine the type of predictive decoding method for the quantization matrix by decoding information about the predictive decoding method from the parameter set. In this case, the parameter set for decoding the information about the predictive decoding method is an adaptive parameter set.

[0509] For example, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, using a parameter set, as shown in the example of Table 31. In the example of Table 31, when the value of scaling_list_pred_mode_flag is 1, the quantization matrix can be decoded using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix. When the value of scaling_list_pred_mode_flag is 0, for inter-quantization matrix prediction, the coefficient values ​​of the quantization matrix to be decoded may be determined to have the same values ​​as the coefficient values ​​of a reference quantization matrix, or the coefficient values ​​of the quantization matrix to be decoded may be determined to be the same as the coefficient values ​​of a base matrix. Here, determining to have the same values ​​means applying a quantization matrix prediction method that copies specific quantization matrix coefficient values ​​to the quantization matrix coefficient values ​​to be decoded.

[0510] When the predictive decoding method of the decoded quantization matrix is ​​an inter-quantization matrix prediction method that determines the quantization matrix to be the same as a reference quantization matrix or a base matrix, the decoder can decode the reference quantization matrix identifier of the quantization matrix to be decoded and whether the base matrix can be used from the parameter set. In this case, the decoded parameter set is an adaptive parameter set.

[0511] Specifically, the decoder can decode scaling_list_pred_matrix_id_delta, which is information on whether a reference quantization matrix identifier of a quantization matrix to be decoded and a base matrix can be used, from the parameter set, as shown in the example of Table 31. In this case, the decoder determines RefMatrixID, which indicates the reference quantization matrix or base matrix of the quantization matrix to be decoded, using scaling_list_pred_matrix_id_delta and Equation 24.

[0512] [Number 24] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta

[0513] If the RefMatrixID value is the same as the matrixID value, the coefficient values ​​of the quantization matrix to be decoded corresponding to sizeID and matrixID may be determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID. And, in Equation 24, if the scaling_list_pred_matrix_id_delta value is 0, this means that the RefMatrixID value and the matrixID value are the same. If the RefMatrixID value is not the same as the matrixID value, the quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be decoded, and the coefficient values ​​of the quantization matrix to be decoded may be determined to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be decoded to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method in which the reference quantization matrix corresponding to RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be decoded, and the coefficient values ​​of the reference quantization matrix are copied to the coefficient values ​​of the quantization matrix to be decoded.

[0514] If the predictive decoding method for the decoded quantization matrix is ​​a decoding method using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix, the decoder can decode difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded using a parameter set. In this case, the parameter set for decoding the difference values ​​is an adaptive parameter set.

[0515] In addition, the decoder may decode scaling_list_delta_coef, which is a difference value between the coefficient values ​​of a quantization matrix previously decoded within the quantization matrix and the coefficient values ​​of the quantization matrix to be decoded, using a parameter set, as in the example of Table 32. As in the example of Table 32, the decoder may decode scaling_list_dc_coef_res, which is a difference value between the coefficient values ​​of a quantization matrix corresponding to a DC matrix coefficient, into a parameter set. In this case, scaling_list_dc_coef_res can be decoded when the size of the quantization matrix to be decoded is a 16x16 (sizeID=2) or 32x32 (sizeID=3) quantization matrix and when a base matrix is ​​not used (useDefaultScalingMatrixFlag=0).

[0516] For a 16x16 quantization matrix or a 32x32 quantization matrix in which the DC matrix coefficients are decoded separately, the DC matrix coefficients can be calculated using the sum of the scaling_list_dc_coef_res value and the matrix coefficients present at the DC position, as shown in Equation 25.

[0517] [Number 25] ScalingFactor[2][MatrixID][0][0]=scaling_list_dc_coef_res[0][MatrixID]+ScalingFactor[2][MatrixID][0][0]withmatrixID=0...5 ScalingFactor[3][MatrixID][0][0]=scaling_list_dc_coef_res[1][MatrixID]+ScalingFactor[3][MatrixID][0][0]withmatrixID=0...1

[0518] In Equation 25, ScalingFactor[2] means a 16×16 quantization matrix, ScalingFactor[3] means a 32×32 quantization matrix, ScalingFactor[2][MatrixID][0][0] means a DC matrix coefficient in the 16×16 quantization matrix corresponding to the corresponding matrixID, and ScalingFactor[3][MatrixID][0][0] means a DC matrix coefficient in the 32×32 quantization matrix corresponding to the corresponding matrixID.

[0519] As explained in the example of the encoder, in conventional quantization matrix encoding / decoding, quantization matrix copying is performed using the size of the quantization matrix at the time of quantization and inverse quantization, rather than the size of the quantization matrix at the time of encoding / decoding. Therefore, since the quantization matrix must be copied from a limited number of quantization matrices, there is a limit to the coding efficiency of the quantization matrix. In the present invention, quantization matrix prediction can be performed from a quantization matrix that has the same size as the quantization matrix at the time of encoding / decoding, thereby improving coding efficiency and increasing the degree of freedom in quantization matrix prediction.

[0520] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from the parameter set. As shown in the examples of Tables 33 and 34, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in the bitstream, from the parameter set. For example, when the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices are determined to be the base quantization matrix, and when the value of scaling_list_present_flag is 1, it is determined that an encoded quantization matrix exists.

[0521] In addition, the decoder may determine the type of predictive decoding method of the quantization matrix by decoding information on the predictive decoding method using a parameter set. In this case, the parameter set for decoding information on the predictive decoding method is an adaptive parameter set.

[0522] Specifically, as shown in the examples of Tables 33 and 34, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, from a parameter set. For example, when the value of scaling_list_pred_mode_flag is 1, the quantization matrix is ​​decoded using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix. When the value of scaling_list_pred_mode_flag is 0, the coefficient values ​​of a quantization matrix to be decoded are determined to have the same value as the coefficient values ​​of a reference quantization matrix for inter-quantization matrix prediction. Here, determining to have the same value means applying a quantization matrix prediction method in which the reference quantization matrix coefficient values ​​are copied to the coefficient values ​​of a quantization matrix to be decoded.

[0523] When the predictive decoding method of the decoded quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix for inter-quantization matrix prediction, the decoder can decode a reference quantization matrix identifier of the quantization matrix to be decoded from a parameter set. In this case, the reference quantization matrix identification information (identifier) ​​can include at least one of the size of the reference quantization matrix of the quantization matrix to be decoded and the reference quantization matrix. The parameter set for decoding the reference quantization matrix identifier is an adaptive parameter set.

[0524] For example, as shown in the example of Table 33, the decoder can decode scaling_list_pred_size_matrix_id_delta, which is reference quantization matrix identification information of the quantization matrix to be decoded, from the parameter set. In this case, RefSizeID, which is the size of the reference quantization matrix of the quantization matrix to be decoded, and RefMatrixID, which indicates the reference quantization matrix, can be determined using scaling_list_pred_size_matrix_id_delta and Equation 26.

[0525] [Number 26] RefSizeID=sizeID-(scaling_list_pred_size_matrix_id_delta / 6) RefMatrixID=scaling_list_pred_size_matrix_id_delta%6

[0526] Also, as in the example of Table 34, the decoder can decode scaling_list_pred_size_id_delta and scaling_list_pred_size_matrix_id_delta, which are identification information for a reference quantization matrix of a quantization matrix to be decoded, from the parameter set. In this case, RefSizeID can be determined using the value of scaling_list_pred_size_id_delta and Equation 27, and RefMatrixID, which indicates a reference quantization matrix of a quantization matrix to be decoded, can be determined using scaling_list_pred_matrix_id_delta and Equation 28.

[0527] [Number 27] RefSizeID=sizeID-scaling_list_pred_size_id_delta

[0528] [Number 28] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta

[0529] The coefficient values ​​of a quantization matrix to be decoded can be determined to be the same as the coefficient values ​​of a reference quantization matrix whose sizeID is the same as RefSizeID and whose matrixID is the same as RefMatrixID. That is, the decoder can copy the reference quantization matrix to the quantization matrix to be decoded. Determining the coefficient values ​​of a quantization matrix to be the same as the reference quantization matrix coefficient values ​​means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefSizeID and RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0530] Through the examples of Tables 33 and 34, it is possible not only to predict a quantization matrix from a quantization matrix having the same sizeID, but also to predict a quantization matrix from a quantization matrix having the same matrix size but a different sizeID during encoding / decoding.

[0531] In addition, in the examples of Tables 33 and 34, the values ​​of scaling_list_pred_size_matrix_id_delta, scaling_list_pred_size_id_delta, and scaling_list_pred_matrix_id_delta may be limited to values ​​within a specific range. For example, scaling_list_pred_size_matrix_id_delta may have a value of 0 to 17, scaling_list_pred_size_id_delta may have a value of 0 to 2, and scaling_list_pred_matrix_id_delta may have a value of 0 to 5.

[0532] Furthermore, in the examples of Tables 33 and 34, the decoder does not predict the current quantization matrix from a quantization matrix that is larger in size than the current quantization matrix.

[0533] Also, in the examples of Tables 33 and 34, when predicting a quantization matrix to be decoded from an 8x8 quantization matrix, the decoder can determine a value corresponding to a DC matrix coefficient position in the 8x8 quantization matrix as a DC matrix coefficient and predict the value of the corresponding position. And, when predicting a quantization matrix to be decoded from a 16x16 or 32x32 quantization matrix, the decoder can also predict the DC matrix coefficient.

[0534] On the other hand, if the predictive decoding method for a quantization matrix is ​​a decoding method using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix, the decoder may decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set for decoding the difference values ​​is an adaptive parameter set.

[0535] Specifically, as in the example of Table 35, when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the decoder can decode scaling_list_dc_coef_minus8, which is a DC matrix coefficient, using the parameter set.

[0536] The decoder can also decode scaling_list_delta_coef from the parameter set, which is the difference value between the coefficient value of a previously decoded quantization matrix and the coefficient value of the quantization matrix to be decoded, as in the example of Table 35.

[0537] In addition, the decoder can determine whether to use a base matrix by using scaling_list_dc_coef_minus8 or scaling_list_delta_coef used in calculating nextCoef. That is, if the value of scaling_list_dc_coef_minus8 is decoded to -8, the corresponding quantization matrix can be determined as the base matrix, and if the first nextCoef value calculated by decoding scaling_list_delta_coef is 0, the corresponding quantization matrix can be determined as the base matrix.

[0538] As described in the example of the encoder, in conventional quantization matrix encoding / decoding, whether to use a base matrix is ​​determined using the coefficient values ​​of the quantization matrix, thereby increasing the complexity of the process of encoding / decoding the matrix coefficient values. Furthermore, since quantization matrix copying is performed using the size of the quantization matrix during quantization and inverse quantization, rather than the size of the quantization matrix during encoding / decoding, the quantization matrix is ​​copied from a limited number of quantization matrices. In the present invention, whether to use a base matrix can be determined using a reference quantization matrix identifier, thereby reducing the computational complexity during quantization matrix encoding / decoding. Furthermore, in the present invention, quantization matrix prediction can be performed from a quantization matrix that has the same size as the quantization matrix during encoding / decoding, thereby improving coding efficiency and increasing the degree of freedom in quantization matrix prediction.

[0539] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from a parameter set. The decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in a bitstream, from a parameter set, as in the examples of Tables 36 and 37. For example, if the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices can be determined to be the base quantization matrix, and if the value of scaling_list_present_flag is 1, it can be determined that an encoded quantization matrix exists.

[0540] The type of predictive decoding method for the quantization matrix can be determined by decoding predictive decoding method information for the quantization matrix using a parameter set, where the parameter set is an adaptive parameter set.

[0541] As shown in the examples of Tables 36 and 37, the decoder can decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, using a parameter set. When scaling_list_pred_mode_flag has a value of 1, the decoder can decode the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix. When scaling_list_pred_mode_flag has a value of 0, the decoder can determine the coefficient values ​​of a quantization matrix to be decoded to have the same values ​​as the coefficient values ​​of a reference quantization matrix, or determine the coefficient values ​​of a quantization matrix to be decoded to be the same as the coefficient values ​​of a base matrix, for inter-quantization matrix prediction. Here, determining to have the same values ​​means applying a quantization matrix prediction method that copies a specific quantization matrix coefficient value to a quantization matrix coefficient value to be decoded.

[0542] When the predictive decoding method of the decoded quantization matrix is ​​a method of determining the quantization matrix as the same as a reference quantization matrix or a base matrix for inter-quantization matrix prediction, the decoder can decode the reference quantization matrix identifier of the quantization matrix to be decoded and whether the base matrix can be used in a parameter set. In this case, the reference quantization matrix identification information (identifier) ​​can include at least one of the reference quantization matrix size and the reference quantization matrix of the quantization matrix to be decoded. The parameter set to be decoded is an adaptive parameter set.

[0543] For example, as shown in Table 36, the decoder can decode scaling_list_pred_size_matrix_id_delta, which is information on whether a reference quantization matrix identifier of a quantization matrix to be decoded and a base matrix can be used, from the parameter set. In this case, RefSizeID and RefMatrixID indicating a reference quantization matrix can be determined using scaling_list_pred_size_matrix_id_delta and Equation 29.

[0544] [Number 29] RefSizeID=sizeID-(scaling_list_pred_size_matrix_id_delta / 6) RefMatrixID=scaling_list_pred_size_matrix_id_delta%6

[0545] Also, as shown in the example of Table 37, the decoder can decode scaling_list_pred_size_id_delta and scaling_list_pred_size_matrix_id_delta, which are information on whether a reference quantization matrix identifier and a base matrix of a quantization matrix to be decoded, from the parameter set. In this case, the decoder can determine RefSizeID using the scaling_list_pred_size_id_delta value and Equation 30, and can determine RefMatrixID, which indicates the reference quantization matrix or base matrix of the quantization matrix to be decoded, using scaling_list_pred_matrix_id_delta and Equation 31.

[0546] [Number 30] RefSizeID=sizeID-scaling_list_pred_size_id_delta

[0547] [Number 31] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta

[0548] If the RefMatrixID value is the same as the matrixID value, the coefficient values ​​of the quantization matrix to be decoded corresponding to sizeID and matrixID may be determined to be the same as the coefficient values ​​of a base matrix predetermined in the encoder and / or decoder. In this case, the base matrix refers to the base matrix corresponding to sizeID and matrixID. In addition, if the scaling_list_pred_matrix_id_delta value in Equation 31 is 0, it means that the RefMatrixID value and the matrixID value are the same.

[0549] If the RefMatrixID value is not the same as the matrixID value, the quantization matrix corresponding to RefSizeID and RefMatrixID is determined to be the reference quantization matrix of the quantization matrix to be decoded, and the coefficient values ​​of the quantization matrix to be decoded may be determined to be the same as the reference quantization matrix coefficient values. Determining the coefficient values ​​of the quantization matrix to be the same as the reference quantization matrix coefficient values ​​means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefSizeID and RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0550] Therefore, not only is it possible to predict a quantization matrix from a quantization matrix having the same sizeID through the examples of Table 36 or Table 37, but it is also possible to predict a quantization matrix from a quantization matrix having the same matrix size but a different sizeID during encoding / decoding.

[0551] Also, in the examples of Table 36 or Table 37, the scaling_list_pred_size_matrix_id_delta value, the scaling_list_pred_size_id_delta value, and the scaling_list_pred_matrix_id_delta value can be limited to a measured range. For example, scaling_list_pred_size_matrix_id_delta can have a value of 0 to 17, scaling_list_pred_size_id_delta can have a value of 0 to 2, and scaling_list_pred_matrix_id_delta can have a value of 0 to 5.

[0552] Also, in the examples of Table 36 or Table 37, the decoder does not predict from a quantization matrix that has a larger magnitude than the quantization matrix to be decoded.

[0553] Also, when predicting from an 8x8 quantization matrix, the decoder can determine a value corresponding to a DC matrix coefficient position in the 8x8 quantization matrix as a DC matrix coefficient and predict the value of the corresponding position. When predicting from a 16x16 quantization matrix or a 32x32 quantization matrix, the decoder can also predict the DC matrix coefficient.

[0554] On the other hand, if the predictive decoding method for a quantization matrix is ​​a decoding method using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix, the decoder can decode difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded using a parameter set. In this case, the parameter set for decoding the difference values ​​is an adaptive parameter set.

[0555] As in the example of Table 38, when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the decoder can decode the DC matrix coefficient scaling_list_dc_coef_minus8 from the parameter set.

[0556] As in the example of Table 38, the decoder can decode scaling_list_delta_coef, which is the difference value between the coefficient value of a previously decoded quantization matrix and the coefficient value of the quantization matrix to be decoded, using the parameter set.

[0557] As described in the example of the encoder, conventional quantization matrix encoding / decoding encodes the coefficients of a quantization matrix without considering coefficient values ​​that frequently occur when encoding / decoding the first coefficient in the quantization matrix, limiting the improvement of coding efficiency. In the present invention, predictive coding / decoding of the first coefficient in a quantization matrix can be performed using frequently occurring coefficient values, thereby improving coding efficiency. If the first coefficient value or DC matrix coefficient value of a base matrix is ​​defined as 16, or if the first coefficient value or DC matrix coefficient value of a non-base matrix is ​​distributed based on 16, coding efficiency can be improved by predicting and encoding / decoding the first coefficient value or DC matrix coefficient value in the quantization matrix to be encoded / decoded from the constant 16.

[0558] Specifically, the decoder can decode information indicating the presence or absence of a quantization matrix from a parameter set. As shown in the example of Table 39, the decoder can decode scaling_list_present_flag, which is information indicating the presence or absence of a quantization matrix in a bitstream, from a parameter set. For example, if the value of scaling_list_present_flag is 0, no quantization matrix exists and all quantization matrices can be determined to be the base quantization matrix, and if the value of scaling_list_present_flag is 1, it can be determined that an encoded quantization matrix exists.

[0559] In addition, the decoder may determine the type of predictive decoding method for the quantization matrix by decoding information on the predictive decoding method from the parameter set. In this case, the parameter set for decoding information on the predictive coding method is an adaptive parameter set.

[0560] As shown in the example of Table 39, the decoder may decode scaling_list_pred_mode_flag, which is information regarding a predictive decoding method for a quantization matrix, from a parameter set. In this case, if the value of scaling_list_pred_mode_flag is 1, the decoder decodes the quantization matrix using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode the coefficients in the quantization matrix. In this case, if the value of scaling_list_pred_mode_flag is 0, the decoder may determine that the coefficient values ​​of the quantization matrix to be decoded have the same values ​​as the coefficient values ​​of the reference quantization matrix for inter-quantization matrix prediction. In this case, determining that the coefficient values ​​have the same values ​​means applying a quantization matrix prediction method that copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0561] When the predictive decoding method of a quantization matrix is ​​a method of determining a quantization matrix to be the same as a reference quantization matrix for inter-quantization matrix prediction, the decoder may decode a reference quantization matrix identifier of the quantization matrix to be decoded from a parameter set. In this case, the parameter set for decoding the reference quantization matrix identifier is an adaptive parameter set.

[0562] Also, as shown in the example of Table 39, the decoder can decode scaling_list_pred_matrix_id_delta, which is a reference quantization matrix identifier of the quantization matrix to be decoded, using a parameter set. In this case, RefMatrixID, which indicates the reference quantization matrix of the quantization matrix to be decoded, can be determined using scaling_list_pred_matrix_id_delta and Equation 32.

[0563] [Number 32] RefMatrixID=matrixID-(1+scaling_list_pred_matrix_id_delta)

[0564] The decoder determines the quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and determines the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the reference quantization matrix. Determining the coefficient values ​​of the quantization matrix to be the same as the coefficient values ​​of the reference quantization matrix means applying a quantization matrix prediction method that determines the reference quantization matrix corresponding to RefMatrixID as the reference quantization matrix of the quantization matrix to be decoded, and copies the coefficient values ​​of the reference quantization matrix to the coefficient values ​​of the quantization matrix to be decoded.

[0565] If the predictive decoding method for the decoded quantization matrix is ​​a decoding method using Exponential-Golomb coding, inverse DPCM, and scanning to predictively decode coefficients in the quantization matrix, the decoder may decode, from a parameter set, difference values ​​between coefficient values ​​of a quantization matrix previously decoded in the quantization matrix and coefficient values ​​of the quantization matrix to be decoded. In this case, the parameter set from which the difference values ​​are decoded is an adaptive parameter set.

[0566] As shown in the example of Table 40, the decoder may decode scaling_list_delta_coef, which is a difference between a previously decoded quantization matrix coefficient value in a quantization matrix and a current quantization matrix coefficient value, from the parameter set. In this case, the decoder may set a predicted value for the first coefficient value to 16, such as nextCoef=16.

[0567] Also, as shown in Table 40, when the size of the quantization matrix to be decoded is 16x16 (sizeID=2) or 32x32 (sizeID=3), the decoder can decode scaling_list_dc_coef_minus16, which is a coefficient value of the quantization matrix corresponding to the DC matrix coefficient, from the parameter set. The value of scaling_list_dc_coef_minus16 means the DC matrix coefficient calculated with the prediction value set to 16.

[0568] In addition, the decoder can determine whether to use a base matrix using scaling_list_dc_coef_minus16 or scaling_list_delta_coef used in calculating nextCoef. For example, if the value of scaling_list_dc_coef_minus16 is decoded to -16, the corresponding quantization matrix can be determined as the base matrix, and if the first nextCoef value calculated by decoding scaling_list_delta_coef is 0, the corresponding quantization matrix can be determined as the base matrix.

[0569] In the examples of Tables 39 and 40 as well as the examples of the above tables, nextCoef can be set to 16, and the value of scaling_list_dc_coef_minus16 means the DC matrix coefficient calculated with the predicted value set to 16, and when the value of scaling_list_dc_coef_minus16 is decoded to -16, the decoder can determine the corresponding quantization matrix as the base matrix.

[0570] As above, the embodiments for encoding / decoding and transmitting / receiving quantization matrix information according to the present invention have been described with reference to tables and drawings.

[0571] In the examples of Tables 18 and 19, 20 and 21, 23 and 24, 25 and 26, 27 and 28, 29 and 30, 31 and 32, 33 and 34, 36 and 38, 37 and 38, and 39 and 40, examples of syntax structures according to the present invention have been described by dividing them into two tables, but this is for convenience of explanation only, and the present invention is not limited thereto.

[0572] For example, in the above syntax structure example, scaling_list_pred_mode_flag indicates the prediction method of the quantization matrix, and if the value of scaling_list_pred_mode_flag is 0, the quantization matrix is ​​obtained by copying the matrix, and if the value of scaling_list_pred_mode_flag is 1, the matrix coefficients are predicted from previous matrix coefficients within the quantization matrix to obtain the quantization matrix.

[0573] Taking Tables 23 and 24 as an example, when the value of scaling_list_pred_mode_flag is 1, the quantization matrix syntax, i.e., the scaling list (scaling_list) syntax is called to obtain the quantization matrix, but this can be resolved with one syntax. It should be noted that configuring two or more syntax structures into one syntax structure with the same meaning does not change the content of the invention and is within the scope of the technical idea of ​​the present invention.

[0574] Table 41 is a syntax structure that configures the examples of Tables 23 and 24. As with Tables 23 and 24, the quantization matrix information of Table 41 can be encoded by an encoder into a parameter set including at least one of a sequence parameter set and a picture parameter set, and can be decoded by a decoder into a parameter set including at least one of a sequence parameter set and a picture parameter set.

[0575] [Table 41]

[0576] As mentioned above, the examples in Tables 23 and 24 and the example in Table 41 differ only in the formality of whether they have two or one syntax structure, and are otherwise the same.

[0577] The encoder can indicate the matrix prediction mode via scaling_list_pred_mode_flag as shown in Table 41. For example, when inter-quantization matrix copying is performed, the value of scaling_list_pred_mode_flag is determined and coded as 0, and when matrix coefficient predictive coding is performed within a quantization matrix, the value of scaling_list_pred_mode_flag is determined and coded as 1. As described above, copying a quantization matrix means using a base quantization matrix as the quantization matrix to be coded, or using a reference quantization matrix as the quantization matrix to be coded. As described above, the method of predicting matrix coefficients means a method of predictively coding coefficients within a quantization matrix.

[0578] If quantization matrix copying is performed (scaling_list_pred_mode_flag==0), scaling_list_pred_matrix_id_delta is sent. As mentioned above, scaling_list_pred_matrix_id_delta specifies the reference or base quantization matrix used to derive the quantization matrix currently being coded.

[0579] For example, if the current quantization matrix to be coded is determined to be the base quantization matrix, the value of scaling_list_pred_matrix_id_delta may be determined to be 0 and coded. That is, this is the case when the current quantization matrix to be coded is inferred from the base quantization matrix. The base quantization matrix may be specified according to Tables 7 and 8.

[0580] If the quantization matrix to be currently coded is determined from the reference quantization matrix, the value of scaling_list_pred_matrix_id_delta can be determined and coded as a non-zero value, i.e., if the quantization matrix to be currently coded (ScalingList) is determined from the reference quantization matrix as shown in Equation 33.

[0581] [Number 33] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta[SizeID][MatrixID] ScalingList[SizeID][MatrixID][i]=ScalingList[SizeID][RefMatrixId][i]

[0582] In Equation 33, the scaling_list_pred_matrix_id_delta value is specified by sizeID and matrixID, and the index i specifies the position of the coefficient within the quantization matrix.

[0583] When predictive coding within a quantization matrix is ​​performed (scaling_list_pred_mode_flag==1), matrix coefficients for a 4x4 quantization matrix, matrix coefficients for an 8x8 quantization matrix, matrix coefficients for a 16x16 quantization matrix including a DC matrix coefficient, and matrix coefficients for a 32x32 quantization matrix including a DC matrix coefficient can be coded. In this case, the total number of matrix coefficients to be coded can be calculated using coefNum=Min(64,(1<<(4+(sizeId<<1)))). In this case, the 16x16 quantization matrix and the 32x32 quantization matrix can be downsampled to an 8x8 quantization matrix before being coded.

[0584] For a decoder, the syntax elements in Table 41 can be decoded from the bitstream and inverse quantization performed to recover the video.

[0585] The decoder can determine the matrix prediction mode according to the instruction of the received scaling_list_pred_mode_flag as shown in Table 41. For example, if the value of scaling_list_pred_mode_flag is 0, inter-quantization matrix copying is performed, and if the value of scaling_list_pred_mode_flag is 1, matrix coefficients can be predicted within the quantization matrix. The decoder can obtain the (inverse) quantization matrix to be used for inverse quantization through this. In this specification, both the quantization matrix to be coded applied in the case of quantization and the quantization matrix to be decoded applied in the case of inverse quantization are also referred to as quantization matrices, but this is for convenience of explanation only. An inverse relationship can be established between the matrix applied for quantization and the matrix applied for inverse quantization, and the quantization matrix used for inverse quantization is also referred to as a scaling list.

[0586] As described above, copying a quantization matrix means determining a base quantization matrix as a quantization matrix to be decoded or determining a reference quantization matrix as a quantization matrix to be decoded. As described above, predicting the coefficients of a matrix means predictive decoding of coefficients in a quantization matrix.

[0587] When quantization matrix copying is performed (scaling_list_pred_mode_flag==0), the decoder identifies a reference or base quantization matrix that is used to derive the quantization matrix currently being decoded.

[0588] For example, if the value of scaling_list_pred_matrix_id_delta is 0, the decoder can determine the current quantization matrix to be decoded as the base quantization matrix. That is, the current quantization matrix to be decoded can be inferred from the base quantization matrix. The base quantization matrix can be specified according to Tables 7 and 8.

[0589] If the value of scaling_list_pred_matrix_id_delta is not 0, the decoder can determine the currently decoded quantization matrix from the reference quantization matrix. That is, the currently decoded quantization matrix (ScalingList) can be determined from the reference quantization matrix as shown in Equation 34.

[0590] [Number 34] RefMatrixID=matrixID-scaling_list_pred_matrix_id_delta[SizeID][MatrixID] ScalingList[SizeID][MatrixID][i]=ScalingList[SizeID][RefMatrixId][i]

[0591] In Equation 34, the scaling_list_pred_matrix_id_delta value is specified by sizeID and matrixID, and the index i specifies the position of the coefficient within the quantization matrix.

[0592] When predictive decoding within a quantization matrix is ​​performed (scaling_list_pred_mode_flag==1), the decoder can decode matrix coefficients for a 4x4 quantization matrix, matrix coefficients for an 8x8 quantization matrix, matrix coefficients for a 16x16 quantization matrix including a DC matrix coefficient, and matrix coefficients for a 32x32 quantization matrix including a DC matrix coefficient. In this case, the total number of matrix coefficients to be decoded can be calculated using coefNum=Min(64,(1<<(4+(sizeId<<1)))). In this case, since the 16x16 quantization matrix and the 32x32 quantization matrix are downsampled to an 8x8 quantization matrix when encoded, they can be restored to the 16x16 quantization matrix and the 32x32 quantization matrix by upsampling or interpolating the 8x8 quantization matrix. Also, when upsampling or interpolation is applied, the DC matrix coefficients can be converted to values ​​derived from separately signaled values ​​such as scaling_list_dc_coef_minus8 without using interpolated values.

[0593] The above describes examples of syntax structures and examples of encoding and decoding using the same using tables. In the above examples, encoding and decoding examples are described using the same syntax structure, but the present invention is not limited to this. For example, the above-described syntax structure table may be used only for encoding or only for decoding.

[0594] FIG. 6 is a flow chart that outlines an example of a method for performing inverse quantization in accordance with the present invention.

[0595] 6, the decoder may obtain an identifier indicating whether a quantization matrix is ​​present in a parameter set (S610). The information indicating whether a quantization matrix is ​​present in a parameter set is scaling_list_present_flag in the example table above.

[0596] In this case, the presence of a quantization matrix in a parameter set includes the presence of information on the quantization matrix in the parameter set (e.g., scaling_list_pred_mode_flag, scaling_list_pred_matrix_id_delta, scaling_list_dc_coef_minus8, scaling_list_delta_coef, etc.). In this case, scaling_list_enable_flag, which is an identifier indicating whether to use a quantization matrix, can be obtained before obtaining an identifier indicating whether a quantization matrix is ​​present. When a quantization matrix is ​​used by obtaining scaling_list_enable_flag, an identifier indicating whether a quantization matrix is ​​present can be obtained.

[0597] In this case, the parameter set is a sequence parameter set or a picture parameter set that transmits information about the quantization matrix.

[0598] The decoder may determine whether a quantization matrix exists in the parameter set based on the identifier (S620). For example, if the value of scaling_list_present_flag is 1, the decoder may determine that a quantization matrix exists in the parameter set, and if the value of scaling_list_present_flag is 0, the decoder may determine that a quantization matrix does not exist in the parameter set.

[0599] If a quantization matrix does not exist in the parameter set (if it is determined that a quantization matrix does not exist in the parameter set), the decoder can decide to not use a quantization matrix in inverse quantization, or to use the same quantization matrix (flat matrix) in inverse quantization where all matrix coefficients have a value of 16, or to set all quantization matrices to the base quantization matrix in inverse quantization (S630).

[0600] If a quantization matrix exists in the parameter set (if it is determined that a quantization matrix exists in the parameter set), the decoder may acquire information about the quantization matrix by size or type (S640). In this case, the types of quantization matrices may be at least one of a quantization matrix for inverse quantization of transform coefficients for an intra-screen residual block, a quantization matrix for inverse quantization of transform coefficients for an inter-screen residual block, a quantization matrix for inverse quantization of transform coefficients for a luma component block, a quantization matrix for inverse quantization of transform coefficients for a chroma component block, etc., or a combination of one or more of these.

[0601] The decoder can perform inverse quantization using the obtained quantization matrix (S650). If a quantization matrix is ​​not present in the parameter set, the decoder can perform inverse quantization without using a quantization matrix based on the determination made in step S630, or can use the same quantization matrix (flat matrix) in which all matrix coefficients have a value of 16 in inverse quantization, or can use all quantization matrices as a base quantization matrix in inverse quantization. Predicting the coefficients of a quantization matrix or using a base quantization matrix is ​​as described in the above embodiments. If a quantization matrix is ​​present in the parameter set, the decoder can obtain the corresponding quantization matrix and use it for inverse quantization. The decoder can restore an image based on the dequantized signal, as described in FIG. 2.

[0602] 6, an identifier indicating the presence or absence of a quantization matrix is ​​transmitted from the encoder, but this is merely an example of the invention. As described above, when transmitting information about a quantization matrix, it is not necessary to separately transmit information about the presence or absence of a quantization matrix.

[0603] Figure 7 is a diagram illustrating an example of a method for acquiring quantization matrix information and performing inverse quantization when a quantization matrix is ​​present in a parameter set. Figure 7 illustrates (1) steps corresponding to S640 and S650 of Figure 6, or (2) a method for acquiring a quantization matrix and performing inverse quantization when a separate identifier indicating the presence or absence of a quantization matrix is ​​not transmitted but the quantization matrix is ​​present in the parameter set and information on the quantization matrix is ​​transmitted from the encoder. However, methods (1) and (2) are similar, excluding the difference as to whether the presence or absence of a quantization matrix is ​​transmitted using a separate identifier. In Figure 7, the quantization matrix information can be decoded by a decoder using a parameter set including at least one of a sequence parameter set and a picture parameter set.

[0604] In the example of Figure 7, in order to reduce complexity when encoding / decoding a quantization matrix, if the reference quantization matrix identifier value for predicting the quantization matrix to be decoded is the same as the identifier value of the quantization matrix to be decoded, the decoder can use the quantization matrix that the decoder already has during inverse quantization without decoding the quantization matrix to be decoded. In this case, the quantization matrix that the decoder already has is a base quantization matrix.

[0605] 7, if a quantization matrix exists in a parameter set, the decoder may determine a prediction method for the quantization matrix (S710). The existence of a quantization matrix in a parameter set includes the existence of information for the quantization matrix (e.g., scaling_list_pred_mode_flag, scaling_list_pred_matrix_id_delta, scaling_list_dc_coef_minus8, scaling_list_delta_coef, etc.) in the parameter set.

[0606] Referring to the above example, the prediction method of the quantization matrix can be determined according to the value of the syntax element pred_mode_flag transmitted from the encoder. To clarify that it is a prediction method for the quantization matrix, pred_mode_flag can also be expressed as scaling_list_pred_mode_flag, as in the above example. The prediction method of the quantization matrix indicated by pred_mode_flag is either (1) a method of using the quantization matrix already possessed by the decoder as is, or (2) a method of transmitting the value of the quantization matrix and performing inverse DPCM between the quantization matrix coefficient values ​​in the quantization matrix.

[0607] For example, if the value of pred_mode_flag is 0, the decoder uses the quantization matrix it already has (an already decoded quantization matrix (reference matrix) or base matrix), and if the value of pred_mode_flag is 1, the decoder can predictively decode the coefficients in the quantization matrix based on the transmitted information.

[0608] If the quantization matrix prediction method is a method of using a quantization matrix that the decoder already has as is, the decoder can obtain identification information of the quantization matrix (S720). The identification information of the quantization matrix is ​​information that can identify a quantization matrix that the decoder already has, and corresponds to scaling_list_pred_matrix_id_delta, pred_matrix_id_delta, etc. in the above example.

[0609] The decoder can determine whether the quantization matrix identified by the identification information is the same as the quantization matrix currently being decoded (S730). pred_matrix_id_delta identifies a reference quantization matrix used to derive the quantization matrix. To clarify that it is for a quantization matrix, pred_matrix_id_delta can also be expressed as scaling_list_pred_matrix_id_delta, as in the example above.

[0610] When the scaling_list_pred_matrix_id_delta value is 0, the base quantization matrix specified by the quantization matrix information (SizeID, MatrixID) can be used as the quantization matrix to be decoded.

[0611] If the value of scaling_list_pred_matrix_id_delta is not 0, referring to the example above, the relationship scaling_list_pred_matrix_id_delta = matrixID-RefMatrixID holds between matrixID, which identifies the (type of) quantization matrix to be decoded, and RefMatrixID, which identifies the reference quantization matrix, so the quantization matrix to be decoded can be derived from an already decoded reference quantization matrix.

[0612] If the quantization matrix specified by the quantization matrix identification information is not the same as the quantization matrix to be decoded (!scaling_list_pred_matrix_id_delta==0 or matrixID!=RefMatrixID), the decoder can determine the quantization matrix to be used during dequantization using the quantization matrix identification information (S740). In this case, the decoder can determine the quantization matrix to be used during dequantization based on the quantization matrix identification information scaling_list_pred_matrix_id_delta as in the example of the table above.

[0613] If the quantization matrix specified by the quantization matrix identification information is the same as the quantization matrix to be decoded (scaling_list_pred_matrix_id_delta==0 or matrixID==RefMatrixID), the decoder can use the base quantization matrix it already has. In this case, the base quantization matrix can be determined using Tables 7 and 8.

[0614] If it is determined in S710 that the inverse DPCM method between the quantization matrix coefficient values ​​is to be used, the decoder may initialize the coefficient values ​​of the quantization matrix (S760). For example, the decoder may be initialized by setting the coefficient (nextcoef) of the quantization matrix to a constant value. The constant set at the time of initialization is either 8 or 16, as in the example of the table above.

[0615] The decoder can decode the inter-coefficient difference values ​​in the quantization matrix transmitted from the encoder (S770). The inter-coefficient difference values ​​in the quantization matrix can be specified by a syntax element such as delta_coef, and to clarify that it is for the quantization matrix, delta_coef may be scaling_list_delta_coef as in the example table above.

[0616] The decoder can derive coefficient values ​​of the quantization matrix (S780). The decoder can derive coefficient values ​​of the quantization matrix to be decoded (current quantization matrix) by adding inter-coefficient difference values ​​within the quantization matrix to coefficients of a previously decoded quantization matrix. For example, the decoder can derive coefficient values ​​of the current quantization matrix using the relationship nextcoef = (nextcoef = delta_coef + 256) % 256, as in the above equation.

[0617] The decoder determines whether the quantization matrix has been derived (S790). If all the coefficients of the quantization matrix have not been decoded, the decoder returns to step S770 and proceeds with the subsequent steps.

[0618] The decoder can perform inverse quantization using the obtained quantization matrix (S650).

[0619] Meanwhile, when deriving the coefficient values ​​of the quantization matrix, no distinction is made in the example of FIG. 7, but as in the above-described embodiment, the DC matrix coefficients can be derived first for a quantization matrix of a predetermined size.

[0620] Figure 8 is a diagram illustrating another example of a method for obtaining information about a quantization matrix and performing inverse quantization when a quantization matrix exists in a parameter set. Figure 8 is (1) a step corresponding to S640 and S650 of Figure 6, or (2) a method for obtaining a quantization matrix and performing inverse quantization when a separate identifier indicating the presence or absence of a quantization matrix is ​​not transmitted but the quantization matrix exists in the parameter set and information about the quantization matrix is ​​transmitted from the encoder. However, excluding the difference as to whether the presence or absence of a quantization matrix is ​​transmitted by a separate identifier, methods (1) and (2) are the same.

[0621] In the example of Figure 8, in order to prevent unnecessary transmission of quantization matrices, if the first value of the quantization matrix to be decoded is a specific value, the decoder does not decode the quantization matrix to be decoded, and can use the default quantization matrix that the decoder already has during inverse quantization.

[0622] 8, if a quantization matrix exists in a parameter set, the decoder may determine a prediction method for the quantization matrix (S810). The existence of a quantization matrix in a parameter set includes the existence of information on the quantization matrix in the parameter set.

[0623] If the quantization matrix prediction method is a method in which the quantization matrix already held by the decoder is used as is, the decoder can obtain identification information of the quantization matrix (S820).

[0624] The identification information of the quantization matrix is ​​information that can identify a quantization matrix that the decoder already has, and may correspond to scaling_list_pred_matrix_id_delta, pred_matrix_id_delta, etc. in the above example.

[0625] The decoder can determine the quantization matrix to be used during dequantization using the quantization matrix identification information (S830). The decoder can determine the quantization matrix according to the indication of the identification information such as scaling_list_pred_matrix_id_delta and pred_matrix_id_delta.

[0626] If it is determined in S810 that the inverse DPCM method between the quantization matrix coefficient values ​​is to be used, the decoder may initialize the coefficient values ​​of the quantization matrix (S840). For example, the decoder may initialize the coefficients (nextcoef) of the quantization matrix by setting them to a constant value. The constant set at the time of initialization is either 8 or 16, as in the example of the table above.

[0627] The decoder may decode the inter-coefficient difference values ​​in the quantization matrix transmitted from the encoder (S850). The inter-coefficient difference values ​​in the quantization matrix may be specified by a syntax element such as delta_coef.

[0628] The decoder can derive coefficient values ​​of the quantization matrix (S860). The decoder can derive coefficient values ​​of the quantization matrix to be decoded (current quantization matrix) by adding inter-coefficient difference values ​​within the quantization matrix to coefficients of a previously decoded quantization matrix. For example, the decoder can derive coefficient values ​​of the current quantization matrix using the relationship nextcoef = (nextcoef = delta_coef + 256) % 256, as in the above equation.

[0629] The decoder may determine whether the derived coefficient is the first coefficient value of the quantization matrix and is equal to a specific value (S870). In this case, the specific value is 0.

[0630] If the derived coefficient is the first coefficient value of the quantization matrix and is the same as a specific value, the decoder may determine to use the base quantization matrix that the decoder already has for inverse quantization (S880).

[0631] If the derived coefficient is the first coefficient value of the quantization matrix and is not the same as the specific value, the decoder checks whether all the difference values ​​for the quantization matrix coefficients have been decoded (S890). If all the difference values ​​have not been decoded, the decoder may proceed to the following steps from step S850.

[0632] The decoder can perform inverse quantization using the obtained quantization matrix (S650).

[0633] In the above-described embodiments, quantization matrix information refers to a quantization matrix or information from which a quantization matrix can be derived. In this case, the information from which a quantization matrix can be derived refers to whether a base matrix can be used, the type of predictive encoding / decoding method, a reference quantization matrix identifier, or a reference quantization matrix.

[0634] In the exemplary system described above, the method is described based on a flowchart with a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps different from those described above. Also, the above-described embodiments include examples of various aspects. For example, a combination of each embodiment should also be understood as an embodiment of the present invention.

Claims

1. 1. A video decoding method in a decoder, comprising: determining a prediction method for a quantization matrix used in inverse quantization; decoding the quantization matrix according to the prediction scheme of the quantization matrix; performing the inverse quantization using the quantization matrix; Including, The prediction method of the quantization matrix is ​​determined to be one of a first prediction method and a second prediction method based on a prediction mode flag, and the prediction mode flag indicates one of the first prediction method and the second prediction method; The first prediction method defines a method of deriving the quantization matrix using information about differences between coefficient values ​​of the quantization matrix, and the second prediction method defines a method of using a reference quantization matrix or a default quantization matrix of the decoder; In the step of decoding the quantization matrix by the second prediction scheme, identification information indicating whether the reference quantization matrix or the default quantization matrix is ​​used as the quantization matrix is ​​decoded; The identification information is a first function for indicating a difference value between a value specifying a quantization matrix to be decoded and a value specifying the reference quantization matrix when the value of the identification information is not 0; and a second function for indicating that the quantization matrix is ​​derived from the default quantization matrix when the value of the identification information is 0; Used for The video decoding method, wherein the quantization matrix has a size of 4x4, 8x8, 16x16, or 32x32.

2. 1. A video encoding method in an encoder, comprising: determining a quantization matrix to be used for quantization and performing the quantization; determining a prediction method for the quantization matrix; encoding information about the quantization matrix according to the prediction method of the quantization matrix; outputting an encoded bitstream including said information about said quantization matrices; Including, the information regarding the quantization matrix is ​​encoded according to a prediction method of the quantization matrix, the prediction method of the quantization matrix being one of a first prediction method and a second prediction method; The information regarding the quantization matrix includes a prediction mode flag indicating one of the first prediction method and the second prediction method, the first prediction method specifying a method of deriving the quantization matrix using information regarding a difference between coefficient values ​​of the quantization matrix, and the second prediction method specifying a method of using a reference quantization matrix or a default quantization matrix of a decoder; in the step of encoding the information regarding the quantization matrix using the second prediction scheme, the information regarding the quantization matrix is ​​encoded to include identification information indicating whether the reference quantization matrix or the default quantization matrix is ​​used as the quantization matrix; The identification information is a first function for indicating a difference value between a value specifying a quantization matrix to be decoded and a value specifying the reference quantization matrix when the value of the identification information is not 0; and a second function for indicating that the quantization matrix is ​​decoded from the default quantization matrix when the value of the identification information is 0; Used for The video encoding method, wherein the quantization matrix has a size of 4x4, 8x8, 16x16, or 32x32.

Citation Information

Patent Citations

  • High fall impact resistance ceramic substrate

    JP1986063575A

  • JPP6720278B

  • Image processing device and method

    WO2013129203A1