diff options
author | Måns Rullgård <mans@mansr.com> | 2008-08-25 02:29:04 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2008-08-25 02:29:04 +0000 |
commit | 94cdcece9177ae33e9685671d816d707546c5c2a (patch) | |
tree | cf484ff24739d5bc9190b44787706a98b5debf42 /libavcodec/armv4l | |
parent | f1424cfd6dcfaf1d0d70ff1518710ccd3e5eac5d (diff) | |
download | ffmpeg-94cdcece9177ae33e9685671d816d707546c5c2a.tar.gz |
ARM: add prefetch function using ARMv5 PLD instruction
Originally committed as revision 14962 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/armv4l')
-rw-r--r-- | libavcodec/armv4l/dsputil_arm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/armv4l/dsputil_arm.c b/libavcodec/armv4l/dsputil_arm.c index af4e470be9..100b89ef8a 100644 --- a/libavcodec/armv4l/dsputil_arm.c +++ b/libavcodec/armv4l/dsputil_arm.c @@ -203,6 +203,19 @@ static void simple_idct_ipp_add(uint8_t *dest, int line_size, DCTELEM *block) } #endif +#ifdef HAVE_ARMV5TE +static void prefetch_arm(void *mem, int stride, int h) +{ + asm volatile( + "1: \n\t" + "subs %0, %0, #1 \n\t" + "pld [%1] \n\t" + "add %1, %1, %2 \n\t" + "bgt 1b \n\t" + : "+r"(h), "+r"(mem) : "r"(stride)); +} +#endif + int mm_support(void) { return ENABLE_IWMMXT * MM_IWMMXT; @@ -279,6 +292,10 @@ void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx) c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm; +#ifdef HAVE_ARMV5TE + c->prefetch = prefetch_arm; +#endif + #ifdef HAVE_IWMMXT dsputil_init_iwmmxt(c, avctx); #endif |