* 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
Showing the changes to libavcodec/arm (13 of 84 files). Show all
Unified · Split
| @@ -6,10 +6,7 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ · 5 unmodified lines | ||
| 6 | 6 | arm/ac3dsp_arm.o |
| 7 | 7 | OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o |
| 8 | 8 | OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o |
| 9 | −OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o \ | |
| 10 | − arm/dsputil_arm.o \ | |
| 11 | − arm/jrevdct_arm.o \ | |
| 12 | − arm/simple_idct_arm.o | |
| 9 | +OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o | |
| 13 | 10 | OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \ |
| 14 | 11 | arm/fft_fixed_init_arm.o |
| 15 | 12 | OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o |
| @@ -18,6 +15,10 @@ OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o · 2 unmodified lines | ||
| 18 | 15 | OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o |
| 19 | 16 | OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \ |
| 20 | 17 | arm/hpeldsp_arm.o |
| 18 | +OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \ | |
| 19 | + arm/idctdsp_arm.o \ | |
| 20 | + arm/jrevdct_arm.o \ | |
| 21 | + arm/simple_idct_arm.o | |
| 21 | 22 | OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o |
| 22 | 23 | OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o |
| 23 | 24 | OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o |
| @@ -41,7 +42,7 @@ OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o · 17 unmodified lines | ||
| 41 | 42 | OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \ |
| 42 | 43 | arm/rv40dsp_init_arm.o |
| 43 | 44 | |
| 44 | −ARMV5TE-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv5te.o \ | |
| 45 | +ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \ | |
| 45 | 46 | arm/simple_idct_armv5te.o |
| 46 | 47 | ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \ |
| 47 | 48 | arm/mpegvideo_armv5te_s.o |
| @@ -52,11 +53,13 @@ ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o · 4 unmodified lines | ||
| 52 | 53 | |
| 53 | 54 | ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o |
| 54 | 55 | ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \ |
| 55 | − arm/dsputil_armv6.o \ | |
| 56 | − arm/simple_idct_armv6.o | |
| 56 | + arm/dsputil_armv6.o | |
| 57 | 57 | ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o |
| 58 | 58 | ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \ |
| 59 | 59 | arm/hpeldsp_armv6.o |
| 60 | +ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \ | |
| 61 | + arm/idctdsp_armv6.o \ | |
| 62 | + arm/simple_idct_armv6.o | |
| 60 | 63 | ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o |
| 61 | 64 | |
| 62 | 65 | ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o |
| @@ -86,9 +89,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \ · 23 unmodified lines | ||
| 86 | 89 | arm/int_neon.o |
| 87 | 90 | NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \ |
| 88 | 91 | arm/blockdsp_neon.o |
| 89 | −NEON-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_neon.o \ | |
| 90 | − arm/dsputil_neon.o \ | |
| 91 | − arm/simple_idct_neon.o | |
| 92 | 92 | NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \ |
| 93 | 93 | arm/fft_fixed_neon.o |
| 94 | 94 | NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o |
| @@ -99,6 +99,9 @@ NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \ · 4 unmodified lines | ||
| 99 | 99 | arm/hpeldsp_neon.o |
| 100 | 100 | NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \ |
| 101 | 101 | arm/hpeldsp_neon.o |
| 102 | +NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \ | |
| 103 | + arm/idctdsp_neon.o \ | |
| 104 | + arm/simple_idct_neon.o | |
| 102 | 105 | NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \ |
| 103 | 106 | arm/mdct_fixed_neon.o |
| 104 | 107 | NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o |
| @@ -24,11 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | #include "libavcodec/avcodec.h" |
| 25 | 25 | #include "libavcodec/dsputil.h" |
| 26 | 26 | |
| 27 | −void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx, | |
| 28 | − unsigned high_bit_depth); | |
| 29 | 27 | void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, |
| 30 | 28 | unsigned high_bit_depth); |
| 31 | −void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx, | |
| 32 | − unsigned high_bit_depth); | |
| 33 | 29 | |
| 34 | 30 | #endif /* AVCODEC_ARM_DSPUTIL_ARM_H */ |
| @@ -20,33 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #include "libavutil/arm/asm.S" |
| 22 | 22 | |
| 23 | −function ff_add_pixels_clamped_armv6, export=1 | |
| 24 | − push {r4-r8,lr} | |
| 25 | − mov r3, #8 | |
| 26 | −1: | |
| 27 | − ldm r0!, {r4,r5,r12,lr} | |
| 28 | − ldrd r6, r7, [r1] | |
| 29 | − pkhbt r8, r4, r5, lsl #16 | |
| 30 | − pkhtb r5, r5, r4, asr #16 | |
| 31 | − pkhbt r4, r12, lr, lsl #16 | |
| 32 | − pkhtb lr, lr, r12, asr #16 | |
| 33 | − pld [r1, r2] | |
| 34 | − uxtab16 r8, r8, r6 | |
| 35 | − uxtab16 r5, r5, r6, ror #8 | |
| 36 | − uxtab16 r4, r4, r7 | |
| 37 | − uxtab16 lr, lr, r7, ror #8 | |
| 38 | − usat16 r8, #8, r8 | |
| 39 | − usat16 r5, #8, r5 | |
| 40 | − usat16 r4, #8, r4 | |
| 41 | − usat16 lr, #8, lr | |
| 42 | − orr r6, r8, r5, lsl #8 | |
| 43 | − orr r7, r4, lr, lsl #8 | |
| 44 | − subs r3, r3, #1 | |
| 45 | − strd_post r6, r7, r1, r2 | |
| 46 | − bgt 1b | |
| 47 | − pop {r4-r8,pc} | |
| 48 | −endfunc | |
| 49 | − | |
| 50 | 23 | function ff_get_pixels_armv6, export=1 |
| 51 | 24 | pld [r1, r2] |
| 52 | 25 | push {r4-r8, lr} |
| @@ -28,71 +28,11 @@ · 27 unmodified lines | ||
| 28 | 28 | #include "libavcodec/dsputil.h" |
| 29 | 29 | #include "dsputil_arm.h" |
| 30 | 30 | |
| 31 | −void ff_j_rev_dct_arm(int16_t *data); | |
| 32 | −void ff_simple_idct_arm(int16_t *data); | |
| 33 | − | |
| 34 | −/* XXX: local hack */ | |
| 35 | −static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); | |
| 36 | −static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); | |
| 37 | − | |
| 38 | −void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, | |
| 39 | − int line_size); | |
| 40 | − | |
| 41 | −/* XXX: those functions should be suppressed ASAP when all IDCTs are | |
| 42 | − * converted */ | |
| 43 | −static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) | |
| 44 | −{ | |
| 45 | − ff_j_rev_dct_arm(block); | |
| 46 | − ff_put_pixels_clamped(block, dest, line_size); | |
| 47 | −} | |
| 48 | − | |
| 49 | −static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) | |
| 50 | −{ | |
| 51 | − ff_j_rev_dct_arm(block); | |
| 52 | − ff_add_pixels_clamped(block, dest, line_size); | |
| 53 | −} | |
| 54 | − | |
| 55 | −static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) | |
| 56 | −{ | |
| 57 | − ff_simple_idct_arm(block); | |
| 58 | − ff_put_pixels_clamped(block, dest, line_size); | |
| 59 | −} | |
| 60 | − | |
| 61 | −static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) | |
| 62 | −{ | |
| 63 | − ff_simple_idct_arm(block); | |
| 64 | − ff_add_pixels_clamped(block, dest, line_size); | |
| 65 | −} | |
| 66 | − | |
| 67 | 31 | av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx, |
| 68 | 32 | unsigned high_bit_depth) |
| 69 | 33 | { |
| 70 | 34 | int cpu_flags = av_get_cpu_flags(); |
| 71 | 35 | |
| 72 | − ff_put_pixels_clamped = c->put_pixels_clamped; | |
| 73 | − ff_add_pixels_clamped = c->add_pixels_clamped; | |
| 74 | − | |
| 75 | − if (!avctx->lowres && !high_bit_depth) { | |
| 76 | − if (avctx->idct_algo == FF_IDCT_AUTO || | |
| 77 | − avctx->idct_algo == FF_IDCT_ARM) { | |
| 78 | − c->idct_put = j_rev_dct_arm_put; | |
| 79 | − c->idct_add = j_rev_dct_arm_add; | |
| 80 | − c->idct = ff_j_rev_dct_arm; | |
| 81 | − c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; | |
| 82 | − } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) { | |
| 83 | − c->idct_put = simple_idct_arm_put; | |
| 84 | − c->idct_add = simple_idct_arm_add; | |
| 85 | − c->idct = ff_simple_idct_arm; | |
| 86 | − c->idct_permutation_type = FF_NO_IDCT_PERM; | |
| 87 | − } | |
| 88 | − } | |
| 89 | − | |
| 90 | − c->add_pixels_clamped = ff_add_pixels_clamped_arm; | |
| 91 | − | |
| 92 | − if (have_armv5te(cpu_flags)) | |
| 93 | − ff_dsputil_init_armv5te(c, avctx, high_bit_depth); | |
| 94 | 36 | if (have_armv6(cpu_flags)) |
| 95 | 37 | ff_dsputil_init_armv6(c, avctx, high_bit_depth); |
| 96 | − if (have_neon(cpu_flags)) | |
| 97 | − ff_dsputil_init_neon(c, avctx, high_bit_depth); | |
| 98 | 38 | } |
| @@ -26,13 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "libavcodec/mpegvideo.h" |
| 27 | 27 | #include "dsputil_arm.h" |
| 28 | 28 | |
| 29 | −void ff_simple_idct_armv6(int16_t *data); | |
| 30 | −void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); | |
| 31 | −void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); | |
| 32 | − | |
| 33 | −void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels, | |
| 34 | − int line_size); | |
| 35 | − | |
| 36 | 29 | void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride); |
| 37 | 30 | void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, |
| 38 | 31 | const uint8_t *s2, int stride); |
| @@ -56,17 +49,6 @@ int ff_pix_sum_armv6(uint8_t *pix, int line_size); · 17 unmodified lines | ||
| 56 | 49 | av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, |
| 57 | 50 | unsigned high_bit_depth) |
| 58 | 51 | { |
| 59 | − if (!avctx->lowres && !high_bit_depth) { | |
| 60 | − if (avctx->idct_algo == FF_IDCT_AUTO || | |
| 61 | − avctx->idct_algo == FF_IDCT_SIMPLEARMV6) { | |
| 62 | − c->idct_put = ff_simple_idct_put_armv6; | |
| 63 | − c->idct_add = ff_simple_idct_add_armv6; | |
| 64 | − c->idct = ff_simple_idct_armv6; | |
| 65 | − c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; | |
| 66 | − } | |
| 67 | − } | |
| 68 | − c->add_pixels_clamped = ff_add_pixels_clamped_armv6; | |
| 69 | − | |
| 70 | 52 | if (!high_bit_depth) |
| 71 | 53 | c->get_pixels = ff_get_pixels_armv6; |
| 72 | 54 | c->diff_pixels = ff_diff_pixels_armv6; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | @ |
| 2 | −@ ARMv4 optimized DSP utils | |
| 2 | +@ ARMv4-optimized IDCT functions | |
| 3 | 3 | @ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp> |
| 4 | 4 | @ |
| 5 | 5 | @ This file is part of FFmpeg. |
| @@ -0,0 +1,34 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2009 Mans Rullgard <mans@mansr.com> | |
| 3 | + * | |
| 4 | + * This file is part of FFmpeg. | |
| 5 | + * | |
| 6 | + * FFmpeg is free software; you can redistribute it and/or | |
| 7 | + * modify it under the terms of the GNU Lesser General Public | |
| 8 | + * License as published by the Free Software Foundation; either | |
| 9 | + * version 2.1 of the License, or (at your option) any later version. | |
| 10 | + * | |
| 11 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | + * Lesser General Public License for more details. | |
| 15 | + * | |
| 16 | + * You should have received a copy of the GNU Lesser General Public | |
| 17 | + * License along with FFmpeg; if not, write to the Free Software | |
| 18 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 19 | + */ | |
| 20 | + | |
| 21 | +#ifndef AVCODEC_ARM_IDCTDSP_ARM_H | |
| 22 | +#define AVCODEC_ARM_IDCTDSP_ARM_H | |
| 23 | + | |
| 24 | +#include "libavcodec/avcodec.h" | |
| 25 | +#include "libavcodec/idctdsp.h" | |
| 26 | + | |
| 27 | +void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 28 | + unsigned high_bit_depth); | |
| 29 | +void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 30 | + unsigned high_bit_depth); | |
| 31 | +void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 32 | + unsigned high_bit_depth); | |
| 33 | + | |
| 34 | +#endif /* AVCODEC_ARM_IDCTDSP_ARM_H */ | |
| @@ -0,0 +1,48 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2009 Mans Rullgard <mans@mansr.com> | |
| 3 | + * | |
| 4 | + * This file is part of FFmpeg. | |
| 5 | + * | |
| 6 | + * FFmpeg is free software; you can redistribute it and/or | |
| 7 | + * modify it under the terms of the GNU Lesser General Public | |
| 8 | + * License as published by the Free Software Foundation; either | |
| 9 | + * version 2.1 of the License, or (at your option) any later version. | |
| 10 | + * | |
| 11 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | + * Lesser General Public License for more details. | |
| 15 | + * | |
| 16 | + * You should have received a copy of the GNU Lesser General Public | |
| 17 | + * License along with FFmpeg; if not, write to the Free Software | |
| 18 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 19 | + */ | |
| 20 | + | |
| 21 | +#include "libavutil/arm/asm.S" | |
| 22 | + | |
| 23 | +function ff_add_pixels_clamped_armv6, export=1 | |
| 24 | + push {r4-r8,lr} | |
| 25 | + mov r3, #8 | |
| 26 | +1: | |
| 27 | + ldm r0!, {r4,r5,r12,lr} | |
| 28 | + ldrd r6, r7, [r1] | |
| 29 | + pkhbt r8, r4, r5, lsl #16 | |
| 30 | + pkhtb r5, r5, r4, asr #16 | |
| 31 | + pkhbt r4, r12, lr, lsl #16 | |
| 32 | + pkhtb lr, lr, r12, asr #16 | |
| 33 | + pld [r1, r2] | |
| 34 | + uxtab16 r8, r8, r6 | |
| 35 | + uxtab16 r5, r5, r6, ror #8 | |
| 36 | + uxtab16 r4, r4, r7 | |
| 37 | + uxtab16 lr, lr, r7, ror #8 | |
| 38 | + usat16 r8, #8, r8 | |
| 39 | + usat16 r5, #8, r5 | |
| 40 | + usat16 r4, #8, r4 | |
| 41 | + usat16 lr, #8, lr | |
| 42 | + orr r6, r8, r5, lsl #8 | |
| 43 | + orr r7, r4, lr, lsl #8 | |
| 44 | + subs r3, r3, #1 | |
| 45 | + strd_post r6, r7, r1, r2 | |
| 46 | + bgt 1b | |
| 47 | + pop {r4-r8,pc} | |
| 48 | +endfunc | |
| @@ -0,0 +1,98 @@ | ||
| 1 | +/* | |
| 2 | + * ARM-optimized IDCT functions | |
| 3 | + * Copyright (c) 2001 Lionel Ulmer | |
| 4 | + * | |
| 5 | + * This file is part of FFmpeg. | |
| 6 | + * | |
| 7 | + * FFmpeg is free software; you can redistribute it and/or | |
| 8 | + * modify it under the terms of the GNU Lesser General Public | |
| 9 | + * License as published by the Free Software Foundation; either | |
| 10 | + * version 2.1 of the License, or (at your option) any later version. | |
| 11 | + * | |
| 12 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 15 | + * Lesser General Public License for more details. | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU Lesser General Public | |
| 18 | + * License along with FFmpeg; if not, write to the Free Software | |
| 19 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | + */ | |
| 21 | + | |
| 22 | +#include <stdint.h> | |
| 23 | + | |
| 24 | +#include "libavutil/attributes.h" | |
| 25 | +#include "libavutil/cpu.h" | |
| 26 | +#include "libavutil/arm/cpu.h" | |
| 27 | +#include "libavcodec/avcodec.h" | |
| 28 | +#include "libavcodec/idctdsp.h" | |
| 29 | +#include "idctdsp_arm.h" | |
| 30 | + | |
| 31 | +void ff_j_rev_dct_arm(int16_t *data); | |
| 32 | +void ff_simple_idct_arm(int16_t *data); | |
| 33 | + | |
| 34 | +/* XXX: local hack */ | |
| 35 | +static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); | |
| 36 | +static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); | |
| 37 | + | |
| 38 | +void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, | |
| 39 | + int line_size); | |
| 40 | + | |
| 41 | +/* XXX: those functions should be suppressed ASAP when all IDCTs are | |
| 42 | + * converted */ | |
| 43 | +static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) | |
| 44 | +{ | |
| 45 | + ff_j_rev_dct_arm(block); | |
| 46 | + ff_put_pixels_clamped(block, dest, line_size); | |
| 47 | +} | |
| 48 | + | |
| 49 | +static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) | |
| 50 | +{ | |
| 51 | + ff_j_rev_dct_arm(block); | |
| 52 | + ff_add_pixels_clamped(block, dest, line_size); | |
| 53 | +} | |
| 54 | + | |
| 55 | +static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) | |
| 56 | +{ | |
| 57 | + ff_simple_idct_arm(block); | |
| 58 | + ff_put_pixels_clamped(block, dest, line_size); | |
| 59 | +} | |
| 60 | + | |
| 61 | +static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) | |
| 62 | +{ | |
| 63 | + ff_simple_idct_arm(block); | |
| 64 | + ff_add_pixels_clamped(block, dest, line_size); | |
| 65 | +} | |
| 66 | + | |
| 67 | +av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 68 | + unsigned high_bit_depth) | |
| 69 | +{ | |
| 70 | + int cpu_flags = av_get_cpu_flags(); | |
| 71 | + | |
| 72 | + ff_put_pixels_clamped = c->put_pixels_clamped; | |
| 73 | + ff_add_pixels_clamped = c->add_pixels_clamped; | |
| 74 | + | |
| 75 | + if (!avctx->lowres && !high_bit_depth) { | |
| 76 | + if (avctx->idct_algo == FF_IDCT_AUTO || | |
| 77 | + avctx->idct_algo == FF_IDCT_ARM) { | |
| 78 | + c->idct_put = j_rev_dct_arm_put; | |
| 79 | + c->idct_add = j_rev_dct_arm_add; | |
| 80 | + c->idct = ff_j_rev_dct_arm; | |
| 81 | + c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; | |
| 82 | + } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) { | |
| 83 | + c->idct_put = simple_idct_arm_put; | |
| 84 | + c->idct_add = simple_idct_arm_add; | |
| 85 | + c->idct = ff_simple_idct_arm; | |
| 86 | + c->idct_permutation_type = FF_NO_IDCT_PERM; | |
| 87 | + } | |
| 88 | + } | |
| 89 | + | |
| 90 | + c->add_pixels_clamped = ff_add_pixels_clamped_arm; | |
| 91 | + | |
| 92 | + if (have_armv5te(cpu_flags)) | |
| 93 | + ff_idctdsp_init_armv5te(c, avctx, high_bit_depth); | |
| 94 | + if (have_armv6(cpu_flags)) | |
| 95 | + ff_idctdsp_init_armv6(c, avctx, high_bit_depth); | |
| 96 | + if (have_neon(cpu_flags)) | |
| 97 | + ff_idctdsp_init_neon(c, avctx, high_bit_depth); | |
| 98 | +} | |
| @@ -22,14 +22,14 @@ · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | #include "libavutil/attributes.h" |
| 24 | 24 | #include "libavcodec/avcodec.h" |
| 25 | −#include "libavcodec/dsputil.h" | |
| 26 | −#include "dsputil_arm.h" | |
| 25 | +#include "libavcodec/idctdsp.h" | |
| 26 | +#include "idctdsp_arm.h" | |
| 27 | 27 | |
| 28 | 28 | void ff_simple_idct_armv5te(int16_t *data); |
| 29 | 29 | void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data); |
| 30 | 30 | void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data); |
| 31 | 31 | |
| 32 | −av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx, | |
| 32 | +av_cold void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 33 | 33 | unsigned high_bit_depth) |
| 34 | 34 | { |
| 35 | 35 | if (!avctx->lowres && !high_bit_depth && |
| @@ -0,0 +1,48 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2009 Mans Rullgard <mans@mansr.com> | |
| 3 | + * | |
| 4 | + * This file is part of FFmpeg. | |
| 5 | + * | |
| 6 | + * FFmpeg is free software; you can redistribute it and/or | |
| 7 | + * modify it under the terms of the GNU Lesser General Public | |
| 8 | + * License as published by the Free Software Foundation; either | |
| 9 | + * version 2.1 of the License, or (at your option) any later version. | |
| 10 | + * | |
| 11 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | + * Lesser General Public License for more details. | |
| 15 | + * | |
| 16 | + * You should have received a copy of the GNU Lesser General Public | |
| 17 | + * License along with FFmpeg; if not, write to the Free Software | |
| 18 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 19 | + */ | |
| 20 | + | |
| 21 | +#include <stdint.h> | |
| 22 | + | |
| 23 | +#include "libavutil/attributes.h" | |
| 24 | +#include "libavcodec/avcodec.h" | |
| 25 | +#include "libavcodec/idctdsp.h" | |
| 26 | +#include "idctdsp_arm.h" | |
| 27 | + | |
| 28 | +void ff_simple_idct_armv6(int16_t *data); | |
| 29 | +void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); | |
| 30 | +void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); | |
| 31 | + | |
| 32 | +void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels, | |
| 33 | + int line_size); | |
| 34 | + | |
| 35 | +av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 36 | + unsigned high_bit_depth) | |
| 37 | +{ | |
| 38 | + if (!avctx->lowres && !high_bit_depth) { | |
| 39 | + if (avctx->idct_algo == FF_IDCT_AUTO || | |
| 40 | + avctx->idct_algo == FF_IDCT_SIMPLEARMV6) { | |
| 41 | + c->idct_put = ff_simple_idct_put_armv6; | |
| 42 | + c->idct_add = ff_simple_idct_add_armv6; | |
| 43 | + c->idct = ff_simple_idct_armv6; | |
| 44 | + c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; | |
| 45 | + } | |
| 46 | + } | |
| 47 | + c->add_pixels_clamped = ff_add_pixels_clamped_armv6; | |
| 48 | +} | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | − * ARM NEON optimised DSP functions | |
| 2 | + * ARM-NEON-optimized IDCT functions | |
| 3 | 3 | * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> |
| 4 | 4 | * |
| 5 | 5 | * This file is part of FFmpeg. |
| @@ -23,8 +23,8 @@ · 17 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | #include "libavutil/attributes.h" |
| 25 | 25 | #include "libavcodec/avcodec.h" |
| 26 | −#include "libavcodec/dsputil.h" | |
| 27 | −#include "dsputil_arm.h" | |
| 26 | +#include "libavcodec/idctdsp.h" | |
| 27 | +#include "idctdsp_arm.h" | |
| 28 | 28 | |
| 29 | 29 | void ff_simple_idct_neon(int16_t *data); |
| 30 | 30 | 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); · 3 unmodified lines | ||
| 34 | 34 | void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int); |
| 35 | 35 | void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int); |
| 36 | 36 | |
| 37 | −av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx, | |
| 37 | +av_cold void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 38 | 38 | unsigned high_bit_depth) |
| 39 | 39 | { |
| 40 | 40 | if (!avctx->lowres && !high_bit_depth) { |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | − * ARM NEON optimised DSP functions | |
| 2 | + * ARM-NEON-optimized IDCT functions | |
| 3 | 3 | * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> |
| 4 | 4 | * |
| 5 | 5 | * This file is part of FFmpeg. |