+ /* don't do pskip motion compensation if it was already done in macroblock_analyse */
+ if( !h->mb.b_skip_mc )
+ {
+ int mvx = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][0],
+ h->mb.mv_min[0], h->mb.mv_max[0] );
+ int mvy = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][1],
+ h->mb.mv_min[1], h->mb.mv_max[1] );
+
+ for( int p = 0; p < plane_count; p++ )
+ h->mc.mc_luma( h->mb.pic.p_fdec[p], FDEC_STRIDE,
+ &h->mb.pic.p_fref[0][0][p*4], h->mb.pic.i_stride[p],
+ mvx, mvy, 16, 16, &h->sh.weight[0][p] );
+
+ if( chroma )
+ {
+ int v_shift = h->mb.chroma_v_shift;
+ int height = 16 >> v_shift;
+
+ /* Special case for mv0, which is (of course) very common in P-skip mode. */
+ if( mvx | mvy )
+ h->mc.mc_chroma( h->mb.pic.p_fdec[1], h->mb.pic.p_fdec[2], FDEC_STRIDE,
+ h->mb.pic.p_fref[0][0][4], h->mb.pic.i_stride[1],
+ mvx, 2*mvy>>v_shift, 8, height );
+ else
+ h->mc.load_deinterleave_chroma_fdec( h->mb.pic.p_fdec[1], h->mb.pic.p_fref[0][0][4],
+ h->mb.pic.i_stride[1], height );
+
+ if( h->sh.weight[0][1].weightfn )
+ h->sh.weight[0][1].weightfn[8>>2]( h->mb.pic.p_fdec[1], FDEC_STRIDE,
+ h->mb.pic.p_fdec[1], FDEC_STRIDE,
+ &h->sh.weight[0][1], height );
+ if( h->sh.weight[0][2].weightfn )
+ h->sh.weight[0][2].weightfn[8>>2]( h->mb.pic.p_fdec[2], FDEC_STRIDE,
+ h->mb.pic.p_fdec[2], FDEC_STRIDE,
+ &h->sh.weight[0][2], height );
+ }
+ }
+
+ x264_macroblock_encode_skip( h );