Decoding device, encoding device, decoding method, encoding method, and bitstream generation method

The adaptive loop filter in video coding technologies addresses inefficiencies by using fixed and adaptive filters to enhance image quality and reduce processing volume and circuit size, optimizing encoding and decoding processes.

WO2025204995A1PCT designated stage Publication Date: 2025-10-02PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2025/009627
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-28
Filing Date
2025-03-13
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

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

Method used

Implementing an adaptive loop filter (ALF) process in decoding devices that uses both predefined fixed filter coefficients and filter coefficients described in a bitstream, allowing for adaptive filtering to improve image quality and reduce processing requirements.

Benefits of technology

The adaptive loop filter enhances image quality and reduces processing volume and circuit size by selectively applying fixed and adaptive filters based on image characteristics, aligning encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2025009627_02102025_PF_FP_ABST
    Figure JP2025009627_02102025_PF_FP_ABST
Patent Text Reader

Abstract

A decoding device (200) comprises a circuit (b1) and a memory (b2) connected to the circuit (b1). When in operation, the circuit (b1) performs an adaptive loop filter (ALF) process using a filtered input image obtained by a decoding process (S401). The ALF process includes one or more fixed filtering processes each using a predefined fixed filter coefficient, and one or more adaptive filtering processes each using a filter coefficient written in a bitstream.
Need to check novelty before this filing date? Find Prior Art

Description

Decoding device, encoding device, decoding method, encoding method, and bitstream generation method

[0001] The present disclosure relates to a decoding device and the like.

[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 regarding the above-mentioned video coding technology.

[0004] H. 265 (ISO / IEC 23008-2 HEVC) / HEVC (High Efficiency Video Coding)

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

[0007] For example, a decoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and the circuit, in operation, performs an adaptive loop filter (ALF) process using a filtered input image obtained by a decoding process, and the ALF process includes one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream.

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

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

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

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

[0012] FIG. 1 is a schematic diagram showing an example of the configuration of a transmission system according to an embodiment. FIG. 2 is a diagram showing an example of a hierarchical structure of data in a stream. FIG. 3 is a diagram showing an example of the configuration of a slice. FIG. 4 is a diagram showing an example of the configuration of a tile. FIG. 5 is a diagram showing an example of an encoding structure for scalable encoding. FIG. 6 is a diagram showing an example of an encoding structure for scalable encoding. FIG. 7 is a block diagram showing an example of the configuration of an encoding device according to an embodiment. FIG. 8 is a block diagram showing an implementation example of an encoding device. FIG. 9 is a flowchart showing an example of the overall encoding process by the encoding device. FIG. 10 is a diagram showing an example of block division. FIG. 11 is a diagram showing an example of the configuration of a division unit. FIG. 12 is a diagram showing an example of a division pattern. FIG. 13A is a diagram showing an example of a syntax tree of a division pattern. FIG. 13B is a diagram showing another example of a syntax tree of a division pattern. FIG. 14 is a table showing transform basis functions corresponding to each transform type. FIG. 15 is a diagram showing an example of SVT. FIG. 16 is a flowchart showing an example of processing by the transform unit. FIG. 17 is a flowchart showing another example of processing by the transform unit. FIG. 18 is a block diagram showing an example of the configuration of a quantization unit. FIG. 19 is a flowchart showing an example of quantization by the quantization unit. FIG. 20 is a block diagram showing an example of the configuration of an entropy coding unit. FIG. 21 is a diagram showing the flow of CABAC in the entropy coding unit. FIG. 22 is a block diagram showing an example of the configuration of a loop filter unit. FIG. 23A is a diagram showing an example of the shape of a filter used in an adaptive loop filter (ALF). FIG. 23B is a diagram showing another example of the shape of a filter used in the ALF. FIG. 23C is a diagram showing another example of the shape of a filter used in the ALF. 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. FIG. 23F is a diagram showing an example of a JC-CCALF. FIG. 23G is a diagram showing examples of weight_index candidates for a JC-CCALF. FIG. 24 is a block diagram showing an example of a detailed configuration of a loop filter unit functioning as a DBF.FIG. 25 is a diagram illustrating an example of a deblocking filter having filter characteristics symmetrical with respect to a block boundary. FIG. 26 is a diagram illustrating an example of a block boundary on which deblocking filter processing is performed. FIG. 27 is a diagram illustrating an example of a Bs value. FIG. 28 is a flowchart illustrating an example of processing performed by a prediction unit of an encoding device. FIG. 29 is a flowchart illustrating another example of processing performed by a prediction unit of an encoding device. FIG. 30 is a flowchart illustrating another example of processing performed by a prediction unit of an encoding device. FIG. 31 is a diagram illustrating an example of 67 intra prediction modes in intra prediction. FIG. 32 is a flowchart illustrating an example of processing by an intra prediction unit. FIG. 33 is a diagram illustrating an example of each reference picture. FIG. 34 is a conceptual diagram illustrating an example of a reference picture list. FIG. 35 is a flowchart illustrating the basic processing flow of inter prediction. FIG. 36 is a flowchart illustrating an example of MV derivation. FIG. 37 is a flowchart illustrating another example of MV derivation. FIG. 38A is a diagram illustrating an example of classification of each MV derivation mode. FIG. 38B is a diagram illustrating an example of classification of each MV derivation mode. FIG. 39 is a flowchart illustrating an example of inter prediction in normal inter mode. FIG. 40 is a flowchart showing an example of inter prediction in normal merge mode. FIG. 41 is a diagram for explaining an example of MV derivation processing in normal merge mode. FIG. 42 is a diagram for explaining an example of MV derivation processing in HMVP (History-based Motion Vector Prediction / Predictor) mode. FIG. 43 is a flowchart showing an example of FRUC (frame rate up conversion). FIG. 44 is a diagram for explaining an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. FIG. 45 is a diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. FIG. 46A is a diagram for explaining an example of MV derivation in sub-block units in affine mode using two control points.FIG. 46B is a diagram illustrating an example of derivation of MVs for each sub-block in affine mode using three control points. FIG. 47A is a conceptual diagram illustrating an example of derivation of MVs for control points in affine mode. FIG. 47B is a conceptual diagram illustrating an example of derivation of MVs for control points in affine mode. FIG. 47C is a conceptual diagram illustrating an example of derivation of MVs for control points in affine mode. FIG. 48A is a diagram illustrating an affine mode having two control points. FIG. 48B is a diagram illustrating an affine mode having three control points. FIG. 49A is a conceptual diagram illustrating an example of a method for derivation of MVs for control points when the number of control points in the coded block and the current block differs. FIG. 49B is a conceptual diagram illustrating another example of a method for derivation of MVs for control points when the number of control points in the coded block and the current block differs. FIG. 50 is a flowchart illustrating an example of processing in affine merge mode. FIG. 51 is a flowchart illustrating an example of processing in affine inter mode. FIG. 52A is a diagram illustrating generation of two triangular predicted images. FIG. 52B is a conceptual diagram illustrating an example of a first portion of a first partition, and a first and second sample sets. FIG. 52C is a conceptual diagram illustrating a first portion of a first partition. FIG. 53 is a flowchart illustrating an example of a triangle mode. FIG. 54 is a diagram illustrating an example of an ATMVP (Advanced Temporal Motion Vector Prediction / Predictor) mode in which motion vectors (MVs) are derived on a sub-block basis. FIG. 55 is a diagram illustrating the relationship between merge mode and dynamic motion vector refreshing (DMVR). FIG. 56 is a conceptual diagram illustrating an example of DMVR. FIG. 57 is a conceptual diagram illustrating another example of DMVR for determining motion vectors. FIG. 58A is a diagram illustrating an example of motion estimation in DMVR. FIG. 58B is a flowchart illustrating an example of motion estimation in DMVR. Fig. 59 is a flowchart showing an example of predicted image generation, and Fig. 60 is a flowchart showing another example of predicted image generation.FIG. 61 is a flowchart illustrating an example of a prediction image correction process using OBMC (overlapped block motion compensation). FIG. 62 is a conceptual diagram illustrating an example of a prediction image correction process using OBMC. FIG. 63 is a diagram illustrating a model assuming uniform linear motion. FIG. 64 is a flowchart illustrating an example of inter prediction according to BIO. FIG. 65 is a diagram illustrating an example of the configuration of an inter prediction unit that performs inter prediction according to BIO. FIG. 66A is a diagram illustrating an example of a prediction image generation method using luminance correction processing using LIC (local illumination compensation). FIG. 66B is a flowchart illustrating an example of a prediction image generation method using luminance correction processing using LIC. FIG. 67 is a block diagram illustrating the configuration of a decoding device according to an embodiment. FIG. 68 is a block diagram illustrating an implementation example of a decoding device. FIG. 69 is a flowchart illustrating an example of an overall decoding process performed by a decoding device. FIG. 70 is a diagram illustrating the relationship between a partition determination unit and other components. FIG. 71 is a block diagram showing an example of the configuration of an entropy decoding unit. FIG. 72 is a diagram showing the flow of CABAC in the entropy decoding unit. FIG. 73 is a block diagram showing an example of the configuration of an inverse quantization unit. FIG. 74 is a flowchart showing an example of inverse quantization by the inverse quantization unit. FIG. 75 is a flowchart showing an example of processing by the inverse transform unit. FIG. 76 is a flowchart showing another example of processing by the inverse transform unit. FIG. 77 is a block diagram showing an example of the configuration of a loop filter unit. FIG. 78 is a flowchart showing an example of processing performed by a prediction unit of a decoding device. FIG. 79 is a flowchart showing another example of processing performed by the prediction unit of a decoding device. FIG. 80A is a flowchart showing part of another example of processing performed by the prediction unit of a decoding device. FIG. 80B is a flowchart showing the remaining part of another example of processing performed by the prediction unit of a decoding device. FIG. 81 is a diagram showing an example of processing by an intra prediction unit of a decoding device. FIG. 82 is a flowchart showing an example of MV derivation in a decoding device. FIG. 83 is a flowchart showing another example of MV derivation in a decoding device.FIG. 84 is a flowchart showing an example of inter prediction in normal inter mode in a decoding device. FIG. 85 is a flowchart showing an example of inter prediction in normal merge mode in a decoding device. FIG. 86 is a flowchart showing an example of inter prediction in FRUC mode in a decoding device. FIG. 87 is a flowchart showing an example of inter prediction in affine merge mode in a decoding device. FIG. 88 is a flowchart showing an example of inter prediction in affine inter mode in a decoding device. FIG. 89 is a flowchart showing an example of inter prediction in triangle mode in a decoding device. FIG. 90 is a flowchart showing an example of motion estimation using DMVR in a decoding device. FIG. 91 is a flowchart showing a detailed example of motion estimation using DMVR in a decoding device. FIG. 92 is a flowchart showing an example of generation of a predicted image in a decoding device. FIG. 93 is a flowchart showing another example of generation of a predicted image in a decoding device. FIG. 94 is a flowchart showing an example of correction of a predicted image using OBMC in a decoding device. FIG. 95 is a flowchart showing an example of correction of a predicted image using BIO in a decoding device. FIG. 96 is a flowchart showing an example of correction of a predicted image using LIC in a decoding device. FIG. 97 is a configuration diagram showing an example of the overall configuration of an in-loop filter. Fig. 98 is a diagram showing an example of an ALF filter configuration. Fig. 99 is a conceptual diagram showing spatial taps. Fig. 100 is a conceptual diagram showing fixed filter output base taps. Fig. 101 is a conceptual diagram showing RecBeforeDB base taps. Fig. 102 is a conceptual diagram showing residual base taps. Fig. 103 is a conceptual diagram showing extension taps. Fig. 104 is a conceptual diagram showing a filter configuration of fixed filter output base taps. Fig. 105 is a conceptual diagram showing a first filter. Fig. 106 is a conceptual diagram showing a second filter. Fig. 107 is a conceptual diagram showing a third filter. Fig. 108 is a flowchart showing an operation for skipping fixed filter processing during encoding. Fig. 109 is a flowchart showing an operation for skipping fixed filter processing during decoding.FIG. 110 is a conceptual diagram showing a filter configuration capable of passing the first, second, third, fifth, and sixth filters. FIG. 111 is a conceptual diagram showing a filter configuration capable of passing the first, second, third, and sixth filters. FIG. 112 is a conceptual diagram showing a filter configuration capable of passing the first, second, third, and fifth filters. FIG. 113 is a conceptual diagram showing a filter configuration capable of passing the first, second, and third filters. FIG. 114 is a conceptual diagram showing a filter configuration capable of passing the first, third, fifth, and sixth filters. FIG. 115 is a conceptual diagram showing a filter configuration capable of passing the first, third, and sixth filters. FIG. 116 is a conceptual diagram showing a filter configuration capable of passing the first, third, and fifth filters. FIG. 117 is a conceptual diagram showing a filter configuration capable of passing the first and third filters. FIG. 118 is a conceptual diagram showing a filter configuration capable of passing the second, third, fifth, and sixth filters. FIG. 119 is a conceptual diagram showing a filter configuration capable of passing the second, third, and sixth filters. FIG. 120 is a conceptual diagram showing a filter configuration capable of passing the second, third, and fifth filters. FIG. 121 is a conceptual diagram showing a filter configuration capable of passing the second and third filters. FIG. 122 is a conceptual diagram showing a filter configuration capable of passing the first, second, fourth, and fifth filters. FIG. 123 is a conceptual diagram showing a filter configuration capable of passing the first, second, and fourth filters. FIG. 124 is a conceptual diagram showing a filter configuration capable of passing the first, second, and fifth filters. FIG. 125 is a conceptual diagram showing a filter configuration capable of passing the first and second filters. FIG. 126 is a conceptual diagram showing a filter configuration capable of passing the third and sixth filters. FIG. 127 is a conceptual diagram showing a filter configuration capable of passing the third filter. FIG. 128 is a conceptual diagram showing a filter configuration capable of passing the second filter. Fig. 129 is a conceptual diagram showing a filter configuration that can bypass the first and fifth filters, and Fig. 130 is a conceptual diagram showing a filter configuration that can bypass the first filter.FIG. 131 is a diagram illustrating another example of an ALF filter configuration. FIG. 132 is a diagram illustrating yet another example of an ALF filter configuration. FIG. 133 is a diagram illustrating yet another example of an ALF filter configuration. FIG. 134 is a diagram illustrating yet another example of an ALF filter configuration. FIG. 135 is a diagram illustrating yet another example of an ALF filter configuration. FIG. 136 is a flowchart illustrating basic processing in an encoding operation performed by an encoding device. FIG. 137 is a flowchart illustrating additional processing in an encoding operation performed by an encoding device. FIG. 138 is a flowchart illustrating basic processing in a decoding operation performed by a decoding device. FIG. 139 is a flowchart illustrating additional processing in a decoding operation performed by a decoding device. FIG. 140 is a diagram illustrating the overall configuration of a content supply system that realizes a content distribution service. FIG. 141 is a diagram illustrating an example of a web page display screen. FIG. 142 is a diagram illustrating an example of a web page display screen. FIG. 143 is a diagram illustrating an example of a smartphone. FIG. 144 is a block diagram illustrating an example of a smartphone configuration.

[0013] For example, the encoding device and the decoding device apply an in-loop filter to the reconstructed image, which reduces coding noise generated by the quantization process and prevents image quality degradation from propagating between frames.

[0014] Here, for example, the in-loop filter includes an ALF (Adaptive Loop Filter). The ALF also includes a filter called fixed-filter-output based taps. The fixed-filter output based taps also include a fixed filter having fixed coefficients. The fixed coefficients are determined in advance by, for example, learning using a large number of images so as to obtain optimal processing results.

[0015] However, the use of fixed filters for images with properties different from those of the majority of images used for training may result in degradation of image quality. Also, for example, ALF may include multiple filters, and the amount of processing required for ALF may be large.

[0016] Therefore, the decoding device of Example 1 includes a circuit and a memory connected to the circuit, and the circuit, in operation, performs an adaptive loop filter (ALF) process using a filtered input image obtained by a decoding process, the ALF process including one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream.

[0017] This may allow for one or more fixed and one or more adaptive filtering to improve image quality.

[0018] The decoding device of Example 2 is the decoding device of Example 1, wherein the circuit further acquires fixed filter control information indicating whether or not to perform a fixed filter process included in the one or more fixed filter processes, and skips the fixed filter process in accordance with the fixed filter control information when performing the ALF processing.

[0019] This may make it possible to skip the fixed filter process, thereby suppressing image quality degradation due to the fixed filter process, and reducing the amount of processing.

[0020] Furthermore, the decoding device of Example 3 may be the decoding device of Example 2, in which the fixed filter control information is decoded from a header region in the bitstream.

[0021] This may allow the encoding and decoding processes to share fixed filter control information via the header area of ​​the bitstream, which may allow the encoding and decoding processes to be aligned.

[0022] Furthermore, the decoding device of Example 4 may be the decoding device of Example 2 or 3, in which the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips all of the plurality of fixed filter processes in accordance with the fixed filter control information.

[0023] This may make it possible to skip all fixed filter processes, thereby suppressing image quality degradation due to all fixed filter processes, and reducing the amount of processing required for all fixed filter processes.

[0024] Furthermore, the decoding device of Example 5 may be the decoding device of Example 2 or 3, in which the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips some of the plurality of fixed filter processes according to the fixed filter control information.

[0025] This may make it possible to skip some of the fixed filter processes, thereby suppressing image quality degradation that accompanies some of the fixed filter processes, and reducing the amount of processing that corresponds to some of the fixed filter processes.

[0026] Furthermore, the decoding device of Example 6 may be the decoding device of any one of Examples 2 to 5, in which the filter processing input image includes at least one image of an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

[0027] This may make it possible to perform filtering using at least one of the image after DBF processing, the image before DBF processing, and the prediction residual image, thereby improving the image quality.

[0028] Furthermore, the decoding device of Example 7 may be the decoding device of any one of Examples 2 to 6, in which the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and the circuit, when the fixed filter process is performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, does not perform the fixed filter process, and performs the filter process subsequent to the fixed filter process using the filtered input image.

[0029] This may allow for skipping the fixed filtering and performing subsequent filtering, thus improving image quality even when the fixed filtering is skipped.

[0030] Furthermore, the decoding device of Example 8 may be the decoding device of any one of Examples 2 to 6, in which the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and the circuit, when the fixed filter process is performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, also skips the filter process subsequent to the fixed filter process.

[0031] This may make it possible to skip the fixed filter process and also to skip the subsequent filter process. Therefore, it may also be possible to skip the filter process that is performed on the assumption that the fixed filter process will be performed. Therefore, it may be possible to suppress deterioration in image quality. Furthermore, it may be possible to reduce the amount of processing.

[0032] Furthermore, the decoding device of Example 9 may be the decoding device of any one of Examples 1 to 8, in which the ALF processing includes only the one or more fixed filter processings and the one or more adaptive filter processings, each of the one or more fixed filter processings is a filter processing performed using the filter processing input image or a result of another fixed filter processing, each of the one or more adaptive filter processings is a filter processing performed using a result of any one of the one or more fixed filter processings, and the filter processing input image includes at least one image from among an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

[0033] This may enable one or more fixed filter processes and one or more adaptive filter processes, each of which follows one of the one or more fixed filter processes, to be implemented as an ALF process. Therefore, it may be possible to simplify the ALF process. Furthermore, it may be possible to improve image quality by performing a filter process using at least one image among a post-DBF image, a pre-DBF image, and a prediction residual image.

[0034] Furthermore, the decoding device of Example 10 may be the decoding device of any one of Examples 1 to 8, in which the ALF processing includes only the one or more fixed filter processings and the one or more adaptive filter processings, each of the one or more fixed filter processings is a filter processing performed using the filter processing input image or a result of another fixed filter processing, each of the one or more adaptive filter processings is a filter processing performed using a result of any one of the one or more fixed filter processings, and the filter processing input image includes at least one image of an image after DBF (Deblocking Filter) processing and an image before DBF processing, but does not include a prediction residual image.

[0035] This may allow one or more fixed filter operations and one or more adaptive filter operations, each of which is followed by one of the one or more fixed filter operations, to be implemented as an ALF operation. Therefore, it may be possible to simplify the ALF operation. Furthermore, it may be possible to simplify the ALF operation, since the filter input image does not include a prediction residual image.

[0036] Furthermore, the decoding device of Example 11 may be the decoding device of any one of Examples 1 to 8, in which the one or more adaptive filter processes are a plurality of adaptive filter processes, the ALF process includes only the one or more fixed filter processes and the plurality of adaptive filter processes, each of the one or more fixed filter processes is a filter process performed using the filter process input image or a result of another fixed filter process, each of the one or more adaptive filter processes excluding one adaptive filter process among the plurality of adaptive filter processes is a filter process performed using a result of any one of the one or more fixed filter processes, and the one adaptive filter process is a filter process performed using at least one image of an image after DBF (Deblocking Filter) processing and an image before DBF processing, which are included in the filter process input image.

[0037] This may allow the ALF process to include one or more fixed filter processes, one or more adaptive filter processes each of which follows one of the one or more fixed filter processes, and other adaptive filter processes, and by including only these filter processes in the ALF process, it may be possible to improve image quality while suppressing an increase in the amount of processing.

[0038] Moreover, the encoding device of Example 12 includes a circuit and a memory connected to the circuit, and the circuit, in operation, performs an adaptive loop filter (ALF) process using a filtered input image obtained by the encoding process, and the ALF process includes one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream.

[0039] This may allow for one or more fixed and one or more adaptive filtering to improve image quality.

[0040] In addition, the encoding device of Example 13 is the encoding device of Example 12, wherein the circuit further acquires fixed filter control information indicating whether or not to perform a fixed filter process included in the one or more fixed filter processes, and skips the fixed filter process in accordance with the fixed filter control information when performing the ALF processing.

[0041] This may make it possible to skip the fixed filter process, thereby suppressing image quality degradation due to the fixed filter process, and reducing the amount of processing.

[0042] Furthermore, the encoding device of Example 14 may be the encoding device of Example 13, in which the circuit analyzes features of at least one of the image to be encoded and the input image for filter processing, and obtains the fixed filter control information according to the features.

[0043] This may enable appropriate acquisition of fixed filter control information according to the feature amounts of the encoding target image, the filter processing input image, or a combination thereof, thereby enabling appropriate skipping of fixed filter processing according to the feature amounts of the image.

[0044] Furthermore, the encoding device of Example 15 may be the encoding device of Example 13 or 14, in which the fixed filter control information is encoded in a header area in the bitstream.

[0045] This may allow the encoding and decoding processes to share fixed filter control information via the header area of ​​the bitstream, which may allow the encoding and decoding processes to be aligned.

[0046] Furthermore, the encoding device of Example 16 may be the encoding device of any one of Examples 13 to 15, in which the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips all of the plurality of fixed filter processes in accordance with the fixed filter control information.

[0047] This may make it possible to skip all fixed filter processes, thereby suppressing image quality degradation due to all fixed filter processes, and reducing the amount of processing required for all fixed filter processes.

[0048] Furthermore, the encoding device of Example 17 may be the encoding device of any one of Examples 13 to 15, in which the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips some of the plurality of fixed filter processes according to the fixed filter control information.

[0049] This may make it possible to skip some of the fixed filter processes, thereby suppressing image quality degradation that accompanies some of the fixed filter processes, and reducing the amount of processing that corresponds to some of the fixed filter processes.

[0050] Furthermore, the encoding device of Example 18 may be the encoding device of any one of Examples 13 to 17, in which the filter processing input image includes at least one image of an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

[0051] This may make it possible to perform filtering using at least one of the image after DBF processing, the image before DBF processing, and the prediction residual image, thereby improving the image quality.

[0052] Furthermore, the encoding device of Example 19 may be the encoding device of any one of Examples 13 to 18, wherein the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and wherein the circuit, when the fixed filter process is to be performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, does not perform the fixed filter process, and performs the filter process subsequent to the fixed filter process using the filtered input image.

[0053] This may allow for skipping the fixed filtering and performing subsequent filtering, thus improving image quality even when the fixed filtering is skipped.

[0054] Furthermore, the encoding device of Example 20 may be the encoding device of any one of Examples 13 to 18, in which the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and the circuit, when the fixed filter process is performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, also skips the filter process subsequent to the fixed filter process.

[0055] This may make it possible to skip the fixed filter process and also to skip the subsequent filter process. Therefore, it may also be possible to skip the filter process that is performed on the assumption that the fixed filter process will be performed. Therefore, it may be possible to suppress deterioration in image quality. Furthermore, it may be possible to reduce the amount of processing.

[0056] Furthermore, the encoding device of Example 21 may be the encoding device of any one of Examples 12 to 20, in which the ALF processing includes only the one or more fixed filter processings and the one or more adaptive filter processings, each of the one or more fixed filter processings is a filter processing performed using the filter processing input image or a result of another fixed filter processing, each of the one or more adaptive filter processings is a filter processing performed using a result of any one of the one or more fixed filter processings, and the filter processing input image includes at least one image from among an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

[0057] This may enable one or more fixed filter processes and one or more adaptive filter processes, each of which follows one of the one or more fixed filter processes, to be implemented as an ALF process. Therefore, it may be possible to simplify the ALF process. Furthermore, it may be possible to improve image quality by performing a filter process using at least one image among a post-DBF image, a pre-DBF image, and a prediction residual image.

[0058] Furthermore, the encoding device of Example 22 may be the encoding device of any one of Examples 12 to 20, in which the ALF processing includes only the one or more fixed filter processings and the one or more adaptive filter processings, each of the one or more fixed filter processings is a filter processing performed using the filter processing input image or a result of another fixed filter processing, each of the one or more adaptive filter processings is a filter processing performed using a result of any one of the one or more fixed filter processings, and the filter processing input image includes at least one image of an image after DBF (Deblocking Filter) processing and an image before DBF processing, but does not include a prediction residual image.

[0059] This may allow one or more fixed filter operations and one or more adaptive filter operations, each of which is followed by one of the one or more fixed filter operations, to be implemented as an ALF operation. Therefore, it may be possible to simplify the ALF operation. Furthermore, it may be possible to simplify the ALF operation, since the filter input image does not include a prediction residual image.

[0060] Furthermore, the encoding device of Example 23 may be the encoding device of any one of Examples 12 to 20, in which the one or more adaptive filter processes are a plurality of adaptive filter processes, the ALF process includes only the one or more fixed filter processes and the plurality of adaptive filter processes, each of the one or more fixed filter processes is a filter process performed using the filter process input image or a result of another fixed filter process, each of the one or more adaptive filter processes excluding one adaptive filter process among the plurality of adaptive filter processes is a filter process performed using a result of any one of the one or more fixed filter processes, and the one adaptive filter process is a filter process performed using at least one image of an image after DBF (Deblocking Filter) processing and an image before DBF processing, which are included in the filter process input image.

[0061] This may allow the ALF process to include one or more fixed filter processes, one or more adaptive filter processes each of which follows one of the one or more fixed filter processes, and other adaptive filter processes, and by including only these filter processes in the ALF process, it may be possible to improve image quality while suppressing an increase in the amount of processing.

[0062] Moreover, the decoding method of Example 24 performs an ALF (Adaptive Loop Filter) process using a filtered input image obtained by the decoding process, and the ALF process includes one or more fixed filter processes each using predefined fixed filter coefficients, and one or more adaptive filter processes each using filter coefficients described in a bitstream.

[0063] This may allow for one or more fixed and one or more adaptive filtering to improve image quality.

[0064] Moreover, the encoding method of Example 25 performs an ALF (Adaptive Loop Filter) process using a filtered input image obtained by the encoding process, and the ALF process includes one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream.

[0065] This may allow for one or more fixed and one or more adaptive filtering to improve image quality.

[0066] Moreover, the bitstream generation method of Example 26 performs an adaptive loop filter (ALF) process using a filtered input image obtained by the encoding process, the ALF process including one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in the bitstream, and generates the bitstream including the filter coefficients of each of the one or more adaptive filter processes.

[0067] This may allow for one or more fixed and one or more adaptive filtering to improve image quality.

[0068] Moreover, the decoding device of Example 27 includes an input unit, an entropy decoding unit, an inverse quantization unit, an inverse transform unit, an intra prediction unit, an inter prediction unit, a loop filter unit, and an output unit.

[0069] The input unit receives an encoded bitstream, the entropy decoding unit applies variable length decoding to the encoded bitstream to derive quantized coefficients, the inverse quantization unit inversely quantizes the quantized coefficients to derive transform coefficients, and the inverse transform unit inversely transforms the transform coefficients to derive prediction errors.

[0070] The intra prediction unit generates a prediction signal for a current block included in the current picture using reference pixels included in the current picture, and the inter prediction unit generates a prediction signal for a current block included in the current picture using reference blocks included in a reference picture other than the current picture.

[0071] The loop filter unit applies a filter to a reconstructed block of a current block included in the current picture, and the output unit outputs the current picture.

[0072] In operation, the loop filter unit performs ALF (Adaptive Loop Filter) processing using the filtered input image obtained by the decoding processing, and the ALF processing includes one or more fixed filter processings each using predefined fixed filter coefficients and one or more adaptive filter processings each using filter coefficients described in a bitstream.

[0073] Moreover, the encoding device of Example 28 includes an input unit, a division unit, an intra prediction unit, an inter prediction unit, a loop filter unit, a transformation unit, a quantization unit, an entropy encoding unit, and an output unit.

[0074] The input unit receives a current picture, and the dividing unit divides the current picture into a plurality of blocks.

[0075] The intra prediction unit generates a prediction signal of a current block included in the current picture using reference pixels included in the current picture. The inter prediction unit generates a prediction signal of a current block included in the current picture using a reference block included in a reference picture other than the current picture. The loop filter unit applies a filter to a reconstructed block of the current block included in the current picture.

[0076] The transform unit transforms a prediction error between an original signal of a current block included in the current picture and a prediction signal generated by the intra prediction unit or the inter prediction unit to generate transform coefficients. The quantization unit quantizes the transform coefficients to generate quantized coefficients. The entropy coding unit applies variable-length coding to the quantized coefficients to generate an encoded bitstream. The output unit then outputs the encoded bitstream, which includes the quantized coefficients to which variable-length coding has been applied and control information.

[0077] In operation, the loop filter unit performs ALF (Adaptive Loop Filter) processing using the filtered input image obtained by the encoding processing, and the ALF processing includes one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream.

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

[0079] [Definition of Terms] As an example, each term may be defined as follows.

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

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

[0082] (3) Block: 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 shaped anything, including, for example, a rectangle made up of M×N pixels, a square made up of M×M pixels, a triangle, a circle, or any other shape.

[0083] (Examples of blocks) 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

[0084] (4) Pixel / Sample A pixel / sample is a minimum unit point that constitutes an image, and includes not only pixels at integer positions but also pixels at decimal positions generated based on pixels at integer positions.

[0085] (5) Pixel Value / Sample Value: A value inherent to a pixel, including not only brightness value, color difference value, and RGB gradation, but also depth value or binary values ​​of 0 and 1.

[0086] (6) Flags: In addition to one bit, flags may be multi-bit, for example, parameters or indexes of two or more bits. In addition, flags may be multi-valued using other bases as well as two values ​​using binary numbers.

[0087] (7) Signal: A signal that is symbolized or coded to transmit information, including discrete digital signals as well as analog signals that take continuous values.

[0088] (8) Stream / Bitstream: A digital data string or flow. A stream / bitstream may consist of a single stream or multiple streams divided into multiple layers. It also includes transmission by serial communication over a single transmission path as well as transmission by packet communication over multiple transmission paths.

[0089] (9) Difference / Difference In the case of scalar quantities, in addition to simple difference (x-y), it is sufficient to include difference calculations, including absolute value of difference (|x-y|), squared difference (x^2-y^2), square root of difference (√(x-y)), weighted difference (ax-by: a, b are constants), and offset difference (x-y+a: a is an offset).

[0090] (10) Sum In the case of a scalar quantity, in addition to simple sum (x + y), it is sufficient if a sum operation is included, including the absolute value of the sum (|x + y|), sum of squares (x^2 + y^2), square root of the sum (√(x + y)), weighted sum (ax + by: a, b are constants), and offset sum (x + y + a: a is an offset).

[0091] (11) Based on: This includes cases where factors other than the one being based on are taken into consideration. It also includes cases where a result is obtained directly or via an intermediate result.

[0092] (12) Using (used, using) This includes cases where elements other than the target of use are taken into account. It also includes cases where a result is obtained directly or via an intermediate result.

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

[0094] (14) Limit (restriction / restrict / restricted) This can be rephrased as not being permitted. Also, not prohibiting something 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 something is completely prohibited.

[0095] (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.

[0096] (16) Luma: An adjective, denoted by the symbol or subscript Y or L, that specifies that a sample array or a single sample represents a monochrome signal associated with a primary color. Instead of the term luma, the term luminance may also be used.

[0097] [Description] In the drawings, the same reference numerals refer to the same or similar elements, and the sizes and relative positions of the elements in the drawings are not necessarily drawn to scale.

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

[0099] Below, 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.

[0100] (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.

[0101] (2) In the encoding device or decoding device according to the embodiment, the functions or processes performed by some of the 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.

[0102] (3) In the method implemented by the encoding device or decoding device according to 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.

[0103] (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 each aspect of the present disclosure.

[0104] (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.

[0105] (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.

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

[0107] (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 video encoding or video decoding disclosed in the embodiments.

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

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

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

[0111] Note that the original image before encoding that is input to the encoding device 100 is also called an original image, an original signal, or an original sample. The image may be a moving image 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. The image is composed of an array of pixels or pixel values, and the signal representing the image or the pixel values ​​is also called a sample. The stream may also be called a bitstream, coded bitstream, compressed bitstream, or coded signal. The encoding device may also be called an image encoding device or a moving image encoding device, and the encoding method used by the encoding device 100 may also be called an encoding method, an image coding method, or a moving image coding method.

[0112] 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, but may also be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting or satellite broadcasting. The network Nw may also 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)).

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

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

[0115] [Data Structure] Figure 2 is a diagram showing an example of a hierarchical structure of data in a stream. The stream includes, for example, a video sequence. 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 Figure 2(a).

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

[0117] The SPS includes parameters used for the 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.

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

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

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

[0121] A brick includes one or more coding tree units (CTUs), as shown in FIG. 2(d).

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

[0123] 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 the decoding device 200 references to decode the one or more CUs.

[0124] A CU may be divided into multiple small 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 an SBT, which will be described later. A CU may also 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.

[0125] Note that the 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.

[0126] [Picture Structure: Slices / Tiles] In order to decode pictures in parallel, pictures may be structured in slices or tiles.

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

[0128] FIG. 3 illustrates an example of a slice configuration. For example, a picture includes 11×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. The shape of a slice is determined by dividing the picture horizontally. The slice boundaries do not necessarily have to be at the edges of the screen, but may be anywhere within the boundaries of the CTUs within the screen. The processing order (encoding order or decoding order) of the CTUs in a slice is, for example, raster scan order. Each 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 first CTU in the slice and the slice type.

[0129] A tile is a unit of rectangular area that makes up a picture. A number called TileId may be assigned to each tile in raster scan order.

[0130] 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 the 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.

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

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

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

[0134] As shown in FIG. 5 , the encoding device 100 may generate a temporally / spatially scalable stream by encoding each of a plurality of pictures into one of a plurality of layers. For example, the encoding device 100 may achieve scalability by encoding pictures layer by layer, where an enhancement layer exists above a base layer. This 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 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.

[0135] Furthermore, the enhancement layer may include meta-information based on image statistical information, etc. The decoding device 200 may generate high-quality moving images by super-resolving pictures in the base layer based on the meta-information. Super-resolution may be either an improvement in the signal-to-noise (SN) 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 the filter process, machine learning, or least-squares calculation used in the super-resolution process.

[0136] 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. Furthermore, attributes of objects (such as a person, a car, or a ball) and their positions within the picture (such as coordinate positions within 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.

[0137] Furthermore, the meta information may be stored in units consisting of multiple pictures, such as streams, sequences, or random access units, etc. 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 the information in units of pictures, it is possible to identify the picture in which the object exists and the position of the object within that picture.

[0138] [Encoding Device] Next, a description will be given of an encoding device 100 according to an embodiment. Fig. 7 is a block diagram showing an example of the configuration of the encoding device 100 according to an embodiment. The encoding device 100 encodes an image in units of blocks.

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

[0140] [Implementation Example of Encoding Device] Fig. 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.

[0141] 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 components for storing information.

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

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

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

[0145] 7 may not be implemented in the encoding device 100, and all of the above-described processes may not be performed. 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.

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

[0147] [Overall Flow of Encoding Process] FIG. 9 is a flowchart showing an example of the overall encoding process performed by the encoding device 100.

[0148] 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 x 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 block 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 for each of the plurality of blocks.

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

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

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

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

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

[0154] 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. Note that 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.

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

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

[0157] In the above example, the encoding device 100 selects one division pattern for fixed-size blocks and encodes each block according to that division pattern, but it may also encode each block according to each of a plurality of division patterns. In this case, the 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.

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

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

[0160] [Divider] The divider 102 divides each picture included in the original image into multiple blocks and outputs each block to the subtractor 104. For example, the divider 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 divider 102 then divides each of the fixed-size blocks into blocks of a variable size (e.g., 64x64 pixels or less), for example, based on recursive quadtree and / or binary tree block division. That is, the divider 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.

[0161] 10 is a diagram showing an example of block division according to an 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.

[0162] Here, the 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).

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

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

[0165] The lower-left 64x64 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.

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

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

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

[0169] Fig. 11 is a diagram showing an example of the 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.

[0170] 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 in accordance with the division pattern, and outputs one or more blocks obtained by the division to the subtraction unit 104.

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

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

[0173] 12 is a diagram showing examples of division patterns, such as quarter division (QT) in which a block is divided into two parts each in the horizontal and vertical directions, three divisions (HT or VT) in which a block is divided in the same direction at a ratio of 1:2:1, two divisions (HB or VB) in which a block is divided in the same direction at a ratio of 1:1, and no division (NS).

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

[0175] 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). It should be noted that further division may be repeatedly applied using a similar process to each of one or more blocks obtained by division using such a division pattern. 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 .

[0176] 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 splitting is to be performed (S: Split flag), then there is information indicating whether or not 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 splitting into two or three (BT: BT flag or TT: TT flag).

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

[0178] [Subtraction Unit] 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. That is, the subtraction unit 104 calculates a prediction residual of the current block. The subtraction unit 104 then outputs the calculated prediction residual to the conversion unit 106.

[0179] The original image is an input signal to the encoding device 100, and is, for example, a signal (for example, a luma signal and two chroma signals) representing the image of each picture that makes up a moving image.

[0180] [Transform Unit] 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.

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

[0182] 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 (intra prediction, inter prediction, etc.) or on the intra prediction mode.

[0183] 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, although the 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).

[0184] Furthermore, the transform unit 106 may retransform the transform coefficients (i.e., the transform results). Such retransformation may be referred to as adaptive secondary transform (AST) or 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 or not 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 be at other levels (e.g., the sequence level, picture level, slice level, brick level, or CTU level).

[0185] 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 multidimensional input as one dimension and performing transformation collectively.

[0186] For example, an example of a non-separable transformation is one in which, if the input is a 4x4 pixel block, it is treated as a single array with 16 elements, and transformation processing is performed on that array using a 16x16 transformation matrix.

[0187] In addition, in another example of a non-separable transform, a 4x4 pixel input block may be treated as a single array having 16 elements, and then a transform (Hypercube Givens Transform) may be performed in which Givens rotation is performed multiple times on the array.

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

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

[0190] 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. A 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 halving, but also quartering. Furthermore, it is also possible to make it more flexible by encoding information indicating the partitioning method and signaling it in the same way as CU partitioning. Note that SVT is also sometimes called SBT (Sub-block Transform).

[0191] 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 a 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 short side of the rectangle is orthogonally transformed using DST7, and the long side is orthogonally transformed using DCT2. Also, for example, if the shape of the CU is square, if MTS is enabled in the sequence, DCT2 is used, and if MTS is disabled, DST7 is used for orthogonal transform. DCT2 and DST7 are merely examples, and other transform types may be used, or different combinations of transform types may be used. The IMTS may be available only for intra-predicted blocks, or may be available for both intra-predicted and inter-predicted blocks.

[0192] The above describes three selection processes, MTS, SBT, and IMTS, as selection processes for selectively switching 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 each 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 for selectively switching the transform type may use a selection process different from the above three selection processes, or each of the above three selection processes may be replaced with a different process, as long as at least one of the following four functions [1] to [4] can be realized. Function [1] is a function for orthogonally transforming the entire range within a CU and encoding information indicating the transform type used for the transform. Function [2] is a function for orthogonally transforming the entire range of a CU and determining the transform type based on a predetermined rule without encoding information indicating the transform type. Function [3] is a function for orthogonally transforming a partial region of a CU and encoding information indicating the transform type used for the transform. Function [4] is a function for orthogonally transforming a partial region of a CU and determining the transform type based on a predetermined rule without encoding information indicating the transform type used for the transform.

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

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

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

[0196] For example, the transform unit 106 determines whether or not to perform an orthogonal transform (step St_1). Here, 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 multiple 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 an 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.

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

[0198] As an example, the first transform type group may include DCT2, DST7, and DCT8. As another example, the second transform type group may include DCT2. The transform types included in the first transform type group and the second transform type group may partially overlap, or may all be different transform types.

[0199] Specifically, the transform unit 106 determines whether the transform size is equal to or less than a predetermined value (step Su_1). If it is determined that the transform size is equal to or less 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 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 less 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).

[0200] 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 of the current block. 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 encoded. The second transform type group may include multiple transform types, and the information indicating the transform type to be used for the orthogonal transform, among the one or more transform types included in the second transform type group, may be encoded.

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

[0202] [Quantization Unit] The quantization unit 108 quantizes the transform coefficients output from the transform unit 106. Specifically, the quantization unit 108 scans the multiple transform coefficients of the current block in a predetermined scanning order and quantizes the multiple transform coefficients based on quantization parameters (QP) corresponding to the scanned transform coefficients. The quantization unit 108 then outputs the multiple 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.

[0203] The predetermined scanning order is an order for quantizing / dequantizing the 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).

[0204] 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 of the quantized coefficient (quantization error) increases.

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

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

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

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

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

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

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

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

[0213] 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). If it determines to perform quantization (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).

[0214] Next, the quantization processing unit 108e quantizes the transform coefficients of the current block using the quantization parameter generated in step Sv_2 (step Sv_4). The predicted quantization parameter generation unit 108b then 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). The 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, causing the entropy coding unit 110 to encode the differential quantization parameter (step Sv_8).

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

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

[0217] [Entropy Encoding Unit] FIG. 20 is a block diagram showing an example of the configuration of the entropy encoding unit 110. As shown in FIG.

[0218] 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 the 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-value signals such as the quantization coefficients and the prediction parameters into binary signals. Examples of binarization methods include truncated rice binarization, exponential Golomb codes, and fixed length binarization. The context control unit 110b derives a context value, i.e., the probability of occurrence of a binary signal, based on the characteristics of a syntax element or the surrounding circumstances. Methods for deriving this context value include, for example, bypassing, referencing a syntax element, referencing an upper or left adjacent block, referencing hierarchical information, and others. The binary arithmetic coding unit 110c performs arithmetic coding on the binarized signal using the derived context value.

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

[0220] First, initialization is performed in the 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 quantized 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.

[0221] [Inverse Quantization Unit] 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.

[0222] [Inverse Transform Unit] 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.

[0223] 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 quantization error.

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

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

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

[0227] [Loop Filter Unit] 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. A 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).

[0228] FIG. 22 is a block diagram showing an example of the configuration of the loop filter unit 120.

[0229] As shown in FIG. 22 , the loop filter unit 120 includes a deblocking filter processing unit 120a, an SAO processing unit 120b, and an ALF processing unit 120c. The deblocking filter processing unit 120a performs the deblocking filter processing described above on the reconstructed image. The SAO processing unit 120b performs the SAO processing described above on the reconstructed image after the deblocking filter processing. The ALF processing unit 120c applies the ALF processing described above to the reconstructed image after the SAO processing. Details of the ALF and deblocking filter will be described later. The SAO processing is a process for improving image quality by reducing ringing (a phenomenon in which pixel values ​​around edges are distorted in a wavy manner) and correcting pixel value deviations. Examples of this SAO processing include edge offset processing and band offset processing. Note that the loop filter unit 120 does not need to include all of the processing units disclosed in FIG. 22 , and may include only some of the processing units. 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.

[0230] [Loop Filter > Adaptive Loop Filter] In ALF, a least square error filter is applied to remove coding artifacts. For example, for each 2x2 pixel sub-block in the current block, one filter is selected from among multiple filters based on the local gradient direction and activity.

[0231] Specifically, first, subblocks (e.g., 2x2 pixel subblocks) are classified into multiple classes (e.g., 15 or 25 classes). The subblocks 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 subblocks are classified into multiple classes based on the classification value C.

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

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

[0234] The shape of the filter used in ALF is, for example, a circularly symmetric shape. Figures 23A to 23C are diagrams showing several examples of filter shapes used in ALF. Figure 23A shows a 5x5 diamond-shaped filter, Figure 23B shows a 7x7 diamond-shaped filter, and Figure 23C shows a 9x9 diamond-shaped filter. Information indicating the filter shape is usually signaled at the picture level. Note that signaling of 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).

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

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

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

[0238] 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 transmitted in APS, scaled by a factor of 2^10, and rounded to a 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).

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

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

[0241] The weight value is coded into a sign flag and a weight index. The weight index (denoted 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:

[0242] If weight_index is less than or equal to 4, then JcCcWeight is equal to weight_index>>2.

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

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

[0245] [Loop Filter Unit>Deblocking Filter] In deblocking filtering, the loop filter unit 120 reduces distortion occurring at block boundaries of the reconstructed image by performing filtering on the block boundaries.

[0246] FIG. 24 is a block diagram showing an example of a detailed configuration of the deblocking filter processing unit 120a.

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

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

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

[0250] The filter determination unit 1203 determines whether or not 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.

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

[0252] When the filtering unit 1205 acquires the pre-filtering 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 filtering unit 1205 outputs the filtered pixel to the switch 1206.

[0253] 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 filtering processing unit 1205 under the control of the processing determining unit 1208 .

[0254] The processing determination unit 1208 controls the switch 1206 based on the respective determination results of the boundary determination unit 1201 and the filter determination unit 1203. That is, when the boundary determination unit 1201 determines that the target pixel is located near a block boundary and the filter determination unit 1203 determines that deblocking filtering is to 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 processing unit 120a, and the deblocking filtering processing unit 120a may have other configurations.

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

[0256] In the deblocking filter process, for example, one of two deblocking filters with different characteristics, that is, a strong filter and a weak filter, is selected using pixel values ​​and a quantization parameter. In the strong filter, as shown in Figure 25, when pixels p0 to p2 and pixels q0 to q2 exist on either side of a block boundary, the pixel values ​​of the pixels q0 to q2 are changed to pixel values ​​q'0 to q'2 by performing the calculation shown in the following equation.

[0257] 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

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

[0259] 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 according to the above formula is clipped to "the pixel value before the operation ±2 × the threshold" using a threshold determined from the quantization parameter. This makes it possible to prevent excessive smoothing.

[0260] Fig. 26 is a diagram for explaining an example of a block boundary on which deblocking filtering is performed, and Fig. 27 is a diagram showing an example of a BS value.

[0261] The block boundary on which the deblocking filter process is performed is, for example, a boundary between CUs, PUs, or TUs in an 8×8 pixel block as shown in Fig. 26. The deblocking filter process 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.

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

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

[0264] 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 the predicted image of the current block using a reconstructed image that has already been obtained by generating predicted images for other blocks, generating prediction residuals, generating quantization coefficients, restoring the prediction residuals, and adding the predicted images.

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

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

[0267] The prediction unit generates a predicted image using a first method (step Sc_1a), a second method (step Sc_1b), and 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.

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

[0269] 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 the 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 the predicted image in step Sc_3 may be performed based on parameters used in the encoding process. The encoding device 100 may signal information identifying the selected predicted image, method, or mode in the stream. This 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 that 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 that method or mode.

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

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

[0272] First, the prediction unit generates a predicted image by intra prediction (step Sd_1a), and then 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.

[0273] 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. The prediction unit may then select, from the intra-predicted image and the inter-predicted image, the predicted image for which the smallest cost C has been calculated as the final predicted image for the current block (step Sd_3). That is, a prediction method or mode for generating a predicted image for the current block is selected.

[0274] [Intra Prediction Unit] 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.

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

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

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

[0278] In various implementation examples, a luma block may be referenced in 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 referred to as CCLM (cross-component linear model) prediction. An intra prediction mode of a chroma block that references such a luma block (e.g., referred to as a CCLM mode) may be added as one of the intra prediction modes of the chroma block.

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

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

[0281] The intra prediction unit 124 selects one intra prediction mode from multiple 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 planar prediction mode and 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).

[0282] If 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.

[0283] On the other hand, if 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 by the entropy coding unit 110 as prediction parameters. The information indicating the intra prediction mode indicates, for example, any value between 0 and 60.

[0284] [Inter Prediction Unit] 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 such as a slice, a brick, or a picture.

[0285] For example, the inter prediction unit 126 performs motion estimation for the current block or current sub-block within a reference picture to find a reference block or sub-block that best matches the current block or current sub-block. The inter prediction unit 126 then 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.

[0286] The motion information used for motion compensation may be signaled as an inter-predicted image in various forms. For example, a motion vector may be signaled. As another example, a difference between a motion vector and a motion vector predictor may be signaled.

[0287] [Reference Picture List] Figure 33 is a diagram showing an example of each reference picture, and Figure 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 Figure 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 Figure 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 Figure 34, the reference picture list is a list indicating candidate reference pictures, and for example, one picture (or slice) may have one or more reference picture lists. For example, if the current picture is a uni-predictive picture, one reference picture list is used, and if the current picture is a bi-predictive 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 prediction unit 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.

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

[0289] [Basic Flow of Inter Prediction] FIG. 35 is a flowchart showing the basic flow of inter prediction.

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

[0291] 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 previously derived MVs may be added 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, an area of ​​a reference picture indicated by the candidate MV. Note that searching an area of ​​a reference picture may also be referred to as motion estimation.

[0292] In addition, 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 other components included in the encoding device 100.

[0293] 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. 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. The process of step Se_3 corresponds to the process of step Sd_1b in Fig. 30.

[0294] [MV Derivation Flow] FIG. 36 is a flowchart showing an example of MV derivation.

[0295] The inter predictor 126 may derive the motion vectors (e.g., motion vectors) of the current block in a mode that encodes motion information. In this case, the motion information may be coded and signaled as prediction parameters, i.e., the coded motion information is included in the stream.

[0296] Alternatively, the inter predictor 126 may derive MVs in a mode that does not encode motion information, in which case the motion information is not included in the stream.

[0297] 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. Furthermore, modes that do not encode motion information include FRUC mode. The inter prediction unit 126 selects a mode for deriving MVs of the current block from these multiple modes, and derives the MVs of the current block using the selected mode.

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

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

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

[0301] As described above, MV derivation modes include normal inter, normal merge, FRUC, and affine modes, which will be described later. Among these modes, modes that encode differential MVs include normal inter and affine modes (specifically, affine inter modes). Modes that do not encode differential MVs include FRUC, normal merge, and affine modes (specifically, affine merge modes). The inter prediction unit 126 selects a mode for deriving MVs for the current block from these multiple modes and derives the MVs for the current block using the selected mode.

[0302] [MV Derivation Modes] Figures 38A and 38B are diagrams showing an example of classification of each MV derivation mode. For example, as shown in Figure 38A, MV derivation modes are broadly 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 Figure 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. Among the merge modes, MMVD mode exceptionally encodes differential motion vectors. 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 motion vectors of each of the multiple sub-blocks constituting the current block are derived as the motion vector of the current block. FRUC mode is a mode in which the motion vector of the current block is derived by searching between already-encoded regions, and neither motion information nor differential motion vectors are encoded. Each of these modes will be described in detail later.

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

[0304] [MV Derivation > Normal Inter Mode] 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.

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

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

[0307] Next, the inter prediction unit 126 extracts N candidate MVs (N is an integer equal to or greater than 2) from the plurality of candidate MVs obtained 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.

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

[0309] Next, the inter prediction unit 126 derives the motion vector 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 between the derived motion vector and the predicted motion vector as a differential motion vector into a stream. That is, the inter prediction unit 126 outputs the differential motion vector 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 consisting of multiple blocks reconstructed after coding.

[0310] 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. Furthermore, 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.

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

[0312] The candidate MV list may be shared 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 the candidate MV list include extracting or selecting candidate MVs from the candidate MV list, sorting candidate MVs, or deleting candidate MVs.

[0313] [MV Derivation > Normal Merge Mode] 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 normal merge mode is a merge mode in the narrow sense, and may also be simply referred to as merge mode. In this embodiment, normal merge mode and merge mode are distinguished, and merge mode is used in a broad sense.

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

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

[0316] Next, the inter prediction unit 126 derives the MV of the current block by selecting one candidate MV from the multiple candidate MVs obtained 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 the 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.

[0317] 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 example, for each block. 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. Furthermore, 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 necessarily 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.

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

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

[0320] 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 spatially located around the current block, temporally adjacent candidate MVs, which are MVs held by blocks near the current block projected onto the coded reference picture, 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.

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

[0322] Furthermore, the entropy coding unit 110 codes merge_idx, which is a signal indicating which candidate MV has been selected, in the stream.

[0323] 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 candidate MVs other than the types of candidate MVs shown in the figure.

[0324] 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, the differential MV is not encoded, whereas in MMVD mode, the differential MV is encoded. In MMVD mode, one candidate MV is selected from the candidate MV list, as in normal merge mode, but the differential MV is encoded. 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 does not need to be the same as the differential MV used in inter mode. For example, the derivation of the differential MV in MMVD mode may require a smaller amount of processing than the derivation of the differential MV in inter mode.

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

[0326] The candidate MV list may also be called a candidate list. Also, merge_idx is MV selection information.

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

[0328] In normal merge mode, a candidate MV is selected from a candidate MV list generated by referring to a coded block (e.g., a CU) to determine the MV of the current block (e.g., a CU). 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.

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

[0330] 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, each 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.

[0331] For example, the inter prediction unit 126 checks, for each MV managed in the FIFO buffer, starting with HMVP1, whether that 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. In this case, the number of candidate MVs registered from the FIFO buffer may be one or more.

[0332] By using the HMVP mode in this way, it is possible to add not only the motion vectors of blocks spatially or temporally adjacent to the current block but also motion vectors of previously processed blocks to the candidate motion vectors, which increases the variety of candidate motion vectors for normal merge mode and increases the possibility of improving coding efficiency.

[0333] 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 MV values ​​but also information indicating the reference picture, the reference direction, and the number of pictures. The above-mentioned block may be, for example, a CU.

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

[0335] 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 the affine mode may be stored in a FIFO buffer in order of most recent to most 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.

[0336] [MV Derivation>FRUC Mode] Motion information may be derived on the decoding device 200 side without being signaled from 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 decoding device 200 side performs motion estimation without using pixel values ​​of the current block. Modes in which such motion estimation is performed on the decoding device 200 side include frame rate up-conversion (FRUC) mode and pattern matched motion vector derivation (PMMVD) mode.

[0337] An example of the FRUC process is shown in FIG. 43. First, by referencing the motion vectors of each coded block spatially or temporally adjacent to the current block, a list indicating these motion vectors as candidate motion vectors (i.e., a candidate motion vector list, which may be the same as the candidate motion vector list for normal merge mode) is generated (step Si_1). Next, a best candidate motion vector is selected from the multiple candidate motion vectors registered in the candidate motion vector list (step Si_2). For example, an evaluation value of each candidate motion vector included in the candidate motion vector list is calculated, and one candidate motion vector is selected as the best candidate motion vector based on the evaluation value. Then, a motion vector for the current block is derived based on the selected best candidate motion vector (step Si_4). Specifically, for example, the selected best candidate motion vector is directly derived as the motion vector for the current block. Alternatively, for example, a motion vector for the current block may be derived by performing pattern matching in a region surrounding a position in the reference picture corresponding to the selected best candidate motion vector. 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 a 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 a MV with a better evaluation value.

[0338] 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 example, for each block. 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 FRUC mode for that slice is completed. Furthermore, when the processes of steps Si_1 to Si_5 are performed for each of all blocks included in a picture, inter prediction using FRUC mode for that 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 FRUC mode for that 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 FRUC mode for that picture may be completed.

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

[0340] The evaluation value may be calculated by various methods. For example, a reconstructed image of a region in a reference picture corresponding to the MV is compared with a reconstructed image of a predetermined region (which may be, for example, a region in another reference picture or a region 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 for the MV. Note that the evaluation value may be calculated using other information in addition to the difference value.

[0341] 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 a 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 may be called bilateral matching and template matching, respectively.

[0342] [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 candidate MV.

[0343] 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 the most closely matched pair 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 multiple candidate MVs may be selected as the best candidate MV.

[0344] 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 (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, if the current picture is located between two reference pictures temporally 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.

[0345] [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 a 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.

[0346] 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, a difference is derived between a reconstructed image of both or either of the coded areas adjacent to the left and / or above the current block and a reconstructed image at the same position in the coded reference picture (Ref0) specified by the candidate MV, and an evaluation value is calculated using the obtained difference value. The candidate MV with the best evaluation value among multiple candidate MVs may be selected as the best candidate MV.

[0347] Information indicating whether such a FRUC mode is applied (e.g., referred to as a FRUC flag) may be signaled at the CU level. Also, if the FRUC mode is applied (e.g., if 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).

[0348] [Movement Vector Derivation>Affine Mode] The affine mode is a mode in which motion vectors are generated using an affine transformation, and may derive motion vectors for each sub-block based on motion vectors of multiple neighboring blocks. This mode is sometimes called an affine motion compensation prediction mode.

[0349] 46A is a diagram illustrating an example of deriving motion vectors for each sub-block based on motion vectors of multiple adjacent blocks. In FIG. 46A, the current block includes, for example, 16 sub-blocks each consisting of 4x4 pixels. Here, the motion vector v of the upper left corner control point of the current block is calculated based on the motion vectors of the adjacent blocks. 0 Similarly, the motion vector v of the upper right corner control point of the current block is derived based on the MV of the neighboring sub-blocks. 1 Then, the two motion vectors v are calculated by the following equation (1A): 0 and v 1 , and project the motion vectors (v x , v y ) is derived.

[0350]

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

[0352] Such information indicating the affine mode (e.g., called an affine flag) may be signaled at the CU level, but 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., sequence level, picture level, slice level, brick level, CTU level, or sub-block level).

[0353] 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, the affine modes include two modes: an affine inter (also called an affine normal inter) mode and an affine merge mode.

[0354] 46B is a diagram illustrating an example of derivation of sub-block-based motion vectors in the affine mode using three control points. In FIG. 46B, the current block includes, for example, 16 sub-blocks each consisting of 4x4 pixels. Here, the motion vector v of the upper left corner control point of the current block is calculated based on the motion vectors of the adjacent blocks. 0 Similarly, the motion vector v of the upper right corner control point of the current block is derived based on the motion vectors of the neighboring blocks. 1 is derived, and the motion vector v of the bottom left corner control point of the current block is calculated based on the MV of the neighboring block. 2 Then, the three motion vectors v are calculated by the following equation (1B): 0 , v 1 and v 2 , and project the motion vectors (v x , v y ) is derived.

[0355]

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

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

[0358] Furthermore, such an affine mode having three control points may include several modes that differ in the method of deriving the MVs of the upper-left, upper-right, and lower-left corner control points. For example, the affine mode having three control points includes two modes, an affine inter mode and an affine merge mode, similar to the affine mode having two control points described above.

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

[0360] [MV Derivation>Affine Mode>Control Point] FIGS. 47A, 47B, and 47C are conceptual diagrams for explaining an example of MV derivation of a control point in affine mode.

[0361] In the affine mode, as shown in Figure 47A, predicted motion vectors (MVs) of each control point of the current block are calculated based on multiple motion vectors corresponding to blocks coded in affine mode, among the coded blocks A (left), B (top), C (top right), D (bottom left), and E (top left) adjacent to the current block. Specifically, coded blocks A (left), B (top), C (top right), D (bottom left), and E (top left) are examined in this order, and the first valid block coded in affine mode is identified. Motion vectors of the control points of the current block are calculated based on multiple motion vectors corresponding to this identified block.

[0362] For example, as shown in FIG. 47B, if block A adjacent to the left of the current block is coded in an affine mode with two control points, the motion vector v projected onto the positions of the upper left and upper right corners of the coded block including block A is 3 and v 4 Then, the derived motion vector v 3 and v 4 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 is calculated.

[0363] For example, as shown in FIG. 47C, if block A adjacent to the left of the current block is coded in an affine mode with three control points, the motion vector v projected onto the positions of the upper left corner, upper right corner, and lower left corner of the coded block including block A is 3 , v 4 and v 5 Then, the derived motion vector v 3 , v 4 and v 5 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 and the motion vector v of the bottom left corner control point 2 is calculated.

[0364] 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 below, 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 below.

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

[0366] FIG. 48A is a diagram illustrating an affine mode having two control points.

[0367] In this affine mode, as shown in FIG. 48A, a motion vector selected from the motion vectors of coded blocks A, B, and C adjacent to the current block is used to determine the motion vector v of the upper left corner control point of the current block. 0 Similarly, the motion vector v of the upper right corner control point of the current block is selected from the motion vectors of the coded blocks D and E adjacent to the current block. 1 It is used as.

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

[0369] In this affine mode, as shown in FIG. 48B, a motion vector selected from the motion vectors of coded blocks A, B, and C adjacent to the current block is used to determine the motion vector v of the upper left corner control point of the current block. 0 Similarly, the motion vector v of the upper right corner control point of the current block is selected from the motion vectors of the coded blocks D and E adjacent to the current block. 1 Furthermore, the motion vector v of the lower left corner control point of the current block is selected from the motion vectors of the coded blocks F and G adjacent to the current block. 2 It is used as.

[0370] 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 shown in Figure 51 described below.

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

[0372] 49A and 49B are conceptual diagrams for explaining 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.

[0373] For example, as shown in Figure 49A, the current block has three control points, the upper left corner, the upper right corner, and the lower left corner, and the block A adjacent to the left of the current block is coded in the affine mode with two control points. In this case, the motion vector v projected onto the positions of the upper left corner and the upper right corner of the coded block including block A is 3 and v 4 Then, the derived motion vector v 3 and v 4 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 Furthermore, the derived motion vector v 0 and v 1 From the motion vector v of the bottom left corner control point 2 is calculated.

[0374] 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 the affine mode with three control points. In this case, the motion vector v projected onto the positions of the upper left, upper right, and lower left corners of the coded block including block A is 3 , v 4 and v 5 Then, the derived motion vector v 3 , v 4 and v 5 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 is calculated.

[0375] 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 shown in Figure 51 described below.

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

[0377] In the affine merge mode, the inter predictor 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 predictor 126 may encode MV selection information for identifying the derived two or three MVs into the stream.

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

[0379] The inter prediction unit 126 derives the motion vectors v of the control points using the first valid block coded in the identified affine mode. For example, if a block A is identified and the block A has two control points, as shown in Figure 47B, the inter prediction unit 126 derives the motion vectors v of the upper left and upper right corners of the coded block including the block A. 3 and v 4 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 For example, the inter prediction unit 126 calculates the motion vectors v3 and v 4 By projecting the current block onto the current block, the motion vector v 0 and the motion vector v of the upper right corner control point 1 and calculate.

[0380] Alternatively, when block A is identified and block A has three control points, as shown in FIG. 47C , the inter predictor 126 calculates the motion vectors v 3 , v 4 and v 5 From the motion vector v of the upper left corner control point of the current block, 0 and the motion vector v of the upper right corner control point 1 and the motion vector v of the bottom left corner control point 2 For example, the inter prediction unit 126 calculates the motion vectors v 3 , v 4 and v 5 By projecting the current block onto the current block, the motion vector v 0 and the motion vector v of the upper right corner control point 1 and the motion vector v of the bottom left corner control point 2 and calculate.

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

[0382] Next, the inter prediction unit 126 performs motion compensation for each of the sub-blocks included in the current block. That is, the inter prediction unit 126 calculates two motion vectors v 0 and v 1 and the above equation (1A), or three motion vectors v0 , v 1 and v 2 and the above-mentioned equation (1B), the motion vectors of the sub-blocks are calculated as affine motion vectors (step Sk_2). Then, the inter prediction unit 126 performs motion compensation on the sub-blocks using the affine motion vectors and the coded reference picture (step Sk_3). When the processes of steps Sk_2 and Sk_3 have been performed on 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. In other words, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0383] In step Sk_1, the above-mentioned candidate MV list may be generated. The candidate MV list may be, for example, a list containing 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.

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

[0385] For example, the candidate MV list may include candidate MVs for affine merge mode with two control points and candidate MVs for affine merge mode with three control points. Alternatively, a candidate MV list including candidate MVs for affine merge mode with two control points and a candidate MV list including candidate MVs for affine merge mode with three control points may be generated. Alternatively, a candidate MV list including candidate MVs for either affine merge mode with two control points or affine merge mode with 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.

[0386] As the MV selection information, an index indicating which candidate MV in the candidate MV list is sent may be sent.

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

[0388] In the affine inter mode, the inter prediction unit 126 first calculates the predicted MVs (v 0 , v 1 ) or (v 0 , v 1 , v 2 ) is derived (step Sj_1). The control point is the upper left corner, upper right corner, or lower left corner of the current block, as shown in FIG. 46A or FIG. 46B.

[0389] For example, when the MV derivation method shown in Figures 48A and 48B is used, the inter prediction unit 126 selects the MV of one of the coded blocks near each control point of the current block shown in Figure 48A or 48B to derive the predicted MV (v 0 , v 1 ) or (v0 , v 1 , v 2 At this time, the inter prediction unit 126 encodes prediction MV selection information for identifying the selected two or three prediction MVs into the stream.

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

[0391] Next, the inter predictor 126 performs motion estimation (steps Sj_3 and Sj_4) while updating each of the prediction MVs selected or derived in step Sj_1 (step Sj_2). Specifically, the inter predictor 126 calculates the affine MVs of each subblock corresponding to the updated prediction MV using the above-described formula (1A) or (1B) (step Sj_3). The inter predictor 126 then performs motion compensation for each subblock using the affine MVs and the coded reference picture (step Sj_4). The processes of steps Sj_3 and Sj_4 are performed for all blocks within the current block each time the prediction MV is updated in step Sj_2. As a result, the inter predictor 126 determines, for example, the prediction MV that provides the smallest cost in the motion estimation loop as the MV of the control point (step Sj_5). At this time, the inter predictor 126 further encodes the difference between the determined MV and the prediction 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 .

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

[0393] In step Sj_1, the above-mentioned candidate MV list may be generated. The candidate MV list may be, for example, a list containing 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.

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

[0395] Note that a candidate MV list may be generated that includes candidate MVs for affine inter modes with two control points and candidate MVs for affine inter modes with three control points. Alternatively, a candidate MV list may be generated that includes candidate MVs for affine inter modes with two control points and a candidate MV list that includes candidate MVs for affine inter modes with three control points. Alternatively, a candidate MV list may be generated that includes candidate MVs for one of affine inter modes with two control points and affine inter modes with three control points. 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.

[0396] In addition, an index indicating which candidate MV in the candidate MV list is being sent as the predicted MV selection information.

[0397] [MV Derivation > Triangle Mode] In the example described above, 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 these multiple predicted images to generate a final rectangular predicted image. The shape other than a rectangle may be, for example, a triangle.

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

[0399] The inter prediction unit 126 generates a predicted image of a triangle 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 predicted image of a triangle 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 of the same rectangle as the current block.

[0400] Note that a rectangular first predicted image corresponding to the current block may be generated using the first MV as the predicted image of the first partition. Furthermore, a rectangular second predicted image corresponding to the current block may be generated using the second MV as the predicted image of the second partition. A predicted image of the current block may be generated by performing weighted addition of the first predicted image and the second predicted image. Note that the portion subjected to weighted addition may be limited to a partial region sandwiching the boundary between the first partition and the second partition.

[0401] 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 the edge of the first partition, where N is an integer greater than zero, e.g., N may be the integer 2. FIG. 52B illustrates a rectangular partition having a rectangular portion one-quarter the width of the first partition, where 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 one-quarter the height of the first partition, where 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 triangle 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.

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

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

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

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

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

[0407] The inter prediction unit 126 then selects candidate MVs for the first partition and the second partition as the first MV and the second MV, respectively, from the multiple candidate MVs obtained 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.

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

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

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

[0411] The first and second partitions may overlap, i.e., the first and second partitions may include the same pixel area, in which 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.

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

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

[0414] The partition information may include at least an index indicating a division direction for dividing the current block into multiple partitions. The MV selection information may include an index indicating a selected first MV and an index indicating a 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.

[0415] [MV Derivation>ATMVP Mode] FIG. 54 is a diagram showing an example of the ATMVP mode in which MVs are derived for each subblock.

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

[0417] Specifically, in ATMVP mode, as shown in Figure 54, a temporal MV reference block associated with the current block is first 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 the sub-block. This generates a predicted image for each sub-block.

[0418] 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. Furthermore, 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.

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

[0420] The inter prediction unit 126 derives motion vectors for the current block in merge mode (step S1_1). Next, the inter prediction unit 126 determines whether to perform motion vector search, i.e., motion search (step S1_2). If the inter prediction unit 126 determines not to perform motion search (No in step S1_2), it determines the motion vectors derived in step S1_1 as the final motion vectors for the current block (step S1_4). That is, in this case, the motion vectors for the current block are determined in merge mode.

[0421] 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 predictor 126 derives the final motion vector for the current block by searching the surrounding area of ​​the reference picture indicated by the motion vector derived in step S1_1 (step S1_3). That is, in this case, the motion vector for the current block is determined by DMVR.

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

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

[0424] 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 between each pixel value of the template and each pixel value of the search area, the candidate MV value, etc.

[0425] Any process may be used, not limited to the process described here, as long as it is capable of searching the vicinity of the candidate MV and deriving the final MV.

[0426] Fig. 57 is a conceptual diagram for explaining another example of DMVR for determining MV. Unlike the example of DMVR shown in Fig. 56, this example shown in Fig. 57 calculates costs without generating templates.

[0427] First, the inter prediction unit 126 searches around the reference blocks included in each of the reference pictures in 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 estimation, the inter prediction unit 126 first sets a search position for the reference picture in the L0 list. The difference vector indicating the set search position, specifically, the 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 the 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.

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

[0429] First, in Step 1, the inter prediction unit 126 calculates the costs at 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 processing of Step 2. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 126 skips the processing of Step 2 and performs the processing of Step 3.

[0430] In Step 2, the inter prediction unit 126 sets the search position moved in accordance with the processing result of Step 1 as a new starting point and performs a search similar to the processing of Step 1. 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 processing of Step 4. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 126 performs the processing of Step 3.

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

[0432] In Step 3, the inter prediction unit 126 determines a pixel position with decimal precision that minimizes the 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 pixel position with decimal precision 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, with 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.

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

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

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

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

[0437] The inter prediction unit 126 derives motion vectors (MVs) of the current block (step Sn_1). Next, the inter prediction unit 126 generates a predicted image using the MVs (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, described below, 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).

[0438] [Motion Compensation > OBMC] An inter-predicted image may be generated using not only the motion information of the current block obtained by motion estimation, but also the motion information of neighboring blocks. Specifically, an inter-predicted 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 block (in the current picture). Such inter-prediction (motion compensation) may be called OBMC (overlapped block motion compensation) or OBMC mode.

[0439] 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 does not need to be 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).

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

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

[0442] 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 superimposing the two predicted images Pred and Pred_L. This has the effect of blending the boundaries between the neighboring blocks.

[0443] 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, in which the boundaries with the adjacent blocks have been blended (smoothed).

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

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

[0446] Here, the OBMC predicted image correction process has been described, in which a single predicted image Pred is obtained by superimposing additional predicted images Pred_L and Pred_U from a single reference picture. However, when a predicted image is corrected based on multiple reference images, a similar process may be applied to each of the multiple reference pictures. In such a case, 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.

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

[0448] 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 a region with complex motion. If the current block belongs to a region with complex motion, the encoding device 100 sets the value of obmc_flag to 1 and applies OBMC to perform encoding. If the current block does not belong to a region with complex motion, the encoding device 100 sets the value of obmc_flag to 0 and performs encoding of the block without applying OBMC. Meanwhile, the decoding device 200 decodes the obmc_flag described in the stream, and switches whether to apply OBMC depending on the value to perform decoding.

[0449] [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. Furthermore, this bi-directional optical flow may be expressed as BDOF instead of BIO.

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

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

[0452]

[0453] 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 component of the horizontal velocity and the spatial gradient of the reference image, and (iii) the product of the vertical component of the vertical velocity and the spatial gradient of the reference image is equal to zero. Based on a combination of this optical flow equation and Hermite interpolation, block-based motion vectors obtained from a candidate MV list or the like may be corrected pixel by pixel.

[0454] Note that the MV may be derived on the decoding device 200 side using a method different from the method for 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.

[0455] 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 configuration of an inter prediction unit 126 that performs inter prediction according to BIO.

[0456] 65 , the inter prediction unit 126 includes, for example, a memory 126 a, an interpolated image derivation unit 126 b, a gradient image derivation unit 126 c, an optical flow derivation unit 126 d, a correction value derivation unit 126 e, and a predicted image correction unit 126 f. Note that the memory 126 a may be the frame memory 122.

[0457] The inter prediction unit 126 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) containing 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 the motion vector (MVx0, MVy0) corresponding to the reference picture Ref0, and the motion vector M1 is the motion vector (MVx1, MVy1) corresponding to the reference picture Ref1.

[0458] 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 The interpolated image derivation unit 126b also 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, which is derived for the current block, and is an interpolated image I 1 is an 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. 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.

[0459] 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). Note that 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.

[0460] 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 described 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 4x4 pixel sub-CU. Note that the optical flow may be derived in units other than sub-blocks, such as in units of pixels.

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

[0462] Note that 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.

[0463] [Motion Compensation>LIC] Next, an example of a mode in which a predicted image (prediction) is generated using LIC (local illumination compensation) will be described.

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

[0465] First, the inter prediction unit 126 derives motion vectors (MVs) from an already-encoded reference picture to obtain a reference image corresponding to the current block (step Sz_1).

[0466] 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. The inter prediction unit 126 then calculates luminance correction parameters using the information indicating how the luminance values ​​have changed (step Sz_3).

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

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

[0469] 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 a brightness correction process may be performed on the reference images obtained from each reference picture in the same manner as described above before generating a predicted image.

[0470] As a method for determining whether to apply LIC, for example, there is a method using lic_flag, which is a signal indicating whether to apply LIC. As a specific example, in the encoding device 100, it is determined whether the current block belongs to an area where a luminance change occurs, and if the current block belongs to an area where a luminance change occurs, the value of lic_flag is set to 1 and LIC is applied for encoding, and if the current block does not belong to an area where a luminance change occurs, the value of lic_flag is set to 0 and LIC is not applied for encoding. On the other hand, the decoding device 200 may decode lic_flag described in the stream, and switch whether to apply LIC depending on the value for decoding.

[0471] Another method for determining whether to apply LIC is, for example, to determine 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 MVs 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 processing is applied to the processing on the decoding device 200 side.

[0472] LIC (luminance correction processing) has been described using Figures 66A and 66B, and will be described in detail below.

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

[0474] 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 that 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.

[0475] Next, the inter prediction unit 126 generates a predicted image for the current block by performing luminance correction processing on a reference image in a reference picture specified by the MV using the luminance correction parameter. 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.

[0476] Note that a portion 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.

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

[0478] Note that LIC may be applied not only to luminance but also to color difference. In this case, correction parameters may be derived individually for each of Y, Cb, and Cr, or a common correction parameter may be used for any of them.

[0479] Alternatively, the LIC process may be applied on a sub-block basis. For example, correction parameters may be derived using a surrounding reference region of the current sub-block and a surrounding reference region of a reference sub-block in a reference picture specified by the MV of the current sub-block.

[0480] [Prediction 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.

[0481] [Prediction Parameter Generation Unit] 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.

[0482] [Decoding 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 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.

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

[0484] [Implementation Example of Decoding Device] Fig. 68 is a block diagram showing an implementation example of the decoding device 200. The decoding device 200 includes a processor b1 and a memory b2. For example, multiple components of the decoding device 200 shown in Fig. 67 are implemented by the processor b1 and memory b2 shown in Fig. 68.

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

[0486] 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 storage, a recording medium, or the like. The memory b2 may also be a non-volatile memory or a volatile memory.

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

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

[0489] 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 the 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.

[0490] Below, 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, inverse transform unit 206, adder 208, block memory 210, frame memory 214, intra prediction unit 216, inter prediction unit 218, prediction control unit 220, and loop filter unit 212 included in the decoding device 200 perform the same processing as the inverse quantization unit 112, inverse transform unit 114, adder 116, block memory 118, frame memory 122, intra prediction unit 124, inter prediction unit 126, prediction control unit 128, and loop filter unit 120 included in the encoding device 100, respectively.

[0491] [Overall Flow of Decoding Process] FIG. 69 is a flowchart showing an example of the overall decoding process by the decoding device 200.

[0492] 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 based on parameters input from the entropy decoding unit 202 (step Sp_1). 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.

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

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

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

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

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

[0498] 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 process from step Sp_1.

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

[0500] 70 is a diagram showing the relationship between the division determination unit 224 and other components. The division determination unit 224 may perform the following processing, for example.

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

[0502] [Entropy Decoding Unit] FIG. 71 is a block diagram showing an example of the configuration of the entropy decoding unit 202. As shown in FIG.

[0503] The entropy decoding unit 202 entropy-decodes the stream to generate quantization coefficients, prediction parameters, and parameters related to the division pattern. 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 performs multi-value conversion (debinarization) to convert the binary signal output from the binary arithmetic decoding unit 202a into a multi-value signal indicating the above-mentioned quantization coefficients, etc. This multi-value conversion is performed in accordance with the binarization method described above.

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

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

[0506] First, initialization is performed in the 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.

[0507] [Inverse Quantization Unit] 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 inversely quantized quantized coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.

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

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

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

[0511] 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 to perform inverse quantization (step Sv_11). 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 for the current block from the entropy decoding unit 202 (step Sv_12).

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

[0513] The quantization parameter generation unit 204a then adds the differential 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. The quantization parameter generation unit 204a then stores the quantization parameter of the current block in the quantization parameter storage unit 204d (step Sv_16).

[0514] Next, the inverse quantization processing 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).

[0515] Note that 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.

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

[0517] [Inverse Transform Unit] The inverse transform unit 206 reconstructs the prediction residual by inverse transforming the transform coefficients input from the inverse quantization unit 204 .

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

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

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

[0521] For example, the inverse transform unit 206 determines whether 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).

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

[0523] 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 of 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 this information is decoded by the entropy decoding unit 202 and output to the inverse transform unit 206.

[0524] 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 the second transform type group (step Su_15).

[0525] For example, the inverse orthogonal transform by the inverse transform unit 206 may be performed for each TU according to the flow shown in Figure 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.

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

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

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

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

[0530] 77 is a block diagram showing an example of the 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.

[0531] As shown in FIG. 77 , 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 processing order disclosed in FIG. 77 .

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

[0533] [Prediction Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] Fig. 78 is a flowchart showing an example of processing performed in 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.

[0534] The prediction unit generates a predicted image of the current block (step Sq_1). This predicted image is also referred to as 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.

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

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

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

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

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

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

[0541] The prediction unit may perform prediction processing according to the flow shown in Figures 80A and 80B, for 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.

[0542] [Intra Prediction Unit] 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 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 220.

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

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

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

[0546] The intra prediction unit 216 first determines whether 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 this 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 the multiple intra prediction modes included in the MPM (step Sw_14).

[0547] On the other hand, if the intra prediction unit 216 determines in step Sw_11 that an MPM flag indicating 1 is not present 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 this 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).

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

[0549] [Inter Prediction Unit] 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.

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

[0551] 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 adjacent blocks.

[0552] 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, and then performs motion compensation (prediction) using the derived motion information.

[0553] Furthermore, when the BIO mode is applied, the inter prediction unit 218 derives motion vectors 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 motion vectors for each sub-block based on the motion vectors of multiple adjacent blocks.

[0554] [MV Derivation Flow] FIG. 82 is a flowchart showing an example of MV derivation in the decoding device 200.

[0555] 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, if 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, if 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.

[0556] 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 MVs but also prediction MV selection information, which will be described later. Furthermore, modes that do not decode motion information include FRUC mode. The inter prediction unit 218 selects a mode for deriving MVs of the current block from these multiple modes, and derives the MVs of the current block using the selected mode.

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

[0558] The inter prediction unit 218, for example, determines whether to decode the differential MV. For example, the inter prediction unit 218 may make this determination based on the prediction mode included in the stream or other information included in the stream. Here, when the inter prediction unit 218 determines to decode the differential MV, it may derive the 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.

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

[0560] As described above, MV derivation modes include normal inter, normal merge, FRUC, and affine modes, which will be described later. Among these modes, modes that encode differential MVs include normal inter and affine modes (specifically, affine inter modes). Modes that do not encode differential MVs include FRUC, normal merge, and affine modes (specifically, affine merge modes). The inter prediction unit 218 selects a mode for deriving MVs for the current block from these multiple modes and derives the MVs for the current block using the selected mode.

[0561] [MV derivation > Normal inter mode] For example, if information interpreted from the stream indicates that normal inter mode should 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 that MV.

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

[0563] The inter prediction unit 218 of the decoding device 200 performs motion compensation on each block. To do this, 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). In other words, the inter prediction unit 218 creates a candidate MV list.

[0564] 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 obtained in step Sg_11 as candidate motion vector predictors (also referred to as candidate prediction MVs) according to a predetermined priority order (step Sg_12). Note that the priority order is predetermined for each of the N candidate prediction MVs.

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

[0566] 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 prediction MV (step Sg_14).

[0567] 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. Furthermore, 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.

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

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

[0570] The inter prediction unit 218 first obtains multiple candidate MVs for the current block based on information such as 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.

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

[0572] 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 example, for each block. 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. Furthermore, 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.

[0573] [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 estimation. In this case, the decoding device 200 performs motion estimation without using pixel values ​​of the current block.

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

[0575] First, the inter prediction unit 218 references the motion vectors of each decoded block spatially or temporally adjacent to the current block and generates a list indicating those motion vectors as candidate motion vectors (i.e., a candidate motion vector list, which may be the same as the candidate motion vector list for normal merge mode) (step Si_11). Next, the inter prediction unit 218 selects a best candidate motion vector from among the multiple candidate motion vectors registered in the candidate motion vector list (step Si_12). For example, the inter prediction unit 218 calculates an evaluation value for each candidate motion vector included in the candidate motion vector list and selects one candidate motion vector as the best candidate motion vector based on the evaluation value. The inter prediction unit 218 then derives a motion vector for the current block based on the selected best candidate motion vector (step Si_14). Specifically, for example, the selected best candidate motion vector is directly derived as the motion vector for the current block. Alternatively, for example, the motion vector for the current block may be derived by performing pattern matching in a region surrounding a position in the reference picture corresponding to the selected best candidate motion vector. 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 a 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 a MV with a better evaluation value.

[0576] 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 example, for each block. 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 FRUC mode for that 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 FRUC mode for that picture is completed. Processing may also be performed on a sub-block basis in the same manner as the above-mentioned block basis.

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

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

[0579] In the affine merge mode, the inter predictor 218 first 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.

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

[0581] The inter prediction unit 218 derives the motion vectors v of the control points using the first valid block decoded in the identified affine mode. For example, if a block A is identified and the block A has two control points, as shown in Figure 47B, the inter prediction unit 218 derives the motion vectors v of the upper left and upper right corners of the decoded block including the block A. 3 and v 4 By projecting the current block onto the current block, the motion vector v 0 and the motion vector v of the upper right corner control point 1 Thus, the MV of each control point is derived.

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

[0583] Furthermore, if the stream includes MV selection information as a prediction parameter, the inter prediction unit 218 may use the MV selection information to derive the MVs of each control point of the current block.

[0584] Next, the inter prediction unit 218 performs motion compensation for each of the sub-blocks included in the current block. That is, the inter prediction unit 218 calculates two motion vectors v 0 and v 1 and the above equation (1A), or three motion vectors v 0 , v 1 and v 2and the above-mentioned formula (1B), the motion vectors of the sub-blocks are calculated as affine motion vectors (step Sk_12). Then, the inter prediction unit 218 performs motion compensation on the sub-blocks using the affine motion vectors and the decoded reference pictures (step Sk_13). When the processes of steps Sk_12 and Sk_13 have been performed on all sub-blocks included in the current block, inter prediction using the affine merge mode for the current block is completed. In other words, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0585] In step Sk_11, the candidate MV list may be generated. The candidate MV list may be a list containing 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.

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

[0587] For example, a candidate MV list may be generated that includes candidate MVs in affine merge mode with two control points and candidate MVs in affine merge mode with three control points. Alternatively, a candidate MV list may be generated that includes candidate MVs in affine merge mode with two control points and a candidate MV list that includes candidate MVs in affine merge mode with three control points. Alternatively, a candidate MV list may be generated that includes candidate MVs in either affine merge mode with two control points or affine merge mode with three control points.

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

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

[0590] In the affine inter mode, the inter prediction unit 218 first calculates the predicted MVs (v 0 , v 1 ) or (v 0 , v 1 , v 2 ) is derived (step Sj_11). The control point is, 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.

[0591] The inter prediction unit 218 obtains prediction MV selection information included in the stream as prediction parameters, and derives prediction MVs for each control point of the current block using MVs 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 selects MVs of blocks identified by the prediction MV selection information from among decoded blocks near each control point of the current block shown in Figures 48A or 48B, thereby deriving prediction MVs (v 0 , v 1 ) or (v 0 , v 1 , v 2 ) is derived.

[0592] Next, the inter prediction unit 218 obtains, 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 corresponding differential MV (step Sj_12), thereby deriving the MV of each control point of the current block.

[0593] Next, the inter prediction unit 218 performs motion compensation for each of the sub-blocks included in the current block. That is, the inter prediction unit 218 calculates two motion vectors v 0 and v 1 and the above equation (1A), or three motion vectors v 0 , v 1 and v 2 and the above-mentioned formula (1B), the motion vectors of the sub-blocks are calculated as affine motion vectors (step Sj_13). Then, the inter prediction unit 218 performs motion compensation on the sub-blocks using the affine motion vectors and the decoded reference pictures (step Sj_14). When the processes of steps Sj_13 and Sj_14 have been performed on all sub-blocks included in the current block, inter prediction using the affine merge mode for the current block is completed. In other words, motion compensation is performed on the current block, and a predicted image of the current block is generated.

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

[0595] [MV Derivation>Triangle Mode] For example, if 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.

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

[0597] In the triangle mode, the inter prediction unit 218 first 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.

[0598] Next, the inter prediction unit 218 first obtains multiple candidate MVs for the current block based on information such as 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.

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

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

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

[0602] [Motion Estimation>DMVR] For example, if information interpreted from the stream indicates the application of DMVR, the inter prediction unit 218 performs motion estimation using DMVR.

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

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

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

[0606] First, in Step 1 shown in Fig. 58A , the inter prediction unit 218 calculates the costs at 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.

[0607] In Step 2 shown in Fig. 58A, the inter prediction unit 218 performs a search similar to the processing 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 processing of Step 4. On the other hand, if the cost of the starting point is the smallest, the inter prediction unit 218 performs the processing of Step 3.

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

[0609] In Step 3 shown in Fig. 58A, the inter prediction unit 218 determines a pixel position with decimal precision that minimizes the 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 pixel position with decimal precision 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, with the costs at each of the four search positions as weights. The inter prediction unit 218 then determines the difference between the position indicated by the initial MV and that final search position as a difference vector.

[0610] [Motion Compensation > BIO / OBMC / LIC] For example, if the information interpreted from the stream indicates the application of correction to the predicted image, 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.

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

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

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

[0614] The inter prediction unit 218 derives motion vectors (MVs) of the current block (step Sn_11). Next, the inter prediction unit 218 generates a predicted image using the motion vectors (step Sn_12) and determines whether to perform correction processing (step Sn_13). For example, the inter prediction unit 218 acquires prediction parameters included in the stream and determines whether to perform correction processing based on the prediction parameters. The prediction parameters are, for example, flags indicating whether 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 correction (step Sn_15).

[0615] [Motion Compensation>OBMC] For example, if 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.

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

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

[0618] Next, the inter prediction unit 218 applies (reuses) the motion vector (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.

[0619] Similarly, the inter prediction unit 218 applies (reuses) the motion vector (MV_U) already derived for the decoded upper adjacent block to the current block to obtain a predicted image (Pred_U). The inter prediction unit 218 then 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).

[0620] [Motion Compensation>BIO] For example, if 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.

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

[0622] As shown in FIG. 63 , the inter prediction unit 218 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) that are different from the picture (Cur Pic) that includes 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 the motion vector (MVx0, MVy0) that corresponds to the reference picture Ref0, and the motion vector M1 is the motion vector (MVx1, MVy1) that corresponds to the reference picture Ref1.

[0623] 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 0is an image included in the reference picture Ref0, which is derived for the current block, and is an interpolated image I 1 is an 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. 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.

[0624] The inter prediction unit 218 also 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.

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

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

[0627] Note that the processing flow of the 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.

[0628] [Motion Compensation>LIC] For example, if 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 the LIC.

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

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

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

[0632] 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 the 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 the reference picture specified by the MV. In this correction, luminance or chrominance may be corrected.

[0633] [Prediction 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, intra-prediction unit 216, and inter-prediction unit 218 on the decoding device 200 side may correspond to the configurations, functions, and processing of the prediction control unit 128, intra-prediction unit 124, and inter-prediction unit 126 on the encoding device 100 side.

[0634] [Overall Configuration of In-Loop Filter] The in-loop filter reduces coding noise generated by quantization processing within the coding loop by performing filtering processing on the reconstructed image, and prevents image quality degradation from propagating between frames.

[0635] 97 is a diagram showing an example of the overall configuration of an in-loop filter. In this example, the in-loop filter is composed of three types of filters: a DBF (Deblocking Filter), an SAO (Sample Adaptive Offset), and an ALF (Adaptive Loop Filter).

[0636] DBF performs smoothing processing on block boundaries (vertical and horizontal boundaries) of a reconstructed image, which is an input image of DBF, using pixels near the boundaries.

[0637] SAO corrects the image by classifying the image after DBF application on a pixel-by-pixel basis and adding an offset to each pixel value according to the classification. Note that if DBF is disabled, SAO uses the reconstructed image as the input image for SAO.

[0638] ALF corrects an image after SAO has been applied by adaptively selecting coefficients from multiple filter coefficient sets according to the characteristics (direction, intensity, etc.) of the pixel to be processed and performing filtering.

[0639] Note that one or more filters are selected from DBF, SAO, and ALF, and filtering is performed based on the selected filters. Therefore, the input image of ALF is a reconstructed image or an image to which a filtering process preceding ALF has been applied. For example, when DBF and SAO are disabled, the input image of ALF is a reconstructed image, and when only SAO is disabled, the input image of ALF is an image after DBF has been applied.

[0640] The in-loop filter may be configured by a combination of one or more filters selected from DBF, SAO, ALF, and other filters. Here, the processing performed by the filter corresponds to the processing performed by the circuits of the encoding device 100 and the decoding device 200 using the filter. The terms filter, filtering, filter processing, and filtering processing may be interchangeable.

[0641] Furthermore, an image to which an in-loop filter is applied, i.e., an image to be updated by the in-loop filter, may be referred to as a "reconstructed image before DBF." An image to which an ALF is applied, i.e., an image to be updated by ALF, may be referred to as a "post-DBF / SAO image." DBF or SAO does not necessarily have to be performed. Therefore, the "post-DBF / SAO image" and the "pre-DBF reconstructed image" may be the same.

[0642] Furthermore, in ALF, a prediction residual image may be used. The prediction residual image is an image corresponding to a difference image between an original image and a predicted image, and is an image before reconstruction.

[0643] [ALF Filter Configuration] Fig. 98 is a diagram showing an example of an ALF filter configuration. In this example, the ALF is configured with a plurality of filters.

[0644] Specifically, in this example, the ALF is composed of five types of filters: spatial taps, fixed-filter-output based taps, RecBeforeDB based taps, residual based taps, and extended taps.

[0645] ALF generates an output pixel by adding values ​​after five types of filter processing to an ALF input pixel (a pixel to be processed after DBF / SAO). More specifically, a value is calculated for the ALF input pixel by each of the five types of filter processing. Then, all values ​​calculated for the ALF input pixel by the five types of filter processing are added to the ALF input pixel.

[0646] Note that a plurality of values ​​calculated for a plurality of ALF input pixels in the image after DBF / SAO by each of the five types of filter processing may be arranged in an image form and generated as an output image.

[0647] Five types of filtering are shown in Figures 99 to 103. In Figures 99 to 103, the filter coefficients signaled from encoding device 100 to decoding device 200 are indicated by numbers 0 to 35.

[0648] 99 is a conceptual diagram illustrating spatial tapping. Spatial tapping generates an output image using the result of a product-sum operation, which involves multiplying the difference between an ALF input pixel and its surrounding pixels by a filter coefficient. Here, the surrounding pixels of the ALF input pixel are included in the same image as the image containing the ALF input pixel. The image containing the ALF input pixel and its surrounding pixels is the image after DBF / SAO.

[0649] Fig. 100 is a conceptual diagram illustrating fixed filter output base taps, which generate an output image using the results of a multiply-and-accumulate operation that involves multiplying the difference between the ALF input pixels and the result of fixed filtering on a particular input image by a filter coefficient.

[0650] For example, the fixed filter output base taps are composed of a first filter, a second filter, a third filter, a fourth filter, a fifth filter, and a sixth filter. Each of the first filter, the second filter, and the third filter is a fixed filter. Each of the fourth filter, the fifth filter, and the sixth filter is an adaptive filter. The result of the fixed filter processing is, for example, the result of the first filter, the second filter, and the third filter. The third filter is also called a residual filter.

[0651] Also, for example, a value to be added to the ALF input pixel may be calculated in each of the fourth, fifth, and sixth filters, and the sum of the three values ​​calculated in the fourth, fifth, and sixth filters may be calculated as the value to be added to the ALF input pixel in the fixed filter output base tap.

[0652] 101 is a conceptual diagram showing the RecBeforeDB base tap, which generates an output image using the result of a product-sum operation that includes multiplying the difference between the ALF input pixel and the reconstructed image before DBF by a filter coefficient.

[0653] Fig. 102 is a conceptual diagram showing the residual base tap, which generates an output image using the result of a multiply-and-accumulate operation that involves multiplying the difference between the ALF input pixel and the residual sample by a filter coefficient.

[0654] Fig. 103 is a conceptual diagram showing an extension tap. The extension tap generates an output image using the result of a product-sum operation, which includes multiplying the difference value between the ALF input pixel and the result of Gaussian filter processing using the reconstructed image before DBF by a filter coefficient. Gaussian filter processing is a fixed filter processing.

[0655] [Filter Configuration of Fixed Filter Output Base Tap] Fig. 104 is a conceptual diagram showing the filter configuration of a fixed filter output base tap. In this example, the fixed filter output base tap is configured with a plurality of filters. Specifically, as described above, the fixed filter output base tap is configured with a first filter, a second filter, a third filter, a fourth filter, a fifth filter, and a sixth filter. The first filter, the second filter, and the third filter are shown in Figs. 105 to 107, which will be described later. The fourth filter, the fifth filter, and the sixth filter are shown in Fig. 100, described above.

[0656] In the example shown in Figure 104, the fixed filter processing in the fixed filter output base tap is composed of three types of filters: a first filter, a second filter, and a third filter. All filter coefficients of the fixed filter processing are fixed coefficients that are not signaled. For example, the filter coefficients of the fixed filter processing may be determined in advance by learning using a large number of images so as to obtain optimal processing results. In Figures 105 to 107, the filter coefficients of the fixed filter processing are indicated by numbers 0 to 63.

[0657] In ALF, it is possible to signal filter coefficients via the header, but the coefficients of the fixed filter are determined in advance without signaling and are shared in advance between the encoding device 100 and the decoding device 200.

[0658] However, coefficient information of a fixed filter may be shared in advance between the encoding device 100 and the decoding device 200 using a method other than the method via an encoded bitstream. For example, coefficient information of a fixed filter placed on a server on the Internet may be shared in advance between the encoding device 100 and the decoding device 200 by notification of URL information or the like.

[0659] 105 is a conceptual diagram showing a first filter. The first filter calculates an output pixel value for an ALF input pixel from the sum of a product-sum result obtained by multiplying a difference value between an ALF input pixel and a surrounding pixel by a filter coefficient, and a product-sum result obtained by multiplying a difference value between the ALF input pixel and a reconstructed image before DBF by a filter coefficient. The first filter then generates an output image as the first filter result, which is obtained by arranging multiple output pixel values ​​for multiple ALF input pixels in an image-like manner.

[0660] 106 is a conceptual diagram showing the second filter. The second filter calculates an output pixel value for an ALF input pixel from the sum of a product-sum result obtained by multiplying a difference value between an ALF input pixel and the first filter result by a filter coefficient, and a product-sum result obtained by multiplying a difference value between the ALF input pixel and the reconstructed image before DBF by a filter coefficient. The second filter then generates an output image as the second filter result, which is obtained by arranging multiple output pixel values ​​for multiple ALF input pixels in an image-like manner.

[0661] 107 is a conceptual diagram showing a third filter. The third filter calculates an output pixel value for an ALF input pixel from a product-sum result obtained by multiplying a difference value between an ALF input pixel and a prediction residual image by a filter coefficient. The third filter then generates an output image as a third filter result, which is obtained by arranging multiple output pixel values ​​for multiple ALF input pixels in an image-like manner.

[0662] The first, second and third filter results are used as inputs to adaptive filter processes (fourth, fifth and sixth filters) of the fixed filter output base taps.

[0663] As described above, in the fixed filter output base tap, first, fixed filter processing (first filter, second filter, and third filter) is performed using fixed coefficients. Specifically, the calculation shown in the following equation (3) is performed.

[0664] Output = Σ (Filter coefficient × (current - Input Image)) >> shifts ... (3)

[0665] In equation (3), "current" indicates the ALF input pixel. For the first filter, "InputImage" indicates the image after DBF (after SAO) and the reconstructed image before DBF. For the second filter, "InputImage" indicates the first filter result and the reconstructed image before DBF. For the third filter, "InputImage" indicates the predicted residual image. "Filter coefficient" indicates a fixed coefficient. "shifts" indicates a predetermined value for bit shift operation. "Output" indicates the filter result.

[0666] Next, adaptive filter processing (fourth filter, fifth filter, and sixth filter) is performed using the signaling coefficients. Specifically, the calculation shown in the following equation (4) is performed.

[0667] Output = Σ (Filter coefficient × (current-fixedFilterResults)) >> shifts ... (4)

[0668] In equation (4), "current" indicates the ALF input pixel. For the fourth filter, "fixedFilterResults" indicates the second filter result. For the fifth filter, "fixedFilterResults" indicates the first filter result. For the sixth filter, "fixedFilterResults" indicates the third filter result. "FilterCoefficients" indicates signaling coefficients. "shifts" indicates predetermined values ​​for bit shift operations. "Output" indicates the filter results.

[0669] In addition, in formulas (3) and (4), the bit shift operation based on "shifts" may be omitted. The order of the operations may be reversed. For example, a bit shift operation may be applied to "current" and "fixedFilterResults", respectively, before subtraction.

[0670] Furthermore, in equations (3) and (4), as described above, the ALF input pixel, i.e., the pixel to be processed, is used as "current." However, if the image containing the pixel to be subtracted from "current" is different from the image containing the ALF input pixel, a pixel at the same position as the pixel to be subtracted may be used as "current." In other words, subtraction may be performed on two pixels at the same position in two images.

[0671] Furthermore, equations (3) and (4) are merely examples of filter operations, and other operations may be performed as filter operations.

[0672] [Issues with Fixed Filter Output Base Taps] As described above, the filter coefficients of the fixed filter processing in the fixed filter output base taps are fixed coefficients that are determined in advance, for example, by performing learning using a large number of images so as to obtain optimal processing results. Therefore, for example, if an image having properties different from those of the large number of images used for learning is input, fixed filter processing that is not suitable for the input image may be performed, which may actually degrade the image quality after ALF processing.

[0673] Furthermore, as described above, in the ALF configurations shown in Figures 98 and 104, etc., a large number of filter processes are performed to generate output pixels, which may result in a very large amount of processing.

[0674] Therefore, in one aspect of the present disclosure, a mechanism is introduced that allows fixed filter processing at the fixed filter output base tap to be bypassed depending on, for example, the image to be processed. This makes it possible to perform ALF processing without any adverse effects even on images for which fixed filter processing is not suitable. Furthermore, in another aspect, the filters to be performed are limited so that processes having similar filter effects are not duplicated in ALF. This allows for a significant reduction in the amount of processing.

[0675] In the present disclosure, performing filtering using one or more images may mean applying filtering to one of the one or more images by referring to the one or more images.

[0676] [Example of Encoding Method] Fig. 108 is a flowchart showing an operation for bypassing fixed filter processing at fixed filter output base taps depending on an image to be processed during encoding. For example, the encoding device 100 performs the operation shown in Fig. 108. The loop filter unit 120 of the encoding device 100 may perform the operation, or the processor a1 of the encoding device 100 may perform the operation, or another component or one or more components of the encoding device 100 may perform the operation.

[0677] First, the encoding device 100 analyzes the characteristics of an input image to fixed filter processing and determines whether or not fixed filter processing is appropriate (S101). Fixed filter processing is a filter process that uses fixed coefficients that are not signaled. Specifically, if the characteristics of the input image match certain characteristics, the encoding device 100 may determine that fixed filter processing is appropriate. Here, the certain characteristics may be, for example, characteristics of the image used to determine the fixed filter coefficients.

[0678] Next, the encoding device 100 sets a control flag indicating whether or not fixed filter processing is to be performed, and encodes the control flag value into a bitstream (S102).The encoding device 100 then performs ALF processing, and in the execution of ALF processing, performs or passes fixed filter processing according to the value of the control flag (S103).

[0679] [Example of Decoding Method] Fig. 109 is a flowchart showing an operation for bypassing fixed filter processing at fixed filter output base taps depending on an image to be processed during decoding. For example, the decoding device 200 performs the operation shown in Fig. 109. The loop filter unit 212 of the decoding device 200 may perform the operation, or the processor b1 of the decoding device 200 may perform the operation, or another component or one or more components of the decoding device 200 may perform the operation.

[0680] First, the decoding device 200 decodes the value of a control flag for determining whether or not to perform fixed filter processing from the bitstream (S201). Next, the decoding device 200 performs ALF processing, and in the execution of the ALF processing, performs or passes fixed filter processing according to the value of the control flag (S202).

[0681] [First Example of Filter Configuration] Figures 110, 111, 112, and 113 show filter configurations that allow the fixed filter processing of the first filter, the second filter, and the third filter to be passed at the fixed filter output base tap. When the fixed filter processing of the first filter, the second filter, and the third filter is passed, the first filter result, the second filter result, and the third filter result are not used.

[0682] FIG. 110 is a conceptual diagram showing a filter configuration that can pass the first filter, the second filter, the third filter, the fifth filter, and the sixth filter.

[0683] In the configuration of Fig. 110, when the fixed filter processes of the first, second, and third filters are passed, the fourth filter is executed using the ALF input image (image after DBF / SAO) instead of the second filter result, and the fifth and sixth filters are passed.

[0684] FIG. 111 is a conceptual diagram showing a filter configuration that can pass the first filter, the second filter, the third filter, and the sixth filter.

[0685] In the configuration of Fig. 111, if the fixed filter processes of the first, second, and third filters are passed, the fourth filter is executed using the ALF input image (image after DBF / SAO) instead of the second filter result. The fifth filter is executed using the ALF input image (image after DBF / SAO) instead of the first filter result. The sixth filter is also passed.

[0686] FIG. 112 is a conceptual diagram showing a filter configuration that can pass the first filter, the second filter, the third filter, and the fifth filter.

[0687] In the configuration of Fig. 112, if the fixed filter processes of the first, second, and third filters are passed, the fourth filter is executed using the ALF input image (image after DBF / SAO) instead of the second filter result. The sixth filter is executed using the prediction residual image instead of the third filter result. The fifth filter is also passed.

[0688] FIG. 113 is a conceptual diagram showing a filter configuration that can pass the first filter, the second filter, and the third filter.

[0689] In the configuration of Fig. 113, if the fixed filter processes of the first, second, and third filters are passed, the fourth filter is performed using the ALF input image (image after DBF / SAO) instead of the second filter result, the fifth filter is performed using the ALF input image (image after DBF / SAO) instead of the first filter result, and the sixth filter is performed using the prediction residual image instead of the third filter result.

[0690] [Variations of the First Example of Filter Configuration] Note that, when the first filter is passed, in several examples of the present disclosure, an ALF input image (image after DBF / SAO) is used instead of the first filter result, but a reconstructed image before DBF m...

Claims

1. A decoding device comprising: a circuit; and a memory connected to the circuit, wherein the circuit, in operation, performs ALF (Adaptive Loop Filter) processing using a filtered input image obtained by a decoding process, the ALF processing including one or more fixed filter processes each using predefined fixed filter coefficients, and one or more adaptive filter processes each using filter coefficients described in a bitstream.

2. The decoding device according to claim 1, wherein the circuit further acquires fixed filter control information indicating whether or not to perform a fixed filter process included in the one or more fixed filter processes, and skips the fixed filter process in accordance with the fixed filter control information when performing the ALF process.

3. The decoding device according to claim 2, wherein the fixed filter control information is decoded from a header area in the bitstream.

4. The decoding device according to claim 2 or 3, wherein the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips all of the plurality of fixed filter processes in accordance with the fixed filter control information.

5. The decoding device according to claim 2 or 3, wherein the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips some of the plurality of fixed filter processes in accordance with the fixed filter control information.

6. The decoding device according to claim 2 or 3, wherein the filter-processed input image includes at least one image selected from the group consisting of an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

7. The decoding device according to claim 2 or 3, wherein the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and wherein the circuit, when the fixed filter process is to be performed, performs the fixed filter process using the filter-processed input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, does not perform the fixed filter process, but performs the filter process subsequent to the fixed filter process using the filter-processed input image.

8. The decoding device according to claim 2 or 3, wherein the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and wherein the circuit, when the fixed filter process is performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, also skips the filter process subsequent to the fixed filter process.

9. The decoding device according to any one of claims 1 to 3, wherein the ALF processing includes only the one or more fixed filter processings and the one or more adaptive filter processings, each of the one or more fixed filter processings is performed using the filter processing input image or a result of another fixed filter processing, each of the one or more adaptive filter processings is performed using a result of any one of the one or more fixed filter processings, and the filter processing input image includes at least one image from among an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

10. The decoding device according to any one of claims 1 to 3, wherein the ALF processing includes only the one or more fixed filter processes and the one or more adaptive filter processes, each of the one or more fixed filter processes is performed using the filter processing input image or a result of another fixed filter process, each of the one or more adaptive filter processes is performed using a result of any one of the one or more fixed filter processes, and the filter processing input image includes at least one image from among an image after DBF (Deblocking Filter) processing and an image before DBF processing, and does not include a prediction residual image.

11. The decoding device according to any one of claims 1 to 3, wherein the one or more adaptive filter processes are a plurality of adaptive filter processes, the ALF process includes only the one or more fixed filter processes and the plurality of adaptive filter processes, each of the one or more fixed filter processes is performed using the filter process input image or a result of another fixed filter process, each of the one or more adaptive filter processes excluding one adaptive filter process among the plurality of adaptive filter processes is performed using a result of any one of the one or more fixed filter processes, and the one adaptive filter process is performed using at least one image out of an image after DBF (Deblocking Filter) processing and an image before DBF processing, which are included in the filter process input image.

12. An encoding device comprising: a circuit; and a memory connected to the circuit, wherein the circuit, in operation, performs ALF (Adaptive Loop Filter) processing using a filtered input image obtained by an encoding process, and the ALF processing includes one or more fixed filter processes each using predefined fixed filter coefficients, and one or more adaptive filter processes each using filter coefficients described in a bitstream.

13. The encoding device according to claim 12, wherein the circuit further acquires fixed filter control information indicating whether or not to perform a fixed filter process included in the one or more fixed filter processes, and skips the fixed filter process in accordance with the fixed filter control information when performing the ALF process.

14. The encoding device according to claim 13, wherein the circuit analyzes features of at least one of the image to be encoded and the input image for filter processing, and acquires the fixed filter control information according to the features.

15. The encoding device according to claim 13 or 14, wherein the fixed filter control information is encoded in a header area in the bitstream.

16. The encoding device according to claim 13 or 14, wherein the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips all of the plurality of fixed filter processes in accordance with the fixed filter control information.

17. The encoding device according to claim 13 or 14, wherein the one or more fixed filter processes are a plurality of fixed filter processes, and the circuit skips some of the plurality of fixed filter processes in accordance with the fixed filter control information.

18. The encoding device according to claim 13 or 14, wherein the filter-processed input image includes at least one image selected from the group consisting of an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

19. The encoding device according to claim 13 or 14, wherein the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and wherein the circuit, when the fixed filter process is to be performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, does not perform the fixed filter process, but performs the filter process subsequent to the fixed filter process using the filtered input image.

20. The encoding device according to claim 13 or 14, wherein the ALF processing includes a plurality of filter processes including the one or more fixed filter processes and the one or more adaptive filter processes, and wherein the circuit, when the fixed filter process is performed, performs the fixed filter process using the filtered input image, and performs a filter process subsequent to the fixed filter process among the plurality of filter processes using a result of the fixed filter process, and when the fixed filter process is skipped, also skips the filter process subsequent to the fixed filter process.

21. The encoding device according to any one of claims 12 to 14, wherein the ALF processing includes only the one or more fixed filter processes and the one or more adaptive filter processes, each of the one or more fixed filter processes is performed using the filtered input image or a result of another fixed filter process, each of the one or more adaptive filter processes is performed using a result of any one of the one or more fixed filter processes, and the filtered input image includes at least one image from among an image after DBF (Deblocking Filter) processing, an image before DBF processing, and a prediction residual image.

22. The encoding device according to any one of claims 12 to 14, wherein the ALF processing includes only the one or more fixed filter processes and the one or more adaptive filter processes, each of the one or more fixed filter processes is performed using the filter processing input image or a result of another fixed filter process, each of the one or more adaptive filter processes is performed using a result of any one of the one or more fixed filter processes, and the filter processing input image includes at least one image from among an image after DBF (Deblocking Filter) processing and an image before DBF processing, but does not include a prediction residual image.

23. The encoding device according to any one of claims 12 to 14, wherein the one or more adaptive filter processes are a plurality of adaptive filter processes, the ALF process includes only the one or more fixed filter processes and the plurality of adaptive filter processes, each of the one or more fixed filter processes is performed using the filtered input image or a result of another fixed filter process, each of the one or more adaptive filter processes excluding one adaptive filter process among the plurality of adaptive filter processes is performed using a result of any one of the one or more fixed filter processes, and the one adaptive filter process is performed using at least one image out of an image after DBF (Deblocking Filter) processing and an image before DBF processing, which are included in the filtered input image.

24. A decoding method, comprising: performing ALF (Adaptive Loop Filter) processing using a filtered input image obtained by decoding; the ALF processing including one or more fixed filter processes each using predefined fixed filter coefficients; and one or more adaptive filter processes each using filter coefficients described in the bitstream.

25. An encoding method, comprising: performing ALF (Adaptive Loop Filter) processing using a filtered input image obtained by encoding processing; the ALF processing including one or more fixed filter processes each using predefined fixed filter coefficients; and one or more adaptive filter processes each using filter coefficients described in the bitstream.

26. A bitstream generation method comprising: performing ALF (Adaptive Loop Filter) processing using a filtered input image obtained by encoding processing, the ALF processing including one or more fixed filter processes each using predefined fixed filter coefficients and one or more adaptive filter processes each using filter coefficients described in a bitstream; and generating the bitstream including the filter coefficients of each of the one or more adaptive filter processes.

Citation Information

Patent Citations

  • Signaled adaptive loop filter with multiple classifiers in video coding

    US20230010869A1

  • Methods and devices for adaptive loop filter

    WO2024039803A1