Encoding device, decoding device, encoding method, decoding method, and non-transitory storage medium

By using the transformation curve composed of multiple line segments in the video encoding technology for LMCS mapping processing, dynamically adjusting the boundary value division, the problem of improving encoding efficiency and picture quality in the prior art is solved, the processing volume and circuit scale are reduced, and the processing speed is improved.

CN119893140APending Publication Date: 2025-04-25PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510194504.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-08-28
Filing Date
2020-08-28
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When existing video encoding technologies process moving images, it is difficult to simultaneously improve encoding efficiency, image quality, processing volume reduction and circuit scale reduction.

Method used

By using multiple line segments that constitute the transformation curve in the encoding device to perform mapping processing of brightness mapping and chromaticity scaling (LMCS), the transformation curve is dynamically determined to optimize the division of boundary values, and the reference width is adjusted according to the bit depth of the image.

Benefits of technology

The coding efficiency improvement, image quality improvement, processing volume and circuit scale reduction have been achieved, processing speed has been improved, and key elements in encoding and decoding have been appropriately selected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893140A_ABST
    Figure CN119893140A_ABST
Patent Text Reader

Abstract

The invention relates to an encoding / decoding apparatus, an encoding / decoding method, and a storage medium. A mapping process of luma mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting a transformation curve, and the mapping process converts a first pixel value space applied to a luma display image signal into a second pixel value space applied to a luma encoding processing signal. A plurality of line segments respectively correspond to one of a plurality of different sections obtained by dividing a first pixel value space and encode an image, and when LMCS is performed, a circuit determines a transformation curve such that a plurality of boundary values in a second pixel value space located at boundaries of the plurality of line segments correspond to one of the plurality of boundary values in the second pixel value space. A first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values by the reference width, the reference width is changed according to the bit depth of the image, and the reference width is obtained by dividing a luminance range represented by the bit depth by a constant value.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a division of an invention patent application with an application date of August 28, 2020, application number 202080053583.8, and invention name “Encoding device, decoding device, encoding method and decoding method”. Technical Field

[0002] The present invention relates to video coding, and in particular to systems, components, methods, etc. in coding and decoding of moving images. Background Art

[0003] Video coding technology has advanced from H.261 and MPEG-1 to H.264 / AVC (Advanced Video Coding), MPEG-LA, H.265 / HEVC (High Efficiency Video Coding), and H.266 / VVC (Versatile Video Codec). With this advancement comes a constant need to provide improvements and optimizations in video coding technology in order to handle the ever-increasing amount of digital video data in a variety of applications. The present invention relates to further advancements, improvements, and optimizations in video coding.

[0004] Furthermore, Non-Patent Document 1 relates to an example of existing standards related to the above-mentioned video encoding technology.

[0005] Prior art literature

[0006] Non-patent literature

[0007] Non-patent document 1: H.265 (ISO / IEC 23008-2 HEVC) / HEVC (High Efficiency Video Coding) Summary of the invention

[0008] Problems to be solved by the invention

[0009] Regarding the encoding method as described above, it is expected to propose a new method to improve the encoding efficiency, improve the image quality, reduce the processing amount, reduce the circuit scale, or appropriately select elements or actions such as filters, blocks, sizes, motion vectors, reference pictures or reference blocks.

[0010] The present invention provides a structure or method that can contribute to one or more of, for example, improvement of coding efficiency, improvement of image quality, reduction of processing volume, reduction of circuit scale, improvement of processing speed, and appropriate selection of elements or actions. In addition, the present invention may include a structure or method that can contribute to benefits other than the above.

[0011] Means for solving problems

[0012] For example, an encoding device according to one aspect of the present invention comprises a circuit and a memory connected to the circuit, wherein the circuit, in operation, performs a mapping process of brightness mapping and chroma scaling (LMCS) using a plurality of line segments constituting a transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, and the image is encoded, and when performing the LMCS, the circuit determines the transformation curve so that, among a plurality of boundary values ​​in the second pixel value space located at the boundary of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, wherein the reference width changes according to the bit depth of the image, wherein the reference width is obtained by dividing a brightness range by a constant value, and the brightness range is represented by the bit depth.

[0013] In video coding technology, it is desired to propose new methods in order to improve coding efficiency, improve image quality, reduce circuit size, and the like.

[0014] The structures or methods of the various embodiments or parts thereof in the present invention can achieve at least one of the following, for example, improvement in coding efficiency, improvement in image quality, reduction in the amount of processing for coding / decoding, reduction in circuit scale, or improvement in the processing speed for coding / decoding. Alternatively, the structures or methods of the various embodiments or parts thereof in the present invention can perform appropriate selection of components / actions such as filters, blocks, sizes, motion vectors, reference pictures, reference blocks, etc. in coding and decoding. In addition, the present invention also includes the disclosure of structures or methods that can provide benefits other than those described above. For example, structures or methods that improve coding efficiency while suppressing an increase in the amount of processing.

[0015] According to the specification and the drawings, further advantages and effects in one form of the present invention are clarified. The advantages and / or effects are obtained respectively by several embodiments and the features described in the specification and the drawings, but in order to obtain one or more advantages and / or effects, it is not necessarily necessary to provide all of them.

[0016] In addition, these general or specific forms may be implemented by a system, an integrated circuit, a computer program, or a computer-readable recording medium such as a CD-ROM, or may be implemented by any combination of a system, a method, an integrated circuit, a computer program, and a recording medium.

[0017] Effects of the Invention

[0018] The structure or method of one aspect of the present invention can contribute to one or more of the following, for example, improvement of coding efficiency, improvement of image quality, reduction of processing load, reduction of circuit scale, improvement of processing speed, and appropriate selection of elements or actions. In addition, the structure or method of one aspect of the present invention can also contribute to benefits other than the above. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a schematic diagram showing an example of the configuration of a transmission system according to an embodiment.

[0020] Figure 2 This is a diagram showing an example of the hierarchical structure of data in a stream.

[0021] Figure 3 This is a diagram showing an example of the structure of a slice.

[0022] Figure 4 This is a diagram showing an example of a tile structure.

[0023] Figure 5 This is a diagram showing an example of a coding structure in the case of scalable coding.

[0024] Figure 6 This is a diagram showing an example of a coding structure in the case of scalable coding.

[0025] Figure 7 This is a block diagram showing an example of the functional structure of the encoding device according to the embodiment.

[0026] Figure 8 This is a block diagram showing an installation example of an encoding device.

[0027] Fig. 9 This is a flowchart showing an example of the overall encoding process performed by the encoding device.

[0028] Fig.10 This is a diagram showing an example of block division.

[0029] Fig.11 This is a diagram showing an example of the functional structure of the dividing unit.

[0030] Fig.12 A diagram showing an example of a segmentation pattern.

[0031] Fig.13A This is a diagram showing an example of a syntax tree of a segmentation pattern.

[0032] Fig. 13B This is a diagram showing another example of a syntax tree of a segmentation pattern.

[0033] Fig.14 This is a table showing the transformation basis functions corresponding to each transformation type.

[0034] Fig.15 This is a diagram showing an example of SVT.

[0035] Fig.16 This is a flowchart showing an example of processing performed by the conversion unit.

[0036] Fig.17 This is a flowchart showing another example of the processing performed by the conversion unit.

[0037] Fig.18 This is a block diagram showing an example of the functional configuration of a quantization unit.

[0038] Fig.19 This is a flowchart showing an example of quantization performed by the quantization unit.

[0039] Fig. 20 This is a block diagram showing an example of the functional structure of the entropy coding unit.

[0040] Fig.21 This is a diagram showing the CABAC process in the entropy coding unit.

[0041] Fig. 22 This is a block diagram showing an example of the functional configuration of a loop filter unit.

[0042] Fig.23A This is a diagram showing an example of the shape of a filter used in an ALF (adaptive loop filter).

[0043] Fig. 23B FIG. 1 is a diagram showing another example of the shape of the filter used in ALF.

[0044] Fig.23C FIG. 1 is a diagram showing another example of the shape of the filter used in ALF.

[0045] Fig.23D This is a diagram showing an example in which the Y sample (first component) is used for the CCALF of Cb and the CCALF of Cr (a plurality of components different from the first component).

[0046] Fig.23E is a diagram showing a diamond-shaped filter.

[0047] Fig.23F It is a diagram showing an example of JC-CCALF.

[0048] Figure 23G This is a diagram showing examples of weight_index candidates of JC-CCALF.

[0049] Fig.24This is a block diagram showing an example of a detailed configuration of a loop filter unit that functions as a DBF.

[0050] Fig.25 A diagram showing an example of a deblocking filter having a filter characteristic that is symmetric with respect to a block boundary.

[0051] Fig.26 This is a diagram for explaining an example of a block boundary on which a deblocking filtering process is performed.

[0052] Fig. 27 This is a diagram showing an example of the Bs value.

[0053] Fig.28 This is a flowchart showing an example of processing performed by the prediction unit of the encoding device.

[0054] Fig.29 This is a flowchart showing another example of the processing performed by the prediction unit of the encoding device.

[0055] Fig.30 This is a flowchart showing another example of the processing performed by the prediction unit of the encoding device.

[0056] Fig.31 This is a diagram showing an example of 67 intra prediction modes in intra prediction.

[0057] Fig.32 This is a flowchart showing an example of processing performed by the intra prediction unit.

[0058] Fig.33 A diagram showing an example of each reference picture.

[0059] Fig.34 This is a conceptual diagram showing an example of a reference picture list.

[0060] Fig.35 This is a flowchart showing the flow of basic processing of inter-frame prediction.

[0061] Fig.36 This is a flowchart showing an example of MV derivation.

[0062] Fig.37 This is a flowchart showing another example of MV derivation.

[0063] Fig.38A This is a diagram showing an example of classification of each mode derived from MV.

[0064] Fig.38B This is a diagram showing an example of classification of each mode derived from MV.

[0065] Fig.39 is a flowchart showing an example of inter-frame prediction based on the normal inter-frame mode.

[0066] Fig.40 is a flowchart showing an example of inter-frame prediction based on normal merge mode.

[0067] Fig.41 This is a diagram for explaining an example of MV derivation processing based on the normal merge mode.

[0068] Fig.42 This is a diagram for explaining an example of MV derivation processing based on the HMVP mode.

[0069] Fig.43 This is a flowchart showing an example of FRUC (frame rate up conversion).

[0070] Fig.44 This is a diagram for explaining an example of pattern matching (bidirectional matching) between two blocks along a motion track.

[0071] Fig.45 This is a diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture.

[0072] Fig.46A This is a diagram for explaining an example of derivation of MV in sub-block units in the affine mode using two control points.

[0073] Fig.46B This is a diagram for explaining an example of derivation of MV in sub-block units in the affine mode using three control points.

[0074] Fig.47A This is a conceptual diagram for explaining an example of MV derivation of control points in the affine mode.

[0075] Fig.47B This is a conceptual diagram for explaining an example of MV derivation of control points in the affine mode.

[0076] Fig.47C This is a conceptual diagram for explaining an example of MV derivation of control points in the affine mode.

[0077] Fig.48A It is a diagram for explaining an affine pattern having two control points.

[0078] Fig.48B It is a diagram for explaining an affine pattern having three control points.

[0079] Fig.49A This is a conceptual diagram for explaining an example of a method for deriving an MV of a control point when the number of control points in an already coded block and a current block is different.

[0080] Fig.49B This is a conceptual diagram for explaining another example of a method for deriving an MV of a control point when the number of control points in an already coded block and a current block is different.

[0081] Fig.50 This is a flowchart showing an example of processing in the affine merge mode.

[0082] Fig.51 This is a flowchart showing an example of processing in the affine inter mode.

[0083] Fig.52A This is a diagram for explaining the generation of predicted images of two triangles.

[0084] Fig.52B This is a conceptual diagram showing an example of the first part of the first partition and the first sample set and the second sample set.

[0085] Fig.52C This is a conceptual diagram showing the first part of the first partition.

[0086] Fig.53 This is a flowchart showing an example of the triangle mode.

[0087] Fig.54 This is a diagram showing an example of the ATMVP mode for deriving MV in sub-block units.

[0088] Fig.55 It is a diagram showing the relationship between merge mode and DMVR (dynamic motion vector refreshing).

[0089] Fig.56 This is a conceptual diagram for explaining an example of DMVR.

[0090] Fig.57 This is a conceptual diagram for explaining another example of DMVR for determining MV.

[0091] Fig.58A This is a diagram showing an example of motion search in DMVR.

[0092] Fig.58B This is a flowchart showing an example of motion search in DMVR.

[0093] Fig.59 This is a flowchart showing an example of generating a predicted image.

[0094] Fig.60 This is a flowchart showing another example of generating a predicted image.

[0095] Fig.61This is a flowchart for explaining an example of predicted image correction processing based on OBMC (overlapped block motion compensation).

[0096] Fig.62 This is a conceptual diagram for explaining an example of predicted image correction processing based on OBMC.

[0097] Fig.63 This is a diagram for explaining a model assuming uniform linear motion.

[0098] Fig.64 This is a flowchart showing an example of inter-frame prediction according to BIO.

[0099] Fig.65 This is a diagram showing an example of the functional structure of an inter-frame prediction unit that performs inter-frame prediction according to BIO.

[0100] Fig.66A This is a diagram for explaining an example of a method for generating a predicted image using a brightness correction process based on LIC (local illumination compensation).

[0101] Fig.66B This is a flowchart showing an example of a method for generating a predicted image using a brightness correction process based on LIC.

[0102] Fig.67 It is a block diagram showing the functional structure of a decoding device according to an embodiment.

[0103] Fig.68 This is a block diagram showing an implementation example of a decoding device.

[0104] Fig.69 This is a flowchart showing an example of the overall decoding process performed by the decoding device.

[0105] Fig.70 This is a diagram showing the relationship between the division determination unit and other components.

[0106] Fig.71 This is a block diagram showing an example of the functional structure of an entropy decoding unit.

[0107] Fig.72 This is a diagram showing the CABAC process in the entropy decoding unit.

[0108] Fig.73 This is a block diagram showing an example of the functional structure of the inverse quantization unit.

[0109] Fig.74 This is a flowchart showing an example of inverse quantization performed by the inverse quantization unit.

[0110] Fig.75 This is a flowchart showing an example of processing performed by the inverse transformation unit.

[0111] Fig.76 This is a flowchart showing another example of the processing performed by the inverse transformation unit.

[0112] Fig.77 This is a block diagram showing an example of the functional configuration of a loop filter unit.

[0113] Fig.78 This is a flowchart showing an example of processing performed by the prediction unit of the decoding device.

[0114] Fig.79 This is a flowchart showing another example of the processing performed by the prediction unit of the decoding device.

[0115] Fig.80A This is a flowchart showing a part of another example of the processing performed by the prediction unit of the decoding device.

[0116] Fig.80B This is a flowchart showing the remaining part of another example of the processing performed by the prediction unit of the decoding device.

[0117] Fig.81 This is a diagram showing an example of processing performed by the intra prediction unit of the decoding device.

[0118] Fig.82 This is a flowchart showing an example of MV derivation in the decoding device.

[0119] Fig.83 This is a flowchart showing another example of MV derivation in the decoding device.

[0120] Fig.84 This is a flowchart showing an example of inter-frame prediction based on the normal inter-frame mode in a decoding device.

[0121] Fig.85 This is a flowchart showing an example of inter-frame prediction based on the normal merge mode in a decoding device.

[0122] Fig.86 This is a flowchart showing an example of inter-frame prediction based on the FRUC mode in the decoding device.

[0123] Fig.87 This is a flowchart showing an example of inter-frame prediction based on the affine merge mode in a decoding device.

[0124] Fig.88 This is a flowchart showing an example of inter prediction based on the affine inter mode in a decoding device.

[0125] Fig.89 This is a flowchart showing an example of inter-frame prediction based on the triangular mode in a decoding device.

[0126] Fig.90 This is a flowchart showing an example of a DMVR-based motion search in a decoding device.

[0127] Fig.91 This is a flowchart showing a detailed example of a DMVR-based motion search in a decoding device.

[0128] Fig.92 This is a flowchart showing an example of generation of a predicted image in a decoding device.

[0129] Fig.93 This is a flowchart showing another example of generation of a predicted image in a decoding device.

[0130] Fig.94 This is a flowchart showing an example of correction of a predicted image based on OBMC in a decoding device.

[0131] Fig.95 This is a flowchart showing an example of correction of a predicted image based on BIO in a decoding device.

[0132] Fig.96 This is a flowchart showing an example of correction of a predicted image based on LIC in a decoding device.

[0133] Fig.97 This is a diagram showing the processing of LMCS (Luma Mapping with Chroma Scaling).

[0134] Fig.98 It is a flowchart of LMCS processing.

[0135] Fig.99 It is a diagram showing the conversion curve in the LMCS process.

[0136] Fig.100 This is a table showing the correspondence between the reference area index and the boundary value index in the LMCS process.

[0137] Fig.101 It is a flowchart showing the processing performed by the encoding device of the present invention to define a transformation curve for mapping LMCS.

[0138] Fig.102 This is another diagram showing the conversion curve in the LMCS process.

[0139] Fig.103 This is a flowchart showing an example of the operation of the encoding device according to the embodiment.

[0140] Fig.104 This is a flowchart showing an example of the operation of the decoding device according to the embodiment.

[0141] Fig.105 This is a diagram showing the overall structure of a content supply system that implements content distribution services.

[0142] Fig.106 This is a diagram showing an example of a display screen of a web page.

[0143] Fig.107 This is a diagram showing an example of a display screen of a web page.

[0144] Fig.108 The diagram shows an example of a smart phone.

[0145] Fig.109 This is a block diagram showing a structural example of a smart phone. DETAILED DESCRIPTION

[0146] [Introduction]

[0147] LMCS is a process performed before the loop filter, and consists of two processes: one is a process of loop mapping of luminance based on the segment line system curve, and the other is a process of residual scaling of chrominance depending on luminance.

[0148] Therefore, for example, an encoding device of one form of the present invention includes a circuit and a memory connected to the circuit, wherein the circuit, when in operation, performs LMCS mapping processing by using multiple line segments constituting a transformation curve, wherein the multiple line segments respectively correspond to multiple intervals obtained by dividing a first pixel value space, and the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coding processing signal applied to brightness, thereby encoding an image. When performing the LMCS, the circuit determines the transformation curve in the following manner, that is, for multiple boundary values ​​in the second pixel value space located at the boundaries of the multiple line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0149] Thus, when performing cyclic mapping of luma, the encoding device can always divide the luma value into segments of a number corresponding to the bit depth. Thus, the encoding device can suppress the amount of processing in LMCS.

[0150] Furthermore, for example, in an encoding device according to one aspect of the present invention, the reference width is obtained by dividing a luminance range expressed by the bit depth by a certain number.

[0151] Thus, when performing cyclic mapping of the luminance, the encoding device can divide the luminance value into the same number of segments. Thus, the encoding device can suppress the amount of processing in LMCS.

[0152] In addition, for example, in an encoding device according to one aspect of the present invention, the certain number is 32.

[0153] Thus, when performing cyclic mapping of the luminance, the encoding device can always divide the luminance value into 32 segments. Thus, the encoding device can suppress the amount of processing in LMCS.

[0154] In addition, for example, a decoding device of one form of the present invention includes a circuit and a memory connected to the circuit, wherein the circuit, when in operation, performs LMCS mapping processing by using multiple line segments constituting a transformation curve, wherein the multiple line segments respectively correspond to multiple intervals obtained by dividing a first pixel value space, and the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coded processing signal applied to brightness, and decodes the image. When performing the LMCS, the circuit determines the transformation curve in the following manner, that is, for multiple boundary values ​​in the second pixel value space located at the boundaries of the multiple line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0155] Thus, when performing cyclic mapping of luma, the decoding device can always divide the luma value into segments of a number corresponding to the bit depth. Thus, the decoding device can suppress the amount of processing in LMCS.

[0156] Furthermore, for example, in a decoding device according to an aspect of the present invention, the reference width is obtained by dividing a luminance range expressed by the bit depth by a certain number.

[0157] Therefore, when performing cyclic mapping of luma, the decoding device can divide the luma value into the same number of segments. Thus, the decoding device can reduce the amount of processing in LMCS.

[0158] Furthermore, for example, in a decoding device according to one aspect of the present invention, the certain number is 32.

[0159] Therefore, when performing cyclic mapping of luma, the decoding device can always divide the luma value into 32 segments. Thus, the decoding device can suppress the amount of processing in LMCS.

[0160] In addition, for example, a coding method of one form of the present invention performs LMCS mapping processing by using multiple line segments constituting a transformation curve, wherein the multiple line segments respectively correspond to multiple intervals obtained by dividing the first pixel value space, and the LMCS mapping processing transforms the first pixel value space of the display image signal applied to the brightness into a second pixel value space of the coding processing signal applied to the brightness, and encodes the image. When performing the LMCS, the transformation curve is determined in the following manner, that is, for multiple boundary values ​​in the second pixel value space located at the boundaries of the multiple line segments, the first value obtained by dividing the boundary value by a reference width is not equal to the second value obtained by dividing the other boundary values ​​by the reference width, and the reference width is determined according to the bit depth of the image.

[0161] Therefore, the encoding method can achieve the same effect as the above-mentioned encoding device.

[0162] In addition, for example, a decoding method of one form of the present invention performs LMCS mapping processing by forming a plurality of line segments constituting a transformation curve, wherein the plurality of line segments respectively correspond to a plurality of intervals obtained by dividing a first pixel value space, and the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coding processing signal applied to brightness, and decodes the image. When performing the LMCS, the transformation curve is determined in the following manner, that is, for a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0163] Therefore, the decoding method can achieve the same effect as the above-mentioned decoding device.

[0164] Furthermore, for example, an encoding device according to one aspect of the present invention includes a partitioning unit, an intra-frame prediction unit, an inter-frame prediction unit, a loop filter unit, a transform unit, a quantization unit, and an entropy encoding unit.

[0165] The segmentation unit may segment a picture into a plurality of blocks. The intra prediction unit may perform intra prediction on a block included in the plurality of blocks. The inter prediction unit may perform inter prediction on the block. The transformation unit may transform a prediction error between a predicted image obtained by the intra prediction or the inter prediction and an original image to generate a transformation coefficient. The quantization unit may generate a quantization coefficient by quantizing the transformation coefficient. The entropy coding unit may encode the quantization coefficient to generate a coded bit stream. The loop filtering unit may apply a filter to a reconstructed image of the block.

[0166] In addition, for example, the encoding device may be an encoding device that encodes a moving image including a plurality of pictures.

[0167] Furthermore, the entropy coding unit may also be configured to perform LMCS mapping processing by using a plurality of line segments constituting a transformation curve, wherein the plurality of line segments respectively correspond to a plurality of intervals obtained by dividing the first pixel value space, and the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coding processing signal applied to brightness, and encodes the image. When performing the LMCS, the transformation curve is determined in the following manner: for a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0168] Furthermore, for example, a decoding device according to one aspect of the present invention includes an entropy decoding unit, an inverse quantization unit, an inverse transformation unit, an intra prediction unit, an inter prediction unit, and a loop filter unit.

[0169] The entropy decoding unit may decode quantization coefficients of blocks in a picture from a coded bit stream. The inverse quantization unit may inversely quantize the quantization coefficients to obtain transform coefficients. The inverse transform unit may inversely transform the transform coefficients to obtain prediction errors. The intra-frame prediction unit may perform intra-frame prediction on the block. The inter-frame prediction unit may perform inter-frame prediction on the block. The filtering unit may apply a filter to a reconstructed image generated using a predicted image obtained by the intra-frame prediction or the inter-frame prediction and the prediction error.

[0170] Furthermore, for example, the decoding device may be a decoding device that decodes a moving image including a plurality of pictures.

[0171] Furthermore, the entropy decoding unit may be configured to perform LMCS mapping processing by using a plurality of line segments constituting a transformation curve, wherein the plurality of line segments respectively correspond to a plurality of intervals obtained by dividing the first pixel value space, and the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coded processing signal applied to brightness, and decodes the image. When performing the LMCS, the circuit determines the transformation curve in the following manner: for a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0172] Moreover, these inclusive or specific forms may also be implemented by systems, devices, methods, integrated circuits, computer programs, or non-temporary recording media such as computer-readable CD-ROMs, or by any combination of systems, devices, methods, integrated circuits, computer programs, and recording media.

[0173] [Definition of terms]

[0174] As an example, each term can be defined as follows.

[0175] (1) Image

[0176] A unit of data consisting of a collection of pixels, consisting of a picture or a block smaller than a picture, and includes both moving images and still images.

[0177] (2) Pictures

[0178] A unit of image processing consisting of a collection of pixels, sometimes called a frame or field.

[0179] (3) Block

[0180] It is a processing unit that includes a set of specific numbers of pixels, such as the following examples, and the name is not limited. In addition, the shape is also not limited, for example, it includes a rectangle composed of M×N pixels, a square composed of M×M pixels, and also includes a triangle, a circle, and other shapes.

[0181] (Block example)

[0182] Slices / Tiles / Bricks

[0183] CTU / super block / basic partition unit

[0184] VPDU / Hardware Processing Division Unit

[0185] CU / Processing block unit / Prediction block unit (PU) / Orthogonal transform block unit (TU) / Unit

[0186] ·Sub-block

[0187] (4) Pixels / sample

[0188] It is a point that is the smallest unit constituting an image, and includes not only pixels at integer positions but also pixels at decimal positions generated based on pixels at integer positions.

[0189] (5) Pixel value / sample value

[0190] It is the inherent value of a pixel, including brightness value, color difference value, RGB grayscale, depth value, or binary value of 0 or 1.

[0191] (6) Logo

[0192] In addition to 1 bit, multiple bits are also included, for example, a parameter or index of 2 bits or more may be used. In addition, not only binary values ​​using binary numbers but also multiple values ​​using numbers in other bases may be used.

[0193] (7) Signal

[0194] Symbolization and encoding are performed to transmit information, and include not only discrete digital signals but also analog signals that take continuous values.

[0195] (8) Stream / Bitstream

[0196] Refers to a data string of digital data or a stream of digital data. A stream / bit stream may be composed of multiple streams divided into multiple layers, in addition to a single stream. In addition, in addition to transmission on a single transmission path through serial communication, it also includes transmission through multiple transmission paths through packet communication.

[0197] (9) Difference / Differential

[0198] In the case of scalars, in addition to simple difference (xy), any difference operation can be used, including the absolute value of the difference (|xy|), square difference (x^2-y^2), square root of the difference (√(xy)), weighted difference (ax-by: a and b are constants), and offset difference (x-y+a: a is the offset).

[0199] (10) and

[0200] In the case of scalars, in addition to the simple sum (x+y), any operation involving the sum will suffice, including the absolute value of the sum (|x+y|), the sum of squares (x^2+y^2), the square root of the sum (√(x+y)), the weighted sum (ax+by: a and b are constants), and the offset sum (x+y+a: a is the offset).

[0201] (11) based on

[0202] It also includes the case where elements other than the object to be based are added. In addition, in addition to the case where a direct result is obtained, it also includes the case where a result is obtained via an intermediate result.

[0203] (12) Use (used, using)

[0204] It also includes the case where elements other than the elements to be used are added. In addition, in addition to the case where a direct result is obtained, it also includes the case where a result is obtained via an intermediate result.

[0205] (13) prohibit (prohibit, forbid)

[0206] It can also be called non-permission. In addition, non-prohibition or permission does not necessarily mean an obligation.

[0207] (14) Restriction (limit, restriction / restrict / restricted)

[0208] It can also be called "not allowed". In addition, not prohibiting or allowing does not necessarily mean an obligation. In addition, as long as part of the quantity or quality is prohibited, it also includes the case of a complete prohibition.

[0209] (15) Chromatic aberration (chroma)

[0210] It is an adjective that specifies that a sample array or a single sample represents one of two color difference signals associated with a primary color, and is represented by the symbols Cb and Cr. In addition, the term chrominance may be used instead of the term chroma.

[0211] (16) Brightness (luma)

[0212] An adjective that specifies that an array of samples or a single sample represents a monochrome signal associated with a primary color, represented by the symbol or subscript Y or L. The term luminance may also be used instead of luma.

[0213] [Explanation related to the record]

[0214] In the drawings, the same reference numerals represent the same or similar components. In addition, the sizes and relative positions of the components in the drawings are not necessarily drawn to scale.

[0215] The following embodiments are described in detail with reference to the accompanying drawings. In addition, the embodiments described below all represent inclusive or specific examples. The numerical values, shapes, materials, components, configuration positions and connection forms of components, steps, relationships and sequences of steps, etc. shown in the following embodiments are examples and are not intended to limit the claims.

[0216] The following describes implementations of a coding device and a decoding device. The implementations are examples of coding devices and decoding devices to which the processing and / or structures described in each form of the present invention can be applied. The processing and / or structures can also be implemented in coding devices and decoding devices different from the implementations. For example, with respect to the processing and / or structures applied to the implementations, for example, one of the following can also be performed.

[0217] (1) Any of the multiple components of the encoding device or decoding device of the embodiment described in each aspect of the present invention may be replaced by another component described in any of the aspects of the present invention, or these components may be combined;

[0218] (2) In the coding device or decoding device of the embodiment, any changes such as addition, replacement, deletion, etc. of functions or processes performed by some of the multiple components of the coding device or decoding device may be made. For example, any function or process may be replaced by another function or process described in any of the embodiments of the present invention, or they may be combined;

[0219] (3) In the method implemented by the encoding device or decoding device of the embodiment, any changes such as addition, replacement, deletion, etc. may be made to a part of the multiple processes included in the method. For example, any process in the method may be replaced by another process described in any of the various aspects of the present invention, or they may be combined;

[0220] (4) Some of the multiple components constituting the encoding device or decoding device of the embodiment may be combined with a component described in any of the aspects of the present invention, may be combined with a component having a part of the function described in any of the aspects of the present invention, or may be combined with a component that implements a part of the processing implemented by the component described in any of the aspects of the present invention.

[0221] (5) A component having a part of the functions of the encoding device or decoding device of the embodiment, or a component implementing a part of the processing of the encoding device or decoding device of the embodiment, is combined with or replaced with a component described in any of the aspects of the present invention, a component having a part of the functions described in any of the aspects of the present invention, or a component implementing a part of the processing described in any of the aspects of the present invention;

[0222] (6) In a method implemented by an encoding device or a decoding device of an embodiment, one of a plurality of processes included in the method is replaced with one of the processes described in each aspect of the present invention or a similar process, or a combination of these processes;

[0223] (7) Some of the multiple processes included in the method implemented by the encoding device or decoding device of the embodiment may be combined with the process described in any of the aspects of the present invention.

[0224] (8) The implementation of the processing and / or structure described in each aspect of the present invention is not limited to the encoding device or decoding device of the embodiment. For example, the processing and / or structure may also be implemented in a device used for a purpose different from the motion picture encoding or motion picture decoding disclosed in the embodiment.

[0225] [System Structure]

[0226] Figure 1 This is a schematic diagram showing an example of the configuration of the transmission system according to the present embodiment.

[0227] The transmission system Trs is a system for transmitting a stream generated by encoding an image and decoding the transmitted stream. Such a transmission system Trs is, for example, Figure 1 As shown, it includes an encoding device 100, a network Nw and a decoding device 200.

[0228] An image is input to the encoding device 100. The encoding device 100 generates a stream by encoding the input image, and outputs the stream to the network Nw. The stream includes, for example, the encoded image and control information for decoding the encoded image. The image is compressed by the encoding.

[0229] In addition, the original image before being encoded that is input to the encoding device 100 is also called the original image, the original signal, or the original sample. In addition, the image can be a moving image or a still image. In addition, the image is a higher-level concept of a sequence, a picture, and a block, and is not limited to spatial and temporal areas unless otherwise specified. In addition, an image is composed of an arrangement of pixels or pixel values, and the signal or pixel value representing the image is also called a sample. In addition, a stream can be called a bit stream, a coded bit stream, a compressed bit stream, or a coded signal. Furthermore, the encoding device can also be called an image encoding device or a moving image encoding device, and the encoding method of the encoding device 100 can also be called an encoding method, an image encoding method, or a moving image encoding method.

[0230] The network Nw transmits the stream generated by the encoding device 100 to the decoding device 200. The network Nw may be the Internet, a wide area network (WAN), a small-scale network (LAN), or a combination thereof. The network Nw 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 or satellite broadcasting. In addition, the network Nw may be replaced by a storage medium that records a stream such as a DVD (Digital Versatile Disc) or a BD (Blu-Ray Disc (registered trademark)).

[0231] The decoding device 200 generates a decoded image, for example, which is an uncompressed image, by decoding the stream transmitted via the network Nw. For example, the decoding device decodes the stream according to a decoding method corresponding to the encoding method of the encoding device 100.

[0232] In addition, the decoding device may also be referred to as an image decoding device or a moving image decoding device, and the decoding method of the decoding device 200 may also be referred to as a decoding method, an image decoding method, or a moving image decoding method.

[0233] [Data structure]

[0234] Figure 2 is a diagram showing an example of a hierarchical structure of data in a stream. The stream includes, for example, a video sequence. The video sequence is, for example, Figure 2 As shown in (a), it includes VPS (Video Parameter Set), SPS (Sequence Parameter Set), PPS (Picture Parameter Set), SEI (SEI: Supplemental Enhancement Information) and multiple pictures.

[0235] The VPS includes coding parameters common to the multiple layers in a moving picture composed of multiple layers and coding parameters associated with the multiple layers included in the moving picture or with each layer.

[0236] The SPS includes parameters used for the sequence, that is, coding parameters that the decoding device 200 refers to in order to decode the sequence. For example, the coding parameters may also represent the width or height of the picture. In addition, there may be multiple SPSs.

[0237] The PPS includes parameters used for the picture, that is, coding parameters that the decoding device 200 refers to in order to decode each picture in the sequence. For example, the coding parameters may also include a reference value of a quantization width used in decoding the picture, and a flag indicating the application of weighted prediction. In addition, there may be multiple PPSs. In addition, SPS and PPS are sometimes referred to as parameter sets.

[0238] like Figure 2 As shown in (b) of FIG. 1 , a picture may include a picture header and one or more slices. The picture header includes coding parameters that the decoding device 200 refers to in order to decode the one or more slices.

[0239] like Figure 2 As shown in (c) of FIG. 1 , a slice includes a slice header and one or more tiles. The slice header includes coding parameters that the decoding device 200 refers to in order to decode the one or more tiles.

[0240] like Figure 2 As shown in (d), a brick includes one or more CTUs (Coding Tree Unit).

[0241] In addition, a picture may not include a slice, but include a tile group instead of the slice. In this case, the tile group includes one or more tiles. In addition, a slice may be included in a tile.

[0242] CTU is also called super block or basic partition unit. Figure 2 As shown in (e) of FIG. 1 , such a CTU includes a CTU header and one or more CUs (Coding Units). The CTU header includes coding parameters that the decoding device 200 refers to in order to decode one or more CUs.

[0243] A CU can also be split into multiple small CUs. Figure 2 As shown in (f), the CU includes a CU header, prediction information, and residual coefficient information. The prediction information is information used to predict the CU, and the residual coefficient information is information representing the prediction residual described later. In addition, the CU is basically the same as the PU (Prediction Unit) and the TU (Transform Unit), but, for example, in the SBT described later, it may also include multiple TUs that are smaller than the CU. In addition, the CU may also process each VPDU (Virtual Pipeline Decoding Unit) that constitutes the CU. The VPDU is a fixed unit that can be processed in one stage when pipeline processing is performed in hardware, for example.

[0244] In addition, the stream may not have Figure 2 The hierarchy of any part of the hierarchies shown. In addition, the order of these hierarchies can be swapped, and any hierarchy can be replaced by other hierarchies. In addition, the picture of the object being processed by the encoding device 100 or the decoding device 200 at the current time point is called the current picture. If the processing is encoding, the current picture is synonymous with the encoding object picture, and if the processing is decoding, the current picture is synonymous with the decoding object picture. In addition, the block of the object such as CU or CU that is processed by the encoding device 100 or the decoding device 200 at the current time point is called the current block. If the processing is encoding, the current block is synonymous with the encoding object block, and if the processing is decoding, the current block is synonymous with the decoding object block.

[0245] [Structural slices / tiles of the image]

[0246] In order to decode pictures in parallel, pictures are sometimes composed of slice units or tile units.

[0247] A slice is a basic coding unit constituting a picture. For example, a picture is composed of one or more slices. In addition, a slice is composed of one or more continuous CTUs.

[0248] Figure 3 This is a diagram showing an example of the structure of a slice. For example, a picture contains 11×8 CTUs and is divided into 4 slices (slices 1-4). Slice 1 is composed of 16 CTUs, slice 2 is composed of 21 CTUs, slice 3 is composed of 29 CTUs, and slice 4 is composed of 22 CTUs. Here, each CTU in the picture belongs to a certain slice. The shape of the slice is a shape that divides the picture in the horizontal direction. The boundary of the slice does not need to be the end of the picture, but can also be somewhere in the boundary of the CTU in the picture. The processing order (encoding order or decoding order) of the CTU in the slice is, for example, a raster scan order. In addition, a slice includes a slice header and encoded data. In the slice header, the characteristics of the slice such as the CTU address at the beginning of the slice and the slice type can also be recorded.

[0249] A tile is a unit of a rectangular area constituting a picture, and a number called TileId may be assigned to each tile in a raster scan order.

[0250] Figure 4 is a diagram showing an example of a tile structure. For example, a picture includes 11×8 CTUs and is divided into four rectangular area tiles (tiles 1-4). When tiles are used, the processing order of CTUs is changed compared to when tiles are not used. When tiles are not used, multiple CTUs in a picture are processed, for example, in raster scan order. When tiles are used, at least one CTU in each of the multiple tiles is processed, for example, in raster scan order. For example, Figure 4 As shown, the processing order of multiple CTUs included in tile 1 is from the left end of the 1st column of tile 1 to the right end of the 1st column of tile 1, and then from the left end of the 2nd column of tile 1 to the right end of the 2nd column of tile 1.

[0251] In addition, one tile may contain more than one slice, and one slice may contain more than one tile.

[0252] In addition, a picture may also be composed of tile set units. A tile set may include one or more tile groups, or may include one or more tiles. A picture may be composed of only one of a tile set, a tile group, and a tile. For example, the order in which a plurality of tiles are scanned in raster order for each tile set is set as the basic encoding order of the tiles. A set of one or more tiles in each tile set whose basic encoding order is continuous is set as a tile group. Such a picture may also be generated by the segmentation unit 102 described later (see Figure 7 )constitute.

[0253] [Scalable Coding]

[0254] Figure 5 and Figure 6 This is a diagram showing an example of the structure of a scalable stream.

[0255] like Figure 5 As shown, the encoding device 100 can generate a temporally / spatially scalable stream by encoding a plurality of pictures by dividing them into a certain layer in a plurality of layers. For example, the encoding device 100 realizes the hierarchical nature of the enhancement layer existing above the base layer by encoding the pictures according to each layer. Such encoding of each picture is called scalable encoding. As a result, the decoding device 200 can switch the image quality of the image displayed by decoding the stream. That is, the decoding device 200 determines which layer to decode to based on internal factors such as its own performance and external factors such as the state of the communication band. As a result, the decoding device 200 can freely switch the same content to low-resolution content and high-resolution content for decoding. For example, the user of the stream uses a smartphone to watch and listen to the moving image of the stream halfway while on the move, and after returning home, uses a device such as an Internet TV to watch and listen to the continuation of the moving image. In addition, the above-mentioned smartphone and device are respectively equipped with decoding devices 200 with the same or different performance. In this case, if the device decodes to the upper layer in the stream, the user can watch and listen to the high-quality moving image after returning home. This eliminates the need for the encoding device 100 to generate a plurality of streams having the same content but different image qualities, thereby reducing the processing load.

[0256] Furthermore, the enhancement layer may also include meta-information such as statistical information based on the image. Alternatively, the decoding device 200 may generate a high-definition moving image by super-resolving the picture of the base layer based on the meta-information. Super-resolution may be either improving the SN ratio or expanding the resolution at the same resolution. The meta-information includes information for determining linear or nonlinear filter coefficients used in super-resolution processing, or information for determining parameter values ​​in filter processing, machine learning, or least squares calculation used in super-resolution processing.

[0257] Alternatively, the picture may be divided into tiles according to the meaning of each object in the picture. In this case, the decoding device 200 can decode only a part of the area in the picture by selecting the tile to be decoded. Furthermore, the attributes of the object (person, car, ball, etc.) and the position in the picture (coordinate position in the same picture, etc.) can be saved as meta information. In this case, the decoding device 200 can determine the position of the desired object based on the meta information and determine the tile containing the object. For example, Figure 6 As shown, the meta information may be stored using a data storage structure different from the pixel data, such as SEI in HEVC. The meta information may indicate, for example, the position, size, or color of the main object.

[0258] Alternatively, the meta information may be stored in units consisting of a plurality of pictures, such as a stream, a sequence, or a random access unit. Thus, the decoding device 200 can obtain the time when a specific person appears in a moving image, and by using the time and information of the picture unit, can identify the picture where the object exists and the position of the object in the picture.

[0259] [Encoding device]

[0260] Next, the encoding device 100 according to the embodiment will be described. Figure 7 1 is a block diagram showing an example of a functional configuration of the encoding device 100 according to the embodiment. The encoding device 100 encodes an image in units of blocks.

[0261] like Figure 7 As shown, the encoding device 100 is a device for encoding an image in units of blocks, and includes a segmentation unit 102, a subtraction unit 104, a transformation unit 106, a quantization unit 108, an entropy coding unit 110, an inverse quantization unit 112, an inverse transformation unit 114, an addition unit 116, a block memory 118, a loop filter unit 120, a frame memory 122, an intra-frame prediction unit 124, an inter-frame prediction unit 126, a prediction control unit 128, and a prediction parameter generation unit 130. In addition, the intra-frame prediction unit 124 and the inter-frame prediction unit 126 are each configured as a part of a prediction processing unit.

[0262] [Encoding device installation example]

[0263] Figure 8 1 is a block diagram showing an implementation example of the coding device 100. The coding device 100 includes a processor a1 and a memory a2. Figure 7 The multiple components of the encoding device 100 shown are Figure 8 The processor a1 and the memory a2 shown are implemented.

[0264] Processor a1 is a circuit that performs information processing and is a circuit that can access memory a2. For example, processor a1 is a dedicated or general-purpose electronic circuit that encodes an image. Processor a1 may also be a processor such as a CPU. In addition, processor a1 may also be a collection of multiple electronic circuits. In addition, for example, processor a1 may also play a role in Figure 7 The functions of the multiple components of the encoding device 100 excluding the components for storing information are shown.

[0265] The memory a2 is a dedicated or general-purpose memory for storing information used by the processor a1 to encode an image. The memory a2 may be an electronic circuit or may be connected to the processor a1. In addition, the memory a2 may be included in the processor a1. In addition, the memory a2 may be a collection of multiple electronic circuits. In addition, the memory a2 may be a magnetic disk or an optical disk, or may be a storage or a recording medium. In addition, the memory a2 may be a non-volatile memory or a volatile memory.

[0266] For example, the memory a2 may store the encoded image or a stream corresponding to the encoded image. In addition, the memory a2 may store a program used by the processor a1 to encode the image.

[0267] In addition, for example, memory a2 can also serve Figure 7 The memory a2 may be used as a component for storing information among the multiple components of the encoding device 100 shown in FIG. Figure 7 The functions of the block memory 118 and the frame memory 122 are shown. More specifically, the memory a2 can store reconstructed images (specifically, reconstructed blocks and reconstructed pictures, etc.).

[0268] In addition, in the encoding device 100, it is not necessary to install Figure 7 All of the plurality of components shown may not perform all of the plurality of processes described above. Figure 7 Some of the multiple components shown may be included in other devices, and some of the above-mentioned multiple processes may be executed by other devices.

[0269] Hereinafter, after explaining the overall processing flow of the encoding device 100 , each component included in the encoding device 100 will be explained.

[0270] [Overall flow of encoding processing]

[0271] Fig. 9 : is a flowchart showing an example of the overall encoding process performed by the encoding device 100.

[0272] First, the segmentation unit 102 of the encoding device 100 segments the picture contained in the original image into a plurality of fixed-size blocks (128×128 pixels) (step Sa_1). Then, the segmentation unit 102 selects a segmentation pattern for the fixed-size block (step Sa_2). That is, the segmentation unit 102 further segments the fixed-size block into a plurality of blocks constituting the selected segmentation pattern. Then, the encoding device 100 performs the processing of steps Sa_3 to Sa_9 for each of the plurality of blocks.

[0273] The prediction processing unit composed of the intra prediction unit 124 and the inter prediction unit 126 and the prediction control unit 128 generates a prediction image of the current block (step Sa_3). In addition, the prediction image is also called a prediction signal, a prediction block or a prediction sample.

[0274] Next, the subtraction unit 104 generates a difference between the current block and the predicted image as a prediction residual (step Sa_4). The prediction residual is also called a prediction error.

[0275] Next, the transform unit 106 and the quantization unit 108 generate a plurality of quantization coefficients by transforming and quantizing the predicted image (step Sa_5).

[0276] Next, the entropy coding unit 110 generates a stream by encoding (specifically, entropy coding) the plurality of quantized coefficients and prediction parameters related to generation of a predicted image (step Sa_6).

[0277] Next, the inverse quantization unit 112 and the inverse transformation unit 114 restore the prediction residual by inverse quantizing and inverse transforming the plurality of quantized coefficients (step Sa_7).

[0278] Next, the adding unit 116 reconstructs the current block by adding the predicted image to the restored prediction residual (step Sa_8). Thus, a reconstructed image is generated. In addition, the reconstructed image is also called a reconstructed block, and in particular, the reconstructed image generated by the encoding device 100 is also called a local decoded block or a local decoded image.

[0279] When the reconstructed image is generated, the loop filter unit 120 filters the reconstructed image as necessary (step Sa_9).

[0280] Then, the encoding device 100 determines whether encoding of the entire picture is completed (step Sa_10 ), and when it is determined that encoding is not completed (No in step Sa_10 ), it repeats the processing from step Sa_2 .

[0281] In addition, in the above example, the encoding device 100 selects one partition pattern for a fixed-size block and encodes each block according to the partition pattern, but each block may be encoded according to each of a plurality of partition patterns. In this case, the encoding device 100 may evaluate the cost for each of the plurality of partition patterns, and may select, for example, a stream obtained by encoding according to the partition pattern with the minimum cost as the final output stream.

[0282] Furthermore, the processing of steps Sa_1 to Sa_10 may be performed sequentially by the encoding device 100, and a part of or a plurality of these processing may be performed in parallel or in a different order.

[0283] The encoding process of the encoding device 100 is a hybrid encoding using predictive encoding and transform encoding. In addition, predictive encoding is performed by a coding loop, which is composed of a subtraction unit 104, a transform unit 106, a quantization unit 108, an inverse quantization unit 112, an inverse transform unit 114, an addition unit 116, a loop filter unit 120, a block memory 118, a frame memory 122, an intra-frame prediction unit 124, an inter-frame prediction unit 126, and a prediction control unit 128. That is, the prediction processing unit composed of the intra-frame prediction unit 124 and the inter-frame prediction unit 126 constitutes a part of the coding loop.

[0284] [Division]

[0285] The segmentation unit 102 divides each picture included in the original image into a plurality of blocks, and outputs each block to the subtraction unit 104. For example, the segmentation unit 102 first divides the picture into blocks of a fixed size (e.g., 128×128 pixels). The fixed-size blocks are sometimes called coding tree units (CTUs). Furthermore, the segmentation unit 102 divides each fixed-size block into blocks of a variable size (e.g., less than 64×64 pixels), for example based on recursive quadtree and / or binary tree block segmentation. That is, the segmentation unit 102 selects a segmentation pattern. The variable-size blocks are sometimes called coding units (CUs), prediction units (PUs), or transform units (TUs). In addition, in various installation examples, it is not necessary to distinguish between CUs, PUs, and TUs, and part or all of the blocks in the picture may be used as processing units of CUs, PUs, or TUs.

[0286] Fig.10 FIG. 1 is a diagram showing an example of block division in an implementation mode. Fig.10 In FIG, the solid line represents the block boundary based on the quadtree block partition, and the dotted line represents the block boundary based on the binary tree block partition.

[0287] Here, the block 10 is a square block of 128×128 pixels. The block 10 is first partitioned into four square blocks of 64×64 pixels (quadtree block partitioning).

[0288] The upper left 64×64 pixel square block is further divided vertically into two rectangular blocks each consisting of 32×64 pixels, and the left 32×64 pixel rectangular block is further divided vertically into two rectangular blocks each consisting of 16×64 pixels (binary tree block division). As a result, the upper left 64×64 pixel square block is divided into two 16×64 pixel rectangular blocks 11 and 12, and a 32×64 pixel rectangular block 13.

[0289] The upper right square block of 64×64 pixels is horizontally divided into two rectangular blocks 14 and 15 each consisting of 64×32 pixels (binary tree block division).

[0290] The square block of 64×64 pixels at the lower left is divided into 4 square blocks of 32×32 pixels each (quadtree block division). The upper left block and the lower right block of the 4 square blocks of 32×32 pixels each are further divided. The square block of 32×32 pixels at the upper left is vertically divided into 2 rectangular blocks of 16×32 pixels each, and the rectangular block of 16×32 pixels on the right is further horizontally divided into 2 square blocks of 16×16 pixels each (binary tree block division). The square block of 32×32 pixels at the lower right is horizontally divided into 2 rectangular blocks of 32×16 pixels each (binary tree block division). As a result, the 64×64 pixel square block in the lower left corner is divided into a rectangular block 16 of 16×32 pixels, two square blocks 17 and 18 of 16×16 pixels each, two square blocks 19 and 20 of 32×32 pixels each, and two rectangular blocks 21 and 22 of 32×16 pixels each.

[0291] The lower right block 23 consisting of 64×64 pixels is not divided.

[0292] As above, in Fig.10 In FIG. 1 , block 10 is divided into 13 blocks 11 to 23 of variable size based on recursive quad-tree and binary tree block division. This kind of division is sometimes called QTBT (quad-tree plus binary tree) division.

[0293] In addition, Fig.10In the example, one block is divided into four or two blocks (quadtree or binary tree block division), but the division is not limited to these. For example, one block can also be divided into three blocks (ternary tree division). The division including such ternary tree division is called MBT (multi type tree) division.

[0294] Fig.11 1 is a diagram showing an example of the functional structure of the segmentation unit 102. Fig.11 As shown in FIG. 1 , the division unit 102 may include a block division determination unit 102a. As an example, the block division determination unit 102a may perform the following processing.

[0295] The block division determination unit 102a collects block information from, for example, the block memory 118 or the frame memory 122 and determines the above-mentioned division pattern based on the block information. The division unit 102 divides the original image according to the division pattern and outputs one or more blocks obtained by the division to the subtraction unit 104.

[0296] In addition, the block division determination unit 102a outputs the parameter indicating the above division pattern to the transform unit 106, the inverse transform unit 114, the intra prediction unit 124, the inter prediction unit 126, and the entropy coding unit 110. The transform unit 106 may transform the prediction residual based on the parameter, and the intra prediction unit 124 and the inter prediction unit 126 may generate a predicted image based on the parameter. In addition, the entropy coding unit 110 may also perform entropy coding on the parameter.

[0297] As an example, parameters related to the segmentation pattern may be written into the stream as follows.

[0298] Fig.12 The figure shows examples of partitioning patterns. The partitioning patterns include: four-partition (QT), which divides the block into two in the horizontal direction and the vertical direction respectively; three-partition (HT or VT), which divides the block in the same direction at a ratio of 1:2:1; two-partition (HB or VB), which divides the block in the same direction at a ratio of 1:1; and no-partition (NS).

[0299] In the case of four-division and no-division, the division pattern does not have the block division direction, and in the case of two-division and three-division, the division pattern has division direction information.

[0300] Fig.13A and Fig. 13B is a diagram showing an example of a syntax tree of a segmentation pattern. Fig.13AIn the example, first, there is information indicating whether to split (S: Split flag), then there is information indicating whether to split into four (QT: QT flag). Next, there is information indicating whether to split into three or two (TT: TT flag or BT: BT flag), and finally there is information indicating the direction of splitting (Ver: Vertical flag or Hor: Horizontal flag). In addition, for each of the one or more blocks obtained by such splitting based on the splitting style, the splitting may be repeatedly applied in the same process. That is, as an example, it is also possible to recursively implement the judgment of whether to split, whether to split into four, whether the splitting method is horizontal or vertical, and whether to split into three or two, and the implemented judgment result is calculated according to the result of the calculation. Fig.13A The encoding order disclosed by the syntax tree shown is encoded into the stream.

[0301] In addition, Fig.13A In the syntax tree shown, this information is arranged in the order of S, QT, TT, Ver, but it can also be arranged in the order of S, QT, Ver, BT. Fig. 13B In the example, first, there is information indicating whether to split (S: Split flag), then there is information indicating whether to split into four (QT: QT flag). Next, there is information indicating the split direction (Ver: Vertical flag or Hor: Horizontal flag), and finally there is information indicating whether to split into two or three (BT: BT flag or TT: TT flag).

[0302] In addition, the division pattern described here is an example, and a division pattern other than the division pattern described may be used, or only a part of the division pattern described may be used.

[0303] [Subtraction Department]

[0304] The subtracting unit 104 subtracts the predicted image (the predicted image input from the prediction control unit 128) from the original image in units of blocks input from the dividing unit 102 and divided by the dividing unit 102. That is, the subtracting unit 104 calculates the prediction residual of the current block. Then, the subtracting unit 104 outputs the calculated prediction residual to the transforming unit 106.

[0305] The original image is an input signal of the encoding device 100, and is, for example, a signal representing an image of each picture constituting a moving image (for example, a luminance (luma) signal and two color difference (chroma) signals).

[0306] [Conversion Department]

[0307] The transform unit 106 transforms the prediction residual in the spatial domain into transform coefficients in the frequency domain, and outputs the transform coefficients to the quantization unit 108. Specifically, the transform unit 106 performs a predetermined discrete cosine transform (DCT) or discrete sine transform (DST) on the prediction residual in the spatial domain, for example.

[0308] In addition, the transform unit 106 may also adaptively select a transform type from a plurality of transform types, and use a transform basis function corresponding to the selected transform type to transform the prediction residual into a transform coefficient. Such a transform is sometimes referred to as an EMT (explicit multiple core transform) or an AMT (adaptive multiple transform). In addition, the transform basis function is sometimes referred to as a basis.

[0309] The plurality of transform types include, for example, DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. In addition, these transform types may be described as DCT2, DCT5, DCT8, DST1, and DST7, respectively. Fig.14 is a table showing the transformation basis functions corresponding to each transformation type. Fig.14 In , N represents the number of input pixels. The selection of a transform type from among these multiple transform types may depend on, for example, the type of prediction (intra-frame prediction, inter-frame prediction, etc.) or the intra-frame prediction mode.

[0310] Information indicating whether such EMT or AMT is applied (e.g., called an EMT flag or an AMT flag) and information indicating the selected transform type are usually signaled at the CU level. In addition, the signaling of such information is not necessarily limited to the CU level, but may also be other levels (e.g., sequence level, picture level, slice level, brick level, or CTU level).

[0311] In addition, the transformation unit 106 may also re-transform the transformation coefficients (i.e., the transformation results). Such re-transformation is sometimes called AST (adaptive secondary transform) or NSST (non-separable secondary transform). For example, the transformation unit 106 re-transforms each sub-block (e.g., a sub-block of 4×4 pixels) contained in the block of transformation coefficients corresponding to the intra-frame prediction residual. Information indicating whether NSST is applied and information related to the transformation matrix used in NSST are usually signaled at the CU level. In addition, the signaling of this information does not need to be limited to the CU level, but can also be other levels (e.g., sequence level, picture level, slice level, brick level, or CTU level).

[0312] Separable transformation and non-separable transformation can also be applied in the transformation unit 106. Separable transformation refers to a method of performing multiple transformations in each direction corresponding to the number of dimensions of the input, and non-separable transformation refers to a method of treating two or more dimensions as one dimension and performing transformations together when the input is multi-dimensional.

[0313] For example, as an example of non-separable transformation, when a block of 4×4 pixels is input, it is regarded as an array of 16 elements, and the array is transformed using a 16×16 transformation matrix.

[0314] In a further example of the Non-Separable transformation, after treating a 4×4 pixel input block as an array of 16 elements, a transformation (Hypercube Givens Transform) may be performed by performing a plurality of Givens rotations on the array.

[0315] In the transformation in the transformation unit 106, the transformation type of the transformation basis function to be transformed into the frequency domain can be switched according to the region in the CU. As an example, there is SVT (Spatially Varying Transform).

[0316] Fig.15 This is a diagram showing an example of SVT.

[0317] In SVT, Fig.15As shown, the CU is divided into two equal parts in the horizontal direction or the vertical direction, and only the area on one of the two sides is transformed into the frequency domain. The transformation type can be set for each area, for example, using DST7 and DCT8. For example, for the area at position 0 of the two areas obtained by dividing the CU into two equal parts in the vertical direction, DST7 and DCT8 can be used. Alternatively, for the area at position 1 of the two areas, DST7 is used. Similarly, for the area at position 0 of the two areas obtained by dividing the CU into two equal parts in the horizontal direction, DST7 and DCT8 are used. Alternatively, for the area at position 1 of the two areas, DST7 is used. In such a Fig.15 In the example shown, only one of the two regions in the CU is transformed, and the other is not transformed, but the two regions can also be transformed separately. In addition, the division method is not only bisection, but also quartering. In addition, it is possible to be more flexible and encode the information indicating the division method, and perform signaling in the same way as CU division. In addition, SVT is sometimes referred to as SBT (Sub-block Transform).

[0318] The aforementioned AMT and EMT may also be referred to as MTS (Multiple Transform Selection). When MTS is applied, a transform type such as DST7 or DCT8 may be selected, and information indicating the selected transform type may be encoded as index information for each CU. On the other hand, as a process for selecting a transform type used in an orthogonal transform based on the shape of the CU without encoding the index information, there is a process called IMTS (Implicit MTS). When IMTS is applied, for example, if the shape of the CU is a rectangle, DST7 is used on the short side of the rectangle and DCT2 is used on the long side, and orthogonal transforms are performed separately. In addition, for example, when the shape of the CU is a square, if MTS is valid within the sequence, DCT2 is used for orthogonal transform, and if MTS is invalid, DST7 is used for orthogonal transform. DCT2 and DST7 are examples, and other transform types may be used, or the combination of transform types used may be set to different combinations. IMTS may be used only in intra-predicted blocks, or it may be used together in intra-predicted blocks and inter-predicted blocks.

[0319] In the above, as the selection process for selectively switching the transform type used in the orthogonal transform, the three processes of MTS, SBT and IMTS are described, but all of the three selection processes may be effective, or only a part of the selection processes may be selectively effective. Whether each selection process is effective can be identified by flag information in the header such as SPS. For example, if all three selection processes are effective, one of the three selection processes is selected for orthogonal transform in units of CUs. In addition, as long as the selection process for selectively switching the transform type can realize at least one of the following four functions [1] to [4], a selection process different from the above three selection processes may be used, or the above three selection processes may be replaced by other processes respectively. Function [1] is a function of performing an orthogonal transform on the entire range within the CU and encoding information indicating the transform type used in the transform. Function [2] is a function of performing an orthogonal transform on the entire range of the CU, not encoding information indicating the transform type, and determining the transform type based on a prescribed rule. Function [3] is a function of performing an orthogonal transform on a part of the CU and encoding information indicating the transform type used in the transform. Function [4] is a function of performing an orthogonal transform on a part of the CU region, and determining the transform type based on a predetermined rule without encoding information indicating the transform type used in the transform.

[0320] In addition, the presence or absence of application of each of MTS, IMTS, and SBT may be determined for each processing unit, for example, the presence or absence of application may be determined for each sequence unit, picture unit, tile unit, slice unit, CTU unit, or CU unit.

[0321] In addition, the tool for selectively switching the transformation type in the present invention can also be renamed as a method for adaptively selecting a basis used in the transformation process, a selection process, or a process of selecting a basis. In addition, the tool for selectively switching the transformation type can also be renamed as a mode for adaptively selecting the transformation type.

[0322] Fig.16 This is a flowchart showing an example of the processing performed by the conversion unit 106.

[0323] For example, the transform unit 106 determines whether to perform an orthogonal transform (step St_1). Here, when it is determined that an orthogonal transform is to be performed (yes in step St_1), the transform unit 106 selects a transform type used for the orthogonal transform from a plurality of transform types (step St_2). Next, the transform unit 106 performs an orthogonal transform by applying the selected transform type to the prediction residual of the current block (step St_3). Then, the transform unit 106 outputs information indicating the selected transform type to the entropy coding unit 110, thereby encoding the information (step St_4). On the other hand, when it is determined that an orthogonal transform is not to be performed (no in step St_1), the transform unit 106 outputs information indicating that an orthogonal transform is not to be performed to the entropy coding unit 110, thereby encoding the information (step St_5). In addition, the determination of whether to perform an orthogonal transform in step St_1 can be determined, for example, based on the size of the transform block, the prediction mode applied to the CU, etc. In addition, the information indicating the transform type used for the orthogonal transform is not encoded, and the orthogonal transform can also be performed using a predetermined transform type.

[0324] Fig.17 : is a flowchart showing another example of the processing performed by the conversion unit 106. Fig.17 The example shown is similar to Fig.16 The example shown is also an example of orthogonal transform in the case of applying a method of selectively switching the transform type used in the orthogonal transform.

[0325] As an example, the first transform type group may include DCT2, DST7, and DCT8. Also, as an example, the second transform type group may include DCT2. In addition, the transform types included in the first transform type group and the second transform type group may overlap in part or may be completely different transform types.

[0326] Specifically, the transform unit 106 determines whether the transform size is less than or equal to a specified value (step Su_1). Here, when it is determined that it is less than or equal to the specified value (yes in step Su_1), the transform unit 106 uses the transform type included in the first transform type group to perform an orthogonal transform on the prediction residual of the current block (step Su_2). Next, the transform unit 106 encodes the information by outputting information indicating which transform type among the one or more transform types included in the first transform type group is used to the entropy coding unit 110 (step Su_3). On the other hand, when it is determined that the transform size is not less than or equal to the specified value (no in step Su_1), the transform unit 106 uses the second transform type group to perform an orthogonal transform on the prediction residual of the current block (step Su_4).

[0327] In step Su_3, the information indicating the transform type used for the orthogonal transform may be information indicating a combination of a transform type applied to the vertical direction of the current block and a transform type applied to the horizontal direction. In addition, the first transform type group may include only one transform type, and the information indicating the transform type used for the orthogonal transform may not be encoded. The second transform type group may include a plurality of transform types, and information indicating a transform type used for the orthogonal transform among one or more transform types included in the second transform type group may be encoded.

[0328] Alternatively, the transform type may be determined based on the transform size alone. Furthermore, if the transform type used for orthogonal transform is determined based on the transform size, the determination is not limited to whether the transform size is equal to or smaller than a predetermined value.

[0329] [Quantitative Department]

[0330] The quantization unit 108 quantizes the transform coefficients output from the transform unit 106. Specifically, the quantization unit 108 scans a plurality of transform coefficients of the current block in a predetermined scanning order, and quantizes the transform coefficients based on a quantization parameter (QP) corresponding to the scanned transform coefficients. The quantization unit 108 outputs the quantized plurality of transform coefficients of the current block (hereinafter referred to as quantized coefficients) to the entropy coding unit 110 and the inverse quantization unit 112.

[0331] The prescribed scanning order is the order for quantization / inverse quantization of transform coefficients. For example, the prescribed scanning order is defined by ascending order (order from low frequency to high frequency) or descending order (order from high frequency to low frequency) of frequency.

[0332] The quantization parameter (QP) refers to a parameter that defines the quantization step size (quantization width). For example, if the value of the quantization parameter increases, the quantization step size also increases. That is, if the value of the quantization parameter increases, the error of the quantization coefficient (quantization error) increases.

[0333] In addition, quantization matrices are sometimes used in quantization. For example, multiple quantization matrices are sometimes used corresponding to frequency transform sizes such as 4×4 and 8×8, prediction modes such as intra-frame prediction and inter-frame prediction, and pixel components such as brightness and color difference. In addition, quantization refers to digitizing values ​​sampled at predetermined intervals in correspondence with predetermined levels. In this technical field, expressions such as rounding, rounding, or scaling are sometimes used.

[0334] As a method of using a quantization matrix, there are a method of using a quantization matrix directly set on the encoding device 100 side and a method of using a default quantization matrix (default matrix). On the encoding device 100 side, by directly setting the quantization matrix, it is possible to set a quantization matrix corresponding to the characteristics of the image. However, in this case, there is a disadvantage that the amount of coding increases due to the encoding of the quantization matrix. In addition, instead of directly using the default quantization matrix or the encoded quantization matrix, a quantization matrix used in the quantization of the current block may be generated based on the default quantization matrix or the encoded quantization matrix.

[0335] On the other hand, there is also a method of performing quantization so that the coefficients of high-frequency components and low-frequency components are the same without using a quantization matrix. This method is equivalent to a method of using a quantization matrix (flat matrix) in which all coefficients have the same value.

[0336] The quantization matrix may be encoded, for example, at a sequence level, a picture level, a slice level, a brick level, or a CTU level.

[0337] When the quantization matrix is ​​used, the quantization unit 108 scales the quantization width obtained based on the quantization parameter, etc., for each transform coefficient using the value of the quantization matrix. The quantization process performed without using the quantization matrix may be a process of quantizing the transform coefficient based on the quantization width obtained based on the quantization parameter, etc. In addition, in the quantization process performed without using the quantization matrix, the quantization width may be multiplied by a predetermined value common to all transform coefficients in the block.

[0338] Fig.18 : is a block diagram showing an example of the functional configuration of the quantization unit 108 .

[0339] The quantization unit 108 includes, for example, a difference quantization parameter generation unit 108 a , a predicted quantization parameter generation unit 108 b , a quantization parameter generation unit 108 c , a quantization parameter storage unit 108 d , and a quantization processing unit 108 e .

[0340] Fig.19 : is a flowchart showing an example of quantization performed by the quantization unit 108 .

[0341] As an example, the quantization unit 108 may be based on Fig.19 The flowchart shown implements quantization for each CU. Specifically, the quantization parameter generation unit 108c determines whether to perform quantization (step Sv_1). Here, when it is determined that quantization is to be performed (yes in step Sv_1), the quantization parameter generation unit 108c generates a quantization parameter for the current block (step Sv_2), and stores the quantization parameter in the quantization parameter storage unit 108d (step Sv_3).

[0342] Next, the quantization processing unit 108e quantizes the transform coefficients of the current block using the quantization parameter generated in step Sv_2 (step Sv_4). Then, the predicted quantization parameter generation unit 108b obtains the quantization parameter of the processing unit different from the current block from the quantization parameter storage unit 108d (step Sv_5). The predicted quantization parameter generation unit 108b generates the predicted quantization parameter of the current block based on the obtained quantization parameter (step Sv_6). The differential quantization parameter generation unit 108a calculates the difference between the quantization parameter of the current block generated by the quantization parameter generation unit 108c and the predicted quantization parameter of the current block generated by the predicted quantization parameter generation unit 108b (step Sv_7). By calculating the difference, a differential quantization parameter is generated. The differential quantization parameter generation unit 108a outputs the differential quantization parameter to the entropy coding unit 110, thereby encoding the differential quantization parameter (step Sv_8).

[0343] In addition, the differential quantization parameter may also be encoded at a sequence level, a picture level, a slice level, a brick level, or a CTU level. In addition, the initial value of the quantization parameter may be encoded at a sequence level, a picture level, a slice level, a brick level, or a CTU level. At this time, the quantization parameter may be generated using the initial value of the quantization parameter and the differential quantization parameter.

[0344] Furthermore, the quantization unit 108 may include a plurality of quantizers, and may apply dependent quantization for quantizing the transform coefficients using a quantization method selected from a plurality of quantization methods.

[0345] [Entropy coding unit]

[0346] Fig. 20 2 is a block diagram showing an example of the functional structure of the entropy coding unit 110 .

[0347] The entropy coding unit 110 performs entropy coding on the quantization coefficients input from the quantization unit 108 and the prediction parameters input from the prediction parameter generation unit 130, thereby generating a stream. In this entropy coding, CABAC (Context-based Adaptive Binary Arithmetic Coding) is used, for example. Specifically, the entropy coding unit 110 includes, for example, a binarization unit 110a, a context control unit 110b, and a binary arithmetic coding unit 110c. The binarization unit 110a performs binarization to convert multi-value signals such as quantization coefficients and prediction parameters into binary signals. Examples of binarization methods include Truncated Rice Binarization, Exponential Golomb codes, and Fixed Length Binarization. The context control unit 110b derives a context value corresponding to the characteristics of the syntactic element or the surrounding conditions, that is, the probability of occurrence of the binary signal. Among the methods for deriving the context value, there are, for example, bypass, syntactic element reference, upper / left adjacent block reference, hierarchical information reference, and others. The binary arithmetic coding unit 110 c performs arithmetic coding on the binary signal using the derived context value.

[0348] Fig.21 3 is a diagram showing the flow of CABAC in the entropy coding unit 110 .

[0349] First, in CABAC in the entropy coding unit 110, initialization is performed. In this initialization, initialization and setting of the initial context value in the binary arithmetic coding unit 110c are performed. Then, the binarization unit 110a and the binary arithmetic coding unit 110c, for example, sequentially perform binarization and arithmetic coding on multiple quantized coefficients of the CTU. At this time, the context control unit 110b updates the context value each time arithmetic coding is performed. Then, the context control unit 110b backs off the context value as post-processing. The backed-off context value is used, for example, as the initial value of the context value for the next CTU.

[0350] [Inverse Quantization Unit]

[0351] The inverse quantization unit 112 inversely quantizes the quantized coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inversely quantizes the quantized coefficients of the current block in a predetermined scanning order. The inverse quantization unit 112 outputs the inversely quantized transform coefficients of the current block to the inverse transform unit 114.

[0352] [Inverse transformation unit]

[0353] The inverse transform unit 114 restores the prediction residual by performing an inverse transform on the transform coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 restores the prediction residual of the current block by performing an inverse transform on the transform coefficients corresponding to the transform performed by the transform unit 106. The inverse transform unit 114 outputs the restored prediction residual to the addition unit 116.

[0354] In addition, the restored prediction residual generally loses information due to quantization, and therefore does not match the prediction error calculated by the subtraction unit 104. In other words, the restored prediction residual generally includes a quantization error.

[0355] [Addition Department]

[0356] The adding unit 116 reconstructs the current block by adding the prediction residual input from the inverse transform unit 114 and the prediction image input from the prediction control unit 128 . As a result, a reconstructed image is generated. The adding unit 116 outputs the reconstructed image to the block memory 118 and the loop filter unit 120 .

[0357] [Block Memory]

[0358] The block memory 118 is a storage unit for storing, for example, a block that is referenced in intra prediction and is a block in the current picture. Specifically, the block memory 118 stores the reconstructed image output from the adder 116 .

[0359] [Frame Memory]

[0360] The frame memory 122 is a storage unit for storing reference pictures used in inter-frame prediction, and is sometimes referred to as a frame buffer. Specifically, the frame memory 122 stores the reconstructed image filtered by the loop filter unit 120 .

[0361] [Loop filter section]

[0362] The loop filter unit 120 performs loop filtering on the reconstructed image output by the adder unit 116, and outputs the filtered reconstructed image to the frame memory 122. Loop filtering refers to filtering used within a coding loop (in-loop filtering), and includes, for example, adaptive loop filtering (ALF), deblocking filtering (DF or DBF), and sample adaptive offset (SAO).

[0363] Fig. 22 3 is a block diagram showing an example of the functional configuration of the loop filter unit 120 .

[0364] For example Fig. 22As shown, the loop filter unit 120 includes a deblocking filter processing unit 120a, an SAO processing unit 120b, and an ALF processing unit 120c. The deblocking filter processing unit 120a applies the above-mentioned deblocking filter processing to the reconstructed image. The SAO processing unit 120b applies the above-mentioned SAO processing to the reconstructed image after the deblocking filter processing. In addition, the ALF processing unit 120c applies the above-mentioned ALF processing to the reconstructed image after the SAO processing. Details about ALF and deblocking filtering will be described later. SAO processing is a processing to improve image quality by reducing ringing (a phenomenon in which pixel values ​​around edges are deformed in a fluctuating manner) and correcting the deviation of pixel values. In the SAO processing, for example, there are edge offset processing and band offset processing. In addition, the loop filter unit 120 may not have Fig. 22 All the processing units disclosed in the disclosure may also include only a part of the processing units. In addition, the loop filter unit 120 may also be configured in accordance with Fig. 22 A structure in which each of the above-mentioned processes is performed in an order different from the processing order disclosed in.

[0365] [Loop Filter Section > Adaptive Loop Filter]

[0366] In ALF, a least square error filter is used to remove coding distortion. For example, for each 2×2 pixel sub-block in the current block, one filter is selected from multiple filters based on the direction and activity of the local gradient.

[0367] Specifically, first, a sub-block (e.g., a 2×2 pixel sub-block) is classified into a plurality of classes (e.g., 15 or 25 classes). The classification of the sub-block is performed, for example, based on the direction and activity of the gradient. In a specific example, the classification value C (e.g., C=5D+A) is calculated using the direction value D of the gradient (e.g., 0 to 2 or 0 to 4) and the activity value A of the gradient (e.g., 0 to 4). And, based on the classification value C, the sub-block is classified into a plurality of classes.

[0368] The gradient direction value D is derived, for example, by comparing gradients in multiple directions (eg, horizontal, vertical, and two diagonal directions). In addition, the gradient activity value A is derived, for example, by adding the gradients in multiple directions and quantizing the added result.

[0369] Based on the result of such classification, a filter to be used for a sub-block is determined from among a plurality of filters.

[0370] As the shape of the filter used in the ALF, for example, a circularly symmetric shape is used. Figures 23A to 23C The diagrams show a plurality of examples of filter shapes used in ALF. Fig.23A represents a 5×5 diamond-shaped filter, Fig. 23B represents a 7×7 diamond shape filter, Fig.23C Represents a 9×9 diamond shape filter. The information representing the shape of the filter is usually signaled at the picture level. In addition, the signaling of the information representing the shape of the filter does not need to be limited to the picture level, and can also be other levels (for example, sequence level, slice level, brick level, CTU level or CU level).

[0371] The on / off of ALF can also be determined at the picture level or CU level. For example, regarding brightness, whether to use ALF can be determined at the CU level, and regarding color difference, whether to use ALF can be determined at the picture level. Information indicating whether ALF is on / off is usually signaled at the picture level or CU level. In addition, the signaling of information indicating whether ALF is on / off does not need to be limited to the picture level or CU level, and can also be other levels (for example, sequence level, slice level, brick level or CTU level).

[0372] In addition, as described above, one filter is selected from a plurality of filters and the ALF processing is applied to the sub-block. For each of the plurality of filters (e.g., filters up to 15 or 25), a coefficient set consisting of a plurality of coefficients used in the filter is usually signaled at the picture level. In addition, the signaling of the coefficient set does not need to be limited to the picture level, and may be other levels (e.g., sequence level, slice level, brick level, CTU level, CU level, or sub-block level).

[0373] [Loop Filter > Cross Component Adaptive Loop Filter]

[0374] Fig.23D This is a diagram showing an example in which the Y sample (first component) is used for CCALF of Cb and CCALF of Cr (a plurality of components different from the first component). Fig.23E is a diagram showing a diamond-shaped filter.

[0375] An example of CC-ALF is to use a linear diamond filter ( Fig.23D , Fig.23E) is applied to the luminance channel of each chroma component. For example, the filter coefficients are sent in APS, scaled by a factor of 2^10, and rounded for fixed decimal point representation. The application of the filter is controlled to variable block sizes and is notified by a context-coded flag received by each block of samples. Block size and CC-ALF validation flag are received at the slice level for each chroma component. The syntax and semantics of CC-ALF are provided in the Appendix. In this document, block sizes of 16x16, 32x32, 64x64, 128x128 are supported (in chroma samples).

[0376] [Loop Filter > Joint Chroma Cross Component Adaptive Loop Filter]

[0377] Fig.23F It is a diagram showing an example of JC-CCALF. Figure 23G This is a diagram showing examples of weight_index candidates of JC-CCALF.

[0378] One example of JC-CCALF uses only one CCALF filter, generates one CCALF filter output as the color difference adjustment signal for only one color component, and applies appropriately weighted versions of the same color difference adjustment signal to the other color components. This reduces the complexity of conventional CCALF to about half.

[0379] The weight value is encoded into a code (sign) flag and a weight index. The weight index (denoted as weight_index) is encoded as 3 bits and specifies the size of the JC-CCALF weight JcCcWeight. It cannot be the same as 0. The size of JcCcWeight is determined as follows.

[0380] When weight_index is 4 or less, JcCcWeight is equal to weight_index>>2.

[0381] In other cases, JcCcWeight is equal to 4 / (weight_index-4).

[0382] The block level on / off control for the ALF filter is separate for Cb and Cr. This is the same as CCALF, where 2 separate sets of block level on / off control flags are encoded. Here, unlike CCALF, the on / off control blocks for Cb and Cr are the same size, so only 1 block size variable is encoded.

[0383] [Loop filter section > Deblocking filter]

[0384] In the deblocking filtering process, the loop filter unit 120 performs filtering on block boundaries of the reconstructed image to reduce distortion generated at the block boundaries.

[0385] Fig.24 It is a block diagram showing an example of a detailed structure of the deblocking filter processing unit 120a.

[0386] The deblocking filter processing unit 120 a includes, for example, a boundary determination unit 1201 , a filter determination unit 1203 , a filter processing unit 1205 , a processing determination unit 1208 , a filter characteristic determination unit 1207 , and switches 1202 , 1204 , and 1206 .

[0387] The boundary determination unit 1201 determines whether there is a pixel (ie, a target pixel) to be subjected to the deblocking filtering process near the block boundary. Then, the boundary determination unit 1201 outputs its determination result to the switch 1202 and the process determination unit 1208 .

[0388] When the boundary determination unit 1201 determines that the target pixel exists near the block boundary, the switch 1202 outputs the image before filtering to the switch 1204. On the contrary, when the boundary determination unit 1201 determines that the target pixel does not exist near the block boundary, the switch 1202 outputs the image before filtering to the switch 1206. The image before filtering is an image composed of the target pixel and at least one peripheral pixel located around the target pixel.

[0389] The filter determination unit 1203 determines whether to perform deblocking filtering on the target pixel based on the pixel value of at least one surrounding pixel located around the target pixel, and then outputs the determination result to the switch 1204 and the processing determination unit 1208 .

[0390] When the filter determination unit 1203 determines that the deblocking filter process is to be performed on the target pixel, the switch 1204 outputs the image before the filtering process obtained via the switch 1202 to the filtering process unit 1205. On the contrary, when the filter determination unit 1203 determines that the deblocking filter process is not to be performed on the target pixel, the switch 1204 outputs the image before the filtering process obtained via the switch 1202 to the switch 1206.

[0391] When the image before filtering is obtained via switches 1202 and 1204 , the filter processing unit 1205 performs a deblocking filter process on the target pixel using the filter characteristics determined by the filter characteristic determination unit 1207 . Then, the filter processing unit 1205 outputs the filtered pixel to the switch 1206 .

[0392] According to the control of the processing determination unit 1208 , the switch 1206 selectively outputs pixels that have not been processed by the deblocking filter and pixels that have been processed by the deblocking filter by the filter processing unit 1205 .

[0393] The processing determination unit 1208 controls the switch 1206 based on the respective determination results of the boundary determination unit 1201 and the filtering determination unit 1203. That is, when the boundary determination unit 1201 determines that the object pixel exists near the block boundary, and the filtering determination unit 1203 determines that the deblocking filtering process is performed on the object pixel, the processing determination unit 1208 outputs the pixel processed by the deblocking filtering from the switch 1206. In addition, in cases other than the above, the processing determination unit 1208 outputs the pixel that has not been processed by the deblocking / filtering process from the switch 1206. By repeatedly outputting such pixels, the image processed by the filtering process is output from the switch 1206. In addition, Fig.24 The illustrated configuration is an example of the configuration of the deblocking filter processing unit 120a, and the deblocking filter processing unit 120a may have other configurations.

[0394] Fig.25 This is a diagram showing an example of a deblocking filter having a filter characteristic that is symmetric with respect to a block boundary.

[0395] In the deblocking filter processing, for example, using the pixel value and the quantization parameter, one of two deblocking filters with different characteristics, that is, a strong filter and a weak filter, is selected. Fig.25 As shown, when pixels p0 to p2 and pixels q0 to q2 exist across a block boundary, the pixel values ​​of pixels q0 to q2 are changed to pixel values ​​q'0 to q'2 by performing calculations shown in the following equations.

[0396] q'0=(p1+2×p0+2×q0+2×q1+q2+4) / 8

[0397] q'1=(p0+q0+q1+q2+2) / 4

[0398] q'2=(p0+q0+q1+3×q2+2×q3+4) / 8

[0399] In the above equations, p0 to p2 and q0 to q2 are pixel values ​​of pixels p0 to p2 and pixels q0 to q2, respectively. In addition, q3 is the pixel value of pixel q3 adjacent to pixel q2 on the side opposite to the block boundary. In addition, on the right side of each of the above equations, the coefficient multiplied by the pixel value of each pixel used in the deblocking filter processing is the filter coefficient.

[0400] Furthermore, in the deblocking filter process, a clipping process may be performed in such a way that the pixel value after operation exceeds the threshold value and does not change. In the clipping process, the pixel value after operation based on the above formula is clipped to "the pixel value before operation ±2×threshold value" using a threshold value determined according to the quantization parameter. This can prevent excessive smoothing.

[0401] Fig.26 This is a diagram for explaining an example of a block boundary on which a deblocking filtering process is performed. Fig. 27 This is a diagram showing an example of the Bs value.

[0402] The block boundary for deblocking filtering is, for example, Fig.26 The deblocking filtering process is performed in units of, for example, 4 rows or 4 columns. First, for Fig.26 The block P and block Q shown are as follows: Fig. 27 That determines the Bs (Boundary Strength) value.

[0403] according to Fig. 27 The Bs value can determine whether to perform deblocking filtering of different strengths even at block boundaries belonging to the same image. When the Bs value is 2, deblocking filtering is performed on the color difference signal. When the Bs value is 1 or more and meets the specified conditions, deblocking filtering is performed on the brightness signal. In addition, the determination condition of the Bs value is not limited to Fig. 27 The conditions shown may also be determined based on other parameters.

[0404] [Prediction unit (intra-frame prediction unit / inter-frame prediction unit / prediction control unit)]

[0405] Fig.28 1 is a flowchart showing an example of processing performed by the prediction unit of the encoding device 100. In addition, as an example, the prediction unit is composed of all or part of the components of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. The prediction processing unit includes the intra prediction unit 124 and the inter prediction unit 126, for example.

[0406] The prediction unit generates a prediction image of the current block (step Sb_1). In addition, the prediction image includes, for example, an intra-frame prediction image (intra-frame prediction signal) or an inter-frame prediction image (inter-frame prediction signal). Specifically, the prediction unit generates a prediction image of the current block using a reconstructed image obtained by generating prediction images for other blocks, generating prediction residuals, generating quantized coefficients, restoring prediction residuals, and adding prediction images.

[0407] The reconstructed image may be, for example, an image of a reference picture or an image including the current block, that is, an image of an encoded block in the current picture (that is, the other blocks mentioned above). The encoded block in the current picture may be, for example, an adjacent block of the current block.

[0408] Fig.29 This is a flowchart showing another example of the processing performed by the prediction unit of the encoding device 100.

[0409] The prediction unit generates a prediction image by the first method (step Sc_1a), generates a prediction image by the second method (step Sc_1b), and generates a prediction image by the third method (step Sc_1c). The first method, the second method, and the third method are different methods for generating prediction images, and may be, for example, an inter-frame prediction method, an intra-frame prediction method, and other prediction methods. In such a prediction method, the above-mentioned reconstructed image may also be used.

[0410] Next, the prediction unit evaluates the predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c, respectively (step Sc_2). For example, the prediction unit evaluates the predicted images by calculating the cost C for each of the predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c, and comparing the costs C of the predicted images. In addition, the cost C is calculated by a formula of the RD optimization model, such as C=D+λ×R. In this formula, D is the coding distortion of the predicted image, and is represented, for example, by the absolute value of the difference between the pixel value of the current block and the pixel value of the predicted image, etc. In addition, R is the bit rate of the stream. In addition, λ is an undetermined multiplier, such as Lagrangian.

[0411] Next, the prediction unit selects one of the prediction images generated in steps Sc_1a, Sc_1b, and Sc_1c, respectively (step Sc_3). That is, the prediction unit selects a method or mode for obtaining the final prediction image. For example, the prediction unit selects a prediction image with the smallest cost C based on the cost C calculated for these prediction images. Alternatively, the evaluation in step Sc_2 and the selection of the prediction image in step Sc_3 may also be performed based on the parameters used in the encoding process. The encoding device 100 may signal information for determining the selected prediction image, method, or mode as a stream. The information may be, for example, a flag. Thus, the decoding device 200 can generate a prediction image in accordance with the method or mode selected in the encoding device 100 based on the information. In addition, in Fig.29 In the example shown, the prediction unit selects any one of the prediction images after generating the prediction images by each method. However, before generating these prediction images, the prediction unit may select a method or mode based on the parameters used for the above encoding process, and may generate the prediction image according to the method or mode.

[0412] For example, the first method and the second method are intra prediction and inter prediction, respectively, and the prediction unit may select a final prediction image for the current block from prediction images generated according to these prediction methods.

[0413] Fig.30 This is a flowchart showing another example of the processing performed by the prediction unit of the encoding device 100.

[0414] First, the prediction unit generates a prediction image by intra prediction (step Sd_1a), and generates a prediction image by inter prediction (step Sd_1b). In addition, the prediction image generated by intra prediction is also called intra prediction image, and the prediction image generated by inter prediction is also called inter prediction image.

[0415] Next, the prediction unit evaluates each of the intra-frame prediction image and the inter-frame prediction image (step Sd_2). The above-mentioned cost C can also be used in this evaluation. Then, the prediction unit can select the prediction image that calculates the minimum cost C from the intra-frame prediction image and the inter-frame prediction image as the final prediction image of the current block (step Sd_3). That is, the prediction method or mode for generating the prediction image of the current block is selected.

[0416] [Intra-frame prediction unit]

[0417] The intra prediction unit 124 performs intra prediction (also referred to as intra-screen prediction) of the current block with reference to the block in the current picture stored in the block memory 118, thereby generating a predicted image of the current block (i.e., intra-prediction image). Specifically, the intra prediction unit 124 generates an intra-prediction image by performing intra prediction with reference to pixel values ​​(e.g., brightness values, color difference values) of blocks adjacent to the current block, and outputs the intra-prediction image to the prediction control unit 128.

[0418] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of predetermined intra prediction modes. The plurality of intra prediction modes generally include one or more non-directional prediction modes and a plurality of directional prediction modes.

[0419] The one or more non-directional prediction modes include, for example, a Planar prediction mode and a DC prediction mode defined in the H.265 / HEVC standard.

[0420] The plurality of directional prediction modes include, for example, 33 directional prediction modes defined by the H.265 / HEVC standard. In addition, the plurality of directional prediction modes may include 32 directional prediction modes in addition to the 33 directional prediction modes (a total of 65 directional prediction modes). Fig.31This is a diagram showing all 67 intra prediction modes (2 non-directional prediction modes and 65 directional prediction modes) in intra prediction. The solid arrows represent the 33 directions specified by the H.265 / HEVC specification, and the dotted arrows represent the additional 32 directions (2 non-directional prediction modes in Fig.31 (not shown in the figure).

[0421] In various implementation examples, the luminance block may be referenced in the intra prediction of the chrominance block. That is, the chrominance component of the current block may be predicted based on the luminance component of the current block. Such intra prediction is called CCLM (cross-component linear model) prediction. Such an intra prediction mode of the chrominance block with reference to the luminance block (for example, CCLM mode) may be added as one of the intra prediction modes of the chrominance block.

[0422] The intra prediction unit 124 may also modify the pixel value after intra prediction based on the gradient of the reference pixel in the horizontal / vertical direction. Intra prediction accompanied by such modification is called PDPC (position dependent intraprediction combination). Information indicating whether PDPC is used (for example, called PDPC flag) is usually signaled at the CU level. In addition, the signaling of this information does not need to be limited to the CU level, but may also be other levels (for example, sequence level, picture level, slice level, brick level or CTU level).

[0423] Fig.32 : is a flowchart showing an example of the processing performed by the intra prediction unit 124 .

[0424] The intra prediction unit 124 selects one intra prediction mode from a plurality of intra prediction modes (step Sw_1). Then, the intra prediction unit 124 generates a predicted image according to the selected intra prediction mode (step Sw_2). Next, the intra prediction unit 124 determines the MPM (Most Probable Modes) (step Sw_3). The MPM is composed of, for example, 6 intra prediction modes. Two of the 6 intra prediction modes may be a Planar prediction mode and a DC prediction mode, and the remaining 4 modes may be directional prediction modes. Then, the intra prediction unit 124 determines whether the intra prediction mode selected in step Sw_1 is included in the MPM (step Sw_4).

[0425] Here, when it is determined that the selected intra prediction mode is included in the MPM (Yes in step Sw_4), the intra prediction unit 124 sets the MPM flag to 1 (step Sw_5), and generates information indicating the selected intra prediction mode in the MPM (step Sw_6). In addition, the MPM flag set to 1 and the information indicating the intra prediction mode are encoded as prediction parameters by the entropy encoding unit 110.

[0426] On the other hand, when it is determined that the selected intra prediction mode is not included in the MPM (No in step Sw_4), the intra prediction unit 124 sets the MPM flag to 0 (step Sw_7). Alternatively, the intra prediction unit 124 does not set the MPM flag. Then, the intra prediction unit 124 generates information indicating the selected intra prediction mode among one or more intra prediction modes not included in the MPM (step Sw_8). In addition, the MPM flag set to 0 and the information indicating the intra prediction mode are respectively encoded as prediction parameters by the entropy coding unit 110. The information indicating the intra prediction mode indicates, for example, any value from 0 to 60.

[0427] [Inter-frame prediction unit]

[0428] The inter-frame prediction unit 126 performs inter-frame prediction (also called inter-screen prediction) of the current block with reference to a reference picture different from the current picture stored in the frame memory 122, thereby generating a predicted image (inter-frame prediction image). Inter-frame prediction is performed in units of the current block or the current sub-block within the current block. The sub-block is contained in the block and is a unit smaller than the block. The size of the sub-block can be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block can also be switched in units such as slices, bricks, or pictures.

[0429] For example, the inter-frame prediction unit 126 performs motion search (motion estimation) in the reference picture for the current block or current sub-block, and searches for the reference block or sub-block that is most consistent with the current block or current sub-block. In addition, the inter-frame prediction unit 126 obtains motion information (such as a motion vector) for compensating for the motion or change from the reference block or sub-block to the current block or sub-block. The inter-frame prediction unit 126 performs motion compensation (or motion prediction) based on the motion information, thereby generating an inter-frame prediction image of the current block or sub-block. In addition, the inter-frame prediction unit 126 outputs the generated inter-frame prediction image to the prediction control unit 128.

[0430] The motion information used in motion compensation is signaled as an inter-frame prediction image in various forms. For example, a motion vector may be signaled. As another example, the difference between a motion vector and a predicted motion vector (motion vector predictor) may be signaled.

[0431] [See picture list]

[0432] Fig.33 is a diagram showing an example of each reference picture. Fig.34 1 is a conceptual diagram showing an example of a reference picture list. The reference picture list is a list showing one or more reference pictures stored in the frame memory 122. Fig.33 In the figure, rectangles represent pictures, arrows represent reference relationships between pictures, the horizontal axis represents time, I, P, and B in the rectangles represent intra-frame prediction pictures, single-prediction pictures, and dual-prediction pictures, respectively, and the numbers in the rectangles represent the decoding order. Fig.33 As shown in , the decoding order of each picture is I0, P1, B2, B3, B4, and the display order of each picture is I0, B3, B2, B4, P1. Fig.34 As shown in FIG, a reference picture list is a list of candidates for reference pictures. For example, a picture (or slice) can have more than one reference picture list. For example, if the current picture is a uni-predicted picture, one reference picture list is used. If the current picture is a bi-predicted picture, two reference picture lists are used. Fig.33 and Fig.34 In the example, picture B3, which is the current picture currPic, has two reference picture lists, namely the L0 list and the L1 list. When the current picture currPic is picture B3, the candidates for the reference pictures of the current picture currPic are I0, P1 and B2, and each reference picture list (i.e., the L0 list and the L1 list) represents these pictures. The inter-frame prediction unit 126 or the prediction control unit 128 specifies which picture in each reference picture list is actually referenced by referring to the picture index refidxLx. Fig.34 , reference pictures P1 and B2 are specified by reference picture indexes refIdxL0 and refIdxL1.

[0433] Such a reference picture list may be generated in sequence units, picture units, slice units, brick units, CTU units, or CU units. In addition, a reference picture index representing a reference picture referenced in inter-frame prediction among reference pictures shown in the reference picture list may be encoded at a sequence level, a picture level, a slice level, a brick level, a CTU level, or a CU level. In addition, a common reference picture list may be used in multiple inter-frame prediction modes.

[0434] [Basic process of inter-frame prediction]

[0435] Fig.35 This is a flowchart showing the basic process of inter-frame prediction.

[0436] The inter prediction unit 126 first generates a predicted image (steps Se_1 to Se_3). Next, the subtraction unit 104 generates a difference between the current block and the predicted image as a prediction residual (step Se_4).

[0437] Here, in the generation of the predicted image, the inter-frame prediction unit 126 generates the predicted image by, for example, determining the motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). In addition, in the determination of the MV, the inter-frame prediction unit 126 determines the MV by, for example, selecting a candidate motion vector (candidate MV) (step Se_1) and deriving the MV (step Se_2). The selection of the candidate MV is performed, for example, by the inter-frame prediction unit 126 generating a candidate MV list and selecting at least one candidate MV from the candidate MV list. In addition, in the candidate MV list, an MV derived in the past can be added as a candidate MV. In addition, in the derivation of the MV, the inter-frame prediction unit 126 can also select at least one candidate MV from the at least one candidate MV and determine the selected at least one candidate MV as the MV of the current block. Alternatively, the inter-frame prediction unit 126 can determine the MV of the current block by searching the area of ​​the reference picture indicated by the candidate MV for each of the selected at least one candidate MV. In addition, the operation of searching for the region of the reference picture may also be referred to as motion estimation.

[0438] In the above example, steps Se_1 to Se_3 are performed by the inter-frame prediction unit 126 , but processing such as step Se_1 or step Se_2 may be performed by other components included in the encoding device 100 .

[0439] In addition, a candidate MV list may be prepared for each process in each inter-frame prediction mode, or a common candidate MV list may be used in multiple inter-frame prediction modes. Fig. 9 The processing of steps Sa_3 and Sa_4 shown in FIG. 1 is equivalent to the processing of step Se_3. Fig.30 The processing of step Sd_1b.

[0440] [MV export process]

[0441] Fig.36 This is a flowchart showing an example of MV derivation.

[0442] The inter-frame prediction unit 126 may derive the MV of the current block in a mode of encoding motion information (eg, MV). In this case, for example, the motion information may be encoded as a prediction parameter and signaled. That is, the encoded motion information is included in the stream.

[0443] Alternatively, the inter prediction unit 126 may derive the MV in a mode in which the motion information is not encoded. In this case, the motion information is not included in the stream.

[0444] Here, the modes for deriving MV include the normal inter mode, normal merge mode, FRUC mode, and affine mode described later. Among these modes, the modes for encoding motion information include the normal inter mode, normal merge mode, and affine mode (specifically, affine inter mode and affine merge mode). In addition, the motion information may include not only the MV but also the predicted MV selection information described later. In addition, the modes for not encoding motion information include the FRUC mode, etc. The inter prediction unit 126 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.

[0445] Fig.37 This is a flowchart showing another example of MV derivation.

[0446] The inter-frame prediction unit 126 can derive the MV of the current block in a mode of encoding the differential MV. In this case, for example, the differential MV is encoded as a prediction parameter and is signaled. That is, the encoded differential MV is included in the stream. The differential MV is the difference between the MV of the current block and its predicted MV. In addition, the predicted MV is a predicted motion vector.

[0447] Alternatively, the inter prediction unit 126 may derive the MV in a mode in which the difference MV is not encoded. In this case, the encoded difference MV is not included in the stream.

[0448] Here, as described above, the MV derivation modes include the normal inter mode, normal merge mode, FRUC mode, and affine mode described later. Among these modes, the modes for encoding the differential MV include the normal inter mode and the affine mode (specifically, the affine inter mode). In addition, the modes for not encoding the differential MV include the FRUC mode, the normal merge mode, and the affine mode (specifically, the affine merge mode). The inter prediction unit 126 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.

[0449] [MV export mode]

[0450] Fig.38A and Fig.38B is a diagram showing an example of the classification of each mode derived from MV. Fig.38AAs shown in FIG. 1 , the MV derivation mode is classified into three major modes according to whether the motion information is encoded and whether the differential MV is encoded. The three modes are inter-frame mode, merge mode, and FRUC (frame rate up-conversion) mode. The inter-frame mode is a mode for performing motion search and a mode for encoding the motion information and the differential MV. For example, Fig.38B As shown in FIG. 1 , the inter-frame mode includes the affine inter-frame mode and the normal inter-frame mode. The merge mode is a mode in which motion search is not performed, and an MV is selected from the surrounding coded blocks and the MV is used to derive the MV of the current block. The merge mode is basically a mode in which motion information is encoded without encoding the differential MV. For example, Fig.38B As shown, the merge mode includes a normal merge mode (sometimes also referred to as a normal merge mode or a regular merge mode), an MMVD (Merge with Motion Vector Difference) mode, a CIIP (Combined inter merge / intraprediction) mode, a triangle mode, an ATMVP mode, and an affine merge mode. Here, in the MMVD mode among the modes included in the merge mode, the differential MV is encoded as an exception. In addition, the above-mentioned affine merge mode and affine inter mode are modes included in the affine mode. The affine mode is a mode in which the MVs of the multiple sub-blocks constituting the current block are derived as the MV of the current block assuming an affine transformation. The FRUC mode is a mode in which the MV of the current block is derived by searching between the encoded regions, and is a mode in which neither the motion information nor the differential MV is encoded. In addition, the details of each of these modes will be described later.

[0451] in addition, Fig.38A and Fig.38B The classification of each mode shown is an example and is not limited to this. For example, when encoding the difference MV in the CIIP mode, the CIIP mode is classified as the inter-frame mode.

[0452] [MV export > Normal interframe mode]

[0453] The normal inter mode is an inter prediction mode based on deriving the MV of the current block by finding a block similar to the image of the current block from the area of ​​the reference picture indicated by the candidate MV. In addition, in the normal inter mode, the differential MV is encoded.

[0454] Fig.39 is a flowchart showing an example of inter-frame prediction based on the normal inter-frame mode.

[0455] First, the inter prediction unit 126 obtains a plurality of candidate MVs for the current block based on information such as MVs of a plurality of coded blocks temporally or spatially located around the current block (step Sg_1). That is, the inter prediction unit 126 creates a candidate MV list.

[0456] Next, the inter-frame prediction unit 126 extracts N (N is an integer greater than or equal to 2) candidate MVs from the plurality of candidate MVs obtained in step Sg_1 as prediction MV candidates in a predetermined priority order (step Sg_2). The priority order is predetermined for each of the N candidate MVs.

[0457] Next, the inter-frame prediction unit 126 selects one prediction MV candidate from the N prediction MV candidates as the prediction MV of the current block (step Sg_3). At this time, the inter-frame prediction unit 126 encodes the prediction MV selection information for identifying the selected prediction MV into the stream. That is, the inter-frame prediction unit 126 outputs the prediction MV selection information as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130.

[0458] Next, the inter-frame prediction unit 126 refers to the coded reference picture and derives the MV of the current block (step Sg_4). At this time, the inter-frame prediction unit 126 also encodes the difference value between the derived MV and the predicted MV as a difference MV to the stream. That is, the inter-frame prediction unit 126 outputs the difference MV as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130. In addition, the coded reference picture is a picture composed of a plurality of blocks reconstructed after encoding.

[0459] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sg_5). The processing of steps Sg_1 to Sg_5 is performed on each block. For example, when the processing of steps Sg_1 to Sg_5 is performed on all blocks included in a slice, the inter prediction using the normal inter mode for the slice is completed. In addition, when the processing of steps Sg_1 to Sg_5 is performed on all blocks included in a picture, the inter prediction using the normal inter mode for the picture is completed. In addition, it is also possible that the processing of steps Sg_1 to Sg_5 is not performed on all blocks included in a slice but on a part of the blocks, and the inter prediction using the normal inter mode for the slice is completed. Similarly, it is also possible that the processing of steps Sg_1 to Sg_5 is performed on a part of the blocks included in a picture, and the inter prediction using the normal inter mode for the picture is completed.

[0460] The predicted image is the inter prediction signal described above. Information indicating the inter prediction mode (in the above example, the normal inter mode) used to generate the predicted image contained in the coded signal is coded as, for example, a prediction parameter.

[0461] In addition, the candidate MV list can also be used in common with the list used in other modes. In addition, the processing related to the candidate MV list can be applied to the processing related to the list used in other modes. The processing related to the candidate MV list is, for example, extracting or selecting candidate MVs from the candidate MV list, rearranging candidate MVs, or deleting candidate MVs.

[0462] [MV Export > Normal Merge Mode]

[0463] The normal merge mode is an inter-frame prediction mode of deriving the MV by selecting a candidate MV from the candidate MV list as the MV of the current block. In addition, the normal merge mode is a merge mode in a narrow sense, and is sometimes referred to as the merge mode. In this embodiment, the normal merge mode and the merge mode are distinguished, and the merge mode is used in a broad sense.

[0464] Fig.40 is a flowchart showing an example of inter-frame prediction based on normal merge mode.

[0465] First, the inter prediction unit 126 obtains a plurality of candidate MVs for the current block based on information such as a plurality of coded block MVs located around the current block in time or space (step Sh_1). That is, the inter prediction unit 126 creates a candidate MV list.

[0466] Next, the inter-frame prediction unit 126 selects one candidate MV from the plurality of candidate MVs obtained in step Sh_1 to derive the MV of the current block (step Sh_2). At this time, the inter-frame prediction unit 126 encodes MV selection information for identifying the selected candidate MV into the stream. That is, the inter-frame prediction unit 126 outputs the MV selection information as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130.

[0467] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sh_3). The processing of steps Sh_1 to Sh_3 is performed on each block, for example. For example, when the processing of steps Sh_1 to Sh_3 is performed on all blocks included in a slice, the inter prediction using the normal merge mode for the slice ends. In addition, when the processing of steps Sh_1 to Sh_3 is performed on all blocks included in a picture, the inter prediction using the normal merge mode for the picture ends. In addition, the processing of steps Sh_1 to Sh_3 may also be that when it is not performed on all blocks included in a slice but on a part of the blocks, the inter prediction using the normal merge mode for the slice ends. Similarly, the processing of steps Sh_1 to Sh_3 may also be that when it is performed on a part of the blocks included in a picture, the inter prediction using the normal merge mode for the picture ends.

[0468] Furthermore, information indicating the inter prediction mode (in the above example, the normal merge mode) used in generating the predicted image contained in the stream is encoded as, for example, a prediction parameter.

[0469] Fig.41 This is a diagram for explaining an example of MV derivation processing of the current picture based on the normal merge mode.

[0470] First, the inter-frame prediction unit 126 generates a candidate MV list in which candidate MVs are registered. The candidate MVs include: spatial neighbor candidate MVs, which are MVs of multiple coded blocks located in the spatial periphery of the current block; temporal neighbor candidate MVs, which are MVs of blocks near the position of the current block in the coded reference picture projected; combined candidate MVs, which are MVs generated by combining the MV values ​​of spatial neighbor candidate MVs and temporal neighbor candidate MVs; and zero candidate MVs, which are MVs with a value of zero, etc.

[0471] Next, the inter prediction unit 126 selects one candidate MV from the plurality of candidate MVs registered in the candidate MV list, and determines the one candidate MV as the MV of the current block.

[0472] Then, the entropy coding unit 110 writes merge_idx, which is a signal indicating which candidate MV is selected, in the stream and encodes it.

[0473] In addition, Fig.41 The candidate MVs registered in the candidate MV list described in the figure are just examples, and may be a number different from that in the figure, or a structure that does not include some types of candidate MVs in the figure, or a structure that adds candidate MVs other than the types of candidate MVs in the figure.

[0474] The MV of the current block derived by the normal merge mode can also be used to perform DMVR (dynamic motion vector refreshing) to determine the final MV. In addition, in the normal merge mode, the differential MV is not encoded, but in the MMVD mode, the differential MV is encoded. The MMVD mode selects one candidate MV from the candidate MV list in the same way as the normal merge mode, but encodes the differential MV. Fig.38B As shown, such MMVD can also be classified as a merge mode together with the normal merge mode. In addition, the differential MV in the MMVD mode may not be the same as the differential MV used in the inter-frame mode. For example, the derivation of the differential MV in the MMVD mode may be a process with a smaller processing amount than the derivation of the differential MV in the inter-frame mode.

[0475] Alternatively, a CIIP (Combined inter merge / intra prediction) mode may be performed in which a prediction image generated in inter prediction is superimposed on a prediction image generated in intra prediction to generate a prediction image of a current block.

[0476] In addition, the candidate MV list may also be referred to as a candidate list. In addition, merge_idx is MV selection information.

[0477] [MV Export > HMVP Mode]

[0478] Fig.42 This is a diagram for explaining an example of MV derivation processing of the current picture based on the HMVP mode.

[0479] In normal merge mode, one candidate MV is selected from a candidate MV list generated by referring to an encoded block (e.g., CU), thereby determining the MV of the current block, e.g., CU. Here, other candidate MVs may also be registered in the candidate MV list. The mode of registering such other candidate MVs is called HMVP mode.

[0480] In the HMVP mode, candidate MVs are managed using a FIFO (First-In First-Out) buffer for HMVP, separately from the candidate MV list of the normal merge mode.

[0481] In the FIFO buffer, motion information such as the MV of the previously processed blocks is sequentially saved from the new FIFO buffer. In the management of the FIFO buffer, each time a block is processed, the MV of the latest block (i.e., the CU processed immediately before) is saved in the FIFO buffer, and the MV of the oldest CU in the FIFO buffer (i.e., the first processed CU) is deleted from the FIFO buffer. Fig.42In the example shown, HMVP1 is the MV of the newest block, and HMVP5 is the MV of the oldest block.

[0482] Then, for example, the inter-frame prediction unit 126 checks, for each MV managed in the FIFO buffer, from HMVP1, whether the MV is different from all candidate MVs already registered in the candidate MV list of the normal merge mode. Furthermore, the inter-frame prediction unit 126 may also add the MV managed in the FIFO buffer as a candidate MV to the candidate MV list of the normal merge mode if it is determined to be different from all candidate MVs. At this time, the candidate MV registered from the FIFO buffer may be one or more.

[0483] In this way, by using the HMVP mode, not only the MVs of the spatially or temporally adjacent blocks of the current block can be added to the candidates, but also the MVs of the blocks processed in the past can be added to the candidates. As a result, by expanding the variation of the candidate MVs of the normal merge mode, the possibility of improving the coding efficiency becomes higher.

[0484] In addition, the MV may also be motion information. That is, the candidate MV list and the information stored in the FIFO buffer may include not only the value of the MV but also information indicating the referenced picture, the referenced direction and the number of pictures, etc. In addition, the block may be, for example, a CU.

[0485] in addition, Fig.42 The candidate MV list and FIFO buffer are one example. The candidate MV list and FIFO buffer can also be Fig.42 Lists or buffers of different sizes, or in the same Fig.42 Structure for registering candidate MVs in different orders. The processing described here is common to both the encoding device 100 and the decoding device 200 .

[0486] In addition, the HMVP mode can also be applied to modes other than the normal merge mode. For example, the motion information such as the MV of the blocks processed in the affine mode in the past can also be saved in sequence from the new FIFO buffer and used as candidate MVs. The mode in which the HMVP mode is applied in the affine mode can also be called the historical affine mode.

[0487] [MV Export > FRUC Mode]

[0488] The motion information may be derived on the decoding device 200 side instead of being signaled on the encoding device 100 side. For example, the motion information may be derived by performing a motion search on the decoding device 200 side. In this case, the motion search is performed on the decoding device 200 side without using the pixel value of the current block. Such modes of performing motion search on the decoding device 200 side include a FRUC (frame rate up-conversion) mode or a PMMVD (pattern matched motion vector derivation) mode.

[0489] Fig.43 An example of FRUC processing is shown in . First, with reference to the MVs of each encoded block adjacent to the current block in space or time, a list is generated to represent these MVs as candidate MVs (that is, a candidate MV list, and it can also be common with the candidate MV list of the normal merge mode) (step Si_1). Next, the best candidate MV is selected from the multiple candidate MVs registered in the candidate MV list (step Si_2). For example, the evaluation value of each candidate MV included in the candidate MV list is calculated, and one candidate is selected as the best candidate MV based on the evaluation value. And, based on the selected best candidate MV, the MV for the current block is derived (step Si_4). Specifically, for example, the selected best candidate MV is derived as the MV for the current block. In addition, for example, the MV for the current block can also be derived by performing style matching in the surrounding area of ​​the position in the reference picture corresponding to the selected best candidate MV. That is, the surrounding area of ​​the best candidate MV can also be searched using style matching and evaluation values ​​in the reference picture. When there is an MV with a better evaluation value, the best candidate MV is updated to the MV and used as the final MV of the current block. It is not necessary to perform the update to the MV having a better evaluation value.

[0490] Finally, the inter-frame prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Si_5). The processing of steps Si_1 to Si_5 is performed on each block, for example. For example, when the processing of steps Si_1 to Si_5 is performed on all blocks included in a slice, the inter-frame prediction using the FRUC mode for the slice is completed. In addition, when the processing of steps Si_1 to Si_5 is performed on all blocks included in a picture, the inter-frame prediction using the FRUC mode for the picture is completed. In addition, the processing of steps Si_1 to Si_5 may also be that when it is not performed on all blocks included in a slice but on a part of the blocks, the inter-frame prediction using the FRUC mode for the slice is completed. Similarly, the processing of steps Si_1 to Si_5 may also be that when it is performed on a part of the blocks included in a picture, the inter-frame prediction using the FRUC mode for the picture is completed.

[0491] Even when processing is performed in sub-block units, the same processing as that in the above-described block unit may be performed.

[0492] The evaluation value can also be calculated by various methods. For example, the reconstructed image of the area in the reference picture corresponding to the MV is compared with the reconstructed image of a specified area (for example, as shown below, the area can be an area of ​​another reference picture or an area of ​​an adjacent block of the current picture). Then, the difference in pixel values ​​of the two reconstructed images can be calculated and used for the evaluation value of the MV. In addition, the evaluation value can also be calculated using other information in addition to the difference value.

[0493] Next, the style matching is described in detail. First, a candidate MV included in the candidate MV list (also called the merge list) is selected as the starting point of the search based on the style matching. As the style matching, the first style matching or the second style matching can be used. The first style matching and the second style matching are respectively called bilateral matching and template matching.

[0494] [MV Export > FRUC > Bidirectional Matching]

[0495] In the first style matching, style matching is performed between two blocks in two different reference pictures along the motion trajectory of the current block. Therefore, in the first style matching, as the prescribed area for calculating the evaluation value of the candidate MV, an area in another reference picture along the motion trajectory of the current block is used.

[0496] Fig.441 is a diagram for explaining an example of the first pattern matching (bidirectional matching) between two blocks in two reference pictures along a motion trajectory. Fig.44 As shown, in the first pattern matching, two MVs (MV0, MV1) are derived by searching for the best matching pair among the pairs of two blocks in two different reference pictures (Ref0, Ref1) along the motion trajectory of the current block (Cur block). Specifically, for the current block, the difference between the reconstructed image at a specified position in the first coded reference picture (Ref0) specified by the candidate MV and the reconstructed image at a specified position in the second coded reference picture (Ref1) specified by the symmetric MV after scaling the candidate MV by the display time interval is derived, and the evaluation value is calculated using the obtained difference value. The candidate MV with the best evaluation value can be selected as the best candidate MV from among multiple candidate MVs.

[0497] Under the assumption of a continuous motion trajectory, the MVs (MV0, MV1) indicating the two reference blocks are proportional to the temporal distances (TD0, TD1) between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, when the current picture is temporally located between the two reference pictures and the temporal distances from the current picture to the two reference pictures are equal, in the first pattern matching, mirror-symmetric bidirectional MVs are derived.

[0498] [MV Export > FRUC > Template Matching]

[0499] In the second pattern matching (template matching), pattern matching is performed between a template in the current picture (a block adjacent to the current block in the current picture (e.g., an upper and / or left adjacent block)) and a block in the reference picture. Therefore, in the second pattern matching, a block adjacent to the current block in the current picture is used as the prescribed area for calculating the evaluation value of the candidate MV.

[0500] Fig.45 is a diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. Fig.45 As shown, in the second pattern matching, the MV of the current block is derived by searching the reference picture (Ref0) for the block that best matches the block adjacent to the current block (Cur block) in the current picture (Cur Pic). Specifically, for the current block, the difference between the reconstructed image of the coded area of ​​both or one of the left adjacent and upper adjacent areas and the reconstructed image at the same position in the coded reference picture (Ref0) specified by the candidate MV is derived, and the evaluation value is calculated using the obtained difference value. The candidate MV with the best evaluation value can be selected as the best candidate MV from among multiple candidate MVs.

[0501] Such information indicating whether the FRUC mode is adopted (for example, called a FRUC flag) is signaled at the CU level. In addition, when the FRUC mode is adopted (for example, when the FRUC flag is true), information indicating the method of style matching that can be adopted (first style matching or second style matching) is signaled at the CU level. In addition, the signaling of this information does not need to be limited to the CU level, and can also be other levels (for example, sequence level, picture level, slice level, brick level, CTU level or sub-block level).

[0502] [MV Export > Affine Mode]

[0503] The affine mode is a mode for generating MV using affine transform, and for example, MV can be derived in sub-block units based on MVs of a plurality of adjacent blocks. This mode is sometimes referred to as affine motion compensation prediction mode.

[0504] Fig.46A FIG. 1 is a diagram for explaining an example of deriving an MV in sub-block units based on MVs of a plurality of adjacent blocks. Fig.46A In the example, the current block includes 16 sub-blocks composed of 4×4 pixels. Here, the motion vector v0 of the upper left corner control point of the current block is derived based on the MV of the adjacent block. Similarly, the motion vector v1 of the upper right corner control point of the current block is derived based on the MV of the adjacent sub-block. Then, according to the following formula (1A), the two motion vectors v0 and v1 are projected, and the motion vectors (v x , v y ).

[0505]

Formula 1

[0506]

[0507] Here, x and y represent the horizontal position and vertical position of the sub-block, respectively, and w represents a predetermined weight coefficient.

[0508] Information indicating such an affine mode (e.g., called an affine flag) may be signaled at the CU level. Furthermore, the signaling of the information indicating the affine mode need not be limited to the CU level, but may be at other levels (e.g., sequence level, picture level, slice level, brick level, CTU level, or sub-block level).

[0509] In addition, such an affine mode may include several modes in which the MVs of the upper left and upper right control points are derived in different ways. For example, the affine mode includes two modes: an affine inter (also called an affine normal inter) mode and an affine merge mode.

[0510] Fig.46B FIG. 1 is a diagram for explaining an example of deriving a sub-block-based MV in an affine mode using three control points. Fig.46B In the example, the current block includes 16 4×4 pixel sub-blocks. Here, the motion vector v0 of the upper left corner control point of the current block is derived based on the MV of the neighboring block. Similarly, the motion vector v1 of the upper right corner control point of the current block is derived based on the MV of the neighboring block, and the motion vector v2 of the lower left corner control point of the current block is derived based on the MV of the neighboring block. Then, according to the following formula (1B), the three motion vectors v0, v1 and v2 are projected to derive the motion vectors (v x , v y ).

[0511]

Formula 2

[0512]

[0513] Here, x and y represent the horizontal position and vertical position of the center of the sub-block, respectively, and w and h represent predetermined weight coefficients. Alternatively, w represents the width of the current block, and h represents the height of the current block.

[0514] Affine modes using different numbers of control points (e.g., 2 and 3) may also be switched and signaled at the CU level. In addition, information indicating the number of control points of the affine mode used at the CU level may also be signaled at other levels (e.g., sequence level, picture level, slice level, brick level, CTU level, or sub-block level).

[0515] In addition, in such an affine mode with three control points, several modes with different methods of deriving the MVs of the upper left, upper right, and lower left control points may be included. For example, in the affine mode with three control points, there are two modes, namely, the affine inter-frame mode and the affine merge mode, similarly to the affine mode with two control points.

[0516] In addition, in the affine mode, the size of each sub-block included in the current block is not limited to 4×4 pixels, but may be other sizes. For example, the size of each sub-block may be 8×8 pixels.

[0517] [MV Export > Affine Mode > Control Points]

[0518] Fig.47A , Fig.47B and Fig.47C This is a conceptual diagram for explaining an example of MV derivation of control points in the affine mode.

[0519] In affine mode, such as Fig.47AAs shown, for example, based on a plurality of MVs corresponding to blocks encoded in an affine mode among the encoded blocks A (left), B (upper), C (upper right), D (lower left), and E (upper left) adjacent to the current block, the predicted MV of each of the control points of the current block is calculated. Specifically, the encoded blocks A (left), B (upper), C (upper right), D (lower left), and E (upper left) are checked in this order to determine the first valid block encoded in the affine mode. The MVs of the control points of the current block are calculated based on the plurality of MVs corresponding to the determined blocks.

[0520] For example, Fig.47B As shown in FIG. 1 , when a block A adjacent to the left side of the current block is encoded in an affine mode having two control points, motion vectors v3 and v4 projected to the positions of the upper left corner and the upper right corner of the encoded block including the block A are derived. Then, based on the derived motion vectors v3 and v4, the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block are calculated.

[0521] For example, Fig.47C As shown in FIG. 1 , when a block A adjacent to the left side of a current block is encoded in an affine mode having three control points, motion vectors v3, v4, and v5 are derived that are projected to the positions of the upper left corner, the upper right corner, and the lower left corner of the encoded block containing block A. Then, based on the derived motion vectors v3, v4, and v5, motion vector v0 of the upper left control point, motion vector v1 of the upper right control point, and motion vector v2 of the lower left control point of the current block are calculated.

[0522] in addition, Figures 47A to 47C The MV derivation method shown can be used in the following Fig.50 The derivation of the MV of each control point of the current block in step Sk_1 shown in FIG. 1 can also be used in the following description. Fig.51 The derivation of the predicted MV of each control point of the current block in step Sj_1 is shown.

[0523] Fig.48A and Fig.48B This is a conceptual diagram for explaining another example of derivation of a control point MV in the affine mode.

[0524] Fig.48A It is a diagram for explaining an affine pattern having two control points.

[0525] In this affine model, if Fig.48AAs shown, the MV selected from the MVs of the coded blocks A, B, and C adjacent to the current block is used as the motion vector v0 of the upper left corner control point of the current block. Similarly, the MV selected from the MVs of the coded blocks D and E adjacent to the current block is used as the motion vector v1 of the upper right corner control point of the current block.

[0526] Fig.48B It is a diagram for explaining an affine pattern having three control points.

[0527] In this affine model, if Fig.48B As shown, the MV selected from the MVs of the coded blocks A, B, and C adjacent to the current block is used as the motion vector v0 of the upper left corner control point of the current block. Similarly, the MV selected from the MVs of the coded blocks D and E adjacent to the current block is used as the motion vector v1 of the upper right corner control point of the current block. In addition, the MV selected from the MVs of the coded blocks F and G adjacent to the current block is used as the motion vector v2 of the lower left corner control point of the current block.

[0528] in addition, Fig.48A and Fig.48B The MV derivation method shown can be used in the following Fig.50 The derivation of the MV of each control point of the current block in step Sk_1 shown in FIG. 1 can also be used for the following Fig.51 The predicted MV of each control point of the current block is derived in step Sj_1.

[0529] Here, for example, when affine modes with different numbers of control points (eg, 2 and 3) are switched at the CU level and signaled, the number of control points may be different between the coded block and the current block.

[0530] Fig.49A and Fig.49B This is a conceptual diagram for explaining an example of a method for deriving an MV of a control point when the number of control points in an already coded block and a current block is different.

[0531] For example, Fig.49A As shown in FIG. 1 , the current block has three control points, namely, the upper left corner, the upper right corner, and the lower left corner, and the block A adjacent to the left of the current block is encoded in an affine mode having two control points. In this case, motion vectors v3 and v4 projected to the positions of the upper left corner and the upper right corner of the encoded block including block A are derived. Then, based on the derived motion vectors v3 and v4, the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block are calculated. Furthermore, based on the derived motion vectors v0 and v1, the motion vector v2 of the lower left corner control point is calculated.

[0532] For example, Fig.49B As shown in FIG. 1 , the current block has two control points, the upper left corner and the upper right corner, and the block A adjacent to the left of the current block is encoded in an affine mode with three control points. In this case, motion vectors v3, v4, and v5 projected to the positions of the upper left corner, the upper right corner, and the lower left corner of the encoded block including the block A are derived. Then, based on the derived motion vectors v3, v4, and v5, the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block are calculated.

[0533] in addition, Fig.49A and Fig.49B The MV derivation method shown can be used in the following Fig.50 The derivation of the MV of each control point of the current block in step Sk_1 shown in FIG. 1 can also be used for the following Fig.51 The predicted MV of each control point of the current block is derived in step Sj_1.

[0534] [MV Export > Affine Mode > Affine Merge Mode]

[0535] Fig.50 This is a flowchart showing an example of the affine merge mode.

[0536] In the affine merge mode, first, the inter-frame prediction unit 126 derives the MV of each control point of the current block (step Sk_1). Fig.46A As shown, it is the upper left and upper right corner points of the current block, or as Fig.46B As shown, these are the points at the upper left corner, upper right corner, and lower left corner of the current block. At this time, the inter prediction unit 126 may also encode MV selection information for identifying the derived two or three MVs into the stream.

[0537] For example, when using Figures 47A to 47C In the case of the MV derivation method shown, Fig.47A As shown, the inter-frame prediction unit 126 checks the encoded blocks A (left), block B (top), block C (top right), block D (bottom left) and block E (top left) in this order, and determines the initial valid block encoded in the affine mode.

[0538] The inter-frame prediction unit 126 uses the first valid block encoded in the determined affine mode to derive the MV of the control point. For example, when block A is determined and block A has two control points, Fig.47BAs shown, the inter-frame prediction unit 126 calculates the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block based on the motion vectors v3 and v4 of the upper left corner and the upper right corner of the coded block including the block A. For example, by projecting the motion vectors v3 and v4 of the upper left corner and the upper right corner of the coded block to the current block, the inter-frame prediction unit 126 calculates the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block.

[0539] Alternatively, if block A is determined and block A has 3 control points, Fig.47C As shown, the inter-frame prediction unit 126 calculates the motion vector v0 of the upper left corner control point, the motion vector v1 of the upper right corner control point, and the motion vector v2 of the lower left corner control point of the current block based on the motion vectors v3, v4, and v5 of the upper left corner, the upper right corner, and the lower left corner of the coded block including the block A. For example, by projecting the motion vectors v3, v4, and v5 of the upper left corner, the upper right corner, and the lower left corner of the coded block onto the current block, the inter-frame prediction unit 126 calculates the motion vector v0 of the upper left corner control point, the motion vector v1 of the upper right corner control point, and the motion vector v2 of the lower left corner control point of the current block.

[0540] In addition, as mentioned above Fig.49A As shown, block A is determined, and when block A has 2 control points, the MV of 3 control points is calculated. Fig.49B As shown, block A is determined, and when block A has 3 control points, MVs of 2 control points are calculated.

[0541] Next, the inter-frame prediction unit 126 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, the inter-frame prediction unit 126 uses two motion vectors v0 and v1 and the above-mentioned formula (1A), or uses three motion vectors v0, v1 and v2 and the above-mentioned formula (1B) for each of the multiple sub-blocks to calculate the MV of the sub-block as an affine MV (step Sk_2). Then, the inter-frame prediction unit 126 uses these affine MVs and the encoded reference picture to perform motion compensation on the sub-block (step Sk_3). When the processing of steps Sk_2 and Sk_3 is performed on all sub-blocks included in the current block, the processing of generating a predicted image using the affine merge mode for the current block is completed. That is, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0542] In addition, in step Sk_1, the candidate MV list mentioned above may also be generated. The candidate MV list may also be a list including candidate MVs derived using multiple MV derivation methods for each control point. The multiple MV derivation methods may be: Figures 47A to 47C The MV export method shown in Fig.48A and Fig.48B The MV export method shown in Fig.49A and Fig.49B The MV derivation method shown and any combination of other MV derivation methods.

[0543] In addition, the candidate MV list may include candidate MVs of a mode other than the affine mode for performing prediction in sub-block units.

[0544] In addition, as a candidate MV list, for example, a candidate MV list including candidate MVs of an affine merge mode with 2 control points and a candidate MV list including candidate MVs of an affine merge mode with 3 control points may be generated. Alternatively, a candidate MV list including candidate MVs of an affine merge mode with 2 control points and a candidate MV list including candidate MVs of an affine merge mode with 3 control points may be generated separately. Alternatively, a candidate MV list including candidate MVs of one of the affine merge modes with 2 control points and the affine merge mode with 3 control points may be generated. The candidate MVs may be, for example, the MVs of the encoded blocks A (left), B (top), C (top right), D (bottom left), and E (top left), or they may be MVs of valid blocks among these blocks.

[0545] Alternatively, an index indicating which candidate MV in the candidate MV list is selected may be transmitted as the MV selection information.

[0546] [MV Export > Affine Mode > Affine Inter Mode]

[0547] Fig.51 This is a flowchart showing an example of the affine inter mode.

[0548] In the affine inter mode, first, the inter prediction unit 126 derives the predicted MV (v0, v1) or (v0, v1, v2) of each of the two or three control points of the current block (step Sj_1). Fig.46A or Fig.46B As shown, the control point is the point at the upper left corner, upper right corner, or lower left corner of the current block.

[0549] For example, when using Fig.48A and Fig.48B In the case of the MV derivation method shown in FIG. 1 , the inter-frame prediction unit 126 selects Fig.48A or Fig.48B The MV of a block in the coded blocks near each control point of the current block shown is used to derive the predicted MV (v0, v1) or (v0, v1, v2) of the control point of the current block. At this time, the inter-frame prediction unit 126 encodes the predicted MV selection information for identifying the selected 2 or 3 predicted MVs into the stream.

[0550] For example, the inter-frame prediction unit 126 may determine which block's MV to select from the coded blocks adjacent to the current block as the predicted MV of the control point by using cost evaluation, etc., and may describe a flag indicating which predicted MV is selected in the bitstream. That is, the inter-frame prediction unit 126 outputs the predicted MV selection information such as the flag to the entropy coding unit 110 as a prediction parameter via the prediction parameter generation unit 130.

[0551] Next, the inter-frame prediction unit 126 performs motion search (steps Sj_3 and Sj_4) while updating the predicted MV selected or derived in step Sj_1 respectively (step Sj_2). That is, the inter-frame prediction unit 126 uses the MV of each sub-block corresponding to the predicted MV to be updated as an affine MV, and calculates it using the above-mentioned formula (1A) or formula (1B) (step Sj_3). Then, the inter-frame prediction unit 126 uses these affine MVs and the encoded reference picture to perform motion compensation on each sub-block (step Sj_4). Whenever the predicted MV is updated in step Sj_2, the processing of steps Sj_3 and Sj_4 is performed on all blocks in the current block. As a result, in the motion search loop, the inter-frame prediction unit 126 determines, for example, the predicted MV that can obtain the minimum cost as the MV of the control point (step Sj_5). At this time, the inter-frame prediction unit 126 also encodes the difference value between the determined MV and the predicted MV as a differential MV into the stream. That is, the inter prediction unit 126 outputs the difference MV as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130 .

[0552] Finally, the inter-frame prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the determined MV and the encoded reference picture (step Sj_6).

[0553] In addition, in step Sj_1, the candidate MV list mentioned above may also be generated. The candidate MV list may also be a list including candidate MVs derived using multiple MV derivation methods for each control point. Multiple MV derivation methods may be Figures 47A to 47C The MV export method shown in Fig.48A and Fig.48B The MV export method shown in Fig.49A and Fig.49B The MV derivation method shown and any combination of other MV derivation methods.

[0554] In addition, the candidate MV list may include candidate MVs of a mode other than the affine mode for performing prediction in sub-block units.

[0555] In addition, as a candidate MV list, a candidate MV list including candidate MVs of an affine inter mode with 2 control points and candidate MVs of an affine inter mode with 3 control points may be generated. Alternatively, a candidate MV list including candidate MVs of an affine inter mode with 2 control points and a candidate MV list including candidate MVs of an affine inter mode with 3 control points may be generated separately. Alternatively, a candidate MV list including candidate MVs of one of the affine inter mode with 2 control points and the affine inter mode with 3 control points may be generated. The candidate MVs may be, for example, the MVs of the encoded blocks A (left), B (top), C (top right), D (bottom left), and E (top left), or the MVs of valid blocks among these blocks.

[0556] Furthermore, as the predicted MV selection information, an index indicating which candidate MV in the candidate MV list is selected may be sent.

[0557] [MV Export > Triangle Mode]

[0558] In the above example, the inter-frame prediction unit 126 generates a rectangular prediction image for the rectangular current block. However, the inter-frame prediction unit 126 may generate a plurality of prediction images of shapes different from the rectangle for the rectangular current block, and generate a final rectangular prediction image by combining these plurality of prediction images. The shape different from the rectangle may be, for example, a triangle.

[0559] Fig.52A This is a diagram for explaining the generation of predicted images of two triangles.

[0560] The inter-frame prediction unit 126 performs motion compensation on the first partition of the triangle in the current block using the first MV of the first partition, thereby generating a predicted image of the triangle. Similarly, the inter-frame prediction unit 126 performs motion compensation on the second partition of the triangle in the current block using the second MV of the second partition, thereby generating a predicted image of the triangle. Furthermore, the inter-frame prediction unit 126 combines these predicted images to generate a predicted image of the same rectangle as the current block.

[0561] In addition, as the prediction image of the first partition, the first rectangular prediction image corresponding to the current block may be generated using the first MV. In addition, as the prediction image of the second partition, the second rectangular prediction image corresponding to the current block may be generated using the second MV. The prediction image of the current block may be generated by weighted addition of the first prediction image and the second prediction image. In addition, the weighted addition may be performed only on a portion of the boundary between the first partition and the second partition.

[0562] Fig.52B1 is a conceptual diagram showing an example of a first portion of a first partition overlapping a second partition, and a first sample set and a second sample set that can be weighted as part of a correction process. The first portion can be, for example, one-fourth of the width or height of the first partition. In another example, the first portion can have a width corresponding to N samples adjacent to an edge of the first partition. Here, N is an integer greater than zero, for example, N can be an integer of 2. Fig.52B The rectangular partition represents a rectangular portion having a width that is one quarter of the width of the first partition. Here, the first sample set includes samples outside the first portion and samples inside the first portion, and the second sample set includes samples inside the first portion. Fig.52B The central example shows a rectangular partition having a rectangular portion with a height that is one quarter of the height of the first partition. Here, the first sample set includes samples outside the first portion and samples inside the first portion, and the second sample set includes samples inside the first portion. Fig.52B The right example of shows a triangular partition of a polygonal part having a height corresponding to two samples. Here, the first sample set includes samples outside the first part and samples inside the first part, and the second sample set includes samples inside the first part.

[0563] The first portion may be a portion of the first partition that overlaps with an adjacent partition. Fig.52C 1 is a conceptual diagram showing a first portion of a first partition that is a portion of the first partition overlapping a portion of an adjacent partition. In order to simplify the description, a rectangular partition having a portion overlapping a spatially adjacent rectangular partition is shown. Partitions having other shapes such as triangular partitions may be used, and the overlapping portion may also overlap with spatially or temporally adjacent partitions.

[0564] Furthermore, an example in which predicted images are generated for each of two partitions using inter-frame prediction is shown, but a predicted image may be generated for at least one partition using intra-frame prediction.

[0565] Fig.53 This is a flowchart showing an example of the triangle mode.

[0566] In the triangular mode, first, the inter prediction unit 126 divides the current block into the first partition and the second partition (step Sx_1). At this time, the inter prediction unit 126 can encode the partition information related to the division into each partition as a prediction parameter to the stream. That is, the inter prediction unit 126 can output the partition information as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130.

[0567] Next, the inter prediction unit 126 first obtains a plurality of candidate MVs for the current block based on information such as MVs of a plurality of coded blocks temporally or spatially located around the current block (step Sx_2). That is, the inter prediction unit 126 creates a candidate MV list.

[0568] Then, the inter-frame prediction unit 126 selects the candidate MV of the first partition and the candidate MV of the second partition as the first MV and the second MV, respectively, from the plurality of candidate MVs obtained in step Sx_1 (step Sx_3). At this time, the inter-frame prediction unit 126 may also encode the MV selection information for identifying the selected candidate MV as a prediction parameter to the stream. That is, the inter-frame prediction unit 126 may output the MV selection information as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130.

[0569] Next, the inter-frame prediction unit 126 performs motion compensation using the selected first MV and the encoded reference picture, thereby generating a first predicted image (step Sx_4). Similarly, the inter-frame prediction unit 126 performs motion compensation using the selected second MV and the encoded reference picture, thereby generating a second predicted image (step Sx_5).

[0570] Finally, the inter-frame prediction unit 126 performs weighted addition on the first predicted image and the second predicted image to generate a predicted image of the current block (step Sx_6).

[0571] In addition, Fig.52A In the example shown, the first partition and the second partition are each a triangle, but they may also be a trapezoid or may have different shapes. Fig.52A In the example shown, the current block is composed of 2 partitions, but it can also be composed of 3 or more partitions.

[0572] In addition, the first partition and the second partition may overlap. That is, the first partition and the second partition may include the same pixel region. In this case, the predicted image in the first partition and the predicted image in the second partition may be used to generate the predicted image of the current block.

[0573] In addition, although this example shows an example in which predicted images are generated by inter-frame prediction in both of the two partitions, a predicted image may be generated by intra-frame prediction for at least one partition.

[0574] In addition, the candidate MV list used to select the first MV and the candidate MV list used to select the second MV may be different from each other or may be the same candidate MV list.

[0575] In addition, the partition information may include an index indicating a direction of partitioning the current block into at least a plurality of partitions. The MV selection information may also include an index indicating the selected first MV and an index indicating the selected second MV. One index may also indicate a plurality of information. For example, one index summarizing a part or the whole of the partition information and a part or the whole of the MV selection information may also be encoded.

[0576] [MV Export > ATMVP Mode]

[0577] Fig.54 This is a diagram showing an example of the ATMVP mode for deriving MV in sub-block units.

[0578] The ATMVP mode is a mode classified as a merge mode. For example, in the ATMVP mode, a candidate MV of a sub-block unit is registered in a candidate MV list for a normal merge mode.

[0579] Specifically, in the ATMVP mode, first, Fig.54 As shown, in the coded reference picture specified by the MV (MV0) of the block adjacent to the lower left of the current block, a temporal MV reference block corresponding to the current block is determined. Next, for each sub-block in the current block, the MV used when encoding the area corresponding to the sub-block in the temporal MV reference block is determined. The MV determined in this way is included in the candidate MV list as a candidate MV of the sub-block of the current block. When such a candidate MV of each sub-block is selected from the candidate MV list, motion compensation using the candidate MV as the MV of the sub-block is performed on the sub-block. In this way, a predicted image of each sub-block is generated.

[0580] In addition, Fig.54 In the example shown, the block adjacent to the lower left of the current block is used as the surrounding MV reference block, but other blocks may be used. In addition, the size of the sub-block may be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block may also be switched in units such as slices, bricks, or pictures.

[0581] [Sports Search>DMVR]

[0582] Fig.55 It is a diagram showing the relationship between the merge mode and DMVR.

[0583] The inter prediction unit 126 derives the MV of the current block in the merge mode (step S1_1). Next, the inter prediction unit 126 determines whether to perform MV search, that is, motion search (step S1_2). Here, when it is determined that the motion search is not to be performed (No in step S1_2), the inter prediction unit 126 determines the MV derived in step S1_1 as the final MV for the current block (step S1_4). That is, in this case, the MV of the current block is determined in the merge mode.

[0584] On the other hand, when it is determined in step S1_1 that motion search is to be performed (Yes in step S1_2), the inter prediction unit 126 derives the final MV for the current block by searching the surrounding area of ​​the reference picture represented by the MV derived in step S1_1 (step S1_3). That is, in this case, the MV of the current block is determined by DMVR.

[0585] Fig.56 This is a conceptual diagram for explaining an example of DMVR for determining MV.

[0586] First, for example, in merge mode, candidate MVs (L0 and L1) are selected for the current block. Then, according to the candidate MV (L0), reference pixels are determined from the first reference picture (L0) of the coded picture in the L0 list. Similarly, according to the candidate MV (L1), reference pixels are determined from the second reference picture (L1) of the coded picture in the L1 list. The template is generated by taking the average of these reference pixels.

[0587] Next, the template is used to search the surrounding areas of the candidate MVs of the first reference image (L0) and the second reference image (L1), and the MV with the minimum cost is determined as the final MV of the current block. In addition, the cost can also be calculated using, for example, the difference between the pixel values ​​of the template and the pixel values ​​of the search area and the candidate MV values.

[0588] Even if it is not the process described here, any process may be used as long as it is a process that can search the vicinity of the candidate MV and derive the final MV.

[0589] Fig.57 This is a conceptual diagram for explaining another example of DMVR for determining MV. Fig.57 This example is shown with Fig.56 The example of DMVR shown is different in that a template is not generated but the cost is calculated.

[0590] First, the inter prediction unit 126 searches for the reference block periphery included in the reference pictures of the L0 list and the L1 list based on the candidate MV obtained from the candidate MV list, that is, the initial MV. Fig.57As shown, the initial MV corresponding to the reference block of the L0 list is InitMV_L0, and the initial MV corresponding to the reference block of the L1 list is InitMV_L1. In the motion search, the inter-frame prediction unit 126 first sets the search position for the reference picture in the L0 list. The differential vector representing the set search position, specifically, the differential vector from the position represented by the initial MV (i.e., InitMV_L0) to the search position is MVd_L0. Then, the inter-frame prediction unit 126 determines the search position in the reference picture of the L1 list. The search position is represented by the differential vector from the position represented by the initial MV (i.e., InitMV_L1) to the search position. Specifically, the inter-frame prediction unit 126 determines the differential vector as MVd_L1 by mirroring MVd_L0. That is, the inter-frame prediction unit 126 sets the position that is symmetrical to the position represented by the initial MV in the reference pictures of the L0 list and the L1 list as the search position. The inter prediction section 126 calculates the sum of absolute differences (SAD) or the like of pixel values ​​within the block of the search position as a cost for each search position, and finds a search position that minimizes the cost.

[0591] Fig.58A is a diagram showing an example of motion search in DMVR. Fig.58B : is a flowchart showing an example of the motion search.

[0592] First, in Step 1, the inter-frame prediction unit 126 calculates the cost of the search position (also called the starting point) represented by the initial MV and the eight search positions located around it. In addition, the inter-frame prediction unit 126 determines whether the cost of the search position other than the starting point is the minimum. Here, when it is determined that the cost of the search position other than the starting point is the minimum, the inter-frame prediction unit 126 moves to the search position with the minimum cost and performs the process of Step 2. On the other hand, if the cost of the starting point is the minimum, the inter-frame prediction unit 126 skips the process of Step 2 and performs the process of Step 3.

[0593] In Step 2, the inter-frame prediction unit 126 uses the search position moved according to the processing result of Step 1 as a new starting point and performs the same search as the processing of Step 1. In addition, the inter-frame prediction unit 126 determines whether the cost of the search position other than the starting point is the smallest. Here, if the cost of the search position other than the starting point is the smallest, the inter-frame prediction unit 126 performs the processing of Step 4. On the other hand, if the cost of the starting point is the smallest, the inter-frame prediction unit 126 performs the processing of Step 3.

[0594] In Step 4, the inter prediction unit 126 treats the search position of the starting point as the final search position, and determines the difference between the position indicated by the initial MV and the final search position as a difference vector.

[0595] In Step 3, the inter-frame prediction unit 126 determines the pixel position with the minimum cost based on the costs at the four points located above, below, left, and right of the starting point of Step 1 or Step 2, and sets the pixel position as the final search position. The pixel position with the minimum cost is determined by weighted addition of the vectors ((0, 1), (0, -1), (-1, 0), (1, 0)) located at the four points above, below, left, and right using the costs of the search positions of the four points as weights. Then, the inter-frame prediction unit 126 determines the difference between the position represented by the initial MV and the final search position as a difference vector.

[0596] [Motion compensation>BIO / OBMC / LIC]

[0597] In motion compensation, there are modes for generating a predicted image and correcting the predicted image. Examples of such modes are BIO, OBMC, and LIC, which will be described later.

[0598] Fig.59 This is a flowchart showing an example of generating a predicted image.

[0599] The inter prediction unit 126 generates a predicted image (step Sm_1 ), and corrects the predicted image using any of the above-mentioned modes (step Sm_2 ).

[0600] Fig.60 This is a flowchart showing another example of generating a predicted image.

[0601] The inter-frame prediction unit 126 derives the MV of the current block (step Sn_1). Next, the inter-frame prediction unit 126 generates a predicted image using the MV (step Sn_2), and determines whether to perform correction processing (step Sn_3). Here, when it is determined that the correction processing is to be performed (yes in step Sn_3), the inter-frame prediction unit 126 generates a final predicted image by correcting the predicted image (step Sn_4). In addition, in the LIC described later, brightness and color difference can also be corrected in step Sn_4. On the other hand, when it is determined that the correction processing is not to be performed (no in step Sn_3), the inter-frame prediction unit 126 outputs the predicted image as the final predicted image without correcting the predicted image (step Sn_5).

[0602] [Motion Compensation > OBMC]

[0603] Not only the motion information of the current block obtained by motion search, but also the motion information of the adjacent blocks can be used to generate an inter-frame prediction image. Specifically, the inter-frame prediction image can also be generated in sub-block units within the current block by weighted addition of the prediction image based on the motion information obtained by motion search (within the reference picture) and the prediction image based on the motion information of the adjacent blocks (within the current picture). Such inter-frame prediction (motion compensation) is sometimes called OBMC (overlapped block motion compensation) or OBMC mode.

[0604] In the OBMC mode, information indicating the size of the sub-block used for OBMC (e.g., OBMC block size) may also be signaled at the sequence level. Furthermore, information indicating whether the OBMC mode is applied (e.g., OBMC flag) may also be signaled at the CU level. In addition, the signaling level of such information need not be limited to the sequence level and the CU level, but may be other levels (e.g., picture level, slice level, brick level, CTU level, or sub-block level).

[0605] The OBMC mode will be described in more detail. Fig.61 and Fig.62 It is a flowchart and a conceptual diagram for explaining the outline of the predicted image correction process based on OBMC.

[0606] First, if Fig.62 As shown, the MV assigned to the current block is used to obtain a predicted image (Pred) based on conventional motion compensation. Fig.62 In FIG. 1 , the arrow “MV” points to the reference picture and indicates which block the current block of the current picture refers to to obtain a predicted image.

[0607] Next, the MV (MV_L) derived for the coded left adjacent block is applied (reused) to the current block to obtain a predicted image (Pred_L). The MV (MV_L) is represented by an arrow "MV_L" pointing from the current block to the reference picture. Then, the first correction of the predicted image is performed by overlapping the two predicted images Pred and Pred_L. This has the effect of blending the boundaries between adjacent blocks.

[0608] Similarly, the MV (MV_U) derived for the encoded upper adjacent block is applied (reused) to the current block to obtain a predicted image (Pred_U). The MV (MV_U) is represented by an arrow "MV_U" pointing from the current block to the reference picture. Then, the second correction of the predicted image is performed by superimposing the predicted image Pred_U with the predicted image (e.g., Pred and Pred_L) that has been corrected the first time. This has the effect of blending the boundaries between adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block with the boundaries with the adjacent blocks blended (smoothed).

[0609] In addition, the above example is a two-path correction method using left-adjacent and upper-adjacent blocks, but the correction method may also be a three-path correction method or more than three-path correction method using right-adjacent and / or lower-adjacent blocks.

[0610] Furthermore, the region to be overlapped may not be the pixel region of the entire block, but may be only a partial region near the block boundary.

[0611] In addition, the prediction image correction processing of OBMC is described here, which is used to obtain one prediction image Pred by superimposing one reference image with the additional prediction images Pred_L and Pred_U. However, in the case of correcting the prediction image based on multiple reference images, the same processing can be applied to each of the multiple reference images. In this case, after the corrected prediction images are obtained from each reference image by performing image correction of OBMC based on multiple reference images, the final prediction image is obtained by further superimposing the obtained multiple corrected prediction images.

[0612] In addition, in OBMC, the unit of the current block may be a PU unit or a sub-block unit obtained by further dividing the PU.

[0613] As a method for determining whether to apply OBMC, there is a method of using obmc_flag, a signal indicating whether to apply OBMC. As a specific example, the encoding device 100 may also determine whether the current block belongs to a region with complex motion. When the current block belongs to a region with complex motion, the encoding device 100 sets the value of obmc_flag to 1 and applies OBMC for encoding. When the current block does not belong to a region with complex motion, the encoding device 100 sets the value of obmc_flag to 0 and does not apply OBMC for encoding the block. On the other hand, in the decoding device 200, obmc_flag described in the stream is decoded, and whether to apply OBMC for decoding is switched according to the value.

[0614] [Motion compensation>BIO]

[0615] Next, the method of deriving MV is described. First, a mode for deriving MV based on a model assuming uniform linear motion is described. This mode is sometimes called a BIO (bi-directional optical flow) mode. In addition, the bi-directional optical flow can also be expressed as BDOF instead of BIO.

[0616] Fig.63 This is a diagram for explaining a model that assumes uniform linear motion. Fig.63 In (v x , v y ) represents the velocity vector, τ0 and τ1 represent the temporal distance between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1), respectively. (MVx0, MVy0) represents the MV corresponding to the reference picture Ref0, and (MVx1, MVy1) represents the MV corresponding to the reference picture Ref1.

[0617] At this time, the velocity vector (v x , v y ) is assumed to be a uniform linear motion, (MVx0, MVy0) and (MVx1, MVy1) are expressed as (vxτ0, vyτ0) and (-vxτ1, -vyτ1) respectively, and the following optical flow equation (2) holds.

[0618]

Formula 3

[0619]

[0620] Here, I(k) represents the brightness value of the reference image k (k=0, 1) after motion compensation. The optical flow equation indicates that the sum of (i) the temporal differential of the brightness value, (ii) the product of the horizontal velocity and the horizontal component of the spatial gradient of the reference image, and (iii) the product of the vertical velocity and the vertical component of the spatial gradient of the reference image is equal to zero. Alternatively, the motion vector of the block unit obtained from the candidate MV list or the like may be corrected in pixel units based on a combination of the optical flow equation and Hermite interpolation.

[0621] Alternatively, the decoding device 200 may derive an MV by a method different from the derivation of a motion vector based on a model assuming uniform linear motion. For example, a motion vector may be derived in sub-block units based on MVs of a plurality of adjacent blocks.

[0622] Fig.64 This is a flowchart showing an example of inter-frame prediction according to BIO. Fig.652 is a diagram showing an example of the functional structure of the inter-frame prediction unit 126 that performs the inter-frame prediction according to the BIO.

[0623] like Fig.65 As shown, the inter prediction unit 126 includes, for example, a memory 126a, an interpolation image derivation unit 126b, a gradient image derivation unit 126c, an optical flow derivation unit 126d, a correction value derivation unit 126e, and a predicted image correction unit 126f.

[0624] The inter prediction unit 126 uses two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) containing the current block to derive two motion vectors (M0, M1). Then, the inter prediction unit 126 uses the two motion vectors (M0, M1) to derive a predicted image of the current block (step Sy_1). In addition, the motion vector M0 is a motion vector (MVx0, MVy0) corresponding to the reference picture Ref0, and the motion vector M1 is a motion vector (MVx1, MVy1) corresponding to the reference picture Ref1.

[0625] Next, the interpolation image deriving unit 126b refers to the memory 126a and derives the interpolation image I of the current block using the motion vector M0 and the reference picture L0. 0 In addition, the interpolation image deriving unit 126b refers to the memory 126a and uses the motion vector M1 and the reference picture L1 to derive the interpolation image I of the current block. 1 (Step Sy_2). Here, the interpolated image I 0 is the image contained in the reference picture Ref0 derived for the current block, the interpolated image I 1 It is an image included in the reference picture Ref1 derived for the current block. 0 and interpolated image I 1 Alternatively, in order to properly derive the gradient image described later, the interpolated image I 0 And the interpolated image I 1 can be images larger than the current block. 0 and I 1 It may include a predicted image derived by applying a motion vector (M0, M1) and a reference picture (L0, L1), and a motion compensation filter.

[0626] In addition, the gradient image deriving unit 126c generates the interpolated image I 0 And the interpolated image I 1 , export the gradient image of the current block (Ix 0 , Ix 1 , Iy 0 , Iy 1)(Step Sy_3). In addition, the gradient image in the horizontal direction is (Ix 0 , Ix 1 ), the vertical gradient image is (Iy 0 , Iy 1 ). The gradient image deriving unit 126c may derive the gradient image by, for example, applying a gradient filter to the interpolation image. The gradient image only needs to represent the spatial variation of the pixel value along the horizontal direction or the vertical direction.

[0627] Next, the optical flow derivation unit 126d uses the interpolated image (I 0 ,I 1 ) and the gradient image (Ix 0 , Ix 1 , Iy 0 , Iy 1 ) is used to derive the optical flow (vx, vy) as the velocity vector (step Sy_4). The optical flow is a coefficient that corrects the spatial movement of a pixel, and may also be referred to as a local motion estimation value, a corrected motion vector, or a corrected weight vector. As an example, a sub-block may be a sub-CU of 4x4 pixels. In addition, the optical flow may be derived not in sub-block units but in other units such as pixel units.

[0628] Next, the inter-frame prediction unit 126 uses the optical flow (vx, vy) to correct the predicted image of the current block. For example, the correction value deriving unit 126e uses the optical flow (vx, vy) to derive the correction value of the value of the pixel included in the current block (step Sy_5). Furthermore, the predicted image correction unit 126f may also use the correction value to correct the predicted image of the current block (step Sy_6). In addition, the correction value may be derived in units of each pixel, or in units of multiple pixels or sub-blocks.

[0629] In addition, the BIO process is not limited to Fig.64 The disclosed processing. Fig.64 A part of the disclosed processing may be added to or replaced with a different processing, or may be executed in a different processing order.

[0630] [Motion Compensation > LIC]

[0631] Next, an example of a mode for generating a predicted image (prediction) using LIC (local illumination compensation) will be described.

[0632] Fig.66A : is a diagram for explaining an example of a method for generating a predicted image using brightness correction processing based on LIC. Fig.66BThis is a flowchart showing an example of a method for generating a predicted image using the LIC.

[0633] First, the inter prediction unit 126 derives an MV from an already encoded reference picture, and obtains a reference picture corresponding to the current block (step Sz_1 ).

[0634] Next, the inter-frame prediction unit 126 extracts information indicating how the brightness value changes in the reference picture and the current picture for the current block (step Sz_2). This extraction is based on the brightness pixel values ​​of the encoded left adjacent reference area (peripheral reference area) and the encoded upper adjacent reference area (peripheral reference area) in the current picture, and the brightness pixel values ​​at the same position in the reference picture specified by the derived MV. Then, the inter-frame prediction unit 126 calculates the brightness correction parameter using the information indicating how the brightness value changes (step Sz_3).

[0635] The inter-frame prediction unit 126 applies the brightness correction parameter to the reference image in the reference picture specified by the MV to perform brightness correction processing, and generates a predicted image for the current block (step Sz_4). That is, the predicted image, which is the reference image in the reference picture specified by the MV, is corrected based on the brightness correction parameter. In this correction, the brightness can be corrected, and the color difference can also be corrected. That is, the correction parameter of the color difference can be calculated using information indicating how the color difference changes, and the color difference correction processing can be performed.

[0636] in addition, Fig.66A The shape of the peripheral reference area in is just an example, and shapes other than this may also be used.

[0637] In addition, the process of generating a predicted image based on one reference picture is described here, but the same is true when generating a predicted image based on multiple reference pictures. The predicted image can also be generated after brightness correction processing is performed on the reference images obtained from each reference picture in the same way as described above.

[0638] As a method for determining whether to apply LIC, for example, there is a method using lic_flag, which is a signal indicating whether to apply LIC. As a specific example, in the encoding device 100, it is determined whether the current block belongs to an area where brightness changes, and if it belongs to an area where brightness changes, a value of 1 is set as lic_flag, and LIC is applied for encoding. If it does not belong to an area where brightness changes, a value of 0 is set as lic_flag, and LIC is not applied for encoding. On the other hand, in the decoding device 200, by decoding lic_flag described in the stream, whether to apply LIC can be switched according to the value thereof for decoding.

[0639] As another method for determining whether to apply LIC, there is a method of determining whether LIC is applied to the surrounding blocks. As a specific example, when the current block is processed in the merge mode, the inter-frame prediction unit 126 determines whether the surrounding coded blocks selected when deriving the MV in the merge mode are coded using LIC. The inter-frame prediction unit 126 switches whether to apply LIC and perform coding based on the result. In addition, in the case of this example, the same processing is also applied to the decoding device 200 side.

[0640] use Fig.66A and Fig.66B LIC (luminance correction processing) has been described above, and its details will be described below.

[0641] First, the inter prediction unit 126 derives an MV for acquiring a reference image corresponding to the current block from a reference picture that is an encoded picture.

[0642] Next, the inter-frame prediction unit 126 uses the brightness pixel values ​​of the coded surrounding reference areas adjacent to the left and above and the brightness pixel values ​​at the same position in the reference picture specified by the MV to extract information indicating how the brightness values ​​change in the reference picture and the current picture, and calculates the brightness correction parameter. For example, the brightness pixel value of a pixel in the surrounding reference area in the current picture is set to p0, and the brightness pixel value of the pixel in the surrounding reference area in the reference picture at the same position as the pixel is set to p1. The inter-frame prediction unit 126 calculates the coefficients A and B for optimizing A×p1+B=p0 as brightness correction parameters for multiple pixels in the surrounding reference area.

[0643] Next, the inter-frame prediction unit 126 generates a predicted image for the current block by performing a brightness correction process on the reference image in the reference picture specified by the MV using the brightness correction parameter. For example, the brightness pixel value in the reference image is set to p2, and the brightness pixel value of the predicted image after the brightness correction process is set to p3. The inter-frame prediction unit 126 generates a predicted image after the brightness correction process by calculating A×p2+B=p3 for each pixel in the reference image.

[0644] In addition, you can also use Fig.66A For example, a region including a predetermined number of pixels thinned out from the upper adjacent pixels and the left adjacent pixels may be used as the surrounding reference region. In addition, the surrounding reference region is not limited to the region adjacent to the current block, and may also be a region not adjacent to the current block. Fig.66AIn the example shown, the peripheral reference area in the reference picture is an area specified by the MV of the current picture from among the peripheral reference areas in the current picture, but it may also be an area specified by another MV. For example, the other MV may also be the MV of the peripheral reference area in the current picture.

[0645] In addition, although the operation in the encoding device 100 is described here, the operation in the decoding device 200 is also the same.

[0646] Furthermore, LIC is applied not only to brightness but also to color difference. In this case, correction parameters may be derived separately for each of Y, Cb, and Cr, or common correction parameters may be used for any of them.

[0647] Furthermore, LIC may be applied in sub-block units. For example, the modification parameters may be derived using the surrounding reference area of ​​the current sub-block and the surrounding reference area of ​​the reference sub-block in the reference picture specified by the MV of the current sub-block.

[0648] [Prediction Control Department]

[0649] The prediction control unit 128 selects one of the intra-frame prediction image (pixels or signals output from the intra-frame prediction unit 124) and the inter-frame prediction image (pixels or signals output from the inter-frame prediction unit 126), and outputs the selected prediction image to the subtraction unit 104 and the addition unit 116.

[0650] [Prediction parameter generation unit]

[0651] The prediction parameter generation unit 130 may output information related to the selection of the prediction image in the intra prediction, inter prediction, and prediction control unit 128 as prediction parameters to the entropy coding unit 110. The entropy coding unit 110 may generate a stream based on the prediction parameters input from the prediction parameter generation unit 130 and the quantization coefficients input from the quantization unit 108. The prediction parameters may also be used in the decoding device 200. The decoding device 200 may also receive and decode the stream and perform the same process as the prediction process performed in the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. The prediction parameters may include a selection prediction signal (e.g., MV, prediction type, or prediction mode used by the intra prediction unit 124 or the inter prediction unit 126), or any index, flag, or value based on the prediction process performed in the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 or indicating the prediction process.

[0652] [Decoding device]

[0653] Next, a decoding device 200 that can decode the stream output from the above-described encoding device 100 will be described. Fig.672 is a block diagram showing an example of the functional configuration of the decoding device 200 according to the embodiment. The decoding device 200 is a device that decodes a coded image, that is, a stream, in units of blocks.

[0654] like Fig.67 As shown, the decoding device 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transformation unit 206, an addition unit 208, a block memory 210, a loop filter unit 212, a frame memory 214, an intra prediction unit 216, an inter prediction unit 218, a prediction control unit 220, a prediction parameter generation unit 222, and a partition determination unit 224. In addition, the intra prediction unit 216 and the inter prediction unit 218 are each configured as a part of the prediction processing unit.

[0655] [Decoding device installation example]

[0656] Fig.68 2 is a block diagram showing an implementation example of the decoding device 200. The decoding device 200 includes a processor b1 and a memory b2. Fig.67 The multiple components of the decoding device 200 shown are Fig.68 The processor b1 and the memory b2 shown are installed and implemented.

[0657] Processor b1 is a circuit that performs information processing and is a circuit that can access memory b2. For example, processor b1 is a dedicated or general electronic circuit that decodes a stream. Processor b1 can also be a processor such as a CPU. In addition, processor b1 can also be a collection of multiple electronic circuits. In addition, for example, processor b1 can also play a role in Fig.67 The functions of the multiple components of the decoding device 200 other than the components for storing information are described above.

[0658] The memory b2 is a dedicated or general memory for storing information used by the processor b1 to decode the stream. The memory b2 may be an electronic circuit or connected to the processor b1. In addition, the memory b2 may be included in the processor b1. In addition, the memory b2 may be a collection of multiple electronic circuits. In addition, the memory b2 may be a magnetic disk or an optical disk, or may be a storage device or a recording medium. In addition, the memory b2 may be a non-volatile memory or a volatile memory.

[0659] For example, the memory b2 can store images or streams. In addition, the memory b2 can also store a program for the processor b1 to decode the stream.

[0660] In addition, for example, memory b2 can also serve Fig.67The memory b2 can be used as a component for storing information among the multiple components of the decoding device 200 shown in FIG. Fig.67 The functions of the block memory 210 and the frame memory 214 are shown. More specifically, the memory b2 can store reconstructed images (specifically, reconstructed blocks or reconstructed pictures, etc.).

[0661] In addition, in the decoding device 200, it is not necessary to install Fig.67 All of the multiple constituent elements shown above may not perform all of the multiple processes described above. Fig.67 Part of the plurality of components shown in the figure may be included in other devices, and part of the plurality of processes described above may be executed by other devices.

[0662] Hereinafter, after describing the overall processing flow of the decoding device 200, each component included in the decoding device 200 will be described. In addition, among the components included in the decoding device 200, a detailed description of the components that perform the same processing as the components included in the encoding device 100 will be omitted. For example, the inverse quantization unit 204, the inverse transformation unit 206, the addition unit 208, the block memory 210, the frame memory 214, the intra-frame prediction unit 216, the inter-frame prediction unit 218, the prediction control unit 220, and the loop filter unit 212 included in the decoding device 200 perform the same processing as the inverse quantization unit 112, the inverse transformation unit 114, the addition unit 116, the block memory 118, the frame memory 122, the intra-frame prediction unit 124, the inter-frame prediction unit 126, the prediction control unit 128, and the loop filter unit 120 included in the encoding device 100, respectively.

[0663] [Overall flow of decoding processing]

[0664] Fig.69 This is a flowchart showing an example of the overall decoding process performed by the decoding device 200.

[0665] First, the partition determination unit 224 of the decoding device 200 determines the partition pattern of each of the plurality of fixed-size blocks (128×128 pixels) included in the picture based on the parameters input from the entropy decoding unit 202 (step Sp_1). The partition pattern is the partition pattern selected by the encoding device 100. Then, the decoding device 200 performs the processing of steps Sp_2 to Sp_6 on each of the plurality of blocks constituting the partition pattern.

[0666] The entropy decoding unit 202 decodes (specifically, entropy decodes) the encoded quantization coefficients and prediction parameters of the current block (step Sp_2).

[0667] Next, the inverse quantization unit 204 and the inverse transformation unit 206 restore the prediction residual of the current block by inverse quantizing and inverse transforming the plurality of quantized coefficients (step Sp_3).

[0668] Next, the prediction processing unit composed of the intra prediction unit 216, the inter prediction unit 218 and the prediction control unit 220 generates a predicted image of the current block (step Sp_4).

[0669] Next, the adding unit 208 reconstructs the current block into a reconstructed image (also referred to as a decoded image block) by adding the predicted image to the prediction residual (step Sp_5).

[0670] Then, when generating the reconstructed image, the loop filter unit 212 filters the reconstructed image (step Sp_6).

[0671] Then, the decoding device 200 determines whether the decoding of the entire picture has been completed (step Sp_7 ), and when it is determined that the decoding has not been completed (No in step Sp_7 ), the processing from step Sp_1 is repeatedly executed.

[0672] Furthermore, the processing of steps Sp_1 to Sp_7 may be performed sequentially by the decoding device 200, and a plurality of processing of some of these processing may be performed in parallel or in a different order.

[0673] [Division Decision Section]

[0674] Fig.70 2 is a diagram showing the relationship between the division determination unit 224 and other components. As an example, the division determination unit 224 may perform the following processing.

[0675] The partition decision unit 224 collects block information from, for example, the block memory 210 or the frame memory 214, and further obtains parameters from the entropy decoding unit 202. Moreover, the partition decision unit 224 can determine the partition pattern of the fixed-size block based on the block information and the parameters. Furthermore, the partition decision unit 224 can also output information indicating the determined partition pattern to the inverse transform unit 206, the intra-frame prediction unit 216, and the inter-frame prediction unit 218. The inverse transform unit 206 can also perform inverse transformation on the transform coefficient based on the partition pattern indicated by the information from the partition decision unit 224. The intra-frame prediction unit 216 and the inter-frame prediction unit 218 can generate a predicted image based on the partition pattern indicated by the information from the partition decision unit 224.

[0676] [Entropy decoding unit]

[0677] Fig.71 It is a block diagram showing an example of the functional structure of the entropy decoding unit 202.

[0678] The entropy decoding unit 202 generates quantization coefficients, prediction parameters, and parameters related to the segmentation pattern by entropy decoding the stream. CABAC is used, for example, in the entropy decoding. Specifically, the entropy decoding unit 202 includes, for example, a binary arithmetic decoding unit 202a, a context control unit 202b, and a multi-valued unit 202c. The binary arithmetic decoding unit 202a uses the context value derived by the context control unit 202b to perform arithmetic decoding on the stream as a binary signal. Similar to the context control unit 110b of the encoding device 100, the context control unit 202b derives the context value corresponding to the characteristics of the syntactic element or the surrounding conditions, that is, the probability of occurrence of the binary signal. The multi-valued unit 202c performs a multi-valued conversion (debinarization) of the binary signal output from the binary arithmetic decoding unit 202a into a multi-valued signal representing the above-mentioned quantization coefficient, etc. The multi-valued conversion is performed in the manner of the above-mentioned binarization.

[0679] The entropy decoding unit 202 outputs the quantized coefficients in units of blocks to the inverse quantization unit 204. The entropy decoding unit 202 may output the stream to the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 (see Figure 1 The intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 can perform the same prediction processing as that performed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 on the encoding device 100 side.

[0680] [Entropy decoding unit]

[0681] Fig.72 3 is a diagram showing the flow of CABAC in the entropy decoding unit 202.

[0682] First, in the CABAC in the entropy decoding unit 202, initialization is performed. In this initialization, initialization and setting of the initial context value in the binary arithmetic decoding unit 202c are performed. Then, the binary arithmetic decoding unit 202c and the multi-valued unit 202c perform arithmetic decoding and multi-valued conversion on the coded data of the CTU, for example. At this time, the context control unit 202b updates the context value each time arithmetic decoding is performed. Then, the context control unit 202b backs off the context value as post-processing. The backed-off context value is used, for example, as the initial value of the context value for the next CTU.

[0683] [Inverse Quantization Unit]

[0684] The inverse quantization unit 204 inversely quantizes the quantized coefficients of the current block as input from the entropy decoding unit 202. Specifically, the inverse quantization unit 204 inversely quantizes the quantized coefficients of the current block based on the quantization parameters corresponding to the quantized coefficients. The inverse quantization unit 204 outputs the inversely quantized quantized coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.

[0685] Fig.73 This is a block diagram showing an example of the functional configuration of the inverse quantization unit 204 .

[0686] The inverse quantization unit 204 includes, for example, a quantization parameter generation unit 204 a , a predicted quantization parameter generation unit 204 b , a quantization parameter storage unit 204 d , and an inverse quantization processing unit 204 e .

[0687] Fig.74 2 is a flowchart showing an example of inverse quantization performed by the inverse quantization unit 204 .

[0688] As an example, the inverse quantization unit 204 may be based on Fig.74 In the process shown, inverse quantization is performed for each CU. Specifically, the quantization parameter generation unit 204a determines whether to perform inverse quantization (step Sv_11). Here, when it is determined that inverse quantization is to be performed (yes in step Sv_11), the quantization parameter generation unit 204a obtains the differential quantization parameter of the current block from the entropy decoding unit 202 (step Sv_12).

[0689] Next, the predicted quantization parameter generator 204b obtains a quantization parameter of a processing unit different from the current block from the quantization parameter storage unit 204d (step Sv_13). The predicted quantization parameter generator 204b generates a predicted quantization parameter of the current block based on the obtained quantization parameter (step Sv_14).

[0690] Then, the quantization parameter generator 204a adds the differential quantization parameter of the current block obtained from the entropy decoding unit 202 and the predicted quantization parameter of the current block generated by the predicted quantization parameter generator 204b (step Sv_15). By this addition, the quantization parameter of the current block is generated. In addition, the quantization parameter generator 204a stores the quantization parameter of the current block in the quantization parameter storage unit 204d (step Sv_16).

[0691] Next, the inverse quantization processing unit 204e inversely quantizes the quantized coefficients of the current block into transform coefficients using the quantization parameters generated in step Sv_15 (step Sv_17).

[0692] In addition, the differential quantization parameter may also be decoded at a bit sequence level, a picture level, a slice level, a brick level, or a CTU level. In addition, the initial value of the quantization parameter may also be decoded at a sequence level, a picture level, a slice level, a brick level, or a CTU level. At this time, the quantization parameter may be generated using the initial value of the quantization parameter and the differential quantization parameter.

[0693] Furthermore, the inverse quantization unit 204 may include a plurality of inverse quantizers, and may inverse quantize the quantized coefficients using an inverse quantization method selected from a plurality of inverse quantization methods.

[0694] [Inverse transformation unit]

[0695] The inverse transform unit 206 restores the prediction residual by inversely transforming the transform coefficients input from the inverse quantization unit 204 .

[0696] For example, when the information read from the stream indicates that EMT or AMT is applied (for example, the AMT flag is true), the inverse transform unit 206 performs an inverse transform on the transform coefficients of the current block based on the read information indicating the transform type.

[0697] Furthermore, for example, when the information decoded from the stream indicates that NSST is applied, the inverse transform unit 206 applies an inverse re-transform to the transform coefficients.

[0698] Fig.75 This is a flowchart showing an example of processing performed by the inverse transformation unit 206.

[0699] For example, the inverse transform unit 206 determines whether there is information indicating that orthogonal transform is not performed in the stream (step St_11). Here, when it is determined that the information does not exist (No in step St_11), the inverse transform unit 206 obtains information indicating the transform type decoded by the entropy decoding unit 202 (step St_12). Next, the inverse transform unit 206 determines the transform type used in the orthogonal transform of the encoding device 100 based on the information (step St_13). And, the inverse transform unit 206 performs inverse orthogonal transform using the determined transform type (step St_14).

[0700] Fig.76 This is a flowchart showing another example of the processing performed by the inverse transformation unit 206.

[0701] For example, the inverse transform unit 206 determines whether the transform size is less than or equal to a predetermined value (step Su_11). Here, when it is determined that the transform size is less than or equal to the predetermined value (yes in step Su_11), the inverse transform unit 206 obtains information indicating which transform type among the one or more transform types included in the first transform type group is used by the encoding device 100 from the entropy decoding unit 202 (step Su_12). In addition, such information is decoded by the entropy decoding unit 202 and output to the inverse transform unit 206.

[0702] Based on this information, the inverse transform unit 206 determines the transform type used in the orthogonal transform in the encoding device 100 (step Su_13). Then, the inverse transform unit 206 performs an inverse orthogonal transform on the transform coefficients of the current block using the determined transform type (step Su_14). On the other hand, when it is determined in step Su_11 that the transform size is not less than the specified value (No in step Su_11), the inverse transform unit 206 performs an inverse orthogonal transform on the transform coefficients of the current block using the second transform type group (step Su_15).

[0703] In addition, as an example, the inverse orthogonal transform performed by the inverse transform unit 206 may be performed according to each TU. Fig.75 or Fig.76 In addition, the information indicating the transform type used in the orthogonal transform may not be decoded, but the inverse orthogonal transform may be performed using a predetermined transform type. Specifically, the transform type is DST7 or DCT8, etc., and in the inverse orthogonal transform, an inverse transform basis function corresponding to the transform type is used.

[0704] [Addition Department]

[0705] The adding unit 208 reconstructs the current block by adding the prediction residual as input from the inverse transform unit 206 and the prediction image as input from the prediction control unit 220. That is, the reconstructed image of the current block is generated. Then, the adding unit 208 outputs the reconstructed image of the current block to the block memory 210 and the loop filter unit 212.

[0706] [Block Memory]

[0707] The block memory 210 is a storage unit for storing blocks in the current picture to be referenced in intra prediction. Specifically, the block memory 210 stores the reconstructed image output from the adder 208 .

[0708] [Loop filter section]

[0709] The loop filter unit 212 performs loop filtering on the reconstructed image generated by the adder 208 , and outputs the filtered reconstructed image to the frame memory 214 , a display device, and the like.

[0710] When the information indicating the on / off of the ALF read from the stream indicates that the ALF is on, one filter is selected from a plurality of filters based on the direction and activity of the local gradient, and the selected filter is applied to the reconstructed image.

[0711] Fig.77 2 is a block diagram showing an example of a functional configuration of the loop filter unit 212. The loop filter unit 212 has the same configuration as the loop filter unit 120 of the encoding device 100.

[0712] The loop filter unit 212 is, for example, Fig.77 As shown in FIG. 1 , the loop filter unit 212 includes a deblocking filter processing unit 212a, a SAO processing unit 212b, and an ALF processing unit 212c. The deblocking filter processing unit 212a applies the above-mentioned deblocking filter processing to the reconstructed image. The SAO processing unit 212b applies the above-mentioned SAO processing to the reconstructed image after the deblocking filter processing. In addition, the ALF processing unit 212c applies the above-mentioned ALF processing to the reconstructed image after the SAO processing. In addition, the loop filter unit 212 may not include Fig.77 All the processing units disclosed in the disclosure may also include only a part of the processing units. In addition, the loop filter unit 212 may also be configured in accordance with Fig.77 A structure in which each of the above-mentioned processes is performed in an order different from the processing order disclosed in.

[0713] [Frame Memory]

[0714] The frame memory 214 is a storage unit for storing reference pictures used in inter-frame prediction, and is sometimes referred to as a frame buffer. Specifically, the frame memory 214 stores the reconstructed image filtered by the loop filter unit 212 .

[0715] [Prediction unit (intra-frame prediction unit / inter-frame prediction unit / prediction control unit)]

[0716] Fig.78 2 is a flowchart showing an example of processing performed by the prediction unit of the decoding device 200. In addition, as an example, the prediction unit is composed of all or part of the components of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. The prediction processing unit includes the intra prediction unit 216 and the inter prediction unit 218, for example.

[0717] The prediction unit generates a prediction image of the current block (step Sq_1). The prediction image is also called a prediction signal or a prediction block. In addition, the prediction signal includes, for example, an intra-frame prediction signal or an inter-frame prediction signal. Specifically, the prediction unit generates a prediction image of the current block using a reconstructed image obtained by generating prediction images for other blocks, restoring prediction residuals, and adding prediction images. The prediction unit of the decoding device 200 generates the same prediction image as the prediction image generated by the prediction unit of the encoding device 100. That is, the prediction image generation methods used in these prediction units are common or corresponding to each other.

[0718] The reconstructed image may be, for example, an image of a reference picture or an image including the current block, that is, an image of a decoded block in the current picture (that is, the other blocks mentioned above). The decoded block in the current picture may be, for example, an adjacent block of the current block.

[0719] Fig.79 This is a flowchart showing another example of the processing performed by the prediction unit of the decoding device 200.

[0720] The prediction unit determines a method or mode for generating a prediction image (step Sr1). For example, the method or mode can be determined based on prediction parameters or the like.

[0721] When it is determined that the first mode is a mode for generating a predicted image, the prediction unit generates a predicted image according to the first mode (step Sr_2a). In addition, when it is determined that the second mode is a mode for generating a predicted image, the prediction unit generates a predicted image according to the second mode (step Sr_2b). In addition, when it is determined that the third mode is a mode for generating a predicted image, the prediction unit generates a predicted image according to the third mode (step Sr_2c).

[0722] The first method, the second method, and the third method are different methods for generating a predicted image, and may be, for example, an inter-frame prediction method, an intra-frame prediction method, or other prediction methods. In such a prediction method, the above-mentioned reconstructed image may also be used.

[0723] Fig.80A and Fig.80B This is a flowchart showing another example of the processing performed in the prediction unit of the decoding device 200.

[0724] As an example, the forecasting unit may also Fig.80A and Fig.80B The process shown in the figure is used for prediction processing. Fig.80A and Fig.80BThe intra-frame block copy shown is a mode belonging to inter-frame prediction, and is a mode in which a block included in the current picture is referred to as a reference image or reference block. That is, in the intra-frame block copy, a picture different from the current picture is not referred to. In addition, Fig.80A The PCM mode shown is a mode belonging to intra-frame prediction, and is a mode in which neither transformation nor quantization is performed.

[0725] [Intra-frame prediction unit]

[0726] The intra prediction unit 216 performs intra prediction based on the intra prediction mode read from the stream, and refers to the block in the current picture stored in the block memory 210, thereby generating a predicted image (i.e., intra prediction image) of the current block. Specifically, the intra prediction unit 216 performs intra prediction by referring to the pixel values ​​(e.g., brightness values, color difference values) of the blocks adjacent to the current block, thereby generating an intra prediction image, and outputs the intra prediction image to the prediction control unit 220.

[0727] Furthermore, when an intra prediction mode that refers to a luminance block is selected in intra prediction of a chrominance block, the intra prediction unit 216 may predict the chrominance component of the current block based on the luminance component of the current block.

[0728] Furthermore, when the information read from the stream indicates application of PDPC, the intra prediction unit 216 corrects the pixel value after intra prediction based on the gradient of the reference pixel in the horizontal and vertical directions.

[0729] Fig.81 This is a diagram showing an example of processing performed by the intra prediction unit 216 of the decoding device 200.

[0730] The intra prediction unit 216 first determines whether the MPM flag indicating 1 exists in the stream (step Sw_11). Here, when it is determined that the MPM flag indicating 1 exists (yes in step Sw_11), the intra prediction unit 216 obtains information indicating the intra prediction mode selected in the encoding device 100 in the MPM from the entropy decoding unit 202 (step Sw_12). In addition, the information is decoded by the entropy decoding unit 202 and output to the intra prediction unit 216. Next, the intra prediction unit 216 determines the MPM (step Sw_13). The MPM is composed of, for example, 6 intra prediction modes. Then, the intra prediction unit 216 determines the intra prediction mode indicated by the information obtained in step Sw_12 from the multiple intra prediction modes included in the MPM (step Sw_14).

[0731] On the other hand, when it is determined in step Sw_11 that there is no MPM flag indicating 1 in the stream (No in step Sw_11), the intra prediction unit 216 obtains information indicating the intra prediction mode selected in the encoding device 100 (step Sw_15). That is, the intra prediction unit 216 obtains information indicating the intra prediction mode selected in the encoding device 100 from the entropy decoding unit 202, among one or more intra prediction modes not included in the MPM. In addition, the information is decoded by the entropy decoding unit 202 and output to the intra prediction unit 216. Then, the intra prediction unit 216 determines the intra prediction mode indicated by the information obtained in step Sw_15 from among the one or more intra prediction modes not included in the MPM (step Sw_17).

[0732] The intra prediction unit 216 generates a predicted image according to the intra prediction mode determined in step Sw_14 or step Sw_17 (step Sw_18 ).

[0733] [Inter-frame prediction unit]

[0734] The inter-frame prediction unit 218 predicts the current block with reference to the reference picture stored in the frame memory 214. The prediction is performed in units of the current block or sub-blocks in the current block. In addition, the sub-block is included in the block and is a unit smaller than the block. The size of the sub-block can be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block can also be switched in units such as slices, bricks, or pictures.

[0735] For example, the inter-frame prediction unit 218 uses motion information (e.g., MV) read from the stream (e.g., prediction parameters output from the entropy decoding unit 202) to perform motion compensation, thereby generating an inter-frame prediction image of the current block or sub-block, and outputs the inter-frame prediction image to the prediction control unit 220.

[0736] When the information read from the stream indicates that the OBMC mode is applied, the inter prediction unit 218 generates an inter prediction image using not only the motion information of the current block obtained by the motion search but also the motion information of the neighboring blocks.

[0737] In addition, when the information read from the stream indicates that the FRUC mode is applied, the inter-frame prediction unit 218 performs motion search according to the pattern matching method (bidirectional matching or template matching) read from the stream to derive motion information. In addition, the inter-frame prediction unit 218 performs motion compensation (prediction) using the derived motion information.

[0738] When the BIO mode is applied, the inter prediction unit 218 derives the MV based on a model assuming uniform linear motion. When the information read from the stream indicates that the affine mode is applied, the inter prediction unit 218 derives the MV in sub-block units based on the MVs of a plurality of adjacent blocks.

[0739] [MV export process]

[0740] Fig.82 This is a flowchart showing an example of MV derivation in the decoding device 200.

[0741] The inter-frame prediction unit 218 determines, for example, whether to decode motion information (e.g., MV). For example, the inter-frame prediction unit 218 can determine based on the prediction mode included in the stream, or can determine based on other information included in the stream. Here, when it is determined that the motion information is to be decoded, the inter-frame prediction unit 218 derives the MV of the current block in a mode in which the motion information is decoded. On the other hand, when it is determined that the motion information is not to be decoded, the inter-frame prediction unit 218 derives the MV in a mode in which the motion information is not decoded.

[0742] Here, the modes for deriving MV include the normal inter mode, normal merge mode, FRUC mode, and affine mode described later. Among these modes, the modes for decoding motion information include the normal inter mode, normal merge mode, and affine mode (specifically, affine inter mode and affine merge mode). In addition, motion information may include not only MV but also predicted MV selection information described later. In addition, the modes for not decoding motion information include the FRUC mode, etc. The inter prediction unit 218 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.

[0743] Fig.83 This is a flowchart showing another example of MV derivation in the decoding device 200.

[0744] The inter-frame prediction unit 218 determines whether to decode the differential MV, for example, and the inter-frame prediction unit 218 can determine based on the prediction mode included in the stream, or can determine based on other information included in the stream. Here, when it is determined to decode the differential MV, the inter-frame prediction unit 218 can derive the MV of the current block in a mode of decoding the differential MV. In this case, for example, the differential MV included in the stream is decoded as a prediction parameter.

[0745] On the other hand, when it is determined that the difference MV is not to be decoded, the inter prediction unit 218 derives the MV in a mode in which the difference MV is not to be decoded. In this case, the encoded difference MV is not included in the stream.

[0746] Here, as described above, the MV derivation modes include the normal inter mode, normal merge mode, FRUC mode, and affine mode described later. Among these modes, the modes for encoding the differential MV include the normal inter mode and the affine mode (specifically, the affine inter mode). In addition, the modes for not encoding the differential MV include the FRUC mode, the normal merge mode, and the affine mode (specifically, the affine merge mode). The inter prediction unit 218 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.

[0747] [MV export > Normal interframe mode]

[0748] For example, when the information read from the stream indicates that the normal inter mode is applied, the inter prediction unit 218 derives an MV in the normal merge mode based on the information read from the stream, and performs motion compensation (prediction) using the MV.

[0749] Fig.84 This is a flowchart showing an example of inter prediction performed in the normal inter mode in the decoding device 200 .

[0750] The inter-frame prediction unit 218 of the decoding device 200 performs motion compensation for each block. At this time, the inter-frame prediction unit 218 first obtains multiple candidate MVs for the current block based on information such as MVs of multiple decoded blocks located around the current block in time or space (step Sg_11). In other words, the inter-frame prediction unit 218 creates a candidate MV list.

[0751] Next, the inter-frame prediction unit 218 extracts N (N is an integer greater than or equal to 2) candidate MVs from the plurality of candidate MVs obtained in step Sg_11 as predicted motion vector candidates (also referred to as predicted MV candidates) in a predetermined priority order (step Sg_12). In addition, the priority order may be predetermined for each of the N predicted MV candidates.

[0752] Next, the inter prediction unit 218 decodes the prediction MV selection information from the input stream, and uses the decoded prediction MV selection information to select one prediction MV candidate from the N prediction MV candidates as the prediction MV of the current block (step Sg_13).

[0753] Next, the inter prediction unit 218 decodes the difference MV from the input stream, and derives the MV of the current block by adding the difference value that is the decoded difference MV to the selected prediction MV (step Sg_14).

[0754] Finally, the inter prediction unit 218 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the decoded reference picture (step Sg_15). The processing of steps Sg_11 to Sg_15 is performed on each block. For example, when the processing of steps Sg_11 to Sg_15 is performed on all blocks included in the slice, the inter prediction using the normal inter mode for the slice is completed. In addition, when the processing of steps Sg_11 to Sg_15 is performed on all blocks included in the picture, the inter prediction using the normal inter mode for the picture is completed. In addition, the processing of steps Sg_11 to Sg_15 may be that when it is not performed on all blocks included in the slice but on a part of the blocks, the inter prediction using the normal inter mode for the slice is completed. Similarly, when the processing of steps Sg_11 to Sg_15 is performed on a part of the blocks included in the picture, the inter prediction using the normal inter mode for the picture may also be completed.

[0755] [MV Export > Normal Merge Mode]

[0756] For example, when the information read from the stream indicates application of the normal merge mode, the inter prediction unit 218 derives an MV in the normal merge mode and performs motion compensation (prediction) using the MV.

[0757] Fig.85 : is a flowchart showing an example of inter-frame prediction based on the normal merge mode in the decoding device 200.

[0758] The inter-frame prediction unit 218 first obtains a plurality of candidate MVs for the current block based on information such as MVs of a plurality of decoded blocks temporally or spatially located around the current block (step Sh_11). That is, the inter-frame prediction unit 218 creates a candidate MV list.

[0759] Next, the inter-frame prediction unit 218 selects one candidate MV from the multiple candidate MVs obtained in step Sh_11 to derive the MV of the current block (step Sh_12). Specifically, the inter-frame prediction unit 218 obtains MV selection information included as a prediction parameter in the stream, for example, and selects the candidate MV identified by the MV selection information as the MV of the current block.

[0760] Finally, the inter prediction unit 218 performs motion compensation on the current block by using the derived MV and the decoded reference picture to generate a predicted image of the current block (step Sh_13). The processing of steps Sh_11 to Sh_13 is performed on each block, for example. For example, when the processing of steps Sh_11 to Sh_13 is performed on all blocks included in a slice, the inter prediction using the normal merge mode for the slice ends. In addition, when the processing of steps Sh_11 to Sh_13 is performed on all blocks included in a picture, the inter prediction using the normal merge mode for the picture ends. In addition, the processing of steps Sh_11 to Sh_13 may also be that when it is not performed on all blocks included in a slice but on a part of the blocks, the inter prediction using the normal merge mode for the slice ends. The processing of steps Sh_11 to Sh_13 may also be that when it is performed on a part of the blocks included in a picture, the inter prediction using the normal merge mode for the picture ends.

[0761] [MV export > FRUC mode]

[0762] For example, when the information decoded from the stream indicates the application of the FRUC mode, the inter-frame prediction unit 218 derives an MV in the FRUC mode and uses the MV to perform motion compensation (prediction). In this case, the motion information is not signaled from the encoding device 100 side, but is derived from the decoding device 200 side. For example, the decoding device 200 may also derive the motion information by performing a motion search. In this case, the decoding device 200 does not use the pixel value of the current block to perform the motion search.

[0763] Fig.86 This is a flowchart showing an example of inter-frame prediction based on the FRUC mode in the decoding device 200 .

[0764] First, the inter-frame prediction unit 218 refers to the MVs of each decoded block that is spatially or temporally adjacent to the current block, and generates a list representing these MVs as candidate MVs (that is, a candidate MV list, and it can also be common with the candidate MV list of the normal merge mode) (step Si_11). Next, the inter-frame prediction unit 218 selects the best candidate MV from the multiple candidate MVs registered in the candidate MV list (step Si_12). For example, the inter-frame prediction unit 218 calculates the evaluation value of each candidate MV included in the candidate MV list, and selects one candidate MV as the best candidate MV based on the evaluation value. Then, the inter-frame prediction unit 218 derives the MV for the current block based on the selected best candidate MV (step Si_14). Specifically, for example, the selected best candidate MV is directly derived as the MV for the current block. In addition, for example, the MV for the current block can also be derived by performing style matching in the surrounding area of ​​the position in the reference picture corresponding to the selected best candidate MV. That is, a search is performed using pattern matching and evaluation values ​​in the reference image for the area surrounding the best candidate MV, and if there is an MV with a good evaluation value, the best candidate MV may be updated to that MV and used as the final MV of the current block. The update to the MV with a better evaluation value may not be performed.

[0765] Finally, the inter-frame prediction unit 218 performs motion compensation on the current block by using the derived MV and the decoded reference picture, and generates a predicted image of the current block (step Si_15). The processing of steps Si_11 to Si_15 is performed on each block, for example. For example, when the processing of steps Si_11 to Si_15 is performed on all blocks contained in a slice, the inter-frame prediction using the FRUC mode for the slice is completed. In addition, when the processing of steps Si_11 to Si_15 is performed on all blocks contained in a picture, the inter-frame prediction using the FRUC mode for the picture is completed. It is also possible to perform the processing in sub-block units in the same way as the above-mentioned block units.

[0766] [MV Export > Affine Merge Mode]

[0767] For example, when the information read from the stream indicates application of the affine merge mode, the inter prediction unit 218 derives an MV in the affine merge mode, and performs motion compensation (prediction) using the MV.

[0768] Fig.87 This is a flowchart showing an example of inter-frame prediction based on the affine merge mode in the decoding device 200.

[0769] In the affine merge mode, the inter prediction unit 218 first derives the MV of each control point of the current block (step Sk_11). Fig.46AAs shown, the control points are the upper left and upper right corners of the current block, or Fig.46B As shown, these are the points at the upper left corner, upper right corner, and lower left corner of the current block.

[0770] For example, when using Figures 47A to 47C In the case of the MV derivation method shown, Fig.47A As shown, the inter-frame prediction unit 218 checks the decoded blocks A (left), block B (top), block C (top right), block D (bottom left) and block E (top left) in this order to determine the first valid block decoded in affine mode.

[0771] The inter-frame prediction unit 218 uses the first valid block decoded in the determined affine mode to derive the MV of the control point. For example, when block A is determined and block A has two control points, Fig.47B As shown, the inter-frame prediction unit 218 calculates the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block by projecting the motion vectors v3 and v4 of the upper left corner and the upper right corner of the decoded block including block A onto the current block. Thus, the MV of each control point is derived.

[0772] In addition, if Fig.49A As shown in FIG. 1 , when block A is determined and block A has two control points, the MV of three control points can also be calculated, or as shown in FIG. Fig.49B Block A is determined as shown, and when block A has three control points, the MVs of two control points are calculated.

[0773] Furthermore, when the stream includes MV selection information as a prediction parameter, the inter prediction unit 218 may derive the MV of each control point of the current block using the MV selection information.

[0774] Next, the inter-frame prediction unit 218 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, the inter-frame prediction unit 218 uses two motion vectors v0 and v1 and the above-mentioned formula (1A), or uses three motion vectors v0, v1 and v2 and the above-mentioned formula (1B) for each of the multiple sub-blocks to calculate the MV of the sub-block as an affine MV (step Sk_12). Then, the inter-frame prediction unit 218 uses these affine MVs and the decoded reference picture to perform motion compensation on the sub-block (step Sk_13). When the processing of steps Sk_12 and Sk_13 is performed on all sub-blocks included in the current block, the inter-frame prediction using the affine merge mode for the current block is completed. That is, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0775] In addition, in step Sk_11, the candidate MV list mentioned above may also be generated. The candidate MV list may also be a list including candidate MVs derived using multiple MV derivation methods for each control point. The multiple MV derivation methods may be: Figures 47A to 47C The MV export method shown in Fig.48A and Fig.48B The MV export method shown in Fig.49A and Fig.49B The MV derivation method shown and any combination of other MV derivation methods.

[0776] In addition, the candidate MV list may include candidate MVs of a mode other than the affine mode for performing prediction in sub-block units.

[0777] In addition, as a candidate MV list, for example, a candidate MV list including candidate MVs of an affine merge pattern with 2 control points and a candidate MV list including candidate MVs of an affine merge pattern with 3 control points may be generated. Alternatively, a candidate MV list including candidate MVs of an affine merge pattern with 2 control points and a candidate MV list including candidate MVs of an affine merge pattern with 3 control points may be generated separately. Alternatively, a candidate MV list including candidate MVs of one of the affine merge patterns with 2 control points and the affine merge pattern with 3 control points may be generated.

[0778] [MV Export > Affine Inter Mode]

[0779] For example, when the information read from the stream indicates application of the affine inter mode, the inter prediction unit 218 derives an MV in the affine inter mode, and performs motion compensation (prediction) using the MV.

[0780] Fig.88 : is a flowchart showing an example of inter prediction based on the affine inter mode in the decoding device 200 .

[0781] In the affine inter mode, first, the inter prediction unit 218 derives the predicted MV (v0, v1) or (v0, v1, v2) of each of the two or three control points of the current block (step Sj_11). Fig.46A or Fig.46B As shown, it is the point at the upper left corner, upper right corner or lower left corner of the current block.

[0782] The inter-frame prediction unit 218 obtains the prediction MV selection information included in the stream as a prediction parameter, and uses the MV identified by the prediction MV selection information to derive the prediction MV of each control point of the current block. Fig.48A and Fig.48B In the case of the MV derivation method shown in FIG. 1 , the inter-frame prediction unit 218 selects Fig.48Aor Fig.48B The MV of the block identified by the prediction MV selection information in the decoded blocks near each control point of the current block shown is used to derive the prediction MV (v0, v1) or (v0, v1, v2) of the control point of the current block.

[0783] Next, the inter-frame prediction unit 218 obtains each differential MV included as a prediction parameter in the stream, and adds the predicted MV of each control point of the current block to the differential MV corresponding to the predicted MV (step Sj_12). Thus, the MV of each control point of the current block is derived.

[0784] Next, the inter-frame prediction unit 218 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, the inter-frame prediction unit 218 uses two motion vectors v0 and v1 and the above-mentioned formula (1A), or uses three motion vectors v0, v1 and v2 and the above-mentioned formula (1B) for each of the multiple sub-blocks to calculate the MV of the sub-block as an affine MV (step Sj_13). Then, the inter-frame prediction unit 218 uses these affine MVs and the decoded reference picture to perform motion compensation on the sub-block (step Sj_14). When the processing of steps Sj_13 and Sj_14 is performed on all sub-blocks included in the current block, the inter-frame prediction using the affine merge mode for the current block is completed. That is, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0785] In addition, in step Sj_11, the above-mentioned candidate MV list can also be generated in the same way as step Sk_11.

[0786] [MV Export > Triangle Mode]

[0787] For example, when the information read from the stream indicates application of the triangular mode, the inter prediction unit 218 derives an MV in the triangular mode and performs motion compensation (prediction) using the MV.

[0788] Fig.89 : is a flowchart showing an example of inter-frame prediction based on the triangular mode in the decoding device 200 .

[0789] In the triangular mode, first, the inter-frame prediction unit 218 divides the current block into the first partition and the second partition (step Sx_11). At this time, the inter-frame prediction unit 218 can obtain information related to the division into each partition, that is, partition information, from the stream as a prediction parameter. Furthermore, the inter-frame prediction unit 218 can divide the current block into the first partition and the second partition based on the partition information.

[0790] Next, the inter-frame prediction unit 218 first obtains a plurality of candidate MVs for the current block based on information such as MVs of a plurality of decoded blocks temporally or spatially located around the current block (step Sx_12). That is, the inter-frame prediction unit 218 creates a candidate MV list.

[0791] Then, the inter-frame prediction unit 218 selects the candidate MV of the first partition and the candidate MV of the second partition as the first MV and the second MV, respectively, from the multiple candidate MVs obtained in step Sx_11 (step Sx_13). At this time, the inter-frame prediction unit 218 may also obtain MV selection information for identifying the selected candidate MVs from the stream as a prediction parameter. Then, the inter-frame prediction unit 218 may select the first MV and the second MV based on the MV selection information.

[0792] Next, the inter-frame prediction unit 218 performs motion compensation using the selected first MV and the decoded reference picture to generate a first predicted image (step Sx_14). Similarly, the inter-frame prediction unit 218 performs motion compensation using the selected second MV and the decoded reference picture to generate a second predicted image (step Sx_15).

[0793] Finally, the inter-frame prediction unit 218 generates a prediction image of the current block by performing weighted addition on the first prediction image and the second prediction image (step Sx_16).

[0794] [Sports Search>DMVR]

[0795] For example, when the information read from the stream indicates application of DMVR, the inter prediction unit 218 performs motion search using DMVR.

[0796] Fig.90 : is a flowchart showing an example of a motion search based on DMVR in the decoding device 200 .

[0797] The inter-frame prediction unit 218 first derives the MV of the current block in the merge mode (step S1_11). Next, the inter-frame prediction unit 218 derives the final MV for the current block by searching the surrounding area of ​​the reference picture represented by the MV derived in step S1_11 (step S1_12). That is, the MV of the current block is determined by DMVR.

[0798] Fig.91 This is a flowchart showing a detailed example of the motion search based on DMVR in the decoding device 200.

[0799] First, the inter-frame prediction unit 218 Fig.58AIn Step 1 shown in FIG. 1 , the cost of the search position (also called the starting point) represented by the initial MV and the costs of the eight search positions located around it are calculated. Then, the inter-frame prediction unit 218 determines whether the cost of the search position other than the starting point is the minimum. Here, if it is determined that the cost of the search position other than the starting point is the minimum, the inter-frame prediction unit 218 moves to the search position with the minimum cost and performs Fig.58A On the other hand, if the cost of the starting point is the smallest, the inter-frame prediction unit 218 skips the processing of Step 2. Fig.58A The process of Step 2 shown in the figure is followed by the process of Step 3.

[0800] exist Fig.58A In Step 2 shown in FIG. 1 , the inter-frame prediction unit 218 uses the search position moved according to the processing result of Step 1 as a new starting point and performs the same search as the processing of Step 1. Furthermore, the inter-frame prediction unit 218 determines whether the cost of the search position other than the starting point is the smallest. Here, if the cost of the search position other than the starting point is the smallest, the inter-frame prediction unit 218 performs the processing of Step 4. On the other hand, if the cost of the starting point is the smallest, the inter-frame prediction unit 218 performs the processing of Step 3.

[0801] In Step 4, the inter prediction unit 218 treats the search position of the starting point as the final search position, and determines the difference between the position indicated by the initial MV and the final search position as a difference vector.

[0802] exist Fig.58A In Step 3 shown in FIG. 1 , the inter-frame prediction unit 218 determines the pixel position with the minimum cost based on the cost of the four points above, below, left, and right at the starting point of Step 1 or Step 2, and uses the pixel position as the final search position. The pixel position with the minimum cost is determined by weighted addition of the vectors ((0, 1), (0, -1), (-1, 0), (1, 0)) located at the four points above, below, left, and right using the cost of the search position of each of the four points as weights. Then, the inter-frame prediction unit 218 determines the difference between the position shown in the initial MV and the final search position as a difference vector.

[0803] [Motion compensation>BIO / OBMC / LIC]

[0804] For example, when the information read from the stream indicates application of modification of the predicted image, when generating the predicted image, the inter prediction unit 218 modifies the predicted image according to the modification mode. Such modes include the above-mentioned BIO, OBMC, and LIC.

[0805] Fig.92 This is a flowchart showing an example of generation of a predicted image in the decoding device 200 .

[0806] The inter-frame prediction unit 218 generates a predicted image (step Sm_11), and corrects the predicted image using any of the above-mentioned modes (step Sm_12).

[0807] Fig.93 This is a flowchart showing another example of generation of a predicted image in the decoding device 200 .

[0808] The inter-frame prediction unit 218 derives the MV of the current block (step Sn_11). Next, the inter-frame prediction unit 218 generates a predicted image using the MV (step Sn_12), and determines whether to perform correction processing (step Sn_13). For example, the inter-frame prediction unit 218 obtains the prediction parameters contained in the stream, and determines whether to perform correction processing based on the prediction parameters. The prediction parameters are, for example, flags indicating whether the above-mentioned modes are applied. Here, when it is determined that the correction processing is to be performed (yes in step Sn_13), the inter-frame prediction unit 218 generates a final predicted image by correcting the predicted image (step Sn_14). In addition, in LIC, the brightness and color difference of the predicted image can be corrected in step Sn_14. On the other hand, when it is determined that the correction processing is not to be performed (no in step Sn_13), the inter-frame prediction unit 218 does not correct the predicted image and outputs it as the final predicted image (step Sn_15).

[0809] [Motion Compensation > OBMC]

[0810] For example, when the information read from the stream indicates the application of OBMC, the inter prediction unit 218 corrects the predicted image in accordance with OBMC when generating the predicted image.

[0811] Fig.94 : is a flowchart showing an example of correction of a predicted image based on OBMC in the decoding device 200. Fig.94 The flowchart shows the use of Fig.62 The process of correcting the predicted image of the current picture and the reference picture is shown.

[0812] First, if Fig.62 As shown, the inter prediction unit 218 obtains a predicted image (Pred) based on normal motion compensation using the MV assigned to the current block.

[0813] Next, the inter-frame prediction unit 218 applies (reuses) the MV (MV_L) derived for the decoded left adjacent block to the current block to obtain a predicted image (Pred_L). Then, the inter-frame prediction unit 218 performs the first correction of the predicted image by superimposing the two predicted images Pred and Pred_L. This has the effect of blending the boundaries between adjacent blocks.

[0814] Similarly, the inter-frame prediction unit 218 applies (reuses) the MV (MV_U) derived for the decoded upper adjacent block to the current block to obtain a predicted image (Pred_U). Then, the inter-frame prediction unit 218 performs a second correction of the predicted image by overlapping the predicted image Pred_U with the predicted image (e.g., Pred and Pred_L) that has been corrected the first time. This has the effect of blending the boundaries between adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block that is blended (smoothed) with the boundaries of the adjacent blocks.

[0815] [Motion compensation>BIO]

[0816] For example, when the information read from the stream indicates the application of BIO, when generating a predicted image, the inter prediction unit 218 corrects the predicted image according to BIO.

[0817] Fig.95 : is a flowchart showing an example of correction of a predicted image based on BIO in the decoding device 200 .

[0818] like Fig.63 As shown, the inter-frame prediction unit 218 uses two reference pictures (Ref0, Ref1) different from the picture (CurPic) containing the current block to derive two motion vectors (M0, M1). Then, the inter-frame prediction unit 218 uses the two motion vectors (M0, M1) to derive the predicted image of the current block (step Sy_11). In addition, the motion vector M0 is the motion vector (MVx0, MVy0) corresponding to the reference picture Ref0, and the motion vector M1 is the motion vector (MVx1, MVy1) corresponding to the reference picture Ref1.

[0819] Next, the inter-frame prediction unit 218 uses the motion vector M0 and the reference picture L0 to derive an interpolated image I of the current block. 0 In addition, the inter-frame prediction unit 218 uses the motion vector M1 and the reference picture L1 to derive the interpolated image I of the current block. 1 (Step Sy_12). Here, the interpolation image I 0 is the image contained in the reference picture Ref0 derived for the current block, the interpolated image I 1 It is an image included in the reference picture Ref1 derived for the current block. 0 and interpolated image I 1 The interpolated image I may be the same size as the current block. 0 and interpolated image I 1 They can also be images larger than the current block. 0 and I 1It may include a predicted image derived by applying a motion vector (M0, M1) and a reference picture (L0, L1), and a motion compensation filter.

[0820] In addition, the inter-frame prediction unit 218 uses the interpolation image I 0 and interpolated image I 1 Export the gradient image of the current block (Ix 0 , Ix 1 , Iy 0 , Iy 1 )(Step Sy_13). In addition, the gradient image in the horizontal direction is (Ix 0 , Ix 1 ), the vertical gradient image is (Ix 0 , Ix 1 ). The inter-frame prediction unit 218 may derive the gradient image by, for example, applying a gradient filter to the interpolation image. The gradient image may be an image that indicates the spatial variation of pixel values ​​along the horizontal direction or the vertical direction.

[0821] Next, the inter-frame prediction unit 218 uses the interpolation image (I 0 , I 1 ) and the gradient image (Ix 0 , Ix 1 , Iy 0 , Iy 1 ) derives the optical flow (vx, vy) as the velocity vector mentioned above (step Sy_14). As an example, the sub-block may be a sub-CU of 4x4 pixels.

[0822] Next, the inter-frame prediction unit 218 uses the optical flow (vx, vy) to correct the predicted image of the current block. For example, the inter-frame prediction unit 218 uses the optical flow (vx, vy) to derive the correction value of the value of the pixel included in the current block (step Sy_15). Then, the inter-frame prediction unit 218 can use the correction value to correct the predicted image of the current block (step Sy_16). In addition, the correction value can be derived in units of each pixel, or in units of multiple pixels or sub-blocks.

[0823] In addition, the BIO process is not limited to Fig.95 The disclosed processing. Fig.95 A part of the disclosed processing may be added to or replaced with a different processing, or may be executed in a different processing order.

[0824] [Motion Compensation > LIC]

[0825] For example, when the information read from the stream indicates application of LIC, the inter prediction unit 218 modifies the predicted image in accordance with LIC when generating the predicted image.

[0826] Fig.96 : is a flowchart showing an example of modification of a predicted image based on LIC in the decoding device 200.

[0827] First, the inter prediction unit 218 obtains a reference image corresponding to the current block from a decoded reference picture using MV (step Sz_11).

[0828] Next, the inter-frame prediction unit 218 extracts information indicating how the brightness value of the current block changes between the reference picture and the current picture (step Sz_12). Fig.66A As shown in FIG. 1 , the extraction is performed based on the luminance pixel values ​​of the decoded left adjacent reference area (peripheral reference area) and the decoded upper adjacent reference area (peripheral reference area) in the current picture, and the luminance pixel values ​​at the same position in the reference picture specified by the derived MV. Then, the inter-frame prediction unit 218 calculates the luminance correction parameter using information indicating how the luminance value changes (step Sz_13).

[0829] The inter-frame prediction unit 218 generates a prediction image for the current block by performing a brightness correction process by applying the brightness correction parameter to the reference image in the reference picture specified by the MV (step Sz_14). That is, the prediction image, which is the reference image in the reference picture specified by the MV, is corrected based on the brightness correction parameter. In this correction, brightness can be corrected or color difference can be corrected.

[0830] [Prediction Control Department]

[0831] The prediction control unit 220 selects one of the intra-frame prediction image and the inter-frame prediction image, and outputs the selected prediction image to the addition unit 208. In general, the structures, functions, and processes of the prediction control unit 220, the intra-frame prediction unit 216, and the inter-frame prediction unit 218 on the decoding device 200 side may correspond to the structures, functions, and processes of the prediction control unit 128, the intra-frame prediction unit 124, and the inter-frame prediction unit 126 on the encoding device 100 side.

[0832] [LMCS]

[0833] Fig.97LMCS is a diagram showing the processing of LMCS in the decoding device. LMCS is a function of mapping the corresponding relationship between the brightness level and the pixel value of the image to be displayed so as to be different from the corresponding relationship between the brightness level and the pixel value of the image to be encoded, and performing decoding processing. For example, near the brightness level in the important information set, by making the step width of the pixel value thinner, a higher precision processing can be performed, and conversely, near the brightness level in the unimportant information set, by making the step width of the pixel value thicker, the amount of coding can be suppressed. Specifically, the decoding device 200 performs inverse quantization and inverse transformation on the mapped signal, reconstructs the sample, and performs intra-frame prediction. In addition, the decoding device 200 performs inverse mapping on the signal after reconstruction, performs loop filtering processing on the signal before mapping, and performs processing related to DPB (Decoded Picture Buffer). Then, the decoding device 200 performs motion compensation and forward mapping. Then, the mapped signal to which the forward mapping is applied is used for reconstruction.

[0834] In addition, processing corresponding to the above-mentioned processing can also be performed by the encoding device 100.

[0835] [First example of inverse mapping processing of LMCS brightness]

[0836] Next, a first example of the inverse mapping process of LMCS brightness is described. Fig.98 It is a diagram showing the flow of LMCS processing. Fig.98 The following is an overview of the inverse mapping process for luma performed in units of blocks in the LMCS process of the encoding device 100 or the decoding device 200 according to the embodiment of the present invention.

[0837] In the LMCS process, in order to change the dynamic range or scaling of the signal before mapping, such as Fig.99 As shown, the encoding apparatus 100 divides the range of the signal before mapping into 16 intervals and approximates the conversion curve for mapping with 16 straight lines. In addition, the range of the signal before mapping can be equally divided. Fig.99 It is a graph showing a conversion curve in LMCS processing. For example, if the signal is 10 bits, the signal range before mapping is a range of 0 to 1023. In addition, the number of bits of the signal can be expressed as a bit depth.

[0838] In the process performed in block units, the inverse mapping unit of the encoding device 100 determines to which region MapSample, which is a mapped signal of a certain pixel, belongs, that is, determines which straight line parameter is used for inverse mapping.

[0839] When the line to be used for inverse mapping is determined, the encoding device 100 calculates the parameters of the line and performs inverse mapping on the MapSample. Thus, the encoding device 100 calculates the pixel value of the MapSample before mapping. The calculated pixel value is used for processing in the subsequent stage.

[0840] The brightness value of the mapped signal corresponding to the boundary position of the 16 intervals is called the boundary value. The encoding device 100 can sequentially compare the boundary value LmcsPivot[i] (i=0, 1, ..., 16) and the size of MapSample, and search for the index i of the interval where the MapSample, which is the brightness value of the mapped signal, exists. Fig.99 As shown on the vertical axis, the range of brightness values ​​of the mapped signal is divided into a specified number of regions, and restrictions are set so that multiple boundary values ​​are not included in each region, so that the encoding device 100 can easily determine the boundary value index i that establishes the corresponding boundary value with the region where the MapSample exists. Here, the region is set as the reference region, and the width of the region is set as the reference width. In addition, the specified number is, for example, 32. In addition, for example, if the signal is 10 bits, the range of brightness values ​​of the mapped signal is 0 to 1023.

[0841] That is, the encoding device 100 performs the following operations in the inverse mapping process of LMCS.

[0842] First, the encoding device 100 searches for a region to which the mapped pixel value belongs (step S100 ) Specifically, the base region index of the region to which the mapped pixel value to be subjected to the inverse mapping process belongs is determined.

[0843] Next, the encoding device 100 calculates the parameters of the transformation curve (step S101). The encoding device 100 calculates the parameters of the transformation curve corresponding to the area to which the mapped pixel value searched in step S100 belongs. The parameters of the transformation curve are, for example, the slope of the transformation curve. More specifically, a boundary value index corresponding to the boundary value established with the area determined in step S100 is determined, and the parameters of the transformation curve are calculated using information of the boundary value.

[0844] Next, the encoding device 100 performs inverse mapping to convert the pixel values ​​after mapping into the pixel values ​​before mapping (step S102). The encoding device 100 uses the parameters of the conversion curve calculated in step S101 for the inverse mapping.

[0845] The above operation is also the same in the decoding device 200. In addition, although the above description is about the processing of the inverse mapping unit that transforms the mapped pixel values ​​into the pre-mapped pixel values, the processing of the forward mapping unit that transforms the pre-mapped pixel values ​​into the mapped pixel values ​​is also performed in the same manner.

[0846] Fig.100 is a table showing the correspondence between the reference region index and the boundary value index in the LMCS process. The reference region index is an index corresponding to each region. Specifically, Fig.100 As shown, the encoding device 100 prepares a table or memory capable of storing data of the number of regions, and updates the table or the memory each time the boundary value LmcsPivot[i] is updated so that the boundary value index i can be referenced. Here, the encoding device 100 regards the boundary value index i corresponding to the MapSample as a reference region index stored in the table or the memory after dividing the MapSample by the width of the region, and refers to the boundary value index i. With such a structure of the encoding device 100 or an encoding method, the encoding device 100 can quickly and easily find the boundary value index i of the location where the MapSample exists. As a result, the installation of the encoding device 100 is also simplified.

[0847] Assuming that in the encoding device 100, when the width of the region obtained by dividing the range of the brightness value of the mapped signal is fixed and the bit depth is small, the number of regions obtained by dividing the range of the brightness value of the mapped signal is reduced. In addition, if the restriction that multiple boundary values ​​cannot be set for one region is satisfied, the restriction for setting the conversion curve becomes larger. Fig.102 is another diagram showing the transformation curve in LMCS processing. Fig.102 As shown in FIG. 1 , when the bit depth is 9 bits, if the range is equally divided into 32 regions of width, the number of divided regions is 16. Fig.99 Compared with the transformation curve shown in Fig.102 The conversion curve shown is represented by a straighter curve, which may deteriorate the performance of the encoding device 100. In addition, when the bit depth is 8, the conversion curve may be limited to the number of divided regions being 8 and represented by a curve with a slope of about 2 times.

[0848] On the contrary, in the structure or encoding method of the encoding device 100 described above, when the bit depth of the signal is large, the number of regions obtained by dividing the range of the brightness value of the mapped signal increases. In this case, the size of the table or memory for referencing the value of i as the boundary value index increases. Therefore, when the bit depth of the signal is large, there is a problem that the installation cost of the encoding device 100 becomes high.

[0849] Therefore, in this form, Fig.99As shown, the encoding device 100 fixes the number of regions obtained by dividing the range of brightness values ​​of the mapped signal to 32, and changes the width of each region according to the bit depth of the image signal. Then, the encoding device 100 defines a mapping conversion curve with a boundary value set to 1 or less for each region.

[0850] Specifically, when the bit depth of the signal is set to BitDepth, the number of divided areas and the signal bandwidth (reference width) of each area can be expressed by the following equation.

[0851] (Formula 1) Number of regions: 32

[0852] Base width: (1<<BitDepth) / 32

[0853] Therefore, the reference region index is obtained by performing integer division on MapSample based on the width of the divided region, or by right-shifting MapSample by the number of bits of the logarithm of the value with base 2 being the width of each region. 2 is the width of each region.

[0854] (Formula 2) Reference area index: MapSample>>Log2((1<<BitDepth) / 32)

[0855] In addition, the above (Formula 1) and (Formula 2) are equivalent even if they are expressed as formulas such as the following (Formula 3) and (Formula 4).

[0856] (Formula 3) Number of regions: 32

[0857] Base width: 1<<(BitDepth-5)

[0858] (Equation 4) Reference area index: MapSample>>(BitDepth-5)

[0859] In addition, whether the number of regions obtained by dividing the range of brightness values ​​of the mapped signal and the width of each region are fixed or variable may be selected based on other signals, etc. When making this selection, it may also be selected based on conditions, etc.

[0860] In addition, the encoding device 100 may set a plurality of boundary values ​​in one region in the region obtained by dividing the range of the brightness value of the mapped signal. For example, the encoding device 100 may be configured to set a plurality of boundary values ​​in one region only when the boundary value coincides with the boundary of the region.

[0861] That is, the encoding device 100 performs the following operations. Fig.101It is a flowchart showing the processing performed by the encoding device of the present invention for defining a transformation curve for mapping of LMCS.

[0862] First, the encoding apparatus 100 obtains the bit depth of the image signal (step S200 ).

[0863] Next, the encoding apparatus 100 sets the number of regions to 32, and derives a reference width according to the bit depth (step S201 ).

[0864] Next, the encoding apparatus 100 defines a conversion curve for mapping in which the boundary value set for the region is 1 or less (step S202 ).

[0865] in addition, Figures 98 to 102 Although the configuration of the encoding device 100 has been described, the same processing can be performed in the decoding device 200. That is, in the encoding device 100, the parameters for defining the transformation curve for mapping are derived according to the method described in this embodiment, and are encoded in the header region of the bit stream. Then, the decoding device 200 decodes the parameters from the header region of the stream, and defines the transformation curve for mapping according to the method described in this embodiment.

[0866] [Effect of the first example of the inverse mapping process of LMCS brightness]

[0867] According to the configuration of this aspect, in LMCS processing, even when the bit depth of the image signal is other than 10 bits, an appropriate conversion curve for mapping can be defined, thereby improving the coding efficiency when the bit depth of the image signal is other than 10 bits.

[0868] [Install]

[0869] Fig.103 is a flowchart showing an example of the operation of the encoding device in the embodiment. Figure 7 The encoding device 100 shown performs Fig.103 Specifically, the processor a1 uses the memory a2 to perform the following operations.

[0870] First, the encoding device 100 performs LMCS mapping processing by corresponding to multiple line segments constituting a transformation curve for each of the multiple intervals obtained by dividing the first pixel value space, and the LMCS mapping processing transforms the first pixel value space applied to the luminance display image signal into the second pixel value space applied to the luminance encoding processing signal (step S300).

[0871] Next, the encoding device 100 encodes an image (step S301 ).

[0872] Then, when performing LMCS, the encoding device 100 determines the transformation curve in the following manner: for multiple boundary values ​​in the second pixel value space located at the boundaries of multiple line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image (step S302).

[0873] In the encoding device 100 , the reference width is obtained by dividing the luminance range represented by the bit depth by a certain number.

[0874] In addition, in encoding device 100 , the fixed number is 32.

[0875] Fig.104 is a flowchart showing an example of the operation of the decoding device in the embodiment. Fig.67 The decoding device 200 shown performs Fig.104 Specifically, processor b1 uses memory b2 to perform the following operations.

[0876] First, the decoding device 200 performs LMCS mapping processing by corresponding to a plurality of line segments constituting a transformation curve for each of a plurality of intervals obtained by dividing the first pixel value space, and the LMCS mapping processing transforms the first pixel value space applied to the display image signal of the luminance into the second pixel value space applied to the luminance encoding processing signal (step S400).

[0877] Next, the decoding apparatus 200 decodes the image (step S401 ).

[0878] Then, when performing LMCS, the decoding device 200 determines the transformation curve in the following manner: for multiple boundary values ​​in the second pixel value space located at the boundaries of multiple line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image (step S402).

[0879] In the decoding apparatus 200 , the reference width is obtained by dividing the luminance range represented by the bit depth by a certain number.

[0880] In addition, in decoding device 200 , the fixed number is 32.

[0881] [Replenish]

[0882] The encoding device 100 and the decoding device 200 in this embodiment can be used as an image encoding device and an image decoding device, respectively, or can be used as a moving picture encoding device and a moving picture decoding device, respectively.

[0883] In addition, in the above-mentioned embodiments, each component is composed of dedicated hardware, but it can also be realized by executing a software program suitable for each component. Each component can be realized by a program execution unit such as a CPU or a processor reading and executing a software program recorded in a recording medium such as a hard disk or a semiconductor memory.

[0884] Specifically, each of the encoding device 100 and the decoding device 200 may include a processing circuit and a storage device electrically connected to the processing circuit and accessible from the processing circuit. For example, the processing circuit corresponds to the processor a1 or b1, and the storage device corresponds to the memory a2 or b2.

[0885] The processing circuit includes at least one of dedicated hardware and a program execution unit, and uses the storage device to execute the processing. In addition, when the processing circuit includes the program execution unit, the storage device stores a software program executed by the program execution unit.

[0886] Here, the software that realizes the encoding device 100 or the decoding device 200 according to this embodiment is the following program.

[0887] That is, it may also be that the program causes the computer to execute: performing LMCS mapping processing by using a plurality of line segments constituting a transformation curve, the plurality of line segments respectively corresponding to a plurality of intervals obtained by dividing the first pixel value space, the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coding processing signal applied to brightness, and encodes the image, and when performing the LMCS, determining the transformation curve in the following manner, the manner being that, for a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to the bit depth of the image.

[0888] Alternatively, the program may cause a computer to execute: performing LMCS (Luma Mapping with Chroma Scaling) mapping processing by using a plurality of line segments constituting a transformation curve, wherein the plurality of line segments respectively correspond to a plurality of intervals obtained by dividing a first pixel value space, wherein the LMCS mapping processing transforms the first pixel value space of a display image signal applied to brightness into a second pixel value space of a coded processing signal applied to brightness, and decodes an image; when performing the LMCS, determining the transformation curve in the following manner, wherein, for a plurality of boundary values ​​in the second pixel value space located at boundaries of the plurality of line segments, a first value obtained by dividing the boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by a reference width, and the reference width is determined according to a bit depth of the image.

[0889] In addition, as described above, each component may also be a circuit. These circuits may constitute one circuit as a whole, or they may be different circuits. In addition, each component may be implemented by a general-purpose processor or a dedicated processor.

[0890] In addition, the processing performed by a specific component may be performed by other components. In addition, the order of performing the processing may be changed, and a plurality of processing may be performed simultaneously. In addition, the encoding and decoding device may include the encoding device 100 and the decoding device 200.

[0891] In addition, the ordinal numbers such as 1 and 2 used in the description may be replaced as appropriate. In addition, ordinal numbers may be newly assigned to components and the like, or ordinal numbers may be removed.

[0892] The above describes the forms of the encoding device 100 and the decoding device 200 based on the embodiment, but the forms of the encoding device 100 and the decoding device 200 are not limited to the present embodiment. As long as it does not depart from the gist of the present invention, various modified forms that can be thought of by those skilled in the art are implemented on the present embodiment, and forms constructed by combining constituent elements in different embodiments can also be included in the scope of the forms of the encoding device 100 and the decoding device 200.

[0893] This aspect can be implemented in combination with at least a part of other aspects of the present invention. In addition, a part of the processing described in the flowchart of this aspect, a part of the structure of the device, a part of the syntax, etc. can also be implemented in combination with other aspects.

[0894] It is also possible to implement by combining at least a portion of one or more forms disclosed herein with other forms in the present invention. In addition, it is also possible to implement by combining a portion of the processing, a portion of the structure of the device, a portion of the syntax, etc. recorded in the flowchart of one or more forms disclosed herein with other forms.

[0895] [Implementation and Application]

[0896] In each of the above embodiments, each functional block or active block can usually be implemented by an MPU (microprocessing unit) and a memory. In addition, the processing of each functional block can also be implemented by a program execution unit such as a processor that reads and executes the software (program) recorded in a recording medium such as a ROM. The software can be distributed. The software can also be recorded in various recording media such as a semiconductor memory. In addition, each functional block can also be implemented by hardware (dedicated circuit).

[0897] The processing described in each embodiment can be implemented by centralized processing using a single device (system), or can be implemented by distributed processing using multiple devices. In addition, the processor that executes the above program can be single or multiple. That is, centralized processing can be performed or distributed processing can be performed.

[0898] The aspects of the present invention are not limited to the above-described embodiments, and various modifications can be made, which are also included in the scope of the aspects of the present invention.

[0899] Furthermore, here, an application example of the moving picture encoding method (image encoding method) or the moving picture decoding method (image decoding method) shown in each of the above embodiments and various systems implementing the application example are described. Such a system may also be characterized by having an image encoding device using the image encoding method, an image decoding device using the image decoding method, or an image encoding and decoding device having both. Other structures of such a system can be appropriately changed according to circumstances.

[0900] [Example of use]

[0901] Fig.105 The figure shows the overall structure of a content supply system ex100 for realizing content distribution service. The communication service providing area is divided into desired sizes, and base stations ex106, ex107, ex108, ex109, and ex110, which are fixed wireless stations in the example shown in the figure, are respectively installed in each cell.

[0902] In the content supply system ex100, devices such as a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 are connected to the Internet ex101 via an Internet service provider ex102 or a communication network ex104, and base stations ex106 to ex110. The content supply system ex100 may also connect some of the above devices in combination. In various embodiments, the devices may be directly or indirectly connected to each other via a telephone network or short-range wireless instead of via base stations ex106 to ex110. Furthermore, the streaming server ex103 may be connected to the devices such as the computer ex111, the game machine ex112, the camera ex113, the home appliance ex114, and the smartphone ex115 via the Internet ex101. Furthermore, the stream...

Claims

1. A coding device, wherein: have: Circuits; and A memory connected to the circuit; The circuit is in action. A mapping process of brightness mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting a transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, Encode the image, and When performing the LMCS, the circuit determines the conversion curve so that, among a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, and the reference width is changed according to the bit depth of the image, wherein, The reference width is obtained by dividing a brightness range represented by the bit depth by a constant value.

2. A decoding device, wherein: have: Circuits; and a memory connected to the circuit, The circuit is in action. A mapping process of brightness mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting a transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, Decode the image, and When performing the LMCS, the circuit determines the conversion curve so that, among a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, and the reference width is changed according to the bit depth of the image, wherein, The reference width is obtained by dividing a brightness range represented by the bit depth by a constant value.

3. A coding method, wherein: A mapping process of brightness mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting a transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, Encode the image, where When performing the LMCS, the conversion curve is determined so that, among a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, and the reference width is changed according to the bit depth of the image, wherein, The reference width is obtained by dividing a brightness range represented by the bit depth by a constant value.

4. A decoding method, wherein: A mapping process of brightness mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting a transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, Decode the image, where When performing the LMCS, the conversion curve is determined so that, among a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, and the reference width is changed according to the bit depth of the image, wherein, The reference width is obtained by dividing a brightness range represented by the bit depth by a constant value.

5. A non-transitory storage medium storing a bit stream and readable by a computer, the bit stream comprising at least the bit depth of an image, for performing a process of determining a transformation curve, wherein: The computer executes: A mapping process of brightness mapping and chroma scaling (LMCS) is performed using a plurality of line segments constituting the transformation curve, wherein the mapping process transforms a first pixel value space applied to a brightness display image signal into a second pixel value space applied to a brightness coding processing signal, wherein the plurality of line segments respectively correspond to one of a plurality of different intervals obtained by dividing the first pixel value space, decoding the image, and When performing the LMCS, the computer determines the conversion curve so that, among a plurality of boundary values ​​in the second pixel value space located at the boundaries of the plurality of line segments, a first value obtained by dividing a boundary value by a reference width is not equal to a second value obtained by dividing other boundary values ​​by the reference width, and the reference width is changed according to the bit depth of the image, wherein, The reference width is obtained by dividing a brightness range represented by the bit depth by a constant value.