Revision f4855a90

View differences:

libavcodec/ac3dsp.c
109 109
    c->ac3_rshift_int32 = ac3_rshift_int32_c;
110 110
    c->float_to_fixed24 = float_to_fixed24_c;
111 111

  
112
    if (ARCH_ARM)
113
        ff_ac3dsp_init_arm(c, bit_exact);
112 114
    if (HAVE_MMX)
113 115
        ff_ac3dsp_init_x86(c, bit_exact);
114 116
}
libavcodec/ac3dsp.h
84 84
} AC3DSPContext;
85 85

  
86 86
void ff_ac3dsp_init    (AC3DSPContext *c, int bit_exact);
87
void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact);
87 88
void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact);
88 89

  
89 90
#endif /* AVCODEC_AC3DSP_H */
libavcodec/arm/Makefile
1
OBJS-$(CONFIG_AC3DSP)                  += arm/ac3dsp_init_arm.o
1 2
OBJS-$(CONFIG_DCA_DECODER)             += arm/dcadsp_init_arm.o         \
2 3

  
3 4
OBJS-$(CONFIG_VP5_DECODER)             += arm/vp56dsp_init_arm.o
......
46 47

  
47 48
NEON-OBJS-$(CONFIG_H264PRED)           += arm/h264pred_neon.o           \
48 49

  
50
NEON-OBJS-$(CONFIG_AC3DSP)             += arm/ac3dsp_neon.o
51

  
49 52
NEON-OBJS-$(CONFIG_DCA_DECODER)        += arm/dcadsp_neon.o             \
50 53
                                          arm/synth_filter_neon.o       \
51 54

  
libavcodec/arm/ac3dsp_init_arm.c
1
/*
2
 * Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
3
 *
4
 * This file is part of Libav.
5
 *
6
 * Libav 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
 * Libav 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 Libav; 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
#include "libavutil/attributes.h"
23
#include "libavcodec/ac3dsp.h"
24
#include "config.h"
25

  
26
void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
27
int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
28

  
29
av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
30
{
31
    if (HAVE_NEON) {
32
        c->ac3_exponent_min      = ff_ac3_exponent_min_neon;
33
        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
34
    }
35
}
libavcodec/arm/ac3dsp_neon.S
1
/*
2
 * Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
3
 *
4
 * This file is part of Libav.
5
 *
6
 * Libav 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
 * Libav 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 Libav; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 */
20

  
21
#include "asm.S"
22

  
23
function ff_ac3_max_msb_abs_int16_neon, export=1
24
        vmov.i16        q0,  #0
25
        vmov.i16        q2,  #0
26
1:      vld1.16         {q1},     [r0,:128]!
27
        vabs.s16        q1,  q1
28
        vld1.16         {q3},     [r0,:128]!
29
        vabs.s16        q3,  q3
30
        vorr            q0,  q0,  q1
31
        vorr            q2,  q2,  q3
32
        subs            r1,  r1,  #16
33
        bgt             1b
34
        vorr            q0,  q0,  q2
35
        vorr            d0,  d0,  d1
36
        vpmax.u16       d0,  d0,  d0
37
        vpmax.u16       d0,  d0,  d0
38
        vmov.u16        r0,  d0[0]
39
        bx              lr
40
endfunc
41

  
42
function ff_ac3_exponent_min_neon, export=1
43
        cmp             r1,  #0
44
        bxeq            lr
45
        push            {lr}
46
        mov             r12, #256
47
1:
48
        vld1.8          {q0},     [r0,:128]
49
        mov             lr,  r1
50
        add             r3,  r0,  #256
51
2:      vld1.8          {q1},     [r3,:128], r12
52
        subs            lr,  lr,  #1
53
        vmin.u8         q0,  q0,  q1
54
        bgt             2b
55
        subs            r2,  r2,  #16
56
        vst1.8          {q0},     [r0,:128]!
57
        bgt             1b
58
        pop             {pc}
59
endfunc

Also available in: Unified diff