comparison ppc/dsputil_ppc.c @ 11382:50415a8f1451 libavcodec

PPC: move prototypes to headers and make some functions static
author mru
date Sat, 06 Mar 2010 22:37:14 +0000
parents 3141f69e3905
children 3cd4cd0509cd
comparison
equal deleted inserted replaced
11381:f5ccf2e590d6 11382:50415a8f1451
23 #include "libavcodec/dsputil.h" 23 #include "libavcodec/dsputil.h"
24 24
25 #include "dsputil_ppc.h" 25 #include "dsputil_ppc.h"
26 26
27 #include "dsputil_altivec.h" 27 #include "dsputil_altivec.h"
28
29 void fdct_altivec(int16_t *block);
30 void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
31 int x16, int y16, int rounder);
32 void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
33 void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
34
35 void ff_vp3_idct_altivec(DCTELEM *block);
36 void ff_vp3_idct_put_altivec(uint8_t *dest, int line_size, DCTELEM *block);
37 void ff_vp3_idct_add_altivec(uint8_t *dest, int line_size, DCTELEM *block);
38
39 void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
40
41 void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
42 void vc1dsp_init_altivec(DSPContext* c, AVCodecContext *avctx);
43 void float_init_altivec(DSPContext* c, AVCodecContext *avctx);
44 void int_init_altivec(DSPContext* c, AVCodecContext *avctx);
45 28
46 int mm_flags = 0; 29 int mm_flags = 0;
47 30
48 int mm_support(void) 31 int mm_support(void)
49 { 32 {
131 distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required. 114 distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required.
132 115
133 see <http://developer.apple.com/technotes/tn/tn2087.html> 116 see <http://developer.apple.com/technotes/tn/tn2087.html>
134 and <http://developer.apple.com/technotes/tn/tn2086.html> 117 and <http://developer.apple.com/technotes/tn/tn2086.html>
135 */ 118 */
136 void clear_blocks_dcbz32_ppc(DCTELEM *blocks) 119 static void clear_blocks_dcbz32_ppc(DCTELEM *blocks)
137 { 120 {
138 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz32, 1); 121 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz32, 1);
139 register int misal = ((unsigned long)blocks & 0x00000010); 122 register int misal = ((unsigned long)blocks & 0x00000010);
140 register int i = 0; 123 register int i = 0;
141 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1); 124 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1);
164 } 147 }
165 148
166 /* same as above, when dcbzl clear a whole 128B cache line 149 /* same as above, when dcbzl clear a whole 128B cache line
167 i.e. the PPC970 aka G5 */ 150 i.e. the PPC970 aka G5 */
168 #if HAVE_DCBZL 151 #if HAVE_DCBZL
169 void clear_blocks_dcbz128_ppc(DCTELEM *blocks) 152 static void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
170 { 153 {
171 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1); 154 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1);
172 register int misal = ((unsigned long)blocks & 0x0000007f); 155 register int misal = ((unsigned long)blocks & 0x0000007f);
173 register int i = 0; 156 register int i = 0;
174 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1); 157 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1);
187 memset(blocks, 0, sizeof(DCTELEM)*6*64); 170 memset(blocks, 0, sizeof(DCTELEM)*6*64);
188 #endif 171 #endif
189 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1); 172 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1);
190 } 173 }
191 #else 174 #else
192 void clear_blocks_dcbz128_ppc(DCTELEM *blocks) 175 static void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
193 { 176 {
194 memset(blocks, 0, sizeof(DCTELEM)*6*64); 177 memset(blocks, 0, sizeof(DCTELEM)*6*64);
195 } 178 }
196 #endif 179 #endif
197 180
199 /* check dcbz report how many bytes are set to 0 by dcbz */ 182 /* check dcbz report how many bytes are set to 0 by dcbz */
200 /* update 24/06/2003 : replace dcbz by dcbzl to get 183 /* update 24/06/2003 : replace dcbz by dcbzl to get
201 the intended effect (Apple "fixed" dcbz) 184 the intended effect (Apple "fixed" dcbz)
202 unfortunately this cannot be used unless the assembler 185 unfortunately this cannot be used unless the assembler
203 knows about dcbzl ... */ 186 knows about dcbzl ... */
204 long check_dcbzl_effect(void) 187 static long check_dcbzl_effect(void)
205 { 188 {
206 register char *fakedata = av_malloc(1024); 189 register char *fakedata = av_malloc(1024);
207 register char *fakedata_middle; 190 register char *fakedata_middle;
208 register long zero = 0; 191 register long zero = 0;
209 register long i = 0; 192 register long i = 0;
229 av_free(fakedata); 212 av_free(fakedata);
230 213
231 return count; 214 return count;
232 } 215 }
233 #else 216 #else
234 long check_dcbzl_effect(void) 217 static long check_dcbzl_effect(void)
235 { 218 {
236 return 0; 219 return 0;
237 } 220 }
238 #endif 221 #endif
239 222