[FFmpeg-devel] [PATCH 2/4] Split lavfi pixfmts test.

Stefano Sabatini stefano.sabatini-lala
Mon Aug 2 01:05:47 CEST 2010


On date Sunday 2010-08-01 21:50:14 +0100, M?ns Rullg?rd encoded:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> 
> > Introduce the function do_lavfi_pixfmts, and use it for generating a
> > test for each different filter.
> > ---
> >  tests/lavfi-regression.sh |   29 ++++++++++++++---------------
> >  1 files changed, 14 insertions(+), 15 deletions(-)
> >
> > diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh
> > index 3f2a5f7..11156f9 100755
> > --- a/tests/lavfi-regression.sh
> > +++ b/tests/lavfi-regression.sh
> > @@ -33,16 +33,11 @@ do_lavfi "vflip"              "vflip"
> >  do_lavfi "vflip_crop"         "vflip,crop=100:100"
> >  do_lavfi "vflip_vflip"        "vflip,vflip"
> >
> > -# all these filters have exactly one input and exactly one output
> > -filters_args="
> > -crop=100:100:100:100
> > -null
> > -pad=500:400:20:20
> > -scale=200:100
> > -vflip
> > -"
> > +do_lavfi_pixfmts() {
> > +if [ $test = pixfmts_${1}_be ] || [ $test = pixfmts_${1}_le ]; then
> 
> test ${test%_[bl]e} = pixfmts_$1 || return 0
> 
> > +    filter=$1
> > +    filter_args=$2
> >
> > -if [ -n "$do_pixfmts_be" ] || [ -n "$do_pixfmts_le" ]; then
> >      showfiltfmts="$target_exec $target_path/tools/lavfi-showfiltfmts"
> >      exclude_fmts=${outfile}exclude_fmts
> >      out_fmts=${outfile}out_fmts
> > @@ -51,20 +46,24 @@ if [ -n "$do_pixfmts_be" ] || [ -n "$do_pixfmts_le" ]; then
> >      $ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^\..\.' | cut -d' ' -f2 | sort >$exclude_fmts
> >      $showfiltfmts scale | awk '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts
> >
> > -    for filter_args in $filters_args; do
> > -        filter=${filter_args%=*}
> >          pix_fmts=$($showfiltfmts $filter | awk '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts)
> > -
> >          for pix_fmt in $pix_fmts; do
> > -            output=pixfmts-${filter}-${pix_fmt}.nut
> > +            output=${test}-${pix_fmt}.nut
> >              do_video_encoding $output "" \
> > -                "-vf slicify=random,format=$pix_fmt,$filter_args -vcodec rawvideo -pix_fmt $pix_fmt"
> > +                "-vf slicify=random,format=$pix_fmt,$filter=$filter_args -vcodec rawvideo -pix_fmt $pix_fmt"
> >              rm ${outfile}${output}
> >          done
> > -    done
> >
> >      rm $exclude_fmts $out_fmts
> >  fi
> 
> The fi goes away with the if above.
> 
> > +}
> 
> Feel free to reindent the 2 lines you didn't change in the same commit
> if you like.  Otherwise, don't forget to do it immediately after.
> 
> > +# all these filters have exactly one input and exactly one output
> > +do_lavfi_pixfmts "crop"    "100:100:100:100"
> > +do_lavfi_pixfmts "null"    ""
> > +do_lavfi_pixfmts "pad"     "500:400:20:20"
> > +do_lavfi_pixfmts "scale"   "200:100"
> > +do_lavfi_pixfmts "vflip"   ""

Fixed, and applied in two steps.
-- 
FFmpeg = Frenzy and Formidable Murdering Puristic Elegant Guide



More information about the ffmpeg-devel mailing list