[FFmpeg-devel] [PATCH] lavfi test for 1-1 filters pixel format output

Stefano Sabatini stefano.sabatini-lala
Wed Jul 28 22:38:59 CEST 2010


On date Sunday 2010-06-20 21:21:37 +0100, M?ns Rullg?rd encoded:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
[...]
> > Patch updated, don't know if this is the correct solution, anyway it
> > works for me. It still misses the BE tests, I don't have such a
> > machine so I need either someone to try them either an an account on
> > such a machine.
> 
> You can have a login on my PPC if you like.  Send me an ssh key and
> desired username.
> 
> > I'm still waiting for a useful reply from Mans, what's sure is that
> > I'm not going to wait forever (note that this thread started in
> > March).
> 
> I already told you to fix it for non-cross builds.  I'll do the rest
> once it works locally.
> 
> > diff --git a/Makefile b/Makefile
> > index 4b945f4..67a7a02 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -14,7 +14,7 @@ PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
> >  OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
> >  MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
> >  TOOLS       = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
> > -HOSTPROGS   = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
> > +HOSTPROGS   = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr lavfi-showfiltfmts)
> 
> This can never work.  lavfi-showfiltfmts has to link against lavfi,
> which is built for the target, not the host.

Do you have an idea how this can be fixed? I suppose we could set
statically the information otherwise dynamically obtained by
lavfi-showfiltfmts (also in this case we would have a BE and LE
variant).
 
> >  $(HOSTOBJS): %.o: %.c
> > -	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
> > +	$(HOSTCC) $(CPPFLAGS) $(HOSTCFLAGS) -c -o $@ $<
> 
> Using CPPFLAGS with HOSTCC is a very bad idea.
> 
> >  $(HOSTPROGS): %$(HOSTEXESUF): %.o
> > -	$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
> > +	$(HOSTCC) $(FF_LDFLAGS) $(HOSTLDFLAGS) -o $@ $< $(FF_EXTRALIBS) $(HOSTLIBS)
> 
> Likewise for LDFLAGS.
> 
> >  depend dep: $(DEPS)
> > diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh
> > index ebbc0f3..8dc92b0 100755
> > --- a/tests/lavfi-regression.sh
> > +++ b/tests/lavfi-regression.sh
> > @@ -67,20 +67,26 @@ scale=200:100
> >  vflip
> >  "
> >  
> > +showfiltfmts="$target_exec ${target_path}/tests/lavfi-showfiltfmts"
> 
> Now you're trying to run a host executable on the target.  This
> command is probably correct if you remove the brokenness above.
> 
> >  if [ -n "$do_lavfi_pix_fmts" ]; then
> >      # exclude pixel formats which are not supported as input
> >      excluded_pix_fmts="$(ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^\..\.' | cut -d' ' -f2)"
> >  
> > -    scale_out_pix_fmts=$(tools/lavfi-showfiltfmts scale | grep "^OUTPUT" | cut -d: -f2)
> > +    scale_out_pix_fmts=$($showfiltfmts scale | grep "^OUTPUT" | cut -d: -f2)
> >      scale_out_pix_fmts=$(get_exclusive_elements "$scale_out_pix_fmts" "$excluded_pix_fmts")
> >  
> > +    ref_file=tests/ref/lavfi/lavfi_pix_fmts
> > +    rm -f $ref_file
> 
> This looks unrelated to cross-builds.
> 
> >      for filter_args in $filters_args; do
> >          filter=$(echo $filter_args | sed -e 's/\([^=]\+\)=.*/\1/')
> > -        in_pix_fmts=$(tools/lavfi-showfiltfmts $filter | grep "^INPUT" | cut -d: -f2)
> > +        in_pix_fmts=$($showfiltfmts $filter | grep "^INPUT" | cut -d: -f2)
> >          pix_fmts=$(get_common_elements "$in_pix_fmts" "$scale_out_pix_fmts")
> >  
> >          for pix_fmt in $pix_fmts; do
> > -            do_video_encoding "${pix_fmt}-${filter}.nut" "" \
> > +            cat $ref_file-${filter}-$pix_fmt >> $ref_file
> > +            do_video_encoding "lavfi_pix_fmts-${filter}-${pix_fmt}.nut" "" \
> 
> Ditto.
> 
> >                  "-vf slicify=random,format=$pix_fmt,$filter_args -vcodec rawvideo -pix_fmt $pix_fmt"
> >          done
> >      done
> > diff --git a/tools/lavfi-showfiltfmts.c b/tests/lavfi-showfiltfmts.c
> > similarity index 100%
> > rename from tools/lavfi-showfiltfmts.c
> > rename to tests/lavfi-showfiltfmts.c
> 
> Why?
> 
> > diff --git a/tests/ref/lavfi/lavfi_pix_fmts-crop-abgr b/tests/ref/lavfi/lavfi_pix_fmts-crop-abgr
> > new file mode 100644
> > index 0000000..ec6fc9a
> 
> Adding the ref files surely has nothing to do with cross-builds.
> 
> Now _PLEASE_ commit the non-cross bits as I've asked you repeatedly
> and stop trying to claim I'm holding you back.

Updated patch with the result of the BE tests, note that this needs to
be validated, also I'm quite sure there are some scaling errors for
argb/bgra/rgba/abgr/yuva420p as the result differs on BE/LE (see the
diff between the BE and LE tests).

I visually validated the output files on LE (they are 139 files), the
same should be done on BE, help is very welcome. What I just did is:
for f in (ls tests/ref/lavfi/pixfmts*); do ffplay $f; done

Also I'm considering to just commit the LE test, as I'm not willing to
fix all the libswscale bugs (especially for platforms which I never
use/access).

Regards.
-- 
FFmpeg = Funny and Formidable Meaningful Perennial Experimenting Ghost



More information about the ffmpeg-devel mailing list