From d3eda72f7c07206652052205cfb5a1577578976f Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 28 Oct 2011 00:31:49 +0000 Subject: [PATCH] looks like the output is Left and Right channels interleaved, only sample one for pretty graphs --- .../Benchmarks/SSJava/MP3Decoder/Player.java | 23 +++++-------------- .../src/Benchmarks/SSJava/MP3Decoder/makefile | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Robust/src/Benchmarks/SSJava/MP3Decoder/Player.java b/Robust/src/Benchmarks/SSJava/MP3Decoder/Player.java index b713ca1d..a19768ec 100644 --- a/Robust/src/Benchmarks/SSJava/MP3Decoder/Player.java +++ b/Robust/src/Benchmarks/SSJava/MP3Decoder/Player.java @@ -208,24 +208,13 @@ public class Player { // @LOC("O") SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h); decoder.decodeFrame(h); - // eom debug - @LOC("C") int sum = 0; - @LOC("C") short[] outbuf = SampleBufferWrapper.getBuffer(); - // short[] outbuf = output.getBuffer(); - TERMINATE: for (@LOC("C") int i = 0; i < SampleBufferWrapper.getBufferLength(); i++) { - // System.out.println(outbuf[i]); - sum += outbuf[i]; + // it looks like there is left and right channel interleaved into the + // output buffer, so only sample one channel (stride=2) + short[] outbuf = SampleBufferWrapper.getBuffer(); + TERMINATE: for (@LOC("C") int i = 0; i < SampleBufferWrapper.getBufferLength(); i = i + 2) { + System.out.println( sampleNumber+" "+outbuf[i] ); + sampleNumber++; } - //System.out.println(sum); - // - - //int stride = outbuf.length / 100; - //for( int i = 0; i < 100; ++i ) { - // System.out.println( sampleNumber+" "+outbuf[i*stride] ); - // sampleNumber++; - //} - System.out.println( sampleNumber+" "+sum ); - sampleNumber++; diff --git a/Robust/src/Benchmarks/SSJava/MP3Decoder/makefile b/Robust/src/Benchmarks/SSJava/MP3Decoder/makefile index 989f86d1..83adb837 100644 --- a/Robust/src/Benchmarks/SSJava/MP3Decoder/makefile +++ b/Robust/src/Benchmarks/SSJava/MP3Decoder/makefile @@ -1,7 +1,7 @@ BUILDSCRIPT=../../../buildscript PROGRAM=MP3Player -SOURCE_FILES=MP3Player.java +SOURCE_FILES=MP3Player.java Player.java ifndef INV_ERROR_PROB INV_ERROR_PROB=1000 -- 2.34.1