diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-12-15 21:46:02 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-12-20 16:40:45 +0400 |
commit | 8c53d39e7f0604127bfc96fa1182c8abe3847ac6 (patch) | |
tree | 18495cabf7f0e6d365871d3407f2534f2b80b653 /libavcodec/arm | |
parent | a925f723a915bc0255e2673f8817af5212131763 (diff) |
lavc: introduce VideoDSPContext
Move some functions from dsputil. The idea is that videodsp contains
functions that are useful for a large and varied set of video decoders.
Currently, it contains emulated_edge_mc() and prefetch().
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/Makefile | 5 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_arm.S | 10 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_armv5te.c | 4 | ||||
-rw-r--r-- | libavcodec/arm/videodsp_armv5te.S | 33 | ||||
-rw-r--r-- | libavcodec/arm/videodsp_init_arm.c | 29 |
5 files changed, 68 insertions, 13 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index b315d8da0e..ac486f47dc 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -30,6 +30,8 @@ OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \ arm/rv40dsp_init_arm.o \ +OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o \ + OBJS += arm/dsputil_init_arm.o \ arm/dsputil_arm.o \ arm/fft_init_arm.o \ @@ -41,6 +43,9 @@ OBJS += arm/dsputil_init_arm.o \ ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \ arm/mpegvideo_armv5te_s.o \ +ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \ + arm/videodsp_armv5te.o \ + ARMV5TE-OBJS += arm/dsputil_init_armv5te.o \ arm/simple_idct_armv5te.o \ diff --git a/libavcodec/arm/dsputil_arm.S b/libavcodec/arm/dsputil_arm.S index ffb6eb4b50..8504032bf4 100644 --- a/libavcodec/arm/dsputil_arm.S +++ b/libavcodec/arm/dsputil_arm.S @@ -22,15 +22,7 @@ #include "config.h" #include "libavutil/arm/asm.S" -#if HAVE_ARMV5TE_EXTERNAL -function ff_prefetch_arm, export=1 - subs r2, r2, #1 - pld [r0] - add r0, r0, r1 - bne ff_prefetch_arm - bx lr -endfunc -#else +#if !HAVE_ARMV5TE_EXTERNAL #define pld @ #endif diff --git a/libavcodec/arm/dsputil_init_armv5te.c b/libavcodec/arm/dsputil_init_armv5te.c index f37ffc3e9c..17017aa17d 100644 --- a/libavcodec/arm/dsputil_init_armv5te.c +++ b/libavcodec/arm/dsputil_init_armv5te.c @@ -25,8 +25,6 @@ void ff_simple_idct_armv5te(DCTELEM *data); void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data); void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data); -void ff_prefetch_arm(void *mem, int stride, int h); - av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) { if (avctx->bits_per_raw_sample <= 8 && @@ -37,6 +35,4 @@ av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) c->idct = ff_simple_idct_armv5te; c->idct_permutation_type = FF_NO_IDCT_PERM; } - - c->prefetch = ff_prefetch_arm; } diff --git a/libavcodec/arm/videodsp_armv5te.S b/libavcodec/arm/videodsp_armv5te.S new file mode 100644 index 0000000000..96e92d5a73 --- /dev/null +++ b/libavcodec/arm/videodsp_armv5te.S @@ -0,0 +1,33 @@ +@ +@ ARMv5te optimized DSP utils +@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp> +@ +@ This file is part of Libav. +@ +@ Libav is free software; you can redistribute it and/or +@ modify it under the terms of the GNU Lesser General Public +@ License as published by the Free Software Foundation; either +@ version 2.1 of the License, or (at your option) any later version. +@ +@ Libav is distributed in the hope that it will be useful, +@ but WITHOUT ANY WARRANTY; without even the implied warranty of +@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +@ Lesser General Public License for more details. +@ +@ You should have received a copy of the GNU Lesser General Public +@ License along with Libav; if not, write to the Free Software +@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +@ + +#include "config.h" +#include "libavutil/arm/asm.S" + +#if HAVE_ARMV5TE_EXTERNAL +function ff_prefetch_arm, export=1 + subs r2, r2, #1 + pld [r0] + add r0, r0, r1 + bne ff_prefetch_arm + bx lr +endfunc +#endif diff --git a/libavcodec/arm/videodsp_init_arm.c b/libavcodec/arm/videodsp_init_arm.c new file mode 100644 index 0000000000..6c97b2ce5e --- /dev/null +++ b/libavcodec/arm/videodsp_init_arm.c @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 Ronald S. Bultje + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/arm/cpu.h" +#include "libavcodec/videodsp.h" +#include "videodsp_arm.h" + +void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc) +{ + int cpu_flags = av_get_cpu_flags(); + if (have_armv5te(cpu_flags)) ff_videodsp_init_armv5te(ctx, bpc); +} |