Patent ID: 8213505

Claim:
An encoding apparatus for generating, in an intra prediction mode, difference data by subtracting prediction values from input image data, and performing encoding processing on the input image data by processing the difference data, the apparatus comprising: a first prediction mode detecting unit configured to identify a first prediction mode from a plurality of candidate first prediction modes, based on at least first cost values associated with the candidate first prediction modes, the first prediction mode being suitable for the encoding processing in a first prediction value generation unit; a second prediction mode detecting unit configured to detect a second prediction mode from a plurality of candidate second prediction modes, based on at least second cost values associated with the candidate second prediction modes, the second prediction mode being suitable for encoding processing in a second prediction value generation unit; and a prediction value generating unit configured to: select one of the first or second prediction modes as a prediction mode of the encoding processing; and generate the prediction value based on the selected prediction mode, wherein: the first prediction mode detecting unit is further configured to identify the first prediction mode by utilizing processing in the second prediction mode detecting unit; the apparatus further comprises a first cost value calculating unit, the first cost value calculating unit being configured to calculate the first cost values, and the first cost values being indicative of an amount of occurring codes for the candidate first prediction modes; and the first cost value calculating unit is further configured to calculate the first cost values by aggregating averages of the second cost values corresponding to one or more prediction directions of the candidate second prediction modes that fail to be associated with the candidate first prediction modes.