• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 
12 #include "vpx_ports/config.h"
13 #include "vpx_ports/arm.h"
14 #include "vp8/common/g_common.h"
15 #include "vp8/common/pragmas.h"
16 #include "vp8/common/subpixel.h"
17 #include "vp8/common/loopfilter.h"
18 #include "vp8/common/recon.h"
19 #include "vp8/common/idct.h"
20 #include "vp8/common/onyxc_int.h"
21 
vp8_arch_arm_common_init(VP8_COMMON * ctx)22 void vp8_arch_arm_common_init(VP8_COMMON *ctx)
23 {
24 #if CONFIG_RUNTIME_CPU_DETECT
25     VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
26     int flags = arm_cpu_caps();
27     int has_edsp = flags & HAS_EDSP;
28     int has_media = flags & HAS_MEDIA;
29     int has_neon = flags & HAS_NEON;
30     rtcd->flags = flags;
31 
32     /* Override default functions with fastest ones for this CPU. */
33 #if HAVE_ARMV6
34     if (has_media)
35     {
36         rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_armv6;
37         rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_armv6;
38         rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_armv6;
39         rtcd->subpix.sixtap4x4     = vp8_sixtap_predict_armv6;
40         rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_armv6;
41         rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_armv6;
42         rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_armv6;
43         rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_armv6;
44 
45         rtcd->idct.idct1        = vp8_short_idct4x4llm_1_v6;
46         rtcd->idct.idct16       = vp8_short_idct4x4llm_v6_dual;
47         rtcd->idct.iwalsh1      = vp8_short_inv_walsh4x4_1_v6;
48         rtcd->idct.iwalsh16     = vp8_short_inv_walsh4x4_v6;
49 
50         rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_armv6;
51         rtcd->loopfilter.normal_b_v  = vp8_loop_filter_bv_armv6;
52         rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_armv6;
53         rtcd->loopfilter.normal_b_h  = vp8_loop_filter_bh_armv6;
54         rtcd->loopfilter.simple_mb_v = vp8_loop_filter_mbvs_armv6;
55         rtcd->loopfilter.simple_b_v  = vp8_loop_filter_bvs_armv6;
56         rtcd->loopfilter.simple_mb_h = vp8_loop_filter_mbhs_armv6;
57         rtcd->loopfilter.simple_b_h  = vp8_loop_filter_bhs_armv6;
58 
59         rtcd->recon.copy16x16   = vp8_copy_mem16x16_v6;
60         rtcd->recon.copy8x8     = vp8_copy_mem8x8_v6;
61         rtcd->recon.copy8x4     = vp8_copy_mem8x4_v6;
62         rtcd->recon.recon       = vp8_recon_b_armv6;
63         rtcd->recon.recon2      = vp8_recon2b_armv6;
64         rtcd->recon.recon4      = vp8_recon4b_armv6;
65     }
66 #endif
67 
68 #if HAVE_ARMV7
69     if (has_neon)
70     {
71         rtcd->subpix.sixtap16x16   = vp8_sixtap_predict16x16_neon;
72         rtcd->subpix.sixtap8x8     = vp8_sixtap_predict8x8_neon;
73         rtcd->subpix.sixtap8x4     = vp8_sixtap_predict8x4_neon;
74         rtcd->subpix.sixtap4x4     = vp8_sixtap_predict_neon;
75         rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_neon;
76         rtcd->subpix.bilinear8x8   = vp8_bilinear_predict8x8_neon;
77         rtcd->subpix.bilinear8x4   = vp8_bilinear_predict8x4_neon;
78         rtcd->subpix.bilinear4x4   = vp8_bilinear_predict4x4_neon;
79 
80         rtcd->idct.idct1        = vp8_short_idct4x4llm_1_neon;
81         rtcd->idct.idct16       = vp8_short_idct4x4llm_neon;
82         rtcd->idct.iwalsh1      = vp8_short_inv_walsh4x4_1_neon;
83         rtcd->idct.iwalsh16     = vp8_short_inv_walsh4x4_neon;
84 
85         rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_neon;
86         rtcd->loopfilter.normal_b_v  = vp8_loop_filter_bv_neon;
87         rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_neon;
88         rtcd->loopfilter.normal_b_h  = vp8_loop_filter_bh_neon;
89         rtcd->loopfilter.simple_mb_v = vp8_loop_filter_mbvs_neon;
90         rtcd->loopfilter.simple_b_v  = vp8_loop_filter_bvs_neon;
91         rtcd->loopfilter.simple_mb_h = vp8_loop_filter_mbhs_neon;
92         rtcd->loopfilter.simple_b_h  = vp8_loop_filter_bhs_neon;
93 
94         rtcd->recon.copy16x16   = vp8_copy_mem16x16_neon;
95         rtcd->recon.copy8x8     = vp8_copy_mem8x8_neon;
96         rtcd->recon.copy8x4     = vp8_copy_mem8x4_neon;
97         rtcd->recon.recon       = vp8_recon_b_neon;
98         rtcd->recon.recon2      = vp8_recon2b_neon;
99         rtcd->recon.recon4      = vp8_recon4b_neon;
100         rtcd->recon.recon_mb    = vp8_recon_mb_neon;
101         rtcd->recon.build_intra_predictors_mby =
102             vp8_build_intra_predictors_mby_neon;
103         rtcd->recon.build_intra_predictors_mby_s =
104             vp8_build_intra_predictors_mby_s_neon;
105     }
106 #endif
107 
108 #endif
109 }
110