The present invention relates to a moving image processing apparatus, a processing method, and a computer-readable storage medium.
PTL 1 discloses a moving image encoding apparatus and decoding apparatus that use intra prediction (intra-frame prediction)/inter prediction (inter-frame prediction), residual transformation, entropy encoding, and in-loop filters.
First, the input image data is input to an inter prediction unit 15 and an intra prediction unit 16. Note that image data of a previous frame is input to the intra prediction unit 15 from a frame buffer 17, and image data of an already-processed block of the same frame as the processing target is input to the intra prediction unit 16 from an addition unit 14. The inter prediction unit 15 calculates a prediction block for the processing target block being processed through inter-frame prediction, based on the previous frame. The intra prediction unit 16 outputs a prediction block for the processing target block based on another block of the same frame as the processing target block. Also, depending on whether inter-frame prediction or intra-frame prediction is to be applied to the processing target block, one of the outputs of the inter prediction unit 15 and the intra prediction unit 16 is output to a subtraction unit 10.
The subtraction unit 10 outputs an error (residual) signal indicating an error between the image of the image processing target block and a predicted image output by the inter prediction unit 15 or the intra prediction unit 16. A transformation/quantization unit 11 outputs a level value by performing orthogonal transformation and quantization on the error signal. The encoding unit 12 generates a bit stream by performing entropy encoding on the level value and side information (not shown). Note that side information is information that is needed to re-configure the pixel values used in the decoding apparatus, and includes information such as the encoding mode, which indicates which of intra prediction or inter prediction was used, the quantization parameters, and the block size.
An inverse quantization/inverse transformation unit 13 generates an error signal by performing processing that is the inverse of that of the transformation/quantization unit 11. The addition unit 14 generates the processing target block by adding the error signal output by the inverse quantization/inverse transformation unit 13 and the predicted image output by the inter prediction unit 15 or the intra prediction unit 16, and outputs the generated processing target block to the intra prediction unit 16 and an in-loop filter 18. Upon receiving all of the blocks of one frame, the in-loop filter 18 generates a locally-decoded image corresponding to the frame and outputs the generated image to a frame buffer 17. The locally-decoded image is used for inter-frame prediction in the inter prediction unit 15.
Note that NPTL 1 discloses that deblocking processing and sample adaptive offset processing are performed by the in-loop filter 18. Deblocking processing is processing for reducing distortion that occurs at the boundary portion of a block in a frame. Accordingly, image quality deterioration is prevented from propagating in inter-frame prediction. Note that the sample adaptive offset processing is processing for adding/subtracting an offset value to/from a pixel value.
A boundary strength determination unit 35 evaluates the boundary strength using three levels, namely 0, 1, and 2, based on the side information, or more specifically, whether intra prediction or inter prediction is used, whether or not the boundary is a boundary between transformation blocks and a non-zero orthogonal transformation coefficient exists, whether or not the difference between the motion vectors of two blocks on both sides of the boundary is greater than or equal to a threshold, and whether a motion compensation reference image of the two blocks on both sides of the boundary is different or the numbers of motion vectors of the two blocks on both sides of the boundary are different. Note that a boundary strength of 0 is the weakest, and a boundary strength of 2 is the strongest. Based on decision criteria that use the boundary strength of the boundary that is the processing target, the quantization parameters included in the side information, and the pixel values of the non-deblocked image, the filter deciding unit 37 decides whether or not a filter is to be used on the boundary that is the processing target, and if the filter is to be used, the filter deciding unit 37 determines whether to apply a weak filter or a strong filter. A filter unit 39 performs deblocking by applying a filter to a non-deblocked image in accordance with the deciding performed by the filter deciding unit 37.
The processing performed by the transformation block boundary detection unit 32, the prediction block boundary detection unit 34, the boundary strength determination unit 36, and the filter deciding unit 38 differs only in the direction of the target boundaries from the processing performed by the transformation block boundary detection unit 31, the prediction block boundary detection unit 33, the boundary strength determination unit 35, and the filter deciding unit 37, and repetitive description thereof is omitted. Also, in accordance with the deciding of the filter deciding unit 38, a filter unit 40 applies a filter to the filter target image, which is an image that is output by the filter unit 39 and is obtained by applying a filter to the boundaries in the vertical direction, and the filter unit 40 outputs a deblocked image.
PTL 2 discloses a configuration in which the boundary strength is increased as the prediction block increases in size, in order to suppress block distortion. Also, NPTL 2 discloses performing encoding control such that a large-sized block is not likely to be selected, in order to suppress block distortion.
NPTL 2: JCTVC-L0232 AHG6: On deblocking filter and parameters signaling
PTL 2 takes only the prediction blocks into consideration, and block distortion occurs depending on the size of the transformation block. Also, in the configuration disclosed in NPTL 2, the encoding amount increases.
According to an aspect of the present invention, a moving image processing apparatus includes: a detection unit configured to detect a boundary of blocks; a determination unit configured to determine a strength of the boundary detected by the detection unit; and a deciding unit configured to decide whether or not a filter is to be applied to the boundary based on the strength of the boundary determined by the determination unit, wherein the determination unit is further configured to use a size of a transformation block to determine the strength of the boundary.
Other features and advantages of the present invention will become apparent from the following description given with reference to the accompanying drawings. Note that in the accompanying drawings, identical or similar configurations are denoted by identical reference numerals.
Hereinafter, exemplary embodiments of the present invention will be described with reference to the drawings. Note that the following embodiments are exemplary and the present invention is not limited to the content of the embodiments. Also, in the following drawings, constituent elements that are not needed in the description of the embodiments are omitted from the drawings.
Basic configurations of an encoding apparatus and a decoding apparatus according to the present embodiment are the same as in
In the present embodiment, a boundary strength determination unit 55 uses the conventional boundary strength determination criteria shown in
In the present embodiment, if the boundary in the vertical direction shown in
Based on the boundary strength of the boundary, the quantization parameters included in the side information, and the pixel values of the non-deblocked image, the filter deciding unit 37 decides whether or not a filter is to be applied to the boundary in accordance with the decision criteria for the filter, and if a filter is to be applied, the filter deciding unit 37 decides whether to apply a weak filter or a strong filter.
Here, with the decision criteria, the larger the value of the boundary strength is, the higher the probability of determining that a filter is to be applied is. More specifically, regarding the luminance values, when the boundary strength is 0, it is determined that no filter is to be applied. On the other hand, when the boundary strength is 1 or more, it is decided whether or not the filter is to be applied by comparing a value calculated based on the pixel values of a total of 12 pixels, namely px0, qx0, px3, and qx3 (here, x is an integer from 0 to 2) and a value obtained based on the average value of the quantization parameters of two blocks constituting the boundary. Also, regarding color difference values, when the boundary strength is 2 or more, it is determined that a filter is to be applied. In other words, with the decision criteria, the value of the strength of the boundary being greater than or equal to a threshold (1 for luminance values, 2 for color difference values) is a condition for applying a filter. Also, if the value of the strength of the boundary is greater than or equal to a threshold, and regarding the luminance values, if the value calculated based on the pixel values of a total of 12 pixels, namely px0, qx0, px3, and qx3 (here, x is an integer from 0 to 2), is less than a value obtained based on the average value of the quantization parameters of the two blocks that constitute the boundary, it is determined that a filter is to be applied. Note that regarding the color difference values, if the value of the strength of the boundary is greater than or equal to a threshold, it is determined that a filter is to be applied.
Also, with the decision criteria, the larger the boundary strength is, the greater the probability of deciding that the strong filter is to be applied is. Specifically, if the filter is to be applied to the luminance values, six values are calculated based on the pixel values of a total of 16 pixels, namely px0, qx0, px3, and qx3 (here, x is an integer from 0 to 3), and if all of the values satisfy predetermined criteria, it is decided that the strong filter is to be applied. Two of the predetermined criteria are satisfied if the difference between p00 and q00 and the difference between p03 and q03 are each less than a second threshold, but the second threshold is set based on the boundary strength. More specifically, an intermediate value is obtained based on the boundary strength. The intermediate value is set to a larger value the larger the boundary strength is. Then, the second threshold is obtained based on the intermediate value. Note that the relationship between the intermediate value and the second threshold is determined in advance. The relationship between the intermediate value and the second threshold is determined such that if the second threshold is a third value when the intermediate value is a first value and the second threshold is a fourth value when the intermediate value is a second value that is larger than the first value, the fourth value is a value that is greater than or equal to the third value. In other words, if the boundary strength changes from the first value to the greater second value, the second threshold changes from the third value to a value that is greater than or equal to the third value. Also, with the decision criteria, the absolute value of the difference between p00 and q00 and the absolute value of the difference between p03 and q03 each being smaller than the second threshold is one condition for selecting the strong filter. Accordingly, if the boundary strength increases, the probability that the strong filter will be applied increases. Note that one type of filter is used for the color difference values.
As described above, in the present embodiment, the sizes of the transformation blocks are used to determine the boundary strength. More specifically, prediction block boundaries and transformation block boundaries are detected, and the sizes of the transformation blocks are used to determine the strength of the boundary between the transformation blocks. At this time, if the size in the same direction as the boundary of at least one transformation block among the transformation blocks on both sides of the boundary is greater than or equal to the first threshold, it is determined that the strength of the boundary is higher than in the case where the size is less than the first threshold. For example, if the size in the same direction as the boundary of at least one transformation block among the transformation blocks on both sides of the boundary is greater than or equal to the first threshold, the strength of the boundary is increased by a predetermined value, for example, 1, compared to the case where the size is less than the first threshold. The filter deciding units 37 and 38 decide whether or not a filter is to be applied to the boundary using the decision criteria including the strength of the boundary, but as described above, the larger strength of the boundary is, the greater the probability that the filter will be applied to the boundary is. Accordingly, if the size of the transformation block is greater than or equal to the first threshold, it is possible to suppress a case in which the probability that the filter will be applied increases and filter distortion becomes noticeable. Also, since the case in which the size of the block increases is not suppressed, the encoding amount does not increase.
Furthermore, if a filter is to be applied to the boundary, the filter deciding units 37 and 38 decide on the filter that is to be applied to the boundary from among multiple filters with different strengths. Note that in the above-described embodiment, the multiple filters with different strengths were two types, namely a weak filter and a strong filter with a higher filter strength than the weak filter. However, it is also possible to use a configuration in which three or more filters with different strengths are used. Also, the filter deciding units 37 and 38 set the second threshold for deciding on the filter to be applied to the boundary based on the strength of the boundary. Here, in the decision criteria, the second threshold is larger the larger the boundary strength is, and the likelihood that the stronger filter will be selected increases the greater the second threshold is. Accordingly, if the size of the transformation block is greater than or equal to the first threshold, the probability that the strong filter will be applied increases and thus it is possible to suppress a case in which filter distortion becomes noticeable.
Next, a second embodiment will be described with a focus on differences from the first embodiment. In the present embodiment, the boundary strength determination unit 55 and the filter deciding unit 37 shown in
As described above, in the present embodiment, if the size of the transformation block on one side of the boundary is greater than or equal to the first threshold, the strong filter is always applied. Accordingly, even if the transformation block size is large, block distortion can be suppressed. Note that in the present embodiment as well, the filter can have three or more strengths. In this case, if the transformation block size is greater than or equal to the first threshold, the strongest filter is always applied.
Next, a third embodiment will be described with a focus on differences from the second embodiment. The configuration of the present embodiment is similar to that of the second embodiment. However, in the second embodiment, if the boundary is a boundary between transformation blocks and the size thereof is greater than or equal to the first threshold, the strong filter was always applied. As described above, the strong filter is applied to the pixels pxy and qxy (here, x is 0 to 2 and y is 0 to 3) shown in
As described above, in the present embodiment, if the transformation block size is greater than or equal to the first threshold, the pixel range for filter application based on the boundary is made larger than that of a normal strong filter. With this configuration, even if the transformation block size is large, block distortion can be suppressed.
In the first to third embodiments, filters were similarly applied to both sides of the boundary. In the present embodiment, if the size of one transformation block at a boundary is greater than or equal to the first threshold, or for example, 16 pixels or more, a filter is decided on for the one transformation block in accordance with the processing of one of the first to third embodiments, and a filter decided on using the conventional method is applied to the other block. For example, as shown in
Accordingly, the filter strength to be applied and the range thereof can be limited to the transformation block that is greater than or equal to the first threshold, and an increase in the filter processing load can be suppressed.
Note that the processing apparatus according to the present invention, or in other words, the encoding apparatus or decoding apparatus, can be realized using programs that cause a computer to operate as the above-described processing apparatus. These computer programs can be stored in a computer-readable storage medium or can be distributed via a network.
The present invention is not limited to the above-described embodiments, and various changes and modifications are possible without departing from the spirit and scope of the present invention. Accordingly, the following claims are appended in order to make the scope of the present invention public.
Number | Date | Country | Kind |
---|---|---|---|
2015-194343 | Sep 2015 | JP | national |
This application is a continuation of U.S. Patent Application Ser. No. 15/922,437 filed Mar. 15, 2018, which is a continuation of International Patent Application No. PCT/JP2016/071967 filed on Jul. 27, 2016, and claims priority to Japanese Patent Application No. 2015-194343 filed on Sep. 30, 2015, the entire content of which is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 15922437 | Mar 2018 | US |
Child | 18208208 | US | |
Parent | PCT/JP2016/071967 | Jul 2016 | US |
Child | 15922437 | US |