]> granicus.if.org Git - libvpx/blob - vpx_scale/arm/scalesystemdependant.c
Merge commit 'refs/changes/09/809/1' of https://review.webmproject.org/p/libvpx
[libvpx] / vpx_scale / arm / scalesystemdependant.c
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 "vpx_scale/vpxscale.h"
15
16
17 void (*vp8_yv12_extend_frame_borders_ptr)(YV12_BUFFER_CONFIG *ybf);
18 extern void vp8_yv12_extend_frame_borders(YV12_BUFFER_CONFIG *ybf);
19 extern void vp8_yv12_extend_frame_borders_neon(YV12_BUFFER_CONFIG *ybf);
20
21 void (*vp8_yv12_copy_frame_yonly_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
22 extern void vp8_yv12_copy_frame_yonly(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
23 extern void vp8_yv12_copy_frame_yonly_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
24
25 void (*vp8_yv12_copy_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
26 extern void vp8_yv12_copy_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
27 extern void vp8_yv12_copy_frame_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
28
29 /****************************************************************************
30 *  Imports
31 *****************************************************************************/
32
33 /****************************************************************************
34  *
35  *  ROUTINE       : vp8_scale_machine_specific_config
36  *
37  *  INPUTS        : UINT32 Version : Codec version number.
38  *
39  *  OUTPUTS       : None.
40  *
41  *  RETURNS       : void
42  *
43  *  FUNCTION      : Checks for machine specifc features such as MMX support
44  *                  sets appropriate flags and function pointers.
45  *
46  *  SPECIAL NOTES : None.
47  *
48  ****************************************************************************/
49 void vp8_scale_machine_specific_config()
50 {
51 #if HAVE_ARMV7 && CONFIG_RUNTIME_CPU_DETECT
52     int flags;
53 #endif
54     /*
55     vp8_horizontal_line_1_2_scale        = horizontal_line_1_2_scale_armv4;
56     vp8_vertical_band_1_2_scale          = vertical_band_1_2_scale_armv4;
57     vp8_last_vertical_band_1_2_scale      = vp8cx_last_vertical_band_1_2_scale_c;
58     vp8_horizontal_line_3_5_scale        = horizontal_line_3_5_scale_armv4;
59     vp8_vertical_band_3_5_scale          = vertical_band_3_5_scale_armv4;
60     vp8_last_vertical_band_3_5_scale      = vp8cx_last_vertical_band_3_5_scale_c;
61     vp8_horizontal_line_3_4_scale        = horizontal_line_3_4_scale_armv4;
62     vp8_vertical_band_3_4_scale          = vertical_band_3_4_scale_armv4;
63     vp8_last_vertical_band_3_4_scale      = vp8cx_last_vertical_band_3_4_scale_c;
64     vp8_horizontal_line_2_3_scale        = horizontal_line_2_3_scale_armv4;
65     vp8_vertical_band_2_3_scale          = vertical_band_2_3_scale_armv4;
66     vp8_last_vertical_band_2_3_scale      = vp8cx_last_vertical_band_2_3_scale_c;
67     vp8_horizontal_line_4_5_scale        = horizontal_line_4_5_scale_armv4;
68     vp8_vertical_band_4_5_scale          = vertical_band_4_5_scale_armv4;
69     vp8_last_vertical_band_4_5_scale      = vp8cx_last_vertical_band_4_5_scale_c;
70
71     vp8_vertical_band_5_4_scale           = vp8cx_vertical_band_5_4_scale_c;
72     vp8_vertical_band_5_3_scale           = vp8cx_vertical_band_5_3_scale_c;
73     vp8_vertical_band_2_1_scale           = vp8cx_vertical_band_2_1_scale_c;
74     vp8_vertical_band_2_1_scale_i         = vp8cx_vertical_band_2_1_scale_i_c;
75     vp8_horizontal_line_2_1_scale         = vp8cx_horizontal_line_2_1_scale_c;
76     vp8_horizontal_line_5_3_scale         = vp8cx_horizontal_line_5_3_scale_c;
77     vp8_horizontal_line_5_4_scale         = vp8cx_horizontal_line_5_4_scale_c;
78     */
79
80 #if !HAVE_ARMV7 || CONFIG_RUNTIME_CPU_DETECT
81     vp8_yv12_extend_frame_borders_ptr      = vp8_yv12_extend_frame_borders;
82     vp8_yv12_copy_frame_yonly_ptr          = vp8_yv12_copy_frame_yonly;
83     vp8_yv12_copy_frame_ptr           = vp8_yv12_copy_frame;
84 #endif
85 #if HAVE_ARMV7
86 #if CONFIG_RUNTIME_CPU_DETECT
87     flags = arm_cpu_caps();
88     if (flags & HAS_NEON)
89 #endif
90     {
91         vp8_yv12_extend_frame_borders_ptr = vp8_yv12_extend_frame_borders_neon;
92         vp8_yv12_copy_frame_yonly_ptr     = vp8_yv12_copy_frame_yonly_neon;
93         vp8_yv12_copy_frame_ptr           = vp8_yv12_copy_frame_neon;
94     }
95 #endif
96 }