Image decoding device, image encoding device, image decoding method, and image encoding method
The image decoding device addresses performance issues in combining secondary transformations with MTS by applying appropriate transformations and adjusting implicit settings, thereby enhancing decoding performance.
Patent Information
- Application Number
- JP2024046769
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-05-30
- Filing Date
- 2024-03-22
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2040-05-29
AI Technical Summary
Existing image decoding technologies face performance issues when combining secondary transformations with Multiple Transform Selection (MTS), particularly with implicit MTS, leading to a loss in performance.
An image decoding device that converts transformation coefficients for each conversion unit, applies secondary transformations using MTS when necessary, and performs separable vertical and horizontal transformations, while adjusting implicit transformation settings based on the presence of secondary transformations and other modes.
The proposed solution enhances the application of conversion and secondary transformations using MTS, improving the overall performance of image decoding by maintaining or restoring the effectiveness of implicit MTS.
Smart Images

Figure 0007654856000001 
Figure 0007654856000002 
Figure 0007654856000003
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates 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 generates encoded data by encoding an image, and an image decoding device is used that generates a decoded image by decoding the encoded data.
[0003] Specific image encoding methods include, for example, H.264 / AVC and High-Efficiency Video Coding (HEVC).
[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 coding / 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 of generating a predicted image include inter-prediction and intra-prediction.
[0006] 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) that switches a transform matrix according to an explicit syntax or an implicit block size in the encoded data. Non-Patent Document 2 discloses an image coding device that transforms each coefficient after transforming a prediction error for each transform unit by RST (Reduced Secondary Transform), i.e., secondary transform, to derive transform coefficients. Non-Patent Document 2 also discloses an image decoding device that inversely transforms transform coefficients for each transform unit by 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 the secondary transform and the technology related to the secondary transform as described in Non-Patent Document 1, there is a problem that the performance is not sufficient when the secondary transform is combined with the transform by MTS. In particular, there is a problem that the performance of the implicit MTS is lost when it is combined with the secondary transform.
[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 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 its value is 0; a second transform unit that applies the secondary transform to the transform coefficients and outputs modified transform coefficients when the value of the index is other than 0; 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 a 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 performs the horizontal transform according to the horizontal transform type variable. [Brief description of the drawings]
[0011] [Figure 1] 1 is a schematic diagram showing a configuration of an image transmission system according to an embodiment of the present invention. [Diagram 2] 1 is a diagram showing the configuration of a transmitting device equipped with a video encoding device according to the present 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. [Diagram 3] 1 is a diagram showing the configuration of a recording device equipped with a video encoding device according to the present 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. [Diagram 5] FIG. 13 is a diagram illustrating an example of division of a CTU. [Figure 6] FIG. 13 is a schematic diagram showing types of intra-prediction modes (mode numbers). [Figure 7] FIG. 1 is a schematic diagram showing a configuration of a video decoding device. [Figure 8] 11 is a flowchart illustrating a schematic operation of the video decoding device. [Figure 9] FIG. 13 is a schematic diagram showing a configuration of an intra-prediction parameter decoding unit. [Figure 10] FIG. 13 is a diagram showing reference regions used for intra prediction. [Figure 11] FIG. 13 is a diagram illustrating a configuration of an intra-prediction image generating 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. 13 is a diagram illustrating a conversion range of a secondary conversion. [Figure 14] FIG. 13 is a diagram for explaining the operation of implicit MTS when using intra sub-split mode (intra sub-split prediction). [Figure 15] FIG. 13 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] 13 is a schematic diagram showing 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]13 is a flowchart for explaining the operation of an MTS setting unit 15211 according to the embodiment. [Figure 21] 13 is a flowchart for explaining the operation of an MTS setting unit 15211 according to the embodiment. [Figure 22] 13 is a flowchart for explaining the operation of an MTS setting unit 15211 according to the embodiment. [Diagram 23] 11 is a block diagram showing the relationship between a TU decoding unit and an inverse transform unit. FIG. [Figure 24] 13 is a flowchart showing a secondary conversion process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[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 encoded stream Te generated by the video encoding 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, and may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. The network 21 may also be replaced by a storage medium on which the encoded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blue-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. When the video decoding device 31 has high processing power, it displays high quality images, and when 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 OR.
[0021] x?y:z is a ternary operator that takes y if x is true (non-zero), and z if x is false (0).
[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, rounded down to the nearest integer.
[0028] <Structure of the Encoded Stream Te>[[]]END]] 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] FIG. 4 is a diagram showing the hierarchical structure of the data in the encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures that make up the sequence. FIG. 4 shows, respectively, an encoded video sequence that defines a sequence SEQ, an encoded picture that defines a picture PICT, an encoded slice that defines a slice S, encoded slice data that defines 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) In the coded video sequence, a set of data that the video decoding device 31 refers to in order to decode the sequence SEQ to be processed is specified. As shown in the coded video sequence of Fig. 4, the sequence SEQ includes a 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 composed of multiple layers, as well as a set of coding parameters related to multiple layers included in an image and each individual layer.
[0032] The sequence parameter set SPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode the target sequence. For example, the width and height of a picture are specified. Note that there may be multiple SPSs. In that case, one of the multiple SPSs is selected from the PPS.
[0033] The picture parameter set PPS specifies a set of coding parameters that the video decoding device 31 refers to in order 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 (weighted_pred_flag) indicating the application of weighted prediction, and a scaling list (quantization matrix). Note that there may be multiple PPSs. In that 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 to be referenced by the video decoding device 31 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. The same applies to other data that are included in the coded stream Te and that are to be described below and that are to be given subscripts.
[0036] (Coded Slice) An encoded slice defines a set of data to be referenced by the video decoding device 31 in order to decode a slice S to be processed. As shown in the encoded slice of Fig. 4, a slice includes a slice header and slice data.
[0037] The slice header includes a group of coding parameters to be referred to by the video decoding device 31 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 when encoding, (2) a P slice that uses unidirectional prediction or intra prediction when encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction when 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, when referring to P or B slice, it refers to a slice including a block that can use inter prediction.
[0039] In addition, 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 specifies a set of data to be referenced by the video decoding device 31 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 specifies a set of data that the video decoding device 31 refers to in order to decode the CTU to be processed. The CTU is divided into coding units CU, which are basic units of the coding process, by recursive quad tree division (QT (Quad Tree) division), binary tree division (BT (Binary Tree) division), or ternary tree division (TT (Ternary Tree) division). BT division and TT division are collectively called multi tree division (MT (Multi Tree) division). A node of a tree structure obtained by recursive quad tree division is called a coding node. Intermediate nodes of the quad tree, binary tree, and ternary tree are coding nodes, and the CTU itself is specified as the top coding node.
[0042] 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 the presence or absence of MT splitting, 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). The CU is the terminal node of the coding node and is not split any further. The 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 the following: 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, the 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 size of a CU and a sub-CU are equal, there is one sub-CU in the CU. When the size of a CU is larger than that 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 CUs, 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 prediction parameters of intra prediction will be described below. The intra prediction parameters are composed of a luminance prediction mode IntraPredModeY and a color difference prediction mode IntraPredModeC. FIG. 6 is a schematic diagram showing types of intra prediction modes (mode numbers). As shown in FIG. 6, there are, for example, 67 types (0 to 66) of intra prediction modes. For example, these are 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 target 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 target block from the intra prediction modes of adjacent blocks and a predetermined intra prediction mode. When the intra_luma_mpm_flag is 1, the IntraPredModeY of the target 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 obtained by 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 a 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 generating unit (prediction image generating device) 308, an inverse quantization and inverse transform unit 311, and an adder 312. Note that, in accordance with the video encoding device 11 described below, the video decoding device 31 may also be configured not to include the loop filter 305.
[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 header (slice information) from the encoded data. The CT information decoding unit 3021 decodes the CT from the encoded data. The CU decoding unit 3022 decodes the CU from the encoded data. The TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data when a prediction error is included in the TU.
[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 or not a secondary transform is used and a transform base from the encoded 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 a transform matrix of MTS from the encoded 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 an 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, and 1 otherwise). Note that when stIdx is 0, no secondary transform is applied, when stIdx is 1, one transform of a set (pair) of secondary transform matrices is indicated, and when stIdx is 2, the other transform of the pair is indicated. Also, the secondary transform matrix secTransMatrix may be selected according to not only the value of stIdx but also the intra prediction mode and the size of the transform.
[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 addition, although an example in which CTU and CU are used as processing units will be described below, the present invention is not limited to this example, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be read as blocks, and sub-CU 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 inputted coded stream Te, and separates and decodes individual codes (syntax elements). There are two types of entropy coding: a method of variable-length coding the syntax elements using a context (probability model) adaptively selected according to the type of syntax element or surrounding circumstances, and a method of variable-length coding the syntax elements using a predetermined table or formula. The former CABAC (Context Adaptive Binary Arithmetic Coding) stores in memory a probability model updated for each coded or decoded picture (slice). Then, as the initial state of the context of a P picture or a B picture, a probability model of a picture using a quantization parameter of the same slice type and the same slice level is set from among the probability models stored in the memory. This initial state is used for coding and decoding processes. The separated codes include prediction information for generating a predicted image and a prediction error 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 a schematic operation of the video decoding device 31.
[0065] (S1100: Decode Parameter Set Information) The header decoding unit 3020 decodes parameter set information such as the VPS, SPS, and PPS from the encoded data.
[0066] (S1200: Decode slice information) The header decoding unit 3020 decodes the slice header (slice information) from the encoded data.
[0067] Thereafter, the video decoding device 31 repeats the processes from S1300 to S5000 for each CTU included in the target picture to derive 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: Decoding CU information) The CU decoding unit 3022 decodes the CU information, prediction information, the TU split flag split_transform_flag, the CU residual flags cbf_cb, cbf_cr, cbf_luma, and the like from the encoded 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 encoded 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: Generation of predicted image) The predicted image generation 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 transform unit 311 executes inverse quantization and inverse transform processing for each TU included in the target CU.
[0075] (S4000: Generate decoded image) The adder 312 adds 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 to generate a decoded image of the current CU.
[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] Moreover, the parameter decoding unit 302 is configured to include an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304, not shown. The predicted image generating unit 308 is configured to include an inter prediction image generating unit 309 and an intra prediction image generating unit 310, 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 prediction parameters stored in a 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 a predicted image generating 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 luminance and chrominance.
[0079] 9 is a schematic diagram showing a 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 the syntax element, and receives the syntax element 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 of the luma intra prediction parameter decoding unit 3042. The parameter decoding control unit 3041 also outputs the syntax element of the chrominance intra prediction parameter to the chrominance 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 in which a CU is further divided into smaller sub-blocks and intra prediction is performed. 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 formula.
[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 subblocks in the vertical direction, and intra prediction, transform coefficient decoding, inverse quantization, and inverse transform are performed on a subblock-by-subblock basis. If IntraSubPartSplitType is 2 (ISP_VER_SPLIT: vertical division), the CU is divided into 2 to 4 subblocks in the horizontal direction, and intra prediction, transform coefficient decoding, inverse quantization, and inverse transform are performed on a subblock-by-subblock basis. The number of subblock divisions, NumIntraSubPart, is derived using the following formula.
[0087] NumIntraSubPart = (cbWidth == 4 && cbHeight == 8) || (cbWidth == 8 && cbHeight== 4) ? 2 : 4 The width nW and height nH of the subblock, and the number 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 a CU (or TU).
[0089] The loop filter 305 is a filter provided in the encoding loop, which removes block distortion and ringing distortion to improve image quality. The loop filter 305 applies a filter 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 location that is determined in advance for each current picture and current CU.
[0091] The prediction parameter memory 307 stores prediction parameters at a predetermined position 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 generating unit 308 receives predMode, prediction parameters, etc. Also, the predicted image generating unit 308 reads a reference picture from the reference picture memory 306. The predicted image generating 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, so called a block), and is an area to be referenced for generating a predicted image.
[0093] (Intra-prediction 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 adjacent blocks in a predetermined range from a target block on a target picture from the reference picture memory 306. The predetermined range refers to adjacent blocks to the left, upper left, upper, and upper right of the target block, and the area to be referenced differs depending on the intra-prediction mode.
[0095] The intra-prediction image generation unit 310 generates a prediction image of the current block by referring to the read decoded pixel values and the prediction mode indicated by IntraPredMode. The intra-prediction image generation unit 310 outputs the generated prediction image of the block to the addition unit 312.
[0096] The generation of a predicted image based on an intra prediction mode will be described below. In planar prediction, DC prediction, and angular prediction, a decoded surrounding area adjacent (close) to the prediction target block 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 prediction target block (or further, the top left, top right, and bottom left) (for example, the area indicated by the pixels marked with a diagonal line in reference area example 1 of FIG. 10).
[0097] (Details of predicted image generation unit) Next, the configuration of the intra-prediction image generation unit 310 will be described in detail with reference to Fig. 11. The intra-prediction 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 prediction image correction unit 3105 (prediction 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 (predicted image before correction) of the block to be predicted, and outputs it 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] Below, each unit included in the intra-predicted image generation unit 310 will be described.
[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 on the prediction target block (prediction target block information). The prediction target block information includes at least an index indicating the size, position, and whether the prediction target block is luminance or chrominance.
[0101] (Unfiltered reference image setting unit 3102) Based on the size and position of the prediction target block, the unfiltered reference image setting unit 3102 sets the neighboring surrounding area of the prediction target block as the reference area R. Then, the unfiltered reference image setting unit 3102 sets each decoded pixel value at a corresponding position on the reference picture memory 306 to each pixel value (unfiltered reference image, boundary pixel) in the reference area R. A line r[x][−1] of decoded pixels adjacent to the top side of the prediction target block and a column r[−1][y] of decoded pixels adjacent to the left side of the prediction target block shown in the 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 periphery to derive a filtered reference image (reference region example 2 in FIG. 10). Note that it is not necessary to apply a low-pass filter to all intra prediction modes, and a 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 in the filtered reference image setting unit 3103 is referred to as a "reference pixel filter (first filter)", whereas a filter that corrects a tentative predicted image in the prediction 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 provisional predicted image (provisional predicted pixel value, pre-corrected predicted image) of a block to be predicted based on an intra prediction mode, an unfiltered reference image, and a filtered reference pixel value, and outputs the generated image to a prediction image correction unit 3105. The intra prediction unit 3104 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 section 31044 (Planar forecast) The planar prediction unit 31041 generates a provisional predicted image by linearly adding a plurality of filtered reference images according to the distance between the prediction target pixel position and the reference pixel position, and outputs the provisional 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 pixel values of chrominance based on pixel values of luminance. Specifically, this is a method of generating a predicted image of a chrominance image (Cb, Cr) using a linear model based on a decoded luminance image. CCLM (Cross-Component Linear Model prediction), which is one of the LM prediction methods, is a prediction method that uses a linear model to predict chrominance from luminance for one block.
[0107] (Configuration of 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 it is.
[0108] (Inverse quantization and inverse transformation 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[ ][ ]. The 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 and quantizing them in the encoding process. 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 unit 312.
[0109] Hereinafter, a configuration example of the inverse quantization and inverse transform unit 311 will be described with reference to FIG. 12. FIG. 12 is a functional block diagram showing a configuration example 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 in 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 difference 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 difference 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 forward transform (transform) and 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" for 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 the CU into a plurality of sub-blocks, and decode a sub-block transform flag cu_sbt_flag for performing the decoding of transform coefficients, inverse quantization, and inverse transform of only one of the plurality of sub-blocks. When 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. When cu_sbt_quad_flag is 0, the number of sub-blocks is 2. When cu_sbt_quad_flag is 1, the number of sub-blocks is 4. In addition, the TU decoding unit 3024 decodes cu_sbt_horizontal_flag indicating whether to divide horizontally or vertically. In addition, the TU decoding unit 3024 decodes cu_sbt_pos_flag indicating which sub-block contains the transform coefficient.
[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 according to 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 formulas.
[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 encoded 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 to restore modified transform coefficients d[ ][ ] (transformation 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 by referring 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 obtains the transform coefficients d[ ][ ] or the corrected transform coefficients d[ ][ ] restored by the secondary transform unit 31121, performs transformation, and derives the prediction error r[ ][ ]. The core transform unit 31123 outputs the prediction error r[ ][ ] to the adder 312.
[0126] (Secondary Transformation) In the video encoding device 11, a further transform (forward secondary transform) is applied to the transform coefficients after the core transform (DCT2 and DST7, etc.) of the differential image, correlation remaining in the transform coefficients is removed, and energy is concentrated 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. In contrast, in the video decoding device 3, a secondary transform is applied to the transform coefficients of some or all of the regions of the decoded TU, and a core transform (DCT2 and DST7, etc.) is applied to the transform coefficients after the secondary transform.
[0127] In the secondary transform, the following processes are performed according to 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 for explaining the secondary transform. The diagram shows a process in which, for an 8x8 TU, transform coefficients d[][] of a 4x4 region are stored in a one-dimensional array u[] of nonZeroSize in the process of S2, converted from the one-dimensional array u[] to a one-dimensional array v[] in the process of S3, and finally stored again in d[][] in the process of S4.
[0128] FIG. 24 is a flowchart showing the process of the secondary conversion.
[0129] (S1: Setting 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. In addition, the sizes of the 4x4 and 8x8 secondary transform may 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 the 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 them. Specifically, in the secondary transform, u[] is derived from the two-dimensional transform coefficients d[][] of the target TU by referring to the transform coefficients of x = 0..nonZeroSize-1. xC, yC are positions on the TU and are derived from the array DiagScanOrder indicating 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 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 arithmetic by the following equation:
[0134] V' = T × F' Here, the transformation basis when the transformation size is 4x4 (RST4x4) is called the first type transformation basis T1. The transformation basis when the transformation size is 8x8 (RST8x8) is called the second type transformation basis T2. T1 is a 16x16 (16 rows, 16 columns) matrix, and the transformation derives a 16x1 (16 rows, 1 column) vector V', that is, a one-dimensional array v'[] of length 16, as the product of the 16x16 matrix T and 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', that is, a one-dimensional array v'[] of length 48, as the product of the 48x16 matrix T and the 16x1 vector F'.
[0135] Specifically, the secondary transform unit 31121 derives a corresponding transform matrix secTranMatrix[][] (transformation 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 between the transform matrix and the one-dimensional array u[] as shown in the following formula. v'[i] = Clip3( CoeffMin, CoeffMax,ΣsecTransMatrix[j][i]*u[j]) Here, Σ is the sum from j=0..nonZeroSize-1. Also, processing is performed for i=0..nStSize-1. CoeffMin and CoeffMax indicate the range of values of the transform coefficients.
[0136] (S4: 2D arrangement of 1D signal after conversion 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 by an explicit flag, index, prediction mode, or the like is called a transform (first transform, core transform). The transform (core transform) used in the core transform is a separation type transform consisting of a vertical transform and a horizontal transform. A transform that separates a two-dimensional signal into a horizontal direction and a vertical direction may be defined as the first transform. In an image decoding device, a transform applied after a second transform (secondary transform) may be defined as the first transform. The transform bases (transformation 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. Note that selectable transforms are not limited to the above, and it is also possible to use another transform (transform base). Note that DCT2, DST7, DCT8, DST1, and DCT5 may be expressed as DCT-II, DST-VII, DCT-VIII, DST-I, and DCT-V, respectively. There may also be a transform skip as a mode for explicitly skipping the core transform.
[0140] There are two types of core transform: explicit MTS and implicit MTS. In the case of explicit MTS, mts_idx is decoded from the encoded data and the transform matrix is switched. In the case of implicit MTS, mts_idx is derived according to the intra prediction mode and block size.
[0141] In this embodiment, an example is described in which mts_idx is decoded in units of CUs or TUs, 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 above-described core transformation will be specifically described with reference to FIG. 18. The core transformation unit 1521 in FIG. 18 is an example of the core transformation unit 31123 in FIG. 12 and the core transformation unit 1521 in FIG. 19. The core transformation unit 1521 in FIG. 18 is composed of an MTS setting unit 15211 that sets the type of transformation to be used from a plurality of transformation bases, a coefficient transformation processing unit 15212 that calculates prediction residuals r[ ][ ] from (modified) transformation coefficients d[ ][ ] using the derived transformation, and a matrix transformation processing unit 15213 that performs actual transformation. When a secondary transformation is not performed, the modified transformation coefficients are equal to the transformation coefficients. When a secondary transformation is performed, the modified transformation coefficients have a value different from the transformation coefficients. The MTS setting unit 15211 is composed of an MTS setting unit 152111 that determines a method for deriving an index mts_ids of the transformation 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] When the 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 the subsequent processing. The flag explicitMtsEnabled indicating whether the explicit MTS is enabled may be set separately for the intra mode and the inter mode. In this case, when the prediction mode PredMode is the inter mode (other than MODE_INTRA) and sps_explicit_mts_inter_enabled_flag is 1, or when the prediction mode PredMode is the intra mode (MODE_INTRA) and sps_explicit_mts_intra_enabled_flag is 1, the MTS setting unit 152111 may determine that the explicit MTS is enabled and decode mts_idx from the encoded data. Furthermore, the 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 intra sub split is on (IntraSubPartSplitType != ISP_NO_SPLIT) CU sub-transformation is on and TU is less than a certain 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 cases other than the above, the MTS setting unit 152111 sets mts_idx=0.
[0148] (explicit MTS) If the explicit MTS indicates that it is valid (if sps_explicit_mts_flag is 1), the TU decoding unit 3024 decodes mts_idx from the encoded data.
[0149] (Explicit MTS Restrictions) The TU decoding unit 3024 may limit the range (type) of the transformation matrix selected by the transformation unit depending on whether the secondary transformation is enabled or not. For example, when the 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) When the explicit MTS is enabled and the 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=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=4. As 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, as trTypeHor and trTypeVer, respectively. In addition, instead of DST7, a transform combining DST1 or DCT4, or a pre- or post-processing and DCT2 may be performed.
[0151] (Restriction example 2) When the explicit MTS is enabled and the secondary transform is enabled (stIdx!=0), the TU decoding unit 3024 decodes mts_idx. mtx_idx is 0 (trTypeHor=trTypeVer=0=DCT2) or 1 (trTypeHor=trTypeVer=1=DST7). In this case, the maximum value of mts_idx, cMax=1. In other cases, any of 0, 1, 2, 3, and 4 is decoded as mts_idx. In this case, the maximum value of mts_idx, cMax=4. As described later, mts_idx=2, 3, and 4 may be a combination of DST7 and DCT8, or a combination of DCT8 and DST7, or a combination of DCT8 and DCT8, as trTypeHor and trTypeVer, respectively.
[0152] (Restriction example 3) When 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, the TU decoding unit 3024 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, so that the coding is simplified. For example, in the case of the restriction example 2, the secondary transform is not performed in the case of DCT8, whose effect overlaps with the secondary transform, so that the overhead due to mts_idx is reduced and the coding efficiency is improved.
[0154] <Explicit MTS Summary> An image decoding device including 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 an input transform coefficient 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 coefficient, the TU decoding unit that decodes mts_idx decodes a value in a first range as mts_idx when the secondary transform is enabled (stIdx!=0), and decodes 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 also decodes mts_idx. Here, when the secondary transform is enabled (stIdx!=0), the maximum value of mts_idx is cMaxSt1, and when the secondary transform is not enabled (stIdx==0), the maximum value is cMaxSt0, and the configuration is such that 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) according to the intra prediction mode IntraPredMode and the TU size, as shown in Figure 14.
[0157] (SM002) In cases other than the 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 the above (default implicit MTS), the implicit MTS setting unit 152112 sets tyTypeHor, tyTypeVer to either 0 (DCT2) or 1 (DST7) according to 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) When 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-transformation is on and TU is less than a certain 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, no intra sub-division determination may be performed, no sub-block transformation may be performed, or other prediction or transformation determinations may be added.
[0163] According to the above configuration, even if MTS is valid, when secondary transform is used (stIdx!=0), implicit MTS is not used. 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 2) When 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 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. Also, the conversion type may be derived by SM001 and SM002.
[0168] According to the above configuration, when the implicit MTS is enabled and the secondary transform is enabled, the DCT2 is used as the MTS, thereby improving the coding efficiency.
[0169] (Implicit MTS implementation example 3) 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 subblock 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 the above (default implicit MTS), the implicit MTS setting unit 152112 sets 0 (DCT2) or 1 (DST7) as tyTypeHor and tyTypeVer according to the secondary transformation and TU size (width nTbW, height nTbH). For example, the implicit MTS setting unit 152112 selects 1 (DCT1) as the horizontal transformation type trTypeHor when stIdx==0 and the width nTbW is within a predetermined range (S1301') (S1302), and sets 0 (DCT2) otherwise (S1303). Similarly, as the vertical transformation type trTypeVer, when stIdx==0 and the height nTbH is within a predetermined range (S1304'), it sets 1 (DCT1) (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 an 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 then trTypeHor = 1 trTypeVer = 1 if mts_idx == 2 then trTypeHor = 2 trTypeVer = 1 if mts_idx == 3 then trTypeHor = 1 trTypeVer = 2 if mts_idx == 4 then trTypeHor = 2 trTypeVer = 2 In addition, 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 conversion unit 152121 (coefficient conversion 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 by the nTbS × nTbS matrix derived using trTypeVer. nTbS is the height of the TU, nTbH. In the case of a 4×4 transformation (nTbS=4) of DCT2 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 Σ means the process of adding the product of the matrix transMatrix[ y ][ j ] and the transformation coefficient d[ x ][ j ] for the subscript j from j = 0..nTbS-1. That is, e[x][y] is the sequence of columns obtained by multiplying vector x[j] (j = 0..nTbS-1), which is made up of d[x][j] (j = 0..nTbS-1), each of which is a column of d[x][y], by matrix element transMatrix[y][j].
[0178] The intermediate clipping unit 152122 derives the intermediate value g[ ][ ] by clipping the intermediate value e[ ][ ], and sends it to the horizontal transformation 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 the above formula assumes that the conversion base is 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 by a matrix of nTbS × nTbS 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] by a one-dimensional transform in the horizontal direction.
[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 the horizontal transformation unit 152123 perform transformation 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 one-dimensional array yy[i] using the derived transformation matrix transMatrix[][], and performs vertical and horizontal transformation. In the vertical transformation, the transformation coefficient d[x][j] of the x column is input as the one-dimensional transformation coefficient xx[j] and transformed. In the horizontal transformation, the intermediate coefficient g[j][y] of the y row is input as xx[j] and transformed.
[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 encoded 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, 4, the TU decoding unit 3024 derives stIdx = 0 without decoding stIdx from the encoded 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, 4, the TU decoding unit 3024 derives stIdx = 0 without decoding stIdx from the encoded data.
[0190] According to the above configuration, the variable stIdx indicating the type of secondary transformation is decoded only when a transformation within a predetermined range is performed in MTS, so that the effective range of the secondary transformation is limited, and therefore the coding is simplified. Also, for example, in the case of the restriction example 2, the secondary transformation is not performed in the case of DCT8, whose effect overlaps with the secondary transformation, so that the overhead due to stIdx is reduced and the coding efficiency is improved.
[0191] The adder 312 generates a decoded image of the block by adding, for each pixel, the predicted image of 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 of 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 generating 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, an encoding parameter determining unit 110, a parameter encoding unit 111, and an entropy encoding unit 104.
[0193] The predicted image generating 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 generating unit 101 operates in the same manner as the predicted image generating unit 308 already described, and therefore a description thereof will be omitted.
[0194] The subtraction unit 102 generates a prediction error by subtracting the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the 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 the prediction errors. 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 applied in the video decoding device 31, except that the steps S1-S4 of the secondary transform are applied in the reverse order of steps S1, S4, S3, S2.
[0198] In process S1, the forward secondary transformation unit 10322 performs the same process as the secondary transformation unit 31121, except that the input and output of the secondary transformation 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 in the TU.
[0200] In process S3, the forward secondary transformation unit 10322 obtains a one-dimensional array u[] (vector F) of nonZeroSize from a one-dimensional array v[] (vector V) of nStOutSize and a 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 a one-dimensional array u[] (vector F) by the following formula.
[0202] F=Tinv×V Here, Tinv 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 Tinv.
[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, K2 is a constant). In this case, the secondary conversion 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 nonZeroSize 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 addition unit .
[0206] The entropy coding unit 104 receives the quantized transform coefficients as input from the transform / quantization unit 103, and receives the coding parameters as input from the parameter coding unit 111. The coding parameters are, for example, predMode.
[0207] The entropy coding unit 104 entropy codes the division information, the prediction parameters, the quantized transformation coefficients, etc. to generate a coded stream Te, and outputs it.
[0208] The parameter encoding unit 111 includes a header encoding unit 1110, a CT information encoding unit 1111, a CU encoding unit 1112 (prediction mode encoding unit), an inter prediction parameter encoding unit 112, and an intra prediction parameter encoding unit 113. The CU encoding unit 1112 further includes a TU encoding 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 transformation coefficients.
[0210] The CT information encoding unit 1111 encodes the 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 encoding unit 113 derives a format for encoding (for example, intra_luma_mpm_idx, intra_luma_mpm_remainder, etc.) from the IntraPredMode input from the encoding parameter determination unit 110. The intra prediction parameter encoding unit 113 includes a part of the same configuration as the configuration in which the intra prediction parameter decoding unit 304 derives intra prediction parameters.
[0215] 17 is a schematic diagram showing a 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 from the coding parameter determination unit 110. The parameter coding control unit 1131 determines intra_luma_mpm_flag by referring 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 a luma intra prediction parameter derivation unit 1132. Also, the parameter coding control unit 1131 outputs IntraPredModeC to a chroma intra prediction parameter derivation unit 1133.
[0217] The luma intra prediction parameter derivation unit 1132 is configured to include 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 referring to the intra prediction modes of adjacent 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 it 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 value 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, for example, as only a deblocking filter.
[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 position for each current picture and CU.
[0224] The coding parameter determination unit 110 selects one set 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 a coded stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the predicted parameter memory 108.
[0226] In addition, a part of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generating unit 308, the inverse quantization and inverse transform unit 311, the addition unit 312, the predicted image generating unit 101, the subtraction 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 realized by a computer. In this case, a program for realizing this control function may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read into and executed by a computer system. In addition, the "computer system" referred to here is 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. In addition, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into computer systems. Furthermore, the term "computer-readable recording medium" may also include devices that dynamically hold a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line, and devices that hold a program for a certain period of time, such as volatile memory inside a computer system that serves as a server or client in such cases. Furthermore, the above-mentioned program may be one that realizes part of the above-mentioned functions, or may be one that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0227] In addition, a part or the whole of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment 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 processed, or may be integrated into a processor in part or in whole. The integrated circuit method is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. In addition, when an integrated circuit technology that replaces LSI appears due to the advancement of semiconductor technology, an integrated circuit based on that technology may be used.
[0228] Although one embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to the above, and various design changes, etc. are possible within the scope that does not deviate from the gist of the present invention.
[0229] [Application example] The above-mentioned video encoding device 11 and video decoding device 31 can be mounted on various devices that transmit, receive, record, and play videos. 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 described with reference to FIG. 2 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for transmitting and receiving videos.
[0231] 2 shows a block diagram illustrating 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 obtains encoded data by encoding a video, a modulation unit PROD_A2 that obtains a modulated signal by modulating a carrier wave with the encoded data obtained by the encoding unit PROD_A1, and a transmitting unit PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The above-mentioned 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 for capturing moving images, a recording medium PROD_A5 for recording moving images, an input terminal PROD_A6 for inputting moving images from the outside, and an image processing unit A7 for generating or processing images, as a source of moving images to be input to the encoding unit PROD_A1. In the figure, the transmitting device PROD_A is illustrated 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 by an encoding method for recording that is different from the encoding method for transmission. In the latter case, a decoding unit (not shown) that decodes the encoded data read from the recording medium PROD_A5 according to the encoding method for recording may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
[0234] 2 shows a block diagram illustrating 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 demodulation 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 a video by decoding the coded data obtained by the demodulation 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 image output by the decoding unit PROD_B3, a display PROD_B4 for displaying the moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal PROD_B6 for outputting the moving image to the outside. In the figure, the receiving device PROD_B is illustrated 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 by 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 broadcast, wired broadcast, wireless communication, and wired communication.
[0238] For example, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) of 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.) of 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] Also, a server (such as a workstation) / client (such as a television receiver, a personal computer, a smartphone, etc.) of a VOD (Video On Demand) service or a video sharing service using the Internet is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by communication (usually, in a LAN, either wireless or wired is used as a transmission medium, and in a WAN, wired is used as a transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Also, smartphones include multi-function mobile phone terminals.
[0240] The client of the video hosting service has a function to decode the encoded data downloaded from the server and display it on a display, as well as a function to encode the video captured by the camera and upload it to the server. That is, 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 described with reference to FIG. 3 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for recording and reproducing videos.
[0242] 3 shows a block diagram illustrating the configuration of a recording device PROD_C equipped with the above-mentioned 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 a 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-mentioned video encoding device 11 is used as this encoding unit PROD_C1.
[0243] The recording medium PROD_M may be (1) a type built into the recording device PROD_C, such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), (2) a type connected to the recording device PROD_C, such as an SD memory card or USB (Universal Serial Bus) flash memory, or (3) a type 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 for capturing 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 for generating or processing images, as a supply source of moving images to be input to the encoding unit PROD_C1. In the figure, the recording device PROD_C is illustrated as having all of these components, but some of them may be omitted.
[0245] The receiving unit PROD_C5 may receive unencoded video, or may receive encoded data encoded by an encoding method for transmission that is different from the encoding method for recording. In the latter case, a transmission decoding unit (not shown) that decodes the encoded data encoded by the encoding method for transmission 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 a 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 image). In addition, a camcorder (in this case, the camera PROD_C3 is the main source of the moving image), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main source of the moving image), and a smartphone (in this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of the moving image) are also examples of such a recording device PROD_C.
[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 out 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 for displaying the video, an output terminal PROD_D4 for outputting the video to the outside, and a transmission unit PROD_D5 for transmitting the video. In the figure, the playback device PROD_D is illustrated as having all of these components, but some of them may be omitted.
[0250] The transmission unit PROD_D5 may transmit unencoded video, or may transmit encoded data encoded by an encoding method for transmission different from the encoding method for recording. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_D2 and the transmission unit PROD_D5, which encodes the video by the encoding method for transmission.
[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 destination of the video image). In addition, a television receiver (in this case, the display PROD_D3 is the main destination of the video image), a digital signage (also called an electronic signboard or an electronic bulletin board, and the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), a desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main destination of the video image), a laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), and the like are also examples of such a playback device PROD_D.
[0252] (Hardware and Software Realization) 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 the commands of a program that realizes each function, a ROM (Read Only Memory) that stores the above program, a RAM (Random Access Memory) that expands the above program, a storage device (recording medium) such as a memory that stores the above 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 the program code (executable program, intermediate code program, source program) of the control program of each of the above devices, which is software that realizes the above-mentioned functions, is recorded in a computer-readable manner, and the computer (or CPU or MPU) reads and executes the program code recorded on the recording medium.
[0254] Examples of the recording medium that can be used include tapes such as magnetic tapes and cassette tapes, 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] Moreover, each of the above devices may be configured to be connectable to a communication network, and the above program code may be supplied via the communication network. This communication network is not particularly limited as long as it is capable of transmitting the program code. For example, the Internet, an intranet, an extranet, a LAN (Local Area Network), an ISDN (Integrated Services Digital Network), a VAN (Value-Added Network), a CATV (Community Antenna television / Cable Television) communication network, a virtual private network, a telephone line network, a mobile communication network, a satellite communication network, etc. may be used. Moreover, the transmission medium constituting this communication network is not limited to a specific configuration or type as long as it is a medium capable of transmitting the program code. For example, it 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, ADSL (Asymmetric Digital Subscriber Line) line, etc., or in wireless communication such as infrared such as IrDA (Infrared Data Association) or remote control, BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. The embodiment of 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 embodiment, and various modifications are possible within the scope of the claims. In other words, the technical scope of the present invention also includes embodiments obtained by combining technical means that are appropriately modified within the scope of the claims.
[0257] 〔summary〕 A video decoding device according to one embodiment of the present invention is an image decoding device that converts 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 turns off implicit transform when the secondary transform is enabled, intra sub-partition mode is not used, and sub-block transform is not used, and when the implicit transform is on, derives a horizontal transform type according to the width of a 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. [Industrial Applicability]
[0258] The embodiments of the present invention can be suitably applied to a video decoding device that decodes coded data in which image data is coded, and a video coding device that generates coded data in which image data is coded, and can also be suitably applied to the data structure of coded data that is 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 Section 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 encoding section 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, comprising: a decoding unit for decoding an index which indicates that a secondary transform is not used when the index has a value of 0; a second transform unit configured to apply the secondary transform to the transform coefficients when the value of the index is other than zero and output modified transform coefficients; a first transform unit for applying a separable transform consisting of a vertical transform and a horizontal transform to the transform coefficients or the modified transform coefficients; an implicit conversion setting unit that sets a value of a horizontal conversion type variable based on whether the value of the index is 0 and the width of the conversion unit is within a predetermined range, and sets a value of a vertical conversion type variable based on whether the value of the index is 0 and the height of the conversion unit is within a predetermined range; The image decoding device, wherein the first transform unit performs the vertical transform in response to the vertical transform type variable, and performs the horizontal transform in response to the horizontal transform type variable.
2. The image decoding device of claim 1, characterized in that the implicit conversion setting unit sets the value of a horizontal conversion type variable based on whether the value of the index is 0 and the width of the conversion unit is 4 or more and 16 or less, and sets the value of a vertical conversion type variable based on whether the value of the index is 0 and the height of the conversion unit is 4 or more and 16 or less.
3. The image decoding device of claim 1, characterized in that the implicit conversion setting unit sets the value of a horizontal conversion type variable to 1 when the value of the index is 0 and the width of the conversion unit is 4 or more and 16 or less, and sets the value of a vertical conversion type variable to 1 when the value of the index is 0 and the height of the conversion unit is 4 or more and 16 or less.
4. An image decoding method for transforming transform coefficients for each transform unit, comprising the steps of: decoding an index whose value is 0, indicating that no secondary transform is utilized; if the value of the index is other than zero, applying the secondary transform to the transform coefficients to output modified transform coefficients; setting a 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; setting a value of a vertical transformation type variable based on whether the value of the index is 0 and the height of the transformation unit is within a predetermined range; applying a separable transform consisting of a vertical transform and a horizontal transform to the transform coefficients or the modified transform coefficients in response to the vertical transform type variable and the horizontal transform type variable.
Citation Information
Patent Citations
Method and apparatus for improved implicit transform selection
WO2020247306A1
Method and apparatus for video coding
WO2020251743A1