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.

79 lines
2.0KB

  1. #!/bin/sh
  2. #
  3. # automatic regression test for libavfilter
  4. #
  5. #
  6. #set -x
  7. set -e
  8. . $(dirname $0)/regression-funcs.sh
  9. eval do_$test=y
  10. rm -f "$logfile"
  11. rm -f "$benchfile"
  12. get_common_elements() (
  13. l1=$1
  14. l2=$2
  15. for elt1 in $1; do
  16. for elt2 in $2; do
  17. [ $elt1 = $elt2 ] && res="$res $elt1 "
  18. done
  19. done
  20. echo $res
  21. )
  22. do_lavfi() {
  23. test_name=$1
  24. eval test=\$do_$test_name
  25. vfilters="slicify=random,$2"
  26. if [ -n "$test" ] ; then
  27. do_video_encoding ${test_name}.nut "" "-vcodec rawvideo -vf $vfilters"
  28. fi
  29. }
  30. do_lavfi "crop" "crop=100:100"
  31. do_lavfi "crop_scale" "crop=100:100,scale=400:-1"
  32. do_lavfi "crop_scale_vflip" "null,null,crop=200:200,crop=20:20,scale=200:200,scale=250:250,vflip,vflip,null,scale=200:200,crop=100:100,vflip,scale=200:200,null,vflip,crop=100:100,null"
  33. do_lavfi "crop_vflip" "crop=100:100,vflip"
  34. do_lavfi "null" "null"
  35. do_lavfi "scale200" "scale=200:200"
  36. do_lavfi "scale500" "scale=500:500"
  37. do_lavfi "vflip" "vflip"
  38. do_lavfi "vflip_crop" "vflip,crop=100:100"
  39. do_lavfi "vflip_vflip" "vflip,vflip"
  40. # all these filters have exactly one input and exactly one output
  41. filters_args="
  42. crop=100:100:100:100
  43. null
  44. pad=500:400:20:20
  45. scale=200:100
  46. vflip
  47. "
  48. if [ -n "$do_lavfi_pix_fmts" ]; then
  49. scale_out_pix_fmts=$(tools/lavfi-showfiltfmts scale | grep "^OUTPUT" | cut -d: -f2)
  50. for filter_args in $filters_args; do
  51. filter=$(echo $filter_args | sed -e 's/\([^=]\+\)=.*/\1/')
  52. in_pix_fmts=$(tools/lavfi-showfiltfmts $filter | grep "^INPUT" | cut -d: -f2)
  53. pix_fmts=$(get_common_elements "$in_pix_fmts" "$scale_out_pix_fmts")
  54. for pix_fmt in $pix_fmts; do
  55. do_video_encoding "${pix_fmt}-${filter}.nut" "" \
  56. "-vf slicify=random,format=$pix_fmt,$filter_args -vcodec rawvideo -pix_fmt $pix_fmt"
  57. done
  58. done
  59. fi
  60. # TODO: add tests for
  61. # direct rendering,
  62. # chains with feedback loops
  63. rm -f "$bench" "$bench2"