diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-19 04:41:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-19 04:54:38 +0200 |
commit | 2b05db4f8102148d013755ac2a7e47f6d79ff7ca (patch) | |
tree | 8135823ee5f9db622126672b644e06c243ae3c01 /libavcodec/arm | |
parent | ab12373956e92b865bced9b05b12971f062cfd3e (diff) | |
parent | e74433a8e6fc00c8dbde293c97a3e45384c2c1d9 (diff) | |
download | ffmpeg-2b05db4f8102148d013755ac2a7e47f6d79ff7ca.tar.gz |
Merge commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9'
* commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9':
dsputil: Split clear_block*/fill_block* off into a separate context
Conflicts:
configure
libavcodec/asvdec.c
libavcodec/dnxhddec.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.h
libavcodec/eamad.c
libavcodec/intrax8.c
libavcodec/mjpegdec.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/vc1dec.c
libavcodec/x86/dsputil_init.c
libavcodec/x86/dsputil_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/Makefile | 3 | ||||
-rw-r--r-- | libavcodec/arm/blockdsp_arm.h | 26 | ||||
-rw-r--r-- | libavcodec/arm/blockdsp_init_arm.c | 33 | ||||
-rw-r--r-- | libavcodec/arm/blockdsp_init_neon.c | 37 | ||||
-rw-r--r-- | libavcodec/arm/blockdsp_neon.S | 38 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_neon.c | 8 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_neon.S | 16 |
7 files changed, 137 insertions, 24 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index 3abc6e6853..ed2306a4ec 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -4,6 +4,7 @@ OBJS += arm/fmtconvert_init_arm.o OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ arm/ac3dsp_arm.o +OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o \ arm/dsputil_arm.o \ arm/jrevdct_arm.o \ @@ -79,6 +80,8 @@ VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_vfp.o \ NEON-OBJS += arm/fmtconvert_neon.o NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o +NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \ + arm/blockdsp_neon.o NEON-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_neon.o \ arm/dsputil_neon.o \ arm/int_neon.o \ diff --git a/libavcodec/arm/blockdsp_arm.h b/libavcodec/arm/blockdsp_arm.h new file mode 100644 index 0000000000..2688d36254 --- /dev/null +++ b/libavcodec/arm/blockdsp_arm.h @@ -0,0 +1,26 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_ARM_BLOCKDSP_ARM_H +#define AVCODEC_ARM_BLOCKDSP_ARM_H + +#include "libavcodec/blockdsp.h" + +void ff_blockdsp_init_neon(BlockDSPContext *c, unsigned high_bit_depth); + +#endif /* AVCODEC_ARM_BLOCKDSP_ARM_H */ diff --git a/libavcodec/arm/blockdsp_init_arm.c b/libavcodec/arm/blockdsp_init_arm.c new file mode 100644 index 0000000000..3b86a71096 --- /dev/null +++ b/libavcodec/arm/blockdsp_init_arm.c @@ -0,0 +1,33 @@ +/* + * ARM optimized block operations + * + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/arm/cpu.h" +#include "libavcodec/blockdsp.h" +#include "blockdsp_arm.h" + +av_cold void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth) +{ + int cpu_flags = av_get_cpu_flags(); + + if (have_neon(cpu_flags)) + ff_blockdsp_init_neon(c, high_bit_depth); +} diff --git a/libavcodec/arm/blockdsp_init_neon.c b/libavcodec/arm/blockdsp_init_neon.c new file mode 100644 index 0000000000..62b51fc788 --- /dev/null +++ b/libavcodec/arm/blockdsp_init_neon.c @@ -0,0 +1,37 @@ +/* + * ARM NEON optimised block operations + * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> + * + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> + +#include "libavutil/attributes.h" +#include "libavcodec/blockdsp.h" +#include "blockdsp_arm.h" + +void ff_clear_block_neon(int16_t *block); +void ff_clear_blocks_neon(int16_t *blocks); + +av_cold void ff_blockdsp_init_neon(BlockDSPContext *c, unsigned high_bit_depth) +{ + if (!high_bit_depth) { + c->clear_block = ff_clear_block_neon; + c->clear_blocks = ff_clear_blocks_neon; + } +} diff --git a/libavcodec/arm/blockdsp_neon.S b/libavcodec/arm/blockdsp_neon.S new file mode 100644 index 0000000000..9fc63cba5b --- /dev/null +++ b/libavcodec/arm/blockdsp_neon.S @@ -0,0 +1,38 @@ +/* + * ARM NEON optimised block functions + * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> + * + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/arm/asm.S" + +function ff_clear_block_neon, export=1 + vmov.i16 q0, #0 + .rept 8 + vst1.16 {q0}, [r0,:128]! + .endr + bx lr +endfunc + +function ff_clear_blocks_neon, export=1 + vmov.i16 q0, #0 + .rept 8*6 + vst1.16 {q0}, [r0,:128]! + .endr + bx lr +endfunc diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c index c7b393aa52..2d30d40117 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/dsputil_init_neon.c @@ -30,9 +30,6 @@ void ff_simple_idct_neon(int16_t *data); void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); -void ff_clear_block_neon(int16_t *block); -void ff_clear_blocks_neon(int16_t *blocks); - void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int); void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int); void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int); @@ -61,11 +58,6 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx, c->put_pixels_clamped = ff_put_pixels_clamped_neon; c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon; - if (!high_bit_depth) { - c->clear_block = ff_clear_block_neon; - c->clear_blocks = ff_clear_blocks_neon; - } - c->vector_clipf = ff_vector_clipf_neon; c->vector_clip_int32 = ff_vector_clip_int32_neon; diff --git a/libavcodec/arm/dsputil_neon.S b/libavcodec/arm/dsputil_neon.S index 6c8231efa6..a8e1db5ca1 100644 --- a/libavcodec/arm/dsputil_neon.S +++ b/libavcodec/arm/dsputil_neon.S @@ -21,22 +21,6 @@ #include "libavutil/arm/asm.S" -function ff_clear_block_neon, export=1 - vmov.i16 q0, #0 - .rept 8 - vst1.16 {q0}, [r0,:128]! - .endr - bx lr -endfunc - -function ff_clear_blocks_neon, export=1 - vmov.i16 q0, #0 - .rept 8*6 - vst1.16 {q0}, [r0,:128]! - .endr - bx lr -endfunc - function ff_put_pixels_clamped_neon, export=1 vld1.16 {d16-d19}, [r0,:128]! vqmovun.s16 d0, q8 |