shithub: libvpx

Download patch

ref: f62805fae0e0dcf5a45ee51d73c416241e3af786
parent: e253eaa0361fd9cc8e8feca1d344acbf24ea1e21
author: Jingning Han <[email protected]>
date: Mon Jul 20 11:11:43 EDT 2015

Make local functions in vp9_dct.c static

This commit limits the scope of 1-D DCT and ADST functions within
vp9_dct.c and makes them static. This largely clears out the cross
referencing issue between vp9_dct.c and the SIMD optimizations.

Change-Id: If7cac478b11bb32328ccf70a9f60b709dad43d7f

--- a/vp9/encoder/vp9_dct.c
+++ b/vp9/encoder/vp9_dct.c
@@ -20,6 +20,34 @@
 #include "vp9/common/vp9_systemdependent.h"
 #include "vp9/encoder/vp9_dct.h"
 
+static void fdct4(const tran_low_t *input, tran_low_t *output);
+static void fadst4(const tran_low_t *input, tran_low_t *output);
+static void fdct8(const tran_low_t *input, tran_low_t *output);
+static void fadst8(const tran_low_t *input, tran_low_t *output);
+static void fdct16(const tran_low_t in[16], tran_low_t out[16]);
+static void fadst16(const tran_low_t *input, tran_low_t *output);
+
+static const transform_2d FHT_4[] = {
+  { fdct4,  fdct4  },  // DCT_DCT  = 0
+  { fadst4, fdct4  },  // ADST_DCT = 1
+  { fdct4,  fadst4 },  // DCT_ADST = 2
+  { fadst4, fadst4 }   // ADST_ADST = 3
+};
+
+static const transform_2d FHT_8[] = {
+  { fdct8,  fdct8  },  // DCT_DCT  = 0
+  { fadst8, fdct8  },  // ADST_DCT = 1
+  { fdct8,  fadst8 },  // DCT_ADST = 2
+  { fadst8, fadst8 }   // ADST_ADST = 3
+};
+
+static const transform_2d FHT_16[] = {
+  { fdct16,  fdct16  },  // DCT_DCT  = 0
+  { fadst16, fdct16  },  // ADST_DCT = 1
+  { fdct16,  fadst16 },  // DCT_ADST = 2
+  { fadst16, fadst16 }   // ADST_ADST = 3
+};
+
 static INLINE tran_high_t fdct_round_shift(tran_high_t input) {
   tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
   // TODO(debargha, peter.derivaz): Find new bounds for this assert
@@ -28,7 +56,7 @@
   return rv;
 }
 
-void vp9_fdct4(const tran_low_t *input, tran_low_t *output) {
+static void fdct4(const tran_low_t *input, tran_low_t *output) {
   tran_high_t step[4];
   tran_high_t temp1, temp2;
 
@@ -125,7 +153,7 @@
   }
 }
 
-void vp9_fadst4(const tran_low_t *input, tran_low_t *output) {
+static void fadst4(const tran_low_t *input, tran_low_t *output) {
   tran_high_t x0, x1, x2, x3;
   tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;
 
@@ -197,7 +225,7 @@
   }
 }
 
-void vp9_fdct8(const tran_low_t *input, tran_low_t *output) {
+static void fdct8(const tran_low_t *input, tran_low_t *output) {
   tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;  // canbe16
   tran_high_t t0, t1, t2, t3;                  // needs32
   tran_high_t x0, x1, x2, x3;                  // canbe16
@@ -325,7 +353,7 @@
 
   // Rows
   for (i = 0; i < 8; ++i) {
-    vp9_fdct8(&intermediate[i * 8], &final_output[i * 8]);
+    fdct8(&intermediate[i * 8], &final_output[i * 8]);
     for (j = 0; j < 8; ++j)
       final_output[j + i * 8] /= 2;
   }
@@ -407,7 +435,7 @@
 
   // Rows
   for (i = 0; i < 8; ++i) {
-    vp9_fdct8(&intermediate[i * 8], &coeff_ptr[i * 8]);
+    fdct8(&intermediate[i * 8], &coeff_ptr[i * 8]);
     for (j = 0; j < 8; ++j)
       coeff_ptr[j + i * 8] /= 2;
   }
@@ -634,7 +662,7 @@
   }
 }
 
-void vp9_fadst8(const tran_low_t *input, tran_low_t *output) {
+static void fadst8(const tran_low_t *input, tran_low_t *output) {
   tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;
 
   tran_high_t x0 = input[7];
@@ -792,7 +820,7 @@
 }
 
 // Rewrote to use same algorithm as others.
-void vp9_fdct16(const tran_low_t in[16], tran_low_t out[16]) {
+static void fdct16(const tran_low_t in[16], tran_low_t out[16]) {
   tran_high_t step1[8];      // canbe16
   tran_high_t step2[8];      // canbe16
   tran_high_t step3[8];      // canbe16
@@ -933,7 +961,7 @@
   out[15] = (tran_low_t)fdct_round_shift(temp2);
 }
 
-void vp9_fadst16(const tran_low_t *input, tran_low_t *output) {
+static void fadst16(const tran_low_t *input, tran_low_t *output) {
   tran_high_t s0, s1, s2, s3, s4, s5, s6, s7, s8;
   tran_high_t s9, s10, s11, s12, s13, s14, s15;
 
--- a/vp9/encoder/vp9_dct.h
+++ b/vp9/encoder/vp9_dct.h
@@ -17,6 +17,8 @@
 extern "C" {
 #endif
 
+void vp9_fdct32(const tran_high_t *input, tran_high_t *output, int round);
+
 void vp9_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output, int stride);
 void vp9_highbd_fdct8x8_c(const int16_t *input, tran_low_t *output, int stride);
 void vp9_highbd_fdct16x16_c(const int16_t *input, tran_low_t *output,
@@ -24,35 +26,6 @@
 void vp9_highbd_fdct32x32_c(const int16_t *input, tran_low_t *out, int stride);
 void vp9_highbd_fdct32x32_rd_c(const int16_t *input, tran_low_t *out,
                                int stride);
-
-void vp9_fdct4(const tran_low_t *input, tran_low_t *output);
-void vp9_fadst4(const tran_low_t *input, tran_low_t *output);
-void vp9_fdct8(const tran_low_t *input, tran_low_t *output);
-void vp9_fadst8(const tran_low_t *input, tran_low_t *output);
-void vp9_fdct16(const tran_low_t in[16], tran_low_t out[16]);
-void vp9_fadst16(const tran_low_t *input, tran_low_t *output);
-void vp9_fdct32(const tran_high_t *input, tran_high_t *output, int round);
-
-static const transform_2d FHT_4[] = {
-  { vp9_fdct4,  vp9_fdct4  },  // DCT_DCT  = 0
-  { vp9_fadst4, vp9_fdct4  },  // ADST_DCT = 1
-  { vp9_fdct4,  vp9_fadst4 },  // DCT_ADST = 2
-  { vp9_fadst4, vp9_fadst4 }   // ADST_ADST = 3
-};
-
-static const transform_2d FHT_8[] = {
-  { vp9_fdct8,  vp9_fdct8  },  // DCT_DCT  = 0
-  { vp9_fadst8, vp9_fdct8  },  // ADST_DCT = 1
-  { vp9_fdct8,  vp9_fadst8 },  // DCT_ADST = 2
-  { vp9_fadst8, vp9_fadst8 }   // ADST_ADST = 3
-};
-
-static const transform_2d FHT_16[] = {
-  { vp9_fdct16,  vp9_fdct16  },  // DCT_DCT  = 0
-  { vp9_fadst16, vp9_fdct16  },  // ADST_DCT = 1
-  { vp9_fdct16,  vp9_fadst16 },  // DCT_ADST = 2
-  { vp9_fadst16, vp9_fadst16 }   // ADST_ADST = 3
-};
 
 #ifdef __cplusplus
 }  // extern "C"