summaryrefslogtreecommitdiff
path: root/libavcodec/arm
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-18 22:27:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-18 22:34:48 +0200
commit204c4e953d895e15ab0908d715fd46181bf32add (patch)
treeaebdffe23aa1133eeb1db55b810135ecdfe1c188 /libavcodec/arm
parentc66978e29ad9cae2c71da83857c6a3cec11bb9cb (diff)
parentffdd93a25e64db82c053577f415ea82c54fd5235 (diff)
downloadffmpeg-204c4e953d895e15ab0908d715fd46181bf32add.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: ppc: fix build with altivec disabled vp3: move idct and loop filter pointers to new vp3dsp context build: add CONFIG_VP3DSP, reduce repetition in OBJS lists tscc2: do not add/subtract 128 bias during DCT tscc2: fix typo in DCT configure: clarify external library section of help output configure: mark libfdk-aac as nonfree configure: cosmetics: drop some unnecessary backslashes os_support: K&R formatting cosmetics Conflicts: configure libavcodec/vp3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r--libavcodec/arm/Makefile5
-rw-r--r--libavcodec/arm/dsputil_init_neon.c21
-rw-r--r--libavcodec/arm/vp3dsp_init_arm.c45
-rw-r--r--libavcodec/arm/vp3dsp_neon.S26
4 files changed, 47 insertions, 50 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile
index d2bdd50daa..a8e531cf18 100644
--- a/libavcodec/arm/Makefile
+++ b/libavcodec/arm/Makefile
@@ -11,6 +11,7 @@ ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
+OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_init_arm.o
OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_init_arm.o
OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_arm.o
@@ -75,13 +76,11 @@ NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_neon.o \
arm/rv40dsp_neon.o \
arm/h264cmc_neon.o \
-NEON-OBJS-$(CONFIG_VP3_DECODER) += arm/vp3dsp_neon.o
+NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
NEON-OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_neon.o \
- arm/vp3dsp_neon.o \
NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_neon.o \
- arm/vp3dsp_neon.o \
NEON-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_neon.o \
arm/vp8dsp_neon.o
diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c
index ef5a8df85f..5533a28c42 100644
--- a/libavcodec/arm/dsputil_init_neon.c
+++ b/libavcodec/arm/dsputil_init_neon.c
@@ -29,11 +29,6 @@ void ff_simple_idct_neon(DCTELEM *data);
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_vp3_idct_neon(DCTELEM *data);
-void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data);
-
void ff_clear_block_neon(DCTELEM *block);
void ff_clear_blocks_neon(DCTELEM *blocks);
@@ -147,9 +142,6 @@ void ff_avg_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_avg_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_avg_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
-void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
-
void ff_vector_fmul_window_neon(float *dst, const float *src0,
const float *src1, const float *win, int len);
void ff_vector_fmul_scalar_neon(float *dst, const float *src, float mul,
@@ -186,13 +178,6 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
c->idct_add = ff_simple_idct_add_neon;
c->idct = ff_simple_idct_neon;
c->idct_permutation_type = FF_PARTTRANS_IDCT_PERM;
- } else if ((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER ||
- CONFIG_VP6_DECODER) &&
- avctx->idct_algo == FF_IDCT_VP3) {
- c->idct_put = ff_vp3_idct_put_neon;
- c->idct_add = ff_vp3_idct_add_neon;
- c->idct = ff_vp3_idct_neon;
- c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
}
}
@@ -319,12 +304,6 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
}
- if (CONFIG_VP3_DECODER) {
- c->vp3_v_loop_filter = ff_vp3_v_loop_filter_neon;
- c->vp3_h_loop_filter = ff_vp3_h_loop_filter_neon;
- c->vp3_idct_dc_add = ff_vp3_idct_dc_add_neon;
- }
-
c->vector_fmul_window = ff_vector_fmul_window_neon;
c->vector_fmul_scalar = ff_vector_fmul_scalar_neon;
c->butterflies_float = ff_butterflies_float_neon;
diff --git a/libavcodec/arm/vp3dsp_init_arm.c b/libavcodec/arm/vp3dsp_init_arm.c
new file mode 100644
index 0000000000..90fc34b218
--- /dev/null
+++ b/libavcodec/arm/vp3dsp_init_arm.c
@@ -0,0 +1,45 @@
+/*
+ * 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 "libavutil/cpu.h"
+#include "libavutil/arm/cpu.h"
+#include "libavcodec/vp3dsp.h"
+
+void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data);
+
+void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
+void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
+
+av_cold void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ c->idct_put = ff_vp3_idct_put_neon;
+ c->idct_add = ff_vp3_idct_add_neon;
+ c->idct_dc_add = ff_vp3_idct_dc_add_neon;
+ c->v_loop_filter = ff_vp3_v_loop_filter_neon;
+ c->h_loop_filter = ff_vp3_h_loop_filter_neon;
+ c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
+ }
+}
diff --git a/libavcodec/arm/vp3dsp_neon.S b/libavcodec/arm/vp3dsp_neon.S
index 70cfd29121..0c88562b45 100644
--- a/libavcodec/arm/vp3dsp_neon.S
+++ b/libavcodec/arm/vp3dsp_neon.S
@@ -260,32 +260,6 @@ endfunc
VP3_IDCT_END row
VP3_IDCT_END col
-function ff_vp3_idct_neon, export=1
- mov ip, lr
- mov r2, r0
- bl vp3_idct_start_neon
- bl vp3_idct_end_row_neon
- mov r3, #8
- bl vp3_idct_core_neon
- bl vp3_idct_end_col_neon
- mov lr, ip
- vpop {d8-d15}
-
- vshr.s16 q8, q8, #4
- vshr.s16 q9, q9, #4
- vshr.s16 q10, q10, #4
- vshr.s16 q11, q11, #4
- vshr.s16 q12, q12, #4
- vst1.64 {d16-d19}, [r0,:128]!
- vshr.s16 q13, q13, #4
- vshr.s16 q14, q14, #4
- vst1.64 {d20-d23}, [r0,:128]!
- vshr.s16 q15, q15, #4
- vst1.64 {d24-d27}, [r0,:128]!
- vst1.64 {d28-d31}, [r0,:128]!
- bx lr
-endfunc
-
function ff_vp3_idct_put_neon, export=1
mov ip, lr
bl vp3_idct_start_neon