Determination is made as to whether the LX prediction of mergeCandList[i] is valid (step S1307 in FIG. 39). In a case where the LX prediction of mergeCandList[i] is valid, determination is made as to whether the LX prediction of mergeCandList[j] is valid (step S1308 in FIG. 39). In a case where the LX prediction of mergeCandList[j] is valid, that is, in a case where both the LX prediction of mergeCandList[i] and the LX prediction of mergeCandList[j] are valid, a motion vector of LX prediction obtained by averaging the motion vector of LX prediction of mergeCandList[i] and the motion vector of LX prediction of mergeCandList[j] will be derived, and an average merging candidate of LX prediction having a reference index of LX prediction of mergeCandList[i] will be derived, so as to be set as LX prediction of averageCand, and the LX prediction of averageCand will be validated (step S1309 in FIG. 39). In step S1308 of FIG. 39, in a case where LX prediction of mergeCandList[j] is not valid, that is, in a case where LX prediction of mergeCandList[i] is valid and LX prediction of mergeCandList[j] is invalid, a motion vector of LX prediction of mergeCandList[i] and an average merging candidate of LX prediction having a reference index will be derived, so as to be set as LX prediction of averageCand, and the LX prediction of averageCand will be validated (step S1310 in FIG. 39). In a case where the LX prediction of mergeCandList[i] is not valid in step S1307 of FIG. 39, determination is made as to whether the LX prediction of mergeCandList[j] is valid (step S1311 of FIG. 39). In a case where LX prediction of mergeCandList[j] is valid, that is, in a case where LX prediction of mergeCandList[i] is invalid and LX prediction of mergeCandList[j] is valid, a motion vector of LX prediction of mergeCandList[j] and an average merging candidate of LX prediction having a reference index will be derived, so as to be set as LX prediction of averageCand, and the LX prediction of averageCand will be validated (step S1312 in FIG. 39). In step S1311 of FIG. 39, in a case where LX prediction of mergeCandList [j] is not valid, that is, in a case where LX prediction of mergeCandList[i] and LX prediction of mergeCandList[j] are both invalid, LX prediction of averageCand will be invalidated. (step S1312 in FIG. 39).