US-12621440-B2 - Encoding apparatus, image capturing apparatus, control method, and storage medium
Abstract
There is provided an encoding apparatus. A determination unit determines whether a degree of flatness of pixel values in a first block among a plurality of blocks that compose an image exceeds a predetermined criterion. A selection unit executes processing for selection of an intra prediction mode for the first block. In a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, a control unit controls the processing for selection so as to increase a possibility that the intra prediction mode for the first block is different from each of one or more intra prediction modes for respective one or more reference blocks. An encoding unit applies intra predictive encoding to the first block in accordance with the intra prediction mode selected through the processing for selection.
Inventors
- Masashi Kawakami
Assignees
- CANON KABUSHIKI KAISHA
Dates
- Publication Date
- 20260505
- Application Date
- 20240227
- Priority Date
- 20230322
Claims (9)
- 1 . An encoding apparatus comprising: at least one processor and/or at least one circuit, which functions as a plurality of units comprising: (1) a determination unit configured to determine whether a degree of flatness of pixel values in a first block among a plurality of blocks that compose an image exceeds a predetermined criterion; (2) a selection unit configured to execute processing for selection of an intra prediction mode for the first block; (3) a control unit configured to, in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, control the processing for selection so as to increase a possibility that the intra prediction mode for the first block is different from each of one or more intra prediction modes for respective one or more reference blocks, the one or more reference blocks being one or more blocks, among the plurality of blocks, including a pixel that is referred to for intra predictive encoding of the first block in accordance with the intra prediction mode for the first block; and (4) an encoding unit configured to apply intra predictive encoding to the first block in accordance with the intra prediction mode selected through the processing for selection, wherein the plurality of blocks are arranged in a matrix, wherein the control unit: (i) in a case where it has been determined that the degree of flatness in the first block, which is located at column X, row Y, exceeds the predetermined criterion, controls the processing for selection so as to increase a possibility that a different intra prediction mode is selected from among three types of predetermined intra prediction modes depending on a remainder of division of (X+Y) by three; or (ii) in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, controls the processing for selection so as to increase a possibility that an intra prediction mode is different from an intra prediction mode for a left-side neighbor block and an intra prediction mode for an upper neighbor block is selected from among three types of predetermined intra prediction modes, and wherein the three types of predetermined intra prediction modes include (1) an intra prediction mode that refers to a pixel in a left-side neighbor block, (2) an intra prediction mode that refers to a pixel in an upper neighbor block, and (3) an intra prediction mode that refers to a pixel in a left-side neighbor block and a pixel in an upper neighbor block.
- 2 . The encoding apparatus according to claim 1 , wherein in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the control unit controls the processing for selection so as to increase a possibility that a different intra prediction mode is selected from among the three types of predetermined intra prediction modes depending on a remainder of division of (X+Y) by three.
- 3 . The encoding apparatus according to claim 1 , wherein in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the control unit controls the processing for selection so as to increase a possibility that an intra prediction mode is different from an intra prediction mode for a left-side neighbor block and an intra prediction mode for an upper neighbor block is selected from among the three types of predetermined intra prediction modes.
- 4 . The encoding apparatus according to claim 1 , wherein the processing for selection includes processing for, with respect to the first block, calculating an index value indicating an encoding efficiency for each of a plurality of predetermined intra prediction modes, and selecting an intra prediction mode corresponding to the index value indicating a highest encoding efficiency from among the plurality of predetermined intra prediction modes.
- 5 . The encoding apparatus according to claim 4 , wherein in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the control unit adjusts the index values of respective intra prediction modes other than a first intra prediction mode among the plurality of predetermined intra prediction modes so as to reduce the encoding efficiencies indicated by the index values, and wherein the first intra prediction mode is an intra prediction mode different from each of the one or more intra prediction modes for the respective one or more reference blocks.
- 6 . The encoding apparatus according to claim 1 , wherein the determination unit determines that the degree of flatness in the first block exceeds the predetermined criterion in a case where a variance value of the pixel values in the first block is smaller than a predetermined threshold.
- 7 . An image capturing apparatus comprising: the encoding apparatus according to claim 1 , wherein the at least one processor and/or the at least one circuit further functions as an image capturing unit configured to generate the image.
- 8 . A control method executed by an encoding apparatus, the control method comprising: determining whether a degree of flatness of pixel values in a first block among a plurality of blocks that compose an image exceeds a predetermined criterion; executing processing for selection of an intra prediction mode for the first block, wherein in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that the intra prediction mode for the first block is different from each of one or more intra prediction modes for respective one or more reference blocks, the one or more reference blocks being one or more blocks, among the plurality of blocks, including a pixel that is referred to for intra predictive encoding of the first block in accordance with the intra prediction mode for the first block; and applying intra predictive encoding to the first block in accordance with the intra prediction mode selected through the processing for selection, wherein the plurality of blocks are arranged in a matrix, wherein: (i) in a case where it has been determined that the degree of flatness in the first block, which is located at column X, row Y, exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that a different intra prediction mode is selected from among three types of predetermined intra prediction modes depending on a remainder of division of (X+Y) by three; or (ii) in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that an intra prediction mode is different from an intra prediction mode for a left-side neighbor block and an intra prediction mode for an upper neighbor block is selected from among three types of predetermined intra prediction modes, and wherein the three types of predetermined intra prediction modes include (1) an intra prediction mode that refers to a pixel in a left-side neighbor block, (2) an intra prediction mode that refers to a pixel in an upper neighbor block, and (3) an intra prediction mode that refers to a pixel in a left-side neighbor block and a pixel in an upper neighbor block.
- 9 . A non-transitory computer-readable storage medium which stores a program for causing a computer to execute a control method, the control method comprising: determining whether a degree of flatness of pixel values in a first block among a plurality of blocks that compose an image exceeds a predetermined criterion; executing processing for selection of an intra prediction mode for the first block, wherein in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that the intra prediction mode for the first block is different from each of one or more intra prediction modes for respective one or more reference blocks, the one or more reference blocks being one or more blocks, among the plurality of blocks, including a pixel that is referred to for intra predictive encoding of the first block in accordance with the intra prediction mode for the first block; and applying intra predictive encoding to the first block in accordance with the intra prediction mode selected through the processing for selection, wherein the plurality of blocks are arranged in a matrix, wherein: (i) in a case where it has been determined that the degree of flatness in the first block, which is located at column X, row Y, exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that a different intra prediction mode is selected from among three types of predetermined intra prediction modes depending on a remainder of division of (X+Y) by three; or (ii) in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, the processing for selection is controlled so as to increase a possibility that an intra prediction mode is different from an intra prediction mode for a left-side neighbor block and an intra prediction mode for an upper neighbor block is selected from among three types of predetermined intra prediction modes, and wherein the three types of predetermined intra prediction modes include (1) an intra prediction mode that refers to a pixel in a left-side neighbor block, (2) an intra prediction mode that refers to a pixel in an upper neighbor block, and (3) an intra prediction mode that refers to a pixel in a left-side neighbor block and a pixel in an upper neighbor block.
Description
BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to an encoding apparatus, an image capturing apparatus, a control method, and a storage medium. Description of the Related Art In recent years, a high-efficiency encoding method, such as H.265 (ITU-T: “SERIES H: AUDIOVISUAL AND MULTIMEDIA SYSTEMS Infrastructure of audiovisual services-Coding of moving video”, High efficiency video coding Recommendation ITU-T H.265, 06/2019), has been used in digital cameras and digital camcorders. H.265 defines 35 types of prediction methods for intra predictive encoding. These prediction methods are called intra prediction modes. These intra prediction modes include planar prediction that is effective in gradation regions, and DC prediction that uses an average value of surrounding reference pixels as a predicted value. The rest of the intra prediction modes is called directional prediction, in which 33 directions are defined. According to H.265, one intra prediction mode can be selected per prediction unit (PU). In the following description, a region in an image that acts as a unit of selection of an intra prediction mode, such as a PU, will be referred to as a block. Conventional techniques have a possibility of causing deterioration in the image quality in a flat region (a region with small fluctuations in pixel values) of an image to which intra predictive encoding is applied. The following describes an example of deterioration in the image quality in a flat region with reference to FIG. 5 and FIG. 6. FIG. 5 shows an example of an image to which intra predictive encoding is applied. In FIG. 5, a region with a diagonal lattice pattern represents a complex region (a region with large fluctuations in pixel values), and a white region represents a flat region. FIG. 6 is an enlarged view of a part of the image shown in FIG. 5. In FIG. 6, 12 blocks and 5 blocks are arrayed in the horizontal direction and the vertical direction, respectively, and there are 60 blocks in total. In FIG. 6, a boundary block is a block that is located on a boundary between the flat region and the complex region. In the boundary block, a relatively large encoding error tends to occur. Assume a case where DC prediction has been selected as the intra prediction mode with respect to 9 flat blocks located on the right of the boundary block in the foregoing situation. According to DC prediction, prediction is performed using pixels that are left-side neighbors of (pixels in a block that is a left-side neighbor of) an encoding target block, and pixels that are upper neighbors of (pixels in a block that is an upper neighbor of) the encoding target block. Therefore, in DC prediction of a block 601, pixels in a left-side neighbor block (a boundary block) that accompanies a relatively large encoding error are used; consequently, the encoding error of the boundary block is propagated to the block 601. Furthermore, DC prediction of a block 602 uses pixels in the block 601, which accompanies the encoding error propagated from the boundary block; consequently, the encoding error of the boundary block is also propagated to the block 602 via the block 601. As propagation of the encoding error to a right-side neighbor block is repeated in this way, the encoding error of the boundary block is propagated continuously in the rightward direction. If the continuous propagation of the encoding error in a certain direction occurs in the flat region, the encoding error becomes easy for a user to see, and leads to deterioration in the image quality. Conventionally, a technique to suppress such deterioration in the image quality has not been known. SUMMARY OF THE INVENTION The present invention has been made in view of the foregoing situation, and provides a technique to select an intra prediction mode so as to suppress deterioration in the image quality in a flat region of an image to which intra predictive encoding is applied. According to a first aspect of the present invention, there is provided an encoding apparatus comprising at least one processor and/or at least one circuit which functions as: a determination unit configured to determine whether a degree of flatness of pixel values in a first block among a plurality of blocks that compose an image exceeds a predetermined criterion; a selection unit configured to execute processing for selection of an intra prediction mode for the first block; a control unit configured to, in a case where it has been determined that the degree of flatness in the first block exceeds the predetermined criterion, control the processing for selection so as to increase a possibility that the intra prediction mode for the first block is different from each of one or more intra prediction modes for respective one or more reference blocks, the one or more reference blocks being one or more blocks, among the plurality of blocks, including a pixel that is referred to for intra predictive encoding of the first block