Embodiments described herein relate generally to an image coding method, an image decoding method, an image coding apparatus, and an image decoding apparatus.
In a technique of video coding and decoding, a motion-compensated interpolation for each block is generally executed. An image signal to be referred is stored in an external memory; therefore, when the video coding and decoding is implemented by hardware, there might be constraints on the amount of read data. Accordingly, when an amount of access to the memory increases, a so-called memory bandwidth, which is a bottleneck in the coding and decoding operations, becomes a problem.
In the motion-compensated interpolation for each block, an interpolation filtering process using FIR (Finite Impulse Response) filter in the horizontal direction and in the vertical direction is executed. In the interpolation filtering process, a pixel outside the block has to be accessed. When the number of pixels outside the block increases, the memory bandwidth per pixel also increases.
Conventionally, the memory bandwidth per pixel has been reduced by applying an interpolation filter with a short tap length to a block with a small size by which the ratio of the accessed pixels outside the block relatively increases.
However, in the conventional art, the memory bandwidth cannot appropriately be reduced. For example, in the case of the chroma format, such as 4:2:0 or 4:2:2, in which the number of samples of the pixel for a color difference (color difference component) is smaller than the number of samples of the pixel for luminance (luminance component), and the resolution is low, the interpolation has to be executed in such a manner that the color difference is enlarged more with the luminance being defined as a reference. Therefore, when the filter with taps longer than two taps is used for the interpolation for the color difference, the process for the color difference signal cannot be restricted, even if the process is changed per luminance block.
According to an embodiment, an image coding method is for coding an image including a luminance component and two color difference components. The method includes acquiring a reference image; and generating a predicted image by interpolating the luminance component and the two color difference components in the reference image according to a motion vector. When a size of a block, which is designated as a unit of the interpolation, is equal to or smaller than a predetermined first threshold value, the generating includes inhibiting a bi-directional prediction, and performing only a uni-directional prediction to generate the predicted image according to the motion vector.
Embodiments will be described below in detail with reference to the accompanying drawings.
The image coding apparatus and the image decoding apparatus according to the present embodiment make a control by referring to chroma format information so that a position of a pixel indicated by a motion vector in a block having a size smaller than a predetermined size is not subject to an interpolation for a color difference, thereby reducing a memory bandwidth.
The image coding apparatus 100 generates coded data 120 from input video signal 101. For example, the input video signal 101 is input to the image coding apparatus 100 in units o frames. The input video signal 101 is divided into a block that is a macroblock.
The subtraction unit 102 outputs a prediction error signal that is a difference between a predicted image signal 111 generated by the predicted image generating unit 110 and the input video signal 101.
The transformation/quantization unit 103 executes a quantization after executing an orthogonal transformation on prediction error signal with a discrete cosine transformation (DCT), thereby generating quantized transform coefficient information. The quantized transform coefficient information is divided into two. One of the divided information is input to the entropy coding unit 105. The other one is input to the inverse quantization/inverse transformation unit 104.
The inverse quantization/inverse transformation unit 104 executes the inverse quantization and inverse transformation on the quantized transform coefficient information as the process inverse to the processing executed by the transformation/quantization unit 103, thereby reproducing the prediction error signal.
The addition unit 106 adds the prediction error signal and the predicted image signal. According to this process, a decoded image signal 107 is generated. The decoded image signal 107 is input to the frame memory 108.
The frame memory 108 is a memory unit that stores therein a reference image signal. The frame memory 108 executes a filtering process or the other process on the decoded image signal 107, and then, determines whether the decoded image signal 107 is stored or not for allowing the decoded image signal 107 to become the reference image signal 109 input to the predicted image generating unit 110. The reference image signal 109 is input to the predicted image generating unit 110 and to the motion vector search unit 116.
The motion vector search unit 116 generates motion vector information 117 from the input video signal 101 and the reference image signal 109. The motion vector information 117 is input to the predicted image generating unit 110, and also transmitted to the entropy coding unit 105.
The predicted image generating unit 110 generates the predicted image signal 111 from the reference image signal 109, the prediction control information 118, and the motion vector information 117.
The coding control unit 113 inputs block size restriction information 115 to the prediction control unit 112, and transmits profile/level information 119 to the entropy coding unit 105.
The profile/level information 119 includes profile information indicating a combination of coding tool groups, and level information that is restriction information of the image coding apparatus according to the processing power of the image decoding apparatus. The level information indicates a restriction combination of a maximum number of macroblocks per hour, the maximum number of macroblocks per frame, the maximum search range of vector, and the number of vectors in two consecutive macroblocks.
For example, H.264 specifies profile information such as a base line profile, a main profile, and high profile. H.264 also specifies 16 level information.
In the present embodiment, parameters are specified using the profile/level information. The parameters includes a parameter specifying as to whether the memory bandwidth reducing method is applied or not, the restriction value of the block size (block size restriction information 115), and a restriction method. These parameters may be specified by using information other than the profile/level information.
The block size restriction information 115 is information specifying a threshold value (the restriction value of the block size) used for the determination of the block size. For example, the coding control unit 113 sets different block size restriction information 115 according to the profile/level information. The block size restriction information 115 may be included in the profile/level information.
The prediction control unit 112 controls the predicted image generation executed by the predicted image generating unit 110 according to the block size restriction information 115 input from the coding control unit 113, chroma format information 114 of the input video signal 101, and the motion vector information 117 input from the motion vector search unit 116 (the detail will be described later). The prediction control unit 112 generates the prediction control information 118 used for the control of the predicted image generation. The prediction control information 118 is input to the predicted image generating unit 110, and also transmitted to the entropy coding unit 105.
The entropy coding unit 105 performs an entropy coding on the coding information to generate the coded data 120 according to a prescribed syntax. The coding information includes, for example, the quantized transform coefficient information input from the transformation/quantization unit 103, the chroma format information 114 of the input video signal, the motion vector information 117 input from the motion vector search unit 116, the prediction control information 118 input from the prediction control unit 112, and the profile/level information 119 input from the coding control unit 113.
Here, the chroma format information 114 will be described. The chroma format information 114 is information indicating a chroma format of the input video signal 101.
chroma_format_idc=0 indicates a monochrome format only with luminance. chroma_format_idc=1 indicates 4:2:0 format in which the color difference is sampled at half horizontally and vertically with respect to the luminance. chroma_format_dc=2 indicates 4:2:2 format in which the color difference is sampled at half only horizontally with respect to the luminance. chroma_format_idc=3 indicates 4:4:4 format in which the luminance and the color difference have the same pixel number.
The horizontal size of the prediction block of the luminance signal is defined as nPSW, and the vertical size is define as nPSH. In 4:2:0 format, the horizontal size of the blocks of the color difference signals Cb and Cr is nPSW/2, while the vertical size is nPSH/2. In 4:2:2 format, the horizontal size of the blocks of the color difference signals Cb and Cr is nPSW/2, while the vertical size is nPSH. In 4:4:4 format, the horizontal size or the blocks of the color difference signals Cb and Cr is nPSW, while the vertical size is nPSH.
Next, the relationship between the chroma format and the interpolation will be described.
The white portions without “A” indicate the position of the motion vector that needs the one-dimensional interpolation for the luminance signal and the color difference signal only horizontally or only vertically. The light shaded portions without “A” indicate the position of the motion vector that needs the two-dimensional interpolation in which the interpolation processing is per horizontally and vertically for the luminance signal and the color difference signal. Dark shaded portions indicate the position of the motion vector that needs the one-dimensional interpolation only horizontally or only vertically for the luminance signal, and needs the two-dimensional interpolation in which the interpolation is executed horizontally and vertically for the color difference signal.
The white portions without “A” indicate the position of the motion vector that needs the one-dimensional interpolation for the luminance signal and the color difference signal only horizontally or only vertically. The light shaded portions without “A” indicate the position of the motion vector that needs the two-dimensional interpolation in which the interpolation is performed horizontally and vertically for the luminance signal and the color difference signal. Dark shaded portions indicate the position of the motion vector that needs the one-dimensional interpolation only horizontally for the luminance signal, and needs the two-dimensional interpolation in which the interpolation is executed horizontally and vertically for the color difference signal.
Next, the relationship between the chroma format and the pixel to be accessed in the interpolation will be described.
As illustrated in
In the present embodiment, by referring to the chrome format and the motion vector, the predicted image generation is controlled so that a specific interpolation in which the number of pixels to be accessed in the reference image (reference image signal 109) is large is not executed. The specific interpolation is an interpolation using bi-directional prediction and two-dimensional interpolation. The interpolation in the bi-directional prediction may be defined as the specific interpolation. The specific method for controlling the predicted image generation so as not to execute the specific interpolation will be described later.
The image decoding apparatus 300 generates a reproduced video signal 307 from coded data 301.
The entropy decoding unit 302 performs an entropy decoding on the coded data 301 in accordance with a prescribed syntax. The entropy decoding unit 302 decodes the coded data 301 to acquire quantized transform coefficient information, prediction control information 311, motion vector information 312, and profile/level information 313. The decoded quantized transform coefficient information is input to the inverse quantization/inverse transformation unit 303. The decoded prediction control information 311, the motion vector information 312, and the profile/level information 313 are input to the predicted image generating unit 110.
The quantized transform coefficient information, the prediction control information 311, the motion vector information 312, and the profile/level information 313 correspond respectively to the quantized transform coefficient information, the prediction control information 118, the motion vector information 117, and the profile/level information 119, which are coded by the image coding apparatus 100 in
The inverse quantization/inverse transformation unit 303 executes inverse quantization and inverse orthogonal transformation on the quantized transform coefficient information, thereby reproducing the prediction error signal.
The addition unit 304 adds the prediction error signal and the predicted image signal 310 to generate a decoded image signal 305. The decoded image signal 305 is input to the frame memory 306.
The frame memory 306 executes the filtering process on the decoded image signal 305, and outputs the resultant as the reproduced video signal 307. The frame memory 306 determines whether the decoded image signal 305, which has undergone the filtering process, is stored or not, based upon the prediction control information 311. The stored decoded image signal 305 is input to the predicted image generating unit 110 as a reference image signal 308.
The predicted image generating unit 110 generates the predicted image signal 310 by using the reference image signal 308, the prediction control information 311, and the motion vector information 312.
The prediction control information 118 includes information (prediction mode) for designating which one of the bi-directional prediction unit 202, the uni-directional prediction unit 203, and the intra-prediction unit 204 is used, for example. The switch 201 makes a changeover for selecting any one of the bi-directional prediction unit 202, the uni-directional prediction unit 203, and the intra-prediction unit 204 by referring to this information.
The reference image signal 109 is input to any one of the bi-directional prediction unit 202, the uni-directional prediction unit 203, and the intra-prediction unit 204, which is selected by the switch 201.
When the bi-directional prediction unit 202 is selected, the bi-directional prediction unit 202 generates a motion compensation image signal by using the reference image signal 109 and the motion vector information 117 from plural reference frames, and generates the predicted image signal 111 based upon the directional prediction. The bi-directional prediction unit 202 is selected not only in the case where the prediction mode is explicitly designated as the bi-directional prediction as the coded data but also in the case where the bi-directional prediction is not explicitly designated by the coded data such as a skip mode, a direct mode, and merge mode, but the operation of the bi-directional prediction is implicitly designated by semantics.
When the uni-directional prediction unit 203 is selected, the uni-directional prediction unit 203 generates the motion compensation image signal by using the reference image signal 109 and the motion vector information 117 from a single reference frame, and generates the predicted image signal 111. The uni-directional prediction unit 203 is selected not only in the case where the prediction mode is explicitly designated as the uni-directional prediction as the coded data but also in the case where the uni-directional prediction is not explicitly designated by the coded data such as the skip mode, the direct mode, and the merge mode, but the operation of the uni-directional prediction is implicitly designated by semantics.
When the intra-prediction unit 204 is selected, the intra-prediction unit 204 generates the predicted image signal 111 by using the reference image signal 109 in a screen.
Next, the control for reducing the memory bandwidth by the image coding apparatus 100 thus configured according to the present embodiment will be described with reference to
The coding control unit 113 sets a restriction value (nLPSW, nLPSH) of the block size according to the profile/level information 119 (step S101). nLPSW is the restriction value of the predicted block size of luminance in the horizontal direction. nLPSH is the restriction value of the predicted block size of luminance in the vertical direction.
When the profile information indicate, a specific profile (e.g., high profile of H.264), or when the level information indicates a specific level (e.g., a certain level or higher level), for example, the coding control unit 113 sets the predetermined restriction value (nLPSW, nLPSH) of the block size. The coding control unit 113 may be configured to set stepwise the restriction value of the block size according to the profile information and the level information.
It is supposed below that a variable RW is a motion vector accuracy in the horizontal direction, expressed by 1/RW-pel accuracy. It is also supposed that a variable RH is a motion vector accuracy in the vertical direction, expressed by 1/RH-pel accuracy. Initial values of the variable RN and the variable RH are defined as the motion vector accuracy of luminance. A value of a power of two is generally, used for RW and RH.
The prediction control unit 112 determines whether the chroma format information (chroma_format_idc) 114 is 1 or not (step S102). In the case of chroma_format_idc=1 (step S102: Yes), the prediction control unit 112 doubles the values of RW and RH (step S103). This is because chroma_format_idc=1 means 4:2:0 format in which the color difference is sampled at half horizontally and vertically with respect to luminance.
In the case where chroma_format_idc=1 is not established (step S102: No), the prediction control unit 112 determines whether the chroma format information (chroma_format_idc) 114 is 2 or not (step S104). In the case of chroma_format_idc=2 (step S104: Yes), the prediction control unit 112 doubles the value of RW (step S105). This is because chroma_format_idc=2 means 4:2:2 format in which the color difference is sampled at half only horizontally with respect to luminance.
When chroma_format_idc assumes other values (step S104: No), the values of RW and RH are not changed.
Next, the prediction control unit 112 calculates a variable L indicating whether the memory bandwidth is restricted or not (step S106). The variable L assuming “true” means that the method of reducing the memory bandwidth is applied, and the variable IL assuming “false” means that the method is not applied.
When the prediction is the bi-directional prediction, the prediction block is small, and two motion vectors are fractional accuracy in the color difference, as described above for example, the memory bandwidth to be accessed per pixel increases. Therefore, the prediction control unit 112 calculates the variable L according to the following equation (1).
L=(PredMode==PredBi)&&
(nPSW≤nLPSW)&&(nPSH≤nIPSH)&&
(mvL0[0]&(RW−1))&&
(mvL0[1]&(RH−1))&&
(mvL1[0]&(RW−1))&&
(mvL1[1]&(RH−1)); (1)
The value of the motion vector in the horizontal direction in the list 0 of the block to be processed is defined as mvL0 [0], and the value in the vertical direction is defined as mvL0[1]. The value of the motion vector in the horizontal direction in the list 1 is defined as mvL1[0], and the value in the vertical direction is defined as mvL1[1]. PredMode indicates the prediction mode. PredBi Indicates the bi-directional prediction. In the description below, the prediction modes of the uni-directional prediction using the motion vectors in the list 0 and in the list 1 are represented as PredL0 and PredL1, respectively.
An example of the equation (1) means a case in which the prediction mode PredMode is Predbi, i.e., the bi-directional prediction unit 202 is selected (nPSW≤nLPSW) &&(nPSH≤nLPSH)&& means the condition in which the prediction block size is equal to or smaller than the block size restriction information. In (mvL0[0]&(RW−1))&&, (mvL0[1]&(RH−1))&&, (mvL1[0]&(RW−1))&&, and (mvL1[1]&(RH−1)), it is checked whether the two motion vectors L0 and L1 are not subjected to the two-dimensional interpolation for the color difference, i.e., whether the lower bit of the motion vector expresses the accuracy after the decimal point. “&” means a bit operator according to the notation in the C language, and expresses bitwise OR.
The conditional equation for calculating the variable L is not limited to the equation (1). For example, it may independently be determined even for the prediction modes (PredL0, PredL1) other than Predbi as in an equation (2).
L=(nPSW≤nLPSW)&&(nPSH≤nLPSH)&&
((PredMode==PredBi)&&
(mvL0[0]&(RW−1))&&
(mvL0[1]&(RH−1))&&
(mvL1[0]&(RW−1))&&
(mvL1[1]&(RH−1))∥
((PredMode==PredL0)&&
(mvL0[0]&(RW−1))&&
(mvL0[1]&(RH−1))∥
((PredMode==PredL1)&&
(mvL1[0]&(RH−1))&&
(mvL1[1]&(RH−1))))); (2)
As in an equation (3), the restriction value (nLPSW1, nLPSH1) of the block size for the uni-directional prediction (PredL0 or PredL1) may separately be set. Specifically, the block size restricted in the uni-directional prediction and the block size restricted in the bi-directional prediction may be different from each other.
L=((PredMode==PredBi)&&
(nPSW≤nLPSW)&&(nPSH≤nLPSH)&&
(mvL0[0]&(RW−1))&&
(mvL0[1]&(RH−1))&&
(mvL1[0]&(RW−1))&&
(mvL1[1]&(RH−1))∥
(((nPSW≤nLPSW1)&&
(nPSH≤nLPSH1))∥
((PredMode==PredL0)&&
(mvL0[0]&(RW−1))&&
(mvL0[1]&(RH−1))&&
((PredMode==PredL1)&&
(mvL1[0]&(RW−1))&&
(mvL1[1]&(RH−1))); (3)
When the prediction block size is equal to or smaller than the restriction value (nLPSW, nLPSH) of the block size as in an equation (4), two motion vectors may be restricted to access only to the integer pixel in the color difference during the bi-directional prediction.
L=((PredMode==PredB)&&
(nPSW≤nLPSW)&&(nPSH≤nLPSH)&&
!((mvL0[0]&(RW−1)==0)&&
(mvL0[1]&(RH−1)==0)&&
(mvL1[0]&(RW−1)==0)&&
(mvL1[1]&(RH−1)==0))); (4)
Whether the value of the motion vector restricted, or under what condition the value of the motion vector is restricted is distinguished by the profile/level information 119.
Next, the specific method of reducing the memory bandwidth will be described.
The prediction control unit 112 determines whether the variable L is “true” or not (step S201). If the variable L is “true” (step S201: Yes), the prediction control unit 112 transforms the values L0 and L1 of two motion vectors as in an equation (5) (step S202).
mvL0[0]=((mvL0[0]+(RW>>1))/RW)×RW;
mvL0[1]=((mvL0[1]+(RH>>1))/RH)×RH;
mvL1[0]=((mvL1[0]+(RW>>1))/RW)×RW;
mvL1[1]=((mvL1[1]+(RH>>1))/RH)×RH; (5)
“>>” indicates an arithmetic right shift according to the notation in the C language. “/” indicates a division in integer arithmetic. “×” indicates a multiplication in integer arithmetic. The bit corresponding to the interpolation accuracy of the color difference signal of two motion vectors L0 and L1 are rounded by the equation (5) to become 0. With this process, the two-dimensional interpolation is not executed, whereby the reduction in the memory bandwidth can be achieved.
The general rounding method is described here. However, the other method may be used. For example, rounding down method, rounding up method, and a method of rounding to the nearest even number may be employed.
The motion vector information 117 whose value is changed is coded in the entropy coding unit 105, and output as the coded data. The method in
Alternatively, instead of coding the motion vector information. 117 whose value is changed in the entropy coding unit 105, the motion vector information 117 before the change may be coded by the entropy coding unit. In this case, the predicted image generating unit 110 in the image decoding apparatus 300 determines whether the method of reducing the memory bandwidth is applied or not in the process same as that in
The method of transforming the value of the motion vector is not limited to the method of rounding the value corresponding to the interpolation accuracy of the color difference as in the equation (4). The value may be rounded separately for the luminance and the color difference. Specifically, during the interpolation for the luminance, the value corresponding to the interpolation accuracy of the luminance may be rounded, while the value corresponding to the interpolation accuracy of the color difference may be rounded during the interpolation processing for the color difference. This method is for not generating the predicted image that increases the memory bandwidth, when the image coding apparatus 100 and the image decoding apparatus 300 are configured in advance in a manner to execute the same operation.
In this example, the prediction control unit 112 and the predicted image generating unit 110 calculate cost for select ng the prediction mode, the predicted block size, and the motion vector. They preferentially select the prediction mode, the predicted block size, and the motion vector, which are small in cost, whereby the optimum combination can be selected.
A variable MV_Cost indicating the cost for the motion vector is calculated by using a sum of absolute distance (SAD) of predicted residual errors, a code amount of the motion vector information (MV_Code), and a Lagrange multiplier (λ) calculated from the quantized information as in an equation (6).
MV_Cost=SAD+λ×MV_Code (6)
If the variable L is “true” (step S301: Yes), the prediction control unit 112 substitutes the predetermined maximum value MaxValue into the variable MV_Cost indicating the cost for the motion vector (step S302). With this process, the prediction control unit 112 controls not to select the motion vector having the large memory bandwidth (step S301).
In the method in
If the variable L is “true” (step 3401), only the prediction mode PredMode of color is forcibly rewritten to the uni-directional prediction PredL0 (step S402). With this process, the case of the bi-directional prediction with the color difference signal using large memory bandwidth can be restricted.
The prediction mode in which the prediction mode is forcibly rewritten may be the uni-directional prediction PredL1. What prediction mode is restricted is determined according to the profile level information 119.
As described above, according to the present embodiment, the memory bandwidth upon generating the motion-compensated interpolation image during the image coding and image decoding can be reduced.
Next, a hardware configuration of the apparatus (the image coding apparatus, and the image decoding apparatus) according to the present embodiment will be described with reference to
The hardware configuration shown in
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is a continuation of U.S. application Ser. No. 16/659,221, filed on Oct. 21, 2019, which is a continuation of U.S. application Ser. No. 15/688,541 (now U.S. Pat. No. 10,554,991), filed on Aug. 28, 2017, which is a continuation of U.S. application. Ser. No. 15/449,394 (now U.S. Pat. No. 9,843,818), filed on Mar. 3, 2017, which is a continuation of U.S. application Ser. No. 14/693,629 (now U.S. Pat. No. 9,672,633), filed on Apr. 22, 2015, which is a continuation of U.S. application Ser. No. 14/026,465 (now U.S. Pat. No. 9,135,717), filed on Sep. 13, 2013, which is a continuation of PCT international application serial no. PCT/JP2011/075725, filed on Nov. 8, 2011 which designates the United. States. The entire contents of each of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 16659221 | Oct 2019 | US |
Child | 16866310 | US | |
Parent | 15688541 | Aug 2017 | US |
Child | 16659221 | US | |
Parent | 15449394 | Mar 2017 | US |
Child | 15688541 | US | |
Parent | 14693629 | Apr 2015 | US |
Child | 15449394 | US | |
Parent | 14026465 | Sep 2013 | US |
Child | 14693629 | US | |
Parent | PCT/JP2011/075725 | Nov 2011 | US |
Child | 14026465 | US |