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_pix_norm1_armv6, export=1 24 push {r4-r6, lr} 25 mov r12, #16 26 mov lr, #0 271: 28 ldm r0, {r2-r5} 29 uxtb16 r6, r2 30 uxtb16 r2, r2, ror #8 31 smlad lr, r6, r6, lr 32 uxtb16 r6, r3 33 smlad lr, r2, r2, lr 34 uxtb16 r3, r3, ror #8 35 smlad lr, r6, r6, lr 36 uxtb16 r6, r4 37 smlad lr, r3, r3, lr 38 uxtb16 r4, r4, ror #8 39 smlad lr, r6, r6, lr 40 uxtb16 r6, r5 41 smlad lr, r4, r4, lr 42 uxtb16 r5, r5, ror #8 43 smlad lr, r6, r6, lr 44 subs r12, r12, #1 45 add r0, r0, r1 46 smlad lr, r5, r5, lr 47 bgt 1b 48 49 mov r0, lr 50 pop {r4-r6, pc} 51endfunc 52 53function ff_pix_sum_armv6, export=1 54 push {r4-r7, lr} 55 mov r12, #16 56 mov r2, #0 57 mov r3, #0 58 mov lr, #0 59 ldr r4, [r0] 601: 61 subs r12, r12, #1 62 ldr r5, [r0, #4] 63 usada8 r2, r4, lr, r2 64 ldr r6, [r0, #8] 65 usada8 r3, r5, lr, r3 66 ldr r7, [r0, #12] 67 usada8 r2, r6, lr, r2 68 beq 2f 69 ldr_pre r4, r0, r1 70 usada8 r3, r7, lr, r3 71 bgt 1b 722: 73 usada8 r3, r7, lr, r3 74 add r0, r2, r3 75 pop {r4-r7, pc} 76endfunc 77