Need to use decoded image as reference image, not original. Why?
The whole point of a p frame is to encode the difference from the previous frame so that it can be recreated during the decoding process. Encoding is lossy and introduces artifacts, so in order to reconstruct the frame accurately during decoding you must use only information that the decoder will actually have available - namely, the decided version of the previous frame. If you use the original frame, then the differences encoded in the p frame will not reconstruct the frame correctly.