Moving image decoding device and moving image coding device
The video decoding device optimizes transformation matrix selection by decoding syntax elements based on block size and non-zero coefficients, addressing inefficiencies in existing video encoding methods and improving encoding efficiency.
Patent Information
- Application Number
- JP2021196591
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2025-01-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing video encoding methods, such as H.264/AVC and HEVC, face inefficiencies in transformation matrix selection, particularly due to insufficient adaptation based on block size and prediction mode, leading to suboptimal encoding efficiency.
A video decoding device that decodes syntax elements to determine block size, LAST position, and non-zero coefficient positions, using threshold values to decide whether to decode mts_idx, optimizing transformation matrix selection based on these factors.
Improves encoding efficiency by enhancing the selection of transformation matrices, leading to more effective video encoding and decoding processes.
Smart Images

Figure 2025010550000001_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to a video decoding device and a video encoding device. [Background technology]
[0002] In order to efficiently transmit or record moving images, a moving image encoding device is used that generates encoded data by encoding the moving images, and a moving image decoding device is used that generates a decoded image by decoding the encoded data.
[0003] Specific examples of video encoding methods include H.264 / AVC and High-Efficiency Video Coding (HEVC).
[0004] In such a video coding method, images (pictures) constituting a video are divided into slices obtained by dividing the images, coding tree units (CTUs) obtained by dividing the slices, coding tree units (CTUs) obtained by dividing the coding tree units, and so on. The coding unit (sometimes called a coding unit (CU)) that is to be encoded, and The coding unit is divided into transform units (TUs), which are managed in a hierarchical structure, and the coding unit is encoded / decoded for each CU.
[0005] In such a video coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the predicted image from the input image (original image) is coded. Methods for generating a predicted image include inter-prediction and intra-prediction.
[0006] In addition, Non-Patent Document 1 states that according to the explicit syntax (mts_idx) in the encoded data, Alternatively, a technique called Multiple Transform Selection (MTS) that switches transform matrices implicitly according to a block size is disclosed. Furthermore, Non-Patent Document 1 discloses a technique that determines whether or not to decode the above explicit syntax depending on the state of transform coefficients, such as the last position of a non-zero coefficient. Furthermore, Non-Patent Document 2 discloses a technique that restricts MTS candidates depending on the state of transform coefficients, particularly the last position. [Prior art documents] [Non-patent literature]
[0007] [Non-Patent Document 1] ITU-T Rec. H.266 [Non-Patent Document 2] "Non-EE2: Adaptive Intra MTS", JVET-X0135, Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29, 24th Meeting, by teleconference Summary of the Invention [Problem to be solved by the invention]
[0008] In the methods described in Non-Patent Document 1 and Non-Patent Document 2, the selection of a transformation matrix according to a prediction mode is not performed, so there is a problem that efficient coding is not possible. In addition, although the availability of MTS is determined according to the block size, the availability of the transformation coefficients that change depending on the block size is not determined. There is a problem in that the selection of transformation matrices according to the situation is not sufficient. [Means for solving the problem]
[0009] In order to solve the above problem, a video decoding device according to one embodiment of the present invention is a video decoding device including a parameter decoding unit that decodes a syntax (mts_idx) of a current block from encoded data, wherein the parameter decoding unit decodes mts_idx according to the block size, LAST position and non-zero coefficient position of the current block, and the parameter decoding unit determines whether to decode mts_idx using a threshold value for the LAST position, and the threshold value is larger when the block size is equal to or larger than a predetermined size compared to when the block size is smaller than the predetermined size. Effect of the Invention
[0010] According to an aspect of the present invention, it is possible to improve the coding efficiency in video coding / decoding processing. [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] FIG. 2 is a diagram showing a hierarchical structure of data in an encoded stream. [Diagram 3] FIG. 1 is a schematic diagram showing a configuration of a video decoding device. [Figure 4] FIG. 13 is a schematic diagram showing a configuration of an inter-prediction image generating unit. [Diagram 5] FIG. 13 is a schematic diagram showing a configuration of an inter-prediction parameter derivation unit. [Figure 6] 11 is a flowchart illustrating a schematic operation of the video decoding device. [Figure 7] FIG. 2 is a functional block diagram showing an example of the configuration of an inverse quantization and inverse transform unit. [Figure 8] FIG. 13 is a schematic diagram showing the configuration of a TU decoding unit. [Figure 9] This is a syntax table for conversion in SPS. [Figure 10] 13 is a syntax table relating to conversion in a CU decoding unit. [Figure 11]13 is a syntax table relating to MtsDcOnly and MtsZeroOutSigCoeffFlag in the RRC section. [Figure 12] This is a table that determines the horizontal transformation type and the vertical transformation type in MTS and SBT. [Figure 13] 13 is another syntax table for mts_idx decoding and MtsZeroOutSigCoeffFlag derivation. [Figure 14] 13 is another syntax table for mts_idx decoding and MtsZeroOutSigCoeffFlag derivation. [Figure 15] 13 is a syntax table for mts_idx decoding and MtsCoeffStat derivation. [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 inter-prediction parameter encoding unit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] (First embodiment) 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 a target image, 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 a video 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 may be the Internet, a wide area network (WLAN), WAN: Wide Area Network), small network (LAN: Local Area Network) or The network 21 is a combination of the above. The network 21 is not necessarily limited to a two-way communication network, and may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcasting, satellite broadcasting, etc. 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 video display device 41 displays all or part of one or more decoded images Td generated by the video decoding device 31. The video 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 when x is true (non-zero) and z when x is false (0).
[0022] Clip3(a, b, c) is a function that clips c to a value between a and b, returning a if c < a, b if c > b, and c otherwise (where a <= b).
[0023] abs(a) is a function that returns the absolute value of a.
[0024] Int(a) is a function that returns the integer value of a.
[0025] floor(a) is a function that returns the largest integer less than or equal to a.
[0026] ceil(a) is a function that returns the smallest integer greater than or equal to a.
[0027] a / d represents the division of a by d (truncating the fractional part).
[0028] <Structure of the Encoded Stream Te> Prior to the detailed description of the moving image encoding apparatus 11 and the moving image decoding apparatus 31 according to this embodiment, the data structure of the encoded stream Te generated by the moving image encoding apparatus 11 and decoded by the moving image decoding apparatus 31 will be described.
[0029] FIG. 2 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 constituting the sequence. FIGS. 2(a) to 2(f) respectively show an encoded video sequence that defines the sequence SEQ, an encoded picture that defines the picture PICT, an encoded slice that defines the slice S, encoded slice data that defines the slice data, an encoded tree unit included in the encoded slice data, and an encoded unit included in the encoded tree unit.
[0030] (Coded Video Sequence) In the case of a coded video sequence, a video decoder is used to decode the sequence SEQ to be processed. The standard specifies a set of data to be referenced by the device 31. As shown in Fig. 2, the sequence SEQ includes a video parameter set, a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), an adaptation parameter set (APS), a picture PICT, and supplemental enhancement information SEI (Supplemental Enhancement Information).
[0031] The video parameter set VPS is used to determine the number of layers of a video image. A set of coding parameters common to multiple video images and a set of coding parameters related to multiple layers and individual layers included in the video images are defined.
[0032] The sequence parameter set SPS is used to decode the target sequence. A set of coding parameters to be referenced by the PPS is specified. 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 can be selected from the PPS. Select .
[0033] The picture parameter set PPS specifies the number of pictures to be decoded for each picture in the target sequence. A set of coding parameters to be referred to by the video decoding device 31 is specified. For example, the set includes a reference value of the quantization width used in decoding a picture (pic_init_qp_minus26) and a flag indicating application of weighted prediction (weighted_pred_flag). Note that there may be multiple PPSs. In that case, one of the multiple PPSs is selected from each picture in the target sequence.
[0034] (Encoded Picture) A coded picture defines a set of data to be referenced by the video decoding device 31 in order to decode a picture PICT to be processed. As shown in FIG. 2, 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, when there is no need to distinguish between slices 0 to NS-1, the symbols are The subscripts may be omitted in the description, and the same applies to other data to which subscripts are added that are included in the coded stream Te described below.
[0036] (Coded Slice) In the case of the coded slice, the video decoding device 31 refers to the slice S to be processed in order to decode the slice S. As shown in Figure 2, a slice consists of a slice header, and includes 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 during encoding, (2) a P slice that uses unidirectional prediction or intra prediction during encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction during encoding. Note that inter prediction is not limited to uni-prediction or bi-prediction, and a predicted image may be generated using more reference pictures. Hereinafter, P When called a B slice, it is a slice that includes blocks that can use inter prediction. This refers to the s.
[0039] In addition, the slice header may include a reference to a 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. As shown in Fig. 2(d), the slice data includes a CTU. 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) 2 specifies a set of data to be referenced by the video decoding device 31 in order to decode a CTU to be processed. The CTU is encoded by recursive quad tree (QT) division, binary tree (BT) division, or ternary tree (TT) division. The image is divided into coding units (CU), which are the basic units of processing. BT division and TT division are collectively called multi-tree division (MT (Multi Tree) division). A node in the tree structure obtained by recursive quadtree division is called a coding node. The intermediate nodes of the tree are coding nodes, and the CTU itself is also defined as the top coding node. The lowest coding node is defined as a coding unit.
[0042] Different trees may be used for luminance (first color component, cIdx=0) and chrominance (second and third color components, cIdx=1,2). The type of tree is indicated by treeType. For example, when using a common tree for luminance and chrominance, the common single tree is indicated by treeType=SINGLE_TREE. When using two different trees (dual trees) for luminance (Y, cIdx=0) and chrominance (Cb / Cr, cIdx=1,2), the luminance tree is indicated by treeType=DUAL_TREE_LUMA and the chrominance tree is indicated by treeType=DUAL_TREE_CHROMA. In the case of DUAL_TREE_CHROMA, the tree is also simply called the chrominance tree, as it encodes and decodes only chrominance images.
[0043] (Encoding Unit) FIG. 2 shows data to be referenced by the video decoding device 31 in order to decode the coding unit to be processed. Specifically, a CU consists of a CU header CUH, prediction parameters, and conversion parameters. The CU header includes information such as a prediction mode, a quantized transformation coefficient, and the like.
[0044] The prediction process may be performed on a CU basis, or on a sub-CU basis by further dividing a CU. If the size of a CU and a sub-CU are the same, there is one sub-CU in the CU. If the size of a CU is larger than that of a sub-CU, the CU is divided into sub-CUs. For example, if the CU is 8x8 and the sub-CU is 4x4, the CU is divided into 2 parts horizontally and 2 parts vertically, into 4 sub-CUs.
[0045] Prediction types (prediction modes) include intra prediction (MODE_INTRA), inter prediction (MODE_INTER), and intra block copy (MODE_IBC). Intra prediction is a prediction within the same picture, and inter prediction refers to a prediction process performed between different pictures (for example, between display times or between layer images).
[0046] Transformation and quantization are performed in units of CUs, but quantization coefficients are stored in units of subblocks such as 4x4. It may be entropy coded.
[0047] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.
[0048] (Inter prediction parameters) The prediction parameters of the inter prediction will be described. The inter prediction parameters are prediction list usage flags predFlagL0 and predFlagL1, reference picture indexes refIdxL0 and refIdxL1. , and motion vectors mvL0 and mvL1. predFlagL0 and predFlagL1 are flags indicating whether or not a reference picture list (L0 list, L1 list) is used, and when the value is 1, the corresponding reference picture list is used. Note that in this specification, when the term "flag indicating whether or not XX" is used, a flag other than 0 (for example, 1) is taken to mean XX, and 0 is taken to mean not XX, and in logical negation, logical product, etc., 1 is treated as true and 0 is treated as false (same below). However, in an actual device or method, other values may be used as true and false values.
[0049] Syntax elements for deriving inter-prediction parameters include, for example, a merge flag merge_flag (general_merge_flag), a merge index merge_idx, merge_subblock_flag indicating whether to use sub-block-based inter-prediction, regulare_merge_flag, ciip_flag indicating whether to use CIIP (combined inter-picture merge and intra-picture prediction) mode or GPM mode (Geometric partitioning merge mode), merge_gpm_partition_idx indicating the partition shape in GPM mode, merge_gpm_idx0 and merge_gpm_idx1 indicating merge indices in GPM mode, an inter-prediction identifier inter_pred_idc for selecting a reference picture to be used in AMVP mode, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx for deriving a motion vector, a difference vector mvdLX, and a motion vector precision mode amvr_mode.
[0050] (Reference picture list) The reference picture list is a list of reference pictures stored in the reference picture memory 306. Each CU can select any picture in the reference picture list RefPicListX (X=0 or 1). Specify whether to actually refer to the L0 list or L1 list with refIdxLX. Note that LX is a description method used when there is no distinction between L0 prediction and L1 prediction. In the following, LX will be replaced with L0 and L1 to distinguish between parameters for the L0 list and parameters for the L1 list.
[0051] (Merge prediction and AMVP prediction) The prediction parameter decoding (encoding) method can be merged prediction mode. Adaptive Motion Vector Prediction (AMVP) mode and merge_flag is a flag for identifying them. The merge mode is a prediction mode in which some or all of the motion vector difference is omitted, and the prediction list usage flag predFlagLX, the reference picture index refIdxLX, and the motion vector mvLX are not included in the encoded data, but are derived from the prediction parameters of the neighboring blocks that have already been processed. The AMVP mode is a mode in which inter_pred_idc, refIdxLX, and mvLX are included in the encoded data. Note that mvLX is encoded as mvp_LX_idx, which identifies the predicted vector mvpLX, and the difference vector mvdLX. A general term for prediction modes in which the motion vector difference is omitted or simplified is called a general merge mode, and general merge mode and AMVP prediction may be selected by general_merge_flag. Furthermore, regular_merge_flag may be transmitted, and if regular_merge_flag is 1, normal merge mode or MMVD may be selected, and otherwise CIIP mode or GPM mode may be selected. In the CIIP mode, a predicted image is generated by a weighted sum of an inter-predicted image and an intra-predicted image. In the GPM mode, a predicted image is generated by dividing a target CU into two non-rectangular prediction units by a line segment.
[0052] The inter_pred_idc is a value indicating the type and number of reference pictures, and takes one of the values PRED_L0, PRED_L1, and PRED_BI. PRED_L0 and PRED_L1 are managed by the L0 list and the L1 list, respectively. PRED_BI is managed by the L0 list and the L1 list. 1 shows bi-prediction using two reference pictures.
[0053] merge_idx is the prediction parameter candidate (merge candidate) derived from the processed block. (comment) is to be used as a prediction parameter for the current block.
[0054] (Motion Vector) mvLX indicates the amount of shift between blocks on two different pictures. A prediction vector and a difference vector related to mvLX are called mvpLX and mvdLX, respectively.
[0055] (Inter prediction identifier inter_pred_idc and prediction list usage flag predFlagLX) The relationship between inter_pred_idc, predFlagL0, and predFlagL1 is as follows, and they are mutually convertible.
[0056] inter_pred_idc = (predFlagL1<<1)+predFlagL0 predFlagL0 = inter_pred_idc & 1 predFlagL1 = inter_pred_idc >> 1 In addition, the inter prediction parameter may use a prediction list usage flag or an inter prediction identifier. Furthermore, the determination using the prediction list usage flag may be replaced with a determination using the inter prediction identifier. Conversely, the determination using the inter prediction identifier may be replaced with a determination using the prediction list usage flag.
[0057] (Bi-predictive biPred decision) A flag biPred indicating whether or not the prediction is bi-predictive can be derived based on whether or not two prediction list usage flags are both 1.
[0058] Alternatively, biPred can be derived based on whether the inter-prediction identifier is a value indicating the use of two prediction lists (reference pictures).
[0059] (Configuration of a video decoding device) The configuration of a video decoding device 31 (FIG. 3) according to this embodiment will be described.
[0060] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device ) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, an inverse quantization and inverse transformation unit 311, and an addition unit 312, a prediction parameter The meter derivation unit 320 is also included. The image decoding device 31 may also be configured without including the loop filter 305 .
[0061] The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022. The CU decoding unit 3022 further 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, PPS, and APS, and slice headers (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.
[0062] The CU decoding unit 3022 may decode a sub-block transform flag cu_sbt_flag. When cu_sbt_flag is 1, a sub-block transform is used in which a CU is divided into a plurality of sub-blocks and transformed on a sub-block basis. Furthermore, the CU decoding unit 3022 may decode a flag cu_sbt_quad_flag indicating whether the size of the sub-block to be transformed is ¼ or ½ of the CU, cu_sbt_horizontal_flag indicating the division direction, and cu_sbt_pos_flag indicating a sub-block including a non-zero transform coefficient.
[0063] In addition, the CU decoding unit 3022 decodes a parameter lfnst_idx indicating whether or not a non-separable transform is used and a non-separable transform matrix from the encoded data. If the length is 4 or more and the prediction mode is an intra prediction mode, lfnst_idx is Note that lfnst_idx is 0 when it indicates that the non-separable transform is not applied, and 1 when it indicates that the non-separable transform is not applied. In the case of 2, it indicates the other transformation matrix of the pair. The transformation matrix is shown.
[0064] In addition, lfnst_idx may be 0 or 1. In addition, lfnst_idx may be derived from the mode number of intra prediction.
[0065] In addition, the CU decoding unit 3022 performs Multiple Transform Selection (MTS) transform on the encoded data. Specifically, the CU decoding unit 3022 decodes a value mts_idx indicating a matrix. and lfnst_idx is 0, mts_idx is decoded. MTS selects and uses one transformation matrix from multiple transformation matrix candidates.
[0066] The CU decoding unit 3022 may decode intra_subpartitions_mode_flag. intra_subpartitions_mode_flag indicates whether intra subblock partitioning (Intra Subpartitining Prediction, ISP) is used, in which a luminance block is partitioned into subblocks for processing. If intra_subpartitions_mode_flag is 0, IntraSubPartitionsSplitType is set to ISP_NO_SPLIT (=0), and ISP is not used. If intra_subpartitions_mode_flag is other than 0, intra_subpartitions_split_flag, which indicates the partitioning direction, is further decoded and set as follows: IntraSubPartitionsSplitType is a parameter indicating the state of a subblock.
[0067] IntraSubPartitionsSplitType = intra_subpartitions_split_flag == 0 ? ISP_HOR_SPLIT : ISP_VER_SPLIT The TU decoding unit 3024 detects whether the size of the transform unit (tbWidth and tbHeight) is equal to or smaller than a predetermined maximum size. If tbWidth<=MaxTsSize && tbHeight<=MaxTsSize, decode transform_skip_flag[x0][y0][cIdx].
[0068] When a TU includes a prediction error (for example, tu_cbf_luma[x0][y0] is In the case of RRC (Regular RC), the QP update information and the quantized transform coefficients are decoded from the encoded data. The quantized transform coefficients may be derived in multiple modes (e.g., RRC mode and TSRC mode). RRC (Rest-Residual Coding) is a decoding mode of prediction error using transform, and TSRC (Transform Skip Residual Coding) is a decoding mode of prediction error in transform skip mode without transform. The TU decoding unit 3024 decodes the last position of the transform coefficient in the RRC mode, but does not need to decode the last position in the TSRC mode. 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.
[0069] The predicted image generating unit 308 generates an inter-predicted image and an intra-predicted image. The device 300 includes a unit 310.
[0070] The prediction parameter derivation unit 320 is a unit including the inter prediction parameter derivation unit 303 (FIG. 5) and the intra prediction parameter derivation unit 304 (FIG. 6). It includes a prediction parameter derivation unit.
[0071] In the following, we will describe an example in which CTU and CU are used as processing units, but this is not limiting. Alternatively, the processing may be performed in units of sub-CUs. and processing may be performed in units of blocks or sub-blocks.
[0072] The entropy decoding unit 301 performs entropy decoding on the encoded stream Te input from the outside. Entropy coding is performed to decode individual codes (syntax elements). There are two types of entropy coding: one is to use a context (probability model) that is adaptively selected according to the type of syntax element and the surrounding circumstances to code the syntax elements into variable-length codes, and the other is to use a predetermined table or formula to code the syntax elements into variable-length codes.
[0073] The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. The decoded code is, for example, a prediction mode predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX, amvr_mode, etc. Control of which code to decode is performed based on an instruction from the parameter decoding unit 302.
[0074] (Basic flow) FIG. 6 is a flowchart illustrating a schematic operation of the video decoding device 31.
[0075] (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.
[0076] (S1200: Decode slice information) The header decoding unit 3020 decodes slice header information from the encoded data. Decode (slice information).
[0077] Hereinafter, the video decoding device 31 performs steps S1300 to S5000 for each CTU included in the target picture. By repeating the above process, a decoded image of each CTU is derived.
[0078] (S1300: Decode CTU Information) The CT information decoding unit 3021 decodes the CTU from the encoded data.
[0079] (S1400: Decode CT Information) The CT information decoding unit 3021 decodes the CT from the encoded data.
[0080] (S1500: CU Decoding) The CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data. Issued.
[0081] (S1510: Decode CU information) The CU decoding unit 3022 decodes CU information, prediction information, and TU division from the encoded data. flag, CU residual flag, etc.
[0082] (S1520: Decode TU information) When a TU includes a prediction error, the TU decoding unit 3024 decodes the encoded TU information. The quantized prediction error, the transform index lfnst_idx, etc. are decoded from the data.
[0083] 8 is a block diagram of the TU decoding unit 3024, which includes an RRC unit 30241 and a TSRC unit 30242. The RRC unit 30241 decodes normal prediction errors using transform from encoded data, and the TSRC unit 30242 decodes normal prediction errors using transform skip. Decode the prediction error in mode.
[0084] (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.
[0085] (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.
[0086] (S4000: Decoded image generation) The adder 312 receives a predicted image from the predicted image generator 308 and The prediction error supplied from the inverse quantization and inverse transform unit 311 is added to the A decoded image is generated.
[0087] (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.
[0088] The loop filter 305 is a filter provided in the coding loop, and is used to remove block distortion and ringing. The loop filter 305 is a filter that removes distortion and improves image quality. The decoded image of the CU is subjected to deblocking filter, sample adaptive offset (SAO), and adaptive Apply a filter such as an automatic loop filter (ALF).
[0089] 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.
[0090] 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 prediction mode predMode separated by the entropy decoding unit 301. do.
[0091] The prediction mode predMode, prediction parameters, etc. are input to the prediction image generation unit 308. The predicted image generation unit 308 then reads out the reference picture from the reference picture memory 306. The predicted image generation unit 308 performs the prediction parameter generation and the read out reference picture in the prediction mode indicated by the prediction mode predMode. A prediction image of a block or sub-block is generated using a reference picture (reference picture block). Here, a reference picture block is a set of pixels on the reference picture (usually rectangular, so called a block), which is an area referenced to generate a prediction image.
[0092] (Configuration of inter-prediction parameter derivation unit) As shown in FIG. 5, the inter-prediction parameter derivation unit 303 receives the input from the parameter decoding unit 302. Based on the input syntax element, the prediction parameters stored in the prediction parameter memory 307 are The inter prediction parameter derivation unit 303 derives inter prediction parameters by referring to the motion vector derivation unit 303. The inter prediction parameter derivation unit 303 also outputs the inter prediction parameters to the inter prediction image generation unit 309 and the prediction parameter memory 307. The inter prediction parameter derivation unit 303 and its internal elements, the AMVP prediction parameter derivation unit 3032, the merge prediction parameter derivation unit 3036, the GPM prediction unit 30377, and the MV addition unit 3038, are means common to the video encoding device and the video decoding device, and therefore may be collectively referred to as a motion vector derivation unit (motion vector derivation device).
[0093] If merge_flag is 1, i.e., it indicates merge prediction mode, derive merge_idx and The resultant signal is output to the prediction parameter derivation unit 3036.
[0094] When merge_flag is 0, that is, when it indicates the AMVP prediction mode, the AMVP prediction parameter derivation unit 3032 derives mvpLX from inter_pred_idc, refIdxLX, or mvp_LX_idx.
[0095] (MV addition section) The MV adder 3038 adds the derived mvpLX and mvdLX to derive mvLX.
[0096] (Merge prediction) The merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361 and a merge candidate selection unit 30362. Note that a merge candidate includes prediction parameters (predFlagLX, mvLX, refIdxLX) and is stored in a merge candidate list. An index is assigned to the merge candidates stored in the merge candidate list according to a predetermined rule.
[0097] The merge candidate derivation unit 30361 directly extracts the motion vector and refIdxLX of the decoded adjacent block. In addition, the merging candidate derivation unit 30361 uses the spatial A merge candidate derivation process, a temporal merge candidate derivation process, etc. may be applied.
[0098] As a spatial merge candidate derivation process, the merge candidate derivation unit 30361 predicts the spatial merge candidates according to a predetermined rule. The prediction parameters stored in the measurement parameter memory 307 are read out and set as merge candidates. For example, the prediction parameters for the positions A1, B1, B0, A0, and B2 are read out.
[0099] A1: (xCb-1, yCb+cbHeight-1) B1: (xCb+cbWidth-1, yCb-1) B0: (xCb+cbWidth, yCb-1) A0: (xCb-1, yCb+cbHeight) B2: (xCb-1, yCb-1) The upper left coordinates of the target block are (xCb, yCb), its width is cbWidth, and its height is cbHeight.
[0100] In the temporal merge derivation process, the merge candidate derivation unit 30361 calculates the prediction parameters of the block C in the reference image including the coordinates of the lower right CBR or the center of the target block from the prediction parameter memory. The merge candidates are read from memory 307 and stored as merge candidates Col in the merge candidate list mergeCandList[]. do.
[0101] The order of storing the mergeCandList[] is, for example, spatial merge candidates (B1, A1, B0, A0, B2), time The merge candidates are Col. Note that the reference blocks that are not available (e.g., the blocks are intra-predicted) The merge candidate list is not populated with i = 0 if(availableFlagB1) mergeCandList[i++] = B1 if(availableFlagA1) mergeCandList[i++] = A1 if(availableFlagB0) mergeCandList[i++] = B0 if(availableFlagA0) mergeCandList[i++] = A0 if(availableFlagB2) mergeCandList[i++] = B2 if(availableFlagCol) mergeCandList[i++] = Col Furthermore, the history merge candidate HmvpCand, the average candidate avgCand, and the zero merge candidate zeroCandm may be added to mergeCandList[] for use.
[0102] The merging candidate selection unit 30362 selects a merging candidate N indicated by merge_idx from among the merging candidates included in the merging candidate list, using the following formula.
[0103] N = mergeCandList[merge_idx] Here, N is a label indicating a merging candidate, and can be A1, B1, B0, A0, B2, Col, etc. The motion information of the merging candidate indicated by the label N is indicated by (mvLXN[0], mvLXN[1]), predFlagLXN, and refIdxLXN.
[0104] The selected (mvLXN[0], mvLXN[0]), predFlagLXN, and refIdxLXN are selected as inter prediction parameters of the current block. The inter-prediction parameters are stored in the prediction parameter memory 307, and the inter-prediction image The generated signal is output to the generating unit 309.
[0105] (Inter-prediction image generation unit 309) When the predMode indicates inter prediction, the inter prediction image generation unit 309 The inter prediction parameter derivation unit 303 calculates the inter prediction parameter and the reference picture. A predicted image of a block or sub-block is generated by super-prediction.
[0106] FIG. 4 is a block diagram of the inter-prediction image generating unit 309 included in the prediction image generating unit 308 according to this embodiment. The inter-prediction image generating unit 309 is a motion compensation unit (prediction image generating device). The synthesis unit 3095 includes an IntraInter synthesis unit 30951, a GPM synthesis unit 30952, a BIO unit 30954, and a weighted prediction unit 3094.
[0107] (Motion Compensation) The motion compensation unit 3091 (interpolated image generation unit 3091) receives the input from the inter prediction parameter derivation unit 303. Based on the input inter prediction parameters (predFlagLX, refIdxLX, mvLX), an interpolated image (motion compensated image) is generated by reading a reference block from the reference picture memory 306. The reference block is a block shifted by mvLX from the position of the target block on the reference picture RefPicLX specified by refIdxLX. If mvLX does not have integer precision, an interpolated image is generated by applying a filter called a motion compensation filter for generating pixels at decimal positions.
[0108] The motion compensation unit 3091 first derives an integer position (xInt, yInt) and a phase (xFrac, yFrac) corresponding to coordinates (x, y) in the prediction block using the following formula.
[0109] xInt = xPb+(mvLX[0]>>(log2(MVPREC)))+x xFrac = mvLX[0]&(MVPREC-1) yInt = yPb+(mvLX[1]>>(log2(MVPREC)))+y yFrac = mvLX[1]&(MVPREC-1) Here, (xPb, yPb) are the upper left coordinates of a block of size bW*bH, where x=0...bW-1, y=0...bH-1, and MVPREC indicates the accuracy of mvLX (1 / MVPREC pixel accuracy), e.g., MVPREC=16.
[0110] The motion compensation unit 3091 derives a temporary image temp[][] by performing horizontal interpolation processing on the reference picture refImg using an interpolation filter. In the following, Σ is the sum for k=0..NTAP-1, shift1 is a normalization parameter that adjusts the value range, and offset1=1<<(shift1-1).
[0111] temp[x][y] = (ΣmcFilter[xFrac][k]*refImg[xInt+k-NTAP / 2+1][yInt]+offset1)>>shift1 Next, the motion compensation unit 3091 derives the interpolated image Pred[][] by vertically interpolating the temporary image temp[][]. In the following, Σ is the sum for k=0..NTAP-1, shift2 is a normalization parameter that adjusts the value range, and offset2=1<<(shift2-1).
[0112] Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP / 2+1]+offset2)>>shift2 In the case of bi-prediction, the above Pred[][] is used to derive interpolated images PredL0[][] and PredL1[][] for each of the L0 and L1 lists, and an interpolated image Pred[][] is generated from PredL0[][] and PredL1[][].
[0113] (GPM synthesis processing) When ciip_mode is 0, the GPM synthesis unit 30952 generates a predicted image in GPM mode by a weighted sum of multiple inter predicted images.
[0114] (IntraInter synthesis processing) When ciip_mode is set to 1, the IntraInter synthesis unit 30951 processes the predicted image in CIIP mode as an inter A predicted image is generated by a weighted sum of the intra-predicted image and the intra-predicted image.
[0115] (BIO forecast) In bi-prediction mode, the BIO unit 30954 generates a predicted image by referring to two predicted images (a first predicted image and a second predicted image) and a gradient correction term.
[0116] (Weighted prediction) The weighted prediction unit 3094 generates a predicted image of the block by multiplying the interpolated image PredLX by a weighting coefficient.
[0117] The inter-prediction image generation unit 309 outputs the generated prediction image of the block to the addition unit 312 .
[0118] (Intra-prediction image generation unit) When predMode indicates intra prediction, the intra prediction image generation unit performs intra prediction using the intra prediction parameters input from the intra prediction parameter derivation unit and reference pixels read from the reference picture memory 306 .
[0119] The inverse quantization and inverse transform unit 311 inverse quantizes the quantized transform coefficients input from the parameter decoding unit 302 to obtain transform coefficients.
[0120] (inverse quantization and inverse transformation) 7 is a block diagram showing the configuration of the inverse quantization and inverse transform unit 311 of this embodiment. The inverse quantization and inverse transform unit 311 is made up of a scaling unit 31111, an inverse non-separable transform unit 31121, and an inverse separate transform unit 31123.
[0121] The inverse quantization and inverse transform unit 311 obtains the transform coefficients d[][] by scaling (inverse quantization) the quantized transform coefficients qd[][] input from the entropy decoding unit 301 using a scaling unit 31111. The quantized transform coefficients qd[][] are coefficients obtained by performing a transform such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on the prediction error in the encoding process and quantizing it, or by further performing a non-separable transform on the transformed coefficients and quantizing them. When lfnst_idx!=0, the inverse quantization and inverse transform unit 31121 performs an inverse transform. Furthermore, the inverse non-separable transform unit 31121 performs an inverse separable transform such as inverse DCT or inverse DST on the transform coefficients to calculate the prediction error. Also, when lfnst_idx==0, the inverse non-separable transform unit 31121 is not performed, and inverse separation transform such as inverse DCT and inverse DST is performed on the transform coefficients scaled by the scaling unit 31111 to calculate a prediction error. The inverse quantization / inverse transform unit 311 outputs the prediction error to the adder 312.
[0122] In addition, since the inverse transformation and the transformation are paired processes, the transformation and the inverse transformation may be interpreted as being interchangeable. Alternatively, when the inverse transformation is called the transformation, the transformation may be called the forward transformation. For example, when the inverse non-separable transformation is called the non-separable transformation, the non-separable transformation may be called the forward non-separable transformation. Moreover, the separable transformation is simply called the transformation.
[0123] (Details of Scaling Part 31111) The scaling unit 31111 uses the quantization parameter and scaling factor derived in the parameter decoding unit 302 to scale the transform coefficients decoded by the TU decoding unit using coefficient-by-coefficient weighting.
[0124] The scaled transform coefficients d[x][y] are transmitted to the inverse non-separable transform unit 31123 or the inverse non-separable transform unit 31121. The inverse non-separable transform unit 31121 applies an inverse non-separable transform to the transform coefficients d[][] after inverse quantization and before the separable transform.
[0125] (Non-separable transform / inverse non-separable transform) The non-separable transform (second transform) is applied in the video encoding device 11 to the transform coefficients of a part or the whole region of the TU after the separable transform (DCT2, DST7, etc.). The non-separable transform removes the correlation remaining in the transform coefficients and concentrates the energy in some of the transform coefficients. The inverse non-separable transform is applied in the video decoding device 31 to the transform coefficients of a part or the whole region of the TU. Inverse Non-Separable Transform After the inverse non-separable transform is applied, the inverse separable transform (DCT2, DST7, etc.) is applied to the transform coefficients after the inverse non-separable transform. In addition, when the TU is divided into 4x4 subblocks, the upper left subblock The non-separable transform and the inverse non-separable transform are applied only to the TU. If either the width W or the height H of the TU is 4, The sizes of the TUs that can be used are, for example, 4×4, 8×4, 4×8, L×4, and 4×L (L is a natural number greater than or equal to 16). Can be obtained.
[0126] Also, the technology of transmitting only some low-frequency components among the conversion coefficients after the separation conversion is called RST (Reduced Secondary Transform) or LFNST (Low Frequency Non-Separable-Transform). Specifically, when the number nonZeroSize of the conversion coefficients of the separation conversion to be transmitted is less than or equal to the size of the TU ((1<<log2StSize)x(1<<log2StSize)) after the separation conversion, it becomes LFNST.
[0127] In the non-separable conversion and the inverse non-separable conversion, the following processing is performed according to the size of the TU and the IntraPredMode of the intra prediction. Hereinafter, the processing of the inverse non-separable conversion will be described in order.
[0128] (S1: Setting of the conversion size and the input / output size) In the inverse non-separable conversion, according to the size (width W, height H) of the TU, the size of the inverse non-separable conversion (4x4 or 8x8), the number (nStOutSize) of the output conversion coefficients, the number nonZeroSize of the conversion coefficients (input conversion coefficients) to which the inverse non-separable conversion is applied, and the number (numStX, numStY) of sub-blocks to which the inverse non-separable conversion is applied are derived. The sizes of the 4x4 and 8x8 inverse non-separable conversions are indicated by nStSize = 4 and 8. Also, the sizes of the 4x4 and 8x8 inverse non-separable conversions may be called RST4x4 and RST8x8, respectively.
[0129] In the inverse non-separable conversion, when the TU is 8x8 or more, 48 conversion coefficients are output by the inverse non-separable conversion of RST8x8. That is, nStSize = 8 and nStOutSize = 48. Otherwise, 16 conversion coefficients are output by the inverse non-separable conversion of RST4x4. That is, nStSize = 4 and nStOutSize = 16. Also, in the inverse non-separable conversion, when the TU is 4x4 or 8x8, the number of input conversion coefficients is 8, that is, nonZeroSize = 8. Otherwise, the number of input conversion coefficients is 16, that is, nonZeroSize = 16.
[0130] If W and H are both 8 or more, log2StSize = 3, nStOutSize = 48 Otherwise, log2StSize = 2, nStOutSize=16 nStSize = 1< <log2StSize If W and H are both 4 or both are 8, then nonZeroSize = 8 Otherwise, nonZeroSize = 16 Note that nonZeroSize is not limited to 8 and 16. For example, it may be 12. nStOutSize is not limited to 16 and 48. It may be 32, 36, 64, or the like.
[0131] numStX = (nTbH == 4 && nTbW > 8) ? 2 : 1 numStY = (nTbW == 4 && nTbH > 8) ? 2 : 1 It is also possible to always set numStX=numStY=1 without performing non-separable transformation on a plurality of sub-blocks.
[0132] (S2: Rearrange into one-dimensional signal) The inverse non-separable transform unit 31121 rearranges some of the transform coefficients d[][] of the TU into a one-dimensional array u[]. Specifically, the inverse non-separable transform unit 31121 processes two TUs of the target TU indicated by the region RU. From the dimensional transform coefficients d[][], u[] is derived by referring to the transform coefficients for x=0..nonZeroSize-1. xC and 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 subblock.
[0133] xC = (xSbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][0] yC = (ySbIdx< <log2StSize) + DiagScanOrder[log2StSize][log2StSize][x][1] u[x] = d[xC][yC] The range copied to the one-dimensional array is called an area RU.
[0134] (S3: Applying conversion processing) The inverse non-separable transform unit 31121 performs transform on u[] of length nonZeroSize using the transform matrix secTransMatrix[][], and derives coefficients v[] of a one-dimensional array of length nStOutSize as output.
[0135] Specifically, the inverse non-separable transform unit 31121 receives a set number (lfnstTrSetId) of the non-separable transform, The inverse non-separable transform unit 31121 derives a transform matrix secTranMatrix[][] from lfnst_idx indicating the transform matrix of the separable transform and the non-separable transform size nStSize(nTrS). lfnstTrSetId is a set number of the non-separable transform derived from the intra prediction mode IntraPredMode. Furthermore, the inverse non-separable transform unit 31121 performs the following As shown in the formula, a multiplication and addition operation is performed between the transformation matrix and the one-dimensional variable u[].
[0136] v[i] = Clip3( CoeffMin, CoeffMax,Σ(secTransMatrix[i][j]*u[j]+64)>>7) Here, Σ is the sum up to j=0..nonZeroSize-1. Also, i is processed for 0..nStSize-1. CoeffMin and CoeffMax indicate the range of values of the conversion coefficients.
[0137] (S4: 2D arrangement of 1D signal after conversion processing) The inverse non-separable transform unit 31121 again arranges the transformed coefficients v[] of the one-dimensional array at predetermined positions within the TU. The arrangement method may be changed depending on PredModeIntra.
[0138] Specifically, if PredModeIntra<=34, the following processing may be applied.
[0139] d[x][y] = (y<4) ? v[x+(y< <log2StSize)] : ((x<4) ? v[32+x+((y-4)<<2)] : d[x][y]) Otherwise, the following formula applies:
[0140] d[x][y] = (x<4) ? v[y+(x< <log2StSize)] : ((y<4) ? v[32+y+((x-4)<<2)] : d[x][y]) Furthermore, the above branching determination may be "PredModeIntra<=34 or PredModeIntra==INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM", etc.
[0141] (Reverse separation conversion unit 31123) The inverse separation transform unit 31123 explicitly or implicitly switches the transformation matrix. The transform that can be used is a separable 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 also be defined as a separable transform. The transform matrices of the separation transform are DCT2, DST7, DCT8, DCT5, DST4, DST1, and IDT. IDT is an identity transform. In the separation transform, the transform matrix is switched independently for the vertical transform and the horizontal transform. Note that the selectable transforms are not limited to those mentioned above, and it is also possible to use a different transform (transform matrix). The inverse separation transform unit 31123 is usually called a transform unit. Below, the process of the inverse non-separable transform will be explained in order.
[0142] (Decoding of separation transformation parameters) 9, 10 and 11 are syntax tables relating to separation transformation parameters.
[0143] As shown in FIG. 9, the parameter decoding unit 302 decodes sps_mts_enabled_flag in the SPS. When sps_mts_enabled_flag is 1, it indicates that sps_explicit_mts_intra_enabled_flag and sps_explicit_mts_inter_enabled_flag are present in the SPS. When sps_mts_enabled_flag is 0, it indicates that sps_explicit_mts_intra_enabled_flag and sps_explicit_mts_inter_enabled_flag are not present in the SPS. When sps_mts_enabled_flag indicates 1, the parameter decoding unit 302 further sps_explicit_mts_intra_enabled_flag is a flag indicating whether mts_idx may be explicitly decoded in a block coded by intra prediction. When sps_explicit_mts_intra_enabled_flag is 1, it indicates that mts_idx may be decoded in a block coded by intra prediction. When sps_explicit_mts_intra_enabled_flag is 0, it indicates that mts_idx may not be decoded in a block coded by intra prediction. When sps_explicit_mts_intra_enabled_flag is not decoded, it is estimated to be 0. Moreover, sps_explicit_mts_inter_enabled_flag is a flag indicating whether mts_idx may be explicitly decoded in a block coded by inter prediction. When sps_explicit_mts_inter_enabled_flag is 1, it indicates that mts_idx may be decoded in a block coded by inter prediction. When sps_explicit_mts_inter_enabled_flag is 0, it indicates that mts_idx may not be decoded in a block coded by inter prediction. When sps_explicit_mts_inter_enabled_flag is not decoded, it is estimated to be 0. Note that mts_idx is an index indicating the transformation matrix of the separation transformation.
[0144] Fig. 10 shows syntax related to mts_idx. When decoding mts_idx, the CU decoding unit 3022 first sets variables MtsDcOnly and MtsZeroOutSigCoeffFlag to 1, and calls the TU decoding unit 3024. MtsDcOnly is a flag indicating whether or not the non-zero transform coefficient in the TU is only a DC component. MtsZeroOutSigCoeffFlag is a flag indicating whether or not a predetermined high frequency component of the TU has no non-zero coefficient (is zeroed out). When transform is used (when transform_skip_flag is 0 or sh_ts_residual_coding_disabled_flag is 1, transform skip mode is not used), the TU decoding unit 3024 (RRC unit 30241) decodes the syntax of residual_coding() shown in Fig. 11. transform_skip_flag is a flag indicating whether or not transform skip is performed. sh_ts_residual_coding_disabled_flag is a flag indicating whether or not normal residual coding (RRC) is prohibited. First, the syntax element indicating the LAST position is decoded to derive the LAST position (LastSignificantCoeffX, LastSignificantCoeffY). The LAST position is the position of the last non-zero coefficient when the transform coefficients of the TU are scanned in the direction from the low frequency component to the high frequency component. Next, the RRC unit 30241 searches the transform coefficients from the high frequency component to the low frequency component, and derives the position of the subblock (lastSubBlock) to which the LAST position belongs and the LAST position (lastScanPos) within the subblock. Then, as shown in SYN_MtsLastPos in FIG. 11, if cIdx==0 (luminance block) and lastSubBlock>0 or lastScanPos>0, the RRC unit 30241 sets the variable MtsDcOnly to 0. Furthermore, when searching for whether or not a non-zero coefficient exists in a block for each subblock, the RRC unit 30241 sets the variable MtsZeroOutSigCoeffFlag as shown in SYN_MtsZeroOutSigCoeff in FIG.That is, when there is a non-zero coefficient in the sub-block, and the sub-block position is at a position greater than a predetermined position, and cIdx == 0, the variable MtsZeroOutSigCoeffFlag is set to 0. Therefore, when there is a non-zero transform coefficient in a predetermined sub-block located in the high-frequency component, MtsZeroOutSigCoeffFlag is turned off (= 0). When there is no non-zero in the predetermined sub-block, MtsZeroOutSigCoeffFlag remains 1. Decode mts_idx only when the TU is zeroed out. Here, the predetermined position is, for example, a position where the x-direction position (xS) of the sub-block is greater than 3, or the y-direction position (yS) is greater than 3 (xS > 3 || yS > 3).
[0145] The CU decoding unit 3022 decodes the conversion set used for the non-separable transform LFNST, or does not perform a non-separable transform to obtain the lfnst_idx indicating this. If lfnst_idx is not decoded, the value of lfnst_idx is estimated to be 0. Then, when the CU decoding unit 3022 satisfies all of the following <MTS condition 1> as shown in SYN_CondMts of FIG. 10 and further satisfies any one of <MTS condition 2>, it decodes mts_idx. <MTS condition 1> (1-1) In the dual tree, it is not a chroma tree (treeType != DUAL_TREE_CHROMA) (1-2) Does not use the non-separable transform LFNST (lfnst_idx == 0) (1-3) It is not in the transform skip mode (transform_skip_flag[x0][y0][0] == 0) (1-4) The CU size is 32x32 or less (Max(cbWidth, cbHeight) <= 32) (1-5) In the intra prediction block, no intra sub-block splitting is performed (IntraSubPartitionsSplitType == ISP_NO_SPLIT) (1-6) In the inter prediction block, no sub-block transform is performed (cu_sbt_flag == 0) (1-7) There is no non-zero coefficient at the high-frequency position (MtsZeroOutSigCoeffFlag == 1) (1-8) The LAST position is not the position of the lowest frequency component (DC component) (MtsDcOnly == 0) <MTS Condition 2> (2-1) sps_explicit_mts_inter_enabled_flag is 1 and the prediction mode is inter prediction (2-2) sps_explicit_mts_intra_enabled_flag is 1 and the prediction mode is intra prediction In addition, when mts_idx is not decoded, it is estimated to be 0. mts_idx may also be configured to take values from 0 to 4. The CU decoder 3022 may encode and decode mts_idx using a TR (Truncated Rice) binary or TB (truncated binary) with cMax = 4 and cRiceParam = 0.
[0146] (Decoding of mts_idx) The CU decoder 3022 may change the value range of mts_idx related to the transformation of the transform coefficients of the target TU (i.e., the number of candidates for the transformation matrix of the target TU) according to the LAST position (the value of lastScanPos) of the target transform block (target TU). The CU decoder 3022 may change the value range of mts_idx using a plurality of thresholds ( number) Specifically, the CU decoding unit 3022 may change the maximum value cMax of mts_idx according to the LAST position and decode mts_idx. For example, when lastScanPos is TH1 or more and TH2 or less, the mts_idx value range may be set to 0 to 1, and decoding may be performed with cMax=1. For example, TH1 may be 1 and TH2 may be 6. In this case, in addition to DCT2 (mts_idx==0), one transformation matrix other than DCT2 (for example, DST7) may be selected. Also, when lastScanPos is greater than TH2 and less than TH3, mts_idx may be decoded using cMax=4 indicating 0 to 4. For example, TH3 may be 32. In this case, in addition to DCT2, four transformation matrices (for example, DST7, DCT8, DCT5, DST4) may be selected according to mts_idx=1,2,3,4. Finally, if lastScanPos is greater than TH3, mts_idx may be decoded using cMax=6, which indicates 0 to 6. In this case, in addition to DCT2, six transform matrices other than DCT2 (for example, DST7, DCT8, DCT5, DST4, DST1, IDT) may be selected. Note that the values of thresholds TH1, TH2, and TH3 for changing the range of mts_idx are not limited to the above values, and the selectable transform matrices are not limited to the above. Also, the parameter decoding unit 302 (CU decoding unit 3022) may decode the thresholds for changing the range of mts_idx.
[0147] In this embodiment, the CU decoding unit 3022 performs syntax of mts_idx according to the last position of the current block. It is characterized by changing the maximum value cMax used for encoding and decoding of the Kusu element. More specifically, when the LAST position is large (located at high frequency), the value of the said cMax may be increased, and mts_idx may be encoded and decoded using cMax. The CU decoder unit 3022 may encode and decode mts_idx using Truncated Binary (TB) with respect to each value of cMax. cMax is the upper limit value of the possible values of the syntax element. TB is a binari zation using a known cMax. Alternatively, the CU decoder unit 3022 decodes in 1 bit whether to use other than DCT2 as the conversion matrix. Thereafter, encoding and decoding may be performed using TR or TB with reference to each cMax - 1.
[0148] (Another embodiment of decoding of the transform parameters) (Another embodiment 1 of <MTS condition>) For (1 - 8) of the above <MTS condition 1>, the CU decoder unit 3022 may use the number of non - zero coefficients instead of the LAST position. That is, the CU decoder unit 3022 may encode and decode mts_idx with the following conditions as (1 - 8) of <MTS condition 1> and decode mts_idx. (1 - 8) The number of non - zero coefficients is greater than or equal to a predetermined number (NonZeroCoeffNum >= NonZeroCoeffNumTh) Here, NonZeroCoeffNum is the number of non - zero coefficients included in the TU block, and NonZeroCoeffNumTh is the threshold value of NonZeroCoeffNum. For example, NonZeroCoeffNumTh = 2 may be used. Hereinafter, a configuration for changing the threshold value of the number of the non - zero coefficients according to the block size and the prediction mode will be described.
[0149] (Configuration for changing the threshold value of the number of non - zero coefficients according to the prediction mode) The CU decoder unit 3022 may derive the threshold value of the number of non - zero coefficients according to whether the prediction mode is intra - prediction or inter - prediction.
[0150] For example, when the prediction mode of the target block is intra prediction, the CU decoder 3022 may regard that NonZeroCoeffNum is greater than or equal to IntraNonZeroCoeffNumTh as one of (1-8) of <MTS condition 1>. IntraNonZeroCoeffNumTh may be, for example, 1 or 2.
[0151] On the other hand, when the prediction mode of the target block is inter prediction, similarly, the CU decoder 3022 may regard that NonZeroCoeffNum is greater than or equal to InterNonZeroCoeffNumTh as one of (1-8) of <MTS condition 1>. InterNonZeroCoeffNumTh may be, for example, 3 or 6.
[0152] From these, the CU decoder 3022 may encode and decode mts_idx using the following as (1-8) of <MTS condition 1>. (1-8) The number of non-zero coefficients is greater than or equal to a predetermined number ((CuPredMode[chType][x0][y0]==MODE_INTRA && NonZeroCoeffNum >= IntraNonZeroCoeffNumTh) || (CuPredMode[chType][x0][y0]==MODE_INTER && NonZeroCoeffNum >= InterNonZeroCoeffNumTh)) Note that the values of IntraNonZeroCoeffNumTh and InterNonZeroCoeffNumTh are not limited to the above values.
[0153] As described above, in this embodiment, the moving image decoder determines whether to decode mts_idx using the threshold of the number of non-zero coefficients, and the threshold varies depending on the prediction mode.
[0154] (Configuration for changing the threshold of the number of non-zero coefficients according to the block size) The CU decoder 3022 may derive the threshold of the number of non-zero coefficients according to the block size of the target block.
[0155] For example, when the TU size of the target block is smaller than a predetermined size, the CU decoding unit 3022 may use the condition that the NonZeroCoeffNum is greater than or equal to SNonZeroCoeffNumTh as one of (1-8) of <MTS condition 1>. SNonZeroCoeffNumTh may be, for example, 1 or 2. That the block size is smaller than a predetermined size means that both the width and height of the block size are smaller than the predetermined size (log2TbWidth < BlkSizeW && log2TbHeight < BlkSizeH). Alternatively, it means that either the width or height of the block size is smaller than the predetermined size (log2TbWidth < BlkSizeW || log2TbHeight < BlkSizeH).
[0156] On the other hand, when the block size of the target block is greater than or equal to a predetermined size, similarly, the CU decoding unit 3022 may use the condition that the NonZeroCoeffNum is greater than or equal to LNonZeroCoeffNumTh as one of (1-8) of <MTS condition 1> LNonZeroCoeffNumTh may be, for example, 3 or 6.
[0157] From these, the CU decoding unit 3022 may encode and decode the mts_idx using the following condition as (1-8) of <MTS condition 1> (1-8) The number of non-zero coefficients is greater than or equal to a predetermined number ((log2TbWidth < BlkSizeW && log2TbHeight < BlkSizeH && NonZeroCoeffNum >= SNonZeroCoeffNumTh) || ((log2TbWidth >= BlkSizeW || log2TbHeight >= BlkSizeH) && NonZeroCoeffNum >= LNonZeroCoeffNumTh)) (1-8) The number of non-zero coefficients is greater than or equal to a predetermined number ((log2TbWidth < BlkSizeW && log2TbHeight < BlkSizeH && NonZeroCoeffNum >= SNonZeroCoeffNumTh) || ((log2TbWidth >= BlkSizeW || log2TbHeight >= BlkSizeH) && NonZeroCoeffNum >= LNonZeroCoeffNumTh)) Note that the values of SNonZeroCoeffNumTh and LNonZeroCoeffNumTh are not limited to the above values.
[0158] As described above, in this embodiment, the moving image decoding apparatus determines whether to decode mts_idx using the threshold of the number of non-zero coefficients, and the threshold varies depending on the block size.
[0159] (Another Embodiment 2 of <MTS Condition>) Regarding (1-4) of the above <MTS Condition 1>, for high-resolution moving images, it may be determined whether to decode mts_idx by expanding the CU size limit to the CTU size. That is, the CU decoding unit 3022 may encode and decode mts_idx with the following conditions as (1-4) of <MTS Condition 1>. (1-4) The CU size is less than or equal to the CTU size (Max(cbWidth, cbHeight) <= CTUSize) (CTUSize is, for example, 128, 256), and by deleting the conditions of (1-7) of the above <MTS Condition>, the CU decoding unit 3022 may decode mts_idx when all of the following <MTS Condition 1-2> are satisfied. <MTS Condition 1-2> (1-1) In the dual tree, it is not a chroma tree (treeType != DUAL_TREE_CHROMA) (1-2) Do not use non-separable transform LFNST (lfnst_idx == 0) (1-3) It is not in the transform skip mode (transform_skip_flag[x0][y0][0] == 0) (1-4) The CU size is less than or equal to the CTU size (Max(cbWidth, cbHeight) <= CTUSize) (CTUSize is, for example, 128, 256) (1-5) Do not perform intra sub-block splitting in the intra prediction block (IntraSubPartitionsSplitType == ISP_NO_SPLIT) (1-6) Do not perform sub-block transform in the inter prediction block (cu_sbt_flag == 0) (1-7) The LAST position is not the position of the lowest frequency component (DC component) (MtsDcOnly == 0) This achieves the effect of improving the encoding efficiency.
[0160] On the other hand, there is a problem that the time required for encoder search increases. In cases such as intra prediction where prediction residuals are likely to occur, efficient encoding can be achieved by using various transformations. On the other hand, in cases where prediction residuals are less likely to occur, such as inter prediction, encoding may be sufficiently efficient with only DCT2. In the following embodiments, an embodiment of changing MTS according to the block size and prediction mode will be described.
[0161] (Example where MTS conditions are different for intra prediction and inter prediction) In this embodiment, the condition of whether to use MTS is changed according to the prediction mode. The CU decoder unit 3022 may change the maximum block size when applying MTS according to whether the prediction mode (CuPredMode) of the current block is intra prediction (MODE_INTRA) or inter prediction (MODE_INTER). Specifically, as shown below, in the encoding and decoding of mts_idx, the block size may be MAX_MTS_SIZE_INTRA for intra prediction and MAX_MTS_SIZE_INTER for inter prediction. That is, the CU decoder unit 3022 may encode and decode mts_idx using the following as (1-4) of <MTS condition 1> (Fig. 13(a)). (1-4) The prediction mode is intra prediction and the CU size is less than or equal to MAX_MTS_SIZE_INTRA, or the prediction mode is inter prediction and the CU size is less than or equal to MAX_MTS_SIZE_INTER (CuPredMode[chType][x0][y0]==MODE_INTRA && Max(cbWidth,cbHeight)<=MAX_MTS_SIZE_INTRA) || (CuPredMode[chType][x0][y0]==MODE_INTER && Max(cbWidth,cbHeight)<=MAX_MTS_SIZE_INTER) Alternatively, the CU decoder unit 3022 may delete (1-4) of <MTS condition 1> and instead add the block size to <MTS condition 2> and encode and decode mts_idx (Fig. 13(b)). <MTS condition 2> (2-1) sps_explicit_mts_inter_enabled_flag is 1, and the prediction mode is inter prediction and the CU size is less than or equal to MAX_MTS_SIZE_INTER (2-2) sps_explicit_mts_intra_enabled_flag is 1, and the prediction mode is intra prediction and the CU size is less than or equal to MAX_MTS_SIZE_INTRA Here, let MAX_MTS_SIZE_INTRA > MAX_MTS_SIZE_INTER. For intra prediction, apply MTS to larger blocks, and for inter prediction, apply MTS only to smaller blocks may be sufficient. For example, MAX_MTS_SIZE_INTRA may be 128 and MAX_MTS_SIZE_INTER may be 32
[0162] Furthermore, the zero-out determination may be changed according to the block size to be applied. That is, when performing MTS up to 128 points for intra prediction and up to 32 points for inter prediction the zero-out determination for each 4x4 sub-block unit can be performed as follows if( sb_coded_flag[ xS ][ yS ] && (( xS > 15 || yS > 15 ) && CuPredMode[chType][x0][y0]==MODE_INTRA || ( xS > 3 || yS > 3 ) && CuPredMode[chType][x0][y0]==MODE_INTER) && cIdx == 0 ) MtsZeroOutSigCoeffFlag = 0 xS is the x-position of the sub-block, yS is the y-position of the sub-block, and sb_coded_flag is a flag indicating whether the sub-block has a non-zero transform coefficient. if( sb_coded_flag[ xS ][ yS ] && (( xS > MaxMtsIntraSz || yS > MaxMtsIntraSz ) && CuPredMode[chType][x0][y0]==MODE_INTRA || ( xS > MaxMtsInterSz || yS > MaxMtsInterSz ) && CuPredMode[chType][x0][y0]==MODE_INTER) && cIdx == 0 ) MtsZeroOutSigCoeffFlag = 0 Here, MaxMtsIntraSz=(MAX_MTS_SIZE_INTRA / 2 / 4)-1, MaxMtsInterSz=(MAX_MTS_SIZE_INTER / 2 / 4)-1. To determine zero-out, check that there are no high frequency components greater than or equal to half the transform size on the horizontal and vertical axes. The 1 / 4 after 1 / 2 corresponds to the threshold for the sub-block size (4x4). 1 / 2 / 4 may be replaced with ">>3", or may be a fixed value calculated in advance.
[0163] Furthermore, in intra prediction, non-zero transform is applied to the high frequency component area that is half or more of the transform size. When coefficients are used, the zero-out determination may be omitted. In this case, the zero-out determination (determination of whether or not to set MtsZeroOutSigCoeffFlag=0) is performed in the case of inter prediction, and in other cases (intra prediction), MtsZeroOutSigCoeffFlag=1 is set, and the zero-out determination does not have to be performed. As shown in FIG. 13(c), the RRC unit 30241 determines whether the prediction mode is inter prediction, 2. When there is a non-zero coefficient in the sub-block, and the sub-block position is at a position larger than a predetermined position, and cIdx == 0 (luminance block), set the variable MtsZeroOutSigCoeffFlag to 0.
[0164] That is, when the prediction mode of the target block is intra prediction, the MtsZeroOutSigCoeffFlag indicating whether the TU is zeroed out is always 1. That is, (1-7) of <MTS condition 1> is always true. On the other hand, when the prediction mode of the target block is inter prediction As described above, the RRC unit 30241 derives the value of MtsZeroOutSigCoeffFlag using conditions such as the sub-block position. The CU decoding unit may decode mts_idx using (1-7) of <MTS condition 1> derived as above.
[0165] According to the above configuration, for intra prediction blocks where the effect of the transform matrix selection (MTS) can be expected mts_idx can be decoded for various block sizes, and various separable transforms can be applied. On the other hand, for inter prediction blocks with a large block size where the effect of MTS cannot be expected, mts_idx is not decoded. This has the effect of improving the coding efficiency while suppressing the complexity.
[0166] (Examples where MTS conditions are different in intra prediction + CIIP mode and inter prediction other than CIIP mode ) The IntraInter synthesis unit 30951 generates a predicted image as a weighted sum of an inter predicted image and an intra predicted image in the CIIP mode. In the CIIP mode, similar to intra prediction, prediction residuals are likely to occur, so MTS can be effectively used. The CU decoding unit 3022 may change the maximum block size when applying MTS according to whether the prediction mode of the current block is intra prediction, CIIP mode, or inter prediction other than the CIIP mode. <MTS Condition 2> (2-1) When sps_explicit_mts_inter_enabled_flag is 1 and the prediction mode is other than the CIIP mode and it is an inter prediction, and the CU size is less than or equal to MAX_MTS_SIZE_INTER (2-2) When sps_explicit_mts_intra_enabled_flag is 1 and the prediction mode is intra prediction or the CIIP mode, and the CU size is less than or equal to MAX_MTS_SIZE_INTRA The CU decoder unit 3022 may decode mts_idx using the above conditions (Fig. 14(a)).
[0167] Only in the case of inter prediction other than the CIIP mode, a zero-out determination (determination of whether MtsZeroOutSigCoeffFlag = 0) is performed. In other cases (CIIP mode or intra prediction), MtsZeroOutSigCoeffFlag is set to 1 and the zero-out determination may not be performed. That is, as shown in Fig. 14(b), the RRC unit 30241, when the prediction mode is inter prediction and the prediction mode is not the CIIP mode, and there are non-zero coefficients in the sub-block, and the sub-block position is at a position larger than a predetermined position, and cIdx == 0, changes the variable MtsZeroOutSigCoeffFlag to 0.
[0168] That is, when the prediction mode of the target block is intra prediction or the CIIP mode, MtsZeroOutSigCoeffFlag indicating whether the TU is zeroed out is always 1. That is That is, (1-7) of <MTS condition 1> is always true. On the other hand, when the prediction mode of the target block is an inter prediction other than the CIIP mode, as described above, the RRC unit 30241 derives the value of MtsZeroOutSigCoeffFlag using conditions such as the sub-block position. The CU decoding unit may decode mts_idx using (1-7) of <MTS condition 1> derived as described above.
[0169] (Example of GPM mode using intra prediction) The GPM mode generates a predicted image by weighted sum of a plurality of inter-predicted images. On the other hand , in the GPM mode, a predicted image may be generated by weighted sum of an intra-predicted image and an inter-predicted image. At this time, when ciip_flag[x0][y0] is 0, that is, when the GPM mode is used , the CU decoding unit 3022 may decode merge_gpm_intra_flag0 and merge_gpm_intra_flag1. merge_gpm_intra_flag0 and merge_gpm_intra_flag1 are flags indicating whether each predicted image is derived by intra prediction. Alternatively, a flag merge_gpm_intra_flag indicating whether one of the predicted images is fixed as an inter-predicted image and the other predicted image is derived by intra prediction may be decoded.
[0170] At this time, the CU decoding unit 3022 may change the block size condition regarding the decoding of mts_idx according to whether the encoding method of the current block is intra prediction, CIIP mode, GPM mode using intra prediction, or other inter predictions. At this time, a variable interUseIntra indicating whether the prediction mode is the CIIP mode or the GPM mode using intra prediction may be derived as follows. interUseIntra = ciip_flag[x0][y0] || merge_gpm_intra_flag0 || merge_gpm_intra_flag1 Alternatively, it may be derived as follows. interUseIntra = ciip_flag[x0][y0] || merge_gpm_intra_flag <MTS condition 2> may be as follows. <MTS condition 2> (2-1) sps_explicit_mts_inter_enabled_flag is 1, and the prediction mode is CIIP mode or an inter prediction other than the GPM mode using intra prediction (CuPredMode[chType][x0][y0]==MODE_INTER &&!interUseIntra), and the CU size is less than or equal to MAX_MTS_SIZE_INTER (2-2) sps_explicit_mts_intra_enabled_flag is 1, and the prediction mode is intra prediction or CIIP mode or the GPM mode using intra prediction (CuPredMode[chType][x0][y0]==MODE_INTER || interUseIntra), and the CU size is less than or equal to MAX_MTS_SIZE_INTRA The CU decoder 3022 may decode mts_idx using the above conditions (Fig. 14(c)).
[0171] Only in the case of an inter prediction other than the CIIP mode or the GPM mode using intra prediction, a judgment of zero output (judgment of whether MtsZeroOutSigCoeffFlag = 0) is performed, and in other cases (CIIP mode or the GPM mode using intra prediction or intra prediction), Set MtsZeroOutSigCoeffFlag = 1, and it is not necessary to perform zero-out determination. That is, as shown in FIG. 14(d), when the prediction mode of the RRC unit 30241 is inter prediction, interUseIntra is 0, there are non-zero coefficients in the sub-block, the sub-block position is at a position larger than a predetermined position, and cIdx == 0, set the variable MtsZeroOutSigCoeffFlag to 0.
[0172] That is, when the prediction mode of the target block is intra prediction or CIIP mode or GPM mode using intra prediction, MtsZeroOutSigCoeffFlag indicating whether the TU is zeroed out is always 1, that is, (1-7) of <MTS condition 1> is always true. On the other hand, when the prediction mode of the target block is CIIP mode or an inter prediction other than the GPM mode using intra prediction, as described above, the RRC unit 30241 derives the value of MtsZeroOutSigCoeffFlag using conditions such as the sub-block position. The CU decoding unit may decode mts_idx using (1-7) of <MTS condition 1> derived as described above.
[0173] According to the above configuration, mts_idx is decoded for a block where the effect of the transform matrix selection (MTS) can be expected, and various separation transforms can be applied. On the other hand, mts_idx is not decoded for a block where the effect of MTS cannot be expected. Thereby, the effect of improving the coding efficiency while suppressing the complexity is achieved.
[0174] As described above, in this embodiment, it is characterized in that the block size for determining whether to decode mts_idx differs depending on whether the prediction mode of the target block is intra prediction or inter prediction. Or, it is characterized in that the block size for decoding mts_idx differs between the case where the prediction mode of the target block is intra prediction or CIIP mode and the case of inter prediction other than CIIP mode. size is different.
[0175] (Another Example 3 of <MTS Conditions>) The syntax shown in FIGS. 10 and 11 aims to encode efficiently by considering that if the LAST position is the position of the DC component, it can be efficiently converted by DCT2 and not decoding mts_idx. On the other hand, in the case of a large block size, even if the LAST position is not the position of the DC component, it may be possible to efficiently convert by DCT2.
[0176] As shown in FIG. 15(d), the CU decoder 3022 of this embodiment derives MtsCoeffStat as a variable indicating the state of the non-zero coefficients of the target block. As shown in SYN_CondMts of FIG. 15(d), the CU decoder 3022 decodes mts_idx when the non-zero coefficients do not meet the predetermined conditions (when MtsCoeffStat == 0). Note that the case where the non-zero coefficients do not meet the predetermined conditions may be determined when the LAST position is larger than the predetermined position or when the number of non-zero transform coefficients is larger than the predetermined number. The CU decoder 3022 sets MtsCoeffStat to 0 when the LAST position is at a position larger than the predetermined position, and decodes mts_idx when MtsCoeffStat == 0 is satisfied. That is, in (1-8) of the above <MTS Condition 1>, mts_idx is decoded using the following conditions (1-8). (1-8) The LAST position is at a position larger than the predetermined position (MtsCoeffStat == 0) Hereinafter, the method for deriving MtsCoeffStat will be described.
[0177] The RRC unit 30241 may derive MtsCoeffStat according to the TU size. For example, as shown in SYN_MtsLastPos in FIG. 15(a), if the TU size is less than 16x16 (log2TbWidth<4 && log2TbHeight<4) and the LAST position (lastScanPos) is greater than 0, the RRC unit 30241 sets MtsCoeffStat to 0. lastScanPos>0 indicates that there is a non-zero coefficient other than the DC component. Alternatively, if either the width or height of the TU size is 16 or more (log2TbWidth>=4 || log2TbHeight>=4) and lastScanPos is greater than 2, the RRC unit 30241 sets MtsCoeffStat to 0. lastScanPos>2 indicates that there is a non-zero coefficient other than the high frequency component. Note that log2TbWidth and log2TbHeight are the logarithmic values of the width and height of the TU size, respectively.
[0178] 15(b), the RRC unit 30241 may set a threshold value lastScanPosTh of the last position used to derive MtsCoeffStat according to the TU size, and when lastScanPos is larger than lastScanPosTh, set MtsCoeffStat to 0. Here, the RRC unit 30241 may derive a larger value as lastScanPosTh as the TU size increases. lastScanPosTh = (log2TbWidth < 4 && log2TbHeight < 4) ? 0 : 2 FIG. 15(b) shows the same process as FIG. 15(a).
[0179] Alternatively, as shown in SYN_MtsLastPos in FIG. 15(c), if the TU size is 16x16 or more (log2TbWidth>=4 && log2TbHeight>=4) and lastScanPos is greater than 2, the RRC unit 30241 sets MtsCoeffStat to 0. Also, if either the width or height of the TU size is less than 16 (log2TbWidth<4 || log2TbHeight<4) and lastScanPos is greater than 0, the RRC unit 30241 sets MtsCoeffStat to 0. The RRC unit 30241 may change the method of deriving MtsCoeffStat using the above configuration. Note that the TU size that is the basis for changing the threshold value of the LAST position is not limited to 16x16. Also, the value of lastScanPosTh is not limited to 0 or 2. In general, it is derived as follows. lastScanPosTh = (log2TbWidth >= BlkSizeW && log2TbHeight >= BlkSizeH) ? PosTh1 : PosTh2 For example, in the example of FIG. 15(c), BlkSizeW=4, BlkSizeH=4, PosTh1=2, and PosTh2=0.
[0180] As described above, in this embodiment, the video decoder decodes mts_idx using the threshold value of the LAST position. The method is characterized in that it determines whether or not to encode the block, and the threshold value differs depending on the block size. In particular, the threshold value is larger when the block size is equal to or larger than a predetermined size than when the block size is smaller than the predetermined size.
[0181] According to the above configuration, mts_idx is decoded at the LAST position where the effect of transformation matrix selection (MTS) can be expected, and various separation transformations can be applied. On the other hand, mts_idx is not decoded at the LAST position where the effect of MTS cannot be expected. This has the effect of improving coding efficiency.
[0182] (Another embodiment of mts_idx decoding) A configuration for changing the value range of mts_idx depending on the block size and prediction mode will be described below.
[0183] (Configuration that changes the value range of mts_idx depending on the prediction mode) In addition to the LAST position, the CU decoding unit 3022 may change the maximum value cMax of mts_idx depending on whether the prediction mode is intra prediction or inter prediction, and decode mts_idx.
[0184] For example, when the prediction mode of the current block is intra prediction, when lastScanPos is greater than or equal to IntraTH1 and less than or equal to IntraTH2, the mts_idx value range may be set to 0 to 1 and decoded with cMax=1. For example, IntraTH1 may be 1 and IntraTH2 may be 6. Also, when lastScanPos is greater than IntraTH2 and less than or equal to IntraTH3, mts_idx may be decoded using cMax=4 indicating 0 to 4. For example, IntraTH3 may be 32. Finally, when lastScanPos is greater than IntraTH3, mts_idx may be decoded using cMax=6 indicating 0 to 6.
[0185] On the other hand, when the prediction mode of the current block is inter prediction, similarly, when lastScanPos is equal to or greater than InterTH1 and equal to or less than InterTH2, the value range of mts_idx may be set to 0 to 1, and decoding may be performed with cMax=1. For example, InterTH1 may be 3 and InterTH2 may be 10. Also, when lastScanPos is greater than InterTH2 and less than or equal to InterTH3, mts_idx may be decoded using cMax=4, which indicates 0 to 4. rTH3 may be 32. Finally, if lastScanPos is greater than InterTH3, mts_idx may be decoded using cMax=6, which indicates 0 to 6.
[0186] Alternatively, when the prediction mode of the current block is inter prediction, if lastScanPos is greater than or equal to InterTH1 and less than or equal to InterTH2, the range of mts_idx may be set to 0 to 1 and decoding may be performed with cMax=1. For example, InterTH1 may be 3 and InterTH2 may be 10. Then, when lastScanPos is greater than InterTH2, mts_idx may be decoded using cMax=4 indicating 0 to 4. In this way, the number of thresholds for changing the range of mts_idx may be different when the prediction mode of the current block is intra prediction and inter prediction.
[0187] Note that the values of the thresholds IntraTH1, IntraTH2, IntraTH3 and InterTH1, InterTH2, InterTH3 for changing the range of mts_idx are not limited to the above values. Some of the thresholds may be common. Furthermore, the parameter decoding unit 302 (CU decoding unit 3022) may decode the thresholds IntraTH1, IntraTH2, IntraTH3 and InterTH1, InterTH2, InterTH3 for changing the range of mts_idx.
[0188] As described above, in this embodiment, the video decoding device uses a plurality of different thresholds to set the range of mts_idx depending on whether the prediction mode of the current block is intra prediction or inter prediction. Alternatively, the maximum value cMax is changed.
[0189] (The mts_idx range changes depending on the block size) In addition to the LAST position, the CU decoding unit 3022 also The maximum value cMax may be changed to decode mts_idx.
[0190] For example, if the TU size of the target block is smaller than a certain size, lastScanPos is STH1 If STH1 is greater than or equal to STH2, the mts_idx range may be set to 0 to 1 and decoding may be performed with cMax=1. For example, STH1 is 1 STH2 may be 6. Also, when lastScanPos is greater than STH2 and less than or equal to STH3, 0 to 4 are used. mts_idx may be decoded using cMax=4 as shown. For example, STH3 may be 32. If lastScanPos is greater than STH3, mts_idx may be decoded using cMax=6, which indicates 0 to 6. The TU size is smaller than the specified size when the width and height of the TU size are smaller than the specified size (log2TbWidth < BlkSizeW && log2TbHeight < BlkSizeH). This refers to the width or height of the size being smaller than the specified size (log2TbWidth < BlkSizeW || log2TbHeight < BlkSizeH).
[0191] On the other hand, if the TU size of the target block is equal to or larger than a certain size, similarly, lastScanPos When lastScanPos is greater than LTH2 and less than or equal to LTH3, mts_idx may be decoded using cMax=4, which indicates 0 to 4, when it is greater than LTH1 and less than or equal to LTH2, with the range of mts_idx being 0 to 1. For example, LTH1 may be 3 and LTH2 may be 10. Also, when lastScanPos is greater than LTH2 and less than or equal to LTH3, mts_idx may be decoded using cMax=4, which indicates 0 to 4. For example, LTH3 may be 32. Finally, when lastScanPos is greater than LTH3, mts_idx may be decoded using cMax=6, which indicates 0 to 6.
[0192] Alternatively, if the TU size of the target block is equal to or larger than a predetermined size, when lastScanPos is equal to or larger than LTH1 and equal to or smaller than LTH2, the mts_idx value range may be set to 0 to 1 and decoding may be performed with cMax=1. For example, LTH1 may be 3 and LTH2 may be 10. Then, when lastScanPos is larger than LTH2, mts_idx may be decoded using cMax=4 indicating 0 to 4. In this way, the number of thresholds for changing the value range of mts_idx may differ depending on the block size of the target block.
[0193] In addition, the thresholds STH1, STH2, STH3 and LTH1, LTH2, LTH3 for changing the range of mts_idx are The values are not limited to the above values. Some of the thresholds may be common. Furthermore, the parameter decoding unit 302 (CU decoding unit 3022) may decode the thresholds STH1, STH2, STH3 and LTH1, LTH2, LTH3 for changing the range of mts_idx.
[0194] As described above, in this embodiment, the video decoding device is characterized in that it changes the value range or maximum value cMax of mts_idx using multiple different thresholds when the block size of the target block is equal to or larger than a specified size and when it is smaller than the specified size.
[0195] (Another configuration that changes the range of mts_idx depending on the block size) If the TU size of the target block is equal to or larger than a specified size (log2TbWidth >= BlkSizeW1 && log2TbHeight >= BlkSizeH1), and lastScanPos is between LTH1 and LTH2, the value of mts_idx For example, LTH1 may be 3 and LTH2 may be 10. When lastScanPos is greater than LTH2 and less than or equal to LTH3, mts_idx is decoded using cMax=4, which indicates 0 to 4. For example, LTH3 may be 32. Finally, if lastScanPos is greater than LTH3, In this case, mts_idx may be decoded using cMax=6, which indicates 0 to 6. For example, BlkSizeW1=BlkSizeH1=4.
[0196] In cases other than the above, if the TU size of the target block is equal to or larger than a predetermined size (log2TbWidth >= BlkSizeW2 && log2TbHeight >= BlkSizeH2), when lastScanPos is equal to or larger than MTH1 and equal to or smaller than MTH2, the mts_idx value range may be set to 0 to 1, and decoding may be performed with cMax=1. For example, MTH1 may be 1 and MTH2 may be 6. Also, when lastScanPos is greater than MTH2 and equal to or smaller than MTH3, mts_idx may be decoded using cMax=4 indicating 0 to 4. For example, MTH3 may be 32. Finally, when lastScanPos is greater than MTH3, mts_idx may be decoded using cMax=6 indicating 0 to 6. For example, BlkSizeW2 = BlkSizeH2 = 3.
[0197] In addition, in cases other than the above, when lastScanPos is between STH1 and STH2, the range of mts_idx is 0 to 1. and then decode with cMax=1. For example, STH1 may be 1 and LTH2 may be 3. Also, when lastScanPos is greater than STH2 and less than or equal to STH3, mts_idx may be decoded using cMax=4, which indicates 0 to 4. For example, STH3 may be 32. Finally, when lastScanPos is greater than STH3, mts_idx may be decoded using cMax=6, which indicates 0 to 6.
[0198] In addition, the thresholds STH1, STH2, STH3 and MTH1, MTH2, MTH3 and The values of STH1, STH2, STH3, MTH1, MTH2, MTH3, and LTH1, LTH2, LTH3 are not limited to the above values. The thresholds may be partially common. Furthermore, the parameter decoding unit 302 (CU decoding unit 3022) may decode the thresholds STH1, STH2, STH3, MTH1, MTH2, MTH3, and LTH1, LTH2, LTH3 for changing the range of mts_idx.
[0199] As described above, in this embodiment, the moving image decoding apparatus changes the value range of mts_idx or the maximum value cMax using a plurality of different threshold values in the case of the block sizes of a plurality of target blocks. This is the feature.
[0200] (Example of using a configuration that changes the value range of mts_idx only in the case of intra prediction) The CU decoding unit 3022 may use a configuration that changes the value range of mts_idx of the target block only when the prediction mode of the target block is intra prediction. That is, the CU decoding unit 3022, when the prediction mode of the target block is intra prediction, changes the value range of mts_idx or the maximum value cMax using a plurality of different threshold values in the above method and decodes mts_idx. On the other hand, when the prediction mode of the target block is inter prediction, the value range of mts_idx is fixed, and mts_idx is decoded using, for example, cMax = 4 indicating 0 to 4.
[0201] (Example of mts_idx decoding in another Embodiment 3 of <MTS condition>) Hereinafter, a configuration that changes both the method of deriving MtsCoeffStat based on the LAST position (value of lastScanPos) and the value range of mts_idx will be described.
[0202] The CU decoding unit 3022 decodes mts_idx using MtsCoeffStat derived by the above method. When lastScanPos is greater than or equal to TH1 and less than or equal to TH2, a configuration that uses 0 to 1 (cMax = 1) for decoding mts_idx may be used. For example, TH1 may be lastScanPosTh + 1 and TH2 may be 6. That is, in this embodiment, the threshold values (TH1, TH2, and TH3) that determine the possible values of mts_idx may be changed using the threshold variable (lastScanPosTh) of the LAST position that depends on the TU size.
[0203] In this embodiment, when the block size of the target block is equal to or larger than a predetermined size, the LAST position is closer to the high frequency component side than when the block size is smaller than the predetermined size. In other words, the LAST position for increasing the value of cMax differs depending on the block size.
[0204] (Separation conversion processing) The inverse separation transform unit 31123 applies an inverse separation transform to the coefficients (transformation coefficients) after transformation by the inverse non-separable transform unit 31121. The inverse separation transform unit 31123 applies an inverse separation transform to the coefficients (transformation coefficients) after scaling by the scaling unit 31111, not to the transformation coefficients output from the inverse non-separable transform unit 31121. In addition, the inverse separation transform unit 31123 may apply an inverse separation transform to the vertical and horizontal directions. One or both may be skipped and only the magnitude of the transform coefficients may be transformed (scaled).
[0205] The inverse separation transform unit 31123 selects vertical and horizontal transformation matrices from among multiple candidates. When determining the transformation matrix from multiple candidates, there are explicit MTS and implicit MTS. In the case of explicit MTS, mts_idx is decoded from the encoded data and the transformation matrix is switched. In the case of implicit MTS, mts_idx is derived depending on the block size and whether or not intra prediction is used, and the transformation matrix is switched.
[0206] The inverse separation conversion unit 31123 detects that the MTS flag is enabled (sps_mts_enabled_flag==1) and The implicit MTS flag (implicitMtsEnabled) is set to 1 when intra-prediction subblock division is on, or the subblock transform flag is on, or in intra-prediction with explicit MTS off, non-separable transform is off, and MIP prediction is off.
[0207] More specifically, the inverse separation conversion unit 31123 sets implicitMtsEnabled=1 when any of the following conditions is satisfied.
[0208] - Intra sub-block splitting is on (IntraSubPartitionsSplitType != ISP_NO_SPLIT) - If the sub-block transformation flag is on and the TU is less than or equal to a certain size (cu_sbt_flag == 1 and Max(nTbW, nTbH) <= 32) 1) The explicit MTS flag sps_explicit_mts_intra_enabled_flag is 0, and 2) CuPredMode indicates intra prediction, and 3) lfnst_idx is 0, and 4) intra_mip_flag is 0 The inverse separation transform unit 31123 transforms a horizontal transformation matrix tyTypeHor and a vertical transformation matrix tyTypeVer is determined as follows:
[0209] (I) The inverse separation transform unit 31123 sets trTypeHor=trTypeVer=0 (=DCT2) if the block is not luminance (cIdx>0) or if intra sub-block division is off and non-separable transformation is not used in the target block (IntraSubPartitionsSplitType != ISP_NO_SPLIT and LfnstEnabledFlag != 0). In other words, MTS is not used.
[0210] (II) In cases other than those mentioned above, in the case of implicit MTS (implicitMtsEnabled==1), the inverse separation conversion unit 31123 sets tyTypeHor and tyTypeVer as follows.
[0211] (i) When sub-block transformation is used (cu_sbt_flag==1), tyTypeHor and tyTypeVer are set using cu_sbt_horizontal_flag and cu_sbt_pos_flag and the table shown in FIG. 12(b). The numbers 0, 1, and 2 in the table represent DCT2, DST7, and DCT8, respectively.
[0212] (ii) Otherwise (cu_sbt_flag == 0), set tyTypeHor and tyTypeVer to either 0 (DCT2) or 1 (DST7) according to the TU size (width nTbW, height nTbH).
[0213] trTypeHor = ( nTbW >= 4 && nTbW <= 16 ) ? 1 : 0 trTypeVer = ( nTbH >= 4 && nTbH <= 16 ) ? 1 : 0 The predetermined range is not limited to the above, and may be, for example, the following:
[0214] trTypeHor = ( nTbW >= 4 && nTbW <= 8 ) ? 1 : 0 trTypeVer = ( nTbH >= 4 && nTbH <= 8 ) ? 1 : 0 (III) In cases other than the above (in the case of explicit MTS), the inverse separation conversion unit 31123 sets tyTypeHor and tyTypeVer using mts_idx and the table shown in FIG. 12(a).
[0215] The inverse separation transform unit 31123 transforms the modified transform coefficients d[ ][ ] (for example, transform coefficients after inverse non-separable transform) into intermediate values e[ ][ ] by vertical one-dimensional transform and clips e[ ][ ]. The inverse separation transform unit 31123 transforms the intermediate values g[ ][ ] into prediction residuals r[ ][ ] by horizontal one-dimensional transform, and r[ ][ ] is sent to the adder 312.
[0216] More specifically, the inverse separation transform unit 31123 derives the first intermediate value e[x][y] by the following formula.
[0217] e[x][y] = Σ(transMatrix[y][j]×d[x][j]) (j = 0..nTbS-1) Here, transMatrix[ ][ ] (=transMatrixV [ ][ ]) is the nTbS × nTbS transformation matrix derived using trTypeVer. nTbS is the height of the TU, nTbH. In the case of a 4x4 transformation (nTbS=4) with trType==0 (DCT2), for example, transMatrix = {{29, 55, 74, 84}{74, 74, 0, -74}{84, -29, -74, 55}{55, -84, 74, -29}} is used. The symbol Σ is expressed as follows, for j = 0..nTbS-1: This means adding the products of the matrix transMatrix[y][j] and the transform coefficients d[x][j]. In other words, e[x][y] is obtained by arranging the columns obtained by multiplying the vector x[j] (j = 0..nTbS-1) consisting of d[x][j] (j = 0..nTbS-1), which is each column of d[x][y], and the matrix elements transMatrix[y][j].
[0218] The inverse separation transform unit 31123 clips the first intermediate value e[x][y] and derives the second intermediate value g[x][y] using the following formula.
[0219] 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 transformation matrix. In the above formula, we assume that the transformation matrix is 7 bits. Also, coeffMin and coeffMax are the minimum and maximum values of clipping.
[0220] The inverse separation transform unit 31123 is a transform matrix transMatrix[][] (=transMatrixH[][]) of nTbS × nTbS derived using trTypeHor, where nTbS is the height nTbH of the TU. The horizontal transform unit 152123 transforms the intermediate value g[x][y] into a prediction residual r[x][y] by one-dimensional transform in the horizontal direction.
[0221] r[x][y] =ΣtransMatrix[x][j]×g[j][y] (j = 0..nTbS-1) The symbol Σ above means the process of adding the products of matrices transMatrix[x][j] and g[j][y] for the subscript j of j = 0..nTbS-1. In other words, r[x][y] is obtained by arranging the rows obtained from the products of g[j][y] (j = 0..nTbS-1), which are the rows of g[x][y], and the matrix transMatrix.
[0222] The adder 312 adds, 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 to generate a decoded image of the block. The adder 312 stores the decoded image of the block in the reference picture memory 306 and also performs loop filtering. The signal is output to the data input unit 305.
[0223] (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, a prediction parameter derivation unit 120, and an entropy encoding unit 104.
[0224] The predicted image generation unit 101 generates a predicted image for each CU. The predicted image generation unit 101 includes the inter predicted image generation unit 309 and the intra predicted image generation unit already described, and therefore a description thereof will be omitted.
[0225] 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.
[0226] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction error input from the subtraction unit 102, and derives quantized transform coefficients by quantizing the prediction error. The quantized transform coefficients are output to the parameter coding unit 111 and the inverse quantization and inverse transform unit 105 .
[0227] The transform / quantization unit 103 includes a separation transform unit (first transform unit) and a non-separation transform unit (second transform unit). and a scaling unit.
[0228] The separate transform unit applies a separate transform to the prediction error. If lfnst_idx is not 0, the non-separable transform unit performs a non-separable transform. The scaling unit scales the transform coefficients with a quantization matrix.
[0229] Specifically, the transformation and quantization unit 103 performs the following processes.
[0230] S1: The separation conversion unit performs separation conversion.
[0231] S2: The non-separable transform unit determines whether the non-separable transform is valid (lfnst_idx!=0).
[0232] S3: If the non-separable transform is valid, the non-separable transform unit performs a non-separable transform (forward non-separable transform).
[0233] S3B: If the non-separable transformation is not valid, the non-separable transformation part performs a non-separable transformation (forward non-separable transformation). Not performed.
[0234] S4: The scaling unit performs scaling on the transform coefficients using a quantization matrix.
[0235] The (forward) non-separable transform performs approximately the same processing as the inverse non-separable transform.
[0236] The inverse quantization and inverse transform unit 105 is the same as the inverse quantization and inverse transform unit 311 in the video decoding device 31, and a description thereof will be omitted.
[0237] The parameter encoding unit 111 includes a header encoding unit 1110, a CT information encoding unit 1111, and a CU encoding unit 111 The CU encoding unit 1112 further includes a TU encoding unit 1114. The outline of the operation of each module is explained below.
[0238] The header encoding unit 1110 performs encoding processing of parameters such as header information, division information, prediction information, and quantized transform coefficients.
[0239] The CT information encoding unit 1111 encodes the QT, MT (BT, TT) division information and the like.
[0240] The CU encoding unit 1112 encodes the CU information, prediction information, division information, and so on.
[0241] When a prediction error is included in a TU, the TU encoding unit 1114 encodes the QP update information and the quantized prediction error.
[0242] The CT information encoding unit 1111 and the CU encoding unit 1112 supply syntax elements such as inter prediction parameters (predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX), intra prediction parameters, and quantized transform coefficients to the parameter encoding unit 111.
[0243] The entropy coding unit 104 receives the quantized transform coefficients and coding parameters (division information, prediction parameters) from the parameter coding unit 111. These are then entropy coded to generate the coded stream Te, which is then output.
[0244] The prediction parameter derivation unit 120 is a means including the inter-prediction parameter coding unit 112 and the intra-prediction parameter coding unit, and uses the parameters input from the coding parameter determination unit 110. The intra prediction parameter and the intra prediction parameter are output to the parameter coding unit 111. do.
[0245] (Configuration of the inter-prediction parameter encoding unit) 17, the inter prediction parameter encoding unit 112 includes a parameter encoding control unit 1121 and an inter prediction parameter derivation unit 303. The inter prediction parameter derivation unit 303 has the same configuration as the video decoding device. The parameter encoding control unit 1121 includes a merge index derivation unit 11211 and a vector candidate index derivation unit 11212.
[0246] The merge index derivation unit 11211 derives merge candidates and the like, and calculates inter prediction parameters The vector candidate index derivation unit 11212 derives predicted vector candidates and the like, and outputs them to the inter prediction parameter derivation unit 303 and the parameter coding unit 111.
[0247] (Configuration of intra-prediction parameter encoding unit) The intra-prediction parameter coding unit includes a parameter coding control unit and an intra-prediction parameter derivation unit. The intra-prediction parameter derivation unit has a common configuration with the video decoding device.
[0248] However, unlike the video decoding device, the inter prediction parameter derivation unit 303 and the intra prediction The inputs to the parameter derivation unit are the encoding parameter determination unit 110 and the prediction parameter memory 108 , and the parameter derivation unit outputs to a parameter encoding unit 111 .
[0249] The adder 106 generates a decoded image by adding, for each pixel, the pixel value of the predicted 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 a reference picture memory 109.
[0250] 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 include the above three types of filters. For example, the filter may be configured with only a deblocking filter.
[0251] 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.
[0252] 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.
[0253] The encoding parameter determination unit 110 determines one of the multiple sets of encoding 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 generating unit 101 generates a predicted image using these coding parameters.
[0254] The coding parameter determination unit 110 determines the size of the amount of information and the coding parameter for each of the plurality of sets. The RD cost value indicating the error is calculated. The RD cost value is, for example, the sum of the code amount and the value obtained by multiplying the squared error by a coefficient λ. The code amount is the information amount of the coded stream Te obtained by entropy coding the quantization error and the coding parameters. The squared error is calculated in the subtraction unit 102. The cost value is the sum of squares of the prediction errors calculated by the coding parameter determination unit 110. The coefficient λ is a preset real number greater than zero. The coding parameter determination unit 110 selects a set of coding parameters that minimizes the calculated cost value. The coding parameter determination unit 110 outputs the determined coding parameters to the parameter coding unit 111 and the prediction parameter derivation unit 120.
[0255] In addition, in the above-described embodiment, a part of the video encoding device 11 and the video decoding device 31, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generating unit 306, The control unit 308, the inverse quantization and inverse transform unit 311, the addition unit 312, the prediction parameter derivation unit 320, the prediction image generation unit 101, the subtraction unit 102, the transformation and quantization unit 103, the entropy coding unit 104, the inverse quantization and inverse transform unit 105, the loop filter 107, the coding parameter determination unit 110, the parameter coding unit 111, and the prediction parameter derivation unit 120 may be realized by a computer. In this case, the control functions may be realized by recording a program for realizing the control functions in a computer-readable recording medium, reading the program recorded in the recording medium into a computer system, and executing the program. Note that the "computer system" here refers to a computer system built into either the video coding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. Also, the "computer-readable recording medium" refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, a CD-ROM, and a storage device such as a hard disk built into a computer system. Furthermore, the term "computer-readable recording medium" may include a medium that dynamically stores 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 a medium that stores a program for a certain period of time, such as a volatile memory inside a computer system that serves as a server or client in such a case. The above 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.
[0256] Furthermore, part or all of the video encoding device 11 and video decoding device 31 in the above-described 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 video decoding device 31 may be individually implemented as a processor, or part or all of them may be integrated into a processor. The integrated circuit implementation is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. Furthermore, with the progress of semiconductor technology, If a new integrated circuit technology emerges that can replace LSI, integrated circuits using that technology may be used.
[0257] 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.
[0258] 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. [Industrial Applicability]
[0259] 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. [Explanation of symbols]
[0260] 31 Video Decoding Device 301 Entropy Decoding Unit 302 Parameter Decoding Unit 3022 CU Decoding Unit 3024 TU Decoding Unit 30241 RRC Department 303 Inter-prediction parameter derivation unit 305, 107 Loop Filter 306, 109 Reference Picture Memory 307, 108 Prediction parameter memory 308, 101 Prediction image generation unit 309 Inter-prediction image generation unit 311, 105 Inverse quantization and inverse transformation unit 312, 106 Addition section 320 Prediction Parameter Derivation Unit 11 Video Encoding Device 102 Subtraction section 103 Transformation and Quantization Section 104 Entropy coding unit 110 Encoding parameter determination unit 111 Parameter Encoding Unit 112 Inter-prediction parameter coding unit 120 Prediction parameter derivation part
Claims
1. A video comprising a parameter decoding unit for decoding mts_idx of a target block from encoded data A decoding device, comprising: The video decoding device, wherein the parameter decoding unit decodes mts_idx according to the block size, LAST position, and non-zero coefficient position of the current block.
2. The parameter decoding unit determines whether to decode mts_idx using a threshold value for the LAST position.
2. The video decoding device according to claim 1, wherein the threshold value varies depending on a block size.
3. 3. The video decoding device according to claim 2, wherein the threshold is larger when the block size is equal to or larger than a predetermined size than when the block size is smaller than the predetermined size.
4. 2. The video according to claim 1, wherein a block size for decoding mts_idx differs depending on whether a prediction mode of the current block is intra prediction or inter prediction. Image decoding device.
5. The block size for decoding mts_idx differs depending on whether the prediction mode of the target block is intra prediction or CIIP mode or inter prediction other than CIIP mode.
2. The video decoding device according to claim 1,
6. The maximum value cMax of mts_idx is changed according to the last position of the target block and multiple thresholds.
2. The video decoding method according to claim 1, wherein mts_idx is decoded using cMax. No. device.
7. 7. The method according to claim 6, wherein the maximum value cMax of mts_idx is changed using a plurality of different thresholds depending on whether the prediction mode of the current block is intra prediction or inter prediction. The above-mentioned video decoding device.
8. The maximum value cMax of mts_idx is changed using a plurality of different thresholds depending on whether the block size of the target block is equal to or larger than a predetermined size or smaller than the predetermined size. The video decoding device according to claim 6 .
9. A motion image encoding unit that encodes the mts_idx of a target block from encoded data. An image encoding device, comprising: The video encoding device, wherein the parameter encoding unit encodes mts_idx according to the block size, LAST position, and non-zero coefficient position of the current block.
10. The parameter encoding unit determines whether to encode mts_idx using a threshold value for the LAST position.
10. The video encoding device according to claim 9, wherein the threshold is set differently depending on the block size.
11. 11. The video encoding device according to claim 10, wherein the threshold is larger when the block size is equal to or larger than a predetermined size than when the block size is smaller than the predetermined size.
12. 10. The video encoding device according to claim 9, wherein a block size for encoding mts_idx differs depending on whether the prediction mode of the current block is intra prediction or inter prediction.
13. The block size for encoding mts_idx differs depending on whether the prediction mode of the target block is intra prediction or CIIP mode or inter prediction other than CIIP mode.
10. The video encoding device according to claim 9.
14. The maximum value cMax of mts_idx is changed according to the last position of the target block and multiple thresholds.
10. The video image according to claim 9, wherein mts_idx is encoded using cMax. Encoding device.
15. The method according to claim 14, characterized in that the maximum value cMax of mts_idx is changed using a plurality of different thresholds depending on whether the prediction mode of the current block is intra prediction or inter prediction. The video encoding device described above.
16. The maximum value cMax of mts_idx is changed using a plurality of different thresholds depending on whether the block size of the target block is equal to or larger than a predetermined size or smaller than the predetermined size.
15. The video encoding device according to claim 14.
Citation Information
Cited By
Decoding method, encoding method, decoder and encoder
JP2025513052A
Decoding method, encoding method, decoder, and encoder
JP7883594B2
Decoding method, encoding method, decoder, and encoder
US12684171B2
Decoding method, encoding method, decoder, and encoder
US12695911B2