You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8KB

  1. #!/bin/sh
  2. #
  3. # automatic regression test for libavfilter
  4. #
  5. #
  6. #set -x
  7. #FIXME the whole file should be removed
  8. set -e
  9. . $(dirname $0)/regression-funcs.sh
  10. eval do_$test=y
  11. do_video_filter() {
  12. label=$1
  13. filters="$2"
  14. shift 2
  15. printf '%-20s' $label
  16. run_avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
  17. $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
  18. }
  19. do_lavfi_pixfmts(){
  20. testname=$1;
  21. test ${test%_[bl]e} = $testname || return 0
  22. filter=$2
  23. filter_args=$3
  24. prefilter_chain=$4
  25. showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test"
  26. scale_exclude_fmts=${outfile}${testname}_scale_exclude_fmts
  27. scale_in_fmts=${outfile}${testname}_scale_in_fmts
  28. scale_out_fmts=${outfile}${testname}_scale_out_fmts
  29. in_fmts=${outfile}${testname}_in_fmts
  30. # exclude pixel formats which are not supported as input
  31. $showfiltfmts scale | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_in_fmts
  32. $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_out_fmts
  33. comm -12 $scale_in_fmts $scale_out_fmts >$scale_exclude_fmts
  34. $showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$in_fmts
  35. pix_fmts=$(comm -12 $scale_exclude_fmts $in_fmts)
  36. for pix_fmt in $pix_fmts; do
  37. do_video_filter $pix_fmt "${prefilter_chain}format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
  38. done
  39. rm $in_fmts $scale_in_fmts $scale_out_fmts $scale_exclude_fmts
  40. }
  41. # all these filters have exactly one input and exactly one output
  42. do_lavfi_pixfmts "kerndeint" "kerndeint" "" "tinterlace=interleave_top,"
  43. do_lavfi_pixfmts "tinterlace_merge" "tinterlace" "merge"
  44. do_lavfi_pixfmts "tinterlace_pad" "tinterlace" "pad"
  45. # TODO: add tests for
  46. # direct rendering,
  47. # chains with feedback loops