shithub: libvpx

Download patch

ref: c983c966cbed4919d008c7fc168292af75593bcd
parent: 8d3ef287a254104b91341f9a34a194d349881494
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Oct 8 07:27:56 EDT 2013

Removing inv_txm4x4_1_add and inv_txm4x4_add function pointers.

We already have itxm_add member in MACROBLOCKD structure. Both
inv_txm4x4_1_add and inv_txm4x4_add are just its special cases for
different eob values. But eob logic is already implemented in
vp9_iwht4x4_add and vp9_idct4x4_add (that's why also removing
inverse_transform_b_4x4_add).

Change-Id: I80bec9b6f7d40c5e5033c613faca5c819c3e6326

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -221,8 +221,6 @@
 
   int lossless;
   /* Inverse transform function pointers. */
-  void (*inv_txm4x4_1_add)(int16_t *input, uint8_t *dest, int stride);
-  void (*inv_txm4x4_add)(int16_t *input, uint8_t *dest, int stride);
   void (*itxm_add)(int16_t *input, uint8_t *dest, int stride, int eob);
 
   struct subpix_fn_table  subpix;
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -22,6 +22,7 @@
 #include "vp9/common/vp9_entropymode.h"
 #include "vp9/common/vp9_extend.h"
 #include "vp9/common/vp9_findnearmv.h"
+#include "vp9/common/vp9_idct.h"
 #include "vp9/common/vp9_mvref_common.h"
 #include "vp9/common/vp9_pred_common.h"
 #include "vp9/common/vp9_quant_common.h"
@@ -1866,8 +1867,7 @@
     // printf("Switching to lossless\n");
     cpi->mb.fwd_txm8x4 = vp9_short_walsh8x4;
     cpi->mb.fwd_txm4x4 = vp9_short_walsh4x4;
-    cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_iwht4x4_1_add;
-    cpi->mb.e_mbd.inv_txm4x4_add = vp9_iwht4x4_16_add;
+    cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add;
     cpi->mb.optimize = 0;
     cpi->common.lf.filter_level = 0;
     cpi->zbin_mode_boost_enabled = 0;
@@ -1876,8 +1876,7 @@
     // printf("Not lossless\n");
     cpi->mb.fwd_txm8x4 = vp9_short_fdct8x4;
     cpi->mb.fwd_txm4x4 = vp9_short_fdct4x4;
-    cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_idct4x4_1_add;
-    cpi->mb.e_mbd.inv_txm4x4_add = vp9_idct4x4_16_add;
+    cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add;
   }
 }
 
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -40,15 +40,6 @@
   }
 }
 
-static void inverse_transform_b_4x4_add(MACROBLOCKD *xd, int eob,
-                                        int16_t *dqcoeff, uint8_t *dest,
-                                        int stride) {
-  if (eob <= 1)
-    xd->inv_txm4x4_1_add(dqcoeff, dest, stride);
-  else
-    xd->inv_txm4x4_add(dqcoeff, dest, stride);
-}
-
 static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
   struct macroblock_plane *const p = &x->plane[plane];
   const MACROBLOCKD *const xd = &x->e_mbd;
@@ -463,8 +454,7 @@
       // this is like vp9_short_idct4x4 but has a special case around eob<=1
       // which is significant (not just an optimization) for the lossless
       // case.
-      inverse_transform_b_4x4_add(xd, pd->eobs[block], dqcoeff,
-                                  dst, pd->dst.stride);
+      xd->itxm_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
       break;
     default:
       assert(!"Invalid transform size");
@@ -631,7 +621,7 @@
           // this is like vp9_short_idct4x4 but has a special case around eob<=1
           // which is significant (not just an optimization) for the lossless
           // case.
-          inverse_transform_b_4x4_add(xd, *eob, dqcoeff, dst, pd->dst.stride);
+          xd->itxm_add(dqcoeff, dst, pd->dst.stride, *eob);
         else
           vp9_short_iht4x4_add(dqcoeff, dst, pd->dst.stride, tx_type);
       }
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -17,6 +17,7 @@
 
 #include "vp9/common/vp9_alloccommon.h"
 #include "vp9/common/vp9_filter.h"
+#include "vp9/common/vp9_idct.h"
 #if CONFIG_VP9_POSTPROC
 #include "vp9/common/vp9_postproc.h"
 #endif
@@ -1245,14 +1246,8 @@
   cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
 
   cpi->oxcf.lossless = oxcf->lossless;
-  if (cpi->oxcf.lossless) {
-    cpi->mb.e_mbd.inv_txm4x4_1_add    = vp9_iwht4x4_1_add;
-    cpi->mb.e_mbd.inv_txm4x4_add      = vp9_iwht4x4_16_add;
-  } else {
-    cpi->mb.e_mbd.inv_txm4x4_1_add    = vp9_idct4x4_1_add;
-    cpi->mb.e_mbd.inv_txm4x4_add      = vp9_idct4x4_16_add;
-  }
-
+  cpi->mb.e_mbd.itxm_add = cpi->oxcf.lossless ? vp9_iwht4x4_add
+                                              : vp9_idct4x4_add;
   cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL;
 
   cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1100,8 +1100,8 @@
           vp9_short_iht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block),
                                dst, pd->dst.stride, tx_type);
         else
-          xd->inv_txm4x4_add(BLOCK_OFFSET(pd->dqcoeff, block),
-                             dst, pd->dst.stride);
+          xd->itxm_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, pd->dst.stride,
+                       16);
       }
     }