@LOC("B")\r
private int lastPosition = 0;\r
\r
+\r
+ private long sampleNumber;\r
+\r
+\r
/**\r
* Creates a new <code>Player</code> instance.\r
*/\r
@LOC("THIS,Player.ST") Header h = BitstreamWrapper.readFrame();\r
decoder.init(h);\r
\r
+ sampleNumber = 1;\r
+ System.out.println( "Gobble sentinel: +++" );\r
+\r
@LOC("IN") int count = 0;\r
SSJAVA: while (count++ < 2147483646) {\r
if (h == null) {\r
return 0;\r
}\r
\r
+\r
/**\r
* Decodes a single frame.\r
* \r
// System.out.println(outbuf[i]);\r
sum += outbuf[i];\r
}\r
- System.out.println(sum);\r
+ //System.out.println(sum);\r
//\r
\r
+ int stride = outbuf.length / 100;\r
+ for( int i = 0; i < 100; ++i ) {\r
+ System.out.println( sampleNumber+" "+outbuf[i*stride] );\r
+ sampleNumber++;\r
+ }\r
+\r
+\r
+\r
// synchronized (this)\r
// {\r
// out = audio;\r
PROGRAM=MP3Player
SOURCE_FILES=MP3Player.java
-BSFLAGS= -32bit -ssjava -mainclass $(PROGRAM) -heapsize-mb 1000 -nooptimize -debug -garbagestats -ssjavadebug #-printlinenum #-joptimize
+SSJAVA= -ssjava -ssjavadebug
+BSFLAGS= -32bit -mainclass $(PROGRAM) -heapsize-mb 1000 -nooptimize -debug -garbagestats #-printlinenum #-joptimize
+NORMAL= -ssjava-inject-error 0 0
+INJECT_ERROR= -ssjava-inject-error 1000 12345
+
default: $(PROGRAM)s.bin
+normal: $(PROGRAM)n.bin
+
+error: $(PROGRAM)e.bin
+
+
$(PROGRAM)s.bin: $(SOURCE_FILES) makefile
- $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) -builddir sing $(SOURCE_FILES)
+ $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES)
+
+$(PROGRAM)n.bin: $(SOURCE_FILES) makefile
+ $(BUILDSCRIPT) $(NORMAL) $(BSFLAGS) -o $(PROGRAM)n -builddir norm $(SOURCE_FILES)
+
+$(PROGRAM)e.bin: $(SOURCE_FILES) makefile
+ $(BUILDSCRIPT) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES)
clean:
- rm -f $(PROGRAM).bin
- rm -fr sing
+ rm -f $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin
+ rm -fr ssj norm injerr
rm -f *~
rm -f *.dot
rm -f *.png
--- /dev/null
+#!/bin/bash
+
+X=converterTempFile
+
+# first gobble up any lines of SSJAVA talk
+# then the benchmark's preamble up to the sentinel: +++
+sed -e '/^SSJAVA:/ d' -e '1,/+++/ d' $1 > $X
+
+mv $X $1
--- /dev/null
+plot "normal.txt" with lines, "error.txt" with lines, "nve-diff-ranges.tmp" with steps axes x1y2
--- /dev/null
+#!/bin/bash
+
+D=nve-diff.tmp
+diff normal.txt error.txt > $D
+
+X=nve-diff-ranges.tmp
+echo '0 1' > $X
+echo '0 0' >> $X
+
+#diff normal.txt error.txt | \
+#sed \
+#-e '/^[^0-9]/ d' \
+#-e 's/\(.*\),\(.*\)c.*/\1 0\n\1 1\n\2 1\n\2 0/' \
+#-e 's/\(.*\)c.*/\1 0\n\1 1\n\1 1\n\1 0/' \
+#>> $X
+
+sed \
+-e '/^[^0-9]/ d' \
+-e 's/\(.*\),\(.*\)c.*/\1 0\n\1 1\n\2 1\n\2 0/' \
+-e 's/\(.*\)c.*/\1 0\n\1 1\n\1 1\n\1 0/' \
+$D >> $X
+
+if [[ -s $D ]]
+then
+ echo 'Normal and Error files differ.'
+else
+ echo 'NO DIFF!'
+fi
+
+gnuplot -persist nve.cmds
+
+rm -f $D $X
--- /dev/null
+#!/bin/bash
+MP3Playere.bin focus.mp3 > error.txt
+
+mp3samples2plotData.sh error.txt
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+MP3Playern.bin focus.mp3 > normal.txt
+
+mp3samples2plotData.sh normal.txt
\ No newline at end of file