Image decoding device and recording medium

The image decoding device optimizes the use of MTS and secondary transforms by managing transform coefficients through a structured decoding process, enhancing decoding performance.

JP7796924B2Active Publication Date: 2026-01-09SHARP KK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2025045944
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-05-30
Filing Date
2025-03-19
Publication Date
2026-01-09
Estimated Expiration
2040-05-29

AI Technical Summary

Technical Problem

The performance of secondary transforms in image coding is insufficient when combined with Multiple Transform Selection (MTS), particularly when implicit MTS is used.

Method used

An image decoding device that transforms transform coefficients for each transform unit, incorporating a transform unit decoding unit, an inverse quantization unit, a secondary transform unit, and a core transform unit, which includes an MTS setting unit and an implicit MTS setting unit to manage inverse transforms based on specific indices and transform types.

Benefits of technology

Enhances the application of MTS and secondary transforms, improving the overall performance of image decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007796924000001
    Figure 0007796924000001
  • Figure 0007796924000002
    Figure 0007796924000002
  • Figure 0007796924000003
    Figure 0007796924000003
Patent Text Reader

Abstract

To provide an image decoding device and a related technology thereof which more suitably apply transform through Multiple Transform Selection (MTS) and secondary transform.SOLUTION: A moving image decoding device 31 includes: a transform unit decoding part 3024; and an inverse quantization / inverse transform part that includes a secondary transform section, a core transform section, and an inverse quantization section. The core transform section includes an MTS setting portion and an implicit MTS setting portion. When explicit MTS is enabled, the MTS setting portion derives horizontal transform type and vertical transform type. When a value of a secondary index is not equal to 0, the implicit MTS setting portion sets the horizontal transform type and the vertical transform type to 0. The core transform section performs inverse transform on the basis of the vertical transform type and also performs inverse transform on the basis of the horizontal transform type.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] FIELD Embodiments of the present invention relate to an image decoding device and an image encoding device. [Background technology]

[0002] In order to efficiently transmit or record images, an image encoding device is used that encodes an image to generate encoded data, and an image decoding device is used that decodes the encoded data to generate a decoded image.

[0003] Specific image encoding methods include, for example, H.264 / AVC and HEVC (High-Efficiency Video Coding).

[0004] In such an image coding method, images (pictures) that make up an image are managed in a hierarchical structure consisting of slices obtained by dividing the image, coding tree units (CTUs) obtained by dividing the slices, coding units (sometimes called coding units (CUs)) obtained by dividing the coding tree units, and transform units (TUs) obtained by dividing the coding units, and are coded / decoded for each CU.

[0005] In such an image coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the predicted image from the input image (original image) is coded. Methods for generating a predicted image include inter-frame prediction (inter-prediction) and intra-frame prediction (intra-prediction).

[0006] Further, recent image coding and decoding techniques include Non-Patent Document 1 and Non-Patent Document 2. Non-Patent Document 1 discloses a technique called Multiple Transform Selection (MTS), which switches transform matrices according to explicit syntax or implicit block size in coded data. Non-Patent Document 2 discloses an image coding device that derives transform coefficients by transforming each coefficient after transform of prediction errors for each transform unit using a reduced secondary transform (RST), i.e., a secondary transform. Non-Patent Document 2 also discloses an image decoding device that inversely transforms transform coefficients for each transform unit using a secondary transform. [Prior art documents] [Non-patent literature]

[0007] [Non-Patent Document 1] "Versatile Video Coding (Draft 5)", JVET-N1001-v6, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 2019-05-23 [Non-patent document 2] "CE12: Mapping functions (test CE12-1 and CE12-2)", JVET-M0427-v2, Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 13th Meeting: Marrakech, MA, 9-18 Jan. 2019 Summary of the Invention [Problem to be solved by the invention]

[0008] In secondary transforms and related technologies such as those described in Non-Patent Document 1, there is a problem that performance is insufficient when secondary transforms are combined with transforms using MTS. In particular, there is a problem that performance of implicit MTS is lost when combined with secondary transforms.

[0009] An object of the present invention is to provide an image decoding device and related techniques that can more suitably apply MTS transform and secondary transform. [Means for solving the problem]

[0010] An image decoding device according to one aspect of the present invention is an image decoding device that transforms transform coefficients for each transform unit, and includes a transform unit decoding unit that decodes from encoded data (i) a secondary index that indicates whether an inverse secondary transform is used and the transform base, and (ii) a multi-transform selection index that is a switching index for selecting a transform base for the inverse core transform, an inverse quantization unit that inverse quantizes quantized transform coefficients and calculates transform coefficients, a secondary transform unit that, when the inverse secondary transform is enabled, derives modified transform coefficients by applying the inverse secondary transform to the transform coefficients using a transform matrix, and a transform unit that decodes the transform coefficients. and a core transform unit that applies the inverse core transform, including a vertical transform and a horizontal transform, to the modified transform coefficients, wherein the core transform unit includes an MTS setting unit and an implicit MTS setting unit, wherein the MTS setting unit derives a horizontal transform type and a vertical transform type based on the multi-transform selection index when explicit MTS is enabled, and the implicit MTS setting unit sets the horizontal transform type and the vertical transform type to 0 when a value of the secondary index is not equal to 0, and the core transform unit performs an inverse transform based on the vertical transform type and performs an inverse transform based on the horizontal transform type. [Brief explanation of the drawings]

[0011] [Figure 1] 1 is a schematic diagram showing the configuration of an image transmission system according to an embodiment of the present invention. [Figure 2] 1 is a diagram showing the configuration of a transmitting device equipped with a video encoding device according to this embodiment, and a receiving device equipped with a video decoding device, in which PROD_A indicates the transmitting device equipped with the video encoding device, and PROD_B indicates the receiving device equipped with the video decoding device. [Figure 3] 1 is a diagram showing the configuration of a recording device equipped with a video encoding device according to this embodiment, and a playback device equipped with a video decoding device, in which PROD_C indicates a recording device equipped with a video encoding device, and PROD_D indicates a playback device equipped with a video decoding device. [Figure 4] FIG. 2 is a diagram showing a hierarchical structure of data in an encoded stream. [Figure 5] FIG. 10 is a diagram illustrating an example of division of a CTU. [Figure 6] FIG. 10 is a schematic diagram showing types of intra prediction modes (mode numbers). [Figure 7] FIG. 1 is a schematic diagram illustrating a configuration of a video decoding device. [Figure 8] 10 is a flowchart illustrating a schematic operation of the video decoding device. [Figure 9] FIG. 10 is a schematic diagram illustrating a configuration of an intra-prediction parameter decoding unit. [Figure 10] FIG. 10 is a diagram illustrating reference regions used for intra prediction. [Figure 11] FIG. 10 is a diagram illustrating a configuration of an intra-prediction image generation unit. [Figure 12] FIG. 2 is a functional block diagram showing an example of the configuration of an inverse quantization and inverse transform unit. [Figure 13] FIG. 10 is a diagram illustrating a conversion range of a secondary conversion. [Figure 14] FIG. 10 is a diagram illustrating the operation of implicit MTS when using intra sub-partition mode (intra sub-partition prediction). [Figure 15] FIG. 10 is a diagram illustrating the operation of implicit MTS when sub-block transform is used. [Figure 16] FIG. 1 is a block diagram showing a configuration of a video encoding device. [Figure 17]FIG. 10 is a schematic diagram illustrating a configuration of an intra-prediction parameter encoding unit. [Figure 18] FIG. 15 is a block diagram illustrating a core conversion unit 1521. [Figure 19] FIG. 2 is a block diagram illustrating a secondary transform and a core transform. [Figure 20] 10 is a flowchart illustrating the operation of an MTS setting unit 15211 according to the embodiment. [Figure 21] 10 is a flowchart illustrating the operation of an MTS setting unit 15211 according to the embodiment. [Figure 22] 10 is a flowchart illustrating the operation of an MTS setting unit 15211 according to the embodiment. [Figure 23] FIG. 10 is a block diagram showing the relationship between a TU decoding unit and an inverse transform unit. [Figure 24] 10 is a flowchart illustrating a secondary conversion process. DETAILED DESCRIPTION OF THE INVENTION

[0012] [Embodiment 1] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

[0013] FIG. 1 is a schematic diagram showing the configuration of an image transmission system 1 according to this embodiment.

[0014] The image transmission system 1 is a system that transmits an encoded stream obtained by encoding an image to be encoded, decodes the transmitted encoded stream, and displays an image. The image transmission system 1 includes a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and an image display device (image display device) 41.

[0015] An image T is input to the video encoding device 11 .

[0016] The network 21 transmits the coded stream Te generated by the video coding device 11 to the video decoding device 31. The network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination of these. The network 21 is not necessarily limited to a bidirectional communication network, but may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. Furthermore, the network 21 may be replaced by a storage medium on which the coded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blu-ray Disc: registered trademark).

[0017] The video decoding device 31 decodes each of the coded streams Te transmitted by the network 21, and generates one or more decoded images Td.

[0018] The image display device 41 displays all or part of one or more decoded images Td generated by the video decoding device 31. The image display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-Luminescence) display. The display may be in the form of a stationary display, a mobile display, an HMD, or the like. If the video decoding device 31 has high processing power, it displays high-quality images, and if it has only low processing power, it displays images that do not require high processing power or display power.

[0019] <operator> The operators used in this specification are listed below.

[0020] >> is a right bit shift, << is a left bit shift, & is a bitwise AND, | is a bitwise OR, |= is the OR assignment operator, and || indicates logical sum.

[0021] x?y:z is a ternary operator that takes y if x is true (non-zero) and z if x is false (zero).

[0022] Clip3(a, b, c) is a function that clips c to a value between a and b (inclusive). If c < a, it returns a; if c > b, it returns b; otherwise, it returns c (where a <= b).

[0023] abs(a) is a function that returns the absolute value of a.

[0024] Int(a) is a function that returns the integer value of a.

[0025] floor(a) is a function that returns the largest integer less than or equal to a.

[0026] ceil(a) is a function that returns the smallest integer greater than or equal to a.

[0027] a / d represents the division of a by d (truncating the decimal part).

[0028] <Structure of the Encoded Stream Te> Prior to the detailed description of the moving image encoding device 11 and the moving image decoding device 31 according to this embodiment, the data structure of the encoded stream Te generated by the moving image encoding device 11 and decoded by the moving image decoding device 31 will be described.

[0029] Figure 4 is a diagram showing the hierarchical structure of data in the encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence. In Figure 4, there are shown, respectively, an encoded video sequence that defines the sequence SEQ, an encoded picture that defines the picture PICT, an encoded slice that defines the slice S, encoded slice data that defines the slice data, an encoded tree unit included in the encoded slice data, and an encoded unit included in the encoded tree unit.

[0030] (Encoded Video Sequence) The coded video sequence defines a set of data that the video decoding device 31 refers to in order to decode the sequence SEQ to be processed. As shown in the coded video sequence of Fig. 4, the sequence SEQ includes a video parameter set (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and supplemental enhancement information SEI (Supplemental Enhancement Information).

[0031] The video parameter set VPS specifies a set of coding parameters common to multiple images, and a set of coding parameters related to multiple layers included in an image and each individual layer, for an image composed of multiple layers.

[0032] The sequence parameter set SPS defines a set of coding parameters that the video decoding device 31 references to decode the target sequence. For example, the width and height of a picture are defined. Note that there may be multiple SPSs. In this case, one of the multiple SPSs is selected from the PPS.

[0033] The picture parameter set PPS defines a set of coding parameters that the video decoding device 31 references to decode each picture in the target sequence. For example, the picture parameter set PPS includes a reference value of the quantization width (pic_init_qp_minus26) used in decoding the picture, a flag indicating the application of weighted prediction (weighted_pred_flag), and a scaling list (quantization matrix). Note that there may be multiple PPSs. In this case, one of the multiple PPSs is selected for each picture in the target sequence.

[0034] (encoded picture) The coded picture defines a set of data that the video decoding device 31 refers to in order to decode the picture PICT to be processed. As shown in the coded picture of Fig. 4, the picture PICT includes slices 0 to NS-1 (NS is the total number of slices included in the picture PICT).

[0035] In the following description, when there is no need to distinguish between slices 0 to NS-1, the subscripts of the symbols may be omitted. This also applies to other data that are included in the coded stream Te described below and have subscripts.

[0036] (encoded slice) An encoded slice defines a set of data that the video decoding device 31 refers to in order to decode a target slice S. As shown in the encoded slice in Fig. 4, a slice includes a slice header and slice data.

[0037] The slice header includes a group of coding parameters that the video decoding device 31 refers to in order to determine a decoding method for the current slice. Slice type designation information (slice_type) that designates the slice type is an example of a coding parameter included in the slice header.

[0038] Slice types that can be specified by the slice type specification information include (1) an I slice that uses only intra prediction during encoding, (2) a P slice that uses unidirectional prediction or intra prediction during encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction during encoding. Note that inter prediction is not limited to uni-prediction or bi-prediction, and a predicted image may be generated using more reference pictures. Hereinafter, P and B slices refer to slices that include blocks that can use inter prediction.

[0039] Note that the slice header may include a reference to the picture parameter set PPS (pic_parameter_set_id).

[0040] (encoded slice data) The coded slice data defines a set of data that the video decoding device 31 references in order to decode the slice data to be processed. The slice data includes a CTU, as shown in the coded slice header in Fig. 4. A CTU is a block of a fixed size (e.g., 64x64) that constitutes a slice, and is also called a Largest Coding Unit (LCU).

[0041] (coding tree unit) The coding tree unit in Fig. 4 defines a set of data that the video decoding device 31 references in order to decode the target CTU. The CTU is divided into coding units (CUs), which are basic units of encoding processing, by recursive quad tree (QT) division, binary tree (BT) division, or ternary tree (TT) division. BT division and TT division are collectively called multi-tree (MT) division. A node in the tree structure obtained by recursive quad tree division is called a coding node. Intermediate nodes in the quad tree, binary tree, and ternary tree are coding nodes, and the CTU itself is defined as the top-level coding node.

[0042] The CT includes, as CT information, a QT split flag (cu_split_flag) indicating whether or not QT splitting is performed, an MT split flag (split_mt_flag) indicating whether or not MT splitting is performed, an MT split direction (split_mt_dir) indicating the split direction of MT splitting, and an MT split type (split_mt_type) indicating the split type of MT splitting. cu_split_flag, split_mt_flag, split_mt_dir, and split_mt_type are transmitted for each encoding node.

[0043] If cu_split_flag is 1, the coding node is split into four coding nodes (QT in Figure 5).

[0044] When cu_split_flag is 0 and split_mt_flag is 0, the coding node is not split and has one CU as a node (no split in Figure 5). A CU is the terminal node of the coding node and is not split any further. A CU is the basic unit of the coding process.

[0045] When split_mt_flag is 1, the coding node is MT-split as follows: When split_mt_type is 0, if split_mt_dir is 1, the coding node is split horizontally into two coding nodes (BT (horizontal split) in Figure 5), and when split_mt_dir is 0, the coding node is split vertically into two coding nodes (BT (vertical split) in Figure 5). Also, when split_mt_type is 1, if split_mt_dir is 1, the coding node is split horizontally into three coding nodes (TT (horizontal split) in Figure 5), and when split_mt_dir is 0, the coding node is split vertically into three coding nodes (TT (vertical split) in Figure 5). These are shown in the CT information in Figure 5.

[0046] Also, when the size of the CTU is 64x64 pixels, the size of the CU can be any of 64x64 pixels, 64x32 pixels, 32x64 pixels, 32x32 pixels, 64x16 pixels, 16x64 pixels, 32x16 pixels, 16x32 pixels, 16x16 pixels, 64x8 pixels, 8x64 pixels, 32x8 pixels, 8x32 pixels, 16x8 pixels, 8x16 pixels, 8x8 pixels, 64x4 pixels, 4x64 pixels, 32x4 pixels, 4x32 pixels, 16x4 pixels, 4x16 pixels, 8x4 pixels, 4x8 pixels, and 4x4 pixels.

[0047] (encoding unit) As shown in the coding unit of Fig. 4, a set of data to be referenced by the video decoding device 31 in order to decode the coding unit to be processed is defined. Specifically, a CU is composed of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The CU header defines a prediction mode, etc.

[0048] The prediction process may be performed in units of CUs, or in units of sub-CUs obtained by further dividing a CU. When the sizes of a CU and a sub-CU are the same, there is one sub-CU in the CU. When the size of a CU is larger than the size of a sub-CU, the CU is divided into sub-CUs. For example, when a CU is 8x8 and a sub-CU is 4x4, the CU is divided into 2 parts horizontally and 2 parts vertically, into 4 sub-CUs.

[0049] There are two types of prediction (prediction modes): intra prediction and inter prediction. Intra prediction is a prediction within the same picture, while inter prediction refers to a prediction process performed between different pictures (for example, between display times or between layer images).

[0050] The transform and quantization processes are performed in units of CU, but the quantized transform coefficients may be entropy coded in units of sub-blocks such as 4x4.

[0051] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.

[0052] The following describes prediction parameters for intra prediction. The intra prediction parameters include a luminance prediction mode IntraPredModeY and a color difference prediction mode IntraPredModeC. FIG. 6 is a schematic diagram showing the types of intra prediction modes (mode numbers). As shown in FIG. 6, there are, for example, 67 types of intra prediction modes (0 to 66). These include planar prediction (0), DC prediction (1), and angular prediction (2 to 66). Furthermore, for color difference, an LM mode (67 to 72) may be added.

[0053] Syntax elements for deriving intra prediction parameters include, for example, intra_luma_mpm_flag, intra_luma_mpm_idx, and intra_luma_mpm_remainder.

[0054] (MPM) The intra_luma_mpm_flag is a flag indicating whether the IntraPredModeY of the current block matches the MPM (Most Probable Mode). The MPM is a prediction mode included in the MPM candidate list mpmCandList[]. The MPM candidate list is a list that stores candidates that are estimated to have a high probability of being applied to the current block based on the intra prediction modes of neighboring blocks and predetermined intra prediction modes. When the intra_luma_mpm_flag is 1, the IntraPredModeY of the current block is derived using the MPM candidate list and the index intra_luma_mpm_idx.

[0055] IntraPredModeY = mpmCandList[intra_luma_mpm_idx] (REM) When intra_luma_mpm_flag is 0, an intra prediction mode is selected from the remaining modes RemIntraPredMode, excluding the intra prediction modes included in the MPM candidate list from all intra prediction modes. The intra prediction modes selectable as RemIntraPredMode are called "non-MPM" or "REM". RemIntraPredMode is derived using intra_luma_mpm_remainder.

[0056] (Configuration of video decoding device) The configuration of a video decoding device 31 (FIG. 7) according to this embodiment will be described.

[0057] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, an inverse quantization and inverse transform unit 311, and an addition unit 312. Note that the video decoding device 31 may also be configured without including the loop filter 305, in accordance with the video coding device 11 described below.

[0058] The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), and the CU decoding unit 3022 includes a TU decoding unit 3024. These may be collectively referred to as a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, and PPS, and slice headers (slice information) from the coded data. The CT information decoding unit 3021 decodes the CT from the coded data. The CU decoding unit 3022 decodes the CU from the coded data. When a prediction error is included in the TU, the TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the coded data.

[0059] 23 is a block diagram showing the relationship between the TU decoding unit 3024 and the inverse transform unit 3112. The stIdx decoding unit 131 of the TU decoding unit 3024 decodes a value stIdx indicating whether a secondary transform is used and the transform base from the coded data, and outputs the value to the secondary transform unit 31121. The mts_idx decoding unit 132 of the TU decoding unit 3024 decodes a value mts_idx indicating the transform matrix of the MTS from the coded data, and outputs the value to the core transform unit 31123. Specifically, the TU decoding unit 3024 decodes stIdx when the width and height of the CU are 4 or more, the prediction mode is intra mode, and the number of transform coefficients in the CU, numSigCoeff, is greater than a predetermined number THSt (for example, 2 for SINGLE_TREE, 1 otherwise). Note that when stIdx is 0, no secondary transform is applied, when stIdx is 1, it indicates one transform of a set (pair) of secondary transform matrices, and when stIdx is 2, it indicates the other transform of the pair. Also, the secondary transform matrix secTransMatrix may be selected according to the intra prediction mode and the size of the transform, in addition to the value of stIdx.

[0060] The parameter decoding unit 302 includes an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304 (not shown). The predicted image generating unit 308 includes an inter prediction image generating unit 309 and an intra prediction image generating unit 310.

[0061] In the following, an example will be described in which CTUs and CUs are used as processing units, but this is not limiting and processing may be performed in sub-CU units. Alternatively, CTUs and CUs may be read as blocks, and sub-CUs as sub-blocks, and processing may be performed in block or sub-block units.

[0062] The entropy decoding unit 301 performs entropy decoding on the externally input coded stream Te to separate and decode individual codes (syntax elements). Entropy coding can be divided into two types: variable-length coding of syntax elements using a context (probability model) adaptively selected according to the type of syntax element and surrounding conditions, and variable-length coding of syntax elements using a predetermined table or formula. The former, CABAC (Context Adaptive Binary Arithmetic Coding), stores an updated probability model in memory for each coded or decoded picture (slice). Then, as the initial state of the context for a P picture or B picture, a probability model for a picture using quantization parameters of the same slice type and slice level is selected from the probability models stored in memory. This initial state is used for the coding and decoding processes. The separated codes include prediction information for generating a predicted image and prediction errors for generating a difference image.

[0063] The entropy decoding unit 301 outputs the separated code to the parameter decoding unit 302. The separated code is, for example, a prediction mode predMode. Control of which code to decode is performed based on an instruction from the parameter decoding unit 302.

[0064] (Basic flow) FIG. 8 is a flowchart illustrating the general operation of the video decoding device 31.

[0065] (S1100: Decode Parameter Set Information) The header decoder 3020 decodes parameter set information such as VPS, SPS, and PPS from the coded data.

[0066] (S1200: Decode slice information) The header decoding unit 3020 decodes the slice header (slice information) from the coded data.

[0067] Thereafter, the video decoding device 31 repeats the processes from S1300 to S5000 for each CTU included in the target picture, thereby deriving a decoded image of each CTU.

[0068] (S1300: Decode CTU Information) The CT information decoding unit 3021 decodes the CTU from the encoded data.

[0069] (S1400: Decode CT Information) The CT information decoding unit 3021 decodes the CT from the encoded data.

[0070] (S1500: CU Decoding) The CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data.

[0071] (S1510: Decode CU Information) The CU decoding unit 3022 decodes CU information, prediction information, the TU split flag split_transform_flag, and CU residual flags cbf_cb, cbf_cr, and cbf_luma from the coded data.

[0072] (S1520: TU information decoding) When a prediction error is included in a TU, the TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the coded data. Note that the QP update information is a difference value from the quantization parameter predicted value qPpred, which is a predicted value of the quantization parameter QP.

[0073] (S2000: Generate predicted image) The predicted image generating unit 308 generates a predicted image for each block included in the current CU based on the prediction information.

[0074] (S3000: Inverse Quantization and Inverse Transformation) The inverse quantization and inverse transformation unit 311 executes inverse quantization and inverse transform processing on each TU included in the target CU.

[0075] (S4000: Generate decoded image) The addition unit 312 generates a decoded image of the current CU by adding the predicted image supplied from the predicted image generation unit 308 and the prediction error supplied from the inverse quantization and inverse transform unit 311.

[0076] (S5000: Loop filter) The loop filter 305 applies a loop filter such as a deblocking filter, SAO, or ALF to the decoded image to generate a decoded image.

[0077] The parameter decoding unit 302 is configured to include an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304, both of which are not shown. The predicted image generation unit 308 is configured to include an inter prediction image generation unit 309 and an intra prediction image generation unit 310, both of which are not shown.

[0078] (Configuration of the intra-prediction parameter decoding unit 304) The intra-prediction parameter decoding unit 304 decodes intra-prediction parameters, for example, an intra-prediction mode IntraPredMode, by referring to the prediction parameters stored in the prediction parameter memory 307, based on the code input from the entropy decoding unit 301. The intra-prediction parameter decoding unit 304 outputs the decoded intra-prediction parameters to the predicted image generation unit 308, and also stores them in the prediction parameter memory 307. The intra-prediction parameter decoding unit 304 may derive different intra-prediction modes for luma and chroma.

[0079] 9 is a schematic diagram showing the configuration of the intra prediction parameter decoding unit 304 of the parameter decoding unit 302. As shown in FIG. 9, the intra prediction parameter decoding unit 304 includes a parameter decoding control unit 3041, a luma intra prediction parameter decoding unit 3042, and a chroma intra prediction parameter decoding unit 3043.

[0080] The parameter decoding control unit 3041 instructs the entropy decoding unit 301 to decode syntax elements and receives the syntax elements from the entropy decoding unit 301. If intra_luma_mpm_flag among the syntax elements is 1, the parameter decoding control unit 3041 outputs intra_luma_mpm_idx to the MPM parameter decoding unit 30422 in the luma intra prediction parameter decoding unit 3042. If intra_luma_mpm_flag is 0, the parameter decoding control unit 3041 outputs intra_luma_mpm_remainder to the non-MPM parameter decoding unit 30423 in the luma intra prediction parameter decoding unit 3042. The parameter decoding control unit 3041 also outputs the syntax elements of the chroma intra prediction parameters to the chroma intra prediction parameter decoding unit 3043.

[0081] The luma intra prediction parameter decoding unit 3042 includes an MPM candidate list derivation unit 30421, an MPM parameter decoding unit 30422, and a non-MPM parameter decoding unit 30423 (decoding unit, derivation unit).

[0082] The MPM parameter decoding unit 30422 references the mpmCandList[ ] and intra_luma_mpm_idx derived by the MPM candidate list derivation unit 30421 , derives IntraPredModeY, and outputs it to the intra-predicted image generation unit 310 .

[0083] The non-MPM parameter decoding unit 30423 derives RemIntraPredMode from mpmCandList[ ] and intra_luma_mpm_remainder, and outputs IntraPredModeY to the intra-predicted image generation unit 310.

[0084] The chrominance intra-prediction parameter decoding unit 3043 derives IntraPredModeC from the syntax elements of the chrominance intra-prediction parameters, and outputs it to the intra-prediction image generation unit 310.

[0085] The luma intra prediction parameter decoding unit 3042 may further decode a flag intra_subpartitions_mode_flag indicating whether or not to perform intra sub-partitioning, which divides a CU into smaller sub-blocks and performs intra prediction. If intra_subpartitions_mode_flag is other than 0, the luma intra prediction parameter decoding unit 3042 further decodes intra_subpartitions_split_flag. The intra sub-partitioning mode is derived by the following equation:

[0086] IntraSubPartSplitType = (intra_subpartitions_mode_flag == 0) ? 0 : 1 + intra_subpartitions_split_flag If IntraSubPartSplitType is 0 (ISP_NO_SPLIT), intra prediction is performed without further division of the CU. If IntraSubPartSplitType is 1 (ISP_HOR_SPLIT: horizontal division), the CU is divided into 2 to 4 sub-blocks vertically, and intra prediction, transform coefficient decoding, inverse quantization, and inverse transform are performed on a sub-block basis. If IntraSubPartSplitType is 2 (ISP_VER_SPLIT: vertical division), the CU is divided into 2 to 4 sub-blocks horizontally, and intra prediction, transform coefficient decoding, inverse quantization, and inverse transform are performed on a sub-block basis. The number of sub-block divisions, NumIntraSubPart, is calculated using the following formula.

[0087] NumIntraSubPart = (cbWidth == 4 && cbHeight == 8) || (cbWidth == 8 && cbHeight== 4) ? 2 : 4 The width nW and height nH of the sub-block, and the numbers of divisions numPartsX and numPartY in the horizontal and vertical directions are derived as follows:

[0088] nW = (IntraSubPartSplitType == ISP_VER_SPLIT?) nTbW / NumIntraSubPart : nTbW nH = (IntraSubPartSplitType == ISP_HOR_SPLIT?) nTbH / NumIntraSubPart : nTbH numPartsX = (IntraSubPartSplitType == ISP_VER_SPLIT?) NumIntraSubPart : 1 numPartsY = (IntraSubPartSplitType == ISP_HOR_SPLIT?) NumIntraSubPart : 1 Here, nTbW and nTbH are the width and height of the CU (or TU).

[0089] The loop filter 305 is a filter provided in the encoding loop that removes block distortion and ringing distortion to improve image quality. The loop filter 305 applies filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the adder 312.

[0090] The reference picture memory 306 stores the decoded image of the CU generated by the adder 312 in a predetermined location for each current picture and current CU.

[0091] The prediction parameter memory 307 stores prediction parameters at a predetermined location for each CTU or CU to be decoded. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302 and the predMode separated by the entropy decoding unit 301.

[0092] The predicted image generation unit 308 receives input of predMode, prediction parameters, etc. The predicted image generation unit 308 also reads a reference picture from the reference picture memory 306. The predicted image generation unit 308 generates a predicted image of a block or sub-block using the prediction parameters and the read reference picture (reference picture block) in the prediction mode indicated by predMode. Here, the reference picture block is a set of pixels on the reference picture (usually rectangular, and therefore called a block), and is an area referenced to generate a predicted image.

[0093] (Intra-predicted image generation unit 310) When predMode indicates an intra prediction mode, the intra prediction image generation unit 310 performs intra prediction using the intra prediction parameters input from the intra prediction parameter decoding unit 304 and reference pixels read from the reference picture memory 306 .

[0094] Specifically, the intra-prediction image generation unit 310 reads neighboring blocks within a predetermined range from the current block in the current picture from the reference picture memory 306. The predetermined range refers to neighboring blocks to the left, upper left, upper, and upper right of the current block, and the area to be referenced differs depending on the intra-prediction mode.

[0095] The intra-predicted image generation unit 310 generates a predicted image of the current block by referring to the read decoded pixel values ​​and the prediction mode indicated by IntraPredMode. The intra-predicted image generation unit 310 outputs the generated predicted image of the block to the adder 312.

[0096] Generation of a predicted image based on an intra prediction mode is described below. In planar prediction, DC prediction, and angular prediction, a decoded surrounding area adjacent (close to) the block to be predicted is set as a reference area R. Then, a predicted image is generated by extrapolating pixels in the reference area R in a specific direction. For example, the reference area R may be set as an L-shaped area including the left and top of the block to be predicted (or further, the top left, top right, and bottom left) (for example, the area indicated by the pixels marked with a diagonal circle in reference area example 1 of FIG. 10).

[0097] (Details of predicted image generation unit) Next, the configuration of the intra-predicted image generation unit 310 will be described in detail with reference to Fig. 11. The intra-predicted image generation unit 310 includes a prediction target block setting unit 3101, an unfiltered reference image setting unit 3102 (first reference image setting unit), a filtered reference image setting unit 3103 (second reference image setting unit), an intra prediction unit 3104, and a predicted image correction unit 3105 (predicted image correction unit, filter switching unit, weighting coefficient changing unit).

[0098] Based on each reference pixel (unfiltered reference image) in the reference region R, a filtered reference image generated by applying a reference pixel filter (first filter), and the intra prediction mode, the intra prediction unit 3104 generates a temporary predicted image (pre-corrected predicted image) of the block to be predicted, and outputs the temporary predicted image to the predicted image correction unit 3105. The predicted image correction unit 3105 corrects the temporary predicted image according to the intra prediction mode, and generates and outputs a predicted image (corrected predicted image).

[0099] Each unit included in the intra-predicted image generation unit 310 will be described below.

[0100] (Prediction target block setting unit 3101) The prediction target block setting unit 3101 sets the target CU as the prediction target block, and outputs information about the prediction target block (prediction target block information). The prediction target block information includes at least the size, position, and index indicating whether the prediction target block is luminance or chrominance.

[0101] (Unfiltered reference image setting unit 3102) Based on the size and position of the block to be predicted, the unfiltered reference image setting unit 3102 sets the neighboring surrounding area of ​​the block to be predicted as the reference area R. Then, for each pixel value (unfiltered reference image, boundary pixel) in the reference area R, each decoded pixel value at a corresponding position in the reference picture memory 306 is set. The line r[x][−1] of decoded pixels adjacent to the top edge of the block to be predicted and the column r[−1][y] of decoded pixels adjacent to the left edge of the block to be predicted shown in reference area example 1 of Fig. 10 are unfiltered reference images.

[0102] (Filtered reference image setting unit 3103) The filtered reference image setting unit 3103 applies a reference pixel filter (first filter) to the unfiltered reference image according to the intra prediction mode, to derive a filtered reference image s[x][y] at each position (x, y) on the reference region R. Specifically, a low-pass filter is applied to the unfiltered reference image at the position (x, y) and its surroundings, to derive a filtered reference image (reference region example 2 in FIG. 10 ). Note that the low-pass filter does not necessarily need to be applied to all intra prediction modes, and the low-pass filter may be applied to some intra prediction modes. Note that the filter applied to the unfiltered reference image on the reference region R by the filtered reference image setting unit 3103 is referred to as a “reference pixel filter (first filter),” whereas the filter that corrects the tentative predicted image in the predicted image correction unit 3105, described later, is referred to as a “boundary filter (second filter).”

[0103] (Configuration of the intra prediction unit 3104) The intra prediction unit 3104 generates a temporary predicted image (temporary predicted pixel values, pre-corrected predicted image) of the block to be predicted based on the intra prediction mode, the unfiltered reference image, and the filtered reference pixel values, and outputs the generated image to the predicted image correction unit 3105. The intra prediction unit 3104 internally includes a planar prediction unit 31041, a DC prediction unit 31042, an angular prediction unit 31043, and an LM prediction unit 31044. The intra prediction unit 3104 selects a specific prediction unit according to the intra prediction mode, and inputs the unfiltered reference image and the filtered reference image. The relationship between the intra prediction mode and the corresponding prediction unit is as follows: ·Planar Prediction ···Planar Prediction Section 31041 DC prediction DC prediction section 31042 ·Angular Prediction ··Angular Prediction Part 31043 ·LM prediction ··LM prediction unit 31044 (Planar forecast) The planar prediction unit 31041 generates a temporary predicted image by linearly adding a plurality of filtered reference images according to the distance between the pixel position to be predicted and the reference pixel position, and outputs the temporary predicted image to the predicted image correction unit 3105.

[0104] (DC forecast) The DC prediction unit 31042 derives a DC predicted value equivalent to the average value of the filtered reference image s[x][y], and outputs a temporary predicted image q[x][y] whose pixel values ​​are the DC predicted values.

[0105] (Angular prediction) The angular prediction unit 31043 generates a temporary predicted image q[x][y] using the filtered reference image s[x][y] in the prediction direction (reference direction) indicated by the intra prediction mode, and outputs the temporary predicted image q[x][y] to the predicted image correction unit 3105.

[0106] (LM forecast) The LM prediction unit 31044 predicts chrominance pixel values ​​based on luminance pixel values. Specifically, this is a method of generating a predicted image of a chrominance image (Cb, Cr) using a linear model based on the decoded luminance image. CCLM (Cross-Component Linear Model prediction), which is one type of LM prediction, is a prediction method that uses a linear model to predict chrominance from luminance for one block.

[0107] (Configuration of the predicted image correction unit 3105) The predicted image correction unit 3105 corrects the temporary predicted image output from the intra prediction unit 3104 according to the intra prediction mode. Specifically, the predicted image correction unit 3105 performs weighted addition (weighted averaging) of the unfiltered reference image and the temporary predicted image for each pixel of the temporary predicted image according to the distance between the reference region R and the target predicted pixel, thereby deriving a predicted image (corrected predicted image) Pred obtained by correcting the temporary predicted image. Note that in some intra prediction modes, the predicted image correction unit 3105 may not correct the temporary predicted image, and the output of the intra prediction unit 3104 may be used as the predicted image as is.

[0108] (Inverse quantization and inverse transform unit 311) The inverse quantization and inverse transform unit 311 inverse quantizes the quantized transform coefficients qd[ ][ ] input from the entropy decoding unit 301 to obtain transform coefficients d[ ][ ]. These quantized transform coefficients qd[ ][ ] are coefficients obtained by performing frequency transform such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on prediction errors during encoding processing and then quantizing them. The inverse quantization and inverse transform unit 311 performs inverse frequency transform such as inverse DCT or inverse DST on the obtained transform coefficients to calculate prediction errors. The inverse quantization and inverse transform unit 311 outputs the prediction errors to the adder 312.

[0109] An example configuration of the inverse quantization and inverse transform unit 311 will be described below with reference to FIG. 12. FIG. 12 is a functional block diagram showing an example configuration of the inverse quantization and inverse transform unit 311. As shown in FIG. 12, the quantization and inverse transform unit 311 includes an inverse quantization unit 3111 and a transform unit 3112. The inverse quantization unit 3111 inverse quantizes the quantized transform coefficients qd[ ][ ] decoded by the TU decoding unit 3024, and derives transform coefficients d[ ][ ]. The inverse quantization unit 3111 outputs the derived transform coefficients d[ ][ ] to the transform unit 3112.

[0110] The transform unit 3112 inversely transforms the received transform coefficients d[ ][ ] for each transform unit TU to restore the prediction errors r[ ][ ]. The transform unit 3112 outputs the restored prediction errors r[ ][ ] to the adder 312.

[0111] In this specification, the process of converting a differential image into a transform coefficient in an image encoding device is called a forward transform, and the process of converting a transform coefficient into a differential image in an image decoding device is called a transform, but they may also be called a transform and an inverse transform, respectively. Note that there is no difference between a forward transform (transform) and a transform (inverse transform) except for the value of the transform matrix that serves as the transform base. Therefore, in the following description, the term "inverse transform" may be used instead of "transform" when referring to the transform process in the transform unit 3112.

[0112] The conversion unit 3112 includes a secondary conversion unit (second conversion unit) 31121 and a core conversion unit (first conversion unit) 31123.

[0113] The TU decoding unit 3024 may further divide a CU into multiple sub-blocks and decode a sub-block transform flag cu_sbt_flag for decoding transform coefficients, inverse quantization, and inverse transform of only one of the multiple sub-blocks. If cu_sbt_flag is 1, the TU decoding unit 3024 may further decode a flag cu_sbt_quad_flag indicating whether to divide into four sub-blocks. If cu_sbt_quad_flag is 0, the number of sub-blocks is 2. If cu_sbt_quad_flag is 1, the number of sub-blocks is 4. The TU decoding unit 3024 also decodes cu_sbt_horizontal_flag, which indicates whether to divide the CU horizontally or vertically. The TU decoding unit 3024 also decodes cu_sbt_pos_flag, which indicates which sub-block contains the transform coefficients.

[0114] (Scaling part 31112) The scaling unit 31112 scales the transform coefficients decoded by the TU decoding unit using coefficient-by-coefficient weights.

[0115] When transform skip is enabled (transform_skip==1), the scaling unit 31112 performs scaling using the following formula.

[0116] r[x][y] = d[x][y] << tsShift where tsShift = 5 + ((log2(nTbW) + log2(nTbH)) / 2).

[0117] In other cases, the quantization matrix m[x][y] and the scaling factor ls[x][y] are derived using the following equations.

[0118] ls[x][y] = (m[x][y] * levelScale[(qP+1)%6]) << (qP / 6) Alternatively, it may be derived using the following formula:

[0119] ls[x][y] = (m[x][y] * levelScale[qP%6]) << (qP / 6) where levelScale[] = { 40, 45, 51, 57, 64, 72}.

[0120] The values ​​of the quantization matrix m[x][y] may be decoded from the coded data, or m[x][y]=16 may be used as uniform quantization.

[0121] The scaling unit 31112 derives dnc[][] from the product of the scaling factor ls[][] and the decoded transform coefficient TransCoeffLevel, and performs inverse quantization.

[0122] dnc[x][y] = ( TransCoeffLevel[xTbY][yTbY][cIdx][x][y] * ls[x][y] * rectNorm +bdOffset ) >> bdShift Finally, the scaling unit 31112 clips the dequantized transform coefficients to derive d[x][y].

[0123] d[x][y] = Clip3( CoeffMin, CoeffMax, dnc[x][y] ) d[x][y] is transmitted to the core transform unit 31123 or the secondary transform unit 31121. The secondary transform unit (second transform unit) 31121 applies a secondary transform to the transform coefficients d[x][y] after inverse quantization and before the core transform.

[0124] (Secondary and Core Transformations) The secondary transform unit 31121 applies a transform using a transform matrix to some or all of the transform coefficients d[ ][ ] received from the inverse quantization unit 3111, thereby restoring modified transform coefficients d[ ][ ] (transform coefficients after transformation by the second transform unit). The secondary transform unit 31121 applies a secondary transform to the transform coefficients d[ ][ ] of a predetermined unit for each transform unit TU. The secondary transform is applied only to intra CUs, and the transform base is determined with reference to the intra prediction mode IntraPredMode. The selection of the transform base will be described later. The secondary transform unit 31121 outputs the restored modified transform coefficients d[ ][ ] to the core transform unit 31123.

[0125] The core transform unit 31123 acquires the transform coefficients d[ ][ ] or the modified transform coefficients d[ ][ ] restored by the secondary transform unit 31121, performs transformation, and derives prediction errors r[ ][ ]. The core transform unit 31123 outputs the prediction errors r[ ][ ] to the adder 312.

[0126] (Secondary Transformation) The video encoding device 11 applies a further transform (forward secondary transform) to the transform coefficients after the core transform (DCT2, DST7, etc.) of the differential image to remove correlation remaining in the transform coefficients and concentrate energy in some of the transform coefficients. FIG. 19 shows a forward transform unit 1032 included in the transform and quantization unit 103 and an inverse transform unit 152 included in the inverse transform and inverse quantization unit 105 of the video encoding device 11. Conversely, the video decoding device 3 applies a secondary transform to the transform coefficients of some or all of the regions of the decoded TU, and then applies a core transform (DCT2, DST7, etc.) to the transform coefficients after the secondary transform.

[0127] In the secondary transform, the following processes are performed depending on the size of the TU and the intra prediction mode. The secondary transform process will be described below in order. FIG. 13 is a diagram illustrating the secondary transform. The diagram shows a process in which, for an 8x8 TU, the transform coefficients d[][] of a 4x4 region are stored in a non-ZeroSize one-dimensional array u[] in the process of S2, the one-dimensional array u[] is converted into a one-dimensional array v[] in the process of S3, and finally the coefficients are stored again in d[][] in the process of S4.

[0128] FIG. 24 is a flowchart showing the secondary conversion process.

[0129] (S1: Set the conversion size and input / output size) The secondary transform unit 31121 derives the size of the secondary transform (4x4 or 8x8), the number of output transform coefficients (nStOutSize), the number of transform coefficients (input transform coefficients) to be applied (nonZeroSize), and the number of sub-blocks to which the secondary transform is applied (numStX, numStY) according to the size of the TU (width nTbW, height nTbH). The sizes of the 4x4 and 8x8 secondary transform are indicated by nStSize = 4 and 8, respectively. The sizes of the 4x4 and 8x8 secondary transform may also be referred to as RST4x4 and RST8x8, respectively.

[0130] If the TU is equal to or larger than a predetermined size, the secondary transform unit 31121 outputs 48 transform coefficients through a RST8x8 secondary transform. Otherwise, it outputs 16 transform coefficients through a RST4x4 secondary transform. If the TU is 4x4, it derives 16 transform coefficients from 8 transform coefficients using RST4x4, and if the TU is 8x8, it derives 48 transform coefficients from 8 transform coefficients using RST8x8. Otherwise, it outputs 16 or 48 transform coefficients from 16 transform coefficients depending on the size of the TU.

[0131] If nTbW and nTbH are both 8 or more, log2StSize = 3, nStOutSize = 48 Otherwise, log2StSize = 2, nStOutSize=16 nStSize = 1< <log2StSize If nTbW and nTbH are both 4, or 8x8, nonZeroSize = 8 Otherwise, nonZeroSize = 16 numStX = (nTbH == 4 && nTbW > 8) ? 2 : 1 numStY = (nTbW == 4 && nTbH > 8) ? 2 : 1 (S2: Rearrange into one-dimensional signal) The secondary transform unit 31121 first rearranges some of the transform coefficients d[][] of the TU into a one-dimensional array u[] and processes it. Specifically, in the secondary transform, u[] is derived from the two-dimensional transform coefficients d[][] of the target TU by referencing the transform coefficients for x = 0..nonZeroSize-1. xC and yC are positions on the TU and are derived from the array DiagScanOrder, which indicates the scan order, and the position x of the transform coefficient in the sub-block.

[0132] for (x=0; x <nonZeroSize; x++) { xC = (xSbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][0] yC = (ySbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][1] u[x] = d[ xC ][ yC ] } (S3: Applying conversion processing) The secondary transformation unit 31121 performs a transformation on u[] (vector F') of length nonZeroSize using a first type transformation basis (matrix) T, and derives as output a one-dimensional array v'[] (vector V') of length nStOutSize.

[0133] This transformation can be expressed in matrix terms by the following equation:

[0134] V'=T×F' Here, the transformation basis when the transformation size is 4x4 (RST4x4) is called the first kind of transformation basis T1. When the transformation size is 8x8 (RST8x8), the transformation basis is called the second kind of transformation basis T2. T1 is a 16x16 (16 rows, 16 columns) matrix, and the transformation derives a 16x1 (16 rows, 1 column) vector V', i.e., a one-dimensional array v'[] of length 16, by multiplying the 16x16 matrix T by the 16x1 (16 rows, 1 column) vector F'. T2 is a 48x16 (48 rows, 16 columns) matrix, and the transformation derives a 48x1 (48 rows, 1 column, length 48) vector V', i.e., a one-dimensional array v'[] of length 48, by multiplying the 48x16 matrix T by the 16x1 vector F'.

[0135] Specifically, the secondary transform unit 31121 derives a corresponding transform matrix secTranMatrix[][] (transform base T1 or T2) from the set number (stTrSetId) of the secondary transform derived from the intra prediction mode IntraPredMode, stIdx indicating the transform base of the secondary transform decoded from the encoded data, and the secondary transform size nStSize(nTrS). Furthermore, the secondary transform unit 31121 performs a multiply-and-accumulate operation on the transform matrix and the one-dimensional array u[] as shown in the following equation. v'[i] = Clip3( CoeffMin, CoeffMax,ΣsecTransMatrix[j][i]*u[j]) Here, Σ is the sum from j=0 to nonZeroSize-1. Also, processing is performed for i=0 to nStSize-1. CoeffMin and CoeffMax indicate the range of values ​​of the transform coefficients.

[0136] (S4: 2D arrangement of 1D signals after transformation processing) The secondary transformation unit 31121 again places the transformed coefficients v′[ ] of the one-dimensional array at predetermined positions within the TU.

[0137] In process S4, the secondary transform unit 31121 places the coefficient v'[] of length nStOutSize obtained in process S3 above in the upper left area of ​​the transform coefficient array d[][].

[0138] The secondary conversion unit 31121 performs the following process on x = 0..nStSize - 1, y = 0..nStSize - 1. Specifically, the secondary conversion unit 31121 applies the following formula when IntraPredMode <= 34 or INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM.

[0139] d[(xSbIdx< <log2StSize)+x][(ySbIdx<<log2StSize)+y] = (y < 4) ? v[x+(y< <log2StSize)] : ((x < 4) ? v[32 + x + ((y - 4) << 2)] : d[(xSbIdx< <log2StSize)+x][(ySbIdx<<log2StSize)+y]) Otherwise, the secondary conversion unit 31121 applies the following formula: d[(xSbIdx< <log2StSize)+x][(ySbIdx<<log2StSize)+y] = (y < 4) ? v[y+(x< <log2StSize)] : ((x < 4) ? v[32 + (y - 4) + (x << 2)] : d[(xSbIdx<<log2StSize)+x][(ySbIdx<<log2StSize)+y]) (Core conversion unit 31123) <Core Transformation> A transform that can adaptively switch transform methods and can be switched using an explicit flag, index, prediction mode, or the like is called a transform (first transform, core transform). The transform used in the core transform (core transform) is a separable transform consisting of a vertical transform and a horizontal transform. A transform that separates a two-dimensional signal into the horizontal and vertical directions may also be defined as the first transform. In an image decoding device, a transform applied after a second transform (secondary transform) may also be defined as the first transform. The transform bases (transform matrices) of the core transform are DCT2, DST7, and DCT8. In the core transform, the transform bases are switched independently for the vertical transform and the horizontal transform. Selectable transforms are not limited to those listed above, and other transforms (transform bases) may also be used. DCT2, DST7, DCT8, DST1, and DCT5 may also be referred to as DCT-II, DST-VII, DCT-VIII, DST-I, and DCT-V, respectively. A transform skip mode may also be used to explicitly skip the core transform.

[0140] There are two types of core transforms: explicit MTS and implicit MTS. In the case of explicit MTS, mts_idx is decoded from the coded data and the transform matrix is ​​switched. In the case of implicit MTS, mts_idx is derived depending on the intra prediction mode and block size.

[0141] In this embodiment, an example is described in which mts_idx is decoded in units of CU or TU, but the unit of decoding (switching) is not limited to this.

[0142] mts_idx is a switch index for selecting the transformation base of the core transformation. mts_idx has a value of 0, 1, 2, 3, or 4, and derives the horizontal transformation type trTypeHor and the vertical transformation type trTypeVer.

[0143] The core transform described above will be specifically explained using FIG. 18. The core transform unit 1521 in FIG. 18 is an example of the core transform unit 31123 in FIG. 12 and the core transform unit 1521 in FIG. 19. The core transform unit 1521 in FIG. 18 includes an MTS setting unit 15211 that sets the type of transform to be used from multiple transform bases, a coefficient transform processing unit 15212 that calculates prediction residuals r[ ][ ] from (modified) transform coefficients d[ ][ ] using the derived transform, and a matrix transform processing unit 15213 that performs the actual transform. When a secondary transform is not performed, the modified transform coefficients are equal to the transform coefficients. When a secondary transform is performed, the modified transform coefficients have values ​​different from the transform coefficients. The MTS setting unit 15211 includes an MTS setting unit 152111 that determines how to derive the index mts_ids of the transform to be used, and an implicit MTS setting unit 152112 that implicitly derives mts_idx.

[0144] The MTS setting unit 152111 selects whether to perform explicit MTS, implicit MTS, or no MTS.

[0145] If explicit MTS is enabled (sps_explicit_mts_flag is 1), the MTS setting unit 152111 uses the explicit MTS and uses mts_idx decoded from the encoded data in subsequent processing. The flag explicitMtsEnabled indicating whether explicit MTS is enabled may be set separately for intra mode and inter mode. In this case, if the prediction mode PredMode is inter mode (other than MODE_INTRA) and sps_explicit_mts_inter_enabled_flag is 1, or if PredMode is intra mode (MODE_INTRA) and sps_explicit_mts_intra_enabled_flag is 1, the MTS setting unit 152111 may determine that explicit MTS is enabled and decode mts_idx from the encoded data. Furthermore, mts_idx may be decoded only when both the width and height of the TU are 32 or less (nTbW<=32 && nTbH<=32).

[0146] (implicitMTS flag set) If the MTS flag is enabled (sps_mts_enabled_flag==1) and the explicit MTS flag does not indicate enablement (explicitMtsEnabled==0), the MTS setting unit 152111 sets the implicit MTS flag (implicitMtsEnabled) to 1. More specifically, if any of the following conditions is satisfied, the MTS setting unit 152111 sets implicitMtsEnabled=1, and otherwise sets implicitMtsEnabled=0.

[0147] - When intrasubsplit is on (IntraSubPartSplitType != ISP_NO_SPLIT) CU sub-transform is on and TU is less than the specified size (cu_sbt_flag == 1 and Max(nTbW, nTbH ) < 32) - Explicit MTS is off (sps_explicit_mts_intra_enabled_flag and sps_explicit_mts_inter_enabled_flag are both 0) and PredMode is MODE_INTRA In other cases than those mentioned above, the MTS setting unit 152111 sets mts_idx=0.

[0148] (explicit MTS) If the explicit MTS is valid (if sps_explicit_mts_flag is 1), the TU decoding unit 3024 decodes mts_idx from the coded data.

[0149] (Explicit MTS Restrictions) The TU decoding unit 3024 may limit the range (type) of transformation matrices selected by the transformation unit depending on whether the secondary transformation is enabled. For example, when explicit MTS is enabled and the secondary transformation is enabled (stIdx!=0), the TU decoding unit 3024 decodes the mts_idx of the maximum value cMaxSt1. Otherwise, when the secondary transformation is not enabled (stIdx==0), the TU decoding unit 3024 decodes the mts_idx of the maximum value cMaxSt0. Here, it is assumed that cMaxSt0>cMaxSt1.

[0150] (Restriction example 1) If explicit MTS is enabled and secondary transform is enabled (stIdx!=0), the TU decoding unit 3024 sets mts_idx=0 (trTypeHor=trTypeVer=0=DCT2). In this case, the maximum value of mts_idx, cMax, is 0. In other cases, one of mts_idx=0, 1, 2, 3, and 4 is decoded. In this case, the maximum value of mts_idx, cMax, is 4. As will be described later, mts_idx=1, 2, 3, and 4 may be a combination of DST7 and DCT8, a combination of DCT8 and DST7, or a combination of DCT8 and DCT8, respectively, as trTypeHor and trTypeVer. In place of DST7, a transform combining DST1 or DCT4, or a combination of pre- and post-processing with DCT2 may be performed.

[0151] (Restriction example 2) The TU decoding unit 3024 decodes mts_idx when explicit MTS is enabled and secondary transform is enabled (stIdx!=0). mtx_idx is 0 (trTypeHor=trTypeVer=0=DCT2) or 1 (trTypeHor=trTypeVer=1=DST7). In this case, the maximum value of mts_idx, cMax, is 1. In other cases, mts_idx is decoded as 0, 1, 2, 3, or 4. In this case, the maximum value of mts_idx, cMax, is 4. Note that, as described below, mts_idx = 2, 3, or 4 may be a combination of DST7 and DCT8, or a combination of DCT8 and DST7, or a combination of DCT8 and DCT8, respectively, as trTypeHor and trTypeVer.

[0152] (Restriction example 3) If explicit MTS is enabled and secondary transform is on (stIdx!=0), the TU decoding unit 3024 decodes mts_idx as 0, 1, or 2. In this case, the maximum value of mts_idx, cMax = 2. In other cases, it decodes mts_idx as 0, 1, 2, 3, or 4. In this case, the maximum value of mts_idx, cMax = 4.

[0153] According to the above configuration, in the case of secondary transform, the effective range of MTS can be limited, which simplifies coding. For example, in Restriction Example 2, secondary transform is not performed in the case of DCT8, whose effect overlaps with secondary transform, so overhead due to mts_idx is reduced and coding efficiency is improved.

[0154] <Explicit MTS Summary> An image decoding device includes a transform unit that transforms transform coefficients for each TU, the transform unit including: a second transform unit that applies a transform using a transform matrix to input transform coefficients when a secondary transform is enabled; and a first transform unit that selects one transform matrix indicated by mtx_idx from two or more transform matrices and applies the transform to the transform coefficients; a TU decoding unit that decodes mts_idx, where mts_idx is a value in a first range when the secondary transform is enabled (stIdx!=0), and a value in a second range when the secondary transform is not enabled (stIdx==0), the second range including the first range. The TU decoding unit decodes mts_idx. Here, mts_idx has a maximum value of cMaxSt1 when the secondary transform is enabled (stIdx!=0), and a maximum value of cMaxSt0 when the secondary transform is not enabled (stIdx==0), where cMaxSt1<cMaxSt0.

[0155] (Implicit MTS) In the case of implicit MTS, the implicit MTS setting unit 152112 performs the following processing.

[0156] (SM001) When the intra sub-split mode is used (IntraSubPartSplitType!=ISP_NO_SPLIT), the implicit MTS setting unit 152112 sets the transform types tyTypeHor and tyTypeVer to either 0 (DCT2) or 1 (DST7) depending on the intra prediction mode IntraPredMode and the TU size, as shown in Figure 14.

[0157] (SM002) In cases other than those mentioned above and when sub-block transformation is on (cu_sbt_flag==1), the implicit MTS setting unit 152112 sets tyTypeHor and tyTypeVer to either 1 (DST7) or 2 (DCT8) according to cu_sbt_horizontal_flag and cu_sbt_pos_flag, as shown in FIG. 15.

[0158] (SM003) In cases other than those described above (default implicit MTS), the implicit MTS setting unit 152112 sets tyTypeHor and tyTypeVer to either 0 (DCT2) or 1 (DST7) depending on the TU size (width nTbW, height nTbH). Specifically, as shown in FIG. 21, if the width nTbW is within a predetermined range (S1301), the horizontal transformation type trTypeHor is set to 1 (DCT1) (S1302), and otherwise it is set to 0 (DCT2) (S1303). Similarly, if the height nTbH is within a predetermined range (S1304), the vertical transformation type trTypeVer is set to 1 (DCT1) (S1305), and otherwise it is set to 0 (DCT2) (S1306).

[0159] trTypeHor = ( nTbW >= 4 && nTbW <= 16 && nTbW <= nTbH ) ? 1 : 0 trTypeVer = ( nTbH >= 4 && nTbH <= 16 && nTbH <= nTbW ) ? 1 : 0 The predetermined range is not limited to the above, and may be, for example, the following:

[0160] trTypeHor = ( nTbW >= 4 && nTbW <= 8 && nTbW <= nTbH ) ? 1 : 0 trTypeVer = ( nTbH >= 4 && nTbH <= 8 && nTbH <= nTbW ) ? 1 : 0 The default implicit MTS described above is the most common mode of implicit MTS.

[0161] (First embodiment of implicit MTS) If secondary conversion is on (stIdx!=0), the MTS setting unit 15211 does not perform implicit MTS and sets implicitMtsEnabled to 0. Specifically, as shown in Fig. 20, in the above-mentioned (implicitMTS flag setting), if any of the following conditions is satisfied and secondary conversion is not on (other than stIdx!=0) (S1500), the MTS setting unit 152111 sets implicitMtsEnabled=1 (S1504), and otherwise sets implicitMtsEnabled=0 (S1505).

[0162] (S1501) When intra-sub-split is on (IntraSubPartSplitType != ISP_NO_SPLIT) (S1502) CU sub-transform is on and TU is less than the specified size (cu_sbt_flag == 1 and Max(nTbW, nTbH) < 32) (S1503) Explicit MTS is off (sps_explicit_mts_intra_enabled_flag and sps_explicit_mts_inter_enabled_flag are both 0), and PredMode is MODE_INTRA Note that the determinations in S1501 to S1503 shown in the dotted box in the figure may be different, for example, there may be cases where intra sub-division determination is not performed, where sub-block transformation is not performed, or where other prediction or transformation determinations are added.

[0163] According to the above configuration, even if MTS is valid, implicit MTS is not used when secondary transform is used (stIdx!=0). As a result, when secondary transform is used, DCT2 is used as MTS, which has the effect of improving coding efficiency.

[0164] (Implicit MTS Implementation Example 2) If the MTS flag is enabled (sps_mts_enabled_flag==1) and the explicit MTS flag does not indicate enablement (explicitMtsEnabled==0), the implicit MTS setting unit 152112 may derive trTypHor = trTypeVer = 0. For example, SM000 may be performed before the above SM001.

[0165] FIG. 21 is a diagram illustrating the operation of the implicit MTS setting unit 152112.

[0166] (SM000) If stIdx!=0, the implicit MTS setting unit 152112 derives trTypeHor=trTypeVer=0.

[0167] 21, the implicit MTS setting unit 152112 may derive the conversion type by deriving the default implicit MTS (SM003) already described when stIdx == 0. Alternatively, the conversion type may be derived by SM001 and SM002.

[0168] According to the above configuration, when implicit MTS is enabled and secondary transform is enabled, DCT2 is used as MTS, thereby achieving the effect of improving coding efficiency.

[0169] (Third embodiment of implicit MTS) The implicit MTS setting unit 152112 does not need to use implicit MTS (for example, set implicitMtsEnabled to 0) if secondary conversion is on (stIdx!=0) and neither MTS based on intra-sub split mode (SM001, IntraSubPartSplitType!=ISP_NO_SPLIT) nor MTS based on sub-block conversion (SM002, cu_sbt_flag == 1) is used.

[0170] Also, when secondary transformation is on (stIdx != 0) and neither MTS by intra sub-split mode (SM001, IntraSubPartSplitType != ISP_NO_SPLIT) nor MTS by sub-block transformation (SM002, cu_sbt_flag == 1) is used, trTypeHor = trTypeVer = 0 is derived. For example, as shown in Fig. 22, SM003' may be performed instead of the above SM003.

[0171] (SM003') In cases other than those described above (default implicit MTS), the implicit MTS setting unit 152112 sets either 0 (DCT2) or 1 (DST7) as tyTypeHor and tyTypeVer depending on the secondary transformation and TU size (width nTbW, height nTbH). For example, if stIdx == 0 and the width nTbW is within a predetermined range (S1301'), the implicit MTS setting unit 152112 selects 1 (DCT1) as the horizontal transformation type trTypeHor (S1302), and sets 0 (DCT2) otherwise (S1303). Similarly, if stIdx == 0 and the height nTbH is within a predetermined range (S1304'), the implicit MTS setting unit 152112 sets 1 (DCT1) as the vertical transformation type trTypeVer (S1305), and sets 0 (DCT2) otherwise (S1306).

[0172] trTypeHor = (stIdx == 0 && nTbW >= 4 && nTbW <= 16 && nTbW <= nTbH) ? 1 : 0 trTypeVer = (stIdx == 0 && nTbH >= 4 && nTbH <= 16 && nTbH <= nTbW) ? 1 : 0 According to the above configuration, when the implicit MTS is enabled and the secondary transform is enabled, the DCT2 is used as the default MTS, thereby improving the coding efficiency.

[0173] The MTS setting unit 15211 derives the index trType of the transform set to be used by the following equation, and outputs it to the coefficient transformation processing unit 15212. The coefficient transformation processing unit 15212 outputs the input trType to the transformation matrix derivation unit 152131. The MTS setting unit 152111 derives a value indicating the MTS to be used by the following equation.

[0174] If mts_idx == 0, then trTypeHor = 0 trTypeVer = 0 if mts_idx == 1, trTypeHor = 1 trTypeVer = 1 if mts_idx == 2, trTypeHor = 2 trTypeVer = 1 if mts_idx == 3, trTypeHor = 1 trTypeVer = 2 If mts_idx == 4, then trTypeHor = 2 trTypeVer = 2 When tyType (trTypeHor or trTypeVer) is 0, 1, or 2, the corresponding transformation base may be DCT2, DST7, or DCT8.

[0175] The coefficient transformation processing unit 15212 is made up of a vertical transformation unit 152121 that performs vertical transformation on the modified transformation coefficients d[ ][ ], and a horizontal transformation unit 152123 that performs horizontal transformation.

[0176] The vertical transformation unit 152121 (coefficient transformation processing unit 15212) performs the following processing.

[0177] e[ x ][ y ] = Σ (transMatrix[ y ][ j ]×d[ x ][ j ]) (j = 0..nTbS - 1) Here, transMatrix[ ][ ] (=transMatrixV[ ][ ]) is the transformation basis expressed as an nTbS × nTbS matrix derived using trTypeVer. nTbS is the TU height nTbH. For a 4x4 DCT2 transformation (nTbS=4) with trType==0, for example, transMatrix={{29, 55, 74, 84}{74, 74, 0,-74}{84, -29, -74, 55}{55, -84, 74, -29}} is used. The symbol Σ denotes the process of adding the product of the matrix transMatrix[ y ][ j ] and the transformation coefficient d[ x ][ j ] for j = 0..nTbS-1. That is, e[x][y] is the sequence of columns obtained by multiplying the vector x[j] (j = 0..nTbS-1), which consists of the columns of d[x][y], d[x][j] (j = 0..nTbS-1), by the matrix elements transMatrix[y][j].

[0178] The intermediate clipping unit 152122 derives intermediate values ​​g[ ][ ] by clipping the intermediate values ​​e[ ][ ], and sends them to the horizontal conversion unit 152123.

[0179] g[ x ][ y ] = Clip3( coeffMin, coeffMax, ( e[ x ][ y ] + 64 ) >> 7 ) The numbers 64 and 7 in the above formula are determined by the bit depth of the conversion base, and in the above formula, the conversion base is assumed to be 7 bits. Also, coeffMin and coeffMax are the minimum and maximum values ​​of clipping.

[0180] The horizontal transform unit 152123 (coefficient transform processing unit 15212) performs the following processing. transMatrix[ ][ ] (=transMatrixH[ ][ ]) is a transform base expressed as an nTbS × nTbS matrix derived using trTypeHor. nTbS is the width nTbW of the TU. The horizontal transform unit 152123 transforms the intermediate value g[x][y] into a prediction residual r[x][y] through a horizontal one-dimensional transform.

[0181] r[ x ][ y ] =Σ transMatrix[ x ][ j ]×g[ j ][ y ] (j = 0..nTbS-1) The symbol Σ above means the process of adding the products of the matrices transMatrix[x][j] and g[j][y] for j = 0..nTbS-1. In other words, r[x][y] is the arrangement of the rows obtained by multiplying each row of g[x][y], g[j][y] (j = 0..nTbS-1), by the matrix transMatrix.

[0182] The prediction residuals r[ ][ ] are sent from the horizontal transform unit 152123 to the adder 312.

[0183] The vertical transformation unit 152121 and horizontal transformation unit 152123 perform transformations using a matrix transformation processing unit 15213. The matrix transformation processing unit 15213 is made up of a transformation matrix derivation unit 152131 and a transformation processing unit 152132.

[0184] The transformation matrix derivation unit 152131 derives the transformation matrix transMatrix[ ][ ] according to the length of the TU (nTbW, nTbH) and the index tyType (trTypeHor, trTypeVer) of the core transformation.

[0185] The matrix transformation processing unit 15213 transforms the input one-dimensional array xx[j] into a one-dimensional array yy[i] using the derived transformation matrix transMatrix[][], and performs vertical and horizontal transformations. For vertical transformation, the transformation coefficients d[x][j] in the x column are input as one-dimensional transformation coefficients xx[j], and transformation is performed. For horizontal transformation, the intermediate coefficients g[j][y] in the y row are input as xx[j], and transformation is performed.

[0186] yy[i] =Σ (transMatrix[ i ][ j ]×xx[ j ]) (j = 0..nTbS-1) <Secondary Transformation> When decoding the secondary transform stIdx, the TU decoding unit 3024 may limit the range of the value of stIdx to be decoded depending on whether the value of mts_idx is valid or not.

[0187] (Restriction example 1) When mts_idx is 0, the TU decoding unit 3024 sets the maximum value cMax of stIdx to be decoded to 1 and decodes stIdx=0 to 2. In other cases, that is, when mts_idx=1, 2, 3, or 4, the TU decoding unit 3024 derives stIdx=0 without decoding stIdx from the coded data.

[0188] (Restriction example 2) When mts_idx is 0..1, the TU decoding unit 3024 sets the maximum value cMax of stIdx to be decoded to 1, and decodes stIdx = 0 to 2. In other cases, that is, when mts_idx = 2, 3, or 4, the TU decoding unit 3024 derives stIdx = 0 without decoding stIdx from the coded data.

[0189] (Restriction example 3) When mts_idx is 0, 1, or 2, the TU decoding unit 3024 sets the maximum value cMax of stIdx to be decoded to 1, and decodes stIdx=0 to 2. In other cases, that is, when mts_idx=3 or 4, the TU decoding unit 3024 derives stIdx=0 without decoding stIdx from the coded data.

[0190] According to the above configuration, the variable stIdx indicating the type of secondary transform is decoded only when a transform within a predetermined range is performed in MTS, thereby limiting the effective range of the secondary transform and simplifying the coding. Also, in Restriction Example 2, for example, the secondary transform is not performed in the case of DCT8, whose effect overlaps with the secondary transform, thereby reducing the overhead due to stIdx and improving the coding efficiency.

[0191] The adder 312 generates a decoded image for the block by adding, for each pixel, the predicted image for the block input from the predicted image generation unit 308 and the prediction error input from the inverse quantization and inverse transform unit 311. The adder 312 stores the decoded image for the block in the reference picture memory 306 and also outputs it to the loop filter 305.

[0192] (Configuration of a video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Fig. 16 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 includes a prediction image generation unit 101, a subtraction unit 102, a transformation and quantization unit 103, an inverse quantization and inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference image storage unit, frame memory) 109, a coding parameter determination unit 110, a parameter coding unit 111, and an entropy coding unit 104.

[0193] The predicted image generation unit 101 generates a predicted image for each CU, which is an area obtained by dividing each picture of the image T. The predicted image generation unit 101 operates in the same manner as the predicted image generation unit 308 already described, and therefore a description thereof will be omitted.

[0194] The subtraction unit 102 generates a prediction error by subtracting pixel values ​​of the predicted image of the block input from the predicted image generation unit 101 from pixel values ​​of the image T. The subtraction unit 102 outputs the prediction error to the transformation and quantization unit 103.

[0195] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction errors input from the subtraction unit 102, and derives quantized transform coefficients by quantizing them. The transform / quantization unit 103 outputs the quantized transform coefficients to the entropy coding unit 104 and the inverse quantization / inverse transform unit 105.

[0196] As shown in FIG. 19, the transform / quantization unit 103 includes a forward core transform unit 10321 (first transform unit) and a forward secondary transform unit 10322 (second transform unit).

[0197] The forward secondary transform applied in the video encoding device 11 is substantially the same as the secondary transform processes S1-S4 applied in the video decoding device 31, except that they are applied in reverse order: S1, S4, S3, S2.

[0198] In process S1, the forward secondary transform unit 10322 performs the same process as the secondary transform unit 31121, except that the input and output of the secondary transform have lengths nStOutSize and nonZeroSize, respectively.

[0199] In process S4, the forward secondary transform unit 10322 derives a one-dimensional array v[] of nStOutSize (or nStSize*nStSize) from the transform coefficients d[][] at predetermined positions within the TU.

[0200] In process S3, the forward secondary transformation unit 10322 obtains a one-dimensional array u[] (vector F) of nonZeroSize from the one-dimensional array v[] (vector V) of nStOutSize and the transformation matrix T[][] by the following transformation.

[0201] F=trans(T)×V Here, trans(T) is the transposed matrix of T. The secondary transformation unit may derive the one-dimensional array u[] (vector F) by the following formula:

[0202] F=Tinv×V Here, T inv is the inverse matrix of T. T is composed of a first type transformation base T1 and a second type transformation base T2. Note that the secondary transformation unit may use an orthogonal matrix for T to set trans(T) of T as T inv.

[0203] In actual processing, since T is a matrix of integer values, it is not T×Tinv=I (unit matrix) but a constant multiple of the unit matrix (T×Tinv=K2×I, where K2 is a constant). In this case, the secondary transformation unit uses a matrix that is a constant multiple of the inverse matrix as Tinv, but the inverse matrix may be used as is for the transposed matrix.

[0204] In process S2, the forward secondary transform unit 10322 rearranges the one-dimensional array u[] of non-ZeroSize into a two-dimensional array, and derives the transform coefficients d[][].

[0205] for (x=0; x <nonZeroSize; x++) { xC = (xSbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][0] yC = (ySbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][1] d[xC][yC] = u[x] } The inverse quantization and inverse transform unit 105 is the same as the inverse quantization and inverse transform unit 311 (FIG. 15) in the video decoding device 31, and a description thereof will be omitted. The calculated prediction error is output to the adder .

[0206] The entropy coding unit 104 receives the quantized transform coefficients from the transform / quantization unit 103 and the coding parameters from the parameter coding unit 111. The coding parameters are, for example, predMode.

[0207] The entropy coding unit 104 entropy codes the division information, prediction parameters, quantized transform coefficients, etc. to generate and output a coded stream Te.

[0208] The parameter coding unit 111 includes a header coding unit 1110, a CT information coding unit 1111, a CU coding unit 1112 (prediction mode coding unit), an inter prediction parameter coding unit 112, and an intra prediction parameter coding unit 113. The CU coding unit 1112 further includes a TU coding unit 1114.

[0209] The operation of each module will be outlined below: The parameter coding unit 111 performs coding processing of parameters such as header information, division information, prediction information, and quantized transform coefficients.

[0210] The CT information encoding unit 1111 encodes QT, MT (BT, TT) division information and the like from the encoded data.

[0211] The CU encoding unit 1112 encodes the CU information, prediction information, TU division flag, CU residual flag, and the like.

[0212] When a prediction error is included in a TU, the TU encoding unit 1114 encodes the QP update information (quantization correction value) and the quantized prediction error (residual_coding).

[0213] The CT information encoding unit 1111 and the CU encoding unit 1112 supply syntax elements such as inter prediction parameters, intra prediction parameters (intra_luma_mpm_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder), and quantized transform coefficients to the entropy encoding unit 104.

[0214] (Configuration of the intra-prediction parameter encoding unit 113) The intra prediction parameter coding unit 113 derives a coding format (for example, intra_luma_mpm_idx, intra_luma_mpm_remainder, etc.) from the IntraPredMode input from the coding parameter determination unit 110. The intra prediction parameter coding unit 113 includes a configuration that is partially the same as the configuration used by the intra prediction parameter decoding unit 304 to derive intra prediction parameters.

[0215] 17 is a schematic diagram showing the configuration of the intra-prediction parameter coding unit 113 of the parameter coding unit 111. The intra-prediction parameter coding unit 113 includes a parameter coding control unit 1131, a luma intra-prediction parameter derivation unit 1132, and a chroma intra-prediction parameter derivation unit 1133.

[0216] The parameter coding control unit 1131 receives IntraPredModeY and IntraPredModeC as input from the coding parameter determination unit 110. The parameter coding control unit 1131 determines intra_luma_mpm_flag with reference to mpmCandList[ ] of the MPM candidate list derivation unit 30421. Then, the parameter coding control unit 1131 outputs intra_luma_mpm_flag and IntraPredModeY to the luma intra prediction parameter derivation unit 1132. Furthermore, the parameter coding control unit 1131 outputs IntraPredModeC to the chroma intra prediction parameter derivation unit 1133.

[0217] The luma intra prediction parameter derivation unit 1132 includes an MPM candidate list derivation unit 30421 (candidate list derivation unit), an MPM parameter derivation unit 11322, and a non-MPM parameter derivation unit 11323 (encoding unit, derivation unit).

[0218] The MPM candidate list derivation unit 30421 derives mpmCandList[] by referencing the intra prediction modes of neighboring blocks stored in the prediction parameter memory 108. When intra_luma_mpm_flag is 1, the MPM parameter derivation unit 11322 derives intra_luma_mpm_idx from IntraPredModeY and mpmCandList[], and outputs this to the entropy coding unit 104. When intra_luma_mpm_flag is 0, the non-MPM parameter derivation unit 11323 derives RemIntraPredMode from IntraPredModeY and mpmCandList[], and outputs intra_luma_mpm_remainder to the entropy coding unit 104.

[0219] The color difference intra prediction parameter derivation unit 1133 derives and outputs intra_chroma_pred_mode from IntraPredModeY and IntraPredModeC.

[0220] The adder 106 generates a decoded image by adding, for each pixel, the pixel values ​​of the predicted image of the block input from the predicted image generation unit 101 and the prediction error input from the inverse quantization and inverse transform unit 105. The adder 106 stores the generated decoded image in the reference picture memory 109.

[0221] The loop filter 107 performs deblocking filtering, SAO, and ALF on the decoded image generated by the adder 106. Note that the loop filter 107 does not necessarily have to include the above three types of filters, and may be configured with only a deblocking filter, for example.

[0222] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in a predetermined location for each current picture and CU.

[0223] The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined location for each current picture and CU.

[0224] The coding parameter determination unit 110 selects one set of coding parameters from among a plurality of sets of coding parameters. The coding parameters are the above-mentioned QT, BT, or TT division information, prediction parameters, or parameters to be coded that are generated in relation to these. The predicted image generation unit 101 generates a predicted image using these coding parameters.

[0225] The coding parameter determination unit 110 calculates an RD cost value indicating the amount of information and the coding error for each of the multiple sets. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. As a result, the entropy coding unit 104 outputs the selected set of coding parameters as the coded stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the prediction parameter memory 108.

[0226] Note that parts of the video encoding device 11 and the video decoding device 31 in the above-described embodiments, such as the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generation unit 308, the inverse quantization and inverse transform unit 311, the adder unit 312, the predicted image generation unit 101, the subtractor unit 102, the transform and quantization unit 103, the entropy encoding unit 104, the inverse quantization and inverse transform unit 105, the loop filter 107, the encoding parameter determination unit 110, and the parameter encoding unit 111, may be implemented by a computer. In this case, a program for implementing these control functions may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read and executed by a computer system. Note that the term "computer system" used here refers to a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. Furthermore, "computer-readable recording media" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, as well as storage devices such as hard disks built into computer systems. Furthermore, "computer-readable recording media" may also include devices that dynamically store programs for a short period of time, such as communication lines used when transmitting programs over networks like the Internet or communication lines like telephone lines, or devices that store programs for a fixed period of time, such as volatile memory within computer systems that serve as servers or clients in such cases. Furthermore, the above-mentioned programs may be programs that realize some of the aforementioned functions, or may be programs that can realize the aforementioned functions in combination with programs already stored in the computer system.

[0227] Furthermore, part or all of the video encoding device 11 and the video decoding device 31 in the above-described embodiments may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and the video decoding device 31 may be individually implemented as a processor, or part or all of them may be integrated into a processor. Furthermore, the integrated circuit implementation method is not limited to LSI, and may be implemented using a dedicated circuit or a general-purpose processor. Furthermore, if an integrated circuit implementation technology that can replace LSI emerges due to advances in semiconductor technology, an integrated circuit based on that technology may be used.

[0228] One embodiment of the present invention has been described in detail above with reference to the drawings, but the specific configuration is not limited to that described above, and various design changes and the like are possible within the scope that does not deviate from the gist of the present invention.

[0229] [Application example] The above-described video encoding device 11 and video decoding device 31 can be mounted and used in various devices that transmit, receive, record, and play back video. The video may be a natural video captured by a camera or the like, or an artificial video (including CG and GUI) generated by a computer or the like.

[0230] First, it will be explained with reference to FIG. 2 that the above-described video encoding device 11 and video decoding device 31 can be used for transmitting and receiving video.

[0231] 2 is a block diagram showing the configuration of a transmitting device PROD_A equipped with a video encoding device 11. As shown in the figure, the transmitting device PROD_A includes an encoding unit PROD_A1 that encodes video to obtain encoded data, a modulation unit PROD_A2 that modulates a carrier wave with the encoded data obtained by the encoding unit PROD_A1 to obtain a modulated signal, and a transmitting unit PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The above-described video encoding device 11 is used as this encoding unit PROD_A1.

[0232] The transmitting device PROD_A may further include a camera PROD_A4 that captures moving images, a recording medium PROD_A5 that records moving images, an input terminal PROD_A6 for inputting moving images from the outside, and an image processing unit A7 that generates or processes images, as sources of moving images to be input to the encoding unit PROD_A1. In the figure, the transmitting device PROD_A is shown as having all of these components, but some of them may be omitted.

[0233] The recording medium PROD_A5 may record unencoded video, or may record video encoded using a recording encoding method that is different from the transmission encoding method. In the latter case, a decoding unit (not shown) that decodes the encoded data read from the recording medium PROD_A5 according to the recording encoding method may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.

[0234] 2 is a block diagram showing the configuration of a receiving device PROD_B equipped with a video decoding device 31. As shown in the figure, the receiving device PROD_B includes a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains coded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a decoding unit PROD_B3 that obtains video by decoding the coded data obtained by the demodulating unit PROD_B2. The above-mentioned video decoding device 31 is used as this decoding unit PROD_B3.

[0235] The receiving device PROD_B may further include, as destinations of the moving images output by the decoding unit PROD_B3, a display PROD_B4 for displaying the moving images, a recording medium PROD_B5 for recording the moving images, and an output terminal PROD_B6 for outputting the moving images to the outside. In the figure, the receiving device PROD_B is shown as having all of these components, but some of them may be omitted.

[0236] The recording medium PROD_B5 may be for recording unencoded video, or may be encoded using an encoding method for recording that is different from the encoding method for transmission. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_B3 and the recording medium PROD_B5, which encodes the video acquired from the decoding unit PROD_B3 according to the encoding method for recording.

[0237] The transmission medium for transmitting the modulated signal may be wireless or wired. The transmission mode for transmitting the modulated signal may be broadcast (here, this refers to a transmission mode in which the destination is not specified in advance) or communication (here, this refers to a transmission mode in which the destination is specified in advance). In other words, the transmission of the modulated signal may be realized by any of wireless broadcasting, wired broadcasting, wireless communication, and wired communication.

[0238] For example, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) for terrestrial digital broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wireless broadcasting. Also, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) for cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by cable broadcasting.

[0239] Furthermore, a server (such as a workstation) / client (such as a television receiver, personal computer, smartphone, etc.) of an Internet-based VOD (Video On Demand) service or video sharing service is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals via communication (usually, in a LAN, either wireless or wired is used as the transmission medium, while in a WAN, wired is used as the transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Furthermore, smartphones also include multi-function mobile phone terminals.

[0240] The client of the video hosting service has the function of decoding the encoded data downloaded from the server and displaying it on a display, as well as the function of encoding the video images captured by a camera and uploading them to the server. In other words, the client of the video hosting service functions as both the transmitting device PROD_A and the receiving device PROD_B.

[0241] Next, it will be explained with reference to FIG. 3 that the above-described video encoding device 11 and video decoding device 31 can be used for recording and reproducing video.

[0242] 3 is a block diagram showing the configuration of a recording device PROD_C equipped with the above-described video encoding device 11. As shown in the figure, the recording device PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding video, and a writing unit PROD_C2 that writes the encoded data obtained by the encoding unit PROD_C1 onto a recording medium PROD_M. The above-described video encoding device 11 is used as this encoding unit PROD_C1.

[0243] The recording medium PROD_M may be (1) a type that is built into the recording device PROD_C, such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), (2) a type that is connected to the recording device PROD_C, such as an SD memory card or USB (Universal Serial Bus) flash memory, or (3) a type that is loaded into a drive device (not shown) built into the recording device PROD_C, such as a DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray Disc: registered trademark).

[0244] The recording device PROD_C may further include a camera PROD_C3 that captures moving images, an input terminal PROD_C4 for inputting moving images from the outside, a receiving unit PROD_C5 for receiving moving images, and an image processing unit PROD_C6 that generates or processes images, as sources of moving images to be input to the encoding unit PROD_C1. Although the figure illustrates a configuration in which the recording device PROD_C includes all of these components, some of them may be omitted.

[0245] The receiving unit PROD_C5 may receive unencoded video, or may receive encoded data encoded by a transmission encoding method different from the recording encoding method. In the latter case, a transmission decoding unit (not shown) that decodes the encoded data encoded by the transmission encoding method may be interposed between the receiving unit PROD_C5 and the encoding unit PROD_C1.

[0246] Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main source of the moving images).Other examples of such a recording device PROD_C include a camcorder (in this case, the camera PROD_C3 is the main source of the moving images), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main source of the moving images), and a smartphone (in this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of the moving images).

[0247] 3 is a block diagram showing the configuration of a playback device PROD_D equipped with the above-mentioned video decoding device 31. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads coded data written to a recording medium PROD_M, and a decoding unit PROD_D2 that obtains video by decoding the coded data read by the reading unit PROD_D1. The above-mentioned video decoding device 31 is used as this decoding unit PROD_D2.

[0248] The recording medium PROD_M may be (1) a type that is built into the playback device PROD_D, such as an HDD or SSD, (2) a type that is connected to the playback device PROD_D, such as an SD memory card or USB flash memory, or (3) a type that is loaded into a drive device (not shown) built into the playback device PROD_D, such as a DVD or BD.

[0249] The playback device PROD_D may further include, as destinations of the video output by the decoding unit PROD_D2, a display PROD_D3 that displays the video, an output terminal PROD_D4 that outputs the video to the outside, and a transmission unit PROD_D5 that transmits the video. Although the figure shows an example of a configuration in which the playback device PROD_D includes all of these, some of them may be omitted.

[0250] The transmitting unit PROD_D5 may transmit unencoded video, or may transmit encoded data encoded by a transmission encoding method different from the recording encoding method. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_D2 and the transmitting unit PROD_D5, which encodes the video by the transmission encoding method.

[0251] Examples of such a playback device PROD_D include a DVD player, a BD player, and an HDD player (in this case, the output terminal PROD_D4 to which a television receiver or the like is connected is the main supply destination of the moving images). Other examples of such a playback device PROD_D include a television receiver (in this case, the display PROD_D3 is the main supply destination of the moving images), a digital signage (also called an electronic billboard or electronic bulletin board, and the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the moving images), a desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main supply destination of the moving images), a laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the moving images), and a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the moving images).

[0252] (Hardware and software implementation) Furthermore, each block of the above-mentioned video decoding device 31 and video encoding device 11 may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be realized in software by using a CPU (Central Processing Unit).

[0253] In the latter case, each of the above devices includes a CPU that executes instructions of a program that realizes each function, a ROM (Read Only Memory) that stores the program, a RAM (Random Access Memory) that expands the program, a storage device (recording medium) such as a memory that stores the program and various data, etc. The object of the embodiment of the present invention can also be achieved by supplying each of the above devices with a recording medium on which program code (executable program, intermediate code program, source program) of a control program for each of the above devices, which is software that realizes the above-mentioned functions, is recorded in a computer-readable manner, and having the computer (or CPU or MPU) read and execute the program code recorded on the recording medium.

[0254] Examples of the recording medium include tapes such as magnetic tape and cassette tape, magnetic disks such as floppy disks (registered trademark) and hard disks, disks including optical disks such as CD-ROMs (Compact Disc Read-Only Memory), MO disks (Magneto-Optical discs), MDs (Mini Discs), DVDs (Digital Versatile Discs: registered trademark), CD-Rs (CD Recordable), and Blu-ray Discs (registered trademark), cards such as IC cards (including memory cards) and optical cards, semiconductor memories such as mask ROMs, EPROMs (Erasable Programmable Read-Only Memory), EEPROMs (Electrically Erasable and Programmable Read-Only Memory: registered trademark), and flash ROMs, and logic circuits such as PLDs (Programmable logic devices) and FPGAs (Field Programmable Gate Arrays).

[0255] Furthermore, each of the above devices may be configured to be connectable to a communications network, and the program code may be supplied via the communications network. This communications network may be any network capable of transmitting the program code. For example, the Internet, an intranet, an extranet, a local area network (LAN), an integrated services digital network (ISDN), a value-added network (VAN), a community antenna television / cable television (CATV) communications network, a virtual private network, a telephone line network, a mobile communications network, a satellite communications network, etc. Furthermore, the transmission media constituting this communications network may be any medium capable of transmitting the program code, and are not limited to any particular configuration or type. For example, the present invention can be used in wired communication such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, or ADSL (Asymmetric Digital Subscriber Line) line, or in wireless communication such as IrDA (Infrared Data Association), infrared such as that used in remote controls, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone networks, satellite lines, or terrestrial digital broadcasting networks. Note that the present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.

[0256] The present invention is not limited to the above-described embodiments, and various modifications are possible within the scope of the claims. In other words, embodiments obtained by combining technical means modified appropriately within the scope of the claims are also included in the technical scope of the present invention.

[0257] 〔summary〕 A video decoding device according to one embodiment of the present invention is an image decoding device that transforms transform coefficients for each transform unit, and includes: a second transform unit that, when a secondary transform is enabled, applies a transform using a transform matrix to the transform coefficients to modify the transform coefficients; a first transform unit that applies a separable transform consisting of a vertical transform and a horizontal transform to the transform coefficients; and an implicit transform setting unit that, when the secondary transform is enabled, an intra subdivision mode is not used, and a sub-block transform is not used, turns off implicit transform, and, when the implicit transform is on, derives a horizontal transform type according to the width of the target TU and derives a vertical transform type according to the height of the target TU, and is characterized in that the first transform unit performs a transform according to the vertical transform type and a transform according to the horizontal transform type. An image decoding device according to one embodiment of the present invention is an image decoding device that transforms transform coefficients for each transform unit, and includes: a decoding unit that decodes an index that indicates that a secondary transform is not used when the value of the index is 0; a second transform unit that applies the secondary transform to the transform coefficients when the value of the index is other than 0 and outputs modified transform coefficients; a first transform unit that applies a separable transform consisting of a vertical transform and a horizontal transform to the transform coefficients or the modified transform coefficients; and an implicit transform setting unit that sets the value of a horizontal transform type variable based on whether the value of the index is 0 and the width of the transform unit is within a predetermined range, and sets the value of a vertical transform type variable based on whether the value of the index is 0 and the height of the transform unit is within a predetermined range, and is characterized in that the first transform unit performs the vertical transform according to the vertical transform type variable and the horizontal transform according to the horizontal transform type variable. [Industrial Applicability]

[0258] The embodiments of the present invention can be suitably applied to a video decoding device that decodes coded data obtained by coding image data, and a video coding device that generates coded data obtained by coding image data, and can also be suitably applied to the data structure of coded data generated by a video coding device and referenced by the video decoding device.

[0259] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of priority to Japanese Patent Application No. 2019-101179, filed on May 30, 2019, the entire contents of which are incorporated herein by reference. [Explanation of symbols]

[0260] 31 Video decoding device 301 Entropy Decoding Unit 302 Parameter Decoding Unit 3020 Header Decoding Unit 303 Inter-prediction parameter decoding unit 304 Intra prediction parameter decoding unit 308 Prediction Image Generation Unit 309 Inter-prediction image generation unit 310 Intra-prediction image generation unit 311 Inverse quantization and inverse transformation unit 312 Addition section 11 Video encoding device 101 Prediction image generation unit 102 Subtraction section 103 Transformation and Quantization Unit 104 Entropy coding unit 105 Inverse quantization and inverse transformation unit 107 Loop Filter 110 Encoding parameter determination unit 111 Parameter Encoding Unit 112 Inter-prediction parameter coding unit 113 Intra prediction parameter coding unit 1110 Header encoding part 1111 CT information encoder 1112 CU encoding unit (prediction mode encoding unit) 1114 TU encoding section 3111 Inverse quantization section 3112 Inverse conversion unit 31121 Secondary conversion unit 31112 Scaling section 31123 Core conversion unit 10322 Forward Secondary Conversion Unit 10323 Forward Core Transformation Unit

Claims

1. An image decoding device that transforms transform coefficients for each transform unit, a transform unit decoder that decodes from the encoded data (i) a secondary index indicating whether an inverse secondary transform is used and the transform base, and (ii) a multi-transform selection index that is a switching index for selecting a transform base for the inverse core transform; an inverse quantization unit for inverse quantizing the quantized transform coefficients to calculate transform coefficients; a secondary transform unit configured to derive modified transform coefficients by applying the inverse secondary transform to the transform coefficients using a transform matrix if the inverse secondary transform is enabled; a core transform unit that applies the inverse core transform, including a vertical transform and a horizontal transform, to the transform coefficients or the modified transform coefficients; the core conversion unit includes an MTS setting unit and an implicit MTS setting unit; the MTS setting unit derives a horizontal transform type and a vertical transform type based on the multi-transform selection index when explicit MTS is enabled; the implicit MTS setting unit sets the horizontal transform type and the vertical transform type to 0 if the value of the secondary index is not equal to 0; The image decoding device, wherein the core transform unit performs an inverse transform based on the vertical transform type and performs an inverse transform based on the horizontal transform type.

2. The image decoding device of claim 1, characterized in that when an intra sub-division mode is used, the implicit MTS setting unit sets the horizontal transform type and the vertical transform type to 0 or 1 based on the intra prediction mode and the size of the transform unit.

3. A computer-readable recording medium for recording a program for causing a computer to convert a conversion coefficient for each conversion unit, The program causes the computer to: decoding a secondary index from the encoded data indicating whether an inverse secondary transform is used and the transform base; decoding a multi-transform selection index, which is a switching index for selecting a transform base of an inverse core transform, from the encoded data; dequantizing the quantized transform coefficients to calculate transform coefficients; if the inverse secondary transform is valid, deriving modified transform coefficients by applying the inverse secondary transform to the transform coefficients using a transform matrix; if explicit MTS is enabled and the value of the secondary index is equal to 0, deriving a horizontal transform type and a vertical transform type based on the multi-transform selection index; if the explicit MTS is valid and the value of the secondary index is not equal to 0, setting the horizontal transform type and the vertical transform type to 0; applying a vertical transform to the transform coefficients or the modified transform coefficients based on the vertical transform type and a horizontal transform to the transform coefficients or the modified transform coefficients based on the horizontal transform type; A computer-readable recording medium that causes a computer to execute the above steps.

Citation Information

Patent Citations

  • Method and apparatus for improved implicit transform selection

    WO2020247306A1

  • Method and apparatus for video coding

    WO2020251743A1