在先前的研究中[3],利用後一張預測畫面中相同位置與鄰近巨區塊來取得移動向量資訊,藉此改善原始H.264/AVC中時間域直接模式無法描述所有物件的移動情形。但此做法會因為遮蔽效應(occlusion)、物件移動動量大小(motion activity)以及視訊移動特性的關係而導致增進的效能有限。因此在本篇論文中,我們以邊界匹配演算法[5]來改善因遮蔽效應而選擇到不正確方向的巨區塊之問題。接著提出巨區塊位移演算法,以改善物件移動動量大小。之後我們結合空間域直接模式來克服視訊移動特性之影響。上述演算法皆屬於後置處理(sum of absolute prediction difference, SAPD),因預測畫面沒有與原始畫面做比較,所以預測畫面較不準確,為了得到更好的編碼性能,我們將前置處理移動向量估測演算法(Sum of Absolute Difference, SAD)與上述的演算法以RDO的方式做結合。由實驗結果得知,我們提出的演算法應用在H.264/AVC可以達到不錯的編碼性能(平均4.034%的位元率增益),因此我們將此概念應用於HEVC的直接模式,同樣可以由實驗結果發現,應用於HEVC可以達到平均1.187%的位元率增益。In previous work [3], we employed the co-located block and its neighboring blocks to improve the temporal DIRECT mode in H.264/AVC. However, occlusion effect, variation of motion activity and video characteristic will limit the improvement. In this work, to overcome the occlusion effect and variation of motion activity, we apply the boundary matching criterion and propose shifted macroblock algorithm; for the variation of video characteristic, we apply spatial DIRECT mode into our proposed algorithm and make use of rate distortion optimization (RDO) to achieve the better performance. The experimental results show that our proposed algorithm can save 4.034% BD bit-rate on average. In additional, we apply this concept into MERGE mode of high efficiency video coding (HEVC). Likewise, the experimental results reveal that the proposed algorithm also achieve good coding performance (1.178% BD bit-rate saving).