summaryrefslogtreecommitdiffstats
path: root/combiner
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@civ.zcu.cz>2014-07-02 22:22:38 +0200
committerFrantišek Dvořák <valtri@civ.zcu.cz>2014-07-02 22:22:38 +0200
commit59b0e77bf65c413e87649ca1fbe980fd4c6e86a8 (patch)
tree3215ce8cbb793e2e16288a6aabab4eb06fa17e66 /combiner
downloadcodecs-testing-mingw-59b0e77bf65c413e87649ca1fbe980fd4c6e86a8.tar.gz
codecs-testing-mingw-59b0e77bf65c413e87649ca1fbe980fd4c6e86a8.tar.xz
codecs-testing-mingw-59b0e77bf65c413e87649ca1fbe980fd4c6e86a8.zip
Initial import.
Diffstat (limited to 'combiner')
-rw-r--r--combiner/Combiner.pm91
-rwxr-xr-xcombiner/flac.pl91
-rwxr-xr-xcombiner/speex.pl64
-rwxr-xr-xcombiner/wavpack.pl80
4 files changed, 326 insertions, 0 deletions
diff --git a/combiner/Combiner.pm b/combiner/Combiner.pm
new file mode 100644
index 0000000..bd0ecfb
--- /dev/null
+++ b/combiner/Combiner.pm
@@ -0,0 +1,91 @@
+package Combiner;
+
+use strict;
+use warnings;
+use Exporter;
+
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(nop init_w32 init_w64 combiner combiners);
+our @EXPORT = qw(nop init_w32 init_w64 combiner combiners);
+
+
+sub nop() {
+}
+
+
+sub init_w32() {
+ print "export WINEPREFIX=\$HOME/.wine32\n";
+}
+
+
+sub init_w64() {
+ print "export WINEPREFIX=\$HOME/.wine64\n";
+}
+
+
+sub combiner($$) {
+ my ($callback, $comb) = @_;
+ my (@s, @n, $i, @comb, @single);
+ my ($j, $opts, $name, $overflow, $opname);
+
+ @comb = @$comb;
+
+ # initial state
+ foreach $i (0..$#comb) {
+ @single = @{$comb[$i]};
+ $s[$i] = 0;
+ $n[$i] = $#single;
+ }
+
+ $overflow = 0;
+ while (!$overflow) {
+ # actual combination of arguments in @s
+ $opts = "";
+ $name = "";
+ foreach $i (0..$#comb) {
+ $opts .= " " if ($opts and $comb[$i][$s[$i]]);
+ $opts .= $comb[$i][$s[$i]];
+
+ $opname = $comb[$i][$s[$i]];
+ $opname =~ s/^-*//;
+ $opname =~ s/ //g;
+ $name .= "-" if ($name and $opname);
+ $name .= $opname;
+ }
+ $callback->($name ? $name : 'default', $opts);
+
+ # next combination
+ $overflow = 1;
+ $i = 0;
+ while ($overflow and ($i <= $#comb)) {
+ $s[$i]++;
+ if ($s[$i] <= $n[$i]) {
+ $overflow = 0;
+ } else {
+ $s[$i] = 0;
+ $i++;
+ }
+ }
+ }
+}
+
+
+sub combiners($$$) {
+ my ($inits, $callbacks, $combs) = @_;
+ my ($i, $j, @inits, @combs, @callbacks);
+ @inits = @$inits;
+ @combs = @$combs;
+ @callbacks = @$callbacks;
+
+ foreach $j (0..$#callbacks) {
+ print "date\n";
+ $inits[$j]->();
+ foreach $i (0..$#combs) {
+ combiner($callbacks[$j], \@{$combs[$i]});
+ }
+ print "\n";
+ }
+}
+
+
+1;
diff --git a/combiner/flac.pl b/combiner/flac.pl
new file mode 100755
index 0000000..6d37b25
--- /dev/null
+++ b/combiner/flac.pl
@@ -0,0 +1,91 @@
+#! /usr/bin/perl -w
+
+use strict;
+use warnings;
+our @EXPORT_OK = qw(combiner);
+use Combiner;
+
+my $w32 = '/usr/i686-w64-mingw32/sys-root/mingw/bin/';
+my $w64 = '/usr/x86_64-w64-mingw32/sys-root/mingw/bin/';
+
+my ($cmd, $dir);
+
+my @combs = (
+ [
+ ["--fast", "--compression-level-5", ""],
+ ["--lax", ""]
+ ],
+ [
+ ["", "--compression-level-8"],
+ ["--qlp-coeff-precision-search"]
+ ],
+ [
+ ["--compression-level-1", "--compression-level-2", "--compression-level-3", "--compression-level-4", "--compression-level-6", "--compression-level-7", "--compression-level-8"],
+ ],
+ [
+ ["-l 0 -b 1152 -r 3", "-b 1152 -r 3", "-l 0 -r 3", "-l 0 -b 1152", "-l 0", "-b 1152", "-r 3"],
+ ],
+ [
+ ["-l 1", "-l 2"]
+ ]
+ );
+
+my @inits = (\&nop, \&init_w32, \&init_w64);
+
+my @callbacks = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "flac $opts -o linux/$name.flac 1.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w32}flac.exe $opts -o win32/$name.flac 1.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}flac.exe $opts -o win64/$name.flac 1.wav\n";
+ }
+);
+
+my @callbacks_dec = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "flac -d -o linux/$name.wav linux/$name.flac\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w32}flac.exe -d -o win32/$name.wav win32/$name.flac\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}flac.exe -d -o win64/$name.wav win64/$name.flac\n";
+ },
+# sub($$) {
+# my ($name, $opts) = @_;
+#
+# print "${w32}flac.exe -d -o linux-win32/$name.wav linux/$name.flac\n";
+# },
+# sub($$) {
+# my ($name, $opts) = @_;
+#
+# print "${w64}flac.exe -d -o linux-win64/$name.wav linux/$name.flac\n";
+# }
+);
+
+
+print qq[#! /bin/sh -ex
+rm -rf linux win32 win64 linux-win32 linux-win64
+mkdir linux win32 win64
+# linux-win32 linux-win64
+
+];
+
+combiners(\@inits, \@callbacks, \@combs);
+
+combiners(\@inits, \@callbacks_dec, \@combs);
diff --git a/combiner/speex.pl b/combiner/speex.pl
new file mode 100755
index 0000000..90fba80
--- /dev/null
+++ b/combiner/speex.pl
@@ -0,0 +1,64 @@
+#! /usr/bin/perl -w
+
+use strict;
+use warnings;
+use Combiner;
+
+my $w32 = '/usr/i686-w64-mingw32/sys-root/mingw/bin/';
+my $w64 = '/usr/x86_64-w64-mingw32/sys-root/mingw/bin/';
+
+my ($cmd, $dir);
+
+my @combs = (
+ [
+ ["--narrowband", "--wideband", "--ultra-wideband"],
+ ], [
+ ["--quality 0", "--quality 5", "--quality 10", ""],
+ ["--vbr", ""],
+ ["--comp 0", "--comp 10", ""]
+ ]
+);
+
+my @inits = (\&nop, \&init_w64);
+my @callbacks = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "speexenc $opts 1.wav linux/$name.spx\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}speexenc.exe $opts 1.wav win64/$name.spx\n";
+ }
+);
+
+my @inits_dec = (\&nop, \&init_w64, \&init_w64);
+my @callbacks_dec = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "speexdec linux/$name.spx linux/$name.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}speexdec.exe win64/$name.spx win64/$name.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}speexdec.exe linux/$name.spx linux-win64/$name.wav\n";
+ }
+);
+
+
+print qq[#! /bin/sh -ex
+rm -rf linux win32 win64 linux-win32 linux-win64
+mkdir linux win64 linux-win64
+
+];
+
+combiners(\@inits, \@callbacks, \@combs);
+
+combiners(\@inits_dec, \@callbacks_dec, \@combs);
diff --git a/combiner/wavpack.pl b/combiner/wavpack.pl
new file mode 100755
index 0000000..54ae49d
--- /dev/null
+++ b/combiner/wavpack.pl
@@ -0,0 +1,80 @@
+#! /usr/bin/perl -w
+
+use strict;
+use warnings;
+use Combiner;
+
+my $w32 = '/usr/i686-w64-mingw32/sys-root/mingw/bin/';
+my $w64 = '/usr/x86_64-w64-mingw32/sys-root/mingw/bin/';
+
+my ($cmd, $dir);
+
+my @combs = (
+ [
+ ["-f", "-h", ""],
+ ],
+ [
+ ["-b24", "-b4812", "-b9600"],
+ ["-c"],
+ ["-cc", ""],
+ ["-f", "-h", ""],
+ ],
+ [
+ ["-b2418"],
+ ["-c"],
+ ["-p", ""],
+ ["--use-dns", ""],
+ ],
+ [
+ ["-x2", "-x4", "-x6"],
+ ]
+ );
+
+my @inits = (\&nop, \&init_w32, \&init_w64);
+
+my @callbacks = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "wavpack $opts 1.wav -o linux/$name.wv\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w32}wavpack.exe $opts 1.wav -o win32/$name.wv\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}wavpack.exe $opts 1.wav -o win64/$name.wv\n";
+ }
+);
+
+my @callbacks_dec = (
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "wvunpack linux/$name.wv -o linux/$name.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w32}wvunpack.exe win32/$name.wv -o win32/$name.wav\n";
+ },
+ sub($$) {
+ my ($name, $opts) = @_;
+
+ print "${w64}wvunpack.exe win64/$name.wv -o win64/$name.wav\n";
+ },
+);
+
+
+print qq[#! /bin/sh -ex
+rm -rf linux win32 win64
+mkdir linux win32 win64
+
+];
+
+combiners(\@inits, \@callbacks, \@combs);
+
+combiners(\@inits, \@callbacks_dec, \@combs);