shithub: libvpx

Download patch

ref: 89dcc139397ca2a0982cc40fa7067ff1903a688d
parent: aeea00cc4fb4fd4a9a407d06bfe9b27cbfb38cbe
author: Scott LaVarnway <slavarnway@google.com>
date: Thu Aug 13 08:57:01 EDT 2015

VPX: removed filter == 128 checks from mips convolve code

The check is handled by the predictor table.

Change-Id: I2fe52bfbbfccb2edd13ba250986e3a4b4b589459

--- a/vpx_dsp/mips/convolve8_avg_dspr2.c
+++ b/vpx_dsp/mips/convolve8_avg_dspr2.c
@@ -348,13 +348,9 @@
                                   const int16_t *filter_y, int y_step_q4,
                                   int w, int h) {
   assert(y_step_q4 == 16);
-  if (((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_avg(src, src_stride,
-                     dst, dst_stride,
-                     filter_x, x_step_q4,
-                     filter_y, y_step_q4,
-                     w, h);
-  } else if (((const int32_t *)filter_y)[0] == 0) {
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
+
+  if (((const int32_t *)filter_y)[0] == 0) {
     vpx_convolve2_avg_vert_dspr2(src, src_stride,
                                  dst, dst_stride,
                                  filter_x, x_step_q4,
--- a/vpx_dsp/mips/convolve8_avg_horiz_dspr2.c
+++ b/vpx_dsp/mips/convolve8_avg_horiz_dspr2.c
@@ -958,13 +958,9 @@
                                    const int16_t *filter_y, int y_step_q4,
                                    int w, int h) {
   assert(x_step_q4 == 16);
-  if (((const int32_t *)filter_x)[1] == 0x800000) {
-    vpx_convolve_avg(src, src_stride,
-                     dst, dst_stride,
-                     filter_x, x_step_q4,
-                     filter_y, y_step_q4,
-                     w, h);
-  } else if (((const int32_t *)filter_x)[0] == 0) {
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
+
+  if (((const int32_t *)filter_x)[0] == 0) {
     vpx_convolve2_avg_horiz_dspr2(src, src_stride,
                                   dst, dst_stride,
                                   filter_x, x_step_q4,
--- a/vpx_dsp/mips/convolve8_dspr2.c
+++ b/vpx_dsp/mips/convolve8_dspr2.c
@@ -938,7 +938,10 @@
 
   assert(x_step_q4 == 16);
   assert(y_step_q4 == 16);
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
 
+
   /* bit positon for extract from acc */
   __asm__ __volatile__ (
     "wrdsp      %[pos],     1           \n\t"
@@ -948,14 +951,6 @@
 
   if (intermediate_height < h)
     intermediate_height = h;
-
-  if ((((const int32_t *)filter_x)[1] == 0x800000)
-      && (((const int32_t *)filter_y)[1] == 0x800000))
-    return vpx_convolve_copy(src, src_stride,
-                             dst, dst_stride,
-                             filter_x, x_step_q4,
-                             filter_y, y_step_q4,
-                             w, h);
 
   /* copy the src to dst */
   if (filter_x[3] == 0x80) {
--- a/vpx_dsp/mips/convolve8_horiz_dspr2.c
+++ b/vpx_dsp/mips/convolve8_horiz_dspr2.c
@@ -842,13 +842,9 @@
                                const int16_t *filter_y, int y_step_q4,
                                int w, int h) {
   assert(x_step_q4 == 16);
-  if (((const int32_t *)filter_x)[1] == 0x800000) {
-    vpx_convolve_copy(src, src_stride,
-                      dst, dst_stride,
-                      filter_x, x_step_q4,
-                      filter_y, y_step_q4,
-                      w, h);
-  } else if (((const int32_t *)filter_x)[0] == 0) {
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
+
+  if (((const int32_t *)filter_x)[0] == 0) {
     vpx_convolve2_horiz_dspr2(src, src_stride,
                               dst, dst_stride,
                               filter_x, x_step_q4,
--- a/vpx_dsp/mips/convolve8_vert_dspr2.c
+++ b/vpx_dsp/mips/convolve8_vert_dspr2.c
@@ -334,13 +334,9 @@
                               const int16_t *filter_y, int y_step_q4,
                               int w, int h) {
   assert(y_step_q4 == 16);
-  if (((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_copy(src, src_stride,
-                      dst, dst_stride,
-                      filter_x, x_step_q4,
-                      filter_y, y_step_q4,
-                      w, h);
-  } else if (((const int32_t *)filter_y)[0] == 0) {
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
+
+  if (((const int32_t *)filter_y)[0] == 0) {
     vpx_convolve2_vert_dspr2(src, src_stride,
                              dst, dst_stride,
                              filter_x, x_step_q4,
--- a/vpx_dsp/mips/vpx_convolve8_avg_horiz_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_avg_horiz_msa.c
@@ -667,13 +667,7 @@
   int8_t cnt, filt_hor[8];
 
   assert(x_step_q4 == 16);
-
-  if (((const int32_t *)filter_x)[1] == 0x800000) {
-    vpx_convolve_avg(src, src_stride, dst, dst_stride,
-                     filter_x, x_step_q4, filter_y, y_step_q4,
-                     w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
 
   for (cnt = 0; cnt < 8; ++cnt) {
     filt_hor[cnt] = filter_x[cnt];
--- a/vpx_dsp/mips/vpx_convolve8_avg_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_avg_msa.c
@@ -577,14 +577,8 @@
 
   assert(x_step_q4 == 16);
   assert(y_step_q4 == 16);
-
-  if (((const int32_t *)filter_x)[1] == 0x800000 &&
-      ((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_avg(src, src_stride, dst, dst_stride,
-                     filter_x, x_step_q4, filter_y, y_step_q4,
-                     w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
 
   for (cnt = 0; cnt < 8; ++cnt) {
     filt_hor[cnt] = filter_x[cnt];
--- a/vpx_dsp/mips/vpx_convolve8_avg_vert_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_avg_vert_msa.c
@@ -641,13 +641,7 @@
   int8_t cnt, filt_ver[8];
 
   assert(y_step_q4 == 16);
-
-  if (((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_avg(src, src_stride, dst, dst_stride,
-                     filter_x, x_step_q4, filter_y, y_step_q4,
-                     w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
 
   for (cnt = 0; cnt < 8; ++cnt) {
     filt_ver[cnt] = filter_y[cnt];
--- a/vpx_dsp/mips/vpx_convolve8_horiz_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_horiz_msa.c
@@ -627,13 +627,7 @@
   int8_t cnt, filt_hor[8];
 
   assert(x_step_q4 == 16);
-
-  if (((const int32_t *)filter_x)[1] == 0x800000) {
-    vpx_convolve_copy(src, src_stride, dst, dst_stride,
-                      filter_x, x_step_q4, filter_y, y_step_q4,
-                      w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
 
   for (cnt = 0; cnt < 8; ++cnt) {
     filt_hor[cnt] = filter_x[cnt];
--- a/vpx_dsp/mips/vpx_convolve8_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_msa.c
@@ -551,14 +551,8 @@
 
   assert(x_step_q4 == 16);
   assert(y_step_q4 == 16);
-
-  if (((const int32_t *)filter_x)[1] == 0x800000 &&
-      ((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_copy(src, src_stride, dst, dst_stride,
-                      filter_x, x_step_q4, filter_y, y_step_q4,
-                      w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_x)[1] != 0x800000);
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
 
   for (cnt = 0; cnt < 8; ++cnt) {
     filt_hor[cnt] = filter_x[cnt];
--- a/vpx_dsp/mips/vpx_convolve8_vert_msa.c
+++ b/vpx_dsp/mips/vpx_convolve8_vert_msa.c
@@ -634,13 +634,7 @@
   int8_t cnt, filt_ver[8];
 
   assert(y_step_q4 == 16);
-
-  if (((const int32_t *)filter_y)[1] == 0x800000) {
-    vpx_convolve_copy(src, src_stride, dst, dst_stride,
-                      filter_x, x_step_q4, filter_y, y_step_q4,
-                      w, h);
-    return;
-  }
+  assert(((const int32_t *)filter_y)[1] != 0x800000);
 
   for (cnt = 8; cnt--;) {
     filt_ver[cnt] = filter_y[cnt];