(Clip3(0, 8, y/nCbR?x+4)). On the other hand, the weight wValue in the case of
(Clip3(0, 8, nCbH?1?x/nCbR?y+4)):
(Clip3(0, 8, nCbW?1?y/nCbR?x+4)). Further, the motion compensation prediction units 306 and 406 calculate shift1=max(5, 17-bitDepth) offset1=1?(shift1?1) with respect to a bit number bitDepth. Then, a result pbSamples of the weighted averaging is calculated as pbSamples=Clip3(0, (1?bitDepth)?1,
(predSamplesLA*wValue+
predSamplesLB*(8-wValue)+offset1)?shift1). Here, predSamplesLA is a pixel value motion-compensated using a motion vector mvLA and predSamplesLB is a pixel value motion-compensated using mvLB.
Storage Process in the Coding Information Storage Memory
The inter prediction information obtained in the triangle merge mode is stored in the coding information storage memory so that the inter prediction information can be referred to as inter prediction information neighboring a target block when coding and decoding are performed. A storage process in the coding information storage memory is performed in 4×4 subblock units and the inter prediction information specified by the partitions is stored.
The specified inter prediction information is inter prediction information of a partition 0(UNI0) of unit-prediction and a partition 1(UNI1) of uni-prediction. A partition 2(BI) of bi-prediction is obtained by using the inter prediction information of UNI0 and UNI1.