Transmitting device and transmitting method
The patent addresses inefficiencies in video coding by determining the division of VPDUs and predicting chrominance samples with or without luminance samples, enhancing coding efficiency and image quality while reducing processing resources.
Patent Information
- Application Number
- JP2024100081
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-06-21
- Filing Date
- 2024-06-21
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-06-18
AI Technical Summary
Existing video coding technologies face challenges in efficiently encoding and decoding blocks using predicted chrominance samples, particularly in handling the increasing amount of digital video data, and there is a need for improvements in coding efficiency, image quality, and reduction of processing resources.
A transmitting device and method that determines whether to divide virtual pipeline decoding units (VPDUs) into smaller blocks and predicts chrominance samples with or without using luminance samples, generating a bitstream for encoding and transmission based on these decisions.
Improves coding efficiency, image quality, and reduces processing resource usage and circuit scale by optimizing the prediction of chrominance samples based on the division of VPDUs.
Smart Images

Figure 0007711270000004 
Figure 0007711270000005 
Figure 0007711270000006
Abstract
Description
Technical Field
[0001] The present disclosure relates to video coding, and more particularly to video encoding and decoding systems and components, such as encoding blocks using predicted chrominance samples, and video encoding and decoding methods.
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). Along with this progress, there is always a need to provide improvements and optimizations to video coding technology to handle the ever-increasing amount of digital video data in various applications. The present disclosure relates to further progress, improvements, and optimizations in video coding, particularly in the encoding of blocks using predicted chrominance samples.
Summary of the Invention
Means for Solving the Problems
[0003] In one aspect, a transmitting device includes a circuit and a memory connected to the circuit. The circuit determines whether to divide a first VPDU (virtual pipeline decoding unit) into smaller blocks and whether to divide a second VPDU into smaller blocks. For a determination of not dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted without using luminance samples. For a determination of dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted using luminance samples. For a determination of not dividing the first VPDU into smaller blocks and not dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted using luminance samples. The block is encoded using the predicted chrominance samples. A bitstream including the encoded block is generated. The generated bitstream is transmitted.
[0004] In one aspect, a transmitting method determines whether to divide a first VPDU (virtual pipeline decoding unit) into smaller blocks and whether to divide a second VPDU into smaller blocks. For a determination of not dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted without using luminance samples. For a determination of dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted using luminance samples. For a determination of not dividing the first VPDU into smaller blocks and not dividing the second VPDU into smaller blocks, a block of chrominance samples is predicted using luminance samples. The block is encoded using the predicted chrominance samples. A bitstream including the encoded block is generated. The generated bitstream is transmitted.
[0005] In video coding technology, new methods are desired to improve coding efficiency, image quality, reduce circuit scale, etc. Implementations of each embodiment in the present disclosure, including the components of the embodiments of the present disclosure considered alone or in various combinations, enable, for example, at least any one of improvement of coding efficiency, improvement of image quality, reduction of encoding / decoding processing resource usage, reduction of circuit scale, or improvement of encoding / decoding processing speed.
[0006] In addition, implementations of each embodiment in the present disclosure, including the components of the embodiments of the present disclosure considered alone or in various combinations, enable appropriate selection of components / operations such as filters, blocks, sizes, motion vectors, reference pictures, reference blocks, etc. in encoding and decoding. Note that the present disclosure also includes disclosure of configurations or methods that can provide benefits other than those described above. For example, a configuration or method that improves coding efficiency while suppressing an increase in processing resource usage.
[0007] Further advantages and effects in the disclosed embodiments will be apparent from the specification and the drawings. Such advantages and / or effects can be obtained by several embodiments and the features described in the specification and the drawings respectively, but not all are necessarily provided to obtain one or more advantages and / or effects.
[0008] Note that these general or specific embodiments may be implemented in a system, a method, an integrated circuit, a computer program, or a recording medium, or may be implemented in any combination of a system, a method, an integrated circuit, a computer program, and a recording medium.
Brief Description of the Drawings
[0009]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13A
Figure 13B
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
Figure 22
Figure 23A
Figure 23B
Figure 23C
Figure 23D
Figure 23E
Figure 23F
Figure 23G
Figure 24
Figure 25
Figure 26
Figure 27
Figure 28
Figure 29
Figure 30
Figure 31
Figure 32
Figure 33
Figure 34
Figure 35
Figure 36
Figure 37
Figure 38A
Figure 38B
Figure 39
Figure 40
Figure 41
Figure 42
Figure 43
Figure 44
Figure 45
Figure 46A
Figure 46B
Figure 47A
Figure 47B
Figure 47C
Figure 48A
Figure 48B
Figure 49A
Figure 49B
Figure 50
Figure 51
Figure 52A
Figure 52B
Figure 52C
Figure 53
Figure 54
Figure 55
Figure 56
Figure 57
Figure 58A
Figure 58B
Figure 59
Figure 60
Figure 61
Figure 62
Figure 63
Figure 64
Figure 65
Figure 66A
Figure 66B
Figure 67
Figure 68
Figure 69
Figure 70
Figure 71
Figure 72
Figure 73
Figure 74
Figure 75
Figure 76
Figure 77
Figure 78
Figure 79
Figure 80
Figure 81
Figure 82
Figure 83
Figure 84
Figure 85
Figure 86
Figure 87
Figure 88
Figure 89
Figure 90
Figure 91
Figure 92
Figure 93
Figure 94
Figure 95
Figure 96
Figure 97
Figure 98
Figure 99
Figure 100
Figure 101
Figure 102
Figure 103
Figure 104
Figure 105
Figure 106
Figure 107
Figure 108
Figure 109
Figure 110
Figure 111
Figure 112
Figure 113
Figure 114
Figure 115
Figure 116
DETAILED DESCRIPTION OF THE INVENTION
[0010] In the drawings, unless otherwise indicated, the same reference numerals denote the same or similar components. Also, the sizes and relative positions of the components in the drawings are not necessarily drawn to a fixed scale.
[0011] Hereinafter, embodiments will be specifically described with reference to the drawings. Note that the embodiments described below are all examples showing comprehensive or specific examples. The numerical values, shapes, materials, components, arrangement positions and connection forms of the components, steps, relationships and orders of the steps, etc. shown in the following embodiments are merely examples and are not intended to limit the scope of the claims.
[0012] Hereinafter, embodiments of an encoding device and a decoding device will be described. The embodiments are examples of an encoding device and a decoding device to which the processes and / or configurations described in each aspect of the present disclosure are applicable. The processes and / or configurations can also be implemented in encoding devices and decoding devices different from the embodiments. For example, with respect to the processes and / or configurations applied to the embodiments, any of the following may be implemented.
[0013] (1) Any one of a plurality of components of the encoding device or the decoding device of the embodiment described in each aspect of the present disclosure may be replaced or combined with any other component described in any aspect of the present disclosure.
[0014] (2) In the encoding device or the decoding device of the embodiment, arbitrary changes such as addition, replacement, or deletion of functions or processes may be made to the functions or processes performed by some of the plurality of components of the encoding device or the decoding device. For example, any function or process may be replaced or combined with any other function or process described in any aspect of the present disclosure.
[0015] (3) In the method implemented by the encoding device or the decoding device of the embodiment, arbitrary changes such as addition, replacement, and deletion may be made to some of the plurality of processes included in the method. For example, any process in the method may be replaced or combined with any other process described in any aspect of the present disclosure.
[0016] (4) Some of the plurality of components constituting the encoding device or the decoding device of the embodiment may be combined with the components described in any aspect of the present disclosure, or may be combined with components having a part of the functions described in any aspect of the present disclosure, or may be combined with components that implement a part of the processes implemented by the components described in each aspect of the present disclosure.
[0017] (5) A component that includes a part of the function of the encoding device or decoding device of the embodiment, or a component that implements a part of the processing of the encoding device or decoding device of the embodiment, may be combined or replaced with a component described in any of the aspects of the present disclosure, a component that includes a part of the function described in any of the aspects of the present disclosure, or a component that implements a part of the processing described in any of the aspects of the present disclosure.
[0018] (6) In the method implemented by the encoding device or decoding device of the embodiment, any one of the plurality of processes included in the method may be replaced or combined with the process described in any of the aspects of the present disclosure, or any similar process.
[0019] (7) Some of the plurality of processes included in the method implemented by the encoding device or decoding device of the embodiment may be combined with the process described in any of the aspects of the present disclosure.
[0020] (8) The manner of implementing the processes and / or configurations described in each aspect of the present disclosure is not limited to the encoding device or decoding device of the embodiment. For example, the processes and / or configurations may be implemented in a device used for a purpose different from the moving image encoding or moving image decoding disclosed in the embodiment.
[0021] [Definition of Terms] Each term may be defined as follows as an example.
[0022] An image is a unit of data composed of a set of pixels and consists of pictures or blocks smaller than a picture. Images include still images as well as moving images.
[0023] A picture is a processing unit of an image composed of a set of pixels and may also be called a frame or a field. A picture may take the form of, for example, a luminance sample array in monochrome format, or a luminance sample array in 4:2:0, 4:2:2, and 4:4:4 color formats as well as two corresponding chrominance sample arrays.
[0024] A block is a processing unit of a set containing a specific number of pixels. Also, the shape of the block is not limited. For example, it includes rectangles consisting of M×N pixels, squares consisting of M×M pixels, as well as triangles, circles, and other shapes. Examples of blocks are slices, tiles, bricks, CTUs, super blocks, basic division units, VPDUs, hardware processing division units, CUs, processing block units, prediction block units (PUs), orthogonal transform block units (TUs), units, sub-blocks, etc. A block may take the form of an M×N array of samples or an M×N array of transform coefficients. For example, a block may be a square or rectangular area of pixels containing one luminance matrix and two chrominance matrices.
[0025] A pixel or a sample is the smallest unit point that constitutes an image. A pixel or a sample includes not only pixels at integer positions but also pixels at sub-pixel positions generated based on pixels at integer positions.
[0026] A pixel value or a sample value is a unique value that a pixel has. A pixel value or a sample value includes one or more luminance values, chrominance values, RGB gradations, as well as depth values, or binary values such as 0 and 1.
[0027] Chroma (or chrominance) is the intensity of color and is usually represented by the symbols Cb and Cr, indicating that a sample array value or a single sample value represents a value of one of the two color difference signals related to the primary colors.
[0028] Luma or luminance is the brightness of an image and is usually represented by a symbol, or a subscripted Y or L, indicating that a sample array value or a single sample value represents a monochrome signal value related to the primary colors.
[0029] A flag includes not only 1 bit but also cases of multiple bits and may be, for example, a parameter or index value. Also, a flag may be a binary flag indicating two values of the flag or may indicate non-binary values of a parameter.
[0030] A signal transmits information symbolized or encoded by the signal. Signals include discretized digital signals and analog signals taking continuous values.
[0031] A stream or bitstream is a digital data string of a digital data flow. A stream or bitstream may be composed of a single stream or multiple streams divided into multiple layers. Also, it may be transmitted by serial communication on a single transmission path or by packet communication on multiple transmission paths.
[0032] Difference or differential refers to various mathematical differences such as simple difference (x - y), absolute value of difference (|x - y|), squared difference (x^2 - y^2), square root of difference (√(x - y)), weighted difference (ax - by: a, b are constants), offset difference (x - y + a: a is an offset), etc. In the case of a scalar quantity, a simple difference is sufficient and an operation of difference may be included.
[0033] Sum refers to various mathematical sums such as simple sum (x + y), absolute value of sum (|x + y|), squared sum (x^2 + y^2), square root of sum (√(x + y)), weighted sum (ax + by: a, b are constants), offset sum (x + y + a: a is an offset), etc. In the case of a scalar quantity, a simple sum is sufficient and an operation of sum may be included.
[0034] The frame is a combination of the top field and the bottom field. Sample lines 0, 2, 4, … are from the top field, and sample lines 1, 3, 5, … are from the bottom field.
[0035] A slice is an integral number of coding tree units, and the integral number of coding tree units includes one independent slice segment and subsequent dependent slice segments, including all dependent slice segments (if any) preceding the next independent slice segment (if any) within the same access unit.
[0036] A tile is a rectangular region of coding tree blocks within a specific tile column and a specific tile row of a picture. A tile may be a rectangular region of a frame. Although tiles are intended to be independently decodable and encodable, a loop filter spanning tile edges may still be applied.
[0037] A coding tree unit (CTU) may be a coding tree block of luminance samples of a picture having three sample arrays, or two corresponding coding tree blocks of chroma samples. Alternatively, a CTU may be a coding tree block of samples of one of a monochrome picture and a picture encoded using a syntax structure and three separate color planes used for sample coding. A superblock may be a square block of 64×64 pixels, consisting of one or two mode information blocks, or recursively divided into four 32×32 blocks each of which is further dividable.
[0038] [System Configuration] First, a transmission system according to an embodiment will be described. FIG. 1 is a schematic diagram showing an example of the configuration of a transmission system 400 according to this embodiment.
[0039] The transmission system 400 is a system that transmits a stream generated by encoding an image and decodes the transmitted stream. As shown in the figure, the transmission system 400 includes, for example, as shown in FIG. 1, an encoding device 100, a network 300, and a decoding device 200.
[0040] An image is input to the encoding device 100. The encoding device 100 generates a stream by encoding the input image and outputs the stream to the network 300. The stream includes, for example, the encoded image and control information for decoding the encoded image. The image is compressed by this encoding.
[0041] Note that the image before being encoded by the encoding device 100 is also called the original image, original signal, or original sample. Also, the image may be a moving image or a still image. Further, the image is a higher concept such as a sequence, a picture, and a block, and is not subject to spatial and temporal region limitations unless otherwise specified. Also, the image consists of an array of pixels or pixel values, and the signal representing the image, or the pixel values, are also called samples. Also, the stream may be called a bit stream, an encoded bit stream, a compressed bit stream, or an encoded signal. Furthermore, the encoding device 100 may be called an image encoding device or a moving image encoding device, and the encoding method by the encoding device 100 may be called an encoding method, an image encoding method, or a moving image encoding method.
[0042] The network 300 transmits the stream generated by the encoding device 100 to the decoding device 200. The network 300 is the Internet, a wide area network (WAN: Wide It may be a wide area network (WAN), a local area network (LAN), or a combination thereof. The network 300 is not necessarily limited to a two-way communication network, and may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcasting or satellite broadcasting. Further, the network 300 may be replaced by a storage medium that records a stream such as a DVD (Digital Versatile Disc) or a BD (Blue-Ray Disc (registered trademark)).
[0043] The decoding device 200 generates a decoded image, which is, for example, an uncompressed image, by decoding the stream transmitted by the network 300. For example, the decoding device decodes the stream according to a decoding method corresponding to the encoding method by the encoding device 100.
[0044] Note that the decoding device 200 may be referred to as an image decoding device or a moving image decoding device, and the decoding method by the decoding device 200 may be referred to as a decoding method, an image decoding method, or a moving image decoding method.
[0045] [Data Structure] FIG. 2 is a conceptual diagram showing an example of the hierarchical structure of data in a stream. For convenience, FIG. 2 will be described with reference to the transmission system 400 of FIG. 1. The stream includes, for example, a video sequence. This video sequence includes, for example, as shown in FIG. 2(a), one or more VPSs (Video Parameter Sets), one or more SPSs (Sequence Parameter Sets), one or more PPSs (Picture Parameter Sets), SEI (Supplemental Enhancement Information), and a plurality of pictures.
[0046] The VPS may include encoding parameters common to a plurality of layers in a moving image composed of a plurality of layers, and encoding parameters related to the plurality of layers or individual layers included in the moving image.
[0047] The SPS includes parameters used for a sequence, that is, encoding parameters that a decoding device 200 refers to for decoding the sequence. For example, the encoding parameters may indicate the width or height of a picture. Note that there may be multiple SPSs.
[0048] The PPS includes parameters used for a picture, that is, encoding parameters that a decoding device 200 refers to for decoding each picture in the sequence. For example, the encoding parameters may include a reference value of a quantization width used for decoding the picture and a flag indicating application of weighted prediction. Note that there may be multiple PPSs. Also, the SPS and the PPS may simply be called a parameter set in some cases.
[0049] As shown in FIG. 2(b), a picture may include a picture header and one or more slices. The picture header includes encoding parameters that a decoding device 200 refers to for decoding the one or more slices.
[0050] As shown in FIG. 2(c), a slice includes a slice header and one or more blocks. The slice header includes encoding parameters that a decoding device 200 refers to for decoding the one or more blocks.
[0051] As shown in FIG. 2(d), a block includes one or more CTUs (Coding Tree Unit).
[0052] Note that a picture may not include slices and instead may include tile groups. In this case, a tile group includes one or more tiles. Also, a slice may be included in a block.
[0053] The CTU is also called a super block or a basic division unit. As shown in Fig. 2(e), the CTU includes a CTU header and one or more CUs (Coding Units). As shown in the figure, the CTU includes four CUs: CU(10), CU(11), CU(12), and CU(13). The CTU header includes coding parameters that the decoding device 200 refers to for decoding one or more CUs.
[0054] The CU may be divided into a plurality of smaller CUs. As shown in the figure, CU(10) is not divided into smaller CUs, CU(11) is divided into four smaller CUs: CU(110), CU(111), CU(112), and CU(113), CU(12) is not divided into smaller CUs, and CU(13) is divided into seven smaller CUs: CU(1310), CU(1311), CU(1312), CU(1313), CU(132), CU(133), and CU(134). Also, as shown in Fig. 2(f), the CU includes a CU header, prediction information, and residual coefficient information. The prediction information is information for predicting the CU, and the residual coefficient information is information indicating the prediction residual described later. Note that the CU is basically the same as the PU (Prediction Unit) and TU (Transform Unit), but for example, in the SBT (sub-block transform) described later, it may include a plurality of TUs smaller than the CU. Also, the CU may be processed for each VPDU (Virtual Pipeline Decoding Unit) that constitutes the CU. The VPDU is a fixed unit that can be processed in one stage, for example, when performing pipeline processing in hardware.
[0055] Note that the stream does not necessarily have all the layers shown in FIG. 2. Also, the order of these layers may be swapped, and any layer may be replaced by another layer. Further, a picture that is the target of processing currently performed by a device such as the encoding device 100 or the decoding device 200 is referred to as a current picture. If the processing is encoding, the current picture is synonymous with the picture to be encoded, and if the processing is decoding, the current picture is synonymous with the picture to be decoded. Also, a block such as a CU or a CU that is the target of processing currently performed by a device such as the encoding device 100 or the decoding device 200 is referred to as a current block. If the processing is encoding, the current block is synonymous with the block to be encoded, and if the processing is decoding, the current block is synonymous with the block to be decoded.
[0056] [Picture Composition: Slice / Tile] To perform picture encoding / decoding in parallel, a picture may be composed of slices or tiles.
[0057] A slice is a basic encoding unit that constitutes a picture. A picture is composed of, for example, one or more slices. Also, a slice consists of one or more CTUs.
[0058] FIG. 3 is a conceptual diagram showing an example of the configuration of slices. For example, in FIG. 3, the picture includes 11×8 CTUs and is divided into four slices (Slices 1-4). Slice 1 consists of, for example, 16 CTUs, Slice 2 consists of, for example, 21 CTUs, Slice 3 consists of, for example, 29 CTUs, and Slice 4 consists of, for example, 22 CTUs. Here, each CTU in the picture belongs to one of the slices. The shape of the slice is in the form of dividing the picture horizontally. The boundary of the slice does not have to be at the edge of the screen and can be anywhere among the boundaries of the CTUs within the screen. The processing order (encoding order or decoding order) of the CTUs in the slice is, for example, the raster scan order. Also, a slice includes a slice header and encoded data. The slice header may describe the characteristics of the slice such as the CTU address at the start of the slice and the slice type.
[0059] A tile is a unit of a rectangular area that makes up a picture. A number called TileId may be assigned to the tiles of the picture in the raster scan order.
[0060] FIG. 4 is a conceptual diagram showing an example of the configuration of tiles. For example, in FIG. 4, the picture includes 11×8 CTUs and is divided into four rectangular area tiles (Tiles 1-4). When tiles are used, the processing order of the CTUs may be different compared to when tiles are not used. When tiles are not used, usually, a plurality of CTUs in the picture are processed, for example, in the raster scan order. When tiles are used, in each of the plurality of tiles, at least one CTU is processed, for example, in the raster scan order. For example, as shown in FIG. 4, the processing order of the plurality of CTUs included in Tile 1 is from the left end of the first column of Tile 1 to the right end of the first column of Tile 1, and then from the left end of the second column of Tile 1 to the right end of the second column of Tile 1.
[0061] Note that one tile may include one or more slices, and one slice may include one or more tiles.
[0062] Note that the picture may be composed of tile sets. A tile set may include one or more tile groups and may include one or more tiles. The picture may be composed of any one of a tile set, a tile group, and a tile. For example, the order of scanning a plurality of tiles in raster order for each tile set is defined as the basic encoding order of the tiles. A collection of one or more tiles with consecutive basic encoding orders within each tile set is defined as a tile group. Such a picture may be composed by a splitting unit 102 (see FIG. 7) described later.
[0063] [Scalable Encoding] FIGS. 5 and 6 are conceptual diagrams showing an example of the configuration of a scalable stream, and will be described with reference to FIG. 1 for convenience.
[0064] As shown in FIG. 5, the symbolization device 100 may generate a temporally / spatially scalable stream by dividing each of a plurality of pictures into one of a plurality of layers and symbolizing them. For example, the symbolization device 100 realizes scalability in which an enhancement layer exists above a base layer by symbolizing pictures for each layer. The symbolization of each such picture is called scalable symbolization. Thereby, the decoding device 200 can switch the image quality of the image displayed by decoding the stream. That is, the decoding device 200 may determine up to which layer to decode according to internal factors such as its own performance and external factors such as the state of the communication band. As a result, the decoding device 200 can freely switch and decode the same content into low-resolution content and high-resolution content. For example, a user of the stream watches a moving image of the stream partway through using a smartphone while moving, and watches the continuation of the moving image using a device such as an Internet TV after returning home. Note that a decoding device 200 with the same or different performance is incorporated in each of the above-described smartphone and device. In this case, if the device decodes up to the upper layer of the stream, the user can watch a high-quality moving image after returning home. Thereby, the symbolization device 100 does not need to generate a plurality of streams with the same content but different image qualities, and can reduce the processing load.
[0065] Furthermore, the enhancement layer may include meta information based on statistical information of the image or the like. The decoding device 200 may generate a moving image with improved image quality by super-resolving the picture of the base layer based on the meta information. Super-resolution may be, for example, an improvement in the signal-to-noise ratio at the same resolution, an enlargement of the resolution, or the like. The meta information may include information for specifying linear or non-linear filter coefficients used for super-resolution processing, or information for specifying parameter values in filter processing, machine learning, or least squares operation used for super-resolution processing.
[0066] In the embodiment, according to the meaning of each object in the picture or the like, the picture may be divided into tiles or the like. In this case, the decoding device 200 may decode only a partial area of the picture by selecting the tile to be decoded. Also, the attributes of the object (such as a person, a car, a ball), and the position within the picture (such as the coordinate position in the same picture) may be stored as meta information. In this case, the decoding device 200 can identify the position of the desired object based on the meta information and determine the tile including the object. For example, as shown in FIG. 6, the meta information is stored using a data storage structure different from the image data, such as the SEI (supplemental enhancement information) message in HEVC. This meta information indicates, for example, the position, size, or color of the main object.
[0067] Also, the meta information may be stored in units composed of a plurality of pictures, such as a stream, a sequence, or a random access unit. Thereby, the decoding device 200 can obtain the time when a specific person appears in the moving image, etc., and by using the time and the picture unit information, can identify the picture in which the object (person) exists and the position of the object within that picture.
[0068] [Encoding device] Next, the encoding device according to the embodiment will be described. FIG. 7 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 a moving image in block units.
[0069] As shown in FIG. 7, the encoding device 100 is a device that encodes an image in block units, and includes a division 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 block memory 118, a loop filter unit 120, a frame memory 122, an intra prediction unit 124, an inter prediction unit 126, a prediction control unit 128, and a prediction parameter generation unit 130. As shown in the figure, each of the intra prediction unit 124 and the inter prediction unit 126 is a part of the prediction control unit.
[0070] The encoding device 100 is realized by, for example, a general-purpose processor and a memory. In this case, when a software program stored in the memory is executed by the processor, the processor functions as the division unit 102, the subtraction unit 104, the conversion unit 106, the quantization unit 108, the entropy encoding unit 110, the inverse quantization unit 112, the inverse conversion unit 114, the addition unit 116, the loop filter unit 120, the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. Further, the encoding device 100 may be realized as one or more dedicated electronic circuits corresponding to the division unit 102, the subtraction unit 104, the conversion unit 106, the quantization unit 108, the entropy encoding unit 110, the inverse quantization unit 112, the inverse conversion unit 114, the addition unit 116, the loop filter unit 120, the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128.
[0071] [Implementation Example of Encoding Device] FIG. 8 is a functional block diagram showing an implementation example of the encoding device 100. The encoding device 100 includes a processor a1 and a memory a2. For example, a plurality of components of the encoding device 100 shown in FIG. 7 are implemented by the processor a1 and the memory a2 shown in FIG. 8.
[0072] Processor a1 is a circuit that performs information processing and is a circuit connected to memory a2. For example, processor a1 is a dedicated or general-purpose electronic circuit that encodes images. Processor a1 may be a processor such as a CPU. Also, processor a1 may be an aggregate of multiple electronic circuits. Further, for example, processor a1 may play the roles of multiple components among the multiple components of the encoding device 100 shown in FIG. 7.
[0073] Memory a2 is a dedicated or general-purpose memory in which information for processor a1 to encode images is stored. Memory a2 may be an electronic circuit and may be connected to processor a1. Also, memory a2 may be included in processor a1. Further, memory a2 may be an aggregate of multiple electronic circuits. Also, memory a2 may be a magnetic disk, an optical disk, etc., or may be expressed as a storage or recording medium, etc. Also, memory a2 may be a non-volatile memory or a volatile memory.
[0074] For example, memory a2 may store the image to be encoded, or may store the bitstream corresponding to the encoded image. Also, memory a2 may store a program for processor a1 to encode images.
[0075] Also, for example, memory a2 may play the role of a component for storing information among the multiple components of the encoding device 100 shown in FIG. 7, etc. For example, memory a2 may play the roles of the block memory 118 and the frame memory 122 shown in FIG. 7. More specifically, memory a2 may store the reconstructed block, the reconstructed picture, etc.
[0076] Note that in the encoding device 100, not all of the plurality of components shown in FIG. 7 need to be implemented, and not all of the plurality of processes described herein need to be performed. A part of the plurality of components shown in FIG. 7 may be included in other devices, and a part of the plurality of processes described herein may be executed by other devices.
[0077] Hereinafter, after explaining the overall processing flow of the encoding device 100, each component included in the encoding device 100 will be described.
[0078] [Overall Flow of Encoding Process] FIG. 9 is a flowchart showing an example of the overall encoding process by the encoding device 100, and will be described with reference to FIG. 7 for convenience.
[0079] First, the splitting unit 102 of the encoding device 100 splits the pictures included in the input image into a plurality of blocks of a fixed size (for example, 128×128 pixels) (step Sa_1). Then, the splitting unit 102 selects a splitting pattern for the block of the fixed size (also called a block shape) (step Sa_2). That is, the splitting unit 102 further splits the block of the fixed size into a plurality of blocks that make up the selected splitting pattern. Then, the encoding device 100 performs the processes of steps Sa_3 to Sa_9 on each of the plurality of blocks (that is, the blocks to be encoded).
[0080] The prediction processing unit including the intra prediction unit 124 and the inter prediction unit 126 and the prediction control unit 128 generate a prediction image of the current block (step Sa_3). The prediction image may also be referred to as a prediction signal, a prediction block, or a prediction sample.
[0081] Next, the subtraction unit 104 generates the difference between the current block and the prediction image as a prediction residual (step Sa_4). The prediction residual may also be referred to as a prediction error.
[0082] Next, the conversion unit 106 and the quantization unit 108 generate a plurality of quantization coefficients by performing conversion and quantization on the predicted image (step Sa_5). The plurality of quantization coefficients may be called a coefficient block in some cases.
[0083] Next, the entropy encoding unit 110 generates a stream by performing encoding (specifically, entropy encoding) on the plurality of quantization coefficients and prediction parameters related to the generation of the predicted image (step Sa_6). The stream may be called an encoded bit stream or a compressed bit stream in some cases.
[0084] Next, the inverse quantization unit 112 and the inverse conversion unit 114 restore the prediction residual by performing inverse quantization and inverse conversion on the plurality of quantization coefficients (step Sa_7).
[0085] Next, the addition unit 116 reconstructs the current block by adding the predicted image to the restored prediction residual (step Sa_8). Thereby, a reconstructed image is generated. The reconstructed image may also be called a reconstructed block or a decoded image block.
[0086] When this reconstructed image is generated, the loop filter unit 120 performs filtering on the reconstructed image as necessary (step Sa_9).
[0087] Then, the encoding device 100 determines whether the encoding of the entire picture is completed (step Sa_10). If it is determined that the encoding is not completed (No in step Sa_10), the processing from step Sa_2 is repeatedly executed for the next block of the picture.
[0088] Note that in the above example, the encoding device 100 selects one splitting pattern for a fixed-size block and encodes each block according to the splitting pattern. However, each block may be encoded according to each of a plurality of splitting patterns. In this case, the encoding device 100 evaluates the cost for each of the plurality of splitting patterns, and for example, may select, as the output stream, the stream obtained by encoding according to the splitting pattern with the smallest cost.
[0089] As shown in the figure, the processes of these steps Sa_1 to Sa_10 are sequentially performed by the encoding device 100. Alternatively, a plurality of some of these processes may be performed in parallel, or the order may be changed.
[0090] The encoding process by such an encoding device 100 is a hybrid encoding using predictive encoding and transform encoding. Also, the predictive encoding is performed by an encoding loop including a subtraction unit 104, a transform unit 106, a quantization unit 108, an inverse quantization unit 112, an inverse transform unit 114, an addition unit 116, a loop filter unit 120, a block memory 118, a frame memory 122, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128. That is, the prediction processing unit including the intra prediction unit 124 and the inter prediction unit 126 constitutes a part of the encoding loop.
[0091] [Splitting Unit] The splitting unit 102 splits each picture included in the original image into a plurality of blocks and outputs each block to the subtraction unit 104. For example, the splitting unit 102 first splits the picture into blocks of a fixed size (for example, 128x128 pixels). Other fixed block sizes may be applied. These fixed-size blocks are sometimes called Coding Tree Units (CTUs). Then, the splitting unit 102 splits each of the fixed-size blocks into blocks of a variable size (for example, 64x64 pixels or less) based on, for example, recursive quadtree and / or binary tree block splitting. That is, the splitting unit 102 selects a splitting pattern. These variable-size blocks are sometimes called Coding Units (CUs), Prediction Units (PUs), or Transformation Units (TUs). Note that in various processing examples, it is not necessary to distinguish between CUs, PUs, and TUs, and some or all of the blocks in the picture may be processing units of CUs, PUs, or TUs.
[0092] FIG. 10 is a conceptual diagram showing an example of block splitting in the embodiment. In FIG. 10, solid lines represent block boundaries by quadtree block splitting, and dashed lines represent block boundaries by binary tree block splitting.
[0093] Here, the block 10 is a square block of 128x128 pixels (128x128 block). This 128x128 block 10 is first split into four square blocks of 64x64 pixels (quadtree block splitting).
[0094] The upper-left square block of 64x64 pixels is further vertically split into two rectangular blocks each consisting of 32x64 pixels, and the left rectangular block of 32x64 pixels is further vertically split into two rectangular blocks each consisting of 16x64 pixels (binary tree block splitting). As a result, the upper-left 64x64 pixel block is split into two 16x64 pixel rectangular blocks 11 and 12 and a 32x64 pixel rectangular block 13.
[0095] The 64x64 pixel block in the upper right is horizontally divided into two rectangular blocks 14 and 15, each consisting of 64x32 pixels (binary tree block division).
[0096] The 64x64 pixel square block in the lower left is divided into four square blocks, each consisting of 32x32 pixels (quad-tree block division). Among the four square blocks, each consisting of 32x32 pixels, the upper left block and the lower right block are further divided. The upper left 32x32 pixel square block is vertically divided into two rectangular blocks, each consisting of 16x32 pixels, and the right 16x32 pixel rectangular block is further horizontally divided into two square blocks, each consisting of 16x16 pixels (binary tree block division). The lower right 32x32 pixel square block is horizontally divided into two rectangular blocks, each consisting of 32x16 pixels (binary tree block division). As a result, the 64x64 pixel square block in the lower left is divided into a 16x32 pixel rectangular block 16, two 16x16 pixel square blocks 17 and 18, two 32x32 pixel square blocks 19 and 20, and two 32x16 pixel rectangular blocks 21 and 22.
[0097] The block 23 consisting of 64x64 pixels in the lower right is not divided.
[0098] As described above, in FIG. 10, the block 10 is divided into 13 variable-size blocks 11 to 23 based on recursive quad-tree and binary tree block division. This type of division is sometimes called QTBT (quad-tree plus binary tree) division.
[0099] Note that in FIG. 10, one block is divided into four or two blocks (quad-tree or binary tree block division), but the division is not limited to these. For example, one block may be divided into three blocks (ternary tree block division). The division including such ternary tree block division is sometimes called MBT (multi type tree) division.
[0100] FIG. 11 is a block diagram showing an example of the functional configuration of the dividing unit 102 according to the embodiment. As shown in FIG. 11, the dividing unit 102 may include a block division determination unit 102a. The block division determination unit 102a may perform the following processing as an example.
[0101] The block division determination unit 102a may, for example, acquire or read block information from the block memory 118 and / or the frame memory 122, and determine a division pattern (for example, the above-described division pattern) based on the block information. The dividing unit 102 divides the original image according to the division pattern, and outputs one or more blocks obtained by the division to the subtraction unit 104.
[0102] Also, the block division determination unit 102a may output, for example, one or more parameters indicating the determined division pattern (for example, the above-described division pattern) to the conversion unit 106, the inverse conversion unit 114, the intra prediction unit 124, the inter prediction unit 126, and the entropy encoding unit 110. The conversion unit 106 may convert the prediction residual based on the one or more parameters, and the intra prediction unit 124 and the inter prediction unit 126 may generate a prediction image based on the one or more parameters. Also, the entropy encoding unit 110 may perform entropy encoding on the one or more parameters.
[0103] Parameters related to the division pattern may be written into the stream as follows as an example.
[0104] FIG. 12 is a conceptual diagram showing an example of the division pattern. The division pattern includes, for example, a four-division (QT) that divides a block into two in each of the horizontal and vertical directions, a three-division (HT or VT) that divides a block in the same direction at a ratio of 1:2:1, a two-division (HB or VB) that divides a block in the same direction at a ratio of 1:1, and no division (NS).
[0105] In the case of 4-way splitting and non-splitting, the splitting pattern has no block splitting direction. In the case of 2-way splitting and 3-way splitting, the splitting pattern has splitting direction information.
[0106] FIG. 13A is a conceptual diagram showing an example of a syntax tree of a splitting pattern.
[0107] FIG. 13B is a conceptual diagram showing another example of a syntax tree of a splitting pattern.
[0108] FIGS. 13A and 13B are diagrams showing examples of syntax trees of splitting patterns. In the example of FIG. 13A, first, information (S: Split flag) indicating whether to perform splitting exists, and then information (QT: QT flag) indicating whether to perform 4-way splitting exists. Next, information (TT: TT flag or BT: BT flag) indicating whether to perform 3-way splitting or 2-way splitting exists, and information (Ver: Vertical flag or Hor: Horizontal flag) indicating the splitting direction exists. Note that for each of one or more blocks obtained by splitting according to such a splitting pattern, splitting may be repeatedly applied by the same process. That is, as an example, the determination of whether to perform splitting, whether to perform 4-way splitting, whether the splitting method is horizontal or vertical, and whether to perform 3-way splitting or 2-way splitting may be recursively performed, and the obtained determination results may be encoded into a stream according to the encoding order disclosed in the syntax tree shown in FIG. 13A.
[0109] Also, in the syntax tree shown in FIG. 13A, the information is arranged in the order of S, QT, TT, Ver, but it may be arranged in the order of S, QT, Ver, BT. That is, in the example of FIG. 13B, first, information (S: Split flag) indicating whether to perform splitting exists, and then information (QT: QT flag) indicating whether to perform 4-way splitting exists. Next, information (Ver: Vertical flag or Hor: Horizontal flag) indicating the splitting direction exists, and information (BT: BT flag or TT: TT flag) indicating whether to perform 2-way splitting or 3-way splitting exists.
[0110] Note that the splitting pattern described here is just an example, and patterns other than the described one may be used, or only a part of the described splitting pattern may be used.
[0111] [Subtraction unit] The subtraction unit 104 receives input from the splitting unit 102 and subtracts a predicted image (a prediction sample input from a prediction control unit 128 described later) from the original image in block units split by the splitting unit 102. That is, the subtraction unit 104 calculates the prediction residual (also called the error) of the current block. Then, the subtraction unit 104 outputs the calculated prediction residual to the conversion unit 106.
[0112] The original image may be an image input to the encoding device 100 as a signal (for example, a luminance signal and two chroma signals) representing the image of each picture constituting a moving image. The signal representing the image may also be called a sample.
[0113] [Conversion unit] The conversion unit 106 converts the prediction residual 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, for example, a predetermined discrete cosine transform (DCT) or discrete sine transform (DST) on the prediction residual in the spatial domain. The predetermined DCT or DST may be determined in advance.
[0114] Note that the conversion unit 106 may adaptively select a conversion type from a plurality of conversion types and use a transform basis function corresponding to the selected conversion type to convert the prediction residual into conversion coefficients. Such a conversion is sometimes called an EMT (explicit multiple core transform) or an AMT (adaptive multiple transform). Also, the transform basis function may sometimes be called a basis.
[0115] The plurality of transform types include, for example, DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. Note that these transform types may be denoted as DCT2, DCT5, DCT8, DST1, and DST7, respectively. FIG. 14 is a table showing examples of transform basis functions corresponding to each transform type. In FIG. 14, N indicates the number of input pixels. The selection of a transform type from among these plurality of transform types may depend on, for example, the type of prediction (such as intra prediction and inter prediction), or may depend on the intra prediction mode.
[0116] Information indicating whether to apply such EMT or AMT (for example, called an EMT flag or an AMT flag) and information indicating the selected transform type are usually signaled at the CU level. Note that the signaling of this information does not have to be limited to the CU level and may be at other levels (for example, sequence level, picture level, slice level, tile level, or CTU level).
[0117] Also, the transform unit 106 may re-transform the transform coefficients (that is, the transform result). Such re-transformation may be called AST (adaptive secondary transform) or NSST (non-separable secondary transform). For example, the transform unit 106 performs re-transformation for each sub-block (for example, a 4x4 pixel sub-block) included in the block of transform coefficients corresponding to the intra prediction residual. Information indicating whether to apply NSST and information regarding the transform matrix used for NSST are usually signaled at the CU level. Note that the signaling of this information does not have to be limited to the CU level and may be at other levels (for example, sequence level, picture level, slice level, tile level, or CTU level).
[0118] The conversion unit 106 may apply separable conversion and non-separable conversion. Separable conversion is a method of performing conversion multiple times by separating in each direction by the number of dimensions of the input, and non-separable conversion is a method of treating two or more dimensions as one dimension when the input is multi-dimensional and performing conversion collectively.
[0119] For example, as an example of non-separable conversion, when the input is a 4×4 pixel block, it is regarded as an array having 16 elements, and a conversion process is performed on the array with a 16×16 conversion matrix.
[0120] Also, in a further example of non-separable conversion, after regarding a 4×4 pixel input block as an array having 16 elements, a conversion (Hypercube Givens Transform) in which Givens rotation is performed multiple times on the array may be performed.
[0121] In the conversion in the conversion unit 106, it is also possible to switch the conversion type of the conversion basis function for converting to the frequency domain according to the region within the CU. As an example, there is SVT (Spatially Varying Transform).
[0122] FIG. 15 is a conceptual diagram showing an example of SVT.
[0123] In SVT, as shown in Fig. 15, the CU is divided into two equal parts either horizontally or vertically, and only one of the regions is transformed into the frequency domain. The transformation type may be set for each region. For example, DST7 and DCT8 are used. For example, among the two regions obtained by dividing the CU vertically into two equal parts, DST7 and DCT8 can be used for the region at position 0. Or, among the two regions, DST7 is used for the region at position 1. Similarly, among the two regions obtained by dividing the CU horizontally into two equal parts, DST7 and DCT8 are used for the region at position 0. Or, among the two regions, DST7 is used for the region at position 1. In the example shown in Fig. 15 like this, only one of the two regions within the CU is transformed and the other is not, but it is also possible to perform transformation on each of the two regions. Also, the splitting method may be not only into two equal parts but also into four equal parts. Also, it can be made more flexible, such as encoding the information indicating the splitting method and signaling it in the same way as CU splitting. Note that SVT is sometimes also called SBT (Sub-block Transform).
[0124] The aforementioned AMT and EMT may be referred to as MTS (Multiple Transform Selection). When applying MTS, a transform type such as DST7 or DCT8 can be selected, and information indicating the selected transform type may be encoded as index information for each CU. On the other hand, there is a process called IMTS (Implicit MTS) as a process of selecting a transform type to be used for orthogonal transformation without encoding the index information. When applying IMTS, for example, if the shape of the CU is rectangular, the short side of the rectangle may be orthogonally transformed using DST7 and the long side may be orthogonally transformed using DCT2. Also, for example, if the shape of the CU is square, orthogonal transformation may be performed using DCT2 if MTS is effective within the sequence and using DST7 if MTS is ineffective. DCT2 and DST7 are just examples, and other transform types may be used, or different combinations of the transform types to be used may be possible. IMTS may be used only for blocks of intra prediction, or may be used for both blocks of intra prediction and blocks of inter prediction.
[0125] In the above, as a selection process for selectively switching the conversion type used in the orthogonal conversion, three processes of MTS, SBT, and IMTS have been described. However, all three selection processes may be applied, or only some of the selection processes may be selectively applied. Whether to apply one or more selection processes can be identified by, for example, flag information in the header such as SPS. For example, if all three selection processes are available, one is selected from the three selection processes for each CU unit to perform orthogonal conversion. Note that the selection process for selectively switching the conversion type may use a selection process different from the above three selection processes, or each of the above three selection processes may be replaced with a different process. Generally, at least one of the following four functions [1] to [4] is performed. Function [1] is a function of performing orthogonal conversion on the entire range within the CU and encoding information indicating the conversion type used in the conversion. Function [2] is a function of performing orthogonal conversion on the entire range of the CU and determining the conversion type based on a predetermined rule without encoding the information indicating the conversion type. Function [3] is a function of performing orthogonal conversion on a partial region of the CU and encoding information indicating the conversion type used in the conversion. Function [4] is a function of performing orthogonal conversion on a partial region of the CU and determining the conversion type based on a predetermined rule without encoding the information indicating the conversion type used in the conversion. The predetermined rule may be determined in advance.
[0126] Note that the applicability of MTS, IMTS, and / or SBT may be determined for each processing unit. For example, the applicability may be determined in units of sequence, picture, block, slice, CTU, or CU.
[0127] Note that the tool for selectively switching the conversion type in the present disclosure may be rephrased as a method for adaptively selecting the basis used in the conversion process, a selection process, or a process for selecting the basis. Also, the tool for selectively switching the conversion type may be rephrased as a mode for adaptively selecting the conversion type.
[0128] FIG. 16 is a flowchart showing an example of the processing by the conversion unit 106, and will be described with reference to FIG. 7 for convenience.
[0129] For example, the conversion unit 106 determines whether to perform an orthogonal conversion (step St_1). Here, if the conversion unit 106 determines to perform an orthogonal conversion (Yes in step St_1), it selects a conversion type to be used for the orthogonal conversion from a plurality of conversion types (step St_2). Next, the conversion unit 106 performs an orthogonal conversion by applying the selected conversion type to the prediction residual of the current block (step St_3). Then, the conversion unit 106 causes the entropy encoding unit 110 to encode the information by outputting the information indicating the selected conversion type to the entropy encoding unit 110 (step St_4). On the other hand, if the conversion unit 106 determines not to perform an orthogonal conversion (No in step St_1), it causes the entropy encoding unit 110 to encode the information by outputting the information indicating that no orthogonal conversion is performed to the entropy encoding unit 110 (step St_5). Note that the determination as to whether to perform an orthogonal conversion in step St_1 may be made based on, for example, the size of the conversion block, the prediction mode applied to the CU, etc. Also, the information indicating the conversion type to be used for the orthogonal conversion may not be encoded, and the orthogonal conversion may be performed using a prescribed conversion type. The prescribed conversion type may be prescribed in advance.
[0130] FIG. 17 is a flowchart showing an example of the processing by the conversion unit 106, and will be described with reference to FIG. 7 for convenience. Note that the example shown in FIG. 17 is an example of an orthogonal conversion when a method of selectively switching the conversion type to be used for the orthogonal conversion is applied, similar to the example shown in FIG. 16.
[0131] As an example, the first conversion type group may include DCT2, DST7, and DCT8. Also, as an example, the second conversion type group may include DCT2. Further, the conversion types included in the first conversion type group and the second conversion type group may partially overlap or may be all different conversion types.
[0132] The conversion unit 106 determines whether the conversion size is less than or equal to a predetermined value (step Su_1). Here, if it is determined that the conversion size is less than or equal to the predetermined value (Yes in step Su_1), the conversion unit 106 orthogonally transforms the prediction residual of the current block using the conversion types included in the first conversion type group (step Su_2). Next, the conversion unit 106 outputs information indicating which conversion type among one or more conversion types included in the first conversion type group to the entropy encoding unit 110, thereby causing the information to be encoded (step Su_3). On the other hand, if the conversion unit 106 determines that the conversion size is not less than or equal to the predetermined value (No in step Su_1), the conversion unit 106 orthogonally transforms the prediction residual of the current block using the second conversion type group (step Su_4). The predetermined value may be a threshold value or a predefined value.
[0133] In step Su_3, the information indicating the conversion type used for the orthogonal transformation may be information indicating a combination of the conversion type applied in the vertical direction and the conversion type applied in the horizontal direction of the current block. Also, the first conversion type group may include only one conversion type, and the information indicating the conversion type used for the orthogonal transformation may not be encoded. The second conversion type group may include a plurality of conversion types, and among one or more conversion types included in the second conversion type group, the information indicating the conversion type used for the orthogonal transformation may be encoded.
[0134] Alternatively, the conversion type may be indicated based on the conversion size without encoding the information indicating the conversion type. Note that the process of determining the conversion type used for the orthogonal transformation based on the conversion size is not limited to the determination of whether the conversion size is less than or equal to a predetermined value.
[0135] [Quantization unit] The quantization unit 108 quantizes the conversion coefficients output from the conversion unit 106. Specifically, the quantization unit 108 scans a plurality of conversion coefficients of the current block in a predetermined scanning order, and quantizes the scanned conversion coefficients based on quantization parameters (QP) corresponding to the scanned conversion coefficients. Then, the quantization unit 108 outputs the plurality of quantized conversion coefficients (hereinafter referred to as quantization coefficients) of the current block to the entropy encoding unit 110 and the inverse quantization unit 112. The predetermined scanning order may be predefined.
[0136] The predetermined scanning order is an order for quantization / inverse quantization of the conversion coefficients. For example, the predetermined scanning order may be defined in ascending order of frequency (from low frequency to high frequency) or descending order (from high frequency to low frequency).
[0137] The quantization parameter (QP) is a parameter that defines the quantization step (quantization width). For example, as the value of the quantization parameter increases, the quantization step also increases. That is, as the value of the quantization parameter increases, the error of the quantization coefficient (quantization error) increases.
[0138] Also, a quantization matrix 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 color difference. Note that quantization means digitizing values sampled at a predetermined interval by associating them with a predetermined level, and in this technical field, it may be referred to using other expressions such as rounding, rounding off, and scaling, or rounding, rounding off, and scaling may be adopted. The predetermined interval and level may be predefined.
[0139] As methods of using a quantization matrix, there are a method of using a quantization matrix directly set on the side of the encoding device 100 and a method of using a default quantization matrix (default matrix). On the side of the encoding device 100, by directly setting the quantization matrix, a quantization matrix corresponding to the characteristics of the image can be set. However, in this case, there may be a demerit that the amount of code increases due to the encoding of the quantization matrix. Note that instead of using the default quantization matrix or the encoded quantization matrix as it is, a quantization matrix used for quantization of the current block may be generated based on the default quantization matrix or the encoded quantization matrix.
[0140] On the other hand, there is also a method of quantizing the coefficients of the high-frequency components and the coefficients of the low-frequency components without using a quantization matrix. Note that this method may be regarded as equivalent to a method of using a quantization matrix (flat matrix) in which the coefficients are the same value.
[0141] The quantization matrix may be encoded, for example, at the sequence level, picture level, slice level, block level, or CTU level. The quantization matrix may be specified, for example, by an SPS (Sequence Parameter Set) or a PPS (Picture Parameter Set). The SPS includes parameters used for a sequence, and the PPS includes parameters used for a picture. The SPS and the PPS may sometimes be simply called parameter sets.
[0142] When using a quantization matrix, the quantization unit 108, for example, scales, for each transform coefficient, the quantization width obtained from quantization parameters or the like using the values of the quantization matrix. The quantization process performed without using a quantization matrix may be a process of quantizing transform coefficients based on the quantization width obtained from quantization parameters or the like. In the quantization process performed without using a quantization matrix, a predetermined value common to all the transform coefficients in the block may be multiplied by the quantization width. The predetermined value may be determined in advance.
[0143] FIG. 18 is a block diagram showing an example of the functional configuration of the quantization unit according to the embodiment. The quantization unit 108 includes, for example, a differential quantization parameter generation unit 108a, a predictive quantization parameter generation unit 108b, a quantization parameter generation unit 108c, a quantization parameter storage unit 108d, and a quantization processing unit 108e.
[0144] FIG. 19 is a flowchart showing an example of the quantization process by the quantization unit 108, and will be described with reference to FIGS. 7 and 18 for convenience.
[0145] As an example, the quantization unit 108 may perform quantization for each CU based on the flowchart shown in FIG. 19. Specifically, the quantization parameter generation unit 108c determines whether to perform quantization (step Sv_1). Here, if it is determined to perform quantization (Yes in step Sv_1), the quantization parameter generation unit 108c generates the quantization parameters for the current block (step Sv_2) and stores the quantization parameters in the quantization parameter storage unit 108d (step Sv_3).
[0146] Next, the quantization processing unit 108e quantizes the transform coefficients of the current block using the quantization parameters generated in step Sv_2 (step Sv_4). Then, the predictive quantization parameter generation unit 108b acquires quantization parameters of a processing unit different from the current block from the quantization parameter storage unit 108d (step Sv_5). The predictive quantization parameter generation unit 108b generates predictive quantization parameters for the current block based on the acquired quantization parameters (step Sv_6). The differential quantization parameter generation unit 108a calculates the difference between the quantization parameters of the current block generated by the quantization parameter generation unit 108c and the predictive quantization parameters of the current block generated by the predictive quantization parameter generation unit 108b (step Sv_7). By calculating this difference, differential quantization parameters may be generated. The differential quantization parameter generation unit 108a outputs the differential quantization parameters to the entropy encoding unit 110 to cause the differential quantization parameters to be encoded (step Sv_8).
[0147] Note that the differential quantization parameters may be encoded at the sequence level, picture level, slice level, block level, or CTU level. Also, the initial values of the quantization parameters may be encoded at the sequence level, picture level, slice level, block level, or CTU level. At this time, the quantization parameters may be generated using the initial values of the quantization parameters and the differential quantization parameters.
[0148] Note that the quantization unit 108 may include a plurality of quantizers, and dependent quantization may be applied in which the transform coefficients are quantized using a quantization method selected from a plurality of quantization methods.
[0149] [Entropy Encoding Unit] FIG. 20 is a block diagram showing an example of the functional configuration of the entropy encoding unit 110, and for convenience, it will be described with reference to FIG. 7. The entropy encoding unit 110 generates a stream by performing entropy encoding on the quantized coefficients input from the quantization unit 108 and the prediction parameters input from the prediction parameter generation unit 130. For this entropy encoding, for example, CABAC (Context-based Adaptive Binary Arithmetic Coding) is used. Specifically, the entropy encoding unit 110 includes, for example, a binarization unit 110a, a context control unit 110b, and a binary arithmetic coding unit 110c. The binarization unit 110a performs binarization to convert a multi-value signal such as a quantized coefficient and a prediction parameter into a binary signal. Examples of the binarization method include Truncated Rice Binarization, Exponential Golomb codes, Fixed Length Binarization, and the like. The context control unit 110b derives a context value according to the characteristics of the syntax element or the surrounding situation, that is, the occurrence probability of the binary signal. Examples of the method for deriving this context value include bypass, syntax element reference, upper / left adjacent block reference, hierarchical information reference, and others. The binary arithmetic coding unit 110c performs arithmetic coding on the binarized signal using the derived context value.
[0150] FIG. 21 is a conceptual diagram showing an example of the flow of CABAC processing in the entropy encoding unit 110. First, in CABAC in the entropy encoding unit 110, initialization is performed. In this initialization, initialization in the binary arithmetic encoding unit 110c and setting of the initial context value are performed. Then, the binarization unit 110a and the binary arithmetic encoding unit 110c may perform binarization and arithmetic encoding in order for each of a plurality of quantized coefficients of, for example, a CTU. The context control unit 110b may update the context value every time arithmetic encoding is performed. Then, as post-processing, the context control unit 110b may save the context value. This saved context value may be used, for example, as the initial value of the context value for the next CTU.
[0151] [Inverse quantization unit] The inverse quantization unit 112 inverse-quantizes the quantized coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inverse-quantizes the quantized coefficients of the current block in a predetermined scanning order. Then, the inverse quantization unit 112 outputs the inverse-quantized transform coefficients of the current block to the inverse transform unit 114. The predetermined scanning order may be determined in advance.
[0152] [Inverse transform unit] The inverse transform unit 114 restores the prediction residual by inverse-transforming the transform coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 restores the prediction residual of the current block by performing an inverse transform corresponding to the transform by the transform unit 106 on the transform coefficients. Then, the inverse transform unit 114 outputs the restored prediction residual to the addition unit 116.
[0153] Note that since information is usually lost due to quantization, the restored prediction residual does not match the prediction residual calculated by the subtraction unit 104. That is, the restored prediction residual usually includes a quantization error.
[0154] [Addition unit] The addition unit 116 reconstructs the current block by adding the prediction residual input from the inverse conversion unit 114 and the predicted image input from the prediction control unit 128. As a result, a reconstructed image is generated. Then, the addition unit 116 outputs the reconstructed image to the block memory 118 and the loop filter unit 120. The reconstructed block may also be called a local decoding block.
[0155] [Block Memory] The block memory 118 is, for example, a storage unit for storing blocks within the current picture used in intra prediction. Specifically, the block memory 118 stores the reconstructed image output from the addition unit 116.
[0156] [Frame Memory] The frame memory 122 is, for example, a storage unit for storing reference pictures used in inter prediction, and may also be called a frame buffer. Specifically, the frame memory 122 stores the reconstructed image filtered by the loop filter unit 120.
[0157] [Loop Filter Unit] The loop filter unit 120 performs loop filter processing on the reconstructed image output from the addition unit 116, and outputs the filtered reconstructed image to the frame memory 122. The loop filter is a filter (in-loop filter) used within the coding loop, and includes, for example, an adaptive loop filter (ALF), a deblocking filter (DF or DBF), and a sample adaptive offset (SAO) filter.
[0158] FIG. 22 is a block diagram showing an example of the functional configuration of the loop filter unit 120 according to the embodiment. As shown in FIG. 22, for example, the loop filter unit 120 includes a deblocking filter processing unit 120a, an SAO processing unit 120b, and an ALF processing unit 120c. The deblocking filter processing unit 120a performs the above-described deblocking filter processing on the reconstructed image. The SAO processing unit 120b performs the above-described SAO processing on the reconstructed image after the deblocking filter processing. Further, the ALF processing unit 120c applies the above-described ALF processing to the reconstructed image after the SAO processing. Details of the ALF and the deblocking filter will be described later. The SAO processing is a process for improving the image quality by reducing ringing (a phenomenon in which pixel values fluctuate like waves around the edge) and correcting pixel value deviations. This SAO processing includes, for example, edge offset processing and band offset processing. Note that the loop filter unit 120 does not necessarily include all the processing units disclosed in FIG. 22, may include some of the processing units, or may include additional processing units. Also, the loop filter unit 120 may be configured to perform the above-described respective processes in an order different from the processing order disclosed in FIG. 22, and does not necessarily perform all the processes.
[0159] [Loop Filter Unit > Adaptive Loop Filter] In the ALF, a least squares error filter for removing encoding distortion is applied, and for example, for each 2x2 pixel sub-block in the current block, one filter selected from a plurality of filters is applied based on the direction and activity of the local gradient.
[0160] Specifically, first, sub-blocks (e.g., 2x2 pixel sub-blocks) are classified into a plurality of classes (e.g., 15 or 25 classes). The classification of sub-blocks may be performed, for example, based on the gradient direction and activity. In a specific example, a classification value C (e.g., C = 5D+A) is calculated using a gradient direction value D (e.g., 0 to 2 or 0 to 4) and a gradient activity value A (e.g., 0 to 4). Then, based on the classification value C, the sub-blocks are classified into a plurality of classes.
[0161] The gradient direction value D is derived, for example, by comparing gradients in a plurality of directions (e.g., horizontal, vertical, and two diagonal directions). Also, the gradient activity value A is derived, for example, by adding gradients in a plurality of directions and quantizing the addition result.
[0162] Based on the results of such classification, a filter for the sub-blocks may be determined from among a plurality of filters.
[0163] As the shape of the filter used in ALF, for example, a circularly symmetric shape is utilized. FIGS. 23A to 23C are conceptual diagrams showing a plurality of examples of the shape of the filter used in ALF. FIG. 23A shows a 5x5 diamond-shaped filter, FIG. 23B shows a 7x7 diamond-shaped filter, and FIG. 23C shows a 9x9 diamond-shaped filter. Information indicating the shape of the filter is usually signaled at the picture level. Note that the signaling of information indicating the shape of the filter is not necessarily limited to the picture level and may be at other levels (e.g., sequence level, slice level, tile level, CTU level, or CU level).
[0164] The on / off of ALF may be determined, for example, at the picture level or CU level. For example, for luminance, it may be determined whether to apply ALF at the CU level, and for chrominance difference, it may be determined whether to apply ALF at the picture level. The information indicating the on / off of ALF is usually signaled at the picture level or CU level. Note that the signaling of the information indicating the on / off of ALF does not have to be limited to the picture level or CU level, and it may be at other levels (e.g., sequence level, slice level, tile level, or CTU level).
[0165] Also, as described above, one filter is selected from a plurality of filters and ALF processing is performed on the sub-block. For each of the plurality of filters (e.g., filters up to 15 or 25), the coefficient set consisting of a plurality of coefficients used for the filter is usually signaled at the picture level. Note that the signaling of the coefficient set does not have to be limited to the picture level, and it may be at other levels (e.g., sequence level, slice level, tile level, CTU level, CU level, or sub-block level).
[0166] [Loop Filter > Cross Component Adaptive Loop Filter] Figure 23D is a conceptual diagram showing an example of the flow of CC-ALF (cross component ALF). Figure 23E is a conceptual diagram showing an example of the filter shape used in CC-ALF such as the CC-ALF in Figure 23D. One example of the CC-ALF in Figures 23D and 23E operates by applying a linear diamond-shaped filter to the luminance channel of each chrominance component. For example, the filter coefficients are transmitted by APS, scaled by a factor of 2^10, and rounded for fixed-point representation. For example, in Figure 23D, Y samples (the first component) are used for the CCALF of Cb and Cr (components different from the first component).
[0167] The application of the filter is controlled with a variable block size and may be signaled with context-encoded flags received for each block of samples. The block size and the CC-ALF enable flag may be received at the slice level for each color difference component. CC-ALF supports various block sizes, e.g., block sizes of 16x16, 32x32, 64x64, 128x128 (in the case of color difference samples).
[0168] [Loop Filter > Joint Chroma Cross Component Adaptive Loop Filter] An example of the joint chroma CCALF is shown in FIGS. 23F and 23G. FIG. 23F is a diagram showing an example of the flow of the joint chroma CCALF. FIG. 23G is a table showing an example of weight_index candidates. As shown, one CCALF filter is used to generate one CCALF filter output as the color difference adjustment signal for one color component, and the weighted version of the same color difference adjustment signal is applied to the other color components. In this way, the complexity of the existing CCALF is approximately halved. The weight value may be encoded into a sign flag and a weight index. The weight index (denoted as weight_index) is encoded into 3 bits and may specify the magnitude of the JC-CCALF weight JcCcWeight that is not zero. The magnitude of JcCcWeight may be determined, for example, as follows.
[0169] When weight_index is 4 or less, JcCcWeight is equal to weight_index>>2.
[0170] Otherwise, JcCcWeight is equal to 4 / (weight_index - 4).
[0171] The block-level on / off control of the ALF filtering for Cb and Cr may be separate. This is the same as CCALF, and two separate sets of block-level on / off control flags may be coded. Here, unlike CCALF, since the on / off control block sizes for Cb and Cr are the same, only one block size variable may be coded.
[0172] [Loop Filter Section > Deblocking Filter] In the deblocking filter process, the loop filter section 120 reduces the distortion generated at the block boundary by performing filtering on the block boundary of the reconstructed image.
[0173] FIG. 24 is a block diagram showing an example of the detailed configuration of the deblocking filter processing section 120a of the loop filter 120 (see FIGS. 7 and 22) that functions as a deblocking filter.
[0174] The deblocking filter processing section 120a includes, for example, a boundary determination section 1201, a filter determination section 1203, a filter processing section 1205, a processing determination section 1208, a filter characteristic determination section 1207, and switches 1202, 1204, and 1206.
[0175] The boundary determination section 1201 determines whether or not the pixel to be deblocking-filtered (i.e., the target pixel) exists near the block boundary. Then, the boundary determination section 1201 outputs the determination result to the switches 1202 and the processing determination section 1208.
[0176] When the boundary determination unit 1201 determines that the target pixel exists near the block boundary, the switch 1202 outputs the image before the filter processing to the switch 1204. Conversely, when the boundary determination unit 1201 determines that the target pixel does not exist near the block boundary, the switch 1202 outputs the image before the filter processing to the switch 1206. Note that the image before the filter processing is an image composed of the target pixel and at least one peripheral pixel around the target pixel.
[0177] The filter determination unit 1203 determines whether to perform deblocking filter processing on the target pixel based on the pixel values of at least one peripheral pixel around the target pixel. Then, the filter determination unit 1203 outputs the determination result to the switch 1204 and the processing determination unit 1208.
[0178] When the filter determination unit 1203 determines that deblocking filter processing is to be performed on the target pixel, the switch 1204 outputs the image before the filter processing obtained via the switch 1202 to the filter processing unit 1205. Conversely, when the filter determination unit 1203 determines that deblocking filter processing is not to be performed on the target pixel, the switch 1204 outputs the image before the filter processing obtained via the switch 1202 to the switch 1206.
[0179] When the filter processing unit 1205 obtains the image before the filter processing via the switches 1202 and 1204, it performs deblocking filter processing having the filter characteristics determined by the filter characteristic determination unit 1207 on the target pixel. Then, the filter processing unit 1205 outputs the pixel after the filter processing to the switch 1206.
[0180] The switch 1206 selectively outputs the pixel that has not been subjected to deblocking filter processing and the pixel that has been subjected to deblocking filter processing by the filter processing unit 1205 according to the control by the processing determination unit 1208.
[0181] The processing determination unit 1208 controls the switch 1206 based on the respective determination results of the boundary determination unit 1201 and the filter determination unit 1203. That is, when the boundary determination unit 1201 determines that the target pixel exists near the block boundary and the filter determination unit 1203 determines that the deblocking filter process is to be performed on the target pixel, the processing determination unit 1208 causes the deblocking filter-processed pixel to be output from the switch 1206. Also, in cases other than the above, the processing determination unit 1208 causes the non-deblocking filter-processed pixel to be output from the switch 1206. By repeatedly outputting such pixels, the filtered image is output from the switch 1206. Note that the configuration shown in FIG. 24 is an example of the configuration in the deblocking filter processing unit 120a, and the deblocking filter processing unit 120a may have various configurations.
[0182] FIG. 25 is a conceptual diagram showing an example of a deblocking filter having filter characteristics symmetric with respect to a block boundary.
[0183] In the deblocking filter process, for example, using the pixel value and the quantization parameter, one of two deblocking filters with different characteristics, namely the strong filter and the weak filter, may be selected. In the strong filter, as shown in FIG. 25, when there are pixels p0 to p2 and pixels q0 to q2 across the block boundary, the respective pixel values of pixels q0 to q2 are changed to pixel values q'0 to q'2, for example, by performing the operations shown in the following equations.
[0184] 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
[0185] In the above equations, p0 to p2 and q0 to q2 are the respective pixel values of pixels p0 to p2 and pixels q0 to q2. Also, q3 is the pixel value of pixel q3 adjacent to pixel q2 on the side opposite to the block boundary. Further, in the right side of each of the above equations, the coefficient multiplied by the pixel value of each pixel used in the deblocking filter process is the filter coefficient.
[0186] Furthermore, in the deblocking filter process, clip processing may be performed so that the pixel value after the operation does not change beyond the threshold value. For example, in this clip processing, the pixel value after the operation by the above equation may be clipped to "the pixel value before the operation ± 2 × the threshold value" using the threshold value determined from the quantization parameter. This can prevent excessive smoothing.
[0187] FIG. 26 is a conceptual diagram for explaining an example of a block boundary where the deblocking filter process is performed. FIG. 27 is a conceptual diagram showing an example of the BS (Boundary Strength) value.
[0188] The block boundary where the deblocking filter process is performed is, for example, the boundary of a CU, PU, or TU of an 8×8 pixel block as shown in FIG. 26. The deblocking filter process may be performed, for example, in units of 4 rows or 4 columns. First, for blocks P and Q shown in FIG. 26, the Bs (Boundary Strength) value is determined as shown in FIG. 27.
[0189] According to the Bs value in FIG. 27, even for block boundaries belonging to the same image, it may be determined whether to perform deblocking filter processing with different strengths. The deblocking filter process for the chrominance signal is performed when the Bs value is 2. The deblocking filter process for the luminance signal is performed when the Bs value is 1 or more and a predetermined condition is satisfied. The predetermined condition may be determined in advance. Note that the determination condition of the Bs value is not limited to that shown in FIG. 27 and may be determined based on other parameters.
[0190] [Prediction Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] FIG. 28 is a flowchart showing an example of the processing performed by the prediction unit of the encoding apparatus 100. Note that the prediction unit includes all or some of the components of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. The prediction processing unit includes, for example, the intra prediction unit 124 and the inter prediction unit 126.
[0191] The prediction unit generates a predicted image of the current block (step Sb_1). The predicted image may be referred to as a prediction signal or a prediction block. Note that the prediction signal includes, for example, an intra predicted image (intra prediction signal) or an inter predicted image (inter prediction signal). The prediction unit generates a predicted image of the current block using a reconstructed image that has already been obtained by performing generation of a predicted image for other blocks, generation of a prediction residual, generation of quantization coefficients, restoration of the prediction residual, and addition of the predicted image.
[0192] The reconstructed image may be, for example, an image of a reference picture, or an image of an encoded block (i.e., the above-described other blocks) in the current picture that is a picture including the current block. The encoded block in the current picture is, for example, an adjacent block of the current block.
[0193] FIG. 29 is a flowchart showing another example of the processing performed by the prediction unit of the encoding apparatus 100.
[0194] The prediction unit generates a predicted image in a first method (step Sc_1a), generates a predicted image in a second method (step Sc_1b), and generates a predicted image in a third method (step Sc_1c). The first method, the second method, and the third method are different methods for generating a predicted image, and may be, for example, an inter prediction method, an intra prediction method, and other prediction methods, respectively. In these prediction methods, the above-described reconstructed image may be used.
[0195] Next, the prediction unit evaluates the prediction images generated in each of steps Sc_1a, Sc_1b, and Sc_1c (step Sc_2). For example, the prediction unit calculates the cost C for the prediction images generated in each of steps Sc_1a, Sc_1b, and Sc_1c, and evaluates those prediction images by comparing the costs C of those prediction images. Note that the cost C may be calculated by an equation of an R-D optimization model, for example, C = D + λ × R. In this equation, D is the encoding distortion of the prediction image, and is represented by, for example, the sum of absolute differences between the pixel values of the current block and the pixel values of the prediction image. Also, R is the bit rate of the stream. Also, λ is, for example, the Lagrange multiplier.
[0196] Next, the prediction unit selects any one of the prediction images generated in each of steps Sc_1a, Sc_1b, and Sc_1c (step Sc_3). That is, the prediction unit selects a method or mode for obtaining the final prediction image. For example, the prediction unit selects the prediction image with the smallest cost C based on the cost C calculated for those prediction images. Alternatively, the evaluation in step Sc_2 and the selection of the prediction image in step Sc_3 may be performed based on parameters used in the encoding process. The encoding device 100 may signal information for specifying the selected prediction image, method, or mode to the stream. The information may be, for example, a flag. Thereby, the decoding device 200 can generate a prediction image according to the method or mode selected in the encoding device 100 based on that information. Note that in the example shown in FIG. 29, the prediction unit selects a prediction image after generating prediction images by each method. However, the prediction unit may select a method or mode based on the parameters used in the above-described encoding process before generating those prediction images, and generate a prediction image according to that method or mode.
[0197] For example, the first method and the second method are intra prediction and inter prediction, respectively, and the prediction unit may select the final prediction image for the current block from the prediction images generated according to these prediction methods.
[0198] FIG. 30 is a flowchart showing another example of the processing performed by the prediction unit of the encoding apparatus 100.
[0199] First, the prediction unit generates a prediction image by intra prediction (step Sd_1a) and generates a prediction image by inter prediction (step Sd_1b). Note that the prediction image generated by intra prediction is also referred to as an intra prediction image, and the prediction image generated by inter prediction is also referred to as an inter prediction image.
[0200] Next, the prediction unit evaluates each of the intra prediction image and the inter prediction image (step Sd_2). The above-described cost C may be used for this evaluation. Then, the prediction unit may select, as the final prediction image of the current block, the prediction image for which the smallest cost C is calculated from the intra prediction image and the inter prediction image (step Sd_3). That is, the prediction method or mode for generating the prediction image of the current block is selected.
[0201] Then, the prediction unit selects, as the final prediction image of the current block, the prediction image for which the smallest cost C is calculated from the intra prediction image and the inter prediction image (step Sd_3). That is, the prediction method or mode for generating the prediction image of the current block is selected.
[0202] [Intra Prediction Unit] The intra prediction unit 124 generates a prediction signal (i.e., an intra prediction image) of the current block by performing intra prediction (also referred to as in-picture prediction) of the current block with reference to the blocks in the current picture stored in the block memory 118. Specifically, the intra prediction unit 124 generates an intra prediction image by performing intra prediction with reference to the pixel values (e.g., luminance values, chrominance difference values) of the blocks adjacent to the current block, and outputs the intra prediction image to the prediction control unit 128.
[0203] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of defined intra prediction modes. The plurality of intra prediction modes usually include one or more non-directional prediction modes and a plurality of directional prediction modes. The defined modes may be predetermined.
[0204] The one or more non-directional prediction modes include, for example, the Planar prediction mode and the DC prediction mode defined in the H.265 / HEVC (high-efficiency video coding) standard.
[0205] The plurality of directional prediction modes include, for example, the 33-direction prediction mode defined in the H.265 / HEVC standard. Note that the plurality of directional prediction modes may further include a 32-direction prediction mode (a total of 65 directional prediction modes) in addition to the 33 directions. FIG. 31 is a conceptual diagram showing all 67 intra prediction modes (2 non-directional prediction modes and 65 directional prediction modes) in intra prediction. The solid arrows represent the 33 directions defined in the H.265 / HEVC standard, and the dashed arrows represent the additional 32 directions (the 2 non-directional prediction modes are not shown in FIG. 31).
[0206] In various processing examples, in the intra prediction of a color difference block, a luminance block may be referenced. That is, based on the luminance component of the current block, the color difference component of the current block may be predicted. Such intra prediction is sometimes called CCLM (cross-component linear model) prediction. Such an intra prediction mode of a color difference block that references a luminance block (for example, called the CCLM mode) may be added as one of the intra prediction modes of the color difference block.
[0207] The intra prediction unit 124 may correct the pixel value after intra prediction based on the gradients of the reference pixels in the horizontal / vertical directions. Such intra prediction with such correction is sometimes called PDPC (position dependent intra prediction combination). Information indicating the presence or absence of application of PDPC (for example, called a PDPC flag) is usually signaled at the CU level. Note that the signaling of this information is not necessarily limited to the CU level and may be at other levels (for example, sequence level, picture level, slice level, tile level or CTU level).
[0208] FIG. 32 is a flowchart showing an example of the processing by the intra prediction unit 124.
[0209] The intra prediction unit 124 selects one intra prediction mode from a plurality of intra prediction modes (step Sw_1). Then, the intra prediction unit 124 generates a prediction image according to the selected intra prediction mode (step Sw_2). Next, the intra prediction unit 124 determines the MPM (Most Probable Modes) (step Sw_3). The MPM consists of, for example, six intra prediction modes. For example, two of the six intra prediction modes may be the Planar prediction mode and the DC prediction mode, and the remaining four modes may be the directional prediction modes. Then, the intra prediction unit 124 determines whether the intra prediction mode selected in step Sw_1 is included in the MPM (step Sw_4).
[0210] Here, when it is determined that the selected intra prediction mode is included in the MPM (Yes in step Sw_4), the intra prediction unit 124 sets the MPM flag to 1 (step Sw_5), and generates information indicating the selected intra prediction mode among the MPMs (step Sw_6). Note that the MPM flag set to 1 and the information indicating the intra prediction mode may each be encoded by the entropy encoding unit 110 as prediction parameters.
[0211] On the other hand, when it is determined that the selected intra prediction mode is not included in the MPM (No in step Sw_4), the intra prediction unit 124 sets the MPM flag to 0 (step Sw_7). Or, the intra prediction unit 124 does not set the MPM flag. Then, the intra prediction unit 124 generates information indicating the selected intra prediction mode among one or more intra prediction modes not included in the MPM (step Sw_8). Note that the MPM flag set to 0 and the information indicating the intra prediction mode may each be encoded by the entropy encoding unit 110 as prediction parameters. The information indicating the intra prediction mode indicates, for example, any value between 0 and 60.
[0212] [Inter prediction unit] The inter prediction unit 126 generates a predicted image (inter prediction image) by performing inter prediction (also called inter-frame prediction) of the current block with reference to a reference picture stored in the frame memory 122 and different from the current picture. The inter prediction is performed in units of the current block or a current sub-block (e.g., 4x4 block) within the current block. The sub-block is included in the block and is a unit smaller than the block. The size of the sub-block may be in a format such as a slice, a brick, or a picture.
[0213] For example, the inter prediction unit 126 performs motion estimation within a reference picture for a current block or a current sub-block, and finds a reference block or sub-block that most closely matches the current block or current sub-block. Then, the inter prediction unit 126 obtains motion information (e.g., a motion vector) for compensating for the motion or change from the reference block or sub-block to the current block or sub-block. Based on the motion information, the inter prediction unit 126 performs motion compensation (or motion prediction) to generate an inter prediction image of the current block or sub-block. The inter prediction unit 126 outputs the generated inter prediction image to the prediction control unit 128.
[0214] The motion information used for motion compensation may be signaled as an inter prediction signal in various forms. For example, a motion vector may be signaled. As another example, a difference between a motion vector and a motion vector predictor may be signaled.
[0215] [Reference Picture List] FIG. 33 is a conceptual diagram showing an example of each reference picture, and FIG. 34 is a conceptual diagram showing an example of a reference picture list. The reference picture list is a list showing one or more reference pictures stored in the frame memory 122. In FIG. 33, a rectangle represents a picture, an arrow represents a reference relationship between pictures, the horizontal axis represents time, I, P, and B in the rectangle represent an intra prediction picture, a single prediction picture, and a bi-prediction picture, respectively, and the numbers in the rectangle represent the decoding order. As shown in FIG. 33, the decoding order of each picture is I0, P1, B2, B3, B4, and the display order of each picture is I0, B3, B2, B4, P1. As shown in FIG. 34, the reference picture list is a list representing candidates for reference pictures, and for example, one picture (or slice) may have one or more reference picture lists. For example, if the current picture is a single prediction picture, one reference picture list is used, and if the current picture is a bi-prediction picture, two reference picture lists are used. In the examples of FIGS. 33 and 34, the picture B3 which is the current picture currPic has two reference picture lists, the L0 list and the L1 list. When the current picture currPic is the picture B3, the candidates for the reference pictures of the current picture currPic are I0, P1, and B2, and each reference picture list (that is, the L0 list and the L1 list) shows these pictures. The inter prediction unit 126 or the prediction control unit 128 designates which picture in each reference picture list is actually referred to by the reference picture index refIdxLx. In FIG. 34, the reference pictures P1 and B2 are designated by the reference picture indexes refIdxL0 and refIdxL1.
[0216] Such a reference picture list may be generated in units of sequence, picture, slice, block, CTU, or CU. Also, among the reference pictures shown in the reference picture list, a reference picture index indicating the reference picture referred to in inter prediction may be coded at the sequence level, picture level, slice level, block level, CTU level, or CU level. Also, a common reference picture list may be used in a plurality of inter prediction modes.
[0217] [Basic Flow of Inter Prediction] FIG. 35 is a flowchart showing an example of the basic flow of the process of inter prediction.
[0218] The inter prediction unit 126 first generates a predicted image (steps Se_1 to Se_3). Next, the subtraction unit 104 generates a difference between the current block and the predicted image as a prediction residual (step Se_4).
[0219] Here, in generating the prediction image, the inter prediction unit 126 generates the prediction image by determining the motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). Also, in determining the MV, the inter prediction unit 126 determines the MV by selecting candidate motion vectors (candidate MVs) (step Se_1) and deriving the MV (step Se_2). The selection of candidate MVs is performed, for example, by the inter prediction unit 126 generating a candidate MV list and selecting at least one candidate MV from the candidate MV list. Note that MVs derived in the past may be added as candidate MVs to the candidate MV list. Also, in deriving the MV, the inter prediction unit 126 may determine the selected at least one candidate MV as the MV of the current block by selecting at least one more candidate MV from at least one candidate MV. Alternatively, the inter prediction unit 126 may determine the MV of the current block by searching the area of the reference picture indicated by the candidate MV for each of the selected at least one candidate MVs. Note that searching the area of the reference picture may be referred to as motion estimation.
[0220] Also, in the above example, steps Se_1 to Se_3 are performed by the inter prediction unit 126, but processing such as step Se_1 or step Se_2 may be performed by other components included in the encoding device 100.
[0221] Note that a candidate MV list may be created for each process in each inter prediction mode, or a common candidate MV list may be used in a plurality of inter prediction modes. Also, the processes of steps Se_3 and Se_4 respectively correspond to the processes of steps Sa_3 and Sa_4 shown in FIG. 9. Also, the process of step Se_3 corresponds to the process of step Sd_1b in FIG. 30.
[0222] [Flow of MV Derivation] FIG. 36 is a flowchart showing an example of MV derivation processing.
[0223] The inter prediction unit 126 may derive the MV of the current block in a mode that encodes motion information (e.g., MV). In this case, for example, the motion information may be encoded as a prediction parameter and signaled. That is, the encoded motion information is included in the stream.
[0224] Alternatively, the inter prediction unit 126 may derive the MV in a mode that does not encode motion information. In this case, the motion information is not included in the stream.
[0225] Here, the modes of MV derivation include a normal inter mode, a normal merge mode, a FRUC mode, an affine mode, etc., which will be described later. Among these modes, the modes that encode motion information include a normal inter mode, a normal merge mode, and an affine mode (specifically, an affine inter mode and an affine merge mode). Note that the motion information may include not only the MV but also prediction MV selection information, which will be described later. Also, the mode that does not encode motion information includes a FRUC mode. The inter prediction unit 126 selects a mode for deriving the MV of the current block from these multiple modes and derives the MV of the current block using the selected mode.
[0226] FIG. 37 is a flowchart showing another example of MV derivation.
[0227] The inter prediction unit 126 may derive the MV of the current block in a mode that encodes the differential MV. In this case, for example, the differential MV may be encoded as a prediction parameter and signaled. That is, the encoded differential MV is included in the stream. This differential MV is the difference between the MV of the current block and its predicted MV. Note that the predicted MV is a predicted motion vector.
[0228] Alternatively, the inter prediction unit 126 may derive the MV in a mode that does not encode the differential MV. In this case, the encoded differential MV is not included in the stream.
[0229] Here, as described above, the modes of deriving the MV include normal inter, normal merge mode, FRUC mode, and affine mode, etc., which will be described later. Among these modes, the modes that encode the differential MV include normal inter mode and affine mode (specifically, affine inter mode), etc. Also, the modes that do not encode the differential MV include FRUC mode, normal merge mode, and affine mode (specifically, affine merge mode), etc. The inter prediction unit 126 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.
[0230] [Modes of MV Derivation] FIGs. 38A and 38B are conceptual diagrams showing an example of the classification of each mode of MV derivation. For example, as shown in FIG. 38A, depending on whether to encode the motion information and whether to encode the differential MV, the modes of MV derivation are roughly classified into three modes. The three modes are inter mode, merge mode, and FRUC (frame rate up-conversion) mode. The inter mode is a mode that performs motion search and is a mode that encodes motion information and differential MV. For example, as shown in FIG. 38B, the inter mode includes affine inter mode and normal inter mode. The merge mode is a mode that does not perform motion search and is a mode that selects an MV from surrounding encoded blocks and derives the MV of the current block using the selected MV. This merge mode is basically a mode that encodes motion information and does not encode differential MV. For example, as shown in FIG. 38B, the merge mode includes normal merge mode (sometimes also called normal merge mode or regular merge mode), MMVD (Merge with Motion Vector Difference) mode, CIIP (Combined It includes an inter merge / intra prediction mode, a triangle mode, an ATMVP mode, and an affine merge mode. Here, in the MMVD mode among each mode included in the merge mode, exceptionally, the differential MV is encoded. Note that the above-mentioned affine merge mode and affine inter mode are modes included in the affine mode. The affine mode is a mode that assumes an affine transformation and derives the MV of each of a plurality of sub-blocks constituting the current block as the MV of the current block. The FRUC mode is a mode that derives the MV of the current block by performing a search between encoded regions, and does not encode either the motion information or the differential MV. Details of each of these modes will be described later.
[0231] Note that the classification of each mode shown in FIGS. 38A and 38B is an example and is not limited to this. For example, when the differential MV is encoded in the CIIP mode, the CIIP mode is classified as an inter mode.
[0232] [MV Derivation > Normal Inter Mode] The normal inter mode is an inter prediction mode that derives the MV of the current block based on a block similar to the image of the current block from the region of the reference picture indicated by the candidate MV. Also, in this normal inter mode, the differential MV is encoded.
[0233] FIG. 39 is a flowchart showing an example of the inter prediction process of the normal inter mode.
[0234] The inter prediction unit 126 first obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of encoded blocks temporally or spatially around the current block (step Sg_1). That is, the inter prediction unit 126 creates a candidate MV list.
[0235] Next, the inter prediction unit 126 extracts, as prediction motion vector candidates (also referred to as prediction MV candidates), each of N (N is an integer of 2 or more) candidate MVs from among the plurality of candidate MVs acquired in step Sg_1, according to a predetermined priority order (step Sg_2). Note that the priority order may be determined in advance for each of the N candidate MVs.
[0236] Next, the inter prediction unit 126 selects one prediction MV candidate from among the N prediction MV candidates as the prediction motion vector (also referred to as the prediction MV) of the current block (step Sg_3). At this time, the inter prediction unit 126 encodes, into the stream, prediction MV selection information for identifying the selected prediction MV. That is, the inter prediction unit 126 outputs, as prediction parameters, the prediction MV selection information to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0237] Next, the inter prediction unit 126 refers to the encoded reference picture and derives the MV of the current block (step Sg_4). At this time, the inter prediction unit 126 further encodes, into the stream, the difference value between the derived MV and the prediction MV as the differential MV. That is, the inter prediction unit 126 outputs, as prediction parameters, the differential MV to the entropy encoding unit 110 via the prediction parameter generation unit 130. Note that the encoded reference picture is a picture composed of a plurality of blocks reconstructed after encoding.
[0238] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sg_5). The processes of steps Sg_1 to Sg_5 are executed for each block. For example, when the processes of steps Sg_1 to Sg_5 are executed for all the blocks included in a slice, the inter prediction using the normal inter mode for that slice ends. Also, when the processes of steps Sg_1 to Sg_5 are executed for all the blocks included in a picture, the inter prediction using the normal inter mode for that picture ends. Note that when the processes of steps Sg_1 to Sg_5 are not executed for all the blocks included in a slice but are executed for some blocks, the inter prediction using the normal inter mode for that slice may end. This also applies to the processes of steps Sg_1 to Sg_5. When the processes of steps Sg_1 to Sg_5 are executed for some blocks included in a picture, the inter prediction using the normal inter mode for that picture may end.
[0239] Note that the predicted image is the above-described inter prediction signal. Also, information indicating the inter prediction mode (the normal inter mode in the above example) used for generating the predicted image, which is included in the encoded signal, is encoded as, for example, prediction parameters.
[0240] Note that the candidate MV list may be used in common with the lists used in other modes. Also, the processing related to the candidate MV list may be applied to the processing related to the lists used in other modes. The processing related to this candidate MV list is, for example, extraction or selection of candidate MVs from the candidate MV list, rearrangement of the candidate MVs, or deletion of the candidate MVs.
[0241] [MV Derivation > Normal Merge Mode] The normal merge mode is an inter prediction mode that derives an MV by selecting a candidate MV from a candidate MV list as the MV of the current block. Note that the normal merge mode is a type of merge mode and may simply be called the merge mode. In this embodiment, the normal merge mode and the merge mode are distinguished, and the merge mode is used in a broad sense.
[0242] Figure 40 is a flowchart showing an example of inter prediction by the normal merge mode.
[0243] First, the inter prediction unit 126 obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of encoded blocks temporally or spatially around the current block (step Sh_1). That is, the inter prediction unit 126 creates a candidate MV list.
[0244] Next, the inter prediction unit 126 derives the MV of the current block by selecting one candidate MV from the plurality of candidate MVs obtained in step Sh_1 (step Sh_2). At this time, the inter prediction unit 126 encodes the MV selection information for identifying the selected candidate MV into the stream. That is, the inter prediction unit 126 outputs the MV selection information as prediction parameters to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0245] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Sh_3). The processes of steps Sh_1 to Sh_3 are executed, for example, for each block. For example, when the processes of steps Sh_1 to Sh_3 are executed for all the blocks included in a slice, the inter prediction using the normal merge mode for that slice is completed. Also, when the processes of steps Sh_1 to Sh_3 are executed for all the blocks included in a picture, the inter prediction using the normal merge mode for that picture is completed. Note that when the processes of steps Sh_1 to Sh_3 are not executed for all the blocks included in a slice but are executed for some of the blocks, the inter prediction using the normal merge mode for that slice may be completed. This also applies to the processes of steps Sh_1 to Sh_3. When the processes of steps Sh_1 to Sh_3 are executed for some of the blocks included in a picture, the inter prediction using the normal merge mode for that picture may be completed.
[0246] In addition, information indicating the inter prediction mode (normal merge mode in the above example) used for generating the predicted image, which is included in the encoded signal, is encoded in the stream as, for example, prediction parameters.
[0247] FIG. 41 is a conceptual diagram for explaining an example of the MV derivation process of the current picture in the normal merge mode.
[0248] First, the inter prediction unit 126 generates a candidate MV list in which candidate MVs are registered. Examples of candidate MVs include a spatial adjacent candidate MV which is an MV possessed by a plurality of encoded blocks spatially adjacent to the current block, a temporal adjacent candidate MV which is an MV possessed by a nearby block obtained by projecting the position of the current block in the encoded reference picture, a combined candidate MV which is an MV generated by combining the MV values of the spatial adjacent candidate MV and the temporal adjacent candidate MV, and a zero candidate MV which is an MV having a value of zero.
[0249] Next, the inter prediction unit 126 determines one candidate MV as the MV of the current block by selecting one candidate MV from among the plurality of candidate MVs registered in the candidate MV list.
[0250] Furthermore, the entropy encoding unit 110 describes and encodes the merge_idx, which is a signal indicating which candidate MV has been selected, into the stream.
[0251] Note that the candidate MVs registered in the candidate MV list described in FIG. 41 are merely examples, and the number may be different from that in the figure, the configuration may not include some types of the candidate MVs in the figure, or the configuration may include candidate MVs other than the types of candidate MVs in the figure.
[0252] The final MV may be determined by performing DMVR (dynamic motion vector refreshing), which will be described later, using the MV of the current block derived in the normal merge mode. Note that in the normal merge mode, the motion information is encoded and the differential MV is not encoded. The MMVD mode selects one candidate MV from the candidate MV list in the same manner as the normal merge mode, but encodes the differential MV. Such MMVD may be classified into the merge mode together with the normal merge mode as shown in FIG. 38B. Note that the differential MV in the MMVD mode does not have to be the same as the differential MV used in the inter mode. For example, the derivation of the differential MV in the MMVD mode may be a process with a smaller processing amount compared to the derivation of the differential MV in the inter mode.
[0253] Also, a CIIP (Combined inter merge / intra prediction) mode may be performed in which the predicted image generated by inter prediction and the predicted image generated by intra prediction are superimposed to generate the predicted image of the current block.
[0254] Note that the candidate MV list may also be referred to as the candidate list. Also, merge_idx is MV selection information.
[0255] [MV Derivation > HMVP Mode] FIG. 42 is a conceptual diagram for explaining an example of the MV derivation process of the current picture in the HMVP mode.
[0256] In the normal merge mode, the MV of a current block, for example, a CU, is determined by selecting one candidate MV from among the MV lists generated with reference to encoded blocks (e.g., CUs). Here, other candidate MVs may be registered in the candidate MV list. A mode in which such other candidate MVs are registered is called the HMVP mode.
[0257] In the HMVP mode, candidate MVs are managed using a FIFO (First-In First-Out) server for HMVP separately from the candidate MV list in the normal merge mode.
[0258] In the FIFO buffer, motion information such as the MVs of blocks processed in the past is stored in order from the newest. In the management of this FIFO buffer, each time a block is processed, the MV of the newest block (i.e., the CU processed immediately before) is stored in the FIFO buffer, and instead, the MV of the oldest CU (i.e., the CU processed earliest) in the FIFO buffer is deleted from the FIFO buffer. In the example shown in FIG. 42, HMVP1 is the MV of the newest block, and HMVP5 is the MV of the oldest block.
[0259] Then, for example, the inter prediction unit 126 checks, in order from HMVP1, whether each MV managed in the FIFO buffer is different from all the candidate MVs already registered in the candidate MV list in the normal merge mode. And when the inter prediction unit 126 determines that it is different from all the candidate MVs, it may add the MV managed in the FIFO buffer as a candidate MV to the candidate MV list in the normal merge mode. At this time, one or more candidate MVs in the FIFO buffer may be registered (added to the candidate MV list).
[0260] By using the HMVP mode in this way, it becomes possible to add not only the MVs of spatially or temporally adjacent blocks of the current block but also the MVs of blocks processed in the past to the candidates. As a result, the variations of the candidate MVs in the normal merge mode are expanded, increasing the likelihood of improving the coding efficiency.
[0261] Note that the above-mentioned MV may be motion information. That is, the information stored in the candidate MV list and the FIFO buffer may include not only the value of the MV but also information indicating the information of the reference picture, the reference direction, the number of pictures, etc. Further, the above-mentioned block may be, for example, a CU.
[0262] Note that the candidate MV list and the FIFO buffer in FIG. 42 are examples, and the candidate MV list and the FIFO buffer may be lists or buffers of sizes different from those in FIG. 42, or may have a configuration in which candidate MVs are registered in an order different from that in FIG. 42. Further, the processing described here may be common to both the encoding device 100 and the decoding device 200.
[0263] Note that the HMVP mode can also be applied to modes other than the normal merge mode. For example, motion information such as the MVs of blocks processed in the affine mode in the past may be stored in the FIFO buffer in order from the newest and used as candidate MVs, which may improve efficiency. The mode in which the HMVP mode is applied to the affine mode may be called the history affine mode.
[0264] [MV Derivation > FRUC Mode] Motion information may be derived on the decoder side without being signaled from the encoder side. For example, motion information may be derived by performing motion search on the decoder 200 side. In an embodiment, on the decoder side, motion search is performed without using the pixel values of the current block. Modes in which such motion search is performed on the decoder 200 side without using the pixel values of the current block include, for example, the FRUC (frame rate up-conversion) mode or the PMMVD (pattern matched motion vector derivation) mode.
[0265] An example of FRUC processing in flowchart form is shown in FIG. 43. First, by referring to the MVs of each encoded block that is spatially or temporally adjacent to the current block, a list showing those MVs as candidate MVs (that is, a candidate MV list, which may be common to the candidate MV list in the normal merge mode) is generated (step Si_1).
[0266] Next, a best candidate MV is selected from among the plurality of candidate MVs registered in the candidate MV list (step Si_2). For example, an evaluation value for each candidate MV included in the candidate MV list is calculated, and one candidate MV is selected based on the evaluation value. Then, based on the selected candidate MV, an MV for the current block is derived (step Si_4). Specifically, for example, the selected candidate MV (best candidate MV) is directly derived as the MV for the current block. Also, for example, by performing pattern matching in a peripheral region of the position in the reference picture corresponding to the position in the reference picture of the selected candidate MV, an MV for the current block may be derived. That is, perform search using pattern matching and evaluation values on the region around the best candidate MV, and if there is an MV with a better evaluation value, update the best candidate MV to that MV and use it as the final MV of the current block. In one embodiment, it may not be necessary to perform an update to an MV having a better evaluation value.
[0267] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the encoded reference picture (step Si_5). The processes of steps Si_1 to Si_5 are executed, for example, for each block. For example, when the processes of steps Si_1 to Si_5 are executed for all the blocks included in a slice, the inter prediction using the FRUC mode for that slice ends. Also, when the processes of steps Si_1 to Si_5 are executed for all the blocks included in a picture, the inter prediction using the FRUC mode for that picture ends. Note that when the processes of steps Si_1 to Si_5 are not executed for all the blocks included in a slice but are executed for some of the blocks, the inter prediction using the FRUC mode for that slice may end. Similarly, when the processes of steps Si_1 to Si_5 are executed for some of the blocks included in a picture, the inter prediction using the FRUC mode for that picture may end.
[0268] Similar processing may be performed in units of sub-blocks.
[0269] The evaluation value may be calculated by various methods. For example, the reconstructed image of the region in the reference picture corresponding to the MV is compared with the reconstructed image of a predetermined region (the region may be, for example, as shown below, a region of another reference picture or a region of an adjacent block of the current picture). The predetermined region may be determined in advance.
[0270] Then, the difference between the pixel values of the two reconstructed images may be calculated and used as the evaluation value of the MV. Note that the evaluation value may be calculated using information other than the difference value in addition.
[0271] Next, an example of pattern matching will be described in detail. First, one candidate MV included in the candidate MV list (for example, the merge list) is selected as the start point of the search by pattern matching. For example, as the pattern matching, the first pattern matching or the second pattern matching may be used. The first pattern matching and the second pattern matching may be called bilateral matching and template matching, respectively.
[0272] [MV Derivation > FRUC > Bilateral Matching] In the first pattern matching, pattern matching is performed between two blocks in two different reference pictures, which are two blocks along the motion trajectory of the current block. Therefore, in the first pattern matching, as the predetermined region for calculating the evaluation value of the candidate MV described above, a region in another reference picture along the motion trajectory of the current block is used. The predetermined region may be determined in advance.
[0273] FIG. 44 is a conceptual diagram for explaining an example of first pattern matching (bilateral matching) between two blocks in two reference pictures along a motion trajectory. As shown in FIG. 44, in the first pattern matching, two MVs (MV0, MV1) are derived by searching for the most matching pair among pairs of two blocks in two different reference pictures (Ref0, Ref1) that are two blocks along the motion trajectory of the current block (Cur block). Specifically, for the current block, the difference between the reconstructed image at the specified position in the first encoded reference picture (Ref0) specified by the candidate MV and the reconstructed image at the specified position in the second encoded reference picture (Ref1) specified by the symmetric MV obtained by scaling the candidate MV by the display time interval is derived, and an evaluation value is calculated using the obtained difference value. A candidate MV with the best evaluation value among a plurality of candidate MVs can be selected as the final MV, which may lead to good results.
[0274] Under the assumption of a continuous motion trajectory, the MVs (MV0, MV1) indicating the two reference blocks are proportional to the temporal distances (TD0, TD1) between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, when the current picture is temporally located between the two reference pictures and the temporal distances from the current picture to the two reference pictures are equal, in the first pattern matching, mirror-symmetric bidirectional MVs are derived.
[0275] [MV Derivation > FRUC > Template Matching] In the second pattern matching (template matching), pattern matching is performed between a template in the current picture (a block adjacent to the current block in the current picture (e.g., the upper and / or left adjacent blocks)) and a block in the reference picture. Therefore, in the second pattern matching, a block adjacent to the current block in the current picture is used as a predetermined region for calculating the evaluation value of the candidate MV described above.
[0276] FIG. 45 is a conceptual diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. As shown in FIG. 45, in the second pattern matching, the MV of the current block is derived by searching in the reference picture (Ref0) for the block that most closely matches the block adjacent to the current block (Cur block) in the current picture (Cur Pic). Specifically, for the current block, the difference between the reconstructed image of the encoded region of both or either of the left and upper adjacent blocks 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. A candidate MV with the best evaluation value among the plurality of candidate MVs may be selected as the best candidate MV.
[0277] Information indicating whether or not to apply such a FRUC mode (for example, called a FRUC flag) may be signaled at the CU level. Also, when the FRUC mode is applied (for example, when 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 necessarily limited to the CU level and may be at other levels (for example, sequence level, picture level, slice level, tile level, CTU level, or sub-block level).
[0278] [MV Derivation > Affine Mode] The affine mode is a mode that generates an MV using an affine transformation. For example, the MV may be derived in sub-block units based on the MVs of a plurality of adjacent blocks. This mode is sometimes called an affine motion compensation prediction mode.
[0279] FIG. 46A is a conceptual diagram for explaining an example of deriving an MV of a sub-block unit based on MVs of a plurality of adjacent blocks. In FIG. 46A, a current block includes, for example, sub-blocks each consisting of 16 4x4 pixels. Here, a motion vector v0 of the upper left control point of the current block is derived based on the MVs of adjacent blocks, and similarly, a motion vector v1 of the upper right control point of the current block is derived based on the MVs of adjacent sub-blocks. Then, the two motion vectors v0 and v1 are projected by the following equation (1A) to derive the motion vectors (v x , v y ) of each sub-block within the current block.
[0280]
Equation
[0281] Here, x and y indicate the horizontal position and the vertical position of the sub-block, respectively, and w indicates a predetermined weight coefficient. The predetermined weight coefficient may be determined in advance.
[0282] Information indicating such an affine mode (for example, called an affine flag) may be signaled at the CU level. Note that the signaling of the information indicating this affine mode is not necessarily limited to the CU level, and may be at other levels (for example, sequence level, picture level, slice level, tile level, CTU level, or sub-block level).
[0283] Also, such an affine mode may include several modes in which the methods of deriving the MVs of the upper left and upper right control points are different. For example, the affine mode includes two modes: an affine inter (also called affine normal inter) mode and an affine merge mode.
[0284] FIG. 46B is a conceptual diagram for explaining an example of deriving an MV for each sub-block in affine mode using three control points. In FIG. 46B, the current block includes, for example, a sub-block consisting of 16 4x4 pixels. Here, the motion vector v0 of the upper left control point of the current block is derived based on the MVs of adjacent blocks. Similarly, the motion vector v1 of the upper right control point of the current block is derived based on the MVs of adjacent blocks, and the motion vector v2 of the lower left control point of the current block is derived based on the MVs of adjacent blocks. Then, by the following equation (1B), the three motion vectors v0, v1, and v2 are projected to derive the motion vectors (v x , v y ) of each sub-block within the current block.
[0285]
Equation
[0286] Here, x and y respectively indicate the horizontal position and the vertical position of the sub-block center, and w and h indicate weight coefficients that may be predetermined weight coefficients. In an embodiment, w may indicate the width of the current block, and h may indicate the height of the current block.
[0287] The affine modes using different numbers of control points (for example, two and three) may be switched and signaled at the CU level. Note that information indicating the number of control points of the affine mode used at the CU level may be signaled at other levels (for example, sequence level, picture level, slice level, tile level, CTU level, or sub-block level).
[0288] In addition, the affine mode having such three control points may include several modes in which the methods for deriving the MVs of the upper left, upper right, and lower left corner control points are different. For example, the affine mode having three control points includes two modes, namely, the affine inter mode and the affine merge mode, similar to the affine mode having two control points described above.
[0289] Note that in the affine mode, the size of each sub-block included in the current block is not limited to 4x4 pixels and may be other sizes. For example, the size of each sub-block may be 8×8 pixels.
[0290] [MV Derivation > Affine Mode > Control Point] FIG. 47A, FIG. 47B, and FIG. 47C are conceptual diagrams for explaining an example of MV derivation of control points in the affine mode.
[0291] In the affine mode, as shown in FIG. 47A, for example, among the encoded blocks A (left), B (upper), C (upper right), D (lower left), and E (upper left) adjacent to the current block, the predicted MVs of the respective control points of the current block are calculated based on a plurality of MVs corresponding to the blocks encoded in the affine mode. Specifically, these blocks are inspected in the order of the encoded blocks A (left), B (upper), C (upper right), D (lower left), and E (upper left), and the first valid block encoded in the affine mode is identified. Based on the plurality of MVs corresponding to this identified block, the predicted MVs of the control points of the current block are calculated.
[0292] For example, as shown in FIG. 47B, when block A adjacent to the left of the current block is encoded in affine mode with two control points, motion vectors v3 and v4 projected onto the upper left and upper right corner positions of the encoded block including block A are derived. Then, from the derived motion vectors v3 and v4, the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point are calculated.
[0293] For example, as shown in FIG. 47C, when block A adjacent to the left of the current block is encoded in affine mode with three control points, motion vectors v3, v4, and v5 projected onto the upper left, upper right, and lower left corner positions of the encoded block including block A are derived. Then, from the derived motion vectors v3, v4, and v5, the motion vector v0 of the upper left corner control point of the current block, the motion vector v1 of the upper right corner control point, and the motion vector v2 of the lower left corner control point are calculated.
[0294] Note that the method for deriving the MV shown in FIGS. 47A to 47C may be used for deriving the MV of each control point of the current block in step Sk_1 shown in FIG. 50, or may be used for deriving the predicted MV of each control point of the current block in step Sj_1 shown in FIG. 51 described later.
[0295] FIGS. 48A and 48B are conceptual diagrams for explaining another example of deriving the control point MV in affine mode.
[0296] FIG. 48A is a conceptual diagram for explaining an example of affine mode with two control points.
[0297] In this affine mode, as shown in FIG. 48A, the MV selected from each of the MVs of the encoded blocks A, B, and C adjacent to the current block is used as the motion vector v0 of the upper left control point of the current block. Similarly, the MV selected from each of the MVs of the encoded blocks D and E adjacent to the current block is used as the motion vector v1 of the upper right control point of the current block.
[0298] FIG. 48B is a conceptual diagram for explaining an example of the affine mode having three control points.
[0299] In this affine mode, as shown in FIG. 48B, the MV selected from each of the MVs of the encoded blocks A, B, and C adjacent to the current block is used as the motion vector v0 of the upper left control point of the current block. Similarly, the MV selected from each of the MVs of the encoded blocks D and E adjacent to the current block is used as the motion vector v1 of the upper right control point of the current block. Further, the MV selected from each of the MVs of the encoded blocks F and G adjacent to the current block is used as the motion vector v2 of the lower left control point of the current block.
[0300] Note that the method for deriving the MVs shown in FIGS. 48A and 48B may be used for deriving the MVs of each control point of the current block in step Sk_1 shown in FIG. 50 described later, or may be used for deriving the predicted MVs of each control point of the current block in step Sj_1 of FIG. 51 described later.
[0301] Here, for example, when switching and signaling the affine mode with different numbers of control points (for example, two and three) at the CU level, there may be a case where the number of control points is different between the encoded block and the current block.
[0302] FIG. 49A and FIG. 49B are conceptual diagrams for explaining an example of a method for deriving an MV of a control point when the number of control points in an encoded block and a current block is different.
[0303] For example, as shown in FIG. 49A, the current block has three control points at the upper left corner, upper right corner, and lower left corner, and the block A adjacent to the left of the current block is encoded in an affine mode having two control points. In this case, motion vectors v3 and v4 projected onto the upper left corner and upper right corner positions of the encoded block including block A are derived. Then, from the derived motion vectors v3 and v4, the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point are calculated. Further, from the derived motion vectors v0 and v1, the motion vector v2 of the lower left corner control point is calculated.
[0304] For example, as shown in FIG. 49B, the current block has two control points at the upper left corner and upper right corner, and the block A adjacent to the left of the current block is encoded in an affine mode having three control points. In this case, motion vectors v3, v4, and v5 projected onto the upper left corner, upper right corner, and lower left corner positions of the encoded block including block A are derived. Then, from the derived motion vectors v3, v4, and v5, the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point are calculated.
[0305] Note that the method for deriving the MV shown in FIGS. 49A and 49B may be used for deriving the MV of each control point of the current block in step Sk_1 shown in FIG. 50 described later, or may be used for deriving the predicted MV of each control point of the current block in step Sj_1 of FIG. 51 described later.
[0306] [MV Derivation > Affine Mode > Affine Merge Mode] FIG. 50 is a flowchart showing an example of the processing of the affine merge mode.
[0307] In the affine merge mode, first, the inter prediction unit 126 derives the respective MVs of the control points of the current block (step Sk_1). As shown in FIG. 46A, the control points are the points at the upper left corner and the upper right corner of the current block, or as shown in FIG. 46B, the points at the upper left corner, the upper right corner, and the lower left corner of the current block. The inter prediction unit 126 may encode the MV selection information for identifying the derived two or three MVs into the stream.
[0308] For example, when using the MV derivation method shown in FIGS. 47A to 47C, the inter prediction unit 126 inspects these blocks in the order of the encoded block A (left), block B (upper), block C (upper right), block D (lower left), and block E (upper left) as shown in FIG. 47A, and identifies the first valid block encoded in the affine mode.
[0309] The inter prediction unit 126 derives the MVs of the control points using the first valid block encoded in the identified affine mode. For example, if block A is identified and block A has two control points, as shown in FIG. 47B, the inter prediction unit 126 calculates the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point from the motion vectors v3 and v4 at the upper left corner and the upper right corner of the encoded block including block A. For example, the inter prediction unit 126 calculates the motion vector v0 of the upper left corner control point of the current block and the motion vector v1 of the upper right corner control point by projecting the motion vectors v3 and v4 at the upper left corner and the upper right corner of the encoded block onto the current block.
[0310] Alternatively, when block A is identified and block A has three control points, as shown in FIG. 47C, the inter prediction unit 126 calculates the motion vectors v0, v1, and v2 of the upper left corner control point, the upper right corner control point, and the lower left corner control point of the current block from the motion vectors v3, v4, and v5 of the upper left corner, the upper right corner, and the lower left corner of the encoded block including block A. For example, the inter prediction unit 126 projects the motion vectors v3, v4, and v5 of the upper left corner, the upper right corner, and the lower left corner of the encoded block onto the current block to calculate 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.
[0311] Note that, as shown in FIG. 49A described above, when block A is identified and block A has two control points, the MVs of the three control points may be calculated. As shown in FIG. 49B described above, when block A is identified and block A has three control points, the MVs of the two control points may be calculated.
[0312] Next, the inter prediction unit 126 performs motion compensation for each of a plurality of sub-blocks included in the current block. That is, the inter prediction unit 126 calculates the MV of each of the plurality of sub-blocks as an affine MV using, for example, two motion vectors v0 and v1 and the above-described formula (1A), or using three motion vectors v0, v1, and v2 and the above-described formula (1B) (step Sk_2). Then, the inter prediction unit 126 performs motion compensation for the sub-block using those affine MVs and the encoded reference picture (step Sk_3). When the processes of steps Sk_2 and Sk_3 are executed for each of all the sub-blocks included in the current block, the process of generating a predicted image using the affine merge mode for the current block ends. That is, motion compensation is performed for the current block, and a predicted image of the current block is generated.
[0313] In step Sk_1, the above-described candidate MV list may be generated. The candidate MV list may be, for example, a list including candidate MVs derived using a plurality of MV derivation methods for each control point. The plurality of MV derivation methods may be, for example, any combination of the MV derivation methods shown in FIGS. 47A to 47C, the MV derivation methods shown in FIGS. 48A and 48B, the MV derivation methods shown in FIGS. 49A and 49B, and other MV derivation methods.
[0314] Note that the candidate MV list may include candidate MVs in a mode that performs prediction in units of sub-blocks other than the affine mode.
[0315] Note that as the candidate MV list, for example, a candidate MV list including candidate MVs in the affine merge mode having two control points and candidate MVs in the affine merge mode having three control points may be generated. Alternatively, a candidate MV list including candidate MVs in the affine merge mode having two control points and a candidate MV list including candidate MVs in the affine merge mode having three control points may be generated respectively. Alternatively, a candidate MV list including candidate MVs in one of the modes of the affine merge mode having two control points and the affine merge mode having three control points may be generated. The candidate MV may be, for example, the MV of the encoded block A (left), block B (upper), block C (upper right), block D (lower left), and block E (upper left), or may be the MV of the valid block among those blocks.
[0316] Note that as the MV selection information, an index indicating which candidate MV in the candidate MV list may be sent.
[0317] [MV Derivation > Affine Mode > Affine Inter-Mode] FIG. 51 is a flowchart showing an example of the processing in the affine inter-mode.
[0318] In the affine inter mode, first, the inter prediction unit 126 derives the prediction MV (v0, v1) or (v0, v1, v2) for each of two or three control points of the current block (step Sj_1). As shown in FIGS. 46A or 46B, the control points are, for example, the points at the upper left corner, upper right corner, or lower left corner of the current block.
[0319] For example, when using the MV derivation method shown in FIGS. 48A and 48B, the inter prediction unit 126 derives the prediction MV (v0, v1) or (v0, v1, v2) of the control point of the current block by selecting the MV of any block among the encoded blocks near each control point of the current block shown in FIGS. 48A or 48B. At this time, the inter prediction unit 126 encodes the prediction MV selection information for identifying the two or three selected prediction MVs into the stream.
[0320] For example, the inter prediction unit 126 may determine which block's MV to select as the prediction MV of the control point from the encoded blocks adjacent to the current block using cost evaluation or the like, and describe a flag indicating which prediction MV is selected in the bit stream. That is, the inter prediction unit 126 outputs the prediction MV selection information such as a flag as a prediction parameter to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0321] Next, while updating the prediction MVs selected or derived in step Sj_1 respectively (step Sj_2), the inter prediction unit 126 performs motion search (steps Sj_3 and Sj_4). That is, the inter prediction unit 126 calculates the MV of each sub-block corresponding to the updated prediction MV as an affine MV using the above formula (1A) or formula (1B) (step Sj_3). Then, the inter prediction unit 126 performs motion compensation on each sub-block using those affine MVs and the encoded reference picture (step Sj_4). The processes of steps Sj_3 and Sj_4 are executed for all the blocks in the current block every time the prediction MV is updated in step Sj_2. As a result, the inter prediction unit 126 determines, for example, the prediction MV that obtains the smallest cost as the MV of the control point in the motion search loop (step Sj_5). At this time, the inter prediction unit 126 further encodes the difference value between the determined MV and the prediction MV as a differential MV into the stream. That is, the inter prediction unit 126 outputs the differential MV as a prediction parameter to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0322] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing motion compensation on the current block using the determined MV and the encoded reference picture (step Sj_6).
[0323] Note that in step Sj_1, the above-mentioned candidate MV list may be generated. The candidate MV list may be, for example, a list including candidate MVs derived using a plurality of MV derivation methods for each control point. The plurality of MV derivation methods may be, for example, any combination of the MV derivation methods shown in FIGS. 47A to 47C, the MV derivation methods shown in FIGS. 48A and 48B, the MV derivation methods shown in FIGS. 49A and 49B, and other MV derivation methods.
[0324] Note that the candidate MV list may include candidate MVs in a mode that performs prediction in units of sub-blocks other than the affine mode.
[0325] Note that as a candidate MV list, a candidate MV list including an affine inter-mode candidate MV having two control points and an affine inter-mode candidate MV having three control points may be generated. Alternatively, a candidate MV list including an affine inter-mode candidate MV having two control points and a candidate MV list including an affine inter-mode candidate MV having three control points may be generated respectively. Alternatively, a candidate MV list including candidate MVs of one of the modes of an affine inter-mode having two control points and an affine inter-mode having three control points may be generated. The candidate MV may be, for example, an MV of an encoded block A (left), block B (upper), block C (upper right), block D (lower left), and block E (upper left), or may be an MV of a valid block among those blocks.
[0326] Note that as prediction MV selection information, an index indicating which candidate MV in the candidate MV list may be sent.
[0327] [MV Derivation > Triangle Mode] In the above example, the inter prediction unit 126 generates one rectangular prediction image for a rectangular current block. However, the inter prediction unit 126 may generate a plurality of prediction images having shapes different from the rectangle for the rectangular current block, and generate a final rectangular prediction image by combining those plurality of prediction images. The shape different from the rectangle may be, for example, a triangle.
[0328] FIG. 52A is a conceptual diagram for explaining the generation of two triangular prediction images.
[0329] The inter prediction unit 126 generates a predicted image of a triangle by performing motion compensation on the first partition of the triangle within the current block using the first MV of the first partition. Similarly, the inter prediction unit 126 generates a predicted image of a triangle by performing motion compensation on the second partition of the triangle within the current block using the second MV of the second partition. Then, the inter prediction unit 126 generates a predicted image of a rectangle identical to the current block by combining these predicted images.
[0330] Note that as the predicted image of the first partition, a first predicted image of a rectangle corresponding to the current block may be generated using the first MV. Also, as the predicted image of the second partition, a second predicted image of a rectangle corresponding to the current block may be generated using the second MV. The predicted image of the current block may be generated by weighted addition of the first predicted image and the second predicted image. Note that the region for weighted addition may be only a partial region sandwiching the boundary between the first partition and the second partition.
[0331] FIG. 52B is a conceptual diagram showing a first portion of a first partition that overlaps a second partition, and examples of a first sample set and a second sample set that can be weighted as part of a correction process. The first portion may be, for example, one-fourth of the width or height of the first partition. In another example, the first portion may have a width corresponding to N samples adjacent to the edge of the first partition. Here, N is an integer greater than zero, and for example, N may be the integer 2. FIG. 52B shows a rectangular partition having a rectangular portion with a width of one-fourth of the width of the first partition. Here, the first sample set includes samples outside the first portion and samples inside the first portion, and the second sample set includes samples within the first portion. The central example of FIG. 52B shows a rectangular partition having a rectangular portion with a height of one-fourth of the height of the first partition. Here, the first sample set includes samples outside the first portion and samples inside the first portion, and the second sample set includes samples within the first portion. The right example of FIG. 52B shows a triangular partition having a polygonal portion with a height corresponding to two samples. Here, the first sample set includes samples outside the first portion and samples inside the first portion, and the second sample set includes samples within the first portion.
[0332] The first portion may be a portion of the first partition that overlaps an adjacent partition. FIG. 52C is a conceptual diagram showing a first portion of a first partition that is a portion of the first partition overlapping a portion of an adjacent partition. For simplicity of explanation, a rectangular partition having a portion overlapping a spatially adjacent rectangular partition is shown. Partitions having other shapes such as triangular partitions may be used, and the overlapping portion may overlap partitions that are spatially or temporally adjacent.
[0333] Also, an example of generating a predicted image for each of two partitions using inter prediction is shown, but a predicted image may be generated for at least one partition using intra prediction.
[0334] FIG. 53 is a flowchart showing an example of processing in triangle mode.
[0335] In triangle mode, first, the inter prediction unit 126 divides the current block into a first partition and a second partition (step Sx_1). At this time, the inter prediction unit 126 may encode the partition information, which is information regarding the division into each partition, as prediction parameters into the stream. That is, the inter prediction unit 126 may output the partition information as prediction parameters to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0336] Next, the inter prediction unit 126 first obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of encoded blocks around the current block temporally or spatially (step Sx_2). That is, the inter prediction unit 126 creates a candidate MV list.
[0337] Then, the inter prediction unit 126 selects a candidate MV for the first partition and a candidate MV for the second partition as a first MV and a second MV, respectively, from among the plurality of candidate MVs obtained in step Sx_2 (step Sx_3). At this time, the inter prediction unit 126 may encode the MV selection information for identifying the selected candidate MV as prediction parameters into the stream. That is, the inter prediction unit 126 may output the MV selection information as prediction parameters to the entropy encoding unit 110 via the prediction parameter generation unit 130.
[0338] Next, the inter prediction unit 126 generates a first prediction image by performing motion compensation using the selected first MV and the encoded reference picture (step Sx_4). Similarly, the inter prediction unit 126 generates a second prediction image by performing motion compensation using the selected second MV and the encoded reference picture (step Sx_5).
[0339] Finally, the inter prediction unit 126 generates a predicted image of the current block by performing weighted addition of the first predicted image and the second predicted image (step Sx_6).
[0340] In the example shown in FIG. 52A, the first partition and the second partition are each triangular, but they may be trapezoidal or may have different shapes from each other. Further, in the example shown in FIG. 52A, the current block is composed of two partitions, but it may be composed of three or more partitions.
[0341] 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 predicted image of the current block may be generated using the predicted image in the first partition and the predicted image in the second partition.
[0342] Also, in this example, an example in which predicted images are generated by inter prediction for both two partitions is shown, but predicted images may be generated by intra prediction for at least one partition.
[0343] Note that the candidate MV list for selecting the first MV and the candidate MV list for selecting the second MV may be different or may be the same candidate MV list.
[0344] Note that the partition information may include at least an index indicating a splitting direction for splitting the current block into a plurality of partitions. The MV selection information may include an index indicating the selected first MV and an index indicating the selected second MV. One index may indicate a plurality of pieces of information. For example, one index that collectively indicates part or all of the partition information and part or all of the MV selection information may be encoded.
[0345] [MV Derivation > ATMVP Mode] FIG. 54 is a conceptual diagram showing an example of the ATMVP (Advanced Temporal Motion Vector Prediction) mode in which MVs are derived in sub-block units.
[0346] The ATMVP mode is a mode classified into the merge mode. For example, in the ATMVP mode, candidate MVs in sub-block units are registered in the candidate MV list used for the normal merge mode.
[0347] Specifically, in the ATMVP mode, first, as shown in FIG. 54, in the encoded reference picture specified by the MV (MV0) of the block adjacent to the lower left of the current block, the temporal MV reference block associated with the current block is identified. Next, for each sub-block in the current block, the MV used at the time of encoding the region corresponding to the sub-block in the temporal MV reference block is identified. The MV thus identified is included in the candidate MV list as a candidate MV for the sub-block of the current block. When the candidate MV of each such sub-block is selected from the candidate MV list, motion compensation using the candidate MV as the MV of the sub-block is performed for the sub-block. Thereby, a predicted image of each sub-block is generated.
[0348] Note that, in the example shown in FIG. 54, a block adjacent to the lower left of the current block is used as the peripheral MV reference block, but other blocks may be used. Also, the size of the sub-block may be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block may be switched in units such as slices, bricks, or pictures.
[0349] [Motion Search > DMVR] FIG. 55 is a flowchart showing the relationship between the merge mode and DMVR (Decoder Motion Vector Refinement).
[0350] The inter prediction unit 126 derives the MV of the current block in merge mode (step Sl_1). Next, the inter prediction unit 126 determines whether to perform MV search, that is, motion search (step Sl_2). Here, if the inter prediction unit 126 determines not to perform motion search (No in step Sl_2), it determines the MV derived in step Sl_1 as the final MV for the current block (step Sl_4). That is, in this case, the MV of the current block is determined in merge mode.
[0351] On the other hand, if it is determined to perform motion search in step Sl_1 (Yes in step Sl_2), the inter prediction unit 126 derives the final MV for the current block by searching the peripheral region of the reference picture indicated by the MV derived in step Sl_1 (step Sl_3). That is, in this case, the MV of the current block is determined by DMVR.
[0352] FIG. 56 is a conceptual diagram for explaining an example of DMVR processing for determining an MV.
[0353] First, for example, in merge mode, candidate MVs (L0 and L1) are selected for the current block. Then, according to the candidate MV (L0), reference pixels are specified from the first reference picture (L0) which is the encoded picture of the L0 list. Similarly, according to the candidate MV (L1), reference pixels are specified from the second reference picture (L1) which is the encoded picture of the L1 list. A template is generated by taking the average of these reference pixels.
[0354] Next, using the template, the peripheral regions of the candidate MVs of the first reference picture (L0) and the second reference picture (L1) are searched respectively, and the MV with the minimum cost is determined as the final MV of the current block. Note that the cost may be calculated using, for example, the difference value between each pixel value of the template and each pixel value of the search region and the candidate MV value, etc.
[0355] Even if it is not the process described here, other processes may be used as long as they can search the vicinity of the candidate MV to derive the final MV.
[0356] FIG. 57 is a conceptual diagram for explaining another example of the DMVR for determining the MV. In this example shown in FIG. 57, unlike the example of the DMVR shown in FIG. 56, the cost is calculated without generating a template.
[0357] First, the inter prediction unit 126 searches the vicinity of the reference blocks included in each of the reference pictures in the L0 list and the L1 list based on the initial MV, which is the candidate MV obtained from the candidate MV list. For example, as shown in FIG. 57, the initial MV corresponding to the reference block in the L0 list is InitMV_L0, and the initial MV corresponding to the reference block in the L1 list is InitMV_L1. In motion search, the inter prediction unit 126 first sets the search position for the reference picture in the L0 list. The difference vector indicating the set search position, specifically, the difference vector from the position indicated by the initial MV (i.e., InitMV_L0) to the search position, is MVd_L0. Then, the inter prediction unit 126 determines the search position in the reference picture in the L1 list. This search position is indicated by the difference vector from the position indicated by the initial MV (i.e., InitMV_L1) to the search position. Specifically, the inter prediction unit 126 determines the difference vector as MVd_L1 by mirroring MVd_L0. That is, the inter prediction unit 126 sets the position symmetric to the position indicated by the initial MV as the search position in each of the reference pictures in the L0 list and the L1 list. The inter prediction unit 126 calculates, for each search position, the sum of the absolute differences (SAD) of the pixel values in the block at the search position as the cost, and finds the search position where the cost is minimized.
[0358] FIG. 58A is a conceptual diagram showing an example of motion search in the DMVR, and FIG. 58B is a flowchart showing an example of the motion search process.
[0359] First, in Step1, the inter prediction unit 126 calculates the costs at the search position indicated by the initial MV (also referred to as the starting point) and the eight search positions around it. Then, the inter prediction unit 126 determines whether the cost of the search position other than the starting point is the minimum. Here, when the inter prediction unit 126 determines that the cost of the search position other than the starting point is the minimum, it moves to the search position where the cost is the minimum and performs the processing of Step2. On the other hand, if the cost of the starting point is the minimum, the inter prediction unit 126 skips the processing of Step2 and performs the processing of Step3.
[0360] In Step2, the inter prediction unit 126 performs the same search as in the processing of Step1 with the search position moved according to the processing result of Step1 as the new starting point. Then, the inter prediction unit 126 determines whether the cost of the search position other than the starting point is the minimum. Here, if the cost of the search position other than the starting point is the minimum, the inter prediction unit 126 performs the processing of Step4. On the other hand, if the cost of the starting point is the minimum, the inter prediction unit 126 performs the processing of Step3.
[0361] In Step4, the inter prediction unit 126 treats the search position of the starting point as the final search position, and determines the difference between the position indicated by the initial MV and the final search position as the difference vector.
[0362] In Step3, the inter prediction unit 126 determines the pixel position with the minimum cost in decimal precision based on the costs at the four points above, below, left, and right of the starting point in Step1 or Step2, and sets the pixel position as the final search position. The pixel position in decimal precision is determined by weighted addition of the vectors of the four points above, below, left, and right ((0, 1), (0, -1), (-1, 0), (1, 0)) with the costs at the respective search positions of the four points as weights. Then, the inter prediction unit 126 determines the difference between the position indicated by the initial MV and the final search position as the difference vector.
[0363] [Motion Compensation > BIO / OBMC / LIC] In motion compensation, there are modes for generating a predicted image and correcting the predicted image. Such modes are, for example, BIO (bi - directional optical flow), OBMC (overlapped block motion compensation), and LIC (local illumination compensation) described later.
[0364] FIG. 59 is a flowchart showing an example of the generation process of a predicted image.
[0365] The inter - prediction unit 126 generates a predicted image (step Sm_1) and corrects the predicted image by any of the above - mentioned modes (step Sm_2).
[0366] FIG. 60 is a flowchart showing another example of the generation process of a predicted image.
[0367] The inter - prediction unit 126 determines the MV of the current block (step Sn_1). Next, the inter - prediction unit 126 generates a predicted image using the MV (step Sn_2) and determines whether to perform a correction process (step Sn_3). Here, when the inter - prediction unit 126 determines to perform the correction process (Yes in step Sn_3), it generates a final predicted image by correcting the predicted image (step Sn_4). Note that in LIC described later, in step Sn_4, the luminance and color difference may be corrected. On the other hand, when the inter - prediction unit 126 determines not to perform the correction process (No in step Sn_3), it outputs the predicted image as the final predicted image without correction (step Sn_5).
[0368] [Motion Compensation > OBMC] Not only the motion information of the current block obtained by motion search but also the motion information of adjacent blocks may be used to generate an inter-predicted image. Specifically, a predicted image based on the motion information obtained by motion search (in the reference picture) and a predicted image based on the motion information of adjacent blocks (in the current picture) may be weighted and added to generate an inter-predicted image in units of sub-blocks within the current block. Such inter-prediction (motion compensation) is sometimes called OBMC (overlapped block motion compensation) or the OBMC mode.
[0369] In the OBMC mode, information indicating the size of sub-blocks for OBMC (for example, called the OBMC block size) may be signaled at the sequence level. Further, information indicating whether or not to apply the OBMC mode (for example, called the OBMC flag) may be signaled at the CU level. Note that the signaling levels of these pieces of information do not have to be limited to the sequence level and the CU level, and may be other levels (for example, the picture level, slice level, block level, CTU level, or sub-block level).
[0370] The OBMC mode will be described more specifically. FIGS. 61 and 62 are a flowchart and a conceptual diagram for explaining the outline of the predicted image correction process by OBMC.
[0371] First, as shown in FIG. 62, a predicted image (Pred) by normal motion compensation is obtained using the MV assigned to the current block. In FIG. 62, the arrow “MV” points to the reference picture and indicates what the current block of the current picture is referring to in order to obtain the predicted image.
[0372] Next, the already derived MV (MV_L) for the encoded left adjacent block is applied (reused) to the current block to obtain a predicted image (Pred_L). The MV (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.
[0373] Similarly, the already derived MV (MV_U) for the encoded upper adjacent block is applied (reused) to the current block to obtain a predicted image (Pred_U). The MV (MV_U) is indicated by the arrow "MV_U" pointing from the current block to the reference picture. Then, the second correction of the predicted image is performed by superimposing the predicted image Pred_U on the predicted image (e.g., Pred and Pred_L) that has undergone the first correction. This has the effect of blending the boundaries between adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block in which the boundary with the adjacent block is blended (smoothed).
[0374] Note that the above example is a two-pass correction method using left and upper adjacent blocks, but the correction method may also be a three-pass or more pass correction method using right and / or lower adjacent blocks.
[0375] Note that the region for superimposition may be only a partial region near the block boundary, rather than the pixel region of the entire block.
[0376] Here, the prediction image correction process of OBMC for obtaining one prediction image Pred by superimposing additional prediction images Pred_L and Pred_U on one reference picture has been described. However, when the prediction image is corrected based on a plurality of reference images, the same process may be applied to each of the plurality of reference pictures. In such a case, by performing the image correction of OBMC based on a plurality of reference pictures, after obtaining the corrected prediction images from each reference picture, the final prediction image is obtained by further superimposing the obtained plurality of corrected prediction images.
[0377] Note that in OBMC, the unit of the current block may be a PU unit or a sub-block unit obtained by further dividing the PU.
[0378] As a method for determining whether to apply OBMC, for example, there is a method using obmc_flag, which is a signal indicating whether to apply OBMC. As a specific example, the encoding device 100 may determine whether the current block belongs to a region with complex motion. When the current block belongs to a region with complex motion, the encoding device 100 sets the value 1 as obmc_flag and applies OBMC for encoding. When the current block does not belong to a region with complex motion, the encoding device 100 sets the value 0 as obmc_flag and performs block encoding without applying OBMC. On the other hand, in the decoding device 200, by decoding the obmc_flag described in the stream, decoding is performed by switching whether to apply OBMC according to the value.
[0379] [Motion Compensation > BIO] Next, a method for deriving the MV will be described. First, a mode for deriving the MV based on a model assuming uniform linear motion will be described. This mode is sometimes called the BIO (bi - directional optical flow) mode. Also, this bi - directional optical flow may be denoted as BDOF instead of BIO.
[0380] FIG. 63 is a diagram for explaining a model assuming uniform linear motion. In FIG. 63, (v x , v y ) indicates a velocity vector, and τ0 and τ1 indicate the temporal distances between the current picture (Cur Pic) and two reference pictures (Ref0, Ref1), respectively. (MV x0 , MV y0 ) indicates the MV corresponding to the reference picture Ref0, and (MV x1 , MV y1 ) indicates the MV corresponding to the reference picture Ref1.
[0381] At this time, under the assumption of uniform linear motion of the velocity vector (v x , v y ), (MV x0 , MV y0 ) and (MV x1 , MV y1 ) are represented as (v xτ0 , v yτ0 ) and (-v xτ1 , -v yτ1 ), respectively, and the following optical flow equation (2) holds.
[0382]
Equation
[0383] Here, I(k) indicates the motion-compensated luminance value of the reference picture k (k = 0, 1) after motion compensation. This optical flow equation indicates that the sum of (i) the temporal 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 the combination of this optical flow equation and Hermite interpolation, the motion vector in block units obtained from the candidate MV list or the like may be corrected in pixel units.
[0384] Note that the MV may be derived on the decoder 200 side by a method different from the derivation of the motion vector based on the model assuming uniform linear motion. For example, the motion vector may be derived in units of sub-blocks based on the MVs of a plurality of adjacent blocks.
[0385] FIG. 64 is a flowchart showing an example of the inter prediction process according to BIO. FIG. 65 is a functional block diagram showing an example of the functional configuration of the inter prediction unit 126 that performs the inter prediction according to BIO.
[0386] As shown in FIG. 65, the inter prediction unit 126 includes, for example, a memory 126a, an interpolation image derivation unit 126b, a gradient image derivation unit 126c, an optical flow derivation unit 126d, a correction value derivation unit 126e, and a prediction image correction unit 126f. Note that the memory 126a may be the frame memory 122.
[0387] The inter prediction unit 126 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) including the current block. Then, the inter prediction unit 126 derives a prediction image of the current block using the two motion vectors (M0, M1) (step Sy_1). Note that the motion vector M0 is the motion vector (MV x0 , MV y0 ) corresponding to the reference picture Ref0, and the motion vector M1 is the motion vector (MV x1 , MV y1 ) corresponding to the reference picture Ref1.
[0388] Next, the interpolation image derivation unit 126b refers to the memory 126a and derives an interpolation image I 0 of the current block using the motion vector M0 and the reference picture L0. Also, the interpolation image derivation unit 126b refers to the memory 126a and derives an interpolation image I 1 of the current block using the motion vector M1 and the reference picture L1 (step Sy_2). Here, the interpolation image I 0is an image included in the reference picture Ref0, which is derived for the current block, and is the interpolated image I 1 is an image included in the reference picture Ref1, which is derived for the current block. The interpolated image I 0 and the interpolated image I 1 may each have the same size as the current block. Or, the interpolated image I 0 and the interpolated image I 1 may each be an image larger than the current block in order to appropriately derive the gradient image described later. Further, the interpolated image I 0 and I 1 may include a predicted image derived by applying motion vectors (M0, M1) and reference pictures (L0, L1) and a motion compensation filter.
[0389] Also, the gradient image derivation unit 126c derives the gradient image (Ix 0 and the interpolated image I 1 for the current block from the interpolated image I 0 , Ix 1 , Iy 0 , Iy 1 ). Note that the horizontal gradient image is (Ix 0 , Ix 1 ), and the vertical gradient image is (Iy 0 , Iy 1 ). The gradient image derivation unit 126c may derive the gradient image by applying, for example, a gradient filter to the interpolated image. The gradient image may indicate the spatial change amount of the pixel values along the horizontal direction, the vertical direction, or both.
[0390] Next, the optical flow derivation unit 126d uses the interpolated images (I 0 , I 1 ) and the gradient images (Ix 0 , Ix 1 , Iy 0 , Iy 1 ) for each of a plurality of sub-block units constituting the current block to obtain the optical flow (v x , vy ) is derived (step Sy_4). The optical flow is a coefficient for correcting the spatial movement amount of pixels, and may be referred to as a local motion estimation value, a corrected motion vector, or a corrected weight vector. As an example, the sub-block may be a 4x4 pixel sub-CU. Note that the derivation of the optical flow may be performed in units other than sub-block units, such as pixel units.
[0391] Next, the inter prediction unit 126 corrects the predicted image of the current block using the optical flow (v x , v y ). For example, the correction value derivation unit 126e derives a correction value for the value of the pixels included in the current block using the optical flow (v x , v y ) (step Sy_5). Then, the predicted image correction unit 126f may correct the predicted image of the current block using the correction value (step Sy_6). Note that the correction value may be derived for each pixel unit, or may be derived for a plurality of pixel units or sub-block units.
[0392] Note that the processing flow of BIO is not limited to the processing disclosed in FIG. 64. For example, only a part of the processing disclosed in FIG. 64 may be performed, different processing may be added or replaced, or the processing may be executed in a different order.
[0393] [Motion Compensation > LIC] Next, an example of a mode for generating a predicted image (prediction) using LIC (local illumination compensation) processing will be described.
[0394] FIG. 66A is a conceptual diagram for explaining an example of the processing of a predicted image generation method using luminance correction processing by LIC. Further, FIG. 66B is a flowchart showing an example of the processing of the predicted image generation method using the LIC.
[0395] First, the inter prediction unit 126 derives an MV from the encoded reference picture and obtains a reference image corresponding to the current block (step Sz_1).
[0396] Next, the inter prediction unit 126 extracts information indicating how the luminance values change between the reference picture and the current picture for the current block (step Sz_2). This extraction is performed based on the luminance pixel values in the encoded left adjacent reference area (peripheral reference area) and the encoded upper adjacent reference area (peripheral reference area) in the current picture, and the luminance pixel values at the equivalent positions in the reference picture specified by the derived MV. Then, the inter prediction unit 126 calculates a luminance correction parameter using the information indicating how the luminance values change (step Sz_3).
[0397] The inter prediction unit 126 generates a prediction image for the current block by performing a luminance correction process of applying the luminance correction parameter to the reference image in the reference picture specified by the MV (step Sz_4). That is, correction based on the luminance correction parameter is performed on the prediction image, which is the reference image in the reference picture specified by the MV. In this correction, the luminance may be corrected, the color difference may be corrected, or both may be corrected. That is, a color difference correction parameter may be calculated using the information indicating how the color difference changes, and a color difference correction process may be performed.
[0398] Note that the shape of the peripheral reference area in FIG. 66A is an example, and other shapes may be used.
[0399] Also, although the process of generating a prediction image from one reference picture has been described here, the same applies to the case of generating a prediction image from a plurality of reference pictures. The luminance correction process may be performed on the reference images obtained from each reference picture in the same manner as described above, and then the prediction image may be generated.
[0400] As a method for determining whether to apply LIC, for example, there is a method using lic_flag, which is a signal indicating whether to apply LIC. As a specific example, in the encoding device 100, it is determined whether the current block belongs to an area where a luminance change has occurred. If it belongs to an area where a luminance change has occurred, the value 1 is set as lic_flag and LIC is applied for encoding. If it does not belong to an area where a luminance change has occurred, the value 0 is set as lic_flag and encoding is performed without applying LIC. On the other hand, in the decoding device 200, by decoding the lic_flag described in the stream, decoding may be performed by switching whether to apply LIC according to the value.
[0401] As another method for determining whether to apply LIC, for example, there is also a method of determining according to whether LIC has been applied to the surrounding blocks. As a specific example, when the current block is being processed in the merge mode, the inter prediction unit 126 determines whether the surrounding encoded blocks selected when deriving the MV in the merge mode have been encoded with LIC applied. The inter prediction unit 126 switches whether to apply LIC according to the result and performs encoding. Note that, also in this example, the same processing is applied to the processing on the decoding device 200 side.
[0402] Although LIC (luminance correction processing) has been described with reference to FIGS. 66A and 66B, the details will be described below.
[0403] First, the inter prediction unit 126 derives an MV for acquiring a reference image corresponding to the current block from the reference picture, which is an encoded picture.
[0404] Next, the inter prediction unit 126 extracts information indicating how the luminance values change between the reference picture and the current picture by using the luminance pixel values of the left and upper adjacent encoded peripheral reference regions for the current block and the luminance pixel values at the equivalent positions in the reference picture specified by the MV, and calculates a luminance correction parameter. For example, let the luminance pixel value of a certain pixel in the peripheral reference region within the current picture be p0, and the luminance pixel value of the pixel in the peripheral reference region within the reference picture at the equivalent position to this pixel be p1. The inter prediction unit 126 calculates, as the luminance correction parameter, the coefficients A and B that optimize A×p1 + B = p0 for a plurality of pixels in the peripheral reference region.
[0405] Next, the inter prediction unit 126 generates a prediction image for the current block by performing luminance correction processing on the reference image in the reference picture specified by the MV using the luminance correction parameter. For example, let the luminance pixel value in the reference image be p2, and the luminance pixel value of the prediction image after the luminance correction processing be p3. The inter prediction unit 126 generates the prediction image after the luminance correction processing by calculating A×p2 + B = p3 for each pixel in the reference image.
[0406] Note that a part of the peripheral reference region shown in FIG. 66A may be used. For example, a region including a predetermined number of pixels decimated from each of the upper adjacent pixel and the left adjacent pixel may be used as the peripheral reference region. Also, the peripheral reference region is not limited to the region adjacent to the current block, and may be a region not adjacent to the current block. Also, in the example shown in FIG. 66A, the peripheral reference region in the reference picture is the region specified by the MV of the current picture from the peripheral reference region in the current picture, but may be a region specified by another MV. For example, the other MV may be the MV of the peripheral reference region in the current picture.
[0407] Note that although the operation in the encoding device 100 has been described here, the operation in the decoding device 200 is the same.
[0408] Note that the LIC may be applied not only to luminance but also to color difference. At this time, 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.
[0409] Also, the LIC process may be applied in sub-block units. For example, correction parameters may be derived using the peripheral reference area of the current sub-block and the peripheral reference area of the reference sub-block in the reference picture specified by the MV of the current sub-block.
[0410] [Prediction control unit] The prediction control unit 128 selects either an intra-predicted image (an image or signal output from the intra-prediction unit 124) or an inter-predicted image (an image or signal output from the inter-prediction unit 126), and outputs the selected predicted image as a prediction signal to the subtraction unit 104 and the addition unit 116.
[0411] [Prediction parameter generation unit] The prediction parameter generation unit 130 may output information regarding intra-prediction, inter-prediction, and selection of the predicted image in the prediction control unit 128 as prediction parameters to the entropy encoding unit 110. The entropy encoding unit 110 may generate a stream based on the prediction parameters input from the prediction parameter generation unit 130 and the quantized coefficients input from the quantization unit 108. The prediction parameters may be used by the decoding device 200. The decoding device 200 may receive and decode the stream, and perform the same processing as the prediction processing performed in the intra-prediction unit 124, the inter-prediction unit 126, and the prediction control unit 128. The prediction parameters may include, for example, a selected prediction signal (e.g., an MV, a prediction type, or a prediction mode used in the intra-prediction unit 124 or the inter-prediction unit 126), or any index, flag, or value based on or indicating the prediction processing performed in the intra-prediction unit 124, the inter-prediction unit 126, and the prediction control unit 128.
[0412] [Decoding device] Next, a decoding device 200 that can decode the stream output from the above-described encoding device 100 will be described. FIG. 67 is a block diagram showing an example of the functional configuration of the decoding device 200 according to the embodiment. The decoding device 200 is a device that decodes a stream, which is an encoded image, in block units.
[0413] As shown in FIG. 67, the decoding device 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transform unit 206, an addition unit 208, a block memory 210, a loop filter unit 212, a frame memory 214, an intra prediction unit 216, an inter prediction unit 218, a prediction control unit 220, a prediction parameter generation unit 222, and a division determination unit 224. Each of the intra prediction unit 216 and the inter prediction unit 218 is configured as a part of the prediction processing unit.
[0414] [Implementation Example of Decoding Device] FIG. 68 is a functional block diagram showing an implementation example of the decoding device 200. The decoding device 200 includes a processor b1 and a memory b2. For example, a plurality of components of the decoding device 200 shown in FIG. 67 are implemented by the processor b1 and the memory b2 shown in FIG. 68.
[0415] The processor b1 is a circuit that performs information processing and is a circuit that can access the memory b2. For example, the processor b1 is a dedicated or general-purpose electronic circuit that decodes a stream. The processor b1 may be a processor such as a CPU. Also, the processor b1 may be an aggregate of a plurality of electronic circuits. Further, for example, the processor b1 may perform the roles of a plurality of components of the decoding device 200 shown in FIG. 67 etc., excluding the components for storing information.
[0416] Memory b2 is a dedicated or general-purpose memory that stores information for the processor b1 to decode the stream. Memory b2 may be an electronic circuit and may be connected to the processor b1. Also, memory b2 may be included in the processor b1. Further, memory b2 may be an aggregate of a plurality of electronic circuits. Also, memory b2 may be a magnetic disk, an optical disk, etc., or may be expressed as a storage or a recording medium, etc. Also, memory b2 may be a non-volatile memory or a volatile memory.
[0417] For example, an image or a stream may be stored in memory b2. Also, a program for the processor b1 to decode the stream may be stored in memory b2.
[0418] Also, for example, memory b2 may serve as a component for storing information among a plurality of components of the decoding device 200 shown in FIG. 67 etc. Specifically, memory b2 may serve as the block memory 210 and the frame memory 214 shown in FIG. 67. More specifically, a reconstructed image (specifically, a reconstructed block or a reconstructed picture, etc.) may be stored in memory b2.
[0419] Note that in the decoding device 200, not all of the plurality of components shown in FIG. 67 etc. need to be implemented, and not all of the plurality of processes described here need to be performed. A part of the plurality of components shown in FIG. 67 etc. may be included in another device, and a part of the plurality of processes described here may be executed by another device.
[0420] First, after explaining the overall processing flow of the decoding apparatus 200, each component included in the decoding apparatus 200 will be described. Among the components included in the decoding apparatus 200, for those that perform the same processing as the components included in the encoding apparatus 100, detailed descriptions will be omitted. For example, the inverse quantization unit 204, inverse transform unit 206, addition unit 208, block memory 210, frame memory 214, intra prediction unit 216, inter prediction unit 218, prediction control unit 220, and loop filter unit 212 included in the decoding apparatus 200 perform the same processing as the inverse quantization unit 112, inverse transform unit 114, addition unit 116, block memory 118, frame memory 122, intra prediction unit 124, inter prediction unit 126, prediction control unit 128, and loop filter unit 120 included in the encoding apparatus 100, respectively.
[0421] [Overall Flow of Decoding Process] FIG. 69 is a flowchart showing an example of the overall decoding process by the decoding apparatus 200.
[0422] First, the division determination unit 224 of the decoding apparatus 200 determines the division pattern of each of a plurality of fixed-size blocks (128×128 pixels) included in the picture based on the parameters input from the entropy decoding unit 202 (step Sp_1). This division pattern is the division pattern selected by the encoding apparatus 100. Then, the decoding apparatus 200 performs the processing of steps Sp_2 to Sp_6 for each of the plurality of blocks constituting the division pattern.
[0423] The entropy decoding unit 202 decodes (specifically, entropy decodes) the encoded quantization coefficients and prediction parameters of the current block (step Sp_2).
[0424] Next, the inverse quantization unit 204 and the inverse transform unit 206 restore the prediction residual of the current block by performing inverse quantization and inverse transform on the plurality of quantization coefficients (step Sp_3).
[0425] Next, the prediction processing unit including the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 generates a prediction image of the current block (step Sp_4).
[0426] Next, the addition unit 208 reconstructs the current block into a reconstructed image (also referred to as a decoded image block) by adding the prediction image to the prediction residual (step Sp_5).
[0427] Then, when this reconstructed image is generated, the loop filter unit 212 performs filtering on the reconstructed image (step Sp_6).
[0428] Then, the decoding device 200 determines whether the decoding of the entire picture is completed (step Sp_7). If it is determined that the decoding is not completed (No in step Sp_7), the processing from step Sp_1 is repeatedly executed.
[0429] Note that the processing of these steps Sp_1 to Sp_7 may be sequentially performed by the decoding device 200, or a plurality of some of those processes may be performed in parallel, or the order may be changed.
[0430] [Partition determination unit] FIG. 70 is a conceptual diagram showing the relationship between the partition determination unit 224 and other components in the embodiment. The partition determination unit 224 may perform the following processing as an example.
[0431] The splitting determination unit 224 collects block information from, for example, the block memory 210 or the frame memory 214, and further obtains parameters from the entropy decoding unit 202. Then, the splitting determination unit 224 may determine a splitting pattern of fixed-size blocks based on the block information and the parameters. Then, the splitting determination unit 224 may output information indicating the determined splitting pattern to the inverse transformation unit 206, the intra prediction unit 216, and the inter prediction unit 218. The inverse transformation unit 206 may perform inverse transformation on the transform coefficients based on the splitting pattern indicated by the information from the splitting determination unit 224. The intra prediction unit 216 and the inter prediction unit 218 may generate a predicted image based on the splitting pattern indicated by the information from the splitting determination unit 224.
[0432] [Entropy decoding unit] FIG. 71 is a block diagram showing an example of the functional configuration of the entropy decoding unit 202.
[0433] The entropy decoding unit 202 generates quantization coefficients, prediction parameters, parameters related to the splitting pattern, etc. by entropy decoding the stream. For example, CABAC is used for the entropy decoding. Specifically, the entropy decoding unit 202 includes, for example, a binary arithmetic decoding unit 202a, a context control unit 202b, and a multi-valued conversion unit 202c. The binary arithmetic decoding unit 202a arithmetically decodes the stream into a binary signal using the context value derived by the context control unit 202b. The context control unit 202b derives a context value according to the characteristics of the syntax element or the surrounding situation, that is, the occurrence probability of the binary signal, in the same way as the context control unit 110b of the encoding device 100. The multi-valued conversion unit 202c performs multi-valued conversion (debinarize) to convert the binary signal output from the binary arithmetic decoding unit 202a into a multi-valued signal indicating the above-mentioned quantization coefficients and the like. This multi-valued conversion is performed according to the above-mentioned binary conversion method.
[0434] The entropy decoding unit 202 outputs quantization coefficients to the inverse quantization unit 204 in block units. The entropy decoding unit 202 may output prediction parameters included in the stream (see FIG. 1) to the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. The intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 can execute the same prediction process as the processes performed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 on the encoder 100 side.
[0435] FIG. 72 is a conceptual diagram showing the flow of an example of CABAC processing in the entropy decoding unit 202.
[0436] First, in CABAC in the entropy decoding unit 202, initialization is performed. In this initialization, initialization in the binary arithmetic decoding unit 202a and setting of initial context values are performed. Then, the binary arithmetic decoding unit 202a and the multivalue conversion unit 202c execute arithmetic decoding and multivalue conversion on, for example, the encoded data of the CTU. At this time, the context control unit 202b updates the context value every time arithmetic decoding is performed. Then, as post-processing, the context control unit 202b saves the context value. This saved context value is used, for example, as the initial value of the context value for the next CTU.
[0437] [Inverse Quantization Unit] The inverse quantization unit 204 inverse quantizes the quantization coefficients of the current block, which is the input from the entropy decoding unit 202. Specifically, for each of the quantization coefficients of the current block, the inverse quantization unit 204 inverse quantizes the quantization coefficient based on the quantization parameter corresponding to the quantization coefficient. Then, the inverse quantization unit 204 outputs the inverse quantized quantization coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.
[0438] FIG. 73 is a block diagram showing an example of the functional configuration of the inverse quantization unit 204.
[0439] The inverse quantization unit 204 includes, for example, a quantization parameter generation unit 204a, a predictive quantization parameter generation unit 204b, a quantization parameter storage unit 204d, and an inverse quantization processing unit 204e.
[0440] FIG. 74 is a flowchart showing an example of the inverse quantization process by the inverse quantization unit 204.
[0441] As an example, the inverse quantization unit 204 may perform an inverse quantization process for each CU based on the flow shown in FIG. 74. Specifically, the quantization parameter generation unit 204a determines whether to perform inverse quantization (step Sv_11). Here, if it is determined to perform inverse quantization (Yes in step Sv_11), the quantization parameter generation unit 204a acquires the differential quantization parameter of the current block from the entropy decoding unit 202 (step Sv_12).
[0442] Next, the predictive quantization parameter generation unit 204b acquires the quantization parameter of a processing unit different from the current block from the quantization parameter storage unit 204d (step Sv_13). The predictive quantization parameter generation unit 204b generates the predictive quantization parameter of the current block based on the acquired quantization parameter (step Sv_14).
[0443] Then, the quantization parameter generation unit 204a generates the quantization parameter of the current block based on the differential quantization parameter of the current block acquired from the entropy decoding unit 202 and the predictive quantization parameter of the current block generated by the predictive quantization parameter generation unit 204b (step Sv_15). For example, the differential quantization parameter of the current block acquired from the entropy decoding unit 202 and the predictive quantization parameter of the current block generated by the predictive quantization parameter generation unit 204b may be added to generate the quantization parameter of the current block. Further, the quantization parameter generation unit 204a stores the quantization parameter of the current block in the quantization parameter storage unit 204d (step Sv_16).
[0444] Next, the inverse quantization processing unit 204e inverse quantizes the quantization coefficients of the current block into conversion coefficients using the quantization parameters generated in step Sv_15 (step Sv_17).
[0445] Note that the differential quantization parameters may be decoded at the bit sequence level, picture level, slice level, block level, or CTU level. Also, the initial values of the quantization parameters may be decoded at the sequence level, picture level, slice level, block level, or CTU level. At this time, the quantization parameters may be generated using the initial values of the quantization parameters and the differential quantization parameters.
[0446] Note that the inverse quantization unit 204 may include a plurality of inverse quantizers, and may inverse quantize the quantization coefficients using an inverse quantization method selected from a plurality of inverse quantization methods.
[0447] [Inverse Transform Unit] The inverse transform unit 206 restores the prediction residual by inverse-transforming the conversion coefficients that are the input from the inverse quantization unit 204.
[0448] For example, when the information decoded from the stream indicates that EMT or AMT is to be applied (for example, the AMT flag is true), the inverse transform unit 206 inverse-transforms the conversion coefficients of the current block based on the information indicating the decoded conversion type.
[0449] Also, for example, when the information decoded from the stream indicates that NSST is to be applied, the inverse transform unit 206 applies an inverse reconversion to the conversion coefficients.
[0450] FIG. 75 is a flowchart showing an example of the processing by the inverse transform unit 206.
[0451] For example, the inverse conversion unit 206 determines whether information indicating that orthogonal conversion is not performed exists in the stream (step St_11). Here, if it is determined that such information does not exist (No in step St_11) (for example, nothing is indicated regarding whether to perform orthogonal conversion, or it is indicated to perform orthogonal conversion), the inverse conversion unit 206 acquires information indicating the conversion type, which has been decoded by the entropy decoding unit 202 (step St_12). Next, the inverse conversion unit 206 determines the conversion type used for the orthogonal conversion of the encoding device 100 based on that information (step St_13). Then, the inverse conversion unit 206 performs inverse orthogonal conversion using the determined conversion type (step St_14). As illustrated in FIG. 75, if it is determined that information indicating that orthogonal conversion is not performed exists (Yes in step St_11) (for example, it is clearly indicated not to perform orthogonal conversion: not indicated to perform orthogonal conversion), orthogonal conversion is not performed.
[0452] FIG. 76 is a flowchart showing another example of the processing by the inverse conversion unit 206.
[0453] For example, the inverse conversion unit 206 determines whether the conversion size is equal to or less than a predetermined value (step Su_11). The predetermined value may be determined in advance. Here, if it is determined that the value is equal to or less than the predetermined value (Yes in step Su_11), the inverse conversion unit 206 acquires from the entropy decoding unit 202 information indicating which of one or more conversion types included in the first conversion type group was used by the encoding device 100 (step Su_12). Note that such information is decoded by the entropy decoding unit 202 and output to the inverse conversion unit 206.
[0454] The inverse transform unit 206 determines the transform type used for the orthogonal transform in the encoding device 100 based on the information (step Su_13). Then, the inverse transform unit 206 performs an inverse orthogonal transform on the transform coefficients of the current block using the determined transform type (step Su_14). On the other hand, when it is determined in step Su_11 that the transform size is not less than a predetermined value (No in step Su_11), the inverse transform unit 206 performs an inverse orthogonal transform on the transform coefficients of the current block using the second transform type group (step Su_15).
[0455] Note that the inverse orthogonal transform by the inverse transform unit 206 may be performed, for example, according to the flow shown in FIG. 75 or FIG. 76 for each TU. Also, without decoding the information indicating the transform type used for the orthogonal transform, an inverse orthogonal transform may be performed using a predetermined transform type. The predetermined transform type may be a predetermined transform type or a default transform type. Specifically, the transform type is, for example, DST7 or DCT8, and in the inverse orthogonal transform, an inverse transform basis function corresponding to the transform type is used.
[0456] [Addition unit] The addition unit 208 reconstructs the current block by adding the prediction residual, which is the input from the inverse transform unit 206, and the prediction image, which is the input from the prediction control unit 220. That is, a reconstructed image of the current block is generated. Then, the addition unit 208 outputs the reconstructed image of the current block to the block memory 210 and the loop filter unit 212.
[0457] [Block memory] The block memory 210 is a block referred to in intra prediction and is a storage unit for storing blocks within the current picture. Specifically, the block memory 210 stores the reconstructed image output from the addition unit 208.
[0458] [Loop filter unit] The loop filter unit 212 applies a loop filter to the reconstructed image generated by the addition unit 208, and outputs the filtered reconstructed image to the frame memory 214, a display device, and the like.
[0459] When the information indicating the on / off of the ALF decoded from the stream indicates that the ALF is on, one filter is selected from a plurality of filters based on the local gradient direction and activity, and the selected filter is applied to the reconstructed image.
[0460] FIG. 77 is a block diagram showing an example of the functional configuration of the loop filter unit 212. Note that the loop filter unit 212 has the same configuration as the loop filter unit 120 of the encoding device 100.
[0461] The loop filter unit 212 includes, for example, as shown in FIG. 77, a deblocking filter processing unit 212a, a SAO processing unit 212b, and an ALF processing unit 212c. The deblocking filter processing unit 212a performs the above-described deblocking filter processing on the reconstructed image. The SAO processing unit 212b performs the above-described SAO processing on the reconstructed image after the deblocking filter processing. Further, the ALF processing unit 212c applies the above-described ALF processing to the reconstructed image after the SAO processing. Note that the loop filter unit 212 does not necessarily include all the processing units disclosed in FIG. 77, and may include only some of the processing units. Also, the loop filter unit 212 may be configured to perform the above-described respective processes in an order different from the processing order disclosed in FIG. 77, and does not necessarily perform all the processes shown in FIG. 77.
[0462] [Frame Memory] The frame memory 214 is a storage unit for storing reference pictures used for inter prediction, and may also be called a frame buffer. Specifically, the frame memory 214 stores the reconstructed image filtered by the loop filter unit 212.
[0463] [Prediction Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] FIG. 78 is a flowchart showing an example of the processing performed by the prediction unit of the decoding apparatus 200. As an example, the prediction unit is composed of all or some of the components of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. The prediction processing unit includes, for example, the intra prediction unit 216 and the inter prediction unit 218.
[0464] The prediction unit generates a prediction image of the current block (step Sq_1). This prediction image is also referred to as a prediction signal or a prediction block. Note that the prediction signal includes, for example, an intra prediction signal or an inter prediction signal. Specifically, the prediction unit generates a prediction image of the current block using a reconstructed image that has already been obtained by performing generation of a prediction image for another block, restoration of a prediction residue, and addition of the prediction image. The prediction unit of the decoding apparatus 200 generates the same prediction image as the prediction image generated by the prediction unit of the encoding apparatus 100. That is, the methods for generating the prediction images used in those prediction units are common or corresponding to each other.
[0465] The reconstructed image may be, for example, an image of a reference picture, or an image of a decoded block (i.e., the above-described other block) in the current picture that is a picture including the current block. The decoded block in the current picture is, for example, an adjacent block of the current block.
[0466] FIG. 79 is a flowchart showing another example of the processing performed by the prediction unit of the decoding apparatus 200.
[0467] The prediction unit determines a method or mode for generating a prediction image (step Sr_1). For example, this method or mode may be determined based on, for example, prediction parameters.
[0468] When the prediction unit determines the first method as a mode for generating a prediction image, it generates a prediction image according to the first method (step Sr_2a). Further, when the prediction unit determines the second method as a mode for generating a prediction image, it generates a prediction image according to the second method (step Sr_2b). Further, when the prediction unit determines the third method as a mode for generating a prediction image, it generates a prediction image according to the third method (step Sr_2c).
[0469] The first method, the second method, and the third method are different methods for generating a prediction image, and each may be, for example, an inter prediction method, an intra prediction method, and a prediction method other than these. In these prediction methods, the above-described reconstructed image may be used.
[0470] FIG. 80 is a flowchart showing another example of the processing performed by the prediction unit of the decoding apparatus 200.
[0471] As an example, the prediction unit may perform prediction processing according to the flow shown in FIG. 80. Note that the intra block copy shown in FIG. 80 is one mode belonging to inter prediction, and is a mode in which a block included in the current picture is referred to as a reference picture or a reference block. That is, in intra block copy, a picture different from the current picture is not referred to. Further, the PCM mode shown in FIG. 80 is one mode belonging to intra prediction, and is a mode in which no conversion and quantization are performed.
[0472] [Intra Prediction Unit] The intra prediction unit 216 generates a predicted image (i.e., an intra prediction image) of the current block by performing intra prediction with reference to the blocks within the current picture stored in the block memory 210 based on the intra prediction mode decoded from the stream. Specifically, the intra prediction unit 216 generates an intra prediction image by performing intra prediction with reference to the pixel values (e.g., luminance values, chrominance difference values) of the blocks adjacent to the current block, and outputs the intra prediction image to the prediction control unit 220.
[0473] Note that when an intra prediction mode that refers to the luminance block is selected for the chrominance difference block in the intra prediction, the intra prediction unit 216 may predict the chrominance difference component of the current block based on the luminance component of the current block.
[0474] Also, when the information decoded from the stream indicates the application of PDPC, the intra prediction unit 216 corrects the pixel values after intra prediction based on the gradients of the reference pixels in the horizontal / vertical directions.
[0475] FIG. 81 is a diagram showing an example of the processing by the intra prediction unit 216 of the decoding apparatus 200.
[0476] The intra prediction unit 216 first determines whether an MPM flag indicating 1 exists in the stream (step Sw_11). Here, if it is determined that the MPM flag indicating 1 exists (Yes in step Sw_11), the intra prediction unit 216 acquires, from the entropy decoding unit 202, information indicating the intra prediction mode selected in the encoding apparatus 100 among the MPMs (step Sw_12). Note that the information is decoded by the entropy decoding unit 202 and output to the intra prediction unit 216. Next, the intra prediction unit 216 determines the MPM (step Sw_13). The MPM consists of, for example, six intra prediction modes. Then, the intra prediction unit 216 determines the intra prediction mode indicated by the information acquired in step Sw_12 from among the plurality of intra prediction modes included in the MPM (step Sw_14).
[0477] On the other hand, if the intra prediction unit 216 determines in step Sw_11 that the MPM flag indicating 1 does not exist in the stream (No in step Sw_11), it acquires information indicating the intra prediction mode selected in the encoding device 100 (step Sw_15). That is, the intra prediction unit 216 acquires from the entropy decoding unit 202 information indicating the intra prediction mode selected in the encoding device 100 among one or more intra prediction modes not included in the MPM. Note that the information is decoded by the entropy decoding unit 202 and output to the intra prediction unit 216. Then, the intra prediction unit 216 determines the intra prediction mode indicated by the information acquired in step Sw_15 from among the one or more intra prediction modes not included in the MPM (step Sw_17).
[0478] The intra prediction unit 216 generates a predicted image according to the intra prediction mode determined in step Sw_14 or step Sw_17 (step Sw_18).
[0479] [Inter Prediction Unit] The inter prediction unit 218 predicts the current block with reference to the reference pictures stored in the frame memory 214. The prediction is performed in units of the current block or sub-blocks within the current block. Note that the sub-blocks are included in the block and are units smaller than the block. The size of the sub-block may be 4x4 pixels, 8x8 pixels, or other sizes. The size of the sub-block may be switched in units such as slices, bricks, or pictures.
[0480] For example, the inter prediction unit 218 generates an inter prediction image of the current block or sub-block by performing motion compensation using motion information (e.g., MV) decoded from the stream (e.g., prediction parameters output from the entropy decoding unit 202), and outputs the inter prediction image to the prediction control unit 220.
[0481] When the information decoded from the stream indicates that the OBMC mode is to be applied, the inter prediction unit 218 generates an inter prediction image using not only the motion information of the current block obtained by motion search but also the motion information of adjacent blocks.
[0482] Also, when the information decoded from the stream indicates that the FRUC mode is to be applied, the inter prediction unit 218 derives motion information by performing motion search according to the pattern matching method (bilateral matching or template matching) decoded from the stream. Then, the inter prediction unit 218 performs motion compensation (prediction) using the derived motion information.
[0483] Also, the inter prediction unit 218 derives the MV based on a model assuming uniform linear motion when the BIO mode is applied. Also, when the information decoded from the stream indicates that the affine mode is to be applied, the inter prediction unit 218 derives the MV in sub - block units based on the MVs of a plurality of adjacent blocks.
[0484] [Flow of MV Derivation] FIG. 82 is a flowchart showing an example of the process of MV derivation in the decoding apparatus 200.
[0485] The inter prediction unit 218 determines, for example, whether to decode motion information (e.g., MV). For example, the inter prediction unit 218 may determine according to the prediction mode included in the stream, or may determine based on other information included in the stream. Here, when the inter prediction unit 218 determines to decode the motion information, it derives the MV of the current block in the mode of decoding that motion information. On the other hand, when the inter prediction unit 218 determines not to decode the motion information, it derives the MV in the mode of not decoding the motion information.
[0486] Here, the modes for MV derivation include the normal inter mode, normal merge mode, FRUC mode, and affine mode, etc., which will be described later. Among these modes, the modes for decoding motion information include the normal inter mode, normal merge mode, and affine mode (specifically, affine inter mode and affine merge mode), etc. Note that the motion information may include not only the MV but also the predicted MV selection information, which will be described later. Also, the mode that does not decode motion information includes the FRUC mode, etc. The inter prediction unit 218 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.
[0487] FIG. 83 is a flowchart showing another example of the MV derivation process in the decoding apparatus 200.
[0488] The inter prediction unit 218 determines, for example, whether to decode the differential MV. For example, the inter prediction unit 218 may determine according to the prediction mode included in the stream, or may determine based on other information included in the stream. Here, when the inter prediction unit 218 determines to decode the differential MV, it may derive the MV of the current block in the mode for decoding the differential MV. In this case, for example, the differential MV included in the stream is decoded as a prediction parameter.
[0489] On the other hand, when the inter prediction unit 218 determines not to decode the differential MV, it derives the MV in the mode that does not decode the differential MV. In this case, the encoded differential MV is not included in the stream.
[0490] Here, as described above, the modes for deriving the MV include the normal inter, normal merge mode, FRUC mode, and affine mode, etc. Among these modes, the modes for encoding the differential MV include the normal inter mode and the affine mode (specifically, the affine inter mode), etc. Also, the modes for not encoding the differential MV include the FRUC mode, the normal merge mode, and the affine mode (specifically, the affine merge mode), etc. The inter prediction unit 218 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.
[0491] [MV Derivation > Normal Inter Mode] For example, when the information decoded from the stream indicates that the normal inter mode is to be applied, the inter prediction unit 218 derives the MV in the normal merge mode based on the information decoded from the stream, and performs motion compensation (prediction) using the MV.
[0492] FIG. 84 is a flowchart showing an example of the inter prediction process in the normal inter mode in the decoding apparatus 200.
[0493] The inter prediction unit 218 of the decoding apparatus 200 performs motion compensation for each block. The inter prediction unit 218 first obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of decoded blocks around the current block temporally or spatially (step Sg_11). That is, the inter prediction unit 218 creates a candidate MV list.
[0494] Next, the inter prediction unit 218 extracts each of N (N is an integer of 2 or more) candidate MVs from the plurality of candidate MVs obtained in step Sg_11 as a prediction motion vector candidate (also referred to as a prediction MV candidate) according to a predetermined priority order (step Sg_12). Note that the priority order may be determined in advance for each of the N prediction MV candidates.
[0495] Next, the inter prediction unit 218 decodes prediction MV selection information from the input stream, and uses the decoded prediction MV selection information to select one prediction MV candidate from among the N prediction MV candidates as the prediction MV of the current block (step Sg_13).
[0496] Next, the inter prediction unit 218 decodes the differential MV from the input stream, and derives the MV of the current block by adding the decoded differential value, which is the differential MV, to the selected prediction MV (step Sg_14).
[0497] Finally, the inter prediction unit 218 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the decoded reference picture (step Sg_15). The processes of steps Sg_11 to Sg_15 are executed for each block. For example, when the processes of steps Sg_11 to Sg_15 are executed for each of all the blocks included in a slice, the inter prediction using the normal inter mode for that slice ends. Also, when the processes of steps Sg_11 to Sg_15 are executed for each of all the blocks included in a picture, the inter prediction using the normal inter mode for that picture ends. Note that even if the processes of steps Sg_11 to Sg_15 are not executed for all the blocks included in a slice and are executed for some blocks, the inter prediction using the normal inter mode for that slice may end. This is the same for pictures in steps Sg_11 to Sg_15. When the processes of steps Sg_11 to Sg_15 are executed for some of the blocks included in a picture, the inter prediction using the normal inter mode for that picture may end.
[0498] [MV Derivation > Normal Merge Mode] For example, when the information decoded from the stream indicates the application of the normal merge mode, the inter prediction unit 218 derives the MV in the normal merge mode and performs motion compensation (prediction) using the MV.
[0499] FIG. 85 is a flowchart showing an example of inter prediction processing by the normal merge mode in the decoding apparatus 200.
[0500] The inter prediction unit 218 first obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of decoded blocks temporally or spatially around the current block (step Sh_11). That is, the inter prediction unit 218 creates a candidate MV list.
[0501] Next, the inter prediction unit 218 derives the MV of the current block by selecting one candidate MV from among the plurality of candidate MVs obtained in step Sh_11 (step Sh_12). Specifically, the inter prediction unit 218 obtains, for example, MV selection information included as a prediction parameter in the stream, and selects the candidate MV identified by the MV selection information as the MV of the current block.
[0502] Finally, the inter prediction unit 218 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the decoded reference picture (step Sh_13). The processes of steps Sh_11 to Sh_13 are executed for each block, for example. For example, when the processes of steps Sh_11 to Sh_13 are executed for each of all the blocks included in a slice, the inter prediction using the normal merge mode for that slice ends. Also, when the processes of steps Sh_11 to Sh_13 are executed for each of all the blocks included in a picture, the inter prediction using the normal merge mode for that picture ends. Note that when the processes of steps Sh_11 to Sh_13 are not executed for all the blocks included in a slice but are executed for some blocks, the inter prediction using the normal merge mode for that slice may end. This is the same for the picture in steps Sh_11 to Sh_13. When the processes of steps Sh_11 to Sh_13 are executed for some of the blocks included in a picture, the inter prediction using the normal merge mode for that picture may end.
[0503] [MV Derivation > FRUC Mode] For example, when the information read from the stream indicates the application of the FRUC mode, the inter prediction unit 218 derives the MV in the FRUC mode and performs motion compensation (prediction) using the MV. In this case, the motion information is derived on the decoder 200 side without being signaled from the encoder 100 side. For example, the decoder 200 may derive the motion information by performing motion search. In this case, the decoder 200 performs the motion search without using the pixel values of the current block.
[0504] FIG. 86 is a flowchart showing an example of the inter prediction process by the FRUC mode in the decoder 200.
[0505] First, the inter prediction unit 218 refers to the MVs of each decoded block that is spatially or temporally adjacent to the current block, and generates a list indicating those MVs as candidate MVs (that is, a candidate MV list, which may be common to the candidate MV list in the normal merge mode) (step Si_11). Next, the inter prediction unit 218 selects a best candidate MV from among the plurality of candidate MVs registered in the candidate MV list (step Si_12). For example, the inter prediction unit 218 calculates an evaluation value for each candidate MV included in the candidate MV list, and selects one candidate MV as the best candidate MV based on the evaluation value. Then, the inter prediction unit 218 derives an MV for the current block based on the selected best candidate MV (step Si_14). Specifically, for example, the selected best candidate MV is directly derived as the MV for the current block. Also, for example, an MV for the current block may be derived by performing pattern matching in a peripheral region of the position in the reference picture corresponding to the selected best candidate MV. That is, a search using pattern matching and an evaluation value in the reference picture is performed on the region around the best candidate MV, and if there is an MV with a better evaluation value, the best candidate MV may be updated to that MV and used as the final MV for the current block. In the embodiment, it may not be necessary to perform an update to an MV having a better evaluation value.
[0506] Finally, the inter prediction unit 218 generates a predicted image of the current block by performing motion compensation on the current block using the derived MV and the decoded reference picture (step Si_15). The processes of steps Si_11 to Si_15 are executed, for example, for each block. For example, when the processes of steps Si_11 to Si_15 are executed for each of all the blocks included in a slice, the inter prediction using the FRUC mode for that slice is completed. Also, when the processes of steps Si_11 to Si_15 are executed for each of all the blocks included in a picture, the inter prediction using the FRUC mode for that picture is completed. The processing may be performed in the same manner as the above-described block unit even in units of sub-blocks.
[0507] [MV Derivation > Affine Merge Mode] For example, when the information decoded from the stream indicates the application of the affine merge mode, the inter prediction unit 218 derives an MV in the affine merge mode and performs motion compensation (prediction) using the MV.
[0508] FIG. 87 is a flowchart showing an example of inter prediction processing by the affine merge mode in the decoding apparatus 200.
[0509] In the affine merge mode, first, the inter prediction unit 218 derives each MV of the control points of the current block (step Sk_11). The control points are, as shown in FIG. 46A, the upper left corner and upper right corner points of the current block, or, as shown in FIG. 46B, the upper left corner, upper right corner, and lower left corner points of the current block.
[0510] For example, when using the MV derivation method shown in FIGS. 47A to 47C, the inter prediction unit 218 inspects these blocks in the order of the decoded block A (left), block B (upper), block C (upper right), block D (lower left), and block E (upper left) as shown in FIG. 47A, and identifies the first valid block decoded in the affine mode. The inter prediction unit 218 derives the MV of the control point using the first valid block decoded in the identified affine mode. For example, if block A is identified and block A has two control points, as shown in FIG. 47B, the inter prediction unit 218 calculates the motion vector v0 of the upper left control point of the current block and the motion vector v1 of the upper right control point from the motion vectors v3 and v4 of the upper left corner and the upper right corner of the decoded block including block A. Thereby, the MV of each control point is derived.
[0511] Note that, as shown in FIG. 49A, when block A is identified and block A has two control points, the MVs of three control points may be calculated. As shown in FIG. 49B, when block A is identified and block A has three control points, the MVs of two control points may be calculated.
[0512] Also, when the MV selection information is included in the stream as a prediction parameter, the inter prediction unit 218 may derive the MV of each control point of the current block using the MV selection information.
[0513] Next, the inter prediction unit 218 performs motion compensation for each of the plurality of sub-blocks included in the current block. That is, for each of the plurality of sub-blocks, the inter prediction unit 218 calculates the MV of the sub-block as an affine MV using two motion vectors v0 and v1 and the above formula (1A), or using three motion vectors v0, v1, and v2 and the above formula (1B) (step Sk_12). Then, the inter prediction unit 218 performs motion compensation for the sub-block using those affine MVs and the decoded reference picture (step Sk_13). When the processes of steps Sk_12 and Sk_13 are executed for each of all the sub-blocks included in the current block, the inter prediction using the affine merge mode for the current block ends. That is, motion compensation is performed for the current block, and a predicted image of the current block is generated.
[0514] Note that in step Sk_11, the above candidate MV list may be generated. The candidate MV list may be, for example, a list including candidate MVs derived using a plurality of MV derivation methods for each control point. The plurality of MV derivation methods may be any combination of the MV derivation methods shown in FIGS. 47A to 47C, the MV derivation methods shown in FIGS. 48A and 48B, the MV derivation methods shown in FIGS. 49A and 49B, and other MV derivation methods.
[0515] Note that the candidate MV list may include candidate MVs for a mode that performs prediction in units of sub-blocks other than the affine mode.
[0516] Note that, as a candidate MV list, for example, a candidate MV list including a candidate MV in an affine merge mode having two control points and a candidate MV in an affine merge mode having three control points may be generated. Alternatively, a candidate MV list including a candidate MV in an affine merge mode having two control points and a candidate MV list including a candidate MV in an affine merge mode having three control points may be generated respectively. Alternatively, a candidate MV list including candidate MVs in one of the modes of an affine merge mode having two control points and an affine merge mode having three control points may be generated.
[0517] [MV Derivation > Affine Inter Mode] For example, when the information decoded from the stream indicates the application of the affine inter mode, the inter prediction unit 218 derives an MV in the affine inter mode and performs motion compensation (prediction) using the MV.
[0518] FIG. 88 is a flowchart showing an example of inter prediction processing by the affine inter mode in the decoding apparatus 200.
[0519] In the affine inter mode, first, the inter prediction unit 218 derives respective predicted MVs (v0, v1) or (v0, v1, v2) of two or three control points of the current block (step Sj_11). The control points are, for example, points at the upper left corner, upper right corner, or lower left corner of the current block as shown in FIG. 46A or FIG. 46B.
[0520] The inter prediction unit 218 acquires prediction MV selection information included as a prediction parameter in the stream, and derives the prediction MV for each control point of the current block using the MV identified by the prediction MV selection information. For example, when using the MV derivation method shown in FIGS. 48A and 48B, the inter prediction unit 218 selects the MV of the block identified by the prediction MV selection information from among the decoded blocks in the vicinity of each control point of the current block shown in FIG. 48A or FIG. 48B, thereby deriving the prediction MV (v0, v1) or (v0, v1, v2) of the control point of the current block.
[0521] Next, the inter prediction unit 218 acquires, for example, each differential MV included as a prediction parameter in the stream, and adds the prediction MV of each control point of the current block and the differential MV corresponding to the prediction MV (step Sj_12). Thereby, the MV of each control point of the current block is derived.
[0522] Next, the inter prediction unit 218 performs motion compensation for each of a plurality of sub-blocks included in the current block. That is, the inter prediction unit 218 calculates the MV of each of the plurality of sub-blocks as an affine MV using two motion vectors v0 and v1 and the above-described equation (1A), or using three motion vectors v0, v1, and v2 and the above-described equation (1B) (step Sj_13). Then, the inter prediction unit 218 performs motion compensation on the sub-block using the affine MV and the decoded reference picture (step Sj_14). When the processes of steps Sj_13 and Sj_14 are executed for each of the sub-blocks included in the current block, the inter prediction using the affine merge mode for the current block ends. That is, motion compensation is performed on the current block, and a predicted image of the current block is generated.
[0523] Note that in step Sj_11, similar to step Sk_11, the above-described candidate MV list may be generated.
[0524] [MV Derivation > Triangle Mode] For example, when the information decoded from the stream indicates the application of the triangle mode, the inter prediction unit 218 derives the MV in the triangle mode and performs motion compensation (prediction) using the MV.
[0525] FIG. 89 is a flowchart showing an example of inter prediction processing by the triangle mode in the decoding apparatus 200.
[0526] In the triangle mode, first, the inter prediction unit 218 divides the current block into a first partition and a second partition (step Sx_11). For example, the inter prediction unit 218 may obtain partition information, which is information regarding the division into each partition, from the stream as prediction parameters. Then, the inter prediction unit 218 may divide the current block into a first partition and a second partition according to the partition information.
[0527] Next, the inter prediction unit 218 obtains a plurality of candidate MVs for the current block based on information such as the MVs of a plurality of decoded blocks around the current block temporally or spatially (step Sx_12). That is, the inter prediction unit 218 creates a candidate MV list.
[0528] Then, the inter prediction unit 218 selects the candidate MV for the first partition and the candidate MV for the second partition as a first MV and a second MV, respectively, from among the plurality of candidate MVs obtained in step Sx_11 (step Sx_13). At this time, the inter prediction unit 218 may obtain MV selection information for identifying the selected candidate MV from the stream as prediction parameters. Then, the inter prediction unit 218 may select the first MV and the second MV according to the MV selection information.
[0529] Next, the inter prediction unit 218 generates a first prediction image by performing motion compensation using the selected first MV and the decoded reference picture (step Sx_14). Similarly, the inter prediction unit 218 generates a second prediction image by performing motion compensation using the selected second MV and the decoded reference picture (step Sx_15).
[0530] Finally, the inter prediction unit 218 generates a prediction image of the current block by weighted addition of the first prediction image and the second prediction image (step Sx_16).
[0531] [Motion Search > DMVR] For example, when the information decoded from the stream indicates the application of DMVR, the inter prediction unit 218 performs motion search with DMVR.
[0532] FIG. 90 is a flowchart showing an example of motion search processing by DMVR in the decoding apparatus 200.
[0533] The inter prediction unit 218 first derives the MV of the current block in merge mode (step Sl_11). Next, the inter prediction unit 218 derives the final MV for the current block by searching the peripheral region of the reference picture indicated by the MV derived in step Sl_11 (step Sl_12). That is, the MV of the current block is determined by DMVR.
[0534] FIG. 91 is a flowchart showing an example of motion search processing by DMVR in the decoding apparatus 200.
[0535] First, in Step 1 shown in FIG. 58A, the inter prediction unit 218 calculates the costs at the search position indicated by the initial MV (also referred to as the starting point) and at the eight search positions around it. Then, the inter prediction unit 218 determines whether the cost of the search position other than the starting point is the minimum. Here, when the inter prediction unit 218 determines that the cost of the search position other than the starting point is the minimum, it moves to the search position where the cost is the minimum and performs the process of Step 2 shown in FIG. 58A. On the other hand, if the cost of the starting point is the minimum, the inter prediction unit 218 skips the process of Step 2 shown in FIG. 58A and performs the process of Step 3.
[0536] In Step 2 shown in FIG. 58A, the inter prediction unit 218 performs the same search as in the process of Step 1, using the search position moved according to the processing result of Step 1 as a new starting point. Then, the inter prediction unit 218 determines whether the cost of the search position other than the starting point is the minimum. Here, if the cost of the search position other than the starting point is the minimum, the inter prediction unit 218 performs the process of Step 4. On the other hand, if the cost of the starting point is the minimum, the inter prediction unit 218 performs the process of Step 3.
[0537] In Step 4, the inter prediction unit 218 treats the search position of the starting point as the final search position, and determines the difference between the position indicated by the initial MV and the final search position as the difference vector.
[0538] In Step 3 shown in FIG. 58A, the inter prediction unit 218 determines the pixel position with the minimum cost and decimal precision based on the costs at the four points above, below, left, and right of the starting point of Step 1 or Step 2, and sets the pixel position as the final search position.
[0539] The pixel position with decimal precision is determined by weighted addition of the vectors of the four points above, below, left, and right ((0, 1), (0, -1), (-1, 0), (1, 0)), with the costs at the respective search positions of the four points as weights. Then, the inter prediction unit 218 determines the difference between the position indicated by the initial MV and the final search position as the difference vector.
[0540] [Motion Compensation > BIO / OBMC / LIC] For example, when the information decoded from the stream indicates the application of correction to the predicted image, the inter prediction unit 218, when generating the predicted image, corrects the predicted image according to the correction mode. The mode is, for example, the above-mentioned BIO, OBMC, and LIC, etc.
[0541] FIG. 92 is a flowchart showing an example of the predicted image generation process in the decoding apparatus 200.
[0542] The inter prediction unit 218 generates a predicted image (step Sm_11), and corrects the predicted image according to any of the above modes (step Sm_12).
[0543] FIG. 93 is a flowchart showing another example of the predicted image generation process in the decoding apparatus 200.
[0544] The inter prediction unit 218 derives the MV of the current block (step Sn_11). Next, the inter prediction unit 218 generates a predicted image using the MV (step Sn_12), and determines whether to perform correction processing (step Sn_13). For example, the inter prediction unit 218 acquires the prediction parameters included in the stream, and determines whether to perform correction processing based on the prediction parameters. This prediction parameter is, for example, a flag indicating whether to apply each of the above modes. Here, when the inter prediction unit 218 determines to perform correction processing (Yes in step Sn_13), it generates the final predicted image by correcting the predicted image (step Sn_14). Note that in LIC, in step Sn_14, the luminance and color difference of the predicted image may be corrected. On the other hand, when the inter prediction unit 218 determines not to perform correction processing (No in step Sn_13), it outputs the predicted image without correction as the final predicted image (step Sn_15).
[0545] [Motion Compensation > OBMC] For example, when the information decoded from the stream indicates the application of OBMC, the inter prediction unit 218 corrects the predicted image according to OBMC when generating the predicted image.
[0546] FIG. 94 is a flowchart showing an example of the correction process of the predicted image by OBMC in the decoding apparatus 200. Note that the flowchart of FIG. 94 shows the flow of the correction of the predicted image using the current picture and the reference pictures shown in FIG. 62.
[0547] First, as shown in FIG. 62, the inter prediction unit 218 obtains a predicted image (Pred) by normal motion compensation using the MV assigned to the current block.
[0548] Next, the inter prediction unit 218 applies (reuses) the MV (MV_L) already derived for the decoded left adjacent block to the current block to obtain a predicted image (Pred_L). Then, the inter prediction unit 218 performs the first correction of the predicted image by superimposing the two predicted images Pred and Pred_L. This has the effect of mixing the boundaries between adjacent blocks.
[0549] Similarly, the inter prediction unit 218 applies (reuses) the MV (MV_U) already derived for the decoded upper adjacent block to the current block to obtain a predicted image (Pred_U). Then, the inter prediction unit 218 performs the second correction of the predicted image by superimposing the predicted image Pred_U on the predicted image (for example, Pred and Pred_L) that has undergone the first correction. This has the effect of mixing the boundaries between adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block in which the boundaries with adjacent blocks are mixed (smoothed).
[0550] [Motion Compensation > BIO] For example, when the information decoded from the stream indicates the application of BIO, the inter prediction unit 218 corrects the predicted image according to BIO when generating the predicted image.
[0551] FIG. 95 is a flowchart showing an example of correction processing of a predicted image by BIO in the decoding apparatus 200.
[0552] As shown in FIG. 63, the inter prediction unit 218 derives two motion vectors (M0, M1) using two reference pictures (Ref0, Ref1) different from the picture (Cur Pic) including the current block. Then, the inter prediction unit 218 derives a predicted image of the current block using the two motion vectors (M0, M1) (step Sy_11). Note that the motion vector M0 is the motion vector (MV x0 , MV y0 ) corresponding to the reference picture Ref0, and the motion vector M1 is the motion vector (MV x1 , MV y1 ) corresponding to the reference picture Ref1.
[0553] Next, the inter prediction unit 218 derives an interpolated image I 0 of the current block using the motion vector M0 and the reference picture L0. Further, the inter prediction unit 218 derives an interpolated image I 1 of the current block using the motion vector M1 and the reference picture L1 (step Sy_12). Here, the interpolated image I 0 is an image included in the reference picture Ref0 derived for the current block, and the interpolated image I 1 is an image included in the reference picture Ref1 derived for the current block. The interpolated image I 0 and the interpolated image I 1 may each have the same size as the current block. Alternatively, the interpolated image I 0 and the interpolated image I 1 may each be an image larger than the current block in order to appropriately derive a gradient image described later. Furthermore, the interpolated images I 0 and I 1 may include predicted images derived by applying the motion vectors (M0, M1) and the reference pictures (L0, L1) and a motion compensation filter.
[0554] Also, the inter prediction unit 218 uses the interpolation image I 0 and the interpolation image I 1 to derive the gradient image (Ix 0 , Ix 1 , Iy 0 , Iy 1 ) of the current block (step Sy_13). Note that the horizontal gradient image is (Ix 0 , Ix 1 ), and the vertical gradient image is (Iy 0 , Iy 1 ). The inter prediction unit 218 may derive the gradient image by, for example, applying a gradient filter to the interpolation image. The gradient image may be any image that indicates the spatial change amount of pixel values along the horizontal or vertical direction.
[0555] Next, the inter prediction unit 218 uses the interpolation image (I 0 , I 1 ) and the gradient image (Ix 0 , Ix 1 , Iy 0 , Iy 1 ) to derive the optical flow (vx, vy) which is the above-mentioned velocity vector in units of a plurality of sub-blocks that make up the current block (step Sy_14). As an example, the sub-block may be a 4x4 pixel sub-CU.
[0556] Next, the inter prediction unit 218 corrects the predicted image of the current block using the optical flow (vx, vy). For example, the inter prediction unit 218 derives a correction value for the value of the pixel included in the current block using the optical flow (vx, vy) (step Sy_15). Then, the inter prediction unit 218 may correct the predicted image of the current block using the correction value (step Sy_16). Note that the correction value may be derived in units of each pixel, or may be derived in units of a plurality of pixels or sub-blocks.
[0557] Note that the processing flow of BIO is not limited to the processing disclosed in FIG. 95. Only some of the processing disclosed in FIG. 95 may be performed, different processing may be added or replaced, or the processing may be executed in a different order.
[0558] [Motion Compensation > LIC] For example, when the information decoded from the stream indicates the application of LIC, the inter prediction unit 218 corrects the predicted image according to LIC after generating the predicted image.
[0559] FIG. 96 is a flowchart showing an example of the correction process of the predicted image by LIC in the decoding apparatus 200.
[0560] First, the inter prediction unit 218 acquires a reference image corresponding to the current block from the decoded reference picture using the MV (step Sz_11).
[0561] Next, the inter prediction unit 218 extracts information indicating how the luminance value has changed between the reference picture and the current picture for the current block (step Sz_12). This extraction may be performed based on the luminance pixel values of the decoded left adjacent reference area (peripheral reference area) and the decoded upper adjacent reference area (peripheral reference area) in the current picture, and the luminance pixel values at the equivalent positions in the reference picture specified by the derived MV, as shown in FIG. 66A. Then, the inter prediction unit 218 calculates a luminance correction parameter using the information indicating how the luminance value has changed (step Sz_13).
[0562] The inter prediction unit 218 generates a predicted image for the current block by performing a luminance correction process of applying the luminance correction parameter to the reference image in the reference picture specified by the MV (step Sz_14). That is, correction based on the luminance correction parameter is performed on the predicted image, which is the reference image in the reference picture specified by the MV. In this correction, the luminance may be corrected or the color difference may be corrected.
[0563] [Prediction Control Unit] The prediction control unit 220 selects either an intra-predicted image or an inter-predicted image and outputs the selected predicted image to the addition unit 208. Overall, the configurations, functions, and processes of the prediction control unit 220, the intra-prediction unit 216, and the inter-prediction unit 218 on the decoder device 200 side correspond to the configurations, functions, and processes of the prediction control unit 128, the intra-prediction unit 124, and the inter-prediction unit 126 on the encoder device 100 side.
[0564] [Decoding Using Predicted Chrominance Samples] In the first aspect, it is determined whether the block of chrominance samples of the current block can be predicted using luminance samples. The predicted chrominance samples are used for block decoding. For example, the embodiment may use a process of determining whether to enable tools such as CCLM that predict a color difference signal using the decoding result of a luminance signal in a decoding method or an encoding method.
[0565] FIG. 97 is a flowchart showing an example of a process 1000 for decoding a block using predicted chrominance samples, and may be performed, for example, by the encoder device 100 of FIG. 7 or the decoder device 200 of FIG. 67. For convenience, FIG. 97 will be described with reference to the decoder device 200 of FIG. 67.
[0566] In S1001, the decoding device 200 determines whether there is a color difference block to be processed within an M×N non-overlapping area that matches the M×N grid of color difference samples. FIGS. 99 and 100 are conceptual diagrams for explaining an example of determining whether there is a color difference block to be processed within an M×N non-overlapping area that matches the M×N grid of color difference samples. In some formats such as the YUV420 format, a 16×16 pixel area of color difference corresponds to a 32×32 pixel area of luminance. As shown in FIGS. 99 and 100, a color difference block included within a 32×32 luminance area that matches a 16×16 color difference grid is determined to be within an M×N non-overlapping area that matches the M×N grid of color difference samples. A color difference block not included within the 32×32 luminance area is not determined to be within an M×N non-overlapping area that matches the M×N grid of color difference samples. Even if the color difference block to be processed straddles the boundary of the corresponding luminance block, if it is included within the same VPDU, color difference samples may be obtained using luminance samples. For example, for the color difference block A in FIG. 99, the samples in the color difference block A-1 are predicted using the corresponding samples in the luminance block B, and the samples in the color difference block A-2 are predicted using the corresponding samples in the luminance block C.
[0567] As shown in FIG. 100, since the color difference block is included within a grid (a 16×16 grid as shown), and the luminance block at the same position is also within a 32×32 area at the same position, the color difference samples of the illustrated color difference block may be predicted using the luminance samples for the color difference block.
[0568] In some embodiments, the color difference samples of blocks not determined to be within an M×N non-overlapping area that matches the M×N grid of color difference samples may not be predicted using luminance samples, but the color difference samples of blocks determined to be within an M×N non-overlapping area that matches the M×N grid of color difference samples may be predicted using luminance samples, for example, by default, when other conditions as described later with reference to S1002 are satisfied.
[0569] As shown in FIG. 97, in S1001, if it is determined that there is no color difference block to be processed within the M×N non-overlapping area that coincides with the M×N grid of the color difference samples, the process 1000 proceeds from S1001 to S1004. In S1004, the decoding device 200 predicts the color difference samples of the block without using the luminance samples. The process 1000 proceeds from S1004 to S1005. In S1005, the decoding device 200 decodes the block using the predicted color difference samples. In S1001, if it is determined that there is a color difference block to be processed within the M×N non-overlapping area, the process 1000 proceeds from S1001 to S1002.
[0570] In S1002, the decoding device 200 determines whether to divide the luminance VPDU to be processed into smaller blocks. The VPDU is a unit of parallel processing in the encoding process or the decoding process, and is, for example, 64×64 in size. The size of the VPDU may be determined by standards or the like, or may be encoded in the stream.
[0571] The determination of whether to divide the luminance VPDU to be processed into smaller blocks may be performed in various ways. Some examples will be described in detail later with reference to FIGS. 102 and 103.
[0572] If it is not determined in S1002 to divide the luminance VPDU to be processed into smaller blocks, the process 1000 proceeds from S1002 to S1004. In S1004, the decoding device 200 predicts the color difference samples of the block without using luminance samples. The process 1000 proceeds from S1004 to S1005. In S1005, the decoding device 200 decodes the block using the predicted color difference samples. If it is determined in S1002 to divide the luminance VPDU to be processed into smaller blocks, the process 1000 proceeds from S1002 to S1003. In S1003, the decoding device 200 predicts the color difference samples of the block using luminance samples. The process 1000 proceeds from S1003 to S1005. In S1005, the decoding device 200 decodes the block using the predicted color difference samples. In some embodiments, for example, as will be described later with reference to FIGS. 104 to 110, considering additional determination, it may be determined whether to decode the color difference samples of the block using luminance samples.
[0573] FIG. 98 is a flowchart showing another example of the process 2000 of decoding a block using predicted color difference samples, and may be performed, for example, by the encoding device 100 of FIG. 7 or the decoding device 200 of FIG. 67. For convenience, FIG. 98 will be described with reference to the decoding device 200 of FIG. 67.
[0574] In S2001, the decoding device 200 determines whether to divide the first VPDU and the second VPDU into smaller blocks. The determination of whether to divide the luminance VPDU to be processed into smaller blocks may be performed in various ways. Some examples will be described in detail later with reference to FIGS. 102 and 103.
[0575] In S2001, when it is determined not to divide the first VPDU into smaller blocks but to divide the second VPDU into smaller blocks, process 2000 proceeds from S2001 to S2002. In S2002, decoder 200 predicts the color difference samples of a block without using luminance samples. Process 2000 proceeds from S2002 to S2004. In S2004, decoder 200 decodes the block using the predicted color difference samples.
[0576] In S2001, when it is not determined not to divide the first luminance VPDU into smaller blocks but to divide the second VPDU into smaller blocks, process 2000 proceeds from S2001 to S2003. In S2003, decoder 200 predicts the color difference samples of a block using luminance samples. Process 2000 proceeds from S2003 to S2004. In S2004, decoder 200 decodes the block using the predicted color difference samples. In some embodiments, for example, as will be described later with reference to FIGS. 104 to 110, additional determination may be considered to determine whether to decode the color difference samples of a block using luminance samples.
[0577] FIG. 101 is a conceptual diagram for explaining VPDU. The VPDU is a non-overlapping area representing the buffer size for the pipeline stage. The left side (label a) of FIG. 101 shows an example of a 128×128 CTU having four 64×64 VPDUs. The right side (label b) of FIG. 101 shows an example of a 128×128 CTU having sixteen 32×32 VPDUs. When the VPDU is 64×64, both M and N are set to 16. When the VPDU is further divided, the size of the divided CU becomes 2M×2N (32×32) or less. In the YUV420 format, since a 16×16 area of chrominance corresponds to a 32×32 area of luminance, pixels in a 16×16 grid of chrominance can be predicted based on pixels in the corresponding 32×32 grid of luminance. Therefore, when the decoding of the 32×32 area of luminance is completed, the decoding of the process of predicting the color difference from the luminance can be started in the 16×16 area of chrominance. In the case of the YUV444 format, the M×N area of luminance corresponds to the M×N area of color difference. In step S1002 of FIG. 97 or step S2001 of FIG. 98, if 2M×2N is half of the size of the VPDU both horizontally and vertically, it may be determined whether to further divide the VPDU into one or more layers. However, that is the case of 1 / 4 of the VPDU. The embodiment may determine whether the size of the divided CU becomes 2M×2N or less, for example, whether to further divide the CU into two or more layers.
[0578] FIG. 102 is a conceptual diagram for explaining an example of determination as to whether a block of chrominance samples can be predicted using luminance samples based on whether a luminance VPDU is divided into blocks. The left side shows a luminance CTU, and the right side shows a corresponding chrominance CTU. As shown, luminance VPDU0 is divided into blocks, and luminance VPDU1 is not divided into blocks. Therefore, referring to process 1000 of FIG. 97, the chrominance samples of VPDU0 may be predicted using luminance samples, and the chrominance samples of VPDU1 may not be predicted using luminance samples.
[0579] FIG. 103 is a conceptual diagram for explaining two examples of a method for determining whether a luminance VPDU is divided into smaller blocks. In the first example shown on the left side (label a) of FIG. 103, the determination as to whether the luminance VPDU is divided may be made based on a division flag associated with the luminance VPDU. As shown, when the value of the division flag is 1, the VPDU is divided (and referring to process 1000 of FIG. 97, the chrominance samples of the block may be predicted using luminance samples). When the value of the division flag is 0, the VPDU is not divided (and referring to process 1000 of FIG. 97, the chrominance samples of the block may not be predicted using luminance samples). Other division flag values may be used to determine whether the luminance VPDU can be divided.
[0580] In the second example shown on the right side (label b) of FIG. 103, the determination as to whether the luminance VPDU is divided may be made based on the quadtree division depth of the luminance block of the VPDU. As shown, since the quadtree division depth of the luminance block of VPDU0 is greater than 1, referring to process 1000 of FIG. 97, when decoding the block of VPDU0, the chrominance samples may be predicted using luminance samples. On the other hand, since the quadtree division depth of the block of VPDU1 is 1 or less, referring to process 1000 of FIG. 97, when decoding the block of VPDU0, the chrominance samples may not be predicted using luminance samples. Other division depth values may be used to determine whether the luminance VPDU can be divided.
[0581] FIG. 104 is a conceptual diagram for explaining additional determination that may be considered to determine whether to predict a color difference sample of a block using luminance samples. As shown, as an additional determination for determining whether to predict a color difference sample of a block using luminance samples, it may be used whether the block size of the processing target is less than or equal to a threshold block size.
[0582] The threshold block size may be a default block size, a signalized block size, or a predetermined block size, and may be a luminance or color difference block size. For example, if the threshold block size is a 16×16 luminance block size, since the luminance block size of VPDU0 is larger than 16×16, it may be determined not to determine the color difference sample of the block using luminance samples. In S1002 of FIG. 97 or S2001 of FIG. 98, it may be determined whether to divide the luminance VPDU into smaller blocks using the threshold block size.
[0583] The modes of the process 1000 in FIG. 97 and the mode of the process 2000 in FIG. 98 may be changed in various ways. For example, the process 1000 or 2000 may be changed to perform more steps than those shown, may be changed to perform fewer steps than those shown, may be changed to perform steps in various orders, or may be changed to combine or divide steps. For example, before S1001 or S1002, the process 1000 may be changed to determine whether to predict a color difference sample of the block based on other determinations such as the size of the block to be processed as described with reference to FIG. 103. In another example, the process 1000 may be changed to omit S1001. In another example, the embodiment of the process 2000 in FIG. 98 may be changed so that S1001 is performed before S2001. In another example, in S2001, it may be determined whether to divide the first VPDU and the second VPDU into smaller blocks.
[0584] FIG. 105 is a conceptual diagram for explaining an example considering a combination of conditions in determining whether to predict a color difference sample of a block using luminance samples. As shown in FIG. 105, the example of the combination of conditions is whether the luminance VPDU and the corresponding color difference VPDU have a quadtree division depth of 2 or more. Since the luminance VPDU0 has a quadtree division depth of 2 or more and the color difference VPDU0 has a quadtree division depth of 2 or more, the color difference sample of the color difference VPDU0 may be predicted using the luminance sample. However, since the luminance VPDU1 has a quadtree division depth of less than 2, one of the conditions is not satisfied, and the color difference sample of the color difference VPDU1 is predicted without using the luminance sample.
[0585] FIG. 106 is a conceptual diagram for explaining another example considering a combination of conditions in determining whether to predict a color difference sample of a block using luminance samples. As shown in FIG. 106, the example of the combination of conditions is (i) whether the quadtree division depth of the luminance VPDU is 2 or more, (ii) whether the quadtree division depth of the corresponding color difference VPDU is equal to 1, and (iii) whether the 32×32 color difference division threshold condition is satisfied (for example, when the color difference size is 32×32, the block is not divided). Since the luminance VPDU0 has a quadtree division depth of 2 or more, it satisfies condition (i). Since the color difference VPDU0 has a quadtree division depth equal to 1, it satisfies condition (ii). Since the color difference VPDU is not divided into blocks smaller than 32×32, all three conditions are satisfied, and the color difference sample of the color difference VPDU0 may be predicted using the luminance sample. However, since the color difference VPDU1 has a block smaller than the 32×32 threshold, condition (iii) is not satisfied, and the color difference sample of the color difference VPDU1 is predicted without using the luminance sample.
[0586] FIG. 107 is a conceptual diagram for explaining another example considering a combination of conditions in determining whether to predict a color difference sample of a block using luminance samples. As shown in FIG. 107, the example of the combination of conditions is (i) whether the quadtree division depth of the luminance VPDU is 2 or more, (ii) whether the quadtree division depth of the corresponding color difference VPDU is equal to 1, and (iii) whether the 32×32 color difference division threshold condition is satisfied (for example, when the color difference size is 32×32, the block is not divided). qtDepthC in FIG. 107 indicates the quadtree division depth of the color difference, and mtDepthC in FIG. 107 indicates the octree division depth of the color difference. After the quadtree division, another quadtree division or octree division (binary division or ternary division) may follow. The specification of the quadtree division of the color difference ends at depth 1, and the condition chromaSplit32x32 == CU_DONT_SPLIT is added (condition iii discussed with reference to FIG. 106). This means that there is no further division at the 32×32 color difference level. If the quadtree division depth qtDepthl of the luminance is 2 or more, only the color difference VPDU0 satisfies all three conditions, and the color difference samples of the color difference VPDU0 may be predicted using the luminance samples. The color difference VPDU1 has a quadtree division depth of 2, and the block is divided into blocks smaller than 32×32, so the color difference samples of the VPDU1 are predicted without using the luminance samples. The color difference VPDU2 has a quadtree division depth of 1, but the block is divided into blocks smaller than 32×32, so the color difference samples of the VPDU2 are predicted without using the luminance samples. The color difference VPDU3 has a quadtree division depth of 1, but the block is divided into blocks smaller than 32×32, so the color difference samples of the VPDU3 are predicted without using the luminance samples.
[0587] FIG. 108 is a conceptual diagram for explaining another example considering a combination of conditions in determining whether to predict a color difference sample of a block using a luminance sample. In the example, the combination of conditions is: (i) whether the quadtree division depth of the luminance VPDU is 2 or more, (ii) whether the quadtree division depth of the corresponding color difference VPDU is equal to 1, and (iii) whether vertical or horizontal three-way division does not follow horizontal color difference division at size 32×32. In VPDU0, the conditions are satisfied. The VPDU is horizontally divided into two 16×32 blocks, and these blocks are not further divided using horizontal or vertical three-way division. Therefore, the color difference samples in all blocks of VPDU0 may be predicted using luminance samples. In VPDU1, the conditions are satisfied for the lower 16×32 block that is not further divided, and the color difference samples of the lower 16×32 block may be predicted using luminance samples. Since there is further vertical three-way division, the conditions are not satisfied for the upper 16×32 block of VPDU1, and the color difference samples of the upper 16×32 block of VPDU1 are predicted without using luminance samples.
[0588] FIG. 109 is a conceptual diagram for explaining another example considering a combination of conditions in determining whether to predict a color difference sample of a block using a luminance sample. As shown in FIG. 109, the example of the combination of conditions is: (i) whether the quadtree division depth of the luminance VPDU is equal to 1, (ii) whether the 64×64 luminance division threshold condition is satisfied (for example, when the luminance size is 64×64, the block is not divided), (iii) whether the quadtree division depth of the corresponding color difference VPDU is equal to 1, and (iv) whether the 32×32 color difference division threshold condition is satisfied (for example, when the color difference size is 32×32, the block is not divided). VPDU0 satisfies all four conditions, and the color difference samples of VPDU0 may be predicted using luminance samples. The color difference VPDU1 has a quadtree division depth of 2, and the block is divided into blocks smaller than 32×32, so the color difference samples of VPDU1 are predicted without using luminance samples.
[0589] FIG. 110 is a conceptual diagram for explaining another example considering a combination of conditions in determining whether to predict a color difference sample of a block using luminance samples. As shown in FIG. 110, if any of the conditions are true, the color difference sample of the block may be predicted using the luminance samples. Examples of the combination of conditions are: (i) whether the quadtree division depth of the luminance VPDU is 2 or more and the quadtree division depth of the color difference VPDU is 2 or more; (ii) the quadtree division depth of the luminance VPDU is equal to 1 and satisfies the 64×64 luminance division threshold condition (for example, when the luminance size is 64×64, the block is not divided), and whether the quadtree division depth of the corresponding color difference VPDU is equal to 1 and satisfies the 32×32 color difference division threshold condition (for example, when the color difference size is 32×32, the block is not divided); (iii) the quadtree division depth of the luminance VPDU is 2 or more and whether the quadtree division depth of the corresponding color difference VPDU is equal to 1 and satisfies the 32×32 color difference division threshold condition (for example, when the color difference size is 32×32, the block is not divided); (iv) the quadtree division depth of the luminance VPDU is 2 or more and the quadtree division depth of the corresponding color difference VPDU is equal to 1, the color difference division of the 32×32 block is a horizontal division, and whether the color difference blocks smaller than 32×32 are not divided or are vertically divided. Since all four blocks of VPDU1 violate all the conditions, the color difference sample of VPDU1 is predicted without using the luminance samples. In order to suppress the latency of color difference prediction (from the luminance samples) within the 32×32 samples considering the scanning order, the conditions of the example in FIG. 110 may be used. For example, in VPDU1, color difference block 0 has to wait for the reconstruction of luminance block 0 for prediction. Also, color difference block 1 has to wait for the reconstruction of luminance block 0 and luminance block 1 for prediction. In order to avoid such latency, the color difference prediction may be performed without using the luminance samples.
[0590] The blocks described in each aspect may be replaced with rectangular or non-rectangular shape partitions. FIG. 111 shows examples of non-rectangular shape partitions such as triangular shape partitions, L-shaped partitions, pentagonal shape partitions, hexagonal shape partitions, polygonal shape partitions, etc. Other non-rectangular shape partitions may be used, or combinations of various shapes may be used. The term "partition" in each aspect may be replaced with the term "prediction unit". Also, the term "partition" in each aspect may be replaced with the term "sub-prediction unit". Also, the term "partition" in each aspect may be replaced with the term "encoding unit".
[0591] Other conditions may be used. For example, in an embodiment, when enabling an encoding mode for predicting a color difference from luminance such as CCLM, the first division of the VPDU may always be 4 divisions. In other embodiments, when not applying a predetermined number of 4 divisions to at least one VPDU in the CTU, for example, the first VPDU of the CTU in scan order, CCLM may be disabled for all VPDUs in the CTU.
[0592] CCLM may be defined as a mode of intra prediction that uses mode information such as intra_chroma_pred_mode. The index number indicating the mode of intra prediction and each mode may be associated one-to-one in a table. However, when CCLM is invalid, the table entries for CCLM are unnecessary. Therefore, the index number can be encoded to reduce the number of bits and encode the signal. In an embodiment, the table indicating the mode of intra prediction may be switched according to whether CCLM is valid or not. For example, by referring to the split flag information indicating the 4-way split of luminance, if the luminance is not split into a size equal to or less than a predetermined size in the VPDU, it may be determined that CCLM is invalid, and the corresponding table for the case where CCLM is invalid is used. Otherwise, the corresponding table used when CCLM can be used may be used. In an embodiment, a table including entries for CCLM may be used without switching the table. However, when CCLM is invalid, it may not be necessary to refer to the entries for CCLM.
[0593] Referring to FIG. 98, for example, in some embodiments, the block to be processed may be included in the first VPDU. In some embodiments, the block to be processed may be included in the second VPDU. In some embodiments, the first VPDU is a luminance VPDU. In some embodiments, the first VPDU is a chrominance VPDU. In some embodiments, the second VPDU is a luminance VPDU. In some embodiments, the second VPDU is a chrominance VPDU. In some embodiments, the first VPDU is a luminance VPDU and the second VPDU is a chrominance VPDU. In some embodiments, whether to divide the VPDU into smaller blocks may be determined based on a division flag associated with the VPDU. In some embodiments, the division flag is a quadtree division flag. In some embodiments, the division flag is a binary tree division flag. In some embodiments, the division flag is a ternary tree division flag. In some embodiments, the determination of whether to divide the VPDU into smaller blocks may be based on a plurality of division flags associated with the VPDU. In some embodiments, the determination of whether to divide the VPDU into smaller blocks may be based on a block division depth. In some embodiments, the block division depth is a quadtree division depth. In some embodiments, the block division depth is a binary tree division depth. In some embodiments, the block division depth is a ternary tree division depth. In some embodiments, the determination of whether to divide the VPDU is repeated until a threshold block size is reached. In some embodiments, the threshold block size is a default threshold block size and may be predetermined. In some embodiments, the threshold block size is signaled. In some embodiments, the partition shape of the smaller blocks is limited to a set of predetermined shapes, and the block size of the smaller blocks is limited to a set of predetermined block sizes. Although these examples have been described with reference to a decoding apparatus and a decoding method, these examples of the embodiments may also be used in an encoding apparatus and an encoding method.
[0594] Among the effects, in particular, by determining whether a color difference sample used to decode a block to be processed can be predicted using a luminance sample, the latency of reconstruction can be reduced, and the flexibility of hardware implementation can be improved.
[0595] One or more aspects disclosed herein may be implemented in combination with at least a part of other aspects in the present disclosure. Also, a part of the processing described in the flowchart of one or more aspects disclosed herein, a part of the configuration of the apparatus, a part of the syntax, etc. may be implemented in combination with other aspects. The aspects described with reference to the components of the encoding apparatus may be similarly performed by the corresponding components of the decoding apparatus.
[0596] [Implementation and Application] In each of the above embodiments, each of the functional or operative blocks can usually be realized by an MPU (micro processing unit), a memory, etc. Also, the processing by each of the functional blocks may be realized as a program execution unit such as a processor that reads and executes software (program) recorded on a recording medium such ...
Claims
1. A circuit, and a memory connected to the circuit, wherein, in operation, the circuit determines whether to divide a first VPDU (virtual pipeline decoding unit) into smaller blocks and whether to divide a second VPDU into smaller blocks, predicts a block of color difference samples without using luminance samples for a determination of not dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, predicts a block of color difference samples using luminance samples for a determination of dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, predicts a block of color difference samples using luminance samples for a determination of not dividing the first VPDU into smaller blocks and not dividing the second VPDU into smaller blocks, encodes the block using the predicted color difference samples, generates a bitstream including the encoded block, and transmits the generated bitstream, a transmission device.
2. Determines whether to divide a first VPDU (virtual pipeline decoding unit) into smaller blocks and whether to divide a second VPDU into smaller blocks, predicts a block of color difference samples without using luminance samples for a determination of not dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, predicts a block of color difference samples using luminance samples for a determination of dividing the first VPDU into smaller blocks and dividing the second VPDU into smaller blocks, predicts a block of color difference samples using luminance samples for a determination of not dividing the first VPDU into smaller blocks and not dividing the second VPDU into smaller blocks, encodes the block using the predicted color difference samples, generates a bitstream including the encoded block, and transmits the generated bitstream, a transmission method.
Citation Information
Patent Citations
Image processing device and image processing method
JP2013034163A
Image encoding device, image encoding method and image encoding program, image decoding device, image decoding method and image decoding program
JP2018191036A
Constraints on coding unit partition
US20200037002A1
Systems and methods for partitioning video blocks in an inter prediction slice of video data
WO2019026807A1
Method and apparatus of LUMA-chroma separated coding tree coding with constraints
WO2020098786A1