Patent ID: 9602837
Date: 2017-03-21
CPC Classifications: H04N

Claim:
1. An image coding method for coding an image per block included in the image, the image coding method comprising: calculating an integer slope indicating an integer value of a slope, based on at least one of a horizontal gradient and a vertical gradient, the calculating being performed using a processor; determining, for each of pixel positions within a current block to be coded, a sub-pel position that is an intersection between a line having the integer slope and passing through the pixel position within the current block and a boundary of a block adjacent to the current block, the determining being performed using the processor; generating a predicted block by predicting, for each of the pixel positions within the current block, a pixel value at the pixel position, based on a pixel value interpolated in the sub-pel position determined for the pixel position, the generating being performed using the processor; and coding the current block by subtracting the predicted block from the current block, the coding being performed using the processor, wherein when the integer slope is calculated, a result of a division is obtained with reference to a division table stored in a memory, and the integer slope is calculated using the obtained result of the division, the division using, as a divisor, a value indicating the one of the horizontal gradient and the vertical gradient, the division table indicating, for each predetermined value, a result of a division of a value scaled by a c-th power of 2, using the predetermined value as a divisor, where c is a positive integer, and when the pixel value is predicted, the pixel value interpolated in the sub-pel position is calculated by multiplying the integer slope generated by scaling by a coordinate value horizontal or vertical to a pixel position to be predicted within the current block, and shifting the multiplied integer slope right by c bits.