[FFmpeg-devel] [PATCH] avcodec/wmalossless: use av_clip_intp2

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Mar 9 22:08:31 CET 2015


On Mon, Mar 09, 2015 at 10:05:03PM +0100, Clément Bœsch wrote:
> On Mon, Mar 09, 2015 at 10:01:20PM +0100, Reimar Döffinger wrote:
> > On Sun, Mar 08, 2015 at 10:32:03PM +0100, Michael Niedermayer wrote:
> > > On Sat, Mar 07, 2015 at 11:44:10PM +0800, zhaoxiu.zeng wrote:
> > > > From 47c997fa0623ab94a7a93b2d2e4cc4fa64c85d5f Mon Sep 17 00:00:00 2001
> > > > From: Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com>
> > > > Date: Sat, 7 Mar 2015 23:26:42 +0800
> > > > Subject: [PATCH 1/1] avcodec/wmalossless: use av_clip_intp2
> > > 
> > > this breaks build on ARM
> > > 
> > > ffmpeg/libavutil/arm/intmath.h:69:5: warning: asm operand 2 probably doesn’t match constraints
> > > ffmpeg/libavutil/arm/intmath.h:69:5: warning: asm operand 2 probably doesn’t match constraints
> > > ffmpeg/libavutil/arm/intmath.h:69:5: error: impossible constraint in ‘asm’
> > > ffmpeg/libavutil/arm/intmath.h:69:5: error: impossible constraint in ‘asm’
> > 
> > ARM uses asm code based on the ssat instruction.
> > That one requires the number of bits to be a constant.
> > This means that for ARM this function may only be used with constant
> > p argument.
> > I guess whether this is ok depends on whether there are other
> > cases/architectures where av_clip_intp2 is actually faster than a
> > normal clip even when p is not constant.
> > The C code doesn't look particularly faster to me in that case,
> > but I haven't tested it.
> 
> maybe we should make use of av_builtin_constant_p()?

Assuming we want av_clip_intp2 to work for non-constant that would be an
option, but note that it will basically break the optimization on non-gcc.
However if we don't I am not so sure what to do about it, or can we
use av_builtin_constant_p to error out compile-time?


More information about the ffmpeg-devel mailing list