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.

68 lines
1.2KB

  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. [ "${V-0}" -gt 0 ] && echov=echov || echov=:
  27. echov(){
  28. echo "$@" >&3
  29. }
  30. . $(dirname $0)/md5.sh
  31. AVCONV_OPTS="-nostats -y -cpuflags $cpuflags"
  32. COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact"
  33. DEC_OPTS="$COMMON_OPTS -threads $threads"
  34. ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint"
  35. run_avconv()
  36. {
  37. $echov $avconv $AVCONV_OPTS $*
  38. $avconv $AVCONV_OPTS $*
  39. }
  40. do_avconv()
  41. {
  42. f="$1"
  43. shift
  44. set -- $* ${target_path}/$f
  45. run_avconv $*
  46. do_md5sum $f
  47. echo $(wc -c $f)
  48. }
  49. do_avconv_crc()
  50. {
  51. f="$1"
  52. shift
  53. run_avconv $* -f crc "$target_crcfile"
  54. echo "$f $(cat $crcfile)"
  55. }