To allow second-order prediction even when adjacent pixels adjacent to a reference block are outside an image frame.
A reference adjacent pixel decision unit 83 receives as input from a reference adjacency determination unit 77 a determination as to whether or not reference adjacent pixels are located within the reference frame. If the reference adjacent pixels are located inside the reference frame, the reference adjacent pixel decision unit 83 decides pixel values for adjacent pixels on the basis of the definition of H.264/AVC. Meanwhile if the reference adjacent pixels are not located inside the reference frame, the reference adjacent pixel decision unit 83 performs edge-pixel processing for the adjacent pixels, and decides the pixel values for the reference adjacent pixels. This method is applied for example to an image encoding device that encodes according to H.264/AVC.
Takashi Nishikawa