Encoding device, decoding device, encoding method, and decoding method

The encoding and decoding devices optimize DPB parameter handling based on layer counts in bitstreams, addressing inefficiencies in existing video coding technologies by enhancing efficiency, image quality, and reducing circuit size.

JP2026031654APending Publication Date: 2026-02-24PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025219050
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2020-02-07
Filing Date
2025-12-02
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in improving encoding efficiency, image quality, reducing processing volume, and circuit size, while also requiring appropriate selection of elements and operations such as filters, block sizes, motion vectors, and reference pictures.

Method used

The proposed solution involves an encoding and decoding device that selectively stores or derives DPB parameters based on the number of layers in a bitstream, using a Video Parameter Set (VPS) or Sequence Parameter Set (SPS), optimizing the storage or derivation process to adjust the amount of code and improve coding efficiency, image quality, and reduce circuit size.

Benefits of technology

This approach enhances coding efficiency, improves image quality, reduces processing volume and circuit size, and allows for appropriate selection of encoding and decoding components, thereby optimizing video coding operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026031654000001_ABST
    Figure 2026031654000001_ABST
Patent Text Reader

Abstract

To provide an encoding device capable of suppressing a code amount.SOLUTION: The encoding device 100 comprises circuitry and a memory connected to the circuitry, wherein the circuitry is configured to, in operation: In a case where a plurality of layer sets each including at least one output layer are included and all layer sets included in a bitstream include one layer, a DecodedPictureBuffer (DPB) parameter related to a DPB and a maximum value of a temporal layer ID are not stored in a VideoParameterSet (VPS), and in a case where at least one of all the layer sets includes two or more layers, the DPB parameter and the maximum value are stored in the VPS, and each of the plurality of layer sets is an OutputLayerSet (OLS).SELECTED DRAWING: Figure 108
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to an encoding device, a decoding device, an encoding method, and a decoding method. [Background technology]

[0002] Video coding technology has progressed 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 progress, there is a constant need to provide improvements and optimizations in video coding technology to handle the ever-increasing amount of digital video data in various applications. This disclosure relates to further advances, improvements, and optimizations in video coding.

[0003] Non-Patent Document 1 relates to an example of a conventional standard related to the above-mentioned video coding technology. [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] H.265(ISO / IEC 23008-2 HEVC) / HEVC(High Efficiency Video Coding) Summary of the Invention [Problem to be solved by the invention]

[0005] With regard to the above-mentioned encoding methods, it is desirable to propose new methods to improve encoding efficiency, improve image quality, reduce the amount of processing, reduce the circuit scale, or appropriately select elements or operations such as filters, block sizes, motion vectors, reference pictures or reference blocks.

[0006] The present disclosure provides a configuration or method that can contribute to one or more of, for example, improved coding efficiency, improved image quality, reduced processing amount, reduced circuit size, improved processing speed, and appropriate selection of elements or operations, etc. Note that the present disclosure may include a configuration or method that can contribute to benefits other than those described above. [Means for solving the problem]

[0007] For example, an encoding device according to one embodiment of the present disclosure includes a circuit and a memory connected to the circuit, wherein, in operation, the circuit does not store DPB parameters related to a DPB (Decoded Picture Buffer) and a maximum value of a temporal layer ID in a VPS (Video Parameter Set) when a plurality of layer sets each including at least one output layer are included in a bitstream and when all layer sets included in the bitstream each include one layer, and stores the DPB parameters and the maximum value in the VPS when at least one of all the layer sets includes two or more layers, and each of the plurality of layer sets is an OLS (Output Layer Set).

[0008] In the field of video coding technology, new methods are desired to improve coding efficiency, image quality, and reduce circuit scale.

[0009] Each embodiment of the present disclosure, or a partial configuration or method thereof, enables at least one of, for example, improved coding efficiency, improved image quality, reduced encoding / decoding processing volume, reduced circuit size, or improved encoding / decoding processing speed. Alternatively, each embodiment of the present disclosure, or a partial configuration or method thereof, enables appropriate selection of components / operations such as filters, block sizes, motion vectors, reference pictures, and reference blocks in encoding and decoding. Note that the present disclosure also includes disclosure of configurations or methods that may provide benefits other than those described above. For example, a configuration or method that improves coding efficiency while suppressing an increase in processing volume.

[0010] Further advantages and benefits of certain aspects of the present disclosure will become apparent from the specification and drawings. While such advantages and / or benefits may be obtained by several embodiments and features described in the specification and drawings, not all of them necessarily need to be provided to obtain one or more advantages and / or benefits.

[0011] These general or specific aspects may be realized as a system, an integrated circuit, a computer program, or a recording medium such as a computer-readable CD-ROM, or may be realized as any combination of a system, a method, an integrated circuit, a computer program, and a recording medium. [Effects of the Invention]

[0012] A configuration or method according to an aspect of the present disclosure may contribute to, for example, one or more of improved coding efficiency, improved image quality, reduced processing amount, reduced circuit size, improved processing speed, and appropriate selection of elements or operations, etc. Note that a configuration or method according to an aspect of the present disclosure may also contribute to benefits other than those described above. [Brief explanation of the drawings]

[0013] [Figure 1] FIG. 1 is a schematic diagram illustrating an example of a configuration of a transmission system according to an embodiment. [Figure 2] FIG. 2 is a diagram showing an example of a hierarchical structure of data in a stream. [Figure 3] FIG. 3 is a diagram illustrating an example of a slice configuration. [Figure 4] FIG. 4 is a diagram illustrating an example of a tile configuration. [Figure 5] FIG. 5 is a diagram showing an example of a coding structure for scalable coding. [Figure 6] FIG. 6 is a diagram showing an example of a coding structure for scalable coding. [Figure 7] FIG. 7 is a block diagram illustrating an example of a functional configuration of an encoding device according to an embodiment. [Figure 8]FIG. 8 is a block diagram showing an example of implementation of the encoding device. [Figure 9] FIG. 9 is a flowchart showing an example of the overall encoding process performed by the encoding device. [Figure 10] FIG. 10 is a diagram showing an example of block division. [Figure 11] FIG. 11 is a diagram illustrating an example of a functional configuration of the dividing unit. [Figure 12] FIG. 12 is a diagram showing an example of a division pattern. [Figure 13A] FIG. 13A is a diagram illustrating an example of a syntax tree of a division pattern. [Figure 13B] FIG. 13B is a diagram showing another example of a syntax tree of a division pattern. [Figure 14] FIG. 14 is a table showing the transformation basis functions corresponding to each transformation type. [Figure 15] FIG. 15 is a diagram illustrating an example of an SVT. [Figure 16] FIG. 16 is a flowchart illustrating an example of processing by the conversion unit. [Figure 17] FIG. 17 is a flowchart showing another example of the process performed by the conversion unit. [Figure 18] FIG. 18 is a block diagram illustrating an example of a functional configuration of the quantization unit. [Figure 19] FIG. 19 is a flowchart showing an example of quantization by the quantization unit. [Figure 20] FIG. 20 is a block diagram illustrating an example of a functional configuration of the entropy coding unit. [Figure 21] FIG. 21 is a diagram showing the flow of CABAC in the entropy coding unit. [Figure 22] FIG. 22 is a block diagram illustrating an example of a functional configuration of the loop filter unit. [Figure 23A] FIG. 23A is a diagram showing an example of the shape of a filter used in an ALF (adaptive loop filter). [Figure 23B]FIG. 23B is a diagram showing another example of the shape of the filter used in ALF. [Figure 23C] FIG. 23C is a diagram showing another example of the shape of the filter used in ALF. [Figure 23D] FIG. 23D is a diagram showing an example in which a Y sample (first component) is used for a Cb CCALF and a Cr CCALF (multiple components different from the first component). [Figure 23E] FIG. 23E is a diagram illustrating a diamond-shaped filter. [Figure 23F] FIG. 23F is a diagram showing an example of JC-CCALF. [Figure 23G] FIG. 23G is a diagram showing examples of weight_index candidates of JC-CCALF. [Figure 24] FIG. 24 is a block diagram showing an example of a detailed configuration of a loop filter unit functioning as a DBF. [Figure 25] FIG. 25 is a diagram showing an example of a deblocking filter having filter characteristics that are symmetric with respect to block boundaries. [Figure 26] FIG. 26 is a diagram illustrating an example of a block boundary on which deblocking filtering is performed. [Figure 27] FIG. 27 is a diagram illustrating an example of the Bs value. [Figure 28] FIG. 28 is a flowchart illustrating an example of processing performed by the prediction unit of the encoding device. [Figure 29] FIG. 29 is a flowchart showing another example of the processing performed by the prediction unit of the encoding device. [Figure 30] FIG. 30 is a flowchart showing another example of the processing performed by the prediction unit of the encoding device. [Figure 31] FIG. 31 is a diagram showing an example of 67 intra prediction modes in intra prediction. [Figure 32] FIG. 32 is a flowchart illustrating an example of processing by the intra prediction unit. [Figure 33] FIG. 33 is a diagram showing an example of each reference picture. [Figure 34] FIG. 34 is a conceptual diagram illustrating an example of a reference picture list. [Figure 35] FIG. 35 is a flowchart showing the flow of basic inter prediction processing. [Figure 36] FIG. 36 is a flowchart showing an example of MV derivation. [Figure 37] FIG. 37 is a flowchart showing another example of MV derivation. [Figure 38A] FIG. 38A is a diagram showing an example of classification of each mode of MV derivation. [Figure 38B] FIG. 38B is a diagram showing an example of classification of each mode of MV derivation. [Figure 39] FIG. 39 is a flowchart showing an example of inter prediction in normal inter mode. [Figure 40] FIG. 40 is a flowchart showing an example of inter prediction in normal merge mode. [Figure 41] FIG. 41 is a diagram illustrating an example of MV derivation processing in the normal merge mode. [Figure 42] FIG. 42 is a diagram for explaining an example of MV derivation processing in the HMVP mode. [Figure 43] FIG. 43 is a flowchart showing an example of FRUC (frame rate up conversion). [Figure 44] FIG. 44 is a diagram for explaining an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. [Figure 45] FIG. 45 is a diagram illustrating an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. [Figure 46A] FIG. 46A is a diagram for explaining an example of derivation of MVs in sub-block units in the affine mode using two control points. [Figure 46B]FIG. 46B is a diagram for explaining an example of derivation of MVs in sub-block units in the affine mode using three control points. [Figure 47A] FIG. 47A is a conceptual diagram for explaining an example of deriving the MV of a control point in the affine mode. [Figure 47B] FIG. 47B is a conceptual diagram for explaining an example of deriving the MV of a control point in the affine mode. [Figure 47C] FIG. 47C is a conceptual diagram for explaining an example of deriving the MV of a control point in the affine mode. [Figure 48A] FIG. 48A is a diagram for explaining an affine mode having two control points. [Figure 48B] FIG. 48B is a diagram illustrating an affine mode having three control points. [Figure 49A] FIG. 49A is a conceptual diagram illustrating an example of a method for deriving MVs of control points when the number of control points differs between an already-encoded block and a current block. [Figure 49B] FIG. 49B 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 differs between an already-encoded block and a current block. [Figure 50] FIG. 50 is a flowchart showing an example of processing in the affine merge mode. [Figure 51] FIG. 51 is a flowchart showing an example of processing in the affine inter mode. [Figure 52A] FIG. 52A is a diagram for explaining generation of predicted images of two triangles. [Figure 52B] FIG. 52B is a conceptual diagram showing an example of a first portion of a first partition, and a first and second sample sets. [Figure 52C] FIG. 52C is a conceptual diagram showing the first portion of the first partition. [Figure 53] FIG. 53 is a flowchart showing an example of the triangle mode. [Figure 54] FIG. 54 shows an example of the ATMVP mode in which MVs are derived for each subblock. [Figure 55] FIG. 55 is a diagram showing the relationship between merge mode and DMVR (dynamic motion vector refreshing). [Figure 56] FIG. 56 is a conceptual diagram illustrating an example of a DMVR. [Figure 57] FIG. 57 is a conceptual diagram for explaining another example of the DMVR for determining the MV. [Figure 58A] FIG. 58A is a diagram showing an example of motion estimation in DMVR. [Figure 58B] FIG. 58B is a flowchart showing an example of motion estimation in DMVR. [Figure 59] FIG. 59 is a flowchart showing an example of generation of a predicted image. [Figure 60] FIG. 60 is a flowchart showing another example of generation of a predicted image. [Figure 61] FIG. 61 is a flowchart illustrating an example of a predictive image correction process using OBMC (overlapped block motion compensation). [Figure 62] FIG. 62 is a conceptual diagram illustrating an example of the predicted image correction process using OBMC. [Figure 63] FIG. 63 is a diagram for explaining a model assuming uniform linear motion. [Figure 64] FIG. 64 is a flowchart showing an example of inter prediction according to BIO. [Figure 65] FIG. 65 is a diagram illustrating an example of the functional configuration of an inter prediction unit that performs inter prediction according to BIO. [Figure 66A] FIG. 66A is a diagram for explaining an example of a predicted image generating method using luminance correction processing by LIC (local illumination compensation). [Figure 66B]FIG. 66B is a flowchart showing an example of a method for generating a predicted image using luminance correction processing by LIC. [Figure 67] FIG. 67 is a block diagram showing a functional configuration of a decoding device according to an embodiment. [Figure 68] FIG. 68 is a block diagram showing an implementation example of a decoding device. [Figure 69] FIG. 69 is a flowchart showing an example of the overall decoding process by the decoding device. [Figure 70] FIG. 70 is a diagram showing the relationship between the division determination unit and other components. [Figure 71] FIG. 71 is a block diagram showing an example of the functional configuration of the entropy decoding unit. [Figure 72] FIG. 72 is a diagram showing the flow of CABAC in the entropy decoding unit. [Figure 73] FIG. 73 is a block diagram showing an example of the functional configuration of the inverse quantization unit. [Figure 74] FIG. 74 is a flowchart showing an example of inverse quantization by the inverse quantization unit. [Figure 75] FIG. 75 is a flowchart showing an example of processing by the inverse conversion unit. [Figure 76] FIG. 76 is a flowchart showing another example of the process performed by the inverse conversion unit. [Figure 77] FIG. 77 is a block diagram showing an example of the functional configuration of the loop filter unit. [Figure 78] FIG. 78 is a flowchart showing an example of processing performed by the prediction unit of the decoding device. [Figure 79] FIG. 79 is a flowchart showing another example of the processing performed by the prediction unit of the decoding device. [Figure 80A] FIG. 80A is a flowchart showing a part of another example of processing performed by the prediction unit of the decoding device. [Figure 80B] FIG. 80B is a flowchart showing the remaining part of another example of processing performed in the prediction unit of the decoding device. [Figure 81]FIG. 81 is a diagram illustrating an example of processing by the intra prediction unit of the decoding device. [Figure 82] FIG. 82 is a flowchart showing an example of MV derivation in a decoding device. [Figure 83] FIG. 83 is a flowchart showing another example of MV derivation in the decoding device. [Figure 84] FIG. 84 is a flowchart showing an example of inter prediction in normal inter mode in the decoding device. [Figure 85] FIG. 85 is a flowchart showing an example of inter prediction in normal merge mode in a decoding device. [Figure 86] FIG. 86 is a flowchart showing an example of inter prediction in FRUC mode in a decoding device. [Figure 87] FIG. 87 is a flowchart showing an example of inter prediction in affine merge mode in a decoding device. [Figure 88] FIG. 88 is a flowchart showing an example of inter prediction in affine inter mode in the decoding device. [Figure 89] FIG. 89 is a flowchart showing an example of inter prediction in triangle mode in the decoding device. [Figure 90] FIG. 90 is a flowchart showing an example of motion estimation using DMVR in a decoding device. [Figure 91] FIG. 91 is a flowchart showing a detailed example of motion estimation using DMVR in the decoding device. [Figure 92] FIG. 92 is a flowchart showing an example of generation of a predicted image in a decoding device. [Figure 93] FIG. 93 is a flowchart showing another example of generation of a predicted image in the decoding device. [Figure 94] FIG. 94 is a flowchart showing an example of correction of a predicted image by OBMC in a decoding device. [Figure 95] FIG. 95 is a flowchart showing an example of correction of a predicted image by BIO in a decoding device. [Figure 96] FIG. 96 is a flowchart showing an example of correction of a predicted image by LIC in a decoding device. [Figure 97] Figure 97 is a diagram showing an example of syntax in which an encoding device notifies one or more PTL (Profile / Tier / Level) parameters and one or more HRD (Hypothetical Reference Decoder) parameters in a VPS (Video Parameter Set). [Figure 98] FIG. 98 is a diagram showing an example of the syntax of the PTL parameters. [Figure 99] Figure 99 is a diagram showing an example of the syntax of the HRD parameters. [Figure 100] FIG. 100 is a flowchart showing the process in which the decoding device analyzes the PTL parameters and HRD parameters notified by the VPS. [Figure 101] FIG. 101 is a diagram showing an example of syntax in which one or more PTL parameters are notified in a VPS. [Figure 102] FIG. 102 is a flowchart showing a process in which the encoding device notifies PTL parameters in a VPS and an SPS (Sequence Parameter Set). [Figure 103] FIG. 103 is a diagram showing an example of syntax in which one or more HRD parameters are notified in a VPS. [Figure 104] FIG. 104 is a flowchart showing the process in which the encoding device notifies HRD parameters in the VPS and SPS. [Figure 105] FIG. 105 is a diagram showing an example of syntax in which one or more DPB (Decoded Picture Buffer) parameters are notified in a VPS. [Figure 106] FIG. 106 is a flowchart showing the process in which the encoding device notifies DPB parameters in the VPS and SPS. [Figure 107]FIG. 107 is a diagram showing an example of syntax that enables switching whether or not all PTL parameters, HRD parameters, and DPB parameters are notified by VPS in the second and third aspects of the present disclosure. [Figure 108] FIG. 108 is a diagram showing an example of syntax for notifying DPB parameters in a VPS. [Figure 109] FIG. 109 is a diagram showing another example of syntax for notifying DPB parameters in a VPS. [Figure 110] FIG. 110 is a flowchart showing an example of the operation of the encoding device according to the embodiment. [Figure 111] FIG. 111 is a flowchart showing an example of the operation of the decoding device according to the embodiment. [Figure 112] FIG. 112 is a diagram showing the overall configuration of a content supply system that realizes a content distribution service. [Figure 113] FIG. 113 is a diagram showing an example of a display screen of a web page. [Figure 114] FIG. 114 is a diagram showing an example of a display screen of a web page. [Figure 115] FIG. 115 is a diagram showing an example of a smartphone. [Figure 116] FIG. 116 is a block diagram showing an example of the configuration of a smartphone. DETAILED DESCRIPTION OF THE INVENTION

[0014] [Introduction] An encoding device in one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in operation, the circuit switches whether to store DPB parameters related to the DPB in a header common to multiple layers included in multiple layer sets, each of which includes at least one output layer, depending on whether the number of layers included in each of the multiple layer sets to be included in a bitstream is one.

[0015] As a result, the encoding device in one aspect of the present disclosure is able to switch whether to save DPB parameters depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is 1, and can adjust the amount of code depending on the number of layers included in each of the multiple layer sets included in the bitstream.

[0016] Also, for example, in the encoding device according to one aspect of the present disclosure, each of the multiple layer sets is an OLS (Output Layer Set).

[0017] As a result, the encoding device in one embodiment of the present disclosure can switch whether to save DPB parameters depending on whether the number of layers included in each OLS is 1 or not, and can adjust the amount of code depending on the number of layers in each OLS.

[0018] Also, for example, in the encoding device according to one aspect of the present disclosure, the header common to multiple layers is a VPS (Video Parameter Set).

[0019] As a result, the encoding device in one aspect of the present disclosure is able to switch whether to save DPB parameters in a VPS depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is 1, and can adjust the amount of code depending on the number of layers included in each of the multiple layer sets included in the bitstream.

[0020] Also, for example, in the encoding device according to one aspect of the present disclosure, if the number of layers included in each of the multiple layer sets is one, the circuit does not store the DPB parameters in a header common to multiple layers.

[0021] As a result, the encoding device according to an aspect of the present disclosure can reduce the amount of code when each of the multiple layer sets includes one layer.

[0022] Also, for example, in the encoding device according to one aspect of the present disclosure, the circuit stores the DPB parameters in the SPS when the number of layers included in each of the multiple layer sets is one.

[0023] As a result, the encoding device according to one aspect of the present disclosure can store the DPB parameters individually in the SPS when each of the multiple layer sets includes one layer.

[0024] Also, for example, in the encoding device according to one aspect of the present disclosure, the circuit stores the DPB parameters in a header common to the multiple layers when the number of layers included in at least one of the multiple layer sets is greater than one.

[0025] As a result, the encoding device according to an aspect of the present disclosure can store DPB parameters in a header common to multiple layers as needed. For example, the encoding device 100 can store DPB parameters suitable for one layer included in at least one layer set in a common header.

[0026] Also, for example, in an encoding device according to one aspect of the present disclosure, when the number of layers included in at least one of the plurality of layer sets is greater than one, the circuit stores a count parameter indicating a value obtained by subtracting one from the number of one or more DPB parameters, each of which is a DPB parameter, and the one or more DPB parameters in a header common to the plurality of layers.

[0027] As a result, in one aspect of the encoding device of the present disclosure, even if the value of the number parameter is 0, one DPB parameter is stored in the common header, so that the number parameter that takes the value 0 can be given meaning and the number parameter can be used efficiently.

[0028] A decoding device in one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in operation, the circuit switches whether to derive DPB parameters related to the DPB from a header common to multiple layers included in multiple layer sets, each of which includes at least one output layer, depending on whether the number of layers included in each of multiple layer sets included in a bitstream is 1.

[0029] As a result, a decoding device in one aspect of the present disclosure can switch whether to derive DPB parameters depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is 1, and can adjust the amount of code depending on the number of layers included in each of the multiple layer sets included in the bitstream.

[0030] Also, for example, in a decoding device according to one aspect of the present disclosure, each of the multiple layer sets is an OLS.

[0031] As a result, the decoding device in one embodiment of the present disclosure can switch whether or not to derive DPB parameters depending on whether the number of layers included in each OLS is 1, and can adjust the amount of code depending on the number of layers in the OLS.

[0032] Also, for example, in a decoding device according to an aspect of the present disclosure, the header common to multiple layers is a VPS.

[0033] As a result, a decoding device in one embodiment of the present disclosure is able to switch whether or not to derive DPB parameters in a VPS depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is 1, and can adjust the amount of code depending on the number of layers included in each of the multiple layer sets included in the bitstream.

[0034] Also, for example, in a decoding device according to one aspect of the present disclosure, if the number of layers included in each of the multiple layer sets is one, the circuit does not derive DPB parameters from a header common to multiple layers.

[0035] As a result, the decoding device according to an aspect of the present disclosure can reduce the amount of coding when each of the multiple layer sets includes one layer.

[0036] Also, for example, in a decoding device according to an aspect of the present disclosure, the circuit derives DPB parameters from the SPS when the number of layers included in each of the multiple layer sets is one.

[0037] As a result, the decoding device according to one aspect of the present disclosure can omit deriving DPB parameters from the VPS and can use the DPB parameters when the number of layers included in each of the multiple layer sets is one.

[0038] Also, for example, in a decoding device according to one aspect of the present disclosure, the circuit derives DPB parameters from a header common to multiple layers when the number of layers included in at least one of the multiple layer sets is greater than one.

[0039] This allows the decoding device in one aspect of the present disclosure to properly derive DPB parameters from a header common to multiple layers.

[0040] Also, for example, when the number of layers included in at least one of the multiple layer sets is greater than 1, the circuit derives a count parameter indicating a value obtained by subtracting 1 from the number of one or more DPB parameters, each of which is a DPB parameter, and the one or more DPB parameters from a header common to the multiple layers.

[0041] As a result, in one aspect of the present disclosure, the decoding device can prevent DPB parameters from being derived when the number of layers included in at least one of the multiple layer sets is greater than 1, since the number of DPB parameters does not become 0 even if the value of the number parameter is 0.

[0042] An encoding method in one aspect of the present disclosure is a method of switching whether or not to store DPB parameters related to the DPB in a header common to multiple layers included in multiple layer sets, each of which includes at least one output layer, depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is one.

[0043] As a result, the encoding method according to one aspect of the present disclosure can achieve the same effects as the encoding device described above.

[0044] A decoding method in one aspect of the present disclosure includes multiple layer sets, each containing at least one output layer, and switches whether or not to derive DPB parameters related to the DPB from a header common to multiple layers included in multiple layer sets, depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is one.

[0045] As a result, the decoding method according to one aspect of the present disclosure can achieve the same effects as the decoding device.

[0046] Also, for example, an encoding device according to one aspect of the present disclosure may include a division unit, an intra prediction unit, an inter prediction unit, a loop filter unit, a transform unit, a quantization unit, and an entropy encoding unit.

[0047] The division unit may divide 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 generate transformation coefficients by transforming a prediction error between a predicted image obtained by the intra prediction or the inter prediction and an original image. The quantization unit may quantize the transformation coefficients to generate quantized coefficients. The entropy coding unit may code the quantized coefficients to generate a coded bitstream. The loop filter unit may apply a filter to a reconstructed image of the block.

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

[0049] The entropy coding unit may also switch whether or not to store DPB parameters related to the DPB in a header common to the multiple layers included in the multiple layer sets, each of which includes at least one output layer, depending on whether the number of layers included in each of the multiple layer sets to be included in the bitstream is one.

[0050] Furthermore, for example, a decoding device according to one aspect of the present disclosure may include an entropy decoding unit, an inverse quantization unit, an inverse transform unit, an intra prediction unit, an inter prediction unit, and a loop filter unit.

[0051] The entropy decoding unit may decode quantized coefficients of blocks in a picture from the coded bitstream. The inverse quantization unit may inverse quantize the quantized coefficients to obtain transform coefficients. The inverse transform unit may inverse transform the transform coefficients to obtain prediction errors. The intra prediction unit may perform intra prediction on the blocks. The inter prediction unit may perform inter prediction on the blocks. The filter unit may apply a filter to a reconstructed image generated using a predicted image obtained by the intra prediction or the inter prediction and the prediction error.

[0052] Furthermore, for example, the decoding device may be a decoding device that decodes a video including a plurality of pictures.

[0053] The entropy decoding unit may also switch whether or not to derive DPB parameters related to the DPB from a header common to the multiple layers included in the multiple layer sets, each of which includes at least one output layer, depending on whether the number of layers included in each of the multiple layer sets included in the bitstream is 1.

[0054] Furthermore, these comprehensive or specific aspects may be realized as a system, an apparatus, a method, an integrated circuit, a computer program, or a non-transitory recording medium such as a computer-readable CD-ROM, or may be realized as any combination of a system, an apparatus, a method, an integrated circuit, a computer program, and a recording medium.

[0055] [Term definition] As an example, each term may be defined as follows:

[0056] (1) Images A data unit made up of a set of pixels, consisting of pictures or blocks smaller than pictures, and includes both moving images and still images.

[0057] (2) Picture It is an image processing unit composed of a set of pixels, and is sometimes called a frame or field.

[0058] (3) Block It is a processing unit for a set containing a specific number of pixels, and can be named anything, as shown in the following examples. It can also be of any shape, including, for example, a rectangle made up of MxN pixels, a square made up of MxM pixels, a triangle, a circle, or any other shape.

[0059] (Example of a block) Slice / Tile / Brick CTU / Superblock / Basic Division Unit VPDU / hardware processing division unit CU / processing block unit / prediction block unit (PU) / orthogonal transform block unit (TU) / unit Sub-block

[0060] (4) Pixels / Samples A point is the smallest unit that constitutes an image, and includes not only pixels at integer positions but also pixels at decimal positions that are generated based on pixels at integer positions.

[0061] (5) Pixel value / sample value It is a unique value that a pixel has, and includes not only brightness value, color difference value, and RGB gradation, but also depth value or binary values ​​of 0 and 1.

[0062] (6) Flag In addition to one bit, it may be multiple bits, for example, a parameter or index of two or more bits. Also, it may be not only a two-value using binary numbers, but also a multi-value using other base numbers.

[0063] (7) Signal It is a symbol or code that is used to transmit information, and includes not only discrete digital signals but also analog signals that take continuous values.

[0064] (8) Stream / Bitstream This refers to a data string or flow of digital data. A stream / bit stream may consist of a single stream or multiple streams divided into multiple layers. It also includes cases where data is transmitted via serial communication over a single transmission line, as well as cases where data is transmitted via packet communication over multiple transmission lines.

[0065] (9) Difference / difference For scalar quantities, in addition to simple difference (xy), it is sufficient to include difference operations, such as absolute difference (|xy|), squared difference (x^2-y^2), square root of difference (√(xy)), weighted difference (ax-by: a, b is a constant), and offset difference (x-y+a: a is an offset).

[0066] (10) sum For scalar quantities, in addition to simple sum (x+y), it is sufficient to include sum operations, such as absolute value of sum (|x+y|), sum of squares (x^2+y^2), square root of sum (√(x+y)), weighted sum (ax+by: a, b is a constant), and offset sum (x+y+a: a is an offset).

[0067] (11) Based on This also includes cases where factors other than the target element are taken into account. In addition to cases where a direct result is sought, it also includes cases where a result is sought via an intermediate result.

[0068] (12) Used, using This includes cases where factors other than the target element are taken into account. It also includes cases where results are obtained directly or via intermediate results.

[0069] (13) Prohibit, forbid This can be rephrased as "not permitted." Also, not prohibiting or being permitted does not necessarily mean obligation.

[0070] (14) Restrict (limit, restriction / restrict / restricted) This can be rephrased as "not permitted." Also, not being prohibited or being permitted does not necessarily mean that it is an obligation. Furthermore, it is sufficient if something is partially prohibited in terms of quantity or quality, and it also includes cases where it is completely prohibited.

[0071] (15) Chroma An adjective, denoted by the symbols Cb and Cr, that specifies that a sample array or a single sample represents one of two color difference signals associated with a primary color. Instead of the term chroma, the term chrominance can also be used.

[0072] (16) Luminance It is an adjective, denoted by the symbol or subscript Y or L, that specifies that the sample array or single sample represents a monochrome signal associated with a primary color. Instead of the term luma, the term luminance can also be used.

[0073] [Explanation regarding the description] In the drawings, the same reference numbers indicate the same or similar elements, and the sizes and relative positions of elements in the drawings are not necessarily drawn to scale.

[0074] Hereinafter, embodiments will be described in detail with reference to the drawings. Note that the embodiments described below are all comprehensive or specific examples. The numerical values, shapes, materials, components, the arrangement and connection of the components, steps, and the relationship and order of the steps shown in the following embodiments are merely examples and are not intended to limit the scope of the claims.

[0075] Hereinafter, embodiments of an encoding device and a decoding device will be described. The embodiments are examples of encoding devices and decoding devices to which the processes and / or configurations described in each aspect of the present disclosure can be applied. The processes and / or configurations can also be implemented in encoding devices and decoding devices different from the embodiments. For example, with regard to the processes and / or configurations applied to the embodiments, any of the following may be implemented.

[0076] (1) Any of the multiple components of the encoding device or decoding device of the embodiments described in each aspect of the present disclosure may be replaced or combined with other components described in any of the aspects of the present disclosure.

[0077] (2) In the encoding device or decoding device of the embodiment, the functions or processes performed by some of the multiple components of the encoding device or decoding device may be changed in any way, such as by adding, replacing, or deleting a function or process. For example, any function or process may be replaced with or combined with another function or process described in any of the aspects of the present disclosure.

[0078] (3) In the method implemented by the encoding device or decoding device of the embodiment, some of the processes included in the method may be arbitrarily modified, such as by addition, replacement, deletion, etc. For example, any process in the method may be replaced with or combined with another process described in any of the aspects of the present disclosure.

[0079] (4) Some of the components constituting the encoding device or decoding device of the embodiment may be combined with components described in any of the aspects of the present disclosure, or may be combined with components having some of the functions described in any of the aspects of the present disclosure, or may be combined with components that perform some of the processing performed by the components described in any of the aspects of the present disclosure.

[0080] (5) A component having part of the functionality of the encoding device or decoding device of an embodiment, or a component that performs part of the processing of the encoding device or decoding device of an embodiment, may be combined or replaced with a component described in any of the aspects of the present disclosure, a component having part of the functionality described in any of the aspects of the present disclosure, or a component that performs part of the processing described in any of the aspects of the present disclosure.

[0081] (6) In the method implemented by the encoding device or decoding device of the embodiment, any of the multiple processes included in the method may be replaced or combined with the process described in any of the aspects of the present disclosure or any similar process.

[0082] (7) Some of the processes included in the method implemented by the encoding device or decoding device of the embodiments may be combined with the processes described in any of the aspects of the present disclosure.

[0083] (8) The implementation of the processes and / or configurations described in each aspect of the present disclosure is not limited to the encoding device or decoding device of the embodiments. For example, the processes and / or configurations may be implemented in a device used for a purpose other than the video encoding or video decoding disclosed in the embodiments.

[0084] [System Configuration] FIG. 1 is a schematic diagram showing an example of the configuration of a transmission system according to this embodiment.

[0085] The transmission system Trs is a system that transmits a stream generated by encoding an image and decodes the transmitted stream. Such a transmission system Trs includes, for example, an encoding device 100, a network Nw, and a decoding device 200, as shown in FIG.

[0086] 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, an encoded image and control information for decoding the encoded image. The image is compressed by this encoding.

[0087] Note that the original image input to the encoding device 100 before encoding is also referred to as an original image, an original signal, or an original sample. The image may be a video or a still image. The image is a broader concept than sequences, pictures, and blocks, and is not limited in spatial or temporal domain unless otherwise specified. An image is composed of an array of pixels or pixel values, and a signal representing the image or pixel values ​​is also referred to as a sample. A stream may also be referred to as a bitstream, coded bitstream, compressed bitstream, or coded signal. The encoding device may also be referred to as an image encoding device or a video encoding device, and the encoding method used by the encoding device 100 may also be referred to as an encoding method, an image coding method, or a video coding method.

[0088] 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 local area network (LAN), or a combination of these. The network Nw is not necessarily limited to a bidirectional communication network, and may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting or satellite broadcasting. Furthermore, the network Nw may be replaced by a storage medium on which a stream is recorded, such as a DVD (Digital Versatile Disc) or a BD (Blu-Ray Disc (registered trademark)).

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

[0090] The decoding device may be called an image decoding device or a video decoding device, and the decoding method performed by the decoding device 200 may be called a decoding method, an image decoding method, or a video decoding method.

[0091] [Data Structure] 2 is a diagram showing an example of a hierarchical structure of data in a stream. The stream includes, for example, a video sequence. This video sequence includes, for example, a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), supplemental enhancement information (SEI), and multiple pictures, as shown in (a) of FIG. 2.

[0092] In a video composed of multiple layers, the VPS includes coding parameters common to multiple layers, and coding parameters related to multiple layers included in the video or to each individual layer.

[0093] The SPS includes parameters used for a sequence, i.e., encoding parameters that the decoding device 200 refers to in order to decode the sequence. For example, the encoding parameters may indicate the width or height of a picture. Note that there may be multiple SPSs.

[0094] The PPS includes parameters used for a picture, i.e., encoding parameters referenced by the decoding device 200 to decode each picture in a sequence. For example, the encoding parameters may include a reference value of the quantization width used in decoding the picture and a flag indicating the application of weighted prediction. Note that there may be multiple PPSs. Furthermore, the SPS and PPS may be simply referred to as parameter sets.

[0095] A picture may include a picture header and one or more slices, as shown in (b) of Figure 2. The picture header includes coding parameters that the decoding device 200 references to decode the one or more slices.

[0096] As shown in (c) of Fig. 2, a slice includes a slice header and one or more bricks. The slice header includes coding parameters that are referenced by the decoding device 200 to decode the one or more bricks.

[0097] A brick includes one or more CTUs (Coding Tree Units), as shown in FIG. 2(d).

[0098] Note that a picture may not contain slices, but may instead contain tile groups, where a tile group contains one or more tiles, and bricks may contain slices.

[0099] A CTU is also called a superblock or a basic division unit. As shown in (e) of Fig. 2, such a CTU includes a CTU header and one or more coding units (CUs). The CTU header includes coding parameters that are referenced by the decoding device 200 to decode the one or more CUs.

[0100] A CU may be divided into multiple smaller CUs. Furthermore, as shown in (f) of FIG. 2, a CU includes a CU header, prediction information, and residual coefficient information. The prediction information is information for predicting the CU, and the residual coefficient information is information indicating a prediction residual, which will be described later. A CU is basically the same as a PU (Prediction Unit) and a TU (Transform Unit), but may include multiple TUs smaller than the CU, for example, in SBT, which will be described later. A CU may be processed for each VPDU (Virtual Pipeline Decoding Unit) that constitutes the CU. A VPDU is a fixed unit that can be processed in one stage, for example, when performing pipeline processing in hardware.

[0101] Note that a stream may not have some of the layers shown in FIG. 2 . The order of these layers may be changed, or some layers may be replaced with other layers. A picture currently being processed by a device such as the encoding device 100 or the decoding device 200 is referred to as a current picture. If the processing is encoding, the current picture is synonymous with a picture to be encoded, and if the processing is decoding, the current picture is synonymous with a picture to be decoded. A block, such as a CU or CU, currently being processed by a device such as the encoding device 100 or the decoding device 200 is referred to as a current block. If the processing is encoding, the current block is synonymous with a block to be encoded, and if the processing is decoding, the current block is synonymous with a block to be decoded.

[0102] [Picture Composition Slice / Tile] In order to decode pictures in parallel, the pictures may be organized into slices or tiles.

[0103] A slice is a basic coding unit that constitutes a picture. A picture is made up of, for example, one or more slices. A slice is made up of one or more consecutive CTUs.

[0104] FIG. 3 illustrates an example of a slice configuration. For example, a picture includes 11 x 8 CTUs and is divided into four slices (slices 1-4). Slice 1 may include, for example, 16 CTUs, slice 2 may include, for example, 21 CTUs, slice 3 may include, for example, 29 CTUs, and slice 4 may include, for example, 22 CTUs. Each CTU in a picture belongs to one of the slices. A slice is shaped like the picture divided horizontally. Slice boundaries do not need to be at the edges of the screen and may be anywhere within the boundaries of CTUs within the screen. The processing order (encoding order or decoding order) of CTUs within a slice is, for example, raster scan order. A slice also includes a slice header and coded data. The slice header may describe the characteristics of the slice, such as the address of the CTU at the beginning of the slice and the slice type.

[0105] A tile is a rectangular unit that makes up a picture. Each tile may be assigned a number called a TileId in raster scan order.

[0106] FIG. 4 is a diagram illustrating an example of a tile configuration. For example, a picture includes 11×8 CTUs and is divided into four rectangular tiles (tiles 1-4). When tiles are used, the processing order of the 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 multiple tiles is processed, for example, in raster scan order. For example, as shown in FIG. 4, the processing order of multiple CTUs included in tile 1 is from the left end of the first column of tile 1 to the right end of the first column of tile 1, and then from the left end of the second column of tile 1 to the right end of the second column of tile 1.

[0107] It should be noted that one tile may include one or more slices, and one slice may include one or more tiles.

[0108] Note that a picture may be composed of tile sets. A tile set may include one or more tile groups, or one or more tiles. A picture may be composed of only one of tile sets, tile groups, and tiles. For example, the order in which multiple tiles for each tile set are scanned in raster order is defined as the basic coding order of the tiles. A collection of one or more tiles in each tile set that follow the basic coding order is defined as a tile group. Such a picture may be composed by the dividing unit 102 (see FIG. 7), which will be described later.

[0109] [Scalable Coding] 5 and 6 are diagrams showing an example of the structure of a scalable stream.

[0110] As shown in FIG. 5, the encoding device 100 may generate a temporally / spatially scalable stream by encoding each of multiple pictures into one of multiple layers. For example, the encoding device 100 may encode pictures layer by layer, thereby achieving scalability in which an enhancement layer exists above a base layer. Such coding of each picture is called scalable coding. This allows the decoding device 200 to switch the image quality of the image displayed by decoding the stream. That is, the decoding device 200 determines up to which layer to decode based on internal factors such as its own performance and external factors such as the state of the communication bandwidth. As a result, the decoding device 200 can freely switch between low-resolution content and high-resolution content and decode the same content. For example, a user of the stream may watch a video of the stream partway through using a smartphone while on the move, and then watch the rest of the video using a device such as an Internet TV after returning home. Note that the above-mentioned smartphone and device each incorporate a decoding device 200 with the same or different performance. In this case, if the device decodes the upper layers of the stream, the user can view high-quality video after returning home. This eliminates the need for the encoding device 100 to generate multiple streams with the same content but different image qualities, thereby reducing the processing load.

[0111] Furthermore, the enhancement layer may include meta-information based on image statistics, etc. The decoding device 200 may generate high-quality moving images by super-resolution of pictures in the base layer based on the meta-information. Super-resolution may be either an improvement in the signal-to-noise ratio at the same resolution or an increase in resolution. The meta-information may include information for specifying linear or nonlinear filter coefficients used in the super-resolution process, or information for specifying parameter values ​​in filter processing, machine learning, or least-squares calculations used in the super-resolution process.

[0112] Alternatively, a picture may be divided into tiles or the like according to the meaning of each object in the picture. In this case, the decoding device 200 may decode only a portion of the picture by selecting tiles to be decoded. Also, the attributes of the object (such as a person, a car, or a ball) and its position in the picture (such as a coordinate position in the same picture) may be stored as meta information. In this case, the decoding device 200 can identify the position of a desired object based on the meta information and determine the tile containing the object. For example, as shown in FIG. 6, the meta information is stored using a data storage structure different from that of image data, such as SEI in HEVC. This meta information indicates, for example, the position, size, or color of the main object.

[0113] Alternatively, the meta information may be stored in units of multiple pictures, such as streams, sequences, or random access units. This allows the decoding device 200 to obtain the time at which a specific person appears in a video, and by using the time and picture-by-picture information, it is possible to identify the picture in which the object exists and the position of the object within that picture.

[0114] [Encoding device] Next, a description will be given of a coding device 100 according to an embodiment. Fig. 7 is a block diagram showing an example of a functional configuration of the coding device 100 according to an embodiment. The coding device 100 codes an image on a block-by-block basis.

[0115] 7, the encoding device 100 is a device that encodes an image in units of blocks, and includes a division unit 102, a subtraction unit 104, a transformation unit 106, a quantization unit 108, an entropy encoding 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 prediction unit 124, an inter prediction unit 126, a prediction control unit 128, and a prediction parameter generation unit 130. Note that the intra prediction unit 124 and the inter prediction unit 126 are each configured as part of a prediction processing unit.

[0116] [Example of an encoder implementation] 8 is a block diagram showing an implementation example of the encoding device 100. The encoding device 100 includes a processor a1 and a memory a2. For example, several components of the encoding device 100 shown in FIG. 7 are implemented by the processor a1 and the memory a2 shown in FIG. 8.

[0117] The processor a1 is a circuit that performs information processing and is a circuit that can access the memory a2. For example, the processor a1 is a dedicated or general-purpose electronic circuit that encodes images. The processor a1 may be a processor such as a CPU. The processor a1 may also be a collection of multiple electronic circuits. For example, the processor a1 may fulfill the roles of multiple components of the encoding device 100 shown in FIG. 7, excluding the component for storing information.

[0118] The memory a2 is a dedicated or general-purpose memory that stores information used by the processor a1 to encode images. The memory a2 may be an electronic circuit and may be connected to the processor a1. The memory a2 may also be included in the processor a1. The memory a2 may also be a collection of multiple electronic circuits. The memory a2 may also be a magnetic disk, an optical disk, or the like, and may also be expressed as storage, a recording medium, or the like. The memory a2 may also be a non-volatile memory or a volatile memory.

[0119] For example, the memory a2 may store an image to be encoded, or a stream corresponding to the encoded image, or may store a program for the processor a1 to encode the image.

[0120] Furthermore, for example, the memory a2 may serve as a component for storing information among the multiple components of the encoding device 100 shown in Fig. 7. Specifically, the memory a2 may serve as the block memory 118 and the frame memory 122 shown in Fig. 7. More specifically, the memory a2 may store a reconstructed image (specifically, a reconstructed block or a reconstructed picture, etc.).

[0121] 7 may not be implemented, and all of the above-described processes may not be performed, in encoding device 100. Some of the components shown in Fig. 7 may be included in another device, and some of the above-described processes may be performed by another device.

[0122] Below, the overall processing flow of the encoding device 100 will be explained, and then each component included in the encoding device 100 will be explained.

[0123] [Overall encoding process flow] FIG. 9 is a flowchart showing an example of the overall encoding process performed by the encoding device 100.

[0124] First, the division unit 102 of the encoding device 100 divides a picture included in an original image into a plurality of fixed-size blocks (128×128 pixels) (step Sa_1). Then, the division unit 102 selects a division pattern for the fixed-size blocks (step Sa_2). That is, the division unit 102 further divides the fixed-size blocks into a plurality of blocks that constitute the selected division pattern. Then, the encoding device 100 performs the processes of steps Sa_3 to Sa_9 on each of the plurality of blocks.

[0125] The prediction processing unit, which is made up of the intra prediction unit 124 and the inter prediction unit 126, and the prediction control unit 128 generate a predicted image of the current block (step Sa_3). Note that the predicted image is also called a predicted signal, a predicted block, or a predicted sample.

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

[0127] Next, the transform unit 106 and the quantization unit 108 perform transform and quantization on the predicted image to generate a plurality of quantization coefficients (step Sa_5).

[0128] Next, the entropy coding unit 110 generates a stream by performing coding (specifically, entropy coding) on ​​the plurality of quantization coefficients and prediction parameters related to generation of a predicted image (step Sa_6).

[0129] Next, the inverse quantization unit 112 and the inverse transform unit 114 perform inverse quantization and inverse transform on the plurality of quantized coefficients to reconstruct the prediction residuals (step Sa_7).

[0130] Next, the adder 116 reconstructs the current block by adding the predicted image to the restored prediction residual (step Sa_8). This generates a reconstructed image. 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 locally decoded block or a locally decoded image.

[0131] When this reconstructed image is generated, the loop filter unit 120 performs filtering on the reconstructed image as needed (step Sa_9).

[0132] Then, the encoding device 100 determines whether or not encoding of the entire picture is complete (step Sa_10), and if it determines that encoding is not complete (No in step Sa_10), repeats the processing from step Sa_2.

[0133] In the above example, encoding device 100 selects one division pattern for fixed-size blocks and encodes each block according to that division pattern, but encoding device 100 may also encode each block according to each of a plurality of division patterns. In this case, encoding device 100 may evaluate the cost for each of the plurality of division patterns and select, for example, the stream obtained by encoding according to the division pattern with the smallest cost as the stream to be finally output.

[0134] Furthermore, the processes of steps Sa_1 to Sa_10 may be performed sequentially by the encoding device 100, or some of the processes may be performed in parallel, or the order of the processes may be changed.

[0135] The coding process performed by the coding device 100 is hybrid coding that uses predictive coding and transform coding. The predictive coding is performed by a coding loop that includes 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 prediction unit 124, an inter prediction unit 126, and a prediction control unit 128. In other words, the prediction processing unit that includes the intra prediction unit 124 and the inter prediction unit 126 forms part of the coding loop.

[0136] [Divided part] The division unit 102 divides each picture included in the original image into multiple blocks and outputs each block to the subtraction unit 104. For example, the division unit 102 first divides the picture into blocks of a fixed size (e.g., 128x128 pixels). These fixed-size blocks may be called coding tree units (CTUs). The division unit 102 then divides each of the fixed-size blocks into blocks of a variable size (e.g., 64x64 pixels or less) based on, for example, recursive quadtree and / or binary tree block division. That is, the division unit 102 selects a division pattern. These variable-size blocks may be called coding units (CUs), prediction units (PUs), or transform units (TUs). Note that in various implementation examples, CUs, PUs, and TUs do not need to be distinguished, and some or all of the blocks in a picture may be the processing unit of a CU, PU, ​​or TU.

[0137] Fig. 10 is a diagram showing an example of block division in the embodiment, in which solid lines represent block boundaries based on quadtree block division, and dashed lines represent block boundaries based on binary tree block division.

[0138] Here, block 10 is a square block of 128x128 pixels. This block 10 is first divided into four square blocks of 64x64 pixels (quadtree block division).

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

[0140] The upper right square block of 64x64 pixels is divided horizontally into two rectangular blocks 14 and 15 each of 64x32 pixels (binary tree block division).

[0141] The lower left 64x64 pixel square block is divided into four 32x32 pixel square blocks (quadtree block division). Of the four 32x32 pixel square blocks, the upper left and lower right blocks are further divided. The upper left 32x32 pixel square block is divided vertically into two 16x32 pixel rectangular blocks, and the right 16x32 pixel rectangular block is further divided horizontally into two 16x16 pixel square blocks (binary tree block division). The lower right 32x32 pixel square block is divided horizontally into two 32x16 pixel rectangular blocks (binary tree block division). As a result, the lower left square block of 64x64 pixels is divided into a rectangular block 16 of 16x32 pixels, two square blocks 17 and 18 each of 16x16 pixels, two square blocks 19 and 20 each of 32x32 pixels, and two rectangular blocks 21 and 22 each of 32x16 pixels.

[0142] The bottom right block 23, consisting of 64x64 pixels, is not divided.

[0143] As described above, in Fig. 10, block 10 is divided into 13 variable-sized blocks 11 to 23 based on recursive quad-tree and binary tree block division. This type of division is sometimes called QTBT (quad-tree plus binary tree) division.

[0144] 10, one block is divided into four or two blocks (quadtree or binary tree block division), but the division is not limited to this. For example, one block may be divided into three blocks (ternary tree block division). Division including such ternary tree block division is sometimes called MBT (multi type tree) division.

[0145] Fig. 11 is a diagram showing an example of the functional configuration of the division unit 102. As shown in Fig. 11, the division unit 102 may include a block division determination unit 102a. The block division determination unit 102a may perform the following processing, for example.

[0146] 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.

[0147] Furthermore, the block division determination unit 102a outputs, for example, parameters indicating the above-mentioned 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 prediction residuals based on the parameters, and the intra prediction unit 124 and the inter prediction unit 126 may generate predicted images based on the parameters. Furthermore, the entropy coding unit 110 may perform entropy coding on the parameters.

[0148] As an example, parameters related to the division pattern may be written to the stream as follows:

[0149] 12 is a diagram showing examples of division patterns. The division patterns include, for example, 4-way division (QT) in which a block is divided into two parts each in the horizontal and vertical directions, 3-way division (HT or VT) in which a block is divided in the same direction at a ratio of 1:2:1, 2-way division (HB or VB) in which a block is divided in the same direction at a ratio of 1:1, and no division (NS).

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

[0151] 13A and 13B are diagrams showing examples of syntax trees for division patterns. In the example of FIG. 13A, first, there is information indicating whether or not division is to be performed (S: Split flag), followed by information indicating whether or not division into four is to be performed (QT: QT flag). Next, there is information indicating whether or not division into three or two is to be performed (TT: TT flag or BT: BT flag), and finally there is information indicating the division direction (Ver: Vertical flag or Hor: Horizontal flag). Note that, for each of one or more blocks obtained by division using such a division pattern, further division may be repeatedly applied using a similar process. That is, as an example, it is possible to recursively determine whether or not division is to be performed, whether or not division into four is to be performed, whether the division method is horizontal or vertical, and whether or not division into three or two is to be performed, and to encode the results of the determinations into a stream according to the encoding order disclosed in the syntax tree shown in FIG. 13A.

[0152] In addition, in the syntax tree shown in Fig. 13A, the information is arranged in the order of S, QT, TT, and Ver, but the information may also be arranged in the order of S, QT, Ver, and BT. That is, in the example of Fig. 13B, first there is information indicating whether or not to perform splitting (S: Split flag), then there is information indicating whether or not to perform splitting 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 perform splitting into two or three (BT: BT flag or TT: TT flag).

[0153] The division patterns described here are merely examples, and division patterns other than those described may be used, or only some of the division patterns described may be used.

[0154] [Subtraction section] The subtraction unit 104 subtracts a predicted image (a predicted image input from the prediction control unit 128) from the original image, for each block input from the division unit 102 and divided by the division unit 102. That is, the subtraction unit 104 calculates a prediction residual of the current block. Then, the subtraction unit 104 outputs the calculated prediction residual to the conversion unit 106.

[0155] The original image is an input signal to 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).

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

[0157] The transform unit 106 may adaptively select a transform type from among a plurality of transform types and transform the prediction residuals into transform coefficients using a transform basis function corresponding to the selected transform type. Such a transform may be called an explicit multiple core transform (EMT) or an adaptive multiple transform (AMT). The transform basis function may also be simply called a basis.

[0158] The multiple transform types include, for example, DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. These transform types may be denoted as DCT2, DCT5, DCT8, DST1, and DST7, respectively. FIG. 14 is a table showing transform basis functions corresponding to each transform type. In FIG. 14, N indicates the number of input pixels. Selection of a transform type from among these multiple transform types may depend, for example, on the type of prediction (such as intra prediction or inter prediction) or the intra prediction mode.

[0159] Information indicating whether EMT or AMT is applied (e.g., referred to as an EMT flag or an AMT flag) and information indicating the selected transform type are typically signaled at the CU level, but signaling of this information does not need to be limited to the CU level and may be at other levels (e.g., the sequence level, picture level, slice level, brick level, or CTU level).

[0160] Furthermore, the transform unit 106 may retransform the transform coefficients (i.e., the transform results). Such retransformation may be referred to as an adaptive secondary transform (AST) or a non-separable secondary transform (NSST). For example, the transform unit 106 performs retransformation for each sub-block (e.g., a 4x4 pixel sub-block) included in a block of transform coefficients corresponding to intra-prediction residuals. Information indicating whether to apply NSST and information regarding the transform matrix used for NSST are typically signaled at the CU level. Note that signaling of this information does not need to be limited to the CU level, and may also be at other levels (e.g., the sequence level, picture level, slice level, brick level, or CTU level).

[0161] Separable transformation and non-separable transformation may be applied to the transformation unit 106. Separable transformation is a method of separating the input into directions for the number of dimensions and performing transformation multiple times, and non-separable transformation is a method of treating two or more dimensions of a multi-dimensional input as one dimension and performing transformation all at once.

[0162] For example, an example of a non-separable transformation is when the input is a 4x4 pixel block, it is treated as a single array with 16 elements, and a 16x16 transformation matrix is ​​used to perform transformation processing on that array.

[0163] Another example of a non-separable transform is a transformation (hypercube givens transform) in which an input block of 4x4 pixels is treated as a single array with 16 elements, and then a Givens rotation is performed multiple times on the array.

[0164] In the transformation performed by the transformation unit 106, it is also possible to switch the transformation type of the transformation basis function that transforms into the frequency domain depending on the region within the CU. One example is SVT (Spatially Varying Transform).

[0165] FIG. 15 is a diagram illustrating an example of an SVT.

[0166] In SVT, as shown in FIG. 15, a CU is divided into two equal parts horizontally or vertically, and only one of the two regions is transformed into the frequency domain. The transform type may be set for each region; for example, DST7 and DCT8 are used. For example, of the two regions obtained by dividing a CU into two equal parts vertically, DST7 and DCT8 may be used for the region at position 0. Alternatively, DST7 is used for the region at position 1. Similarly, of the two regions obtained by dividing a CU into two equal parts horizontally, DST7 and DCT8 are used for the region at position 0. Alternatively, DST7 is used for the region at position 1. In the example shown in FIG. 15, only one of the two regions in the CU is transformed, and the other is not, but transformation may also be performed on each of the two regions. Furthermore, the division method may be not only divided into two equal parts, but also into four equal parts. Furthermore, more flexibility is possible, for example, by encoding information indicating the division method and signaling it in the same way as CU division. SVT is also called SBT (Sub-block Transform).

[0167] The above-mentioned 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 can be selected, and information indicating the selected transform type may be coded as index information for each CU. On the other hand, there is a process called IMTS (Implicit MTS) that selects the transform type to be used for orthogonal transform based on the shape of the CU without coding index information. When IMTS is applied, for example, if the shape of the CU is rectangular, the orthogonal transform is performed using DST7 on the shorter sides of the rectangle and DCT2 on the longer sides. For example, if the shape of the CU is square, the orthogonal transform is performed using DCT2 if MTS is enabled in the sequence, and DST7 if MTS is disabled. DCT2 and DST7 are merely examples, and other transform types may be used, or different combinations of transform types may be used. IMTS may be usable only for intra-predicted blocks, or may be usable for both intra-predicted blocks and inter-predicted blocks.

[0168] The above describes three selection processes, MTS, SBT, and IMTS, that selectively switch the transform type used in the orthogonal transform. However, all three selection processes may be enabled, or only some of the selection processes may be selectively enabled. Whether an individual selection process is enabled can be identified by flag information in a header such as SPS. For example, if all three selection processes are enabled, one of the three selection processes is selected for each CU to perform the orthogonal transform. Note that the selection process that selectively switches the transform type may be a selection process different from the three selection processes described above, or each of the three selection processes may be replaced with a different process, as long as at least one of the following four functions [1] to [4] is realized. Function [1] is a function that performs an orthogonal transform on the entire range within a CU and encodes information indicating the transform type used for the transform. Function [2] is a function that performs an orthogonal transform on the entire range of a CU and determines the transform type based on a predetermined rule without encoding information indicating the transform type. Function [3] is a function that performs an orthogonal transform on a portion of a CU and encodes information indicating the transform type used for the transform. Function [4] is a function that performs an orthogonal transform on a part of a CU and determines the transform type based on a predetermined rule without encoding information indicating the transform type used for the transform.

[0169] Note that whether or not to apply MTS, IMTS, and SBT may be determined for each processing unit, such as a sequence, a picture, a brick, a slice, a CTU, or a CU.

[0170] The tool for selectively switching between transformation types in the present disclosure may be rephrased as a method for adaptively selecting a basis to be used in a transformation process, a selection process, or a process for selecting a basis. The tool for selectively switching between transformation types may also be rephrased as a mode for adaptively selecting a transformation type.

[0171] FIG. 16 is a flowchart showing an example of processing by the conversion unit 106.

[0172] For example, the transform unit 106 determines whether or not to perform an orthogonal transform (step St_1). If the transform unit 106 determines to perform an orthogonal transform (Yes in step St_1), it selects a transform type to be 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 causing the information to be coded (step St_4). On the other hand, if the transform unit 106 determines not to perform an orthogonal transform (No in step St_1), it outputs information indicating that the orthogonal transform will not be performed to the entropy coding unit 110, thereby causing the information to be coded (step St_5). Note that the determination of whether or not to perform an orthogonal transform in step St_1 may be made based on, for example, the size of the transform block, the prediction mode applied to the CU, etc. Alternatively, the information indicating the transform type used for the orthogonal transform may not be coded, and the orthogonal transform may be performed using a predefined transform type.

[0173] Fig. 17 is a flowchart showing another example of processing by transform unit 106. Note that the example shown in Fig. 17 is an example of orthogonal transform in the case where a method of selectively switching the transform type used for orthogonal transform is applied, similar to the example shown in Fig. 16.

[0174] For example, the first group of transform types may include DCT2, DST7, and DCT8. For example, the second group of transform types may include DCT2. The transform types included in the first group of transform types and the second group of transform types may partially overlap, or may all be different transform types.

[0175] Specifically, the transform unit 106 determines whether the transform size is equal to or smaller than a predetermined value (step Su_1). If it is determined that the transform size is equal to or smaller than the predetermined value (Yes in step Su_1), the transform unit 106 performs an orthogonal transform on the prediction residual of the current block using a transform type included in the first transform type group (step Su_2). Next, the transform unit 106 outputs information indicating which transform type to use from the one or more transform types included in the first transform type group to the entropy coding unit 110, thereby causing the information to be coded (step Su_3). On the other hand, if the transform unit 106 determines that the transform size is not equal to or smaller than the predetermined value (No in step Su_1), the transform unit 106 performs an orthogonal transform on the prediction residual of the current block using a second transform type group (step Su_4).

[0176] 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 to be applied to the vertical direction of the current block and a transform type to be applied to the horizontal direction. Alternatively, the first transform type group may include only one transform type, and the information indicating the transform type to be used for the orthogonal transform may not be coded. The second transform type group may include multiple transform types, and the information indicating the transform type to be used for the orthogonal transform from among the one or more transform types included in the second transform type group may be coded.

[0177] Alternatively, the transform type may be determined based only on the transform size. Note that the process is not limited to determining whether the transform size is equal to or smaller than a predetermined value, as long as the process determines the transform type to be used for the orthogonal transform based on the transform size.

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

[0179] The predetermined scanning order is an order for quantizing / dequantizing transform coefficients, for example, the predetermined scanning order is defined as an ascending order (low to high frequencies) or a descending order (high to low frequencies).

[0180] The quantization parameter (QP) is a parameter that defines the quantization step (quantization width). For example, as the value of the quantization parameter increases, the quantization step also increases. In other words, as the value of the quantization parameter increases, the error in the quantized coefficient (quantization error) also increases.

[0181] In addition, a quantization matrix may be used for quantization. For example, several types of quantization matrices may be used corresponding to frequency transform sizes such as 4x4 and 8x8, prediction modes such as intra prediction and inter prediction, and pixel components such as luminance and chrominance. Note that quantization refers to digitizing values ​​sampled at predetermined intervals by associating them with predetermined levels, and in this technical field, expressions such as rounding, rounding, or scaling may also be used.

[0182] There are two methods for using a quantization matrix: one is to use a quantization matrix that is directly set on the encoding device 100 side, and the other is to use a default quantization matrix (default matrix). By directly setting a quantization matrix on the encoding device 100 side, it is possible to set a quantization matrix that corresponds to the characteristics of the image. However, this has the disadvantage that the amount of code increases due to encoding of the quantization matrix. Note that instead of using the default quantization matrix or an encoded quantization matrix as is, a quantization matrix to be used for quantizing the current block may be generated based on the default quantization matrix or an encoded quantization matrix.

[0183] On the other hand, there is also a method that does not use a quantization matrix and quantizes the coefficients of both high-frequency components and low-frequency components in the same way. Note that this method is equivalent to using a quantization matrix in which all coefficients have the same value (a flat matrix).

[0184] The quantization matrix may be coded, for example, at the sequence level, picture level, slice level, brick level or CTU level.

[0185] When using a quantization matrix, the quantization unit 108 scales, for example, a quantization step determined from a quantization parameter for each transform coefficient using the value of the quantization matrix. Quantization processing performed without using a quantization matrix may be processing in which transform coefficients are quantized based on a quantization step determined from a quantization parameter. Note that in quantization processing performed without using a quantization matrix, the quantization step may be multiplied by a predetermined value that is common to all transform coefficients in a block.

[0186] FIG. 18 is a block diagram showing an example of the functional configuration of the quantization unit 108.

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

[0188] FIG. 19 is a flowchart showing an example of quantization by the quantization unit 108.

[0189] As an example, the quantization unit 108 may perform quantization for each CU based on the flowchart shown in Fig. 19. Specifically, the quantization parameter generation unit 108c determines whether or not to perform quantization (step Sv_1). Here, if 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).

[0190] Next, the quantization processing unit 108e quantizes the transform coefficients of the current block using the quantization parameters generated in step Sv_2 (step Sv_4). Then, the predicted quantization parameter generation unit 108b acquires a quantization parameter for a processing unit different from that of the current block from the quantization parameter storage unit 108d (step Sv_5). The predicted quantization parameter generation unit 108b generates a predicted quantization parameter for the current block based on the acquired quantization parameter (step Sv_6). The differential quantization parameter generation unit 108a calculates the difference between the quantization parameter for the current block generated by the quantization parameter generation unit 108c and the predicted quantization parameter for the current block generated by the predicted quantization parameter generation unit 108b (step Sv_7). A differential quantization parameter is generated by calculating this difference. The differential quantization parameter generation unit 108a outputs the differential quantization parameter to the entropy coding unit 110, thereby causing the differential quantization parameter to be coded (step Sv_8).

[0191] The differential quantization parameter may be coded at the sequence level, picture level, slice level, brick level, or CTU level. Also, the initial value of the quantization parameter may be coded at the sequence level, picture level, slice level, brick level, or CTU level. In this case, the quantization parameter may be generated using the initial value of the quantization parameter and the differential quantization parameter.

[0192] The quantization unit 108 may include a plurality of quantizers, and may apply dependent quantization, which quantizes the transform coefficients using a quantization method selected from a plurality of quantization methods.

[0193] [Entropy coding section] FIG. 20 is a block diagram showing an example of the functional configuration of the entropy encoding unit 110. As shown in FIG.

[0194] The entropy coding unit 110 generates a stream by entropy coding the quantization coefficients input from the quantization unit 108 and the prediction parameters input from the prediction parameter generation unit 130. For example, CABAC (Context-based Adaptive Binary Arithmetic Coding) is used for this entropy coding. 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, converting multi-level signals such as the 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 context values, i.e., the probability of occurrence of binary signals, according to the characteristics of syntax elements or surrounding circumstances. The context value can be derived by, for example, bypassing, referencing a syntax element, referencing an upper or left adjacent block, referencing hierarchical information, etc. The binary arithmetic coding unit 110c performs arithmetic coding on the binarized signal using the derived context value.

[0195] FIG. 21 is a diagram showing the flow of CABAC in the entropy encoding unit 110.

[0196] First, initialization is performed in CABAC in the entropy coding unit 110. This initialization involves initialization of the binary arithmetic coding unit 110c and setting of initial context values. Then, the binarization unit 110a and the binary arithmetic coding unit 110c sequentially perform binarization and arithmetic coding on, for example, each of the multiple quantization coefficients of a CTU. At this time, the context control unit 110b updates the context values ​​every time arithmetic coding is performed. Then, as post-processing, the context control unit 110b saves the context values. The saved context values ​​are used, for example, as the initial context values ​​for the next CTU.

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

[0198] [Inverse conversion section] The inverse transform unit 114 reconstructs the prediction residual by inverse transforming the transform coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 reconstructs 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. Then, the inverse transform unit 114 outputs the reconstructed prediction residual to the adder unit 116.

[0199] Note that the restored prediction residual usually 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 usually contains a quantization error.

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

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

[0202] [Frame memory] The frame memory 122 is a storage unit for storing, for example, reference pictures used in inter prediction, and is sometimes called a frame buffer. Specifically, the frame memory 122 stores the reconstructed image filtered by the loop filter unit 120.

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

[0204] FIG. 22 is a block diagram showing an example of the functional configuration of the loop filter unit 120. As shown in FIG.

[0205] As shown in FIG. 22 , the loop filter unit 120 includes a deblocking filter processor 120a, an SAO processor 120b, and an ALF processor 120c. The deblocking filter processor 120a performs the deblocking filter process described above on the reconstructed image. The SAO processor 120b performs the SAO process described above on the reconstructed image after the deblocking filter process. The ALF processor 120c applies the ALF process described above to the reconstructed image after the SAO process. Details of the ALF and the deblocking filter will be described later. The SAO process improves image quality by reducing ringing (a phenomenon in which pixel values ​​around edges appear wavy) and correcting pixel value deviations. Examples of this SAO process include edge offset processing and band offset processing. Note that the loop filter unit 120 does not necessarily have to include all of the processors shown in FIG. 22 , and may include only some of the processors. Furthermore, the loop filter unit 120 may be configured to perform the above-described processes in an order different from the processing order disclosed in FIG.

[0206] [Loop filter section > Adaptive loop filter] ALF applies a least squares error filter to remove coding artifacts, for example, for each 2x2 pixel sub-block in the current block, one filter selected from multiple filters based on the local gradient direction and activity.

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

[0208] The gradient direction value D is derived, for example, by comparing gradients in multiple directions (e.g., horizontal, vertical, and two diagonal directions), and the gradient activity value A is derived, for example, by adding gradients in multiple directions and quantizing the sum.

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

[0210] The filter shape used in ALF is, for example, a circularly symmetric shape. FIGS. 23A to 23C are diagrams showing several examples of filter shapes used in ALF. FIG. 23A shows a 5x5 diamond-shaped filter, FIG. 23B shows a 7x7 diamond-shaped filter, and FIG. 23C shows a 9x9 diamond-shaped filter. Information indicating the filter shape is usually signaled at the picture level. Note that signaling of the information indicating the filter shape does not need to be limited to the picture level, and may be at other levels (e.g., sequence level, slice level, brick level, CTU level, or CU level).

[0211] Whether to turn on or off the ALF may be determined, for example, at the picture level or the CU level. For example, whether to apply the ALF for luminance may be determined at the CU level, and whether to apply the ALF for chrominance may be determined at the picture level. Information indicating whether to turn on or off the ALF is usually signaled at the picture level or the CU level. Note that signaling of information indicating whether to turn on or off the ALF does not need to be limited to the picture level or the CU level, and may be at another level (for example, the sequence level, the slice level, the brick level, or the CTU level).

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

[0213] [Loop Filter > Cross Component Adaptive Loop Filter] Fig. 23D is a diagram showing an example in which a Y sample (first component) is used for a Cb CCALF and a Cr CCALF (multiple components different from the first component). Fig. 23E is a diagram showing a diamond-shaped filter.

[0214] One example of CC-ALF operates by applying a linear diamond-shaped filter (Figures 23D and 23E) to the luma 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-point representation. The application of the filter is controlled by variable block sizes and signaled by context-coded flags received for each block of samples. The block size and CC-ALF enable flag are received at the slice level for each chroma component. The syntax and semantics of CC-ALF are provided in the Appendix. Contributions support block sizes of 16x16, 32x32, 64x64, and 128x128 (for chroma samples).

[0215] [Loop Filter > Joint Chroma Cross Component Adaptive Loop Filter] Fig. 23F is a diagram showing an example of JC-CCALF, and Fig. 23G is a diagram showing examples of weight_index candidates for JC-CCALF.

[0216] One example of JC-CCALF uses only one CCALF filter to generate a chrominance adjustment signal for only one color component, and then applies an appropriately weighted version of the same chrominance adjustment signal to the other color component, thus roughly halving the complexity of existing CCALF filters.

[0217] The weight value is coded into a sign flag and a weight index. The weight index (denoted as weight_index) is coded into 3 bits and specifies the magnitude of the JC-CCALF weight JcCcWeight. It cannot be equal to 0. The magnitude of JcCcWeight is determined as follows:

[0218] ·If weight_index is 4 or less, JcCcWeight is equal to weight_index>>2.

[0219] Otherwise, JcCcWeight is equal to 4 / (weight_index-4).

[0220] The block-level on / off control for Cb and Cr ALF filtering is separate. This is the same as CCALF, where two separate sets of block-level on / off control flags are coded. Unlike CCALF, here, the Cb and Cr on / off control block sizes are the same, so only one block size variable is coded.

[0221] [Loop filter section > Deblocking filter] In the deblocking filtering process, the loop filter unit 120 reduces distortions that occur at block boundaries of the reconstructed image by filtering the block boundaries.

[0222] FIG. 24 is a block diagram showing an example of a detailed configuration of the deblocking filtering unit 120a.

[0223] The deblocking filtering unit 120 a includes, for example, a boundary determining unit 1201 , a filter determining unit 1203 , a filtering unit 1205 , a processing determining unit 1208 , a filter characteristics determining unit 1207 , and switches 1202 , 1204 , and 1206 .

[0224] The boundary determination unit 1201 determines whether a pixel to be deblocking filtered (i.e., a target pixel) is located near a block boundary, and outputs the determination result to the switch 1202 and the processing determination unit 1208.

[0225] If the boundary determination unit 1201 determines that the target pixel is located near a block boundary, the switch 1202 outputs the image before filtering to the switch 1204. Conversely, if the boundary determination unit 1201 determines that the target pixel is not located near a block boundary, the switch 1202 outputs the image before filtering to the switch 1206. Note that the image before filtering is an image made up of the target pixel and at least one surrounding pixel located around the target pixel.

[0226] 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 around the target pixel, and outputs the determination result to the switch 1204 and the processing determination unit 1208.

[0227] When the filter determination unit 1203 determines that deblocking filtering is to be performed on the target pixel, the switch 1204 outputs the pre-filtering image acquired via the switch 1202 to the filter processing unit 1205. Conversely, when the filter determination unit 1203 determines that deblocking filtering is not to be performed on the target pixel, the switch 1204 outputs the pre-filtering image acquired via the switch 1202 to the switch 1206.

[0228] When the filter processing unit 1205 acquires an unfiltered image via the switches 1202 and 1204, it performs deblocking filtering on the target pixel using the filter characteristics determined by the filter characteristics determination unit 1207. Then, the filter processing unit 1205 outputs the filtered pixel to the switch 1206.

[0229] The switch 1206 selectively outputs pixels that have not been subjected to deblocking filtering and pixels that have been subjected to deblocking filtering by the filter processing unit 1205 under the control of the processing determination unit 1208 .

[0230] The processing determination unit 1208 controls the switch 1206 based on the determination results of the boundary determination unit 1201 and the filter determination unit 1203. That is, when the boundary determination unit 1201 determines that a target pixel exists near a block boundary and the filter determination unit 1203 determines that deblocking filtering should be performed on the target pixel, the processing determination unit 1208 causes the switch 1206 to output a pixel that has been subjected to deblocking filtering. In addition, in cases other than those described above, the processing determination unit 1208 causes the switch 1206 to output a pixel that has not been subjected to deblocking filtering. By repeatedly outputting pixels in this manner, a filtered image is output from the switch 1206. Note that the configuration shown in FIG. 24 is an example of the configuration of the deblocking filtering unit 120a, and the deblocking filtering unit 120a may have other configurations.

[0231] FIG. 25 is a diagram showing an example of a deblocking filter having filter characteristics that are symmetric with respect to block boundaries.

[0232] In deblocking filtering, for example, pixel values ​​and quantization parameters are used to select one of two deblocking filters with different characteristics, namely, a strong filter and a weak filter. In the strong filter, when pixels p0 to p2 and pixels q0 to q2 exist on either side of a block boundary as shown in Fig. 25, the pixel values ​​of pixels q0 to q2 are changed to pixel values ​​q'0 to q'2 by performing the calculation shown in the following equations.

[0233] q'0=(p1+2×p0+2×q0+2×q1+q2+4) / 8 q'1=(p0+q0+q1+q2+2) / 4 q'2=(p0+q0+q1+3×q2+2×q3+4) / 8

[0234] In the above equations, p0-p2 and q0-q2 are the pixel values ​​of pixels p0-p2 and q0-q2, respectively. q3 is the pixel value of pixel q3, which is adjacent to pixel q2 on the opposite side of the block boundary. The coefficients used in the deblocking filter process on the right side of each equation above are the filter coefficients.

[0235] Furthermore, in the deblocking filter process, clipping may be performed to prevent the pixel value after the operation from changing beyond a threshold. In this clipping process, the pixel value after the operation using the above formula is clipped to "the pixel value before the operation ±2 × threshold" using a threshold determined from the quantization parameter. This prevents excessive smoothing.

[0236] Fig. 26 is a diagram illustrating an example of a block boundary on which deblocking filtering is performed, and Fig. 27 is a diagram illustrating an example of a BS value.

[0237] The block boundaries on which deblocking filtering is performed are, for example, boundaries of CU, PU, ​​or TU in 8x8 pixel blocks as shown in Fig. 26. Deblocking filtering is performed in units of, for example, four rows or four columns. First, a Bs (Boundary Strength) value is determined for block P and block Q shown in Fig. 26 as shown in Fig. 27.

[0238] Whether or not to perform deblocking filter processing of different strengths may be determined according to the Bs value in Figure 27, even for block boundaries belonging to the same image. Deblocking filter processing for the color difference signal is performed when the Bs value is 2. Deblocking filter processing for the luminance signal is performed when the Bs value is 1 or greater and certain conditions are met. Note that the conditions for determining the Bs value are not limited to those shown in Figure 27, and may be determined based on other parameters.

[0239] [Prediction unit (intra prediction unit, inter prediction unit, prediction control unit)] 28 is a flowchart showing an example of processing performed by the prediction unit of the encoding device 100. Note that, as an example, the prediction unit is made up of all or some 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, for example, the intra prediction unit 124 and the inter prediction unit 126.

[0240] The prediction unit generates a predicted image of the current block (step Sb_1). The predicted image may be, for example, an intra-predicted image (intra-predicted signal) or an inter-predicted image (inter-predicted signal). Specifically, the prediction unit generates a predicted image of the current block using a reconstructed image that has already been obtained by generating a predicted image for another block, generating a prediction residual, generating a quantization coefficient, restoring the prediction residual, and adding the predicted image.

[0241] The reconstructed image may be, for example, an image of a reference picture, or an image of an encoded block (i.e., the other block) in a current picture, which is a picture including the current block. The encoded block in the current picture may be, for example, a neighboring block of the current block.

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

[0243] The prediction unit generates a predicted image using a first method (step Sc_1a), generates a predicted image using a second method (step Sc_1b), and generates a predicted image using a third method (step Sc_1c). The first method, the second method, and the third method are different methods for generating predicted images, and may be, for example, an inter-prediction method, an intra-prediction method, or another prediction method. These prediction methods may use the reconstructed image described above.

[0244] Next, the prediction unit evaluates the predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c (step Sc_2). For example, the prediction unit calculates a cost C for each of the predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c, and evaluates the predicted images by comparing the costs C of the predicted images. The cost C is calculated using an RD optimization model formula, for example, C=D+λ×R. In this formula, D is the coding distortion of the predicted image, and is expressed, for example, by the sum of absolute differences between pixel values ​​of the current block and pixel values ​​of the predicted image. R is the bit rate of the stream. λ is, for example, a Lagrange multiplier.

[0245] Next, the prediction unit selects one of the predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c (step Sc_3). That is, the prediction unit selects a method or mode for obtaining a final predicted image. For example, the prediction unit selects a predicted image with the smallest cost C based on the costs C calculated for those predicted images. Alternatively, the evaluation in step Sc_2 and the selection of a predicted image in step Sc_3 may be performed based on parameters used in the encoding process. The encoding device 100 may signal information for identifying the selected predicted image, method, or mode in the stream. The information may be, for example, a flag. This allows the decoding device 200 to generate a predicted image according to the method or mode selected by the encoding device 100 based on the information. Note that in the example shown in FIG. 29, the prediction unit generates predicted images using each method and then selects one of the predicted images. However, before generating those predicted images, the prediction unit may select a method or mode based on parameters used in the encoding process and generate predicted images according to the selected method or mode.

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

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

[0248] First, the prediction unit generates a predicted image by intra prediction (step Sd_1a), and generates a predicted image by inter prediction (step Sd_1b). Note that the predicted image generated by intra prediction is also called an intra predicted image, and the predicted image generated by inter prediction is also called an inter predicted image.

[0249] Next, the prediction unit evaluates each of the intra-predicted image and the inter-predicted image (step Sd_2). The above-mentioned cost C may be used for this evaluation. Then, the prediction unit may select, from the intra-predicted image and the inter-predicted image, the predicted image for which the smallest cost C is calculated as the final predicted image of the current block (step Sd_3). In other words, a prediction method or mode for generating a predicted image of the current block is selected.

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

[0251] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of predefined intra prediction modes. The plurality of intra prediction modes typically includes one or more non-directional prediction modes and a plurality of directional prediction modes.

[0252] 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.

[0253] The multiple directional prediction modes include, for example, the 33 prediction modes defined in the H.265 / HEVC standard. Note that the multiple directional prediction modes may also include 32 prediction modes in addition to the 33 directions (a total of 65 directional prediction modes). Figure 31 is a diagram showing all 67 intra prediction modes (two non-directional prediction modes and 65 directional prediction modes) in intra prediction. Solid arrows represent the 33 directions defined in the H.265 / HEVC standard, and dashed arrows represent the additional 32 directions (the two non-directional prediction modes are not shown in Figure 31).

[0254] In various implementation examples, a luma block may be referenced in the intra prediction of a chroma block. That is, the chroma component of the current block may be predicted based on the luma component of the current block. Such intra prediction is sometimes called CCLM (cross-component linear model) prediction. An intra prediction mode of a chroma block that references such a luma block (e.g., called a CCLM mode) may be added as one of the intra prediction modes of the chroma block.

[0255] The intra prediction unit 124 may correct pixel values ​​after intra prediction based on gradients of reference pixels in the horizontal / vertical directions. Intra prediction involving such correction is sometimes called position dependent intra prediction combination (PDPC). Information indicating whether PDPC is applied (e.g., called a PDPC flag) is usually signaled at the CU level. Note that signaling of this information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, brick level, or CTU level).

[0256] FIG. 32 is a flowchart showing an example of processing by the intra prediction unit 124.

[0257] 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 Most Probable Modes (MPM) (step Sw_3). The MPM consists of, for example, six intra prediction modes. Two of the six intra prediction modes may be a planar prediction mode and a DC prediction mode, and the remaining four 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).

[0258] 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 from the MPM (step Sw_6). Note that the MPM flag set to 1 and the information indicating the intra prediction mode are each coded by the entropy coding unit 110 as prediction parameters.

[0259] 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 from among one or more intra prediction modes not included in the MPM (step Sw_8). Note that the MPM flag set to 0 and the information indicating the intra prediction mode are each coded as prediction parameters by the entropy coding unit 110. The information indicating the intra prediction mode indicates, for example, any one of values ​​0 to 60.

[0260] [Inter prediction section] The inter prediction unit 126 generates a predicted image (inter predicted image) by performing inter prediction (also called inter prediction) on the current block with reference to a reference picture stored in the frame memory 122 that is different from the current picture. Inter prediction is performed in units of the current block or a current sub-block within the current block. A sub-block is included in a block and is a smaller unit than a block. The size of a sub-block may be 4x4 pixels, 8x8 pixels, or another size. The size of a sub-block may be switched in units of a slice, a brick, a picture, or the like.

[0261] For example, the inter prediction unit 126 performs motion estimation for a current block or a current sub-block within a reference picture to find a reference block or a sub-block that best matches the current block or the current sub-block. Then, the inter prediction unit 126 obtains motion information (e.g., a motion vector) that compensates for the motion or change from the reference block or sub-block to the current block or sub-block. The inter prediction unit 126 performs motion compensation (or motion prediction) based on the motion information to generate an inter prediction image for the current block or sub-block. The inter prediction unit 126 outputs the generated inter prediction image to the prediction control unit 128.

[0262] The motion information used for motion compensation may be signaled as an inter-predicted image in various forms, such as a motion vector, or as a difference between a motion vector and a motion vector predictor.

[0263] [Reference Picture List] FIG. 33 is a diagram showing an example of each reference picture, and FIG. 34 is a conceptual diagram showing an example of a reference picture list. The reference picture list is a list indicating one or more reference pictures stored in the frame memory 122. In FIG. 33, rectangles indicate pictures, arrows indicate the reference relationships between pictures, the horizontal axis indicates time, I, P, and B in the rectangles indicate intra-predicted pictures, uni-predicted pictures, and bi-predicted pictures, respectively, and the numbers in the rectangles indicate the decoding order. As shown in FIG. 33, the decoding order of each picture is I0, P1, B2, B3, and B4, and the display order of each picture is I0, B3, B2, B4, and P1. As shown in FIG. 34, the reference picture list is a list indicating reference picture candidates, and for example, one picture (or slice) may have one or more reference picture lists. For example, if the current picture is a uni-predicted picture, one reference picture list is used, and if the current picture is a bi-predicted picture, two reference picture lists are used. In the examples of Figures 33 and 34, picture B3, which is the current picture currPic, has two reference picture lists: an L0 list and an L1 list. When the current picture currPic is picture B3, the reference picture candidates for the current picture currPic are I0, P1, and B2, and each reference picture list (i.e., the L0 list and the L1 list) indicates these pictures. The inter predictor 126 or the prediction control unit 128 specifies which picture in each reference picture list is actually referenced using the reference picture index refIdxLx. In Figure 34, reference pictures P1 and B2 are specified by reference picture indexes refIdxL0 and refIdxL1.

[0264] Such a reference picture list may be generated in units of a sequence, a picture, a slice, a brick, a CTU, or a CU. Furthermore, among the reference pictures indicated in the reference picture list, reference picture indices indicating reference pictures referenced in inter prediction may be coded at the sequence level, the picture level, the slice level, the brick level, the CTU level, or the CU level. Furthermore, a common reference picture list may be used in multiple inter prediction modes.

[0265] [Basic flow of inter prediction] FIG. 35 is a flowchart showing the basic flow of inter prediction.

[0266] 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).

[0267] Here, in generating a predicted image, the inter prediction unit 126 generates the predicted image by, for example, determining a motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). In determining an MV, the inter prediction unit 126 determines the MV by, for example, selecting a candidate motion vector (candidate MV) (step Se_1) and deriving an MV (step Se_2). The selection of a candidate MV is performed, for example, by the inter prediction unit 126 generating a candidate MV list and selecting at least one candidate MV from the candidate MV list. Note that MVs derived in the past may be added as candidate MVs to the candidate MV list. In deriving an MV, the inter prediction unit 126 may further 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 prediction unit 126 may determine the MV of the current block by searching, for each of the at least one selected candidate MV, the region of the reference picture indicated by the candidate MV. Note that searching the region of the reference picture may also be referred to as motion estimation.

[0268] In the above example, steps Se_1 to Se_3 are performed by the inter prediction unit 126, but the processing of step Se_1 or step Se_2, for example, may be performed by another component included in the encoding device 100.

[0269] Note that a candidate MV list may be created for each process in each inter prediction mode, or a common candidate MV list may be used for multiple inter prediction modes. Furthermore, the processes of steps Se_3 and Se_4 correspond to the processes of steps Sa_3 and Sa_4, respectively, shown in Fig. 9. Furthermore, the process of step Se_3 corresponds to the process of step Sd_1b in Fig. 30.

[0270] [MV derivation flow] FIG. 36 is a flowchart showing an example of MV derivation.

[0271] The inter prediction unit 126 may derive the MV of the current block in a mode in which motion information (e.g., MV) is coded. In this case, for example, the motion information may be coded as a prediction parameter and signaled. That is, the coded motion information is included in the stream.

[0272] Alternatively, the inter prediction unit 126 may derive the MV in a mode that does not encode motion information, in which case the motion information is not included in the stream.

[0273] Here, MV derivation modes include normal inter mode, normal merge mode, FRUC mode, and affine mode, which will be described later. Among these modes, modes that encode motion information include normal inter mode, normal merge mode, and affine mode (specifically, affine inter mode and affine merge mode). Note that the motion information may include not only MVs but also prediction MV selection information, which will be described later. Also, modes that do not encode motion information include FRUC 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.

[0274] FIG. 37 is a flowchart showing another example of MV derivation.

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

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

[0277] As described above, MV derivation modes include normal inter, normal merge mode, FRUC mode, and affine mode, which will be described later. Among these modes, modes that encode differential MVs include normal inter mode and affine mode (specifically, affine inter mode). Furthermore, modes that do not encode differential MVs include FRUC mode, normal merge mode, and affine mode (specifically, affine merge mode). 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.

[0278] [MV derivation mode] 38A and 38B are diagrams showing an example of classification of each MV derivation mode. For example, as shown in FIG. 38A, MV derivation modes are roughly classified into three modes depending on whether motion information is coded and whether a differential MV is coded. The three modes are inter mode, merge mode, and FRUC (frame rate up-conversion) mode. Inter mode is a mode in which motion estimation is performed and motion information and a differential MV are coded. For example, as shown in FIG. 38B, inter mode includes affine inter mode and normal inter mode. Merge mode is a mode in which motion estimation is not performed and an MV is selected from a neighboring coded block and the MV of the current block is derived using that MV. This merge mode is basically a mode in which motion information is coded and a differential MV is not coded. For example, as shown in FIG. 38B, merge modes include normal merge mode (sometimes referred to as normal merge mode or regular merge mode), MMVD (Merge with Motion Vector Difference) mode, CIIP (Combined inter merge / intra prediction) mode, triangle mode, ATMVP mode, and affine merge mode. Here, among the modes included in the merge mode, MMVD mode is an exception in which a differential MV is coded. Note that the above-mentioned affine merge mode and affine inter mode are modes included in affine mode. Affine mode is a mode in which, assuming affine transformation, the MVs of each of a plurality of sub-blocks constituting a current block are derived as the MV of the current block. FRUC mode is a mode in which the MV of the current block is derived by searching between coded regions, and neither motion information nor differential MV is coded. Note that details of each of these modes will be described later.

[0279] 38A and 38B are merely examples, and are not limiting. For example, when a differential MV is coded in a CIIP mode, the CIIP mode is classified as an inter mode.

[0280] [MV Derivation > Normal Intermode] The normal inter mode is an inter prediction mode in which the MV of the current block is derived by finding a block similar to the image of the current block from the region of the reference picture indicated by the candidate MV. In this normal inter mode, the differential MV is coded.

[0281] FIG. 39 is a flowchart showing an example of inter prediction in normal inter mode.

[0282] The inter prediction unit 126 first obtains multiple candidate MVs for the current block based on information such as MVs of multiple coded blocks temporally or spatially surrounding the current block (step Sg_1). That is, the inter prediction unit 126 creates a candidate MV list.

[0283] Next, the inter prediction unit 126 extracts N candidate MVs (N is an integer equal to or greater than 2) from the multiple candidate MVs acquired in step Sg_1 as prediction MV candidates according to a predetermined priority order (step Sg_2). Note that the priority order is predetermined for each of the N candidate MVs.

[0284] Next, the inter prediction unit 126 selects one prediction MV candidate from the N prediction MV candidates as a prediction MV for the current block (step Sg_3). At this time, the inter prediction unit 126 encodes prediction MV selection information for identifying the selected prediction MV into a stream. That is, the inter 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.

[0285] Next, the inter prediction unit 126 derives the MV of the current block by referring to the coded reference picture (step Sg_4). At this time, the inter prediction unit 126 further encodes the difference value between the derived MV and the predicted MV into a stream as a differential MV. That is, the inter prediction unit 126 outputs the differential MV as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130. Note that the coded reference picture is a picture made up of multiple blocks reconstructed after coding.

[0286] 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 coded reference picture (step Sg_5). The processes of steps Sg_1 to Sg_5 are performed for each block. For example, when the processes of steps Sg_1 to Sg_5 are performed for each of all blocks included in a slice, inter prediction using the normal inter mode for that slice is completed. Also, when the processes of steps Sg_1 to Sg_5 are performed for each of all blocks included in a picture, inter prediction using the normal inter mode for that picture is completed. Note that the processes of steps Sg_1 to Sg_5 do not have to be performed for all blocks included in a slice, and inter prediction using the normal inter mode for that slice may be completed when they are performed for some blocks. Similarly, when the processes of steps Sg_1 to Sg_5 are performed for some blocks included in a picture, inter prediction using the normal inter mode for that picture may be completed.

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

[0288] The candidate MV list may be used in common with lists used in other modes. Furthermore, processing related to the candidate MV list may be applied to processing related to lists used in other modes. Examples of processing related to this candidate MV list include extracting or selecting candidate MVs from the candidate MV list, sorting the candidate MVs, or deleting candidate MVs.

[0289] [MV Derivation > Normal Merge Mode] The normal merge mode is an inter-prediction mode in which a candidate MV is selected from a candidate MV list as the MV of the current block, thereby deriving the MV. Note that the normal merge mode is a merge mode in a narrow sense, and may also be simply called a 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.

[0290] FIG. 40 is a flowchart showing an example of inter prediction in normal merge mode.

[0291] The inter prediction unit 126 first obtains multiple candidate MVs for the current block based on information such as MVs of multiple coded blocks temporally or spatially surrounding the current block (step Sh_1). That is, the inter prediction unit 126 creates a candidate MV list.

[0292] Next, the inter prediction unit 126 derives the MV of the current block by selecting one candidate MV from the multiple candidate MVs acquired in step Sh_1 (step Sh_2). At this time, the inter prediction unit 126 encodes MV selection information for identifying the selected candidate MV into a stream. That is, the inter 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.

[0293] 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 coded reference picture (step Sh_3). The processes of steps Sh_1 to Sh_3 are performed for each block, for example. For example, when the processes of steps Sh_1 to Sh_3 are performed for each of all blocks included in a slice, inter prediction using the normal merge mode for that slice is completed. Also, when the processes of steps Sh_1 to Sh_3 are performed for each of all blocks included in a picture, inter prediction using the normal merge mode for that picture is completed. Note that the processes of steps Sh_1 to Sh_3 do not have to be performed for all blocks included in a slice, and inter prediction using the normal merge mode for that slice may be completed when they are performed for some blocks. Similarly, when the processes of steps Sh_1 to Sh_3 are performed for some blocks included in a picture, inter prediction using the normal merge mode for that picture may be completed.

[0294] Furthermore, information included in the stream indicating the inter prediction mode (normal merge mode in the above example) used to generate the predicted image is coded as, for example, a prediction parameter.

[0295] FIG. 41 is a diagram illustrating an example of the MV derivation process for the current picture in the normal merge mode.

[0296] First, the inter prediction unit 126 generates a candidate MV list in which candidate MVs are registered. The candidate MVs include spatially adjacent candidate MVs, which are MVs held by multiple coded blocks located spatially around the current block, temporally adjacent candidate MVs, which are MVs held by nearby blocks onto which the position of the current block in a coded reference picture is projected, combined candidate MVs, which are MVs generated by combining the MV values ​​of the spatially adjacent candidate MVs and the temporally adjacent candidate MVs, and zero candidate MVs, which are MVs with a value of zero.

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

[0298] Furthermore, the entropy coding unit 110 writes merge_idx, which is a signal indicating which candidate MV has been selected, into the stream and codes it.

[0299] Note that the candidate MVs registered in the candidate MV list described in Figure 41 are just an example, and the number may be different from the number shown in the figure, the configuration may not include some of the types of candidate MVs shown in the figure, or the configuration may include additional candidate MVs other than the types of candidate MVs shown in the figure.

[0300] The final MV may be determined by performing dynamic motion vector refreshing (DMVR), which will be described later, using the MV of the current block derived in normal merge mode. Note that in normal merge mode, differential MVs are not coded, but in MMVD mode, differential MVs are coded. Like normal merge mode, MMVD mode selects one candidate MV from a candidate MV list, but codes the differential MV. Such MMVD may be classified as a merge mode along with normal merge mode, as shown in FIG. 38B. Note that the differential MV in MMVD mode need not be the same as the differential MV used in inter mode; for example, derivation of a differential MV in MMVD mode may require a smaller amount of processing than derivation of a differential MV in inter mode.

[0301] Alternatively, a combined inter merge / intra prediction (CIIP) mode may be performed in which a predicted image generated by inter prediction and a predicted image generated by intra prediction are combined to generate a predicted image of the current block.

[0302] The candidate MV list may also be referred to as a candidate list. Furthermore, merge_idx is MV selection information.

[0303] [MV Derivation > HMVP Mode] FIG. 42 is a diagram illustrating an example of the MV derivation process for the current picture in the HMVP mode.

[0304] In normal merge mode, the MV of the current block (e.g., CU) is determined by selecting one candidate MV from a candidate MV list generated by referring to a coded block (e.g., CU). Here, other candidate MVs may be registered in the candidate MV list. The mode in which such other candidate MVs are registered is called HMVP mode.

[0305] In HMVP mode, candidate MVs are managed using a FIFO (First-In First-Out) buffer for HMVP, separate from the candidate MV list used in normal merge mode.

[0306] The FIFO buffer stores motion information such as MVs of previously processed blocks in order from most recent to least recent. In this FIFO buffer management, every time a block is processed, the MV of the newest block (i.e., the CU processed immediately before) is stored in the FIFO buffer, and instead the MV of the oldest CU in the FIFO buffer (i.e., the CU processed earliest) is deleted from the FIFO buffer. In the example shown in Figure 42, HMVP1 is the MV of the newest block, and HMVP5 is the MV of the oldest block.

[0307] Then, for example, the inter prediction unit 126 checks, for each MV managed in the FIFO buffer, starting from HMVP1, whether the MV is different from all candidate MVs already registered in the candidate MV list for normal merge mode. If the inter prediction unit 126 determines that the MV is different from all candidate MVs, it may add the MV managed in the FIFO buffer as a candidate MV to the candidate MV list for normal merge mode. At this time, the number of candidate MVs registered from the FIFO buffer may be one or more.

[0308] By using the HMVP mode in this way, it is possible to add not only MVs of blocks spatially or temporally adjacent to the current block but also MVs of blocks processed in the past to the candidates. As a result, the variation of candidate MVs for the normal merge mode is expanded, which increases the possibility of improving coding efficiency.

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

[0310] Note that the candidate MV list and FIFO buffer in Figure 42 are just an example, and the candidate MV list and FIFO buffer may be lists or buffers of different sizes than those in Figure 42, or may be configured to register candidate MVs in a different order than those in Figure 42. Furthermore, the processing described here is common to both the encoding device 100 and the decoding device 200.

[0311] The HMVP mode can also be applied to modes other than the normal merge mode. For example, motion information such as MVs of blocks previously processed in affine mode may be stored in a FIFO buffer in order from the most recent to the least recent, and used as candidate MVs. A mode in which the HMVP mode is applied to the affine mode may be called a history affine mode.

[0312] [MV derivation > FRUC mode] The motion information may be derived on the decoding device 200 side without being signaled by the encoding device 100 side. For example, the motion information may be derived by performing motion estimation on the decoding device 200 side. In this case, the motion estimation is performed on the decoding device 200 side without using pixel values ​​of the current block. Modes for performing such motion estimation on the decoding device 200 side include frame rate up-conversion (FRUC) mode and pattern matched motion vector derivation (PMMVD) mode.

[0313] An example of the FRUC process is shown in FIG. 43. First, by referencing the MVs of each coded block spatially or temporally adjacent to the current block, a list indicating these MVs as candidate MVs (i.e., a candidate MV list, which may be the same as the candidate MV list for normal merge mode) is generated (step Si_1). Next, a best candidate MV is selected from the multiple candidate MVs registered in the candidate MV list (step Si_2). For example, an evaluation value of each candidate MV included in the candidate MV list is calculated, and one candidate MV is selected as the best candidate MV based on the evaluation value. Then, an MV for the current block is derived based on the selected best candidate MV (step Si_4). Specifically, for example, the selected best candidate MV is directly derived as the MV for the current block. Alternatively, for example, an MV for the current block may be derived by performing pattern matching in a surrounding area of ​​a position in the reference picture corresponding to the selected best candidate MV. That is, a search is performed on the area around the best candidate MV using pattern matching and evaluation values ​​in the reference picture, and if an MV with a better evaluation value is found, the best candidate MV can be updated to that MV and used as the final MV for the current block. It is not necessary to update to an MV with a better evaluation value.

[0314] 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 coded reference picture (step Si_5). The processes of steps Si_1 to Si_5 are performed for each block, for example. For example, when the processes of steps Si_1 to Si_5 are performed for each of all blocks included in a slice, inter prediction using the FRUC mode for the slice is completed. Also, when the processes of steps Si_1 to Si_5 are performed for each of all blocks included in a picture, inter prediction using the FRUC mode for the picture is completed. Note that the processes of steps Si_1 to Si_5 do not have to be performed for all blocks included in a slice, and inter prediction using the FRUC mode for the slice may be completed when they are performed for some blocks. Similarly, when the processes of steps Si_1 to Si_5 are performed for some blocks included in a picture, inter prediction using the FRUC mode for the picture may be completed.

[0315] The sub-block unit may be processed in the same manner as the block unit described above.

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

[0317] Next, pattern matching will be described in detail. First, one candidate MV included in a candidate MV list (also called a merge list) is selected as a starting point for search by pattern matching. As the pattern matching, first pattern matching or second pattern matching may be used. The first pattern matching and the second pattern matching are sometimes called bilateral matching and template matching, respectively.

[0318] [MV derivation > FRUC > Bilateral matching] In the first pattern matching, pattern matching is performed between two blocks in two different reference pictures that are along the motion trajectory of the current block. Therefore, in the first pattern matching, an area in another reference picture that is along the motion trajectory of the current block is used as a predetermined area for calculating the evaluation value of the above-mentioned candidate MV.

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

[0320] Under the assumption of continuous motion trajectories, MVs (MV0, MV1) pointing to two reference blocks are proportional to the temporal distances (TD0, TD1) between the current picture (CurPic) and the two reference pictures (Ref0, Ref1). For example, if the current picture is located between two reference pictures in time and the temporal distances from the current picture to the two reference pictures are equal, the first pattern matching derives bidirectional MVs that are mirror-symmetric.

[0321] [MV derivation > FRUC > template matching] 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, the block adjacent to the current block in the current picture is used as a predetermined area for calculating the evaluation value of the above-mentioned candidate MV.

[0322] FIG. 45 is a diagram illustrating an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. As shown in FIG. 45, in the second pattern matching, the MV of the current block is derived by searching the reference picture (Ref0) for a block that best matches a block adjacent to the current block (Cur block) in the current picture (Cur Pic). Specifically, the difference between the reconstructed image of both or either of the coded areas adjacent to the left and / or above the current block and the reconstructed image at the same position in the coded reference picture (Ref0) specified by the candidate MV is derived, and an evaluation value is calculated using the obtained difference value. The candidate MV with the best evaluation value among the multiple candidate MVs is preferably selected as the best candidate MV.

[0323] Information indicating whether such a FRUC mode is applied (e.g., referred to as an FRUC flag) may be signaled at the CU level. Also, when the FRUC mode is applied (e.g., when the FRUC flag is true), information indicating an applicable pattern matching method (first pattern matching or second pattern matching) may be signaled at the CU level. Note that signaling of this information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, brick level, CTU level, or sub-block level).

[0324] [MV Derivation > Affine Mode] The affine mode is a mode in which MVs are generated using an affine transform, and for example, MVs may be derived for each sub-block based on the MVs of multiple neighboring blocks. This mode is sometimes called an affine motion compensation prediction mode.

[0325] FIG. 46A is a diagram illustrating an example of derivation of MVs for each sub-block based on MVs of multiple adjacent blocks. In FIG. 46A, the current block includes, for example, 16 sub-blocks each consisting of 4x4 pixels. Here, a motion vector v0 for the upper left corner control point of the current block is derived based on the MVs of the adjacent blocks, and similarly, a motion vector v1 for the upper right corner control point of the current block is derived based on the MVs of the adjacent sub-blocks. Then, the two motion vectors v0 and v1 are projected using the following equation (1A) to derive the motion vectors (v x ,v y ) is derived.

[0326]

number

[0327] Here, x and y respectively indicate the horizontal and vertical positions of the sub-block, and w indicates a predetermined weighting coefficient.

[0328] Such information indicating the affine mode (e.g., called an affine flag) may be signaled at the CU level. Note that the signaling of the information indicating the affine mode does not need to be limited to the CU level, and may be at other levels (e.g., the sequence level, picture level, slice level, brick level, CTU level, or sub-block level).

[0329] Such affine modes may also include several modes that differ in the method of deriving the MVs of the top-left and top-right corner control points. For example, there are two affine modes: affine inter (also called affine normal inter) mode and affine merge mode.

[0330] FIG. 46B is a diagram illustrating an example of derivation of MVs for each sub-block in affine mode using three control points. In FIG. 46B, the current block includes, for example, 16 sub-blocks each consisting of 4x4 pixels. Here, a motion vector v0 for the upper left corner control point of the current block is derived based on the MV of an adjacent block. Similarly, a motion vector v1 for the upper right corner control point of the current block is derived based on the MV of an adjacent block, and a motion vector v2 for the lower left corner control point of the current block is derived based on the MV of the adjacent block. Then, the three motion vectors v0, v1, and v2 are projected using the following equation (1B) to obtain the motion vectors (v x ,v y ) is derived.

[0331]

number

[0332] Here, x and y respectively indicate the horizontal and vertical positions of the sub-block center, and w and h indicate predetermined weighting coefficients, where w may indicate the width of the current block and h may indicate the height of the current block.

[0333] Affine modes using different numbers of control points (e.g., two and three) may be switched and signaled at the CU level. Note that 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).

[0334] Furthermore, such an affine mode with three control points may include several modes with different methods for deriving the MVs of the upper-left, upper-right, and lower-left corner control points. For example, the affine mode with three control points includes two modes, affine inter mode and affine merge mode, similar to the affine mode with two control points described above.

[0335] In the affine mode, the size of each sub-block included in the current block is not limited to 4x4 pixels and may be other sizes, for example, 8x8 pixels.

[0336] [MV Derivation > Affine Mode > Control Points] 47A, 47B, and 47C are conceptual diagrams for explaining an example of deriving the MV of a control point in the affine mode.

[0337] In the affine mode, as shown in FIG. 47A, for example, among the coded blocks A (left), B (top), C (top right), D (bottom left), and E (top left) adjacent to the current block, the predicted MVs of each control point of the current block are calculated based on a plurality of MVs corresponding to the blocks coded in the affine mode. Specifically, these blocks are examined in the order of the coded blocks A (left), B (top), C (top right), D (bottom left), and E (top left), and the first valid block coded in the affine mode is identified. The MVs of the control points of the current block are calculated based on a plurality of MVs corresponding to this identified block.

[0338] For example, as shown in Figure 47B, if block A, adjacent to the left of the current block, is coded in affine mode with two control points, motion vectors v3 and v4 are derived by projecting them onto the positions of the upper left and upper right corners of a coded block that includes block A. Then, from the derived motion vectors v3 and v4, motion vector v0 for the upper left corner control point and motion vector v1 for the upper right corner control point of the current block are calculated.

[0339] For example, as shown in Figure 47C, if block A, adjacent to the left of the current block, is coded in affine mode with three control points, motion vectors v3, v4, and v5 are derived by projecting them onto the positions of the upper left, upper right, and lower left corners of a coded block that includes block A. Then, from the derived motion vectors v3, v4, and v5, motion vector v0 for the upper left corner control point, motion vector v1 for the upper right corner control point, and motion vector v2 for the lower left corner control point of the current block are calculated.

[0340] The MV derivation method shown in Figures 47A to 47C may be used to derive the MV of each control point of the current block in step Sk_1 shown in Figure 50 described later, or may be used to derive the predicted MV of each control point of the current block in step Sj_1 shown in Figure 51 described later.

[0341] 48A and 48B are conceptual diagrams for explaining another example of derivation of control points MV in the affine mode.

[0342] FIG. 48A is a diagram for explaining an affine mode having two control points.

[0343] In this affine mode, as shown in Figure 48A, an MV selected from the MVs of 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, an MV selected from the MVs of 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.

[0344] FIG. 48B is a diagram illustrating an affine mode having three control points.

[0345] In this affine mode, as shown in Figure 48B, an MV selected from the MVs of coded blocks A, B, and C adjacent to the current block is used as the motion vector v0 for the upper-left corner control point of the current block. Similarly, an MV selected from the MVs of coded blocks D and E adjacent to the current block is used as the motion vector v1 for the upper-right corner control point of the current block. Furthermore, an MV selected from the MVs of coded blocks F and G adjacent to the current block is used as the motion vector v2 for the lower-left corner control point of the current block.

[0346] The MV derivation method shown in Figures 48A and 48B may be used to derive the MV of each control point of the current block in step Sk_1 shown in Figure 50 described below, or may be used to derive the predicted MV of each control point of the current block in step Sj_1 of Figure 51 described below.

[0347] Here, for example, when affine modes with different numbers of control points (for example, two and three) are switched at the CU level and signaled, the number of control points may differ between the coded block and the current block.

[0348] 49A and 49B are conceptual diagrams for explaining an example of a method for deriving an MV of a control point when the number of control points differs between an already-encoded block and a current block.

[0349] For example, as shown in Figure 49A, the current block has three control points (top left, top right, and bottom left), and block A, which is adjacent to the left of the current block, is coded in affine mode with two control points. In this case, motion vectors v3 and v4 are derived by projecting them onto the positions of the top left and top right corners of a coded block that includes block A. Then, from the derived motion vectors v3 and v4, motion vector v0 for the top left corner control point of the current block and motion vector v1 for the top right corner control point are calculated. Furthermore, from the derived motion vectors v0 and v1, motion vector v2 for the bottom left corner control point is calculated.

[0350] For example, as shown in Figure 49B, the current block has two control points, the upper left and upper right corners, and block A, which is adjacent to the left of the current block, is coded in affine mode with three control points. In this case, motion vectors v3, v4, and v5 are derived by projecting them to the positions of the upper left, upper right, and lower left corners of a coded block that includes block A. Then, from the derived motion vectors v3, v4, and v5, motion vector v0 for the upper left corner control point of the current block and motion vector v1 for the upper right corner control point are calculated.

[0351] The MV derivation method shown in Figures 49A and 49B may be used to derive the MV of each control point of the current block in step Sk_1 shown in Figure 50 described below, or may be used to derive the predicted MV of each control point of the current block in step Sj_1 of Figure 51 described below.

[0352] [MV Derivation > Affine Mode > Affine Merge Mode] FIG. 50 is a flowchart showing an example of the affine merge mode.

[0353] In the affine merge mode, the inter prediction unit 126 first derives MVs for each of the control points of the current block (step Sk_1). The control points are the upper left and upper right corners of the current block as shown in Figure 46A, or the upper left, upper right, and lower left corners of the current block as shown in Figure 46B. At this time, the inter prediction unit 126 may encode MV selection information for identifying the derived two or three MVs into the stream.

[0354] For example, when using the MV derivation method shown in Figures 47A to 47C, the inter prediction unit 126 examines the coded blocks A (left), block B (top), block C (top right), block D (bottom left) and block E (top left) in that order, as shown in Figure 47A, and identifies the first valid block coded in affine mode.

[0355] The inter prediction unit 126 derives the MV of the control point using the first valid block coded in the identified affine mode. For example, when a block A is identified and the block A has two control points, as shown in FIG. 47B, the inter prediction unit 126 calculates the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point from 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, the inter prediction unit 126 calculates the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point by projecting the motion vectors v3 and v4 of the upper left corner and the upper right corner of the coded block onto the current block.

[0356] Alternatively, when block A is identified and block A has three control points, as shown in Figure 47C, the inter 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 from the motion vectors v3, v4, and v5 of the upper left corner, upper right corner, and lower left corner of the coded block including block A. For example, the inter 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 by projecting the motion vectors v3, v4, and v5 of the upper left corner, upper right corner, and lower left corner of the coded block onto the current block.

[0357] As shown in Figure 49A above, when block A is identified and block A has two control points, the MVs of three control points may be calculated, and as shown in Figure 49B above, when block A is identified and block A has three control points, the MVs of two control points may be calculated.

[0358] Next, the inter prediction unit 126 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, for each of the multiple sub-blocks, the inter prediction unit 126 calculates the MV of the sub-block as an affine MV using two motion vectors v0 and v1 and the above-mentioned formula (1A), or using three motion vectors v0, v1, and v2 and the above-mentioned formula (1B) (step Sk_2). Then, the inter prediction unit 126 performs motion compensation on the sub-block using the affine MV and the coded reference picture (step Sk_3). When the processes of steps Sk_2 and Sk_3 are performed on each of all sub-blocks included in the current block, the process 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.

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

[0360] The candidate MV list may include candidate MVs for modes other than the affine mode that perform prediction on a sub-block basis.

[0361] Note that, as the candidate MV list, for example, a candidate MV list including a candidate MV for an affine merge mode having two control points and a candidate MV for an affine merge mode having three control points may be generated. Alternatively, a candidate MV list including a candidate MV for an affine merge mode having two control points and a candidate MV list including a candidate MV for an affine merge mode having three control points may be generated. Alternatively, a candidate MV list including a candidate MV for one of an affine merge mode having two control points and an affine merge mode having three control points may be generated. The candidate MVs may be, for example, the MVs of coded block A (left), block B (top), block C (top right), block D (bottom left), and block E (top left), or may be the MVs of valid blocks among these blocks.

[0362] Note that an index indicating which candidate MV in the candidate MV list is being sent as the MV selection information.

[0363] [MV Derivation > Affine Mode > Affine Intermode] FIG. 51 is a flowchart showing an example of the affine inter mode.

[0364] In the affine inter mode, the inter prediction unit 126 first derives predicted MVs (v0, v1) or (v0, v1, v2) for each of two or three control points of the current block (step Sj_1). The control points are the upper left, upper right, or lower left corners of the current block, as shown in Figure 46A or 46B.

[0365] For example, when using the MV derivation methods shown in Figures 48A and 48B, the inter prediction unit 126 derives the predicted MV (v0, v1) or (v0, v1, v2) of the control point of the current block by selecting the MV of any of the coded blocks near each control point of the current block shown in Figure 48A or 48B. At this time, the inter prediction unit 126 encodes predicted MV selection information for identifying the selected two or three predicted MVs into the stream.

[0366] For example, the inter prediction unit 126 may use cost evaluation or the like to determine which block's MV to select as the prediction MV for the control point from among the coded blocks adjacent to the current block, and may write a flag indicating which prediction MV has been selected in the bitstream. That is, the inter prediction unit 126 outputs prediction MV selection information such as a flag as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit 130.

[0367] Next, the inter prediction unit 126 performs motion search (steps Sj_3 and Sj_4) while updating each of the prediction MVs selected or derived in step Sj_1 (step Sj_2). That is, the inter prediction unit 126 calculates the MV of each sub-block corresponding to the updated prediction MV as an affine MV using the above-mentioned formula (1A) or (1B) (step Sj_3). Then, the inter prediction unit 126 performs motion compensation for each sub-block using the affine MVs and coded reference pictures (step Sj_4). The processes of steps Sj_3 and Sj_4 are performed for all blocks in the current block every time the prediction MV is updated in step Sj_2. As a result, the inter prediction unit 126 determines, for example, the prediction MV that obtains the smallest cost in the motion search loop as the MV of the control point (step Sj_5). At this time, the inter prediction unit 126 further encodes the difference value between the determined MV and the prediction MV as a differential MV into a stream. That is, the inter prediction unit 126 outputs the differential MV as a prediction parameter to the entropy coding unit 110 via the prediction parameter generation unit .

[0368] Finally, the inter prediction unit 126 performs motion compensation on the current block using the determined MV and the coded reference picture, thereby generating a predicted image of the current block (step Sj_6).

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

[0370] The candidate MV list may include candidate MVs for modes other than the affine mode that perform prediction on a sub-block basis.

[0371] Note that a candidate MV list including candidate MVs for an affine inter mode having two control points and candidate MVs for an affine inter mode having three control points may be generated. Alternatively, a candidate MV list including candidate MVs for an affine inter mode having two control points and a candidate MV list including candidate MVs for an affine inter mode having three control points may be generated. Alternatively, a candidate MV list including candidate MVs for one of an affine inter mode having two control points and an affine inter mode having three control points may be generated. The candidate MVs may be, for example, MVs for coded block A (left), block B (top), block C (top right), block D (bottom left), and block E (top left), or MVs for valid blocks among these blocks.

[0372] Note that an index indicating which candidate MV in the candidate MV list is being sent as predicted MV selection information.

[0373] [MV Derivation > Triangle Mode] In the above example, the inter prediction unit 126 generates one rectangular predicted image for the rectangular current block. However, the inter prediction unit 126 may generate multiple predicted images of shapes other than a rectangle for the rectangular current block and combine the multiple predicted images to generate a final rectangular predicted image. The shape other than a rectangle may be, for example, a triangle.

[0374] FIG. 52A is a diagram for explaining generation of predicted images of two triangles.

[0375] The inter prediction unit 126 generates a triangular predicted image by performing motion compensation on a first partition of a triangle in the current block using a first MV of the first partition. Similarly, the inter prediction unit 126 generates a triangular predicted image by performing motion compensation on a second partition of a triangle in the current block using a second MV of the second partition. The inter prediction unit 126 then combines these predicted images to generate a predicted image that is the same rectangle as the current block.

[0376] Note that a first rectangular predicted image corresponding to the current block may be generated using a first MV as the predicted image for the first partition. Also, a second rectangular predicted image corresponding to the current block may be generated using a second MV as the predicted image for the second partition. A predicted image for the current block may be generated by weighting and adding the first predicted image and the second predicted image. Note that the portion subjected to weighting and adding may be limited to a partial area sandwiching the boundary between the first partition and the second partition.

[0377] FIG. 52B is a conceptual diagram illustrating an example of a first portion of a first partition that overlaps a second partition, as well as first and second sample sets that may be weighted as part of the correction process. The first portion may be, for example, one-quarter the width or height of the first partition. In another example, the first portion may have a width corresponding to N samples adjacent to an edge of the first partition, where N is an integer greater than zero, e.g., N may be the integer 2. The left example of FIG. 52B illustrates a rectangular partition having a rectangular portion that is one-quarter the width of the first partition. Here, the first sample set includes samples outside and inside the first portion, and the second sample set includes samples within the first portion. The center example of FIG. 52B illustrates a rectangular partition having a rectangular portion that is one-quarter the height of the first partition. Here, the first sample set includes samples outside and inside the first portion, and the second sample set includes samples within the first portion. The example on the right of Figure 52B shows a triangular partition with polygonal portions of height corresponding to two samples, where a first sample set includes samples outside the first portion and samples inside the first portion, and a second sample set includes samples within the first portion.

[0378] The first portion may be a portion of the first partition that overlaps with an adjacent partition. Figure 52C is a conceptual diagram illustrating a first portion of a first partition that overlaps with a portion of an adjacent partition. For ease of explanation, a rectangular partition is shown having an overlapping portion with a spatially adjacent rectangular partition. Partitions having other shapes, such as triangular partitions, may be used, and the overlapping portion may overlap with a spatially or temporally adjacent partition.

[0379] Also, although an example is shown in which a predicted image is generated for each of two partitions using inter prediction, a predicted image may be generated for at least one partition using intra prediction.

[0380] FIG. 53 is a flowchart showing an example of the triangle mode.

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

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

[0383] Then, the inter prediction unit 126 selects a candidate MV for the first partition and a candidate MV for the second partition as the first MV and the second MV, respectively, from the multiple candidate MVs acquired in step Sx_2 (step Sx_3). At this time, the inter prediction unit 126 may encode MV selection information for identifying the selected candidate MVs into the stream as a prediction parameter. That is, the inter 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.

[0384] Next, the inter prediction unit 126 generates a first predicted image by performing motion compensation using the selected first MV and a coded reference picture (step Sx_4). Similarly, the inter prediction unit 126 generates a second predicted image by performing motion compensation using the selected second MV and a coded reference picture (step Sx_5).

[0385] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing weighted addition of the first predicted image and the second predicted image (step Sx_6).

[0386] In the example shown in Figure 52A, the first and second partitions are each triangular, but they may also be trapezoidal, or may have different shapes. Furthermore, in the example shown in Figure 52A, the current block is made up of two partitions, but it may also be made up of three or more partitions.

[0387] The first and second partitions may overlap, i.e., the first and second partitions may include the same pixel area. In this case, a predicted image for the current block may be generated using a predicted image for the first partition and a predicted image for the second partition.

[0388] Furthermore, although this example shows an example in which predicted images are generated by inter prediction for both of the two partitions, predicted images may be generated by intra prediction for at least one partition.

[0389] The candidate MV list for selecting the first MV and the candidate MV list for selecting the second MV may be different or may be the same candidate MV list.

[0390] The partition information may include at least an index indicating the division direction for dividing the current block into multiple partitions. The MV selection information may include an index indicating the selected first MV and an index indicating the selected second MV. One index may indicate multiple pieces of information. For example, one index may be coded that collectively indicates part or all of the partition information and part or all of the MV selection information.

[0391] [MV derivation > ATMVP mode] FIG. 54 shows an example of the ATMVP mode in which MVs are derived for each subblock.

[0392] The ATMVP mode is a mode classified as a merge mode. For example, in the ATMVP mode, candidate MVs are registered in sub-block units in the candidate MV list used in the normal merge mode.

[0393] Specifically, in ATMVP mode, first, as shown in Figure 54, a temporal MV reference block associated with the current block is identified in a coded reference picture specified by the MV (MV0) of the block adjacent to the lower left of the current block. Next, for each sub-block in the current block, the MV used when coding the area corresponding to that sub-block in the temporal MV reference block is identified. The MVs thus identified are included in a candidate MV list as candidate MVs for the sub-blocks of the current block. When such a candidate MV for each sub-block is selected from the candidate MV list, motion compensation is performed on that sub-block using the candidate MV as the MV for that sub-block. This generates a predicted image for each sub-block.

[0394] In the example shown in Figure 54, the block adjacent to the lower left of the current block is used as the surrounding MV reference block, but other blocks may also be used. Also, the size of the sub-block may be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block may be switched in units of slice, brick, picture, or the like.

[0395] [Motion Search > DMVR] FIG. 55 is a diagram showing the relationship between merge mode and DMVR.

[0396] The inter prediction unit 126 derives an MV of the current block in merge mode (step Sl_1). Next, the inter prediction unit 126 determines whether or not to search for an MV, i.e., perform motion search (step Sl_2). Here, if the inter prediction unit 126 determines not to perform motion search (No in step Sl_2), it determines the MV derived in step Sl_1 as the final MV for the current block (step Sl_4). That is, in this case, the MV of the current block is determined in merge mode.

[0397] On the other hand, if it is determined in step S1_1 that motion estimation is to be performed (Yes in step S1_2), the inter prediction unit 126 derives a final MV for the current block by searching the surrounding area of ​​the reference picture indicated 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 the DMVR.

[0398] FIG. 56 is a conceptual diagram for explaining an example of DMVR for determining MV.

[0399] First, for example, in merge mode, candidate MVs (L0 and L1) are selected for the current block. Then, reference pixels are identified from the first reference picture (L0), which is a coded picture in the L0 list, according to the candidate MV (L0). Similarly, reference pixels are identified from the second reference picture (L1), which is a coded picture in the L1 list, according to the candidate MV (L1). A template is generated by averaging these reference pixels.

[0400] Next, using the template, the surrounding areas of the candidate MVs in the first reference picture (L0) and the second reference picture (L1) are searched, and the MV with the smallest cost is determined as the final MV for the current block. Note that the cost may be calculated using, for example, the difference value between each pixel value of the template and each pixel value of the search area, the candidate MV value, etc.

[0401] Any process may be used other than the process described here, as long as it is a process that can search around the candidate MVs and derive the final MV.

[0402] Fig. 57 is a conceptual diagram for explaining another example of a DMVR for determining an MV. In this example shown in Fig. 57, unlike the example of the DMVR shown in Fig. 56, costs are calculated without generating a template.

[0403] First, the inter prediction unit 126 searches around the reference blocks included in the reference pictures of the L0 list and the L1 list, based on the initial MV, which is a candidate MV acquired from the candidate MV list. For example, as shown in FIG. 57 , the initial MV corresponding to the reference block in the L0 list is InitMV_L0, and the initial MV corresponding to the reference block in the L1 list is InitMV_L1. In motion search, the inter prediction unit 126 first sets a search position for the reference picture in the L0 list. A difference vector indicating the set search position, specifically, a difference vector from the position indicated by the initial MV (i.e., InitMV_L0) to the search position, is MVd_L0. Then, the inter prediction unit 126 determines a search position in the reference picture in the L1 list. This search position is indicated by a difference vector from the position indicated by the initial MV (i.e., InitMV_L1) to the search position. Specifically, the inter prediction unit 126 determines the difference vector as MVd_L1 by mirroring MVd_L0. That is, the inter prediction unit 126 sets a position symmetrical to the position indicated by the initial MV in each of the reference pictures in the L0 list and the L1 list as a search position. For each search position, the inter prediction unit 126 calculates a cost such as the sum of absolute differences (SAD) of pixel values ​​in the block at that search position, and finds the search position that minimizes the cost.

[0404] FIG. 58A is a diagram showing an example of motion estimation in DMVR, and FIG. 58B is a flowchart showing this example of motion estimation.

[0405] First, in Step 1, the inter prediction unit 126 calculates the costs of the search position (also called the starting point) indicated by the initial MV and the eight search positions surrounding it. Then, the inter prediction unit 126 determines whether the cost of the search positions other than the starting point is the smallest. Here, if the inter prediction unit 126 determines that the cost of the search positions other than the starting point is the smallest, it moves to the search position with the smallest cost and performs the process of Step 2. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 126 skips the process of Step 2 and performs the process of Step 3.

[0406] In Step 2, the inter prediction unit 126 performs a search similar to the process in Step 1, using the search position moved in accordance with the processing result of Step 1 as a new starting point. Then, the inter prediction unit 126 determines whether the cost of a search position other than the starting point is the smallest. Here, if the cost of a search position other than the starting point is the smallest, the inter prediction unit 126 performs the process in Step 4. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 126 performs the process in Step 3.

[0407] In Step 4, the inter prediction unit 126 treats the search position of the start 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.

[0408] In Step 3, the inter prediction unit 126 determines the decimal precision pixel position with the smallest cost based on the costs at four points above, below, left, and right of the starting point of Step 1 or Step 2, and sets that pixel position as the final search position. The decimal precision pixel position is determined by weighting and adding the vectors ((0,1), (0,-1), (-1,0), (1,0)) of the four points above, below, left, and right, using the costs at each of the four search positions as weights. The inter prediction unit 126 then determines the difference between the position indicated by the initial MV and that final search position as a difference vector.

[0409] [Motion Compensation > BIO / OBMC / LIC] Motion compensation includes modes in which a predicted image is generated and then corrected, such as BIO, OBMC, and LIC, which will be described later.

[0410] FIG. 59 is a flowchart showing an example of generation of a predicted image.

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

[0412] FIG. 60 is a flowchart showing another example of generation of a predicted image.

[0413] The inter prediction unit 126 derives an MV of the current block (step Sn_1). Next, the inter prediction unit 126 generates a predicted image using the MV (step Sn_2) and determines whether or not to perform correction processing (step Sn_3). Here, if the inter prediction unit 126 determines that correction processing is to be performed (Yes in step Sn_3), it corrects the predicted image to generate a final predicted image (step Sn_4). Note that in LIC, which will be described later, luminance and chrominance may be corrected in step Sn_4. On the other hand, if the inter prediction unit 126 determines that correction processing is not to be performed (No in step Sn_3), it outputs the predicted image as a final predicted image without correction (step Sn_5).

[0414] [Motion Compensation > OBMC] An inter-prediction image may be generated using not only the motion information of the current block obtained by motion estimation but also the motion information of the neighboring blocks. Specifically, an inter-prediction image may be generated for each sub-block in the current block by weighting and adding a predicted image based on the motion information obtained by motion estimation (in the reference picture) and a predicted image based on the motion information of the neighboring blocks (in the current picture). Such inter-prediction (motion compensation) may be called OBMC (overlapped block motion compensation) or OBMC mode.

[0415] In the OBMC mode, information indicating the size of a sub-block for OBMC (e.g., referred to as an OBMC block size) may be signaled at the sequence level. Furthermore, information indicating whether the OBMC mode is applied (e.g., referred to as an OBMC flag) may be signaled at the CU level. Note that the signaling level of this information is not limited to the sequence level and the CU level, and may be at other levels (e.g., the picture level, slice level, brick level, CTU level, or sub-block level).

[0416] The OBMC mode will now be described in more detail. Figures 61 and 62 are a flowchart and a conceptual diagram for explaining an outline of the predictive image correction process using OBMC.

[0417] First, a predicted image (Pred) is obtained by normal motion compensation using the MV assigned to the current block, as shown in Figure 62. In Figure 62, the arrow "MV" points to a reference picture, indicating what the current block of the current picture is referring to in order to obtain the predicted image.

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

[0419] Similarly, the MV (MV_U) already derived for the coded upper neighboring block is applied (reused) to the current block to obtain a predicted image (Pred_U). The MV (MV_U) is indicated by an arrow "MV_U" pointing from the current block to the reference picture. The predicted image Pred_U is then superimposed on the predicted image (e.g., Pred and Pred_L) that has undergone the first correction, thereby performing a second correction of the predicted image. 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).

[0420] Note that the above example is a two-pass correction method using the left-adjacent and above-adjacent blocks, but the correction method may also be a three-pass or more-pass correction method using the right-adjacent and / or below-adjacent blocks.

[0421] The area to be superimposed does not have to be the pixel area of ​​the entire block, but may be only a part of the area near the block boundary.

[0422] Here, the OBMC predicted image correction process has been described, in which additional predicted images Pred_L and Pred_U are superimposed from one reference picture to obtain one predicted image Pred. However, when a predicted image is corrected based on multiple reference pictures, the same process may be applied to each of the multiple reference pictures. In such a case, the OBMC image correction based on multiple reference pictures is performed to obtain a corrected predicted image from each reference picture, and then the obtained multiple corrected predicted images are further superimposed to obtain a final predicted image.

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

[0424] As a method for determining whether to apply OBMC, for example, there is a method using obmc_flag, which is a signal indicating whether to apply OBMC. As a specific example, the encoding device 100 may determine whether the current block belongs to an area with complex motion. If the current block belongs to an area with complex motion, the encoding device 100 sets the value of obmc_flag to 1 and applies OBMC to perform encoding, and if the current block does not belong to an area with complex motion, the encoding device 100 sets the value of obmc_flag to 0 and performs encoding of the block without applying OBMC. Meanwhile, the decoding device 200 decodes obmc_flag described in the stream, and switches whether to apply OBMC depending on the value, and performs decoding.

[0425] [Motion Compensation > BIO] Next, a method for deriving MV will be described. First, a mode for deriving MV based on a model assuming uniform linear motion will be described. This mode is sometimes called BIO (bi-directional optical flow) mode. This bi-directional optical flow may also be expressed as BDOF instead of BIO.

[0426] Figure 63 is a diagram illustrating a model assuming uniform linear motion. In Figure 63, (vx, vy) indicates a velocity vector, and τ0 and τ1 indicate the temporal distances between the current picture (Cur Pic) and two reference pictures (Ref0, Ref1), respectively. (MVx0, MVy0) indicate the MV corresponding to reference picture Ref0, and (MVx1, MVy1) indicate the MV corresponding to reference picture Ref1.

[0427] In this case, under the assumption of uniform linear motion of the velocity vector (vx, vy), (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.

[0428]

number

[0429] Here, I(k) denotes the luminance value of reference image k (k=0, 1) after motion compensation. This optical flow equation indicates that the sum of (i) the time derivative of the luminance 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. Based on a combination of this optical flow equation and Hermite interpolation, block-wise motion vectors obtained from a candidate MV list or the like may be corrected pixel by pixel.

[0430] Note that the MV may be derived on the decoding device 200 side using a method different from the method of deriving a motion vector based on a model assuming uniform linear motion. For example, a motion vector may be derived for each sub-block based on the MVs of multiple adjacent blocks.

[0431] Fig. 64 is a flowchart showing an example of inter prediction according to BIO, and Fig. 65 is a diagram showing an example of the functional configuration of inter prediction unit 126 that performs inter prediction according to BIO.

[0432] 65, the inter prediction unit 126 includes, for example, a memory 126a, an interpolated 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. Note that the memory 126a may be the frame memory 122.

[0433] The inter prediction unit 126 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) including the current block. Then, the inter prediction unit 126 derives a predicted image of the current block using the two motion vectors (M0, M1) (step Sy_1). Note that 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.

[0434] Next, the interpolated image derivation unit 126b refers to the memory 126a and derives an interpolated image I of the current block using the motion vector M0 and the reference picture L0. 0 Furthermore, the interpolated image derivation unit 126b derives an interpolated image I of the current block by referring to the memory 126a and using the motion vector M1 and the reference picture L1. 1 (Step Sy_2). Here, the interpolated image I 0 is an image included in the reference picture Ref0 derived for the current block, and is an interpolated image I 1 is the image contained in the reference picture Ref1 that is derived for the current block. 0 and the interpolated image I 1 may each be the same size as the current block, or the interpolated image I 0 and the interpolated image I 1 Each of the interpolated images I may be larger than the current block in order to properly derive the gradient image described below. 0 and I 1may include a predicted image derived by applying a motion vector (M0, M1) and a reference picture (L0, L1) and a motion compensation filter.

[0435] The gradient image derivation unit 126c also generates the interpolated image I 0 and the interpolated image I 1 From the gradient image of the current block (Ix 0 ,Ix 1 ,Iy 0 ,Iy 1 ) is derived (step Sy_3). The horizontal gradient image is (Ix 0 ,Ix 1 ), and the vertical gradient image is (Iy 0 ,Iy 1 ) The gradient image derivation unit 126c may derive the gradient image by, for example, applying a gradient filter to the interpolated image. The gradient image may be any image that indicates the spatial variation of pixel values ​​along the horizontal or vertical direction.

[0436] Next, the optical flow derivation unit 126d calculates an interpolated image (I 0 ,I 1 ) and gradient image (Ix 0 ,Ix 1 ,Iy 0 ,Iy 1 ) to derive the optical flow (vx, vy), which is the velocity vector mentioned above (step Sy_4). The optical flow is a coefficient that corrects the spatial movement amount of pixels, and may also be called a local motion estimate, a correction motion vector, or a correction weight vector. As an example, the sub-block may be a sub-CU of 4x4 pixels. Note that the optical flow may be derived not in units of sub-blocks but in other units such as in units of pixels.

[0437] Next, the inter prediction unit 126 corrects the predicted image of the current block using the optical flow (vx, vy). For example, the correction value derivation unit 126e derives correction values ​​for the values ​​of pixels included in the current block using the optical flow (vx, vy) (step Sy_5). Then, the predicted image correction unit 126f may correct the predicted image of the current block using the correction values ​​(step Sy_6). Note that the correction values ​​may be derived for each pixel, or may be derived for multiple pixels or sub-blocks.

[0438] The processing flow of the BIO is not limited to the processing disclosed in Fig. 64. Only a part of the processing disclosed in Fig. 64 may be performed, different processing may be added or replaced, or the processing may be performed in a different order.

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

[0440] Fig. 66A is a diagram illustrating an example of a method for generating a predicted image using a luminance correction process by an LIC, and Fig. 66B is a flowchart illustrating an example of the method for generating a predicted image using the LIC.

[0441] First, the inter prediction unit 126 derives an MV from an already-encoded reference picture to obtain a reference image corresponding to the current block (Step Sz_1).

[0442] Next, the inter prediction unit 126 extracts information indicating how the luminance values ​​of the current block have changed between the reference picture and the current picture (step Sz_2). This extraction is performed based on the luminance pixel values ​​of the coded left-adjacent reference area (peripheral reference area) and the coded upper-adjacent reference area (peripheral reference area) in the current picture, and the luminance pixel values ​​at the equivalent positions in the reference picture specified by the derived MV. Then, the inter prediction unit 126 calculates a luminance correction parameter using the information indicating how the luminance values ​​have changed (step Sz_3).

[0443] The inter prediction unit 126 generates a predicted image for the current block by performing luminance correction processing that applies the luminance correction parameter to a reference image in a reference picture specified by the MV (step Sz_4). That is, correction based on the luminance correction parameter is performed on the predicted image that is a reference image in a reference picture specified by the MV. In this correction, luminance may be corrected, or chrominance may be corrected. That is, chrominance correction parameters may be calculated using information indicating how chrominance has changed, and chrominance correction processing may be performed.

[0444] The shape of the peripheral reference region in FIG. 66A is an example, and other shapes may be used.

[0445] Although the process of generating a predicted image from one reference picture has been described here, the same applies when generating a predicted image from multiple reference pictures, and the reference images obtained from each reference picture may be subjected to brightness correction processing in the same manner as described above before generating a predicted image.

[0446] 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, the encoding device 100 determines whether the current block belongs to an area where a luminance change occurs, and if the current block belongs to an area where a luminance change occurs, sets the value of lic_flag to 1 and performs encoding by applying LIC, and if the current block does not belong to an area where a luminance change occurs, sets the value of lic_flag to 0 and performs encoding without applying LIC. On the other hand, the decoding device 200 may decode lic_flag described in the stream, and perform decoding by switching whether to apply LIC depending on the value.

[0447] As another method for determining whether to apply LIC, for example, there is a method of determining whether LIC has been applied to neighboring blocks. As a specific example, when the current block is processed in merge mode, the inter prediction unit 126 determines whether the neighboring coded blocks selected when deriving the MV in merge mode have been coded using LIC. Depending on the result, the inter prediction unit 126 switches whether to apply LIC and performs coding. Note that even in this example, the same process is applied to the process on the decoding device 200 side.

[0448] LIC (luminance correction processing) has been explained using FIGS. 66A and 66B, and will be explained in detail below.

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

[0450] Next, the inter prediction unit 126 uses the luminance pixel values ​​of the coded surrounding reference areas adjacent to the left and above the current block and the luminance pixel values ​​at the equivalent positions in the reference picture specified by the MV to extract information indicating how the luminance values ​​have changed between the reference picture and the current picture, and calculates luminance correction parameters. For example, the luminance pixel value of a pixel in the surrounding reference area in the current picture is set to p0, and the luminance pixel value of a pixel in the surrounding reference area in the reference picture at the equivalent position to the pixel is set to p1. The inter prediction unit 126 calculates coefficients A and B that optimize A×p1+B=p0 as luminance correction parameters for multiple pixels in the surrounding reference areas.

[0451] Next, the inter prediction unit 126 performs luminance correction processing on the reference image in the reference picture specified by the MV using the luminance correction parameter, thereby generating a predicted image for the current block. For example, the luminance pixel value in the reference image is set to p2, and the luminance pixel value of the predicted image after the luminance correction processing is set to p3. The inter prediction unit 126 generates a predicted image after the luminance correction processing by calculating A×p2+B=p3 for each pixel in the reference image.

[0452] Note that a part of the surrounding reference area shown in FIG. 66A may be used. For example, an area including a predetermined number of pixels thinned out from each of the upper adjacent pixels and the left adjacent pixels may be used as the surrounding reference area. Furthermore, the surrounding reference area is not limited to an area adjacent to the current block, but may also be an area not adjacent to the current block. Furthermore, in the example shown in FIG. 66A, the surrounding reference area in the reference picture is an area specified by the MV of the current picture from the surrounding reference area in the current picture, but it may also be an area specified by another MV. For example, the other MV may be the MV of the surrounding reference area in the current picture.

[0453] Although the operation of the encoding device 100 has been described above, the operation of the decoding device 200 is similar.

[0454] Note that LIC may be applied to color difference as well as luminance. In this case, correction parameters may be derived individually for Y, Cb, and Cr, or a common correction parameter may be used for any of them.

[0455] Alternatively, the LIC process may be applied to each sub-block. For example, the correction parameters may be derived using the surrounding reference regions of the current sub-block and the surrounding reference regions of the reference sub-blocks in the reference picture specified by the MV of the current sub-block.

[0456] [Predictive control unit] The prediction control unit 128 selects either an intra-predicted image (an image or signal output from the intra-prediction unit 124) or an inter-predicted image (an image or signal output from the inter-prediction unit 126), and outputs the selected predicted image to the subtraction unit 104 and the addition unit 116.

[0457] [Prediction parameter generation part] The prediction parameter generation unit 130 may output information related to intra prediction, inter prediction, and selection of a predicted image by the 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 be used by the decoding device 200. The decoding device 200 may receive and decode the stream and 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. The prediction parameters may include a selected 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 or indicating the prediction processing performed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128.

[0458] [Decryption device] Next, a description will be given of a decoding device 200 capable of decoding the stream output from the above-described encoding device 100. Fig. 67 is a block diagram showing an example of the functional configuration of the decoding device 200 according to an embodiment. The decoding device 200 is a device that decodes a stream, which is an encoded image, in units of blocks.

[0459] 67, the decoding device 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transform unit 206, an adder 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. Note that the intra prediction unit 216 and the inter prediction unit 218 are each configured as part of a prediction processing unit.

[0460] [Example of implementation of a decryption device] Figure 68 is a block diagram showing an implementation example of decoding device 200. Decoding device 200 includes processor b1 and memory b2. For example, several components of decoding device 200 shown in Figure 67 are implemented by processor b1 and memory b2 shown in Figure 68.

[0461] The processor b1 is a circuit that performs information processing and is a circuit that can access the memory b2. For example, the processor b1 is a dedicated or general-purpose electronic circuit that decodes a stream. The processor b1 may be a processor such as a CPU. The processor b1 may also be a collection of multiple electronic circuits. For example, the processor b1 may fulfill the roles of multiple components of the decoding device 200 shown in FIG. 67 and the like, excluding the component for storing information.

[0462] The memory b2 is a dedicated or general-purpose memory that stores information for the processor b1 to decode the stream. The memory b2 may be an electronic circuit and may be connected to the processor b1. The memory b2 may also be included in the processor b1. The memory b2 may also be a collection of multiple electronic circuits. The memory b2 may also be a magnetic disk, an optical disk, or the like, and may also be expressed as a storage or a recording medium. The memory b2 may also be a non-volatile memory or a volatile memory.

[0463] For example, the memory b2 may store an image or a stream, or may store a program for the processor b1 to decode the stream.

[0464] Furthermore, for example, memory b2 may serve as a component for storing information among the multiple components of decoding device 200 shown in Figure 67 etc. Specifically, memory b2 may serve as the block memory 210 and frame memory 214 shown in Figure 67. More specifically, memory b2 may store a reconstructed image (specifically, a reconstructed block or a reconstructed picture etc.).

[0465] Note that not all of the components shown in Figure 67 etc. may be implemented, and not all of the above-described processes may be performed, in decoding device 200. Some of the components shown in Figure 67 etc. may be included in another device, and some of the above-described processes may be executed by another device.

[0466] Hereinafter, the overall processing flow of the decoding device 200 will be described, followed by a description of each component included in the decoding device 200. Note that detailed description of the components included in the decoding device 200 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 transform unit 206, the adder 208, the block memory 210, the frame memory 214, the intra prediction unit 216, the inter 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 transform unit 114, the adder 116, the block memory 118, the frame memory 122, the intra prediction unit 124, the inter prediction unit 126, the prediction control unit 128, and the loop filter unit 120 included in the encoding device 100, respectively.

[0467] [Overall flow of decryption process] FIG. 69 is a flowchart showing an example of the overall decoding process by the decoding device 200.

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

[0469] The entropy decoding unit 202 decodes (specifically, entropy decodes) the coded quantized coefficients and prediction parameters of the current block (step Sp_2).

[0470] Next, the inverse quantization unit 204 and the inverse transform unit 206 perform inverse quantization and inverse transform on the multiple quantized coefficients to reconstruct the prediction residuals of the current block (step Sp_3).

[0471] Next, the prediction processing unit, which is made up 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).

[0472] Next, the adder 208 reconstructs the current block into a reconstructed image (also called a decoded image block) by adding the predicted image to the prediction residual (step Sp_5).

[0473] Then, when this reconstructed image is generated, the loop filter unit 212 performs filtering on the reconstructed image (step Sp_6).

[0474] Then, the decoding device 200 determines whether or not the decoding of the entire picture is completed (step Sp_7), and if it determines that the decoding is not completed (No in step Sp_7), it repeats the processing from step Sp_1.

[0475] The processes of steps Sp_1 to Sp_7 may be performed sequentially by the decoding device 200, or some of the processes may be performed in parallel, or the order of the processes may be changed.

[0476] [Division decision section] 70 is a diagram showing the relationship between the division determination section 224 and other components. The division determination section 224 may perform the following process, for example.

[0477] The partition determination unit 224 may, for example, collect block information from the block memory 210 or the frame memory 214, and further acquire parameters from the entropy decoding unit 202. The partition determination unit 224 may then determine a partition pattern for fixed-size blocks based on the block information and the parameters. The partition determination unit 224 may then output information indicating the determined partition pattern to the inverse transform unit 206, the intra prediction unit 216, and the inter prediction unit 218. The inverse transform unit 206 may perform an inverse transform on the transform coefficients based on the partition pattern indicated by the information from the partition determination unit 224. The intra prediction unit 216 and the inter prediction unit 218 may generate a predicted image based on the partition pattern indicated by the information from the partition determination unit 224.

[0478] [Entropy Decoding] FIG. 71 is a block diagram showing an example of the functional configuration of the entropy decoding unit 202.

[0479] The entropy decoding unit 202 entropy-decodes the stream to generate quantization coefficients, prediction parameters, parameters related to the division pattern, and the like. For example, CABAC is used for 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-value conversion unit 202c. The binary arithmetic decoding unit 202a arithmetically decodes the stream into a binary signal using a context value derived by the context control unit 202b. Similar to the context control unit 110b of the encoding device 100, the context control unit 202b derives a context value, i.e., the probability of occurrence of a binary signal, according to the characteristics of a syntax element or the surrounding circumstances. The multi-value conversion unit 202c converts the binary signal output from the binary arithmetic decoding unit 202a into a multi-value signal indicating the above-mentioned quantization coefficients, etc. (debinarization). This multi-value conversion is performed according to the above-mentioned binarization method.

[0480] The entropy decoding unit 202 outputs the quantized coefficients on a block-by-block basis to the inverse quantization unit 204. The entropy decoding unit 202 may output prediction parameters included in the stream (see FIG. 1 ) to the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. The intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 can perform the same prediction processing as the processing performed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 on the encoding device 100 side.

[0481] [Entropy Decoding] FIG. 72 is a diagram showing the flow of CABAC in the entropy decoding unit 202.

[0482] First, initialization is performed in CABAC in the entropy decoding unit 202. This initialization involves initialization of the binary arithmetic decoding unit 202a and setting of initial context values. Then, the binary arithmetic decoding unit 202a and the multi-value conversion unit 202c perform arithmetic decoding and multi-value conversion on, for example, the coded data of a CTU. At this time, the context control unit 202b updates the context values ​​every time arithmetic decoding is performed. Then, as post-processing, the context control unit 202b saves the context values. The saved context values ​​are used, for example, as the initial context values ​​for the next CTU.

[0483] [Dequantization section] The inverse quantization unit 204 inverse quantizes the quantized coefficients of the current block that are input from the entropy decoding unit 202. Specifically, the inverse quantization unit 204 inverse quantizes each quantized coefficient of the current block based on a quantization parameter corresponding to the quantized coefficient. The inverse quantization unit 204 then outputs the inverse quantized coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.

[0484] FIG. 73 is a block diagram showing an example of the functional configuration of the inverse quantization unit 204.

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

[0486] FIG. 74 is a flowchart showing an example of inverse quantization by the inverse quantization unit 204.

[0487] For example, the inverse quantization unit 204 may perform inverse quantization processing for each CU based on the flow shown in Fig. 74. Specifically, the quantization parameter generation unit 204a determines whether or not to perform inverse quantization (step Sv_11). Here, if it is determined that inverse quantization is to be performed (Yes in step Sv_11), the quantization parameter generation unit 204a acquires a differential quantization parameter of the current block from the entropy decoding unit 202 (step Sv_12).

[0488] Next, the predicted quantization parameter generation unit 204b acquires a quantization parameter for a processing unit different from that of the current block from the quantization parameter storage unit 204d (step Sv_13). The predicted quantization parameter generation unit 204b generates a predicted quantization parameter for the current block based on the acquired quantization parameter (step Sv_14).

[0489] Then, the quantization parameter generation unit 204a adds the difference quantization parameter of the current block acquired from the entropy decoding unit 202 to the predicted quantization parameter of the current block generated by the predicted quantization parameter generation unit 204b (step Sv_15). This addition generates a quantization parameter of the current block. Furthermore, the quantization parameter generation unit 204a stores the quantization parameter of the current block in the quantization parameter storage unit 204d (step Sv_16).

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

[0491] The differential quantization parameter may be decoded at the bit sequence level, picture level, slice level, brick level, or CTU level. Also, the initial value of the quantization parameter may be decoded at the sequence level, picture level, slice level, brick level, or CTU level. In this case, the quantization parameter may be generated using the initial value of the quantization parameter and the differential quantization parameter.

[0492] 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.

[0493] [Inverse conversion section] The inverse transform unit 206 restores the prediction residual by inverse transforming the transform coefficients input from the inverse quantization unit 204 .

[0494] For example, if the information interpreted from the stream indicates that EMT or AMT is to be applied (e.g., the AMT flag is true), the inverse transform unit 206 inverse transforms the transform coefficients of the current block based on the interpreted information indicating the transform type.

[0495] Also for example, if the information decoded from the stream indicates that NSST is to be applied, then the inverse transform unit 206 applies an inverse re-transform to the transform coefficients.

[0496] FIG. 75 is a flowchart showing an example of processing by the inverse conversion unit 206.

[0497] For example, the inverse transform unit 206 determines whether or not information indicating that an orthogonal transform is not performed is present in the stream (step St_11). If it is determined that such information is not present (No in step St_11), the inverse transform unit 206 acquires 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). Then, the inverse transform unit 206 performs an inverse orthogonal transform using the determined transform type (step St_14).

[0498] FIG. 76 is a flowchart showing another example of the processing by the inverse conversion unit 206.

[0499] For example, the inverse transform unit 206 determines whether the transform size is equal to or smaller than a predetermined value (step Su_11). If it is determined that the transform size is equal to or smaller than the predetermined value (Yes in step Su_11), the inverse transform unit 206 acquires information indicating which transform type, among the one or more transform types included in the first transform type group, has been used by the encoding device 100 from the entropy decoding unit 202 (step Su_12). Note that such information is decoded by the entropy decoding unit 202 and output to the inverse transform unit 206.

[0500] Based on the 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 inverse orthogonal transform on the transform coefficients of the current block using the determined transform type (step Su_14). On the other hand, if the inverse transform unit 206 determines in step Su_11 that the transform size is not equal to or less than the predetermined value (No in step Su_11), it performs inverse orthogonal transform on the transform coefficients of the current block using a second group of transform types (step Su_15).

[0501] For example, the inverse orthogonal transform by the inverse transform unit 206 may be performed for each TU according to the flow shown in FIG. 75 or 76. Alternatively, the inverse orthogonal transform may be performed using a predefined transform type without decoding information indicating the transform type used for the orthogonal transform. Specifically, the transform type is DST7 or DCT8, and the inverse orthogonal transform uses an inverse transform basis function corresponding to the transform type.

[0502] [Addition section] The adder 208 reconstructs the current block by adding the prediction residual input from the inverse transformer 206 and the predicted image input from the prediction control unit 220. In other words, a reconstructed image of the current block is generated. The adder 208 then outputs the reconstructed image of the current block to the block memory 210 and the loop filter unit 212.

[0503] [Block Memory] The block memory 210 is a storage unit for storing blocks in the current picture that are referenced in intra prediction. Specifically, the block memory 210 stores the reconstructed image output from the adder 208.

[0504] [Loop filter section] The loop filter unit 212 applies a loop filter to the reconstructed image generated by the adder unit 208, and outputs the filtered reconstructed image to a frame memory 214, a display device, or the like.

[0505] If the information interpreted from the stream indicating ALF on / off indicates that ALF is on, one filter is selected from multiple filters based on the local gradient direction and activity, and the selected filter is applied to the reconstructed image.

[0506] 77 is a block diagram showing an example of the functional configuration of the loop filter unit 212. Note that the loop filter unit 212 has the same configuration as the loop filter unit 120 of the encoding device 100.

[0507] As shown in FIG. 77, for example, the loop filter unit 212 includes a deblocking filter processor 212a, an SAO processor 212b, and an ALF processor 212c. The deblocking filter processor 212a performs the deblocking filter process described above on the reconstructed image. The SAO processor 212b performs the SAO process described above on the reconstructed image after the deblocking filter process. The ALF processor 212c applies the ALF process described above to the reconstructed image after the SAO process. The loop filter unit 212 does not need to include all of the processors disclosed in FIG. 77, and may include only some of the processors. The loop filter unit 212 may also be configured to perform the above processes in an order different from the order disclosed in FIG. 77.

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

[0509] [Prediction unit (intra prediction unit, inter prediction unit, prediction control unit)] 78 is a flowchart showing an example of processing performed by the prediction unit of the decoding device 200. Note that, as an example, the prediction unit is made up of all or some 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, for example, the intra prediction unit 216 and the inter prediction unit 218.

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

[0511] The reconstructed image may be, for example, an image of a reference picture, or an image of a decoded block (i.e., the other block) in a current picture, which is a picture including the current block. The decoded block in the current picture may be, for example, a neighboring block of the current block.

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

[0513] The prediction unit determines a method or mode for generating a predicted image (step Sr_1). For example, the method or mode may be determined based on prediction parameters, etc.

[0514] When the prediction unit determines that the first method is the mode for generating the predicted image, the prediction unit generates the predicted image according to the first method (step Sr_2a). When the prediction unit determines that the second method is the mode for generating the predicted image, the prediction unit generates the predicted image according to the second method (step Sr_2b). When the prediction unit determines that the third method is the mode for generating the predicted image, the prediction unit generates the predicted image according to the third method (step Sr_2c).

[0515] The first, second, and third methods are different methods for generating a predicted image, and may be, for example, an inter-prediction method, an intra-prediction method, or other prediction methods. These prediction methods may use the reconstructed image described above.

[0516] 80A and 80B are flowcharts showing another example of the processing performed by the prediction unit of the decoding device 200.

[0517] The prediction unit may perform prediction processing according to the flow shown in Figures 80A and 80B as an example. Note that the intra block copy shown in Figures 80A and 80B is a mode belonging to inter prediction, in which a block included in the current picture is referenced as a reference image or reference block. In other words, in intra block copy, a picture other than the current picture is not referenced. Also, the PCM mode shown in Figure 80A is a mode belonging to intra prediction, in which transformation and quantization are not performed.

[0518] [Intra prediction section] The intra prediction unit 216 generates a predicted image of the current block (i.e., an intra predicted image) by performing intra prediction with reference to blocks in the current picture stored in the block memory 210 based on the intra prediction mode interpreted from the stream. Specifically, the intra prediction unit 216 generates an intra predicted image by performing intra prediction with reference to pixel values ​​(e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra predicted image to the prediction control unit 220.

[0519] Note that when an intra prediction mode that references a luminance block in intra prediction of a chrominance block is selected, the intra prediction unit 216 may predict the chrominance component of the current block based on the luminance component of the current block.

[0520] Furthermore, when the information interpreted from the stream indicates the application of PDPC, the intra prediction unit 216 corrects pixel values ​​after intra prediction based on the gradients of reference pixels in the horizontal and vertical directions.

[0521] FIG. 81 is a diagram showing an example of processing by the intra prediction unit 216 of the decoding device 200.

[0522] The intra prediction unit 216 first determines whether or not an MPM flag indicating 1 is present in the stream (step Sw_11). If it is determined that an MPM flag indicating 1 is present (Yes in step Sw_11), the intra prediction unit 216 acquires information indicating the intra prediction mode selected in the encoding device 100 from the entropy decoding unit 202 (step Sw_12). Note that 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 an MPM (step Sw_13). The MPM consists of, for example, six intra prediction modes. Then, the intra prediction unit 216 determines the intra prediction mode indicated by the information acquired in step Sw_12 from among the multiple intra prediction modes included in the MPM (step Sw_14).

[0523] On the other hand, if the intra prediction unit 216 determines in step Sw_11 that the MPM flag indicating 1 does not exist in the stream (No in step Sw_11), it acquires information indicating the intra prediction mode selected in the encoding device 100 (step Sw_15). That is, the intra prediction unit 216 acquires information indicating the intra prediction mode selected in the encoding device 100 from the one or more intra prediction modes not included in the MPM, from the entropy decoding unit 202. Note that 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 acquired in step Sw_15 from the one or more intra prediction modes not included in the MPM (step Sw_17).

[0524] The intra prediction unit 216 generates a predicted image in accordance with the intra prediction mode determined in step Sw_14 or step Sw_17 (step Sw_18).

[0525] [Inter prediction section] The inter prediction unit 218 predicts the current block by referring to a reference picture stored in the frame memory 214. Prediction is performed in units of the current block or sub-blocks within the current block. Note that a sub-block is included in a block and is a smaller unit than a block. The size of a sub-block may be 4x4 pixels, 8x8 pixels, or another size. The size of a sub-block may be switched in units such as a slice, a brick, or a picture.

[0526] For example, the inter prediction unit 218 generates an inter prediction image of the current block or sub-block by performing motion compensation using motion information (e.g., MV) interpreted from the stream (e.g., prediction parameters output from the entropy decoding unit 202), and outputs the inter prediction image to the prediction control unit 220.

[0527] If the information interpreted from the stream indicates that the OBMC mode is to be applied, the inter prediction unit 218 generates an inter prediction image using not only the motion information of the current block obtained by motion estimation, but also the motion information of neighboring blocks.

[0528] Furthermore, if the information interpreted from the stream indicates that the FRUC mode is to be applied, the inter prediction unit 218 derives motion information by performing motion search according to the pattern matching method (bilateral matching or template matching) interpreted from the stream. Then, the inter prediction unit 218 performs motion compensation (prediction) using the derived motion information.

[0529] Furthermore, when the BIO mode is applied, the inter prediction unit 218 derives an MV based on a model assuming uniform linear motion. Furthermore, when information interpreted from the stream indicates that the affine mode is applied, the inter prediction unit 218 derives an MV for each sub-block based on the MVs of multiple adjacent blocks.

[0530] [MV derivation flow] FIG. 82 is a flowchart showing an example of MV derivation in the decoding device 200.

[0531] The inter prediction unit 218 determines, for example, whether to decode motion information (e.g., MV). For example, the inter prediction unit 218 may make the determination according to a prediction mode included in the stream, or may make the determination based on other information included in the stream. Here, when the inter prediction unit 218 determines to decode the motion information, it derives the MV of the current block in a mode for decoding the motion information. On the other hand, when the inter prediction unit 218 determines not to decode the motion information, it derives the MV in a mode for not decoding the motion information.

[0532] Here, MV derivation modes include normal inter mode, normal merge mode, FRUC mode, and affine mode, which will be described later. Among these modes, modes that decode motion information include normal inter mode, normal merge mode, and affine mode (specifically, affine inter mode and affine merge mode). Note that the motion information may include not only MV but also prediction MV selection information, which will be described later. Also, modes that do not decode motion information include FRUC 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.

[0533] FIG. 83 is a flowchart showing another example of MV derivation in the decoding device 200.

[0534] The inter prediction unit 218, for example, determines whether to decode a differential MV. For example, the inter prediction unit 218 may make the determination according to a prediction mode included in the stream, or may make the determination based on other information included in the stream. Here, when the inter prediction unit 218 determines to decode a differential MV, it may derive an MV of the current block in a mode for decoding the differential MV. In this case, for example, the differential MV included in the stream is decoded as a prediction parameter.

[0535] On the other hand, if the inter prediction unit 218 determines not to decode the differential MV, it derives the MV in a mode in which the differential MV is not decoded. In this case, the coded differential MV is not included in the stream.

[0536] As described above, MV derivation modes include normal inter, normal merge mode, FRUC mode, and affine mode, which will be described later. Among these modes, modes that encode differential MVs include normal inter mode and affine mode (specifically, affine inter mode). Furthermore, modes that do not encode differential MVs include FRUC mode, normal merge mode, and affine mode (specifically, 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.

[0537] [MV Derivation > Normal Intermode] For example, if the information interpreted from the stream indicates that normal inter mode is to be applied, the inter prediction unit 218 derives an MV in normal merge mode based on the information interpreted from the stream, and performs motion compensation (prediction) using the MV.

[0538] FIG. 84 is a flowchart showing an example of inter prediction in the normal inter mode in the decoding device 200.

[0539] The inter prediction unit 218 of the decoding device 200 performs motion compensation on each block. At this time, the inter prediction unit 218 first obtains multiple candidate MVs for the current block based on information such as the MVs of multiple decoded blocks temporally or spatially surrounding the current block (step Sg_11). That is, the inter prediction unit 218 creates a candidate MV list.

[0540] Next, the inter prediction unit 218 extracts N candidate MVs (N is an integer equal to or greater than 2) from the plurality of candidate MVs acquired in step Sg_11 as motion vector predictor candidates (also referred to as predicted MV candidates) according to a predetermined priority order (step Sg_12). Note that the priority order is predetermined for each of the N predicted MV candidates.

[0541] 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 for the current block (step Sg_13).

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

[0543] 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 processes of steps Sg_11 to Sg_15 are performed for each block. For example, when the processes of steps Sg_11 to Sg_15 are performed for each of all blocks included in a slice, inter prediction using the normal inter mode for that slice is completed. Also, when the processes of steps Sg_11 to Sg_15 are performed for each of all blocks included in a picture, inter prediction using the normal inter mode for that picture is completed. Note that the processes of steps Sg_11 to Sg_15 do not have to be performed for all blocks included in a slice, and inter prediction using the normal inter mode for that slice may be completed when they are performed for some blocks. Similarly, when the processes of steps Sg_11 to Sg_15 are performed for some blocks included in a picture, inter prediction using the normal inter mode for that picture may be completed.

[0544] [MV Derivation > Normal Merge Mode] For example, when information interpreted from the stream indicates the application of the normal merge mode, the inter prediction unit 218 derives MVs in the normal merge mode and performs motion compensation (prediction) using the MVs.

[0545] FIG. 85 is a flowchart showing an example of inter prediction in the normal merge mode in the decoding device 200.

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

[0547] Next, the inter prediction unit 218 derives the MV of the current block by selecting one candidate MV from the multiple candidate MVs obtained in step Sh_11 (step Sh_12). Specifically, the inter prediction unit 218 obtains MV selection information included in the stream as prediction parameters, for example, and selects the candidate MV identified by the MV selection information as the MV of the current block.

[0548] 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 Sh_13). The processes of steps Sh_11 to Sh_13 are performed for each block, for example. For example, when the processes of steps Sh_11 to Sh_13 are performed for each of all blocks included in a slice, inter prediction using the normal merge mode for that slice is completed. Also, when the processes of steps Sh_11 to Sh_13 are performed for each of all blocks included in a picture, inter prediction using the normal merge mode for that picture is completed. Note that the processes of steps Sh_11 to Sh_13 do not have to be performed for all blocks included in a slice, and inter prediction using the normal merge mode for that slice may be completed when they are performed for some blocks. Similarly, when the processes of steps Sh_11 to Sh_13 are performed for some blocks included in a picture, inter prediction using the normal merge mode for that picture may be completed.

[0549] [MV derivation > FRUC mode] For example, if information interpreted from the stream indicates the application of FRUC mode, the inter prediction unit 218 derives MVs in FRUC mode and performs motion compensation (prediction) using the MVs. In this case, the motion information is not signaled from the encoding device 100 side, but is derived on the decoding device 200 side. For example, the decoding device 200 may derive the motion information by performing motion search. In this case, the decoding device 200 performs motion search without using pixel values ​​of the current block.

[0550] FIG. 86 is a flowchart showing an example of inter prediction in FRUC mode in the decoding device 200.

[0551] First, the inter prediction unit 218 references the MVs of each decoded block spatially or temporally adjacent to the current block and generates a list indicating these MVs as candidate MVs (i.e., a candidate MV list, which may be the same as the candidate MV list for normal merge mode) (step Si_11). Next, the inter prediction unit 218 selects a best candidate MV from among the multiple candidate MVs registered in the candidate MV list (step Si_12). For example, the inter prediction unit 218 calculates an evaluation value for 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 prediction unit 218 derives an 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. Alternatively, for example, the MV for the current block may be derived by performing pattern matching in a peripheral area of ​​a position in the reference picture corresponding to the selected best candidate MV. That is, a search is performed on the area around the best candidate MV using pattern matching and evaluation values ​​in the reference picture, and if an MV with a better evaluation value is found, the best candidate MV can be updated to that MV and used as the final MV for the current block. It is not necessary to update to an MV with a better evaluation value.

[0552] 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 Si_15). The processes of steps Si_11 to Si_15 are performed for each block, for example. For example, when the processes of steps Si_11 to Si_15 are performed for each of all blocks included in a slice, inter prediction using the FRUC mode for the slice is completed. Furthermore, when the processes of steps Si_11 to Si_15 are performed for each of all blocks included in a picture, inter prediction using the FRUC mode for the picture is completed. Processing may also be performed in units of sub-blocks, similar to the above-mentioned block units.

[0553] [MV Derivation > Affine Merge Mode] For example, when information interpreted from the stream indicates the application of the affine merge mode, the inter prediction unit 218 derives MVs in the affine merge mode and performs motion compensation (prediction) using the MVs.

[0554] FIG. 87 is a flowchart showing an example of inter prediction in affine merge mode in the decoding device 200.

[0555] In the affine merge mode, first, the inter prediction unit 218 derives MVs for each of the control points of the current block (step Sk_11). The control points are the upper left and upper right corners of the current block as shown in Figure 46A, or the upper left, upper right, and lower left corners of the current block as shown in Figure 46B.

[0556] For example, when using the MV derivation method shown in Figures 47A to 47C, the inter prediction unit 218 examines the decoded blocks A (left), block B (top), block C (top right), block D (bottom left) and block E (top left) in that order, as shown in Figure 47A, and identifies the first valid block decoded in affine mode.

[0557] The inter prediction unit 218 derives the motion vector of the control point by using the first valid block decoded in the identified affine mode.For example, when the block A is identified and the block A has two control points, as shown in Figure 47B, the inter prediction unit 218 calculates the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point by projecting the motion vectors v3 and v4 of the upper left corner and the upper right corner of the decoded block including the block A onto the current block.This derives the motion vector of each control point.

[0558] As shown in FIG. 49A, when block A is identified and has two control points, the MVs of three control points may be calculated, and as shown in FIG. 49B, when block A is identified and has three control points, the MVs of two control points may be calculated.

[0559] Furthermore, when MV selection information is included in the stream as a prediction parameter, the inter prediction unit 218 may use the MV selection information to derive the MV of each control point of the current block.

[0560] Next, the inter prediction unit 218 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, for each of the multiple sub-blocks, the inter prediction unit 218 calculates the MV of the sub-block as an affine MV using two motion vectors v0 and v1 and the above-mentioned formula (1A), or using three motion vectors v0, v1, and v2 and the above-mentioned formula (1B) (step Sk_12). Then, the inter prediction unit 218 performs motion compensation on the sub-block using the affine MV and the decoded reference picture (step Sk_13). When the processes of steps Sk_12 and Sk_13 are performed on each of all sub-blocks included in the current block, the inter 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.

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

[0562] The candidate MV list may include candidate MVs for modes other than the affine mode that perform prediction on a sub-block basis.

[0563] Note that, as the candidate MV list, for example, a candidate MV list including candidate MVs for an affine merge mode with two control points and a candidate MV for an affine merge mode with three control points may be generated. Alternatively, a candidate MV list including candidate MVs for an affine merge mode with two control points and a candidate MV list including candidate MVs for an affine merge mode with three control points may be generated. Alternatively, a candidate MV list including candidate MVs for one of an affine merge mode with two control points and an affine merge mode with three control points may be generated.

[0564] [MV Derivation > Affine Intermode] For example, when information interpreted from the stream indicates the application of the affine inter mode, the inter prediction unit 218 derives MVs in the affine inter mode and performs motion compensation (prediction) using the MVs.

[0565] FIG. 88 is a flowchart showing an example of inter prediction in the affine inter mode in the decoding device 200.

[0566] In the affine inter mode, the inter prediction unit 218 first derives predicted MVs (v0, v1) or (v0, v1, v2) for each of two or three control points of the current block (step Sj_11). The control points are, for example, the upper left corner, upper right corner, or lower left corner of the current block, as shown in FIG. 46A or FIG. 46B.

[0567] The inter prediction unit 218 obtains prediction MV selection information included in the stream as a prediction parameter, and derives a prediction MV for each control point of the current block using the MV identified by the prediction MV selection information. For example, when using the MV derivation method shown in Figures 48A and 48B, the inter prediction unit 218 derives a prediction MV (v0, v1) or (v0, v1, v2) for the control point of the current block by selecting the MV of the block identified by the prediction MV selection information from among the decoded blocks near each control point of the current block shown in Figures 48A or 48B.

[0568] Next, the inter prediction unit 218 acquires, for example, each differential MV included in the stream as a prediction parameter, 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). As a result, the MV of each control point of the current block is derived.

[0569] Next, the inter prediction unit 218 performs motion compensation on each of the multiple sub-blocks included in the current block. That is, for each of the multiple sub-blocks, the inter prediction unit 218 calculates the MV of the sub-block as an affine MV using two motion vectors v0 and v1 and the above-mentioned formula (1A), or using three motion vectors v0, v1, and v2 and the above-mentioned formula (1B) (step Sj_13). Then, the inter prediction unit 218 performs motion compensation on the sub-block using the affine MV and the decoded reference picture (step Sj_14). When the processes of steps Sj_13 and Sj_14 are performed on each of all sub-blocks included in the current block, the inter 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.

[0570] In step Sj_11, the above-mentioned candidate MV list may be generated, similarly to step Sk_11.

[0571] [MV Derivation > Triangle Mode] For example, if the information interpreted from the stream indicates the application of triangle mode, the inter prediction unit 218 derives MVs in triangle mode and performs motion compensation (prediction) using the MVs.

[0572] FIG. 89 is a flowchart showing an example of inter prediction in the triangle mode in the decoding device 200.

[0573] In the triangle mode, first, the inter prediction unit 218 divides the current block into a first partition and a second partition (step Sx_11). At this time, the inter prediction unit 218 may acquire partition information, which is information about the division into each partition, from the stream as a prediction parameter. Then, the inter prediction unit 218 may divide the current block into the first partition and the second partition according to the partition information.

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

[0575] Then, the inter prediction unit 218 selects the candidate MV for the first partition and the candidate MV for the second partition as the first MV and the second MV, respectively, from the multiple candidate MVs acquired in step Sx_11 (step Sx_13). At this time, the inter prediction unit 218 may acquire MV selection information for identifying the selected candidate MVs from the stream as a prediction parameter. Then, the inter prediction unit 218 may select the first MV and the second MV according to the MV selection information.

[0576] Next, the inter prediction unit 218 generates a first predicted image by performing motion compensation using the selected first MV and a decoded reference picture (step Sx_14). Similarly, the inter prediction unit 218 generates a second predicted image by performing motion compensation using the selected second MV and a decoded reference picture (step Sx_15).

[0577] Finally, the inter prediction unit 218 generates a predicted image of the current block by weighting and adding the first predicted image and the second predicted image (step Sx_16).

[0578] [Motion Search > DMVR] For example, if the information interpreted from the stream indicates the application of DMVR, the inter predictor 218 performs motion estimation using DMVR.

[0579] FIG. 90 is a flowchart showing an example of motion estimation using DMVR in the decoding device 200.

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

[0581] FIG. 91 is a flowchart showing a detailed example of motion estimation using DMVR in the decoding device 200.

[0582] First, in Step 1 shown in Fig. 58A, the inter prediction unit 218 calculates the costs of the search position (also called the starting point) indicated by the initial MV and the eight search positions surrounding it. Then, the inter prediction unit 218 determines whether the cost of the search positions other than the starting point is the smallest. Here, if the inter prediction unit 218 determines that the cost of the search positions other than the starting point is the smallest, it moves to the search position with the smallest cost and performs the processing of Step 2 shown in Fig. 58A. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 218 skips the processing of Step 2 shown in Fig. 58A and performs the processing of Step 3.

[0583] In Step 2 shown in FIG. 58A, the inter prediction unit 218 performs a search similar to the process of Step 1, using the search position moved in accordance with the processing result of Step 1 as a new starting point. Then, the inter prediction unit 218 determines whether the cost of a search position other than the starting point is the smallest. Here, if the cost of a search position other than the starting point is the smallest, the inter prediction unit 218 performs the process of Step 4. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 218 performs the process of Step 3.

[0584] In Step 4, the inter prediction unit 218 treats the search position of the start 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.

[0585] In Step 3 shown in Fig. 58A, the inter prediction unit 218 determines the decimal precision pixel position with the smallest cost based on the costs at four points above, below, left, and right of the starting point of Step 1 or Step 2, and sets that pixel position as the final search position. The decimal precision pixel position is determined by weighting and adding the vectors ((0,1), (0,-1), (-1,0), (1,0)) of the four points above, below, left, and right, using the costs at each of the four search positions as weights. Then, the inter prediction unit 218 determines the difference between the position indicated by the initial MV and that final search position as a difference vector.

[0586] [Motion Compensation > BIO / OBMC / LIC] For example, if the information interpreted from the stream indicates that correction of the predicted image is to be applied, the inter prediction unit 218 generates a predicted image and then corrects the predicted image according to the correction mode, such as the above-mentioned BIO, OBMC, and LIC.

[0587] FIG. 92 is a flowchart showing an example of generation of a predicted image in the decoding device 200.

[0588] The inter prediction unit 218 generates a predicted image (step Sm_11) and corrects the predicted image using one of the above modes (step Sm_12).

[0589] FIG. 93 is a flowchart showing another example of generation of a predicted image in the decoding device 200.

[0590] The inter prediction unit 218 derives the motion vector (MV) of the current block (step Sn_11). Next, the inter prediction unit 218 generates a predicted image using the MV (step Sn_12) and determines whether or not to perform correction processing (step Sn_13). For example, the inter prediction unit 218 acquires prediction parameters included in the stream and determines whether or not to perform correction processing based on the prediction parameters. The prediction parameters are, for example, flags indicating whether or not to apply each of the above-mentioned modes. Here, if the inter prediction unit 218 determines to perform correction processing (Yes in step Sn_13), it generates a final predicted image by correcting the predicted image (step Sn_14). Note that in LIC, the luminance and chrominance of the predicted image may be corrected in step Sn_14. On the other hand, if the inter prediction unit 218 determines not to perform correction processing (No in step Sn_13), it outputs the predicted image as the final predicted image without correcting it (step Sn_15).

[0591] [Motion Compensation > OBMC] For example, if the information interpreted from the stream indicates the application of OBMC, the inter prediction unit 218 generates a predicted image and then corrects the predicted image in accordance with OBMC.

[0592] 94 is a flowchart showing an example of correction of a predicted image by OBMC in the decoding device 200. Note that the flowchart in FIG. 94 shows the flow of correction of a predicted image using the current picture and reference pictures shown in FIG.

[0593] First, as shown in FIG. 62, the inter prediction unit 218 obtains a predicted image (Pred) by normal motion compensation using the MV assigned to the current block.

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

[0595] Similarly, the inter prediction unit 218 applies (reuses) the MV (MV_U) already derived for the decoded upper adjacent block to the current block to obtain a predicted image (Pred_U). Then, the inter prediction unit 218 performs a second correction of the predicted image by superimposing the predicted image Pred_U on 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 in which the boundaries with the adjacent blocks have been blended (smoothed).

[0596] [Motion Compensation > BIO] For example, if the information interpreted from the stream indicates the application of BIO, the inter prediction unit 218 generates a predicted image and then corrects the predicted image in accordance with BIO.

[0597] FIG. 95 is a flowchart showing an example of correction of a predicted image by BIO in the decoding device 200.

[0598] As shown in FIG. 63, the inter prediction unit 218 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) including the current block. Then, the inter prediction unit 218 derives a predicted image of the current block using the two motion vectors (M0, M1) (step Sy_11). Note that 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.

[0599] Next, the inter prediction unit 218 predicts an interpolated image I of the current block using the motion vector M0 and the reference picture L0. 0 The inter prediction unit 218 also derives an interpolated image I of the current block using the motion vector M1 and the reference picture L1. 1 (Step Sy_12). Here, the interpolated image I 0 is an image included in the reference picture Ref0 derived for the current block, and is an interpolated image I 1 is the image contained in the reference picture Ref1 that is derived for the current block. 0 and the interpolated image I 1 may each be the same size as the current block, or the interpolated image I 0 and the interpolated image I 1 Each of the interpolated images I may be larger than the current block in order to properly derive the gradient image described below. 0 and I 1 may include a predicted image derived by applying a motion vector (M0, M1) and a reference picture (L0, L1) and a motion compensation filter.

[0600] In addition, the inter prediction unit 218 predicts the interpolated image I 0 and the interpolated image I 1 From the gradient image of the current block (Ix 0 ,Ix 1 ,Iy 0 ,Iy 1 ) is derived (step Sy_13). Note that the horizontal gradient image is (Ix 0 ,Ix 1 ), and the vertical gradient image is (Iy 0 ,Iy 1 ) The inter prediction unit 218 may derive the gradient image by, for example, applying a gradient filter to the interpolated image. The gradient image may indicate the spatial variation of pixel values ​​along the horizontal or vertical direction.

[0601] Next, the inter prediction unit 218 generates an interpolated image (I 0 ,I 1 ) and gradient image (Ix 0 ,Ix 1 ,Iy 0 ,Iy 1 ) to derive the optical flow (vx, vy), which is the velocity vector described above (step Sy_14). As an example, the sub-block may be a sub-CU of 4x4 pixels.

[0602] Next, the inter prediction unit 218 corrects the predicted image of the current block using the optical flow (vx, vy). For example, the inter prediction unit 218 derives correction values ​​for the values ​​of pixels included in the current block using the optical flow (vx, vy) (step Sy_15). Then, the inter prediction unit 218 may correct the predicted image of the current block using the correction values ​​(step Sy_16). Note that the correction values ​​may be derived for each pixel, or may be derived for multiple pixels or sub-blocks.

[0603] The processing flow of BIO is not limited to the processing disclosed in Fig. 95. Only a part of the processing disclosed in Fig. 95 may be performed, different processing may be added or replaced, or the processing may be performed in a different order.

[0604] [Motion Compensation > LIC] For example, if the information interpreted from the stream indicates the application of LIC, the inter prediction unit 218 generates a predicted image and then corrects the predicted image in accordance with LIC.

[0605] FIG. 96 is a flowchart showing an example of correction of a predicted image by LIC in the decoding device 200.

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

[0607] Next, the inter prediction unit 218 extracts information indicating how the luminance values ​​of the current block have changed between the reference picture and the current picture (step Sz_12). As shown in FIG. 66A, this 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 equivalent positions in the reference picture specified by the derived MV. Then, the inter prediction unit 218 calculates a luminance correction parameter using the information indicating how the luminance values ​​have changed (step Sz_13).

[0608] The inter prediction unit 218 generates a predicted image for the current block by performing a luminance correction process that applies the luminance correction parameter to a reference image in a reference picture specified by the MV (step Sz_14). That is, correction based on the luminance correction parameter is performed on the predicted image that is a reference image in a reference picture specified by the MV. In this correction, luminance or chrominance may be corrected.

[0609] [Predictive control unit] The prediction control unit 220 selects either an intra-predicted image or an inter-predicted image, and outputs the selected predicted image to the addition unit 208. Overall, the configurations, functions, and processing of the prediction control unit 220, the intra-prediction unit 216, and the inter-prediction unit 218 on the decoding device 200 side may correspond to the configurations, functions, and processing of the prediction control unit 128, the intra-prediction unit 124, and the inter-prediction unit 126 on the encoding device 100 side.

[0610] [First aspect] FIG. 97 is a diagram showing an example of syntax in which encoding device 100 notifies one or more PTL parameters and one or more HRD parameters in a VPS.

[0611] PTL parameters are parameters that represent information including profile information, level information, and tier information. Here, profile information is information that includes information indicating a specific subset in a video coding technology. Level information is information that includes information about a group of constraints on parameters and syntax element values ​​in a video coding technology. Tier information is information that includes information about the category of level constraints that form a nested structure in a certain level constraint group.

[0612] The HRD parameters are parameters that represent information including the bit rate and CPB (Coded Picture Buffer) size.

[0613] An OLS (Output Layer Set) is a set of layers including at least one output layer. For example, an output layer is a layer for which a decoded picture is designated to be output. The encoding device 100 and the decoding device 200 can handle an OLS as a combination of layers that can be simultaneously decoded and display an image.

[0614] As shown in FIG. 97, the encoding device 100 may generate a bitstream to notify one or more PTL parameters (e.g., profile_tier_level()) and one or more HRD parameters (e.g., ols_hrd_parameters()) depending on information regarding the number of each parameter that is common to one VPS (e.g., the value vps_num_ptls_hrds).

[0615] Note that the encoding device 100 may generate a bitstream in which notification of the HRD parameter group including general_hrd_parameters(), ols_hrd_parameters(), and the like is omitted altogether by notifying a predetermined flag (for example, vps_general_hrd_params_present_flag).

[0616] In addition, encoding device 100 may change the number of pieces of information regarding the temporal sublayer included in the i-th PTL parameter and the i-th HRD parameter depending on information regarding the maximum value of the temporal layer ID common to one VPS (e.g., the value of ptl_hrd_max_temporal_id[i]).

[0617] In addition, encoding device 100 may use an index common to one VPS (e.g., ols_ptl_hrd_idx[i]) to generate a bitstream that notifies information regarding one or more PTL parameters and one or more HRD parameters that correspond to the i-th OLS, among the one or more PTL parameters and one or more HRD parameters that encoding device 100 notifies in the VPS.

[0618] In addition, the PTL parameters and HRD parameter groups may be notified in an order different from the example shown in Figure 97, provided that they are notified later based on information regarding the number of each parameter that is common to one VPS (e.g., vps_num_ptls_hrds) and information regarding the maximum value of the temporal layer ID that is common to one VPS (e.g., ptl_hrd_max_temporal_id).

[0619] FIG. 98 is a diagram showing an example of the syntax of the PTL parameters.

[0620] When encoding device 100 notifies the i-th PTL parameter in the syntax shown in Fig. 97, it sets the value of the i-th ptl_hrd_max_tmporal_id to argument maxNumSubLayersMinus1 and calls profile_tier_level(). Depending on the value of argument maxNumSubLayersMinus1, encoding device 100 changes the number of sublayer_level_present_flag or sublayer_level_idc to be notified in the bitstream.

[0621] Figure 99 is a diagram showing an example of the syntax of the HRD parameters.

[0622] When notifying the i-th HRD parameter in the syntax shown in Figure 97, encoding device 100 sets the i-th ptl_hrd_max_temporal_id to argument maxSubLayers and calls ols_hrd_parameters(). Encoding device 100 changes the number of fixed_pic_rate_general_flag or sublayer_hrd_parameters() to be notified in the bitstream, depending on the value of argument maxSubLayers.

[0623] FIG. 100 is a flowchart showing the process in which the decoding device 200 analyzes the PTL parameters and HRD parameters notified in the VPS.

[0624] First, the encoding device 100 acquires information N about the number of PTL parameters and HRD parameters, which is common to both of them (Step S100). The information N about the number of both of them is, for example, vps_num_ptls_hrds in FIG.

[0625] Next, encoding device 100 executes loop processing according to information N on the number of each parameter that is common to one VPS. Encoding device 100 acquires information on the maximum value of the temporal layer ID that is common to the i-th PTL parameter and HRD parameter in the loop processing (step S101). The information on the maximum value of the temporal layer ID that is common to the i-th PTL parameter and HRD parameter is, for example, ptl_hrd_max_temporal_id[i] shown in FIG. 97. Here, i is an integer between 0 and N-1.

[0626] Furthermore, the encoding device 100 executes a loop process according to information N on the number of common parameters in one VPS. The encoding device 100 acquires N PTL parameters (Step S102).

[0627] Next, the encoding device 100 executes a loop process according to the number of OLSs (TotalNumOlss shown in FIG. 97). The encoding device 100 acquires an index common to the PTL parameters or HRD parameters corresponding to each OLS, the number of which is equal to or less than the value of TotalNumOlss (step S103). The index common to the PTL parameters or HRD parameters corresponding to each OLS is, for example, ols_hrd_parameters() in FIG. 97.

[0628] Next, the encoding device 100 starts a loop N times. Then, the encoding device 100 acquires an HRD parameter according to the maximum value of the corresponding temporal ID (step S104). Here, the encoding device 100 ends the loop N times.

[0629] As described above, according to the configuration of the first aspect, the encoding device 100 may be able to reduce the number of bits of the VPS parameters by using parameters common to the PTL parameters and the HRD parameters. Here, the parameters common to the PTL parameters and the HRD parameters are vps_num_ptls_hrds, ptl_hrd_max_temporal_id[i], or ols_ptl_hrd_idx[i].

[0630] Furthermore, the encoding device 100 can simplify the correspondence between the OLS and the PTL parameters or the HRD parameters, which may enable the configuration of the decoding device 200 to be simplified.

[0631] [Combination with other aspects] This aspect may be combined with at least a part of other aspects of the embodiments of the present disclosure. In addition, some of the processes, some device configurations, and some syntaxes described in the flowcharts of this aspect may be implemented in combination with other aspects.

[0632] The encoding device 100 may output parameters in the same procedure as the VPS analysis process in the decoding device 200. The encoding device 100 does not always need all of the components described in this aspect, and may include only some of the components of the first aspect.

[0633] [Second mode] FIG. 101 is a diagram showing an example of syntax in which one or more PTL parameters are notified in a VPS.

[0634] As shown in the example of FIG. 101, the encoding device 100 may generate a bitstream to notify one or more PTL parameters, etc. (e.g., profile_tier_level()) depending on information indicating the number of each parameter, such as a PTL parameter (e.g., a value indicating the number indicated by vps_num_ptls, etc.).

[0635] In addition, the encoding device 100 may generate a bitstream to notify the value of an index (e.g., ols_ptl_idx[i]) for each OLS to indicate which of one or more PTL parameters notified in the VPS is the PTL that corresponds to the i-th OLS.

[0636] Note that, for an OLS in which the number of layers included in the OLS is 1, the encoding device 100 may generate a bitstream in which the same PTL parameters as those notified in the SPS referenced when decoding the layer of the OLS are notified in the VPS as PTL parameters corresponding to the OLS. Here, for example, the number of layers included in the i-th OLS is represented by NumLayersInOls[i].

[0637] Note that the layer mentioned here refers to a layer identified by nuh_layer_id signaled in the NAL unit layer, and is different from the temporal layer identified by nuh_temporal_id_plus1 signaled in the NAL unit layer. The example shown in Figure 101 is an example of the semantics of ols_ptl_idx[i].

[0638] Below is an example of the semantics of ols_ptl_idx[i]:

[0639] ols_ptl_idx[i] specifies the index into the list of profile_tier_level() syntax structures that apply to the i-th ols. The value of ols_hrd_idx[i] ranges from 0 to num_ols_hrd_params_minus1.

[0640] When NumLayersInOls[i] is equal to 1, the profile_tier_level() syntax structure applied to the i-th ols exists in both the VPS and SPS referenced by the layer in the i-th OLS. If the profile_tier_level() syntax structure exists in both the VPS and SPS, the profile_tier_level() syntax structure coded in the VPS and SPS for the i-th OLS must be identical in order for the bitstream to meet standard conformance.

[0641] Note that the encoding device 100 may omit encoding of ols_ptl_idx[i] by determining in advance a method for determining which index to use when ols_ptl_idx[i] does not exist.

[0642] In addition, for an OLS that includes one layer, the encoding device 100 may generate a bitstream so that the PTL parameters corresponding to the OLS are not notified in the SPS that is referenced when decoding the layer of the OLS, but are not notified in the VPS.

[0643] Furthermore, if the OLS is the 0th OLS, the encoding device 100 may generate a bitstream so that the corresponding PTL parameters are not notified in the VPS, but are notified in the SPS that is referenced when decoding the layer of the OLS.

[0644] FIG. 102 is a flowchart showing the process in which the encoding device 100 notifies PTL parameters in the VPS and SPS.

[0645] First, the encoding device 100 starts a first loop, which is a loop for each layer. In the first loop, the encoding device 100 determines PTL parameters for each layer (step S200). Then, the encoding device 100 ends the first loop, which is a loop for each layer.

[0646] Next, the encoding device 100 starts a second loop, which is a loop for each OLS. The encoding device 100 determines the PTL parameters for each OLS and describes the PTL parameters for each OLS in the VPS.

[0647] Next, the encoding device 100 determines whether the number of layers in the OLS is equal to 1 (step S201). If the encoding device 100 determines that the number of layers in the OLS is equal to 1 (Yes in step S201), the encoding device 100 acquires PTL parameters corresponding to the layers included in the OLS from the PTL parameters determined for each layer by the encoding device 100 in the first loop (step S203). In step S203, the encoding device 100 may copy the PTL parameters corresponding to the layers included in the OLS.

[0648] Next, the encoding device 100 writes the acquired PTL parameters into the VPS (Step S204).

[0649] If the encoding apparatus 100 does not determine that the number of layers in the OLS is equal to 1 (No in step S201), the encoding apparatus 100 determines the PTL parameters of the OLS (step S202).

[0650] Then, the encoding device 100 writes the determined PTL parameters into the VPS (step S204), and ends the second loop, which is a loop for each OLS.

[0651] Furthermore, the encoding apparatus 100 starts a third loop, which is a loop for each layer. The encoding apparatus 100 writes the PTL parameters determined for each layer in the first loop to the SPS corresponding to each layer (step S205).

[0652] Then, encoding apparatus 100 ends the third loop, which is a loop for each layer.

[0653] As described above, according to the configuration of the second aspect, the encoding device 100 can generate a bitstream in which PTL parameters corresponding to all OLSs can be obtained by analyzing the VPS, which may simplify the bitstream analysis process in a system or decoding device 200 that processes a bitstream containing multiple layers.

[0654] [Combination with other aspects] This aspect may be combined with at least a part of other aspects of the embodiments of the present disclosure. In addition, some of the processes, some device configurations, and some syntaxes described in the flowcharts of this aspect may be implemented in combination with other aspects.

[0655] The encoding device 100 may output parameters in the same procedure as the VPS analysis process in the decoding device 200. Also, not all of the components described in this aspect are always necessary, and only some of the components of the second aspect may be provided.

[0656] [Third aspect] Figure 103 is a diagram showing an example of syntax in which one or more HRD parameters are signaled in a VPS. As in the example shown in Figure 103, encoding device 100 generates a bitstream so as to signal one or more HRD parameters according to information on the number of HRD parameters. Here, the information on the number of HRD parameters may be, for example, a value expressed by the formula num_ols_hrd_params_minus1 + 1. Furthermore, the HRD parameters may be a value indicated by ols_hrd_parameters().

[0657] The encoding device 100 may write information represented by a flag into the bitstream to generate a bitstream in which notification of the HRD parameter set is omitted altogether. Here, the flag is, for example, vps_general_hrd_params_present_flag. The HRD parameters included in the HRD parameter set are, for example, general_hrd_parameters() or ols_hrd_parameters().

[0658] Furthermore, encoding apparatus 100 may change the number of pieces of information about temporal sub-layers included in the i-th HRD parameter according to information about the maximum value of the temporal layer ID. Here, the information about the maximum value of the temporal layer ID is, for example, the value of hrd_max_tid[i].

[0659] In addition, the encoding device 100 may generate a bitstream that notifies which of one or more HRD parameters notified in the VPS corresponds to the i-th OLS by notifying an index for all OLSs.

[0660] In addition, for an OLS that includes one layer, the encoding device 100 may generate a bitstream so that an HRD parameter that represents the same content as the HRD parameter notified in the SPS referenced when decoding the layer of the OLS is notified in the VPS as the HRD parameter corresponding to the OLS.

[0661] Note that the layer mentioned here refers to the layer identified by nuh_layer_id notified at the NAL unit layer, and is different from the temporal layer identified by nuh_temporal_id_plus1 notified by the encoding device 100 at the NAL unit layer.

[0662] Below is an example of the semantics of ols_hrd_idx[i]:

[0663] ols_hrd_idx[i] specifies the index of the ols_hrd_parameters() that applies to the i-th ols. The value of ols_hrd_idx[i] ranges from 0 to num_ols_hrd_params_minus1.

[0664] When NumLayersInOls[i] is equal to 1, the general_hrd_parameters() and ols_hrd_parameters() applied to the i-th ols exist in both the VPS and SPS referenced by the layer in the i-th OLS. For the i-th OLS, the general_hrd_parameters() and ols_hrd_parameters() coded in the VPS and SPS must be identical in order for the bitstream to meet the standard conformance requirement.

[0665] Note that the encoding device 100 may omit encoding of ols_hrd_idx[i] by determining in advance a method for determining which index to use when ols_hrd_idx[i]] does not exist.

[0666] Note that the encoding device 100 may generate a bitstream such that, for an OLS having one layer included therein, the corresponding HRD parameters are not notified in an SPS referred to when decoding the layer of the OLS, but are notified in a VPS. Furthermore, the encoding device 100 may generate a bitstream such that, for an OLS having an OLS number of 0, the corresponding HRD parameters are not notified in a VPS, but are notified in an SPS referred to when decoding the layer of the OLS.

[0667] FIG. 104 is a flowchart showing the process in which the encoding device 100 notifies HRD parameters in the VPS and SPS.

[0668] First, encoding apparatus 100 starts a first loop, which is a loop for each layer. Encoding apparatus 100 determines HRD parameters for the layer (step S300). Then, encoding apparatus 100 ends the first loop, which is a loop for each layer.

[0669] Next, the encoding apparatus 100 starts a second loop, which is a loop for each OLS. The encoding apparatus 100 determines whether the number of layers in the OLS is equal to 1 (step S301).

[0670] If the encoding device 100 determines that the number of layers in the OLS is equal to 1 (Yes in step S301), the encoding device 100 acquires the HRD parameters corresponding to the layers included in the OLS from the HRD parameters determined for each layer in the first loop (step S303). At this time, the encoding device 100 may copy the HRD parameters corresponding to the layers included in the OLS.

[0671] If the encoding apparatus 100 does not determine that the number of layers in the OLS is equal to 1 (No in step S301), the encoding apparatus 100 determines HRD parameters for the OLS (step S302).

[0672] Next, the encoding device 100 writes the HRD parameters for the OLS into the determined VPS (step S304), and then ends the second loop, which is a loop for each OLS.

[0673] Next, encoding apparatus 100 starts a third loop, which is a loop for each layer.

[0674] Encoding device 100 writes the HRD parameters determined for each layer in the first loop to the SPS corresponding to each layer (step S305). Note that encoding device 100 may write the HRD parameters for a layer included in an OLS with one layer to the SPS corresponding to that layer, and may omit writing the HRD parameters for layers other than those included in the OLS with one layer to the corresponding SPS. Then, encoding device 100 ends the third loop, which is a loop for each layer.

[0675] As described above, according to the configuration of the third aspect of the embodiment of the present disclosure, the encoding device 100 can generate a bitstream from which HRD parameters corresponding to all OLSs can be acquired by analyzing the VPS. Therefore, the encoding device 100 may be able to simplify the bitstream analysis process in a system that processes a bitstream including multiple layers or in a decoding device.

[0676] [Combination with other aspects] This aspect may be combined with at least a part of other aspects of the embodiments of the present disclosure. In addition, some of the processes, some device configurations, and some syntaxes described in the flowcharts of this aspect may be implemented in combination with other aspects.

[0677] The encoding device 100 may output the parameters in the same procedure as the VPS analysis process in the decoding device 200. Also, not all of the components described in this aspect are always required, and only some of the components of the third aspect may be provided.

[0678] [Fourth aspect] FIG. 105 is a diagram showing an example of syntax in which one or more DPB parameters are notified in a VPS.

[0679] The DPB parameters include information such as the DPB size and information on rearrangement of pictures from decoding order to output order or display order.

[0680] As shown in the example of Fig. 105, encoding device 100 may generate a bitstream that notifies one or more DPB parameters according to information indicating the number of DPB parameters. Here, the information indicating the number of DPB parameters is, for example, the value of vps_num_dpb_params. Furthermore, the DPB parameter is, for example, dpb_parameters().

[0681] Furthermore, encoding apparatus 100 may change the number of pieces of information relating to temporal sub-layers included in the i-th DPB parameter, according to information indicating the maximum value of the temporal layer ID.

[0682] In addition, the encoding device 100 may generate a bitstream that notifies which of one or more DPB parameters notified in the VPS corresponds to the i-th layer by notifying an index for each layer.

[0683] In addition, if the decoding device 200 can decode a layer without referring to other layers, the encoding device 100 may generate a bitstream so that DPB parameters having the same content as the DPB parameters notified in the SPS referenced when decoding the layer are notified as DPB parameters corresponding to the layer in the VPS. For example, if the i-th layer can be decoded without referring to other layers, the encoding device 100 sets the value of vps_independent_layer_flag[i] to 1.

[0684] Below is an example of the semantics of layer_output_dpb_params_idx[i]:

[0685] layer_output_dpb_params_idx[i] specifies the index of the dpb_parameters() that applies to the i-th layer, relative to the list of dpb_parameters() in the VPS, when the output layer is present in OLS. When layer_output_dpb_params_idx[i] exists, the value of layer_output_dpb_params_idx[i] ranges from 0 to vps_num_dpb_params - 1.

[0686] When the value of vps_num_dpb_params is equal to 1, the value of layer_output_dpb_params_idx[i] is inferred to be equal to 0.

[0687] When vps_independent_layer_flag[i] is equal to 1 and the dpb_parameters() that apply to the i-th layer are present in both the VPS and the SPS, it is a requirement of bitstream conformance that the dpb_parameters() coded into the VPS and the SPS for the i-th layer be identical.

[0688] Also, it is a requirement for bitstream conformance that layer_output_dpb_params_idx[i] is the same as dpb_size_only_flag[layer_output_dpb_params_idx[i]] being equal to 1.

[0689] Note that the encoding device 100 may omit encoding of layer_output_dpb_params_idx[i] by determining in advance a method for determining which index to use when layer_output_dpb_params_idx[i] does not exist.

[0690] Note that, when decoding device 200 can decode a certain layer without referring to other layers, encoding device 100 may generate a bitstream such that the DPB parameters corresponding to the layer are not notified in the SPS referred to by decoding device 200 when decoding the layer, but are notified in the VPS. Furthermore, when the layer is the 0th layer, encoding device 100 may generate a bitstream such that the DPB parameters corresponding to the layer are not notified in the VPS, but are not notified in the SPS referred to by decoding device 200 when decoding the layer.

[0691] FIG. 106 is a flowchart showing the process in which the encoding device 100 notifies DPB parameters in the VPS and SPS.

[0692] First, encoding apparatus 100 starts a first loop, which is a loop for each layer. Encoding apparatus 100 determines DPB parameters for the layer (step S400). Note that encoding apparatus 100 determines the DPB parameters for each layer. Then, encoding apparatus 100 ends the first loop, which is a loop for each layer.

[0693] Next, the encoding apparatus 100 starts a second loop, which is a loop for each layer. The encoding apparatus 100 determines whether or not a layer is an independent layer (step S401).

[0694] If the encoding device 100 determines that the layer is an independent layer (Yes in step S401), the encoding device 100 acquires the DPB parameters corresponding to the layer (step S403). Here, the encoding device 100 may copy the DPB parameters corresponding to the layer. Note that the case where the encoding device 100 determines that the layer is an independent layer occurs when the layer is the i-th layer and the value of vps_independent_layer_flag[i] is set to 1.

[0695] If the encoding device 100 does not determine that the layer is an independent layer (No in step S401), it determines DPB parameters for the layer (step S402). Note that the case where the encoding device 100 does not determine that the layer is an independent layer occurs when the layer is the i-th layer and the value of vps_independent_layer_flag[i] is set to 0.

[0696] Next, encoding apparatus 100 writes the DPB parameters into the VPS for the layer (step S404), and then ends the second loop, which is a loop for each layer.

[0697] Next, encoding device 100 starts a third loop, which is a loop for each layer. Encoding device 100 writes DPB parameters into an SPS for the layer (step S405). Note that encoding device 100 may write DPB parameters into an SPS corresponding to a layer that decoding device 200 can decode without referring to other layers. Then, encoding device 100 ends the third loop, which is a loop for each layer.

[0698] As described above, according to the configuration of the fourth aspect, the encoding device 100 can generate a bitstream in which DPB parameters corresponding to all layers can be acquired by analyzing the VPS. Therefore, the encoding device 100 may be able to simplify the bitstream analysis process in a system that processes a bitstream including multiple layers or in the decoding device 200.

[0699] [Combination with other aspects] This aspect may be combined with at least a part of other aspects of the embodiments of the present disclosure. In addition, some of the processes, some device configurations, and some syntaxes described in the flowcharts of this aspect may be implemented in combination with other aspects.

[0700] Note that the encoding device 100 may output parameters in the same procedure as the VPS analysis process in the decoding device 200. Also, not all of the components described in this aspect are always required, and only some of the components of the fourth aspect may be provided.

[0701] [Fifth mode] FIG. 107 is a diagram showing an example of syntax that enables switching whether or not all PTL parameters, HRD parameters, and DPB parameters are notified by VPS in the second and third aspects of the present disclosure.

[0702] As shown in the example of Fig. 107, the encoding device 100 may notify notification switching information indicating whether the PTL parameters, HRD parameters, and DPB parameters are to be notified by the VPS, and may switch whether the PTL parameters, HRD parameters, and DPB parameters are to be notified by the VPS according to the notification switching information. Here, the notification switching information is, for example, all_ptl_dpb_hrd_in_vps_flag.

[0703] If all_ptl_dpb_hrd_in_vps_flag is TRUE, the encoding device 100 may generate a bitstream so that the PTL parameters corresponding to all OLSs, ols_ptl_idx[i], the HRD parameters corresponding to all OLSs, ols_hrd_idx[i], the DPB parameters corresponding to all layers, and layer_output_dpb_params_idx[i] are notified in the VPS.

[0704] If all_ptl_dpb_hrd_in_vps_flag is FALSE, the encoding device 100 may generate a bitstream so that the PTL parameters corresponding to an OLS with one layer, ols_ptl_idx[i], the HRD parameters corresponding to an OLS with one layer, ols_hrd_idx[i], the DPB parameters corresponding to an independent layer that can be decoded without referring to other layers, and layer_output_dpb_params_idx[i] are not notified in the VPS.

[0705] Below is an example of the semantics of all_ptl_dpb_hrd_in_vps_flag.

[0706] all_ptl_dpb_hrd_in_vps_flag equal to 1 specifies whether profile_tier_level() for all OLS, dpb_parameters() for all layers, and ols_hrd_parameters() for all OLS are present in the VPS. all_ptl_dpb_hrd_in_vps_flag equal to 0 specifies whether profile_tier_level() for some OLS, dpb_parameters() for some layers, and / or hrd_parameters() for some OLS are present in the VPS. If the above information is not present in the VPS, the value of all_ptl_dpb_hrd_in_vps_flag is inferred to be equal to 0.

[0707] As described above, according to the configuration of the fifth aspect of the embodiment of the present disclosure, the encoding device 100 can switch whether or not to include the PTL parameters, HRD parameters, and DPB parameters corresponding to all layers in the VPS. Therefore, the encoding device 100 may be able to adjust the code amount depending on the use case when encoding a bitstream including multiple layers.

[0708] [Combination with other aspects] This aspect may be combined with at least a part of other aspects of the present disclosure. In addition, some of the processes, some device configurations, and some syntaxes described in the flowcharts of this aspect may be implemented in combination with other aspects.

[0709] Note that the encoding device 100 may output parameters in the same procedure as the VPS analysis process in the decoding device 200. Also, not all of the components described in this aspect are always required, and only some of the components of the fifth aspect may be provided.

[0710] [Sixth aspect] FIG. 108 is a diagram illustrating an example of syntax for notifying DPB parameters in a VPS. As in the example illustrated in FIG. 108, encoding apparatus 100 switches whether to encode DPB parameters, which are parameters related to the DPB, in a VPS, depending on whether the number of layers included in each of a plurality of OLSs included in a bitstream by encoding apparatus 100 is 1. Here, encoding may also mean storing. For example, whether to notify DPB parameters (e.g., dpb_parameters()) or all or some parameters associated with the DPB parameters in a VPS may be switched depending on information (e.g., each_layer_is_an_ols_flag) indicating whether the number of layers included in each of a plurality of OLSs included in a bitstream by encoding apparatus 100 is 1 may be switched. Here, the parameters associated with the DPB parameters are parameters that notify information related to the DPB (e.g., vps_num_dpb_params_minus1, vps_sublayer_dpb_params_present_flag, etc.).

[0711] Furthermore, the DPB parameters and / or parameters associated with the DPB parameters are also included in the SPS. The DPB parameters included in the SPS may have the same structure as the DPB parameters included in the VPS, in which the maximum number of hierarchical layers and a flag indicating whether or not to use the DPB are used as arguments, as shown in Fig. 108, or may have a different structure.

[0712] For example, if the number of layers included in each of the multiple OLSs included in the bitstream by the encoding device 100 is 1, the encoding device 100 does not notify the DPB parameters and all or some of the p...

Claims

1. The circuit and a memory connected to the circuit; The circuit, in operation, When a plurality of layer sets each including at least one output layer are included in the bitstream, and all the layer sets each include one layer, the DPB parameters related to the DPB (Decoded Picture Buffer) and the maximum value of the temporal layer ID are not stored in the VPS (Video Parameter Set); If at least one of the layer sets includes two or more layers, store the DPB parameter and the maximum value in the VPS; Each of the plurality of layer sets is an Output Layer Set (OLS), Encoding device.

2. The circuit and a memory connected to the circuit; The circuit, in operation, For a plurality of layer sets each including at least one output layer, where all layer sets included in the bitstream include one layer each, the DPB parameters related to the DPB (Decoded Picture Buffer) and the maximum value of the temporal layer ID are not derived from the VPS (Video Parameter Set); if at least one of the layer sets includes two or more layers, deriving the DPB parameter and the maximum value from the VPS; Each of the plurality of layer sets is an Output Layer Set (OLS), Decryption device.

3. When a plurality of layer sets each including at least one output layer are included in the bitstream, and all the layer sets each include one layer, the DPB parameters related to the DPB (Decoded Picture Buffer) and the maximum value of the temporal layer ID are not stored in the VPS (Video Parameter Set); If at least one of the layer sets includes two or more layers, store the DPB parameter and the maximum value in the VPS; Each of the plurality of layer sets is an Output Layer Set (OLS), Encoding method.

4. For a plurality of layer sets each including at least one output layer, where all layer sets included in the bitstream include one layer each, the DPB parameters related to the DPB (Decoded Picture Buffer) and the maximum value of the temporal layer ID are not derived from the VPS (Video Parameter Set); if at least one of the layer sets includes two or more layers, deriving the DPB parameter and the maximum value from the VPS; Each of the plurality of layer sets is an Output Layer Set (OLS), Decryption method.