Dedup them via scripts
authorLauri Kasanen <cand@gmx.com>
Wed, 26 May 2021 08:49:03 +0000 (11:49 +0300)
committerLauri Kasanen <cand@gmx.com>
Wed, 26 May 2021 08:49:03 +0000 (11:49 +0300)
media/Makefile
media/audio/mp3/mp3_0.sh [new file with mode: 0755]
media/audio/mp3/mp3_1.sh [new file with mode: 0755]

index 0e64e1d88abeb58491f62810c42983b72faa72ee..2ef7dcb3a05c894880ab30cfae0e5ba60705b26e 100644 (file)
@@ -13,7 +13,7 @@ VER = $(shell cat data/VERSION)
 SRC = $(wildcard audio/*/*.s video/*/*.s)
 OBJ = $(SRC:.s=.bin)
 
-DUMP = /tmp/out
+export DUMP = /tmp/out
 
 # commented for luke's convenience
 #export SILENCELOG = 1
@@ -37,94 +37,13 @@ wget:
        $(OBJCOPY) $<.elf -I elf64-little -O binary $@
 
 tests: $(OBJ)
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf0:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples0
+       @echo audio/mp3_0
+       for i in `seq 0 1000 9000`; do \
+               audio/mp3/mp3_0.sh $$i \
+       done
 
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf1000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples1000
+       @echo audio/mp3_1
+       for i in `seq 0 23`; do \
+               audio/mp3/mp3_1.sh $$i \
+       done
 
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf2000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples2000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf3000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples3000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf4000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples4000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf5000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples5000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf6000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples6000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf7000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples7000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf8000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples8000
-
-       pypowersim -g audio/mp3/mp3_0.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_0_data/buf9000:0x100000 \
-               -l data/audio/mp3/mp3_0_data/win0:0x200000 \
-               -d $(DUMP):0x400000:128 \
-               -i audio/mp3/mp3_0_apply_window_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_0_data/samples9000
-
-       ##
-
-       pypowersim -g audio/mp3/mp3_1.gpr \
-               -s common.spr \
-               -l data/audio/mp3/mp3_1_data/beforeout0:0x100000 \
-               -l data/audio/mp3/mp3_1_data/buf0:0x200000 \
-               -l data/audio/mp3/mp3_1_data/in0:0x300000 \
-               -l data/audio/mp3/mp3_1_data/win0:0x400000 \
-               -d $(DUMP):0x100000:2304 \
-               -i audio/mp3/mp3_1_imdct36_float.bin
-       cmp $(DUMP) data/audio/mp3/mp3_1_data/out0
diff --git a/media/audio/mp3/mp3_0.sh b/media/audio/mp3/mp3_0.sh
new file mode 100755 (executable)
index 0000000..57aa4bd
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+pypowersim -g audio/mp3/mp3_0.gpr \
+       -s common.spr \
+       -l data/audio/mp3/mp3_0_data/buf${1}:0x100000 \
+       -l data/audio/mp3/mp3_0_data/win0:0x200000 \
+       -d ${DUMP}:0x400000:128 \
+       -i audio/mp3/mp3_0_apply_window_float.bin
+cmp ${DUMP} data/audio/mp3/mp3_0_data/samples${1}
diff --git a/media/audio/mp3/mp3_1.sh b/media/audio/mp3/mp3_1.sh
new file mode 100755 (executable)
index 0000000..0e4ee61
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+
+pypowersim -g audio/mp3/mp3_1.gpr \
+       -s common.spr \
+       -l data/audio/mp3/mp3_1_data/beforeout${1}:0x100000 \
+       -l data/audio/mp3/mp3_1_data/buf${1}:0x200000 \
+       -l data/audio/mp3/mp3_1_data/in${1}:0x300000 \
+       -l data/audio/mp3/mp3_1_data/win${1}:0x400000 \
+       -d ${DUMP}:0x100000:2304 \
+       -i audio/mp3/mp3_1_imdct36_float.bin
+cmp ${DUMP} data/audio/mp3/mp3_1_data/out${1}