Encoding apparatus, image capturing apparatus, control method, and program
By determining block flatness and adjusting intra prediction modes to differ from neighboring blocks, the imaging device mitigates encoding error propagation in flat areas, enhancing image quality.
Patent Information
- Application Number
- JP2023045786
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-10-04
AI Technical Summary
Conventional image encoding techniques suffer from image quality deterioration in flat areas due to the propagation of encoding errors during intra-prediction, particularly in regions with small pixel value fluctuations.
An imaging device determines the flatness of pixel values in blocks and adjusts the intra prediction mode selection process to increase the likelihood of selecting modes different from those of neighboring blocks, thereby controlling the direction of encoding error propagation.
This approach effectively suppresses image quality deterioration in flat regions by diversifying the direction of encoding errors, making them less visually noticeable.
Smart Images

Figure 2024135215000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an encoding device, an imaging device, a control method, and a program. [Background technology]
[0002] In recent years, highly efficient encoding methods such as H.265 (Non-Patent Document 1) have been adopted in digital cameras and digital camcorders.
[0003] In H.265, 35 types of prediction methods for intra-prediction coding are defined. These prediction methods are called intra-prediction modes. These intra-prediction modes include planar prediction, which is effective in gradation regions, and DC prediction, which uses the average value of surrounding reference pixels as a predicted value. The remaining intra-prediction modes are called directional prediction, and 33 directions are defined. In H.265, one intra-prediction mode can be selected for each Prediction Unit (PU). In the following description, an area in an image that is a selection unit of an intra-prediction mode such as a PU is called a block. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] 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 Summary of the Invention [Problem to be solved by the invention]
[0005] In conventional techniques, degradation of image quality may occur in flat regions (regions with small fluctuations in pixel values) of an image where intra-prediction coding is performed.
[0006] An example of image quality degradation in a flat region will be described with reference to Figures 5 and 6. Figure 5 shows an example of an image to which intra-prediction coding is performed. In Figure 5, the diagonal lattice region indicates a complex region (a region with large fluctuations in pixel values), and the white region indicates a flat region. Figure 6 is an enlarged view of a portion of the image shown in Figure 5. In Figure 6, there are 12 blocks arranged horizontally and 5 blocks arranged vertically, for a total of 60 blocks.
[0007] In FIG. 6, the boundary block is a block located on the boundary between the flat region and the complex region. The boundary block tends to have a relatively large coding error. In this situation, consider the case where DC prediction is selected as the intra prediction mode for nine flat blocks to the right of the boundary block. In DC prediction, prediction is performed using the left adjacent pixels (pixels of the left adjacent block) and the upper adjacent pixels (pixels of the upper adjacent block) of the block to be coded. Therefore, in the DC prediction of block 601, pixels of the left adjacent block (boundary block) with a relatively large coding error are used, so that the coding error of the boundary block is propagated to block 601. In addition, in the DC prediction of block 602, pixels of block 601 with a coding error propagated from the boundary block are used, so that the coding error of the boundary block is also propagated to block 602 via block 601. In this way, the coding error is propagated to the block to the right repeatedly, so that the coding error of the boundary block is continuously propagated to the right. If continuous propagation of the coding error occurs in a certain direction in a flat region, the coding error is easily visually recognized by the user, leading to deterioration of image quality. Conventionally, no technology has been known to suppress such deterioration in image quality.
[0008] The present invention has been made in consideration of the above circumstances, and aims to provide a technique for selecting an intra prediction mode so as to suppress image quality degradation in flat regions of an image subjected to intra prediction coding. [Means for solving the problem]
[0009] In order to solve the above problem, the present invention provides an encoding device comprising: a determination means for determining whether the flatness of pixel values in a first block among a plurality of blocks constituting an image exceeds a predetermined criterion; a selection means for performing a selection process of an intra prediction mode of the first block; and a control means for controlling the selection process when it is determined that the flatness of the first block exceeds the predetermined criterion so as to increase the likelihood that the intra prediction mode of the first block differs from the intra prediction modes of one or more reference blocks, wherein the one or more reference blocks are one or more blocks among the plurality of blocks that contain pixels that are referenced for intra prediction encoding of the first block according to the intra prediction mode of the first block; and an encoding means for performing intra prediction encoding of the first block according to the intra prediction mode selected by the selection process. Effect of the Invention
[0010] According to the present invention, it is possible to suppress deterioration in image quality in flat regions of an image subjected to intra-prediction coding.
[0011] Other features and advantages of the present invention will become apparent from the accompanying drawings and the following detailed description of the preferred embodiments of the present invention. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a block diagram showing an example of the configuration of an imaging device having a function of an encoding device. [Diagram 2] 5 is a flowchart of an intra prediction mode selection process according to the first embodiment. [Diagram 3] A close-up of a portion of an original image. [Figure 4] A close-up of a portion of an original image. [Diagram 5]FIG. 1 is a diagram showing an example of an image to be subjected to intra-prediction coding; [Figure 6] FIG. 6 is an enlarged view of a portion of the image shown in FIG. 5. [Figure 7] 10 is a flowchart of an intra prediction mode selection process according to the second embodiment. [Figure 8] 11 is a diagram for explaining a method for determining an intra prediction mode in which a predetermined value is added to a cost value. [Figure 9] FIG. 4 is a diagram for explaining peripheral blocks of a target block. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a number of features, not all of these features are essential to the invention, and the features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0014] [First embodiment] Imaging device configuration 1 is a block diagram showing an example of the configuration of an image pickup device having the function of an encoding device, The image pickup device in FIG.
[0015] The encoding processing unit 100 includes an adder 102, an orthogonal transform unit 103, a quantization unit 104, an entropy encoding unit 105, an inverse quantization unit 106, an inverse orthogonal transform unit 107, an adder 108, an intra memory 109, an intra prediction unit 110, and a flatness determination unit 111. The encoding processing unit 100 also includes a loop filter 112, a frame memory 113, an inter prediction unit 114, and a selector 115.
[0016] In the following description, the encoding processing unit 100 is assumed to encode an image according to H.265. However, in this embodiment, the encoding method of the encoding processing unit 100 is not limited to H.265. As the encoding method of the encoding processing unit 100, any encoding method capable of executing intra-prediction encoding according to an intra-prediction mode selected on a block-by-block basis such as a PU can be adopted.
[0017] The control unit 117 performs overall control of the imaging apparatus, and also controls each component of the imaging apparatus, such as the encoding processing unit 100, as necessary.
[0018] The imaging unit 101 includes a lens optical system and an image sensor that converts optical information from the lens optical system into an electrical signal. In the imaging unit 101, the electrical signal obtained by the image sensor is converted into a digital signal to generate image data. Then, a development process is performed on the generated image data to generate an input image (original image to be encoded) for the encoding processing unit 100. The lens optical system is capable of optical zooming and includes an optical lens, an aperture, a focus control unit, and a lens driving unit. The configuration of the image sensor is not particularly limited, and may be, for example, an image sensor such as a CCD image sensor or a CMOS sensor. The development process includes demosaic processing, noise removal processing, optical distortion correction processing, color correction processing, and the like.
[0019] The adder 102 generates a difference image between the original image input from the imaging unit 101 and a predicted image output from a selector 115 (described later). The predicted image is generated by the intra prediction unit 110 or the inter prediction unit 114.
[0020] The orthogonal transformation unit 103 performs an orthogonal transformation on the data of the difference image generated by the adder 102. Specifically, for example, a discrete cosine transform (DCT transform) and a discrete sine transform (DST transform) are performed.
[0021] The quantization unit 104 performs a quantization process on the transformation coefficients generated by the orthogonal transformation in the orthogonal transformation unit 103. The quantization process is a process for reducing information, mainly high frequency components, of the transformation coefficients, thereby compressing the amount of information.
[0022] The entropy coding unit 105 receives as input the transform coefficients quantized by the quantization unit 104 and coding parameters (e.g., motion vectors) generated during the coding process according to the prediction mode, and performs entropy coding in accordance with the procedure defined in the H.265 standard.
[0023] The inverse quantization unit 106 performs inverse quantization processing on the transform coefficients quantized by the quantization unit 104 .
[0024] The inverse orthogonal transform unit 107 performs inverse orthogonal transform on the transform coefficients dequantized by the dequantization unit 106 to generate a difference image.
[0025] The adder 108 adds the difference image generated by the inverse orthogonal transform unit 107 and the predicted image output from the selector 115 to generate a locally decoded image.
[0026] The intra memory 109 is a memory that holds locally decoded images corresponding to areas that may be referenced for intra prediction.
[0027] The intra prediction unit 110 uses the original image and peripheral images of a current block (block to be coded) from the intra memory 109 as inputs to select an intra prediction mode. When selecting an intra prediction mode, the intra prediction unit 110 calculates a cost value for each of a plurality of selectable, predetermined intra prediction modes using a cost formula, and selects the intra prediction mode that minimizes the cost value. Details of the process of selecting an intra prediction mode using the cost formula will be described later. The intra prediction unit 110 generates a predicted image according to the selected intra prediction mode, and outputs it to the selector 115.
[0028] The flatness determination unit 111 determines whether the flatness of pixel values in the target block exceeds a predetermined criterion, thereby determining whether the target block is a flat block. As an example of the flatness of pixel values in the target block, a variance value of pixel values in the target block can be used. In this case, the flatness determination unit 111 calculates the variance value of pixel values in the target block, and if the variance value is smaller than a predetermined threshold, it can determine that the flatness exceeds the predetermined criterion (i.e., the target block is a flat block). The flatness determination unit 111 outputs information indicating the determination result to the intra prediction unit 110.
[0029] The loop filter 112 filters the locally decoded image to remove block noise, thereby improving the quality of the locally decoded image used as a reference image. The locally decoded image after the filtering process is output to the frame memory 113.
[0030] The frame memory 113 is a memory that stores a locally decoded image after filtering by the loop filter 112. The frame memory 113 has a larger storage capacity than the intra memory 109, and stores a plurality of frames. The stored locally decoded image is used as a reference image during inter prediction.
[0031] The inter prediction unit 114 performs inter prediction using an original image and a reference image from the frame memory 113 as input. The inter prediction unit 114 is composed of a motion vector detection unit that detects a motion vector, a compensation unit that generates a predicted image using the motion vector detected by the motion vector detection unit, and the like.
[0032] The selector 115 selects a predicted image for intra prediction or a predicted image for inter prediction.
[0033] The recording medium 116 is, for example, a recording medium configured from a non-volatile memory.
[0034] Cost formula for intra prediction mode selection In order to select an intra-prediction mode, the intra-prediction unit 110 calculates an index value representing the coding efficiency of each of the selectable intra-prediction modes for the current block. In the following, a cost value is used as an example of the index value, and the intra-prediction unit 110 calculates the cost value for each of the selectable intra-prediction modes using a cost formula. For example, the following formula 1 is used as the cost formula. cost=RESIDUAL*α+CODELEN*β … (1) In formula 1, RESIDUAL (residual) is the difference (residual signal) between the original image and the predicted image, and is a variable related to the image quality and the code amount of the residual signal. α is a weight by which RESIDUAL is multiplied, and is determined, for example, taking into account the value of a quantization parameter. α is set by the control unit 117 via a register or the like. CODELEN is a variable indicating the code amount of the intra prediction mode. β is a weight by which CODELEN is multiplied, and is set by the control unit 117 via a register or the like, like α.
[0035] It is considered that the image quality is good if the difference between the original image and the predicted image is small. Therefore, for example, the Sum of Squared Difference (SSD) (squared error), the Sum of Absolute Difference (SAD) (sum of absolute differences), or the Sum of Absolute Transformed Difference (SATD) (calculated by applying a Hadamard transform or the like to the prediction error and calculating the absolute sum) is used as the RESIDUAL.
[0036] For example, the code amount after entropy coding, the binary code amount before entropy coding, etc. are used as CODELEN. Since the exact code amount cannot be known without actually coding, there is also a configuration in which the code amount is determined by looking up a table.
[0037] The intra prediction unit 110 calculates a cost value for each of all selectable intra prediction modes according to Equation 1 for each block, and selects the intra prediction mode with the lowest cost value (the intra prediction mode corresponding to the index value indicating the highest coding efficiency). The intra prediction unit 110 performs intra prediction coding for each block according to the selected intra prediction mode, thereby generating a predicted image and outputting it to the selector 115.
[0038] Intra prediction mode selection process 2 is a flowchart of the intra prediction mode selection process according to the first embodiment. This selection process is performed by (the components included in) the encoding process unit 100 under the control of the control unit 117.
[0039] In S200, the control unit 117 sets the values of MB_X and MB_Y to 0. MB_X and MB_Y are variables that specify a current block (target block) among multiple blocks that make up the original image. Each block has a size of, for example, 16 pixels horizontal by 16 pixels vertical. MB_X indicates the position of the target block in the horizontal direction, and MB_Y indicates the position of the target block in the vertical direction. In other words, among multiple blocks arranged in a matrix, the target block is located at MB_X column, MB_Y row (X column, Y row). For the top left block of the original image, MB_X=MB_Y=0.
[0040] In S201, the flatness determining unit 111 calculates a variance value of pixel values of the target block to be used for determining the flatness degree of the target block.
[0041] In S202, the intra prediction unit 110 calculates the cost value of each of all selectable intra prediction modes using the cost formula of Equation 1 described above.
[0042] In S203, the flatness determination unit 111 determines whether the variance calculated in S201 is smaller than a predetermined threshold Th. The variance of pixel values of the target block is an example of the flatness of pixel values in the target block, and the variance value being smaller than the threshold Th means that the flatness exceeds a predetermined standard (i.e., the target block is a flat block). If the variance value is smaller than the threshold Th, the process proceeds to S204, and if not, the process proceeds to S209.
[0043] In S204, the control unit 117 determines whether or not the remainder when (MB_X+MB_Y) is divided by 3 is 0. If the remainder is 0, the process proceeds to S206, and if not, the process proceeds to S205.
[0044] In S205, the control unit 117 determines whether the remainder when (MB_X+MB_Y) is divided by 3 is 1. If the remainder is 1, the process proceeds to S207, and if not (i.e., if the remainder is 2), the process proceeds to S208.
[0045] In S206, the intra prediction unit 110 adds a predetermined value a to the cost value of each intra prediction mode other than horizontal prediction (an intra prediction mode that references pixels of a block adjacent to the left) among the cost values of all intra prediction modes calculated in S202. In other words, the intra prediction unit 110 adjusts the index value of each intra prediction mode other than horizontal prediction (an intra prediction mode different from the intra prediction modes of one or more reference blocks) among the multiple selectable intra prediction modes so as to reduce the coding efficiency represented by this index value. The cost value of the intra prediction mode to which the predetermined value a is added becomes the same value as the cost value calculated by the following formula 2 instead of formula 1. The predetermined value a is provided to the intra prediction unit 110 from the control unit 117, for example. Note that the "one or more reference blocks" refers to one or more blocks including pixels that are referenced for intra prediction coding of the target block according to the intra prediction mode of the target block among the multiple blocks constituting the original image. cost=RESIDUAL*α+CODELEN*β+a … (2) In this way, in S206, the predetermined value a is added to the cost value of each intra prediction mode other than horizontal prediction, so that the cost value of the intra prediction mode of horizontal prediction is likely to be smaller than the cost values of other intra prediction modes, thereby increasing the possibility that horizontal prediction will be selected as the intra prediction mode.
[0046] Although the configuration of adding a predetermined value a to increase the cost value of some intra prediction modes (in S206, each intra prediction mode other than horizontal prediction) is described, the method of increasing the cost value is not limited to this. For example, the cost value may be increased by increasing at least one of the weights α and β in Equation 1. This also applies to S207 and S208 described below.
[0047] In S207, the intra prediction unit 110 adds a predetermined value a to the cost value of each intra prediction mode other than vertical prediction (an intra prediction mode that references pixels of an adjacent block above) among the cost values of all intra prediction modes calculated in S202. As in S206, the cost formula reflecting the addition becomes Formula 2. As a result, the cost value of the intra prediction mode of vertical prediction is more likely to be smaller than the cost values of the other intra prediction modes, and the possibility of vertical prediction being selected as the intra prediction mode increases.
[0048] In S208, the intra prediction unit 110 adds a predetermined value a to the cost value of each intra prediction mode other than DC prediction (an intra prediction mode that references pixels of the left adjacent block and pixels of the upper adjacent block) among the cost values of all intra prediction modes calculated in S202. As in S206, the cost formula reflecting the addition becomes Formula 2. As a result, the cost value of the intra prediction mode of DC prediction is more likely to be smaller than the cost values of other intra prediction modes, and the possibility of DC prediction being selected as the intra prediction mode increases.
[0049] In S209, the intra prediction unit 110 selects the intra prediction mode with the smallest cost value from among all selectable intra prediction modes as the intra prediction mode for the current block. If the current block is a flat block, the cost values of intra prediction modes other than a specific intra prediction mode (horizontal prediction, vertical prediction, or DC prediction) are increased in any of S206 to S208, so that there is a high possibility that the specific intra prediction mode (an intra prediction mode different from the intra prediction modes of one or more reference blocks) will be selected.
[0050] In S211, the control unit 117 determines whether or not there is an unprocessed block in the horizontal direction. If there is an unprocessed block in the horizontal direction, the process proceeds to S212, and if not, the process proceeds to S213.
[0051] In S212, the control unit 117 increments MB_X and returns the process to S201. As a result, the block to the right of the current target block is selected as the next target block, and a process for selecting an intra prediction mode for the next target block is performed.
[0052] In S213, the control unit 117 sets the value of MB_X to 0.
[0053] In S214, the control unit 117 determines whether or not there is an unprocessed block in the vertical direction. If there is an unprocessed block in the vertical direction, the process proceeds to S215, and if not, the process of this flowchart ends.
[0054] In S215, the control unit 117 increments MB_Y and returns the process to S201. As a result, the leftmost block in the row below the current target block is selected as the next target block, and a process for selecting an intra prediction mode for the next target block is performed.
[0055] Example of intra prediction mode selection process FIG. 3 is an enlarged view of a part of an original image. In FIG. 3, the diagonal grid area indicates a complex area, and the white area indicates a flat area. 12 squares arranged horizontally and 5 squares arranged vertically indicate blocks of 16 pixels by 16 pixels, and an intra prediction mode is selected for each block. In the enlarged view of FIG. 3, 60 blocks are arranged in a matrix. The numbers written above and to the left of the image indicate the MB_X value at the top and the MB_Y value at the left. Block 300 is a block (border block) located at the boundary between the flat area and the complex area, and a relatively large coding error occurs here.
[0056] 2 will be described from the point in time when intra-prediction coding of block 300 is completed and MB_X=13, MB_Y=32. The target block at this point in time is block 301.
[0057] In S201, a variance value of pixel values of the block 301 is calculated, and in S202, a cost value of each of the selectable intra prediction modes is calculated. Since the block 301 is a flat block, the process proceeds from S203 to S204.
[0058] In block 301, MB_X=13 and MB_Y=32. Therefore, the value of MB_X+MY_Y is 45, and the remainder when 45 is divided by 3 is 0, so the process proceeds from S204 to S206, where a predetermined value a is added to the cost value of each intra prediction mode other than horizontal prediction.
[0059] For flat blocks, the cost values of the 35 intra prediction modes defined by H.265 are almost the same. However, since a predetermined value is added to the cost values of intra prediction modes other than horizontal prediction in S206, the cost value of the intra prediction mode of horizontal prediction is likely to be the smallest. As a result, it is likely that horizontal prediction will be selected from the 35 selectable intra prediction modes in S209.
[0060] When horizontal prediction is selected as the intra prediction mode of block 301, a predicted image is generated using the adjacent pixel to the left as a reference pixel. Therefore, the coding error generated in block 300 is propagated to block 301.
[0061] Since there are unprocessed blocks in the horizontal direction, the process proceeds from S211 to S212, MB_X is incremented, and block 302 becomes the next target block. Then, the process returns to S201.
[0062] In S201, a variance value of pixel values of the block 302 is calculated, and in S202, a cost value of each selectable intra prediction mode is calculated. Since the block 302 is a flat block, the process proceeds from S203 to S204.
[0063] In block 302, MB_X+MY_Y is 46, and therefore the remainder when MB_X+MY_Y is divided by 3 is 1. Therefore, the process proceeds from S204 to S207 via S205. As a result, the possibility that vertical prediction will be selected as the intra prediction mode for block 302 increases.
[0064] When vertical prediction is selected as the intra prediction mode of block 302, a predicted image is generated using the adjacent pixel above as a reference pixel. Therefore, no coding error is propagated from block 301 to block 302, and block 302 does not contain the coding error generated in block 300.
[0065] Thereafter, the same process is performed on block 303 as the target block. In block 303, the remainder when MB_X+MB_Y is divided by 3 is 2, so the process of S208 is performed. As a result, the possibility that DC prediction will be selected as the intra prediction mode for block 303 increases.
[0066] When DC prediction is selected as the intra prediction mode of block 303, the upper adjacent pixel and the left adjacent pixel are used as reference pixels. Therefore, the coding error of block 302 is propagated to block 303. However, since block 302 does not contain the coding error generated in block 300, block 303 also does not contain the coding error generated in block 300.
[0067] In this way, when focusing on the horizontal propagation of the coding error occurring in block 300, it propagates only up to block 301 (propagation stops at block 301). That is, the horizontal propagation of the coding error does not continue very long in flat regions. Therefore, it is difficult for the user to visually recognize the coding error, and deterioration of image quality is suppressed.
[0068] The intra prediction mode selection process is performed similarly for other blocks. Therefore, for example, horizontal prediction is likely to be selected for block 304, and horizontal prediction is likely to be selected for the block adjacent above block 302. Furthermore, vertical prediction is likely to be selected for the block adjacent above block 303, and DC prediction is likely to be selected for the block adjacent above block 304.
[0069] Next, a specific example of intra prediction mode selection processing will be described, focusing on the vertical propagation of coding error.
[0070] FIG. 4 is an enlarged view of a part of an original image. In FIG. 4, the diagonal grid area indicates a complex area, and the white area indicates a flat area. Eight squares arranged horizontally and eight squares arranged vertically indicate blocks of 16 pixels by 16 pixels, and an intra prediction mode is selected for each block. In the enlarged view of FIG. 4, 64 blocks are arranged in a matrix. The numbers written on the top and left of the image indicate the MB_X value at the top and the MB_Y value at the left. Block 400 is a block (border block) located on the boundary between the flat area and the complex area, and a relatively large coding error occurs here.
[0071] 2 will be described from the point in time when intra-prediction coding of block 400 is completed and MB_X=14, MB_Y=20. The target block at this point in time is block 401.
[0072] When the block row of MB_Y=20 in which block 401 exists is coded in raster order, there are no more unprocessed blocks in the horizontal direction at the right end of the image. Therefore, the process transitions from S211 to S213, and the value of MB_X is set to 0. Since there is a block row of MB_Y=21 in the vertical direction, the process advances from S214 to S215, and MB_Y is incremented. Each block is processed in order from the left end of the block row of MB_Y=21 (the block of MB_X=0, MB_Y=21) to the right, and block 402 becomes the target block.
[0073] Since block 402 is a flat block, the process proceeds from S203 to S204. When block 402 is the target block, MB_X=13, MB_Y=21, and so MB_X+MB_Y=34. Since the remainder when 34 is divided by 3 is 1, the process transitions to S207. The process of S207 increases the likelihood that vertical prediction will be selected as the intra prediction mode for block 402.
[0074] When vertical prediction is selected as the intra prediction mode of the block 402, a predicted image is generated using the adjacent pixels above as reference pixels. Therefore, the coding error generated in the block 400 is propagated to the block 402.
[0075] Similarly, in block 403, MB_X+MB_Y=35, and the remainder when 35 is divided by 3 is 2, so the process of S208 is performed. As a result, the possibility that DC prediction will be selected as the intra prediction mode for block 403 increases.
[0076] When DC prediction is selected as the intra prediction mode of the block 403, the upper adjacent pixel and the left adjacent pixel are used as reference pixels. Therefore, the coding error of the block 402 is propagated to the block 403. Since the block 402 includes the coding error generated in the block 400, the block 403 also includes the coding error generated in the block 400. As a result, the coding error generated in the block 400 is propagated to the block 403.
[0077] Similarly, for block 404, the process of S206 increases the likelihood that horizontal prediction will be selected as the intra prediction mode for block 404.
[0078] When horizontal prediction is selected as the intra prediction mode of block 404, a predicted image is generated using the adjacent pixel to the left as a reference pixel. Therefore, the coding error of block 403 is not propagated to block 404, and block 404 does not include the coding error generated in block 400.
[0079] In this way, when focusing on the vertical propagation of the coding error occurring in block 400, it only propagates up to block 403 (propagation stops at block 403). That is, the vertical propagation of the coding error does not continue very long in flat regions. Therefore, it is difficult for the user to visually recognize the coding error, and deterioration of image quality is suppressed.
[0080] Summary of the first embodiment As described above, according to the first embodiment, an imaging device having the function of an encoding device judges whether the flatness of pixel values in a target block exceeds a predetermined standard (i.e., whether the target block is a flat block). In addition, the imaging device performs a process of selecting an intra prediction mode of the target block. Here, when the target block is a flat block, the imaging device controls a process of selecting an intra prediction mode of the target block based on the remainder when (MB_X+MB_Y) is divided by 3. For example, when the remainder is 0, the imaging device controls to increase the possibility that horizontal prediction is selected, when the remainder is 1, the imaging device controls to increase the possibility that vertical prediction is selected, and when the remainder is 2, the imaging device controls to increase the possibility that DC prediction is selected. By such control, when the target block is a flat block, the possibility that the intra prediction mode of the target block is different from the intra prediction mode of one or more reference blocks (one or more blocks including pixels referenced for intra prediction coding of the target block according to the intra prediction mode of the target block among the multiple blocks constituting the original image) is increased.
[0081] For example, as shown in Fig. 3, horizontal prediction is likely to be selected for the block adjacent to the upper side of block 302, and vertical prediction is likely to be selected for block 302. Therefore, when focusing on block 302 as a target block, it can be said that control is performed to increase the possibility that the intra prediction mode (vertical prediction) of the target block (block 302) is different from the intra prediction mode (horizontal prediction) of one or more reference blocks (blocks adjacent to the upper side of block 302). When such control is performed, the directions of propagation of coding errors become diversified, and the propagation of coding errors generated in a specific block in a fixed direction in a flat region does not continue for very long.
[0082] Therefore, according to this embodiment, it is possible to suppress deterioration in image quality in flat regions of an image subjected to intra-prediction coding.
[0083] The configuration of the present embodiment described above is merely one example of a configuration for realizing control to improve the possibility that the intra prediction mode of the target block is different from the intra prediction mode of one or more reference blocks. For example, in the above description, the intra prediction modes that are the subject of control to improve the possibility of selection are three types of intra prediction modes, namely horizontal prediction, vertical prediction, and DC prediction. However, the number of types of intra prediction modes that are the subject of control to improve the possibility of selection is not limited to three. In addition, some or all of these three types of intra prediction modes may be changed to other types of intra prediction modes.
[0084] [Second embodiment] In the second embodiment, a configuration example different from that of the first embodiment is described for implementing control to improve the possibility that the intra prediction mode of a target block is different from the intra prediction mode of each of one or more reference blocks. In the second embodiment, the basic configuration of an imaging device (FIG. 1) having the function of an encoding device is the same as that of the first embodiment. Below, the differences from the first embodiment are mainly described.
[0085] 7 is a flowchart of the intra prediction mode selection process according to the second embodiment. This selection process is performed by (the components included in) the encoding process unit 100 under the control of the control unit 117.
[0086] The processes in S200 to S203 are the same as those in the first embodiment (FIG. 2). However, if it is determined in S203 that the target block is a flat block, the process proceeds to S704.
[0087] In S704, the intra prediction unit 110 obtains the intra prediction modes of the neighboring blocks of the current block.
[0088] Next, the blocks surrounding the current block will be described with reference to Fig. 9. Each square in Fig. 9 indicates a block, and an intra prediction mode is selected for each block. When block 901 is the current block, intra prediction unit 110 obtains the intra prediction mode of block 902, which is adjacent to the left of block 901, and the intra prediction mode of block 903, which is adjacent to the top of block 901.
[0089] It is assumed here that the intra prediction unit 110 selects an intra prediction mode for the current block from three types of intra prediction modes: horizontal prediction, vertical prediction, and DC prediction. Therefore, the left and right neighboring blocks are used as the neighboring blocks. However, the neighboring blocks may change depending on the selectable intra prediction modes. For example, when an intra prediction mode that refers to pixels of the upper right block (block 904 when block 901 is the current block) can be selected, the neighboring blocks include the upper right block.
[0090] In S705, the intra prediction unit 110 adds a predetermined value to the cost value of each intra prediction mode other than the specific intra prediction mode corresponding to the intra prediction mode of the obtained neighboring block. As the addition method here, the same addition method as the addition method described with reference to S206 in FIG. 2 in the first embodiment can be used.
[0091] A method for determining an intra prediction mode to which a predetermined value is to be added to a cost value will now be described with reference to Fig. 8. The table in Fig. 8 shows specific intra prediction modes corresponding to the intra prediction modes of the blocks adjacent to the upper and left of the current block, and the cost values of each intra prediction mode other than the specific intra prediction modes shown here are targets for adding a predetermined value.
[0092] For example, if the intra prediction mode of the block above is horizontal prediction and the intra prediction mode of the block to the left is vertical prediction, the DC prediction shown in cell 800 corresponds to a "specific intra prediction mode," and a predetermined value is added to the cost value of each intra prediction mode other than DC prediction.
[0093] In FIG. 8, a cell with a lattice pattern in the background indicates that an intra-prediction mode other than the intra-prediction mode in the cell may be a "specific intra-prediction mode". For example, consider a case where the intra-prediction mode of the upper adjacent block is DC prediction, and the intra-prediction mode of the left adjacent block is also DC prediction. In this case, the horizontal prediction shown in cell 801 corresponds to the "specific intra-prediction mode", and a predetermined value is added to the cost value of each intra-prediction mode other than the horizontal prediction. However, since the "specific intra-prediction mode" only needs to be different from the intra-prediction modes of the upper adjacent block and the left adjacent block, the vertical prediction may be the "specific intra-prediction mode" here. In this case, a predetermined value is added to the cost value of each intra-prediction mode other than the vertical prediction.
[0094] The processes from S209 onwards are similar to those in the first embodiment (FIG. 2). As a result of the processes in S704 and S705, in S209, an intra prediction mode different from the intra prediction modes of the peripheral blocks is likely to be selected as the intra prediction mode of the current block.
[0095] In this way, in the second embodiment, similarly to the first embodiment, the control is realized to improve the possibility that the intra prediction mode of the target block is different from the intra prediction mode of each of one or more reference blocks.Therefore, according to this embodiment, it is possible to suppress the deterioration of image quality in the flat area of the image in which intra prediction coding is performed.
[0096] [Other embodiments] The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
[0097] [summary] The above-described embodiment discloses at least the inventions shown in the following items, but is not limited to these inventions. [Item 1] a determining means for determining whether or not a degree of flatness of pixel values in a first block among a plurality of blocks constituting an image exceeds a predetermined standard; A selection means for selecting an intra prediction mode of the first block; a control means for controlling the selection process when it is determined that the flatness of the first block exceeds the predetermined standard so as to increase the possibility that the intra prediction mode of the first block is different from the intra prediction mode of each of one or more reference blocks, the one or more reference blocks being one or more blocks among the plurality of blocks that include pixels referenced for intra prediction coding of the first block according to the intra prediction mode of the first block; an encoding means for performing intra-prediction encoding on the first block in accordance with the intra-prediction mode selected by the selection process; An encoding device comprising: [Item 2] The plurality of blocks are arranged in a matrix, The first block is located in column X and row Y; when it is determined that the flatness degree of the first block exceeds the predetermined criterion, the control means controls the selection process in accordance with a remainder when (X+Y) is divided by 3 so as to increase the likelihood that a different intra prediction mode will be selected from among three predetermined intra prediction modes; The three predetermined intra prediction modes include an intra prediction mode that refers to pixels of a left adjacent block, an intra prediction mode that refers to pixels of an upper adjacent block, and an intra prediction mode that refers to pixels of the left adjacent block and pixels of the upper adjacent block. 2. The encoding device according to item 1, [Item 3] The plurality of blocks are arranged in a matrix, when it is determined that the flatness degree of the first block exceeds the predetermined criterion, the control means controls the selection process so as to increase a possibility that an intra prediction mode different from an intra prediction mode of a left adjacent block and an intra prediction mode of an upper adjacent block is selected from among three types of predetermined intra prediction modes; The three predetermined intra prediction modes include an intra prediction mode that refers to pixels of a left adjacent block, an intra prediction mode that refers to pixels of an upper adjacent block, and an intra prediction mode that refers to pixels of the left adjacent block and pixels of the upper adjacent block. 2. The encoding device according to item 1, [Item 4] The selection process includes a process of calculating, for the first block, an index value representing a coding efficiency of each of a plurality of predetermined intra prediction modes, and selecting, from the plurality of predetermined intra prediction modes, an intra prediction mode corresponding to the index value representing the highest coding efficiency. 4. The encoding device according to any one of items 1 to 3, [Item 5] When it is determined that the flatness degree of the first block exceeds the predetermined standard, the control means adjusts index values of each intra prediction mode other than a first intra prediction mode among the plurality of predetermined intra prediction modes so as to reduce coding efficiency represented by the index values; The first intra-prediction mode is an intra-prediction mode different from an intra-prediction mode of each of the one or more reference blocks. 5. The encoding device according to item 4, [Item 6] The determining means determines that the degree of flatness of the first block exceeds the predetermined standard when a variance value of pixel values in the first block is smaller than a predetermined threshold. 6. The encoding device according to any one of items 1 to 5, [Item 7] An encoding device according to any one of items 1 to 6, An imaging means for generating the image; An imaging device comprising: [Item 8] A control method executed by an encoding device, comprising: a determining step of determining whether or not a degree of flatness of pixel values in a first block among a plurality of blocks constituting an image exceeds a predetermined standard; A selection process for selecting an intra prediction mode for the first block; a control step of controlling the selection process when it is determined that the flatness degree of the first block exceeds the predetermined criterion so as to increase a possibility that the intra prediction mode of the first block is different from the intra prediction mode of each of one or more reference blocks, the one or more reference blocks being one or more blocks among the plurality of blocks that include pixels referenced for intra prediction coding of the first block according to the intra prediction mode of the first block; an encoding process of performing intra-prediction encoding on the first block in accordance with the intra-prediction mode selected by the selection process; A control method comprising: [Item 9] A program for causing a computer to function as each of the means of the encoding device described in any one of items 1 to 6.
[0098] The invention is not limited to the above-described embodiments, and various modifications and variations are possible without departing from the spirit and scope of the invention. Accordingly, the following claims are appended to apprise the public of the scope of the invention. [Explanation of symbols]
[0099] 100: encoding processing unit, 101: imaging unit, 109: intra memory, 110: intra prediction unit, 111: flatness determination unit, 117: control unit
Claims
1. a determining means for determining whether or not a degree of flatness of pixel values in a first block among a plurality of blocks constituting an image exceeds a predetermined standard; A selection means for selecting an intra prediction mode of the first block; a control means for controlling the selection process when it is determined that the flatness of the first block exceeds the predetermined standard so as to increase a possibility that an intra prediction mode of the first block is different from an intra prediction mode of each of one or more reference blocks, the one or more reference blocks being one or more blocks among the plurality of blocks that include pixels referenced for intra prediction coding of the first block according to the intra prediction mode of the first block; an encoding means for performing intra-prediction encoding on the first block in accordance with the intra-prediction mode selected by the selection process; An encoding device comprising:
2. The plurality of blocks are arranged in a matrix, The first block is located in X column and Y row, when it is determined that the flatness degree of the first block exceeds the predetermined criterion, the control means controls the selection process in accordance with a remainder when (X+Y) is divided by 3 so as to increase the likelihood that a different intra prediction mode will be selected from among three predetermined types of intra prediction modes; The three types of predetermined intra prediction modes include an intra prediction mode that refers to pixels of a left adjacent block, an intra prediction mode that refers to pixels of an upper adjacent block, and an intra prediction mode that refers to pixels of the left adjacent block and pixels of the upper adjacent block.
2. The encoding device according to claim 1 .
3. The plurality of blocks are arranged in a matrix, When it is determined that the flatness degree of the first block exceeds the predetermined criterion, the control means controls the selection process so as to increase a possibility that an intra prediction mode different from the intra prediction mode of the left adjacent block and the intra prediction mode of the upper adjacent block is selected from among three types of predetermined intra prediction modes; The three types of predetermined intra prediction modes include an intra prediction mode that refers to pixels of a left adjacent block, an intra prediction mode that refers to pixels of an upper adjacent block, and an intra prediction mode that refers to pixels of the left adjacent block and pixels of the upper adjacent block.
2. The encoding device according to claim 1 .
4. The selection process includes a process of calculating, for the first block, an index value representing the coding efficiency of each of a plurality of predetermined intra prediction modes, and selecting, from the plurality of predetermined intra prediction modes, an intra prediction mode corresponding to the index value representing the highest coding efficiency.
2. The encoding device according to claim 1 .
5. When it is determined that the flatness degree of the first block exceeds the predetermined standard, the control means adjusts index values of each intra prediction mode other than a first intra prediction mode among the plurality of predetermined intra prediction modes so as to reduce coding efficiency represented by the index values; The first intra-prediction mode is an intra-prediction mode different from an intra-prediction mode of each of the one or more reference blocks.
5. The encoding device according to claim 4.
6. The determining means determines that the degree of flatness of the first block exceeds the predetermined standard when a variance value of pixel values in the first block is smaller than a predetermined threshold.
2. The encoding device according to claim 1 .
7. An encoding device according to claim 1; An imaging means for generating the image; An imaging device comprising:
8. A control method executed by an encoding device, comprising: a determining step of determining whether or not a degree of flatness of pixel values in a first block among a plurality of blocks constituting an image exceeds a predetermined standard; A selection process for selecting an intra prediction mode for the first block; a control step of controlling the selection process so as to increase a possibility that an intra prediction mode of the first block is different from an intra prediction mode of each of one or more reference blocks when it is determined that the flatness degree of the first block exceeds the predetermined standard, the one or more reference blocks being one or more blocks among the plurality of blocks that include pixels referenced for intra prediction coding of the first block according to the intra prediction mode of the first block; an encoding process of performing intra-prediction encoding on the first block in accordance with the intra-prediction mode selected by the selection process; A control method comprising:
9. A program for causing a computer to function as each of the means of the encoding device according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intra prediction mode selection in video coding
US20170041616A1
Limitation of error propagation in line-based prediction for intra coding
WO2012034690A1
