2 * Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
4 * This file is part of Libav.
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.
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.
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
21 #include "libavutil/arm/asm.S"
23 function ff_ac3_bit_alloc_calc_bap_armv6, export=1
29 movrelx r4, X(ff_ac3_bin_to_band_tab), r11
30 movrelx lr, X(ff_ac3_band_start_tab)
33 add r1, r1, r2, lsl #1 @ psd + start
34 add r0, r0, r4, lsl #1 @ mask + band
36 add r7, r7, r2 @ bap + start
38 ldrsh r9, [r0], #2 @ mask[band]
40 sub r9, r9, r12 @ - snr_offset
41 ldrb r10, [r4, #1]! @ band_start_tab[++band]
42 subs r9, r9, r5 @ - floor
46 and r9, r9, r8, lsl #1 @ & 0x1fe0
51 add r9, r9, r5 @ + floor => m
61 usat r8, #6, r8, asr #5 @ address
62 usat lr, #6, lr, asr #5
63 ldrb r8, [r6, r8] @ bap_tab[address]
65 strb r8, [r7], #1 @ bap[bin]
73 ldrsh r8, [r1], #2 @ psd[bin]
75 usat r8, #6, r8, asr #5 @ address
76 ldrb r8, [r6, r8] @ bap_tab[address]
77 strb r8, [r7], #1 @ bap[bin]