shithub: libvpx

Download patch

ref: cf8b5a09ed2189f776eb3e137691b70481db6506
parent: 776c1482a302f5ea42dfe4517f51c0f1e48f2670
author: Jingning Han <jingning@google.com>
date: Tue May 7 06:45:31 EDT 2013

Add building blocks for partition down to 4x4

Macro ab4x4 contains experiments for recursive partition down to
4x4 block size.

Change-Id: Ic727842fa98a4df9fd51e0025a545dc76a5c76c1

--- a/configure
+++ b/configure
@@ -250,6 +250,7 @@
     multiple_arf
     code_zerogroup
     non420
+    ab4x4
 "
 CONFIG_LIST="
     external_build
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -192,7 +192,13 @@
 
 static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) {
   switch (sb_type) {
+#if CONFIG_AB4X4
+    case BLOCK_SIZE_SB4X8:
+#endif
     case BLOCK_SIZE_AB4X4: return 0;
+#if CONFIG_AB4X4
+    case BLOCK_SIZE_SB8X4:
+#endif
     case BLOCK_SIZE_SB8X8:
     case BLOCK_SIZE_SB8X16: return 1;
     case BLOCK_SIZE_SB16X8:
@@ -209,7 +215,13 @@
 
 static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
   switch (sb_type) {
+#if CONFIG_AB4X4
+    case BLOCK_SIZE_SB8X4:
+#endif
     case BLOCK_SIZE_AB4X4: return 0;
+#if CONFIG_AB4X4
+    case BLOCK_SIZE_SB4X8:
+#endif
     case BLOCK_SIZE_SB8X8:
     case BLOCK_SIZE_SB16X8: return 1;
     case BLOCK_SIZE_SB8X16:
--- a/vp9/common/vp9_enums.h
+++ b/vp9/common/vp9_enums.h
@@ -20,6 +20,10 @@
 
 typedef enum BLOCK_SIZE_TYPE {
   BLOCK_SIZE_AB4X4,
+#if CONFIG_AB4X4
+  BLOCK_SIZE_SB4X8,
+  BLOCK_SIZE_SB8X4,
+#endif
   BLOCK_SIZE_SB8X8,
   BLOCK_SIZE_SB8X16,
   BLOCK_SIZE_SB16X8,
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2229,7 +2229,6 @@
 
 
   if (pred_exists) {
-    // FIXME(rbultje): mb code still predicts into xd->predictor
     for (i = 0; i < bh * MI_SIZE; ++i)
       vpx_memcpy(xd->plane[0].dst.buf + i * xd->plane[0].dst.stride,
                  tmp_ybuf + i * bw * MI_SIZE,
@@ -2264,17 +2263,11 @@
     if (threshold < x->encode_breakout)
       threshold = x->encode_breakout;
 
-    if (bsize != BLOCK_SIZE_MB16X16) {
-      var = cpi->fn_ptr[block_size].vf(x->plane[0].src.buf,
-                                       x->plane[0].src.stride,
-                                       xd->plane[0].dst.buf,
-                                       xd->plane[0].dst.stride,
-                                       &sse);
-    } else {
-      var = vp9_variance16x16(x->plane[0].src.buf, x->plane[0].src.stride,
-                              xd->plane[0].dst.buf, xd->plane[0].dst.stride,
-                              &sse);
-    }
+    var = cpi->fn_ptr[block_size].vf(x->plane[0].src.buf,
+                                     x->plane[0].src.stride,
+                                     xd->plane[0].dst.buf,
+                                     xd->plane[0].dst.stride,
+                                     &sse);
 
     if ((int)sse < threshold) {
       unsigned int q2dc = xd->plane[0].dequant[0];
@@ -2284,30 +2277,17 @@
           (sse / 2 > var && sse - var < 64)) {
         // Check u and v to make sure skip is ok
         int sse2;
+        unsigned int sse2u, sse2v;
+        var = cpi->fn_ptr[uv_block_size].vf(x->plane[1].src.buf,
+                                            x->plane[1].src.stride,
+                                            xd->plane[1].dst.buf,
+                                            xd->plane[1].dst.stride, &sse2u);
+        var = cpi->fn_ptr[uv_block_size].vf(x->plane[2].src.buf,
+                                            x->plane[1].src.stride,
+                                            xd->plane[2].dst.buf,
+                                            xd->plane[1].dst.stride, &sse2v);
+        sse2 = sse2u + sse2v;
 
-        if (bsize != BLOCK_SIZE_MB16X16) {
-          unsigned int sse2u, sse2v;
-          // FIXME(rbultje): mb predictors predict into xd->predictor
-          var = cpi->fn_ptr[uv_block_size].vf(x->plane[1].src.buf,
-                                              x->plane[1].src.stride,
-                                              xd->plane[1].dst.buf,
-                                              xd->plane[1].dst.stride, &sse2u);
-          var = cpi->fn_ptr[uv_block_size].vf(x->plane[2].src.buf,
-                                              x->plane[1].src.stride,
-                                              xd->plane[2].dst.buf,
-                                              xd->plane[1].dst.stride, &sse2v);
-          sse2 = sse2u + sse2v;
-        } else {
-          unsigned int sse2u, sse2v;
-          var = vp9_variance8x8(x->plane[1].src.buf, x->plane[1].src.stride,
-                                xd->plane[1].dst.buf, xd->plane[1].dst.stride,
-                                &sse2u);
-          var = vp9_variance8x8(x->plane[2].src.buf, x->plane[1].src.stride,
-                                xd->plane[2].dst.buf, xd->plane[1].dst.stride,
-                                &sse2v);
-          sse2 = sse2u + sse2v;
-        }
-
         if (sse2 * 2 < threshold) {
           x->skip = 1;
           *distortion = sse + sse2;
@@ -2622,14 +2602,10 @@
     mbmi->interp_filter = cm->mcomp_filter_type;
     vp9_setup_interp_filters(xd, mbmi->interp_filter, &cpi->common);
 
-    // if (!(cpi->ref_frame_flags & flag_list[ref_frame]))
-    //  continue;
-
     if (bsize != BLOCK_SIZE_SB8X8 &&
         (this_mode == I4X4_PRED || this_mode == SPLITMV))
       continue;
-    //  if (vp9_mode_order[mode_index].second_ref_frame == INTRA_FRAME)
-    //  continue;
+
 
     if (comp_pred) {
       if (ref_frame == ALTREF_FRAME) {