Image encoding device, image decoding device, and bitstream generation device

The image encoding/decoding device improves video coding efficiency by predicting and encoding/decoding non-rectangular partitions with dual motion vectors, addressing the challenge of handling increasing digital video data in inter-prediction.

JP2026086569APending Publication Date: 2026-05-26PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
Filing Date
2026-02-05
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in efficiently handling the increasing amount of digital video data, particularly in the inter-prediction function that constructs a prediction of a current frame based on reference frames.

Method used

An image encoding/decoding device employs a circuit and memory to predict pixels for non-rectangular shaped partitions using single motion vectors, weights these predictions where partitions overlap, and stores dual motion vectors for improved encoding/decoding efficiency.

Benefits of technology

This approach enhances coding efficiency, simplifies processes, and increases coding/decoding speeds by effectively utilizing overlapping pixel predictions and dual motion vectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026086569000001_ABST
    Figure 2026086569000001_ABST
Patent Text Reader

Abstract

To provide an image encoding device that can reduce the amount of memory used. [Solution] The image encoding device comprises a circuit and a memory connected to the circuit. In operation, the circuit predicts a first set of pixels for a first partition having a non-rectangular shape of an image block using a first motion vector, which is a single predictive motion vector; predicts a second set of pixels for a second partition having a non-rectangular shape of an image block using a second motion vector, which is a single predictive motion vector; weights the first set of pixels and the second set of pixels for a plurality of pixels in the first part where the first and second partitions overlap; stores the first and second motion vectors in memory as a double predictive motion vector and as the motion vector for the first part; and encodes the first partition using at least the plurality of pixels of the weighted first part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to video coding, and more particularly to systems, components, and methods in the encoding and decoding of moving images for implementing an inter-prediction function that constructs a prediction of a current frame based on reference frames.

Background Art

[0002] Video coding technology has advanced from H.261 and MPEG-1 to H.264 / AVC (Advanced Video Coding), MPEG-LA, H.265 / HEVC (High Efficiency Video Coding), and H.266 / VVC (Versatile Video Codec). With this advancement, there has always been a need to provide improvements and optimizations to video coding technology to handle the continuously increasing amount of digital video data in various applications. The present disclosure relates to further advancements, improvements, and optimizations in video coding, particularly in the inter-prediction function that constructs a prediction of a current frame based on reference frames.

Summary of the Invention

[0003] An image encoding apparatus according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit predicts a first set of pixels for a first partition having a non-rectangular shape of an image block using a first motion vector that is a single prediction motion vector, predicts a second set of pixels for a second partition having a non-rectangular shape of the image block using a second motion vector that is a single prediction motion vector, weights the first set of pixels and the second set of pixels for a plurality of pixels in a first portion where the first partition and the second partition overlap, stores the first motion vector and the second motion vector in the memory as a dual prediction motion vector and as a motion vector of the first portion, and encodes the first partition using at least the weighted plurality of pixels in the first portion.

[0004] An image decoding device according to one aspect of the present disclosure comprises a circuit and a memory connected to the circuit, wherein the circuit, in operation, predicts a first set of pixels for a first partition having a non-rectangular shape of an image block using a first motion vector which is a single predictive motion vector, predicts a second set of pixels for a second partition having a non-rectangular shape of the image block using a second motion vector which is a single predictive motion vector, weights the first set of pixels and the second set of pixels for a plurality of pixels in a first portion where the first and second partitions overlap, stores the first motion vector and the second motion vector as a double predictive motion vector and as the motion vector for the first portion in the memory, and decodes the first partition using at least the weighted plurality of pixels of the first portion.

[0005] A bitstream generation device according to one aspect of the present disclosure comprises a circuit and a memory connected to the circuit, wherein the circuit, in operation, predicts a first set of pixels for a first partition having a non-rectangular shape of an image block using a first motion vector which is a single predictive motion vector, predicts a second set of pixels for a second partition having a non-rectangular shape of the image block using a second motion vector which is a single predictive motion vector, weights the first set of pixels and the second set of pixels for a plurality of pixels in a first portion where the first and second partitions overlap, stores the first motion vector and the second motion vector as a double predictive motion vector and as a motion vector for the first portion in the memory, encodes the first partition using at least the weighted plurality of pixels in the first portion, and generates a bitstream containing information used to encode the image block using the first partition.

[0006] In one embodiment, the image encoding device comprises a circuit and a memory connected to the circuit. In operation, the circuit predicts a first set of pixels for a first partition of the current picture using a first motion vector and predicts a second set of pixels for a second partition of the current picture using a second motion vector. The first set of pixels and the second set of pixels are weighted for a plurality of pixels in the first portion where the first and second partitions overlap. Based on a first condition, one of the first motion vector and the second motion vector is stored in the memory as the motion vector for the first portion. Based on a second condition different from the first condition, both the first and second motion vectors are stored in the memory as the motion vector for the first portion. The first partition is encoded using at least the plurality of weighted pixels in the first portion.

[0007] In one embodiment, the image coding device includes: a division unit that receives a source picture and divides it into a plurality of blocks in operation; a first adder that receives the plurality of blocks from the division unit and a plurality of predictions from the prediction control unit, subtracts each prediction from the corresponding block and outputs a residual; a conversion unit that performs a conversion on the plurality of residuals output from the first adder and outputs a plurality of conversion coefficients in operation; a quantization unit that quantizes the plurality of conversion coefficients and generates a plurality of quantized conversion coefficients in operation; an entropy coding unit that codes the plurality of quantized conversion coefficients and generates a bitstream in operation; an inverse quantization conversion unit that inversely quantizes the plurality of quantized conversion coefficients to obtain the plurality of conversion coefficients and inversely converts the plurality of conversion coefficients to obtain the plurality of residuals in operation; a second adder that adds the plurality of residuals output from the inverse quantization conversion unit and the plurality of predictions output from the prediction control unit to reconstruct the plurality of blocks in operation; and an inter-prediction unit, an intra-prediction unit, and the prediction control unit connected to memory. The inter-prediction unit generates a prediction of the current block based on the reference block in the encoded reference picture during operation. The intra-prediction unit generates a prediction of the current block based on the encoded reference block in the current picture during operation. The inter-prediction unit predicts a first set of pixels for the first partition of the current picture using a first motion vector, and predicts a second set of pixels for the second partition of the current picture using a second motion vector. The first set of pixels and the second set of pixels are weighted for a plurality of pixels in the first portion where the first and second partitions overlap. Based on a first condition, one of the first motion vector and the second motion vector is stored in the memory as the motion vector for the first portion. Based on a second condition different from the first condition, both the first and second motion vectors are stored in the memory as the motion vector for the first portion. The first partition is encoded using at least the plurality of weighted pixels in the first portion.

[0008] In one embodiment, the image coding method predicts a first set of pixels for a first partition of the current picture using a first motion vector, and predicts a second set of pixels for a second partition of the current picture using a second motion vector. The first set of pixels and the second set of pixels are weighted for a plurality of pixels in the first portion where the first and second partitions overlap. Based on a first condition, one of the first motion vector and the second motion vector is stored in memory as the motion vector for the first portion. Based on a second condition different from the first condition, both the first and second motion vectors are stored in the memory as the motion vector for the first portion. The first partition is coded using at least the plurality of weighted pixels in the first portion.

[0009] In one embodiment, the image decoding device comprises a circuit and a memory connected to the circuit. In operation, the circuit predicts a first set of pixels for a first partition of the current picture using a first motion vector and predicts a second set of pixels for a second partition of the current picture using a second motion vector. The first set of pixels and the second set of pixels are weighted for a plurality of pixels in the first portion where the first and second partitions overlap. Based on a first condition, one of the first motion vector and the second motion vector is stored in the memory as the motion vector for the first portion. Based on a second condition different from the first condition, both the first and second motion vectors are stored in the memory as the motion vector for the first portion. The first partition is decoded using at least the plurality of weighted pixels in the first portion.

[0010] In one embodiment, the system includes: an entropy decoding unit that receives and decodes an encoded bitstream to obtain a plurality of quantization conversion coefficients; an inverse quantization conversion unit that inversely quantizes the plurality of quantization conversion coefficients to obtain a plurality of conversion coefficients and inversely converts the plurality of conversion coefficients to obtain a plurality of residuals; an addition unit that inversely adds the plurality of residuals output from the inverse quantization conversion unit and a plurality of predictions output from a prediction control unit to reconstruct a plurality of blocks; and an inter-prediction unit, an intra-prediction unit, and a prediction control unit connected to memory. The inter-prediction unit generates a prediction of the current block based on the reference block in the decoded reference picture. The intra-prediction unit generates a prediction of the current block based on the decoded reference block in the current picture. The inter-prediction unit predicts a first set of pixels for a first partition of the current picture using a first motion vector and predicts a second set of pixels for a second partition of the current picture using a second motion vector. Weights are assigned to the first set of pixels and the second set of pixels for a plurality of pixels in the first portion where the first partition and the second partition overlap. Based on the first condition, one of the first motion vector and the second motion vector is stored in the memory as the motion vector for the first portion. Based on the second condition, which is different from the first condition, both the first motion vector and the second motion vector are stored in the memory as the motion vector for the first portion. The first partition is decoded using at least the plurality of pixels of the weighted first portion.

[0011] In one embodiment, the image decoding method predicts a first set of pixels for a first partition of the current picture using a first motion vector, and predicts a second set of pixels for a second partition of the current picture using a second motion vector. The first set of pixels and the second set of pixels are weighted for a plurality of pixels in the first portion where the first and second partitions overlap. Based on a first condition, one of the first motion vector and the second motion vector is stored in memory as the motion vector for the first portion. Based on a second condition different from the first condition, both the first and second motion vectors are stored in memory as the motion vector for the first portion. The first partition is decoded using at least the plurality of weighted pixels in the first portion.

[0012] Some implementations of the embodiments in this disclosure may improve coding efficiency, simplify coding / decoding processes, increase coding / decoding speeds, or efficiently select appropriate components / operations used for coding and decoding, such as appropriate filters, block sizes, motion vectors, reference pictures, reference blocks, etc.

[0013] Further advantages and effects of one aspect of this disclosure will be made apparent from the specification and drawings. Such advantages and / or effects may be obtained by several embodiments and features described in the specification and drawings, but not all of them are necessarily provided to obtain one or more advantages and / or effects.

[0014] These general or specific embodiments may be implemented as systems, methods, integrated circuits, computer programs, recording media, or any combination thereof. [Brief explanation of the drawing]

[0015] [Figure 1] Figure 1 is a block diagram showing the functional configuration of an encoding device according to an embodiment. [Figure 2] Figure 2 is a flowchart showing an example of the overall encoding process performed by the encoding device. [Figure 3] Figure 3 is a conceptual diagram showing an example of block division. [Figure 4A] Figure 4A is a conceptual diagram showing an example of a slice configuration. [Figure 4B] Figure 4B is a conceptual diagram showing an example of tile configuration. [Figure 5A] Figure 5A is a table showing the transformation basis functions corresponding to various transformation types. [Figure 5B] Figure 5B is a conceptual diagram showing an example of SVT (Spatially Varying Transform). [Figure 6A] Figure 6A is a conceptual diagram showing an example of the filter shape used in an adaptive loop filter (ALF). [Figure 6B] Figure 6B is a conceptual diagram showing another example of the filter shape used in ALF. [Figure 6C] Figure 6C is a conceptual diagram showing another example of the filter shape used in ALF. [Figure 7] Figure 7 is a block diagram showing an example of a detailed configuration of a loop filter section that functions as a DBF (deblocking filter). [Figure 8] Figure 8 is a conceptual diagram showing an example of a deblocking filter with symmetrical filter characteristics with respect to block boundaries. [Figure 9] Figure 9 is a conceptual diagram illustrating the block boundaries where deblocking filtering is performed. [Figure 10] Figure 10 is a conceptual diagram showing an example of a Bs value. [Figure 11] Figure 11 is a flowchart showing an example of the processing performed in the prediction processing unit of the encoding device. [Figure 12] Figure 12 is a flowchart showing another example of processing performed in the prediction processing unit of an encoding device. [Figure 13]FIG. 13 is a flowchart showing another example of the processing performed by the prediction processing unit of the encoding apparatus. [Figure 14] FIG. 14 is a conceptual diagram showing an example of 67 intra prediction modes in the intra prediction of the embodiment. [Figure 15] FIG. 15 is a flowchart showing an example of the basic processing flow of inter prediction. [Figure 16] FIG. 16 is a flowchart showing an example of motion vector derivation. [Figure 17] FIG. 17 is a flowchart showing another example of motion vector derivation. [Figure 18] FIG. 18 is a flowchart showing another example of motion vector derivation. [Figure 19] FIG. 19 is a flowchart showing an example of inter prediction in the normal inter mode. [Figure 20] FIG. 20 is a flowchart showing an example of inter prediction in the merge mode. [Figure 21] FIG. 21 is a conceptual diagram for explaining an example of motion vector derivation processing in the merge mode. [Figure 22] FIG. 22 is a flowchart showing an example of FRUC (frame rate up conversion) processing. [Figure 23] FIG. 23 is a conceptual diagram for explaining an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. [Figure 24] FIG. 24 is a conceptual diagram for explaining an example of pattern matching (template matching) between a template in the current picture and a block in the reference picture. [Figure 25A] FIG. 25A is a conceptual diagram for explaining an example of deriving a motion vector in units of sub-blocks based on the motion vectors of a plurality of adjacent blocks. [Figure 25B] FIG. 25B is a conceptual diagram for explaining an example of deriving a motion vector in units of sub-blocks in the affine mode having three control points. [Figure 26A] Figure 26A is a conceptual diagram illustrating the affine merge mode. [Figure 26B] Figure 26B is a conceptual diagram illustrating an affine merge mode with two control points. [Figure 26C] Figure 26C is a conceptual diagram illustrating an affine merge mode with three control points. [Figure 27] Figure 27 is a flowchart showing an example of processing in affine merge mode. [Figure 28A] Figure 28A is a conceptual diagram illustrating an affine intermode with two control points. [Figure 28B] Figure 28B is a conceptual diagram illustrating an affine intermode with three control points. [Figure 29] Figure 29 is a flowchart showing an example of affine intermode processing. [Figure 30A] Figure 30A is a conceptual diagram illustrating an affine intermode in which the current block has three control points and the adjacent block has two control points. [Figure 30B] Figure 30B is a conceptual diagram illustrating an affine intermode in which the current block has two control points and the adjacent block has three control points. [Figure 31A] Figure 31A is a flowchart showing merge modes including DMVR (decoder motion vector refinement). [Figure 31B] Figure 31B is a conceptual diagram illustrating an example of DMVR processing. [Figure 32] Figure 32 is a flowchart showing an example of predictive image generation. [Figure 33] Figure 33 is a flowchart showing another example of predictive image generation. [Figure 34] Figure 34 is a flowchart showing another example of predictive image generation. [Figure 35]Figure 35 is a flowchart illustrating an example of predictive image correction processing using OBMC (overlapped block motion compensation). [Figure 36] Figure 36 is a conceptual diagram illustrating an example of predictive image correction processing using OBMC. [Figure 37] Figure 37 is a conceptual diagram illustrating the generation of two triangular predicted images. [Figure 38] Figure 38 is a conceptual diagram illustrating a model that assumes uniform linear motion. [Figure 39] Figure 39 is a conceptual diagram illustrating an example of a predictive image generation method using brightness correction processing by LIC (local illumination compensation). [Figure 40] Figure 40 is a block diagram showing an example implementation of an encoding device. [Figure 41] Figure 41 is a block diagram showing the functional configuration of a decoding device according to an embodiment. [Figure 42] Figure 42 is a flowchart showing an example of the overall decoding process by the decoding device. [Figure 43] Figure 43 is a flowchart showing an example of the processing performed in the prediction processing unit of the decoding device. [Figure 44] Figure 44 is a flowchart showing another example of the processing performed in the prediction processing unit of the decoding device. [Figure 45] Figure 45 is a flowchart showing an example of inter-mode prediction in a decoding device. [Figure 46] Figure 46 is a block diagram showing an example of a decoding device implementation. [Figure 47] Figure 47 is a flowchart showing the overall processing flow for dividing an image block into multiple partitions, including at least a first partition and a second partition having a non-rectangular shape (e.g., a triangle), according to one embodiment, and then performing further processing. [Figure 48]Figure 48 shows two exemplary methods for dividing an image block into a first partition having a non-rectangular shape (e.g., a triangle) and a second partition (which also has a non-rectangular shape in the examples shown). [Figure 49] Figure 49 shows an example of boundary smoothing, which involves weighting multiple primary values ​​of multiple boundary pixels predicted based on the first partition with multiple secondary values ​​of multiple boundary pixels predicted based on the second partition. [Figure 50] Figure 50 shows three further examples of boundary smoothing, which involves weighting multiple primary values ​​of multiple boundary pixels predicted based on the first partition with multiple secondary values ​​of multiple boundary pixels predicted based on the second partition. [Figure 51] Figure 51 is a table diagram showing examples of multiple parameters ("multiple first index values") and multiple information sets encoded by each of the multiple parameters. [Figure 52] Figure 52 is a table diagram showing the binarization of multiple parameters (multiple index values). [Figure 53] Figure 53 is a flowchart illustrating the process of dividing an image block into multiple partitions, including a first partition and a second partition, both having a non-rectangular shape. [Figure 54] Figure 54 shows several examples of dividing an image block into multiple partitions, including a first partition and a second partition, which have a non-rectangular shape that is triangular in the multiple examples shown. [Figure 55] Figure 55 shows several further examples of dividing an image block into multiple partitions, including a first partition having a non-rectangular shape which is a polygon with at least five sides and angles in the multiple examples shown, and a second partition. [Figure 56]Figure 56 is a flowchart illustrating a boundary smoothing process that involves weighting multiple primary values ​​of multiple boundary images predicted based on a first partition with multiple secondary values ​​of multiple boundary images predicted based on a second partition. [Figure 57A] Figure 57A shows an example of boundary smoothing, in which multiple weighted first values ​​for multiple boundary pixels are predicted based on a first partition, and multiple weighted second values ​​for multiple boundary pixels are predicted based on a second partition. [Figure 57B] Figure 57B shows an example of boundary smoothing, in which multiple weighted first values ​​for multiple boundary pixels are predicted based on a first partition, and multiple weighted second values ​​for multiple boundary pixels are predicted based on a second partition. [Figure 57C] Figure 57C shows an example of boundary smoothing, in which multiple weighted first values ​​for multiple boundary pixels are predicted based on a first partition, and multiple weighted second values ​​for multiple boundary pixels are predicted based on a second partition. [Figure 57D] Figure 57D shows an example of boundary smoothing, in which multiple weighted first values ​​for multiple boundary pixels are predicted based on a first partition, and multiple weighted second values ​​for multiple boundary pixels are predicted based on a second partition. [Figure 58] Figure 58 is a flowchart illustrating a method performed by an encoding device to divide an image block into multiple partitions, including a first partition and a second partition, which have a non-rectangular shape, based on partition parameters indicating the division, and to write one or more parameters, including the partition parameters, to the bitstream during entropy coding. [Figure 59]Figure 59 is a flowchart illustrating a method performed by a decoding device that reads one or more parameters from a bitstream, including partition parameters that indicate dividing an image block into multiple partitions, including a first partition and a second partition having a non-rectangular shape, divides the image block into multiple partitions based on the partition parameters, and decodes the first and second partitions. [Figure 60] Figure 60 is a table diagram showing multiple partition parameters ("multiple first index values") that indicate dividing an image block into multiple partitions, including a first partition and a second partition, each having a non-rectangular shape, and multiple information sets that can be encoded together by the multiple partition parameters. [Figure 61] Figure 61 is a table of multiple combinations of the first and second parameters, where one of the first and second parameters is a partition parameter indicating that an image block is divided into multiple partitions, including a first partition and a second partition, both having a non-rectangular shape. [Figure 62] Figure 62 is a flowchart illustrating an example of a processing flow in which a first sample set is predicted for a first partition of the current picture using a first motion vector, a second sample set is predicted for a first portion contained in the first partition using a second motion vector, the first and second sample sets are weighted, at least one of the first and second motion vectors for the first partition is stored, the first partition is encoded or decoded using the weighted samples, and further processing is performed according to one embodiment. [Figure 63] Figure 63 is a conceptual diagram showing an example of how to divide an image block into a first partition and a second partition. [Figure 64] Figure 64 is a conceptual diagram showing the neighboring and non-neighboring partitions of the first partition. [Figure 65]Figure 65 is a conceptual diagram showing single-prediction motion vector candidates and bi-prediction motion vector candidates for an image block. [Figure 66] Figure 66 is a conceptual diagram showing an example of the first part of the first partition and the first and second sample sets. [Figure 67] Figure 67 is a conceptual diagram showing the first portion of the first partition, which is a part of the first partition that overlaps with a portion of an adjacent partition. [Figure 68] Figure 68 is a conceptual diagram illustrating an example where the first and second motion vectors are single predictive motion vectors pointing to different pictures in different reference picture lists. [Figure 69] Figure 69 is a conceptual diagram illustrating an example where the first and second motion vectors are single predictive motion vectors pointing to pictures within a single reference picture list. [Figure 70] Figure 70 is a conceptual diagram illustrating an example where the first and second motion vectors are single predictive motion vectors pointing to the same picture in the same reference picture list. [Figure 71] Figure 71 is a conceptual diagram illustrating an example where the first and second motion vectors are single predictive motion vectors pointing to the same picture in the same reference picture list. [Figure 72] Figure 72 is a conceptual diagram illustrating an example where the first and second motion vectors are single predictive motion vectors pointing to the same picture in the same reference picture list. [Figure 73] Figure 73 is a block diagram showing the overall configuration of a content supply system that realizes a content distribution service. [Figure 74] Figure 74 is a conceptual diagram showing an example of an encoding structure during scalable encoding. [Figure 75] Figure 75 is a conceptual diagram showing an example of an encoding structure during scalable coding. [Figure 76] Figure 76 is a conceptual diagram showing an example of a web page display screen. [Figure 77]Figure 77 is a conceptual diagram showing an example of a web page display screen. [Figure 78] Figure 78 is a block diagram showing an example of a smartphone. [Figure 79] Figure 79 is a block diagram showing an example of a smartphone configuration. [Modes for carrying out the invention]

[0016] The embodiments will be described in detail below with reference to the drawings. Note that the embodiments described below are all general or specific examples. The numerical values, shapes, materials, components, arrangement and connection forms of components, steps, relationships and sequences of steps shown in the following embodiments are examples only and are not intended to limit the scope of the claims.

[0017] Embodiments of encoding and decoding devices are described below. These embodiments are examples of encoding and decoding devices to which the processes and / or configurations described in each aspect of this disclosure can be applied. The processes and / or configurations can also be implemented in encoding and decoding devices different from those in the embodiments. For example, with respect to the processes and / or configurations applicable to the embodiments, one of the following may be implemented:

[0018] (1) Any of the multiple components of the encoding 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.

[0019] (2) In the encoding or decoding device of the embodiment, any modifications such as addition, replacement, or deletion of functions or processes performed by some of the multiple components of the encoding or decoding device may be made. For example, any of the functions or processes may be replaced or combined with other functions or processes described in any of the embodiments of this disclosure.

[0020] (3) In the methods performed by the encoding or decoding apparatus of the embodiment, any modifications, such as additions, replacements, and deletions, may be made to some of the processes included in the method. For example, any of the processes in the method may be replaced with or combined with other processes described in any of the embodiments of this disclosure.

[0021] (4) Some of the multiple components constituting the encoding or decoding device of the embodiment may be combined with components described in any of the embodiments of this disclosure, or with components that have some of the functions described in any of the embodiments of this disclosure, or with components that perform some of the processing performed by the components described in any of the embodiments of this disclosure.

[0022] (5) Components that provide some of the functions of the encoding or decoding device of the embodiment, or components that perform some of the processing of the encoding or decoding device of the embodiment, may be combined with or replaced with components described in any of the aspects of the disclosure and components that provide some of the functions described in any of the aspects of the disclosure, or components that perform some of the processing described in any of the aspects of the disclosure.

[0023] (6) In a method performed by an encoding or decoding device of an embodiment, any of the processes included in the method may be replaced or combined with any of the processes described in any of the embodiments of the present disclosure.

[0024] (7) Some of the processes included in the methods performed by the encoding or decoding device of the embodiment may be combined with the processes described in any of the embodiments of this disclosure.

[0025] (8) The methods of carrying out the processes and / or configurations described in each aspect of the present disclosure are not limited to the encoding or decoding devices of the embodiments. For example, the processes and / or configurations may be carried out in devices used for purposes other than the video encoding or video decoding disclosed in the embodiments.

[0026] [Encoding device] First, the encoding device according to the embodiment will be described. Figure 1 is a block diagram showing the functional configuration of the encoding device 100 according to the embodiment. The encoding device 100 is a video encoding device that encodes video in block units.

[0027] As shown in Figure 1, the encoding device 100 is a device that encodes an image in block units and comprises 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, and a prediction control unit 128.

[0028] The encoding device 100 can be implemented, for example, by a general-purpose processor and memory. In this case, when a software program stored in memory is executed by the processor, the processor functions as a splitting unit 102, a subtraction unit 104, a conversion unit 106, a quantization unit 108, an entropy encoding unit 110, an inverse quantization unit 112, an inverse conversion unit 114, an addition unit 116, a loop filter unit 120, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128. Alternatively, the encoding device 100 may be implemented as one or more dedicated electronic circuits corresponding to the splitting unit 102, a subtraction unit 104, a conversion unit 106, a quantization unit 108, an entropy encoding unit 110, an inverse quantization unit 112, an inverse conversion unit 114, an addition unit 116, a loop filter unit 120, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128.

[0029] The following describes the overall processing flow of the encoding device 100, followed by a description of each component included in the encoding device 100.

[0030] [Overall flow of the encoding process] Figure 2 is a flowchart showing an example of the overall encoding process performed by the encoding device 100.

[0031] First, the splitting unit 102 of the encoding device 100 divides each picture contained in the input image, which is a moving image, into multiple fixed-size blocks (for example, 128 x 128 pixels) (step Sa_1). Then, the splitting unit 102 selects a splitting pattern (also called a block shape) for these fixed-size blocks (step Sa_2). In other words, the splitting unit 102 further divides the fixed-size blocks into multiple blocks that constitute the selected splitting pattern. Then, the encoding device 100 performs the processing in steps Sa_3 to Sa_9 for each of these multiple blocks (i.e., the block to be encoded).

[0032] In other words, the prediction processing unit, which consists of all or part of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128, generates a prediction signal (also called a prediction block) for the block to be encoded (also called the current block) (step Sa_3).

[0033] Next, the subtraction unit 104 generates the difference between the block to be encoded and the predicted block as the predicted residual (also called the difference block) (step Sa_4).

[0034] Next, the transformation unit 106 and the quantization unit 108 generate multiple quantization coefficients by performing transformation and quantization on the difference block (step Sa_5). A block consisting of multiple quantization coefficients is also called a coefficient block.

[0035] Next, the entropy coding unit 110 generates an encoded signal by encoding (specifically, entropy coding) its coefficient block and the prediction parameters related to the generation of the prediction signal (step Sa_6). The encoded signal is also called an encoded bitstream, compressed bitstream, or stream.

[0036] Next, the inverse quantization unit 112 and the inverse transformation unit 114 reconstruct multiple predicted residuals (i.e., difference blocks) by performing inverse quantization and inverse transformation on the coefficient block (step Sa_7).

[0037] Next, the adder 116 reconstructs the current block into a reconstructed image (also called a reconstructed block or decoded image block) by adding the predicted block to the restored difference block (step Sa_8). This generates the reconstructed image.

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

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

[0040] In the example described above, the encoding device 100 selects one division pattern for a fixed-size block and encodes each block according to that division pattern. However, it may also encode each block according to multiple division patterns. In this case, the encoding device 100 may evaluate the cost of each of the multiple division patterns and select, for example, the encoded signal obtained by encoding according to the division pattern with the smallest cost as the output encoded signal.

[0041] As shown in the diagram, these steps Sa_1 to Sa_10 are performed sequentially by the encoding device 100. Alternatively, some of these processes may be performed in parallel, or the order of these processes may be changed.

[0042] [Divided part] The splitting unit 102 divides each picture contained in the input video into multiple blocks and outputs each block to the subtraction unit 104. For example, the splitting unit 102 first divides the picture into blocks of a fixed size (e.g., 128x128). Other fixed block sizes may be used. These fixed-size blocks are sometimes called coding tree units (CTUs). Then, the splitting unit 102 divides each of the fixed-size blocks into blocks of a variable size (e.g., 64x64 or less) based on, for example, a recursive quadtree and / or binary tree block partitioning. In other words, the splitting unit 102 selects a partitioning pattern. These variable-size blocks are sometimes called coding units (CUs), prediction units (PUs), or transformation units (TUs). Note that in various processing examples, CUs, PUs, and TUs do not need to be distinguished, and some or all of the blocks in the picture may become processing units for CUs, PUs, and TUs.

[0043] Figure 3 is a conceptual diagram showing an example of block partitioning in the embodiment. In Figure 3, solid lines represent block boundaries due to quadtree block partitioning, and dashed lines represent block boundaries due to binary tree block partitioning.

[0044] Here, block 10 is a 128x128 pixel square block (128x128 block). This 128x128 block 10 is first divided into four 64x64 square blocks (quadtree block partitioning).

[0045] The top-left 64x64 block is further divided vertically into two rectangular 32x64 blocks, and the left 32x64 block is further divided vertically into two rectangular 16x64 blocks (binary tree block partitioning). As a result, the top-left 64x64 block is divided into two 16x64 blocks 11 and 12 and a 32x64 block 13.

[0046] The 64x64 block in the upper right is horizontally divided into two rectangular 64x32 blocks, 14 and 15 (binary tree block division).

[0047] The bottom-left 64x64 block is divided into four square 32x32 blocks (quadrutree block division). Of the four 32x32 blocks, the top-left and bottom-right blocks are further divided. The top-left 32x32 block is vertically divided into two rectangular 16x32 blocks, and the rightmost 16x32 block is further horizontally divided into two 16x16 blocks (binary tree block division). The bottom-right 32x32 block is horizontally divided into two 32x16 blocks (binary tree block division). As a result, the bottom-left 64x64 block is divided into 16x32 block 16, two 16x16 blocks 17 and 18, two 32x32 blocks 19 and 20, and two 32x16 blocks 21 and 22.

[0048] The 64x64 block 23 in the bottom right will not be divided.

[0049] As described above, in Figure 3, block 10 is divided into 13 variable-sized blocks 11-23 based on recursive quad-tree and binary tree block partitioning. Such partitioning is sometimes called QTBT (quad-tree plus binary tree) partitioning.

[0050] In Figure 3, one block was divided into four or two blocks (quadrutree or binary tree block partitioning), but partitioning is not limited to these. For example, one block may be divided into three blocks (ternary tree block partitioning). Partitioning that includes such ternary tree block partitioning is sometimes called MBT (multi-type tree) partitioning.

[0051] [Picture composition: slice / tile] To decode pictures in parallel, the pictures may be composed of slice units or tile units. A picture consisting of slice units or tile units may be composed of a division unit 102.

[0052] A slice is the basic coding unit that makes up a picture. A picture is composed of, for example, one or more slices. A slice consists of one or more consecutive Coding Tree Units (CTUs).

[0053] Figure 4A is a conceptual diagram showing an example of slice configuration. For example, a picture contains 11 × 8 CTUs and is divided into four slices (slice 1-4). Slice 1 consists of 16 CTUs, slice 2 consists of 21 CTUs, slice 3 consists of 29 CTUs, and slice 4 consists of 22 CTUs. Here, each CTU in the picture belongs to one of the slices. The shape of the slice is the horizontal division of the picture. The boundaries of the slice do not have to be at the edges of the screen, but can be anywhere among 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, the raster scan order. A slice also contains header information and encoded data. The header information may describe the characteristics of the slice, such as the CTU address at the beginning of the slice and the slice type.

[0054] A tile is a rectangular area that makes up a picture. Each tile may be assigned a number called a TileId in the order of the raster scan.

[0055] Figure 4B is a conceptual diagram showing an example of tile configuration. For example, a picture contains 11 × 8 CTUs and is divided into four rectangular tiles (tiles 1-4). When tiles are used, the processing order of CTUs is changed compared to when tiles are not used. When tiles are not used, multiple CTUs in a picture are processed in raster scan order. When tiles are used, in each of the multiple tiles, at least one CTU is processed in raster scan order. For example, as shown in Figure 4B, the processing order of multiple CTUs contained in tile 1 is from the left end of the first row of tile 1 to the right end of the first row of tile 1, and then from the left end of the second row of tile 1 to the right end of the second row of tile 1.

[0056] Note that one tile may contain one or more slices, and one slice may contain one or more tiles.

[0057] [Subtraction Unit] The subtraction unit 104 subtracts the predicted signal (predicted samples input from the prediction control unit 128, shown below) from the original signal (original sample) in block units that are input from the division unit 102 and divided by the division unit 102. In other words, the subtraction unit 104 calculates the prediction error (also called residual) of the block to be encoded (hereinafter referred to as the current block). The subtraction unit 104 then outputs the calculated prediction error (residual) to the conversion unit 106.

[0058] The source signal is the input signal to the encoding device 100, and is a signal representing the image of each picture that makes up the video (for example, a luminance (luma) signal and two chroma (chroma) signals). In the following, the signal representing an image may also be referred to as a sample.

[0059] [Conversion section] The conversion unit 106 converts the prediction error in the spatial domain into conversion coefficients in the frequency domain and outputs the conversion coefficients to the quantization unit 108. Specifically, the conversion unit 106 performs a predetermined discrete cosine transform (DCT) or discrete sine transform (DST) on the prediction error in the spatial domain, for example. The predetermined DCT or DST may be predetermined.

[0060] The transformation unit 106 may also adaptively select a transformation type from among several transformation types and use a transformation basis function corresponding to the selected transformation type to convert the prediction error into transformation coefficients. Such a transformation is sometimes called an EMT (explicit multiple core transform) or an AMT (adaptive multiple transform).

[0061] Multiple transformation types include, for example, DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. Figure 5A is a table showing transformation basis functions corresponding to example transformation types. In Figure 5A, N represents the number of input pixels. The selection of a transformation type from among these multiple transformation types may depend, for example, on the type of prediction (intra-prediction and inter-prediction) or on the intra-prediction mode.

[0062] Information indicating whether or not to apply EMT or AMT (e.g., called an EMT flag or AMT flag) and information indicating the selected conversion type are typically signaled at the CU level. However, the signaling of this information is not limited to the CU level and may be at other levels (e.g., bit sequence level, picture level, slice level, tile level, or CTU level).

[0063] Furthermore, the transformation unit 106 may retransform the transformation coefficients (transformation results). Such retransformation is sometimes called AST (adaptive secondary transform) or NSST (non-separable secondary transform). For example, the transformation unit 106 performs retransformation for each subblock (e.g., 4x4 subblock) contained in the block of transformation coefficients corresponding to the intra-prediction error. Information indicating whether or not to apply NSST and information regarding the transformation matrix used for NSST are usually signaled at the CU level. However, the signaling of this information is not limited to the CU level and may be at other levels (e.g., sequence level, picture level, slice level, tile level, or CTU level).

[0064] The transformation unit 106 may be subjected to either a separable transformation or a non-separable transformation. A separable transformation is a method in which the input is separated into directions equal to the number of dimensions and transformed multiple times, while a non-separable transformation is a method in which, when the input is multidimensional, two or more dimensions are treated as one dimension and transformed together.

[0065] For example, one example of a non-separable transformation is to treat a 4x4 block as a single array with 16 elements and then perform the transformation on that array using a 16x16 transformation matrix.

[0066] Another example of a non-separable transformation is a transformation (Hypercube Givens Transform) in which a 4x4 input block is treated as a single array with 16 elements, and then multiple Givens rotations are performed on that array.

[0067] In the conversion unit 106, the type of basis for conversion to the frequency domain can be switched depending on the region within the CU. One example is SVT (Spatially Varying Transform). In SVT, as shown in Figure 5B, the CU is divided into two equal parts horizontally or vertically, and only one of the regions is converted to the frequency domain. The type of conversion basis can be set for each region; for example, DST7 and DCT8 are used. In this example, only one of the two regions within the CU is converted, and the other is not, but both regions may also be converted. Furthermore, the division method can be made more flexible, not only by dividing into two equal parts, but also by dividing into four equal parts, or by separately encoding information indicating the division and signaling it in the same way as CU division. Note that SVT is sometimes called SBT (Sub-block Transform).

[0068] [Quantization section] The quantization unit 108 quantizes the conversion coefficients output from the conversion unit 106. Specifically, the quantization unit 108 scans the conversion coefficients of the current block in a predetermined scan order and quantizes the conversion coefficients based on the quantization parameter (QP) corresponding to the scanned conversion coefficients. The quantization unit 108 then outputs the quantized conversion coefficients of the current block (hereinafter referred to as quantization coefficients) to the entropy coding unit 110 and the inverse quantization unit 112. The predetermined scan order may be set in advance.

[0069] A predetermined scan order is the order for quantization / inverse quantization of the conversion coefficients. For example, a predetermined scan order may be defined as ascending frequency (from low to high frequency) or descending frequency (from high to low frequency).

[0070] The quantization parameter (QP) is a parameter that defines the quantization step (quantization width). For example, if the value of the quantization parameter increases, the quantization step also increases. In other words, if the value of the quantization parameter increases, the quantization error increases.

[0071] Furthermore, quantization matrices may be used for quantization. For example, several types of quantization matrices may be used corresponding to frequency conversion 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 the process of digitizing values ​​sampled at predetermined intervals and associating them with predetermined levels. In this technical field, it may also be referred to using other expressions such as rounding, scaling, and rounding, or rounding, rounding, and scaling may be employed. The predetermined intervals and levels may be predetermined.

[0072] There are two methods for using quantization matrices: using a quantization matrix directly set on the encoding device, and using a default quantization matrix (default matrix). By directly setting the quantization matrix on the encoding device, it is possible to set a quantization matrix that corresponds to the image features. However, in this case, there is a disadvantage that the amount of code increases due to the encoding of the quantization matrix.

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

[0074] The quantization matrix may be specified, for example, as an SPS (Sequence Parameter Set) or a PPS (Picture Parameter Set). An SPS contains the parameters used for the sequence, and a PPS contains the parameters used for the picture. SPS and PPS are sometimes simply referred to as parameter sets.

[0075] [Entropy coding unit] The entropy coding unit 110 generates an encoded signal (encoded bitstream) based on the quantization coefficients input from the quantization unit 108. Specifically, the entropy coding unit 110, for example, binarizes the quantization coefficients, arithmetically encodes the binary signal, and outputs a compressed bitstream or sequence.

[0076] [Dequantization section] The inverse quantization unit 112 inversely quantizes the quantization coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inversely quantizes the quantization coefficients of the current block in a predetermined scanning order. Then, the inverse quantization unit 112 outputs the inversely quantized conversion coefficients of the current block to the inverse conversion unit 114. The predetermined scanning order may be set in advance.

[0077] [Inverse Transformation Section] The inverse transform unit 114 restores the prediction error (residual) by performing an inverse transform on the transformation coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 restores the prediction error of the current block by performing an inverse transform on the transformation coefficients corresponding to the transformation by the transformation unit 106. The inverse transform unit 114 then outputs the restored prediction error to the adder unit 116.

[0078] Furthermore, the recovered prediction error usually does not match the prediction error calculated by the subtraction unit 104 because information is typically lost due to quantization. In other words, the recovered prediction error usually includes quantization errors.

[0079] [Addition section] The adder 116 reconstructs the current block by adding the prediction error input from the inverse transformer 114 and the prediction sample input from the prediction control unit 128. The adder 116 then outputs the reconstructed block to the block memory 118 and the loop filter unit 120. The reconstructed block is sometimes called the local decoded block.

[0080] [Block memory] The block memory 118 is a storage unit for storing blocks within the encoded picture (referred to as the current picture) that are referenced in intra prediction, for example. Specifically, the block memory 118 stores the reconstructed blocks output from the adder 116.

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

[0082] [Loop Filter Section] The loop filter unit 120 applies a loop filter to the block reconstructed by the adder unit 116 and outputs the filtered reconstructed block to the frame memory 122. A loop filter is a filter used within the encoding loop (in-loop filter), and includes, for example, a deblocking filter (DF or DBF), sample adaptive offset (SAO), and adaptive loop filter (ALF).

[0083] In ALF, a least-squares error filter is applied to remove coding distortion. For example, for each 2x2 subblock within the current block, one filter selected from several filters is applied based on the direction and activity of the local gradient.

[0084] Specifically, first, subblocks (e.g., 2x2 subblocks) are classified into multiple classes (e.g., 15 or 25 classes). The classification of subblocks is based on the direction and activity of the gradient. For example, a classification value C (e.g., C = 5D + A) is calculated using the gradient direction value D (e.g., 0-2 or 0-4) and the gradient activity value A (e.g., 0-4). Then, based on the classification value C, the subblocks are classified into multiple classes.

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

[0086] Based on the results of this classification, a filter for the subblock is determined from among multiple filters.

[0087] For example, a circularly symmetric shape is used as the filter shape in ALF. Figures 6A to 6C show several examples of filter shapes used in ALF. Figure 6A shows a 5x5 diamond-shaped filter, Figure 6B shows a 7x7 diamond-shaped filter, and Figure 6C shows a 9x9 diamond-shaped filter. Information indicating the filter shape is usually signaled at the picture level. However, the signaling of information indicating the filter shape is not limited to the picture level and may be at other levels (e.g., sequence level, slice level, tile level, CTU level, or CU level).

[0088] The on / off status of ALF may be determined, for example, at the picture level or CU level. For example, the decision to apply ALF to luminance may be made at the CU level, and the decision to apply ALF to color difference may be made at the picture level. Information indicating whether ALF is on or off is usually signaled at the picture level or CU level. However, the signaling of information indicating whether ALF is on or off is not limited to the picture level or CU level, but may be at other levels (e.g., sequence level, slice level, tile level, or CTU level).

[0089] The coefficient sets for multiple selectable filters (e.g., up to 15 or 25 filters) are typically signaled at the picture level. However, signaling of the coefficient sets is not limited to the picture level; it may be at other levels (e.g., sequence level, slice level, tile level, CTU level, CU level, or subblock level).

[0090] [Loop Filter Section > Deblocking Filter] In a deblocking filter, the loop filter section 120 reduces distortion at block boundaries by applying a filter to the block boundaries of the reconstructed image.

[0091] Figure 7 is a block diagram showing an example of a detailed configuration of the loop filter section 120, which functions as a deblocking filter.

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

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

[0094] If the boundary determination unit 1201 determines that the target pixel is located near a block boundary, switch 1202 outputs the image before filtering to switch 1204. Conversely, if the boundary determination unit 1201 determines that the target pixel is not located near a block boundary, switch 1202 outputs the image before filtering to switch 1206.

[0095] The filter determination unit 1203 determines whether or not to perform a deblocking filter on the target pixel based on the pixel values ​​of at least one surrounding pixel located around the target pixel. The filter determination unit 1203 then outputs the determination result to the switch 1204 and the processing determination unit 1208.

[0096] If the filter determination unit 1203 determines that deblocking filtering should be performed on the target pixel, switch 1204 outputs the pre-filtered image acquired via switch 1202 to the filter processing unit 1205. Conversely, if the filter determination unit 1203 determines that deblocking filtering should not be performed on the target pixel, switch 1204 outputs the pre-filtered image acquired via switch 1202 to switch 1206.

[0097] When the filter processing unit 1205 acquires an image before filtering via switches 1202 and 1204, it performs a deblocking filter process on the target pixel, using the filter characteristics determined by the filter characteristic determination unit 1207. The filter processing unit 1205 then outputs the filtered pixel to switch 1206.

[0098] Switch 1206 selectively outputs pixels that have not undergone deblocking and filtering, and pixels that have undergone deblocking and filtering by the filtering processing unit 1205, in accordance with the control by the processing determination unit 1208.

[0099] The processing determination unit 1208 controls the switch 1206 based on the determination results of the boundary determination unit 1201 and the filter determination unit 1203. Specifically, if the boundary determination unit 1201 determines that a target pixel is near a block boundary, and the filter determination unit 1203 determines that the target pixel should undergo deblocking and filtering, the processing determination unit 1208 outputs the deblocked and filtered pixel from the switch 1206. In all other cases, the processing determination unit 1208 outputs the undeblocked and unfiltered pixel from the switch 1206. This output of pixels is repeated, resulting in the filtered image being output from the switch 1206.

[0100] Figure 8 is a conceptual diagram showing an example of a deblocking filter with symmetrical filter characteristics with respect to block boundaries.

[0101] In deblocking filtering, for example, one of two deblocking filters with different characteristics, namely a strong filter and a weak filter, is selected using pixel values ​​and quantization parameters. In the strong filter, as shown in Figure 8, if pixels p0~p2 and pixels q0~q2 exist on either side of a block boundary, the respective pixel values ​​of pixels q0~q2 are changed to pixel values ​​q'0~q'2 by performing an operation shown in the following equation, for example.

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

[0103] In the above equations, p0~p2 and q0~q2 are the pixel values ​​of pixels p0~p2 and pixels q0~q2, respectively. Also, q3 is the pixel value of pixel q3, which is adjacent to pixel q2 on the opposite side of the block boundary. Furthermore, the coefficient multiplied by the pixel value of each pixel used in the deblocking filter process on the right-hand side of each of the above equations is the filter coefficient.

[0104] Furthermore, in the deblocking filter process, clipping may be performed to ensure that the calculated pixel values ​​do not exceed a threshold. In this clipping process, the calculated pixel values ​​according to the above formula are clipped to "calculated pixel value ± 2 × threshold" using a threshold determined from the quantization parameters. This prevents excessive smoothing.

[0105] Figure 9 is a conceptual diagram illustrating the block boundaries where deblocking filtering is performed. Figure 10 is a conceptual diagram showing an example of a Bs value.

[0106] The block boundaries on which deblocking filtering is performed are, for example, the boundaries of the PU (Prediction Unit) or TU (Transform Unit) of an 8x8 pixel block, as shown in Figure 9. Deblocking filtering can be performed in units of 4 rows or 4 columns. First, for blocks P and Q shown in Figure 9, the Bs (Boundary Strength) value is determined as shown in Figure 10.

[0107] According to the Bs value in Figure 10, it is determined whether or not to perform deblocking filtering of different strengths, even for block boundaries belonging to the same image. Deblocking filtering is performed on the color difference signal when the Bs value is 2. Deblocking filtering is performed on the luminance signal when the Bs value is 1 or greater and predetermined conditions are met. These predetermined conditions may be set in advance. Note that the criteria for determining the Bs value are not limited to those shown in Figure 10 and may be determined based on other parameters.

[0108] [Prediction Processing Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] Figure 11 is a flowchart showing an example of processing performed in the prediction processing unit of the encoding device 100. The prediction processing unit consists of all or some of the components of the intra-prediction unit 124, the inter-prediction unit 126, and the prediction control unit 128.

[0109] The prediction processing unit generates a predicted image of the current block (step Sb_1). This predicted image is also called a predicted signal or predicted block. Predicted signals include, for example, intra-predicted signals or inter-predicted signals. Specifically, the prediction processing unit generates a predicted image of the current block using the reconstructed image already obtained by generating predicted blocks, difference blocks, coefficient blocks, difference blocks, and decoded image blocks.

[0110] The reconstructed image may be, for example, the image of the reference picture, or it may be the image of the encoded block within the current picture, which is the picture containing the current block. The encoded block within the current picture may be, for example, the adjacent block of the current block.

[0111] Figure 12 is a flowchart showing another example of processing performed in the prediction processing unit of the encoding device 100.

[0112] The prediction processing 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, second, and third methods are different methods for generating predicted images, and may be, for example, an interpretation method, an intraprediction method, and other prediction methods. These prediction methods may use the reconstructed images described above.

[0113] Next, the prediction processing unit selects one of the multiple prediction images generated in steps Sc_1a, Sc_1b, and Sc_1c (step Sc_2). This selection of a prediction image, i.e., the selection of a method or mode to obtain the final prediction image, may be based on the cost of each generated prediction image. Alternatively, the selection of the prediction image may be based on the parameters used in the coding process. The coding device 100 may signal information to identify the selected prediction image, method, or mode into a coded signal (also called a coded bitstream). This information may be, for example, a flag. This allows the decoding device to generate a prediction image according to the method or mode selected by the coding device 100 based on this information. In the example shown in Figure 12, the prediction processing unit selects one of the prediction images after generating prediction images for each method. However, the prediction processing unit may select a method or mode based on the parameters used in the coding process described above before generating those prediction images, and then generate the prediction image according to that method or mode.

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

[0115] Figure 13 is a flowchart showing another example of processing performed in the prediction processing unit of the encoding device 100.

[0116] First, the prediction processing unit generates a predicted image using intra-prediction (step Sd_1a), and then generates a predicted image using inter-prediction (step Sd_1b). The predicted image generated by intra-prediction is also called the intra-prediction image, and the predicted image generated by inter-prediction is also called the inter-prediction image.

[0117] Next, the prediction processing unit evaluates the intra-predicted image and the inter-predicted image (step Sd_2). Cost may be used in this evaluation. That is, the prediction processing unit calculates the cost C of the intra-predicted image and the inter-predicted image. This cost C can be calculated using the formula of the RD optimization model, for example, C = D + λ × R. In this formula, D is the coding distortion of the predicted image, which can be expressed as, for example, the sum of the absolute differences between the pixel values ​​of the current block and the pixel values ​​of the predicted image. R is the generated code amount of the predicted image, which specifically is the code amount required to encode motion information and other data for generating the predicted image. λ is, for example, a Lagrange multiplier.

[0118] The prediction processing unit then selects the prediction image with the smallest cost C from the intra-predicted image and inter-predicted image as the final prediction image for the current block (step Sd_3). In other words, a prediction method or mode for generating the prediction image for the current block is selected.

[0119] [Intra Prediction Unit] The intra-prediction unit 124 generates a prediction signal (intra-prediction signal) by performing intra-prediction (also called in-screen prediction) of the current block by referring to the block in the current picture stored in the block memory 118. Specifically, the intra-prediction unit 124 generates an intra-prediction signal by performing intra-prediction by referring to samples (e.g., luminance values, color difference values) of blocks adjacent to the current block, and outputs the intra-prediction signal to the prediction control unit 128.

[0120] For example, the intra-prediction unit 124 performs intra-prediction using one of a predetermined set of intra-prediction modes. The set of intra-prediction modes typically includes one or more non-directional prediction modes and multiple directional prediction modes. The predetermined set of modes may be predetermined.

[0121] One or more non-directional prediction modes include, for example, the Planar prediction mode and DC prediction mode as defined in the H.265 / HEVC standard.

[0122] Multiple directional prediction modes include, for example, the 33 directional prediction modes defined in the H.265 / HEVC standard. Note that multiple directional prediction modes may also include 32 additional directional prediction modes (a total of 65 directional prediction modes). Figure 14 is a conceptual diagram showing all 67 intra-prediction modes (2 non-directional prediction modes and 65 directional prediction modes) that can be used 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 2 non-directional prediction modes are not shown in Figure 14).

[0123] In various processing examples, luminance blocks may be referenced in the intra-prediction of chrominance blocks. That is, the chrominance components of the current block may be predicted based on the luminance components of the current block. Such intra-prediction is sometimes called CCLM (cross-component linear model) prediction. Such an intra-prediction mode for chrominance blocks that references luminance blocks (e.g., called CCLM mode) may be added as one of the intra-prediction modes for chrominance blocks.

[0124] The intra-prediction unit 124 may correct the pixel values ​​after intra-prediction based on the gradient of the horizontal / vertical reference pixels. Intra-prediction with such correction is sometimes called PDPC (position dependent intra-prediction combination). Information indicating whether or not PDPC is applied (for example, called a PDPC flag) is usually signaled at the CU level. However, the signaling of this information is not limited to the CU level and may be at other levels (for example, sequence level, picture level, slice level, tile level, or CTU level).

[0125] [International Prediction Department] The inter-prediction unit 126 generates a prediction signal (inter-prediction signal) by performing inter-prediction (also called inter-screen prediction) of the current block by referring 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 the current sub-block within the current block (e.g., a 4x4 block). For example, the inter-prediction unit 126 performs motion estimation within the reference picture for the current block or current sub-block and finds the reference block or sub-block that best matches that current block or current sub-block. Then, the inter-prediction unit 126 obtains motion information (e.g., a motion vector) that compensates for the movement or change from the reference block or sub-block to the current block or sub-block. Based on that motion information, the inter-prediction unit 126 performs motion compensation (or motion prediction) and generates an inter-prediction signal for the current block or sub-block. The inter-prediction unit 126 outputs the generated inter-prediction signal to the prediction control unit 128.

[0126] The motion information used for motion compensation may be signaled as an interpretation signal in various forms. For example, the motion vector may be signaled. As another example, the difference between the motion vector and the predicted motion vector (motion vector predictor) may be signaled.

[0127] [Basic flow of interpretation] Figure 15 is a flowchart illustrating an example of the basic flow of interpretation prediction.

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

[0129] Here, the interpretation unit 126 generates a predicted image by determining the motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). The interpretation unit 126 also determines the MV by selecting a candidate motion vector (candidate MV) (step Se_1) and deriving the MV (step Se_2). The selection of a candidate MV is performed, for example, by selecting at least one candidate MV from a list of candidate MVs. In the derivation of the MV, the interpretation unit 126 may determine the selected at least one candidate MV as the MV of the current block by further selecting at least one candidate MV from the at least one candidate MV. Alternatively, the interpretation unit 126 may determine the MV of the current block by searching the region of the reference picture indicated by each of the selected at least one candidate MVs. This search of the region of the reference picture may be called motion estimation.

[0130] Furthermore, in the example described above, steps Se_1 to Se_3 are performed by the interpretation unit 126, but processing such as step Se_1 or step Se_2 may be performed by other components included in the encoding device 100.

[0131] [Flowchart for deriving motion vectors] Figure 16 is a flowchart showing an example of motion vector derivation.

[0132] The interpretation unit 126 derives the MV of the current block in a mode that encodes motion information (e.g., MV). In this case, for example, motion information is encoded as prediction parameters and converted into a signal. That is, the encoded motion information is included in the encoded signal (also called an encoded bitstream).

[0133] Alternatively, the interpretation unit 126 derives MV in a mode that does not encode motion information. In this case, motion information is not included in the encoded signal.

[0134] Here, the modes for MV derivation may include the normal intermode, merge mode, FRUC mode, and affine mode, as described later. Among these modes, the modes that encode motion information include the normal intermode, merge mode, and affine mode (specifically, the affine intermode and affine merge mode). Note that the motion information may include not only the MV but also the predicted motion vector selection information, as described later. Modes that do not encode motion information include the FRUC mode, etc. The interpretation unit 126 selects a mode from these multiple modes for deriving the MV of the current block and derives the MV of the current block using the selected mode.

[0135] Figure 17 is a flowchart showing another example of motion vector derivation.

[0136] The interpretation unit 126 derives the MV of the current block in a mode that encodes the differential MV. In this case, for example, the differential MV is encoded as a prediction parameter and converted into a signal. That is, the encoded differential MV is included in the encoded signal. This differential MV is the difference between the MV of the current block and its predicted MV.

[0137] Alternatively, the interpretation unit 126 derives MV in a mode that does not encode the differential MV. In this case, the encoded differential MV is not included in the encoded signal.

[0138] As mentioned above, the modes for MV derivation include the normal inter, merge mode, FRUC mode, and affine mode, which will be described later. Of these modes, the modes that encode differential MV include the normal inter mode and affine mode (specifically, affine inter mode). Modes that do not encode differential MV include the FRUC mode, merge mode, and affine mode (specifically, affine merge mode). The inter prediction unit 126 selects a mode from these multiple modes to derive the MV of the current block, and uses the selected mode to derive the MV of the current block.

[0139] [Flowchart for deriving motion vectors] Figure 18 is a flowchart illustrating another example of motion vector derivation. There are several modes for MV derivation, i.e., interpretation modes, which can be broadly divided into modes that encode differential MVs and modes that do not encode differential motion vectors. Modes that do not encode differential MVs include merge mode, FRUC mode, and affine mode (specifically, affine merge mode). Details of these modes will be described later, but simply put, merge mode derives the MV of the current block by selecting motion vectors from surrounding encoded blocks, and FRUC mode derives the MV of the current block by performing a search between encoded regions. Affine mode assumes an affine transformation and derives the motion vectors of each of the multiple subblocks that make up the current block as the MV of the current block.

[0140] Specifically, as shown in the figure, the interpretation unit 126 derives the motion vector by merge mode (Sf_2) when the interpretation mode information indicates 0 (0 in Sf_1). The interpretation unit 126 also derives the motion vector by FRUC mode (Sf_3) when the interpretation mode information indicates 1 (1 in Sf_1). The interpretation unit 126 also derives the motion vector by affine mode (specifically, affine merge mode) when the interpretation mode information indicates 2 (2 in Sf_1) (Sf_4). The interpretation unit 126 also derives the motion vector by a mode that encodes the difference MV (for example, normal intermode) when the interpretation mode information indicates 3 (3 in Sf_1) (Sf_5).

[0141] [MV Derivation > Normal Intermode] The normal intermode is an interpretation mode that derives the MV of the current block based on blocks similar to the image of the current block, using the region of the reference picture indicated by the candidate MV. In this normal intermode, the differential MV is also encoded.

[0142] Figure 19 is a flowchart showing an example of inter-mode prediction.

[0143] The interpretation unit 126 first obtains multiple candidate MVs for the current block based on information such as the MVs of multiple encoded blocks surrounding the current block in time or space (step Sg_1). In other words, the interpretation unit 126 creates a candidate MV list.

[0144] Next, the interpretation unit 126 extracts N candidate MVs (where N is an integer greater than or equal to 2) from among the multiple candidate MVs obtained in step Sg_1 as predicted motion vector candidates (also called predicted MV candidates) according to a predetermined priority order (step Sg_2). Note that this priority order may be predetermined for each of the N candidate MVs.

[0145] Next, the interpretation unit 126 selects one of the N predicted motion vector candidates as the predicted motion vector (also called predicted MV) for the current block (step Sg_3). At this time, the interpretation unit 126 encodes the predicted motion vector selection information for identifying the selected predicted motion vector into a stream. The stream is the encoded signal or encoded bitstream described above.

[0146] Next, the interpretation unit 126 refers to the encoded reference picture and derives the MV of the current block (step Sg_4). At this time, the interpretation unit 126 further encodes the difference between the derived MV and the predicted motion vector as the difference MV into the stream. The encoded reference picture is a picture consisting of multiple blocks that have been reconstructed after encoding.

[0147] Finally, the interpretation unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sg_5). The predicted image is the interpretation signal described above.

[0148] Furthermore, information indicating the interprediction mode used to generate the predicted image (the normal intermode in the example above), which is included in the encoded signal, is encoded, for example, as a prediction parameter.

[0149] The candidate MV list may be the same as the list used in other modes. Furthermore, processing related to the candidate MV list may be applied to processing related to lists used in other modes. This processing related to the candidate MV list may include, for example, extracting or selecting candidate MVs from the candidate MV list, rearranging candidate MVs, or deleting candidate MVs.

[0150] [MV Derivation > Merge Mode] Merge mode is an interpretation mode that derives an MV by selecting a candidate MV from a list of candidate MVs as the MV of the current block.

[0151] Figure 20 is a flowchart showing an example of interpretation using merge mode.

[0152] The interpretation unit 126 first obtains multiple candidate MVs for the current block based on information such as the MVs of multiple encoded blocks surrounding the current block in time or space (step Sh_1). In other words, the interpretation unit 126 creates a candidate MV list.

[0153] Next, the interpretation unit 126 derives the MV of the current block by selecting one candidate MV from among the multiple candidate MVs obtained in step Sh_1 (step Sh_2). At this time, the interpretation unit 126 encodes MV selection information to identify the selected candidate MV into a stream.

[0154] Finally, the interpretation unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sh_3).

[0155] Furthermore, information indicating the inter-prediction mode (the merge mode in the example above) used to generate the predicted image, which is included in the encoded signal, is encoded, for example, as a prediction parameter.

[0156] Figure 21 is a conceptual diagram illustrating an example of the process of deriving the motion vector of the current picture using merge mode.

[0157] First, a list of predicted MVs is generated, containing registered candidates for predicted MVs. Candidates for predicted MVs include spatially adjacent predicted MVs, which are the MVs of multiple encoded blocks located spatially around the target block; temporally adjacent predicted MVs, which are the MVs of nearby blocks projected onto the target block's position in the encoded reference picture; combined predicted MVs, which are generated by combining the MV values ​​of spatially adjacent predicted MVs and temporally adjacent predicted MVs; and zero predicted MVs, which are MVs with a value of zero.

[0158] Next, one predicted MV is selected from the multiple predicted MVs registered in the predicted MV list to determine it as the MV for the target block.

[0159] Furthermore, the variable-length coding unit encodes the merge_idx signal, which indicates which predicted MV was selected, by writing it to a stream.

[0160] Note that the predicted MVs registered in the predicted MV list explained in Figure 21 are just examples, and the number of predicted MVs may differ from the number shown in the figure, the configuration may not include some of the types of predicted MVs shown in the figure, or it may include predicted MVs other than those shown in the figure.

[0161] The final MV may be determined by performing the DMVR (decoder motion vector refinement) process described later, using the MV of the target block derived by merge mode.

[0162] The candidates for the predicted MV are the candidate MVs mentioned above, and the predicted MV list is the candidate MV list mentioned above. The candidate MV list may also be referred to as the candidate list. Furthermore, merge_idx is the MV selection information.

[0163] [MV Derivation > FRUC Mode] Motion information may be derived on the decoding side without being signaled from the encoding side. As mentioned above, the merge mode specified in the H.265 / HEVC standard may be used. Alternatively, motion information may be derived by performing motion search on the decoding side, for example. In this embodiment, motion search is performed on the decoding side without using the pixel values ​​of the current block.

[0164] Here, we will explain the mode in which motion detection is performed on the decoding device side. This mode in which motion detection is performed on the decoding device side is sometimes called PMMVD (pattern matched motion vector derivation) mode or FRUC (frame rate up-conversion) mode.

[0165] An example of FRUC processing is shown in flowchart form in Figure 22. First, a list of multiple candidates (i.e., a candidate MV list, which may be the same as the merge list) is generated by referencing the motion vectors of encoded blocks spatially or temporally adjacent to the current block, each having a predicted motion vector (MV) (step Si_1). Next, the best candidate MV is selected from the multiple candidate MVs registered in the candidate MV list (step Si_2). For example, an evaluation value is calculated for each candidate MV included in the candidate MV list, and one candidate MV is selected based on the evaluation value. Then, a motion vector for the current block is derived based on the motion vector of the selected candidate (step Si_4). Specifically, for example, the motion vector of the selected candidate (best candidate MV) 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 the area surrounding the position in the reference picture corresponding to the motion vector of the selected candidate. In other words, a search is performed in the area surrounding the best candidate MV using pattern matching and evaluation values ​​in the reference picture. If an MV with a better evaluation value is found, the best candidate MV may be updated to that MV and set as the final MV for the current block. It is also possible to configure the system so that it does not perform the process of updating to an MV with a better evaluation value.

[0166] Finally, the interpretation unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Si_5).

[0167] The same processing method can be used when processing at the sub-block level.

[0168] The evaluation value may be calculated by various methods. For example, the reconstructed image of a region in a reference picture corresponding to a motion vector may be compared with the reconstructed image of a predetermined region (which may be, for example, a region in another reference picture or a region in an adjacent block of the current picture, as shown below). The predetermined region may be set in advance.

[0169] Furthermore, the difference in pixel values ​​between the two reconstructed images may be calculated and used as the evaluation value for the motion vector. Alternatively, the evaluation value may be calculated using other information in addition to the difference value.

[0170] Next, we will explain in detail an example of pattern matching. First, one candidate MV included in the candidate MV list (e.g., merge list) is selected as the starting point for the search using pattern matching. For example, first pattern matching or second pattern matching may be used. First pattern matching and second pattern matching are sometimes called bilateral matching and template matching, respectively.

[0171] [MV Derivation > FRUC > Bilateral Matching] In the first pattern matching, pattern matching is performed between two blocks in two different reference pictures that are aligned with the motion trajectory of the current block. Therefore, in the first pattern matching, a region in another reference picture aligned with the motion trajectory of the current block is used as a predetermined region for calculating the evaluation value of the candidate described above. This predetermined region may be set in advance.

[0172] Figure 23 is a conceptual diagram illustrating an example of first pattern matching (bilateral matching) between two blocks in two reference pictures along a motion trajectory. As shown in Figure 23, in first pattern matching, two motion vectors (MV0, MV1) are derived by searching for the most matching pair among two pairs of blocks in two different reference pictures (Ref0, Ref1) that are along the motion trajectory of the current block. Specifically, for the current block, the difference between the reconstructed image at a specified position in the first encoded reference picture (Ref0) specified by the candidate MV and the reconstructed image at a specified position in the second encoded reference picture (Ref1) specified by a symmetric MV scaled by the display time interval of the candidate MV is derived, and an evaluation value is calculated using the obtained difference value. It is possible to select the candidate MV with the best evaluation value among multiple candidate MVs as the final MV, which can yield good results.

[0173] Under the assumption of a continuous motion trajectory, the motion vector (MV0, MV1) pointing to two reference blocks is proportional to the temporal distance (TD0, TD1) between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, if the current picture is temporally located between the two reference pictures and the temporal distances from the current picture to the two reference pictures are equal, then the first pattern matching derives a mirror-symmetric bidirectional motion vector.

[0174] [MV Derivation > FRUC > Template Matching] In the second pattern matching (template matching), pattern matching is performed between the template in the current picture (blocks adjacent to the current block in the current picture (e.g., blocks above and / or to the left)) and the blocks in the reference picture. Therefore, in the second pattern matching, the blocks adjacent to the current block in the current picture are used as a predetermined area for calculating the evaluation value of the candidates mentioned above.

[0175] Figure 24 is a conceptual diagram illustrating an example of pattern matching (template matching) between a template in the current picture and a block in the reference picture. As shown in Figure 24, in the second pattern matching, the motion vector of the current block is derived by searching in the reference picture (Ref0) for the block that best matches the block adjacent to the current block in the current picture (Cur Pic). Specifically, for the current block, the difference between the reconstructed image of both or either of the left-adjacent and top-adjacent encoded regions and the reconstructed image at the equivalent position in the encoded reference picture (Ref0) specified by the candidate MV is derived, and an evaluation value is calculated using the obtained difference value. Among the multiple candidate MVs, the candidate MV with the best evaluation value is selected as the best candidate MV.

[0176] Information indicating whether or not to apply such a FRUC mode (e.g., called a FRUC flag) may be signaled at the CU level. Furthermore, if FRUC mode is applied (e.g., the FRUC flag is true), information indicating the applicable pattern matching method (first pattern matching or second pattern matching) may be signaled at the CU level. Note that the signaling of this information is not limited to the CU level, but may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).

[0177] [MV Derivation > Affine Mode] Next, we will describe an affine mode in which motion vectors are derived at the sub-block level based on the motion vectors of multiple adjacent blocks. This mode is sometimes called the affine motion compensation prediction mode.

[0178] Figure 25A is a conceptual diagram illustrating an example of deriving a subblock-level motion vector based on the motion vectors of multiple adjacent blocks. In Figure 25A, the current block contains 16 4x4 subblocks. Here, the motion vector v0 of the upper left corner control point of the current block is derived based on the motion vectors of the adjacent blocks, and similarly, the motion vector v1 of the upper right corner control point of the current block is derived based on the motion vectors of the adjacent subblocks. Then, the two motion vectors v0 and v1 may be projected by the following equation (1A), and the motion vector (v) of each subblock within the current block is derived. x ,v y ) may be derived.

[0179]

number

[0180] Here, x and y represent the horizontal and vertical positions of the subblock, respectively, and w represents a predetermined weighting coefficient. The predetermined weighting coefficient may be determined in advance.

[0181] Information indicating such affine modes (e.g., called an affine flag) may be signaled at the CU level. However, the signaling of this information indicating affine modes is not limited to the CU level, but may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).

[0182] Furthermore, such affine modes may include several modes in which the method of deriving the motion vectors of the upper-left and upper-right corner control points differs. For example, there are two affine modes: the affine inter (also called the affine normal inter) mode and the affine merge mode.

[0183] [MV Derivation > Affine Mode] Figure 25B is a conceptual diagram illustrating an example of deriving motion vectors for subblock units in an affine mode with three control points. In Figure 25B, the current block contains 16 4x4 subblocks. Here, the motion vector v0 of the upper left corner control point of the current block is derived based on the motion vectors of adjacent blocks, and similarly, the motion vector v1 of the upper right corner control point of the current block is derived based on the motion vectors of adjacent blocks, and the motion vector v2 of the lower left corner control point of the current block is derived based on the motion vectors of adjacent blocks. Then, the three motion vectors v0, v1 and v2 may be projected by the following equation (1B), and the motion vector (v) of each subblock within the current block is derived. x ,v y ) may be derived.

[0184]

number

[0185] Here, x and y represent the horizontal and vertical positions of the subblock center, respectively, w represents the width of the current block, and h represents the height of the current block.

[0186] Affine modes with different numbers of control points (e.g., two and three) may be switched and signaled at the CU level. Information indicating the number of control points for the affine mode used at the CU level may also be signaled at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).

[0187] Furthermore, an affine mode having three control points may include several modes in which the method of deriving the motion vectors of the upper-left, upper-right, and lower-left corner control points differs. For example, there are two affine modes: the affine inter (also called the affine normal inter) mode and the affine merge mode.

[0188] [MV Derivation > Affine Merge Mode] Figures 26A, 26B, and 26C are conceptual diagrams illustrating the affine merge mode.

[0189] In affine merge mode, as shown in Figure 26A, the predicted motion vectors for each control point of the current block are calculated based on multiple motion vectors corresponding to blocks encoded in affine mode among the encoded blocks adjacent to the current block: Block A (left), Block B (top), Block C (upper right), Block D (lower left), and Block E (upper left). Specifically, these blocks are examined in the order of encoded Block A (left), Block B (top), Block C (upper right), Block D (lower left), and Block E (upper left), and the first valid block encoded in affine mode is identified. Based on the multiple motion vectors corresponding to this identified block, the predicted motion vectors for the control points of the current block are calculated.

[0190] For example, as shown in Figure 26B, if block A, which is adjacent to the left of the current block, is encoded in affine mode with two control points, then motion vectors v3 and v4 are derived projected onto the upper-left and upper-right corners of the encoded block containing block A. Then, from the derived motion vectors v3 and v4, the predicted motion vector v0 for the upper-left corner control point and the predicted motion vector v1 for the upper-right corner control point of the current block are calculated.

[0191] For example, as shown in Figure 26C, if block A, which is adjacent to the left of the current block, is encoded in affine mode with three control points, then motion vectors v3, v4, and v5 are derived projected onto the upper left, upper right, and lower left corners of the encoded block containing block A. From these derived motion vectors v3, v4, and v5, the predicted motion vector v0 for the upper left corner control point of the current block, the predicted motion vector v1 for the upper right corner control point, and the predicted motion vector v2 for the lower left corner control point are calculated.

[0192] Furthermore, this method for deriving predicted motion vectors may also be used to derive the predicted motion vectors for each control point of the current block in step Sj_1 of Figure 29, which will be described later.

[0193] Figure 27 is a flowchart showing an example of the affine merge mode.

[0194] In affine merge mode, as shown in the figure, the interpretation unit 126 first derives the predicted MV for each control point 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 25A, or the upper left, upper right, and lower left corners of the current block, as shown in Figure 25B.

[0195] In other words, as shown in Figure 26A, the interpretation unit 126 examines these blocks in the order of encoded block A (left), block B (top), block C (upper right), block D (lower left), and block E (upper left), and identifies the first valid block encoded in affine mode.

[0196] Then, if block A is identified and block A has two control points, as shown in Figure 26B, the interpretation unit 126 calculates the motion vector v0 of the upper left corner control point and the motion vector v1 of the upper right corner control point of the current block from the motion vectors v3 and v4 of the upper left and upper right corners of the encoded block containing block A. For example, the interpretation unit 126 calculates the predicted motion vector v0 of the upper left corner control point and the predicted motion vector v1 of the upper right corner control point of the current block by projecting the motion vectors v3 and v4 of the upper left and upper right corners of the encoded block onto the current block.

[0197] Alternatively, if block A is identified and block A has three control points, as shown in Figure 26C, the interpretation unit 126 calculates the motion vector v0 of the upper left corner control point, the motion vector v1 of the upper right corner control point, and the motion vector v2 of the lower left corner control point of the current block from the motion vectors v3, v4, and v5 of the upper left, upper right, and lower left corners of the encoded block containing block A. For example, the interpretation unit 126 calculates the predicted motion vector v0 of the upper left corner control point, the predicted motion vector v1 of the upper right corner control point, and the motion vector v2 of the lower left corner control point of the current block by projecting the motion vectors v3, v4, and v5 of the upper left, upper right, and lower left corners of the encoded block onto the current block.

[0198] Next, the interpretation unit 126 performs motion compensation for each of the multiple subblocks contained in the current block. That is, for each of the multiple subblocks, the interpretation unit 126 calculates the motion vector of that subblock as an affine MV using two predicted motion vectors v0 and v1 and equation (1A) described above, or three predicted motion vectors v0, v1 and v2 and equation (1B) described above (step Sk_2). Then, the interpretation unit 126 performs motion compensation for that subblock using these affine MVs and the encoded reference picture (step Sk_3). As a result, motion compensation is performed on the current block, and a predicted image of that current block is generated.

[0199] [MV Derivation > Affine Intermode] Figure 28A is a conceptual diagram illustrating an affine intermode with two control points.

[0200] In this affine intermode, as shown in Figure 28A, a motion vector selected from the motion vectors of the encoded blocks A, B, and C adjacent to the current block is used as the predicted motion vector v0 for the control point at the upper left corner of the current block. Similarly, a motion vector selected from the motion vectors of the encoded blocks D and E adjacent to the current block is used as the predicted motion vector v1 for the control point at the upper right corner of the current block.

[0201] Figure 28B is a conceptual diagram illustrating an affine intermode with three control points.

[0202] In this affine intermode, as shown in Figure 28B, the motion vector selected from the motion vectors of the encoded blocks A, B, and C adjacent to the current block is used as the predicted motion vector v0 for the control point at the upper left corner of the current block. Similarly, the motion vector selected from the motion vectors of the encoded blocks D and E adjacent to the current block is used as the predicted motion vector v1 for the control point at the upper right corner of the current block. Furthermore, the motion vector selected from the motion vectors of the encoded blocks F and G adjacent to the current block is used as the predicted motion vector v2 for the control point at the lower left corner of the current block.

[0203] Figure 29 is a flowchart showing an example of an affine intermode.

[0204] As shown in the figure, in affine intermode, the interpretation unit 126 first derives the predicted MV(v0,v1) or (v0,v1,v2) for each of two or three control points of the current block (step Sj_1). The control points are the upper left corner, upper right corner, or lower left corner of the current block, as shown in Figure 25A or Figure 25B.

[0205] In other words, the interpretation unit 126 derives the predicted motion vector (v0,v1) or (v0,v1,v2) of the control point of the current block by selecting the motion vector of one of the encoded blocks near each control point of the current block shown in Figure 28A or Figure 28B. At this time, the interpretation unit 126 encodes predicted motion vector selection information into a stream to identify the two selected motion vectors.

[0206] For example, the interpretation unit 126 may determine, using cost evaluation or the like, which block's motion vector to select as the predicted motion vector for the control point from the encoded blocks adjacent to the current block, and write a flag to the bitstream indicating which predicted motion vector was selected.

[0207] Next, the interpretation unit 126 performs motion search (steps Sj_3 and Sj_4) while updating the predicted motion vectors selected or derived in step Sj_1 (step Sj_2). That is, the interpretation unit 126 calculates the motion vectors of each subblock corresponding to the updated predicted motion vectors as affine MVs using the above-mentioned equation (1A) or equation (1B) (step Sj_3). Then, the interpretation unit 126 performs motion compensation for each subblock using these affine MVs and encoded reference pictures (step Sj_4). As a result, in the motion search loop, the interpretation unit 126 determines, for example, the predicted motion vector that yields the smallest cost as the motion vector of the control point (step Sj_5). At this time, the interpretation unit 126 further encodes the difference between the determined MV and the predicted motion vector as a difference MV into a stream.

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

[0209] [MV Derivation > Affine Intermode] When switching between affine modes with different numbers of control points (e.g., two and three) at the CU level to generate signals, the number of control points may differ between the encoded block and the current block. Figures 30A and 30B are conceptual diagrams illustrating how to derive the control point prediction vector when the number of control points differs between the encoded block and the current block.

[0210] For example, as shown in Figure 30A, if the current block has three control points at the upper left corner, upper right corner, and lower left corner, and block A adjacent to the left of the current block is encoded in affine mode with two control points, then motion vectors v3 and v4 projected onto the upper left and upper right corner positions of the encoded block containing block A are derived. Then, from the derived motion vectors v3 and v4, the predicted motion vector v0 for the upper left corner control point and the predicted motion vector v1 for the upper right corner control point of the current block are calculated. Furthermore, from the derived motion vectors v0 and v1, the predicted motion vector v2 for the lower left corner control point is calculated.

[0211] For example, as shown in Figure 30B, if the current block has two control points, the upper left corner and the upper right corner, and block A adjacent to the left of the current block is encoded in affine mode with three control points, then motion vectors v3, v4, and v5 are derived projected onto the upper left, upper right corner, and lower left corner positions of the encoded block containing block A. Then, from the derived motion vectors v3, v4, and v5, the predicted motion vector v0 for the upper left corner control point of the current block and the predicted motion vector v1 for the upper right corner control point are calculated.

[0212] This method for deriving predicted motion vectors may also be used to derive the predicted motion vectors for each control point of the current block in step Sj_1 of Figure 29.

[0213] [MV Derivation > DMVR] Figure 31A is a flowchart showing the relationship between merge mode and DMVR.

[0214] The interpretation unit 126 derives the motion vector of the current block in merge mode (step Sl_1). Next, the interpretation unit 126 determines whether or not to perform a motion vector search, i.e., a motion search (step Sl_2). If the interpretation unit 126 determines not to perform a motion search (No in step Sl_2), it determines the motion vector derived in step Sl_1 as the final motion vector for the current block (step Sl_4). In other words, in this case, the motion vector of the current block is determined in merge mode.

[0215] On the other hand, if it is determined in step Sl_1 to perform a motion search (Yes in step Sl_2), the interpretation unit 126 derives the final motion vector for the current block by searching the surrounding region of the reference picture indicated by the motion vector derived in step Sl_1 (step Sl_3). In other words, in this case, the motion vector of the current block is determined by the DMVR.

[0216] Figure 31B is a conceptual diagram illustrating an example of DMVR processing for determining MV.

[0217] First, the optimal MVP set for the current block (for example, in merge mode) is designated as the candidate MV. Then, according to the candidate MV(L0), reference pixels are identified from the first reference picture (L0), which is an encoded picture in the L0 direction. Similarly, according to the candidate MV(L1), reference pixels are identified from the second reference picture (L1), which is an encoded picture in the L1 direction. A template is generated by taking the average of these reference pixels.

[0218] Next, using the template, search the peripheral regions of the candidate MVs of the first reference picture (L0) and the second reference picture (L1) respectively, and determine the MV with the minimum cost as the final MV. Here, the cost value may be calculated using, for example, the difference value between each pixel value of the template and each pixel value of the search region, and the candidate MV value, etc.

[0219] Typically, in the encoding device and the decoding device described later, the configurations and operations of the processes described here are basically common.

[0220] Even if it is not the process example itself described here, any process may be used as long as it is a process capable of searching the periphery of the candidate MV to derive the final MV.

[0221] [Motion Compensation > BIO / OBMC] In motion compensation, there are modes for generating a predicted image and correcting the predicted image. Those modes are, for example, BIO and OBMC described later.

[0222] FIG. 32 is a flowchart showing an example of the generation of a predicted image.

[0223] The inter prediction unit 126 generates a predicted image (step Sm_1), and corrects the predicted image by, for example, any of the above-described modes (step Sm_2).

[0224] FIG. 33 is a flowchart showing another example of the generation of a predicted image.

[0225] The interpretation unit 126 determines the motion vector of the current block (step Sn_1). Next, the interpretation unit 126 generates a predicted image (step Sn_2) and determines whether or not to perform correction processing (step Sn_3). If the interpretation unit 126 determines that correction processing should be performed (Yes in step Sn_3), it generates the final predicted image by correcting the predicted image (step Sn_4). On the other hand, if the interpretation unit 126 determines that no correction processing should be performed (No in step Sn_3), it outputs the predicted image as the final predicted image without correction (step Sn_5).

[0226] Furthermore, motion compensation includes a mode that corrects brightness when generating the predicted image. One such mode is the LIC, which will be discussed later.

[0227] Figure 34 is a flowchart showing another example of predictive image generation.

[0228] The interpretation unit 126 derives the motion vector of the current block (step So_1). Next, the interpretation unit 126 determines whether or not to perform brightness correction processing (step So_2). If the interpretation unit 126 determines to perform brightness correction processing (Yes in step So_2), it generates a predicted image while performing brightness correction (step So_3). In other words, the predicted image is generated by LIC. On the other hand, if the interpretation unit 126 determines not to perform brightness correction processing (No in step So_2), it generates a predicted image using normal motion compensation without performing brightness correction (step So_4).

[0229] [Motion Compensation > OBMC] Interpretation signals may be generated using not only the motion information of the current block obtained through motion search, but also the motion information of adjacent blocks. Specifically, interpretation signals may be generated at the sub-block level within the current block by weighted addition of a prediction signal based on motion information obtained through motion search (within the reference picture) and a prediction signal based on motion information of adjacent blocks (within the current picture). Such interpretation (motion compensation) is sometimes called OBMC (overlapped block motion compensation).

[0230] In OBMC mode, information indicating the size of subblocks for OBMC (e.g., called OBMC block size) may be signaled at the sequence level. Furthermore, information indicating whether or not to apply OBMC mode (e.g., called OBMC flag) may be signaled at the CU level. Note that the signaling levels of this information are not limited to the sequence level and CU level, but may be other levels (e.g., picture level, slice level, tile level, CTU level, or subblock level).

[0231] Let's explain an example of the OBMC mode in more detail. Figures 35 and 36 are flowcharts and conceptual diagrams illustrating the overview of the predictive image correction process using OBMC processing.

[0232] First, as shown in Figure 36, a predicted image (Pred) is obtained using normal motion compensation with the motion vector (MV) assigned to the current block to be processed. In Figure 36, the arrow "MV" points to the reference picture, indicating what the current block of the current picture is referencing in order to obtain the predicted image.

[0233] Next, the motion vector (MV_L) already derived for the encoded left-adjacent block is applied (reused) to the block to be encoded to obtain the predicted image (Pred_L). The motion vector (MV_L) is indicated by the arrow "MV_L" pointing from the current block to the reference picture. Then, the first correction of the predicted image is performed by superimposing the two predicted images, Pred and Pred_L. This has the effect of blending the boundaries between adjacent blocks.

[0234] Similarly, the motion vector (MV_U) already derived for the encoded upper adjacent block is applied (reused) to the block to be encoded to obtain the predicted image (Pred_U). The motion vector (MV_U) is indicated by an arrow "MV_U" pointing from the current block to the reference picture. Then, the predicted image Pred_U is superimposed on the predicted image that has undergone the first correction (e.g., Pred and Pred_L) to perform a second correction of the predicted image. This has the effect of blending the boundaries between adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block, with the boundaries with adjacent blocks blended (smoothed).

[0235] The above example is a two-pass correction method using left-adjacent and top-adjacent blocks, but the correction method may also be a three-pass or more-pass correction method using right-adjacent and / or bottom-adjacent blocks.

[0236] Furthermore, the area to be superimposed does not have to be the entire pixel area of ​​the block, but rather only a portion of the area near the block boundary.

[0237] Here, we have described the OBMC predictive image correction process for obtaining a single predictive image Pred by superimposing additional predictive images Pred_L and Pred_U onto a single reference picture. However, if the predictive image is corrected based on multiple reference images, the same process may be applied to each of the multiple reference pictures. In such cases, by performing OBMC image correction based on multiple reference pictures, a corrected predictive image is obtained from each reference picture, and then the final predictive image is obtained by further superimposing these multiple corrected predictive images.

[0238] In OBMC, the unit of the target block may be the prediction block unit, or it may be a subblock unit obtained by further dividing the prediction block.

[0239] One method for determining whether to apply OBMC processing is to use an obmc_flag signal, which indicates whether or not to apply OBMC processing. As a specific example, the encoding device may determine whether the target block belongs to a region with complex motion. If it belongs to a region with complex motion, the encoding device sets the obmc_flag to a value of 1 and applies OBMC processing to perform encoding. If it does not belong to a region with complex motion, it sets the obmc_flag to a value of 0 and encodes the block without applying OBMC processing. On the other hand, the decoding device decodes the obmc_flag described in the stream (e.g., compressed sequence) and switches whether or not to apply OBMC processing depending on its value to perform decoding.

[0240] In the example described above, the interpretation unit 126 generates one rectangular prediction image for the current rectangular block. However, the interpretation unit 126 may generate multiple prediction images of shapes different from rectangles for the current rectangular block, and then combine these multiple prediction images to generate the final rectangular prediction image. The shapes different from rectangles may be, for example, triangles.

[0241] FIG. 37 is a conceptual diagram for explaining the generation of two triangular prediction images.

[0242] The inter prediction unit 126 generates a prediction image of a triangle by performing motion compensation on the first partition of the triangle in the current block using the first MV of the first partition. Similarly, the inter prediction unit 126 generates a prediction image of a triangle by performing motion compensation on the second partition of the triangle in the current block using the second MV of the second partition. Then, the inter prediction unit 126 generates a prediction image of a rectangle the same as the current block by combining these prediction images.

[0243] In the example shown in FIG. 37, the first partition and the second partition are each a triangle, but they may be trapezoids, and they may have different shapes from each other. Further, in the example shown in FIG. 37, the current block is composed of two partitions, but it may be composed of three or more partitions.

[0244] Also, the first partition and the second partition may overlap. That is, the first partition and the second partition may include the same pixel region. In this case, a prediction image of the current block may be generated using the prediction image in the first partition and the prediction image in the second partition.

[0245] Also, in this example, an example in which prediction images are generated by inter prediction for both of the two partitions is shown, but prediction images may be generated by intra prediction for at least one partition.

[0246] [Motion Compensation > BIO] Next, a method for deriving a motion vector will be described. First, a mode for deriving a motion vector based on a model assuming uniform linear motion will be described. This mode is sometimes called the BIO (bi - directional optical flow) mode.

[0247] Figure 38 is a conceptual diagram illustrating a model that assumes uniform linear motion. In Figure 38, (vx, vy) represents the velocity vector, and τ0 and τ1 represent the temporal distance between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1), respectively. (MVx0, MVy0) represents the motion vector corresponding to reference picture Ref0, and (MVx1, MVy1) represents the motion vector corresponding to reference picture Ref1.

[0248] In this case, under the assumption of uniform linear motion of the velocity vector (vx, vy), (MVx0, MVy0) and (MVx1, MVy1) can be expressed as (vxτ0, vyτ0) and (-vxτ1, -vyτ1), respectively, and the following optical flow equation (2) may be adopted.

[0249]

number

[0250] Here, I(k) represents the luminance value of the reference image k (k=0,1) after motion compensation. This optical flow equation shows that the sum of (i) the time derivative of the luminance value, (ii) the product of the horizontal velocity and the horizontal component of the spatial gradient of the reference image, and (iii) the product of the vertical velocity and the vertical component of the spatial gradient of the reference image is equal to zero. Based on this optical flow equation and Hermite interpolation, block-level motion vectors obtained from merge lists, etc., may be corrected on a pixel-by-pixel basis.

[0251] Furthermore, the motion vector may be derived on the decoding side using a method different from that used for deriving motion vectors based on a model that assumes uniform linear motion. For example, the motion vector may be derived on a sub-block basis based on the motion vectors of multiple adjacent blocks.

[0252] [Motion Compensation > LIC] Next, we will describe an example of a mode that generates a predicted image (prediction) using LIC (local illumination compensation) processing.

[0253] Figure 39 is a conceptual diagram illustrating an example of a predictive image generation method using brightness correction processing by LIC processing.

[0254] First, the MV is derived from the encoded reference picture to obtain the reference image corresponding to the current block.

[0255] Next, information is extracted showing how the luminance values ​​have changed between the reference picture and the current picture for the current block. This extraction is based on the luminance pixel values ​​of the encoded left adjacent reference region (peripheral reference region) and encoded upper adjacent reference region (peripheral reference region) in the current picture, and the luminance pixel values ​​at the equivalent positions in the reference picture specified by the derived MV. Then, the luminance correction parameter is calculated using the information showing how the luminance values ​​have changed.

[0256] A predicted image for the current block is generated by applying the brightness correction parameters to the reference image within the reference picture specified in MV.

[0257] Note that the shape of the peripheral reference region in Figure 39 is just one example, and other shapes may be used.

[0258] Furthermore, although this explanation describes the process of generating a predicted image from a single reference picture, the process is similar when generating predicted images from multiple reference pictures. Alternatively, the brightness correction process may be applied to each reference picture obtained from the reference picture in the same manner as described above before generating the predicted image.

[0259] One method for determining whether or not to apply LIC processing is to use a signal called lic_flag, which indicates whether or not to apply LIC processing. For example, in an encoding device, it is determined whether the current block belongs to a region where brightness changes are occurring. If it belongs to a region where brightness changes are occurring, the value of lic_flag is set to 1, and LIC processing is applied and encoding is performed. If it does not belong to a region where brightness changes are occurring, the value of lic_flag is set to 0, and encoding is performed without applying LIC processing. On the other hand, in a decoding device, the lic_flag written in the stream can be decoded, and the device may switch whether or not to apply LIC processing depending on its value before performing decoding.

[0260] Another way to determine whether to apply LIC processing is, for example, by checking whether LIC processing was applied to surrounding blocks. A specific example is, if the current block is in merge mode, the system checks whether the surrounding encoded blocks selected during the MV derivation in merge mode were encoded with LIC processing. Based on this result, the system switches whether to apply LIC processing and then performs the encoding. Note that in this example, the same process is applied to the decoding device.

[0261] The LIC processing (luminance correction processing) method was explained using Figure 39, and its details will be explained below.

[0262] First, the interpretation unit 126 derives motion vectors to obtain a reference image corresponding to the block to be encoded from a reference picture which is an encoded picture.

[0263] Next, the interpretation unit 126 extracts information indicating how the luminance values ​​have changed between the reference picture and the picture to be encoded, using the luminance pixel values ​​of the left-adjacent and upper-adjacent encoded peripheral reference regions and the luminance pixel values ​​at equivalent positions in the reference picture specified by the motion vector, and calculates luminance correction parameters. For example, let p0 be the luminance pixel value of a pixel in the peripheral reference region of the picture to be encoded, and p1 be the luminance pixel value of a pixel in the peripheral reference region of the reference picture at an equivalent position to that pixel. The interpretation unit 126 calculates coefficients A and B as luminance correction parameters to optimize A×p1+B=p0 for multiple pixels in the peripheral reference region.

[0264] Next, the interpretation unit 126 generates a predicted image for the encoding target block by performing brightness correction processing on the reference image in the reference picture specified by the motion vector using brightness correction parameters. For example, let p2 be the brightness pixel value in the reference image, and p3 be the brightness pixel value of the predicted image after brightness correction processing. The interpretation unit 126 generates the predicted image after brightness correction processing by calculating A × p2 + B = p3 for each pixel in the reference image.

[0265] Note that the shape of the surrounding reference region in Figure 39 is just one example, and other shapes may be used. Also, only a part of the surrounding reference region shown in Figure 39 may be used. For example, a region containing a predetermined number of pixels obtained by thinning out the upper adjacent pixels and the left adjacent pixels may be used as the surrounding reference region. Furthermore, the surrounding reference region is not limited to the region adjacent to the block to be encoded, but may also be a region not adjacent to the block to be encoded. The predetermined number of pixels may be set in advance.

[0266] Furthermore, in the example shown in Figure 39, the peripheral reference region within the reference picture is the region specified by the motion vector of the picture to be encoded, but it may also be a region specified by another motion vector. For example, this other motion vector may be the motion vector of the peripheral reference region within the picture to be encoded.

[0267] Although the operation of the encoding device 100 has been described here, the operation of the decoding device 200 is typically similar.

[0268] Furthermore, LIC processing may be applied not only to luminance but also to chrominance. 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.

[0269] Furthermore, LIC processing may be applied on a subblock basis. For example, correction parameters may be derived using the surrounding reference region of the current subblock and the surrounding reference region of the reference subblock within the reference picture specified by the MV of the current subblock.

[0270] [Prediction Control Unit] The prediction control unit 128 selects either the intra-prediction signal (the signal output from the intra-prediction unit 124) or the inter-prediction signal (the signal output from the inter-prediction unit 126), and outputs the selected signal as the prediction signal to the subtraction unit 104 and the addition unit 116.

[0271] As shown in Figure 1, in various encoding device examples, the prediction control unit 128 may output prediction parameters that are input to the entropy encoding unit 110. The entropy encoding unit 110 may generate an encoded bitstream (or sequence) based on the prediction parameters input from the prediction control unit 128 and the quantization coefficients input from the quantization unit 108. The prediction parameters may be used in the decoding device. The decoding device may receive and decode the encoded bitstream and perform the same processing as the prediction processing performed in the intra-prediction unit 124, inter-prediction unit 126, and prediction control unit 128. The prediction parameters may include a selected prediction signal (e.g., a motion vector, prediction type, or prediction mode used in the intra-prediction unit 124 or inter-prediction unit 126), or any index, flag, or value that is based on or indicates the prediction processing performed in the intra-prediction unit 124, inter-prediction unit 126, and prediction control unit 128.

[0272] [Example of an encoding device implementation] Figure 40 is a block diagram showing an example implementation of the encoding device 100. The encoding device 100 includes a processor a1 and memory a2. For example, the multiple components of the encoding device 100 shown in Figure 1 are implemented by the processor a1 and memory a2 shown in Figure 40.

[0273] Processor a1 is a circuit that performs information processing and is a circuit that can access memory a2. For example, processor a1 is a dedicated or general-purpose electronic circuit for encoding moving images. Processor a1 may be a processor such as a CPU. Alternatively, processor a1 may be a collection of multiple electronic circuits. Furthermore, for example, processor a1 may perform the roles of multiple components of the encoding device 100 shown in Figure 1, etc.

[0274] Memory a2 is a dedicated or general-purpose memory in which information for the processor a1 to encode moving images is stored. Memory a2 may be an electronic circuit and may be connected to the processor a1. Memory a2 may also be included in the processor a1. Memory a2 may also be a collection of multiple electronic circuits. Memory a2 may also be a magnetic disk or an optical disk, or may be described as storage or a recording medium. Memory a2 may also be a non-volatile memory or a volatile memory.

[0275] For example, memory a2 may store the video to be encoded, or it may store the bit sequence corresponding to the encoded video. Alternatively, memory a2 may store a program for processor a1 to encode the video.

[0276] Furthermore, for example, memory a2 may play the role of an information storage component among the multiple components of the encoding device 100 shown in Figure 1, etc. For example, memory a2 may play the role of the block memory 118 and frame memory 122 shown in Figure 1. More specifically, reconstructed blocks and reconstructed pictures may be stored in memory a2.

[0277] Furthermore, it is not necessary for the encoding device 100 to implement all of the components shown in Figure 1, etc., nor is it necessary for all of the processes described above to be performed. Some of the components shown in Figure 1, etc., may be included in other devices, and some of the processes described above may be performed by other devices.

[0278] [Decoding device] Next, we will describe a decoding device capable of decoding an encoded signal (encoded bitstream) output from the above-mentioned encoding device 100. Figure 41 is a block diagram showing the functional configuration of a decoding device 200 according to an embodiment. The decoding device 200 is a video decoding device that decodes video in block units.

[0279] As shown in Figure 41, the decoding device 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transform unit 206, an adder unit 208, a block memory 210, a loop filter unit 212, a frame memory 214, an intra prediction unit 216, an inter prediction unit 218, and a prediction control unit 220.

[0280] The decoding device 200 can be implemented, for example, by a general-purpose processor and memory. In this case, when the software program stored in memory is executed by the processor, the processor functions as an entropy decoding unit 202, an inverse quantization unit 204, an inverse transformation unit 206, an addition unit 208, a loop filter unit 212, an intra prediction unit 216, an inter prediction unit 218, and a prediction control unit 220. Alternatively, the decoding device 200 may be implemented as one or more dedicated electronic circuits corresponding to the entropy decoding unit 202, the inverse quantization unit 204, the inverse transformation unit 206, the addition unit 208, the loop filter unit 212, the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220.

[0281] The following describes the overall processing flow of the decoding device 200, followed by a description of each component included in the decoding device 200.

[0282] [Overall flow of the decryption process] Figure 42 is a flowchart showing an example of the overall decoding process by the decoding device 200.

[0283] First, the entropy decoding unit 202 of the decoding device 200 identifies a division pattern for a fixed-size block (for example, 128 × 128 pixels) (step Sp_1). This division pattern is the one selected by the encoding device 100. Then, the decoding device 200 performs steps Sp_2 to Sp_6 for each of the multiple blocks that make up that division pattern.

[0284] In other words, the entropy decoding unit 202 decodes (specifically, performs entropy decoding) the encoded quantization coefficients and prediction parameters of the block to be decoded (also called the current block) (step Sp_2).

[0285] Next, the inverse quantization unit 204 and the inverse transformation unit 206 reconstruct multiple predicted residuals (i.e., difference blocks) by performing inverse quantization and inverse transformation on multiple quantization coefficients (step Sp_3).

[0286] Next, the prediction processing unit, which consists of all or part of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220, generates a prediction signal (also called a prediction block) for the current block (step Sp_4).

[0287] Next, the addition unit 208 reconstructs the current block into a reconstructed image (also called a decoded image block) by adding the predicted block to the difference block (step Sp_5).

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

[0289] The decryption device 200 then determines whether or not the entire picture has been decrypted (step Sp_7). If it determines that it has not been completed (No. in step Sp_7), it repeats the process from step Sp_1.

[0290] As shown in the diagram, steps Sp_1 to Sp_7 are performed sequentially by the decoding device 200. Alternatively, some of these steps may be performed in parallel, or their order may be changed.

[0291] [Entropy Decoder] The entropy decoding unit 202 entropically decodes the encoded bitstream. Specifically, the entropy decoding unit 202 arithmetically decodes the encoded bitstream into a binary signal, for example. Then, the entropy decoding unit 202 debinarizes the binary signal. The entropy decoding unit 202 outputs the quantization coefficients in block units to the inverse quantization unit 204. The entropy decoding unit 202 may also output prediction parameters included in the encoded bitstream (see Figure 1) to the intra-prediction unit 216, inter-prediction unit 218, and prediction control unit 220 in the embodiment. The intra-prediction unit 216, inter-prediction unit 218, and prediction control unit 220 can perform the same prediction processing as the intra-prediction unit 124, inter-prediction unit 126, and prediction control unit 128 on the encoding device side.

[0292] [Dequantization section] The inverse quantization unit 204 inversely quantizes the quantization coefficients of the decoded block (hereinafter referred to as the current block), which is the input from the entropy decoding unit 202. Specifically, for each quantization coefficient of the current block, the inverse quantization unit 204 inversely quantizes the quantization coefficient based on the quantization parameter corresponding to that quantization coefficient. The inverse quantization unit 204 then outputs the inversely quantized quantization coefficients (i.e., transformation coefficients) of the current block to the inverse transformation unit 206.

[0293] [Inverse Transformation Section] The inverse transform unit 206 restores the prediction error by inversely transforming the transformation coefficients, which are input from the inverse quantization unit 204.

[0294] For example, if the information decoded from the encoded bitstream indicates that EMT or AMT should be applied (e.g., the AMT flag is true), the inverse transform unit 206 inversely transforms the transformation coefficients of the current block based on the information indicating the decoded transformation type.

[0295] For example, if the information decoded from the encoded bitstream indicates that NSST should be applied, the inverse transform unit 206 applies inverse retransformation to the transformation coefficients.

[0296] [Addition section] The adder 208 reconstructs the current block by adding the prediction error, which is the input from the inverse transformer 206, and the prediction sample, which is the input from the prediction control unit 220. The adder 208 then outputs the reconstructed block to the block memory 210 and the loop filter unit 212.

[0297] [Block memory] The block memory 210 is a storage unit for storing blocks that are referenced in intra prediction and are located within the decoded picture (hereinafter referred to as the current picture). Specifically, the block memory 210 stores the reconstructed blocks output from the adder 208.

[0298] [Loop Filter Section] The loop filter unit 212 applies a loop filter to the block reconstructed by the adder unit 208 and outputs the filtered reconstructed block to the frame memory 214 and the display device, etc.

[0299] If the information interpreted from the encoded bitstream indicating ALF on / off indicates ALF is on, one filter is selected from among several filters based on the direction and activity of the local gradient, and the selected filter is applied to the reconstruction block.

[0300] [Frame memory] The frame memory 214 is a memory unit for storing reference pictures used for interpretation, and is sometimes called a frame buffer. Specifically, the frame memory 214 stores the reconstructed blocks filtered by the loop filter unit 212.

[0301] [Prediction Processing Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] Figure 43 is a flowchart showing an example of processing performed in the prediction processing unit of the decoding device 200. The prediction processing unit consists of all or some of the components of the intra-prediction unit 216, the inter-prediction unit 218, and the prediction control unit 220.

[0302] The prediction processing unit generates a predicted image of the current block (step Sq_1). This predicted image is also called a predicted signal or predicted block. Predicted signals include, for example, intra-predicted signals or inter-predicted signals. Specifically, the prediction processing unit generates a predicted image of the current block using the reconstructed image already obtained by generating predicted blocks, difference blocks, coefficient blocks, difference blocks, and decoded image blocks.

[0303] The reconstructed image may be, for example, the image of the reference picture, or it may be the image of the decoded block within the current picture, which is the picture containing the current block. The decoded block within the current picture is, for example, the adjacent block to the current block.

[0304] Figure 44 is a flowchart showing another example of the processing performed in the prediction processing unit of the decoding device 200.

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

[0306] If the prediction processing unit determines a first method as the mode for generating the prediction image, it generates the prediction image according to that first method (step Sr_2a). If the prediction processing unit determines a second method as the mode for generating the prediction image, it generates the prediction image according to that second method (step Sr_2b). If the prediction processing unit determines a third method as the mode for generating the prediction image, it generates the prediction image according to that third method (step Sr_2c).

[0307] The first, second, and third methods are different methods for generating predictive images, and may be, for example, an interpretation method, an intrapretation method, and other prediction methods, respectively. These prediction methods may use the reconstructed images described above.

[0308] [Intra Prediction Unit] The intra-prediction unit 216 generates a prediction signal (intra-prediction signal) by performing intra-prediction based on the intra-prediction mode decoded from the encoded bitstream, and by referring to the blocks in the current picture stored in the block memory 210. Specifically, the intra-prediction unit 216 generates an intra-prediction signal by performing intra-prediction by referring to samples (e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra-prediction signal to the prediction control unit 220.

[0309] Furthermore, if an intra-prediction mode that references a luminance block is selected in the intra-prediction of a color difference block, the intra-prediction unit 216 may predict the color difference component of the current block based on the luminance component of the current block.

[0310] Furthermore, if the information decoded from the encoded bitstream 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.

[0311] [International Prediction Department] 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 (e.g., 4x4 blocks). For example, the inter-prediction unit 218 generates an inter-prediction signal for the current block or sub-block by performing motion compensation using motion information (e.g., motion vectors) decoded from the encoded bitstream (e.g., prediction parameters output from the entropy decoding unit 202), and outputs the inter-prediction signal to the prediction control unit 220.

[0312] If the information decoded from the encoded bitstream indicates that the OBMC mode should be applied, the interpretation unit 218 generates an interpretation prediction signal using not only the motion information of the current block obtained by motion search, but also the motion information of the adjacent block.

[0313] Furthermore, if the information decoded from the encoded bitstream indicates that FRUC mode should be applied, the interpretation unit 218 derives motion information by performing a motion search according to the pattern matching method (bilateral matching or template matching) decoded from the encoded stream. Then, the interpretation unit 218 performs motion compensation (prediction) using the derived motion information.

[0314] Furthermore, when the BIO mode is applied, the inter-prediction unit 218 derives motion vectors based on a model that assumes uniform linear motion. Also, if the information decoded from the encoded bitstream indicates that the affine motion compensation prediction mode should be applied, the inter-prediction unit 218 derives motion vectors on a sub-block basis based on the motion vectors of multiple adjacent blocks.

[0315] [MV Derivation > Normal Intermode] If the information decoded from the encoded bitstream indicates that the normal intermode should be applied, the interpretation unit 218 derives the motion video (MV) based on the information decoded from the encoded stream and uses that MV to perform motion compensation (prediction).

[0316] Figure 45 is a flowchart showing an example of inter-mode prediction in the decoding device 200.

[0317] The interpretation unit 218 of the decoding device 200 performs motion compensation for each block. Based on information such as the MVs of multiple decoded blocks surrounding the current block in time or space, the interpretation unit 218 obtains multiple candidate MVs for the current block (step Ss_1). In other words, the interpretation unit 218 creates a list of candidate MVs.

[0318] Next, the interpretation unit 218 extracts N candidate MVs (where N is an integer greater than or equal to 2) from among the multiple candidate MVs obtained in step Ss_1 as predicted motion vector candidates (also called predicted MV candidates) according to a predetermined priority order (step Ss_2). Note that this priority order may be predetermined for each of the N predicted MV candidates.

[0319] Next, the interpretation unit 218 decodes the predicted motion vector selection information from the input stream (i.e., the encoded bitstream), and uses the decoded predicted motion vector selection information to select one predicted MV candidate from among the N predicted MV candidates as the predicted motion vector (also called the predicted MV) for the current block (step Ss_3).

[0320] Next, the interpretation unit 218 decodes the differential MV from the input stream and derives the MV of the current block by adding the decoded differential MV (the difference value) to the selected predicted motion vector (step Ss_4).

[0321] Finally, the interpretation 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 Ss_5).

[0322] [Prediction Control Unit] The prediction control unit 220 selects either the intra-prediction signal or the inter-prediction signal and outputs the selected signal as the prediction signal to the summer unit 208. Overall, the configuration, functions, and processing of the prediction control unit 220, intra-prediction unit 216, and inter-prediction unit 218 on the decoding device side may correspond to the configuration, functions, and processing of the prediction control unit 128, intra-prediction unit 124, and inter-prediction unit 126 on the encoding device side.

[0323] [Example of a decryption device implementation] Figure 46 is a block diagram showing an example implementation of the decoding device 200. The decoding device 200 includes a processor b1 and memory b2. For example, the multiple components of the decoding device 200 shown in Figure 41 are implemented by the processor b1 and memory b2 shown in Figure 46.

[0324] Processor b1 is a circuit that performs information processing and is a circuit that can access memory b2. For example, processor b1 is a dedicated or general-purpose electronic circuit that decodes encoded video (i.e., encoded bitstream). Processor b1 may be a processor such as a CPU. Alternatively, processor b1 may be a collection of multiple electronic circuits. Furthermore, for example, processor b1 may perform the roles of multiple components of the decoding device 200 shown in Figure 41, etc.

[0325] Memory b2 is a dedicated or general-purpose memory in which information for the processor b1 to decode the encoded bitstream is stored. Memory b2 may be an electronic circuit and may be connected to the processor b1. Memory b2 may also be included in the processor b1. Memory b2 may also be a collection of multiple electronic circuits. Memory b2 may also be a magnetic disk or an optical disk, or may be described as storage or a recording medium. Memory b2 may also be non-volatile memory or volatile memory.

[0326] For example, memory b2 may store a video image or an encoded bitstream. Alternatively, memory b2 may store a program for processor b1 to decode the encoded bitstream.

[0327] Furthermore, for example, memory b2 may play the role of an information storage component among the multiple components of the decoding device 200 shown in Figure 41, etc. Specifically, memory b2 may play the role of the block memory 210 and frame memory 214 shown in Figure 41. More specifically, reconstructed blocks and reconstructed pictures may be stored in memory b2.

[0328] Furthermore, the decoding device 200 does not necessarily have to implement all of the components shown in Figure 41, etc., nor does it have to perform all of the processes described above. Some of the components shown in Figure 41, etc., may be included in other devices, and some of the processes described above may be performed by other devices.

[0329] [Definitions of each term] Each term may be defined as follows, for example:

[0330] A picture is an array of multiple luminance samples in a monochrome format, or two corresponding arrays of multiple luminance samples and multiple color difference samples in 4:2:0, 4:2:2, and 4:4:4 color formats. A picture may be a frame or a field.

[0331] The frame is composed of a top field where multiple sample rows 0, 2, 4, ... are generated, and a bottom field where multiple sample rows 1, 3, 5, ... are generated.

[0332] A slice is an integer number of coded tree units contained within one independent slice segment and all subsequent dependent slice segments that precede (if any) the next independent slice segment within the same access unit.

[0333] A tile is a rectangular region of a picture containing multiple coding tree blocks within a particular tile sequence and a particular tile row. A tile may also be a rectangular region of a frame that is intended to be decoded and coded independently, although loop filters may still be applied across the edges of the tile.

[0334] A block is an MxN (N rows x M columns) array of multiple samples, or an MxN array of multiple transformation coefficients. A block may also be a square or rectangular region of multiple pixels consisting of multiple matrices of one luminance and two chrominance values.

[0335] A CTU (Coded Tree Unit) may be a coded tree block of multiple luminance samples of a picture having three sample sequences, or two corresponding coded tree blocks of multiple chrominance samples. Alternatively, a CTU may be a coded tree block of multiple samples of either a monochrome picture or a picture coded using a syntax structure used to code three separate color planes and multiple samples.

[0336] The superblock may consist of one or two mode information blocks, or it may be a 64x64 pixel square block that can be recursively divided into four 32x32 blocks and further divided.

[0337] [Non-rectangular division] In the prediction control unit 128 connected to the intra-prediction unit 124 and inter-prediction unit 126 of the encoding device (see Figure 1), and in the prediction control unit 220 connected to the intra-prediction unit 216 and inter-prediction unit 218 of the decoding device (see Figure 41), conventionally, the multiple partitions (or multiple variable-size blocks, or multiple sub-blocks) obtained from the division of each block and from which motion information (e.g., multiple motion vectors) is obtained are always rectangular, as shown in Figure 3. The inventors have found that generating multiple partitions having a non-rectangular shape, such as a triangular shape, leads to improvements in image quality and encoding efficiency in various embodiments, depending on the image content in the picture. Various embodiments in which at least one partition divided from an image block for prediction purposes has a non-rectangular shape are described below. These embodiments are equally applicable to the encoding device side (prediction control unit 128 connected to the intra-prediction unit 124 and the inter-prediction unit 126) and the decoding device side (prediction control unit 220 connected to the intra-prediction unit 216 and the inter-prediction unit 218), and may be implemented in the encoding device shown in Figure 1 or the decoding device shown in Figure 41.

[0338] Figure 47 is a flowchart illustrating an example of a process that divides an image block into multiple partitions, including at least a first partition and a second partition having a non-rectangular shape (e.g., a triangle), and further encodes (or decodes) the image block as a reconstructed combination of the first and second partitions.

[0339] In step S1001, the image block is divided into multiple partitions, including a first partition having a non-rectangular shape and a second partition that may or may not have a non-rectangular shape. For example, as shown in Figure 48, the image block may be divided from the upper left corner to the lower right corner to create a first and second partition that both have a non-rectangular shape (e.g., a triangle). Alternatively, the image block may be divided from the upper right corner to the lower left corner to create a first and second partition that both have a non-rectangular shape (e.g., a triangle). Various examples of non-rectangular divisions will be described later with reference to Figures 48 and 53-55.

[0340] In step S1002, the process predicts a first motion vector for the first partition and a second motion vector for the second partition. For example, predicting the first and second motion vectors may include selecting a first motion vector from a set of candidate first motion vectors and selecting a second motion vector from a set of candidate second motion vectors.

[0341] In step S1003, motion compensation processing is performed to obtain the first partition using the first motion vector derived in step S1002, and to obtain the second partition using the second motion vector derived in step S1002.

[0342] In step S1004, prediction processing is performed on the image block as a (reconstructed) combination of the first partition and the second partition. The prediction processing includes boundary smoothing processing to smooth the boundary between the first partition and the second partition. For example, boundary smoothing processing involves weighting multiple first values ​​of multiple boundary pixels predicted based on the first partition and multiple second values ​​of multiple boundary pixels predicted based on the second partition. Various implementations of boundary smoothing processing will be described later with reference to Figures 49, 50, 56 and 57A to 57D.

[0343] In step S1005, the process encodes or decodes an image block using one or more parameters, including a partition parameter, which indicates that the image block is divided into a first partition and a second partition having a non-rectangular shape. As summarized in the table in Figure 51, for example, the partition parameter ("first index value") may encode together the division direction applied to the division (for example, from top left to bottom right or top right to bottom left, as shown in Figure 48) and the first and second motion vectors derived in step S1002 described above. Details of such partition syntax operation with one or more parameters, including the partition parameter, will be described in detail later with reference to Figures 51, 52 and 58-61.

[0344] Figure 53 is a flowchart of the process 2000 for dividing an image block. In step S2001, the process divides the image into multiple partitions, including a first partition having a non-rectangular shape and a second partition which may or may not have a non-rectangular shape. As shown in Figure 48, the image block is divided into a first partition having a triangular shape and a second partition which also has a triangular shape. There are many other examples in which the image block is divided into multiple partitions, including a first partition and a second partition, where at least the first partition has a non-rectangular shape. The non-rectangular shape may be a triangle, a trapezoid, or a polygon having at least five sides and angles.

[0345] For example, as shown in Figure 54, an image block may be divided into two triangular partitions. An image block may be divided into more than two triangular partitions (e.g., three triangular partitions). An image block may be divided into a combination of one or more triangular partitions and one or more rectangular partitions. Alternatively, an image block may be divided into a combination of one or more triangular partitions and one or more polygonal partitions.

[0346] Furthermore, as shown in Figure 55, the image block may be divided into L-shaped (polygonal) partitions and rectangular partitions. The image block may be divided into pentagonal (polygonal) partitions and triangular partitions. The image block may be divided into hexagonal (polygonal) partitions and pentagonal (polygonal) partitions. Alternatively, the image block may be divided into multiple polygonal partitions.

[0347] Referring again to Figure 53, in step S2002, the process predicts a first motion vector for the first partition by, for example, selecting the first partition from a first motion vector candidate set, and predicts a second motion vector for the second partition by, for example, selecting the second partition from a second motion vector candidate set. For example, the first motion vector candidate set may include multiple motion vectors for multiple partitions adjacent to the first partition, and the second motion vector candidate set may include multiple motion vectors for multiple partitions adjacent to the second partition. The adjacent partitions may be either or both spatially adjacent partitions and / or temporally adjacent partitions. Some examples of spatially adjacent partitions include partitions located to the left, lower left, bottom, lower right, right, upper right, top, or upper left of the partition being processed. Some examples of temporally adjacent partitions include multiple co-located partitions in multiple reference pictures of an image block.

[0348] In various implementations, multiple partitions adjacent to the first partition, and multiple partitions adjacent to the second partition, may be outside the image block divided into the first and second partitions. The first motion vector candidate set may be the same as or different from the second motion vector candidate set. Furthermore, the first motion vector candidate set and at least one of the second motion vector candidate sets may be the same as another third motion vector candidate set prepared for the image block.

[0349] In some implementations, in step S2002, if it is determined that the second partition, like the first partition, has a non-rectangular shape (e.g., a triangle), process 2000 creates a second motion vector candidate set (for the non-rectangular second partition) that includes multiple motion vectors of multiple partitions adjacent to the second partition, excluding the first partition (i.e., excluding the motion vector of the first partition). On the other hand, if it is determined that the second partition has a rectangular shape, unlike the first partition, process 2000 creates a second motion vector candidate set (for the rectangular second partition) that includes the first partition and multiple motion vectors of multiple partitions adjacent to the second partition.

[0350] In step S2003, the process encodes or decodes the first partition using the first motion vector derived in step S2002 described above, and encodes or decodes the second partition using the second motion vector derived in step S2002 described above.

[0351] Image block division processing, such as process 2000 in Figure 53, may be performed by an image encoding device including a circuit and memory connected to the circuit, as shown in Figure 1. In operation, the circuit divides an image block into multiple partitions, including a first partition and a second partition having a non-rectangular shape (step S2001), predicts a first motion vector for the first partition and a second motion vector for the second partition (step S2002), and encodes the first partition using the first motion vector and the second partition using the second motion vector (step S2003).

[0352] In another embodiment, an image encoding device, as shown in Figure 1, is provided, comprising: a splitting unit 102 that receives a source image in operation and divides it into multiple blocks; an adding unit 104 that receives multiple blocks from the splitting unit and multiple predictions from a prediction control unit 128 in operation, subtracts each prediction from its corresponding block and outputs a residual; a conversion unit 106 that performs a conversion on the multiple residuals output from the adder unit 104 and outputs multiple conversion coefficients; a quantization unit 108 that quantizes the multiple conversion coefficients in operation and generates multiple quantized conversion coefficients; an entropy encoding unit 110 that encodes the multiple quantized conversion coefficients in operation and generates a bitstream; an inter-prediction unit 126 that generates a prediction for the current block based on a reference block in an encoded reference picture in operation; an intra-prediction unit 124 that generates a prediction for the current block based on an encoded reference block in the current picture in operation; and a prediction control unit 128 connected to memories 118 and 122. In operation, the prediction control unit 128 divides the block into multiple partitions, including a first partition and a second partition, which have a non-rectangular shape (Figure 53, step S2001), predicts a first motion vector for the first partition and a second motion vector for the second partition (step S2002), and encodes the first partition using the first motion vector and the second partition using the second motion vector (step S2003).

[0353] In other embodiments, an image decoding device is provided that includes a circuit and a memory connected to the circuit, as shown in Figure 41, for example. The circuit operates by dividing an image block into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape (Figure 53, step S2001), predicting a first motion vector for the first partition and a second motion vector for the second partition (step S2002), and decoding the first partition using the first motion vector and the second partition using the second motion vector (step S2003).

[0354] Furthermore, according to the embodiment, the image decoding device shown in Figure 41 includes an entropy decoding unit 202 that receives and decodes an encoded bitstream in operation to obtain a plurality of quantization conversion coefficients, an inverse quantization unit 204 and an inverse transformation unit 206 that in operation inverse quantization conversion coefficients to obtain a plurality of conversion coefficients and inversely transform the plurality of conversion coefficients to obtain a plurality of residuals, an addition unit 208 that in operation adds a plurality of residuals output from the inverse quantization unit 204 and the inverse transformation unit 206 and a plurality of predictions output from the prediction control unit 220 to reconstruct a plurality of blocks, an inter-prediction unit 218 that in operation generates a prediction of the current block based on the reference block in the decoded reference picture, an intra-prediction unit 216 that in operation generates a prediction of the current block based on the decoded reference block in the current picture, and a prediction control unit 220 connected to memories 210 and 214. In operation, the prediction control unit 220 divides an image block into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape (Figure 53, step S2001), predicts a first motion vector for the first partition and a second motion vector for the second partition (step S2002), and decodes the first partition using the first motion vector and the second partition using the second motion vector (step S2003).

[0355] [Boundary smoothing] As described above in Figure 47, step S1004, predictive processing on an image block as a (reconstructed) combination of a first partition having a non-rectangular shape and a second partition may be accompanied by the application of boundary smoothing processing along the boundary between the first partition and the second partition, according to various embodiments.

[0356] For example, Figure 57B shows an example of boundary smoothing, which involves weighting multiple first values ​​of multiple boundary pixels predicted first based on the first partition with multiple second values ​​of multiple boundary pixels predicted second based on the second partition.

[0357] Figure 56 is a flowchart illustrating an overall boundary smoothing process 3000, according to one embodiment, which involves weighting a plurality of first values ​​of a plurality of boundary pixels first predicted based on a first partition with a plurality of second values ​​of a plurality of boundary pixels second predicted based on a second partition. In step S3001, as shown in Figure 57A, or in Figures 48, 54, and 55 described above, the image block is divided along its boundary into a first partition and a second partition, where at least the first partition has a non-rectangular shape.

[0358] In step S3002, multiple primary values ​​(e.g., color, brightness, transparency, etc.) of a set of pixels in the first partition along the boundary ("multiple boundary pixels" in Figure 57A) are first predicted using information from the first partition. In step S3003, multiple secondary values ​​of the (same) set of pixels in the first partition along the boundary are second predicted using information from the second partition. In some embodiments, at least one of the first and second predictions is an inter-prediction process that predicts multiple primary and secondary values ​​based on a reference partition in an encoded reference picture. Referring to Figure 57D, in some implementations, the prediction process predicts multiple primary values ​​for all pixels in the first partition ("first sample set") that includes the set of pixels where the first and second partitions overlap, and predicts secondary values ​​only for the set of pixels where the first and second partitions overlap ("second sample set"). In other implementations, at least one of the first and second predictions is an intra-prediction process that predicts multiple primary and secondary values ​​based on an encoded reference partition in the current picture. In some implementations, the prediction method used for the first prediction is different from the prediction method used for the second prediction. For example, the first prediction may include an intra-prediction process, and the second prediction may include an intra-prediction process. The information used for the first prediction of multiple primary values, or the second prediction of multiple secondary values, may include multiple motion vectors of the first or second partition, multiple intra-prediction directions, etc.

[0359] In step S3004, the multiple first values ​​predicted using the first partition and the multiple second values ​​predicted using the second partition are weighted. In step S3005, the first partition is encoded or decoded using the weighted multiple first values ​​and multiple second values.

[0360] Figure 57B shows an example of boundary smoothing operation where the first and second partitions overlap by up to 5 pixels in each row or in each row. That is, the maximum number of pixel sets in each row or column where multiple first values ​​are predicted based on the first partition and multiple second values ​​are predicted based on the second partition is 5. Figure 57C shows another example of boundary smoothing operation where the first and second partitions overlap by up to 3 pixels in each row or in each column. That is, the maximum number of pixel sets in each row or column where multiple first values ​​are predicted based on the first partition and multiple second values ​​are predicted based on the second partition is 3.

[0361] Figure 49 shows another example of boundary smoothing operation where the first and second partitions overlap by (up to) four pixels in each row or column. That is, there are at most four sets of pixels in each row or column where multiple primary values ​​are predicted based on the first partition and multiple secondary values ​​are predicted based on the second partition. In the example shown, multiple weights of 1 / 8, 1 / 4, 3 / 4, and 7 / 8 may be applied to multiple primary values ​​of four pixels in a set, respectively, and multiple weights of 7 / 8, 3 / 4, 1 / 4, and 1 / 8 may be applied to multiple secondary values ​​of four pixels in a set, respectively.

[0362] Figure 50 further shows several examples of boundary smoothing operations where the first and second partitions overlap by 0 pixels in each row or column (i.e., they do not overlap), overlap by (up to) 1 pixel in each row or column, and overlap by (up to) 2 pixels in each row or column. In the example where the first and second partitions do not overlap, multiple zero weights are applied. In the example where the first and second partitions overlap by 1 pixel in each row or column, a weight of 1 / 2 may be applied to multiple primary values ​​of multiple pixels in the set predicted based on the first partition, and a weight of 1 / 2 may be applied to multiple secondary values ​​of multiple pixels in the set predicted based on the second partition. In an example where the first and second partitions overlap by two pixels in each row or column, weights of 1 / 3 and 2 / 3 may be applied to multiple primary values ​​of two pixels in the set predicted based on the first partition, and weights of 2 / 3 and 1 / 3 may be applied to multiple secondary values ​​of two pixels in the set predicted based on the second partition.

[0363] In the embodiments described above, the number of pixels in the set where the first and second partitions overlap is an integer. In other implementations, the number of overlapping pixels in a set may be, for example, a non-integer or a fraction. The weights applied to the multiple first and multiple second values ​​of the pixel set may also be fractions or integers, depending on the application.

[0364] Boundary smoothing operations, such as process 3000 in Figure 56, may be performed by an image encoding device including a circuit and memory connected to the circuit, as shown in Figure 1. In operation, the circuit performs boundary smoothing operations along the boundary between a first partition having a non-rectangular shape and a second partition, which are separated from an image block (Figure 56, step S3001). The boundary smoothing operations include predicting a plurality of first values ​​of the pixel set of the first partition along the boundary using information of the first partition (step S3002), second predicting a plurality of second values ​​of the pixel set of the first partition along the boundary using information of the second partition (step S3003), weighting the plurality of first values ​​and the plurality of second values ​​(step S3004), and encoding the first partition using the weighted plurality of first values ​​and the weighted plurality of second values ​​(step S3005).

[0365] In another embodiment, an image encoding device, as shown in Figure 1, is provided, comprising: a splitting unit 102 that receives a source image in operation and divides it into multiple blocks; an adding unit 104 that receives multiple blocks from the splitting unit and multiple predictions from a prediction control unit 128 in operation, subtracts each prediction from its corresponding block and outputs a residual; a conversion unit 106 that performs a conversion on the multiple residuals output from the adder unit 104 and outputs multiple conversion coefficients; a quantization unit 108 that quantizes the multiple conversion coefficients in operation and generates multiple quantized conversion coefficients; an entropy encoding unit 110 that encodes the multiple quantized conversion coefficients in operation and generates a bitstream; an inter-prediction unit 126 that generates a prediction for the current block based on a reference block in an encoded reference picture in operation; an intra-prediction unit 124 that generates a prediction for the current block based on an encoded reference block in the current picture in operation; and a prediction control unit 128 connected to memories 118 and 122. In operation, the prediction control unit 128 performs a boundary smoothing operation along the boundary between a first partition having a non-rectangular shape, which is divided from an image block, and a second partition (Figure 56, step S3001). The boundary smoothing operation includes: first predicting a plurality of first values ​​of the pixel set of the first partition along the boundary using information of the first partition (step S3002); second predicting a plurality of second values ​​of the pixel set of the first partition along the boundary using information of the second partition (step S3003); weighting the plurality of first values ​​and the plurality of second values ​​(step S3004); and encoding the first partition using the weighted plurality of first values ​​and the weighted plurality of second values ​​(step S3005).

[0366] In other embodiments, for example, an image decoding device is provided that includes a circuit and a memory connected to the circuit, as shown in Figure 41. The circuit performs a boundary smoothing operation along the boundary between a first partition having a non-rectangular shape and a second partition, which are separated from an image block in operation (Figure 56, step S3001). The boundary smoothing operation includes first predicting a plurality of first values ​​of the pixel set of the first partition along the boundary using information of the first partition (step S3002), second predicting a plurality of second values ​​of the pixel set of the first partition along the boundary using information of the second partition (step S3003), weighting the plurality of first values ​​and the plurality of second values ​​(step S3004), and decoding the first partition using the weighted plurality of first values ​​and the weighted plurality of second values ​​(step S3005).

[0367] In another embodiment, the image decoding device shown in Figure 41 includes an entropy decoding unit 202 that receives and decodes an encoded bitstream in operation to obtain a plurality of quantization conversion coefficients, an inverse quantization unit 204 and an inverse transformation unit 206 that in operation inverse quantization conversion coefficients to obtain a plurality of conversion coefficients and inversely transform the plurality of conversion coefficients to obtain a plurality of residuals, an addition unit 208 that in operation adds a plurality of residuals output from the inverse quantization unit 204 and the inverse transformation unit 206 and a plurality of predictions output from the prediction control unit 220 to reconstruct a plurality of blocks, an inter-prediction unit 218 that in operation generates a prediction of the current block based on a reference block in a decoded reference picture, an intra-prediction unit 216 that in operation generates a prediction of the current block based on a decoded reference block in the current picture, and a prediction control unit 220 connected to memories 210 and 214. In operation, the prediction control unit 220 performs a boundary smoothing operation along the boundary between a first partition having a non-rectangular shape, which is divided from an image block, and a second partition (Figure 56, step S3001). The boundary smoothing operation includes: first predicting a plurality of first values ​​of the pixel set of the first partition along the boundary using information of the first partition (step S3002); second predicting a plurality of second values ​​of the pixel set of the first partition along the boundary using information of the second partition (step S3003); weighting the plurality of first values ​​and the plurality of second values ​​(step S3004); and decoding the first partition using the weighted plurality of first values ​​and the weighted plurality of second values ​​(step S3005).

[0368] [Entropy coding and decoding using partition parameter syntax] As shown in Figure 47, step S1005, according to various embodiments, an image block divided into a first partition and a second partition having a non-rectangular shape may be encoded or decoded using one or more parameters including a partition parameter indicating the non-rectangular division of the image block. In various embodiments, such a partition parameter may be encoded together, for example, the division direction applied to the division (e.g., from top left to bottom right, or from top right to bottom left, see Figure 48) and the first and second motion vectors predicted in step S1002, as will be described in more detail later.

[0369] Figure 51 is a table of multiple information sets, each encoded as a whole by multiple sample partition parameters ("first index values") and multiple partition parameters. The multiple partition parameters ("first index values") range from 0 to 6 and encode as a whole the direction of dividing the image block into a first and second partition, both of which are triangles (see Figure 48), the predicted first motion vector for the first partition (Figure 47, step S1002), and the predicted second motion vector for the second partition (Figure 47, step S1002). In particular, partition parameter 0 encodes that the division direction is from the upper left corner to the lower right corner, that the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition.

[0370] Partition parameter 1 encodes that the partitioning direction is from the upper right corner to the lower left corner, that the first motion vector is the "first" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "second" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 2 encodes that the partitioning direction is from the upper right corner to the lower left corner, that the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 3 encodes that the partitioning direction is from the upper left corner to the lower right corner, that the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "second" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 4 encodes that the division direction is from the upper right corner to the lower left corner, that the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "third" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 5 encodes that the division direction is from the upper left corner to the lower right corner, that the first motion vector is the "third" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 6 encodes that the division direction is from the upper left corner to the lower right corner, that the first motion vector is the "fourth" motion vector listed in the first motion vector candidate set for the first partition, and that the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition.

[0371] Figure 58 is a flowchart of method 4000 performed on the encoding device side. In step S4001, the process divides an image block into multiple partitions, including a first partition having a non-rectangular shape and a second partition, based on a partition parameter indicating the division. For example, as shown in Figure 51 above, the partition parameter may indicate the direction in which the image block is divided (e.g., from the upper right corner to the lower left corner, or from the upper left corner to the lower right corner). In step S4002, the process encodes the first and second partitions. In step S4003, the process writes one or more parameters, including the partition parameter, to a bitstream that can be received and decoded so that the decoding device side can acquire one or more parameters and perform the same prediction processing on the first and second partitions on the decoding device side (as performed on the encoding device side). The one or more parameters, including the partition parameter, encode various information together or separately, such as the non-rectangular shape of the first partition, the shape of the second partition, the division direction used to divide the image block to acquire the first and second partitions, the first motion vector of the first partition, the second motion vector of the second partition, etc.

[0372] Figure 59 is a flowchart showing the method 5000 performed on the decoding device side. In step S5001, the process reads one or more parameters from a bitstream in which one or more parameters indicate that the image block is divided into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape. The one or more parameters, including the partition parameters, read from the bitstream may encode together or separately various information necessary for the decoding device to perform the same prediction processing as performed on the encoding device side, such as the non-rectangular shape of the first partition, the shape of the second partition, the division direction used to divide the image block to obtain the first and second partitions, the first motion vector of the first partition, the second motion vector of the second partition, etc. In step S5002, the process 5000 divides the image block into a plurality of partitions based on the partition parameters read from the bitstream. In step S5003, the process decodes the first and second partitions that are divided from the image block.

[0373] Figure 60 is a table of multiple information sets, each encoded as a whole by multiple sample partition parameters ("first index value") and multiple partition parameters, with characteristics similar to the sample table described above in Figure 51. In Figure 60, the partition parameters ("first index value") range from 0 to 6 and encode as a whole the shapes of the first and second partitions separated from the image block, the direction in which the image block is divided into the first and second partitions, the predicted first motion vector for the first partition (Figure 47, step S1002), and the predicted second motion vector for the second partition (Figure 47, step S1002). In particular, partition parameter 0 encodes that neither the first nor the second partition has a triangular shape, and therefore the division direction information is "N / A", the first motion vector information is "N / A", and the second motion vector information is "N / A".

[0374] Partition parameter 1 encodes that the first and second partitions are triangular, the division direction is from the upper left corner to the lower right corner, the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 2 encodes that the first and second partitions are triangular, the division direction is from the upper right corner to the lower left corner, the first motion vector is the "first" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "second" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 3 encodes that the first and second partitions are triangular, the division direction is from the upper right corner to the lower left corner, the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 4 encodes that the first and second partitions are triangular, the division direction is from the upper left corner to the lower right corner, the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "second" motion vector listed in the second motion vector candidate set for the second partition. Partition parameter 5 encodes that the first and second partitions are triangular, the division direction is from the upper right corner to the lower left corner, the first motion vector is the "second" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "third" motion vector listed in the second motion vector candidate set for the second partition.Partition parameter 6 encodes that the first and second partitions are triangular, the division direction is from the upper left corner to the lower right corner, the first motion vector is the "third" motion vector listed in the first motion vector candidate set for the first partition, and the second motion vector is the "first" motion vector listed in the second motion vector candidate set for the second partition.

[0375] According to some implementations, multiple partition parameters (multiple index values) may be binarized according to a binarization scheme selected depending on the values ​​of at least one or more parameters. Figure 52 shows an example of a binarization scheme for binarizing multiple index values ​​(multiple partition parameter values).

[0376] Figure 61 is a table of example combinations of the first and second parameters, where one of the first and second parameters is a partition parameter indicating that the image block is divided into multiple partitions, including a first partition and a second partition, both having a non-rectangular shape. In this example, the partition parameter may also be used to indicate that the image block is divided without encoding other information encoded by one or more of the other parameters as a whole.

[0377] In the first example shown in Figure 61, the first parameter is used to indicate the image block size, and the second parameter is used as a partition parameter (flag) to indicate that at least one of the multiple partitions divided from the image block has a triangular shape. Such a combination of the first and second parameters may be used, for example, to indicate that 1) there are no triangular partitions when the image block size is greater than 64 × 64, or 2) there are no triangular partitions when the ratio of the width to height of the image block is greater than 4 (e.g., 64 × 4).

[0378] In the second example in Figure 61, the first parameter is used to indicate the prediction mode, and the second parameter is used as a partition parameter (flag) to indicate that at least one of the multiple partitions divided from the image block has a triangular shape. Such a combination of the first and second parameters may be used, for example, to indicate that there are no triangular partitions when the image block is encoded in intra mode.

[0379] In the third example in Figure 61, the first parameter is used as a partition parameter (flag) to indicate that at least one of the multiple partitions divided from the image block has a triangular shape, and the second parameter is used to indicate the prediction mode. Such a combination of the first and second parameters may be used, for example, to indicate that 1) the image block must be intercoded if at least one of the multiple partitions divided from the image block has a triangular shape.

[0380] In the fourth example in Figure 61, the first parameter indicates the motion vector of adjacent blocks, and the second parameter is used as a partition parameter indicating the direction in which the image block is divided into two triangles. Such a combination of the first and second parameters may be used, for example, to indicate that the direction in which the image block is divided into two triangles is from the upper left corner to the lower right corner when the motion vector of adjacent blocks is diagonal.

[0381] In the fifth example in Figure 61, the first parameter indicates the intra-prediction direction of the adjacent block, and the second parameter is used as a partition parameter indicating the direction in which the image block is divided into two triangles. Such a combination of the first and second parameters may be used, for example, to indicate that if the intra-prediction direction of the adjacent block is in the opposite diagonal direction, the direction in which the image block is divided into two triangles is from the upper right corner to the lower left corner.

[0382] Multiple tables of one or more parameters, including partition parameters, and which information is encoded together or separately, as shown in Figures 51, 60, and 61, are presented only as examples, and it should be understood that many other ways of encoding various information together or separately as part of the partition syntax operation described above are within the scope of this disclosure. For example, a partition parameter may indicate that the first partition is a triangle, trapezoid, or polygon having at least five sides and angles. A partition parameter may indicate that the second partition has a non-rectangular shape, such as a triangle, trapezoid, or polygon having at least five sides and angles. The partition parameter may indicate one or more pieces of information about the division, such as the non-rectangular shape of the first partition, the shape of the second partition (which may be non-rectangular or rectangular), and the division direction applied to divide an image block into multiple partitions (e.g., from the top-left corner to the bottom-right corner of the image block, and from the top-right corner to the bottom-left corner of the image block). The partition parameters encode further information as a whole, such as the first motion vector of the first partition, the second motion vector of the second partition, image block size, prediction mode, motion vector of adjacent blocks, and intra-prediction direction of adjacent blocks. Alternatively, any of this further information may be encoded separately by one or more parameters other than the partition parameters.

[0383] A partition syntax operation like the one shown in Figure 58 (process 4000) may be performed by an image encoding device including a circuit and memory connected to the circuit, for example, as shown in Figure 1. The circuit performs a partition syntax operation that includes dividing an image block into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape, based on partition parameters indicating the division (Figure 58, step S4001), encoding the first and second partitions (S4002), and writing one or more parameters, including the partition parameters, as a bitstream (S4003).

[0384] In another embodiment, an image encoding device, as shown in Figure 1, is provided, comprising: a splitting unit 102 that receives a source image in operation and divides it into multiple blocks; an adding unit 104 that receives multiple blocks from the splitting unit and multiple predictions from a prediction control unit 128 in operation, subtracts each prediction from its corresponding block and outputs a residual; a conversion unit 106 that performs a conversion on the multiple residuals output from the adder unit 104 and outputs multiple conversion coefficients; a quantization unit 108 that quantizes the multiple conversion coefficients in operation and generates multiple quantized conversion coefficients; an entropy encoding unit 110 that encodes the multiple quantized conversion coefficients in operation and generates a bitstream; an inter-prediction unit 126 that generates a prediction for the current block based on a reference block in an encoded reference picture in operation; an intra-prediction unit 124 that generates a prediction for the current block based on an encoded reference block in the current picture in operation; and a prediction control unit 128 connected to memories 118 and 122. In operation, the prediction control unit 128 divides an image block into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape, based on partition parameters indicating the division (Figure 58, step S4001), and encodes the first partition and the second partition (step S4002). In operation, the entropy encoding unit 110 writes one or more parameters, including partition parameters, as a bitstream (step S4003).

[0385] In other embodiments, for example, an image decoding device is provided that includes a circuit and a memory connected to the circuit, as shown in Figure 41. The circuit performs a partition syntax operation which includes reading one or more parameters from a bitstream, including a partition parameter that indicates that an image block is divided into a plurality of partitions, including a first partition and a second partition having a non-rectangular shape (Figure 59, step S5001); dividing the image block into a plurality of partitions based on the partition parameter (S5002); and decoding the first partition and the second partition (S5003).

[0386] Furthermore, according to the embodiment, the image decoding device shown in Figure 41 includes an entropy decoding unit 202 that receives and decodes an encoded bitstream in operation to obtain a plurality of quantization conversion coefficients, an inverse quantization unit 204 and an inverse transformation unit 206 that in operation inverse quantization conversion coefficients to obtain a plurality of conversion coefficients and inversely transform the plurality of conversion coefficients to obtain a plurality of residuals, an addition unit 208 that in operation adds a plurality of residuals output from the inverse quantization unit 204 and the inverse transformation unit 206 and a plurality of predictions output from the prediction control unit 220 to reconstruct a plurality of blocks, an inter-prediction unit 218 that in operation generates a prediction of the current block based on the reference block in the decoded reference picture, an intra-prediction unit 216 that in operation generates a prediction of the current block based on the decoded reference block in the current picture, and a prediction control unit 220 connected to memories 210 and 214. In operation, the entropy decoding unit 202, in cooperation with the prediction control unit 220 in some implementations, reads one or more parameters from the bitstream, including partition parameters that indicate that the image block is divided into multiple partitions, including a first partition and a second partition having a non-rectangular shape (Figure 59, step S5001). Based on the partition parameters, it divides the image block into multiple partitions (S5002) and decodes the first and second partitions (S5003).

[0387] Following several other examples, the interpretation unit may perform the following operations:

[0388] All motion vector candidates included in the first motion vector candidate set may be multiple single predicted motion vectors. In other words, the interpretation unit may determine only multiple single predicted motion vectors as multiple motion vector candidates in the first motion vector candidate set.

[0389] The interpretation unit may select only a few single prediction motion vector candidates from the first motion vector candidate set.

[0390] For predicting small blocks, only single-prediction motion vectors may be used. For predicting large blocks, dual-prediction motion vectors may be used. As an example, the prediction process may include determining the size of the image block. If the size of the image block is determined to be greater than a threshold, the prediction may include selecting a first motion vector from a first motion vector candidate set, and the first motion vector candidate set may include single-prediction motion vectors and / or dual-prediction motion vectors. If the size of the image block is determined to be less than a threshold, the prediction may include selecting a first motion vector from a first motion vector candidate set, and the first motion vector candidate set may include only multiple single-prediction motion vectors.

[0391] [Method for storing motion vectors for weighted regions] Figure 62 is a flowchart illustrating an example of a processing flow 6000 that predicts a first sample set for a first partition of the current picture using a first motion vector, obtains a second motion vector from a second partition different from the first partition, predicts a second sample set for a first portion contained in the first partition using the second motion vector, weights the first and second sample sets, stores at least one of the first and second motion vectors for the first partition, encodes or decodes the first partition using the weighted samples, and performs further processing according to one embodiment. The processing flow 6000 may be performed, for example, by the encoding device 100 in Figure 1, the decoding device 200 in Figure 41, and so on.

[0392] In step S6001, a first sample set for the first partition of the current picture is predicted by one or more motion vectors, including a first motion vector. The first partition may or may not be rectangular in shape. The first sample set may be, for example, a plurality of pixel blocks having corresponding motion vectors, luminance pixel components, and chrominance pixel components. For example, each sample may be a 4x4 pixel block associated with the first motion vector, and may be a 4x4 pixel block having corresponding luminance pixel components and chrominance pixel components.

[0393] The first partition may be, for example, a partition of an image block that has been divided into multiple partitions. Figure 63 is a conceptual diagram illustrating an example of how to divide an image block into a first and second partition. See also Figures 48, 54, and 55. For example, as shown in Figure 63, an image block may be divided into two or more partitions of various shapes. The examples in Figure 63 include an image block divided from the upper left corner to the lower right corner of the image block to produce a first and second partition, both of which are non-rectangular in shape (e.g., a triangle); an image block divided into an L-shaped partition and a rectangular partition; an image block divided into a pentagonal partition and a triangular partition; an image block divided into a hexagonal partition and a pentagonal partition; and an image block divided into two polygonal partitions. The various partition shapes shown may be formed by dividing the image block in other ways. For example, two triangular partitions may be formed by dividing an image block from the upper right corner to the lower left corner, thereby generating a first and second partition, both having a triangular shape. In some embodiments, two or more partitions of an image block may have overlapping portions.

[0394] In some embodiments, the first motion vector may be obtained by motion detection processing. In some embodiments, the first motion vector may be analyzed from a bitstream. In some embodiments, the first motion vector may also be a motion vector predicted from a set of motion vector candidates for at least a first partition. The motion vector candidates in the motion vector candidate list may include motion vector candidates derived from at least spatially adjacent or temporally adjacent partitions of the first partition, or they may be derived from a list of motion vector candidates for image blocks for prediction modes such as merge mode, skip mode, or intermode.

[0395] Figure 64 is a conceptual diagram showing the neighboring and non-neighboring partitions of the first partition of the current picture. Neighboring partitions are partitions adjacent to the first partition of the current picture. Non-neighboring partitions are partitions far from the first partition of the current picture. In some embodiments, the motion vector candidate set may be derived from the spatially adjacent partitions of at least the first partition of the current picture.

[0396] The first motion vector may be, for example, a single predictive motion vector or a double predictive motion vector. Figure 65 is a conceptual diagram showing single predictive motion vector candidates and double predictive motion vector candidates for an image block of the current picture. A single predictive motion vector candidate is a single motion vector of the current block in the current picture relative to a single reference picture. As shown in the upper part of Figure 65, a single predictive motion vector candidate is a motion vector from the block of the current picture to the block of the reference picture that is earlier in display order than the current picture. In some embodiments, the reference picture may be later in display order than the current picture.

[0397] A dual predictive motion vector candidate consists of two motion vectors: a first motion vector of the current block for the first reference picture and a second motion vector of the current block for the second reference picture. As shown in Figure 65, the lower left dual predictive motion vector candidate has a first motion vector from the current picture's block to the first reference picture's block and a second motion vector from the current picture's block to the second reference picture's block. As illustrated, the first and second reference pictures appear before the current picture in display order. The lower right dual predictive motion vector candidate in Figure 65 has a first motion vector from the current picture's block to the first reference picture's block and a second motion vector from the current picture's block to the second reference picture's block. The first reference picture appears before the current picture in display order, and the second reference picture appears after the current picture in display order.

[0398] In some embodiments, several partition shapes may be associated with one type of predicted motion vector. For example, in some embodiments, a triangular partition may be associated with a single predicted motion vector candidate.

[0399] The prediction of the first sample set may include motion compensation processing with one or more motion vectors, including the first motion vector, and the motion compensation processing may predict samples from the current picture (intrablock), from another picture (interblock), or a combination thereof.

[0400] In step S6002, one or more motion vectors, including the second motion vector, are obtained from a second partition different from the first partition. The second partition may be, for example, a spatial or temporally co-located partition of the first partition. Part of the second partition may spatially overlap with part of the first partition. The second motion vector may be obtained by motion detection processing. In some embodiments, the second motion vector may be analyzed from a bitstream. In some embodiments, the second motion vector may also be a motion vector predicted from at least a set of motion vector candidates for the second partition. The motion vector candidates in the motion vector candidate list may include motion vector candidates derived from spatially adjacent or temporally adjacent partitions of the second partition, or may be derived from a list of motion vector candidates for image blocks for prediction modes such as merge mode, skip mode, or other intermodes. The second motion vector may be a single predicted motion vector or a double predicted motion vector.

[0401] In step S6003, a second sample set for a portion of the first partition is predicted using one or more motion vectors, including the second motion vector. The first portion of the first partition is smaller than the first partition, located adjacent to the edge of the first partition, and overlaps with the first sample set. The prediction of the second sample set may include motion compensation using one or more motion vectors, including the second motion vector, and the motion compensation may predict samples from the current picture (intra-block), from another picture (inter-block), or a combination thereof. The second sample set may be, for example, a pixel block having a corresponding motion vector, luminance pixel component, and chrominance pixel component. For example, each sample in the second sample set may be a 4x4 pixel block associated with the second motion vector, and may also be a 4x4 pixel block having a corresponding luminance pixel component and chrominance pixel component.

[0402] Figure 66 is a conceptual diagram showing an example of a first partition with a first portion, a first sample set, and a second sample set. The first portion may be, for example, one-quarter of the width or height of the first partition. In other examples, 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 or equal to 1, for example, 2. As shown, the example on the right of Figure 66 shows a rectangular partition having a rectangular portion whose width is one-quarter of the width of the first partition, comprising a first sample set containing samples outside the first portion and samples inside the first portion, and a second sample set containing samples within the first portion. The example in the middle of Figure 66 shows a rectangular partition having a rectangular portion whose height is one-quarter of the height of the first partition, comprising a first sample set containing samples outside the first portion and samples inside the first portion, and a second sample set containing samples within the first portion. The example on the left of Figure 66 shows a triangular partition having a polygonal section with a height corresponding to two samples, comprising a first sample set containing samples outside the first section and samples inside the first section, and a second sample set containing samples within the first section.

[0403] The first part may be a portion of the first partition that overlaps with an adjacent partition. Figure 67 is a conceptual diagram showing the first part of the first partition, which is a portion of the first partition that overlaps with a portion of an adjacent partition. For simplicity of illustration, a rectangular partition with an overlapping portion with a spatially adjacent rectangular partition is shown. Partitions of other shapes, such as triangular partitions, may also be used. The overlapping portion may also overlap with a spatially or temporally adjacent partition. The adjacent partition may be the second partition.

[0404] In step S6004, a weighting process is performed on the first part contained in the first partition using a subset of the first sample set contained in the first part and a second sample set contained in the first part. This weighting may be performed as part of a boundary smoothing process, such as overlapped block motion compensation (OBMC, see Figures 35 and 36 and their descriptions) or boundary smoothing as described with reference to Figures 47 to 61. For example, various weights may be assigned to multiple pixels of the first sample set in the first part, for example, based on the distance of the sample from the edge of the first partition to which the first part corresponds. Smaller weights may be assigned to samples closer to the edge than to samples farther from the edge. Similarly, various weights may be assigned to multiple pixels of the second sample set in the first part of the first partition, for example, based on the distance of the sample from the edge of the first partition to which the first part corresponds. Larger weights may be assigned to samples closer to the edge than to samples farther from the edge.

[0405] In step S6005, one or more motion vectors based on one or both of the first motion vector and the second motion vector are stored for the first part of the first partition. In some embodiments, the one or more motion vectors stored may take into account the reference picture lists pointed to by the first motion vector and the second motion vector.

[0406] For example, Figure 68 is a conceptual diagram illustrating an example where the first and second motion vectors are single-prediction motion vectors pointing to different pictures in different reference picture lists. In some embodiments, when the first and second motion vectors are single-prediction motion vectors pointing to different pictures in different reference picture lists, the first and second motion vectors may be stored together as a bi-prediction motion vector for the first part of the first partition. As shown in Figure 68, the current picture is POC4. The first motion vector Mv1 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0, which includes reference pictures POC0 to POC8. The second motion vector Mv2 is a single-prediction motion vector pointing to reference picture POC16 in reference picture list L1, which includes reference pictures POC8 to POC16. The first motion vector Mv1 and the second motion vector Mv2 are stored together as a bi-prediction motion vector for the first part of the first partition.

[0407] As another example, Figure 69 is a conceptual diagram illustrating an example where the first and second motion vectors are single-prediction motion vectors pointing to pictures in a single list of reference pictures. A double-prediction motion vector points to two different lists of reference pictures. Thus, simply combining the first and second motion vectors does not produce a double-prediction motion vector. In some embodiments, if the first and second motion vectors are single-prediction motion vectors pointing to different reference pictures in a single list of reference pictures, then if one of the pointed-to reference pictures is included in another list of reference pictures, for example, the motion vector corresponding to that picture (for example, the second motion vector if the reference picture pointed to by the second motion vector is included in both lists of reference pictures) may be represented by a motion vector pointing to the same reference picture in that other list of reference pictures. The first and second motion vectors are combined by replacing the motion vector corresponding to the reference picture with a replacement motion vector pointing to the reference picture in the other list of reference pictures, and stored as a double-prediction motion vector for the first part of the first partition. As shown in Figure 69, the current picture is POC4. The first motion vector Mv1 is a single predicted motion vector pointing to reference picture POC0 in reference picture list L0, which contains reference pictures POC0 to POC8. The second motion vector Mv2 is a single predicted motion vector pointing to reference picture POC8 in reference picture list L0. Reference picture POC8 is also included in reference picture list L1. The second motion vector Mv2 is replaced with a replacement motion vector Mv2' pointing to reference picture POC8 in reference picture list L1. The first motion vector Mv1 and the replacement second motion vector Mv2' are combined and stored as a double predicted motion vector for the first part of the first partition. In other words, different lists containing the same pictures may be used.

[0408] As another example, Figures 70, 71, and 72 are conceptual diagrams illustrating an example where the first and second motion vectors are single-prediction motion vectors pointing to the same reference picture in the same reference picture list. In some embodiments, when the first and second motion vectors are single-prediction motion vectors pointing to the same reference picture in the same reference picture list, the first motion vector is stored as a single-prediction motion vector for the first part of the first partition. As shown in Figure 70, the current picture is POC4. The first motion vector Mv1 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0, which contains reference pictures POC0 to POC8. The second motion vector Mv2 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0. The first motion vector Mv1 is stored as a single-prediction motion vector for the first part of the first partition.

[0409] In some embodiments, if the first and second motion vectors are single-prediction motion vectors pointing to the same reference picture in the same reference picture list, the second motion vector is stored as a single-prediction motion vector for the first part of the first partition. As shown in Figure 71, the current picture is POC4. The first motion vector Mv1 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0, which includes reference pictures POC0 to POC8. The second motion vector Mv2 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0. The second motion vector Mv2 is stored as a single-prediction motion vector for the first part of the first partition.

[0410] In some embodiments, if the first and second motion vectors are single-prediction motion vectors pointing to the same reference picture in the same reference picture list, the second motion vector is replaced with an inverted motion vector pointing to a reference picture in a different reference picture list, and then the first and inverted motion vectors are combined and stored as a double-prediction motion vector for the first part of the first partition. As shown in Figure 72, the current picture is POC4. The first motion vector Mv1 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0, which contains reference pictures POC0 to POC8. The second motion vector Mv2 is a single-prediction motion vector pointing to reference picture POC0 in reference picture list L0. The second motion vector Mv2 is replaced with an inverted motion vector MV2' pointing to a reference picture in reference picture list L1, such as reference picture POC8 in the illustrated reference picture list L1. The first motion vector Mv1 and the inverted motion vector Mv2' are combined and stored as a dual predictive motion vector for the first part of the first partition. The reference picture in such another reference picture list may be selected in various ways. For example, a reference picture in reference picture list L1 may be selected that is in the same position as the reference picture pointed to by the second motion vector in reference picture list L0, or a reference picture in reference picture list L1 may be selected that is the same distance in display order from the current picture as the reference picture pointed to by the second motion vector in reference picture list L0. The inverted motion vector may be scaled as appropriate depending on the reference picture in the other reference picture list that the inverted motion vector points to.

[0411] In some embodiments, if a bipredictive motion vector based on the first and second motion vectors can be stored without inverting or scaling one of the first and second motion vectors, the bipredictive motion vector is stored in the first part of the first partition (see, for example, the embodiments in Figures 68 and 69); if a bipredictive motion vector cannot be generated without inverting or scaling one of the first and second motion vectors, a single predictive motion vector is stored in the first part of the first partition (see, for example, storing one of the first and second motion vectors as a single predictive motion vector for the first part of the first partition, see Figures 70 and 71).

[0412] As another example, if the first and second motion vectors are single predictive motion vectors pointing to the same reference picture, the average of the first and second motion vectors may be calculated to generate a single predictive motion vector that is stored as the single predictive motion vector for the first part of the first partition.

[0413] As another example, one of the first and second motion vectors may be a bipredictive motion vector and the other a singlepredictive motion vector. The bipredictive motion vector may be stored as the motion vector for the first part of the first partition.

[0414] As another example, both the first and second motion vectors may be bipredictive motion vectors, and the reference picture of the first motion vector may be the same as the reference picture of the second motion vector. The average of the first and second motion vectors may be calculated to generate a bipredictive motion vector that is stored as the bipredictive motion vector for the first part of the first partition.

[0415] As another example, both the first and second motion vectors may be bipredictive motion vectors, and the reference picture of the first motion vector may be different from the reference picture of the second motion vector. The second motion vector may be scaled to match the reference picture of the first motion vector, and then the average with the first motion vector may be calculated to generate an average bipredictive motion vector, which may be stored as the bipredictive motion vector of the first part of the first partition.

[0416] As another example, the first motion vector may be stored as the motion vector for the first part of the first partition, either always or under certain conditions. As yet another example, the second motion vector may be stored as the motion vector for the first part of the first partition, either always or under certain conditions. In step S6006, the first partition is encoded or decoded using at least the weighted samples of the first part of the first partition. For example, the weighted pixel component values ​​(e.g., luminance values, chrominance values) of the samples in the first sample set and the weighted pixel component values ​​of the corresponding samples in the second sample set may be combined to determine the pixel component values ​​used in the encoding or decoding process. See, for example, Figures 47 to 61 and their corresponding descriptions.

[0417] The disclosed embodiments introduce a method for storing motion vectors for weighted regions (e.g., the first portion of the first partition in the disclosed example). This may improve the accuracy of motion vector predictions for the next partition to be processed, thereby potentially improving processing efficiency. Note that the motion vectors for weighted regions may typically be stored in 4-pixel blocks. For example, each sample may be a 4x4 pixel block in which the motion vectors are stored. Single-prediction or double-prediction motion vectors for weighted regions may be stored without significant impact, that is, without increasing the amount of memory used to store the motion vectors for weighted regions in any case.

[0418] Furthermore, the terms "encoding" and "processing" used in the description of the encoding method and encoding process performed by the image encoding device can be replaced with the term "decoding" used in the description of the decoding method and decoding process performed by the image decoding device. Not all of the processes and components described are necessarily required, and in some embodiments, one or more of the described processes may be omitted.

[0419] One or more embodiments disclosed herein may be implemented in combination with at least some of the other embodiments disclosed herein. Furthermore, some processes, some configurations of the apparatus, some syntax, etc., described in the flowcharts of one or more embodiments disclosed herein may be implemented in combination with the other embodiments.

[0420] [Implementation and Application] In each of the above embodiments, each functional or operational block can typically be implemented by an MPU (micro processing unit) and memory, etc. Furthermore, the processing performed by each functional block may be implemented as a program execution unit, such as a processor, that reads and executes software (programs) recorded on a recording medium such as ROM. This software may be distributed. This software may be recorded on various recording media such as semiconductor memory. It is also possible to implement each functional block using hardware (dedicated circuits). Various combinations of hardware and software can be employed.

[0421] The processing described in each embodiment may be implemented by centralized processing using a single device (system), or by distributed processing using multiple devices. Furthermore, the processor executing the above program may be one or multiple. In other words, centralized processing may be performed, or distributed processing may be performed.

[0422] The embodiments of this disclosure are not limited to those described above, and various modifications are possible, which are also included within the scope of the embodiments of this disclosure.

[0423] Furthermore, here we will describe application examples of the video encoding method (image encoding method) or video decoding method (image decoding method) shown in each of the above embodiments, and various systems for implementing these application examples. Such systems may be characterized by having an image encoding device using the image encoding method, an image decoding device using the image decoding method, or an image encoding and decoding device that includes both. Other configurations of such systems can be appropriately modified as needed.

[0424] [Usage example] Figure 73 shows the overall configuration of a suitable content supply system ex100 for realizing a content distribution service. The service area for the communication service is divided into cells of a desired size, and within each cell, there are base stations ex106, ex107, ex108, ex109, and ex110, which are fixed radio stations in the illustrated example.

[0425] In this content supply system ex100, various devices such as a computer ex111, a game console ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 are connected to the internet ex101 via an internet service provider ex102 or a communication network ex104, and base stations ex106~ex110. The content supply system ex100 may also be configured to connect any combination of the above devices. In various implementations, the devices may be directly or indirectly interconnected via a telephone network or short-range wireless, etc., without going through base stations ex106~ex110. Furthermore, the streaming server ex103 may be connected to various devices such as a computer ex111, a game console ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 via the internet ex101, etc. The streaming server ex103 may also be connected to terminals in a hotspot on an airplane ex117 via satellite ex116.

[0426] Note that instead of base stations ex106~ex110, wireless access points or hotspots may be used. Also, streaming server ex103 may be connected directly to the communication network ex104 without going through the internet ex101 or internet service provider ex102, or it may be connected directly to the airplane ex117 without going through satellite ex116.

[0427] The camera ex113 is a device capable of taking still images and videos, such as a digital camera. The smartphone ex115 is a smartphone, mobile phone, or PHS (Personal Handy-phone System) that supports mobile communication systems such as 2G, 3G, 3.9G, 4G, and the upcoming 5G.

[0428] Home appliance ex114 refers to appliances such as refrigerators or equipment included in household fuel cell cogeneration systems.

[0429] In the content supply system ex100, live streaming becomes possible when a terminal with a shooting function is connected to the streaming server ex103 via a base station ex106 or the like. In live streaming, a terminal (such as a computer ex111, a game console ex112, a camera ex113, a home appliance ex114, a smartphone ex115, and a terminal inside an airplane ex117) may perform the encoding process described in each of the above embodiments on still images or video content captured by a user using the terminal, or it may multiplex the video data obtained by encoding with sound data encoded from the sound corresponding to the video, and then transmit the obtained data to the streaming server ex103. In other words, each terminal functions as an image encoding device according to one aspect of this disclosure.

[0430] Meanwhile, the streaming server ex103 streams the content data sent to the requesting client. The client is a computer ex111, a game console ex112, a camera ex113, a home appliance ex114, a smartphone ex115, or a terminal on an airplane ex117, etc., that is capable of decoding the encoded data. Each device that receives the distributed data may decode and play back the received data. That is, each device may function as an image decoding device according to one aspect of this disclosure.

[0431] [Distributed Processing] Furthermore, the streaming server ex103 may consist of multiple servers or computers that distribute data processing, recording, and distribution. For example, the streaming server ex103 may be implemented by a CDN (Content Delivery Network), where content delivery is achieved through a network connecting numerous edge servers distributed worldwide. In a CDN, the physically closest edge server can be dynamically assigned depending on the client. Latency can be reduced by caching and delivering content to the edge server. In addition, if several types of errors occur or the communication state changes due to increased traffic, processing can be distributed among multiple edge servers, the delivery entity can be switched to another edge server, or delivery can be continued by bypassing the failed part of the network, thus enabling high-speed and stable delivery.

[0432] Furthermore, beyond the distributed processing of the distribution itself, the encoding process of the captured data can be performed on each terminal, on the server side, or shared among them. For example, encoding generally involves two processing loops. In the first loop, the complexity or code amount of the image at the frame or scene level is detected. In the second loop, processing is performed to improve encoding efficiency while maintaining image quality. For example, if the terminal performs the first encoding process and the server that receives the content performs the second encoding process, it is possible to improve the quality and efficiency of the content while reducing the processing load on each terminal. In this case, if there is a request to receive and decode near real time, the first encoded data from the terminal can be received and played back on other terminals, enabling more flexible real-time distribution.

[0433] Another example is the camera ex113, which extracts features (quantities of features or characteristics) from an image, compresses the data related to the features as metadata, and sends it to the server. The server performs compression according to the meaning (or importance of content) of the image, for example, by determining the importance of objects from the features and switching the quantization precision. Feature data is particularly effective in improving the accuracy and efficiency of motion vector prediction during further compression on the server. Alternatively, a simple encoding such as VLC (Variable Length Coding) may be performed on the terminal, and a more computationally intensive encoding such as CABAC (Context-Adaptive Binary Arithmetic Coding) may be performed on the server.

[0434] Another example is a scenario in a stadium, shopping mall, or factory where multiple video data sets of nearly identical scenes may exist, captured by multiple terminals. In such cases, the encoding process is distributed among the multiple terminals that captured the footage, along with other terminals and servers as needed, by assigning encoding tasks to each unit, for example, at the Group of Picture (GOP) level, picture level, or tile level (a division of a picture). This reduces latency and enables more real-time performance.

[0435] Since multiple video data sets depict essentially the same scene, the server may manage and / or instruct the video data captured by each terminal to reference each other. Alternatively, the server may receive the encoded data from each terminal, change the reference relationships between the multiple data sets, or correct or replace the pictures themselves and re-encode them. This allows for the creation of a stream with improved quality and efficiency for each individual data set.

[0436] Furthermore, the server may transcode the video data to change its encoding method before distributing it. For example, the server may convert an MPEG-based encoding to a VP-based encoding (e.g., VP9), or convert H.264 to H.265, etc.

[0437] Thus, the encoding process can be performed by a terminal or one or more servers. Therefore, in the following, the terms "server" or "terminal" will be used to refer to the entity performing the processing, but some or all of the processing performed by the server may be performed by the terminal, and some or all of the processing performed by the terminal may be performed by the server. The same applies to the decoding process.

[0438] [3D, Multi-angle] It is becoming increasingly common to integrate and utilize images or videos of different scenes, or the same scene, captured from different angles, by multiple cameras ex113 and / or smartphones ex115, which are nearly synchronized with each other. Videos captured by each device can be integrated based on the relative positional relationship between the devices, or on areas where feature points contained in the video coincide.

[0439] The server may not only encode two-dimensional video but also encode still images automatically based on scene analysis of the video, or at a time specified by the user, and transmit them to the receiving terminal. Furthermore, if the server can obtain the relative positional relationship between the shooting terminals, it can generate a three-dimensional shape of the scene based not only on two-dimensional video but also on video of the same scene taken from different angles. The server may separately encode three-dimensional data generated by a point cloud or the like, or it may select or reconstruct video from video taken by multiple terminals to transmit to the receiving terminal based on the results of recognizing or tracking a person or object using the three-dimensional data.

[0440] In this way, users can enjoy scenes by arbitrarily selecting each video corresponding to each shooting terminal, or they can enjoy content in which a video from a selected viewpoint is extracted from 3D data reconstructed using multiple images or videos. Furthermore, along with the video, sound is also collected from multiple different angles, and the server may multiplex the sound from a specific angle or space with the corresponding video and transmit the multiplexed video and sound.

[0441] In recent years, content that links the real world with a virtual world, such as Virtual Reality (VR) and Augmented Reality (AR), has also become popular. In the case of VR images, the server may create separate viewpoint images for the right and left eyes and perform encoding that allows referencing between the viewpoint images using Multi-View Coding (MVC), or it may encode them as separate streams without referencing each other. When decoding the separate streams, it is advisable to synchronize playback so that the virtual 3D space is reproduced according to the user's viewpoint.

[0442] In the case of AR images, the server may superimpose virtual object information from the virtual space onto camera information from the real space, based on its three-dimensional position or the user's viewpoint movement. The decoding device may acquire or retain the virtual object information and three-dimensional data, generate a two-dimensional image according to the user's viewpoint movement, and create superimposed data by smoothly stitching them together. Alternatively, the decoding device may send the user's viewpoint movement to the server in addition to the request for virtual object information. The server may create superimposed data according to the viewpoint movement received from the three-dimensional data held by the server, encode the superimposed data, and distribute it to the decoding device. Typically, superimposed data has an α value indicating transparency in addition to RGB, and the server may set the α value of parts other than the object created from the three-dimensional data to 0, and encode the data in a state where those parts are transparent. Alternatively, the server may set predetermined RGB values ​​as the background, like in chroma keying, and generate data where parts other than the object are the background color. The predetermined RGB values ​​may be predetermined.

[0443] Similarly, the decryption process of the distributed data can be performed by the client (e.g., a terminal), the server, or a shared task between them. For example, one terminal may send a reception request to the server, another terminal may receive the content corresponding to that request, decrypt it, and then transmit the decrypted signal to a device with a display. By distributing the processing and selecting appropriate content regardless of the performance of the communication-capable terminals themselves, it is possible to play back data with high image quality. Another example is that while receiving large image data on a TV or similar device, a portion of the picture, such as tiles, may be decrypted and displayed on the viewer's personal terminal. This allows for sharing the overall picture while simultaneously allowing users to check their own area of ​​responsibility or areas they wish to examine in more detail.

[0444] In situations where multiple short-range, medium-range, or long-range wireless communication networks are available both indoors and outdoors, it may be possible to seamlessly receive content using distribution system standards such as MPEG-DASH. Users may freely select and switch in real time between decoding devices or display devices, such as their own terminals or displays located indoors or outdoors. Furthermore, decoding can be performed while switching between the decoding terminal and the display terminal using the user's location information. This makes it possible to map and display information on a part of the wall or ground of an adjacent building with a displayable device embedded, while the user is moving to their destination. It is also possible to switch the bitrate of the received data based on the ease of access to the encoded data on the network, such as when the encoded data is cached on a server that can be accessed quickly from the receiving terminal, or copied to an edge server in the content delivery service.

[0445] [Scalable encoding] Regarding content switching, we will explain using a scalable stream compressed and encoded using the video encoding method described in each of the embodiments above, as shown in Figure 74. The server may have multiple streams with the same content but different qualities as individual streams, but it may also be configured to switch content by taking advantage of the temporal / spatial scalability of the stream realized by encoding it in layers, as shown in the figure. In other words, the decoding side can freely switch between decoding low-resolution and high-resolution content by deciding which layer to decode according to internal factors such as performance and external factors such as the state of the communication bandwidth. For example, if a user was watching a video on their smartphone ex115 while on the go and wants to continue watching it on a device such as an internet TV after returning home, the device only needs to decode the same stream up to a different layer, thus reducing the burden on the server.

[0446] Furthermore, as described above, in addition to a configuration where each layer encodes a picture and scalability is achieved by an enhancement layer above the base layer, the enhancement layer may also include metadata based on image statistics. The decoding side may generate high-quality content by super-resolution the picture in the base layer based on the metadata. Super-resolution may improve the signal-to-noise ratio while maintaining and / or increasing the resolution. The metadata may include information for identifying linear or nonlinear filter coefficients used in the super-resolution process, or information for identifying parameter values ​​in the filtering process, machine learning, or least-squares operation used in the super-resolution process.

[0447] Alternatively, a configuration may be provided in which the picture is divided into tiles or the like according to the meaning of objects within the image. The decoding side decodes only a portion of the area by selecting the tiles to decode. Furthermore, by storing the attributes of the objects (people, cars, balls, etc.) and their positions in the image (coordinate positions within the same image, etc.) as metadata, the decoding side can identify the position of the desired object based on the metadata and determine the tile containing that object. For example, as shown in Figure 75, the metadata may be stored using a data storage structure different from the pixel data, such as the SEI (supplemental enhancement information) message in HEVC. This metadata indicates, for example, the position, size, or color of the main object.

[0448] Metadata may be stored in units consisting of multiple pictures, such as streams, sequences, or random access units. The decryption side can obtain information such as the time when a specific person appears in the video, and by combining the picture-level information with the time information, it can identify the picture in which the object exists and determine the object's position within the picture.

[0449] [Web page optimization] Figure 76 shows an example of a web page display screen on a computer ex111, etc. Figure 77 shows an example of a web page display screen on a smartphone ex115, etc. As shown in Figures 76 and 77, a web page may contain multiple linked images, which are links to image content, and their appearance may differ depending on the viewing device. When multiple linked images are visible on the screen, the display device (decoder) may display still images or I-pictures of each content as linked images until the user explicitly selects a linked image, or until a linked image approaches the center of the screen or the entire linked image is within the screen, or it may display a video such as a GIF animation using multiple still images or I-pictures, or it may receive only the base layer and decode and display the video.

[0450] When a linked image is selected by the user, the display device performs decoding, prioritizing the base layer, for example. If the HTML of the web page contains information indicating that the content is scalable, the display device may decode up to the enhancement layer. Furthermore, to ensure real-time performance, before selection or when the communication bandwidth is very limited, the display device can decode and display only forward-referenced pictures (I pictures, P pictures, and B pictures that only use forward references), thereby reducing the delay between the decoding time and the display time of the first picture (the delay from the start of content decoding to the start of display). In addition, the display device may deliberately ignore the reference relationships of the pictures and roughly decode all B pictures and P pictures using forward references, performing normal decoding as time passes and more pictures are received.

[0451] [Autonomous driving] Furthermore, when transmitting and receiving still image or video data, such as 2D or 3D map information, for autonomous driving or driving assistance of a vehicle, the receiving terminal may receive metadata such as weather or construction information in addition to image data belonging to one or more layers, and decode these in association with each other. The metadata may belong to a layer, or it may simply be multiplexed with the image data.

[0452] In this case, since the vehicle, drone, or airplane containing the receiving terminal is moving, the receiving terminal can transmit its own location information, enabling seamless reception and decoding while switching between base stations ex106 to ex110. Furthermore, the receiving terminal can dynamically switch how much metadata is received or how much map information is updated, depending on the user's selection, the user's situation, and / or the state of the communication bandwidth.

[0453] The content delivery system ex100 allows the client to receive, decode, and play back encoded information transmitted by the user in real time.

[0454] [Distribution of personal content] Furthermore, the ex100 content delivery system allows for unicast or multicast distribution of not only high-definition, long-duration content from video distribution companies, but also low-definition, short-duration content from individuals. It is expected that the amount of such individual content will continue to increase. To improve the quality of individual content, the server may perform editing before encoding. This can be achieved, for example, using a configuration like the following.

[0455] During shooting, or after shooting, the server performs recognition processing such as detecting shooting errors, searching for scenes, analyzing semantics, and detecting objects from the original image data or encoded data in real time. Based on the recognition results, the server manually or automatically edits the images, correcting out-of-focus or shaky images, deleting less important scenes such as those with lower brightness or out of focus compared to other pictures, emphasizing object edges, and altering color tones. The server then encodes the edited data based on the editing results. It is also known that viewership decreases if the shooting time is too long, so the server may automatically clip scenes with little movement, as well as less important scenes, based on the image processing results, to ensure that the content falls within a specific time range according to the shooting time. Alternatively, the server may generate and encode a digest based on the results of the semantic analysis of the scenes.

[0456] Personal content may contain elements that infringe on copyright, moral rights, or portrait rights, and the scope of sharing may exceed the intended scope, which can be inconvenient for the individual. Therefore, for example, the server may intentionally change the image to one that is out of focus, such as the faces of people at the edges of the screen or the interior of a house, before encoding. Furthermore, the server may recognize whether the face of a person other than those previously registered is visible in the image to be encoded, and if so, it may apply a mosaic effect to the face. Alternatively, as a pre-processing or post-processing step before encoding, the user may specify a person or background area that they want to process from a copyright perspective. The server may replace the specified area with another image or blur the focus. In the case of a person, the server can track the person in a video and replace the image of the person's face.

[0457] Viewing personal content with small data volumes requires real-time processing, so depending on the bandwidth, the decoder may prioritize receiving the base layer first and then decode and play it back. During this time, the decoder may receive the enhancement layer, and if playback is looped or if the content is played back more than once, it may play back the high-quality video including the enhancement layer. With a stream that uses this scalable encoding, it is possible to provide an experience where the video is rough when unselected or at the beginning of viewing, but gradually the stream becomes smarter and the image quality improves. In addition to scalable encoding, a similar experience can be provided even if the rough stream played back the first time and the second stream encoded by referencing the first video are configured as a single stream.

[0458] [Other examples of practical applications] Furthermore, these encoding or decoding processes are generally performed in the LSIex500 present in each terminal. The LSI (large scale integration circuitry) ex500 (see Figure 73) may be a single chip or a configuration consisting of multiple chips. Alternatively, video encoding or decoding software may be embedded in some recording medium (such as a CD-ROM, flexible disk, or hard disk) that can be read by a computer ex111, and the encoding or decoding process may be performed using that software. In addition, if the smartphone ex115 has a camera, video data acquired by that camera may be transmitted. This video data may be data encoded by the LSIex500 present in the smartphone ex115.

[0459] The LSIex500 may also be configured to be activated by downloading application software. In this case, the terminal first determines whether it supports the content encoding method or whether it has the capability to perform the specific service. If the terminal does not support the content encoding method or does not have the capability to perform the specific service, the terminal may download a codec or application software and then acquire and play the content.

[0460] Furthermore, not only the content supply system ex100 via the Internet ex101, but also digital broadcasting systems can incorporate at least one of the video encoding device (image encoding device) or video decoding device (image decoding device) of each of the above embodiments. While the content supply system ex100 has a configuration that is more suited to multicast than unicast, as it transmits and receives multiplexed data with video and sound multiplexed onto broadcast radio waves using satellites, etc., the encoding and decoding processes are similar and can be applied in the same way.

[0461] [Hardware configuration] Figure 78 shows further details of the smartphone ex115 shown in Figure 73. Figure 79 shows an example of the configuration of the smartphone ex115. The smartphone ex115 includes an antenna ex450 for transmitting and receiving radio waves with the base station ex110, a camera unit ex465 capable of taking video and still images, and a display unit ex458 that displays video captured by the camera unit ex465 and data decoded from video received by the antenna ex450. The smartphone ex115 further includes an operation unit ex466, which is a touch panel, an audio output unit ex457, which is a speaker for outputting voice or sound, an audio input unit ex456, which is a microphone for inputting voice, a memory unit ex467 capable of storing captured video or still images, recorded audio, received video or still images, encoded data such as emails, or decoded data, and a slot unit ex464, which is an interface unit with SIM ex468 for identifying the user and authenticating access to various data, including the network. External memory may be used instead of the memory unit ex467.

[0462] The main control unit ex460, which can comprehensively control the display unit ex458 and the operation unit ex466, is connected to the power supply circuit unit ex461, the operation input control unit ex462, the video signal processing unit ex455, the camera interface unit ex463, the display control unit ex459, the modulation / demodulation unit ex452, the multiplexing / decompression unit ex453, the audio signal processing unit ex454, the slot unit ex464, and the memory unit ex467 via the synchronization bus ex470.

[0463] The power supply circuit unit ex461, when the power key is turned on by the user, starts up the smartphone ex115 into an operational state and supplies power to each component from the battery pack.

[0464] The smartphone ex115 performs tasks such as voice calls and data communication based on the control of the main control unit ex460, which has a CPU, ROM, RAM, etc. During a call, the voice signal picked up by the voice input unit ex456 is converted into a digital voice signal by the voice signal processing unit ex454, spread spectrum processing is performed by the modulation / demodulation unit ex452, digital-to-analog conversion and frequency conversion processing are performed by the transmission / reception unit ex451, and the resulting signal is transmitted via the antenna ex450. Received data is amplified, subjected to frequency conversion and analog-to-digital conversion processing, despread spectrum processing is performed by the modulation / demodulation unit ex452, converted into an analog voice signal by the voice signal processing unit ex454, and then output from the voice output unit ex457. In data communication mode, text, still images, or video data can be transmitted via the operation input control unit ex462 under the control of the main control unit ex460 based on operations such as those performed by the operation unit ex466 on the main unit. Similar transmission and reception processing is performed. When transmitting video, still images, or video and audio in data communication mode, the video signal processing unit ex455 compresses and encodes the video signal stored in the memory unit ex467 or the video signal input from the camera unit ex465 using the video encoding method shown in each of the above embodiments, and sends the encoded video data to the multiplexing / decoding unit ex453. The audio signal processing unit ex454 encodes the audio signal picked up by the audio input unit ex456 while the camera unit ex465 is capturing video or still images, and sends the encoded audio data to the multiplexing / decoding unit ex453. The multiplexing / decoding unit ex453 multiplexes the encoded video data and encoded audio data in a predetermined manner, performs modulation and conversion processing in the modulation / demodulation unit (modulation / demodulation circuit unit) ex452 and the transmission / reception unit ex451, and transmits via the antenna ex450. The predetermined manner may be set in advance.

[0465] When receiving video attached to an email or chat, or video linked to a webpage, etc., the multiplexing / decomposition unit ex453 separates the multiplexed data received via antenna ex450, dividing it into a video data bitstream and an audio data bitstream. It then supplies the encoded video data to the video signal processing unit ex455 and the encoded audio data to the audio signal processing unit ex454 via the synchronization bus ex470. The video signal processing unit ex455 decodes the video signal using a video decoding method corresponding to the video encoding method shown in each of the above embodiments, and the video or still image contained in the linked video file is displayed from the display unit ex458 via the display control unit ex459. The audio signal processing unit ex454 decodes the audio signal, and the audio is output from the audio output unit ex457. As real-time streaming is becoming increasingly widespread, audio playback may be socially inappropriate depending on the user's situation. Therefore, as an initial setting, it is preferable to play only the video data without playing the audio signal, and to synchronize the audio playback only when the user performs an action such as clicking on the video data.

[0466] While the smartphone ex115 was used as an example here, other implementation forms are possible for terminals, such as a transmitting terminal with only an encoder and a receiving terminal with only a decoder, in addition to a transmitting / receiving terminal that has both an encoder and a decoder. In the explanation for digital broadcasting systems, multiplexed data in which audio data is multiplexed with video data is received or transmitted. However, the multiplexed data may also contain text data related to the video in addition to audio data. Furthermore, the video data itself may be received or transmitted instead of multiplexed data.

[0467] Although it was explained that the main control unit ex460, including the CPU, controls the encoding or decoding process, various terminals often have a GPU. Therefore, a configuration that leverages the GPU's performance to process a wide area at once using memory shared by the CPU and GPU, or memory whose addresses are managed so that it can be used in common, is also possible. This can shorten the encoding time, ensure real-time performance, and achieve low latency. In particular, it is efficient to perform motion detection, deblocking filters, SAO (Sample Adaptive Offset), and transformation / quantization processes at once on the GPU, rather than on the CPU, in units such as pictures.

Claims

1. Circuits and, The circuit comprises a memory connected to the aforementioned circuit, In operation, the aforementioned circuit Using a first motion vector, which is a single predicted motion vector, we predict the first set of pixels for a first partition of an image block that has a non-rectangular shape. Using a second motion vector, which is a single predicted motion vector, a second set of pixels for a second partition having a non-rectangular shape in the image block is predicted. For a plurality of pixels in the first portion where the first partition and the second partition overlap, the first pixel set and the second pixel set are weighted. The first motion vector and the second motion vector are stored in the memory as a dual prediction motion vector and as the motion vector of the first portion. The first partition is encoded using at least a plurality of weighted pixels of the first portion. Image encoding device.

2. Circuits and, The circuit comprises a memory connected to the aforementioned circuit, In operation, the aforementioned circuit Using a first motion vector, which is a single predicted motion vector, we predict the first set of pixels for a first partition of an image block that has a non-rectangular shape. Using a second motion vector, which is a single predicted motion vector, a second set of pixels for a second partition having a non-rectangular shape in the image block is predicted. For a plurality of pixels in the first portion where the first partition and the second partition overlap, the first pixel set and the second pixel set are weighted. The first motion vector and the second motion vector are stored in the memory as a dual prediction motion vector and as the motion vector of the first portion. The first partition is decoded using at least a plurality of pixels of the weighted first portion. Image decoding device.

3. Circuits and, The circuit comprises a memory connected to the aforementioned circuit, In operation, the aforementioned circuit Using a first motion vector, which is a single predicted motion vector, we predict the first set of pixels for a first partition of an image block that has a non-rectangular shape. Using a second motion vector, which is a single predicted motion vector, a second set of pixels for a second partition having a non-rectangular shape in the image block is predicted. For a plurality of pixels in the first portion where the first partition and the second partition overlap, the first pixel set and the second pixel set are weighted. The first motion vector and the second motion vector are stored in the memory as a dual prediction motion vector and as the motion vector of the first portion. The first partition is encoded using at least a plurality of weighted pixels of the first portion, A bitstream is generated that includes information used to encode the image block using the first partition. Bitstream generator.