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.

607 lines
16KB

  1. #!/bin/sh
  2. #
  3. # automatic regression test for ffmpeg
  4. #
  5. #
  6. #set -x
  7. # Even in the 21st century some diffs are not supporting -u.
  8. diff -u $0 $0 > /dev/null 2>&1
  9. if [ $? -eq 0 ]; then
  10. diff_cmd="diff -u"
  11. else
  12. diff_cmd="diff"
  13. fi
  14. diff -w $0 $0 > /dev/null 2>&1
  15. if [ $? -eq 0 ]; then
  16. diff_cmd="$diff_cmd -w"
  17. fi
  18. set -e
  19. datadir="./data"
  20. logfile="$datadir/ffmpeg.regression"
  21. outfile="$datadir/a-"
  22. # tests to do
  23. if [ "$1" = "mpeg4" ] ; then
  24. do_mpeg4=y
  25. elif [ "$1" = "mpeg" ] ; then
  26. do_mpeg=y
  27. do_mpeg2=y
  28. elif [ "$1" = "ac3" ] ; then
  29. do_ac3=y
  30. elif [ "$1" = "libavtest" ] ; then
  31. do_libav=y
  32. logfile="$datadir/libav.regression"
  33. outfile="$datadir/b-"
  34. else
  35. do_mpeg=y
  36. do_mpeg2=y
  37. do_mpeg2thread=y
  38. do_msmpeg4v2=y
  39. do_msmpeg4=y
  40. do_wmv1=y
  41. do_wmv2=y
  42. do_h263=y
  43. do_h263p=y
  44. do_mpeg4=y
  45. do_huffyuv=y
  46. do_mjpeg=y
  47. do_ljpeg=y
  48. do_rv10=y
  49. do_mp2=y
  50. do_ac3=y
  51. do_g726=y
  52. do_adpcm_ima_wav=y
  53. do_adpcm_ms=y
  54. do_rc=y
  55. do_mpeg4adv=y
  56. do_mpeg4thread=y
  57. do_mpeg4nr=y
  58. do_mpeg1b=y
  59. do_asv1=y
  60. do_asv2=y
  61. do_flv=y
  62. do_ffv1=y
  63. do_error=y
  64. fi
  65. # various files
  66. ffmpeg="../ffmpeg_g"
  67. tiny_psnr="./tiny_psnr"
  68. reffile="$2"
  69. benchfile="$datadir/ffmpeg.bench"
  70. raw_src="$3/%d.pgm"
  71. raw_dst="$datadir/out.yuv"
  72. raw_ref="$datadir/ref.yuv"
  73. pcm_src="asynth1.sw"
  74. pcm_dst="$datadir/out.wav"
  75. if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
  76. do_md5sum() { md5sum -b $1; }
  77. elif [ -x /sbin/md5 ]; then
  78. do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
  79. else
  80. do_md5sum() { echo No md5sum program found; }
  81. fi
  82. # create the data directory if it does not exists
  83. mkdir -p $datadir
  84. do_ffmpeg()
  85. {
  86. f="$1"
  87. shift
  88. echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
  89. $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
  90. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration)" /tmp/ffmpeg$$ || true
  91. rm -f /tmp/ffmpeg$$
  92. do_md5sum $f >> $logfile
  93. if [ $f = $raw_dst ] ; then
  94. $tiny_psnr $f $raw_ref >> $logfile
  95. else
  96. wc -c $f >> $logfile
  97. fi
  98. expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
  99. echo `cat $datadir/bench2.tmp` $f >> $benchfile
  100. }
  101. do_ffmpeg_crc()
  102. {
  103. f="$1"
  104. shift
  105. echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
  106. $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
  107. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration)" /tmp/ffmpeg$$ || true
  108. rm -f /tmp/ffmpeg$$
  109. echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
  110. }
  111. do_ffmpeg_nocheck()
  112. {
  113. f="$1"
  114. shift
  115. echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
  116. $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
  117. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration)" /tmp/ffmpeg$$ || true
  118. rm -f /tmp/ffmpeg$$
  119. expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
  120. echo `cat $datadir/bench2.tmp` $f >> $benchfile
  121. }
  122. echo "ffmpeg regression test" > $logfile
  123. echo "ffmpeg benchmarks" > $benchfile
  124. ###################################
  125. # generate reference for quality check
  126. do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
  127. ###################################
  128. if [ -n "$do_mpeg" ] ; then
  129. # mpeg1 encoding
  130. file=${outfile}mpeg1.mpg
  131. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
  132. # mpeg1 decoding
  133. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  134. fi
  135. ###################################
  136. if [ -n "$do_mpeg2" ] ; then
  137. # mpeg2 encoding
  138. file=${outfile}mpeg2.mpg
  139. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
  140. # mpeg2 decoding
  141. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  142. # mpeg2 encoding
  143. file=${outfile}mpeg2.mpg
  144. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct_algo 1 -dct_algo 2 -f mpeg1video $file
  145. # mpeg2 decoding
  146. do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
  147. # mpeg2 encoding interlaced
  148. file=${outfile}mpeg2i.mpg
  149. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file
  150. # mpeg2 decoding
  151. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  152. fi
  153. ###################################
  154. if [ -n "$do_mpeg2thread" ] ; then
  155. # mpeg2 encoding interlaced
  156. file=${outfile}mpeg2thread.mpg
  157. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 2 $file
  158. # mpeg2 decoding
  159. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  160. fi
  161. ###################################
  162. if [ -n "$do_msmpeg4v2" ] ; then
  163. # msmpeg4 encoding
  164. file=${outfile}msmpeg4v2.avi
  165. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
  166. # msmpeg4v2 decoding
  167. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  168. fi
  169. ###################################
  170. if [ -n "$do_msmpeg4" ] ; then
  171. # msmpeg4 encoding
  172. file=${outfile}msmpeg4.avi
  173. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
  174. # msmpeg4 decoding
  175. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  176. fi
  177. ###################################
  178. if [ -n "$do_wmv1" ] ; then
  179. # wmv1 encoding
  180. file=${outfile}wmv1.avi
  181. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
  182. # wmv1 decoding
  183. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  184. fi
  185. ###################################
  186. if [ -n "$do_wmv2" ] ; then
  187. # wmv2 encoding
  188. file=${outfile}wmv2.avi
  189. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
  190. # wmv2 decoding
  191. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  192. fi
  193. ###################################
  194. if [ -n "$do_h263" ] ; then
  195. # h263 encoding
  196. file=${outfile}h263.avi
  197. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
  198. # h263 decoding
  199. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  200. fi
  201. ###################################
  202. if [ -n "$do_h263p" ] ; then
  203. # h263p encoding
  204. file=${outfile}h263p.avi
  205. do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
  206. # h263p decoding
  207. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  208. fi
  209. ###################################
  210. if [ -n "$do_mpeg4" ] ; then
  211. # mpeg4
  212. file=${outfile}odivx.mp4
  213. do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  214. # mpeg4 decoding
  215. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  216. fi
  217. ###################################
  218. if [ -n "$do_huffyuv" ] ; then
  219. # huffyuv
  220. file=${outfile}huffyuv.avi
  221. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec huffyuv -strict -1 $file
  222. # huffyuv decoding
  223. do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
  224. fi
  225. ###################################
  226. if [ -n "$do_rc" ] ; then
  227. # mpeg4 rate control
  228. file=${outfile}mpeg4-rc.avi
  229. do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  230. # mpeg4 rate control decoding
  231. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  232. fi
  233. ###################################
  234. if [ -n "$do_mpeg4adv" ] ; then
  235. # mpeg4
  236. file=${outfile}mpeg4-adv.avi
  237. do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  238. # mpeg4 decoding
  239. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  240. fi
  241. ###################################
  242. if [ -n "$do_mpeg4thread" ] ; then
  243. # mpeg4
  244. file=${outfile}mpeg4-thread.avi
  245. do_ffmpeg $file -y -b 500 -4mv -hq -part -ps 200 -aic -trell -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
  246. # mpeg4 decoding
  247. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  248. fi
  249. ###################################
  250. if [ -n "$do_mpeg4adv" ] ; then
  251. # mpeg4
  252. file=${outfile}mpeg4-Q.avi
  253. do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -qpel -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  254. # mpeg4 decoding
  255. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  256. fi
  257. ###################################
  258. if [ -n "$do_error" ] ; then
  259. # damaged mpeg4
  260. file=${outfile}error-mpeg4-adv.avi
  261. do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -part -ps 250 -error 10 -aic -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  262. # damaged mpeg4 decoding
  263. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  264. fi
  265. ###################################
  266. if [ -n "$do_mpeg4nr" ] ; then
  267. # noise reduction
  268. file=${outfile}mpeg4-nr.avi
  269. do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  270. # mpeg4 decoding
  271. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  272. fi
  273. ###################################
  274. if [ -n "$do_mpeg1b" ] ; then
  275. # mpeg1
  276. file=${outfile}mpeg1b.mpg
  277. do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
  278. # mpeg1 decoding
  279. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  280. fi
  281. ###################################
  282. if [ -n "$do_mjpeg" ] ; then
  283. # mjpeg
  284. file=${outfile}mjpeg.avi
  285. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
  286. # mjpeg decoding
  287. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  288. fi
  289. ###################################
  290. if [ -n "$do_ljpeg" ] ; then
  291. # ljpeg
  292. file=${outfile}ljpeg.avi
  293. do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg $file
  294. # ljpeg decoding
  295. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  296. fi
  297. ###################################
  298. if [ -n "$do_rv10" ] ; then
  299. # rv10 encoding
  300. file=${outfile}rv10.rm
  301. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
  302. # rv10 decoding
  303. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  304. fi
  305. ###################################
  306. if [ -n "$do_asv1" ] ; then
  307. # asv1 encoding
  308. file=${outfile}asv1.avi
  309. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
  310. # asv1 decoding
  311. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  312. fi
  313. ###################################
  314. if [ -n "$do_asv2" ] ; then
  315. # asv2 encoding
  316. file=${outfile}asv2.avi
  317. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
  318. # asv2 decoding
  319. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  320. fi
  321. ###################################
  322. if [ -n "$do_flv" ] ; then
  323. # flv encoding
  324. file=${outfile}flv.flv
  325. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
  326. # flv decoding
  327. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  328. fi
  329. ###################################
  330. if [ -n "$do_ffv1" ] ; then
  331. # ffv1 encoding
  332. file=${outfile}ffv1.avi
  333. do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
  334. # ffv1 decoding
  335. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  336. fi
  337. ###################################
  338. if [ -n "$do_mp2" ] ; then
  339. # mp2 encoding
  340. file=${outfile}mp2.mp2
  341. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
  342. # mp2 decoding
  343. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  344. fi
  345. ###################################
  346. if [ -n "$do_ac3" ] ; then
  347. # ac3 encoding
  348. file=${outfile}ac3.rm
  349. do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
  350. # ac3 decoding
  351. #do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  352. fi
  353. ###################################
  354. if [ -n "$do_g726" ] ; then
  355. # g726 encoding
  356. file=${outfile}g726.wav
  357. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
  358. # g726 decoding
  359. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  360. fi
  361. ###################################
  362. if [ -n "$do_adpcm_ima_wav" ] ; then
  363. # encoding
  364. file=${outfile}adpcm_ima.wav
  365. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
  366. # decoding
  367. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  368. fi
  369. ###################################
  370. if [ -n "$do_adpcm_ms" ] ; then
  371. # encoding
  372. file=${outfile}adpcm_ms.wav
  373. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
  374. # decoding
  375. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  376. fi
  377. ###################################
  378. # libav testing
  379. ###################################
  380. if [ -n "$do_libav" ] ; then
  381. # avi
  382. file=${outfile}libav.avi
  383. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  384. do_ffmpeg_crc $file -i $file
  385. # asf
  386. file=${outfile}libav.asf
  387. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  388. do_ffmpeg_crc $file -i $file
  389. # rm
  390. file=${outfile}libav.rm
  391. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  392. # broken
  393. #do_ffmpeg_crc $file -i $file
  394. # mpegps
  395. file=${outfile}libav.mpg
  396. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  397. do_ffmpeg_crc $file -i $file
  398. # swf (decode audio only)
  399. file=${outfile}libav.swf
  400. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  401. do_ffmpeg_crc $file -i $file
  402. # ffm
  403. file=${outfile}libav.ffm
  404. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  405. do_ffmpeg_crc $file -i $file
  406. # flv
  407. file=${outfile}libav.flv
  408. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
  409. do_ffmpeg_crc $file -i $file
  410. # mov
  411. file=${outfile}libav.mov
  412. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
  413. do_ffmpeg_crc $file -i $file
  414. # nut
  415. file=${outfile}libav.nut
  416. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  417. do_ffmpeg_crc $file -i $file
  418. # XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
  419. ####################
  420. # streamed images
  421. # mjpeg
  422. #file=${outfile}libav.mjpeg
  423. #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  424. #do_ffmpeg_crc $file -i $file
  425. # pbmpipe
  426. file=${outfile}libav.pbm
  427. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
  428. do_ffmpeg_crc $file -f imagepipe -i $file
  429. # pgmpipe
  430. file=${outfile}libav.pgm
  431. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
  432. do_ffmpeg_crc $file -f imagepipe -i $file
  433. # ppmpipe
  434. file=${outfile}libav.ppm
  435. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
  436. do_ffmpeg_crc $file -f imagepipe -i $file
  437. # gif
  438. file=${outfile}libav.gif
  439. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  440. #do_ffmpeg_crc $file -i $file
  441. # yuv4mpeg
  442. file=${outfile}libav.yuv4mpeg
  443. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  444. #do_ffmpeg_crc $file -i $file
  445. ####################
  446. # image formats
  447. # pgm (we do not do md5 on image files yet)
  448. file=${outfile}libav%d.pgm
  449. $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
  450. do_ffmpeg_crc $file -i $file
  451. # ppm (we do not do md5 on image files yet)
  452. file=${outfile}libav%d.ppm
  453. $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
  454. do_ffmpeg_crc $file -i $file
  455. # jpeg (we do not do md5 on image files yet)
  456. #file=${outfile}libav%d.jpg
  457. #$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
  458. #do_ffmpeg_crc $file -i $file
  459. ####################
  460. # audio only
  461. # wav
  462. file=${outfile}libav.wav
  463. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  464. do_ffmpeg_crc $file -i $file
  465. # alaw
  466. file=${outfile}libav.al
  467. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  468. do_ffmpeg_crc $file -i $file
  469. # mulaw
  470. file=${outfile}libav.ul
  471. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  472. do_ffmpeg_crc $file -i $file
  473. # au
  474. file=${outfile}libav.au
  475. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  476. do_ffmpeg_crc $file -i $file
  477. ####################
  478. # pix_fmt conversions
  479. conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
  480. yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
  481. monob pal8"
  482. for pix_fmt in $conversions ; do
  483. file=${outfile}libav-${pix_fmt}.yuv
  484. do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
  485. -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
  486. do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
  487. -f rawvideo -s 352x288 -pix_fmt yuv444p $file
  488. done
  489. fi
  490. if $diff_cmd $logfile $reffile ; then
  491. echo
  492. echo Regression test succeeded.
  493. exit 0
  494. else
  495. echo
  496. echo Regression test: Error.
  497. exit 1
  498. fi