From 5f74bd31a9bd1ac7655103b11743c12d38e0419f Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 9 Jul 2016 15:30:34 +0200 Subject: [PATCH] vp8/armv6: mc: avoid boolean expression in calculation GNU as evaluates true as '-1' while Apple's variant and llvm's internal assembler evaluate it as '1'. The best way to avoid this madness is to eliminate boolean expressions instead of trying to fix it with preprocessor directives. Use a direct formula to calculate the required temporary space on the stack in ff_put_vp8_{epel,bilin}{4,8,16}_h[246]v[246]_armv6(). Fixes a checkasm segfault in vp8dsp.mc when using llvm's internal assembler for a non-Apple target. --- libavcodec/arm/vp8dsp_armv6.S | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libavcodec/arm/vp8dsp_armv6.S b/libavcodec/arm/vp8dsp_armv6.S index 4e83fe1466..565361e280 100644 --- a/libavcodec/arm/vp8dsp_armv6.S +++ b/libavcodec/arm/vp8dsp_armv6.S @@ -1226,13 +1226,8 @@ vp8_mc_1 bilin, 8, v vp8_mc_1 bilin, 4, h vp8_mc_1 bilin, 4, v -/* True relational expressions have the value -1 in the GNU assembler, - +1 in Apple's. */ -#ifdef __APPLE__ -# define TMPSIZE \size * (8 + 8*(\size > 4) + \ytaps - 1) -#else -# define TMPSIZE \size * (8 - 8*(\size > 4) + \ytaps - 1) -#endif +@ 4 and 8 pixel wide mc blocks might have height of 8 or 16 lines +#define TMPSIZE \size * (16 / ((16 / \size + 1) / 2) + \ytaps - 1) .macro vp8_mc_hv name, size, h, v, ytaps function ff_put_vp8_\name\size\()_\h\v\()_armv6, export=1