History

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

Michael Niedermayer committed 12 years ago

Commit 581b5f02 parents 909f53f e3fcb1484 files · +1332 −996Browse files

Showing the changes to libavcodec/arm (13 of 84 files). Show all

Unified · Split

13 files
  1. libavcodec/arm/Makefile +13 −10
  2. libavcodec/arm/dsputil_arm.h +0 −4
  3. libavcodec/arm/dsputil_armv6.S +0 −27
  4. libavcodec/arm/dsputil_init_arm.c +0 −60
  5. libavcodec/arm/dsputil_init_armv6.c +0 −18
  6. libavcodec/arm/idctdsp_arm.S +1 −1
  7. libavcodec/arm/idctdsp_arm.h +34 −0
  8. libavcodec/arm/idctdsp_armv6.S +48 −0
  9. libavcodec/arm/idctdsp_init_arm.c +98 −0
  10. libavcodec/arm/idctdsp_init_armv5te.c +3 −3
  11. libavcodec/arm/idctdsp_init_armv6.c +48 −0
  12. libavcodec/arm/idctdsp_init_neon.c +4 −4
  13. libavcodec/arm/idctdsp_neon.S +1 −1
libavcodec/arm/Makefile+13−10
@@ -6,10 +6,7 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ · 5 unmodified lines
6 arm/ac3dsp_arm.o6 arm/ac3dsp_arm.o
7OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o7OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
8OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o8OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
9OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o \9OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o
10 arm/dsputil_arm.o \
11 arm/jrevdct_arm.o \
12 arm/simple_idct_arm.o
13OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \10OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
14 arm/fft_fixed_init_arm.o11 arm/fft_fixed_init_arm.o
15OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o12OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
@@ -18,6 +15,10 @@ OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o · 2 unmodified lines
18OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o15OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
19OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \16OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \
20 arm/hpeldsp_arm.o17 arm/hpeldsp_arm.o
18OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \
19 arm/idctdsp_arm.o \
20 arm/jrevdct_arm.o \
21 arm/simple_idct_arm.o
21OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o22OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o
22OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o23OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
23OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o24OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
@@ -41,7 +42,7 @@ OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o · 17 unmodified lines
41OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \42OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
42 arm/rv40dsp_init_arm.o43 arm/rv40dsp_init_arm.o
43 44
44ARMV5TE-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv5te.o \45ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \
45 arm/simple_idct_armv5te.o46 arm/simple_idct_armv5te.o
46ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \47ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \
47 arm/mpegvideo_armv5te_s.o48 arm/mpegvideo_armv5te_s.o
@@ -52,11 +53,13 @@ ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o · 4 unmodified lines
52 53
53ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o54ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
54ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \55ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \
55 arm/dsputil_armv6.o \56 arm/dsputil_armv6.o
56 arm/simple_idct_armv6.o
57ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o57ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o
58ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \58ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
59 arm/hpeldsp_armv6.o59 arm/hpeldsp_armv6.o
60ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \
61 arm/idctdsp_armv6.o \
62 arm/simple_idct_armv6.o
60ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o63ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
61 64
62ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o65ARMV6-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 arm/int_neon.o89 arm/int_neon.o
87NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \90NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
88 arm/blockdsp_neon.o91 arm/blockdsp_neon.o
89NEON-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_neon.o \
90 arm/dsputil_neon.o \
91 arm/simple_idct_neon.o
92NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \92NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
93 arm/fft_fixed_neon.o93 arm/fft_fixed_neon.o
94NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o94NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
@@ -99,6 +99,9 @@ NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \ · 4 unmodified lines
99 arm/hpeldsp_neon.o99 arm/hpeldsp_neon.o
100NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \100NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \
101 arm/hpeldsp_neon.o101 arm/hpeldsp_neon.o
102NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \
103 arm/idctdsp_neon.o \
104 arm/simple_idct_neon.o
102NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \105NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
103 arm/mdct_fixed_neon.o106 arm/mdct_fixed_neon.o
104NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o107NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
libavcodec/arm/dsputil_arm.h+0−4
@@ -24,11 +24,7 @@ · 23 unmodified lines
24#include "libavcodec/avcodec.h"24#include "libavcodec/avcodec.h"
25#include "libavcodec/dsputil.h"25#include "libavcodec/dsputil.h"
26 26
27void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,
28 unsigned high_bit_depth);
29void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,27void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
30 unsigned high_bit_depth);28 unsigned high_bit_depth);
31void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
32 unsigned high_bit_depth);
33 29
34#endif /* AVCODEC_ARM_DSPUTIL_ARM_H */30#endif /* AVCODEC_ARM_DSPUTIL_ARM_H */
libavcodec/arm/dsputil_armv6.S+0−27
@@ -20,33 +20,6 @@ · 19 unmodified lines
20 20
21#include "libavutil/arm/asm.S"21#include "libavutil/arm/asm.S"
22 22
23function ff_add_pixels_clamped_armv6, export=1
24 push {r4-r8,lr}
25 mov r3, #8
261:
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}
48endfunc
49
50function ff_get_pixels_armv6, export=123function ff_get_pixels_armv6, export=1
51 pld [r1, r2]24 pld [r1, r2]
52 push {r4-r8, lr}25 push {r4-r8, lr}
libavcodec/arm/dsputil_init_arm.c+0−60
@@ -28,71 +28,11 @@ · 27 unmodified lines
28#include "libavcodec/dsputil.h"28#include "libavcodec/dsputil.h"
29#include "dsputil_arm.h"29#include "dsputil_arm.h"
30 30
31void ff_j_rev_dct_arm(int16_t *data);
32void ff_simple_idct_arm(int16_t *data);
33
34/* XXX: local hack */
35static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
36static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
37
38void 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 */
43static 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
49static 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
55static 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
61static 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
67av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,31av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
68 unsigned high_bit_depth)32 unsigned high_bit_depth)
69{33{
70 int cpu_flags = av_get_cpu_flags();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 if (have_armv6(cpu_flags))36 if (have_armv6(cpu_flags))
95 ff_dsputil_init_armv6(c, avctx, high_bit_depth);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}
libavcodec/arm/dsputil_init_armv6.c+0−18
@@ -26,13 +26,6 @@ · 25 unmodified lines
26#include "libavcodec/mpegvideo.h"26#include "libavcodec/mpegvideo.h"
27#include "dsputil_arm.h"27#include "dsputil_arm.h"
28 28
29void ff_simple_idct_armv6(int16_t *data);
30void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
31void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
32
33void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
34 int line_size);
35
36void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);29void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
37void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,30void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
38 const uint8_t *s2, int stride);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
56av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,49av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
57 unsigned high_bit_depth)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 if (!high_bit_depth)52 if (!high_bit_depth)
71 c->get_pixels = ff_get_pixels_armv6;53 c->get_pixels = ff_get_pixels_armv6;
72 c->diff_pixels = ff_diff_pixels_armv6;54 c->diff_pixels = ff_diff_pixels_armv6;
libavcodec/arm/idctdsp_arm.Srenamed from libavcodec/arm/dsputil_arm.S+1−1
@@ -1,5 +1,5 @@
1@1@
2@ ARMv4 optimized DSP utils2@ ARMv4-optimized IDCT functions
3@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>3@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
4@4@
5@ This file is part of FFmpeg.5@ This file is part of FFmpeg.
libavcodec/arm/idctdsp_arm.h+34−0
@@ -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
27void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx,
28 unsigned high_bit_depth);
29void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
30 unsigned high_bit_depth);
31void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
32 unsigned high_bit_depth);
33
34#endif /* AVCODEC_ARM_IDCTDSP_ARM_H */
libavcodec/arm/idctdsp_armv6.S+48−0
@@ -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
23function ff_add_pixels_clamped_armv6, export=1
24 push {r4-r8,lr}
25 mov r3, #8
261:
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}
48endfunc
libavcodec/arm/idctdsp_init_arm.c+98−0
@@ -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
31void ff_j_rev_dct_arm(int16_t *data);
32void ff_simple_idct_arm(int16_t *data);
33
34/* XXX: local hack */
35static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
36static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
37
38void 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 */
43static 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
49static 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
55static 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
61static 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
67av_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}
libavcodec/arm/idctdsp_init_armv5te.crenamed from libavcodec/arm/dsputil_init_armv5te.c+3−3
@@ -22,14 +22,14 @@ · 21 unmodified lines
22 22
23#include "libavutil/attributes.h"23#include "libavutil/attributes.h"
24#include "libavcodec/avcodec.h"24#include "libavcodec/avcodec.h"
25#include "libavcodec/dsputil.h"25#include "libavcodec/idctdsp.h"
26#include "dsputil_arm.h"26#include "idctdsp_arm.h"
27 27
28void ff_simple_idct_armv5te(int16_t *data);28void ff_simple_idct_armv5te(int16_t *data);
29void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);29void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
30void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);30void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
31 31
32av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,32av_cold void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx,
33 unsigned high_bit_depth)33 unsigned high_bit_depth)
34{34{
35 if (!avctx->lowres && !high_bit_depth &&35 if (!avctx->lowres && !high_bit_depth &&
libavcodec/arm/idctdsp_init_armv6.c+48−0
@@ -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
28void ff_simple_idct_armv6(int16_t *data);
29void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
30void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
31
32void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
33 int line_size);
34
35av_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}
libavcodec/arm/idctdsp_init_neon.crenamed from libavcodec/arm/dsputil_init_neon.c+4−4
@@ -1,5 +1,5 @@
1/*1/*
2 * ARM NEON optimised DSP functions2 * ARM-NEON-optimized IDCT functions
3 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>3 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
4 *4 *
5 * This file is part of FFmpeg.5 * This file is part of FFmpeg.
@@ -23,8 +23,8 @@ · 17 unmodified lines
23 23
24#include "libavutil/attributes.h"24#include "libavutil/attributes.h"
25#include "libavcodec/avcodec.h"25#include "libavcodec/avcodec.h"
26#include "libavcodec/dsputil.h"26#include "libavcodec/idctdsp.h"
27#include "dsputil_arm.h"27#include "idctdsp_arm.h"
28 28
29void ff_simple_idct_neon(int16_t *data);29void ff_simple_idct_neon(int16_t *data);
30void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);30void 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
34void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);34void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
35void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);35void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
36 36
37av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,37av_cold void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
38 unsigned high_bit_depth)38 unsigned high_bit_depth)
39{39{
40 if (!avctx->lowres && !high_bit_depth) {40 if (!avctx->lowres && !high_bit_depth) {
libavcodec/arm/idctdsp_neon.Srenamed from libavcodec/arm/dsputil_neon.S+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * ARM NEON optimised DSP functions2 * ARM-NEON-optimized IDCT functions
3 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>3 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
4 *4 *
5 * This file is part of FFmpeg.5 * This file is part of FFmpeg.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t