diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-01 14:38:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-01 15:22:11 +0200 |
commit | 581b5f0b9b93969712e73e0ae6324bbd03e85d4e (patch) | |
tree | d1319dc7744ac67e6ebd3379f11ff6e4a8178dc1 /libavcodec/arm | |
parent | 909f53f2b285bc7dbe77d4690a03f3d114417297 (diff) | |
parent | e3fcb14347466095839c2a3c47ebecff02da891e (diff) | |
download | ffmpeg-581b5f0b9b93969712e73e0ae6324bbd03e85d4e.tar.gz |
Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'
* commit 'e3fcb14347466095839c2a3c47ebecff02da891e':
dsputil: Split off IDCT bits into their own context
Conflicts:
configure
libavcodec/aic.c
libavcodec/arm/Makefile
libavcodec/arm/dsputil_init_arm.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/asvdec.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.c
libavcodec/dvdec.c
libavcodec/dxva2_mpeg2.c
libavcodec/intrax8.c
libavcodec/mdec.c
libavcodec/mjpegdec.c
libavcodec/mjpegenc_common.h
libavcodec/mpegvideo.c
libavcodec/ppc/dsputil_altivec.h
libavcodec/ppc/dsputil_ppc.c
libavcodec/ppc/idctdsp.c
libavcodec/x86/Makefile
libavcodec/x86/dsputil_init.c
libavcodec/x86/dsputil_mmx.c
libavcodec/x86/dsputil_x86.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/Makefile | 23 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_arm.h | 4 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_armv6.S | 27 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_arm.c | 60 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_armv6.c | 18 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_arm.S (renamed from libavcodec/arm/dsputil_arm.S) | 2 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_arm.h | 34 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_armv6.S | 48 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_init_arm.c | 98 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_init_armv5te.c (renamed from libavcodec/arm/dsputil_init_armv5te.c) | 6 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_init_armv6.c | 48 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_init_neon.c (renamed from libavcodec/arm/dsputil_init_neon.c) | 8 | ||||
-rw-r--r-- | libavcodec/arm/idctdsp_neon.S (renamed from libavcodec/arm/dsputil_neon.S) | 2 |
13 files changed, 250 insertions, 128 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index 66a214028e..575e79fe5e 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -6,10 +6,7 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ arm/ac3dsp_arm.o OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_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 \ - arm/simple_idct_arm.o +OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \ arm/fft_fixed_init_arm.o OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o @@ -18,6 +15,10 @@ OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \ arm/hpeldsp_arm.o +OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \ + arm/idctdsp_arm.o \ + arm/jrevdct_arm.o \ + arm/simple_idct_arm.o OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o @@ -41,7 +42,7 @@ OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \ arm/rv40dsp_init_arm.o -ARMV5TE-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv5te.o \ +ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \ arm/simple_idct_armv5te.o ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \ arm/mpegvideo_armv5te_s.o @@ -52,11 +53,13 @@ ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \ - arm/dsputil_armv6.o \ - arm/simple_idct_armv6.o + arm/dsputil_armv6.o ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \ arm/hpeldsp_armv6.o +ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \ + arm/idctdsp_armv6.o \ + arm/simple_idct_armv6.o ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o @@ -86,9 +89,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \ arm/int_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/simple_idct_neon.o NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \ arm/fft_fixed_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o @@ -99,6 +99,9 @@ NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \ arm/hpeldsp_neon.o NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \ arm/hpeldsp_neon.o +NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \ + arm/idctdsp_neon.o \ + arm/simple_idct_neon.o NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \ arm/mdct_fixed_neon.o NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o diff --git a/libavcodec/arm/dsputil_arm.h b/libavcodec/arm/dsputil_arm.h index e1c42ee17f..cd7957d0ff 100644 --- a/libavcodec/arm/dsputil_arm.h +++ b/libavcodec/arm/dsputil_arm.h @@ -24,11 +24,7 @@ #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" -void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx, - unsigned high_bit_depth); void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); -void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx, - unsigned high_bit_depth); #endif /* AVCODEC_ARM_DSPUTIL_ARM_H */ diff --git a/libavcodec/arm/dsputil_armv6.S b/libavcodec/arm/dsputil_armv6.S index 6ec238b8b5..8876d5fa18 100644 --- a/libavcodec/arm/dsputil_armv6.S +++ b/libavcodec/arm/dsputil_armv6.S @@ -20,33 +20,6 @@ #include "libavutil/arm/asm.S" -function ff_add_pixels_clamped_armv6, export=1 - push {r4-r8,lr} - mov r3, #8 -1: - ldm r0!, {r4,r5,r12,lr} - ldrd r6, r7, [r1] - pkhbt r8, r4, r5, lsl #16 - pkhtb r5, r5, r4, asr #16 - pkhbt r4, r12, lr, lsl #16 - pkhtb lr, lr, r12, asr #16 - pld [r1, r2] - uxtab16 r8, r8, r6 - uxtab16 r5, r5, r6, ror #8 - uxtab16 r4, r4, r7 - uxtab16 lr, lr, r7, ror #8 - usat16 r8, #8, r8 - usat16 r5, #8, r5 - usat16 r4, #8, r4 - usat16 lr, #8, lr - orr r6, r8, r5, lsl #8 - orr r7, r4, lr, lsl #8 - subs r3, r3, #1 - strd_post r6, r7, r1, r2 - bgt 1b - pop {r4-r8,pc} -endfunc - function ff_get_pixels_armv6, export=1 pld [r1, r2] push {r4-r8, lr} diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index c3a48cdecf..1a7433cee6 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -28,71 +28,11 @@ #include "libavcodec/dsputil.h" #include "dsputil_arm.h" -void ff_j_rev_dct_arm(int16_t *data); -void ff_simple_idct_arm(int16_t *data); - -/* XXX: local hack */ -static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); -static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); - -void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, - int line_size); - -/* XXX: those functions should be suppressed ASAP when all IDCTs are - * converted */ -static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) -{ - ff_j_rev_dct_arm(block); - ff_put_pixels_clamped(block, dest, line_size); -} - -static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) -{ - ff_j_rev_dct_arm(block); - ff_add_pixels_clamped(block, dest, line_size); -} - -static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) -{ - ff_simple_idct_arm(block); - ff_put_pixels_clamped(block, dest, line_size); -} - -static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) -{ - ff_simple_idct_arm(block); - ff_add_pixels_clamped(block, dest, line_size); -} - av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { int cpu_flags = av_get_cpu_flags(); - ff_put_pixels_clamped = c->put_pixels_clamped; - ff_add_pixels_clamped = c->add_pixels_clamped; - - if (!avctx->lowres && !high_bit_depth) { - if (avctx->idct_algo == FF_IDCT_AUTO || - avctx->idct_algo == FF_IDCT_ARM) { - c->idct_put = j_rev_dct_arm_put; - c->idct_add = j_rev_dct_arm_add; - c->idct = ff_j_rev_dct_arm; - c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; - } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) { - c->idct_put = simple_idct_arm_put; - c->idct_add = simple_idct_arm_add; - c->idct = ff_simple_idct_arm; - c->idct_permutation_type = FF_NO_IDCT_PERM; - } - } - - c->add_pixels_clamped = ff_add_pixels_clamped_arm; - - if (have_armv5te(cpu_flags)) - ff_dsputil_init_armv5te(c, avctx, high_bit_depth); if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx, high_bit_depth); - if (have_neon(cpu_flags)) - ff_dsputil_init_neon(c, avctx, high_bit_depth); } diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index 17d55eaac7..57b90daa1e 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -26,13 +26,6 @@ #include "libavcodec/mpegvideo.h" #include "dsputil_arm.h" -void ff_simple_idct_armv6(int16_t *data); -void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); -void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); - -void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels, - int line_size); - void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride); void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); @@ -56,17 +49,6 @@ int ff_pix_sum_armv6(uint8_t *pix, int line_size); av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { - if (!avctx->lowres && !high_bit_depth) { - if (avctx->idct_algo == FF_IDCT_AUTO || - avctx->idct_algo == FF_IDCT_SIMPLEARMV6) { - c->idct_put = ff_simple_idct_put_armv6; - c->idct_add = ff_simple_idct_add_armv6; - c->idct = ff_simple_idct_armv6; - c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; - } - } - c->add_pixels_clamped = ff_add_pixels_clamped_armv6; - if (!high_bit_depth) c->get_pixels = ff_get_pixels_armv6; c->diff_pixels = ff_diff_pixels_armv6; diff --git a/libavcodec/arm/dsputil_arm.S b/libavcodec/arm/idctdsp_arm.S index e0a8a2e97f..e8333c4b70 100644 --- a/libavcodec/arm/dsputil_arm.S +++ b/libavcodec/arm/idctdsp_arm.S @@ -1,5 +1,5 @@ @ -@ ARMv4 optimized DSP utils +@ ARMv4-optimized IDCT functions @ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp> @ @ This file is part of FFmpeg. diff --git a/libavcodec/arm/idctdsp_arm.h b/libavcodec/arm/idctdsp_arm.h new file mode 100644 index 0000000000..d7bc5cd02a --- /dev/null +++ b/libavcodec/arm/idctdsp_arm.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009 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 + */ + +#ifndef AVCODEC_ARM_IDCTDSP_ARM_H +#define AVCODEC_ARM_IDCTDSP_ARM_H + +#include "libavcodec/avcodec.h" +#include "libavcodec/idctdsp.h" + +void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); + +#endif /* AVCODEC_ARM_IDCTDSP_ARM_H */ diff --git a/libavcodec/arm/idctdsp_armv6.S b/libavcodec/arm/idctdsp_armv6.S new file mode 100644 index 0000000000..a6e77d6da1 --- /dev/null +++ b/libavcodec/arm/idctdsp_armv6.S @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2009 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_add_pixels_clamped_armv6, export=1 + push {r4-r8,lr} + mov r3, #8 +1: + ldm r0!, {r4,r5,r12,lr} + ldrd r6, r7, [r1] + pkhbt r8, r4, r5, lsl #16 + pkhtb r5, r5, r4, asr #16 + pkhbt r4, r12, lr, lsl #16 + pkhtb lr, lr, r12, asr #16 + pld [r1, r2] + uxtab16 r8, r8, r6 + uxtab16 r5, r5, r6, ror #8 + uxtab16 r4, r4, r7 + uxtab16 lr, lr, r7, ror #8 + usat16 r8, #8, r8 + usat16 r5, #8, r5 + usat16 r4, #8, r4 + usat16 lr, #8, lr + orr r6, r8, r5, lsl #8 + orr r7, r4, lr, lsl #8 + subs r3, r3, #1 + strd_post r6, r7, r1, r2 + bgt 1b + pop {r4-r8,pc} +endfunc diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c new file mode 100644 index 0000000000..cc5e116766 --- /dev/null +++ b/libavcodec/arm/idctdsp_init_arm.c @@ -0,0 +1,98 @@ +/* + * ARM-optimized IDCT functions + * Copyright (c) 2001 Lionel Ulmer + * + * 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/avcodec.h" +#include "libavcodec/idctdsp.h" +#include "idctdsp_arm.h" + +void ff_j_rev_dct_arm(int16_t *data); +void ff_simple_idct_arm(int16_t *data); + +/* XXX: local hack */ +static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); +static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); + +void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, + int line_size); + +/* XXX: those functions should be suppressed ASAP when all IDCTs are + * converted */ +static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) +{ + ff_j_rev_dct_arm(block); + ff_put_pixels_clamped(block, dest, line_size); +} + +static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) +{ + ff_j_rev_dct_arm(block); + ff_add_pixels_clamped(block, dest, line_size); +} + +static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) +{ + ff_simple_idct_arm(block); + ff_put_pixels_clamped(block, dest, line_size); +} + +static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) +{ + ff_simple_idct_arm(block); + ff_add_pixels_clamped(block, dest, line_size); +} + +av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) +{ + int cpu_flags = av_get_cpu_flags(); + + ff_put_pixels_clamped = c->put_pixels_clamped; + ff_add_pixels_clamped = c->add_pixels_clamped; + + if (!avctx->lowres && !high_bit_depth) { + if (avctx->idct_algo == FF_IDCT_AUTO || + avctx->idct_algo == FF_IDCT_ARM) { + c->idct_put = j_rev_dct_arm_put; + c->idct_add = j_rev_dct_arm_add; + c->idct = ff_j_rev_dct_arm; + c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; + } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) { + c->idct_put = simple_idct_arm_put; + c->idct_add = simple_idct_arm_add; + c->idct = ff_simple_idct_arm; + c->idct_permutation_type = FF_NO_IDCT_PERM; + } + } + + c->add_pixels_clamped = ff_add_pixels_clamped_arm; + + if (have_armv5te(cpu_flags)) + ff_idctdsp_init_armv5te(c, avctx, high_bit_depth); + if (have_armv6(cpu_flags)) + ff_idctdsp_init_armv6(c, avctx, high_bit_depth); + if (have_neon(cpu_flags)) + ff_idctdsp_init_neon(c, avctx, high_bit_depth); +} diff --git a/libavcodec/arm/dsputil_init_armv5te.c b/libavcodec/arm/idctdsp_init_armv5te.c index 0ba4f453ee..9ca36879d7 100644 --- a/libavcodec/arm/dsputil_init_armv5te.c +++ b/libavcodec/arm/idctdsp_init_armv5te.c @@ -22,14 +22,14 @@ #include "libavutil/attributes.h" #include "libavcodec/avcodec.h" -#include "libavcodec/dsputil.h" -#include "dsputil_arm.h" +#include "libavcodec/idctdsp.h" +#include "idctdsp_arm.h" void ff_simple_idct_armv5te(int16_t *data); void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data); void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data); -av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx, +av_cold void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { if (!avctx->lowres && !high_bit_depth && diff --git a/libavcodec/arm/idctdsp_init_armv6.c b/libavcodec/arm/idctdsp_init_armv6.c new file mode 100644 index 0000000000..27ca6cedb7 --- /dev/null +++ b/libavcodec/arm/idctdsp_init_armv6.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2009 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/avcodec.h" +#include "libavcodec/idctdsp.h" +#include "idctdsp_arm.h" + +void ff_simple_idct_armv6(int16_t *data); +void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); + +void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels, + int line_size); + +av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) +{ + if (!avctx->lowres && !high_bit_depth) { + if (avctx->idct_algo == FF_IDCT_AUTO || + avctx->idct_algo == FF_IDCT_SIMPLEARMV6) { + c->idct_put = ff_simple_idct_put_armv6; + c->idct_add = ff_simple_idct_add_armv6; + c->idct = ff_simple_idct_armv6; + c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; + } + } + c->add_pixels_clamped = ff_add_pixels_clamped_armv6; +} diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/idctdsp_init_neon.c index cf4017f236..d8684e7012 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/idctdsp_init_neon.c @@ -1,5 +1,5 @@ /* - * ARM NEON optimised DSP functions + * ARM-NEON-optimized IDCT functions * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> * * This file is part of FFmpeg. @@ -23,8 +23,8 @@ #include "libavutil/attributes.h" #include "libavcodec/avcodec.h" -#include "libavcodec/dsputil.h" -#include "dsputil_arm.h" +#include "libavcodec/idctdsp.h" +#include "idctdsp_arm.h" void ff_simple_idct_neon(int16_t *data); void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); @@ -34,7 +34,7 @@ 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); -av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx, +av_cold void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { if (!avctx->lowres && !high_bit_depth) { diff --git a/libavcodec/arm/dsputil_neon.S b/libavcodec/arm/idctdsp_neon.S index 4a2fce0005..1911a33468 100644 --- a/libavcodec/arm/dsputil_neon.S +++ b/libavcodec/arm/idctdsp_neon.S @@ -1,5 +1,5 @@ /* - * ARM NEON optimised DSP functions + * ARM-NEON-optimized IDCT functions * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> * * This file is part of FFmpeg. |