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.

71 lines
1.3KB

  1. #!/bin/sh
  2. #
  3. # common regression functions for avconv
  4. #
  5. #
  6. test="${1#regtest-}"
  7. test_ref=$2
  8. raw_src_dir=$3
  9. target_exec=$4
  10. target_path=$5
  11. threads=${6:-1}
  12. cpuflags=${8:-all}
  13. datadir="./tests/data"
  14. target_datadir="${target_path}/${datadir}"
  15. this="$test.$test_ref"
  16. outfile="$datadir/$test_ref/"
  17. # various files
  18. avconv="$target_exec ${target_path}/avconv"
  19. raw_src="${target_path}/$raw_src_dir/%02d.pgm"
  20. raw_dst="$datadir/$this.out.yuv"
  21. pcm_src="$target_datadir/asynth1.sw"
  22. crcfile="$datadir/$this.crc"
  23. target_crcfile="$target_datadir/$this.crc"
  24. cleanfiles="$raw_dst $crcfile"
  25. trap 'rm -f -- $cleanfiles' EXIT
  26. mkdir -p "$datadir"
  27. mkdir -p "$outfile"
  28. [ "${V-0}" -gt 0 ] && echov=echov || echov=:
  29. echov(){
  30. echo "$@" >&3
  31. }
  32. . $(dirname $0)/md5.sh
  33. AVCONV_OPTS="-nostats -y -cpuflags $cpuflags"
  34. COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact"
  35. DEC_OPTS="$COMMON_OPTS -threads $threads"
  36. ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint"
  37. run_avconv()
  38. {
  39. $echov $avconv $AVCONV_OPTS $*
  40. $avconv $AVCONV_OPTS $*
  41. }
  42. do_avconv()
  43. {
  44. f="$1"
  45. shift
  46. set -- $* ${target_path}/$f
  47. run_avconv $*
  48. do_md5sum $f
  49. echo $(wc -c $f)
  50. }
  51. do_avconv_crc()
  52. {
  53. f="$1"
  54. shift
  55. run_avconv $* -f crc "$target_crcfile"
  56. echo "$f $(cat $crcfile)"
  57. }