diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-02 05:12:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-02 05:12:10 +0200 |
commit | cd8cb54990be4fbd23e28f9d7c2c6170d3667692 (patch) | |
tree | 28965f743e1e731b5a7616cbd7b0551c416da327 /libavcodec/arm | |
parent | 06a9da736554197601e4062298fcf45a5e8d49ff (diff) | |
parent | 8e112df409061034202b98fcc6ce2c1c670c0dda (diff) | |
download | ffmpeg-streaming-cd8cb54990be4fbd23e28f9d7c2c6170d3667692.zip ffmpeg-streaming-cd8cb54990be4fbd23e28f9d7c2c6170d3667692.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
ARM: ac3dsp: optimised update_bap_counts()
mpegaudiodec: Fix av_dlog() invocation.
h264/10bit: add HAVE_ALIGNED_STACK checks.
Update 8-bit H.264 IDCT function names to reflect bit-depth.
Add IDCT functions for 10-bit H.264.
mpegaudioenc: Fix broken av_dlog statement.
Employ correct printf format specifiers, mostly in debug output.
ARM: fix MUL64 inline asm for pre-armv6
Conflicts:
libavcodec/mpegaudioenc.c
libavformat/ape.c
libavformat/mxfdec.c
libavformat/r3d.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/arm/ac3dsp_arm.S | 35 | ||||
-rw-r--r-- | libavcodec/arm/ac3dsp_init_arm.c | 4 | ||||
-rw-r--r-- | libavcodec/arm/mathops.h | 14 |
4 files changed, 50 insertions, 4 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index a5a5dfa..a5abfdd 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -1,4 +1,5 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ + arm/ac3dsp_arm.o OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o \ diff --git a/libavcodec/arm/ac3dsp_arm.S b/libavcodec/arm/ac3dsp_arm.S new file mode 100644 index 0000000..545714c --- /dev/null +++ b/libavcodec/arm/ac3dsp_arm.S @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 Mans Rullgard <mans@mansr.com> + * + * This file is part of Libav. + * + * Libav 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. + * + * Libav 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 Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "asm.S" + +function ff_ac3_update_bap_counts_arm, export=1 + push {lr} + ldrb lr, [r1], #1 +1: + lsl r3, lr, #1 + ldrh r12, [r0, r3] + subs r2, r2, #1 + ldrbgt lr, [r1], #1 + add r12, r12, #1 + strh r12, [r0, r3] + bgt 1b + pop {pc} +endfunc diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c index 65790cd..5a9fdf0 100644 --- a/libavcodec/arm/ac3dsp_init_arm.c +++ b/libavcodec/arm/ac3dsp_init_arm.c @@ -35,10 +35,12 @@ void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd, int snr_offset, int floor, const uint8_t *bap_tab, uint8_t *bap); -int ff_ac3_compute_mantissa_size_arm(int cnt[5], uint8_t *bap, int nb_coefs); +void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len); av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact) { + c->update_bap_counts = ff_ac3_update_bap_counts_arm; + if (HAVE_ARMV6) { c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6; } diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h index e889719..2640477 100644 --- a/libavcodec/arm/mathops.h +++ b/libavcodec/arm/mathops.h @@ -41,6 +41,8 @@ static inline av_const int MULL(int a, int b, unsigned shift) } #define MULH MULH +#define MUL64 MUL64 + #if HAVE_ARMV6 static inline av_const int MULH(int a, int b) { @@ -48,6 +50,13 @@ static inline av_const int MULH(int a, int b) __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); return r; } + +static inline av_const int64_t MUL64(int a, int b) +{ + int64_t x; + __asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b)); + return x; +} #else static inline av_const int MULH(int a, int b) { @@ -55,15 +64,14 @@ static inline av_const int MULH(int a, int b) __asm__ ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a)); return hi; } -#endif static inline av_const int64_t MUL64(int a, int b) { int64_t x; - __asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b)); + __asm__ ("smull %Q0, %R0, %1, %2" : "=&r"(x) : "r"(a), "r"(b)); return x; } -#define MUL64 MUL64 +#endif static inline av_const int64_t MAC64(int64_t d, int a, int b) { |