Encoder, decoder, encoding method, decoding method, and invariant means.

VN128451APending Publication Date: 2026-08-17PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202606070
Authority / Receiving Office
VN · VN
Patent Type
Applications
Current Assignee / Owner
Priority Date
2020-03-25
Filing Date
2021-03-23
Publication Date
2026-08-17

AI Technical Summary

Technical Problem

Current video coding technologies face challenges in improving encoding efficiency, image quality, reducing processing amounts, and circuit size, particularly in selecting appropriate elements and operations for efficient video encoding and decoding.

Method used

An encoding device and method that include a circuit and memory, configured to perform a top temporal sublayer, calculate DPB output time by subtracting DPB output delta from DPB output delay, and store offset values in the bitstream to adjust DPB output time, ensuring it is not earlier than CPB removal time, thereby preventing reversal phenomena and reducing code amount.

Benefits of technology

The solution enhances encoding efficiency, image quality, and reduces processing amounts and circuit size by appropriately adjusting DPB output time and offset values, ensuring efficient encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202606070_0
    Figure VN1202606070_0
Patent Text Reader

Abstract

The invention relates to an encoder (100) comprising a circuit and memory coupled to the circuit. If the id indicates a lower time subclass outside the highest time subclass in the time subclasses, the circuit calculates the output [id] DPB time (decoded picture buffer) for the picture in the lower time subclass (S201). In step S201, the encoder circuit (100) subtracts the output [id] DPB blackout given to each time subclass from the output DPB delay shared among the time subclasses, and if maxid indicates the highest time subclass, calculates the output [id] DPB blackout by subtracting the CPB rejection delay and the [id] shift from the CPB rejection delay. The circuit then stores the [id] shift in the bitstream (S202).
Need to check novelty before this filing date? Find Prior Art

Description

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

[0001] The present disclosure relates to video coding, and more particularly to systems, components, and methods for encoding and decoding moving images.

[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, an encoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in operation, when id indicates a lower temporal sublayer other than a highest temporal sublayer included in a plurality of temporal sublayers, the circuit subtracts a DPB output delta [id] provided for each temporal sublayer from a DPB output delay common to the plurality of temporal sublayers in order to calculate a DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer, and when maxid indicates the highest temporal sublayer, calculates the DPB output delta [id] by subtracting a CPB (Coded Picture Buffer) removal delay [max id] and an offset [id] from a CPB removal delay [id], and stores the offset [id] 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 functional 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 an overall encoding process by an encoding device. FIG. 10 is a diagram showing an example of block division. FIG. 11 is a diagram showing an example of the functional 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 a transform unit. FIG. 17 is a flowchart showing another example of processing by a transform unit. FIG. 18 is a block diagram showing an example of the functional 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 functional 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 functional 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 showing an example of a deblocking filter having filter characteristics symmetrical with respect to block boundaries. FIG. 26 is a diagram for explaining an example of block boundaries on which deblocking filter processing is performed. FIG. 27 is a diagram showing an example of a Bs value. FIG. 28 is a flowchart showing an example of processing performed by a prediction unit of an encoding device. FIG. 29 is a flowchart showing another example of processing performed by a prediction unit of an encoding device. FIG. 30 is a flowchart showing another example of processing performed by a prediction unit of an encoding device. FIG. 31 is a diagram showing an example of 67 intra prediction modes in intra prediction. FIG. 32 is a flowchart showing an example of processing by an intra prediction unit. FIG. 33 is a diagram showing an example of reference pictures. FIG. 34 is a conceptual diagram showing an example of a reference picture list. FIG. 35 is a flowchart showing the basic processing flow of inter prediction. FIG. 36 is a flowchart showing an example of MV derivation. FIG. 37 is a flowchart showing another example of MV derivation. FIG. 38A is a diagram showing an example of classification of MV derivation modes. FIG. 38B is a diagram showing an example of classification of MV derivation modes. FIG. 39 is a flowchart showing 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 illustrating an example of MV derivation processing in normal merge mode. FIG. 42 is a diagram illustrating an example of MV derivation processing in HMVP mode (History-based Motion Vector Prediction / Predictor). FIG. 43 is a flowchart illustrating an example of FRUC (frame rate up conversion). FIG. 44 is a diagram illustrating an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. 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. FIG. 46A is a diagram illustrating 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 the 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 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 a DMVR. FIG. 57 is a conceptual diagram illustrating another example of a 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 illustrating an example of generation of a predicted image. FIG. 60 is a flowchart illustrating another example of generation of a predicted image.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 functional 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 functional 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 functional 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 functional 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 functional 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 diagram for explaining an example of the internal configuration of an HRD in a conventional decoding device. FIG. 98 is a diagram illustrating information encoded in a buffering period SEI message. FIG. 99 is a diagram illustrating an example of the internal configuration of an HRD in a decoding device of the present disclosure. FIG. 100 is a flowchart illustrating an example of a process for adjusting a DPB output time of each picture in a decoding device. FIG. 101 is a flowchart illustrating operations performed by an encoding device. FIG. 102 is a flowchart illustrating operations performed by a decoding device. FIG. 103 is a diagram illustrating the overall configuration of a content supply system that realizes a content distribution service. FIG. 104 is a diagram illustrating an example of a display screen of a web page. FIG. 105 is a diagram illustrating an example of a display screen of a web page. FIG. 106 is a diagram illustrating an example of a smartphone. FIG. 107 is a block diagram illustrating an example of the configuration of a smartphone.

[0013] [Introduction] An encoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit, wherein, in operation, when id indicates a lower temporal sublayer other than a highest temporal sublayer included in a plurality of temporal sublayers, the circuit subtracts a DPB output delta[id] provided for each temporal sublayer from a DPB output delay common to the plurality of temporal sublayers to calculate a DPB (Decoded Picture Buffer) output time[id] of a picture in the lower temporal sublayer; when maxid indicates the highest temporal sublayer, the circuit subtracts a CPB (Coded Picture Buffer) removal delay[maxid] and an offset[id] from a CPB removal delay[id] to calculate the DPB output delta[id], and stores the offset[id] in a bitstream.

[0014] This may enable the encoding device to adjust, by the offset value for each temporal sublayer, the DPB output delta value used to calculate the time to be added to the CPB removal time when calculating the DPB output time. The encoding device may then be able to adjust the DPB output time according to the DPB output delta value adjusted by the offset value for each temporal sublayer. Thus, the encoding device may be able to adjust the DPB output time for each temporal sublayer. As a result, the encoding device can adjust the DPB output time so that it does not occur before the CPB removal time (i.e., so that it does not occur before the CPB removal time), thereby eliminating the reversal phenomenon in which a picture must be output before it is decoded.

[0015] For example, in an encoding device according to one aspect of the present disclosure, the CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream.

[0016] This allows the encoding device to adjust the DPB output delta value with an offset value for each temporal sublayer, eliminating the need to store these CPB removal delays in the bitstream for adjusting the DPB output delta value, thereby reducing the amount of code.

[0017] For example, in an encoding device according to one aspect of the present disclosure, the circuit calculates, as the DPB output delta [id], a value that is equal to or less than the DPB output delay [maxid] by subtracting the offset [id].

[0018] This may enable the encoding device to prevent the time calculated by subtracting the DPB output delta value from the DPB output delay from becoming negative, and therefore may enable the encoding device to prevent the DPB output time from being calculated as a time that is earlier than the CPB removal time.

[0019] For example, in an encoding device according to one aspect of the present disclosure, each of the plurality of temporal sublayers is a temporal sublayer that can be selected by a decoding device.

[0020] This may enable the encoding device to write offset values ​​into the bitstream for the temporal sublayers selectable by the decoding device, and may also enable the encoding device to adjust the DPB output times for the lower temporal sublayers that are lower than the temporal sublayers selectable by the decoding device.

[0021] For example, in an encoding device according to one aspect of the present disclosure, the circuit writes the offset [id] to a buffering period SEI message in the bitstream.

[0022] This may allow the encoding device to write the offset value together with other parameters related to the buffering period. Also, the buffering period SEI message may define common parameters for multiple pictures. Therefore, the encoding device may be able to write the offset value as a common parameter for multiple pictures.

[0023] For example, in an encoding device according to one aspect of the present disclosure, the circuit estimates the offset [maxid] to be zero for the topmost temporal sublayer without writing the offset [maxid] to the bitstream.

[0024] This may allow the encoding device to omit writing an offset value for the highest temporal sub-layer. Therefore, the encoding device may be able to contribute to reducing the amount of code. Furthermore, the DPB output time for the highest temporal sub-layer may not need to be adjusted. Therefore, by estimating the offset value for the highest temporal sub-layer to be zero, the encoding device may be able to calculate the DPB output time for the highest temporal sub-layer according to the same process as for the lower temporal sub-layer.

[0025] For example, in an encoding device according to one aspect of the present disclosure, the circuit calculates the DPB output time [maxid] for the top temporal sublayer by adding the time calculated from the DPB output delay [maxid] to the CPB removal time [maxid] without using the DPB output delta [id].

[0026] This may enable the encoding device to easily calculate the DPB output time for the highest temporal sub-layer, thereby potentially reducing the amount of processing required by the encoding device.

[0027] For example, in an encoding device according to one aspect of the present disclosure, the circuit writes the offset [id] into the bitstream to calculate the DPB output time [id] for the lower temporal sublayer that satisfies the condition that the DPB output time [id] for all pictures in the temporal sublayer is after the CPB removal time [id].

[0028] This may enable the encoding device to calculate a time after the CPB removal time as the DPB output time, and may also prevent the encoding device from calculating a time before the CPB removal time as the DPB output time.

[0029] For example, in an encoding device according to one aspect of the present disclosure, the circuit writes a flag to the bitstream indicating whether the offset [id] exists or not, and if the flag indicates that the offset [id] exists, writes the offset [id] to the bitstream for the lower temporal sublayer.

[0030] This may enable the encoding device to control whether or not to write the offset value into the bitstream, which may contribute to reducing the amount of code.

[0031] For example, an encoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit, and the circuit, in operation, calculates an offset [id] for calculating a Decoded Picture Buffer (CPB) output time [id] of a picture in a lower temporal sublayer other than a top temporal sublayer included in a plurality of temporal sublayers when maxid indicates the top temporal sublayer, and stores the offset [id] in a bitstream; and calculates the DPB output time [id] by using a Coded Picture Buffer (CPB) output time [id] of a picture in the lower temporal sublayer when maxid indicates the top temporal sublayer. a value for calculating the DPB output delta [id] by subtracting the CPB removal delay [max id] and the offset [id] from the CPB removal delay [id], and the DPB output delta [id] is a value for calculating the DPB output time [id] by subtracting the DPB output delta [id] from a DPB output delay common to the multiple temporal sublayers.

[0032] As a result, the encoding device calculates the offset [id] and writes the calculated offset [id] into the bitstream, thereby reducing the amount of code.

[0033] For example, in an encoding device according to one aspect of the present disclosure, the CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream.

[0034] This allows the encoding device to adjust the DPB output delta value with an offset value for each temporal sublayer, eliminating the need to store these CPB removal delays in the bitstream for adjusting the DPB output delta value, thereby reducing the amount of code.

[0035] For example, in an encoding device according to one aspect of the present disclosure, the offset [id] is the difference between the DPB output time [maxid] assigned to the first picture when the first picture is extracted from a plurality of pictures as the top temporal sublayer, and the DPB output time [id] assigned to the first picture when the first picture is extracted from the plurality of pictures to be encoded as the lower temporal sublayer.

[0036] This allows the encoding device to use the minimum necessary offset value for each temporal sublayer to eliminate the above-mentioned inversion phenomenon, thereby allowing the appropriate DPB output time to be calculated for each temporal sublayer.

[0037] Moreover, a decoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit, wherein, in operation, when id indicates a lower temporal sublayer other than a highest temporal sublayer included in a plurality of temporal sublayers, the circuit reads, from a bitstream, an offset [id] for calculating a DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer, and subtracts a DPB output delta [id] provided for each temporal sublayer from a DPB output delay common to the plurality of temporal sublayers to calculate the DPB output time [id]; and when maxid indicates the highest temporal sublayer, the circuit calculates the DPB output delta [id] by subtracting a CPB (Coded Picture Buffer) removal delay [max id] and the offset [id] from a CPB removal delay [id].

[0038] This may enable the decoding device to adjust the DPB output delta value, which is used to calculate the time to be added to the CPB removal time when calculating the DPB output time, by using the offset value for each temporal sublayer. The decoding device may then be able to adjust the DPB output time according to the DPB output delta value adjusted by the offset value for each temporal sublayer. Therefore, the decoding device may be able to adjust the DPB output time for each temporal sublayer. As a result, the decoding device can adjust the DPB output time so that it does not occur before the CPB removal time (i.e., so that it does not occur before the CPB removal time), thereby eliminating the reversal phenomenon in which a picture must be output before it is decoded.

[0039] For example, in a decoding device according to one aspect of the present disclosure, the CPB removal delay [id] and the CPB removal delay [maxid] are not read from the bitstream.

[0040] This allows the decoding device to adjust the DPB output delta value with an offset value for each temporal sublayer, eliminating the need to read these CPB removal delays from the bitstream to adjust the DPB output delta value, thereby reducing the amount of processing required.

[0041] For example, in a decoding device according to one aspect of the present disclosure, the circuit calculates, as the DPB output delta [id], a value that is equal to or less than the DPB output delay [maxid] by subtracting the offset [id].

[0042] This may enable the decoding device to prevent the time calculated by subtracting the DPB output delta value from the DPB output delay from becoming negative, and therefore may enable the decoding device to prevent the DPB output time from being calculated as a time that is earlier than the CPB removal time.

[0043] For example, in a decoding device according to one aspect of the present disclosure, each of the plurality of temporal sublayers is a temporal sublayer that can be selected by the decoding device.

[0044] This may enable the decoder to read offset values ​​from the bitstream for the temporal sublayers selectable by the decoder, and may enable the decoder to adjust the DPB output times for the lower temporal sublayers that are lower than the temporal sublayers selectable by the decoder.

[0045] For example, in a decoding device according to one aspect of the present disclosure, the circuit reads the offset [id] from within a buffering period SEI message in the bitstream.

[0046] This may allow a decoding device to read the offset value together with other parameters related to the buffering period. Furthermore, a buffering period SEI message may define common parameters for multiple pictures. Therefore, a decoding device may be able to read the offset value as a common parameter for multiple pictures.

[0047] For example, in a decoding device according to one aspect of the present disclosure, the circuit estimates the offset [maxid] to be zero for the topmost temporal sublayer without reading the offset [maxid] from the bitstream.

[0048] This may allow the decoding device to omit reading the offset value for the highest temporal sub-layer. Therefore, the decoding device may be able to contribute to reducing the amount of code. Furthermore, the DPB output time for the highest temporal sub-layer may not need to be adjusted. Therefore, by estimating the offset value for the highest temporal sub-layer to be zero, the decoding device may be able to calculate the DPB output time for the highest temporal sub-layer according to the same process as for the lower temporal sub-layer.

[0049] For example, in a decoding device according to one aspect of the present disclosure, the circuit calculates the DPB output time [maxid] for the top temporal sublayer by adding the time calculated from the DPB output delay [maxid] to the CPB removal time [maxid] without using the DPB output delta [id].

[0050] This may enable the decoding device to easily calculate the DPB output time for the highest temporal sub-layer, thereby potentially reducing the amount of processing required by the decoding device.

[0051] For example, the circuit reads the offset [id] from the bitstream to calculate the DPB output time [id] for the lower temporal sublayer that satisfies the condition that the DPB output time [id] for all pictures in the temporal sublayer is after the CPB removal time [id].

[0052] This may enable the decoding device to calculate the time after the CPB removal time as the DPB output time, and may also prevent the decoding device from calculating the time before the CPB removal time as the DPB output time.

[0053] For example, in a decoding device according to one aspect of the present disclosure, the circuit reads a flag from the bitstream indicating whether the offset [id] exists or not, and if the flag indicates that the offset [id] exists, reads the offset [id] from the bitstream for the lower temporal sublayer.

[0054] This may enable the decoding device to control whether or not to read the offset value from the bitstream, which may contribute to reducing the amount of coding.

[0055] Furthermore, in an encoding method according to one aspect of the present disclosure, when id indicates a lower temporal sub-layer other than a highest temporal sub-layer included in a plurality of temporal sub-layers, a DPB output delta [id] provided for each temporal sub-layer is subtracted from a DPB output delay common to the plurality of temporal sub-layers to calculate a DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sub-layer; when maxid indicates the highest temporal sub-layer, a CPB (Coded Picture Buffer) removal delay [maxid] and an offset [id] are subtracted from the CPB removal delay [id] to calculate the DPB output delta [id], and the offset [id] is stored in a bitstream.

[0056] This may enable a device that performs the encoding method to adjust, by an offset value for each temporal sublayer, a DPB output delta value that is used to calculate the time to be added to the CPB removal time when calculating the DPB output time. The device that performs the encoding method may then adjust the DPB output time according to the DPB output delta value adjusted by the offset value for each temporal sublayer. Therefore, the device that performs the encoding method may be able to adjust the DPB output time for each temporal sublayer.

[0057] Furthermore, a decoding method according to one aspect of the present disclosure, when id indicates a lower temporal sub-layer other than a highest temporal sub-layer included in a plurality of temporal sub-layers, reads from a bitstream an offset [id] used to calculate a DPB (Decoded Picture Buffer) output time of a picture in the lower temporal sub-layer, and subtracts a DPB output delta [id] provided for each temporal sub-layer from a DPB output delay common to the plurality of temporal sub-layers to calculate the DPB output time [id]; when maxid indicates the highest temporal sub-layer, calculates a DPB output delta [id] by subtracting a CPB (Coded Picture Buffer) removal delay [maxid] and the offset [id] from a CPB removal delay [id].

[0058] This may enable a device that executes the decoding method to adjust, by an offset value for each temporal sublayer, a DPB output delta value that is used to calculate the time to be added to the CPB removal time when calculating the DPB output time. The device that executes the decoding method may then adjust the DPB output time according to the DPB output delta value adjusted by the offset value for each temporal sublayer. Therefore, the device that executes the decoding method may be able to adjust the DPB output time for each temporal sublayer.

[0059] Furthermore, a non-transitory storage medium according to an aspect of the present disclosure is a non-transitory storage medium for storing a bitstream, the bitstream including a syntax for causing a decoding device receiving the bitstream to perform a decoding process, the syntax including, when id indicates a lower temporal sublayer other than a highest temporal sublayer included in a plurality of temporal sublayers, an offset [id] for calculating a Decoded Picture Buffer (CPB) output time [id] of a picture in the lower temporal sublayer, and when maxid indicates the highest temporal sublayer, the offset [id] is a CPB (Coded Picture Buffer) output time. a value for calculating a DPB output delta [id] by subtracting a CPB removal delay [max id] and an offset [id] from a CPB removal delay [id] common to the plurality of temporal sublayers, and the DPB output delta [id] is a value for calculating a DPB removal delay [id] by subtracting the DPB output delta [id] from a DPB output delay common to the plurality of temporal sublayers.

[0060] This makes it possible to adjust the DPB output delta value, which is used to calculate the time to be added to the CPB removal time when calculating the DPB output time, using the offset value for each temporal sublayer. Then, it becomes possible to adjust the DPB output time according to the DPB output delta value adjusted using the offset value for each temporal sublayer. Therefore, it becomes possible to adjust the DPB output time for each temporal sublayer. As a result, it becomes possible to adjust the DPB output time so that it does not occur before the CPB removal time, thereby eliminating the reversal phenomenon in which a picture must be output before it is decoded.

[0061] For example, in a non-transitory storage medium according to one aspect of the present disclosure, the CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream.

[0062] This makes it possible to adjust the DPB output delta value using an offset value for each temporal sublayer, so there is no need to store these CPB removal delays in the bitstream for adjusting the DPB output delta value, thereby reducing the amount of code.

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

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

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

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

[0067] (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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0122] [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 functional configuration of the encoding device 100 according to an embodiment. The encoding device 100 encodes an image in units of blocks.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0188] 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) also increases.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0333] 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 motion vectors 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.

[0334]

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

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

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

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

[0339]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0364] Alternatively, when block A is identified and block A has three control points, as shown in FIG. 47C , the inter prediction unit 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0436]

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

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

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

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

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

[0442] 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 from the motion vector (M0, M1) and the reference picture (L0, L1) and by applying a motion compensation filter.

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

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

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

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

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

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

[0449] First, the inter prediction unit 126 derives motion vectors (MVs) from coded reference pictures to obtain reference images corresponding to the current block (step Sz_1).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0466] [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 functional configuration of the decoding device 200 according to an embodiment. The decoding device 200 is a device that decodes a stream, which is an encoded image, in units of blocks.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0607] 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 from the motion vector (M0, M1) and the reference picture (L0, L1) and by applying a motion compensation filter.

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

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

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

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

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

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

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

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

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

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

[0618] [First Aspect] Next, the encoding device 100 and the decoding device 200 according to the first aspect will be described.

[0619] When id indicates a lower temporal sub-layer other than the highest temporal sub-layer included in the plurality of temporal sub-layers, the encoding device 100 subtracts a DPB output delta [id] provided for each temporal sub-layer from a DPB output delay common to the plurality of temporal sub-layers to calculate a DPB (Decoded Picture Buffer) output time [id] of the picture in the lower temporal sub-layer; when maxid indicates the highest temporal sub-layer, the encoding device 100 subtracts a CPB (Coded Picture Buffer) removal delay [maxid] and an offset [id] from the CPB removal delay [id] to calculate a DPB output delta [id] and stores the offset [id] in the bitstream.

[0620] In addition, when id indicates a lower temporal sublayer other than the top temporal sublayer included in the multiple temporal sublayers, the decoding device 200 reads from the bitstream an offset [id] for calculating the DPB output time [id] of the picture in the lower temporal sublayer, and subtracts the DPB output delta [id] provided for each temporal sublayer from the DPB output delay common to the multiple temporal sublayers to calculate the DPB output time [id], and when maxid indicates the top temporal sublayer, calculates the DPB output delta [id] by subtracting the CPB removal delay [maxid] and the offset [id] from the CPB removal delay [id].

[0621] The decoding device 200 will be described below in comparison with a conventional example.

[0622] [Internal Structure of HRD in Conventional Decoding Device] When a hypothetical reference decoder (HRD) is used in video coding, the CPB removal time of each picture can be calculated. This corresponds to the time when the picture is removed from the CPB and decoded. In some systems, this time may correspond to what is called a decoding time stamp (DTS). The HRD can also be used to calculate the DPB output time of each picture. This usually corresponds to the time when the picture to be displayed is output from the decoding device. In some systems, this time may correspond to what is called a presentation time stamp (PTS).

[0623] Video coding bitstreams can use temporal scalability, whereby pictures with higher temporal identifiers (hereinafter also referred to as temporal IDs) can be discarded from the bitstream without affecting the decoding of pictures with lower temporal IDs. This temporal scalability may be used in applications that use frame rate scalability. For example, by discarding every other frame (so-called frame pictures or pictures) from a 100 fr / s (frames per second) bitstream, the 100 fr / s bitstream also contains a version of the bitstream that has only a 50 fr / s bitrate. Because the discarded frames are not necessary for decoding the remaining frames, a decoding device can successfully decode the 50 fr / s version of the bitstream. However, discarding pictures in this manner causes the CPB removal time for each individual picture to change depending on the version of the bitstream being decoded (i.e., the 100 fr / s version or the 50 fr / s version).

[0624] Here, temporal sub-layers will be specifically described with reference to the hierarchical structure of temporal scalability shown in Fig. 5. In the case of a version in which pictures are decoded every other frame as described above, for example, temporal layer 0 and temporal layer 1 shown in Fig. 5 need to be decoded. Thus, a set of multiple temporal layers required for decoding is called a temporal sub-layer. Furthermore, Htid, which is an identifier of a temporal sub-layer, corresponds to the highest temporal ID of the multiple temporal layers required for decoding.

[0625] To enable signaling of different CPB removal times for different versions of a bitstream, the HRD described in the current Versatile Video Coding (VVC) draft specification signals the CPB removal value of each temporal sub-layer present in the bitstream. Therefore, the calculated CPB removal time varies depending on the version of the bitstream being decoded. Typically, the CPB removal time of an individual picture, "CpbRemovalTime," may be calculated for picture "n" and decoded temporal sub-layer "Htid" as follows:

[0626] CpbRemovalTime[n][Htid]=CpbRemovalTime[firstPicInCurrBuffPeriod][Htid]+ClockTick*CpbRemovalDelayVal[n][Htid] ...Formula (3)

[0627] Here, picture "n" refers to the picture with picture index n, which is the nth picture.

[0628] CpbRemovalDelayVal in the above equation (3) is calculated based on syntax elements coded in the picture timing SEI message for each picture "n" and each decoded temporal sub-layer "Htid", and ClockTick in the above equation (3) is calculated based on syntax elements read from the SPS (Sequence Parameter Set) or VPS (Video Parameter Set) (e.g., for a 100 fr / s bitstream, ClockTick is equal to 0.01).

[0629] However, only one sequence of DPB output times is calculated for all versions of the bitstream. This is understood because there is no reason to change the timing of displaying the remaining pictures after removing some pictures from the decoded bitstream. The interval between the DPB output times of pictures and the output order of pictures are actually independent of the decoded temporal sub-layer (the so-called decoded temporal sub-layer). However, because the DPB output time of a picture is calculated based on the corresponding CPB removal time for that picture (which may be different for each decoded temporal sub-layer), a delta needs to be added to the formula as follows:

[0630] DpbOutputTime[n][Htid]=CpbRemovalTime[n][Htid]+ClockTick×(picDpbOutputDelay[n]-picDpbOutputDelta[n][Htid]) ...Formula (4)

[0631] The picDpbOutputDelay in the above formula (4) is coded in the picture timing SEI message for each picture. However, the picDpbOutputDelay is coded only once for all decoded temporal sub-layers. In other words, the picDpbOutputDelay is provided in common for multiple temporal sub-layers.

[0632] Furthermore, picpbOutputDelta in the above equation (4) is calculated as follows based on the information coded in the picture timing SEI message:

[0633] picDpbOutputDelta[n][Htid]=CpbRemovalDelayVal[n][Htid]-CpbRemovalDelayVal[n][MaxTid]...Formula (5)

[0634] In the above formula (5), MaxTid is the maximum value of the temporal IDs present in the bitstream. In other words, MaxTid is the temporal ID of the highest temporal sublayer among the multiple temporal sublayers present in the bitstream, and can also be interpreted as the maximum Htid. Therefore, MaxTid corresponds to the entire set of multiple temporal sublayers in the bitstream.

[0635] [Issues with the Internal Structure of the HRD in Conventional Decoding Devices] Unfortunately, the conventional formula for calculating the DpbOutputtime of a picture includes subtraction. This means that there is no guarantee that DpbOutputTime[n][Hid] will always be greater than or equal to CpbRemovalTime[n][Htid]. Figure 97 is a diagram illustrating an example of the internal structure of the HRD in a conventional decoding device. Regarding picture types, "I" represents an I picture, "P" represents a P picture, "b" represents a B picture in the highest temporal sub-layer, and "B" represents a B picture in another temporal sub-layer. In Figure 97, picture "n" means the nth picture in the output order.

[0636] Indeed, in the example of Figure 97, there are cases where DpbOutputTime[n][Htid] is smaller than CpbRemovalTime[n][Htid], which means that in this case, a reverse phenomenon occurs in which a picture must be output before it is decoded.

[0637] For example, as shown in Figure 97, the DPB output time of the third picture in the bitstream (i.e., temporal ID = 3), whose output order (n) is 2 and whose decoded temporal sub-layer (Htid) is 3, is calculated as follows: First, using the above formula (5), the DPB output delta value is calculated as follows from n = 2, Htid = 3, and MaxTid = 4.

[0638] picDpbOutputDelta[2][3]=CpbRemovalDelayVal[2][3]-CpbRemovalDelayVal[2][4]=8-4=4...Formula (5A)

[0639] 97, for convenience, 0 is used for the initial CPB removal delay (InitialCpbRemovalTime), and CpbRemovalTime[FirstPicInCurrBufferPeriod][Htid] in the above equation (3) becomes 0. Therefore, in the example of FIG. 97, the above equation (3) is expressed as the following equation (3A).

[0640] CpbRemovalTime[n][Htid]=ClockTick*CpbRemovalDelayVal[n][Htid] ...Formula (3A)

[0641] In this case, the above formula (4) is expressed as the following formula (4A) based on the above formula (3A).

[0642] DpbOutputTime[n][Htid]=ClockTick×(CpbRemovalDelayVal[n][Htid]+picDpbOutputDelay[n]-picDpbOutputDelta[n][Htid]) ...Formula (4A)

[0643] Therefore, the DPB output time of a picture whose output order (n) is 2 and whose decoded temporal sub-layer (Htid) is 3 is calculated as follows based on the above formula (4A):

[0644] DpbOutputTime[2][3]=ClockTick×(CpbRemovalDelayVal[2][3]+picDpbOutputDelay[2]-picDpbOutputDelta[2][3])

[0645] As shown in Figure 97, CpbRemovalDelayVal[2][3] = 8, and picDpbOutputDelay[2] = 2. Furthermore, from the above equation (5A), picDpbOutputDelta[2][3] = 4. Therefore, the DPB output time of the desired picture is as follows:

[0646] DpbOutputTime[2][3]=ClockTick×(8+2-4)=ClockTick×6

[0647] In this way, in the example of FIG. 97, an inverse phenomenon occurs in which DpbOutputTime[2][3] is smaller than CpbRemovalTime[2][3].

[0648] Therefore, in the present disclosure, in a picture in which such an inversion phenomenon occurs, the DPB output time is set so that the DPB output time is equal to or greater than the CPB removal time.

[0649] [Internal Structure of HRD in Decoding Device According to the Present Disclosure] As described above, in the past, the DPB output delta [id] was not stored in the bitstream, and the DPB output delta [id] was calculated using the calculated CPB removal delay [id] and CPB removal delay [maxid]. However, when decoding pictures of some temporal sublayers, the DPB output time sometimes preceded the CPB delay time (so-called CPB removal time). Even if the DPB output delta [id] was adjusted to resolve this inversion, the DPB output delay was common to the multiple temporal sublayers, making it impossible to adjust it for each temporal sublayer. Furthermore, setting a large value for the DPB output delay common to multiple temporal sublayers resulted in problems such as video delay and the need for a large buffer. Therefore, an offset [id] was provided for each temporal sublayer to make the DPB output time adjustable.

[0650] This disclosure relates to the introduction of an offset for each decoded temporal sub-layer. This DPB output time offset shifts the sequence of DPB output times calculated for decoding all temporal sub-layers present in the bitstream, so that for all pictures and decoded temporal sub-layers, the DPB output time is never shorter than the CPB removal time. For a picture "n" and a decoded temporal sub-layer temporal ID "Htid", equation (4') for calculating the DPB output time of a picture is modified as follows:

[0651] DpbOutputTime[n][Htid]=CpbRemovalTime[n][Htid]+ClockTick×(picDpbOutputDelay[n]-picDpbOutputDelta[n][Htid]) ...Formula (4')

[0652] The picDpbOutputDelay in the above equation (4') is coded in the picture timing SEI message for each picture. Also, the picDpbOutputDelta in the above equation (4') is calculated as follows based on the information coded in the picture timing SEI message and the buffering period SEI message:

[0653] picDpbOutputDelta[n][Htid]=CpbRemovalDelayVal[n][Htid]-CpbRemovalDelayVal[n][MaxTid]-dpb_output_tid_offset[Htid] ...Formula (5')

[0654] MaxTid in the above equation (5') is the maximum value of the temporal ID present in the bitstream, similar to the above equation (5).

[0655] Hereinafter, the difference between the internal configuration of the HRD in a conventional decoding device and the internal configuration of the HRD in the decoding device of the present disclosure will be described with reference to the above formula (5) and formula (5').

[0656] In conventional decoding devices, the CPB output delta value "picDpbOutputDelta" of a picture is calculated based on information coded in a picture timing SEI message (see equation (5)). However, in the decoding device according to the present disclosure, the DPB output delta value of a picture is calculated based on information coded in a picture timing SEI message and a buffering period SEI message (see equation (5')). Furthermore, in the present disclosure, the DPB output delta value of a picture is adjusted using an offset value. Figure 98 is a diagram for explaining information coded in a buffering period SEI message.

[0657] As shown in Figure 98, a new syntax element dpb_output_tid_offset[Htid] is coded in the buffering period SEI message for each decoded temporal sublayer except for the highest temporal sublayer in the bitstream, MaxTid, which is assumed to be equal to zero. For example, as shown in Figure 98, the syntax element sublayer_dpb_output_offsets_present_flag indicates the presence of a sequence containing a value for dpb_output_tid_offset. If sublayer_dpb_output_offsets_present_flag is equal to 1, a value of dpb_output_tid_offset[i] is coded for each decoded temporal sublayer "i" with a temporal ID between 0 and bp_max_sublayers_minus1-1. The offset of the highest temporal sublayer present in the bitstream (i.e., the temporal sublayer with a temporal ID equal to bp_max_sublayers_minus1) is always zero, so there is no need to signal dpb_output_tid_offset.

[0658] [Offsets Introduced in the Present Disclosure] Next, the offsets introduced in the present disclosure will be described in more detail. Figure 99 is a diagram for explaining an example of the internal structure of the HRD in the decoding device of the present disclosure. Note that in Figure 99 as well, as in Figure 97, picture "n" means the nth picture in the output order.

[0659] In the present disclosure, the above offset is introduced to resolve the reversal phenomenon of the DPB output time of pictures described in the example of Fig. 97. For example, in the present disclosure, in adjusting the DPB output time of the third picture in the bitstream (i.e., temporal ID = 3), the output order (n) is 2, and the decoded temporal sublayer (Htid) is 3, the syntax values ​​may be set as follows:

[0660] Specifically, dpb_output_tid_offset[3] is set equal to 2, dpb_output_tid_offset[2] is set equal to 4, and dpb_output_tid_offset[1] is set equal to 4. This eliminates the inversion phenomenon described in the example of Figure 97, as shown in Figure 99. The DPB output time is shifted by dpb_output_tid_offset for each decoded temporal sub-layer whose temporal ID is lower than bp_max_sublayers_minus1. Therefore, in the present disclosure, there is no picture whose DPB output time is shorter than the CPB removal time, that is, the above-mentioned inversion phenomenon does not occur.

[0661] In the present disclosure, for example, as shown in Figure 99, the DPB output time of the third picture in the bitstream (i.e., temporal ID = 3), the picture whose output order (n) is 2, and the decoded temporal sub-layer (Htid) is 3 is calculated as follows: First, using the above formula (5'), the DPB output delta value is calculated as follows from n = 2, Htid = 3, and MaxTid = 4.

[0662] picDpbOutputDelta[2][3]=CpbRemovalDelayVal[2][3]-CpbRemovalDelayVal[2][4]-dpb_output_tid_offset[3]=8-4-2=2...(5A')

[0663] In addition, in Figure 99, for convenience, 0 is used for the initial CPB removal delay (InitialCpbRemovalTime), and CpbRemovalTime[FirstPicInCurrBufferPeriod][Htid] = 0 in the above equation (3). Therefore, in the example of Figure 99, the above equation (3) is expressed by the above equation (3A). In this case, the above equation (4) is expressed by the above equation (4A) based on the above equation (3A).

[0664] Therefore, the DPB output time of a picture whose output order (n) is 2 and whose decoded temporal sub-layer (Htid) is 3 is calculated as follows based on the above formula (4A):

[0665] DpbOutputTime[2][3]=ClockTick×(CpbRemovalDelayVal[2][3]+picDpbOutputDelay[2]-picDpbOutputDelta[2][3])

[0666] As shown in FIG. 99, CpbRemovalDelayVal[2][3]=8, picDpbOutputDelay[2]=2.

[0667] Furthermore, from the above formula (5') and from the above formula (5A'), picDpbOutputDelta[2][3] = 2. Therefore, the DPB output time of the desired picture is as follows.

[0668] DpbOutputTime[2][3]=ClockTick×(8+2-2)=ClockTick×8

[0669] As such, in the present disclosure, as shown in FIG. 99, there are no pictures in which DpbOutputTime[2][3] is equal to or greater than CpbRemovalTime[2][3] and the above-described reversal phenomenon occurs.

[0670] Note that the DPB output delta value of the highest temporal sub-layer present in the bitstream does not need to be calculated, and the DPB output time of the highest temporal sub-layer can be calculated using the CPB removal time and the DPB output delay without using the DPB output delta value.

[0671] [Example of Adjustment Process of DPB Output Times of Pictures in a Decoding Device] Next, the adjustment process of the DPB output times of each picture in a decoding device will be described in more detail. Figure 100 is a flowchart showing an example of the adjustment process of the DPB output times of each picture in a decoding device. Here, an example is described in which a sequence of CPB removal times and DPB output times is calculated for all pictures in one temporal version of a bitstream obtained by decoding all temporal sub-layers having temporal IDs equal to or less than Htid provided as input to the process. Note that in Figure 100, picture "n" means the nth picture in coding order.

[0672] First, the decoding device sets picture index n to 0 (step S101). At the first (i.e., leading) picture of the bitstream, the associated buffering period SEI message (more specifically, the information encoded in the buffering period SEI message) is used to initialize the HRD.

[0673] Next, the decoding device reads information from the buffering period SEI message (step S102). At this time, the decoding device reads, for example, information "initial_cpb_removal_delay[Htid]" on the CPB initial removal delay for the decoded temporal sublayer "Htid", information "dpb_output_tid_offset[Htid]" on the DPB output time offset for the decoded temporal sublayer "Htid" introduced in the present disclosure, and information "bp_max_sublayers_minus1" on the indexes of all temporal sublayers (also referred to as maximum temporal sublayers) present in the bitstream, which is used to set the value of the variable MaxTid in FIG. 100.

[0674] Next, the decoding device sets the value of MaxTid read in step S102 to the index of the maximum temporal sub-layer present in the bitstream (step S103).

[0675] Next, a loop of pictures is performed.

[0676] In the loop process, first, the decoding device reads information from the associated picture timing SEI message for each picture (step S104). At this time, the decoding device reads, for example, information "cpb_removal_delay_minus1[Htid]" on the CPB removal delay of the decoded temporal sublayer "Htid", information "cpb_removal_delay_minus1[MaxTid]" on the CPB removal delay of all temporal sublayers "MaxTid" present in the bitstream, and information "dpb_output_delay" on the DPB output delay. This information on the DPB output delay is the same for all decoded temporal sublayers, that is, it is common to all decoded temporal sublayers.

[0677] Next, the decoding device determines whether picture n is the first picture in the bitstream. Specifically, the decoding device identifies the picture for which the HRD is to be initialized by checking whether the picture index n of the current picture is zero. For example, if picture n is the first picture in the bitstream, that is, if picture index n is zero (Yes in step S105), the decoding device calculates the CPB removal time of picture n using the initial CPB removal delay read from the buffering period SEI message (step S106). Specifically, the CPB removal time of picture n is calculated using the following formula:

[0678] CpbRemovalTime[0]=initial_cpb_removal_delay[Htid] / 90000

[0679] On the other hand, if picture n is not the first picture in the bitstream, i.e., if picture index n is not zero (No in step S105), the decoding device calculates the CPB removal time for picture n by multiplying the CPB removal delay for the decoded temporal sub-layer "Htid" read from the picture timing SEI message by ClockTick and adding the CPB removal time of the first picture to the result (step S107). The value of ClockTick is determined by information coded in the sequence parameter set or video parameter set. Specifically, the CPB removal time for picture n is calculated using the following formula.

[0680] CpbRemovalTime[n]=CpbRemovalTime[0]+ClockTick×(cpb_removal_delay_minus1[Htid]+1)

[0681] Next, the decoding device calculates the DPB output time of picture n (steps S108 to S109).

[0682] First, the decoding device calculates the output delta value of picture n (step S108). The output delta value of picture n is the value of the variable picDpbOutputDelta. The output delta value is calculated by subtracting the newly introduced syntax element "dpb_output_tid_offset[Htid]" for the decoded temporal sublayer "Htid" from the difference in CPB removal delay between the temporal sublayer "Htid" and the maximum temporal sublayer "MaxTid" read from the picture timing SEI message. Specifically, the output delta value of picture n is calculated using the following formula:

[0683] picDpbOutputDelta [n] = cpb_removal_delay_minus1 [Htid] - cpb_removal_delay_minus1 [MaxTid] - dpb_output_tid_offset [Htid]

[0684] Note that in the particular case where Htid is equal to MaxTid, dpb_output_tid_offset[MaxTid] is not signaled but is inferred to be zero, resulting in the value of picDpbOutputDelta being equal to zero.

[0685] Next, the decoding device calculates the DPB output time of picture n (step S109). For example, the DPB output time of picture n is calculated by adding the previously calculated CPB removal time of picture n (specifically, the CPB removal time calculated in step S107) to the difference between the DPB output delay read from the picture timing SEI message and the value obtained by multiplying the previously calculated variable picDpbOutputDelta by ClockTick (specifically, the value calculated in step S108). Specifically, the DPB output time of picture n is calculated using the following formula.

[0686] DpbOutputTime[n]=CpbRemovalTime[n]+ClockTick×(dpb_output_delay-picDpbOutputDelta[n])

[0687] Next, the decoding device determines whether there are other pictures in the bitstream besides picture n (step S110), and if there are other pictures in the bitstream (Yes), adds 1 to picture index n (step S111), and then loops back to the process of reading information from the picture timing SEI message related to the picture with picture index n (processing of step S104).

[0688] On the other hand, if there is no other picture in the bitstream (No in step S110), the decoding device outputs the sequence of CPB removal times and DPB output times and ends the process.

[0689] The process described with reference to FIG. 100 may also be applied to the simulation process of the HRD operation performed in the encoding device to generate a stream that complies with the standard.

[0690] [Effects of the First Aspect] The configuration according to the first aspect allows more appropriate DPB output times to be calculated for all temporal versions of a bitstream. This may be very useful for trick-play operations. For example, this allows each picture included in the lowest temporal sublayer of a bitstream to be output at the appropriate time when only the lowest temporal sublayer is decoded. Note that the DPB output time calculation process described above in the decoding device 200 may also be performed in the HRD of the encoding device 100. Furthermore, not all of the components described in this aspect are necessarily required, and only some of the components of the first aspect may be included.

[0691] Note that the encoding device 100 determines and writes offset values ​​to the bitstream so that the DPB output times of all pictures in each temporal sublayer are after the CPB delay time. This allows the decoding device 200 to determine the DPB output times using the offset values ​​read from the bitstream so that the DPB output times are after the CPB delay time.

[0692] Additionally, the term "encode" may be replaced with terms such as "store," "include," "write," "write," "signal," "send," "notify," or "preserve." For example, encoding information may refer to including information in a bitstream. Additionally, the term "decode" may be replaced with terms such as "read," "decode," "read," "load," "derive," "obtain," "receive," "extract," or "restore." For example, decoding information may refer to obtaining information from a bitstream.

[0693] [Variation of First Aspect] The name of the newly introduced offset "dpb_output_tid_offset" in the present disclosure may be changed. Also, since the purpose of the newly introduced offset is to shift the sequence of DPB output times by an amount that depends on the decoded temporal sublayer, adding the offset to the DPB output time equation described in equation (4') above rather than subtracting it from the offset is mathematically equivalent to subtracting the offset from the calculation formula for picDpbOutputDelta such as equation (5') above.

[0694] Note that the information about the offset "dpb_output_tid_offset" may be coded in a different syntax structure, for example, a picture timing SEI message.

[0695] [Typical Example of Processing] A typical example of processing by the encoding device 100 and the decoding device 200 shown above will be described below.

[0696] 101 is a flowchart showing the operation of the encoding device 100. The encoding device 100 includes a circuit and a memory connected to the circuit. The circuit and memory included in the encoding device 100 may correspond to the processor a1 and memory a2 shown in FIG. 8. In operation, the circuit of the encoding device 100 performs the following:

[0697] For example, when id indicates a lower temporal sublayer other than the highest temporal sublayer included in multiple temporal sublayers, the circuit of the encoding device 100 calculates a DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer (S201). In step S201, the circuit of the encoding device 100 subtracts a DPB output delta [id] provided for each temporal sublayer from a DPB output delay common to the multiple temporal sublayers, and when maxid indicates the highest temporal sublayer, calculates a DPB output delta [id] by subtracting a CPB (Coded Picture Buffer) removal delay [maxid] and an offset [id] from the CPB removal delay [id].

[0698] Next, the circuit of the encoding device 100 stores the offset [id] in the bitstream (S202).

[0699] This may enable the encoding device 100 to adjust the DPB output delta value, which is used to calculate the time to be added to the CPB removal time when calculating the DPB output time, using the offset value for each temporal sublayer. The encoding device 100 may then adjust the DPB output time according to the DPB output delta value adjusted using the offset value for each temporal sublayer. Therefore, the encoding device 100 may be able to adjust the DPB output time for each temporal sublayer. As a result, the encoding device 100 can adjust the DPB output time so that it does not occur before the CPB removal time (i.e., so that it does not occur before the CPB removal time), thereby eliminating the reversal phenomenon in which a picture must be output before it is decoded.

[0700] In step S202, for example, the CPB removal delay [id] and the CPB removal delay [maxid] do not have to be stored in the bitstream. This allows the encoding device 100 to adjust the DPB output delta value using an offset value for each temporal sublayer, eliminating the need to store these CPB removal delays in the bitstream for adjusting the DPB output delta value, thereby reducing the amount of code.

[0701] For example, the circuit of the encoding device 100 may calculate a value that is equal to or less than the DPB output delay [maxid] as the DPB output delta [id] by subtracting the offset [id].

[0702] This may enable the encoding device...

Claims

1. A coding device comprising a circuit and a memory connected to the circuit, wherein in operation, when id indicates a lower temporal sublayer other than the topmost temporal sublayer included in a plurality of temporal sublayers, the circuit subtracts a DPB (Decoded Picture Buffer) output delta [id] provided for each temporal sublayer from a DPB output delay common to the plurality of temporal sublayers to calculate a DPB output time [id] of a picture in the lower temporal sublayer; when maxid indicates the topmost temporal sublayer, the circuit calculates the DPB output delta [id] by subtracting a CPB (Coded Picture Buffer) removal delay [maxid] and an offset [id] from a CPB removal delay [id], and stores the offset [id] in a bitstream.

2. The coding device according to claim 1, wherein the CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream.

3. The coding device according to claim 1 or 2, wherein the circuit calculates a value that is less than or equal to the DPB output delay [maxid] as the DPB output delta [id] by subtracting the offset [id].

4. The coding device according to claim 1 or 2, wherein each of the plurality of temporal sublayers is a temporal sublayer selectable by a decoding device.

5. The coding device according to any one of claims 1 to 4, wherein the circuit writes the offset [id] to a buffering period SEI message in the bitstream.

6. The coding device according to any one of claims 1 to 5, wherein for the topmost temporal sublayer, the circuit estimates the offset [maxid] to be zero without writing the offset [maxid] to the bitstream.

7. The coding device according to any one of claims 1 to 6, wherein for the topmost temporal sublayer, the circuit calculates the DPB output time [maxid] by adding a time calculated from the DPB output delay [maxid] to the CPB removal time [maxid] without using the DPB output delta [id].

8. The circuit writes the offset [id] for calculating the DPB output time [id] that satisfies the condition that the DPB output time [id] for all pictures in the temporal sublayer is after the CPB removal time [id] for the lower temporal sublayer to the bitstream. The encoding device according to any one of claims 1 to 7.

9. The circuit writes a flag indicating whether the offset [id] exists to the bitstream, and when the flag indicates that the offset [id] exists, writes the offset [id] to the bitstream for the lower temporal sublayer. The encoding device according to any one of claims 1 to 8.

10. An encoding device comprising: a circuit; and a memory connected to the circuit, wherein in operation, when id indicates a lower temporal sublayer other than the uppermost temporal sublayer included in a plurality of temporal sublayers, calculates an offset [id] for calculating the DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer, stores the offset [id] in a bitstream, the offset [id] is a value for calculating a DPB output delta [id] by subtracting the CPB (Coded Picture Buffer) removal delay [maxid] and the offset [id] from the CPB removal delay [id] for calculating the DPB output time [id] when maxid indicates the uppermost temporal sublayer, and the DPB output delta [id] is a value for calculating the DPB output time [id] by subtracting the DPB output delta [id] from a DPB output delay common to the plurality of temporal sublayers.

11. The CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream. The encoding device according to claim 10.

12. The offset [id] is the difference between the DPB output time [maxid] assigned to the first picture when the first picture is extracted as the top temporal sublayer from a plurality of pictures and the DPB output time [id] assigned when the first picture is extracted as the lower temporal sublayer from the plurality of pictures to be encoded. The encoding apparatus according to any one of claims 1 to 11.

13. A circuit and a memory connected to the circuit, wherein the circuit, in operation, when id indicates a lower temporal sublayer other than the top temporal sublayer included in a plurality of temporal sublayers, reads an offset [id] for calculating the DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer from a bitstream, subtracts a DPB output delta [id] provided for each temporal sublayer from a DPB output delay common to the plurality of temporal sublayers to calculate the DPB output time [id], and calculates the DPB output delta [id] by subtracting the CPB (Coded Picture Buffer) removal delay [maxid] and the offset [id] from the CPB removal delay [id] when maxid indicates the top temporal sublayer. Decoding apparatus.

14. The CPB removal delay [id] and the CPB removal delay [maxid] are not read from the bitstream. The decoding apparatus according to claim 13.

15. The circuit calculates a value that is less than or equal to the DPB output delay [maxid] as the DPB output delta [id] by subtracting the offset [id]. The decoding apparatus according to claim 13 or 14.

16. Each of the plurality of temporal sublayers is a temporal sublayer selectable by the decoding apparatus. The decoding apparatus according to claim 13 or 14.

17. The circuit reads the offset [id] from within a buffering period SEI message in the bitstream. The decoding apparatus according to any one of claims 13 to 16.

18. The decoding apparatus according to any one of claims 13 to 17, wherein for the highest temporal sublayer, the circuit estimates the offset [maxid] to be zero without reading the offset [maxid] from the bitstream.

19. The decoding apparatus according to any one of claims 13 to 18, wherein for the highest temporal sublayer, the circuit calculates the DPB output time [maxid] by adding the time calculated from the DPB output delay [maxid] to the CPB removal time [maxid] without using the DPB output delta [id].

20. The decoding apparatus according to any one of claims 13 to 19, wherein for the lower temporal sublayer, the circuit reads the offset [id] from the bitstream to calculate the DPB output time [id] that satisfies the condition that the DPB output time [id] for all pictures in the temporal sublayer is after the CPB removal time [id].

21. The decoding apparatus according to any one of claims 13 to 20, wherein the circuit reads a flag indicating whether the offset [id] exists from the bitstream, and when the flag indicates that the offset [id] exists, the circuit reads the offset [id] from the bitstream for the lower temporal sublayer.

22. When id indicates a lower temporal sublayer other than the highest temporal sublayer included in a plurality of temporal sublayers, in order to calculate the DPB (Decoded Picture Buffer) output time [id] of a picture in the lower temporal sublayer, subtract the DPB output delta [id] provided for each temporal sublayer from the DPB output delay common to the plurality of temporal sublayers. When maxid indicates the highest temporal sublayer, calculate the DPB output delta [id] by subtracting the CPB removal delay [id] and the offset [id] from the CPB (Coded Picture Buffer) removal delay [maxid], and save the offset [id] in the bitstream. Encoding method.

23. When the id indicates a lower temporal sublayer other than the topmost temporal sublayer included in a plurality of temporal sublayers, an offset [id] for calculating the DPB (Decoded Picture Buffer) output time of a picture in the lower temporal sublayer is read from a bitstream, and in order to calculate the DPB output time [id], a DPB output delta [id] provided for each temporal sublayer is subtracted from a DPB output delay common to the plurality of temporal sublayers. When maxid indicates the topmost temporal sublayer, the DPB output delta [id] is calculated by subtracting the CPB (Coded Picture Buffer) removal delay [maxid] and the offset [id] from the CPB removal delay [id]. A decoding method.

24. A non-transitory storage medium for storing a bitstream, the bitstream including syntax for causing a decoding device that receives the bitstream to perform a decoding process. The syntax includes an offset [id] for calculating the DPB (Decoded Picture Buffer) output time [id] of a picture in a lower temporal sublayer when the id indicates a lower temporal sublayer other than the topmost temporal sublayer included in a plurality of temporal sublayers. The offset [id] is a value for calculating the DPB output delta [id] by subtracting the CPB (Coded Picture Buffer) removal delay [maxid] and the offset [id] from the CPB removal delay [id] when maxid indicates the topmost temporal sublayer. The DPB output delta [id] is a value for calculating the DPB removal delay [id] by subtracting the DPB output delta [id] from a DPB output delay common to the plurality of temporal sublayers. A non-transitory storage medium.

25. The non-transitory storage medium according to claim 24, wherein the CPB removal delay [id] and the CPB removal delay [maxid] are not stored in the bitstream.