shithub: libvpx

Download patch

ref: f103dcefaf2437b0eeba66e52426e4e9714cf949
parent: 2a8f57f50de05af71284b42a2fe73a7168ae7a93
author: John Koleszar <jkoleszar@google.com>
date: Thu Jan 12 11:55:44 EST 2012

RTCD: add subpixel functions

This commit continues the process of converting to the new RTCD
system.

Change-Id: I6c519ab61e4f4e0ebcc796f2df061f945c48cefe

--- a/vp8/common/arm/arm_systemdependent.c
+++ /dev/null
@@ -1,62 +1,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include "vpx_config.h"
-#include "vpx_ports/arm.h"
-#include "vp8/common/pragmas.h"
-#include "vp8/common/subpixel.h"
-#include "vp8/common/loopfilter.h"
-#include "vp8/common/onyxc_int.h"
-
-void vp8_arch_arm_common_init(VP8_COMMON *ctx)
-{
-#if CONFIG_RUNTIME_CPU_DETECT
-    VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
-    int flags = arm_cpu_caps();
-    rtcd->flags = flags;
-
-    /* Override default functions with fastest ones for this CPU. */
-#if HAVE_EDSP
-    if (flags & HAS_EDSP)
-    {
-    }
-#endif
-
-#if HAVE_MEDIA
-    if (flags & HAS_MEDIA)
-    {
-        rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_armv6;
-        rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_armv6;
-        rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_armv6;
-        rtcd->subpix.sixtap4x4     = vp8_sixtap_predict_armv6;
-        rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_armv6;
-        rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_armv6;
-        rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_armv6;
-        rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_armv6;
-    }
-#endif
-
-#if HAVE_NEON
-    if (flags & HAS_NEON)
-    {
-        rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_neon;
-        rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_neon;
-        rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_neon;
-        rtcd->subpix.sixtap4x4     = vp8_sixtap_predict_neon;
-        rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_neon;
-        rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_neon;
-        rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_neon;
-        rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_neon;
-    }
-#endif
-
-#endif
-}
--- a/vp8/common/arm/bilinearfilter_arm.c
+++ b/vp8/common/arm/bilinearfilter_arm.c
@@ -8,10 +8,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-
+#include "vpx_config.h"
+#include "vpx_rtcd.h"
 #include <math.h>
 #include "vp8/common/filter.h"
-#include "vp8/common/subpixel.h"
 #include "bilinearfilter_arm.h"
 
 void vp8_filter_block2d_bil_armv6
--- a/vp8/common/arm/filter_arm.c
+++ b/vp8/common/arm/filter_arm.c
@@ -10,9 +10,9 @@
 
 
 #include "vpx_config.h"
+#include "vpx_rtcd.h"
 #include <math.h>
 #include "vp8/common/filter.h"
-#include "vp8/common/subpixel.h"
 #include "vpx_ports/mem.h"
 
 extern void vp8_filter_block2d_first_pass_armv6
@@ -87,7 +87,7 @@
 );
 
 #if HAVE_MEDIA
-void vp8_sixtap_predict_armv6
+void vp8_sixtap_predict4x4_armv6
 (
     unsigned char  *src_ptr,
     int  src_pixels_per_line,
--- a/vp8/common/arm/neon/sixtappredict4x4_neon.asm
+++ b/vp8/common/arm/neon/sixtappredict4x4_neon.asm
@@ -9,7 +9,7 @@
 ;
 
 
-    EXPORT  |vp8_sixtap_predict_neon|
+    EXPORT  |vp8_sixtap_predict4x4_neon|
     ARM
     REQUIRE8
     PRESERVE8
@@ -33,7 +33,7 @@
 ; stack(r4) unsigned char *dst_ptr,
 ; stack(lr) int  dst_pitch
 
-|vp8_sixtap_predict_neon| PROC
+|vp8_sixtap_predict4x4_neon| PROC
     push            {r4, lr}
 
     adr             r12, filter4_coeff
--- a/vp8/common/arm/subpixel_arm.h
+++ /dev/null
@@ -1,89 +1,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef SUBPIXEL_ARM_H
-#define SUBPIXEL_ARM_H
-
-#if HAVE_MEDIA
-extern prototype_subpixel_predict(vp8_sixtap_predict16x16_armv6);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x8_armv6);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x4_armv6);
-extern prototype_subpixel_predict(vp8_sixtap_predict_armv6);
-extern prototype_subpixel_predict(vp8_bilinear_predict16x16_armv6);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_armv6);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x4_armv6);
-extern prototype_subpixel_predict(vp8_bilinear_predict4x4_armv6);
-
-#if !CONFIG_RUNTIME_CPU_DETECT
-#undef  vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_armv6
-
-#undef  vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_armv6
-
-#undef  vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_armv6
-
-#undef  vp8_subpix_sixtap4x4
-#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_armv6
-
-#undef  vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_armv6
-
-#undef  vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_armv6
-
-#undef  vp8_subpix_bilinear8x4
-#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_armv6
-
-#undef  vp8_subpix_bilinear4x4
-#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_armv6
-#endif
-#endif
-
-#if HAVE_NEON
-extern prototype_subpixel_predict(vp8_sixtap_predict16x16_neon);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x8_neon);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x4_neon);
-extern prototype_subpixel_predict(vp8_sixtap_predict_neon);
-extern prototype_subpixel_predict(vp8_bilinear_predict16x16_neon);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_neon);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x4_neon);
-extern prototype_subpixel_predict(vp8_bilinear_predict4x4_neon);
-
-#if !CONFIG_RUNTIME_CPU_DETECT
-#undef  vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_neon
-
-#undef  vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_neon
-
-#undef  vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_neon
-
-#undef  vp8_subpix_sixtap4x4
-#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_neon
-
-#undef  vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_neon
-
-#undef  vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_neon
-
-#undef  vp8_subpix_bilinear8x4
-#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_neon
-
-#undef  vp8_subpix_bilinear4x4
-#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_neon
-#endif
-#endif
-
-#endif
--- a/vp8/common/blockd.h
+++ b/vp8/common/blockd.h
@@ -18,7 +18,6 @@
 #include "vpx_scale/yv12config.h"
 #include "mv.h"
 #include "treecoder.h"
-#include "subpixel.h"
 #include "vpx_ports/mem.h"
 
 /*#define DCPRED 1*/
@@ -199,6 +198,8 @@
 
     union b_mode_info bmi;
 } BLOCKD;
+
+typedef void (*vp8_subpix_fn_t)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 
 typedef struct macroblockd
 {
--- a/vp8/common/filter.c
+++ b/vp8/common/filter.c
@@ -149,7 +149,7 @@
 }
 
 
-void vp8_sixtap_predict_c
+void vp8_sixtap_predict4x4_c
 (
     unsigned char  *src_ptr,
     int   src_pixels_per_line,
--- a/vp8/common/generic/systemdependent.c
+++ b/vp8/common/generic/systemdependent.c
@@ -11,8 +11,11 @@
 
 #include "vpx_config.h"
 #include "vpx_rtcd.h"
-#include "vp8/common/subpixel.h"
-#include "vp8/common/loopfilter.h"
+#if ARCH_ARM
+#include "vpx_ports/arm.h"
+#elif ARCH_X86 || ARCH_X86_64
+#include "vpx_ports/x86.h"
+#endif
 #include "vp8/common/onyxc_int.h"
 
 #if CONFIG_MULTITHREAD
@@ -24,9 +27,6 @@
 #endif
 #endif
 
-extern void vp8_arch_x86_common_init(VP8_COMMON *ctx);
-extern void vp8_arch_arm_common_init(VP8_COMMON *ctx);
-
 #if CONFIG_MULTITHREAD
 static int get_cpu_count()
 {
@@ -65,30 +65,15 @@
 
 void vp8_machine_specific_config(VP8_COMMON *ctx)
 {
-#if CONFIG_RUNTIME_CPU_DETECT
-    VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
-
-    rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_c;
-    rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_c;
-    rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_c;
-    rtcd->subpix.sixtap4x4     = vp8_sixtap_predict_c;
-    rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c;
-    rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_c;
-    rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_c;
-    rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_c;
-#endif
-
-#if ARCH_X86 || ARCH_X86_64
-    vp8_arch_x86_common_init(ctx);
-#endif
-
-#if ARCH_ARM
-    vp8_arch_arm_common_init(ctx);
-#endif
-
 #if CONFIG_MULTITHREAD
     ctx->processor_core_count = get_cpu_count();
 #endif /* CONFIG_MULTITHREAD */
+
+#if ARCH_ARM
+    ctx->cpu_caps = arm_cpu_caps();
+#elif ARCH_X86 || ARCH_X86_64
+    ctx->cpu_caps = x86_simd_caps();
+#endif
 
     vpx_rtcd();
 }
--- a/vp8/common/invtrans.h
+++ b/vp8/common/invtrans.h
@@ -33,8 +33,7 @@
     }
 }
 
-static void vp8_inverse_transform_mby(MACROBLOCKD *xd,
-                                      const VP8_COMMON_RTCD *rtcd)
+static void vp8_inverse_transform_mby(MACROBLOCKD *xd)
 {
     short *DQC = xd->dequant_y1;
 
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -69,16 +69,6 @@
     BILINEAR = 1
 } INTERPOLATIONFILTERTYPE;
 
-typedef struct VP8_COMMON_RTCD
-{
-#if CONFIG_RUNTIME_CPU_DETECT
-    vp8_subpix_rtcd_vtable_t      subpix;
-    int                           flags;
-#else
-    int unused;
-#endif
-} VP8_COMMON_RTCD;
-
 typedef struct VP8Common
 
 {
@@ -194,9 +184,6 @@
     double bitrate;
     double framerate;
 
-#if CONFIG_RUNTIME_CPU_DETECT
-    VP8_COMMON_RTCD rtcd;
-#endif
 #if CONFIG_MULTITHREAD
     int processor_core_count;
 #endif
@@ -203,6 +190,7 @@
 #if CONFIG_POSTPROC
     struct postproc_state  postproc_state;
 #endif
+    int cpu_caps;
 } VP8_COMMON;
 
 #endif
--- a/vp8/common/reconinter.c
+++ b/vp8/common/reconinter.c
@@ -12,7 +12,6 @@
 #include "vpx_config.h"
 #include "vpx_rtcd.h"
 #include "vpx/vpx_integer.h"
-#include "subpixel.h"
 #include "blockd.h"
 #include "reconinter.h"
 #if CONFIG_RUNTIME_CPU_DETECT
--- a/vp8/common/rtcd_defs.sh
+++ b/vp8/common/rtcd_defs.sh
@@ -160,3 +160,38 @@
     prototype void vp8_blend_b "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
     # no asm yet
 fi
+
+#
+# Subpixel
+#
+prototype void vp8_sixtap_predict16x16 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_sixtap_predict16x16 mmx sse2 ssse3 media neon
+vp8_sixtap_predict16x16_media=vp8_sixtap_predict16x16_armv6
+
+prototype void vp8_sixtap_predict8x8 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_sixtap_predict8x8 mmx sse2 ssse3 media neon
+vp8_sixtap_predict8x8_media=vp8_sixtap_predict8x8_armv6
+
+prototype void vp8_sixtap_predict8x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_sixtap_predict8x4 mmx sse2 ssse3 media neon
+vp8_sixtap_predict8x4_media=vp8_sixtap_predict8x4_armv6
+
+prototype void vp8_sixtap_predict4x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_sixtap_predict4x4 mmx ssse3 media neon
+vp8_sixtap_predict4x4_media=vp8_sixtap_predict4x4_armv6
+
+prototype void vp8_bilinear_predict16x16 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_bilinear_predict16x16 mmx sse2 ssse3 media neon
+vp8_bilinear_predict16x16_media=vp8_bilinear_predict16x16_armv6
+
+prototype void vp8_bilinear_predict8x8 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_bilinear_predict8x8 mmx sse2 ssse3 media neon
+vp8_bilinear_predict8x8_media=vp8_bilinear_predict8x8_armv6
+
+prototype void vp8_bilinear_predict8x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_bilinear_predict8x4 mmx media neon
+vp8_bilinear_predict8x4_media=vp8_bilinear_predict8x4_armv6
+
+prototype void vp8_bilinear_predict4x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
+specialize vp8_bilinear_predict4x4 mmx media neon
+vp8_bilinear_predict4x4_media=vp8_bilinear_predict4x4_armv6
--- a/vp8/common/subpixel.h
+++ /dev/null
@@ -1,86 +1,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef SUBPIXEL_H
-#define SUBPIXEL_H
-
-#define prototype_subpixel_predict(sym) \
-    void sym(unsigned char *src, int src_pitch, int xofst, int yofst, \
-             unsigned char *dst, int dst_pitch)
-
-#if ARCH_X86 || ARCH_X86_64
-#include "x86/subpixel_x86.h"
-#endif
-
-#if ARCH_ARM
-#include "arm/subpixel_arm.h"
-#endif
-
-#ifndef vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_sixtap16x16);
-
-#ifndef vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_sixtap8x8);
-
-#ifndef vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_sixtap8x4);
-
-#ifndef vp8_subpix_sixtap4x4
-#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_sixtap4x4);
-
-#ifndef vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_bilinear16x16);
-
-#ifndef vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_bilinear8x8);
-
-#ifndef vp8_subpix_bilinear8x4
-#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_bilinear8x4);
-
-#ifndef vp8_subpix_bilinear4x4
-#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_c
-#endif
-extern prototype_subpixel_predict(vp8_subpix_bilinear4x4);
-
-typedef prototype_subpixel_predict((*vp8_subpix_fn_t));
-typedef struct
-{
-    vp8_subpix_fn_t  sixtap16x16;
-    vp8_subpix_fn_t  sixtap8x8;
-    vp8_subpix_fn_t  sixtap8x4;
-    vp8_subpix_fn_t  sixtap4x4;
-    vp8_subpix_fn_t  bilinear16x16;
-    vp8_subpix_fn_t  bilinear8x8;
-    vp8_subpix_fn_t  bilinear8x4;
-    vp8_subpix_fn_t  bilinear4x4;
-} vp8_subpix_rtcd_vtable_t;
-
-#if CONFIG_RUNTIME_CPU_DETECT
-#define SUBPIX_INVOKE(ctx,fn) (ctx)->fn
-#else
-#define SUBPIX_INVOKE(ctx,fn) vp8_subpix_##fn
-#endif
-
-#endif
--- a/vp8/common/x86/subpixel_x86.h
+++ /dev/null
@@ -1,124 +1,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef SUBPIXEL_X86_H
-#define SUBPIXEL_X86_H
-
-#include "filter_x86.h"
-
-/* Note:
- *
- * This platform is commonly built for runtime CPU detection. If you modify
- * any of the function mappings present in this file, be sure to also update
- * them in the function pointer initialization code
- */
-
-#if HAVE_MMX
-extern prototype_subpixel_predict(vp8_sixtap_predict16x16_mmx);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x8_mmx);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x4_mmx);
-extern prototype_subpixel_predict(vp8_sixtap_predict4x4_mmx);
-extern prototype_subpixel_predict(vp8_bilinear_predict16x16_mmx);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_mmx);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x4_mmx);
-extern prototype_subpixel_predict(vp8_bilinear_predict4x4_mmx);
-
-
-#if !CONFIG_RUNTIME_CPU_DETECT
-#undef  vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_mmx
-
-#undef  vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_mmx
-
-#undef  vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_mmx
-
-#undef  vp8_subpix_sixtap4x4
-#define vp8_subpix_sixtap4x4 vp8_sixtap_predict4x4_mmx
-
-#undef  vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_mmx
-
-#undef  vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_mmx
-
-#undef  vp8_subpix_bilinear8x4
-#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_mmx
-
-#undef  vp8_subpix_bilinear4x4
-#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_mmx
-
-#endif
-#endif
-
-
-#if HAVE_SSE2
-extern prototype_subpixel_predict(vp8_sixtap_predict16x16_sse2);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x8_sse2);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x4_sse2);
-extern prototype_subpixel_predict(vp8_bilinear_predict16x16_sse2);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_sse2);
-
-
-#if !CONFIG_RUNTIME_CPU_DETECT
-#undef  vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_sse2
-
-#undef  vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_sse2
-
-#undef  vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_sse2
-
-#undef  vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_sse2
-
-#undef  vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_sse2
-
-#endif
-#endif
-
-#if HAVE_SSSE3
-extern prototype_subpixel_predict(vp8_sixtap_predict16x16_ssse3);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x8_ssse3);
-extern prototype_subpixel_predict(vp8_sixtap_predict8x4_ssse3);
-extern prototype_subpixel_predict(vp8_sixtap_predict4x4_ssse3);
-extern prototype_subpixel_predict(vp8_bilinear_predict16x16_ssse3);
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_ssse3);
-
-#if !CONFIG_RUNTIME_CPU_DETECT
-#undef  vp8_subpix_sixtap16x16
-#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_ssse3
-
-#undef  vp8_subpix_sixtap8x8
-#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_ssse3
-
-#undef  vp8_subpix_sixtap8x4
-#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_ssse3
-
-#undef  vp8_subpix_sixtap4x4
-#define vp8_subpix_sixtap4x4 vp8_sixtap_predict4x4_ssse3
-
-
-#undef  vp8_subpix_bilinear16x16
-#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_ssse3
-
-#undef  vp8_subpix_bilinear8x8
-#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_ssse3
-
-#endif
-#endif
-
-
-
-#endif
--- a/vp8/common/x86/vp8_asm_stubs.c
+++ b/vp8/common/x86/vp8_asm_stubs.c
@@ -10,8 +10,8 @@
 
 
 #include "vpx_config.h"
+#include "vpx_rtcd.h"
 #include "vpx_ports/mem.h"
-#include "vp8/common/subpixel.h"
 #include "filter_x86.h"
 
 extern const short vp8_six_tap_mmx[8][6*8];
@@ -114,7 +114,6 @@
     unsigned int   output_height,
     const short   *vp8_filter
 );
-extern prototype_subpixel_predict(vp8_bilinear_predict8x8_mmx);
 
 
 #if HAVE_MMX
--- a/vp8/common/x86/x86_systemdependent.c
+++ /dev/null
@@ -1,75 +1,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include "vpx_config.h"
-#include "vpx_ports/x86.h"
-#include "vp8/common/subpixel.h"
-#include "vp8/common/loopfilter.h"
-#include "vp8/common/pragmas.h"
-#include "vp8/common/onyxc_int.h"
-
-void vp8_arch_x86_common_init(VP8_COMMON *ctx)
-{
-#if CONFIG_RUNTIME_CPU_DETECT
-    VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
-    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_MMX
-
-    if (flags & HAS_MMX)
-    {
-        rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_mmx;
-        rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_mmx;
-        rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_mmx;
-        rtcd->subpix.sixtap4x4     = vp8_sixtap_predict4x4_mmx;
-        rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_mmx;
-        rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_mmx;
-        rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_mmx;
-        rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_mmx;
-    }
-
-#endif
-#if HAVE_SSE2
-
-    if (flags & HAS_SSE2)
-    {
-        rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_sse2;
-        rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_sse2;
-        rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_sse2;
-        rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_sse2;
-        rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_sse2;
-    }
-
-#endif
-
-#if HAVE_SSSE3
-
-    if (flags & HAS_SSSE3)
-    {
-        rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_ssse3;
-        rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_ssse3;
-        rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_ssse3;
-        rtcd->subpix.sixtap4x4     = vp8_sixtap_predict4x4_ssse3;
-        rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_ssse3;
-        rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_ssse3;
-    }
-#endif
-
-#endif
-}
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -614,17 +614,17 @@
         /* To enable choice of different interploation filters */
         if (pc->mcomp_filter_type == SIXTAP)
         {
-            xd->subpixel_predict      = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap4x4);
-            xd->subpixel_predict8x4   = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x4);
-            xd->subpixel_predict8x8   = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x8);
-            xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap16x16);
+            xd->subpixel_predict        = vp8_sixtap_predict4x4;
+            xd->subpixel_predict8x4     = vp8_sixtap_predict8x4;
+            xd->subpixel_predict8x8     = vp8_sixtap_predict8x8;
+            xd->subpixel_predict16x16   = vp8_sixtap_predict16x16;
         }
         else
         {
-            xd->subpixel_predict      = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear4x4);
-            xd->subpixel_predict8x4   = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x4);
-            xd->subpixel_predict8x8   = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x8);
-            xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear16x16);
+            xd->subpixel_predict        = vp8_bilinear_predict4x4;
+            xd->subpixel_predict8x4     = vp8_bilinear_predict8x4;
+            xd->subpixel_predict8x8     = vp8_bilinear_predict8x8;
+            xd->subpixel_predict16x16   = vp8_bilinear_predict16x16;
         }
 
         if (pbi->decoded_key_frame && pbi->ec_enabled && !pbi->ec_active)
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -76,9 +76,6 @@
     vp8dx_initialize();
 
     vp8_create_common(&pbi->common);
-#if CONFIG_RUNTIME_CPU_DETECT
-    pbi->mb.rtcd = &pbi->common.rtcd;
-#endif
 
     pbi->common.current_video_frame = 0;
     pbi->ready_for_new_data = 1;
@@ -391,7 +388,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_push_neon(dx_store_reg);
@@ -404,7 +401,7 @@
     {
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-        if (cm->rtcd.flags & HAS_NEON)
+        if (cm->cpu_caps & HAS_NEON)
 #endif
         {
             vp8_pop_neon(dx_store_reg);
@@ -433,7 +430,7 @@
     {
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-        if (cm->rtcd.flags & HAS_NEON)
+        if (cm->cpu_caps & HAS_NEON)
 #endif
         {
             vp8_pop_neon(dx_store_reg);
@@ -454,7 +451,7 @@
         {
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-            if (cm->rtcd.flags & HAS_NEON)
+            if (cm->cpu_caps & HAS_NEON)
 #endif
             {
                 vp8_pop_neon(dx_store_reg);
@@ -472,7 +469,7 @@
         {
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-            if (cm->rtcd.flags & HAS_NEON)
+            if (cm->cpu_caps & HAS_NEON)
 #endif
             {
                 vp8_pop_neon(dx_store_reg);
@@ -562,7 +559,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_pop_neon(dx_store_reg);
--- a/vp8/encoder/arm/arm_csystemdependent.c
+++ b/vp8/encoder/arm/arm_csystemdependent.c
@@ -21,7 +21,7 @@
 void vp8_arch_arm_encoder_init(VP8_COMP *cpi)
 {
 #if CONFIG_RUNTIME_CPU_DETECT
-    int flags = cpi->common.rtcd.flags;
+    int flags = cpi->common.cpu_caps;
 
 #if HAVE_EDSP
     if (flags & HAS_EDSP)
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -26,7 +26,6 @@
 #include "vp8/common/findnearmv.h"
 #include <stdio.h>
 #include <limits.h>
-#include "vp8/common/subpixel.h"
 #include "vp8/common/invtrans.h"
 #include "vpx_ports/vpx_timer.h"
 
@@ -686,25 +685,17 @@
     // Functions setup for all frame types so we can use MC in AltRef
     if (cm->mcomp_filter_type == SIXTAP)
     {
-        xd->subpixel_predict        = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, sixtap4x4);
-        xd->subpixel_predict8x4     = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, sixtap8x4);
-        xd->subpixel_predict8x8     = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, sixtap8x8);
-        xd->subpixel_predict16x16   = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, sixtap16x16);
+        xd->subpixel_predict        = vp8_sixtap_predict4x4;
+        xd->subpixel_predict8x4     = vp8_sixtap_predict8x4;
+        xd->subpixel_predict8x8     = vp8_sixtap_predict8x8;
+        xd->subpixel_predict16x16   = vp8_sixtap_predict16x16;
     }
     else
     {
-        xd->subpixel_predict        = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, bilinear4x4);
-        xd->subpixel_predict8x4     = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, bilinear8x4);
-        xd->subpixel_predict8x8     = SUBPIX_INVOKE(
-                                        &cpi->common.rtcd.subpix, bilinear8x8);
-        xd->subpixel_predict16x16   = SUBPIX_INVOKE(
-                                      &cpi->common.rtcd.subpix, bilinear16x16);
+        xd->subpixel_predict        = vp8_bilinear_predict4x4;
+        xd->subpixel_predict8x4     = vp8_bilinear_predict8x4;
+        xd->subpixel_predict8x8     = vp8_bilinear_predict8x8;
+        xd->subpixel_predict16x16   = vp8_bilinear_predict16x16;
     }
 
     // Reset frame count of inter 0,0 motion vector useage.
@@ -1116,7 +1107,7 @@
     vp8_tokenize_mb(cpi, &x->e_mbd, t);
 
     if (xd->mode_info_context->mbmi.mode != B_PRED)
-        vp8_inverse_transform_mby(xd, IF_RTCD(&cpi->common.rtcd));
+        vp8_inverse_transform_mby(xd);
 
     vp8_dequant_idct_add_uv_block
                     (xd->qcoeff+16*16, xd->dequant_uv,
@@ -1301,7 +1292,7 @@
         vp8_tokenize_mb(cpi, xd, t);
 
         if (xd->mode_info_context->mbmi.mode != B_PRED)
-            vp8_inverse_transform_mby(xd, IF_RTCD(&cpi->common.rtcd));
+            vp8_inverse_transform_mby(xd);
 
         vp8_dequant_idct_add_uv_block
                         (xd->qcoeff+16*16, xd->dequant_uv,
--- a/vp8/encoder/encodeintra.c
+++ b/vp8/encoder/encodeintra.c
@@ -42,7 +42,7 @@
 
         vp8_encode_intra16x16mby(rtcd, x);
 
-        vp8_inverse_transform_mby(&x->e_mbd, IF_RTCD(&cpi->common.rtcd));
+        vp8_inverse_transform_mby(&x->e_mbd);
     }
     else
     {
--- a/vp8/encoder/encodemb.c
+++ b/vp8/encoder/encodemb.c
@@ -651,5 +651,5 @@
 
     vp8_quantize_mby(x);
 
-    vp8_inverse_transform_mby(&x->e_mbd, IF_RTCD(rtcd->common));
+    vp8_inverse_transform_mby(&x->e_mbd);
 }
--- a/vp8/encoder/generic/csystemdependent.c
+++ b/vp8/encoder/generic/csystemdependent.c
@@ -25,7 +25,6 @@
 void vp8_cmachine_specific_config(VP8_COMP *cpi)
 {
 #if CONFIG_RUNTIME_CPU_DETECT
-    cpi->rtcd.common                    = &cpi->common.rtcd;
     cpi->rtcd.variance.sad16x16              = vp8_sad16x16_c;
     cpi->rtcd.variance.sad16x8               = vp8_sad16x8_c;
     cpi->rtcd.variance.sad8x16               = vp8_sad8x16_c;
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1009,10 +1009,6 @@
     if (cpi->sf.improved_quant != last_improved_quant)
         vp8cx_init_quantizer(cpi);
 
-#if CONFIG_RUNTIME_CPU_DETECT
-    cpi->mb.e_mbd.rtcd = &cpi->common.rtcd;
-#endif
-
     if (cpi->sf.iterative_sub_pixel == 1)
     {
         cpi->find_fractional_mv_step = vp8_find_best_sub_pixel_step_iteratively;
@@ -4571,7 +4567,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_push_neon(store_reg);
@@ -4588,7 +4584,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_pop_neon(store_reg);
@@ -4639,7 +4635,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_push_neon(store_reg);
@@ -4714,7 +4710,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-        if (cm->rtcd.flags & HAS_NEON)
+        if (cm->cpu_caps & HAS_NEON)
 #endif
         {
             vp8_pop_neon(store_reg);
@@ -5103,7 +5099,7 @@
 
 #if HAVE_NEON
 #if CONFIG_RUNTIME_CPU_DETECT
-    if (cm->rtcd.flags & HAS_NEON)
+    if (cm->cpu_caps & HAS_NEON)
 #endif
     {
         vp8_pop_neon(store_reg);
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -224,7 +224,6 @@
 
 typedef struct VP8_ENCODER_RTCD
 {
-    VP8_COMMON_RTCD            *common;
     vp8_variance_rtcd_vtable_t  variance;
     vp8_fdct_rtcd_vtable_t      fdct;
     vp8_encodemb_rtcd_vtable_t  encodemb;
--- a/vp8/vp8_common.mk
+++ b/vp8/vp8_common.mk
@@ -50,7 +50,6 @@
 VP8_COMMON_SRCS-yes += common/rtcd.c
 VP8_COMMON_SRCS-yes += common/rtcd_defs.sh
 VP8_COMMON_SRCS-yes += common/setupintrarecon.h
-VP8_COMMON_SRCS-yes += common/subpixel.h
 VP8_COMMON_SRCS-yes += common/swapyv12buffer.h
 VP8_COMMON_SRCS-yes += common/systemdependent.h
 VP8_COMMON_SRCS-yes += common/threading.h
@@ -74,8 +73,6 @@
 
 VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/filter_x86.c
 VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/filter_x86.h
-VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/subpixel_x86.h
-VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/x86_systemdependent.c
 VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp8_asm_stubs.c
 VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/loopfilter_x86.c
 VP8_COMMON_SRCS-$(CONFIG_POSTPROC) += common/postproc.h
@@ -104,11 +101,9 @@
 endif
 
 # common (c)
-VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/arm_systemdependent.c
 VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/filter_arm.c
 VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/loopfilter_arm.c
 VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/reconintra_arm.c
-VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/subpixel_arm.h
 VP8_COMMON_SRCS-$(ARCH_ARM)  += common/arm/dequantize_arm.c
 
 # common (media)
--