shithub: libvpx

Download patch

ref: f4871b6a3fc914b48a9409ef713ad642559ab513
parent: cb98b832393b2327f659c698e903da03d600ee93
author: Jim Bankoski <jimbankoski@google.com>
date: Sun Nov 18 07:33:18 EST 2012

clean out some of the rtcd code.

This removes functions that are no longer needed and cleans up some warnings.

Change-Id: I292a4c3694e9c1d68ce99cea390905b198434719

--- a/vp9/common/rtcd_defs.sh
+++ b/vp9/common/rtcd_defs.sh
@@ -378,22 +378,22 @@
 prototype void vp9_sad4x4x8 "const unsigned char *src_ptr, int  src_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned short *sad_array"
 specialize vp9_sad4x4x8 sse4
 
-prototype void vp9_sad32x32x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad32x32x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad32x32x4d
 
-prototype void vp9_sad16x16x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad16x16x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad16x16x4d sse3
 
-prototype void vp9_sad16x8x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad16x8x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad16x8x4d sse3
 
-prototype void vp9_sad8x16x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad8x16x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad8x16x4d sse3
 
-prototype void vp9_sad8x8x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad8x8x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad8x8x4d sse3
 
-prototype void vp9_sad4x4x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char* const ref_ptr[], int  ref_stride, unsigned int *sad_array"
+prototype void vp9_sad4x4x4d "const unsigned char *src_ptr, int  src_stride, const unsigned char **ref_ptr, int  ref_stride, unsigned int *sad_array"
 specialize vp9_sad4x4x4d sse3
 
 #
@@ -506,6 +506,9 @@
 
 prototype void vp9_temporal_filter_apply "unsigned char *frame1, unsigned int stride, unsigned char *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, unsigned short *count"
 specialize vp9_temporal_filter_apply sse2
+
+prototype void vp9_yv12_copy_partial_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc, int fraction"
+specialize vp9_yv12_copy_partial_frame neon
 
 
 fi
--- a/vp9/encoder/generic/csystemdependent.c
+++ b/vp9/encoder/generic/csystemdependent.c
@@ -14,30 +14,8 @@
 #include "vp9/encoder/onyx_int.h"
 
 
-void vp9_arch_x86_encoder_init(VP9_COMP *cpi);
-void vp9_arch_arm_encoder_init(VP9_COMP *cpi);
-
-void (*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc,
-                                        YV12_BUFFER_CONFIG *dst_ybc,
-                                        int fraction);
-extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc,
-                                        YV12_BUFFER_CONFIG *dst_ybc,
-                                        int fraction);
-
 void vp9_cmachine_specific_config(VP9_COMP *cpi) {
 #if CONFIG_RUNTIME_CPU_DETECT
   cpi->rtcd.common                    = &cpi->common.rtcd;
 #endif
-
-  vp9_yv12_copy_partial_frame_ptr = vp9_yv12_copy_partial_frame;
-
-#if ARCH_X86 || ARCH_X86_64
-  vp9_arch_x86_encoder_init(cpi);
-#endif
-
-#if ARCH_ARM
-  vp9_arch_arm_encoder_init(cpi);
-#endif
-
-
 }
--- a/vp9/encoder/mcomp.c
+++ b/vp9/encoder/mcomp.c
@@ -1442,7 +1442,7 @@
       unsigned int sad_array[4];
 
       for (j = 0; j < x->searches_per_step; j += 4) {
-        unsigned char *block_offset[4];
+        const unsigned char *block_offset[4];
 
         for (t = 0; t < 4; t++)
           block_offset[t] = ss[i + t].offset + best_address;
@@ -2070,7 +2070,7 @@
 
     if (all_in) {
       unsigned int sad_array[4];
-      unsigned char *block_offset[4];
+      unsigned char const *block_offset[4];
       block_offset[0] = best_address - in_what_stride;
       block_offset[1] = best_address - 1;
       block_offset[2] = best_address + 1;
--- a/vp9/encoder/picklpf.c
+++ b/vp9/encoder/picklpf.c
@@ -31,12 +31,8 @@
 #define IF_RTCD(x) NULL
 #endif
 
-extern void(*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc,
-                                              YV12_BUFFER_CONFIG *dst_ybc,
-                                              int fraction);
-
-void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc,
-                                 YV12_BUFFER_CONFIG *dst_ybc, int Fraction) {
+void vp9_yv12_copy_partial_frame_c(YV12_BUFFER_CONFIG *src_ybc,
+                                   YV12_BUFFER_CONFIG *dst_ybc, int Fraction) {
   unsigned char *src_y, *dst_y;
   int yheight;
   int ystride;
@@ -147,7 +143,7 @@
   int best_filt_val = cm->filter_level;
 
   //  Make a copy of the unfiltered / processed recon buffer
-  vp9_yv12_copy_partial_frame_ptr(cm->frame_to_show, &cpi->last_frame_uf, 3);
+  vp9_yv12_copy_partial_frame(cm->frame_to_show, &cpi->last_frame_uf, 3);
 
   if (cm->frame_type == KEY_FRAME)
     cm->sharpness_level = 0;
@@ -174,7 +170,7 @@
   best_err = calc_partial_ssl_err(sd, cm->frame_to_show, 3);
 
   //  Re-instate the unfiltered frame
-  vp9_yv12_copy_partial_frame_ptr(&cpi->last_frame_uf, cm->frame_to_show, 3);
+  vp9_yv12_copy_partial_frame(&cpi->last_frame_uf, cm->frame_to_show, 3);
 
   filt_val -= (1 + ((filt_val > 10) ? 1 : 0));
 
@@ -187,7 +183,7 @@
     filt_err = calc_partial_ssl_err(sd, cm->frame_to_show, 3);
 
     //  Re-instate the unfiltered frame
-    vp9_yv12_copy_partial_frame_ptr(&cpi->last_frame_uf, cm->frame_to_show, 3);
+    vp9_yv12_copy_partial_frame(&cpi->last_frame_uf, cm->frame_to_show, 3);
 
 
     // Update the best case record or exit loop.
@@ -216,7 +212,7 @@
       filt_err = calc_partial_ssl_err(sd, cm->frame_to_show, 3);
 
       //  Re-instate the unfiltered frame
-      vp9_yv12_copy_partial_frame_ptr(&cpi->last_frame_uf,
+      vp9_yv12_copy_partial_frame(&cpi->last_frame_uf,
                                       cm->frame_to_show, 3);
 
       // Update the best case record or exit loop.
--- a/vp9/encoder/variance.h
+++ b/vp9/encoder/variance.h
@@ -38,7 +38,7 @@
 
 typedef void (*vp9_sad_multi_d_fn_t)(const unsigned char *src_ptr,
                                      int source_stride,
-                                     const unsigned char * const ref_ptr[],
+                                     const unsigned char ** ref_ptr,
                                      int  ref_stride, unsigned int *sad_array);
 
 typedef unsigned int (*vp9_variance_fn_t)(const unsigned char *src_ptr,
--- a/vp9/encoder/x86/x86_csystemdependent.c
+++ b/vp9/encoder/x86/x86_csystemdependent.c
@@ -14,7 +14,8 @@
 #include "vp9/encoder/variance.h"
 #include "vp9/encoder/onyx_int.h"
 
-
+// TODO(jimbankoski) Consider rewriting the c to take the same values rather
+// than going through these pointer conversions
 #if HAVE_MMX
 void vp9_short_fdct8x4_mmx(short *input, short *output, int pitch) {
   vp9_short_fdct4x4_mmx(input,   output,    pitch);
@@ -75,24 +76,3 @@
 }
 
 #endif
-
-void vp9_arch_x86_encoder_init(VP9_COMP *cpi) {
-#if CONFIG_RUNTIME_CPU_DETECT
-  int flags = x86_simd_caps();
-
-  /* Note:
-   *
-   * This platform can be built without runtime CPU detection as well. If
-   * you modify any of the function mappings present in this file, be sure
-   * to also update them in static mapings (<arch>/filename_<arch>.h)
-   */
-
-  /* Override default functions with fastest ones for this CPU. */
-#if HAVE_SSE2
-  if (flags & HAS_SSE2) {
-  }
-#endif
-
-
-#endif
-}