Originally committed as revision 6669 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavcodec/ppc (1 of 1 file). Show all
Unified · Split
| @@ -249,10 +249,19 @@ long check_dcbzl_effect(void) · 248 unmodified lines | |||
| 249 | } | 249 | } |
| 250 | #endif | 250 | #endif |
| 251 | 251 | ||
| 252 | static void prefetch_ppc(void *mem, int stride, int h) | ||
| 253 | { | ||
| 254 | register const uint8_t *p = mem; | ||
| 255 | do { | ||
| 256 | asm volatile ("dcbt 0,%0" : : "r" (p)); | ||
| 257 | p+= stride; | ||
| 258 | } while(--h); | ||
| 259 | } | ||
| 260 | |||
| 252 | void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) | 261 | void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) |
| 253 | { | 262 | { |
| 254 | // Common optimizations whether Altivec is available or not | 263 | // Common optimizations whether Altivec is available or not |
| 255 | 264 | c->prefetch = prefetch_ppc; | |
| 256 | switch (check_dcbzl_effect()) { | 265 | switch (check_dcbzl_effect()) { |
| 257 | case 32: | 266 | case 32: |
| 258 | c->clear_blocks = clear_blocks_dcbz32_ppc; | 267 | c->clear_blocks = clear_blocks_dcbz32_ppc; |