arm_systemdependent.c 3.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 *  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_ports/config.h"
#include "vpx_ports/arm.h"
John Koleszar's avatar
John Koleszar committed
14
15
16
17
18
19
20
#include "vp8/common/g_common.h"
#include "vp8/common/pragmas.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/onyxc_int.h"
21

John Koleszar's avatar
John Koleszar committed
22
void vp8_arch_arm_common_init(VP8_COMMON *ctx) {
23
#if CONFIG_RUNTIME_CPU_DETECT
John Koleszar's avatar
John Koleszar committed
24
25
26
  VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
  int flags = arm_cpu_caps();
  rtcd->flags = flags;
27

John Koleszar's avatar
John Koleszar committed
28
  /* Override default functions with fastest ones for this CPU. */
29
#if HAVE_ARMV5TE
John Koleszar's avatar
John Koleszar committed
30
31
  if (flags & HAS_EDSP) {
  }
32
33
#endif

34
// The commented functions need to be re-written for vpx.
35
#if HAVE_ARMV6
John Koleszar's avatar
John Koleszar committed
36
  if (flags & HAS_MEDIA) {
37
38
39
40
    rtcd->subpix.sixtap16x16   = vp9_sixtap_predict16x16_armv6;
    rtcd->subpix.sixtap8x8     = vp9_sixtap_predict8x8_armv6;
    rtcd->subpix.sixtap8x4     = vp9_sixtap_predict8x4_armv6;
    rtcd->subpix.sixtap4x4     = vp9_sixtap_predict_armv6;
41

42
43
44
45
    rtcd->subpix.bilinear16x16 = vp9_bilinear_predict16x16_armv6;
    rtcd->subpix.bilinear8x8   = vp9_bilinear_predict8x8_armv6;
    rtcd->subpix.bilinear8x4   = vp9_bilinear_predict8x4_armv6;
    rtcd->subpix.bilinear4x4   = vp9_bilinear_predict4x4_armv6;
46

47
48
49
50
    // rtcd->idct.idct1        = vp9_short_idct4x4llm_1_v6;
    // rtcd->idct.idct16       = vp9_short_idct4x4llm_v6_dual;
    // rtcd->idct.iwalsh1      = vp9_short_inv_walsh4x4_1_v6;
    // rtcd->idct.iwalsh16     = vp9_short_inv_walsh4x4_v6;
51

52
53
54
55
56
57
    rtcd->recon.copy16x16   = vp9_copy_mem16x16_v6;
    rtcd->recon.copy8x8     = vp9_copy_mem8x8_v6;
    rtcd->recon.copy8x4     = vp9_copy_mem8x4_v6;
    rtcd->recon.recon       = vp9_recon_b_armv6;
    rtcd->recon.recon2      = vp9_recon2b_armv6;
    rtcd->recon.recon4      = vp9_recon4b_armv6;
John Koleszar's avatar
John Koleszar committed
58
  }
59
60
61
#endif

#if HAVE_ARMV7
John Koleszar's avatar
John Koleszar committed
62
  if (flags & HAS_NEON) {
63
64
65
66
    rtcd->subpix.sixtap16x16   = vp9_sixtap_predict16x16_neon;
    rtcd->subpix.sixtap8x8     = vp9_sixtap_predict8x8_neon;
    rtcd->subpix.sixtap8x4     = vp9_sixtap_predict8x4_neon;
    rtcd->subpix.sixtap4x4     = vp9_sixtap_predict_neon;
67

68
69
70
71
    rtcd->subpix.bilinear16x16 = vp9_bilinear_predict16x16_neon;
    rtcd->subpix.bilinear8x8   = vp9_bilinear_predict8x8_neon;
    rtcd->subpix.bilinear8x4   = vp9_bilinear_predict8x4_neon;
    rtcd->subpix.bilinear4x4   = vp9_bilinear_predict4x4_neon;
72

73
74
75
76
    // rtcd->idct.idct1        = vp9_short_idct4x4llm_1_neon;
    // rtcd->idct.idct16       = vp9_short_idct4x4llm_neon;
    // rtcd->idct.iwalsh1      = vp9_short_inv_walsh4x4_1_neon;
    // rtcd->idct.iwalsh16     = vp9_short_inv_walsh4x4_neon;
77

78
79
80
81
82
83
84
    rtcd->recon.copy16x16   = vp9_copy_mem16x16_neon;
    rtcd->recon.copy8x8     = vp9_copy_mem8x8_neon;
    rtcd->recon.copy8x4     = vp9_copy_mem8x4_neon;
    rtcd->recon.recon       = vp9_recon_b_neon;
    rtcd->recon.recon2      = vp9_recon2b_neon;
    rtcd->recon.recon4      = vp9_recon4b_neon;
    rtcd->recon.recon_mb    = vp9_recon_mb_neon;
John Koleszar's avatar
John Koleszar committed
85
    rtcd->recon.build_intra_predictors_mby =
86
      vp9_build_intra_predictors_mby_neon;
John Koleszar's avatar
John Koleszar committed
87
    rtcd->recon.build_intra_predictors_mby_s =
88
      vp9_build_intra_predictors_mby_s_neon;
John Koleszar's avatar
John Koleszar committed
89
  }
90
91
92
93
#endif

#endif
}