Coding method and decoding method

By adjusting pixel values and applying asymmetric deblocking filters based on quantization parameters, the solution addresses the need for improved video coding techniques, specifically reducing errors at block boundaries for enhanced image quality and efficiency.

JP2025010299AActive Publication Date: 2025-01-20PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2024190270
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2016-12-27
Filing Date
2024-10-30
Publication Date
2025-01-20
Estimated Expiration
2037-12-21

AI Technical Summary

Technical Problem

Existing video coding techniques, such as HEVC, require further improvements in encoding and decoding processes to enhance image quality and efficiency, particularly in handling block boundaries during filtering.

Method used

The proposed solution involves adjusting pixel values of adjacent blocks to ensure that the amount of change within a clip width at block boundaries is controlled, using different clip widths based on quantization parameters, and applying asymmetric deblocking filter characteristics to reduce errors at block boundaries.

Benefits of technology

This approach effectively suppresses errors at block boundaries, improving image quality and encoding efficiency by minimizing the influence of large errors on small errors, thereby enhancing the overall encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025010299000001_ABST
    Figure 2025010299000001_ABST
Patent Text Reader

Abstract

To further realize an improvement.SOLUTION: In a coding method, a plurality of pixel values of a first block and a plurality of pixel values of a second block are changed so as to be that a change amount of each value becomes within a clip width in order to filter a boundary the first block and the second block that is adjacent to the first block, A plurality of pixel of the first block and a plurality of pixel of the second block are arranged along a line crossed to the boundary. The plurality of pixel of the first block contains a first pixel at a first position, and the plurality of pixel of the second block contains a second pixel at a second position corresponded to the first position while nipping the boundary. The crip width is selected on the basis of a quantization parameter. In the crip width, a first crip width corresponded to the first pixel and a second crip width corresponded to the second pixel are contained, and the first and second crip widths are different.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to an encoding device, a decoding device, an encoding method, and a decoding method. [Background technology]

[0002] A video coding standard called High-Efficiency Video Coding (HEVC) has been standardized by the Joint Collaborative Team on Video Coding (JCT-VC). [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] H.265(ISO / IEC 23008-2 HEVC(High Efficiency Video Coding)) Summary of the Invention [Problem to be solved by the invention]

[0004] Further improvements in such encoding and decoding techniques are required.

[0005] Therefore, an object of the present disclosure is to provide an encoding device, a decoding device, an encoding method, or a decoding method that can achieve further improvements. [Means for solving the problem]

[0006] An encoding method according to an embodiment of the present disclosure includes: filtering a boundary between a first block and a second block adjacent to the first block, changing values ​​of a plurality of pixels of the first block and values ​​of a plurality of pixels of the second block such that an amount of change in each value is within a clip width of each of the first block and the second block; encoding a third block included in a second picture different from the first picture by referring to a first picture including the first block and the second block after the filtering; the first block includes a first pixel at a first position and the second block includes a second pixel at a second position across the boundary corresponding to the first position, the clip width is selected based on a quantization parameter, the clip width includes a first clip width corresponding to the first pixel and a second clip width corresponding to the second pixel, the first clip width and the second clip width are different, the first block and the second block are adjacent to each other on the left and right, and the boundary is a vertical boundary.

[0007] A decoding method according to an embodiment of the present disclosure includes filtering a boundary between a first block and a second block adjacent to the first block, changing values ​​of a plurality of pixels of the first block and values ​​of a plurality of pixels of the second block such that a change in each value is within a clip width of each of the first block and the second block, and decoding a third coded block included in a second picture different from the first picture by referring to a first picture including the first block and the second block after the filtering, and filtering the boundary between the plurality of pixels of the first block and the plurality of pixels of the second block by filtering the boundary between the plurality of pixels of the first block and the plurality of pixels of the second block. the first block includes a first pixel at a first position and the second block includes a second pixel at a second position across the boundary corresponding to the first position; the clip width is selected based on a quantization parameter, the clip width includes a first clip width corresponding to the first pixel and a second clip width corresponding to the second pixel; the first clip width and the second clip width are different; the first block and the second block are adjacent to each other on the left and right; and the boundary is a vertical boundary.

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

[0009] The present disclosure can provide an encoding device, a decoding device, an encoding method, or a decoding method that can achieve further improvements. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a block diagram showing a functional configuration of a coding device according to the first embodiment. [Diagram 2] FIG. 2 is a diagram showing an example of block division according to the first embodiment. [Diagram 3] FIG. 3 is a table showing the transform basis functions corresponding to each transform type. [Figure 4A] FIG. 4A is a diagram showing an example of the shape of a filter used in ALF. [Figure 4B] FIG. 4B is a diagram showing another example of the shape of the filter used in the ALF. [Figure 4C] FIG. 4C is a diagram showing another example of the shape of the filter used in the ALF. [Figure 5A] FIG. 5A is a diagram showing 67 intra prediction modes in intra prediction. [Figure 5B] FIG. 5B is a flowchart for explaining an outline of the predicted image correction process by the OBMC process. [Figure 5C] FIG. 5C is a conceptual diagram for explaining an overview of the predicted image correction process by the OBMC process. [Figure 5D] FIG. 5D is a diagram showing an example of FRUC. [Figure 6] FIG. 6 is a diagram for explaining pattern matching (bilateral matching) between two blocks along a motion trajectory. [Figure 7] FIG. 7 is a diagram for explaining pattern matching (template matching) between a template in a current picture and a block in a reference picture. [Figure 8] FIG. 8 is a diagram for explaining a model assuming uniform linear motion. [Figure 9A] FIG. 9A is a diagram for explaining derivation of a motion vector for each sub-block based on motion vectors of a plurality of adjacent blocks. [Figure 9B] FIG. 9B is a diagram for explaining an overview of the motion vector derivation process in the merge mode. [Figure 9C] FIG. 9C is a conceptual diagram for explaining an overview of the DMVR process. [Figure 9D] FIG. 9D is a diagram for explaining an outline of a predicted image generating method using luminance correction processing by LIC processing. [Figure 10]FIG. 10 is a block diagram showing a functional configuration of a decoding device according to the first embodiment. As shown in FIG. [Figure 11] FIG. 11 is a flowchart of the deblocking filter process according to the first embodiment. [Figure 12] FIG. 12 is a diagram showing an example of a pixel arrangement on a block boundary according to the first embodiment. [Figure 13] FIG. 13 is a flowchart of the deblocking filter process according to the first embodiment. [Figure 14] FIG. 14 is a flowchart of the deblocking filter process according to the second embodiment. [Figure 15] FIG. 15 is a diagram showing the relationship between pixel positions in a block and errors according to the second embodiment. In FIG. [Figure 16] FIG. 16 is a flowchart of the deblocking filter process according to the third embodiment. [Figure 17] FIG. 17 is a diagram illustrating a transform basis of DCT-II according to the third embodiment. [Figure 18] FIG. 18 is a diagram illustrating a transformation base of the DST-VII according to the third embodiment. [Figure 19] FIG. 19 is a flowchart of the deblocking filter process according to the fourth embodiment. [Figure 20] FIG. 20 is a flowchart of the deblocking filter process according to the fifth embodiment. [Figure 21] FIG. 21 is a diagram showing an example of weights based on the intra prediction direction and the direction of a block boundary according to the fifth embodiment. [Figure 22] FIG. 22 is a flowchart of the deblocking filter process according to the sixth embodiment. [Diagram 23] FIG. 23 is a diagram showing an example of weights based on the quantization parameters according to the sixth embodiment. [Figure 24] FIG. 24 is a diagram showing DCT-II, which is an example of a basis. [Diagram 25] FIG. 25 is a diagram showing DST-VII, which is an example of a basis. [Figure 26] FIG. 26 is a diagram showing the error distribution of four adjacent blocks and the error distribution after the deblocking filter process therefor. [Figure 27] FIG. 27 is a block diagram showing a main configuration of a loop filter unit according to the seventh embodiment. As shown in FIG. [Figure 28] FIG. 28 is a flowchart illustrating a schematic processing operation of the loop filter unit according to the seventh embodiment. [Figure 29] FIG. 29 is a block diagram showing a detailed configuration of the loop filter unit according to the seventh embodiment. As shown in FIG. [Diagram 30] FIG. 30 is a diagram showing an example of a deblocking filter having filter characteristics that are symmetric with respect to block boundaries. [Diagram 31] FIG. 31 is a diagram showing an example of DCT-II for each block size. [Diagram 32] FIG. 32 is a diagram showing an example of DCT-V for each block size. [Diagram 33] FIG. 33 is a diagram showing an example of DCT-VIII for each block size. [Diagram 34] FIG. 34 is a diagram showing an example of DST-I for each block size. [Diagram 35] FIG. 35 is a diagram showing an example of DST-VII for each block size. [Diagram 36] FIG. 36 is a diagram showing an example of filter coefficients determined in the seventh embodiment. [Figure 37] FIG. 37 is a diagram showing another example of the filter coefficients determined in the seventh embodiment. In FIG. [Figure 38] FIG. 38 is a diagram showing still another example of filter coefficients determined in the seventh embodiment. [Figure 39] FIG. 39 is a diagram for explaining the relationship between the block size and the error. [Diagram 40] FIG. 40 is a diagram showing still another example of filter coefficients determined in the seventh embodiment. [Diagram 41]FIG. 41 is a diagram showing gradients of different bases depending on block size. [Diagram 42] FIG. 42 is a block diagram showing an implementation example of the encoding device according to each embodiment. [Diagram 43] FIG. 43 is a block diagram showing an implementation example of the decoding device according to each embodiment. [Diagram 44] FIG. 44 is a diagram showing the overall configuration of a content supply system that realizes a content distribution service. [Diagram 45] FIG. 45 is a diagram showing an example of a coding structure in scalable coding. [Diagram 46] FIG. 46 is a diagram showing an example of a coding structure in scalable coding. [Figure 47] FIG. 47 is a diagram showing an example of a display screen of a web page. [Figure 48] FIG. 48 is a diagram showing an example of a display screen of a web page. [Figure 49] FIG. 49 is a diagram illustrating an example of a smartphone. [Figure 50] FIG. 50 is a block diagram showing an example configuration of a smartphone. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] An encoding device according to one embodiment of the present disclosure includes a processing circuit and a memory, and the processing circuit uses the memory to transform, for each block consisting of a plurality of pixels, a block consisting of a plurality of transform coefficients using a basis, and for each block consisting of the plurality of transform coefficients, reconstructs a block consisting of a plurality of pixels by performing at least an inverse transform on the block, and determines filter characteristics for the boundary between the two blocks based on a combination of bases used in the transformation of each of the two reconstructed adjacent blocks, and performs a deblocking filter process having the determined filter characteristics.

[0012] Depending on the combination of bases used in the transformation of two adjacent blocks, the error distribution near the boundary between the two blocks is different. For example, the transformation of two blocks may cause a large error near the boundary of one of the two blocks and a small error near the boundary of the other block. This error is the difference between the pixel values ​​of the original image or input image and the reconstructed image. In such a case, if a deblocking filter process having a filter characteristic symmetrical with respect to the boundary is performed, the pixel value of the small error may be significantly affected by the pixel value of the large error. In other words, the error may not be sufficiently suppressed. Therefore, in the encoding device according to one aspect of the present disclosure, the filter characteristic for the boundary between the two blocks is determined based on the combination of bases used in the transformation of each of the two adjacent reconstructed blocks. This makes it possible to determine, for example, a filter characteristic asymmetrical with respect to the boundary. As a result, even if there is a difference in error near the boundary between the two blocks as described above, the possibility of suppressing the error can be increased by performing a deblocking filter process having an asymmetric filter characteristic.

[0013] In addition, in determining the filter characteristics, the processing circuit may determine, as the filter characteristics, a smaller filter coefficient for a pixel located at a position where the amplitude of the basis used in transforming the block is larger.

[0014] For example, the pixel at the position where the amplitude of the basis is large is more likely to have a large error in the pixel value of the pixel. In the encoding device according to one aspect of the present disclosure, a small filter coefficient is determined for the pixel having the pixel value of the large error. Therefore, by the deblocking filter process having such a filter coefficient, the influence of the pixel value of the large error on the pixel value of the small error can be further suppressed. In other words, the possibility of suppressing the error can be further increased.

[0015] Furthermore, the amplitude of the basis may be the amplitude of a zeroth order basis.

[0016] The lower the order of the basis, the greater the effect on the error. Therefore, the larger the amplitude of the zero-order basis is, the smaller the filter coefficient is determined for that pixel, which further increases the possibility of suppressing the error.

[0017] The two blocks may be a first block and a second block located to the right or below the first block, and the processing circuit may determine, when a base used in transforming the first block is a first base and a base used in transforming the second block is a second base, a first filter coefficient for pixels located near the boundary in the first block and a second filter coefficient for pixels located near the boundary in the second block, as the filter characteristics, based on the first base and the second base. For example, when the first base and the second base are DST (Discrete Sine Transforms)-VII, the processing circuit may determine, when determining the filter characteristics, the second filter coefficient larger than the first filter coefficient.

[0018] When the first base and the second base are DST-VII, there is a high possibility that the error is large near the boundary of the first block and the error is small near the boundary of the second block. Therefore, in such a case, the second filter coefficient larger than the first filter coefficient is determined, and the deblocking filter process having these first and second filter coefficients is performed, so that the possibility of appropriately suppressing the error near the boundary can be increased.

[0019] In addition, when determining the filter characteristics, the processing circuit may determine, when the first basis and the second basis are DCT (Discrete Cosine Transforms)-II, the second filter coefficient that is equal to the first filter coefficient as the filter characteristics.

[0020] When the first basis and the second basis are DCT-II, there is a high possibility that the error is equal between the boundary of the first block and the boundary of the second block. Therefore, in this case, the second filter coefficient equal to the first filter coefficient is determined, and the deblocking filter process using the first and second filter coefficients is performed, so that the possibility of appropriately suppressing the error in the boundary can be increased.

[0021] Furthermore, in determining the filter characteristics, when the first basis and the second basis are DST (Discrete Sine Transforms)-VII and the size of the second block is smaller than the size of the first block, the processing circuit may determine the second filter coefficient larger than the first filter coefficient as the filter characteristics, and a slope of the filter coefficient between the first filter coefficient and the second filter coefficient may be gentler than when the sizes of the first block and the second block are equal.

[0022] When the first and second bases are DST-VII and the size of the second block is smaller than the size of the first block, there is a high possibility that the error is large near the boundary of block 1 and the error is at a medium level near the boundary of the second block. In other words, there is a high possibility that the error distribution near the boundary between the first block and the second block has a gentle gradient.

[0023] In such a case, in the encoding device according to an embodiment of the present disclosure, a second filter coefficient larger than the first filter coefficient is determined, and a deblocking filter process is performed using these first and second filter coefficients. Here, the slope of the filter coefficient between the determined first filter coefficient and the second filter coefficient is gentler than when the sizes of the first block and the second block are equal. Therefore, even if the error distribution near the boundary between the first block and the second block has a gentle slope, it is possible to increase the possibility of appropriately suppressing the error near the boundary.

[0024] In addition, the processing circuit may further determine, in determining the filter characteristics, a first threshold value for the first block and a second threshold value for the second block as the filter characteristics based on a combination of bases of the first block and the second block, and in the deblocking filter process, obtain a post-operation pixel value of the target pixel by performing an operation using the first filter coefficient and the second filter coefficient on a pixel value of the target pixel, determine whether or not an amount of change from the pixel value of the target pixel before the operation to the pixel value after the operation is greater than the first threshold value or the second threshold value, which is a threshold value of the block to which the target pixel belongs, and if the amount of change is greater than the threshold value, clip the post-operation pixel value of the target pixel to a sum or difference between the pixel value of the target pixel before the operation and the threshold value.

[0025] As a result, when the change amount of the pixel value after the operation of the target pixel is larger than the threshold, the pixel value after the operation is clipped to the sum or difference between the pixel value before the operation and the threshold, so that the pixel value of the target pixel can be prevented from being significantly changed by the deblocking filter process. In addition, the first threshold value for the first block and the second threshold value for the second block are determined based on the combination of the bases of the first block and the second block. Therefore, in each of the first block and the second block, a large threshold value can be determined for pixels at positions where the amplitude of the base is large, i.e., pixels with large errors, and a small threshold value can be determined for pixels at positions where the amplitude of the base is small, i.e., pixels with small errors. As a result, the deblocking filter process allows the pixel value of a pixel with a large error to be significantly changed, and prohibits the pixel value of a pixel with a small error from being significantly changed. Therefore, the possibility of appropriately suppressing errors near the boundary between the first block and the second block can be further increased.

[0026] Also, an encoding device according to an aspect of the present disclosure includes a processing circuit and a memory, and the processing circuit uses the memory to determine filter characteristics for a boundary between the first block and the second block based on block sizes of the first block and a second block adjacent to the first block, and performs a deblocking filter process with the determined filter characteristics. For example, in determining the filter characteristics, the processing circuit may determine a first filter coefficient for pixels in the first block near the boundary and a second filter coefficient for pixels in the second block near the boundary as the filter characteristics, and when a size of the second block is smaller than a size of the first block, determine the second filter coefficient larger than the first filter coefficient as the filter characteristic.

[0027] This allows, for example, filter characteristics that are asymmetric with respect to the boundary to be determined according to the difference in block size. As a result, even if there is a difference in error near the boundary between two blocks as described above, the possibility of suppressing the error can be increased by performing deblocking filter processing with asymmetric filter characteristics.

[0028] A decoding device according to one embodiment of the present disclosure includes a processing circuit and a memory, and the processing circuit uses the memory to reconstruct a block consisting of a plurality of pixels by performing at least an inverse transform on each block consisting of a plurality of transform coefficients obtained by transform using a basis, determines filter characteristics for the boundary between the two blocks based on a combination of bases used in the transform of each of the two reconstructed adjacent blocks, and performs a deblocking filter process having the determined filter characteristics.

[0029] Depending on the combination of bases used in the transformation of two adjacent blocks, the error distribution near the boundary between the two blocks is different. For example, the transformation of two blocks may cause a large error near the boundary of one of the two blocks and a small error near the boundary of the other block. This error is the difference between the pixel values ​​of the original image or input image and the reconstructed image. In such a case, if a deblocking filter process having a filter characteristic symmetrical with respect to the boundary is performed, the pixel value of the small error may be significantly affected by the pixel value of the large error. In other words, the error may not be sufficiently suppressed. Therefore, in a decoding device according to one aspect of the present disclosure, the filter characteristic for the boundary between the two blocks is determined based on the combination of bases used in the transformation of each of the two adjacent reconstructed blocks. This makes it possible to determine, for example, a filter characteristic asymmetrical with respect to the boundary. As a result, even if there is a difference in error near the boundary between the two blocks as described above, the possibility of suppressing the error can be increased by performing a deblocking filter process having an asymmetric filter characteristic.

[0030] In addition, in determining the filter characteristics, the processing circuit may determine, as the filter characteristics, a smaller filter coefficient for a pixel located at a position where the amplitude of the basis used in transforming the block is larger.

[0031] For example, the pixel at the position where the amplitude of the basis is large is more likely to have a large error in the pixel value of the pixel. In the decoding device according to one aspect of the present disclosure, a small filter coefficient is determined for the pixel having the pixel value of the large error. Therefore, by the deblocking filter process having such a filter coefficient, the influence of the pixel value of the large error on the pixel value of the small error can be further suppressed. In other words, the possibility of suppressing the error can be further increased.

[0032] Furthermore, the amplitude of the basis may be the amplitude of a zeroth order basis.

[0033] The lower the order of the basis, the greater the effect on the error. Therefore, the larger the amplitude of the zero-order basis is, the smaller the filter coefficient is determined for that pixel, which further increases the possibility of suppressing the error.

[0034] The two blocks may be a first block and a second block located to the right or below the first block, and the processing circuit may determine, when a base used in transforming the first block is a first base and a base used in transforming the second block is a second base, a first filter coefficient for pixels located near the boundary in the first block and a second filter coefficient for pixels located near the boundary in the second block, as the filter characteristics, based on the first base and the second base. For example, when the first base and the second base are DST (Discrete Sine Transforms)-VII, the processing circuit may determine, when determining the filter characteristics, the second filter coefficient larger than the first filter coefficient.

[0035] When the first base and the second base are DST-VII, there is a high possibility that the error is large near the boundary of the first block and the error is small near the boundary of the second block. Therefore, in such a case, the second filter coefficient larger than the first filter coefficient is determined, and the deblocking filter process having these first and second filter coefficients is performed, so that the possibility of appropriately suppressing the error near the boundary can be increased.

[0036] In addition, when determining the filter characteristics, the processing circuit may determine, when the first basis and the second basis are DCT (Discrete Cosine Transforms)-II, the second filter coefficient that is equal to the first filter coefficient as the filter characteristics.

[0037] When the first basis and the second basis are DCT-II, there is a high possibility that the error is equal between the boundary of the first block and the boundary of the second block. Therefore, in this case, the second filter coefficient equal to the first filter coefficient is determined, and the deblocking filter process using the first and second filter coefficients is performed, so that the possibility of appropriately suppressing the error in the boundary can be increased.

[0038] Furthermore, in determining the filter characteristics, when the first basis and the second basis are DST (Discrete Sine Transforms)-VII and the size of the second block is smaller than the size of the first block, the processing circuit may determine the second filter coefficient larger than the first filter coefficient as the filter characteristics, and a slope of the filter coefficient between the first filter coefficient and the second filter coefficient may be gentler than when the sizes of the first block and the second block are equal.

[0039] When the first and second bases are DST-VII and the size of the second block is smaller than the size of the first block, there is a high possibility that the error is large near the boundary of block 1 and the error is at a medium level near the boundary of the second block. In other words, there is a high possibility that the error distribution near the boundary between the first block and the second block has a gentle gradient.

[0040] In such a case, in the decoding device according to an embodiment of the present disclosure, a second filter coefficient that is larger than the first filter coefficient is determined, and a deblocking filter process is performed using these first and second filter coefficients.Here, the slope of the filter coefficient between the determined first filter coefficient and the second filter coefficient is gentler than when the sizes of the first block and the second block are equal.Therefore, even if the error distribution near the boundary between the first block and the second block has a gentle slope, it is possible to increase the possibility of appropriately suppressing the error near the boundary.

[0041] In addition, the processing circuit may further determine, in determining the filter characteristics, a first threshold value for the first block and a second threshold value for the second block as the filter characteristics based on a combination of bases of the first block and the second block, and in the deblocking filter process, obtain a post-operation pixel value of the target pixel by performing an operation using the first filter coefficient and the second filter coefficient on a pixel value of the target pixel, determine whether or not an amount of change from the pixel value of the target pixel before the operation to the pixel value after the operation is greater than the first threshold value or the second threshold value, which is a threshold value of the block to which the target pixel belongs, and if the amount of change is greater than the threshold value, clip the post-operation pixel value of the target pixel to a sum or difference between the pixel value of the target pixel before the operation and the threshold value.

[0042] As a result, when the change amount of the pixel value after the operation of the target pixel is larger than the threshold, the pixel value after the operation is clipped to the sum or difference between the pixel value before the operation and the threshold, so that the pixel value of the target pixel can be prevented from being significantly changed by the deblocking filter process. In addition, the first threshold value for the first block and the second threshold value for the second block are determined based on the combination of the bases of the first block and the second block. Therefore, in each of the first block and the second block, a large threshold value can be determined for pixels at positions where the amplitude of the base is large, i.e., pixels with large errors, and a small threshold value can be determined for pixels at positions where the amplitude of the base is small, i.e., pixels with small errors. As a result, the deblocking filter process allows the pixel value of a pixel with a large error to be significantly changed, and prohibits the pixel value of a pixel with a small error from being significantly changed. Therefore, the possibility of appropriately suppressing errors near the boundary between the first block and the second block can be further increased.

[0043] Also, a decoding device according to an aspect of the present disclosure includes a processing circuit and a memory, and the processing circuit uses the memory to determine filter characteristics for a boundary between the first block and the second block based on block sizes of the first block and a second block adjacent to the first block, and performs a deblocking filter process with the determined filter characteristics. For example, in determining the filter characteristics, the processing circuit may determine a first filter coefficient for a pixel in the first block near the boundary and a second filter coefficient for a pixel in the second block near the boundary as the filter characteristics, and when a size of the second block is smaller than a size of the first block, determine the second filter coefficient larger than the first filter coefficient as the filter characteristic.

[0044] This allows, for example, filter characteristics that are asymmetric with respect to the boundary to be determined according to the difference in block size. As a result, even if there is a difference in error near the boundary between two blocks as described above, the possibility of suppressing the error can be increased by performing deblocking filter processing with asymmetric filter characteristics.

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

[0046] Hereinafter, the embodiment will be described in detail with reference to the drawings.

[0047] The embodiments described below are all comprehensive or specific examples. The numerical values, shapes, materials, components, component arrangement and connection forms, steps, and order of steps shown in the following embodiments are merely examples and are not intended to limit the scope of the claims. Furthermore, among the components in the following embodiments, components that are not described in an independent claim showing a top concept are described as optional components.

[0048] (Embodiment 1) First, an overview of the first embodiment will be described as an example of an encoding device and a decoding device to which the processes and / or configurations described in each aspect of the present disclosure can be applied. However, the first embodiment is merely an example of an encoding device and a decoding device to which the processes and / or configurations described in each aspect of the present disclosure can be applied, and the processes and / or configurations described in each aspect of the present disclosure can also be implemented in encoding devices and decoding devices different from the first embodiment.

[0049] When applying the processing and / or configurations described in each aspect of the present disclosure to the first embodiment, for example, any of the following may be performed.

[0050] (1) For the encoding device or the decoding device of the first embodiment, among the multiple components constituting the encoding device or the decoding device, components corresponding to the components described in each aspect of the present disclosure are replaced with the components described in each aspect of the present disclosure. (2) In the encoding device or decoding device of the first embodiment, any modification such as addition, replacement, or deletion of functions or processes performed by some of the components constituting the encoding device or decoding device is made, and then the components corresponding to the components described in each aspect of the present disclosure are replaced with the components described in each aspect of the present disclosure. (3) Adding a process to the method implemented by the encoding device or decoding device of the first embodiment, and / or replacing or deleting some of the processes included in the method, and then replacing the process corresponding to the process described in each aspect of the present disclosure with the process described in each aspect of the present disclosure. (4) Some of the components constituting the encoding device or decoding device of the first embodiment may be implemented in combination with components described in each aspect of the present disclosure, components having some of the functions of the components described in each aspect of the present disclosure, or components performing some of the processing performed by the components described in each aspect of the present disclosure. (5) Implementing a component having some of the functions of some of the multiple components constituting the encoding device or decoding device of embodiment 1, or a component that performs some of the processing performed by some of the multiple components constituting the encoding device or decoding device of embodiment 1, in combination with a component described in each aspect of the present disclosure, a component having some of the functions of the component described in each aspect of the present disclosure, or a component that performs some of the processing performed by the component described in each aspect of the present disclosure. (6) In the method implemented by the encoding device or the decoding device of the first embodiment, among a plurality of processes included in the method, a process corresponding to a process described in each aspect of the present disclosure is replaced with a process described in each aspect of the present disclosure. (7) Some of the processes included in the method implemented by the encoding device or the decoding device of the first embodiment may be implemented in combination with the processes described in each aspect of the present disclosure.

[0051] It should be noted that the manner of implementing the processes and / or configurations described in each aspect of the present disclosure is not limited to the above examples. For example, the processes and / or configurations may be implemented in a device used for a purpose other than the video / image encoding device or video / image decoding device disclosed in the first embodiment, or the processes and / or configurations described in each aspect may be implemented independently. Furthermore, the processes and / or configurations described in different aspects may be implemented in combination.

[0052] [Outline of the encoding device] First, a description will be given of an overview of a coding device according to embodiment 1. Fig. 1 is a block diagram showing a functional configuration of a coding device 100 according to embodiment 1. The coding device 100 is a video / image coding device that codes a video / image on a block-by-block basis.

[0053] As shown in FIG. 1, the encoding device 100 is a device that encodes an image on a block-by-block basis, and includes a division unit 102, a subtraction unit 104, a transformation unit 106, a quantization unit 108, an entropy encoding unit 110, an inverse quantization unit 112, an inverse transformation unit 114, an addition unit 116, a block memory 118, a loop filter unit 120, a frame memory 122, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128.

[0054] The encoding device 100 is realized by, for example, a general-purpose processor and a memory. In this case, when the software program stored in the memory is executed by the processor, the processor functions as the division unit 102, the subtraction unit 104, the transformation unit 106, the quantization unit 108, the entropy coding unit 110, the inverse quantization unit 112, the inverse transformation 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. The encoding device 100 may also be realized as one or more dedicated electronic circuits corresponding to the division unit 102, the subtraction unit 104, the transformation unit 106, the quantization unit 108, the entropy coding unit 110, the inverse quantization unit 112, the inverse transformation 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.

[0055] Each component included in the encoding device 100 will be described below.

[0056] [Divided part] The division unit 102 divides each picture included in the input video into a plurality of blocks, and outputs each block to the subtraction unit 104. For example, the division unit 102 first divides a picture into blocks of a fixed size (e.g., 128x128). These fixed-size blocks may be called coding tree units (CTUs). The division unit 102 then divides each of the fixed-size blocks into blocks of a variable size (e.g., 64x64 or less) based on recursive quadtree and / or binary tree block division. These variable-size blocks may be called coding units (CUs), prediction units (PUs), or transform units (TUs). Note that in this embodiment, it is not necessary to distinguish between CUs, PUs, and TUs, and some or all of the blocks in a picture may be the processing units of CUs, PUs, and TUs.

[0057] Fig. 2 is a diagram showing an example of block division according to embodiment 1. In Fig. 2, solid lines represent block boundaries based on quadtree block division, and dashed lines represent block boundaries based on binary tree block division.

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

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

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

[0061] The bottom left 64x64 block is divided into four square 32x32 blocks (quadtree block division). Of the four 32x32 blocks, the top left and bottom right blocks are further divided. The top left 32x32 block is divided vertically into two rectangular 16x32 blocks, and the right 16x32 block is further divided horizontally into two 16x16 blocks (binary tree block division). The bottom right 32x32 block is divided horizontally into two 32x16 blocks (binary tree block division). As a result, the bottom 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.

[0062] The bottom right 64x64 block 23 is not split.

[0063] 2, the block 10 is divided into 13 variable-sized blocks 11 to 23 based on recursive quad-tree and binary tree block division. Such division is sometimes called QTBT (quad-tree plus binary tree) division.

[0064] In Fig. 2, one block is divided into four or two blocks (quadtree or binary tree block division), but the division is not limited to this. For example, one block may be divided into three blocks (ternary tree block division). Division including such ternary tree block division is sometimes called MBT (multi type tree) division.

[0065] [Subtraction section] The subtraction unit 104 subtracts a prediction signal (prediction sample) from an original signal (original sample) for each block divided by the division unit 102. That is, the subtraction unit 104 calculates a prediction error (also called a residual error) of a block to be coded (hereinafter, referred to as a current block). Then, the subtraction unit 104 outputs the calculated prediction error to the conversion unit 106.

[0066] The original signal is an input signal to the encoding device 100, and is a signal representing an image of each picture constituting a 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.

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

[0068] The transform unit 106 may adaptively select a transform type from among a plurality of transform types, and transform the prediction errors into transform coefficients using a transform basis function corresponding to the selected transform type. Such a transform may be called an explicit multiple core transform (EMT) or an adaptive multiple transform (AMT).

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

[0070] Such information indicating whether EMT or AMT is applied (e.g., called an AMT flag) and information indicating the selected transformation type are signaled at the CU level. Note that the signaling of such information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, or CTU level).

[0071] Furthermore, the transform unit 106 may retransform the transform coefficients (transformation results). Such retransformation may be called AST (adaptive secondary transform) or NSST (non-separable secondary transform). For example, the transform unit 106 performs retransformation for each subblock (e.g., 4x4 subblock) included in a block of transform coefficients corresponding to intra-prediction errors. Information indicating whether or not to apply NSST and information regarding a transform matrix used in NSST are signaled at a CU level. Note that signaling of these pieces of information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, or CTU level).

[0072] Here, a separable transformation is a method in which the transformation is performed multiple times by separating the input into directions equal to the number of dimensions, and a non-separable transformation is a method in which when the input is multidimensional, two or more dimensions are treated as one dimension and the transformation is performed together.

[0073] For example, one example of a non-separable transformation is when the input is a 4x4 block, it is treated as a single array with 16 elements, and a 16x16 transformation matrix is ​​used to transform the array.

[0074] Another example of a non-separable transformation is the Hypercube Givens Transform, which treats a 4x4 input block as a single array with 16 elements and then performs Givens rotations on that array multiple times.

[0075] [Quantization section] 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 a quantization parameter (QP) corresponding to the scanned transform coefficients. Then, the quantization unit 108 outputs the quantized transform coefficients of the current block (hereinafter, referred to as quantized coefficients) to the entropy coding unit 110 and the inverse quantization unit 112.

[0076] The predetermined order is an order for quantization / dequantization of the transform coefficients. For example, the predetermined scanning order is defined as ascending (low to high) or descending (high to low) frequency order.

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

[0078] [Entropy coding part] The entropy coding unit 110 generates a coded signal (coded bit stream) by variable-length coding the quantized coefficients input from the quantization unit 108. Specifically, the entropy coding unit 110, for example, binarizes the quantized coefficients and arithmetically codes the binary signal.

[0079] [Dequantization section] The inverse quantization unit 112 inverse quantizes the quantized coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inverse quantizes the quantized coefficients of the current block in a predetermined scanning order. Then, the inverse quantization unit 112 outputs the inverse quantized transform coefficients of the current block to the inverse transform unit 114.

[0080] [Inverse conversion section] The inverse transform unit 114 restores the prediction error by inverse transforming the transform coefficients that are input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 restores the prediction error of the current block by performing an inverse transform on the transform coefficients that corresponds to the transform performed by the transform unit 106. Then, the inverse transform unit 114 outputs the restored prediction error to the adder unit 116.

[0081] Note that the restored prediction error does not match the prediction error calculated by the subtraction unit 104 because information has been lost due to quantization. That is, the restored prediction error includes a quantization error.

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

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

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

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

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

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

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

[0089] The shape of the filter used in the ALF is, for example, a circularly symmetric shape. FIGS. 4A to 4C are diagrams showing a number of examples of the shape of the filter used in the ALF. FIG. 4A shows a 5×5 diamond-shaped filter, FIG. 4B shows a 7×7 diamond-shaped filter, and FIG. 4C shows a 9×9 diamond-shaped filter. Information indicating the shape of the filter is signaled at the picture level. Note that the signaling of the information indicating the shape of the filter does not need to be limited to the picture level, and may be at other levels (for example, the sequence level, slice level, tile level, CTU level, or CU level).

[0090] The on / off of ALF is determined, for example, at the picture level or the CU level. For example, whether or not to apply ALF is determined for luminance at the CU level, and whether or not to apply ALF is determined for chrominance at the picture level. Information indicating whether or not to apply ALF is signaled at the picture level or the CU level. Note that the signaling of information indicating whether or not to apply ALF is not limited to the picture level or the CU level, and may be at another level (for example, the sequence level, the slice level, the tile level, or the CTU level).

[0091] The coefficient sets of multiple selectable filters (e.g., up to 15 or 25 filters) are signaled at the picture level. Note that the signaling of the coefficient sets does not need to be limited to the picture level, but may be at other levels (e.g., sequence level, slice level, tile level, CTU level, CU level, or sub-block level).

[0092] [Frame memory] The frame memory 122 is a storage unit for storing reference pictures used in inter prediction, and may be called a frame buffer. Specifically, the frame memory 122 stores the reconstructed block filtered by the loop filter unit 120.

[0093] [Intra prediction section] The intra prediction unit 124 generates a prediction signal (intra prediction signal) by performing intra prediction (also called intra-screen prediction) of the current block with reference to a 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 (e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra prediction signal to the prediction control unit 128.

[0094] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of predefined intra prediction modes. The plurality of intra prediction modes includes one or more non-directional prediction modes and a plurality of directional prediction modes.

[0095] The one or more non-directional prediction modes include, for example, a planar prediction mode and a DC prediction mode defined in the H.265 / High-Efficiency Video Coding (HEVC) standard (Non-Patent Document 1).

[0096] The multiple directional prediction modes include, for example, 33 prediction modes defined in the H.265 / HEVC standard. The multiple directional prediction modes may include 32 prediction modes in addition to the 33 directions (a total of 65 directional prediction modes). FIG. 5A is a diagram showing 67 intra prediction modes (2 non-directional prediction modes and 65 directional prediction modes) in intra prediction. The solid arrows represent the 33 directions defined in the H.265 / HEVC standard, and the dashed arrows represent the additional 32 directions.

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

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

[0099] [Inter prediction section] The inter prediction unit 126 generates a prediction signal (inter prediction signal) by performing inter prediction (also called inter 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 sub-block (e.g., 4x4 block) in the current block. For example, the inter prediction unit 126 performs motion estimation in the reference picture for the current block or the sub-block. Then, the inter prediction unit 126 generates an inter prediction signal of the current block or the sub-block by performing motion compensation using motion information (e.g., a motion vector) obtained by the motion estimation. Then, the inter prediction unit 126 outputs the generated inter prediction signal to the prediction control unit 128.

[0100] The motion information used for the motion compensation is signaled. For the signaling of the motion vector, a motion vector predictor may be used, i.e. the difference between the motion vector and the motion vector predictor may be signaled.

[0101] In addition, the 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 the adjacent block. Specifically, the inter prediction signal may be generated for each sub-block in the current block by performing weighted addition of the prediction signal based on the motion information obtained by motion search and the prediction signal based on the motion information of the adjacent block. Such inter prediction (motion compensation) may be called OBMC (overlapped block motion compensation).

[0102] In such an OBMC mode, information indicating the size of a sub-block for OBMC (e.g., called OBMC block size) is signaled at the sequence level. Also, information indicating whether or not to apply the OBMC mode (e.g., called OBMC flag) is signaled at the CU level. Note that the signaling level of these pieces of information does not need to be limited to the sequence level and CU level, and may be other levels (e.g., picture level, slice level, tile level, CTU level, or sub-block level).

[0103] The OBMC mode will now be described in more detail. Figures 5B and 5C are a flowchart and a conceptual diagram for explaining an overview of the predicted image correction process in the OBMC process.

[0104] First, a predicted image (Pred) is obtained by normal motion compensation using a motion vector (MV) assigned to a block to be coded.

[0105] Next, the motion vector (MV_L) of the already-encoded left adjacent block is applied to the block to be encoded to obtain a predicted image (Pred_L), and the predicted image is weighted and superimposed with Pred_L to perform a first correction of the predicted image.

[0106] Similarly, the motion vector (MV_U) of the already-encoded adjacent block above is applied to the block to be encoded to obtain a predicted image (Pred_U), and the predicted image that has been corrected the first time is weighted and overlaid with Pred_U to perform a second correction of the predicted image, which is then used as the final predicted image.

[0107] Although a two-stage correction method using the left adjacent block and the upper adjacent block has been described here, it is also possible to configure a method in which more than two stages of correction are performed using the right adjacent block or the lower adjacent block.

[0108] The area in which overlapping is performed does not have to be the entire pixel area of ​​the block, but may be only a part of the area near the block boundary.

[0109] Note that although the above describes the process of correcting a predicted image from one reference picture, the process is similar when correcting a predicted image from multiple reference pictures. After obtaining corrected predicted images from each reference picture, the obtained predicted images are then overlaid to obtain the final predicted image.

[0110] The block to be processed may be a prediction block unit, or a sub-block unit obtained by further dividing the prediction block.

[0111] As a method of determining whether or not to apply OBMC processing, for example, there is a method of using obmc_flag, which is a signal indicating whether or not to apply OBMC processing. As a specific example, in an encoding device, it is determined whether or not the encoding target block belongs to an area with complex motion, and if it belongs to an area with complex motion, a value of 1 is set as obmc_flag and encoding is performed by applying OBMC processing, and if it does not belong to an area with complex motion, a value of 0 is set as obmc_flag and encoding is performed without applying OBMC processing. On the other hand, in a decoding device, by decoding obmc_flag described in a stream, whether or not to apply OBMC processing is switched according to the value, and decoding is performed.

[0112] In addition, the motion information may be derived on the decoding device side without being signaled. For example, a merge mode defined in the H.265 / HEVC standard may be used. Also, for example, the motion information may be derived by performing motion estimation on the decoding device side. In this case, the motion estimation is performed without using pixel values ​​of the current block.

[0113] Here, a mode in which motion estimation is performed on the decoding device side will be described. This mode in which motion estimation is performed on the decoding device side is sometimes called a pattern matched motion vector derivation (PMMVD) mode or a frame rate up-conversion (FRUC) mode.

[0114] An example of the FRUC process is shown in FIG. 5D. First, a list of multiple candidates (which may be the same as the merge list) each having a predicted motion vector is generated by referring to the motion vectors of encoded blocks spatially or temporally adjacent to the current block. Next, a best candidate MV is selected from multiple candidate MVs registered in the candidate list. For example, an evaluation value of each candidate included in the candidate list is calculated, and one candidate is selected based on the evaluation value.

[0115] Then, based on the motion vector of the selected candidate, a motion vector for the current block is derived. Specifically, for example, the motion vector of the selected candidate (best candidate MV) is derived as it is as the motion vector for the current block. Also, for example, the motion vector for the current block may be derived by performing pattern matching in the surrounding area of ​​the position in the reference picture corresponding to the motion vector of the selected candidate. That is, a search is performed in the surrounding area of ​​the best candidate MV in the same manner, and if there is an MV with a better evaluation value, the best candidate MV may be updated to the MV, and the MV may be set as the final MV of the current block. It is also possible to configure the system without performing this process.

[0116] The same processing may be performed when processing is performed in sub-block units.

[0117] The evaluation value is calculated by finding a difference value of the reconstructed image by pattern matching between an area in a reference picture corresponding to the motion vector and a predetermined area. The evaluation value may be calculated using information other than the difference value.

[0118] As the pattern matching, a first pattern matching or a second pattern matching is used. The first pattern matching and the second pattern matching are sometimes called bilateral matching and template matching, respectively.

[0119] In the first pattern matching, pattern matching is performed between two blocks in two different reference pictures that are along the motion trajectory of the current block. Therefore, in the first pattern matching, an area in another reference picture along the motion trajectory of the current block is used as a predetermined area for calculating the evaluation value of the above-mentioned candidate.

[0120] FIG. 6 is a diagram for explaining an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. As shown in FIG. 6, in the first pattern matching, two motion vectors (MV0, MV1) are derived by searching for a pair of two blocks that are along the motion trajectory of a current block (Cur block) and are in two different reference pictures (Ref0, Ref1) that best match each other. Specifically, for the current block, a difference is derived between a reconstructed image at a designated position in a first coded reference picture (Ref0) designated by a candidate MV and a reconstructed image at a designated position in a second coded reference picture (Ref1) designated by a symmetric MV obtained by scaling the candidate MV by a display time interval, and an evaluation value is calculated using the obtained difference value. It is preferable to select the candidate MV with the best evaluation value among a plurality of candidate MVs as the final MV.

[0121] Under the assumption of continuous motion trajectories, the motion vectors (MV0, MV1) pointing to two reference blocks are proportional to the temporal distances (TD0, TD1) between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, if the current picture is located between two reference pictures in time and the temporal distances from the current picture to the two reference pictures are equal, the first pattern matching derives bidirectional motion vectors that are mirror-symmetric.

[0122] In the second pattern matching, pattern matching is performed between a template in the current picture (a block adjacent to the current block in the current picture (e.g., an upper and / or left adjacent block)) and a block in the reference picture. Therefore, in the second pattern matching, a block adjacent to the current block in the current picture is used as a predetermined area for calculating the evaluation value of the above-mentioned candidate.

[0123] Fig. 7 is a diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. As shown in Fig. 7, in the second pattern matching, a motion vector of a current block is derived by searching in a reference picture (Ref0) for a block that best matches a block adjacent to a current block (Cur block) in a current picture (Cur Pic). Specifically, for the current block, a difference is derived between a reconstructed image of both or either of the left adjacent and / or upper adjacent coded areas and a reconstructed image at the same position in a coded reference picture (Ref0) specified by a candidate MV, an evaluation value is calculated using the obtained difference value, and a candidate MV with the best evaluation value among a plurality of candidate MVs is selected as a best candidate MV.

[0124] Information indicating whether such a FRUC mode is applied (e.g., when the FRUC flag is true) is signaled at the CU level. Also, when the FRUC mode is applied (e.g., when the FRUC flag is true), information indicating a pattern matching method (first pattern matching or second pattern matching) (e.g., when the FRUC mode flag is true) is signaled at the CU level. Note that the signaling of such information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).

[0125] Here, a mode in which a motion vector is derived based on a model assuming uniform linear motion will be described. This mode is sometimes called a BIO (bi-directional optical flow) mode.

[0126] FIG. 8 is a diagram for explaining a model assuming uniform linear motion. In FIG. x ,v y) denotes a velocity vector, and τ0 and τ1 denote the temporal distance between the current picture (CurPic) and two reference pictures (Ref0, Ref1), respectively. (MVx0,MVy0) denotes a motion vector corresponding to the reference picture Ref0, and (MVx1,MVy1) denotes a motion vector corresponding to the reference picture Ref1.

[0127] At this time, the velocity vector (v x ,v y Under the assumption of uniform linear motion of the object, (MVx0,MVy0) and (MVx1,MVy1) are respectively (v x τ0,v y τ0) and (-v x τ1,-v y τ1), and the following optical flow equation (1) holds:

[0128]

number

[0129] Here, I (k) denotes the luminance value of reference image k (k=0,1) after motion compensation. This optical flow equation indicates that the sum of (i) the time derivative of the luminance value, (ii) the product of the horizontal 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 a combination of this optical flow equation and Hermite interpolation, block-wise motion vectors obtained from a merge list or the like are corrected pixel by pixel.

[0130] Note that the decoding device may derive a motion vector using a method other than the method based on a model assuming uniform linear motion. For example, a motion vector may be derived for each sub-block based on the motion vectors of multiple adjacent blocks.

[0131] Here, a mode in which a motion vector is derived for each sub-block based on the motion vectors of a plurality of adjacent blocks will be described. This mode is sometimes called an affine motion compensation prediction mode.

[0132] FIG. 9A is a diagram for explaining derivation of a motion vector for each sub-block based on the motion vectors of multiple adjacent blocks. In FIG. 9A, the current block includes 16 4x4 sub-blocks. Here, a motion vector v0 of the upper left corner control point of the current block is derived based on the motion vectors of the adjacent blocks, and a motion vector v1 of the upper right corner control point of the current block is derived based on the motion vectors of the adjacent sub-blocks. Then, using the two motion vectors v0 and v1, the motion vectors (v x ,v y ) is derived.

[0133]

number

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

[0135] Such affine motion compensation prediction mode may include several modes with different methods of deriving the motion vectors of the upper left and upper right corner control points. Information indicating such affine motion compensation prediction mode (e.g., called affine flag) is signaled at the CU level. Note that the signaling of the information indicating this affine motion compensation prediction mode does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).

[0136] [Predictive control unit] The prediction control unit 128 selects either the intra-prediction signal or the inter-prediction signal, and outputs the selected signal to the subtraction unit 104 and the addition unit 116 as a prediction signal.

[0137] Here, an example of deriving a motion vector for a picture to be coded in the merge mode will be described. Fig. 9B is a diagram for explaining an overview of a motion vector derivation process in the merge mode.

[0138] First, a prediction MV list is generated in which prediction MV candidates are registered. The prediction MV candidates include spatially adjacent prediction MVs, which are MVs held by multiple coded blocks located spatially around the block to be coded, temporally adjacent prediction MVs, which are MVs held by nearby blocks projected onto the position of the block to be coded in the coded reference picture, joint prediction MVs, which are MVs generated by combining the MV values ​​of spatially adjacent prediction MVs and temporally adjacent prediction MVs, and zero prediction MVs, which are MVs with a value of zero.

[0139] Next, one prediction MV is selected from the multiple prediction MVs registered in the prediction MV list, and is determined as the MV for the block to be coded.

[0140] Furthermore, the variable length coding unit writes merge_idx, which is a signal indicating which predicted MV has been selected, into the stream and codes it.

[0141] Note that the predicted MVs registered in the predicted MV list described in Figure 9B are just an example, and the number may be different from the number shown in the figure, the configuration may not include some of the types of predicted MVs shown in the figure, or the configuration may include additional predicted MVs other than the types of predicted MVs shown in the figure.

[0142] Note that the final MV may be determined by performing DMVR processing, which will be described later, using the MV of the block to be coded derived in the merge mode.

[0143] Here, an example of determining the MV using the DMVR process will be described.

[0144] FIG. 9C is a conceptual diagram for explaining an overview of the DMVR process.

[0145] First, the optimal MVP set for the block to be processed is set as a candidate MV, and reference pixels are obtained from the first reference picture, which is a processed picture in the L0 direction, and the second reference picture, which is a processed picture in the L1 direction, according to the candidate MV, and a template is generated by taking the average of each reference pixel.

[0146] Next, the template is used to search the surrounding areas of the candidate MVs of the first and second reference pictures, and the MV with the smallest cost is determined as the final MV. The cost value is calculated using the difference value between each pixel value of the template and each pixel value of the search area, the MV value, etc.

[0147] The outline of the processing described here is basically the same for the encoding device and the decoding device.

[0148] Note that other processing may be used instead of the processing described here, as long as it is processing that can search the vicinity of the candidate MV and derive the final MV.

[0149] Here, a mode in which a predicted image is generated using LIC processing will be described.

[0150] FIG. 9D is a diagram for explaining an outline of a predicted image generating method using luminance correction processing by LIC processing.

[0151] First, a MV for obtaining a reference image corresponding to a block to be coded from a reference picture that is a coded picture is derived.

[0152] Next, for the block to be coded, the luminance pixel values ​​of the coded surrounding reference areas adjacent to the left and above and the luminance pixel values ​​at the equivalent positions in the reference picture specified by the MV are used to extract information indicating how the luminance values ​​have changed between the reference picture and the picture to be coded, and a luminance correction parameter is calculated.

[0153] A luminance correction process is performed on a reference image in a reference picture specified by the MV using the luminance correction parameter, thereby generating a predicted image for the block to be coded.

[0154] It should be noted that the shape of the peripheral reference region in FIG. 9D is just an example, and other shapes may be used.

[0155] Although the process of generating a predicted image from one reference picture has been described here, the process is similar when generating a predicted image from multiple reference pictures, and a luminance correction process is performed in a similar manner on the reference images obtained from each reference picture before generating a predicted image.

[0156] As a method of determining whether or not to apply LIC processing, for example, there is a method of using lic_flag, which is a signal indicating whether or not to apply LIC processing. As a specific example, in an encoding device, it is determined whether or not the encoding target block belongs to an area where a luminance change occurs, and if it belongs to an area where a luminance change occurs, a value of 1 is set as lic_flag and encoding is performed by applying LIC processing, and if it does not belong to an area where a luminance change occurs, a value of 0 is set as lic_flag and encoding is performed without applying LIC processing. On the other hand, a decoding device decodes lic_flag described in a stream, and switches whether or not to apply LIC processing depending on the value and performs decoding.

[0157] Another method of determining whether to apply LIC processing is, for example, a method of determining according to whether LIC processing is applied to surrounding blocks.As a specific example, when the block to be coded is in merge mode, determine whether the surrounding coded blocks selected when deriving MV in merge mode processing have been coded by applying LIC processing, and switch whether to apply LIC processing according to the result and perform coding.In addition, in this example, the process in decoding is exactly the same.

[0158] [Overview of the Decryption Device] Next, a description will be given of an overview of a decoding device capable of decoding the coded signal (coded bit stream) output from the above coding device 100. Fig. 10 is a block diagram showing a functional configuration of a decoding device 200 according to the first embodiment. The decoding device 200 is a video / image decoding device that decodes a video / image on a block-by-block basis.

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

[0160] The decoding device 200 is realized by, for example, a general-purpose processor and a memory. In this case, when the 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 transform 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. The decoding device 200 may also be realized as one or more dedicated electronic circuits corresponding to the entropy decoding unit 202, the inverse quantization unit 204, the inverse transform 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.

[0161] Each component included in the decoding device 200 will be described below.

[0162] [Entropy Decoding Part] The entropy decoding unit 202 entropy decodes the coded bit stream. Specifically, the entropy decoding unit 202 arithmetically decodes the coded bit stream into a binary signal, for example. The entropy decoding unit 202 then debinarizes the binary signal. As a result, the entropy decoding unit 202 outputs quantized coefficients to the inverse quantization unit 204 on a block-by-block basis.

[0163] [Dequantization section] The inverse quantization unit 204 inverse quantizes the quantized coefficients of a block to be decoded (hereinafter, referred to as a current block) that is input from the entropy decoding unit 202. Specifically, the inverse quantization unit 204 inverse quantizes each quantized coefficient of the current block based on a quantization parameter corresponding to the quantized coefficient. Then, the inverse quantization unit 204 outputs the inverse quantized quantized coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.

[0164] [Inverse conversion section] The inverse transform unit 206 restores the prediction error by inverse transforming the transform coefficients input from the inverse quantization unit 204 .

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

[0166] Also for example, if the information interpreted from the coded bitstream indicates to apply NSST, then inverse transform unit 206 applies an inverse re-transform to the transform coefficients.

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

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

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

[0170] If the information indicating ALF on / off read from the encoded bitstream indicates ALF on, one filter is selected from among multiple filters based on the local gradient direction and activity, and the selected filter is applied to the reconstructed block.

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

[0172] [Intra prediction section] 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 an intra prediction mode interpreted from the encoded bit stream. Specifically, the intra prediction unit 216 generates an intra prediction signal by performing intra prediction with reference to samples (e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra prediction signal to the prediction control unit 220.

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

[0174] Furthermore, when information interpreted from the encoded bitstream indicates the application of PDPC, the intra prediction unit 216 corrects pixel values ​​after intra prediction based on the gradients of reference pixels in the horizontal / vertical directions.

[0175] [Inter prediction section] The inter prediction unit 218 predicts the current block by referring to a 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) in the current block. For example, the inter prediction unit 218 generates an inter prediction signal of the current block or sub-block by performing motion compensation using motion information (e.g., motion vectors) interpreted from the encoded bitstream, and outputs the inter prediction signal to the prediction control unit 220.

[0176] In addition, when the information interpreted from the encoded bitstream 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.

[0177] Also, if the information interpreted from the encoded bitstream indicates that the FRUC mode is applied, the inter prediction unit 218 derives motion information by performing motion search according to the pattern matching method (bilateral matching or template matching) interpreted from the encoded bitstream. Then, the inter prediction unit 218 performs motion compensation using the derived motion information.

[0178] In addition, when the BIO mode is applied, the inter prediction unit 218 derives a motion vector based on a model assuming uniform linear motion. In addition, when information interpreted from the encoded bitstream indicates that an affine motion compensation prediction mode is applied, the inter prediction unit 218 derives a motion vector on a sub-block basis based on the motion vectors of multiple adjacent blocks.

[0179] [Predictive control unit] The prediction control unit 220 selects either the intra-prediction signal or the inter-prediction signal, and outputs the selected signal to the addition unit 208 as a prediction signal.

[0180] [Deblocking filter processing] Next, the deblocking filter processing performed in the encoding device 100 and the decoding device 200 configured as above will be specifically described with reference to the drawings. Note that, although the operation of the loop filter unit 120 provided in the encoding device 100 will be mainly described below, the operation of the loop filter unit 212 provided in the decoding device 200 is also similar.

[0181] As described above, when encoding an image, the encoding device 100 calculates a prediction error by subtracting a prediction signal generated by the intra prediction unit 124 or the inter prediction unit 126 from an original signal. The encoding device 100 generates a quantized coefficient by performing an orthogonal transform process and a quantization process on the prediction error. Furthermore, the encoding device 100 restores the prediction error by inverse quantizing and inverse orthogonal transforming the obtained quantized coefficient. Here, since the quantization process is a lossy process, the restored prediction error has an error (quantization error) with respect to the prediction error before transformation.

[0182] The deblocking filter process performed by the loop filter unit 120 is a type of filter process that is performed for the purpose of reducing the quantization error. The deblocking filter process is applied to block boundaries to remove block noise. In the following, the deblocking filter process is also simply referred to as filter process.

[0183] Fig. 11 is a flowchart showing an example of the deblocking filter process performed by the loop filter unit 120. For example, the process shown in Fig. 11 is performed for each block boundary.

[0184] First, the loop filter unit 120 calculates a block boundary strength (Bs) to determine the behavior of the deblocking filter process (S101). Specifically, the loop filter unit 120 determines Bs using the prediction mode or the properties of the motion vector of the block to be filtered. For example, if at least one of the blocks sandwiching the boundary is an intra-prediction block, Bs is set to 2. If at least one of the conditions (1) to (3) is satisfied, namely (1) at least one of the blocks sandwiching the boundary contains a dominant orthogonal transform coefficient, (2) the difference between the motion vectors of both blocks sandwiching the block boundary is equal to or greater than a threshold, and (3) the number of motion vectors or the reference image of both blocks sandwiching the block boundary are different, Bs is set to 1. If none of the conditions (1) to (3) is satisfied, Bs is set to 0.

[0185] Next, the loop filter unit 120 determines whether the set Bs is greater than a first threshold value (S102). If Bs is equal to or less than the first threshold value (No in S102), the loop filter unit 120 does not perform filtering (S107).

[0186] On the other hand, if the set Bs is greater than the first threshold (Yes in S102), the loop filter unit 120 calculates the pixel variation d of the boundary region using pixel values ​​in the blocks on both sides of the block boundary (S103). This process will be explained with reference to Fig. 12. If the pixel values ​​of the block boundary are defined as shown in Fig. 12, the loop filter unit 120 calculates, for example, d = |p30-2 x p20 + p10| + |p33-2 x p23 + p13| + |q30-2 x q20 + q10| + |q33-2 x q23 + q13|.

[0187] Next, the loop filter unit 120 judges whether the calculated d is greater than a second threshold (S104). If d is equal to or less than the second threshold (No in S104), the loop filter unit 120 does not perform filtering (S107). Note that the first threshold and the second threshold are different.

[0188] If the calculated d is greater than the second threshold (Yes in S104), the loop filter unit 120 determines the filter characteristics (S105) and performs filtering with the determined filter characteristics (S106). For example, a 5-tap filter of (1, 2, 2, 2, 1) / 8 is used. That is, for p10 shown in FIG. 12, the calculation (1×p30+2×p20+2×p10+2×q10+1×q20) / 8 is performed. Here, during filtering, clipping is performed so that the displacement falls within a certain range to avoid excessive smoothing. The clipping here refers to threshold processing in which, for example, when the threshold of the clipping is tc and the pixel value before filtering is q, the pixel value after filtering can only be within the range of q±tc.

[0189] Hereinafter, an example will be described in which an asymmetric filter is applied across a block boundary in the deblocking filtering process by the loop filter unit 120 according to this embodiment.

[0190] Fig. 13 is a flowchart showing an example of a deblocking filter process according to the present embodiment. Note that the process shown in Fig. 13 may be performed for each block boundary, or may be performed for each unit pixel including one or more pixels.

[0191] First, the loop filter unit 120 acquires coding parameters and determines asymmetric filter characteristics across a block boundary using the acquired coding parameters (S111). In the present disclosure, it is assumed that the acquired coding parameters characterize, for example, an error distribution.

[0192] Here, the filter characteristics are parameters used to control filter coefficients and filter processing, etc. The coding parameters may be any parameters that can be used to determine the filter characteristics. The coding parameters may be information indicating the error itself, or may be information or parameters related to the error (e.g., information that determines the magnitude of the error).

[0193] In the following description, a pixel that is determined to have a large or small error based on the encoding parameters, that is, a pixel that is likely to have a large or small error, will also be referred to simply as a pixel with a large or small error.

[0194] Here, it is not necessary to perform the determination process each time, but the process may be performed according to a predetermined rule that associates the encoding parameters with the filter characteristics.

[0195] It should be noted that even if a pixel is statistically likely to have a small error, it may have a larger error than a pixel that is likely to have a large error when viewed on a pixel-by-pixel basis.

[0196] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S112).

[0197] Here, the filter characteristics determined in step S111 do not necessarily have to be asymmetric, and a symmetric design is also possible. In the following, a filter having asymmetric filter characteristics across a block boundary is also referred to as an asymmetric filter, and a filter having symmetric filter characteristics across a block boundary is also referred to as a symmetric filter.

[0198] Specifically, the filter characteristics are determined taking into consideration two points: that pixels determined to have a small error are less likely to be influenced by surrounding pixels with large errors, and that pixels determined to have a large error are more likely to be influenced by surrounding pixels with small errors. In other words, the filter characteristics are determined so that the larger the error, the greater the influence of the filter process. For example, the filter characteristics are determined so that the larger the error, the greater the change in pixel value before and after filter process. This makes it possible to prevent pixels that are likely to have a small error from deviating from the true value due to large value fluctuations. Conversely, for pixels that are likely to have a large error, the error can be reduced by fluctuating the value under the strong influence of pixels with small errors.

[0199] In the following, a factor that changes the displacement caused by a filter is defined as a filter weight. In other words, a weight indicates the degree of influence of the filter process on a target pixel. Increasing the weight means that the influence of the filter process on the pixel in question increases. In other words, it means that the pixel value after the filter process is more susceptible to the influence of other pixels. Specifically, increasing the weight means determining filter characteristics so that the amount of change in pixel value before and after the filter process increases, or so that the filter process is more easily performed.

[0200] That is, the loop filter unit 120 increases the weight for pixels with larger errors. Note that increasing the weight for pixels with larger errors does not necessarily mean changing the weight continuously based on the error, but also includes changing the weight stepwise. That is, the weight for a first pixel only needs to be smaller than the weight for a second pixel that has a larger error than the first pixel. The same expression is used hereinafter.

[0201] In addition, it is not necessary that the weight of a pixel having a larger error is larger in the finally determined filter characteristic. In other words, the loop filter unit 120 may modify the reference filter characteristic determined by the conventional method, for example, so that the weight of a pixel having a larger error tends to be larger.

[0202] A number of specific methods for changing the weights asymmetrically will be described below. Note that any of the methods described below may be used, or a combination of a number of methods may be used.

[0203] As a first technique, the loop filter unit 120 reduces the filter coefficient for a pixel with a larger error. For example, the loop filter unit 120 reduces the filter coefficient for a pixel with a larger error and increases the filter coefficient for a pixel with a smaller error.

[0204] For example, an example of deblocking filter processing performed on pixel p1 shown in FIG. 12 will be described. In the following, a filter determined by, for example, a conventional method without applying this method is called a reference filter. The reference filter is a 5-tap filter perpendicular to the block boundary and extends over (p3, p2, p1, q1, q2). The filter coefficient is (1, 2, 2, 2, 1) / 8. It is also assumed that the error of block P is likely to be large, and the error of block Q is likely to be small. In this case, the filter coefficient is set so that block P with a large error is easily influenced by block Q with a small error. Specifically, the filter coefficient used for pixels with a small error is set to be large, and the filter coefficient used for pixels with a large error is set to be small. For example, (0.5, 1.0, 1.0, 2.0, 1.5) / 6 is used as the filter coefficient.

[0205] As another example, 0 may be used as the filter coefficient for pixels with small error. For example, (0,0,1,2,2) / 5 may be used as the filter coefficient. That is, the filter tap may be changed. Conversely, a filter coefficient that is currently 0 may be changed to a value other than 0. For example, (1,2,2,2,1,1) / 9 may be used as the filter coefficient. That is, the loop filter unit 120 may extend the filter tap to the side with small error.

[0206] The reference filter does not have to be a filter symmetrical about the target pixel, such as the above (1,2,2,2,1) / 8. In such a case, the loop filter unit 120 further adjusts the filter. For example, the filter coefficient of the reference filter used for the pixel at the left end of the Q block is (1,2,3,4,5) / 15, and the filter coefficient of the reference filter used for the pixel at the right end of the block P is (5,4,3,2,1) / 15. That is, in this case, filter coefficients that are inverted left and right are used between pixels sandwiching the block boundary. Such filter characteristics that are inversion symmetrical about the block boundary can also be called "filter characteristics that are symmetrical about the block boundary". In other words, filter characteristics that are asymmetrical about the block boundary are filter characteristics that are not inversion symmetrical about the block boundary.

[0207] Also, as described above, when the error in block P is large and the error in block Q is small, the loop filter unit 120 changes, for example, the filter coefficients of the reference filter used for the rightmost pixel of block P from (5,4,3,2,1) / 15 to (2.5,2.0,1.5,2.0,1.0) / 9.

[0208] In this way, in the deblocking filter process, a filter whose filter coefficients change asymmetrically across a block boundary is used. For example, the loop filter unit 120 determines a reference filter having filter characteristics symmetric across a block boundary according to a predetermined criterion. The loop filter unit 120 changes the reference filter so that it has filter characteristics asymmetric across the block boundary. Specifically, the loop filter unit 120 at least one of increasing the filter coefficient of at least one pixel with a small error and decreasing the filter coefficient of at least one pixel with a large error among the filter coefficients of the reference filter.

[0209] Next, a second method of changing weights asymmetrically will be described. First, the loop filter unit 120 performs a filter operation using a reference filter. Next, the loop filter unit 120 performs asymmetric weighting across a block boundary on a reference change amount Δ0, which is a change amount of pixel value before and after the filter operation using the reference filter. In the following, for the sake of distinction, the process using the reference filter is called a filter operation, and a series of processes including the filter operation and the subsequent correction process (for example, asymmetric weighting) is called a filter process (deblocking filter process).

[0210] For example, for pixels with small errors, the loop filter unit 120 calculates a post-correction change amount Δ1 by multiplying the reference change amount Δ0 by a coefficient smaller than 1. For pixels with large errors, the loop filter unit 120 calculates a post-correction change amount Δ1 by multiplying the reference change amount Δ0 by a coefficient larger than 1. Next, the loop filter unit 120 generates a post-filter pixel value by adding the post-correction change amount Δ1 to the pixel value before the filter operation. Note that the loop filter unit 120 may perform only one of the processing for pixels with small errors and the processing for pixels with large errors.

[0211] For example, as in the above, it is assumed that the error in block P is large and the error in block Q is small. In this case, the loop filter unit 120 calculates the post-correction change amount Δ1 for pixels included in block Q with small error by, for example, multiplying the reference change amount Δ0 by 0.8. Also, the loop filter unit 120 calculates the post-correction change amount Δ1 for pixels included in block P with large error by, for example, multiplying the reference change amount Δ0 by 1.2. In this way, it is possible to reduce the fluctuation in the value of pixels with small error. Also, it is possible to increase the fluctuation in the value of pixels with large error.

[0212] In addition, the ratio of the coefficient multiplied by the reference change amount Δ0 of a pixel with a small error to the coefficient multiplied by the reference change amount Δ0 of a pixel with a large error may be selected to be 1:1. In this case, the filter characteristics are symmetrical on both sides of the block boundary.

[0213] The loop filter unit 120 may calculate the coefficient by which the reference change amount Δ0 is multiplied by a constant by multiplying the reference coefficient. In this case, the loop filter unit 120 uses a larger constant for pixels with large errors than for pixels with small errors. As a result, the amount of change in pixel value for pixels with large errors increases, and the amount of change in pixel value for pixels that are likely to have small errors decreases. For example, the loop filter unit 120 uses a constant of 1.2 or 0.8 for pixels adjacent to the block boundary, and a constant of 1.1 or 0.9 for pixels one pixel away from the pixel adjacent to the block boundary. The reference coefficient is calculated by, for example, (A×(q1−p1)−B×(q2−p2)+C) / D. Here, A, B, C, and D are constants. For example, A=9, B=3, C=8, and D=16. Also, p1, p2, q1, and q2 are pixel values ​​of pixels having the positional relationship shown in FIG. 12 across the block boundary.

[0214] Next, a third method of changing weights asymmetrically will be described. The loop filter unit 120 performs a filter operation using the filter coefficients of the reference filter, as in the second method. Next, the loop filter unit 120 adds an offset value that is asymmetric across the block boundary to the pixel value after the filter operation. Specifically, the loop filter unit 120 adds a positive offset value to the pixel value of a pixel with a large error so that the value of the pixel with a large error approaches the value of a pixel that is likely to have a small error and the displacement of the pixel with a large error increases. In addition, the loop filter unit 120 adds a negative offset to the pixel value of a pixel with a small error so that the value of the pixel with a small error does not approach the value of a pixel with a large error and the displacement of the pixel with a small error decreases. As a result, the amount of change in pixel value for a pixel with a large error increases, and the amount of change in pixel value for a pixel with a small error decreases. Note that the loop filter unit 120 may perform only one of the processing for a pixel with a small error and the processing for a pixel with a large error.

[0215] For example, for a pixel included in a block with a large error, the loop filter unit 120 calculates a post-correction change amount Δ1 by adding a positive offset value (e.g., 1) to the absolute value of the reference change amount Δ0. Also, for a pixel included in a block with a small error, the loop filter unit 120 calculates a post-correction change amount Δ1 by adding a negative offset value (e.g., -1) to the absolute value of the reference change amount Δ0. Next, the loop filter unit 120 generates a post-filter pixel value by adding the post-correction change amount Δ1 to the pixel value before the filter operation. Note that the loop filter unit 120 may add an offset value to the pixel value after the filter operation, instead of adding an offset value to the change amount. Also, the offset value does not have to be symmetrical across the block boundary.

[0216] Furthermore, when a filter tap extends from a block boundary over a plurality of pixels, the loop filter unit 120 may change only the weight for a specific pixel, or may change the weight for all pixels. Furthermore, the loop filter unit 120 may change the weight according to the distance from the block boundary to the target pixel. For example, the loop filter unit 120 may make the filter coefficients applied to the first two pixels from the block boundary asymmetric, and make the filter coefficients applied to the subsequent pixels symmetric. Furthermore, the filter weights may be common to a plurality of pixels, or may be set for each pixel.

[0217] Next, a fourth method of asymmetrically changing weights will be described. The loop filter unit 120 performs a filter calculation using the filter coefficients of a reference filter. Next, when a change amount Δ in pixel values ​​before and after the filter calculation exceeds a clip width that is a reference value, the loop filter unit 120 clips the change amount Δ to the clip width. The loop filter unit 120 sets the clip width asymmetrically across the block boundary.

[0218] Specifically, the loop filter unit 120 makes the clip width for pixels with large errors larger than the clip width for pixels with small errors. For example, the loop filter unit 120 makes the clip width for pixels with large errors a constant multiple of the clip width for pixels with small errors. As a result of changing the clip width, the values ​​of pixels with small errors cannot change significantly. Also, the values ​​of pixels with large errors can change significantly.

[0219] The loop filter unit 120 may adjust the absolute value of the clip width instead of specifying the ratio of the clip width. For example, the loop filter unit 120 fixes the clip width for a pixel with a large error to twice the predetermined reference clip width. The loop filter unit 120 sets the ratio of the clip width for a pixel with a large error to the clip width for a pixel with a small error to 1.2:0.8. Specifically, for example, the reference clip width is 10, and the change amount Δ before and after the filter operation is 12. In this case, if the reference clip width is used as is, the change amount Δ is corrected to 10 by threshold processing. On the other hand, if the target pixel is a pixel with a large error, for example, the reference clip width is multiplied by 1.5. As a result, the clip width becomes 15, so threshold processing is not performed and the change amount Δ becomes 12.

[0220] Next, a fifth method of asymmetrically changing weights will be described. The loop filter unit 120 sets the condition for determining whether or not to perform filtering asymmetrically across the block boundary. Here, the condition for determining whether or not to perform filtering is, for example, the first threshold value or the second threshold value shown in FIG. 11.

[0221] Specifically, the loop filter unit 120 sets conditions for pixels with large errors so that filtering is more likely to be performed, and sets conditions for pixels with small errors so that filtering is less likely to be performed. For example, the loop filter unit 120 sets a threshold for pixels with small errors higher than the threshold for pixels with large errors. For example, the loop filter unit 120 sets a threshold for pixels with small errors to a constant multiple of the threshold for pixels with large errors.

[0222] Furthermore, the loop filter unit 120 may not only specify the ratio of the thresholds but also adjust the absolute values ​​of the thresholds. For example, the loop filter unit 120 may fix the threshold for pixels with small errors to twice the predetermined reference threshold, and set the ratio between the threshold for pixels with small errors and the threshold for pixels with large errors to 1.2:0.8.

[0223] Specifically, suppose the reference threshold for the second threshold in step S104 is 10, and d calculated from pixel values ​​in the block is 12. If the reference threshold is used as the second threshold as is, it is determined that filtering is to be performed. On the other hand, if the target pixel is a pixel with a small error, for example, a value 1.5 times the reference threshold is used as the second threshold. In this case, the second threshold becomes 15, which is larger than d. As a result, it is determined that filtering is not to be performed.

[0224] Furthermore, the constants indicating the weights based on the errors used in the first to fifth techniques may be values ​​that are predetermined or may be variable in the encoding device 100 and the decoding device 200. Specifically, the constants are coefficients multiplied by the filter coefficients or the filter coefficients of the reference filter in the first technique, coefficients multiplied by the reference change amount Δ0 or constants multiplied by the reference coefficients in the second technique, offset values ​​in the third technique, constants multiplied by the clip width or the reference clip width in the fourth technique, and constants multiplied by the threshold or the reference threshold in the fifth technique.

[0225] When the constant is variable, information indicating the constant may be included in a bitstream as a parameter for each sequence or slice, for example, and transmitted from encoding device 100 to decoding device 200. Note that the information indicating the constant may be information indicating the constant itself, or information indicating a ratio or difference from a reference value.

[0226] In addition, examples of methods for changing a coefficient or constant depending on an error include a method of changing it linearly, a method of changing it quadratically, a method of changing it exponentially, or a method of using a lookup table showing the relationship between an error and a constant.

[0227] Also, when the error is equal to or greater than the reference value, or when the error is equal to or less than the reference value, a fixed value may be used as the constant. For example, the loop filter unit 120 may set the variable to a first value when the error is equal to or less than a predetermined range, set the variable to a second value when the error is equal to or greater than the predetermined range, and continuously change the variable from the first value to the second value according to the error when the error is within the predetermined range.

[0228] Furthermore, when the error exceeds a predetermined reference, the loop filter unit 120 may use a symmetric filter (reference filter) instead of the asymmetric filter.

[0229] Furthermore, when using a lookup table or the like, loop filter unit 120 may store both tables for cases where the error is large and cases where the error is small, or may store only one of the tables and calculate the other constant from the contents of that table in accordance with a predetermined rule.

[0230] As described above, the encoding device 100 and the decoding device 200 according to this embodiment can reduce errors in reconstructed images by using an asymmetric filter, thereby improving the encoding efficiency.

[0231] (Embodiment 2) Specific examples of encoding parameters that characterize the above-mentioned error distribution will be described in the second to sixth embodiments. In the present embodiments, the loop filter unit 120 determines filter characteristics according to the position of the target pixel within the block.

[0232] 14 is a flowchart showing an example of the deblocking filter process according to the present embodiment. First, the loop filter unit 120 acquires information indicating the position of the target pixel in the block as an encoding parameter characterizing the error distribution. Based on the position, the loop filter unit 120 determines filter characteristics that are asymmetric across the block boundary (S121).

[0233] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S122).

[0234] Here, pixels farther from the reference pixels for intra prediction are more likely to have a larger error than pixels closer to the reference pixels for intra prediction. Therefore, the loop filter unit 120 determines filter characteristics such that the amount of change in pixel value before and after the filtering process increases for pixels farther from the reference pixels for intra prediction.

[0235] For example, in the case of H.265 / HEVC or JEM, the pixel closest to the reference pixel is the pixel located at the upper left in the block, and the pixel closest to the reference pixel is the pixel located at the lower right in the block, as shown in Fig. 15. Therefore, the loop filter unit 120 determines the filter characteristics such that the weight of the lower right pixel in the block is greater than the weight of the upper left pixel.

[0236] Specifically, the loop filter unit 120 determines filter characteristics for pixels far from the reference pixels of intra prediction so that the influence of the filter process is increased, as described in the first embodiment. That is, the loop filter unit 120 increases the weight of pixels far from the reference pixels of intra prediction. Here, increasing the weight means, as described above, performing at least one of the following: (1) decreasing the filter coefficient; (2) increasing the filter coefficient of pixels on either side of a boundary (i.e., pixels close to the reference pixels of intra prediction); (3) increasing the coefficient multiplied by the amount of change; (4) increasing the offset value of the amount of change; (5) increasing the clip width; and (6) correcting the threshold value so that the filter process is easily performed. On the other hand, the loop filter unit 120 determines filter characteristics for pixels close to the reference pixels of intra prediction so that the influence of the filter process is reduced. That is, the loop filter unit 120 decreases the weight of pixels close to the reference pixels of intra prediction. Here, reducing the weight means, as described above, doing at least one of the following: (1) increasing the filter coefficient; (2) decreasing the filter coefficient of pixels on either side of a boundary (i.e., pixels close to the reference pixel for intra prediction); (3) decreasing the coefficient by which the change amount is multiplied; (4) decreasing the offset value of the change amount; (5) decreasing the clip width; and (6) modifying the threshold value so that the filter process is less likely to be performed.

[0237] It is to be noted that the above process may be performed when intra prediction is used, and not for blocks where inter prediction is used, but since the properties of intra prediction blocks may also be influenced by inter prediction, the above process may also be performed for inter prediction blocks.

[0238] Furthermore, the loop filter unit 120 may change the weighting by arbitrarily specifying a position in a particular block. For example, as described above, the loop filter unit 120 may increase the weighting of the pixel in the lower right of the block and decrease the weighting of the pixel in the upper left of the block. Note that the loop filter unit 120 may change the weighting by arbitrarily specifying a position in the block, not limited to the upper left and lower right.

[0239] 15, at adjacent block boundaries in the horizontal direction, the error of the left block is large and the error of the right block is large. Therefore, loop filter unit 120 may increase the weight of the left block and decrease the weight of the right block for adjacent block boundaries in the horizontal direction.

[0240] Similarly, at the boundary between adjacent blocks in the vertical direction, the error of the upper block is large and the error of the lower block is small. Therefore, for the boundary between adjacent blocks in the vertical direction, loop filter unit 120 may increase the weight of the upper block and decrease the weight of the lower block.

[0241] Furthermore, the loop filter unit 120 may change the weight according to the distance from the reference pixel of intra prediction. Furthermore, the loop filter unit 120 may determine the weight in block boundary units or in pixel units. The farther away from the reference pixel, the larger the error is likely to be. Therefore, the loop filter unit 120 determines the filter characteristics so that the gradient of the weight becomes steeper the farther away from the reference pixel. Furthermore, the loop filter unit 120 determines the filter characteristics so that the gradient of the weight on the upper side of the right side of the block is gentler than the gradient of the weight on the lower side.

[0242] (Embodiment 3) In this embodiment, the loop filter unit 120 determines the filter characteristics according to the orthogonal transform basis.

[0243] 16 is a flowchart showing an example of the deblocking filter process according to the present embodiment. First, the loop filter unit 120 acquires information indicating an orthogonal transform base used for a current block as an encoding parameter characterizing an error distribution. Based on the orthogonal transform base, the loop filter unit 120 determines filter characteristics that are asymmetric across a block boundary (S131).

[0244] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S132).

[0245] The encoding device 100 selects one of a plurality of candidates for an orthogonal transform base, which is a transform base used when performing an orthogonal transform. The plurality of candidates include, for example, a base in which the 0th-order transform base of DCT-II or the like is flat, and a base in which the 0th-order transform base of DCT-VII or the like is not flat. Fig. 17 is a diagram showing the transform bases of DCT-II. Fig. 18 is a diagram showing the transform bases of DCT-VII.

[0246] The zero-order basis of DCT-II is constant regardless of the position in the block. In other words, when DCT-II is used, the error in the block is constant. Therefore, when both blocks on either side of the block boundary are transformed by DCT-II, the loop filter unit 120 performs filtering using a symmetric filter, not an asymmetric filter.

[0247] On the other hand, the zeroth order basis of DST-VII has a larger value as the distance from the left or top block boundary increases. In other words, the error is likely to increase as the distance from the left or top block boundary increases. Therefore, the loop filter unit 120 uses an asymmetric filter when at least one of two blocks on either side of a block boundary has been transformed by DST-VII. Specifically, the loop filter unit 120 determines the filter characteristics so that the effect of the filter process is smaller for pixels with smaller values ​​in a block of a lower order basis (e.g., zeroth order).

[0248] Specifically, when both blocks on either side of a block boundary are converted by DST-VII, the loop filter unit 120 determines the filter characteristics so that the effect of the filter process is greater for the bottom right pixel in the block by the above-mentioned method, and also determines the filter characteristics so that the effect of the filter process is greater for the top left pixel in the block.

[0249] Also, when DST-VII and DCT-II are adjacent to each other vertically, the loop filter unit 120 determines the filter characteristics so that the filter weight for the lower pixel of the upper block in which DST-VII is used, which is adjacent to the block boundary, is larger than the filter weight for the upper pixel of the lower block in which DCT-II is used. However, the difference in amplitude of the low-order basis in this case is smaller than the difference in amplitude of the low-order basis when DST-VIIs are adjacent to each other. Therefore, the loop filter unit 120 sets the filter characteristics so that the gradient of the weight in this case is smaller than the gradient of the weight when DST-VIIs are adjacent to each other. For example, the loop filter unit 120 sets the weight to 1:1 (symmetric filter) when DCT-II and DCT-II are adjacent, sets the weight to 1.3:0.7 when DST-VII and DST-VII are adjacent, and sets the weight to 1.2:0.8 when DST-VII and DCT-II are adjacent.

[0250] (Embodiment 4) In this embodiment, the loop filter unit 120 determines the filter characteristics according to pixel values ​​on either side of a block boundary.

[0251] 19 is a flowchart showing an example of the deblocking filter process according to the present embodiment. First, the loop filter unit 120 acquires information indicating pixel values ​​in blocks sandwiching a block boundary as an encoding parameter characterizing an error distribution. The loop filter unit 120 determines filter characteristics that are asymmetric across the block boundary based on the pixel values ​​(S141).

[0252] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S142).

[0253] For example, the loop filter unit 120 increases the difference in filter characteristics across the block boundary as the pixel value difference d0 increases. Specifically, the loop filter unit 120 determines the filter characteristics so that the difference in the effect of the filter process increases. For example, the loop filter unit 120 sets the weights to 1.4:0.6 when d0>(quantization parameter)×(constant) is satisfied, and sets the weights to 1.2:0.8 when the above relationship is not satisfied. That is, the loop filter unit 120 compares the pixel value difference d0 with a threshold based on the quantization parameter, and increases the difference in filter characteristics across the block boundary when the pixel value difference d0 is greater than the threshold, compared to when the pixel value difference d0 is smaller than the threshold.

[0254] As another example, the loop filter unit 120 may increase the difference in filter characteristics across the block boundary as the average value b0 of the variances of pixel values ​​in both blocks on either side of the block boundary increases. Specifically, the loop filter unit 120 may determine filter characteristics such that the difference in the influence of the filter process increases. For example, the loop filter unit 120 may set the weights to 1.4:0.6 when b0>(quantization parameter)×(constant) is satisfied, and may set the weights to 1.2:0.8 when the above relationship is not satisfied. In other words, the loop filter unit 120 may compare the variance b0 of pixel values ​​with a threshold based on the quantization parameter, and increase the difference in filter characteristics across the block boundary when the variance b0 of pixel values ​​is greater than the threshold, compared to when the variance b0 of pixel values ​​is smaller than the threshold.

[0255] Which of the adjacent blocks should have a larger weight, that is, which block has a larger error, can be specified by the method of the above-mentioned second or third embodiment, or the method of the below-mentioned sixth embodiment. That is, the loop filter unit 120 determines asymmetric filter characteristics on either side of the block boundary according to a predetermined rule (for example, the method of the second, third or sixth embodiment). Next, the loop filter unit 120 changes the determined filter characteristics based on the pixel value difference d0 so that the difference between the filter characteristics on either side of the block boundary becomes larger. That is, the loop filter unit 120 increases the ratio or difference between the weight of a pixel with a large error and the weight of a pixel with a small error.

[0256] Here, if the pixel value difference d0 is large, this may be the case when the block boundary coincides with the edge of an object in the image. In such a case, by reducing the difference in filter characteristics on either side of the block boundary, unnecessary smoothing can be prevented.

[0257] Conversely, the loop filter unit 120 may reduce the difference in filter characteristics across the block boundary as the pixel value difference d0 increases. Specifically, the loop filter unit 120 determines the filter characteristics so that the difference in the influence of the filter process decreases. For example, the loop filter unit 120 sets the weights to 1.2:0.8 when d0>(quantization parameter)×(constant) is satisfied, and sets the weights to 1.4:0.6 when the above relationship is not satisfied. The weights may be set to 1:1 (symmetric filter) when the above relationship is satisfied. That is, the loop filter unit 120 compares the pixel value difference d0 with a threshold based on the quantization parameter, and reduces the difference in filter characteristics across the block boundary when the pixel value difference d0 is greater than the threshold, compared to when the pixel value difference d0 is smaller than the threshold.

[0258] For example, a large pixel value difference d0 means that block boundaries are easily noticeable. In such a case, by reducing the difference in filter characteristics on either side of the block boundary, it is possible to prevent the smoothing effect from being weakened by an asymmetric filter.

[0259] Note that these two processes may be performed simultaneously. For example, the loop filter unit 120 may use a first weight when the pixel value difference d0 is less than a first threshold, use a second weight with a difference greater than the first weight when the pixel value difference d0 is equal to or greater than the first threshold and less than a second threshold, and use a third weight with a difference smaller than the second weight when the pixel value difference d0 is equal to or greater than the second threshold.

[0260] Furthermore, the pixel value difference d0 may be the difference between pixel values ​​on either side of the boundary, or the average or variance of the pixel value differences. For example, the pixel value difference d0 is calculated by (A×(q1-p1)-B×(q2-p2)+C) / D, where A, B, C, and D are constants. For example, A=9, B=3, C=8, and D=16. Furthermore, p1, p2, q1, and q2 are pixel values ​​of pixels on either side of the block boundary, which are in the positional relationship shown in FIG. 12.

[0261] The pixel value difference d0 and the weight may be set on a pixel-by-pixel basis, on a block boundary basis, or on a block group basis including multiple blocks (for example, on an LCU (Largest Coding Unit) basis).

[0262] (Embodiment 5) In this embodiment, the loop filter unit 120 determines the filter characteristics according to the intra-prediction direction and the block boundary direction.

[0263] 20 is a flowchart showing an example of a deblocking filter process according to the present embodiment. First, the loop filter unit 120 acquires information indicating an angle between the prediction direction of intra prediction and a block boundary as an encoding parameter characterizing an error distribution. The loop filter unit 120 determines filter characteristics that are asymmetric across the block boundary based on the angle (S151).

[0264] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S152).

[0265] Specifically, the loop filter unit 120 increases the difference in filter characteristics across the block boundary as the angle approaches vertical, and decreases the difference in filter characteristics across the block boundary as the angle approaches horizontal. More specifically, when the intra-prediction direction is closer to vertical to the block boundary, the filter characteristics are determined so that the difference in filter weights for pixels on both sides of the block boundary increases, and when the intra-prediction direction is closer to horizontal to the block boundary, the filter characteristics are determined so that the difference in filter weights for pixels on both sides of the block boundary decreases. Figure 21 is a diagram showing an example of weights for the relationship between the intra-prediction direction and the direction of the block boundary.

[0266] Which of the adjacent blocks should have a larger weight, that is, which block has a larger error, can be specified by the method of the above-mentioned second or third embodiment, or the method of the below-mentioned sixth embodiment. That is, the loop filter unit 120 determines asymmetric filter characteristics on either side of the block boundary according to a predetermined rule (for example, the method of the second, third or sixth embodiment). Next, the loop filter unit 120 changes the determined filter characteristics based on the intra prediction direction and the direction of the block boundary so that the difference between the filter characteristics on either side of the block boundary becomes large.

[0267] Furthermore, the encoding device 100 and the decoding device 200 specify the intra prediction direction using, for example, an intra prediction mode.

[0268] In addition, when the intra prediction mode is the planar mode or the DC mode, the loop filter unit 120 may not consider the direction of the block boundary. For example, when the intra prediction mode is the planar mode or the DC mode, the loop filter unit 120 may use a predetermined weight or a weight difference regardless of the direction of the block boundary. Alternatively, when the intra prediction mode is the planar mode or the DC mode, the loop filter unit 120 may use a symmetric filter.

[0269] (Embodiment 6) In this embodiment, the loop filter unit 120 determines the filter characteristics according to a quantization parameter indicating the width of quantization.

[0270] 22 is a flowchart showing an example of the deblocking filter process according to the present embodiment. First, the loop filter unit 120 acquires information indicating a quantization parameter used in quantizing the current block as an encoding parameter characterizing an error distribution. The loop filter unit 120 determines filter characteristics that are asymmetric across a block boundary based on the quantization parameter (S161).

[0271] Next, the loop filter unit 120 executes a filter process having the determined filter characteristics (S162).

[0272] Here, the greater the quantization parameter, the greater the possibility of an error occurring. Therefore, loop filter unit 120 determines filter characteristics such that the greater the quantization parameter, the greater the effect of filtering.

[0273] Fig. 23 is a diagram showing an example of weighting for a quantization parameter. As shown in Fig. 23, the loop filter unit 120 increases the weighting for the upper left pixel in a block as the quantization parameter increases. On the other hand, the loop filter unit 120 reduces the increase in the weighting for the lower right pixel in the block as the quantization parameter increases. In other words, the loop filter unit 120 determines the filter characteristics such that the change in the effect of the filtering process associated with the change in the quantization parameter for the upper left pixel is greater than the change in the effect of the filtering process associated with the change in the quantization parameter for the lower right pixel.

[0274] Here, the upper left pixel in the block is more susceptible to the effect of the quantization parameter than the lower right pixel in the block, so by performing the above-described process, the error can be appropriately reduced.

[0275] Furthermore, the loop filter unit 120 may determine the weight of each of the two blocks on either side of the boundary based on the quantization parameter of the block, or may calculate the average value of the quantization parameters of the two blocks and determine the weights of the two blocks based on the average value. Alternatively, the loop filter unit 120 may determine the weights of two blocks based on the quantization parameter of one block. For example, the loop filter unit 120 uses the above-mentioned method to determine the weight of one block based on the quantization parameter of the one block. Next, the loop filter unit 120 determines the weight of the other block based on the determined weight and in accordance with a predetermined rule.

[0276] Alternatively, loop filter unit 120 may use a symmetric filter when the quantization parameters of the two blocks are different, or when the difference between the quantization parameters of the two blocks exceeds a threshold.

[0277] 23, the weights are set using a linear function, but any function other than a linear function or a table may be used. For example, a curve showing the relationship between the quantization parameter and the quantization step (quantization width) may be used.

[0278] Furthermore, when the quantization parameter exceeds a threshold, the loop filter unit 120 may use a symmetric filter instead of an asymmetric filter.

[0279] Furthermore, when the quantization parameter is described with decimal point accuracy, the loop filter unit 120 may perform an operation such as rounding up, rounding down, or the like on the quantization parameter and use the calculated quantization parameter in the above process. Alternatively, the loop filter unit 120 may perform the above process taking into account decimal points.

[0280] As described above, in the second to sixth embodiments, a plurality of methods for determining an error have been described individually, but two or more of these methods may be combined. In this case, the loop filter unit 120 may weight the two or more combined elements.

[0281] The following describes modified examples.

[0282] Encoding parameters other than the above-described examples may be used. For example, the encoding parameters may be the type of orthogonal transform (Wavelet, DFT, lapped transform, etc.), the block size (width and height of the block), the direction of the motion vector, the length of the motion vector, or the number of reference pictures used in inter prediction, and information indicating the characteristics of the reference filter. They may also be used in combination. For example, the loop filter unit 120 may use an asymmetric filter only when the length of the block boundary is 16 pixels or less and the pixel to be filtered is close to the reference pixel of the intra prediction, and may use a symmetric filter in other cases. As another example, asymmetric processing may be performed only when a predetermined type of filter among multiple filter candidates is used. For example, an asymmetric filter may be used only when the displacement by the reference filter is calculated by (A×(q1-p1)-B×(q2-p2)+C) / D. Here, A, B, C, and D are constants. For example, A=9, B=3, C=8, and D=16. Also, p1, p2, q1, and q2 are pixel values ​​of pixels having the positional relationship shown in FIG. 12 across the block boundary.

[0283] Furthermore, the loop filter unit 120 may perform the above processing on one of the luminance signal and the color difference signal, or may perform the above processing on both. Furthermore, the loop filter unit 120 may perform a common process on the luminance signal and the color difference signal, or may perform different processes on the luminance signal and the color difference signal. For example, the loop filter unit 120 may use different weights for the luminance signal and the color difference signal, or may determine the weights according to different rules.

[0284] Moreover, the various parameters used in the above processes may be determined by the encoding device 100, or may be preset fixed values.

[0285] Moreover, whether to perform the above processing or not, or the contents of the above processing may be switched in a predetermined unit. The predetermined unit is, for example, a slice unit, a tile unit, a wavefront division unit, or a CTU unit. The contents of the above processing are a parameter indicating which of the above-mentioned multiple methods is to be used, or a weight, or a parameter for determining these.

[0286] Furthermore, the loop filter unit 120 may limit the area in which the above processing is performed to a CTU boundary, a slice boundary, or a tile boundary.

[0287] Furthermore, the number of filter taps may differ between the symmetric filter and the asymmetric filter.

[0288] Furthermore, the loop filter unit 120 may determine whether or not to perform the above-mentioned processing, or change the content of the above-mentioned processing, depending on the frame type (I frame, P frame, B frame).

[0289] Furthermore, the loop filter section 120 may determine whether or not to perform the above processing, or the content of the above processing, depending on whether or not a specific processing has been performed in the previous or subsequent stage.

[0290] In addition, the loop filter unit 120 may perform different processing depending on the type of prediction mode used for the block, or may perform the above processing only for blocks using a specific prediction mode. For example, the loop filter unit 120 may perform different processing for blocks using intra prediction, blocks using inter prediction, and merged blocks.

[0291] Furthermore, the encoding device 100 may encode filter information, which is a parameter indicating whether or not to perform the above processing, or the content of the above processing. That is, the encoding device 100 may generate an encoded bitstream including the filter information. This filter information may include information indicating whether or not to perform the above processing on a luminance signal, information indicating whether or not to perform the above processing on a chrominance signal, or information indicating whether or not to make the processing different for each prediction mode.

[0292] Furthermore, the decoding device 200 may perform the above-mentioned processing based on filter information included in the encoded bitstream. For example, the decoding device 200 may determine whether to perform the above-mentioned processing or the content of the above-mentioned processing based on the filter information.

[0293] (Embodiment 7) In this embodiment, similarly to the third embodiment, the loop filter unit 120 determines filter characteristics according to an orthogonal transform base. Note that in this embodiment, the configuration and processing in the third embodiment are shown more specifically, and in particular, the configuration and processing for determining filter characteristics according to a combination of orthogonal transform bases of adjacent blocks are described. Also, the loop filter unit 212 in the decoding device 200 has a configuration similar to that of the loop filter unit 120 in the encoding device 100, and performs processing operations similar to those of the loop filter unit 120. Therefore, in this embodiment, the configuration and processing operations of the loop filter unit 120 in the encoding device 100 are described, and detailed descriptions of the configuration and processing operations of the loop filter unit 212 in the decoding device 200 are omitted.

[0294] Various orthogonal transform bases are used in the orthogonal transform used in image coding. Therefore, there are cases where the error distribution is not spatially uniform. Note that the orthogonal transform base is also called the transform base or simply the base.

[0295] Specifically, when encoding an image, the residual between a predicted signal generated by inter prediction or intra prediction and an original signal is orthogonally transformed and quantized, thereby reducing the amount of data. Since quantization is an irreversible process, the encoded image will have a deviation from the image before encoding, that is, an error will occur.

[0296] However, the error distribution caused by coding is not necessarily spatially uniform even if the quantization parameter is constant, and is considered to depend on the basis of the orthogonal transform.

[0297] That is, the transform unit 106 selects a transform base for performing an orthogonal transform from among a plurality of candidates. At this time, for example, DCT-II may be selected as a base in which the 0th-order transform base is flat, and for example, DST-VII may be selected as a base in which the 0th-order transform base is not flat.

[0298] FIG. 24 is a diagram showing DCT-II, which is an example of a basis. The horizontal axis of the graph in FIG. 24 indicates the position in one-dimensional space, and the vertical axis indicates the value of the basis (i.e., amplitude). Here, k indicates the order of the basis, n indicates the position in one-dimensional space, and N indicates the number of pixels to be orthogonally transformed. Note that the position n in one-dimensional space is a horizontal position or a vertical position, and indicates larger values ​​from left to right in the horizontal direction or from top to bottom in the vertical direction. Furthermore, x n denotes the pixel value (specifically, the residual) of the pixel at position n, and Xk denotes the frequency transformation result at the kth order, that is, the transformation coefficient.

[0299] In the DCT-II, when k=0, the transform coefficient X0 is expressed by the following equation (3).

[0300]

number

[0301] In addition, in the DCT-II, when 1≦k≦N−1, the transform coefficient Xk is expressed by the following equation (4).

[0302]

number

[0303] Fig. 25 is a diagram showing DST-VII, which is an example of a basis. Note that the horizontal axis in Fig. 25 indicates a position in a one-dimensional space, and the vertical axis indicates a value of the basis (i.e., amplitude).

[0304] In the DST-VII, when 0≦k≦N−1, the transform coefficient Xk is expressed by the following equation (5).

[0305]

number

[0306] In this way, the transform coefficient is basically determined by Σ(pixel value×transformation basis). Also, the transform coefficient of a low-order basis is likely to be larger than the transform coefficient of a high-order basis. Therefore, if DST-VII, whose zero-order basis is not flat, is used as the transform basis for a block, even if the transform coefficient has the same amount of quantization error, the error distribution will be biased according to the value (i.e., amplitude) of the low-order basis. In other words, in the upper or left region of the block where the value of the low-order basis is small, the error is likely to be small, and conversely, in the lower or right region of the block where the value of the low-order basis is large, the error is likely to be large.

[0307] FIG. 26 is a diagram showing the error distribution of four adjacent blocks and the error distribution after the deblocking filter process therefor.

[0308] As shown in the left sides of (a) and (b) of Figure 26, when DST-VII is used for the orthogonal transformation of each of the four blocks, the error is small in the upper or left regions of these blocks, and conversely, the error is large in the lower or right regions of the blocks.

[0309] When the error distribution is not uniform in this way, performing deblocking filter processing with filter characteristics that are symmetrical with respect to block boundaries poses the problem of the occurrence of areas in which the error becomes larger, as shown on the right side of (a) in Fig. 26. In other words, when an area with a large error and an area with a small error are adjacent to each other, unnecessary error is superimposed on pixels that originally had a small error.

[0310] Therefore, in this embodiment, the error distribution is estimated based on the basis used in the orthogonal transform of the block, and the deblocking filter process is performed based on the result. As a result, as shown on the left side of Fig. 26(b), it is possible to suppress the error in pixels that originally had a large error without adding the error to pixels that originally had a small error.

[0311] FIG. 27 is a block diagram showing the main components of loop filter section 120 according to the present embodiment.

[0312] The loop filter unit 120 includes an error distribution estimation unit 1201 , a filter characteristic determination unit 1202 , and a filter processing unit 1203 .

[0313] The error distribution estimation unit 1201 estimates the error distribution based on an error-related parameter. The error-related parameter is a parameter that affects the magnitude relationship of errors, and indicates, for example, the type of basis applied to the orthogonal transform of each of two blocks sandwiching a block boundary to be subjected to deblocking filter processing.

[0314] The filter characteristic determination unit 1202 determines the filter characteristic based on the error distribution estimated by the error distribution estimation unit 1201 .

[0315] The filter processing unit 1203 performs deblocking filtering using the filter characteristics determined by the filter characteristics determination unit 1202 on the vicinity of block boundaries.

[0316] FIG. 28 is a flowchart showing a schematic processing operation of the loop filter section 120 according to the present embodiment.

[0317] First, the error distribution estimation unit 1201 acquires an error-related parameter. This error-related parameter is a parameter that affects the magnitude relationship of errors, in other words, information that characterizes the error distribution in the region that is the target of the deblocking filter process. Specifically, the error-related parameter indicates the type of basis applied to the orthogonal transformation of two blocks sandwiching the block boundary to be deblocking filtered, that is, the combination of the basis of the two blocks. Then, the error distribution estimation unit 1201 estimates the error distribution in the region that is the target of the deblocking filter process based on the error-related parameter (step S1201). Specifically, the error distribution estimation unit 1201 selects the i (1≦i≦N)th error distribution that corresponds to the error-related parameter from the error distributions classified into N. In this way, the error distribution is estimated.

[0318] Next, the filter characteristic determination unit 1202 determines the filter characteristic according to the estimated error distribution (step S1202). That is, the filter characteristic determination unit 1202 refers to a table in which filter characteristics are associated with each of the N error distributions. Then, the filter characteristic determination unit 1202 finds the filter characteristic associated with the error distribution estimated in step S1201 from the table. In this way, the filter characteristic is determined.

[0319] Finally, the filter processing unit 1203 performs deblocking filtering on the image represented by the input signal, in which the filter characteristics determined in step S1202 are reflected (step S1203). Note that the image represented by the input signal is, for example, a reconstructed image.

[0320] In this embodiment, the error-related parameters indicate the type of basis used in transforming the block. Therefore, in this embodiment, the deblocking filter process is performed based on the basis. For example, the loop filter unit 120 determines at least one of the filter coefficients and thresholds of the deblocking filter process as filter characteristics according to a combination of the basis of the orthogonal transform used for two adjacent blocks. That is, the filter characteristics are designed based on the magnitude relationship of the error. Then, the loop filter unit 120 performs the deblocking filter process having the determined filter characteristics on the target pixel.

[0321] That is, the encoding device 100 in this embodiment includes, for example, a processing circuit and a memory. Then, the processing circuit performs the following process using the memory. That is, for each block consisting of a plurality of pixels, the processing circuit transforms the block into a block consisting of a plurality of transform coefficients using a basis. Next, for each block consisting of a plurality of transform coefficients, the processing circuit reconstructs a block consisting of a plurality of pixels by performing at least an inverse transform on the block. Next, the processing circuit determines filter characteristics for the boundary between the two adjacent blocks based on a combination of bases used in the transform of each of the reconstructed two blocks. Then, the processing circuit performs a deblocking filter process having the determined filter characteristics.

[0322] The processing circuit is, for example, composed of a CPU (Central Processing Unit) or a processor, and functions as the loop filter unit 120 shown in Fig. 1. The memory may be the block memory 118 or the frame memory 122, or may be another memory.

[0323] Similarly, the decoding device 200 in this embodiment includes, for example, a processing circuit and a memory. The processing circuit performs the following processing using the memory. That is, the processing circuit reconstructs a block of pixels by performing at least an inverse transform on each block of a plurality of transform coefficients obtained by a transform using a basis. Next, the processing circuit determines filter characteristics for the boundary between the two adjacent blocks based on a combination of bases used in the transform of each of the reconstructed blocks. Then, the processing circuit performs a deblocking filter process having the determined filter characteristics.

[0324] The processing circuit is, for example, composed of a CPU (Central Processing Unit) or a processor, and functions as the loop filter unit 212 shown in Fig. 10. The memory may be the block memory 210 or the frame memory 214, or may be another memory.

[0325] In this way, since the filter characteristics for the boundary between the two adjacent blocks are determined based on the combination of bases used in the transformation of each of the two reconstructed blocks, it is possible to determine, for example, asymmetric filter characteristics for the boundary. As a result, even if there is a difference in the error of each pixel value of pixels sandwiching the boundary between the two blocks, it is possible to increase the possibility of suppressing the error by performing a deblocking filter process having asymmetric filter characteristics.

[0326] FIG. 29 is a block diagram showing a detailed configuration of loop filter section 120 according to the present embodiment.

[0327] 27, the loop filter unit 120 includes an error distribution estimating unit 1201, a filter characteristics determining unit 1202, and a filtering unit 1203. The loop filter unit 120 further includes switches 1205, 1207, and 1209, a boundary determining unit 1204, a filter determining unit 1206, and a processing determining unit 1208.

[0328] The boundary determination unit 1204 determines whether or not a pixel to be subjected to deblocking filtering (i.e., a target pixel) exists near a block boundary. Then, the boundary determination unit 1204 outputs the determination result to the switch 1205 and the processing determination unit 1208.

[0329] When the boundary determination unit 1204 determines that the target pixel exists near the block boundary, the switch 1205 outputs the image before filtering to the switch 1207. Conversely, when the boundary determination unit 1204 determines that the target pixel does not exist near the block boundary, the switch 1205 outputs the image before filtering to the switch 1209.

[0330] The filter determination unit 1206 determines whether or not to perform deblocking filter processing on the target pixel, based on the pixel value of at least one surrounding pixel around the target pixel and the error distribution estimated by the error distribution estimation unit 1201. Then, the filter determination unit 1206 outputs the determination result to the switch 1207 and the processing determination unit 1208.

[0331] When the filter determination unit 1206 determines that deblocking filter processing is to be performed on the target pixel, the switch 1207 outputs the unfiltered image acquired via the switch 1205 to the filter processing unit 1203. Conversely, when the filter determination unit 1206 determines that deblocking filter processing is not to be performed on the target pixel, the switch 1207 outputs the unfiltered image acquired via the switch 1205 to the switch 1209.

[0332] When the filtering unit 1203 acquires an unfiltered image via the switches 1205 and 1207, it executes deblocking filtering on a target pixel, the deblocking filtering having the filter characteristics determined by the filter characteristics determination unit 1202. Then, the filtering unit 1203 outputs the filtered pixel to the switch 1209.

[0333] The switch 1209 selectively outputs pixels that have not been subjected to the deblocking filter process and pixels that have been subjected to the deblocking filter process by the filter processing unit 1203 under the control of the process determining unit 1208 .

[0334] The processing determination unit 1208 controls the switch 1209 based on the respective determination results of the boundary determination unit 1204 and the filter determination unit 1206. That is, when the boundary determination unit 1204 determines that the target pixel exists near a block boundary and the filter determination unit 1206 determines that the target pixel is to be subjected to deblocking filter processing, the processing determination unit 1208 causes the switch 1209 to output a pixel that has been subjected to deblocking filter processing. In addition, in cases other than the above, the processing determination unit 1208 causes the switch 1209 to output a pixel that has not been subjected to deblocking filter processing. By repeatedly outputting pixels in this way, a filtered image is output from the switch 1209.

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

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

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

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

[0339] Furthermore, in the HEVC deblocking filter process, clipping is performed so that the pixel value after the calculation does not change beyond a threshold. In this clipping process, the pixel value after the calculation according to the above formula is clipped to "pixel value before the calculation ±2 × threshold" using a threshold determined from the quantization parameter. This makes it possible to prevent excessive smoothing.

[0340] However, in such deblocking filter processing, the change in pixel value is determined by the surrounding pixel values ​​and the quantization parameter, and the filter characteristics are designed without reflecting the non-uniformity of the error distribution in the block. Therefore, the problem shown in (a) of FIG. 26 may occur.

[0341] Therefore, the loop filter unit 120 in this embodiment determines the filter characteristics of the deblocking filter process by reflecting the non-uniformity of the error distribution in the block. Specifically, the error distribution estimation unit 1201 estimates that the pixel value of a pixel has a larger error as the pixel is located at a position where the amplitude of the base is larger. Next, the filter characteristics determination unit 1202 determines the filter characteristics based on the error distribution estimated by the error distribution estimation unit 1201. Here, when determining the filter coefficients of the filter characteristics, the filter characteristics determination unit 1202 determines a small filter coefficient for a pixel with a large error so that the pixel with a small error is less likely to be affected by surrounding pixels with large errors. In addition, the filter characteristics determination unit 1202 determines a large filter coefficient for a pixel with a small error so that the pixel with a large error is more likely to be affected by surrounding pixels with small errors.

[0342] That is, the filter coefficients or thresholds determined by the loop filter unit 120 do not necessarily need to be symmetrical with respect to the block boundary. When performing deblocking filter processing on a target pixel with a large error, the loop filter unit 120 determines a large filter coefficient for a pixel with a small error. Also, when performing deblocking filter processing on a target pixel with a small error of two pixels that sandwich a block boundary, the loop filter unit 120 determines a small filter coefficient for the pixel with a large error.

[0343] That is, in this embodiment, in determining filter characteristics, the processing circuit determines a smaller filter coefficient for a pixel at a position where the amplitude of the basis used for transforming the block is larger.In addition, as described above, the transform coefficient of a low-order basis is likely to be larger than the transform coefficient of a high-order basis.Therefore, the amplitude of the above-mentioned basis is, for example, the amplitude of a low-order basis, and in particular, the amplitude of the 0th order basis.

[0344] For example, the pixel value of a pixel is more likely to have a larger error at a position where the amplitude of the basis is larger. In the encoding device 100 in this embodiment, a smaller filter coefficient is determined for a pixel having a pixel value with a larger error. Therefore, by the deblocking filter process with such a filter coefficient, the influence of the pixel value with a large error on the pixel value with a small error can be further suppressed. In other words, the possibility of suppressing the error can be further increased. In addition, the lower the basis, the greater the influence on the error. Therefore, the pixel is more likely to have a larger error at a position where the amplitude of the 0th basis is larger, and a smaller filter coefficient is determined for the pixel, thereby further increasing the possibility of suppressing the error.

[0345] The error distribution estimation unit 1201 may use at least one of the orthogonal transform basis, block size, presence or absence of a pre-filter, intra prediction direction, the number of reference images for inter prediction, and quantization parameter as the error-related parameter.

[0346] Figs. 31 to 35 are diagrams showing examples of bases for orthogonal transformation for each block size. That is, these diagrams show examples of bases for orthogonal transformation for each of block sizes N = 32, 16, 8, and 4. Specifically, Fig. 31 shows bases of the 0th to 5th orders among the bases of DCT-II, Fig. 32 shows bases of the 0th to 5th orders among the bases of DCT-V, and Fig. 33 shows bases of the 0th to 5th orders among the bases of DCT-VIII. Fig. 34 shows bases of the 0th to 5th orders among the bases of DST-I, and Fig. 35 shows bases of the 0th to 5th orders among the bases of DST-VII. Note that the horizontal axis of each graph in Figs. 31 to 35 indicates the position in one-dimensional space, and the vertical axis indicates the value (i.e., amplitude) of the base.

[0347] The error distribution estimation unit 1201 estimates the error distribution based on bases such as DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII shown in Figs. 31 to 35. At this time, the error distribution estimation unit 1201 may further estimate the error distribution based on the size of the block, i.e., the number of pixels N, to which the orthogonal transformation of these bases is applied.

[0348] <Specific Example of DST-VII / DST-VII> Fig. 36 is a diagram showing an example of the determined filter coefficients.

[0349] For example, as shown in Fig. 36, the loop filter unit 120 performs deblocking filter processing on the target pixel p0. Note that the block P and the block Q are adjacent to each other, for example, in the horizontal direction, and the target pixel p0 exists at a position close to the boundary (i.e., the block boundary) with the block Q in the block P.

[0350] Here, for example, each of the block P and the block Q is a block orthogonally transformed by DST-VII. In such a case, as shown in Fig. 35, in the upper and left regions within the block, the amplitude of the low-order (specifically, the 0th order) base is small, and in the lower and right regions within the block, the amplitude of the low-order base is large.

[0351] Therefore, when blocks P and Q are adjacent in the horizontal direction, the amplitude of the low-order (specifically, zero-order) basis is large near the block boundary of the left block P, i.e., on the right side of the block P. Also, the amplitude of the low-order basis is small near the block boundary of the right block Q, i.e., on the left side of the block Q.

[0352] As a result, the error distribution estimation unit 1201 estimates a large error near the block boundary in block P, and estimates a small error near the block boundary in block Q. In this way, the error distribution near the block boundary is estimated.

[0353] The filter characteristic determination unit 1202 determines, for example, the filter coefficients of a 5-tap deblocking filter as the filter characteristics based on the estimated error distribution.

[0354] The 5-tap deblocking filter is a deblocking filter that uses five pixels arranged in the horizontal direction. When pixel p0 is the target pixel, the five pixels are pixels p2, p1, p0, q0, and q1. The filter coefficient of the reference 5-tap deblocking filter is, for example, (1,2,2,2,1) / 8. The pixel value p'0 after the calculation of the target pixel p0 is calculated by the calculation using this reference filter coefficient, that is, p'0=(1×p2+2×p1+2×p0+2×q0+1×q1) / 8.

[0355] In the present embodiment, when the error distribution as described above is estimated, the filter characteristic determination unit 1202 determines filter coefficients different from the above-mentioned criteria as filter characteristics. Specifically, a small filter coefficient is determined for a pixel in a position in the block P where the error is estimated to be large, and a large filter coefficient is determined for a pixel in a position in the block Q where the error is estimated to be small. More specifically, as shown in FIG. 36, the filter characteristic determination unit 1202 determines the filter coefficients of pixels p2, p1, p0, q0, and q1 for performing deblocking filter processing on the target pixel p0 in the block P, as (0.5, 1.0, 1.0, 2.0, 1.5) / 6. In this case, the filter coefficient determined for the pixel p0 in the block P where the error is estimated to be large is "1.0 / 6", and the filter coefficient determined for the pixel q0 in the block Q where the error is estimated to be small is "2.0 / 6". In other words, the filter coefficient of pixel p0 is smaller than the filter coefficient of pixel q0, and the filter coefficient of pixel q0 is larger than the filter coefficient of pixel p0.

[0356] As a result, the filter processing unit 1203 performs a calculation using the filter coefficients thus determined to calculate a post-calculation pixel value p'0 of the target pixel p0, i.e., p'0=(0.5×p2+1.0×p1+1.0×p0+2.0×q0+1.5×q1) / 6. This post-calculation pixel value p'0 is the pixel value of the target pixel p0 after the deblocking filter process.

[0357] Here, the filter characteristic determination unit 1202 in this embodiment may further determine a threshold value for clip processing as a filter characteristic based on the estimated error distribution. The threshold value is the above-mentioned reference value or clip width. For example, the filter characteristic determination unit 1202 determines a large threshold value for pixels at positions where the amplitude of the basis is large, that is, pixels at positions where the error is estimated to be large. Conversely, the filter characteristic determination unit 1202 determines a small threshold value for pixels at positions where the amplitude of the basis is small, that is, pixels at positions where the error is estimated to be small. The amplitude of this basis is, for example, the amplitude of a low-order basis, specifically, the amplitude of a zero-order basis. For example, when the reference threshold value is 10, the filter characteristic determination unit 12 determines a threshold value for pixels on the right side close to the block boundary of the block P as 12, and determines a threshold value for pixels on the left side close to the block boundary of the block Q as 8.

[0358] When a threshold value is determined for the target pixel p0, the filter processing unit 1203 performs clipping on the post-computation pixel value p'0 of the target pixel p0. The threshold value determined for the target pixel p0 is, for example, 12. Therefore, when the amount of change from the pixel value p0 before the computation to the pixel value p'0 after the computation is greater than the threshold value 12, the filter processing unit 1203 clips the post-computation pixel value p'0 to a pixel value (p0+12) or a pixel value (p0-12). More specifically, when (p0-p'0)>12, the filter processing unit 1203 clips the post-computation pixel value p'0 to (p0-12), and when (p0-p'0)<-12, the filter processing unit 1203 clips the post-computation pixel value p'0 to (p0+12). As a result, the pixel value (p0+12) or the pixel value (p0-12) is set as the pixel value p'0 of the target pixel p0 after the deblocking filter process. On the other hand, if the amount of change is 12 or less, the calculated pixel value p'0 is set as the pixel value of the target pixel p0 after the deblocking filter process.

[0359] Thus, in this embodiment, the two blocks are a first block and a second block located to the right or below the first block. In determining the filter characteristics, if the basis used for transforming the first block is a first basis and the basis used for transforming the second block is a second basis, the processing circuit determines a first filter coefficient for a pixel located near the boundary in the first block and a second filter coefficient for a pixel located near the boundary in the second block as filter characteristics based on the first basis and the second basis, respectively. Specifically, in determining the filter characteristics, if the first basis and the second basis are DST (Discrete Sine Transforms)-VII, the processing circuit determines a second filter coefficient larger than the first filter coefficient as the filter characteristics.

[0360] When the first base and the second base are DST-VII, there is a high possibility that the error is large near the boundary of the first block and the error is small near the boundary of the second block. Therefore, in such a case, the second filter coefficient larger than the first filter coefficient is determined, and the deblocking filter process having these first and second filter coefficients is performed, so that the possibility of appropriately suppressing the error near the boundary can be increased.

[0361] In addition, in the determination of the filter characteristics, the processing circuit further determines a first threshold value for the first block and a second threshold value for the second block as filter characteristics based on a combination of the bases of the first block and the second block. In the deblocking filter process, the processing circuit performs an operation using the first filter coefficient and the second filter coefficient on the pixel value of the target pixel to obtain a pixel value after the operation of the target pixel. Next, the processing circuit determines whether or not the amount of change from the pixel value of the target pixel before the operation to the pixel value after the operation is greater than the threshold value of the block to which the target pixel belongs, out of the first threshold value and the second threshold value. In the case where the amount of change is greater than the threshold value, the processing circuit clips the pixel value of the target pixel after the operation to the sum or difference between the pixel value of the target pixel before the operation and the threshold value.

[0362] Thus, when the change amount of the pixel value after the operation of the target pixel is larger than the threshold value, the pixel value after the operation is clipped to the sum or difference between the pixel value before the operation and the threshold value, so that it is possible to suppress a large change in the pixel value to be processed by the deblocking filter process. Also, the first threshold value for the first block and the second threshold value for the second block are determined based on the combination of the bases of the first block and the second block. Therefore, for each of the first block and the second block, a large threshold value is determined for a pixel located at a position where the base amplitude is large, that is, a pixel with a large error, and a small threshold value is determined for a pixel located at a position where the base amplitude is small, that is, a pixel with a small error. As a result, it is possible to permit a large change in the pixel value of a pixel with a large error and prohibit a large change in the pixel value of a pixel with a small error by the deblocking filter process. Therefore, it is possible to further enhance the possibility of appropriately suppressing the error near the boundary between the first block and the second block.

[0363] <Specific Example of DST-VII / DCT-II> FIG. 37 is a diagram showing another example of the filter coefficient to be determined.

[0364] For example, the loop filter unit 120 performs deblocking filter processing on the target pixel p0 as shown in FIG. 37, similar to the example shown in FIG. 36.

[0365] Here, for example, block P is a block orthogonally transformed by DST-VII, and block Q is a block orthogonally transformed by DCT-II. In such a case, as shown in FIG. 35, in the upper and left regions of block P, the amplitude of the low-order (specifically, 0th order) basis is small, and in the lower and right regions of block P, the amplitude of the low-order basis is large. On the other hand, as shown in FIG. 31, in block Q, the amplitude of the low-order basis is constant, but is larger than the amplitude in the upper and left regions of block P and smaller than the amplitude in the lower and right regions of block P. That is, in block Q, the amplitude of the low-order basis is constant at a medium level.

[0366] Therefore, when blocks P and Q are adjacent in the horizontal direction, the amplitude of the low-order (specifically, 0th order) basis is large near the block boundary of the left block P, i.e., on the right side of the block P. Also, near the block boundary of the right block Q, i.e., on the left side of the block Q, the amplitude of the low-order basis is at a medium level.

[0367] As a result, the error distribution estimation unit 1201 estimates a large error near the block boundary in block P, and estimates a medium level error near the block boundary in block Q. This allows the error distribution near the block boundary to be estimated. That is, the error distribution estimated shows a more gradual error change in the direction perpendicular to the block boundary than the example shown in FIG.

[0368] Based on the estimated error distribution, the filter characteristic determination unit 1202 determines, as filter characteristics, the filter coefficients of, for example, a 5-tap deblocking filter. That is, the filter characteristic determination unit 1202 determines the filter coefficients such that the target pixel p0 located at a position with a large error in block P is more likely to be affected by the pixels having medium-level errors in block Q. Also, since the error distribution near the block boundary shows a gentle error change in the direction perpendicular to the block boundary, the filter characteristic determination unit 1202 determines five filter coefficients with smaller differences from each other than in the example shown in FIG. 36. Specifically, the filter characteristic determination unit 1202 determines the filter coefficients of pixels p2, p1, p0, q0, and q1 for performing deblocking filter processing on the target pixel p0 of block P as (0.5, 1.0, 1.5, 1.75, 1.25) / 6. In this case, the filter coefficient determined for the pixel p0 at the position where the error in block P is estimated to be large is "1.5 / 6", and the filter coefficient determined for the pixel q0 at the position where the error in block Q is estimated to be at a medium level is "1.75 / 6". That is, the filter coefficient of pixel p0 is smaller than the filter coefficient of pixel q0, and the filter coefficient of pixel q0 is larger than the filter coefficient of pixel p0. Also, the difference between the filter coefficient of pixel p0 and the filter coefficient of pixel q0 is smaller than in the example shown in FIG. 36.

[0369] Also, even when block P and block Q are adjacent in the vertical direction, the error distribution estimation unit 1201 estimates the error distribution in the same manner as described above, and the filter characteristic determination unit 1202 determines the filter coefficients based on the error distribution. Further, the filter characteristic determination unit 1202 may determine the threshold for the clip process in the same manner as the example shown in FIG. 36, and the filter processing unit 1203 may perform the clip process using the threshold.

[0370] <Specific Example of DST-I / DST-I> FIG. 38 is a diagram showing still another example of the determined filter coefficients.

[0371] For example, the loop filter unit 120 performs deblocking filtering on the target pixel p0 as shown in FIG. 38, similarly to the examples shown in FIGS.

[0372] Here, for example, each of block P and block Q is a block that has been orthogonally transformed by DST-I. In this case, as shown in Fig. 34, the amplitude of the low-order (specifically, 0th order) basis in the upper and left regions of the block is equal to the amplitude of the low-order basis in the lower and right regions of the block.

[0373] Therefore, when blocks P and Q are adjacent in the horizontal direction, the amplitude of the low-order basis near the block boundary of block P is equal to the amplitude of the low-order basis near the block boundary of block Q.

[0374] As a result, the error distribution estimation unit 1201 estimates an error distribution near the block boundary between block P and block Q that is symmetric with respect to the block boundary.

[0375] In such a case, the filter characteristic determination unit 1202 determines the above-mentioned reference filter characteristic, that is, the filter characteristic that is symmetric with respect to the block boundary, as the filter characteristic based on the error distribution.

[0376] Also, even if each of the blocks P and Q is a block orthogonally transformed by DCT-II, the amplitude of the low-order basis near the block boundary of the block P is equal to the amplitude of the low-order basis near the block boundary of the block Q, as described above. Therefore, even in such a case, the error distribution estimation unit 1201 estimates an error distribution symmetrical with respect to the block boundary as the error distribution near the block boundary of the blocks P and Q. Then, the filter characteristic determination unit 1202 determines the above-mentioned reference filter characteristic, that is, the filter characteristic symmetrical with respect to the block boundary, as the filter characteristic based on the error distribution. The filter coefficient of the reference 5-tap deblocking filter is, for example, (1,2,2,2,1) / 8. In this case, the filter coefficient determined for the pixel p0 in the block P is "2 / 8", and the filter coefficient determined for the pixel q0 in the block Q is "2 / 8". That is, these filter coefficients are symmetrical with respect to the block boundary.

[0377] In this manner, in this embodiment, when the first basis and the second basis are DCT (Discrete Cosine Transforms)-II, the second filter coefficients equal to the first filter coefficients are determined as the filter characteristics.

[0378] When the first and second bases are DCT-II, there is a high possibility that the errors are equal near the boundary of the first block and near the boundary of the second block. Therefore, in this case, the second filter coefficient equal to the first filter coefficient is determined, and a deblocking filter process using these first and second filter coefficients is performed, so that the possibility of appropriately suppressing the errors near the boundaries can be increased.

[0379] <Examples of block sizes> Fig. 39 is a diagram for explaining the relationship between block size and error. Note that block size is the block width or the number of pixels in a block. Specifically, Fig. 39(a) shows the 0th to 5th order basis of DST-VII for block size N=32, and Fig. 39(b) shows the 0th to 5th order basis of DST-VII for block size N=4. Note that the horizontal axis of each graph in Fig. 39 indicates the position in one-dimensional space, and the vertical axis indicates the value of the basis (i.e., amplitude).

[0380] The amplitude of the basis at the block boundary differs depending on the block size, which is the number of pixels in the block to be orthogonally transformed. Therefore, the error distribution estimation unit 1201 in this embodiment estimates the error distribution based on the block size as well. This makes it possible to improve the accuracy of the determined filter coefficients.

[0381] For example, as shown in FIG. 39, even in a block orthogonally transformed by DST-VII, the amplitudes of the bases at the block boundary are different between the case of block size N=4 and the case of block size N=32. Specifically, in the case of block size N=32, as shown in FIG. 39(a), the amplitudes of the zeroth to fifth order bases at position n=32 of DST-VII are all 1. The position of n=32 is the right or lower end in the block of block size N=32. On the other hand, in the case of block size N=4, as shown in FIG. 39(b), some of the amplitudes of the zeroth to third order bases at position n=4 of DST-VII are smaller than 1. The position of n=4 is the right or lower end in the block of block size N=4.

[0382] Therefore, in this embodiment, the error distribution estimation unit 1201 estimates a small error as the error on the right and bottom sides of the block orthogonally transformed by DST-VII when the block size N=4, and estimates a larger error when the block size N=32.

[0383] FIG. 40 is a diagram showing still another example of the determined filter coefficients.

[0384] For example, the loop filter unit 120 performs a filter process on the target pixel p0 as shown in FIG. 40, similar to the examples shown in FIGS.

[0385] Here, for example, block P is a block of block size N=32 that has been orthogonally transformed by DST-VII, and block Q is a block of block size N=4 that has been orthogonally transformed by DST-VII. In such a case, as shown in (a) of Fig. 39, in the upper and left regions of block P, the amplitude of the low-order basis (specifically, 0th order) is small, and in the lower and right regions of block P, the amplitude of the low-order basis is large. On the other hand, as shown in (b) of Fig. 39, in the upper and left regions of block Q, the amplitude of the low-order basis is at a medium level.

[0386] As a result, the error distribution estimation unit 1201 estimates a large error near the block boundary in block P, and estimates a medium level error near the block boundary in block Q. This allows the error distribution near the block boundary to be estimated. That is, the error distribution estimated shows a more gradual error change in the direction perpendicular to the block boundary than the example shown in FIG.

[0387] The filter characteristic determination unit 1202 determines, for example, the filter coefficients of a 5-tap filter as the filter characteristics based on the estimated error distribution. That is, the filter characteristic determination unit 1202 determines the filter coefficients so that the target pixel p0 in the block P having a large error is easily influenced by the pixel in the block Q having a medium level error. In addition, since the error distribution near the block boundary shows a gradual error change in the direction perpendicular to the block boundary, the filter characteristic determination unit 1202 determines five filter coefficients whose differences are smaller than those in the example shown in FIG. 36. Specifically, the filter characteristic determination unit 1202 determines the filter coefficients of the pixels p2, p1, p0, q0, and q1 for performing the deblocking filter process on the target pixel p0 in the block P as (0.5, 1.0, 1.5, 1.75, 1.25) / 6. In this case, the filter coefficient determined for pixel p0 at a position where the error in block P is estimated to be large is "1.5 / 6", and the filter coefficient determined for pixel q0 at a position where the error in block Q is estimated to be medium level is "1.75 / 6". That is, the filter coefficient of pixel p0 is smaller than the filter coefficient of pixel q0, and the filter coefficient of pixel q0 is larger than the filter coefficient of pixel p0. Also, the difference between the filter coefficient of pixel p0 and the filter coefficient of pixel q0 is smaller than in the example shown in FIG.

[0388] Thus, in this embodiment, when the first and second bases are DST (Discrete Sine Transforms)-VII and the size of the second block is smaller than the size of the first block, the processing circuit determines the second filter coefficient larger than the first filter coefficient as the filter characteristic. The slope of the filter coefficient between the determined first and second filter coefficients is gentler than when the sizes of the first and second blocks are equal.

[0389] When the first and second bases are DST-VII and the size of the second block is smaller than the size of the first block, there is a high possibility that the error is large near the boundary of the first block and the error is medium near the boundary of the second block, i.e., the error distribution near the boundary between the first block and the second block is likely to have a gentle gradient.

[0390] In this embodiment, in the encoding device 100, in such a case, a second filter coefficient larger than the first filter coefficient is determined, and a deblocking filter process is performed using these first and second filter coefficients. Here, the slope of the filter coefficient between the determined first filter coefficient and the second filter coefficient is gentler than when the sizes of the first block and the second block are equal. Therefore, even if the error distribution near the boundary between the first block and the second block has a gentle slope, it is possible to increase the possibility of appropriately suppressing the error near the boundary.

[0391] <Variation 1> In the seventh embodiment, the filter processing unit 1203 performs deblocking filtering even on pixels with small errors, but the deblocking filtering on pixels with small errors may be turned off. Turning off the deblocking filtering is equivalent to setting the filter coefficient for the target pixel to 1 and the filter coefficients for pixels other than the target pixel to zero.

[0392] In addition, in the above-mentioned seventh embodiment, the filter determination unit 1206 and the filter characteristic determination unit 1202 perform processing based on the error distribution estimated by the error distribution estimation unit 1201. However, the filter determination unit 1206 may determine whether or not to perform filtering using only the quantization parameter, and the filter characteristic determination unit 1202 may determine the filter characteristic based on the quantization parameter and the basis of the orthogonal transform.

[0393] In addition, in this modification, deblocking filter processing may be performed on each of the luminance signal and the color difference signal. In this case, the loop filter unit 120 may design the deblocking filter for the luminance signal and the deblocking filter for the color difference signal independently or to be mutually dependent. For example, the loop filter unit 120 may perform the deblocking filter processing of the above-mentioned embodiment 7 only on one of the luminance signal and the color difference signal, and perform the other deblocking filter processing on the other signal.

[0394] In addition, in this modification, for example, the deblocking filter process of the seventh embodiment may be performed only on the intra-prediction block, or the deblocking filter process of the seventh embodiment may be performed on both the intra-prediction block and the inter-prediction block.

[0395] Furthermore, the loop filter unit 120 may switch the deblocking filter process of the seventh embodiment on and off in units of slices, tiles, wavefront divisions, or CTUs.

[0396] Also, there is a technology that performs a further transform after the orthogonal transform to increase the bias of coefficients in frequency space and improve compression efficiency (for example, Non-Separable Secondary Transform in JVET). In this case, the loop filter unit 120 may determine the filter characteristics based on the transform base of the orthogonal transform.

[0397] Also, for example, the first block may be orthogonally transformed by DST-VII in the first and second times, and the second block may be orthogonally transformed by DST-VII in the first time and by DCT-II in the second time. In such a case, the loop filter unit 120 estimates a steeper error distribution for the first block than for the second block. That is, the slopes of the error distribution in the horizontal and vertical directions of the first block are steeper than the slopes of the error distribution of the second block. Then, the loop filter unit 120 determines the filter characteristics based on the steeper error distribution.

[0398] In addition, the block size may differ between the first transform and the second transform. In such a case, the loop filter unit 120 performs a deblocking filter process on at least one of the boundaries between the blocks of the two block sizes that are different from each other.

[0399] Furthermore, when performing the deblocking filter process of the seventh embodiment on an inter-prediction block, it is expected that the distribution or absolute value of the coefficient for each frequency after orthogonal transformation will differ depending on the prediction method. The prediction methods include, for example, Uni-pred (single-frame reference prediction) and Bi-pred (two-frame reference prediction).

[0400] Therefore, the loop filter unit 120 may determine a filter coefficient according to the prediction method. For example, the loop filter unit 120 sets a filter weight for a Uni-pred block, which tends to have a large absolute value of a coefficient, smaller than a filter weight for a Bi-pred block.

[0401] Furthermore, the loop filter unit 120 may independently determine the filter weight for the block to which the merge mode is applied. For example, the loop filter unit 120 sets the filter weight for the block to which the merge mode is applied to be larger or smaller than the filter weight for the block to which a prediction other than the merge mode is applied.

[0402] Moreover, the deblocking filter process in the seventh embodiment not only makes the image to be processed closer to the original image, but also makes the block boundaries less noticeable, as in the case of conventional deblocking filter processes. Therefore, if emphasis is placed on subjective evaluation as well as objective evaluation, it is effective to change the filter characteristics for each block size.

[0403] Specifically, since block noise is noticeable in blocks with large errors, loop filter unit 120 may set the filter coefficients, thresholds, or number of filter taps on both sides of the block boundary to be larger than those for blocks with small errors.

[0404] Basically, the closer the pixels are to each other, the higher the correlation between pixel values ​​is, so the more pixels farther away from the target pixel are used in the deblocking filter process of the target pixel, the worse the objective evaluation will be. However, the more pixels are used in the deblocking filter process, the less noticeable the block noise will be from a subjective perspective. Therefore, based on a trade-off between the objective evaluation and the subjective evaluation, the loop filter unit 120 may use a pixel farther away from the target pixel in the deblocking filter process.

[0405] In the seventh embodiment, the error distribution is estimated according to a basis such as DCT and DST, and the filter characteristics are determined based on the estimated error distribution. However, instead of these bases, the error distribution may be estimated according to other transform methods such as KLT (Karhunen-Loeve Transform), DFT (Discrete Fourier transform), Wavelet transform, and lapped transform, and the filter characteristics may be determined based on the estimated error distribution.

[0406] Furthermore, although the coding apparatus 100 in the seventh embodiment above includes the error distribution estimation unit 1201 and estimates the error distribution, the coding apparatus 100 may not include this error distribution estimation unit 1201. That is, the coding apparatus 100 may directly determine the filter characteristics from the basis used for transforming the block, without estimating the error distribution.

[0407] <Variation 2> In the seventh embodiment or its first modification, a deblocking filter process having filter characteristics determined based on a combination of bases is performed. However, a loop filter process other than a deblocking filter process may be performed.

[0408] For example, the loop filter unit 120 may determine a filter coefficient of SAO (Sample Adaptive Offset) using a basis used for transformation and a position of the target pixel in the block. Alternatively, the loop filter unit 120 may perform trilateral filter processing based on three parameters. The three parameters include, for example, a pixel value difference, a distance between pixels, and an error distribution estimated from a basis of an orthogonal transformation. Alternatively, the loop filter unit 120 may perform filter processing that applies the deblocking filter processing of the seventh embodiment or its first modification in the intra processing loop. Also, the loop filter unit 120 does not need to change the pixel value of the target pixel based on information of the surrounding pixels, and may provide an offset according to the error distribution to each target pixel.

[0409] Also, if the error distribution can be predicted, the loop filter unit 120 does not need to acquire error-related parameters for each filter process. For example, in an intra-prediction block by software of JEM (Joint Exploration Model) 4.0, due to the design of the above-mentioned EMT, errors are unlikely to occur on the upper and left sides of the block, and errors are likely to occur on the lower and right sides of the block. Therefore, the loop filter unit 120 may take this into consideration in advance and perform deblocking filter processing with weak filter strength on the upper and left sides of the intra-prediction block of JEM4.0.

[0410] In the seventh embodiment or its first modification, the filter determination unit 1206 determines whether or not to perform deblocking filtering on the target pixel. However, the filter determination unit 1206 may perform deblocking filtering on all block boundaries without performing this determination.

[0411] Furthermore, in the above-mentioned seventh embodiment or its first modification, the loop filter unit 120 performs deblocking filter processing on the block boundary of the reconstructed block output from the adder unit 116, the deblocking filter processing having filter characteristics determined based on a combination of bases. Here, for example, the encoding device 100 may include a filter unit different from the loop filter unit 120. That is, the filter unit performs filter processing on the reconstructed block, and the loop filter unit 120 performs deblocking filter processing on the block boundary of the reconstructed block filtered by the filter unit. In such a case, the loop filter unit 120 may determine the filter characteristics of the deblocking filter processing based on the filter characteristics of the filter unit as well as the combination of bases. Furthermore, the filter unit may perform deblocking filter processing having filter characteristics symmetrical with respect to the block boundary. In this case, the filter coefficient used in the filter unit is set to be smaller than the filter coefficient when the loop filter unit 120 of the above-mentioned seventh embodiment or its first modification is not provided in the encoding device 100. Furthermore, the filter unit may perform bilateral filter processing based on two parameters as deblocking filter processing having filter characteristics symmetrical with respect to the block boundary. The two parameters are, for example, the difference between pixel values ​​and the distance between pixels. In this case, the loop filter unit 120 may determine filter coefficients that are generally smaller than the filter coefficients shown in, for example, FIGS.

[0412] In the seventh embodiment or its first modification, the loop filter unit 120 performs deblocking filter processing on block boundaries, but may perform filter processing on areas within a block that are not block boundaries. For example, the loop filter unit 120 may change the pixel values ​​of pixels with large errors within one block by using pixel values ​​of pixels with small errors. Hereinafter, such filter processing is referred to as intra-block filter processing.

[0413] Specifically, as shown in Fig. 35, within a block orthogonally transformed by DST-VII, the error of the pixels on the upper side or the left side is small, and the error of the pixels on the lower side or the right side is large. Therefore, the loop filter unit 120 performs intra-block filtering to change the pixel values ​​of the pixels on the lower side or the right side using the pixel values ​​of the pixels on the upper side or the left side. This increases the possibility of reducing the error.

[0414] Fig. 41 is a diagram showing the gradient of the basis that differs depending on the block size. Note that the horizontal axis of each graph in Fig. 41 indicates the position in one-dimensional space, and the vertical axis indicates the value of the basis (i.e., the amplitude).

[0415] 41(a), the amplitude of the zeroth-order basis of DST-VII for block size N=32 increases by about 10 times from positions n=1 to n=32 in one-dimensional space. On the other hand, the amplitude of the zeroth-order basis of DST-VII for block size N=4 increases by about 3 times from positions n=1 to n=4 in one-dimensional space.

[0416] Thus, even if the basis used in the transformation of each of the two blocks is the same, if the block sizes are different, the gradient of the basis within the block will be steeper in the smaller block and gentler in the larger block.

[0417] In other words, as described above, when the loop filter unit 120 performs intra-block filtering, the effect of increasing the possibility of error reduction can be more effectively achieved for blocks with a steep gradient of the low-order basis of the orthogonal transform, i.e., small blocks.

[0418] Furthermore, even if the block size of a block is large, if the distance dependency or directional dependency of the correlation of pixel values ​​in the block is weak, the possibility of error reduction can be increased by the loop filter unit 120 performing intrablock filtering. For example, the direction of intraprediction affects the distance dependency or directional dependency of the correlation of pixel values. The distance dependency is a property in which the closer the distance between two pixels is, the higher the correlation of the pixel values ​​of those pixels is. The directional dependency is a property in which the correlation of the pixel values ​​of these pixels differs depending on the direction from one pixel to the other pixel. Therefore, the loop filter unit 120 may change the pixel value of a pixel with a large error by performing intrablock filtering according to the direction of intraprediction.

[0419] [Implementation example] Fig. 42 is a block diagram showing an implementation example of the encoding device 100 according to each of the above-mentioned embodiments. The encoding device 100 includes a processing circuit 160 and a memory 162. For example, multiple components of the encoding device 100 shown in Fig. 1 are implemented by the processing circuit 160 and the memory 162 shown in Fig. 42.

[0420] The processing circuit 160 is a circuit that performs information processing and is a circuit that can access the memory 162. For example, the processing circuit 160 is a dedicated or general-purpose electronic circuit that encodes moving images. The processing circuit 160 may be a processor such as a CPU. The processing circuit 160 may also be a collection of multiple electronic circuits. For example, the processing circuit 160 may play the roles of multiple components of the encoding device 100 shown in FIG. 1 , excluding components for storing information.

[0421] The memory 162 is a general-purpose or dedicated memory in which information for the processing circuit 160 to encode a moving image is stored. The memory 162 may be an electronic circuit and may be connected to the processing circuit 160. The memory 162 may be included in the processing circuit 160. The memory 162 may be a collection of multiple electronic circuits. The memory 162 may be a magnetic disk, an optical disk, or the like, and may be expressed as a storage, a recording medium, or the like. The memory 162 may be a non-volatile memory or a volatile memory.

[0422] For example, the memory 162 may store a video to be encoded, or a bit string corresponding to the encoded video. Also, the memory 162 may store a program for the processing circuitry 160 to encode the video.

[0423] Also, for example, the memory 162 may play the role of a component for storing information among the multiple components of the encoding device 100 shown in Fig. 1. Specifically, the memory 162 may play the role of the block memory 118 and the frame memory 122 shown in Fig. 1. More specifically, the memory 162 may store processed sub-blocks, processed blocks, processed pictures, and the like.

[0424] In addition, in the encoding device 100, all of the components shown in Fig. 1 and the like may not be implemented, and all of the above-described processes may not be performed. Some of the components shown in Fig. 1 and the like may be included in another device, and some of the above-described processes may be executed by another device. In the encoding device 100, some of the components shown in Fig. 1 and the like are implemented, and some of the above-described processes are performed, so that a moving image can be appropriately processed with a small amount of code.

[0425] Fig. 43 is a block diagram showing an implementation example of the decoding device 200 according to each of the above embodiments. The decoding device 200 includes a processing circuit 260 and a memory 262. For example, multiple components of the decoding device 200 shown in Fig. 10 are implemented by the processing circuit 260 and the memory 262 shown in Fig. 43.

[0426] The processing circuit 260 is a circuit that performs information processing and is a circuit that can access the memory 262. For example, the processing circuit 260 is a general-purpose or dedicated electronic circuit that decodes moving images. The processing circuit 260 may be a processor such as a CPU. The processing circuit 260 may also be a collection of multiple electronic circuits. For example, the processing circuit 260 may play the roles of multiple components of the decoding device 200 shown in FIG. 10 , excluding the components for storing information.

[0427] The memory 262 is a general-purpose or dedicated memory in which information for the processing circuit 260 to decode a moving image is stored. The memory 262 may be an electronic circuit and may be connected to the processing circuit 260. The memory 262 may be included in the processing circuit 260. The memory 262 may be a collection of multiple electronic circuits. The memory 262 may be a magnetic disk, an optical disk, or the like, and may be expressed as a storage, a recording medium, or the like. The memory 262 may be a non-volatile memory or a volatile memory.

[0428] For example, the memory 262 may store a bit string corresponding to an encoded video, or a video corresponding to a decoded bit string, or may store a program for the processing circuitry 260 to decode the video.

[0429] Also, for example, the memory 262 may play the role of a component for storing information among the multiple components of the decoding device 200 shown in Fig. 10. Specifically, the memory 262 may play the role of the block memory 210 and the frame memory 214 shown in Fig. 10. More specifically, the memory 262 may store processed sub-blocks, processed blocks, processed pictures, and the like.

[0430] In addition, in the decoding device 200, all of the components shown in Fig. 10 and the like may not be implemented, and all of the above-described processes may not be performed. Some of the components shown in Fig. 10 and the like may be included in another device, and some of the above-described processes may be executed by another device. In the decoding device 200, some of the components shown in Fig. 10 and the like are implemented, and some of the above-described processes are performed, so that a moving image can be appropriately processed with a small amount of code.

[0431] [supplement] The encoding device 100 and the decoding device 200 in each of the above embodiments may be used as an image encoding device and an image decoding device, or may be used as a video encoding device and a video decoding device. Alternatively, the encoding device 100 and the decoding device 200 may be used as an inter prediction device. That is, the encoding device 100 and the decoding device 200 may correspond only to the inter prediction unit 126 and the inter prediction unit 218, respectively.

[0432] In addition, in each of the above embodiments, a predictive block is coded or decoded as a block to be coded or a block to be decoded, but the block to be coded or the block to be decoded is not limited to a predictive block and may be a sub-block or another block.

[0433] In each of the above embodiments, each component may be implemented by dedicated hardware or by executing a software program suitable for each component. Each component may be implemented 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.

[0434] Specifically, each of the encoding device 100 and the decoding device 200 may include a processing circuitry and a storage device electrically connected to the processing circuitry and accessible from the processing circuitry.

[0435] The processing circuit includes at least one of dedicated hardware and a program execution unit, and executes processing using a storage device. In addition, when the processing circuit includes a program execution unit, the storage device stores a software program to be executed by the program execution unit.

[0436] Here, the software for realizing the encoding device 100 or the decoding device 200 in each of the above-mentioned embodiments is a program as follows.

[0437] That is, this program causes the computer to execute processing according to any of the flowcharts shown in Figures 5B, 5D, 11, 13, 14, 16, 19, 20, 22, and 28.

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

[0439] Furthermore, a process executed by a specific component may be executed by another component. The order in which the processes are executed may be changed, or multiple processes may be executed in parallel. Furthermore, the encoding / decoding device may include the encoding device 100 and the decoding device 200.

[0440] Ordinal numbers such as first and second used in the description may be changed as appropriate. Also, new ordinal numbers may be given to components or removed.

[0441] Although the aspects of the encoding device 100 and the decoding device 200 have been described based on the respective embodiments, the aspects of the encoding device 100 and the decoding device 200 are not limited to these embodiments. As long as they do not deviate from the spirit of the present disclosure, the scope of the aspects of the encoding device 100 and the decoding device 200 may include various modifications conceivable by a person skilled in the art to the embodiments and configurations constructed by combining components in different embodiments.

[0442] (Embodiment 8) In each of the above embodiments, each of the functional blocks can usually be realized by an MPU, a memory, etc. Furthermore, the processing by each of the functional blocks is usually realized by a program execution unit such as a processor reading and executing software (programs) recorded on a recording medium such as a ROM. The software may be distributed by downloading, etc., or may be recorded on a recording medium such as a semiconductor memory and distributed. Of course, each functional block can also be realized by hardware (dedicated circuitry).

[0443] Furthermore, 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 multiple devices. The processor that executes the above program may be either single or multiple. That is, centralized processing or distributed processing may be performed.

[0444] The aspects of the present disclosure are not limited to the above examples, and various modifications are possible, which are also included within the scope of the aspects of the present disclosure.

[0445] Further, here, application examples of the video coding method (image coding method) or video decoding method (image decoding method) shown in each of the above embodiments and a system using the same will be described. The system is characterized by having an image coding device using the image coding method, an image decoding device using the image decoding method, and an image coding / decoding device equipped with both. Other configurations in the system can be appropriately changed depending on the case.

[0446] [Usage example] 44 is a diagram showing the overall configuration of a content supply system ex100 that realizes a content distribution service. The area where communication services are provided is divided into cells of a desired size, and base stations ex106, ex107, ex108, ex109, and ex110, which are fixed wireless stations, are installed in each cell.

[0447] In this content supply system ex100, devices such as a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 are connected to the Internet ex101 via an Internet service provider ex102 or a communication network ex104, and base stations ex106 to ex110. The content supply system ex100 may be configured to connect any of the above elements in combination. Each device may be directly or indirectly connected to each other via a telephone network or short-distance wireless communication, without going through the base stations ex106 to ex110, which are fixed wireless stations. In addition, the streaming server ex103 is connected to each device such as a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 via the Internet ex101, etc. In addition, the streaming server ex103 is connected to a terminal in a hot spot in an airplane ex117, etc., via a satellite ex116.

[0448] Instead of the base stations ex106 to ex110, wireless access points or hot spots may be used. The streaming server ex103 may be directly connected to the communication network ex104 without going through the Internet ex101 or the Internet service provider ex102, or may be directly connected to an airplane ex117 without going through a satellite ex116.

[0449] The camera ex113 is a device capable of taking still images and videos, such as a digital camera. The smartphone ex115 is a smartphone, a mobile phone, or a PHS (Personal Handyphone System) that is compatible with a mobile communication system generally called 2G, 3G, 3.9G, 4G, and 5G in the future.

[0450] The home appliance ex118 is a refrigerator or an appliance included in a home fuel cell cogeneration system.

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

[0452] Meanwhile, the streaming server ex103 streams the transmitted content data to the requesting client. The client is a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, a smartphone ex115, a terminal in an airplane ex117, or the like, capable of decoding the encoded data. Each device that receives the distributed data decodes and plays back the received data. That is, each device functions as an image decoding device according to one aspect of the present disclosure.

[0453] [Distributed processing] The streaming server ex103 may be a plurality of servers or computers that process, record, and distribute data in a distributed manner. For example, the streaming server ex103 may be realized by a CDN (Contents Delivery Network), and content distribution may be realized by a network that connects a large number of edge servers distributed around the world. In a CDN, an edge server that is physically close to the client is dynamically assigned according to the client. The content is cached and distributed to the edge server, thereby reducing delays. In addition, when an error occurs or the communication state changes due to an increase in traffic, the processing can be distributed among multiple edge servers, the distribution entity can be switched to another edge server, or distribution can be continued by bypassing the part of the network where a failure has occurred, thereby realizing high-speed and stable distribution.

[0454] In addition to the distributed processing of the distribution itself, the encoding processing of the captured data may be performed by each terminal, may be performed by the server side, or may be shared among the terminals. As an example, in the encoding processing, a processing loop is generally performed twice. In the first loop, the complexity of the image or the amount of code is detected for each frame or scene. In the second loop, processing is performed to maintain the image quality and improve the encoding efficiency. For example, the terminal performs the first encoding processing, and the server side that receives the content performs the second encoding processing, thereby improving the quality and efficiency of the content while reducing the processing load on each terminal. In this case, if there is a request to receive and decode almost in real time, the data encoded once by the terminal can be received and played back by other terminals, making it possible to perform more flexible real-time distribution.

[0455] As another example, the camera ex113 etc. extracts features from an image, compresses data related to the features as metadata, and transmits the compressed data to the server. The server performs compression according to the meaning of the image, for example, by determining the importance of an object from the features and switching the quantization precision. The feature data is particularly effective in improving the precision and efficiency of motion vector prediction when the server performs recompression. Alternatively, the terminal may perform simple encoding such as VLC (variable length coding), and the server may perform encoding with a large processing load such as CABAC (context-adaptive binary arithmetic coding).

[0456] As another example, in a stadium, a shopping mall, a factory, etc., there may be a plurality of video data in which almost the same scene has been shot by a plurality of terminals. In this case, using the plurality of terminals that shot the video and, as necessary, other terminals and servers that did not shoot the video, coding processing is assigned to each of them, for example, in units of GOPs (Group of Pictures), in units of pictures, or in units of tiles obtained by dividing a picture, for distributed processing. This reduces delays and realizes better real-time performance.

[0457] In addition, since the multiple video data are of almost the same scene, the server may manage and / or instruct the video data shot by each terminal to be mutually referenced. Alternatively, the server may receive the encoded data from each terminal and change the reference relationship between the multiple data, or correct or replace the pictures themselves and re-encode them. This makes it possible to generate a stream with improved quality and efficiency for each piece of data.

[0458] The server may also perform transcoding to change the encoding format of the video data before distributing it. For example, the server may convert an MPEG-based encoding format into a VP-based encoding format, or convert H.264 into H.265.

[0459] In this way, the encoding process can be performed by a terminal or one or more servers. Therefore, in the following, descriptions such as "server" or "terminal" are used to indicate the entity performing the processing, but some or all of the processing performed by the server may be performed by the terminal, and some or all of the processing performed by the terminal may be performed by the server. The same applies to the decoding process.

[0460] [3D, multi-angle] In recent years, it has become common to integrate and use images or videos of different scenes or the same scene taken from different angles by multiple devices such as cameras ex113 and / or smartphones ex115 that are almost synchronized with each other. The videos taken by the devices are integrated based on the relative positional relationship between the devices that is obtained separately, or on areas where feature points included in the videos match.

[0461] The server may not only encode 2D video, but also encode still images automatically or at a time specified by the user based on scene analysis of the video and transmit them to the receiving terminal. If the server can obtain the relative positional relationship between the shooting terminals, the server may generate a 3D shape of the scene based on not only 2D video but also images of the same scene captured from different angles. The server may separately encode 3D data generated by point clouds, etc., or may generate images to be transmitted to the receiving terminal by selecting or reconstructing images from images captured by multiple terminals based on the results of recognizing or tracking people or objects using the 3D data.

[0462] In this way, the user can enjoy a scene by selecting any video corresponding to each shooting terminal, or can enjoy content in which a video from any viewpoint is cut out from 3D data reconstructed using multiple images or videos. Furthermore, sound may be collected from multiple different angles, just like the video, and the server may multiplex the sound from a specific angle or space with the video and transmit it in accordance with the video.

[0463] In recent years, content that associates the real world with a virtual world, such as Virtual Reality (VR) and Augmented Reality (AR), has also become popular. In the case of VR images, the server creates viewpoint images for the right eye and the left eye, respectively, and may perform encoding that allows reference between each viewpoint video using Multi-View Coding (MVC) or the like, or may encode them as separate streams without mutual reference. When decoding the separate streams, it is preferable to play them in synchronization with each other so that a virtual three-dimensional space is reproduced according to the user's viewpoint.

[0464] In the case of an AR image, the server superimposes virtual object information in the virtual space on camera information in the real space based on the three-dimensional position or the movement of the user's viewpoint. The decoding device may obtain or hold virtual object information and three-dimensional data, generate a two-dimensional image according to the movement of the user's viewpoint, and smoothly connect them to create superimposed data. Alternatively, the decoding device may transmit the movement of the user's viewpoint to the server in addition to a request for virtual object information, and 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 deliver it to the decoding device. Note that the superimposed data may have an α value indicating the 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, etc., and encode the data in a state in which the part is transparent. Alternatively, the server may generate data in which a predetermined value of RGB value is set to the background like a chromakey, and the part other than the object is the background color.

[0465] Similarly, the decoding process of the distributed data may be performed by each client terminal, or may be performed by the server side, or may be shared among 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 other terminals, decoded, and the decoded signal may be transmitted to a device having a display. By distributing the processing and selecting appropriate content regardless of the performance of the communication-enabled terminals themselves, data with good image quality can be reproduced. In another example, while large-sized image data is received by a TV or the like, a part of the area, such as tiles into which the picture is divided, may be decoded and displayed on the viewer's personal terminal. This allows the viewer to share the overall picture while checking his / her own area of ​​responsibility or the area he / she wants to check in more detail at hand.

[0466] In the future, it is expected that content will be seamlessly received by switching appropriate data for the currently connected communication using delivery system standards such as MPEG-DASH under circumstances where multiple short-distance, medium-distance, or long-distance wireless communication is available, regardless of whether indoors or outdoors. This allows users to freely select and switch in real time not only their own terminals but also decoding devices or display devices such as displays installed indoors and outdoors. In addition, decoding can be performed while switching the decoding device and the display device based on the user's location information, etc. This makes it possible to move while displaying map information on the wall or part of the ground of a neighboring building where a displayable device is embedded while moving to a destination. It is also possible to switch the bit rate of the received data based on the accessibility of the encoded data on the network, such as when the encoded data is cached on a server that can be accessed from the receiving terminal in a short time, or when it is copied to an edge server in a content delivery service.

[0467] [Scalable Coding] The switching of contents will be described using a scalable stream compressed and coded by applying the video coding method shown in each of the above embodiments, as shown in FIG. 45. The server may have multiple streams with the same content but different qualities as individual streams, but may be configured to switch contents by taking advantage of the characteristics of a temporal / spatial scalable stream realized by coding in layers as shown in the figure. In other words, the decoding side can freely switch between low-resolution content and high-resolution content by determining which layer to decode according to an internal factor such as performance and an external factor such as the state of the communication band. For example, if you want to continue watching a video you were watching on your smartphone ex115 while on the move on a device such as an Internet TV after you get home, the device can decode the same stream up to a different layer, reducing the burden on the server side.

[0468] Furthermore, as described above, in addition to the configuration that realizes scalability in which pictures are coded for each layer and an enhancement layer exists above a base layer, the enhancement layer may include meta-information based on image statistics, etc., and the decoding side may generate high-quality content by super-resolving pictures of the base layer based on the meta-information. Super-resolution may be either an improvement in the signal-to-noise ratio at the same resolution or an increase in resolution. The meta-information includes information for specifying linear or nonlinear filter coefficients used in the super-resolution process, or information for specifying parameter values ​​in the filter process, machine learning, or least squares calculation used in the super-resolution process.

[0469] Alternatively, a picture may be divided into tiles or the like according to the meaning of an object in an image, and the decoding side may select a tile to decode to decode only a part of the area. Also, by storing the attribute of an object (person, car, ball, etc.) and its position in a video (coordinate position in the same image, etc.) as meta information, the decoding side can identify the position of a desired object based on the meta information and determine the tile containing the object. For example, as shown in FIG. 46, the meta information is stored using a data storage structure different from pixel data such as an SEI message in HEVC. This meta information indicates, for example, the position, size, or color of a main object.

[0470] Meta information may also be stored in units consisting of multiple pictures, such as streams, sequences, or random access units, etc. This allows the decoding side to obtain the time when a specific person appears in the video, and by combining this with picture-by-picture information, it is possible to identify the picture in which an object exists and the position of the object within the picture.

[0471] [Web page optimization] FIG. 47 is a diagram showing an example of a display screen of a web page in a computer ex111 or the like. FIG. 48 is a diagram showing an example of a display screen of a web page in a smartphone ex115 or the like. As shown in FIG. 47 and FIG. 48, a web page may include multiple link images that are links to image content, and the appearance of the web page differs depending on the device used to view the page. When multiple link images are visible on the screen, the display device (decoding device) displays a still image or I-picture that each content has as a link image, displays a video such as a gif animation using multiple still images or I-pictures, or receives only the base layer to decode and display the video, until the user explicitly selects the link image, or until the link image approaches the center of the screen or the entire link image enters the screen.

[0472] When a link image is selected by a user, the display device gives top priority to decoding the base layer. If the HTML constituting the web page contains information indicating that the content is scalable, the display device may decode up to the enhancement layer. In order to ensure real-time performance, before selection or when the communication bandwidth is very tight, the display device decodes and displays only forward-reference pictures (I-pictures, P-pictures, and B-pictures with forward reference only), thereby reducing the delay between the decoding time of the first picture and the display time (the delay from the start of decoding the content to the start of display). The display device may also ignore the reference relationship between pictures and roughly decode all B-pictures and P-pictures with forward reference, and perform normal decoding as the number of received pictures increases over time.

[0473] [Automatic driving] Furthermore, when transmitting and receiving still image or video data such as 2D or 3D map information for automatic driving or driving assistance of a vehicle, the receiving terminal may receive weather or construction information as meta information in addition to image data belonging to one or more layers, and may associate and decode these. Note that the meta information may belong to a layer, or may simply be multiplexed with the image data.

[0474] In this case, since a car, drone, or airplane including a receiving terminal moves, the receiving terminal can realize seamless reception and decoding while switching between base stations ex106 to ex110 by transmitting the location information of the receiving terminal at the time of a reception request. Also, the receiving terminal can dynamically switch how much meta information to receive or how much to update map information according to the user's selection, the user's situation, or the state of the communication band.

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

[0476] [Distribution of personal content] Furthermore, the content supply system ex100 allows not only high-quality, long-duration content from video distributors, but also low-quality, short-duration content from individuals via unicast or multicast distribution. It is expected that such personal content will continue to increase in the future. To improve the quality of personal content, the server may perform editing processing before encoding processing. This can be achieved, for example, by the following configuration.

[0477] During shooting, in real time or after accumulating, the server performs recognition processing such as shooting errors, scene search, semantic analysis, and object detection from the original image 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 that are less bright than other pictures or are out of focus, emphasizes object edges, changes color, and performs other editing. The server encodes the edited data based on the editing result. It is also known that if the shooting time is too long, the viewer rating will decrease, and the server may automatically clip not only scenes of less importance as described above but also scenes with little movement based on the image processing result so that the content will be within a specific time range depending on the shooting time. Alternatively, the server may generate a digest based on the result of the semantic analysis of the scene and encode it.

[0478] In addition, there are cases where personal contents contain images that infringe copyrights, moral rights, portrait rights, etc., and the scope of sharing may exceed the intended scope, which may be inconvenient for individuals. Therefore, for example, the server may change the image to an unfocused image of a person's face on the periphery of the screen, or the inside of a house, and encode it. The server may also recognize whether the image to be encoded contains a face of a person other than a person registered in advance, and if so, may perform processing such as blurring the face. Alternatively, as pre-processing or post-processing of encoding, the user may specify a person or background area that he or she wishes to process in the image from the viewpoint of copyright, etc., and the server may replace the specified area with another image or blur the focus. If it is a person, the image of the face part can be replaced while tracking the person in the video.

[0479] In addition, since viewing of personal content with a small amount of data requires real-time performance, the decoding device first receives the base layer as a top priority, and performs decoding and playback, although this depends on the bandwidth. The decoding device may receive an enhancement layer during this time, and when playback is looped or otherwise played two or more times, play high-quality video including the enhancement layer. In this way, if the stream is scalably encoded, it is possible to provide an experience in which the video is rough when not selected or when viewing begins, but 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 the first time and a second stream encoded with reference to the first video are configured as one stream.

[0480] [Other use cases] Moreover, these encoding or decoding processes are generally processed in an LSIex500 possessed by each terminal. The LSIex500 may be a single chip or may be configured with multiple chips. Note that software for encoding or decoding moving images may be incorporated into some kind of recording medium (such as a CD-ROM, a flexible disk, or a hard disk) that can be read by the computer ex111 or the like, and the encoding or decoding process may be performed using the software. Furthermore, if the smartphone ex115 has a camera, video data captured by the camera may be transmitted. The video data in this case is data that has been encoded by the LSIex500 possessed by the smartphone ex115.

[0481] 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 downloads a codec or application software, and then acquires and plays the content.

[0482] Furthermore, at least one of the video encoding device (image encoding device) or video decoding device (image decoding device) of each of the above embodiments can be incorporated into a digital broadcasting system, not limited to the content supply system ex100 via the Internet ex101. Since multiplexed data in which video and audio are multiplexed is carried and transmitted over broadcasting radio waves using a satellite or the like, there is a difference in that it is more suitable for multicast compared to the content supply system ex100, which has a configuration that is easy to use for unicast, but similar applications are possible with regard to the encoding process and decoding process.

[0483] [Hardware configuration] FIG. 49 is a diagram showing a smartphone ex115. FIG. 50 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 taking videos and still images, and a display unit ex458 for displaying the video captured by the camera unit ex465 and the decoded data of 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 encoded data such as captured video or still images, recorded audio, received video or still images, and e-mail, or decoded data, and a slot unit ex464 which is an interface unit with a SIMex468 for identifying a user and authenticating access to various data including a network. In addition, an external memory may be used instead of the memory unit ex467.

[0484] In addition, a main control unit ex460, which comprehensively controls the display unit ex458 and operation unit ex466, etc., is connected to 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 / separation unit ex453, an audio signal processing unit ex454, a slot unit ex464, and a memory unit ex467 via a bus ex470.

[0485] When the power key is turned on by a user's operation, the power supply circuit unit ex461 starts up the smartphone ex115 into an operational state by supplying power to each unit from the battery pack.

[0486] The smartphone ex115 performs processes such as telephone calls and data communications under the control of a main control unit ex460 having a CPU, a ROM, and a RAM. During a telephone call, a voice signal collected by a voice input unit ex456 is converted into a digital voice signal by a voice signal processing unit ex454, which is then subjected to spectrum spreading processing by a modulation / demodulation unit ex452, and the digital-to-analog conversion processing and frequency conversion processing by a transmission / reception unit ex451 is then transmitted via an antenna ex450. In addition, the received data is amplified, and subjected to frequency conversion processing and analog-to-digital conversion processing, and the spectrum inverse spreading processing by a modulation / demodulation unit ex452 is then performed, and the analog voice signal is converted into an analog voice signal by a voice signal processing unit ex454, which is then output from a voice output unit ex457. During a data communication mode, text, still images, or video data is sent to the main control unit ex460 via an operation input control unit ex462 by operating an operation unit ex466 or the like of the main unit, and transmission and reception processing is performed in the same manner. 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 the video signal 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 / separation unit ex453. The audio signal processing unit ex454 also encodes the audio signal collected by the audio input unit ex456 while the camera unit ex465 is capturing the video or still images, and sends the encoded audio data to the multiplexing / separation unit ex453. The multiplexing / separation unit ex453 multiplexes the encoded video data and the encoded audio data by a predetermined method, and performs modulation and conversion processing in the modulation / demodulation unit (modulation / demodulation circuit unit) ex452 and the transmission / reception unit ex451, and transmits the data via the antenna ex450.

[0487] When receiving a video attached to an e-mail 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 / separation 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 video encoding method shown in each of the above embodiments, and displays the video or still image contained in the linked video file on the display unit ex458 via the display control unit ex459. The audio signal processing unit ex454 also decodes the audio signal, and audio is output from the audio output unit ex457. Note that since real-time streaming is widespread, there may be cases where audio playback is socially inappropriate depending on the user's situation. Therefore, as an initial value, a configuration in which only video data is played without playing audio signals is preferable. The audio may be played in sync only when the user performs an operation such as clicking on the video data.

[0488] In addition, although the smartphone ex115 has been described as an example here, three types of implementation formats are possible for the terminal: a transmitting / receiving terminal having both an encoder and a decoder, a transmitting terminal having only an encoder, and a receiving terminal having only a decoder. Furthermore, in the digital broadcasting system, multiplexed data in which audio data and the like are multiplexed with video data is received or transmitted, but the multiplexed data may include text data related to the video in addition to audio data, or the video data itself may be received or transmitted instead of the multiplexed data.

[0489] Although the main control unit ex460 including the CPU controls the encoding or decoding process, terminals often have a GPU. Therefore, a configuration may be used in which a wide area is processed collectively by utilizing the performance of the GPU using a memory shared by the CPU and GPU, or a memory whose addresses are managed so that they can be used in common. This can shorten the encoding time, ensure real-time performance, and achieve low latency. In particular, it is efficient to perform the processing of motion search, deblocking filter, SAO (Sample Adaptive Offset), and transformation and quantization collectively in units such as pictures by the GPU, rather than by the CPU. [Industrial Applicability]

[0490] The present disclosure is applicable to an encoding device, a decoding device, an encoding method, and a decoding method. [Explanation of symbols]

[0491] 100 Encoding device 102 Division 104 Subtraction section 106 Conversion unit 108 Quantization section 110 Entropy coding unit 112, 204 Inverse quantization section 114, 206 Inverse conversion unit 116, 208 Addition section 118, 210 Block Memory 120, 212 Loop filter section 122, 214 frame memory 124, 216 Intra prediction section 126, 218 Inter prediction section 128, 220 Predictive control unit 160, 260 Processing circuit 162, 262 memory 200 Decryption device 202 Entropy Decoding Unit

Claims

1. changing values ​​of a plurality of pixels of the first block and values ​​of a plurality of pixels of the second block such that the change amounts of the respective values ​​are within respective clip widths, in order to filter a boundary between a first block and a second block adjacent to the first block; encoding a third block included in a second picture different from the first picture by referring to a first picture including the first block and the second block after the filtering; a plurality of pixels of the first block and a plurality of pixels of the second block are aligned along a line intersecting the boundary, the plurality of pixels of the first block includes a first pixel at a first position, the plurality of pixels of the second block includes a second pixel at a second position corresponding to the first position across a boundary, The clip width is selected based on a quantization parameter; the clip width includes a first clip width corresponding to the first pixel and a second clip width corresponding to the second pixel, the first clip width and the second clip width being different from each other; the first block and the second block are adjacent to each other horizontally, and the boundary is a vertical boundary. Encoding method.

2. changing values ​​of a plurality of pixels of the first block and values ​​of a plurality of pixels of the second block such that the change amounts of the respective values ​​are within respective clip widths, in order to filter a boundary between a first block and a second block adjacent to the first block; decode a third coded block included in a second picture different from the first picture by referring to a first picture including the first block and the second block after the filtering; a plurality of pixels of the first block and a plurality of pixels of the second block are aligned along a line intersecting the boundary, the plurality of pixels of the first block includes a first pixel at a first position, the plurality of pixels of the second block includes a second pixel at a second position corresponding to the first position across a boundary, The clip width is selected based on a quantization parameter; the clip width includes a first clip width corresponding to the first pixel and a second clip width corresponding to the second pixel, the first clip width and the second clip width being different from each other; the first block and the second block are adjacent to each other horizontally, and the boundary is a vertical boundary. Decryption method.

Citation Information

Patent Citations

  • Information processor

    JP2007180767A

  • Image processor, moving image decoding device, moving image encoding device, image processing method, moving image decoding method, and, moving image encoding method

    JP2010081368A

  • Measurement-based and scalable deblock filtering of image data

    JP2010141883A

  • Image processing device, image processing method, and program

    WO2007013437A1

  • Image processor and image processing method

    WO2011145601A1