Encoder, decoder and bit stream generation device

The encoding apparatus optimizes video coding by using context adaptive encoding and Golomb-Rice encoding for coefficient flags, addressing inefficiencies in existing technologies and enhancing encoding efficiency, processing speed, and reducing circuit scale.

JP2025113378AActive Publication Date: 2025-08-01PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2025084575
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-04-24
Filing Date
2025-05-21
Publication Date
2025-08-01
Estimated Expiration
2040-04-24

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in improving encoding efficiency, image quality, reducing processing volume, and circuit scale, while appropriately selecting elements or operations such as filters, blocks, motion vectors, and reference pictures.

Method used

An encoding apparatus that applies context adaptive encoding and Golomb-Rice encoding for coefficient information flags, allowing for efficient encoding and decoding of image blocks with and without orthogonal transforms, and adjusts processing limits based on coefficient positions to balance code amount and processing delay.

Benefits of technology

This approach enhances encoding efficiency, simplifies processing, reduces circuit scale, and improves processing speed by optimizing encoding and decoding methods for video coding, particularly in handling blocks with and without orthogonal transforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025113378000001_ABST
    Figure 2025113378000001_ABST
Patent Text Reader

Abstract

To reduce processing delay by simplifying processing.SOLUTION: An encoder (100) includes circuitry circuit and a memory which is connected to the circuitry. In a case where a restriction on the number of context adaptive coding processes allows the context adaptive coding to be collectively performed on a plurality of coefficient information flags, the circuitry encodes the plurality of coefficient information flags by the context adaptive coding and encodes a remainder value of a flag by Golomb-Rice coding. In a case where the restriction on the number of context adaptive coding processes does not allow the context adaptive coding to be collectively performed on the plurality of coefficient information flags, the circuitry skips the encoding of the plurality of coefficient information flags and encodes a value of a coefficient by the Golomb-Rice coding. In a case where orthogonal transform is skipped, the circuitry encodes a plurality of absolute value flags relating to magnitudes of absolute values of coefficients by the context adaptive coding. The plurality of coefficient information flags includes a flag indicating whether or not the coefficient is an odd number or an even number.SELECTED DRAWING: Figure 56
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to video coding, for example, systems, components, and methods in video encoding and decoding, etc.

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 increasing amount of digital video data in various applications.

[0003] Note that Non-Patent Document 1 relates to an example of a conventional standard regarding the above-described video coding technology.

Prior Art Documents

Non-Patent Documents

[0004]

Non-Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0005] Regarding the encoding method as described above, for improving encoding efficiency, improving image quality, reducing processing volume, reducing circuit scale, or appropriately selecting elements or operations such as filters, blocks, sizes, motion vectors, reference pictures, or reference blocks, etc., a new method is desired.

[0006] The present disclosure provides a configuration or method that can contribute to, for example, improvement of encoding efficiency, improvement of image quality, reduction of processing amount, reduction of circuit scale, improvement of processing speed, and appropriate selection of elements or operations. Note that the present disclosure may include a configuration or method that can contribute to benefits other than the above.

Means for Solving the Problem

[0007] For example, an encoding apparatus according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In residual encoding of a current block, when an orthogonal transform using different syntaxes is applied and when the orthogonal transform is skipped, if a processing count limit of context adaptive encoding allows batch context adaptive encoding of a plurality of coefficient information flags included in the current block, the circuit encodes the plurality of coefficient information flags by the context adaptive encoding, encodes a residual value of the coefficients by Golomb-Rice encoding, and if the processing count limit does not allow batch context adaptive encoding of the plurality of coefficient information flags, the circuit skips encoding of the plurality of coefficient information flags and encodes values of the coefficients by Golomb-Rice encoding. When the orthogonal transform is skipped, after encoding the plurality of coefficient information flags and before encoding the residual value of the coefficients, the circuit encodes a plurality of absolute value flags regarding magnitudes of absolute values of the coefficients by the context adaptive encoding. The plurality of coefficient information flags includes a flag indicating whether the coefficient is odd or even.

[0008] Some implementations of embodiments in the present disclosure may improve encoding efficiency, simplify encoding / decoding processing, increase encoding / decoding processing speed, or efficiently select appropriate components / operations used for encoding and decoding, such as appropriate filters, block sizes, motion vectors, reference pictures, reference blocks, etc.

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

[0010] Note that these general or specific aspects may be implemented by a system, a method, an integrated circuit, a computer program, a recording medium, or any arbitrary combination thereof.

Advantages of the Invention

[0011] The configuration or method according to one aspect of the present disclosure can contribute to, for example, one or more of improvement in coding efficiency, improvement in image quality, reduction in processing amount, reduction in circuit scale, improvement in processing speed, and appropriate selection of elements or operations. Note that the configuration or method according to one aspect of the present disclosure may contribute to benefits other than those described above.

Brief Description of the Drawings

[0012]

Figure 1

Figure 2

Figure 3

Figure 4A

Figure 4B

Figure 5A

Figure 5B

Figure 6A

Figure 6B

Figure 6C

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

Figure 25A

Figure 25B

Figure 26A

Figure 26B

Figure 26C

Figure 27

Figure 28A

Figure 28B

Figure 29

Figure 30A

Figure 30B

Figure 31A

Figure 31B

Figure 32

Figure 33

Figure 34

Figure 35

Figure 36

Figure 37

Figure 38

Figure 39

Figure 40

Figure 41

Figure 42

Figure 43

Figure 44

Figure 45

Figure 46

Figure 47

Figure 48

Figure 49

Figure 50

Figure 51

Figure 52

Figure 53

Figure 54

Figure 55

Figure 56

Figure 57

Figure 58

Figure 59

Figure 60

Figure 61

Figure 62

Figure 63

Figure 64

Figure 65

Figure 66

DETAILED DESCRIPTION OF THE INVENTION

[0013] For example, in encoding a block of an image, an encoding device may be able to convert the block into data that is easy to compress by applying an orthogonal transform to the block. On the other hand, in encoding a block of an image, the encoding device may be able to reduce the processing delay by not applying an orthogonal transform to the block.

[0014] Also, the characteristics of a block to which an orthogonal transform is applied are different from those of a block to which an orthogonal transform is not applied. The encoding method used for a block to which an orthogonal transform is applied and the encoding method used for a block to which an orthogonal transform is not applied may be different from each other.

[0015] However, if an inappropriate encoding method is used for a block to which an orthogonal transform is applied, or if an inappropriate encoding method is used for a block to which an orthogonal transform is not applied, an increase in the amount of code or an increase in the processing delay may occur. Also, if the encoding method used for a block to which an orthogonal transform is applied and the encoding method used for a block to which an orthogonal transform is not applied deviate significantly from each other, the processing may become complicated and the circuit scale may increase.

[0016] Therefore, for example, an encoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit limits the number of processing times of context-adaptive encoding to encode a block of an image. In the encoding of the block, in both the case where an orthogonal transform is applied to the block and the case where an orthogonal transform is not applied to the block, a sub-block flag encoding process for encoding a sub-block flag indicating whether a non-zero coefficient is included in a sub-block included in the block by context-adaptive encoding is performed without including it in the number of processing times.

[0017] As a result, regardless of whether the orthogonal transformation is applied or not, and regardless of the limitation on the number of times of context adaptive coding processing, the sub-block flag may be coded by context adaptive coding. Therefore, the amount of code may be reduced. Also, the difference between the coding method used for the block to which the orthogonal transformation is applied and the coding method used for the block to which the orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0018] Also, for example, when the orthogonal transformation is applied to the block, the circuit further performs a position parameter coding process of coding, by context adaptive coding, a parameter indicating the position of the first non-zero coefficient in the block in the scan order, without including it in the number of times of processing.

[0019] As a result, when the orthogonal transformation is applied, regardless of the limitation on the number of times of context adaptive coding processing, the parameter indicating the position of the first non-zero coefficient may be coded by context adaptive coding. Therefore, the amount of code may be reduced.

[0020] Also, for example, when the orthogonal transformation is applied to the block, the circuit further determines the limitation range of the number of times of processing according to the position of the first non-zero coefficient.

[0021] As a result, when the orthogonal transformation is applied, the limited number of times of processing may be appropriately determined. Therefore, the balance between the reduction of the amount of code and the reduction of the processing delay may be appropriately adjusted.

[0022] Further, for example, a decoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit limits the number of processing times of context adaptive decoding to decode an image block. In the decoding of the block, when an inverse orthogonal transform is applied to the block and when an inverse orthogonal transform is not applied to the block, a sub-block flag indicating whether non-zero coefficients are included in sub-blocks included in the block is decoded by context adaptive decoding without including the sub-block flag decoding process in the number of processing times.

[0023] As a result, regardless of whether an inverse orthogonal transform is applied and the limitation of the number of processing times of context adaptive decoding, the sub-block flag may be decoded by context adaptive decoding. Therefore, the amount of code may be reduced. In addition, the difference between the decoding method used for a block to which an inverse orthogonal transform is applied and the decoding method used for a block to which an inverse orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0024] Further, for example, when an inverse orthogonal transform is applied to the block, the circuit further performs a position parameter decoding process of decoding, by context adaptive decoding, a parameter indicating the position of the first non-zero coefficient in the block without including the position parameter decoding process in the number of processing times.

[0025] As a result, when an inverse orthogonal transform is applied, regardless of the limitation of the number of processing times of context adaptive decoding, a parameter indicating the position of the first non-zero coefficient may be decoded by context adaptive decoding. Therefore, the amount of code may be reduced.

[0026] Further, for example, when an inverse orthogonal transform is applied to the block, the circuit determines the limitation range of the number of processing times according to the position of the first non-zero coefficient.

[0027] As a result, when the inverse orthogonal transform is applied, the limit number of processing times can be appropriately determined. Therefore, the balance between the reduction of the amount of code and the reduction of processing delay can be appropriately adjusted.

[0028] Also, for example, an encoding method according to an aspect of the present disclosure limits the number of processing times of context adaptive encoding to encode an image block. In the encoding of the block, when an orthogonal transform is applied to the block, and in both cases where an orthogonal transform is not applied to the block, a sub-block flag encoding process for encoding a sub-block flag indicating whether or not non-zero coefficients are included in sub-blocks included in the block by context adaptive encoding is performed without including it in the number of processing times.

[0029] As a result, regardless of whether or not an orthogonal transform is applied and the limit of the number of processing times of context adaptive encoding, the sub-block flag may be encoded by context adaptive encoding. Therefore, the amount of code may be reduced. Also, the difference between the encoding method used for a block to which an orthogonal transform is applied and the encoding method used for a block to which an orthogonal transform is not applied becomes small, and the circuit scale may become small.

[0030] Also, for example, a decoding method according to an aspect of the present disclosure limits the number of processing times of context adaptive decoding to decode an image block. In the decoding of the block, when an inverse orthogonal transform is applied to the block, and in both cases where an inverse orthogonal transform is not applied to the block, a sub-block flag decoding process for decoding a sub-block flag indicating whether or not non-zero coefficients are included in sub-blocks included in the block by context adaptive decoding is performed without including it in the number of processing times.

[0031] As a result, regardless of whether the inverse orthogonal transformation is applied or not, and regardless of the limitation on the number of times of context-adaptive decoding processing, the sub-block flag may be decoded by context-adaptive decoding. Therefore, the amount of code may be reduced. Also, the difference between the decoding method used for a block to which the inverse orthogonal transformation is applied and the decoding method used for a block to which the inverse orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0032] Also, for example, an encoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, when an orthogonal transformation is applied to a block of an image to be encoded and when the orthogonal transformation is not applied to the block, if the number of times of context-adaptive encoding processing is within the limitation range of the number of times of processing, a coefficient information flag indicating an attribute of coefficients included in the block is encoded by context-adaptive encoding. When the number of times of processing is not within the limitation range of the number of times of processing, encoding of the coefficient information flag is skipped. When the coefficient information flag is encoded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is encoded by Golomb-Rice encoding. When encoding of the coefficient information flag is skipped, the value of the coefficient is encoded by Golomb-Rice encoding.

[0033] As a result, regardless of whether the orthogonal transformation is applied or not, encoding of the coefficient information flag may be skipped according to the limitation on the number of times of context-adaptive encoding processing. Therefore, an increase in processing delay may be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the encoding method used for a block to which the orthogonal transformation is applied and the encoding method used for a block to which the orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0034] Also, for example, the coefficient information flag is a flag indicating whether the value of the coefficient is greater than 1.

[0035] As a result, regardless of whether or not an orthogonal transformation is applied, encoding of a coefficient information flag indicating whether the value of a coefficient is greater than 1 may be skipped in accordance with the limit on the number of times of context adaptive encoding processing. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed.

[0036] Also, for example, a decoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit performs context adaptive decoding of a coefficient information flag indicating an attribute of a coefficient included in a block when inverse orthogonal transformation is applied to the block of the image to be decoded and when inverse orthogonal transformation is not applied to the block, provided that the number of times of context adaptive decoding processing is within the limit range of the number of times of processing. When the number of times of processing is not within the limit range of the number of times of processing, decoding of the coefficient information flag is skipped. When the coefficient information flag is decoded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is decoded by Golomb-Rice decoding. When decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding.

[0037] As a result, regardless of whether or not an inverse orthogonal transformation is applied, decoding of a coefficient information flag may be skipped in accordance with the limit on the number of times of context adaptive decoding processing. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the decoding method used for a block to which an inverse orthogonal transformation is applied and the decoding method used for a block to which no inverse orthogonal transformation is applied becomes smaller, and the circuit scale may become smaller.

[0038] Also, for example, the coefficient information flag is a flag indicating whether the value of the coefficient is greater than 1.

[0039] As a result, regardless of whether the inverse orthogonal transform is applied or not, the decoding of the coefficient information flag indicating whether the value of the coefficient is greater than 1 may be skipped according to the limit on the number of times of context adaptive decoding processing. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed.

[0040] Also, for example, in the encoding method according to one aspect of the present disclosure, when an orthogonal transform is applied to a block of an image to be encoded and when the orthogonal transform is not applied to the block, when the number of times of context adaptive encoding is within the limit range of the number of times of processing, a coefficient information flag indicating an attribute of a coefficient included in the block is encoded by context adaptive encoding, and when the number of times of processing is not within the limit range of the number of times of processing, encoding of the coefficient information flag is skipped. When the coefficient information flag is encoded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is encoded by Golomb-Rice encoding, and when encoding of the coefficient information flag is skipped, the value of the coefficient is encoded by Golomb-Rice encoding.

[0041] As a result, regardless of whether the orthogonal transform is applied or not, the encoding of the coefficient information flag may be skipped according to the limit on the number of times of context adaptive encoding processing. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the encoding method used for a block to which the orthogonal transform is applied and the encoding method used for a block to which the orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0042] Also, for example, in the decoding method according to one aspect of the present disclosure, when an inverse orthogonal transform is applied to a block of a decoding target image and when the inverse orthogonal transform is not applied to the block, if the number of processing times of context adaptive decoding is within the limit range of the number of processing times, a coefficient information flag indicating an attribute of a coefficient included in the block is decoded by context adaptive decoding. When the number of processing times is not within the limit range of the number of processing times, decoding of the coefficient information flag is skipped. When the coefficient information flag is decoded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is decoded by Golomb-Rice decoding. When decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding.

[0043] Thereby, regardless of whether or not an inverse orthogonal transform is applied, decoding of the coefficient information flag may be skipped in accordance with the limit of the number of processing times of context adaptive decoding. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the decoding method used for a block to which an inverse orthogonal transform is applied and the decoding method used for a block to which an inverse orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0044] Also, for example, an encoding apparatus according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit limits the number of processing times of context adaptive encoding and encodes a block of an image. In the encoding of the block, when an orthogonal transform is not applied to the block, it is determined whether or not processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags are encoded by context adaptive encoding. The processing condition is a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

[0045] As a result, when orthogonal transformation is not applied, it is possible to comprehensively determine whether context adaptive coding can be used for a plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Also, when similar processing is performed on blocks to which orthogonal transformation is applied, the difference between the coding method used for blocks to which orthogonal transformation is applied and the coding method used for blocks to which orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0046] Also, for example, the plurality of coefficient information flags include a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5.

[0047] As a result, it is possible to comprehensively determine a plurality of coefficient information flags including a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5. Therefore, the processing may be simplified and the processing delay may be reduced.

[0048] Also, for example, the plurality of coefficient information flags further include a coefficient information flag indicating whether the value of the coefficient is greater than 7 and a coefficient information flag indicating whether the value of the coefficient is greater than 9.

[0049] As a result, it is possible to comprehensively determine a plurality of coefficient information flags including four coefficient information flags: whether the value of the coefficient is greater than 3, whether the value of the coefficient is greater than 5, whether the value of the coefficient is greater than 7, and whether the value of the coefficient is greater than 9. Therefore, the processing may be simplified and the processing delay may be reduced.

[0050] Further, for example, a decoding apparatus according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit. In operation, the circuit limits the number of processing times of context adaptive decoding to decode an image block. In the decoding of the block, when an inverse orthogonal transform is not applied to the block, it is determined whether processing conditions are satisfied for a plurality of coefficient information flags each indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags are decoded by context adaptive decoding. The processing condition is a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

[0051] Thereby, when an inverse orthogonal transform is not applied, it is possible to comprehensively determine whether context adaptive decoding can be used for a plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Further, when similar processing is performed on a block to which an inverse orthogonal transform is applied, the difference between the decoding method used for the block to which an inverse orthogonal transform is applied and the decoding method used for the block to which an inverse orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0052] Further, for example, the plurality of coefficient information flags include a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5.

[0053] Thereby, it is possible to comprehensively determine a plurality of coefficient information flags including a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5. Therefore, the processing may be simplified and the processing delay may be reduced.

[0054] Further, for example, the plurality of coefficient information flags further include a coefficient information flag indicating whether the value of the coefficient is greater than 7 and a coefficient information flag indicating whether the value of the coefficient is greater than 9.

[0055] As a result, comprehensive determination may be performed on a plurality of coefficient information flags including four coefficient information flags indicating whether the value of the coefficient is greater than 3, whether the value of the coefficient is greater than 5, whether the value of the coefficient is greater than 7, and whether the value of the coefficient is greater than 9. Therefore, the processing may be simplified and the processing delay may be reduced.

[0056] Also, for example, the encoding method according to one aspect of the present disclosure limits the number of times of context-adaptive encoding to encode an image block. In the encoding of the block, when an orthogonal transform is not applied to the block, it is determined whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags are encoded by context-adaptive encoding. The processing condition is a condition that the number of times of processing when the number of the plurality of coefficient information flags is added to the number of times of processing is within the limit range of the number of times of processing.

[0057] As a result, when an orthogonal transform is not applied, it is possible to comprehensively determine whether context-adaptive encoding can be used for a plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Also, when similar processing is performed on a block to which an orthogonal transform is applied, the difference between the encoding method used for the block to which an orthogonal transform is applied and the encoding method used for the block to which no orthogonal transform is applied becomes smaller, and the circuit scale may become smaller.

[0058] Further, for example, the decoding method according to one aspect of the present disclosure limits the number of processing times of context-adaptive decoding to decode an image block. In the decoding of the block, when an inverse orthogonal transform is not applied to the block, it is determined whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags are decoded by context-adaptive decoding. The processing condition is a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

[0059] Thereby, when an inverse orthogonal transform is not applied, it is possible to comprehensively determine whether context-adaptive decoding can be used for a plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Further, when similar processing is performed on a block to which an inverse orthogonal transform is applied, the difference between the decoding method used for the block to which an inverse orthogonal transform is applied and the decoding method used for the block to which an inverse orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0060] Further, for example, an encoding apparatus according to one aspect of the present disclosure includes a splitting unit, an intra prediction unit, an inter prediction unit, a prediction control unit, a conversion unit, a quantization unit, an entropy encoding unit, and a loop filter unit.

[0061] The splitting unit splits an encoding target picture constituting the moving image into a plurality of blocks. The intra prediction unit performs intra prediction to generate a prediction image of an encoding target block in the encoding target picture using a reference image in the encoding target picture. The inter prediction unit performs inter prediction to generate a prediction image of the encoding target block using a reference image in a reference picture different from the encoding target picture.

[0062] The prediction control unit controls the intra prediction performed by the intra prediction unit and the inter prediction performed by the inter prediction unit. The conversion unit converts a prediction residual signal between the prediction image generated by the intra prediction unit or the inter prediction unit and the image of the block to be coded, and generates a conversion coefficient signal of the block to be coded. The quantization unit quantizes the conversion coefficient signal. The entropy coding unit codes the quantized conversion coefficient signal. The loop filter unit applies a filter to the block to be coded.

[0063] Also, for example, in operation, the entropy coding unit limits the number of times of context adaptive coding processing to code an image block, and in the coding of the block, when orthogonal transformation is applied to the block and when orthogonal transformation is not applied to the block, a sub-block flag indicating whether non-zero coefficients are included in sub-blocks included in the block is coded by context adaptive coding without including the sub-block flag coding process in the number of times.

[0064] Also, for example, in operation, when orthogonal transformation is applied to a block of an image to be coded and when orthogonal transformation is not applied to the block, when the number of times of context adaptive coding processing is within the limit range of the number of times, a coefficient information flag indicating the attribute of the coefficients included in the block is coded by context adaptive coding, when the number of times is not within the limit range of the number of times, coding of the coefficient information flag is skipped, when the coefficient information flag is coded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is coded by Golomb-Rice coding, and when coding of the coefficient information flag is skipped, the value of the coefficient is coded by Golomb-Rice coding.

[0065] Also, for example, in operation, the entropy encoding unit limits the number of processing times of context-adaptive encoding, encodes an image block, and in the encoding of the block, when an orthogonal transform is not applied to the block, it determines whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block, and when it is determined that the processing conditions are satisfied, encodes the plurality of coefficient information flags by context-adaptive encoding, and the processing conditions are the condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

[0066] Also, for example, a decoding device according to an aspect of the present disclosure is a decoding device that decodes a moving image using a predicted image, and includes an entropy decoding unit, an inverse quantization unit, an inverse transform unit, an intra prediction unit, an inter prediction unit, a prediction control unit, an addition unit (reconstruction unit), and a loop filter unit.

[0067] The entropy decoding unit decodes a quantized transform coefficient signal of a decoding target block in a decoding target picture constituting the moving image. The inverse quantization unit inverse quantizes the quantized transform coefficient signal. The inverse transform unit inverse transforms the transform coefficient signal to obtain a prediction residual signal of the decoding target block.

[0068] The intra prediction unit performs intra prediction for generating the predicted image of the decoding target block using a reference image in the decoding target picture. The inter prediction unit performs inter prediction for generating the predicted image of the decoding target block using a reference image in a reference picture different from the decoding target picture. The prediction control unit controls the intra prediction performed by the intra prediction unit and the inter prediction performed by the inter prediction unit.

[0069] The addition unit adds the prediction image generated by the intra prediction unit or the inter prediction unit and the prediction residual signal to reconstruct the image of the block to be decoded. The loop filter unit applies a filter to the block to be decoded.

[0070] Also, for example, in operation, the entropy decoding unit limits the number of times of context-adaptive decoding processing to decode an image block. In the decoding of the block, when an inverse orthogonal transform is applied to the block and when an inverse orthogonal transform is not applied to the block, a sub-block flag indicating whether non-zero coefficients are included in sub-blocks included in the block is decoded by context-adaptive decoding without including the sub-block flag decoding process in the number of times of processing.

[0071] Also, for example, in operation, when an inverse orthogonal transform is applied to a block of an image to be decoded and when an inverse orthogonal transform is not applied to the block, when the number of times of context-adaptive decoding processing is within the limit range of the number of times of processing, a coefficient information flag indicating the attribute of coefficients included in the block is decoded by context-adaptive decoding. When the number of times of processing is not within the limit range of the number of times of processing, decoding of the coefficient information flag is skipped. When the coefficient information flag is decoded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is decoded by Golomb-Rice decoding. When decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding.

[0072] Also, for example, in operation, the entropy decoding unit limits the number of processing times of context adaptive decoding to decode an image block. In the decoding of the block, when inverse orthogonal transformation is not applied to the block, it is determined whether processing conditions are satisfied for a plurality of coefficient information flags each indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags are decoded by context adaptive decoding. The processing condition is a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

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

[0074] Hereinafter, embodiments will be specifically described with reference to the drawings. Note that each of the embodiments described below shows general 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.

[0075] 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 processing and / or configuration described in each aspect of the present disclosure are applicable. The processing and / or configuration can also be implemented in an encoding device and a decoding device different from the embodiments. For example, with respect to the processing and / or configuration applied to the embodiments, any of the following may be implemented, for example.

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

[0077] (2) In the encoding device or decoding device of the embodiments, arbitrary changes such as addition, replacement, deletion, etc. may be made to the functions or processes performed by some of the multiple components of the encoding device or decoding device. For example, any function or process may be replaced or combined with other functions or processes described in any of the aspects of the present disclosure.

[0078] (3) In the method implemented by the encoding device or decoding device of the embodiments, arbitrary changes such as addition, replacement, and deletion may be made to some of the multiple processes included in the method. For example, any process in the method may be replaced or combined with other processes described in any of the aspects of the present disclosure.

[0079] (4) Some of the multiple components constituting the encoding device or decoding device of the embodiments may be combined with the components described in any of the aspects of the present disclosure, or may be combined with components having a part of the functions described in any of the aspects 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.

[0080] (5) Components having a part of the functions of the encoding device or decoding device of the embodiments, or components that implement a part of the processes of the encoding device or decoding device of the embodiments may be combined or replaced with the components described in any of the aspects of the present disclosure, components having a part of the functions described in any of the aspects of the present disclosure, or components that implement a part of the processes described in any of the aspects of the present disclosure.

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

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

[0083] (8) The implementation manner of the processes and / or configurations described in each aspect of the present disclosure is not limited to the encoding device or decoding device according to the embodiment. For example, the processes and / or configurations may be implemented in a device used for purposes different from the moving image encoding or moving image decoding disclosed in the embodiment.

[0084] [Encoding Device] First, the encoding device according to the embodiment will be described. FIG. 1 is a block diagram showing the functional configuration of the encoding device 100 according to the embodiment. The encoding device 100 is a moving image encoding device that encodes moving images in block units.

[0085] As shown in FIG. 1, the encoding device 100 is a device that encodes images in block units, and includes a splitting unit 102, a subtraction unit 104, a conversion unit 106, a quantization unit 108, an entropy encoding unit 110, an inverse quantization unit 112, an inverse conversion unit 114, an addition unit 116, a block memory 118, a loop filter unit 120, a frame memory 122, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128.

[0086] The symbolization 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 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 loop filter unit 120, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128. Further, the symbolization 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.

[0087] After explaining the overall processing flow of the symbolization device 100 below, each component included in the symbolization device 100 will be described.

[0088] [Overall Flow of Encoding Process] FIG. 2 is a flowchart showing an example of the overall encoding process by the symbolization device 100.

[0089] First, the division unit 102 of the symbolization device 100 divides each picture included in the input image, which is a moving image, into a plurality of blocks of a fixed size (for example, 128×128 pixels) (step Sa_1). Then, the division unit 102 selects a division pattern (also referred to as a block shape) for the block of the fixed size (step Sa_2). That is, the division unit 102 further divides the block of the fixed size into a plurality of blocks that constitute the selected division pattern. Then, for each of the plurality of blocks, the symbolization device 100 performs the processing of steps Sa_3 to Sa_9 on that block (i.e., the block to be encoded).

[0090] That is, a prediction processing unit composed of all or part of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 generates a prediction signal (also referred to as a prediction block) of an encoding target block (also referred to as a current block) (step Sa_3).

[0091] Next, the subtraction unit 104 generates a difference between the encoding target block and the prediction block as a prediction residual (also referred to as a difference block) (step Sa_4).

[0092] Next, the conversion unit 106 and the quantization unit 108 generate a plurality of quantization coefficients by performing conversion and quantization on the difference block (step Sa_5). Note that a block composed of a plurality of quantization coefficients is also referred to as a coefficient block.

[0093] Next, the entropy encoding unit 110 generates an encoded signal by performing encoding (specifically, entropy encoding) on the coefficient block and prediction parameters related to the generation of the prediction signal (step Sa_6). Note that the encoded signal is also referred to as an encoded bit stream, a compressed bit stream, or a stream.

[0094] Next, the inverse quantization unit 112 and the inverse conversion unit 114 restore a plurality of prediction residuals (that is, difference blocks) by performing inverse quantization and inverse conversion on the coefficient block (step Sa_7).

[0095] Next, the addition unit 116 reconstructs the current block into a reconstructed image (also referred to as a reconstructed block or a decoded image block) by adding the prediction block to the restored difference block (step Sa_8). Thereby, a reconstructed image is generated.

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

[0097] Then, the encoding device 100 determines whether the encoding of the entire picture has been completed (step Sa_10). If it is determined that the encoding has not been completed (No in step Sa_10), the processing from step Sa_2 is repeatedly executed.

[0098] In the above example, the encoding device 100 selects one splitting pattern for a block of a fixed size and performs encoding of each block according to the splitting pattern. However, encoding of each block may be performed according to each of a plurality of splitting patterns. In this case, the encoding device 100 may evaluate the cost for each of the plurality of splitting patterns, and for example, select the encoded signal obtained by encoding according to the splitting pattern with the smallest cost as the encoded signal to be output.

[0099] As shown in the figure, the processing of these steps Sa_1 to Sa_10 is sequentially performed by the encoding device 100. Alternatively, a plurality of some of those processes may be performed in parallel, and the order of those processes may be changed, etc.

[0100] [Splitting Unit] The splitting unit 102 splits each picture included in the input moving 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). Other fixed block sizes may be adopted. These blocks of a fixed size are sometimes called coding tree units (CTUs). Then, the splitting unit 102 splits each of the blocks of a fixed size into blocks of a variable size (for example, 64x64 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 blocks of a variable size are sometimes called coding units (CUs), prediction units (PUs), or transform units (TUs). 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, and TUs.

[0101] Figure 3 is a conceptual diagram showing an example of block division in the embodiment. In Figure 3, the solid line represents the block boundary by quadtree block division, and the dashed line represents the block boundary by binary tree block division.

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

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

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

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

[0106] The lower right 64x64 block 23 is not divided.

[0107] As described above, in FIG. 3, block 10 is divided into 13 variable-sized blocks 11 to 23 based on recursive quadtree and binary tree block partitioning. Such partitioning is sometimes referred to as QTBT (quad-tree plus binary tree) partitioning.

[0108] In FIG. 3, one block was divided into four or two blocks (quadtree or binary tree block partitioning), but the partitioning is not limited to these. For example, one block may be divided into three blocks (ternary tree block partitioning). Partitioning that includes such ternary tree block partitioning is sometimes referred to as MBT (multi type tree) partitioning.

[0109] [Picture Composition: Slice / Tile] To decode pictures in parallel, a picture may be composed of slices or tiles. A picture composed of slices or tiles may be formed by the splitting unit 102.

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

[0111] Figure 4A is a conceptual diagram showing an example of the slice configuration. For example, a picture includes 11×8 CTUs and is divided into four slices (Slices 1-4). Slice 1 consists of 16 CTUs, Slice 2 consists of 21 CTUs, Slice 3 consists of 29 CTUs, and Slice 4 consists of 22 CTUs. Here, each CTU in the picture belongs to one of the slices. The shape of the slice is 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, the slice includes header information and encoded data. The header information may describe the characteristics of the slice, such as the CTU address at the beginning of the slice and the slice type.

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

[0113] Figure 4B is a conceptual diagram showing an example of the tile configuration. For example, a 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 is changed compared to when tiles are not used. When tiles are not used, multiple CTUs in the picture are processed in the raster scan order. When tiles are used, in each of the multiple tiles, at least one CTU is processed in the raster scan order. For example, as shown in Figure 4B, the processing order of the multiple CTUs included in Tile 1 is from the left end of the first row of Tile 1 to the right end of the first row of Tile 1, and then from the left end of the second row of Tile 1 to the right end of the second row of Tile 1.

[0114] Note that one tile may include one or more slices, and one slice may include one or more tiles.

[0115] [Subtraction unit] The subtraction unit 104 subtracts a predicted signal (predicted samples input from the prediction control unit 128 shown below) from the original signal (original samples) in block units input from the division unit 102 and divided by the division unit 102. That is, the subtraction unit 104 calculates the prediction error (also referred to as the residual) of the block to be encoded (hereinafter referred to as the current block). Then, the subtraction unit 104 outputs the calculated prediction error (residual) to the conversion unit 106.

[0116] The original signal is the input signal of the encoding device 100 and is a signal representing the image of each picture constituting the moving image (for example, a luminance (luma) signal and two color difference (chroma) signals). Hereinafter, the signal representing the image may also be referred to as a sample.

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

[0118] Note that the conversion unit 106 may adaptively select a conversion type from a plurality of conversion types and convert the prediction error into conversion coefficients using a conversion basis function corresponding to the selected conversion type. Such a conversion is sometimes referred to as an EMT (explicit multiple core transform) or an AMT (adaptive multiple transform).

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

[0120] Information indicating whether or not to apply such EMT or AMT (for example, called an EMT flag or an AMT flag) and information indicating the selected conversion 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, the bit sequence level, the picture level, the slice level, the tile level, or the CTU level).

[0121] Also, the conversion unit 106 may re-convert the conversion coefficients (conversion results). Such re-conversion is sometimes called AST (adaptive secondary transform) or NSST (non-separable secondary transform). For example, the conversion unit 106 performs re-conversion for each sub-block (for example, 4x4 sub-block) included in the block of conversion coefficients corresponding to the intra prediction error. Information indicating whether or not to apply NSST and information regarding the conversion 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, the sequence level, the picture level, the slice level, the tile level, or the CTU level).

[0122] Both separable conversion and non-separable conversion may be applied to the conversion unit 106. Separable conversion is a method in which conversion is performed a plurality of times by separating for each direction by the number of dimensions of the input, and non-separable conversion is a method in which when the input is multi-dimensional, two or more dimensions are regarded as one dimension and conversion is performed together.

[0123] For example, as an example of non-separable conversion, when the input is a 4×4 block, it is regarded as an array having 16 elements, and conversion processing is performed on the array with a 16×16 conversion matrix.

[0124] In a further example of non-separable transformation, after considering a 4×4 input block as an array with 16 elements, a transformation (Hypercube Givens Transform) that performs a plurality of Givens rotations on the array may be performed.

[0125] In the transformation in the transformation unit 106, the type of basis for transformation into the frequency domain can also be switched according to the region within the CU. As an example, there is SVT (Spatially Varying Transform). In SVT, as shown in FIG. 5B, the CU is divided into two equal parts in the horizontal or vertical direction, and transformation into the frequency domain is performed only on one of the regions. The type of transformation basis can be set for each region. For example, DST7 and DCT8 are used. In this example, only one of the two regions within the CU is transformed, and the other is not transformed, but both regions may be transformed. Also, the division method can be made more flexible, not only divided into two equal parts, but also into four equal parts, or information indicating the division can be separately encoded and signaled in the same way as CU division. Note that SVT is sometimes also called SBT (Sub-block Transform).

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

[0127] The predetermined scanning order is the order for quantization / inverse quantization of the transform coefficients. For example, the predetermined scanning order may be defined in ascending order of frequency (from low frequency to high frequency) or descending order of frequency (from high frequency to low frequency).

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

[0129] 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 chrominance difference. Note that quantization refers to digitizing the sampled values 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 determined in advance.

[0130] As methods of using the quantization matrix, there are a method of using the quantization matrix directly set on the encoder side and a method of using the default quantization matrix (default matrix). On the encoder side, by directly setting the quantization matrix, a quantization matrix corresponding to the characteristics of the image can be set. However, in this case, there is a demerit that the amount of code increases due to the encoding of the quantization matrix.

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

[0132] 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 referred to as parameter sets.

[0133] [Entropy Encoding Unit] The entropy encoding unit 110 generates an encoded signal (encoded bit stream) based on the quantization coefficients input from the quantization unit 108. Specifically, the entropy encoding unit 110, for example, binarizes the quantization coefficients, arithmetic-encodes the binary signal, and outputs a compressed bit stream or sequence.

[0134] [Inverse Quantization Unit] The inverse quantization unit 112 inverse-quantizes the quantization coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inverse-quantizes the quantization 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 predefined.

[0135] [Inverse Transform Unit] The inverse transform unit 114 restores a prediction error (residual) by inverse-transforming the transform coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 performs an inverse transform corresponding to the transform by the transform unit 106 on the transform coefficients to restore the prediction error of the current block. Then, the inverse transform unit 114 outputs the restored prediction error to the addition unit 116.

[0136] Note that since information is usually lost due to quantization, the restored prediction error does not match the prediction error calculated by the subtraction unit 104. That is, the restored prediction error usually includes a quantization error.

[0137] [Addition Unit] The adder 116 reconstructs the current block by adding the prediction error input from the inverse conversion unit 114 and the prediction sample input from the prediction control unit 128. Then, the adder 116 outputs the reconstructed block to the block memory 118 and the loop filter unit 120. The reconstructed block may also be called a local decoding block.

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

[0139] [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 block filtered by the loop filter unit 120.

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

[0141] In the case of the ALF, a least squares error filter for removing coding distortion is applied, and for example, for each 2x2 sub-block within the current block, one filter selected from a plurality of filters is applied based on the direction and activity of the local gradient.

[0142] Specifically, first, sub-blocks (e.g., 2x2 sub-blocks) are classified into a plurality of classes (e.g., 15 or 25 classes). The classification of sub-blocks is performed based on the direction and activity of gradients. For example, a classification value C (e.g., C = 5D + A) is calculated using the gradient direction value D (e.g., 0 to 2 or 0 to 4) and the 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.

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

[0144] Based on the results of such classification, a filter for the sub-blocks is determined from among a plurality of filters.

[0145] As the shape of the filter used in ALF, for example, a circularly symmetric shape is utilized. FIGS. 6A to 6C are diagrams showing a plurality of examples of the shape of the filter used in ALF. FIG. 6A shows a 5x5 diamond-shaped filter, FIG. 6B shows a 7x7 diamond-shaped filter, and FIG. 6C 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).

[0146] 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 color difference, it may be determined whether to apply ALF at the picture level. Information indicating the on / off of ALF is usually signaled at the picture level or CU level. Note that the signaling of 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 (for example, sequence level, slice level, tile level or CTU level).

[0147] A set of coefficients for a plurality of selectable filters (for example, filters up to 15 or 25) 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 (for example, sequence level, slice level, tile level, CTU level, CU level or sub-block level).

[0148] [Loop Filter Section > Deblocking Filter] In the deblocking filter, the loop filter section 120 reduces the distortion generated at the block boundary by performing filtering processing on the block boundary of the reconstructed image.

[0149] FIG. 7 is a block diagram showing an example of a detailed configuration of the loop filter section 120 that functions as a deblocking filter.

[0150] The loop filter section 120 includes 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.

[0151] The boundary determination section 1201 determines whether a pixel to be deblocked filtered (i.e., a 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.

[0152] 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 process 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 process to the switch 1206.

[0153] 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 neighboring pixel around the target pixel. Then, the filter determination unit 1203 outputs the determination result to the switch 1204 and the process determination unit 1208.

[0154] 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 process 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 process obtained via the switch 1202 to the switch 1206.

[0155] When the filter processing unit 1205 obtains the image before the filter process 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 process to the switch 1206.

[0156] 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 process determination unit 1208.

[0157] The processing determination unit 1208 controls the switch 1206 based on the determination results of the boundary determination unit 1201 and the filter determination unit 1203 respectively. That is, when the processing determination unit 1208 determines by the boundary determination unit 1201 that the target pixel exists near the block boundary, and determines by the filter determination unit 1203 that the target pixel is to be subjected to deblocking filter processing, the processing determination unit 1208 causes the deblocking filter processed pixel to be output from the switch 1206. Further, in cases other than the above, the processing determination unit 1208 causes the pixel that has not been subjected to deblocking filter processing to be output from the switch 1206. By repeatedly outputting such pixels, the image after the filter processing is output from the switch 1206.

[0158] FIG. 8 is a conceptual diagram showing an example of a deblocking filter having filter characteristics symmetric with respect to a block boundary.

[0159] In the deblocking filter processing, 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, is selected. In the strong filter, as shown in FIG. 8, when there are pixels p0 to p2 and pixels q0 to q2 sandwiching the block boundary, the pixel values of each of the pixels q0 to q2 are changed to pixel values q'0 to q'2 by performing the operations shown in the following equations, for example.

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

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

[0162] Furthermore, in the deblocking filter process, a clip process may be performed so that the pixel value after the operation is not set to exceed the threshold value. In this clip process, the pixel value after the operation by the above equation is clipped to "operation target pixel value ± 2 × threshold value" using the threshold value determined from the quantization parameter. This can prevent excessive smoothing.

[0163] FIG. 9 is a conceptual diagram for explaining the block boundary where the deblocking filter process is performed. FIG. 10 is a conceptual diagram showing an example of the Bs value.

[0164] The block boundary where the deblocking filter process is performed is, for example, the boundary of a PU (Prediction Unit) or TU (Transform Unit) of an 8×8 pixel block as shown in FIG. 9. The deblocking filter process can be performed in units of 4 rows or 4 columns. First, for blocks P and Q shown in FIG. 9, a Bs (Boundary Strength) value is determined as shown in FIG. 10.

[0165] According to the Bs value in FIG. 10, even for block boundaries belonging to the same image, it is determined whether to perform the deblocking filter process 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. 10 and may be determined based on other parameters.

[0166] [Prediction Processing Unit (Intra Prediction Unit, Inter Prediction Unit, Prediction Control Unit)] FIG. 11 is a flowchart showing an example of the processing performed by the prediction processing unit of the encoding apparatus 100. Note that the prediction processing 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.

[0167] The prediction processing unit generates a predicted image of the current block (step Sb_1). This predicted 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 processing unit generates a predicted image of the current block using the reconstructed image that has already been obtained by performing generation of a prediction block, generation of a difference block, generation of a coefficient block, restoration of the difference block, and generation of a decoded image block.

[0168] The reconstructed image may be, for example, an image of a reference picture, or may be an image of an encoded block 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.

[0169] FIG. 12 is a flowchart showing another example of the processing performed by the prediction processing unit of the encoding apparatus 100.

[0170] The prediction processing 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 a prediction method other than these, respectively. In these prediction methods, the above-described reconstructed image may be used.

[0171] Next, the prediction processing unit selects any one of the plurality of predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c (step Sc_2). The selection of this predicted image, that is, the selection of the method or mode for obtaining the final predicted image, may be performed based on calculating the cost for each generated predicted image and based on that cost. Alternatively, the selection of the predicted image may be performed based on the parameters used in the encoding process. The encoding device 100 may signal information for specifying the selected predicted image, method, or mode in an encoded signal (also referred to as an encoded bit stream). The information may be, for example, a flag or the like. Thereby, the decoding device can generate a predicted image according to the method or mode selected in the encoding device 100 based on that information. In the example shown in FIG. 12, the prediction processing unit selects any predicted image after generating predicted images by each method. However, the prediction processing unit may select a method or mode based on the parameters used in the above-described encoding process before generating those predicted images and generate a predicted image according to the method or mode.

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

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

[0174] First, the prediction processing unit generates a predicted image by intra prediction (step Sd_1a) and generates a predicted image by inter prediction (step Sd_1b). Note that the predicted image generated by intra prediction is also referred to as an intra-predicted image, and the predicted image generated by inter prediction is also referred to as an inter-predicted image.

[0175] Next, the prediction processing unit evaluates each of the intra-predicted image and the inter-predicted image (step Sd_2). A cost may be used for this evaluation. That is, the prediction processing unit calculates the cost C for each of the intra-predicted image and the inter-predicted image. This cost C can be calculated by an equation of the R-D optimization model, for example, C = D + λ × R. In this equation, D is the encoding distortion of the predicted image, which is represented by, for example, the sum of absolute differences between the pixel values of the current block and the pixel values of the predicted image. Also, R is the amount of generated code of the predicted image, specifically, the amount of code required for encoding motion information or the like for generating the predicted image. Also, λ is, for example, the Lagrange multiplier.

[0176] Then, the prediction processing unit selects, as the final predicted image of the current block, the predicted image for which the smallest cost C has been calculated from the intra-predicted image and the inter-predicted image (step Sd_3). That is, the prediction method or mode for generating the predicted image of the current block is selected.

[0177] [Intra Prediction Unit] The intra prediction unit 124 generates a prediction signal (intra prediction signal) by performing intra prediction (also referred to as in-picture prediction) of the current block with reference to the block in the current picture stored in the block memory 118. Specifically, the intra prediction unit 124 generates an intra prediction signal by performing intra prediction with reference to samples (for example, luminance values, color difference values) of blocks adjacent to the current block, and outputs the intra prediction signal to the prediction control unit 128.

[0178] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of prescribed 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 plurality of prescribed modes may be prescribed in advance.

[0179] The non-directional prediction modes of 1 or more include, for example, the Planar prediction mode and the DC prediction mode defined in the H.265 / HEVC standard.

[0180] 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. 14 is a conceptual diagram showing all 67 intra prediction modes (2 non-directional prediction modes and 65 directional prediction modes) that can be used in intra prediction. 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. 14).

[0181] In various processing examples, in the intra prediction of the chrominance blocks, the luminance blocks may be referred to. That is, based on the luminance component of the current block, the chrominance component of the current block may be predicted. Such intra prediction is sometimes called CCLM (cross-component linear model) prediction. An intra prediction mode of a chrominance block that refers to such a luminance block (for example, called the CCLM mode) may be added as one of the intra prediction modes of the chrominance block.

[0182] The intra prediction unit 124 may correct the pixel value after intra prediction based on the gradient 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).

[0183] [Inter Prediction Unit] The inter prediction unit 126 generates a prediction signal (inter prediction signal) by performing inter prediction (also called inter-picture 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. For example, the inter prediction unit 126 performs motion estimation within the reference picture for the current block or current sub-block, and finds the reference block or sub-block that most matches the current block or current sub-block. Then, the inter prediction unit 126 acquires motion information (e.g., motion vector) for compensating the motion or change from the reference block or sub-block to the current block or sub-block. The inter prediction unit 126 performs motion compensation (or motion prediction) based on the motion information, and generates an inter prediction signal for the current block or sub-block. The inter prediction unit 126 outputs the generated inter prediction signal to the prediction control unit 128.

[0184] The motion information used for motion compensation may be signaled as an inter prediction signal in various forms. For example, the motion vector may be signaled. As another example, the difference between the motion vector and the motion vector predictor may be signaled.

[0185] [Basic Flow of Inter Prediction] FIG. 15 is a flowchart showing an example of the basic flow of inter prediction.

[0186] The inter prediction unit 126 first generates a prediction image (Steps Se_1 to Se_3). Next, the subtraction unit 104 generates the difference between the current block and the prediction image as a prediction residual (Step Se_4).

[0187] Here, in generating the predicted image, the inter prediction unit 126 generates the predicted image by determining the motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). 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 selecting at least one candidate MV from a 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 further selecting at least one candidate MV from the at least one candidate MV. Alternatively, the inter prediction unit 126 may determine the MV of the current block by searching for the region of the reference picture indicated by the candidate MV for each of the selected at least one candidate MVs. Note that searching for the region of this reference picture may be referred to as motion estimation.

[0188] Also, in the above example, steps Se_1 to Se_3 are performed by the inter prediction unit 126. However, for example, processing such as step Se_1 or step Se_2 may be performed by other components included in the encoding device 100.

[0189] [Flow of Derivation of Motion Vector] FIG. 16 is a flowchart showing an example of motion vector derivation.

[0190] The inter prediction unit 126 derives the MV of the current block in a mode in which motion information (e.g., MV) is encoded. In this case, for example, the motion information is encoded as a prediction parameter and signaled. That is, the encoded motion information is included in the encoded signal (also referred to as an encoded bitstream).

[0191] Alternatively, the inter prediction unit 126 derives the MV in a mode in which the motion information is not encoded. In this case, the motion information is not included in the encoded signal.

[0192] Here, the modes for MV derivation may include, for example, the normal inter mode, the merge mode, the FRUC mode, and the affine mode, which will be described later. Among these modes, the modes in which the motion information is encoded include the normal inter mode, the merge mode, and the affine mode (specifically, the affine inter mode and the affine merge mode). Note that the motion information may include not only the MV but also the predicted motion vector selection information, which will be described later. Also, the modes in which the motion information is not encoded include the 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.

[0193] FIG. 17 is a flowchart showing another example of motion vector derivation.

[0194] The inter prediction unit 126 derives the MV of the current block in a mode in which the differential MV is encoded. In this case, for example, the differential MV is encoded as a prediction parameter and signaled. That is, the encoded differential MV is included in the encoded signal. This differential MV is the difference between the MV of the current block and its predicted MV.

[0195] Alternatively, the inter prediction unit 126 derives the MV in a mode in which the differential MV is not encoded. In this case, the encoded differential MV is not included in the encoded signal.

[0196] Here, as described above, the modes for deriving the MV include the normal inter, merge mode, FRUC mode, and affine mode, etc., which will be described later. 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 merge mode, and the affine mode (specifically, the 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.

[0197] [Flow of Deriving Motion Vector] FIG. 18 is a flowchart showing another example of motion vector derivation. There are multiple modes for the MV derivation mode, that is, the inter prediction mode, and broadly divided into a mode for encoding the differential MV and a mode for not encoding the differential motion vector. The modes for not encoding the differential MV include the merge mode, the FRUC mode, and the affine mode (specifically, the affine merge mode). The details of these modes will be described later, but briefly, the merge mode is a mode for deriving the MV of the current block by selecting a motion vector from the surrounding encoded blocks, and the FRUC mode is a mode for deriving the MV of the current block by performing a search between the encoded regions. Also, the affine mode is a mode for deriving the motion vector of each of the multiple sub-blocks constituting the current block as the MV of the current block assuming an affine transformation.

[0198] Specifically, as shown in the figure, when the inter-prediction mode information indicates 0 (0 in Sf_1), the inter-prediction unit 126 derives a motion vector in the merge mode (Sf_2). Also, when the inter-prediction mode information indicates 1 (1 in Sf_1), the inter-prediction unit 126 derives a motion vector in the FRUC mode (Sf_3). Further, when the inter-prediction mode information indicates 2 (2 in Sf_1), the inter-prediction unit 126 derives a motion vector in the affine mode (specifically, the affine merge mode) (Sf_4). Also, when the inter-prediction mode information indicates 3 (3 in Sf_1), the inter-prediction unit 126 derives a motion vector in the mode of encoding the differential MV (for example, the normal inter mode) (Sf_5).

[0199] [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 area of the reference picture indicated by the candidate MV. Also, in this normal inter mode, the differential MV is encoded.

[0200] FIG. 19 is a flowchart showing an example of inter-prediction by the normal inter mode.

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

[0202] Next, the inter-prediction unit 126 extracts each of N (N is an integer of 2 or more) candidate MVs from the plurality of candidate MVs obtained in step Sg_1 as a prediction motion vector candidate (also referred to as a prediction MV candidate) 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.

[0203] Next, the inter prediction unit 126 selects one candidate prediction motion vector from among the N candidate prediction motion vectors 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 prediction motion vector selection information for identifying the selected prediction motion vector into the stream. Note that the stream is the encoded signal or encoded bit stream described above.

[0204] 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 the difference value between the derived MV and the prediction motion vector as the differential MV into the stream. Note that the encoded reference picture is a picture composed of a plurality of blocks reconstructed after encoding.

[0205] 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). Note that the predicted image is the inter prediction signal described above.

[0206] In addition, information indicating the inter prediction mode (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.

[0207] Note that the candidate MV list may be used in common with 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 candidate MVs, or deletion of candidate MVs.

[0208] [MV Derivation > Merge Mode] The merge mode is an inter prediction mode that derives an MV by selecting a candidate MV from the candidate MV list as the MV of the current block.

[0209] FIG. 20 is a flowchart showing an example of inter prediction by the merge mode.

[0210] 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 Sh_1). That is, the inter prediction unit 126 creates a candidate MV list.

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

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

[0213] Also, information indicating the inter prediction mode (merge 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.

[0214] FIG. 21 is a conceptual diagram for explaining an example of the motion vector derivation process of the current picture by the merge mode.

[0215] First, a prediction MV list in which candidates for the predicted MV are registered is generated. As candidates for the predicted MV, there are a spatial adjacent prediction MV which is the MV of a plurality of encoded blocks spatially adjacent to the target block, a temporal adjacent prediction MV which is the MV of a neighboring block obtained by projecting the position of the target block in the encoded reference picture, a combined prediction MV which is an MV generated by combining the MV values of the spatial adjacent prediction MV and the temporal adjacent prediction MV, and a zero prediction MV which is an MV with a value of zero, etc.

[0216] Next, one predicted MV is selected from among the plurality of predicted MVs registered in the prediction MV list, and thus determined as the MV of the target block.

[0217] Furthermore, in the variable length encoding section, merge_idx, which is a signal indicating which predicted MV is selected, is described in the stream and encoded.

[0218] Note that the predicted MVs registered in the prediction MV list described in FIG. 21 are just examples, and there may be a different number from the number in the figure, a configuration that does not include some of the types of predicted MVs in the figure, or a configuration in which predicted MVs other than the types of predicted MVs in the figure are added.

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

[0220] Note that the candidates for the predicted MV are the above-described candidate MVs, and the prediction MV list is the above-described candidate MV list. Also, the candidate MV list may be referred to as the candidate list. Also, merge_idx is MV selection information.

[0221] [MV Derivation > FRUC Mode] Motion information may be derived on the decoder side without being signaled from the encoder side. Note that, as described above, the merge mode defined in the H.265 / HEVC standard may be used. Also, for example, motion information may be derived by performing motion search on the decoder side. In the embodiment, on the decoder side, motion search is performed without using the pixel values of the current block.

[0222] Here, a mode in which motion search is performed on the decoder side will be described. This mode in which motion search is performed on the decoder side may be referred to as the PMMVD (pattern matched motion vector derivation) mode or the FRUC (frame rate up-conversion) mode.

[0223] An example of FRUC processing is shown in Fig. 22 in the form of a flowchart. First, by referring to the motion vectors of the encoded blocks that are spatially or temporally adjacent to the current block, a list of a plurality of candidates each having a predicted motion vector (i.e., a candidate MV list, which may be common with the merge list) is generated (step Si_1). Next, the best candidate MV is selected from among the plurality of candidate MVs registered in the candidate MV list (step Si_2). For example, the evaluation value of 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 motion vector of the selected candidate, a motion vector for the current block is derived (step Si_4). Specifically, for example, the motion vector of the selected candidate (the best candidate MV) is directly derived as the motion vector for the current block. Also, for example, in the peripheral region of the position in the reference picture corresponding to the motion vector of the selected candidate, by performing pattern matching, a motion vector for the current block may be derived. That is, for the region around the best candidate MV, search using pattern matching and evaluation value in the reference picture is performed, and if there is an MV with a better evaluation value, the best candidate MV is updated to the MV, and it may be used as the final MV of the current block. It is also possible to adopt a configuration in which the process of updating to an MV having a better evaluation value is not performed.

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

[0225] When processing is performed in units of sub-blocks, the same processing may be used.

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

[0227] Then, the difference between the pixel values of the two reconstructed images may be calculated and used as the evaluation value of the motion vector. In addition to the difference value, other information may be used to calculate the evaluation value.

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

[0229] [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 above-described candidate, the region in another reference picture along the motion trajectory of the current block is used. The predetermined region may be determined in advance.

[0230] FIG. 23 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. 23, in the first pattern matching, two motion vectors (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. It is possible to select the candidate MV with the best evaluation value among a plurality of candidate MVs as the final MV, which can bring good results.

[0231] Under the assumption of a continuous motion trajectory, the motion vectors (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 motion vectors are derived.

[0232] [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 block)) 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 the predetermined region for calculating the evaluation value of the above-described candidate.

[0233] FIG. 24 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. 24, in the second pattern matching, the motion vector of the current block is derived by searching in the reference picture (Ref0) for the block that most closely matches the block adjacent to the current block (Cur block) within 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 adjacent 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, an evaluation value is calculated using the obtained difference value, and it is possible to select, as the best candidate MV, the candidate MV having the best evaluation value among a plurality of candidate MVs.

[0234] 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 need not be 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).

[0235] [MV Derivation > Affine Mode] Next, the affine mode for deriving a motion vector in sub-block units based on the motion vectors of a plurality of adjacent blocks will be described. This mode may be called an affine motion compensation prediction mode.

[0236] FIG. 25A is a conceptual diagram for explaining an example of derivation of a motion vector for each sub-block based on motion vectors of a plurality of adjacent blocks. In FIG. 25A, a current block includes 16 4x4 sub-blocks. Here, a motion vector v0 of the upper left control point of the current block is derived based on the motion vectors of adjacent blocks. Similarly, a motion vector v1 of the upper right control point of the current block is derived based on the motion vectors of adjacent sub-blocks. Then, the two motion vectors v0 and v1 may be projected by the following equation (1A), and the motion vectors (v x , v y ) of each sub-block within the current block may be derived.

[0237] [Number]

[0238] Here, x and y indicate the horizontal position and vertical position of the sub-block, respectively, and w indicates a predetermined weight coefficient. The predetermined weight coefficient may be determined in advance.

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

[0240] Also, such an affine mode may include several modes in which the methods for deriving the motion vectors 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.

[0241] [MV Derivation > Affine Mode] FIG. 25B is a conceptual diagram for explaining an example of deriving motion vectors of sub-block units in affine mode having three control points. In FIG. 25B, the current block includes 16 4x4 sub-blocks. Here, the motion vector v0 of the upper left control point of the current block is derived based on the motion vectors of adjacent blocks. Similarly, the motion vector v1 of the upper right control point of the current block is derived based on the motion vectors of adjacent blocks, and the motion vector v2 of the lower left control point of the current block is derived based on the motion vectors of adjacent blocks. Then, the three motion vectors v0, v1, and v2 may be projected by the following equation (1B), and the motion vectors (v x , v y ) of each sub-block within the current block may be derived.

[0242] [Number]

[0243] Here, x and y indicate the horizontal position and vertical position of the sub-block center, respectively, w indicates the width of the current block, and h indicates the height of the current block.

[0244] The affine modes with different numbers of control points (e.g., two and three) may be switched and signaled at the CU level. Note that information indicating the number of control points of the affine mode used at the CU level may be signaled at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or sub-block level).

[0245] Also, in such an affine mode having three control points, it may include several modes with different methods for deriving the motion vectors of the upper left, upper right, and lower left control points. For example, the affine mode includes two modes: the affine inter (also referred to as affine normal inter) mode and the affine merge mode.

[0246] [MV Derivation > Affine Merge Mode] FIG. 26A, FIG. 26B, and FIG. 26C are conceptual diagrams for explaining the affine merge mode.

[0247] In the affine merge mode, as shown in FIG. 26A, for example, among the encoded blocks A (left), block B (upper), block C (upper right), block D (lower left), and block E (upper left) adjacent to the current block, a plurality of motion vectors corresponding to the blocks encoded in the affine mode are used. Based on these motion vectors, the predicted motion vectors of the respective control points of the current block are calculated. Specifically, these blocks are inspected 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), and the first valid block encoded in the affine mode is identified. Based on the plurality of motion vectors corresponding to this identified block, the predicted motion vectors of the control points of the current block are calculated.

[0248] For example, as shown in FIG. 26B, when the block A adjacent to the left of the current block is encoded in the affine mode having two control points, the motion vectors v3 and v4 projected onto the upper left and upper right corner positions of the encoded block including the block A are derived. Then, from the derived motion vectors v3 and v4, the predicted motion vector v0 of the control point at the upper left corner of the current block and the predicted motion vector v1 of the control point at the upper right corner are calculated.

[0249] For example, as shown in FIG. 26C, when the block A adjacent to the left of the current block is encoded in the affine mode having three control points, the motion vectors v3, v4, and v5 projected onto the upper left, upper right, and lower left corner positions of the encoded block including the block A are derived. Then, from the derived motion vectors v3, v4, and v5, the predicted motion vector v0 of the control point at the upper left corner of the current block, the predicted motion vector v1 of the control point at the upper right corner, and the predicted motion vector v2 of the control point at the lower left corner are calculated.

[0250] Note that this predicted motion vector derivation method may also be used to derive the respective predicted motion vectors of the control points of the current block in step Sj_1 of FIG. 29 described later.

[0251] FIG. 27 is a flowchart showing an example of the affine merge mode.

[0252] In the affine merge mode, as shown in the figure, first, the inter prediction unit 126 derives the respective predicted MVs of the control points of the current block (step Sk_1). As shown in FIG. 25A, the control points are the upper left and upper right points of the current block, or as shown in FIG. 25B, the upper left, upper right, and lower left points of the current block.

[0253] That is, as shown in FIG. 26A, 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), and identifies the first valid block encoded in the affine mode.

[0254] When block A is identified and block A has two control points, as shown in FIG. 26B, the inter prediction unit 126 calculates the motion vector v0 of the control point at the upper left corner of the current block and the motion vector v1 of the control point at the upper right corner from the motion vectors v3 and v4 at the upper left and upper right corners of the encoded block including block A. For example, the inter prediction unit 126 projects the motion vectors v3 and v4 at the upper left and upper right corners of the encoded block onto the current block to calculate the predicted motion vector v0 of the control point at the upper left corner of the current block and the predicted motion vector v1 of the control point at the upper right corner.

[0255] Alternatively, when block A is specified and block A has three control points, as shown in FIG. 26C, the inter prediction unit 126 calculates the motion vectors v0, v1, and v2 of the control points at the upper left corner, upper right corner, and lower left corner of the current block from the motion vectors v3, v4, and v5 at the upper left corner, upper right corner, and 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 at the upper left corner, upper right corner, and lower left corner of the encoded block onto the current block to calculate the predicted motion vector v0 of the control point at the upper left corner of the current block, the predicted motion vector v1 of the control point at the upper right corner, and the motion vector v2 of the control point at the lower left corner.

[0256] Next, the inter prediction unit 126 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 126 calculates the motion vector of the sub - block as an affine MV using two prediction motion vectors v0 and v1 and the above - mentioned formula (1A), or three prediction motion vectors v0, v1, and v2 and the above - mentioned formula (1B) (step Sk_2). Then, the inter prediction unit 126 performs motion compensation on the sub - block using those affine MVs and the encoded reference picture (step Sk_3). As a result, motion compensation is performed on the current block, and a predicted image of the current block is generated.

[0257] [MV Derivation > Affine Inter Mode] FIG. 28A is a conceptual diagram for explaining the affine inter mode having two control points.

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

[0259] FIG. 28B is a conceptual diagram for explaining the affine interpolation mode having three control points.

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

[0261] FIG. 29 is a flowchart showing an example of the affine interpolation mode.

[0262] As shown in the figure, in the affine interpolation mode, first, the inter prediction unit 126 derives the respective predicted MVs (v0, v1) or (v0, v1, v2) of two or three control points of the current block (step Sj_1). The control points are the points at the upper left corner, upper right corner, or lower left corner of the current block, as shown in FIG. 25A or FIG. 25B.

[0263] That is, the inter prediction unit 126 derives the predicted motion vectors (v0, v1) or (v0, v1, v2) of the control points of the current block by selecting the motion vector of any one of the encoded blocks near each control point of the current block shown in FIG. 28A or FIG. 28B. At this time, the inter prediction unit 126 encodes the prediction motion vector selection information for identifying the two selected motion vectors into the stream.

[0264] For example, the inter prediction unit 126 may use cost evaluation or the like to determine which block's motion vector to select as the predicted motion vector of the control point from the encoded blocks adjacent to the current block, and describe a flag indicating which predicted motion vector is selected in the bit stream.

[0265] Next, the inter prediction unit 126 performs motion search (steps Sj_3 and Sj_4) while updating the predicted motion vectors selected or derived in step Sj_1 (step Sj_2). That is, the inter prediction unit 126 calculates the motion vectors of the respective sub-blocks corresponding to the updated predicted motion vectors as affine MVs 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). As a result, the inter prediction unit 126 determines, for example, the predicted motion vector that obtains the smallest cost as the motion vector 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 each predicted motion vector into the stream as a differential MV.

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

[0267] [MV Derivation > Affine Inter Mode] When signaling by switching the affine mode with different numbers of control points (for example, two and three) at the CU level, the number of control points may be different between the encoded block and the current block. FIGS. 30A and 30B are conceptual diagrams for explaining a method of deriving a prediction vector of control points when the number of control points is different between the encoded block and the current block.

[0268] For example, as shown in FIG. 30A, when 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 the affine mode with two control points, 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, a predicted motion vector v0 of the control point at the upper left corner of the current block and a predicted motion vector v1 of the control point at the upper right corner are calculated. Further, from the derived motion vectors v0 and v1, a predicted motion vector v2 of the control point at the lower left corner is calculated.

[0269] For example, as shown in FIG. 30B, when 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 the affine mode with three control points, 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, a predicted motion vector v0 of the control point at the upper left corner of the current block and a predicted motion vector v1 of the control point at the upper right corner are calculated.

[0270] This prediction motion vector derivation method may be used to derive each predicted motion vector of the control points of the current block in step Sj_1 of FIG. 29.

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

[0272] The inter prediction unit 126 derives the motion vector of the current block in the merge mode (step Sl_1). Next, the inter prediction unit 126 determines whether to perform motion vector 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 motion vector derived in step Sl_1 as the final motion vector for the current block (step Sl_4). That is, in this case, the motion vector of the current block is determined in the merge mode.

[0273] 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 motion vector for the current block by searching the peripheral area of the reference picture indicated by the motion vector derived in step Sl_1 (step Sl_3). That is, in this case, the motion vector of the current block is determined by DMVR.

[0274] FIG. 31B is a conceptual diagram for explaining an example of DMVR processing for determining an MV.

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

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

[0277] Note that typically, in the encoding device and the decoding device described later, the configuration and operation of the processing described here are basically common.

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

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

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

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

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

[0283] The inter prediction unit 126 determines the motion vector of the current block (step Sn_1). Next, the inter prediction unit 126 generates a prediction image (step Sn_2) and determines whether to perform correction processing (step Sn_3). Here, when the inter prediction unit 126 determines to perform correction processing (Yes in step Sn_3), it generates a final prediction image by correcting the prediction image (step Sn_4). On the other hand, when the inter prediction unit 126 determines not to perform correction processing (No in step Sn_3), it outputs the prediction image as the final prediction image without correction (step Sn_5).

[0284] Also, in motion compensation, there is a mode of correcting luminance when generating a prediction image. That mode is, for example, LIC described later.

[0285] Figure 34 is a flowchart showing another example of generating a prediction image.

[0286] The inter prediction unit 126 derives the motion vector of the current block (step So_1). Next, the inter prediction unit 126 determines whether to perform luminance correction processing (step So_2). Here, when the inter prediction unit 126 determines to perform luminance correction processing (Yes in step So_2), it generates a prediction image while performing luminance correction (step So_3). That is, the prediction image is generated by LIC. On the other hand, when the inter prediction unit 126 determines not to perform luminance correction processing (No in step So_2), it generates a prediction image by normal motion compensation without performing luminance correction (step So_4).

[0287] [Motion Compensation > OBMC] An inter prediction signal may be generated using not only the motion information of the current block obtained by motion search but also the motion information of adjacent blocks. Specifically, a prediction signal based on the motion information obtained by motion search (in the reference picture) and a prediction signal based on the motion information of adjacent blocks (in the current picture) may be weighted and added to generate an inter prediction signal in units of sub-blocks within the current block. Such inter prediction (motion compensation) is sometimes called OBMC (overlapped block motion compensation).

[0288] In the OBMC mode, information indicating the size of sub-blocks for OBMC (for example, called OBMC block size) may be signaled at the sequence level. Further, information indicating whether to apply the OBMC mode (for example, called 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, picture level, slice level, tile level, CTU level, or sub-block level).

[0289] An example of the OBMC mode will be described more specifically. FIGS. 35 and 36 are a flowchart and a conceptual diagram for explaining the outline of the prediction image correction process by OBMC processing.

[0290] First, as shown in FIG. 36, a predicted image (Pred) by normal motion compensation is obtained using the motion vector (MV) assigned to the processing target (current) block. In FIG. 36, the arrow “MV” points to the reference picture and indicates what the current block of the current picture refers to in order to obtain the predicted image.

[0291] Next, the motion vector (MV_L) already derived for the encoded left adjacent block is applied (reused) to the block to be encoded to obtain a predicted image (Pred_L). The motion vector (MV_L) is indicated by an 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.

[0292] Similarly, the motion vector (MV_U) already derived for the encoded upper adjacent block is applied (reused) to the block to be encoded to obtain a predicted image (Pred_U). The motion vector (MV_U) is indicated by an arrow "MV_U" pointing from the current block to the reference picture. Then, the 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 with the boundaries mixed (smoothed) with adjacent blocks.

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

[0294] Note that the region for superimposition may be only a partial region near the block boundary, rather than the entire pixel region of the block.

[0295] 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 of the reference pictures, the final prediction image is obtained by further superimposing the plurality of obtained corrected prediction images.

[0296] Note that in OBMC, the unit of the target block may be a prediction block unit or a sub-block unit obtained by further dividing the prediction block.

[0297] As a method for determining whether to apply the OBMC process, for example, there is a method using an obmc_flag which is a signal indicating whether to apply the OBMC process. As a specific example, the encoding device may determine whether the target block belongs to a region with complex motion. When the target block belongs to a region with complex motion, the encoding device sets the value 1 as the obmc_flag and applies the OBMC process for encoding. When the target block does not belong to a region with complex motion, the encoding device sets the value 0 as the obmc_flag and performs block encoding without applying the OBMC process. On the other hand, in the decoding device, by decoding the obmc_flag described in the stream (for example, the compressed sequence), the decoding is performed by switching whether to apply the OBMC process according to the value.

[0298] In the above example, the inter prediction unit 126 generates one rectangular prediction image for the rectangular current block. However, the inter prediction unit 126 may generate a plurality of prediction images with shapes different from the rectangle for the rectangular current block, and generate the final rectangular prediction image by combining the plurality of prediction images. The shape different from the rectangle may be, for example, a triangle.

[0299] FIG. 37 is a conceptual diagram for explaining the generation of predicted images of two triangles.

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

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

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

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

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

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

[0306] At this time, under the assumption of uniform linear motion of the velocity vector (vx, vy), (MVx0, MVy0) and (MVx1, MVy1) are respectively represented as (vxτ0, vyτ0) and (-vxτ1, -vyτ1), and the following optical flow equation (2) may be adopted.

[0307]

Equation

[0308] Here, I(k) indicates the luminance value of the reference image 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 merge list or the like may be corrected in pixel units.

[0309] Note that the motion vector may be derived on the decoder 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 sub-block units based on the motion vectors of a plurality of adjacent blocks.

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

[0311] FIG. 39 is a conceptual diagram for explaining an example of a method for generating a predicted image using luminance correction processing by LIC processing.

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

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

[0314] By performing a luminance correction process of applying the luminance correction parameter to the reference image in the reference picture specified by the MV, a predicted image for the current block is generated.

[0315] Note that the shape of the peripheral reference region in FIG. 39 is an example, and other shapes may be used.

[0316] Also, although the process of generating a predicted image from one reference picture has been described here, the same applies when generating a predicted image from a plurality of reference pictures. The reference images obtained from each reference picture may be subjected to luminance correction processing in the same manner as described above, and then a predicted image may be generated.

[0317] As a method for determining whether to apply LIC processing, for example, there is a method of using lic_flag, which is a signal indicating whether to apply LIC processing. As a specific example, in an encoding device, 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, a value 1 is set as lic_flag and LIC processing is applied for encoding. If it does not belong to an area where a luminance change has occurred, a value 0 is set as lic_flag and encoding is performed without applying LIC processing. On the other hand, in a decoding device, by decoding lic_flag described in the stream, decoding may be performed by switching whether to apply LIC processing according to the value thereof.

[0318] As another method for determining whether to apply LIC processing, for example, there is also a method of determining according to whether LIC processing has been applied to surrounding blocks. As a specific example, when the current block is in merge mode, it is determined whether the encoded block around selected when deriving the MV in the merge mode processing has been encoded with LIC processing applied. Encoding is performed by switching whether to apply LIC processing according to the result. Note that even in this example, the same processing is applied to the processing on the decoder side.

[0319] Although the mode of LIC processing (luminance correction processing) has been described with reference to FIG. 39, the details will be described below.

[0320] First, the inter prediction unit 126 derives a motion vector for obtaining a reference image corresponding to the encoding target block from a reference picture that is an encoded picture.

[0321] Next, the inter prediction unit 126 extracts information indicating how the luminance value changes between the reference picture and the block to be coded using the luminance pixel values of the left and upper adjacent coded peripheral reference regions for the block to be coded and the luminance pixel values at the equivalent positions in the reference picture specified by the motion vector, and calculates a luminance correction parameter. For example, let the luminance pixel value of a certain pixel in the peripheral reference region within the picture to be coded be p0, and let 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.

[0322] Next, the inter prediction unit 126 generates a prediction picture for the block to be coded by performing luminance correction processing on the reference picture in the reference picture specified by the motion vector using the luminance correction parameter. For example, let the luminance pixel value in the reference picture be p2, and let the luminance pixel value of the prediction picture after the luminance correction processing be p3. The inter prediction unit 126 generates a prediction picture after the luminance correction processing by calculating A×p2 + B = p3 for each pixel in the reference picture.

[0323] Note that the shape of the peripheral reference region in FIG. 39 is an example, and other shapes may be used. Also, a part of the peripheral reference region shown in FIG. 39 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 block to be coded, and may be a region not adjacent to the block to be coded. The predetermined number regarding the pixels may be determined in advance.

[0324] Also, in the example shown in FIG. 39, the peripheral reference region in the reference picture is the region specified by the motion vector of the picture to be coded from the peripheral reference region in the picture to be coded, but it may be the region specified by another motion vector. For example, the other motion vector may be the motion vector of the peripheral reference region in the picture to be coded.

[0325] Here, the operation of the encoding device 100 has been described. However, the operation of the decoding device 200 is typically the same.

[0326] Note that the LIC process 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.

[0327] Also, the LIC process may be applied in sub-block units. For example, correction parameters may be derived using the peripheral reference region of the current sub-block and the peripheral reference region of the reference sub-block in the reference picture specified by the MV of the current sub-block.

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

[0329] As shown in FIG. 1, in various examples of an encoding apparatus, the prediction control unit 128 may output prediction parameters input to the entropy encoding unit 110. The entropy encoding unit 110 may generate an encoded bit stream (or sequence) based on the prediction parameters input from the prediction control unit 128 and the quantization coefficients input from the quantization unit 108. The prediction parameters may be used in a decoding apparatus. The decoding apparatus may receive and decode the encoded bit 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 a selection prediction signal (e.g., a motion vector, 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.

[0330] [Implementation Example of Encoding Apparatus] FIG. 40 is a block diagram showing an implementation example of the encoding apparatus 100. The encoding apparatus 100 includes a processor a1 and a memory a2. For example, a plurality of components of the encoding apparatus 100 shown in FIG. 1 are implemented by the processor a1 and the memory a2 shown in FIG. 40.

[0331] The processor a1 is a circuit that performs information processing and is a circuit that can access the memory a2. For example, the processor a1 is a dedicated or general-purpose electronic circuit that encodes moving images. The processor a1 may be a processor such as a CPU. Also, the processor a1 may be an aggregate of a plurality of electronic circuits. Also, for example, the processor a1 may play the roles of a plurality of components among the plurality of components of the encoding apparatus 100 shown in FIG. 1 and the like.

[0332] Memory a2 is a dedicated or general-purpose memory that stores information for the processor a1 to encode a moving image. 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 a plurality of electronic circuits. Also, memory a2 may be a magnetic disk, an optical disk, etc., or may be expressed as a storage or a recording medium, etc. Also, memory a2 may be a non-volatile memory or a volatile memory.

[0333] For example, memory a2 may store the moving image to be encoded, or may store the bit string corresponding to the encoded moving image. Also, a program for the processor a1 to encode a moving image may be stored in memory a2.

[0334] Also, for example, memory a2 may serve as a component for storing information among the plurality of components of the encoding device 100 shown in FIG. 1 etc. For example, memory a2 may serve as the block memory 118 and the frame memory 122 shown in FIG. 1. More specifically, memory a2 may store the reconstructed blocks, the reconstructed pictures, etc.

[0335] Note that in the encoding device 100, not all of the plurality of components shown in FIG. 1 etc. need to be implemented, and not all of the plurality of processes described above need to be performed. A part of the plurality of components shown in FIG. 1 etc. may be included in another device, and a part of the plurality of processes described above may be executed by another device.

[0336] [Decoder device] Next, for example, a decoder device capable of decoding the encoded signal (encoded bit stream) output from the above encoding device 100 will be described. FIG. 41 is a block diagram showing the functional configuration of the decoder device 200 according to the embodiment. The decoder device 200 is a moving image decoder device that decodes a moving image in block units.

[0337] As shown in FIG. 41, the decoding apparatus 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transformation 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, and a prediction control unit 220.

[0338] The decoding apparatus 200 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 entropy decoding unit 202, the inverse quantization unit 204, the inverse transformation unit 206, the addition unit 208, the loop filter unit 212, the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. Further, the decoding apparatus 200 may be realized as one or more dedicated electronic circuits corresponding to the entropy decoding unit 202, the inverse quantization unit 204, the inverse transformation unit 206, the addition unit 208, the loop filter unit 212, the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220.

[0339] First, after explaining the overall processing flow of the decoding apparatus 200, each component included in the decoding apparatus 200 will be described.

[0340] [Overall Flow of Decoding Process] FIG. 42 is a flowchart showing an example of the overall decoding process by the decoding apparatus 200.

[0341] First, the entropy decoding unit 202 of the decoding apparatus 200 identifies a division pattern of a block of a fixed size (for example, 128×128 pixels) (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 on each of the plurality of blocks constituting the division pattern.

[0342] That is, the entropy decoding unit 202 decodes (specifically, entropy decodes) the encoded quantization coefficients and prediction parameters of the block to be decoded (also referred to as the current block) (step Sp_2).

[0343] Next, the inverse quantization unit 204 and the inverse transform unit 206 restore a plurality of prediction residuals (i.e., difference blocks) by performing inverse quantization and inverse transform on the plurality of quantization coefficients (step Sp_3).

[0344] Next, a prediction processing unit composed of all or part of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 generates a prediction signal (also referred to as a prediction block) of the current block (step Sp_4).

[0345] 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 block to the difference block (step Sp_5).

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

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

[0348] As shown in the figure, the processing of steps Sp_1 to Sp_7 is sequentially performed by the decoding device 200. Alternatively, a plurality of some of these processes may be performed in parallel, or the order may be changed, etc.

[0349] [Entropy Decoding Unit] The entropy decoding unit 202 entropy-decodes the encoded bit stream. Specifically, the entropy decoding unit 202, for example, arithmetically decodes the encoded bit stream into a binary signal. Then, the entropy decoding unit 202 de-binarizes the binary signal. 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 encoded bit stream (see FIG. 1) to the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 in the embodiment. The intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 can execute the same prediction processing as that performed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 on the encoding device side.

[0350] [Inverse Quantization Unit] The inverse quantization unit 204 inverse-quantizes the quantization coefficients of the block to be decoded (hereinafter referred to as the current block), which is the input from the entropy decoding unit 202. Specifically, for each quantization coefficient of the current block, the inverse quantization unit 204 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.

[0351] [Inverse Transform Unit] The inverse transform unit 206 restores the prediction error by inverse-transforming the transform coefficients that are the input from the inverse quantization unit 204.

[0352] For example, when the information decoded from the encoded bit 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 transform coefficients of the current block based on the information indicating the decoded transform type.

[0353] Also, for example, when the information decoded from the encoded bit stream indicates that NSST is to be applied, the inverse transform unit 206 applies inverse-retransformation to the transform coefficients.

[0354] [Addition unit] The addition unit 208 reconstructs the current block by adding the prediction error, which is the input from the inverse conversion unit 206, and the prediction sample, which is the input from the prediction control unit 220. Then, the addition unit 208 outputs the reconstructed block to the block memory 210 and the loop filter unit 212.

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

[0356] [Loop filter unit] The loop filter unit 212 applies a loop filter to the block reconstructed by the addition unit 208 and outputs the filtered reconstructed block to the frame memory 214 and a display device or the like.

[0357] When the information indicating the on / off of the ALF read from the encoded bitstream 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 block.

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

[0359] [Prediction processing unit (intra prediction unit, inter prediction unit, prediction control unit)] FIG. 43 is a flowchart showing an example of the processing performed by the prediction processing unit of the decoding apparatus 200. The prediction processing unit includes all or some of the components of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220.

[0360] The prediction processing unit generates a predicted image of the current block (step Sq_1). This predicted 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 processing unit generates a predicted image of the current block using the reconstructed image already obtained by performing generation of a prediction block, generation of a difference block, generation of a coefficient block, restoration of the difference block, and generation of a decoded image block.

[0361] The reconstructed image may be, for example, an image of a reference picture, or may be an image of a decoded block in the current picture that is the picture including the current block. The decoded block in the current picture is, for example, an adjacent block of the current block.

[0362] FIG. 44 is a flowchart showing another example of the processing performed by the prediction processing unit of the decoding apparatus 200.

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

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

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

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

[0367] In addition, when an intra prediction mode that refers to a luminance block is selected in the intra prediction of a chrominance difference block, the intra prediction unit 216 may predict the chrominance difference component of the current block based on the luminance component of the current block.

[0368] Also, when the information decoded from the encoded bitstream indicates the application of PDPC, the intra prediction unit 216 corrects the pixel value after intra prediction based on the gradient of the reference pixels in the horizontal / vertical direction.

[0369] [Inter Prediction Unit] The inter prediction unit 218 predicts the current block by referring to the reference picture stored in the frame memory 214. The prediction is performed in units of the current block or sub-blocks (e.g., 4x4 blocks) within the current block. For example, the inter prediction unit 218 generates an inter prediction signal for the current block or sub-block by performing motion compensation using motion information (e.g., motion vectors) decoded from the coded bit stream (e.g., prediction parameters output from the entropy decoding unit 202), and outputs the inter prediction signal to the prediction control unit 220.

[0370] When the information decoded from the coded bit stream indicates that the OBMC mode is to be applied, the inter prediction unit 218 generates an inter prediction signal using not only the motion information of the current block obtained by motion search but also the motion information of adjacent blocks.

[0371] Also, when the information decoded from the coded bit 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 coded stream. Then, the inter prediction unit 218 performs motion compensation (prediction) using the derived motion information.

[0372] Also, the inter prediction unit 218 derives a motion vector based on a model assuming uniform linear motion when the BIO mode is applied. Also, when the information decoded from the coded bit stream indicates that the affine motion compensation prediction mode is to be applied, the inter prediction unit 218 derives a motion vector in units of sub-blocks based on the motion vectors of a plurality of adjacent blocks.

[0373] [MV Derivation > Normal Inter Mode] When the information decoded from the symbolized bitstream indicates that the normal inter mode is to be applied, the inter prediction unit 218 derives an MV based on the information decoded from the coded stream and performs motion compensation (prediction) using the MV.

[0374] FIG. 45 is a flowchart showing an example of inter prediction in the normal inter mode in the decoding apparatus 200.

[0375] The inter prediction unit 218 of the decoding apparatus 200 performs motion compensation for each block. The inter prediction unit 218 acquires 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 Ss_1). That is, the inter prediction unit 218 creates a candidate MV list.

[0376] 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 acquired in step Ss_1 as a prediction motion vector candidate (also referred to as a prediction MV candidate) according to a predetermined priority order (step Ss_2). Note that the priority order may be determined in advance for each of the N prediction MV candidates.

[0377] Next, the inter prediction unit 218 decodes prediction motion vector selection information from the input stream (i.e., the symbolized bitstream), and uses the decoded prediction motion vector selection information to select one prediction MV candidate from the N prediction MV candidates as the prediction motion vector (also referred to as the prediction MV) of the current block (step Ss_3).

[0378] 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 difference value, which is the decoded differential MV, to the selected prediction motion vector (step Ss_4).

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

[0380] [Prediction control unit] The prediction control unit 220 selects either the intra prediction signal or the inter prediction signal, and outputs the selected signal as a prediction signal to the addition unit 208. Overall, the configuration, function, and processing of the prediction control unit 220, the intra prediction unit 216, and the inter prediction unit 218 on the decoder side may correspond to the configuration, function, and processing of the prediction control unit 128, the intra prediction unit 124, and the inter prediction unit 126 on the encoder side.

[0381] [Implementation example of decoder] FIG. 46 is a block diagram showing an implementation example of the decoder 200. The decoder 200 includes a processor b1 and a memory b2. For example, a plurality of components of the decoder 200 shown in FIG. 41 are implemented by the processor b1 and the memory b2 shown in FIG. 46.

[0382] 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 an encoded moving image (i.e., an encoded bitstream). 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. Also, for example, the processor b1 may play the roles of a plurality of components among the plurality of components of the decoder 200 shown in FIG. 41 and the like.

[0383] Memory b2 is a dedicated or general-purpose memory in which information for the processor b1 to decode the encoded bitstream is stored. Memory b2 may be an electronic circuit and may be connected to processor b1. Also, memory b2 may be included in 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 recording medium, etc. Also, memory b2 may be a non-volatile memory or a volatile memory.

[0384] For example, a moving image or an encoded bitstream may be stored in memory b2. Also, a program for the processor b1 to decode the encoded bitstream may be stored in memory b2.

[0385] 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. 41 etc. Specifically, memory b2 may serve as the block memory 210 and the frame memory 214 shown in FIG. 41. More specifically, a reconstructed block, a reconstructed picture, etc. may be stored in memory b2.

[0386] Note that in the decoding device 200, not all of the plurality of components shown in FIG. 41 etc. need to be implemented, and not all of the plurality of processes described above need to be performed. A part of the plurality of components shown in FIG. 41 etc. may be included in another device, and a part of the plurality of processes described above may be executed by another device.

[0387] [Definitions of Terms] Each term may be defined as follows as an example.

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

[0389] A frame is a composition of a top field in which a plurality of sample rows 0, 2, 4,... occur, and a bottom field in which a plurality of sample rows 1, 3, 5,... occur.

[0390] A slice is an integer number of coded tree units included in one independent slice segment and all subsequent dependent slice segments (if any) preceding the next independent slice segment (if any) in the same access unit.

[0391] A tile is a rectangular area of a plurality of coded tree blocks in a specific tile column and a specific tile row in a picture. The tile may be a rectangular area of a frame that is still intended to be independently decoded and encoded, although a loop filter spanning the edges of the tile may still be applied.

[0392] A block is an MxN (N rows and M columns) array of a plurality of samples, or an MxN array of a plurality of transform coefficients. The block may be a square or rectangular area of a plurality of pixels consisting of a plurality of matrices of one luminance and two chrominances.

[0393] A CTU (Coded Tree Unit) may be a coded tree block of a plurality of luminance samples of a picture having three sample arrays, or two corresponding coded tree blocks of a plurality of chrominance samples. Alternatively, a CTU may be a coded tree block of a plurality of samples of either a monochrome picture or a picture encoded using a syntax structure used for encoding three separate color planes and a plurality of samples.

[0394] The superblock may constitute one or two mode information blocks, or may be a square block of 64×64 pixels that is recursively divided into four 32×32 blocks and can be further divided.

[0395] [First Mode of Coefficient Encoding] FIG. 47 is a flowchart showing a basic coefficient encoding method according to the first mode. Specifically, FIG. 47 represents a coefficient encoding method for a region where prediction residuals are obtained by intra encoding or inter encoding. In the following description, the operations performed by the encoding device 100 are shown. The decoding device 200 may perform operations corresponding to the operations performed by the encoding device 100. For example, the decoding device 200 may perform an inverse orthogonal transformation and decoding corresponding to the orthogonal transformation and encoding performed by the encoding device 100.

[0396] In FIG. 47, last_sig_coeff, subblock_flag, thres, and CCB are shown. last_sig_coeff is a parameter representing the coordinate position where a non-zero coefficient (non-zero coefficient) first appears when scanning within the block. subblock_flag is a flag indicating whether there is a non-zero coefficient in a 4x4 subblock (also referred to as 16 transform coefficient levels). subblock_flag is also expressed as coded_sub_block_flag, or subblock flag.

[0397] thres is a constant determined on a block-by-block basis. thres may be determined in advance. thres may have different values depending on the block size, or may have the same value regardless of the block size. thres may take different values depending on whether orthogonal transformation is applied or not. thres may be determined depending on the coordinate position determined in the block by last_sig_coeff.

[0398] CCB represents the number of bins encoded in the context mode of CABAC (Context-Adaptive Binary Arithmetic Coding). That is, CCB represents the number of times of the encoding process based on the context mode of CABAC. The context mode is also called the regular mode. Here, the encoding based on the context mode of CABAC is called CABAC encoding or context-adaptive encoding. Also, the encoding based on the bypass mode of CABAC is called bypass encoding. The process of bypass encoding is lighter than that of CABAC encoding.

[0399] CABAC encoding is a process of converting a sequence of bins obtained by binarizing a signal to be encoded into an encoded bit sequence based on the occurrence probabilities of 0 and 1 for each bin. Note that CCB may count the number of all flags used in residual coefficient encoding, or may count the number of some flags used in residual coefficient encoding. Bypass encoding is a process of encoding 1 bin in a sequence of bins as 1 bit of an encoded bit sequence without using the variable occurrence probabilities of 0 and 1 for each bin (in other words, using fixed probabilities).

[0400] For example, the encoding device 100 compares the CCB value with the thres value to determine the coefficient encoding method.

[0401] Specifically, in FIG. 47, first, CCB is initialized to 0 (S101). Then, it is determined whether orthogonal transformation is applied to the block (S102). If orthogonal transformation is applied to the block (Yes in S102), the encoding device 100 encodes last_sig_coeff (S131). Then, the encoding device 100 performs loop processing for each sub-block (S141 to S148).

[0402] In the loop process for each sub-block (S141 to S148), the encoding device 100 encodes the subblock_flag related to the sub-block. And when the subblock_flag is different from 0 (Yes in S146), the encoding device 100 encodes the 16 coefficients in the sub-block by the first encoding method described later (S147).

[0403] Also, when orthogonal transformation is not applied to the block (No in S102), the encoding device 100 performs loop processing for each sub-block (S121 to S128).

[0404] In the loop process for each sub-block (S121 to S128), the encoding device 100 determines whether the CCB is less than or equal to thres (S122). If the CCB is less than or equal to thres (Yes in S122), the encoding device 100 encodes the subblock_flag by CABAC encoding (S123). And the encoding device 100 increments the CCB (S124). Otherwise (No in S122), the encoding device 100 encodes the subblock_flag by bypass encoding (S125).

[0405] And when the subblock_flag is different from 0 (Yes in S126), the encoding device 100 encodes the 16 coefficients in the sub-block by the second encoding method described later (S127).

[0406] When orthogonal transformation is not applied to the block, for example, it may be the case where orthogonal transformation is skipped. The CCB is also used in the first encoding method and the second encoding method. The CCB may be initialized in units of sub-blocks. In that case, thres may be a value that changes for each sub-block instead of a fixed value for the block.

[0407] Here, the CCB is incremented from 0 and it is determined whether it has reached thres, but the CCB may be decremented from thres (or a specific value) and it is determined whether it has reached 0.

[0408] FIG. 48 is a flowchart showing details of the first encoding method shown in FIG. 47. In the first encoding method, a plurality of coefficients in a sub-block are encoded. At this time, the first loop process (S151 to S156) is performed for each coefficient information flag of each coefficient in the sub-block, and the second loop process (S161 to S165) is performed for each coefficient in the sub-block.

[0409] In the first loop process (S151 to S156), one or more coefficient information flags each indicating one or more attributes of a coefficient are sequentially encoded. The one or more coefficient information flags may include sig_flag, gt1_flag, parity_flag, and gt3_flag described later. Then, within a range where CCB does not exceed thres, the one or more coefficient information flags are sequentially encoded by CABAC encoding, and CCB is incremented by one each time encoding is performed. After CCB exceeds thres, the coefficient information flag is not encoded.

[0410] That is, in the first loop process (S151 to S156), the encoding device 100 determines whether CCB is less than or equal to thres (S152). And when CCB is less than or equal to thres (Yes in S152), the encoding device 100 encodes the coefficient information flag by CABAC encoding (S153). And the encoding device 100 increments CCB (S154). When CCB is not less than or equal to thres (No in S152), the encoding device 100 ends the first loop process (S151 to S156).

[0411] In the second loop process (S161 to S165), for the coefficient for which the coefficient information flag is encoded, remainder which is a residual value not represented by the coefficient information flag (that is, a residual value for reconstructing the value of the coefficient using the coefficient information flag) is encoded by Golomb-Rice encoding. Coefficients for which the coefficient information flag is not encoded are directly encoded by Golomb-Rice encoding. Note that remainder may be encoded using another encoding method instead of Golomb-Rice encoding.

[0412] That is, in the second loop process (S161 to S165), the encoding device 100 determines whether the coefficient information flag corresponding to the coefficient to be processed is encoded (S162). Then, when the coefficient information flag is encoded (Yes in S162), the encoding device 100 encodes the remainder by Golomb-Rice encoding (S163). When the coefficient information flag is not encoded (No in S162), the encoding device 100 encodes the value of the coefficient by Golomb-Rice encoding (S164).

[0413] Here, the number of loop processes is 2, but the number of loop processes may be different from 2.

[0414] The above-described sig_flag is a flag indicating whether AbsLevel is non-zero. AbsLevel is the value of the coefficient, and more specifically, the absolute value of the coefficient. The gt1_flag is a flag indicating whether AbsLevel is greater than 1. The parity_flag is a flag representing the first bit of AbsLevel and indicates whether AbsLevel is odd or even. The gt3_flag is a flag indicating whether AbsLevel is greater than 3.

[0415] The gt1_flag and gt3_flag may be expressed as abs_gt1_flag and abs_gt3_flag, respectively. Also, for example, as the above-described remainder, the value of (Abslevel - 4) / 2 may be encoded by Golomb-Rice encoding.

[0416] One or more other coefficient information flags different from the above one or more coefficient information flags may be encoded. For example, some of the coefficient information flags may not be encoded. The coefficient information flags included in the above one or more coefficient information flags may be replaced with coefficient information flags or parameters having other meanings.

[0417] FIG. 49 is a flowchart showing details of the second encoding method shown in FIG. 47. In the second encoding method, a plurality of coefficients in a sub-block are encoded. At this time, for each coefficient information flag of each coefficient in the sub-block, a first loop process (S171 to S176) is performed, and for each coefficient in the sub-block, a second loop process (S181 to S185) is performed.

[0418] In the first loop process (S171 to S176), one or more coefficient information flags each indicating one or more attributes of a coefficient are sequentially encoded. The one or more coefficient information flags may include sig_flag, sign_flag, gt1_flag, parity_flag, gt3_flag, gt5_flag, gt7_flag, and gt9_flag.

[0419] Here, sign_flag is a flag representing the positive or negative sign of a coefficient. gt5_flag is a flag representing whether AbsLevel is greater than 5. gt7_flag is a flag representing whether AbsLevel is greater than 7. gt9_flag is a flag representing whether AbsLevel is greater than 9. gt5_flag, gt7_flag, and gt9_flag may be expressed as abs_gt5_flag, abs_gt7_flag, and abs_gt9_flag, respectively. Also, flags representing whether AbsLevel is greater than x (x is an integer of 1 or more) may be collectively expressed as gtx_flag or abs_gtx_flag. AbsLevel is, for example, the absolute value of the transform coefficient level.

[0420] Note that one or more other coefficient information flags different from the one or more above-mentioned coefficient information flags may be encoded. For example, some of the coefficient information flags may not be encoded. The coefficient information flags included in the one or more above-mentioned coefficient information flags may be replaced with coefficient information flags or parameters having other meanings.

[0421] One or more of the above coefficient information flags are sequentially encoded by CABAC encoding. And each time encoding is performed, the CCB is incremented by one. After the CCB exceeds thres, the coefficient information flag is encoded by bypass encoding.

[0422] That is, in the first loop process (S171 to S176), the encoding device 100 determines whether the CCB is less than or equal to thres (S172). And when the CCB is less than or equal to thres (Yes in S172), the encoding device 100 encodes the coefficient information flag by CABAC encoding (S173). And the encoding device 100 increments the CCB (S174). When the CCB is not less than or equal to thres (No in S172), the encoding device 100 encodes the coefficient information flag by bypass encoding (S175).

[0423] Before and after the CCB exceeds thres, the syntax of the second loop process in FIG. 49 does not change. That is, whether the coefficient information flag is encoded by CABAC encoding or the coefficient information flag is encoded by bypass encoding, the same processing below is performed in the second loop process (S181 to S185).

[0424] Specifically, in the second loop process (S181 to S185), the encoding device 100 encodes a remainder (that is, a remainder for reconstructing the value of the coefficient using the coefficient information flag), which is a residual value not represented by the coefficient information flag, by Golomb-Rice encoding (S183). Note that instead of using Golomb-Rice encoding, the remainder may be encoded using another encoding method.

[0425] Here, the number of loop processes is 2, but the number of loop processes may be different from 2.

[0426] As shown in FIGS. 47, 48, and 49, in the basic operation of this embodiment, there are different flags regarding whether the application of orthogonal transformation is included in the limit of the number of CABAC encoding processes depending on whether there is an application of orthogonal transformation. Also, the syntax of coefficient encoding is different between the case where there is an application of orthogonal transformation and the case where there is no application of orthogonal transformation. As a result, it may be necessary to prepare separate circuits. Therefore, the circuit configuration may become complex.

[0427] [First Example of the First Aspect of Coefficient Encoding] FIG. 50 is a flowchart showing a coefficient encoding method according to the first example of the first aspect. In the example of FIG. 50, the post-processing of last_sig_coeff (S132) and the processing of subblock_flag (S142 to S145) are different from the example of FIG. 47.

[0428] In FIG. 47, when there is an application of orthogonal transformation, the CCB is incremented for sig_flag, parity_flag, and gtX_flag (X = 1, 3). In the example of FIG. 50, the CCB is also incremented for last_sig_coeff and subblock_flag. On the other hand, the processing flow when there is no application of orthogonal transformation is the same as the example of FIG. 47.

[0429] That is, in the example of FIG. 50, the encoding device 100 encodes last_sig_coeff (S131), and then adds the number of CABAC encoding processes in the encoding of last_sig_coeff to the CCB (S132).

[0430] Also, before encoding subblock_flag, the encoding device 100 determines whether CCB is less than or equal to thres (S142). And when CCB is less than or equal to thres (Yes in S142), the encoding device 100 encodes subblock_flag by CABAC encoding (S143). Then, the encoding device 100 adds 1 to CCB (S144). On the other hand, when CCB is not less than or equal to thres (No in S142), the encoding device 100 encodes subblock_flag by bypass encoding (S145).

[0431] [Effect of the first example of the first aspect of coefficient encoding] According to the example of FIG. 50, there may be a case where the processing flow of encoding subblock_flag can be shared and unified between the case where orthogonal transformation is performed and the case where it is not performed. Therefore, there is a possibility that some circuits may be shared between the case where orthogonal transformation is performed and the case where it is not performed, and the circuit scale may be reduced. As a result, a plurality of processing flows divided by the presence or absence of orthogonal transformation may become the same except for the presence or absence of last_sig_coeff.

[0432] For example, even if the number of times of CABAC encoding processing is limited at the block level, in the example of FIG. 47, after CCB reaches thres, subblock_flag is encoded by CABAC encoding. On the other hand, in the case of FIG. 50, after CCB reaches thres, subblock_flag is not encoded by CABAC encoding. Thereby, there is a possibility that the number of times of CABAC encoding processing is appropriately limited to thres.

[0433] Note that the number of times of CABAC encoding processing in last_sig_coeff may not be included in CCB. Also, thres may be determined depending on the coordinate position defined in the block by last_sig_coeff.

[0434] Further, the encoding device 100 may always determine that the value of subblock_flag is 1 after the CCB exceeds thres and then perform encoding. If it is determined that the value of subblock_flag is always 1 after the CCB exceeds thres, the encoding device 100 may not encode subblock_flag after the CCB exceeds thres.

[0435] Also, even when orthogonal transformation is not applied, the encoding device 100 may always determine that the value of subblock_flag is 1 after the CCB exceeds thres and then perform encoding. Also, in this case as well, if it is determined that the value of subblock_flag is always 1 after the CCB exceeds thres, the encoding device 100 may not encode subblock_flag after the CCB exceeds thres.

[0436] [Second Example of the First Aspect of Coefficient Encoding] FIG. 51 is a flowchart showing a coefficient encoding method according to the second example of the first aspect. In the example of FIG. 51, the processing (S123) of subblock_flag is different from the example of FIG. 47.

[0437] In FIG. 47, when orthogonal transformation is not applied, the CCB is incremented for sig_flag, parity_flag, gtX_flag (X = 1, 3, 5, 7, 9), and subblock_flag. In the example of FIG. 51, the CCB is not incremented for subblock_flag. On the other hand, the processing flow when orthogonal transformation is applied is the same as the example of FIG. 47.

[0438] That is, in the example of FIG. 51, the encoding device 100 always encodes subblock_flag by CABAC encoding without incrementing the CCB regardless of whether the CCB exceeds thres (S123).

[0439] [Effect of the Second Example of the First Aspect of Coefficient Encoding] According to the example of FIG. 51, there may be a case where the encoding process of subblock_flag can be made common and unified whether or not orthogonal transformation is performed. Therefore, some circuits may be shared whether or not orthogonal transformation is performed, and the circuit scale may be reduced. As a result, the plurality of processing flows divided by the presence or absence of orthogonal transformation may be the same except for the presence or absence of last_sig_coeff.

[0440] Also, compared with FIG. 50, the processing in FIG. 51 is simplified. Therefore, the circuit scale may be reduced. Also, the appearance frequency of 0 or 1 regarding subblock_flag is likely to be biased according to the surrounding situation. Therefore, in the CABAC encoding of subblock_flag, it is assumed that the amount of code reduction is large with respect to the increase amount of processing delay. Therefore, it is useful to perform the CABAC encoding of subblock_flag without imposing a limit on the number of times of the CABAC encoding process.

[0441] Note that the number of times of the CABAC encoding process for last_sig_coeff may be included in the CCB. Also, thres may be determined depending on the coordinate position defined in the block by last_sig_coeff.

[0442] [Second Mode of Coefficient Encoding] [First Example of the Second Mode of Coefficient Encoding] FIG. 52 is a flowchart showing a coefficient encoding method according to the first example of the second mode. In the example of FIG. 52, even when orthogonal transformation is not applied to the block, encoding the 16 coefficients in the subblock by the first encoding method (S127a) is different from the example of FIG. 47.

[0443] That is, in the example of FIG. 52, when the orthogonal transformation is not applied to the block, the encoding device 100 encodes the 16 coefficients in the sub-block in the first encoding method shown in FIG. 48 instead of the second encoding method shown in FIG. 49 (S127a). That is, the encoding device 100 encodes the 16 coefficients in the sub-block in the first encoding method shown in FIG. 48 regardless of whether the orthogonal transformation is applied or not, instead of the second encoding method shown in FIG. 49.

[0444] More specifically, regardless of whether the orthogonal transformation is present or not, the encoding device 100 follows the first encoding method shown in FIG. 48. In the first loop process, when the CCB exceeds thres, it does not use bypass encoding and skips the encoding of the coefficient information flag. Then, in the second loop process, when the coefficient information flag corresponding to the coefficient to be processed is not encoded, the encoding device 100 encodes the value of the coefficient using Golomb-Rice encoding without using the coefficient information flag.

[0445] Note that the syntax for encoding the coefficient information flag in the first loop process of FIG. 48 may be different depending on whether the orthogonal transformation is applied or not. For example, some or all of the coefficient information flags may be different between one or more coefficient information flags when the orthogonal transformation is applied and one or more coefficient information flags when the orthogonal transformation is not applied.

[0446] [Effect of the First Example of the Second Aspect of Coefficient Encoding] According to the example of FIG. 52, even when the syntax for encoding the coefficient information flag differs depending on the presence or absence of the orthogonal transformation, there is a possibility that the syntax for encoding the 16 coefficients in the sub-block is shared after the CCB exceeds thres regardless of the presence or absence of the orthogonal transformation. As a result, there is a possibility that some circuits are shared between the case where the orthogonal transformation is applied and the case where the orthogonal transformation is not applied, and the circuit scale may be reduced.

[0447] After the CCB exceeds thres, the coefficients are encoded without being divided into coefficient information flags encoded by bypass encoding and residual value information encoded by Golomb-Rice encoding. Therefore, an increase in the amount of information may be suppressed, and an increase in the amount of code may be suppressed.

[0448] [Second Example of the Second Mode of Coefficient Encoding] FIG. 53 is a flowchart showing a coefficient encoding method according to the second example of the second mode. In the example of FIG. 53, even when orthogonal transformation is applied to a block, encoding 16 coefficients in a sub-block by the second encoding method (S147a) is different from the example of FIG. 47.

[0449] That is, in the example of FIG. 53, when orthogonal transformation is applied to a block, the encoding device 100 encodes 16 coefficients in the sub-block by the second encoding method shown in FIG. 49 instead of the first encoding method shown in FIG. 48 (S147a). That is, the encoding device 100 encodes 16 coefficients in the sub-block by the second encoding method shown in FIG. 49 instead of the first encoding method shown in FIG. 48 whether or not orthogonal transformation is applied.

[0450] More specifically, regardless of whether orthogonal transformation is performed or not, the encoding device 100, according to the second encoding method shown in FIG. 49, in the first loop process, when the CCB exceeds thres, does not skip encoding and encodes the coefficient information flag by bypass encoding. Then, in the second loop process, the encoding device 100 encodes the remainder depending on the coefficient information flag by Golomb-Rice encoding.

[0451] Note that the syntax for encoding the coefficient information flag in the first loop process of FIG. 49 may be different when orthogonal transformation is applied and when it is not applied. For example, some or all of the coefficient information flags may be different between one or more coefficient information flags when orthogonal transformation is applied and one or more coefficient information flags when orthogonal transformation is not applied.

[0452] [Effect of the Second Example of the Second Aspect of Coefficient Encoding] According to the example of FIG. 53, even when the syntax of encoding the coefficient information flag differs depending on the presence or absence of orthogonal transformation, regardless of the presence or absence of orthogonal transformation, after the CCB exceeds thres, the syntax of encoding the 16 coefficients in the sub-block may be unified. As a result, some circuits may be shared between the case where orthogonal transformation is applied and the case where orthogonal transformation is not applied, and the circuit scale may be reduced.

[0453] [Third Aspect of Coefficient Encoding] FIG. 54 is a syntax diagram showing a basic first encoding method according to the third aspect. The syntax shown in FIG. 54 corresponds to an example of the syntax of the first encoding method shown in FIG. 47. Basically, the first encoding method is used when orthogonal transformation is applied.

[0454] Here, the coefficient information flag and the parameter are the same as the coefficient information flag and the parameter shown in the first aspect. Note that the plurality of coefficient information flags shown here are examples, and other plural coefficient information flags may be encoded. For example, some coefficient information flags may not be encoded. Also, the coefficient information flag shown here may be replaced with a coefficient information flag or parameter having another meaning.

[0455] The first for loop in the example of FIG. 54 corresponds to the first loop process in the example of FIG. 48. In this first for loop, if the CCB remains, that is, if the CCB does not exceed the threshold, coefficient information flags such as sig_flag are encoded by CABAC encoding. If the CCB does not remain, the coefficient information flag is not encoded. Note that the second example of the second aspect may be applied to this example. That is, if the CCB does not remain, the coefficient information flag may be encoded by bypass encoding.

[0456] The second for loop from the top and the third for loop from the top correspond to the second loop process in the example of FIG. 48. In the second for loop from the top, for the coefficients with the coefficient information flag encoded, the residual values are encoded by Golomb-Rice coding. In the third for loop from the top, for the coefficients without the coefficient information flag encoded, the coefficients are encoded by Golomb-Rice coding. Note that in this example, by applying the second example of the second aspect, the residual values may always be encoded by Golomb-Rice coding.

[0457] In the fourth for loop from the top, sign_flag is encoded by bypass coding.

[0458] The syntax described in this aspect may be applied to the examples of FIGS. 47, 48, 50, 51, and 52.

[0459] FIG. 55 is a syntax diagram showing a basic second coding method according to the third aspect. The syntax shown in FIG. 55 corresponds to an example of the syntax of the second coding method in FIG. 47. Basically, the second coding method is used when no orthogonal transformation is applied.

[0460] Note that the plurality of coefficient information flags shown here are just examples, and other plural coefficient information flags may be encoded. For example, some of the coefficient information flags may not be encoded. Also, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.

[0461] The first five for loops in the example of FIG. 55 correspond to the first loop process in the example of FIG. 49. In these first five for loops, if the CCB remains, that is, if the CCB does not exceed the threshold, the coefficient information flags such as sig_flag are encoded by CABAC coding. If the CCB does not remain, the coefficient information flags are encoded by bypass coding. Note that in this example, the first example of the second aspect may be applied. That is, if the CCB does not remain, the coefficient information flags may not be encoded.

[0462] The sixth for loop from the top corresponds to the second loop process in the example of FIG. 49. In the sixth for loop from the top, the residual value is encoded by Golomb-Rice encoding. In this example, the first example of the second aspect may be applied. That is, for the coefficient for which the coefficient information flag is encoded, the residual value may be encoded by Golomb-Rice encoding. And for the coefficient for which the coefficient information flag is not encoded, the coefficient may be encoded by Golomb-Rice encoding.

[0463] The syntax described in this aspect may be applied to the examples of FIGS. 47, 49, 50, 51, and 53.

[0464] In the case where there is no application of orthogonal transformation (FIG. 55), compared with the case where there is an application of orthogonal transformation (FIG. 54), the number of loop processes for encoding the coefficient information flag is larger. Therefore, in the case where there is no application of orthogonal transformation, the processing amount of the hardware may increase compared with the case where there is an application of orthogonal transformation. Also, since the syntax of coefficient encoding differs depending on whether orthogonal transformation is performed or not, there is a possibility that circuits have to be prepared respectively. Therefore, the circuit may become complex.

[0465] [First Example of the Third Aspect of Coefficient Encoding] FIG. 56 is a syntax diagram showing a second encoding method according to the first example of the third aspect. The syntax shown in FIG. 56 corresponds to an example of the second encoding method of FIG. 47. For the first encoding method of FIG. 47, the syntax shown in FIG. 54 may be used. Note that this example may be combined with other examples of the third aspect or combined with other aspects.

[0466] The first for loop in the example of FIG. 56 corresponds to the first loop process in the example of FIG. 49. In this first for loop, if there are 8 or more CCBs remaining, that is, if the CCB to which 8 is added does not exceed the threshold, up to 8 coefficient information flags are encoded by CABAC encoding according to the coefficient, and the CCB is counted up to 8 times at most. If there are not 8 or more CCBs remaining, that is, if the CCB to which 8 is added exceeds the threshold, 8 coefficient information flags are encoded by bypass encoding according to the coefficient.

[0467] In other words, before the 8 coefficient information flags are encoded, it is comprehensively determined whether it is possible to encode the 8 coefficient information flags by CABAC encoding. And when it is possible to encode the 8 coefficient information flags by CABAC encoding, up to 8 coefficient information flags are encoded by CABAC encoding.

[0468] Note that in this example, the first example of the second aspect may be applied. That is, if there are not 8 or more CCBs remaining, the 8 coefficient information flags may not be encoded. That is, in this case, the encoding of the 8 coefficient information flags may be skipped without encoding the 8 coefficient information flags by bypass encoding.

[0469] Also, as shown in FIG. 56, according to the value of the coefficient, the encoding of one or more of the 8 coefficient information flags may be omitted. For example, when sig_flag is 0, the encoding of the remaining 7 coefficient information flags may be omitted.

[0470] The second for loop from the top corresponds to the second loop process in the example of FIG. 49. In the second for loop from the top, the residual value is encoded by Golomb-Rice encoding. Note that in this example, the first example of the second aspect may be applied. That is, for the coefficient for which 8 coefficient information flags are encoded, the residual value may be encoded by Golomb-Rice encoding, and for the coefficient for which 8 coefficient information flags are not encoded, the coefficient may be encoded by Golomb-Rice encoding.

[0471] The plurality of coefficient information flags shown here are just examples, and other plural coefficient information flags may be encoded. For example, some of the coefficient information flags may not be encoded. Also, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.

[0472] Also, the example of FIG. 55 and the example of FIG. 56 may be combined. For example, in the example of FIG. 55, before four coefficient information flags such as sig_flag and sign_flag are encoded, it may be comprehensively determined whether the four coefficient information flags can be encoded by CABAC encoding.

[0473] [Effect of the First Example of the Third Aspect of Coefficient Encoding] In the example of FIG. 56, all the coefficient information flags encoded by CABAC encoding are encoded in one loop process. That is, compared with the example of FIG. 55, in the example of FIG. 56, the number of loop processes is small. Therefore, there is a possibility that the processing amount is reduced.

[0474] Also, in the example of FIG. 54 and the example of FIG. 56, the number of loop processes for encoding a plurality of coefficient information flags by CABAC encoding is the same. Therefore, compared with the combination of the example of FIG. 54 and the example of FIG. 55, in the combination of the example of FIG. 54 and the example of FIG. 56, the modified part of the circuit may be reduced.

[0475] Also, since it is comprehensively determined whether a plurality of coefficient information flags can be encoded by CABAC encoding before the plurality of coefficient information flags are encoded, the processing may be simplified and the processing delay may be reduced.

[0476] In addition, in both the case where orthogonal transformation is applied and the case where orthogonal transformation is not applied, before a plurality of coefficient information flags are encoded, it may be comprehensively determined whether or not the plurality of coefficient information flags can be encoded by CABAC encoding. As a result, the difference between the encoding method used for a block to which orthogonal transformation is applied and the encoding method used for a block to which orthogonal transformation is not applied becomes even smaller, and the circuit scale may become even smaller.

[0477] Also, in the example of FIG. 56, from sig_flag to abs_gt9_flag are included in one loop, but the encoding method is not limited to this. A plurality of loops (for example, two loops) may be used, and it may be comprehensively determined whether or not a plurality of coefficient information flags can be encoded by CABAC encoding for each loop. Although the processing increases compared to one loop, the effect of processing reduction can be obtained in the same way as in the example of FIG. 55.

[0478] [Second Example of the Third Aspect of Coefficient Encoding] FIG. 57 is a syntax diagram showing a second encoding method according to the second example of the third aspect. The syntax shown in FIG. 57 corresponds to an example of the second encoding method of FIG. 47. The syntax shown in FIG. 54 may be used for the first encoding method of FIG. 47. Note that this example may be combined with other examples of the third aspect or with other aspects.

[0479] The first for loop in the example of FIG. 57 corresponds to the first loop process in the example of FIG. 49. In this first for loop, if CCB remains 7 or more, that is, if the CCB added with 7 does not exceed the threshold, up to seven coefficient information flags are encoded by CABAC encoding according to the coefficients, and CCB is counted up at most seven times. If CCB does not remain 7 or more, that is, if the CCB added with 7 exceeds the threshold, seven coefficient information flags are encoded by bypass encoding according to the coefficients.

[0480] In other words, before the seven coefficient information flags are encoded, it is comprehensively determined whether the seven coefficient information flags can be encoded by CABAC encoding. And if it is possible to encode the seven coefficient information flags by CABAC encoding, the seven coefficient information flags are encoded by CABAC encoding.

[0481] Note that in this example, the first example of the second aspect may be applied. That is, if there are no more than 7 CCBs remaining, the seven coefficient information flags may not be encoded. That is, in this case, the encoding of the seven coefficient information flags may be skipped without being encoded by bypass encoding.

[0482] Also, as shown in FIG. 57, according to the value of the coefficient, the encoding of one or more of the seven coefficient information flags may be omitted. For example, when sig_flag is 0, the encoding of the remaining six coefficient information flags may be omitted.

[0483] The second for loop from the top corresponds to the second loop process in the example of FIG. 49. In the second for loop from the top, the residual value is encoded by Golomb-Rice encoding. Note that in this example, the first example of the second aspect may be applied. That is, for the coefficient for which the seven coefficient information flags are encoded, the residual value may be encoded by Golomb-Rice encoding, and for the coefficient for which the seven coefficient information flags are not encoded, the coefficient may be encoded by Golomb-Rice encoding.

[0484] In the third for loop from the top, if CCB remains, that is, if CCB does not exceed the threshold, sign_flag is encoded by CABAC encoding and CCB is incremented. If CCB does not remain, sign_flag is encoded by bypass encoding. Note that, similar to the example of FIG. 54, sign_flag may always be encoded by bypass encoding.

[0485] The plurality of coefficient information flags shown here are just an example, and other plural coefficient information flags may be encoded. For example, some of the coefficient information flags may not be encoded. Also, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.

[0486] Also, the example of FIG. 55 and the example of FIG. 57 may be combined. For example, in the example of FIG. 55, before encoding four coefficient information flags such as sig_flag and sign_flag, it may be comprehensively determined whether it is possible to encode the four coefficient information flags by CABAC encoding.

[0487] [Effect of the second example of the third mode of coefficient encoding] Similar to the example of FIG. 56, in the example of FIG. 57, a plurality of coefficient information flags (specifically, abs_gt3_flag, abs_gt5_flag, etc.) for representing by comparing the magnitude of the coefficient with a threshold are encoded in one loop process. Therefore, compared with the example of FIG. 55, in the example of FIG. 57, the number of loop processes is small. Therefore, there is a possibility that the processing amount is reduced.

[0488] Compared with the example of FIG. 56, in the example of FIG. 57, the number of loop processes for encoding a plurality of coefficient information flags increases. However, compared with the example of FIG. 56, in the example of FIG. 57, there is a part similar to the example of FIG. 54. For example, sign_flag is encoded last. Therefore, compared with the combination of the examples of FIGS. 54 and 56, in the combination of the examples of FIGS. 54 and 57, the changed part of the circuit may be reduced.

[0489] Also, since it is comprehensively determined whether it is possible to encode a plurality of coefficient information flags by CABAC encoding before the plurality of coefficient information flags are encoded, the processing is simplified and there is a possibility that the processing delay is reduced.

[0490] In addition, in both the case where orthogonal transformation is applied and the case where orthogonal transformation is not applied, before a plurality of coefficient information flags are encoded, it may be comprehensively determined whether or not the plurality of coefficient information flags can be encoded by CABAC encoding. As a result, the difference between the encoding method used for a block to which orthogonal transformation is applied and the encoding method used for a block to which orthogonal transformation is not applied becomes even smaller, and there is a possibility that the circuit scale becomes even smaller.

[0491] Also, in the example of FIG. 57, from sig_flag to abs_gt9_flag are included in one loop, but the encoding method is not limited to this. A plurality of loops (for example, two loops) may be used, and it may be comprehensively determined whether or not a plurality of coefficient information flags can be encoded by CABAC encoding for each loop. Although the processing increases compared to one loop, the effect of processing reduction can be obtained in the same manner as in the example of FIG. 55.

[0492] [Modification Example of Coefficient Encoding] Any plurality of aspects and any plurality of examples regarding the above coefficient encoding may be combined. Also, any one of the plurality of aspects, the plurality of examples, and any plurality of combinations thereof regarding the above coefficient encoding may be applied to a luminance block or may be applied to a chrominance block. In that case, different thres may be used for the luminance block and the chrominance block.

[0493] Also, for a block to which orthogonal transformation is not applied and to which BDPCM (Block-based Delta Pulse Code Modulation) is applied, any one of the plurality of aspects, the plurality of examples, and any plurality of combinations thereof regarding the above coefficient encoding may be used. In a block to which BDPCM is applied, the information amount is reduced by subtracting each residual signal in the block from a residual signal adjacent vertically or horizontally to the residual signal.

[0494] Also, for a block to which BDPCM is applied, for a chrominance block, any one of the plurality of aspects, plurality of examples, and any plurality of combinations thereof regarding the above coefficient coding may be used.

[0495] Also, for a block to which ISP (Intra Sub-Partitions) is applied, any one of the plurality of aspects, plurality of examples, and any plurality of combinations thereof regarding the above coefficient coding may be used. In ISP, an intra block is divided vertically or horizontally, and the intra prediction of each sub-block is performed using the pixel values of the sub-blocks adjacent to that sub-block.

[0496] Also, for a block to which ISP is applied, for a chrominance block, any one of the plurality of aspects, plurality of examples, and any plurality of combinations thereof regarding the above coefficient coding may be used.

[0497] Also, when Chroma Joint Coding is used as the coding mode for a chrominance block, any one of the plurality of aspects, plurality of examples, and any plurality of combinations thereof regarding the above coefficient coding may be used. Here, Chroma Joint Coding is a coding method for deriving the Cr value from the Cb value.

[0498] Also, the value of thres in the case where orthogonal transformation is applied may be twice the value of thres in the case where orthogonal transformation is not applied. Alternatively, the value of thres in the case where orthogonal transformation is not applied may be twice the value of thres in the case where orthogonal transformation is applied.

[0499] Also, only when differential color combination coding is used, the value of thres of CCB when orthogonal transformation is applied may be twice the value of thres of CCB when orthogonal transformation is not applied. Alternatively, only when differential color combination coding is used, the value of thres of CCB when orthogonal transformation is not applied may be twice the value of thres of CCB when orthogonal transformation is applied.

[0500] Also, in the plurality of aspects and examples regarding the above coefficient coding, the scan order of a plurality of coefficients in a block where orthogonal transformation is not applied may be the same as the scan order of a plurality of coefficients in a block where orthogonal transformation is applied.

[0501] Also, in the third aspect and a plurality of examples of the third aspect, some examples of syntax are shown, but the applied syntax is not limited to these examples. For example, in a plurality of aspects different from the third aspect and their plurality of examples, a syntax different from any of the plurality of syntaxes shown in the third aspect and its plurality of examples may be used. Various syntaxes for coding 16 coefficients may be applied.

[0502] Note that in the plurality of aspects and examples of coefficient coding, the processing flow of coding is shown, but except for the difference in whether to send or receive a bitstream, the processing flow of decoding is basically the same as the processing flow of coding. For example, the decoding device 200 may perform an inverse orthogonal transformation and decoding corresponding to the orthogonal transformation and coding performed by the coding device 100.

[0503] Also, each flowchart regarding the plurality of aspects and examples of coefficient coding is an example. For each flowchart, new conditions or processes may be added, conditions or processes may be deleted, or conditions or processes may be changed.

[0504] Also, here, the coefficients are values that constitute an image such as a block or a sub-block. Specifically, a plurality of coefficients that constitute an image may be obtained from a plurality of pixel values of the image through orthogonal transformation. Also, a plurality of coefficients that constitute an image may be obtained without going through orthogonal transformation from a plurality of pixel values of the image. That is, a plurality of coefficients that constitute an image may be the plurality of pixel values of the image itself. Also, each pixel value may be a pixel value of the original image or a value of a prediction residual. Also, the coefficients may be quantized.

[0505] [Typical Examples of Configuration and Processing] Typical examples of the configuration and processing of the encoding device 100 and the decoding device 200 shown above are shown below.

[0506] FIG. 58 is a flowchart showing the operation of the encoding device 100. For example, the encoding device 100 includes a circuit and a memory connected to the circuit. The circuit and the memory included in the encoding device 100 may correspond to the processor a1 and the memory a2 shown in FIG. 40. The circuit of the encoding device 100 performs the operation shown in FIG. 58. Specifically, the circuit of the encoding device 100 encodes a block of an image in the operation (S211).

[0507] In one example, the circuit of the encoding device 100 may limit the number of times of context-adaptive encoding processing to encode a block of an image. And in both cases where orthogonal transformation is applied to the block and where orthogonal transformation is not applied to the block, the sub-block flag encoding process may be performed without being included in the number of times of the processing to be limited.

[0508] Here, the sub-block flag encoding process is a process of encoding a sub-block flag indicating whether or not non-zero coefficients are included in the sub-blocks included in the block by context-adaptive encoding.

[0509] As a result, regardless of whether an orthogonal transformation is applied or not, and regardless of the limitation on the number of times of context adaptive encoding processing, the sub-block flag may be encoded by context adaptive encoding. Therefore, the amount of code may be reduced. Also, the difference between the encoding method used for blocks to which an orthogonal transformation is applied and the encoding method used for blocks to which no orthogonal transformation is applied becomes smaller, and the circuit scale may become smaller.

[0510] Also, when an orthogonal transformation is applied to a block, the circuit of the encoding device 100 may perform the position parameter encoding process without including it in the number of times of the process to be restricted. Here, the position parameter encoding process is a process of encoding, by context adaptive encoding, a parameter indicating the position of the first non-zero coefficient in the block in the scan order.

[0511] As a result, when an orthogonal transformation is applied, regardless of the limitation on the number of times of context adaptive encoding processing, the parameter indicating the position of the first non-zero coefficient may be encoded by context adaptive encoding. Therefore, the amount of code may be reduced.

[0512] Also, when an orthogonal transformation is applied to a block, the circuit of the encoding device 100 may determine the range of the number of times of processing according to the position of the first non-zero coefficient. As a result, when an orthogonal transformation is applied, the limited number of times of processing may be appropriately determined. Therefore, the balance between reduction of the amount of code and reduction of processing delay may be appropriately adjusted.

[0513] In another example, when an orthogonal transformation is applied to a block of the image to be encoded and when no orthogonal transformation is applied to the block, the circuit of the encoding device 100 may operate as follows.

[0514] Specifically, in both of these cases, when the number of processing times of context adaptive coding is within the limit range of the number of processing times, the circuit of the encoding device 100 may encode the coefficient information flag by context adaptive coding. Also, in both of these cases, when the number of processing times of context adaptive coding is not within the limit range of the number of processing times, the circuit of the encoding device 100 may skip the encoding of the coefficient information flag. Here, the coefficient information flag indicates the attributes of the coefficients included in the block.

[0515] And when the coefficient information flag is encoded, the circuit of the encoding device 100 may encode the residual value information by Golomb-Rice coding. Here, the residual value information is information for reconstructing the coefficient value using the coefficient information flag. Also, when the encoding of the coefficient information flag is skipped, the circuit of the encoding device 100 may encode the coefficient value by Golomb-Rice coding.

[0516] Thereby, regardless of whether orthogonal transformation is applied or not, there is a possibility that the encoding of the coefficient information flag is skipped according to the limit on the number of processing times of context adaptive coding. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the coding method used for blocks to which orthogonal transformation is applied and the coding method used for blocks to which orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0517] Also, the coefficient information flag may be a flag indicating whether the coefficient value is greater than 1. Thereby, regardless of whether orthogonal transformation is applied or not, there is a possibility that the encoding of the coefficient information flag indicating whether the coefficient value is greater than 1 is skipped according to the limit on the number of processing times of context adaptive coding. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed.

[0518] In yet another example, the circuit of the encoding device 100 may limit the number of times of context adaptive encoding and encode an image block. When an orthogonal transform is not applied to a block, it may be determined whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block. When it is determined that the processing conditions are satisfied, the plurality of coefficient information flags may be encoded by context adaptive encoding.

[0519] Here, the processing condition is a condition that the number of times of processing when the number of the plurality of coefficient information flags is added to the number of times of processing is within the limit range of the number of times of processing.

[0520] Thereby, when an orthogonal transform is not applied, it is possible to comprehensively determine whether context adaptive encoding can be used for a plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Also, when similar processing is performed on a block to which an orthogonal transform is applied, the difference between the encoding method used for the block to which an orthogonal transform is applied and the encoding method used for the block to which an orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.

[0521] Also, the plurality of coefficient information flags may include a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5. Thereby, it is possible to comprehensively determine a plurality of coefficient information flags including a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5. Therefore, the processing may be simplified and the processing delay may be reduced.

[0522] Further, the plurality of coefficient information flags may include a coefficient information flag indicating whether the value of the coefficient is greater than 7 and a coefficient information flag indicating whether the value of the coefficient is greater than 9. Thereby, there is a possibility that comprehensive determination is performed on a plurality of coefficient information flags including four coefficient information flags: whether the value of the coefficient is greater than 3, whether the value of the coefficient is greater than 5, whether the value of the coefficient is greater than 7, and whether the value of the coefficient is greater than 9. Therefore, the processing may be simplified and the processing delay may be reduced.

[0523] Note that the above operation performed by the circuit of the encoding device 100 may be performed by the entropy encoding unit 110 of the encoding device 100.

[0524] FIG. 59 is a flowchart showing the operation of the decoding device 200. For example, the decoding device 200 includes a circuit and a memory connected to the circuit. The circuit and the memory included in the decoding device 200 may correspond to the processor b1 and the memory b2 shown in FIG. 46. The circuit of the decoding device 200 performs the operation shown in FIG. 59. Specifically, in the operation, the circuit of the decoding device २०० decodes a block of an image (S221).

[0525] In one example, the circuit of the decoding device 200 may limit the number of times of context adaptive decoding processing to decode a block of an image. And in both cases where inverse orthogonal transformation is applied to the block and where inverse orthogonal transformation is not applied to the block, the sub-block flag decoding process may be performed without being included in the number of times of processing to be limited.

[0526] Here, the sub-block flag decoding process is a process of decoding a sub-block flag indicating whether a non-zero coefficient is included in a sub-block included in a block by context adaptive decoding.

[0527] As a result, regardless of whether the inverse orthogonal transform is applied or not, and regardless of the limit on the number of times of context-adaptive decoding processing, the sub-block flag may be decoded by context-adaptive decoding. Therefore, the amount of code may be reduced. Also, the difference between the decoding method used for a block to which the inverse orthogonal transform is applied and the decoding method used for a block to which the inverse orthogonal transform is not applied becomes smaller, and the circuit scale may become smaller.

[0528] Also, when the inverse orthogonal transform is applied to a block, the circuit of the decoding device 200 may perform the position parameter decoding process without including it in the number of times of processing to be restricted. Here, the position parameter decoding process is a process of decoding, by context-adaptive decoding, a parameter indicating the position of the first non-zero coefficient in the block in the scan order.

[0529] As a result, when the inverse orthogonal transform is applied, regardless of the limit on the number of times of context-adaptive decoding processing, the parameter indicating the position of the first non-zero coefficient may be decoded by context-adaptive decoding. Therefore, the amount of code may be reduced.

[0530] Also, when the inverse orthogonal transform is applied to a block, the circuit of the decoding device 200 may determine the limit range of the number of times of processing based on the position of the first non-zero coefficient. As a result, when the inverse orthogonal transform is applied, the limit number of times of processing may be appropriately determined. Therefore, the balance between the reduction of the amount of code and the reduction of the processing delay may be appropriately adjusted.

[0531] In another example, when the inverse orthogonal transform is applied to a block of the image to be decoded and when the inverse orthogonal transform is not applied to the block, the circuit of the decoding device 200 may operate as follows.

[0532] Specifically, in both cases, when the number of processing times of context adaptive decoding is within the limit range of the number of processing times, the circuit of the decoding device 200 may decode the coefficient information flag by context adaptive decoding. Also, in both cases, when the number of processing times of context adaptive decoding is not within the limit range of the number of processing times, the circuit of the decoding device 200 may skip the decoding of the coefficient information flag. Here, the coefficient information flag indicates the attribute of the coefficients included in the block.

[0533] And when the coefficient information flag is decoded, the circuit of the decoding device 200 may decode the residual value information by Golomb Rice decoding. Here, the residual value information is information for reconstructing the coefficient value using the coefficient information flag. Also, when the decoding of the coefficient information flag is skipped, the circuit of the decoding device 200 may decode the coefficient value by Golomb Rice decoding.

[0534] Thereby, regardless of whether inverse orthogonal transformation is applied or not, there is a possibility that the decoding of the coefficient information flag is skipped according to the limit of the number of processing times of context adaptive decoding. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed. Also, the difference between the decoding method used for blocks where inverse orthogonal transformation is applied and the decoding method used for blocks where inverse orthogonal transformation is not applied becomes smaller, and the circuit scale may become smaller.

[0535] Also, the coefficient information flag may be a flag indicating whether the coefficient value is greater than 1. Thereby, regardless of whether inverse orthogonal transformation is applied or not, there is a possibility that the decoding of the coefficient information flag indicating whether the coefficient value is greater than 1 is skipped according to the limit of the number of processing times of context adaptive decoding. Therefore, an increase in processing delay can be suppressed, and an increase in the amount of code may be suppressed.

[0536] In yet another example, the circuit of the decoding device 200 may limit the number of processing times of context adaptive decoding to decode an image block. And when the inverse orthogonal transform is not applied to the block, it may be determined whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of the coefficients included in the block. And when it is determined that the processing conditions are satisfied, the plurality of coefficient information flags may be decoded by context adaptive decoding.

[0537] Here, the processing condition is a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times.

[0538] Thereby, when the inverse orthogonal transform is not applied, it is possible to comprehensively determine whether context adaptive decoding can be used for the plurality of coefficient information flags. Therefore, the processing may be simplified and the processing delay may be reduced. Also, when similar processing is performed on a block to which the inverse orthogonal transform is applied, the difference between the decoding method used for the block to which the inverse orthogonal transform is applied and the decoding method used for the block to which the inverse orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.

[0539] Also, the plurality of coefficient information flags may include a coefficient information flag indicating whether the value of the coefficient is greater than 3 and a coefficient information flag indicating whether the value of the coefficient is greater than 5. Thereby, it is possible to comprehensively determine the plurality of coefficient information flags including the coefficient information flag indicating whether the value of the coefficient is greater than 3 and the coefficient information flag indicating whether the value of the coefficient is greater than 5. Therefore, the processing may be simplified and the processing delay may be reduced.

[0540] Further, the plurality of coefficient information flags may include a coefficient information flag indicating whether the value of the coefficient is greater than 7 and a coefficient information flag indicating whether the value of the coefficient is greater than 9. Thereby, there is a possibility that comprehensive determination can be performed on a plurality of coefficient information flags including four coefficient information flags: whether the value of the coefficient is greater than 3, whether the value of the coefficient is greater than 5, whether the value of the coefficient is greater than 7, and whether the value of the coefficient is greater than 9. Therefore, the processing may be simplified and the processing delay may be reduced.

[0541] Note that the above operations performed by the circuit of the decoding device 200 may be performed by the entropy decoding unit 202 of the decoding device 200.

[0542] [Other Examples] The encoding device 100 and the decoding device 200 in each of the above-described examples may be used as an image encoding device and an image decoding device, respectively, or may be used as a moving image encoding device and a moving image decoding device.

[0543] Further, the encoding device 100 and the decoding device 200 may perform only some of the above-described operations, and other devices may perform other operations. Further, the encoding device 100 and the decoding device 200 may include only some of the above-described plurality of components, and other devices may include other components.

[0544] Further, at least a part of each of the above-described examples may be used as an encoding method or a decoding method, or may be used as other methods.

[0545] Each component may be configured by dedicated hardware or may be realized by executing a software program suitable for each component. Each component may be realized by a program execution unit such as a CPU or a processor reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.

[0546] Specifically, each of the encoding device 100 and the decoding device 200 may include a processing circuitry and a storage that is electrically connected to the processing circuitry and accessible from the processing circuitry. For example, the processing circuitry corresponds to processor a1 or b1, and the storage corresponds to memory a2 or b2.

[0547] The processing circuitry includes at least one of dedicated hardware and a program execution unit, and executes processing using the storage. Further, when the processing circuitry includes a program execution unit, the storage stores a software program executed by the program execution unit.

[0548] Here, the software that realizes the above-described encoding device 100 or decoding device 200, etc. is the following program.

[0549] For example, this program causes a computer to limit the number of processing times of context-adaptive encoding, encode an image block, and in the encoding of the block, in both the case where an orthogonal transform is applied to the block and the case where an orthogonal transform is not applied to the block, perform a sub-block flag encoding process of encoding, by context-adaptive encoding, a sub-block flag indicating whether or not non-zero coefficients are included in sub-blocks included in the block without including the sub-block flag encoding process in the number of processing times.

[0550] Further, for example, this program causes a computer to limit the number of processing times of context-adaptive decoding, decode an image block, and in the decoding of the block, in both the case where an inverse orthogonal transform is applied to the block and the case where an inverse orthogonal transform is not applied to the block, perform a sub-block flag decoding process of decoding, by context-adaptive decoding, a sub-block flag indicating whether or not non-zero coefficients are included in sub-blocks included in the block without including the sub-block flag decoding process in the number of processing times.

[0551] Also, for example, this program causes a computer to perform context-adaptive encoding on a coefficient information flag indicating an attribute of coefficients included in a block when the number of times of context-adaptive encoding is within the limit range of the number of times of processing both when an orthogonal transformation is applied to the block of the image to be encoded and when the orthogonal transformation is not applied to the block, skip the encoding of the coefficient information flag when the number of times of processing is not within the limit range of the number of times of processing, perform Golomb-Rice encoding on residual value information for reconstructing the value of the coefficients using the coefficient information flag when the coefficient information flag is encoded, and perform Golomb-Rice encoding on the value of the coefficients when the encoding of the coefficient information flag is skipped.

[0552] Also, for example, this program causes a computer to perform context-adaptive decoding on a coefficient information flag indicating an attribute of coefficients included in a block when the number of times of context-adaptive decoding is within the limit range of the number of times of processing both when an inverse orthogonal transformation is applied to the block of the image to be decoded and when the inverse orthogonal transformation is not applied to the block, skip the decoding of the coefficient information flag when the number of times of processing is not within the limit range of the number of times of processing, perform Golomb-Rice decoding on residual value information for reconstructing the value of the coefficients using the coefficient information flag when the coefficient information flag is decoded, and perform Golomb-Rice decoding on the value of the coefficients when the decoding of the coefficient information flag is skipped.

[0553] Also, for example, this program causes a computer to limit the number of processing times of context adaptive encoding, encode an image block, and in the encoding of the block, when an orthogonal transform is not applied to the block, determine whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block, and when it is determined that the processing conditions are satisfied, encode the plurality of coefficient information flags by context adaptive encoding, where the processing conditions are a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times, and may execute an encoding method.

[0554] Also, for example, this program causes a computer to limit the number of processing times of context adaptive decoding, decode an image block, and in the decoding of the block, when an inverse orthogonal transform is not applied to the block, determine whether processing conditions are satisfied for a plurality of coefficient information flags respectively indicating a plurality of attributes of coefficients included in the block, and when it is determined that the processing conditions are satisfied, decode the plurality of coefficient information flags by context adaptive decoding, where the processing conditions are a condition that the number of processing times when the number of the plurality of coefficient information flags is added to the number of processing times is within the limit range of the number of processing times, and may execute a decoding method.

[0555] Also, as described above, each component may be a circuit. These circuits may constitute one circuit as a whole, or may be separate circuits respectively. Also, each component may be realized by a general-purpose processor or a dedicated processor.

[0556] Also, another component may execute the processing executed by a specific component. Also, the order of executing the processing may be changed, or a plurality of processes may be executed in parallel. Also, the encoding / decoding device may include an encoding device 100 and a decoding device 200.

[0557] Also, ordinal numbers such as the first and second used in the description may be appropriately re-assigned. Also, ordinal numbers may be newly assigned to or removed from components and the like.

[0558] As described above, the aspects of the encoding device 100 and the decoding device 200 have been described based on a plurality of examples. However, the aspects of the encoding device 100 and the decoding device 200 are not limited to these examples. As long as the gist of the present disclosure is not deviated from, forms constructed by applying various modifications conceivable by those skilled in the art to each example or by combining components in different examples may also be included within the scope of the aspects of the encoding device 100 and the decoding device 200.

[0559] 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 device, a part of the syntax, etc. may be implemented in combination with other aspects.

[0560] [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, and the like. 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 as a ROM. The software may be distributed. The software may be recorded on various recording media such as a semiconductor memory. Note that each functional block can also be realized by hardware (a dedicated circuit). Various combinations of hardware and software can be adopted.

[0561] The processes described in each embodiment may be realized by centralized processing using a single device (system), or may be realized by distributed processing using a plurality of devices. Also, the processor that executes the above program may be singular or plural. That is, centralized processing may be performed, or distributed processing may be performed.

[0562] Aspects of the present disclosure are not limited to the above embodiments, and various modifications are possible, and these are also included within the scope of the aspects of the present disclosure.

[0563] Furthermore, here, application examples of the moving image encoding method (image encoding method) or the moving image decoding method (image decoding method) shown in each of the above embodiments, and various systems for implementing the application examples will be described. Such a system may be characterized by having an image encoding device using an image encoding method, an image decoding device using an image decoding method, or an image encoding / decoding device having both. Other configurations of such a system can be appropriately changed as the case may be.

[0564] [Usage Example] FIG. 60 is a diagram showing the overall configuration of a suitable content supply system ex100 for realizing a content distribution service. The communication service providing area is divided into a desired size, and base stations ex106, ex107, ex108, ex109, ex110, which are fixed radio stations in the illustrated example, are installed in each cell.

[0565] In this content supply system ex100, devices such as computer ex111, game console ex112, camera ex113, home appliance ex114, and smartphone ex115 are connected to the Internet ex101 via Internet service provider ex102 or communication network ex104 and base stations ex106 - ex110. The content supply system ex100 may be connected by combining any of the above devices. In various implementations, the devices may be directly or indirectly connected to each other via a telephone network or short - range wireless etc. without going through base stations ex106 - ex110. Further, streaming server ex103 may be connected to devices such as computer ex111, game console ex112, camera ex113, home appliance ex114, and smartphone ex115 via Internet ex101 etc. Also, streaming server ex103 may be connected to terminals etc. within a hotspot in an airplane ex117 via satellite ex116.

[0566] Note that instead of base stations ex106 - ex110, a wireless access point or hotspot etc. may be used. Also, streaming server ex103 may be directly connected to communication network ex104 without going through Internet ex101 or Internet service provider ex102, or may be directly connected to airplane ex117 without going through satellite ex116.

[0567] Camera ex113 is a device capable of still - image shooting and video shooting such as a digital camera etc. Also, smartphone ex115 is a smartphone device, mobile phone, or PHS (Personal Handy - phone System) etc. corresponding to the mobile communication system methods called 2G, 3G, 3.9G, 4G, and in the future 5G.

[0568] Home appliance ex114 is a refrigerator or a device included in a household fuel cell cogeneration system etc.

[0569] In the content supply system ex100, a terminal having a photographing function is connected to a streaming server ex103 through a base station ex106 or the like, enabling live distribution and the like. In live distribution, a terminal (such as a computer ex111, a game machine ex112, a camera ex113, a household appliance ex114, a smartphone ex115, and a terminal in an airplane ex117) may perform the encoding process described in each of the above embodiments on a still image or moving image content photographed by the user using the terminal. The video data obtained by encoding and the audio data obtained by encoding the audio corresponding to the video may be multiplexed and the obtained data may be transmitted to the streaming server ex103. That is, each terminal functions as an image encoding device according to one aspect of the present disclosure.

[0570] On the other hand, the streaming server ex103 streams the content data transmitted to the requested client. The client is a computer ex111, a game machine ex112, a camera ex113, a household appliance ex114, a smartphone ex115, or a terminal in an airplane ex117 that can decode the encoded data. Each device that has received the distributed data may decode and reproduce the received data. That is, each device may function as an image decoding device according to one aspect of the present disclosure.

[0571] [Distributed processing] In addition, the streaming server ex103 may be a plurality of servers or a plurality of computers that distribute, process, record, and deliver data. For example, the streaming server ex103 may be realized by a CDN (Content Delivery Network), and content delivery may be realized by a network connecting a large number of edge servers distributed around the world and between the edge servers. In a CDN, a physically closer edge server can be dynamically assigned according to the client. Then, by caching and delivering the content to the edge server, the delay can be reduced. Also, when several types of errors occur or the communication state changes due to an increase in traffic, etc., the processing can be distributed among multiple edge servers, the delivery entity can be switched to another edge server, or the part of the network with a failure can be bypassed to continue the delivery, so high-speed and stable delivery can be realized.

[0572] In addition to just the distributed processing of the delivery itself, the encoding process of the captured data may be performed on each terminal, on the server side, or shared between them. As an example, generally in the encoding process, the processing loop is performed twice. In the first loop, the complexity of the image in units of frames or scenes, or the amount of code is detected. Also, in the second loop, processing is performed to improve the encoding efficiency while maintaining the image quality. For example, by having the terminal perform the first encoding process and the server side that receives the content perform the second encoding process, it is possible to reduce the processing load on each terminal while improving the quality and efficiency of the content. In this case, if there is a requirement to receive and decode in almost real time, the first encoded data performed by the terminal can also be received and played back by other terminals, so more flexible real-time delivery becomes possible.

[0573] As another example, cameras such as camera ex113 extract feature amounts (amounts of features or characteristics) from images, compress data related to the feature amounts as metadata, and transmit the compressed data to a server. The server performs compression according to the meaning (or importance of the content) of the image, for example, by determining the importance of an object from the feature amounts and switching the quantization accuracy. The feature amount data is particularly effective in improving the accuracy and efficiency of motion vector prediction during re-compression at the server. Also, simple encoding such as VLC (Variable Length Coding) may be performed at the terminal, and encoding with a large processing load such as CABAC (Context Adaptive Binary Arithmetic Coding) may be performed at the server.

[0574] As yet another example, in a stadium, a shopping mall, a factory, etc., there may be a plurality of video data in which substantially the same scene is captured by a plurality of terminals. In this case, using the plurality of terminals that performed the shooting, and other terminals and a server that did not perform shooting as necessary, encoding processing is respectively assigned and distributed processing is performed, for example, in units of GOP (Group of Picture), in units of pictures, or in units of tiles obtained by dividing a picture. Thereby, delay can be reduced and more real-time performance can be realized.

[0575] Since the plurality of video data are of substantially the same scene, the server may manage and / or give instructions so that the video data captured by each terminal can refer to each other. Also, the server may receive the encoded data from each terminal, change the reference relationship between the plurality of data, or correct or replace the picture itself and re-encode it. Thereby, a stream with improved quality and efficiency of each piece of data can be generated.

[0576] Furthermore, the server may perform transcoding to change the encoding method of the video data and then distribute the video data. For example, the server may convert an MPEG-based encoding method to a VP-based (for example, VP9) method, or convert H.264 to H.265, etc.

[0577] In this way, the encoding process can be performed by the terminal or one or more servers. Therefore, hereinafter, descriptions such as "server" or "terminal" are used as the entity performing the process, but part or all of the processes performed by the server may be performed by the terminal, or part or all of the processes performed by the terminal may be performed by the server. Also, regarding these, the same applies to the decoding process.

[0578] [3D, Multi-angle] There is an increasing trend to integrate and utilize different scenes captured by a plurality of cameras ex113 and / or terminals such as smartphones ex115 that are substantially synchronized with each other, or images or videos of the same scene captured from different angles. The videos captured by each terminal can be integrated based on the relative positional relationship between the terminals obtained separately or the regions where the feature points included in the videos match.

[0579] The server may not only encode a two-dimensional moving image, but also automatically or at a time specified by the user encode a still image based on scene analysis of the moving image and transmit it to the receiving terminal. When the server can further obtain the relative positional relationship between the shooting terminals, it can generate the three-dimensional shape of the scene based on not only the two-dimensional moving image but also videos of the same scene captured from different angles. The server may separately encode the three-dimensional data generated by a point cloud or the like, or based on the results of recognizing or tracking a person or an object using the three-dimensional data, select or reconstruct the video to be transmitted to the receiving terminal from the videos captured by a plurality of terminals.

[0580] In this way, the user can arbitrarily select each video corresponding to each shooting terminal to enjoy the scene, or can also enjoy the content obtained by cutting out the video from the selected viewpoint from the three-dimensional data reconstructed using a plurality of images or videos. Further, sounds are also collected from a plurality of different angles together with the video, and the server may multiplex the sound from a specific angle or space with the corresponding video and transmit the multiplexed video and sound.

[0581] In recent years, content that associates the real world with the virtual world, such as Virtual Reality (VR) and Augmented Reality (AR), has also become popular. In the case of VR images, the server may create right-eye and left-eye viewpoint images respectively and perform encoding that allows reference between each viewpoint video by means of Multi-View Coding (MVC) or the like, or may perform encoding as separate streams without referring to each other. At the time of decoding the separate streams, it is advisable to synchronize and play them so that a virtual three-dimensional space is reproduced according to the user's viewpoint.

[0582] In the case of AR images, the server may superimpose virtual object information on the virtual space on the camera information of the real space based on the three-dimensional position or the movement of the user's viewpoint. The decoding device may acquire or hold virtual object information and three-dimensional data, generate a two-dimensional image according to the movement of the user's viewpoint, and create superimposed data by smoothly connecting them. Alternatively, the decoding device may transmit the movement of the user's viewpoint to the server in addition to the request for virtual object information. The server may create superimposed data according to the movement of the viewpoint received from the three-dimensional data held by the server, encode the superimposed data, and distribute it to the decoding device. Note that the superimposed data typically has an α value indicating transparency in addition to RGB, and the server may set the α value of the part other than the object created from the three-dimensional data to 0 or the like and encode it in a state where the part is transparent. Or, the server may set the RGB value of a predetermined value like chroma key as the background and generate data with the part other than the object being the background color. The RGB value of the predetermined value may be determined in advance.

[0583] The decoding process of the data delivered in the same way may be performed on the client side (for example, a terminal), on the server side, or may be shared between them. As an example, a certain terminal may once send a reception request to the server, and the content corresponding to the request may be received by another terminal for decoding, and the decoded signal may be transmitted to a device having a display. By dispersing the processing regardless of the performance of the communicable terminals themselves and selecting appropriate content, it is possible to reproduce high-quality data. As another example, while receiving large-size image data on a TV or the like, only a part of the area such as tiles into which the picture is divided may be decoded and displayed on the personal terminal of the viewer. As a result, while sharing the overall image, it is possible to check the area within one's own field of responsibility or the area to be confirmed in more detail at hand.

[0584] In a situation where multiple short-range, medium-range, or long-range wireless communications inside and outside the building can be used, it may be possible to receive content seamlessly using a delivery system standard such as MPEG-DASH. The user may freely select a decoding device or a display device such as the user's terminal or a display arranged inside and outside the building and switch in real time. Also, decoding can be performed while switching the terminal to be decoded and the terminal to be displayed using the user's location information or the like. As a result, while the user is moving to the destination, it becomes possible to map and display information on a part of the wall surface or the ground of the adjacent building in which the displayable device is embedded. Also, based on the ease of access to the encoded data on the network, such as the encoded data being cached in a server that can be accessed from the receiving terminal in a short time or being copied to an edge server in a content delivery service, it is also possible to switch the bit rate of the received data.

[0585] [Scalable Encoding] Regarding content switching, an explanation will be given using a scalable stream compressed and encoded by applying the moving image encoding method shown in each of the above embodiments, as shown in FIG. 61. The server may have a plurality of streams with the same content but different qualities as individual streams, but it may also be configured to switch content by taking advantage of the characteristics of a temporally / spatially scalable stream realized by encoding in layers as shown in the figure. That is, by determining which layer to decode according to internal factors such as performance and external factors such as the state of the communication bandwidth on the decoding side, the decoding side can freely switch between low-resolution content and high-resolution content for decoding. For example, when a user wants to watch the continuation of a video that was being viewed on a smartphone ex115 while moving on a device such as an Internet TV after returning home, the device only needs to decode the same stream to a different layer, thus reducing the burden on the server side.

[0586] Furthermore, as described above, pictures are encoded for each layer. In addition to the configuration that realizes scalability in the enhancement layer above the base layer, the enhancement layer may include meta information based on statistical information of the image or the like. The decoding side may generate high-quality content by super-resolving the picture of the base layer based on the meta information. Super-resolution may improve the signal-to-noise ratio while maintaining and / or expanding the resolution. The meta information includes information for specifying linear or non-linear filter coefficients for use in super-resolution processing, or information for specifying parameter values in filter processing, machine learning, or least squares calculation used in super-resolution processing.

[0587] Alternatively, a configuration may be provided in which a picture is divided into tiles or the like according to the meaning of an object or the like in the image. The decoding side decodes only a part of the area by selecting the tile to be decoded. Further, by storing the attributes of the object (such as a person, a car, a ball, etc.) and the position in the video (such as the coordinate position in the same image) as meta information, the decoding side can specify the position of a desired object based on the meta information and determine the tile including the object. For example, as shown in FIG. 62, the meta information may be stored using a data storage structure different from the pixel data, such as an SEI (supplemental enhancement information) message in HEVC. This meta information indicates, for example, the position, size, or color of the main object.

[0588] The meta information may be stored in a unit composed of a plurality of pictures, such as a stream, a sequence, or a random access unit. The decoding side can obtain the time when a specific person appears in the video, and by combining the information per picture and the time information, can specify the picture in which the object exists and determine the position of the object in the picture.

[0589] [Optimization of Web Page] FIG. 63 is a diagram showing an example of a display screen of a web page on a computer ex111 or the like. FIG. 64 is a diagram showing an example of a display screen of a web page on a smartphone ex115 or the like. As shown in FIGS. 63 and 64, the web page may include a plurality of link images that are links to image contents, and the appearance may be different depending on the device for viewing. When a plurality of link images are visible on the screen, until the user explicitly selects a link image, or until the link image approaches the vicinity of the center of the screen or the entire link image enters the screen, the display device (decoding device) may display a still image or an I picture that each content has as a link image, or may display a video like a gif animation with a plurality of still images or I pictures, etc., or may receive only the base layer, decode and display the video.

[0590] When a user selects a linked image, the display device performs decoding, for example, with the base layer having the highest priority. If there is information indicating that the HTML constituting the web page is scalable content, the display device may decode up to the enhancement layer. Further, in order to ensure real-time performance, before selection or when the communication bandwidth is very strict, the display device can reduce the delay between the decoding time and the display time of the leading picture (the delay from the start of content decoding to the start of display) by decoding and displaying only forward-reference pictures (I pictures, P pictures, B pictures with only forward reference). Furthermore, the display device may deliberately ignore the reference relationship of the pictures, roughly decode all B pictures and P pictures with forward reference, and perform normal decoding as the received pictures increase over time.

[0591] [Autonomous driving] Also, when transmitting and receiving still image or video data such as two-dimensional or three-dimensional map information for autonomous driving or driving support of a vehicle, the receiving terminal may receive, in addition to the image data belonging to one or more layers, weather or construction information, etc. as meta information, and decode them in association. Note that the meta information may belong to a layer or may simply be multiplexed with the image data.

[0592] In this case, since a vehicle, drone, airplane, etc. including the receiving terminal moves, the receiving terminal can realize seamless reception and decoding by transmitting the position information of the receiving terminal while switching between base stations ex106~ex110. Also, the receiving terminal can dynamically switch how much meta information to receive or how much to update the map information according to the user's selection, the user's situation, and / or the state of the communication bandwidth.

[0593] In the content supply system ex100, the client can receive, decode, and play back the encoded information transmitted by the user in real time.

[0594] [Distribution of personal content] In addition, in the content supply system ex100, not only high-quality and long-duration content by video distributors but also unicast or multicast distribution of low-quality and short-duration content by individuals is possible. It is considered that such individual content will increase in the future. In order to make individual content into better content, the server may perform encoding processing after performing editing processing. This can be realized, for example, using the following configuration.

[0595] At the time of shooting in real time or accumulating and after shooting, the server performs recognition processing such as shooting error, scene search, semantic analysis, and object detection from the original image data or encoded data. Then, based on the recognition result, the server manually or automatically corrects out-of-focus or camera shake, deletes less important scenes such as scenes with lower brightness or out-of-focus compared to other pictures, emphasizes the edges of objects, or changes the color tone, etc. The server encodes the edited data based on the editing result. Also, it is known that if the shooting time is too long, the viewing rate will decrease. The server may automatically clip not only less important scenes but also scenes with little movement, etc., within a specific time range according to the shooting time, based on the image processing result, so that the content is within a specific time range. Or, the server may generate a digest based on the result of semantic analysis of the scene and encode it.

[0596] Personal content may sometimes contain elements that, as they are, would infringe copyrights, moral rights of the author, or portrait rights, etc., and may be inconvenient for individuals, such as when the sharing scope exceeds the intended scope. Therefore, for example, the server may deliberately change the image so that the faces of people in the peripheral part of the screen or the inside of a house are out of focus and then encode it. Furthermore, the server may recognize whether a face of a person different from the pre-registered person is reflected in the image to be encoded, and if so, perform processing such as applying a mosaic to the face part. Alternatively, as pre-processing or post-processing of encoding, the user may specify a person or background area that the user wants to process the image from the perspective of copyright, etc. The server may perform processing such as replacing the specified area with another video or blurring the focus. In the case of a person, in a moving image, the person can be tracked and the video of the face part of the person can be replaced.

[0597] Since the viewing of personal content with a small data volume has a strong requirement for real-time performance, depending on the bandwidth, the decoding device may first receive the base layer with the highest priority and perform decoding and playback. During this period, the decoding device may receive the enhancement layer and, when the playback is looped or played back two or more times, play back a high-quality video including the enhancement layer. For a stream with scalable encoding like this, the video is rough when not selected or at the beginning of viewing, but it can provide an experience where the stream gradually becomes smarter and the image quality improves. In addition to scalable encoding, a similar experience can be provided even if a rough stream played for the first time and a second stream encoded with reference to the first video are configured as one stream.

[0598] [Other implementation and application examples] Also, these encoding or decoding processes are generally processed in the LSIex500 that each terminal has. The LSI (large scale integration circuitry)ex500 (see FIG. 60) may be a one-chip configuration or a configuration consisting of multiple chips. Note that software for moving image encoding or decoding may be incorporated into some recording medium (such as a CD-ROM, a flexible disk, or a hard disk) readable by a computer ex111 or the like, and encoding or decoding processes may be performed using the software. Further, when the smartphone ex115 has a camera, moving image data acquired by the camera may be transmitted. The moving image data at this time may be data encoded by the LSIex500 that the smartphone ex115 has.

[0599] Note that the LSIex500 may be configured to download and activate application software. In this case, the terminal first determines whether the terminal supports the encoding method of the content or has the ability to execute a specific service. If the terminal does not support the encoding method of the content or does not have the ability to execute a specific service, the terminal may download a codec or application software and then acquire and play the content.

[0600] Also, not limited to the content supply system ex100 via the Internet ex101, at least either a moving image encoding device (image encoding device) or a moving image decoding device (image decoding device) of the above embodiments can be incorporated into a digital broadcast system. Since multiplexed data in which video and audio are multiplexed is carried on broadcast radio waves using a satellite or the like for transmission and reception, there is a difference in that it is more suitable for multicast compared to the unicast-oriented configuration of the content supply system ex100, but similar applications are possible for encoding and decoding processes.

[0601] [Hardware Configuration] FIG. 65 is a diagram showing further details of the smartphone ex115 shown in FIG. 60. Further, FIG. 66 is a diagram showing a configuration example of the smartphone ex115. The smartphone ex115 includes an antenna ex450 for transmitting and receiving radio waves to and from the base station ex110, a camera unit ex465 capable of capturing video and still images, and a display unit ex458 for displaying data obtained by decoding the video captured by the camera unit ex465 and the video received by the antenna ex450. The smartphone ex115 further includes an operation unit ex466 such as a touch panel, an audio output unit ex457 such as a speaker for outputting audio or sound, an audio input unit ex456 such as a microphone for inputting audio, a memory unit ex467 capable of storing the captured video or still images, the recorded audio, the received video or still images, the encoded data such as emails, or the decoded data, and a slot unit ex464 which is an interface unit for the SIM ex468 for identifying the user and authenticating access to various data including the network. Note that an external memory may be used instead of the memory unit ex467.

[0602] A main control unit ex460 capable of comprehensively controlling the display unit ex458, the operation unit ex466, etc., a power supply circuit unit ex461, an operation input control unit ex462, a video signal processing unit ex455, a camera interface unit ex463, a display control unit ex459, a modulation / demodulation unit ex452, a multiplexing / demultiplexing unit ex453, an audio signal processing unit ex454, a slot unit ex464, and a memory unit ex467 are connected via a synchronization bus ex470.

[0603] When the power key is turned on by the user's operation, the power supply circuit unit ex461 activates the smartphone ex115 to an operable state and supplies power to each unit from the battery pack.

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

[0605] When receiving a video attached to an email or chat, or a video linked to a web page, etc., in order to decode the multiplexed data received via the antenna ex450, the multiplexing / demultiplexing unit ex453 separates the multiplexed data into a bit stream of video data and a bit stream of audio data by separating the multiplexed data, and supplies the encoded video data to the video signal processing unit ex455 via the synchronization bus ex470, and supplies the encoded audio data to the audio signal processing unit ex454. The video signal processing unit ex455 decodes the video signal by a video decoding method corresponding to the moving image encoding method shown in each of the above embodiments, and the video or still image included in the linked moving image file is displayed from the display unit ex458 via the display control unit ex459. The audio signal processing unit ex454 decodes the audio signal, and the audio is output from the audio output unit ex457. Since real-time streaming is becoming increasingly popular, depending on the user's situation, it may not be socially appropriate to play the audio. Therefore, as an initial value, it is desirable to have a configuration that plays only the video data without playing the audio signal, and the audio may be played synchronously only when the user performs an operation such as clicking on the video data.

[0606] Also, although the smartphone ex115 has been described as an example here, as the terminal, in addition to the transceiver type terminal having both an encoder and a decoder, other implementation forms such as a transmitting terminal having only an encoder and a receiving terminal having only a decoder can be considered. In the digital broadcast system, it has been described as receiving or transmitting multiplexed data in which audio data is multiplexed with video data. However, in the multiplexed data, character data related to the video, etc. may be multiplexed in addition to the audio data. Also, instead of the multiplexed data, the video data itself may be received or transmitted.

[0607] Although the main control unit ex460 including the CPU has been described as controlling the encoding or decoding process, many types of terminals are also equipped with a GPU. Therefore, a configuration in which a wide area is processed collectively by taking advantage of the performance of the GPU using a memory shared by the CPU and the GPU or a memory whose addresses are managed so as to be commonly used may be adopted. This can shorten the encoding time, ensure real-time performance, and achieve low latency. In particular, it is efficient to perform motion search, deblocking filter, SAO (Sample Adaptive Offset), and transform / quantization processes in units such as pictures using the GPU instead of the CPU.

Industrial Applicability

[0608] The present disclosure can be applied to, for example, a television receiver, a digital video recorder, a car navigation system, a mobile phone, a digital camera, a digital video camera, a video conferencing system, or an electronic mirror.

Explanation of Signs

[0609] 100 Encoding device 102 Splitting unit 104 Subtraction unit 106 Transformation unit 108 Quantization unit 110 Entropy encoding unit 112, 204 Inverse quantization unit 114, 206 Inverse transformation unit 116, 208 Addition unit 118, 210 Block memory 120, 212 Loop filter unit 122, 214 Frame memory 124, 216 Intra prediction unit 126, 218 Inter prediction unit 128, 220 Prediction control unit 200 Decoding device 202 Entropy decoding unit 1201 Boundary determination unit 1202, 1204, 1206 Switch 1203 Filter Determination Unit 1205 Filter Processing Unit 1207 Filter Characteristic Determination Unit 1208 Processing Determination Unit a1, b1 Processors a2, b2 Memories

Claims

1. A circuit and a memory connected to the circuit, wherein in residual encoding of a current block, when an orthogonal transform using different syntaxes is applied and when the orthogonal transform is skipped, if a processing count limit of context adaptive encoding permits batch context adaptive encoding of a plurality of coefficient information flags regarding coefficients included in the current block, the circuit encodes the plurality of coefficient information flags by the context adaptive encoding and encodes a residual value of the coefficients by Golomb-Rice encoding; if the processing count limit does not permit batch context adaptive encoding of the plurality of coefficient information flags, the circuit skips encoding of the plurality of coefficient information flags and encodes values of the coefficients by Golomb-Rice encoding; when the orthogonal transform is skipped, after encoding the plurality of coefficient information flags and before encoding the residual value of the coefficients, the circuit encodes a plurality of absolute value flags regarding magnitudes of absolute values of the coefficients by the context adaptive encoding; the plurality of coefficient information flags include a flag indicating whether the coefficient is odd or even; an encoding device.

2. A circuit and a memory connected to the circuit, wherein in residual decoding of a current block, when an inverse orthogonal transform using different syntaxes is applied and when the inverse orthogonal transform is skipped, if a processing count limit of context adaptive decoding permits batch context adaptive decoding of a plurality of coefficient information flags regarding coefficients included in the current block, the circuit decodes the plurality of coefficient information flags by the context adaptive decoding and decodes a residual value of the coefficients by Golomb-Rice decoding; if the processing count limit does not permit batch context adaptive decoding of the plurality of coefficient information flags, the circuit skips decoding of the plurality of coefficient information flags and decodes values of the coefficients by Golomb-Rice decoding; when the inverse orthogonal transform is skipped, after decoding the plurality of coefficient information flags and before decoding the residual value of the coefficients, the circuit decodes a plurality of absolute value flags regarding magnitudes of absolute values of the coefficients by the context adaptive decoding; The plurality of coefficient information flags includes a flag indicating whether the coefficient is odd or even. Decoder. **Claim 3** A circuit; A memory connected to the circuit, In operation, the circuit Generates information for causing the decoder to perform residual decoding of a current block, Includes the information in a bit stream, In both the case where an inverse orthogonal transform using different syntaxes is applied and the case where the inverse orthogonal transform is skipped in the residual decoding of the current block, When the processing count limit of context adaptive decoding allows batch context adaptive decoding of a plurality of coefficient information flags related to the coefficients included in the current block, the plurality of coefficient information flags are decoded by the context adaptive decoding, and the residual values of the coefficients are decoded by Golomb-Rice decoding; When the processing count limit does not allow batch context adaptive decoding of the plurality of coefficient information flags, decoding of the plurality of coefficient information flags is skipped, and the values of the coefficients are decoded by Golomb-Rice decoding; When the inverse orthogonal transform is skipped, after decoding the plurality of coefficient information flags and before decoding the residual values of the coefficients, a plurality of absolute value flags related to the magnitudes of the absolute values of the coefficients are decoded by the context adaptive decoding; The plurality of coefficient information flags includes a flag indicating whether the coefficient is odd or even. Bit stream generation device.

Citation Information

Patent Citations

  • Binarizing secondary transform index

    US20170324643A1