.macro SAD_FUNC_DUAL w, h
function x264_pixel_sad_aligned_\w\()x\h\()_neon_dual, export=1
-.if \w == 16
- .set r, \h / 2 - 2
-.else
- .set r, \h / 2 - 1
-.endif
-
SAD_DUAL_START_\w
.rept \h / 2 - \w / 8
SAD_DUAL_\w
vshl.s32 q2, q2, #6
vadd.s32 q1, q8, q8
- mov r3, #416 // ssim_c1= .01*.01*255*255*64
- movw ip, #39355 // ssim_c2= .03*.03*255*255*64*63 - 3<<16
- movt ip, #3
+ mov r3, #416 // ssim_c1 = .01*.01*255*255*64
+ movconst ip, 235963 // ssim_c2 = .03*.03*255*255*64*63
vdup.32 q14, r3
vdup.32 q15, ip
add r4, r4, r3, lsl #8
add r5, r5, r4, lsl #8
add r6, r6, r5, lsl #8
- ldr ip, pb_1
+ ldr ip, =0x01010101
PRED4x4_LOWPASS r1, r2, r3, r4, r5, r6, ip
str r1, [r0, #0*FDEC_STRIDE]
lsl r2, r1, #8
pop {r4-r6,pc}
.endfunc
-pb_1: .word 0x01010101
-
function x264_predict_4x4_ddl_neon, export=1
sub r0, #FDEC_STRIDE
mov ip, #FDEC_STRIDE
cc_check || die "No working C compiler found."
-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" \) ] ; then
+if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" \) ] ; then
pic="yes"
fi
# set flags so neon is built by default
echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-mfloat-abi)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
- if cc_check '' '' 'asm("rev r0, r0");' ; then CFLAGS="$CFLAGS -DHAVE_ARMV6"
+ if cc_check '' '' 'asm("rev ip, ip");' ; then CFLAGS="$CFLAGS -DHAVE_ARMV6"
cc_check '' '' 'asm("movt r0, #0");' && CFLAGS="$CFLAGS -DHAVE_ARMV6T2"
cc_check '' '' 'asm("vadd.i16 q0, q0, q0");' && CFLAGS="$CFLAGS -DHAVE_NEON"
ASFLAGS="$ASFLAGS $CFLAGS -c"
else
- echo "You specified a pre-ARMv6 CPU in your CFLAGS."
+ echo "You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS."
echo "If you really want to run on such a CPU, configure with --disable-asm."
exit 1
fi
if [ "$debug" = "yes" ]; then
CFLAGS="-O1 -g $CFLAGS"
+elif [ $ARCH = ARM ]; then
+ # arm-gcc-4.2 produces incorrect output with -ffast-math
+ # and it doesn't save any speed anyway on 4.4, so disable it
+ CFLAGS="-O4 -fno-fast-math $CFLAGS"
else
CFLAGS="-O4 -ffast-math $CFLAGS"
fi