Sub-8x8 Qpel-RD in P-frames
[x262.git] / encoder / cabac.c
index 111b82e..1786378 100644 (file)
@@ -1077,6 +1077,19 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
     }
 }
 
+static void x264_subpartition_size_cabac( x264_t *h, x264_cabac_t *cb, int i4, int i_pixel )
+{
+    int b_8x4 = i_pixel == PIXEL_8x4;
+    block_residual_write_cabac( h, cb, DCT_LUMA_4x4, i4, h->dct.luma4x4[i4], 16 );
+    if( i_pixel == PIXEL_4x4 )
+        x264_cabac_mb_mvd( h, cb, 0, i4, 1, 1 );
+    else
+    {
+        x264_cabac_mb_mvd( h, cb, 0, i4, 1+b_8x4, 2-b_8x4 );
+        block_residual_write_cabac( h, cb, DCT_LUMA_4x4, i4+2-b_8x4, h->dct.luma4x4[i4+2-b_8x4], 16 );
+    }
+}
+
 static void x264_partition_i8x8_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_mode )
 {
     const int i_pred = x264_mb_predict_intra4x4_mode( h, 4*i8 );