CPC H04N 19/16 (2014.11) [H04N 19/11 (2014.11); H04N 19/176 (2014.11); H04N 19/197 (2014.11); H04N 19/463 (2014.11); H04N 19/593 (2014.11)] | 3 Claims |
1. A non-transitory computer-readable medium storing thereon a computer program for decoding, on a block-by-block basis, image data included in a coded stream, the computer program executed by the processor, causes the processor to perform operations including:
selecting candidates for an intra prediction mode to be used for intra prediction for a decoding target block from a plurality of predetermined intra prediction modes, each of the plurality of predetermined intra prediction modes having a mode number;
deriving the selected candidates, the number of the candidates constantly being a predetermined fixed plural number, the predetermined fixed plural number being at least 2 and less than a number of the plurality of predetermined intra prediction modes;
making a candidates list which includes indices and the derived candidates, the derived candidates corresponding on a one-to-one basis with the indices, and a number of the indices being equal to the predetermined fixed plural number;
obtaining a coded flag which indicating whether the intra prediction mode is inferred from a neighboring block or not;
decoding the coded flag to obtain a decoded flag;
when the decoded flag indicates that the intra prediction mode is inferred from the neighboring block,
(i) obtaining, from the coded stream, a coded specified index which specifies an index of one of the derived candidates as the intra prediction mode to be used for intra prediction for the decoding target block,
(ii) decoding the coded specified index to obtain a decoded specified index,
(iii) determining the one of the derived candidates using the decoded specified index, the index of the one of the derived candidates being specified by the decoded specified index in the candidates list, and
(iv) decoding the image data using the determined one of the derived candidates; and
when the decoded flag indicates that the intra prediction mode is not inferred from the neighboring block,
(i) obtaining a coded specified mode number from the coded stream,
(ii) decoding the coded specified mode number to obtain a decoded specified mode number, and
(iii) comparing the mode number of one of the derived candidates with the decoded specified mode number,
when the mode number of the one of the derived candidates is larger than the decoded specified mode number, determining the one of the derived candidates as the intra prediction mode to be used for intra prediction for the decoding target block, and decoding the image data using the determined one of the derived candidates, and
when the mode number of the one of the derived candidates is smaller than or equal to the decoded specified mode number, adding one to the decoded specified mode number, and decoding the image data using one of the plurality of predetermined intra prediction modes which is specified by the number obtained by adding one to the decoded specified mode number,
wherein the deriving includes:
deriving a first candidate for the intra prediction mode to be used for intra prediction for the decoding target block from an intra prediction mode used for intra prediction for each of adjacent blocks that are adjacent to the decoding target block; and
in a case that the number of the derived first candidates is smaller than the predetermined fixed plural number, further deriving a second candidate as a DC prediction mode to be used for intra prediction and a third candidate as a vertical (angular) prediction mode to be used for intra prediction.
|