Optimal Weighted 3D Prediction for Lossless Video Coding