summaryrefslogtreecommitdiffstats
path: root/tests/regression.sh
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2006-12-01 11:29:37 +0000
committerDiego Biurrun <diego@biurrun.de>2006-12-01 11:29:37 +0000
commitfb132953d40cc7fe31f5784f30f71c31ea458c16 (patch)
treeea9e9619bc5f4bf36332f285e16eb5bb1debab7b /tests/regression.sh
parent36aed9e51b895937bc1b5605a8f4351654babfb4 (diff)
downloadffmpeg-streaming-fb132953d40cc7fe31f5784f30f71c31ea458c16.zip
ffmpeg-streaming-fb132953d40cc7fe31f5784f30f71c31ea458c16.tar.gz
Use a function for audio encoding and decoding.
Originally committed as revision 7199 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/regression.sh')
-rwxr-xr-xtests/regression.sh46
1 files changed, 25 insertions, 21 deletions
diff --git a/tests/regression.sh b/tests/regression.sh
index 60e89a0..70f4eba 100755
--- a/tests/regression.sh
+++ b/tests/regression.sh
@@ -165,6 +165,17 @@ do_video_encoding()
do_ffmpeg $file -y $1 -f pgmyuv -i $raw_src $2 $file
}
+do_audio_encoding()
+{
+ file=${outfile}$1
+ do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src $3 $file
+}
+
+do_audio_decoding()
+{
+ do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+}
+
do_libav()
{
file=${outfile}libav.$1
@@ -579,72 +590,65 @@ fi
###################################
if [ -n "$do_mp2" ] ; then
# mp2 encoding
-file=${outfile}mp2.mp2
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
+do_audio_encoding mp2.mp2 "-ar 44100"
# mp2 decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
fi
###################################
if [ -n "$do_ac3" ] ; then
# ac3 encoding
-file=${outfile}ac3.rm
-do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
+do_audio_encoding ac3.rm "" -vn
# ac3 decoding
-#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+#do_audio_decoding
fi
###################################
if [ -n "$do_g726" ] ; then
# g726 encoding
-file=${outfile}g726.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
+do_audio_encoding g726.wav "-ar 44100" "-ab 32 -ac 1 -ar 8000 -acodec g726"
# g726 decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
fi
###################################
if [ -n "$do_adpcm_ima_wav" ] ; then
# encoding
-file=${outfile}adpcm_ima.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
+do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
fi
###################################
if [ -n "$do_adpcm_ms" ] ; then
# encoding
-file=${outfile}adpcm_ms.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
+do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
fi
###################################
if [ -n "$do_adpcm_yam" ] ; then
# encoding
-file=${outfile}adpcm_yam.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
+do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
fi
###################################
if [ -n "$do_flac" ] ; then
# encoding
-file=${outfile}flac.flac
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec flac -compression_level 2 $file
+do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_audio_decoding
fi
###################################
OpenPOWER on IntegriCloud