An encoder includes circuitry and a memory connected to the circuitry. In operation, the circuitry: generates a plurality of predicted values of a pixel in a current picture to be encoded, using a plurality of reference pixels in the current picture, and enables or disables a process of determining a predicted value of the pixel on a block-by-block basis based on availability of at least one reference pixel among the plurality of reference pixels by filtering the plurality of predicted values based on a position of the pixel.